← All problems
Problem 353
Sum M(2^n-1) for n=1..15, risk of shortest paths on lattice sphere.
View problem on Project Euler
Performance comparison
Metric Our solution Best known
Time complexity O(n^4)O(n^2)
Space complexity O(n^2)O(n^2)
Approach Flow solution Combinatorial or DP counting
Verdict Suboptimal
Flow source
# Project Euler 353
# Sum M(2^n-1) for n=1..15, risk of shortest paths on lattice sphere.
import euler.nt { isqrt }
extern {
function calloc(n: i64, size: i64) -> ptr<void>
function free(p: ptr<void>) -> void
function realloc(p: ptr<void>, size: i64) -> ptr<void>
function acos(x: f64) -> f64
function fabs(x: f64) -> f64
}
function abs64(x: i64) -> i64 {
if x < 0 { return 0 - x }
return x
}
function hget(keys: ptr<i64>, vals: ptr<i64>, used: ptr<i8>, cap: i64, key: i64) -> i64 {
let mut slot: i64 = key
if slot < 0 { slot = 0 - slot }
slot = slot & (cap - 1)
while used[slot] != 0 {
if keys[slot] == key { return vals[slot] }
slot = (slot + 1) & (cap - 1)
}
return 0 - 1
}
function hput(keys: ptr<i64>, vals: ptr<i64>, used: ptr<i8>, cap: i64, key: i64, val: i64) -> void {
let mut slot: i64 = key
if slot < 0 { slot = 0 - slot }
slot = slot & (cap - 1)
while used[slot] != 0 && keys[slot] != key {
slot = (slot + 1) & (cap - 1)
}
used[slot] = 1
keys[slot] = key
vals[slot] = val
}
function pack3(a: i64, b: i64, c: i64) -> i64 {
# pack three signed 20-bit-ish coords into i64 (offset)
let o: i64 = 200000
return ((a + o) << 40) | ((b + o) << 20) | (c + o)
}
function cellhash(cx: i64, cy: i64, cz: i64, cap: i64) -> i64 {
# mix all three coords into low bits so cells do not collide by z-slice
let h: i64 = (cx + 200000) * 2654435761 + (cy + 200000) * 40503 + (cz + 200000) * 65599
let mut s: i64 = h
if s < 0 { s = 0 - s }
return s & (cap - 1)
}
function choose_L(r: i64) -> i64 {
if r <= 512 { return 2 * r }
if r < 8191 { return 256 }
return 512
}
function main() -> i32 {
let max_r: i64 = (1 << 15) - 1
let max_lim: i64 = 2 * max_r
let spf: ptr<i32> = calloc(max_lim + 1, 4)
let mut i: i64 = 0
while i <= max_lim {
spf[i] = i as i32
i = i + 1
}
if max_lim >= 1 { spf[1] = 1 }
let lim: i64 = isqrt(max_lim)
i = 2
while i <= lim {
if (spf[i] as i64) == i {
let mut j: i64 = i * i
while j <= max_lim {
if (spf[j] as i64) == j { spf[j] = i as i32 }
j = j + i
}
}
i = i + 1
}
# prime_rep open addressing: key=p, val=(a<<32)|b
let RCAP: i64 = 1 << 17
let rkeys: ptr<i64> = calloc(RCAP, 8)
let rvals: ptr<i64> = calloc(RCAP, 8)
let rused: ptr<i8> = calloc(RCAP, 1)
i = 2
while i <= max_lim {
if (spf[i] as i64) == i && (i & 3) == 1 {
let root: i64 = isqrt(i)
let mut a: i64 = 0 - 1
let mut b: i64 = 0
let mut x: i64 = 1
while x <= root {
let y2: i64 = i - x * x
let y: i64 = isqrt(y2)
if y * y == y2 {
a = x
b = y
break
}
x = x + 1
}
if a < b {
let t: i64 = a
a = b
b = t
}
hput(rkeys, rvals, rused, RCAP, i, (a << 32) | b)
}
i = i + 1
}
let PI: f64 = 3.14159265358979323846
let mut total: f64 = 0.0
let mut nbit: i64 = 1
while nbit <= 15 {
let r: i64 = (1 << nbit) - 1
let L: i64 = choose_L(r)
let r2: i64 = r * r
# Generate points with z>=0
let CAP_P: i64 = 400000
let xs: ptr<i32> = calloc(CAP_P, 4)
let ys: ptr<i32> = calloc(CAP_P, 4)
let zs: ptr<i32> = calloc(CAP_P, 4)
let mut np: i64 = 0
let mut start: i64 = 0 - 1
let mut z: i64 = 0
while z <= r {
let s: i64 = r2 - z * z
if s == 0 {
xs[np] = 0
ys[np] = 0
zs[np] = z as i32
if z == r { start = np }
np = np + 1
} else {
let aa: i64 = r - z
let bb: i64 = r + z
# factor aa*bb into map of primes
let FCAP: i64 = 64
let fp: ptr<i64> = calloc(FCAP, 8)
let fe: ptr<i64> = calloc(FCAP, 8)
let mut fc: i64 = 0
let mut xx: i64 = aa
while xx > 1 {
let p: i64 = spf[xx] as i64
let mut e: i64 = 0
while xx % p == 0 {
xx = xx / p
e = e + 1
}
let mut found: i64 = 0 - 1
let mut t: i64 = 0
while t < fc {
if fp[t] == p { found = t; break }
t = t + 1
}
if found >= 0 {
fe[found] = fe[found] + e
} else {
fp[fc] = p
fe[fc] = e
fc = fc + 1
}
}
xx = bb
while xx > 1 {
let p: i64 = spf[xx] as i64
let mut e: i64 = 0
while xx % p == 0 {
xx = xx / p
e = e + 1
}
let mut found: i64 = 0 - 1
let mut t: i64 = 0
while t < fc {
if fp[t] == p { found = t; break }
t = t + 1
}
if found >= 0 {
fe[found] = fe[found] + e
} else {
fp[fc] = p
fe[fc] = e
fc = fc + 1
}
}
# sumsq pairs from factors
let mut scalar: i64 = 1
let mut e2: i64 = 0
let mut odd2: i64 = 0
let mut ti: i64 = 0
while ti < fc {
if fp[ti] == 2 {
e2 = fe[ti]
scalar = scalar << (e2 / 2)
odd2 = e2 & 1
}
ti = ti + 1
}
# reps list
let RMAX: i64 = 1024
let rx: ptr<i64> = calloc(RMAX, 8)
let ry: ptr<i64> = calloc(RMAX, 8)
let mut rc: i64 = 1
rx[0] = 1
ry[0] = 0
let mut ok: i64 = 1
ti = 0
while ti < fc {
let p: i64 = fp[ti]
let e: i64 = fe[ti]
if p == 2 {
ti = ti + 1
continue
}
if (p & 3) == 3 {
if (e & 1) == 1 {
ok = 0
break
}
let mut t: i64 = 0
while t < e / 2 {
scalar = scalar * p
t = t + 1
}
ti = ti + 1
continue
}
# p ≡ 1 mod 4
let repv: i64 = hget(rkeys, rvals, rused, RCAP, p)
let pa: i64 = repv >> 32
let pb: i64 = repv & 4294967295
# powers of gp and gpc
let powx: ptr<i64> = calloc(e + 2, 8)
let powy: ptr<i64> = calloc(e + 2, 8)
let powcx: ptr<i64> = calloc(e + 2, 8)
let powcy: ptr<i64> = calloc(e + 2, 8)
powx[0] = 1; powy[0] = 0
powcx[0] = 1; powcy[0] = 0
let mut k: i64 = 0
while k < e {
# gauss_mul with (pa,pb) and (pa,-pb)
powx[k + 1] = powx[k] * pa - powy[k] * pb
powy[k + 1] = powx[k] * pb + powy[k] * pa
powcx[k + 1] = powcx[k] * pa - powcy[k] * (0 - pb)
powcy[k + 1] = powcx[k] * (0 - pb) + powcy[k] * pa
k = k + 1
}
let nrx: ptr<i64> = calloc(RMAX, 8)
let nry: ptr<i64> = calloc(RMAX, 8)
let mut nrc: i64 = 0
let mut ri: i64 = 0
while ri < rc {
k = 0
while k <= e {
let x1: i64 = powx[k]
let y1: i64 = powy[k]
let x2: i64 = powcx[e - k]
let y2: i64 = powcy[e - k]
# gauss_mul (rx,ry)*(tx,ty) then * (x1,y1)*(x2,y2)
let tx: i64 = x1 * x2 - y1 * y2
let ty: i64 = x1 * y2 + y1 * x2
nrx[nrc] = rx[ri] * tx - ry[ri] * ty
nry[nrc] = rx[ri] * ty + ry[ri] * tx
nrc = nrc + 1
k = k + 1
}
ri = ri + 1
}
rc = nrc
ri = 0
while ri < rc {
rx[ri] = nrx[ri]
ry[ri] = nry[ri]
ri = ri + 1
}
free(nry); free(nrx); free(powcy); free(powcx); free(powy); free(powx)
ti = ti + 1
}
if ok == 1 {
if odd2 == 1 {
let mut ri: i64 = 0
while ri < rc {
let x: i64 = rx[ri]
let y: i64 = ry[ri]
rx[ri] = x - y
ry[ri] = x + y
ri = ri + 1
}
}
if scalar != 1 {
let mut ri: i64 = 0
while ri < rc {
rx[ri] = rx[ri] * scalar
ry[ri] = ry[ri] * scalar
ri = ri + 1
}
}
# unique canonical pairs
let UCAP: i64 = 1 << 10
let uk: ptr<i64> = calloc(UCAP, 8)
let uu: ptr<i8> = calloc(UCAP, 1)
let mut ri: i64 = 0
while ri < rc {
let mut a: i64 = abs64(rx[ri])
let mut b: i64 = abs64(ry[ri])
if a < b {
let t: i64 = a
a = b
b = t
}
let key: i64 = (a << 32) | b
let mut slot: i64 = key
if slot < 0 { slot = 0 - slot }
slot = slot & (UCAP - 1)
let mut seen: i64 = 0
while uu[slot] != 0 {
if uk[slot] == key { seen = 1; break }
slot = (slot + 1) & (UCAP - 1)
}
if seen == 0 {
uu[slot] = 1
uk[slot] = key
# expand signs
let mut sx: array<i64, 2> = [a, 0 - a]
let mut sy: array<i64, 2> = [b, 0 - b]
let mut nx: i64 = 2
let mut ny: i64 = 2
if a == 0 { nx = 1; sx[0] = 0 }
if b == 0 { ny = 1; sy[0] = 0 }
if a == b {
let mut ix: i64 = 0
while ix < nx {
let mut iy: i64 = 0
while iy < ny {
xs[np] = sx[ix] as i32
ys[np] = sy[iy] as i32
zs[np] = z as i32
np = np + 1
iy = iy + 1
}
ix = ix + 1
}
} else {
let mut ix: i64 = 0
while ix < nx {
let mut iy: i64 = 0
while iy < ny {
xs[np] = sx[ix] as i32
ys[np] = sy[iy] as i32
zs[np] = z as i32
np = np + 1
xs[np] = sy[iy] as i32
ys[np] = sx[ix] as i32
zs[np] = z as i32
np = np + 1
iy = iy + 1
}
ix = ix + 1
}
}
}
ri = ri + 1
}
free(uu); free(uk)
}
free(ry); free(rx); free(fe); free(fp)
}
z = z + 1
}
# ref_risk
let inv_r2: f64 = 1.0 / (r2 as f64)
let inv_pi: f64 = 1.0 / PI
let ref_risk: ptr<f64> = calloc(r + 1, 8)
z = 0
while z <= r {
let mut c: f64 = 1.0 - 2.0 * ((z * z) as f64) * inv_r2
if c < (0.0 - 1.0) { c = 0.0 - 1.0 }
let t: f64 = acos(c) * inv_pi
ref_risk[z] = t * t
z = z + 1
}
# spatial hash: key -> linked list head index into list arrays
let HCAP: i64 = 1 << 18
let hkeys: ptr<i64> = calloc(HCAP, 8)
let hhead: ptr<i32> = calloc(HCAP, 4)
let hused: ptr<i8> = calloc(HCAP, 1)
let mut hi: i64 = 0
while hi < HCAP {
hhead[hi] = -1
hi = hi + 1
}
let nextp: ptr<i32> = calloc(np, 4)
i = 0
while i < np {
let cx: i64 = (xs[i] as i64) / L
let cy: i64 = (ys[i] as i64) / L
let cz: i64 = (zs[i] as i64) / L
# fix negative division toward -inf for cell
let mut cx2: i64 = cx
let mut cy2: i64 = cy
let mut cz2: i64 = cz
if (xs[i] as i64) < 0 && (xs[i] as i64) % L != 0 { cx2 = cx - 1 }
if (ys[i] as i64) < 0 && (ys[i] as i64) % L != 0 { cy2 = cy - 1 }
if (zs[i] as i64) < 0 && (zs[i] as i64) % L != 0 { cz2 = cz - 1 }
let key: i64 = pack3(cx2, cy2, cz2)
let mut slot: i64 = cellhash(cx2, cy2, cz2, HCAP)
while hused[slot] != 0 && hkeys[slot] != key {
slot = (slot + 1) & (HCAP - 1)
}
if hused[slot] == 0 {
hused[slot] = 1
hkeys[slot] = key
hhead[slot] = -1
}
nextp[i] = hhead[slot]
hhead[slot] = i as i32
i = i + 1
}
# Dijkstra with indexed binary heap (decrease-key, no stale entries)
let INF: f64 = 1.0e100
let dist: ptr<f64> = calloc(np, 8)
let heap_v: ptr<i32> = calloc(np, 4)
let heap_pos: ptr<i32> = calloc(np, 4)
i = 0
while i < np {
dist[i] = INF
heap_pos[i] = -1
i = i + 1
}
dist[start] = 0.0
heap_v[0] = start as i32
heap_pos[start] = 0
let mut hs: i64 = 1
let mut best: f64 = 0.5
while hs > 0 {
let u: i64 = heap_v[0] as i64
let d: f64 = dist[u]
hs = hs - 1
heap_pos[u] = -1
if hs > 0 {
let last: i64 = heap_v[hs] as i64
heap_v[0] = last as i32
heap_pos[last] = 0
let mut idx: i64 = 0
while true {
let l: i64 = 2 * idx + 1
let rr: i64 = l + 1
let mut smallest: i64 = idx
if l < hs && dist[heap_v[l] as i64] < dist[heap_v[smallest] as i64] { smallest = l }
if rr < hs && dist[heap_v[rr] as i64] < dist[heap_v[smallest] as i64] { smallest = rr }
if smallest == idx { break }
let a: i64 = heap_v[idx] as i64
let b: i64 = heap_v[smallest] as i64
heap_v[idx] = b as i32
heap_v[smallest] = a as i32
heap_pos[a] = smallest as i32
heap_pos[b] = idx as i32
idx = smallest
}
}
if 2.0 * d >= best { break }
let z0: i64 = zs[u] as i64
let cand: f64 = 2.0 * d + ref_risk[z0]
if cand < best { best = cand }
let x0: i64 = xs[u] as i64
let y0: i64 = ys[u] as i64
let mut cx: i64 = x0 / L
let mut cy: i64 = y0 / L
let mut cz: i64 = z0 / L
if x0 < 0 && x0 % L != 0 { cx = cx - 1 }
if y0 < 0 && y0 % L != 0 { cy = cy - 1 }
if z0 < 0 && z0 % L != 0 { cz = cz - 1 }
let mut dxcell: i64 = 0 - 1
while dxcell <= 1 {
let mut dycell: i64 = 0 - 1
while dycell <= 1 {
let mut dzcell: i64 = 0 - 1
while dzcell <= 1 {
let key: i64 = pack3(cx + dxcell, cy + dycell, cz + dzcell)
let mut slot: i64 = cellhash(cx + dxcell, cy + dycell, cz + dzcell, HCAP)
let mut found: i64 = 0
while hused[slot] != 0 {
if hkeys[slot] == key { found = 1; break }
slot = (slot + 1) & (HCAP - 1)
}
if found == 1 {
let mut v: i64 = hhead[slot] as i64
while v != 0 - 1 {
if v != u {
let dx: i64 = (xs[v] as i64) - x0
let dy: i64 = (ys[v] as i64) - y0
let dz: i64 = (zs[v] as i64) - z0
if dx <= L && dx >= (0 - L) && dy <= L && dy >= (0 - L) && dz <= L && dz >= (0 - L) {
let dot: i64 = x0 * (xs[v] as i64) + y0 * (ys[v] as i64) + z0 * (zs[v] as i64)
let mut c: f64 = (dot as f64) * inv_r2
if c > 1.0 { c = 1.0 }
if c < (0.0 - 1.0) { c = 0.0 - 1.0 }
let tt: f64 = acos(c) * inv_pi
let w: f64 = tt * tt
let nd: f64 = d + w
if nd < dist[v] - 1.0e-15 {
dist[v] = nd
if heap_pos[v] >= 0 {
let mut idx: i64 = heap_pos[v] as i64
while idx > 0 {
let par: i64 = (idx - 1) / 2
if dist[heap_v[par] as i64] <= dist[heap_v[idx] as i64] { break }
let a: i64 = heap_v[par] as i64
let b: i64 = heap_v[idx] as i64
heap_v[par] = b as i32
heap_v[idx] = a as i32
heap_pos[a] = idx as i32
heap_pos[b] = par as i32
idx = par
}
} else {
let mut idx: i64 = hs
heap_v[idx] = v as i32
heap_pos[v] = idx as i32
hs = hs + 1
while idx > 0 {
let par: i64 = (idx - 1) / 2
if dist[heap_v[par] as i64] <= dist[heap_v[idx] as i64] { break }
let a: i64 = heap_v[par] as i64
let b: i64 = heap_v[idx] as i64
heap_v[par] = b as i32
heap_v[idx] = a as i32
heap_pos[a] = idx as i32
heap_pos[b] = par as i32
idx = par
}
}
}
}
}
v = nextp[v] as i64
}
}
dzcell = dzcell + 1
}
dycell = dycell + 1
}
dxcell = dxcell + 1
}
}
total = total + best
free(heap_pos); free(heap_v); free(dist)
free(nextp); free(hused); free(hhead); free(hkeys)
free(ref_risk); free(zs); free(ys); free(xs)
nbit = nbit + 1
}
# print with 10 decimals
printf("%.10f\n", total)
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);
double acos(double x);
int64_t abs64_i64(int64_t x);
int64_t hget_ptr_i64_ptr_i64_ptr_i8_i64_i64(int64_t* keys, int64_t* vals, int8_t* used, int64_t cap, int64_t key);
void hput_ptr_i64_ptr_i64_ptr_i8_i64_i64_i64(int64_t* keys, int64_t* vals, int8_t* used, int64_t cap, int64_t key, int64_t val);
int64_t pack3_i64_i64_i64(int64_t a, int64_t b, int64_t c);
int64_t cellhash_i64_i64_i64_i64(int64_t cx, int64_t cy, int64_t cz, int64_t cap);
int64_t choose_L_i64(int64_t r);
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;
}
int64_t abs64_i64(int64_t x) {
if (x < 0) {
return (0 - x);
}
return x;
}
int64_t hget_ptr_i64_ptr_i64_ptr_i8_i64_i64(int64_t* keys, int64_t* vals, int8_t* used, int64_t cap, int64_t key) {
int64_t slot = key;
if (slot < 0) {
slot = (0 - slot);
}
slot = (slot & (cap - 1));
while (used[slot] != 0) {
if (keys[slot] == key) {
return vals[slot];
}
slot = ((slot + 1) & (cap - 1));
}
return (0 - 1);
}
void hput_ptr_i64_ptr_i64_ptr_i8_i64_i64_i64(int64_t* keys, int64_t* vals, int8_t* used, int64_t cap, int64_t key, int64_t val) {
int64_t slot = key;
if (slot < 0) {
slot = (0 - slot);
}
slot = (slot & (cap - 1));
while ((used[slot] != 0 && keys[slot] != key)) {
slot = ((slot + 1) & (cap - 1));
}
used[slot] = 1;
keys[slot] = key;
vals[slot] = val;
}
int64_t pack3_i64_i64_i64(int64_t a, int64_t b, int64_t c) {
int64_t o = 200000;
return ((FLOW_CHECKED_SHL(((a + o)), (40)) | FLOW_CHECKED_SHL(((b + o)), (20))) | (c + o));
}
int64_t cellhash_i64_i64_i64_i64(int64_t cx, int64_t cy, int64_t cz, int64_t cap) {
int64_t h = ((((cx + 200000) * 2654435761) + ((cy + 200000) * 40503)) + ((cz + 200000) * 65599));
int64_t s = h;
if (s < 0) {
s = (0 - s);
}
return (s & (cap - 1));
}
int64_t choose_L_i64(int64_t r) {
if (r <= 512) {
return (2 * r);
}
if (r < 8191) {
return 256;
}
return 512;
}
int32_t main(void) {
int64_t max_r = (FLOW_CHECKED_SHL((1), (15)) - 1);
int64_t max_lim = (2 * max_r);
int32_t* spf = (int32_t*)(calloc((max_lim + 1), 4));
int64_t i = 0;
while (i <= max_lim) {
spf[i] = ((int32_t)(i));
i = (i + 1);
}
if (max_lim >= 1) {
spf[1] = 1;
}
int64_t lim = isqrt_i64(max_lim);
i = 2;
while (i <= lim) {
if (((int64_t)(spf[i])) == i) {
int64_t j = (i * i);
while (j <= max_lim) {
if (((int64_t)(spf[j])) == j) {
spf[j] = ((int32_t)(i));
}
j = (j + i);
}
}
i = (i + 1);
}
int64_t RCAP = FLOW_CHECKED_SHL((1), (17));
int64_t* rkeys = (int64_t*)(calloc(RCAP, 8));
int64_t* rvals = (int64_t*)(calloc(RCAP, 8));
int8_t* rused = (int8_t*)(calloc(RCAP, 1));
i = 2;
while (i <= max_lim) {
if ((((int64_t)(spf[i])) == i && (i & 3) == 1)) {
int64_t root = isqrt_i64(i);
int64_t a = (0 - 1);
int64_t b = 0;
int64_t x = 1;
while (x <= root) {
int64_t y2 = (i - (x * x));
int64_t y = isqrt_i64(y2);
if ((y * y) == y2) {
a = x;
b = y;
break;
}
x = (x + 1);
}
if (a < b) {
int64_t t = a;
a = b;
b = t;
}
hput_ptr_i64_ptr_i64_ptr_i8_i64_i64_i64(rkeys, rvals, rused, RCAP, i, (FLOW_CHECKED_SHL((a), (32)) | b));
}
i = (i + 1);
}
double PI = 3.14159265358979323846;
double total = 0.0;
int64_t nbit = 1;
while (nbit <= 15) {
int64_t r = (FLOW_CHECKED_SHL((1), (nbit)) - 1);
int64_t L = choose_L_i64(r);
int64_t r2 = (r * r);
int64_t CAP_P = 400000;
int32_t* xs = (int32_t*)(calloc(CAP_P, 4));
int32_t* ys = (int32_t*)(calloc(CAP_P, 4));
int32_t* zs = (int32_t*)(calloc(CAP_P, 4));
int64_t np = 0;
int64_t start = (0 - 1);
int64_t z = 0;
while (z <= r) {
int64_t s = (r2 - (z * z));
if (s == 0) {
xs[np] = 0;
ys[np] = 0;
zs[np] = ((int32_t)(z));
if (z == r) {
start = np;
}
np = (np + 1);
} else {
int64_t aa = (r - z);
int64_t bb = (r + z);
int64_t FCAP = 64;
int64_t* fp = (int64_t*)(calloc(FCAP, 8));
int64_t* fe = (int64_t*)(calloc(FCAP, 8));
int64_t fc = 0;
int64_t xx = aa;
while (xx > 1) {
int64_t p = ((int64_t)(spf[xx]));
int64_t e = 0;
while (FLOW_CHECKED_MOD((xx), (p)) == 0) {
xx = FLOW_CHECKED_DIV((xx), (p));
e = (e + 1);
}
int64_t found = (0 - 1);
int64_t t = 0;
while (t < fc) {
if (fp[t] == p) {
found = t;
break;
}
t = (t + 1);
}
if (found >= 0) {
fe[found] = (fe[found] + e);
} else {
fp[fc] = p;
fe[fc] = e;
fc = (fc + 1);
}
}
xx = bb;
while (xx > 1) {
int64_t p = ((int64_t)(spf[xx]));
int64_t e = 0;
while (FLOW_CHECKED_MOD((xx), (p)) == 0) {
xx = FLOW_CHECKED_DIV((xx), (p));
e = (e + 1);
}
int64_t found = (0 - 1);
int64_t t = 0;
while (t < fc) {
if (fp[t] == p) {
found = t;
break;
}
t = (t + 1);
}
if (found >= 0) {
fe[found] = (fe[found] + e);
} else {
fp[fc] = p;
fe[fc] = e;
fc = (fc + 1);
}
}
int64_t scalar = 1;
int64_t e2 = 0;
int64_t odd2 = 0;
int64_t ti = 0;
while (ti < fc) {
if (fp[ti] == 2) {
e2 = fe[ti];
scalar = FLOW_CHECKED_SHL((scalar), (FLOW_CHECKED_DIV((e2), (2))));
odd2 = (e2 & 1);
}
ti = (ti + 1);
}
int64_t RMAX = 1024;
int64_t* rx = (int64_t*)(calloc(RMAX, 8));
int64_t* ry = (int64_t*)(calloc(RMAX, 8));
int64_t rc = 1;
rx[0] = 1;
ry[0] = 0;
int64_t ok = 1;
ti = 0;
while (ti < fc) {
int64_t p = fp[ti];
int64_t e = fe[ti];
if (p == 2) {
ti = (ti + 1);
continue;
}
if ((p & 3) == 3) {
if ((e & 1) == 1) {
ok = 0;
break;
}
int64_t t = 0;
while (t < FLOW_CHECKED_DIV((e), (2))) {
scalar = (scalar * p);
t = (t + 1);
}
ti = (ti + 1);
continue;
}
int64_t repv = hget_ptr_i64_ptr_i64_ptr_i8_i64_i64(rkeys, rvals, rused, RCAP, p);
int64_t pa = FLOW_CHECKED_SHR((repv), (32));
int64_t pb = (repv & 4294967295);
int64_t* powx = (int64_t*)(calloc((e + 2), 8));
int64_t* powy = (int64_t*)(calloc((e + 2), 8));
int64_t* powcx = (int64_t*)(calloc((e + 2), 8));
int64_t* powcy = (int64_t*)(calloc((e + 2), 8));
powx[0] = 1;
powy[0] = 0;
powcx[0] = 1;
powcy[0] = 0;
int64_t k = 0;
while (k < e) {
powx[(k + 1)] = ((powx[k] * pa) - (powy[k] * pb));
powy[(k + 1)] = ((powx[k] * pb) + (powy[k] * pa));
powcx[(k + 1)] = ((powcx[k] * pa) - (powcy[k] * (0 - pb)));
powcy[(k + 1)] = ((powcx[k] * (0 - pb)) + (powcy[k] * pa));
k = (k + 1);
}
int64_t* nrx = (int64_t*)(calloc(RMAX, 8));
int64_t* nry = (int64_t*)(calloc(RMAX, 8));
int64_t nrc = 0;
int64_t ri = 0;
while (ri < rc) {
k = 0;
while (k <= e) {
int64_t x1 = powx[k];
int64_t y1 = powy[k];
int64_t x2 = powcx[(e - k)];
int64_t y2 = powcy[(e - k)];
int64_t tx = ((x1 * x2) - (y1 * y2));
int64_t ty = ((x1 * y2) + (y1 * x2));
nrx[nrc] = ((rx[ri] * tx) - (ry[ri] * ty));
nry[nrc] = ((rx[ri] * ty) + (ry[ri] * tx));
nrc = (nrc + 1);
k = (k + 1);
}
ri = (ri + 1);
}
rc = nrc;
ri = 0;
while (ri < rc) {
rx[ri] = nrx[ri];
ry[ri] = nry[ri];
ri = (ri + 1);
}
free(nry);
free(nrx);
free(powcy);
free(powcx);
free(powy);
free(powx);
ti = (ti + 1);
}
if (ok == 1) {
if (odd2 == 1) {
int64_t ri = 0;
while (ri < rc) {
int64_t x = rx[ri];
int64_t y = ry[ri];
rx[ri] = (x - y);
ry[ri] = (x + y);
ri = (ri + 1);
}
}
if (scalar != 1) {
int64_t ri = 0;
while (ri < rc) {
rx[ri] = (rx[ri] * scalar);
ry[ri] = (ry[ri] * scalar);
ri = (ri + 1);
}
}
int64_t UCAP = FLOW_CHECKED_SHL((1), (10));
int64_t* uk = (int64_t*)(calloc(UCAP, 8));
int8_t* uu = (int8_t*)(calloc(UCAP, 1));
int64_t ri = 0;
while (ri < rc) {
int64_t a = abs64_i64(rx[ri]);
int64_t b = abs64_i64(ry[ri]);
if (a < b) {
int64_t t = a;
a = b;
b = t;
}
int64_t key = (FLOW_CHECKED_SHL((a), (32)) | b);
int64_t slot = key;
if (slot < 0) {
slot = (0 - slot);
}
slot = (slot & (UCAP - 1));
int64_t seen = 0;
while (uu[slot] != 0) {
if (uk[slot] == key) {
seen = 1;
break;
}
slot = ((slot + 1) & (UCAP - 1));
}
if (seen == 0) {
uu[slot] = 1;
uk[slot] = key;
int64_t sx[2] = { a, (0 - a) };
int64_t sy[2] = { b, (0 - b) };
int64_t nx = 2;
int64_t ny = 2;
if (a == 0) {
nx = 1;
sx[0] = 0;
}
if (b == 0) {
ny = 1;
sy[0] = 0;
}
if (a == b) {
int64_t ix = 0;
while (ix < nx) {
int64_t iy = 0;
while (iy < ny) {
xs[np] = ((int32_t)((((unsigned)(ix) < 2) ? sx[ix] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(ix), 2), flow_fault_handler("array index out of bounds"), sx[0]))));
ys[np] = ((int32_t)((((unsigned)(iy) < 2) ? sy[iy] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(iy), 2), flow_fault_handler("array index out of bounds"), sy[0]))));
zs[np] = ((int32_t)(z));
np = (np + 1);
iy = (iy + 1);
}
ix = (ix + 1);
}
} else {
int64_t ix = 0;
while (ix < nx) {
int64_t iy = 0;
while (iy < ny) {
xs[np] = ((int32_t)((((unsigned)(ix) < 2) ? sx[ix] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(ix), 2), flow_fault_handler("array index out of bounds"), sx[0]))));
ys[np] = ((int32_t)((((unsigned)(iy) < 2) ? sy[iy] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(iy), 2), flow_fault_handler("array index out of bounds"), sy[0]))));
zs[np] = ((int32_t)(z));
np = (np + 1);
xs[np] = ((int32_t)((((unsigned)(iy) < 2) ? sy[iy] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(iy), 2), flow_fault_handler("array index out of bounds"), sy[0]))));
ys[np] = ((int32_t)((((unsigned)(ix) < 2) ? sx[ix] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(ix), 2), flow_fault_handler("array index out of bounds"), sx[0]))));
zs[np] = ((int32_t)(z));
np = (np + 1);
iy = (iy + 1);
}
ix = (ix + 1);
}
}
}
ri = (ri + 1);
}
free(uu);
free(uk);
}
free(ry);
free(rx);
free(fe);
free(fp);
}
z = (z + 1);
}
double inv_r2 = (1.0 / ((double)(r2)));
double inv_pi = (1.0 / PI);
double* ref_risk = (double*)(calloc((r + 1), 8));
z = 0;
while (z <= r) {
double c = (1.0 - ((2.0 * ((double)((z * z)))) * inv_r2));
if (c < (0.0 - 1.0)) {
c = (0.0 - 1.0);
}
double t = (acos(c) * inv_pi);
ref_risk[z] = (t * t);
z = (z + 1);
}
int64_t HCAP = FLOW_CHECKED_SHL((1), (18));
int64_t* hkeys = (int64_t*)(calloc(HCAP, 8));
int32_t* hhead = (int32_t*)(calloc(HCAP, 4));
int8_t* hused = (int8_t*)(calloc(HCAP, 1));
int64_t hi = 0;
while (hi < HCAP) {
hhead[hi] = (-1);
hi = (hi + 1);
}
int32_t* nextp = (int32_t*)(calloc(np, 4));
i = 0;
while (i < np) {
int64_t cx = FLOW_CHECKED_DIV((((int64_t)(xs[i]))), (L));
int64_t cy = FLOW_CHECKED_DIV((((int64_t)(ys[i]))), (L));
int64_t cz = FLOW_CHECKED_DIV((((int64_t)(zs[i]))), (L));
int64_t cx2 = cx;
int64_t cy2 = cy;
int64_t cz2 = cz;
if ((((int64_t)(xs[i])) < 0 && FLOW_CHECKED_MOD((((int64_t)(xs[i]))), (L)) != 0)) {
cx2 = (cx - 1);
}
if ((((int64_t)(ys[i])) < 0 && FLOW_CHECKED_MOD((((int64_t)(ys[i]))), (L)) != 0)) {
cy2 = (cy - 1);
}
if ((((int64_t)(zs[i])) < 0 && FLOW_CHECKED_MOD((((int64_t)(zs[i]))), (L)) != 0)) {
cz2 = (cz - 1);
}
int64_t key = pack3_i64_i64_i64(cx2, cy2, cz2);
int64_t slot = cellhash_i64_i64_i64_i64(cx2, cy2, cz2, HCAP);
while ((hused[slot] != 0 && hkeys[slot] != key)) {
slot = ((slot + 1) & (HCAP - 1));
}
if (hused[slot] == 0) {
hused[slot] = 1;
hkeys[slot] = key;
hhead[slot] = (-1);
}
nextp[i] = hhead[slot];
hhead[slot] = ((int32_t)(i));
i = (i + 1);
}
double INF = 1.0e100;
double* dist = (double*)(calloc(np, 8));
int32_t* heap_v = (int32_t*)(calloc(np, 4));
int32_t* heap_pos = (int32_t*)(calloc(np, 4));
i = 0;
while (i < np) {
dist[i] = INF;
heap_pos[i] = (-1);
i = (i + 1);
}
dist[start] = 0.0;
heap_v[0] = ((int32_t)(start));
heap_pos[start] = 0;
int64_t hs = 1;
double best = 0.5;
while (hs > 0) {
int64_t u = ((int64_t)(heap_v[0]));
double d = dist[u];
hs = (hs - 1);
heap_pos[u] = (-1);
if (hs > 0) {
int64_t last = ((int64_t)(heap_v[hs]));
heap_v[0] = ((int32_t)(last));
heap_pos[last] = 0;
int64_t idx = 0;
while (1) {
int64_t l = ((2 * idx) + 1);
int64_t rr = (l + 1);
int64_t smallest = idx;
if ((l < hs && dist[((int64_t)(heap_v[l]))] < dist[((int64_t)(heap_v[smallest]))])) {
smallest = l;
}
if ((rr < hs && dist[((int64_t)(heap_v[rr]))] < dist[((int64_t)(heap_v[smallest]))])) {
smallest = rr;
}
if (smallest == idx) {
break;
}
int64_t a = ((int64_t)(heap_v[idx]));
int64_t b = ((int64_t)(heap_v[smallest]));
heap_v[idx] = ((int32_t)(b));
heap_v[smallest] = ((int32_t)(a));
heap_pos[a] = ((int32_t)(smallest));
heap_pos[b] = ((int32_t)(idx));
idx = smallest;
}
}
if ((2.0 * d) >= best) {
break;
}
int64_t z0 = ((int64_t)(zs[u]));
double cand = ((2.0 * d) + ref_risk[z0]);
if (cand < best) {
best = cand;
}
int64_t x0 = ((int64_t)(xs[u]));
int64_t y0 = ((int64_t)(ys[u]));
int64_t cx = FLOW_CHECKED_DIV((x0), (L));
int64_t cy = FLOW_CHECKED_DIV((y0), (L));
int64_t cz = FLOW_CHECKED_DIV((z0), (L));
if ((x0 < 0 && FLOW_CHECKED_MOD((x0), (L)) != 0)) {
cx = (cx - 1);
}
if ((y0 < 0 && FLOW_CHECKED_MOD((y0), (L)) != 0)) {
cy = (cy - 1);
}
if ((z0 < 0 && FLOW_CHECKED_MOD((z0), (L)) != 0)) {
cz = (cz - 1);
}
int64_t dxcell = (0 - 1);
while (dxcell <= 1) {
int64_t dycell = (0 - 1);
while (dycell <= 1) {
int64_t dzcell = (0 - 1);
while (dzcell <= 1) {
int64_t key = pack3_i64_i64_i64((cx + dxcell), (cy + dycell), (cz + dzcell));
int64_t slot = cellhash_i64_i64_i64_i64((cx + dxcell), (cy + dycell), (cz + dzcell), HCAP);
int64_t found = 0;
while (hused[slot] != 0) {
if (hkeys[slot] == key) {
found = 1;
break;
}
slot = ((slot + 1) & (HCAP - 1));
}
if (found == 1) {
int64_t v = ((int64_t)(hhead[slot]));
while (v != (0 - 1)) {
if (v != u) {
int64_t dx = (((int64_t)(xs[v])) - x0);
int64_t dy = (((int64_t)(ys[v])) - y0);
int64_t dz = (((int64_t)(zs[v])) - z0);
if ((((((dx <= L && dx >= (0 - L)) && dy <= L) && dy >= (0 - L)) && dz <= L) && dz >= (0 - L))) {
int64_t dot = (((x0 * ((int64_t)(xs[v]))) + (y0 * ((int64_t)(ys[v])))) + (z0 * ((int64_t)(zs[v]))));
double c = (((double)(dot)) * inv_r2);
if (c > 1.0) {
c = 1.0;
}
if (c < (0.0 - 1.0)) {
c = (0.0 - 1.0);
}
double tt = (acos(c) * inv_pi);
double w = (tt * tt);
double nd = (d + w);
if (nd < (dist[v] - 1.0e-15)) {
dist[v] = nd;
if (heap_pos[v] >= 0) {
int64_t idx = ((int64_t)(heap_pos[v]));
while (idx > 0) {
int64_t par = FLOW_CHECKED_DIV(((idx - 1)), (2));
if (dist[((int64_t)(heap_v[par]))] <= dist[((int64_t)(heap_v[idx]))]) {
break;
}
int64_t a = ((int64_t)(heap_v[par]));
int64_t b = ((int64_t)(heap_v[idx]));
heap_v[par] = ((int32_t)(b));
heap_v[idx] = ((int32_t)(a));
heap_pos[a] = ((int32_t)(idx));
heap_pos[b] = ((int32_t)(par));
idx = par;
}
} else {
int64_t idx = hs;
heap_v[idx] = ((int32_t)(v));
heap_pos[v] = ((int32_t)(idx));
hs = (hs + 1);
while (idx > 0) {
int64_t par = FLOW_CHECKED_DIV(((idx - 1)), (2));
if (dist[((int64_t)(heap_v[par]))] <= dist[((int64_t)(heap_v[idx]))]) {
break;
}
int64_t a = ((int64_t)(heap_v[par]));
int64_t b = ((int64_t)(heap_v[idx]));
heap_v[par] = ((int32_t)(b));
heap_v[idx] = ((int32_t)(a));
heap_pos[a] = ((int32_t)(idx));
heap_pos[b] = ((int32_t)(par));
idx = par;
}
}
}
}
}
v = ((int64_t)(nextp[v]));
}
}
dzcell = (dzcell + 1);
}
dycell = (dycell + 1);
}
dxcell = (dxcell + 1);
}
}
total = (total + best);
free(heap_pos);
free(heap_v);
free(dist);
free(nextp);
free(hused);
free(hhead);
free(hkeys);
free(ref_risk);
free(zs);
free(ys);
free(xs);
nbit = (nbit + 1);
}
printf("%.10f\n", total);
return 0;
}
Generated MLIR
module {
llvm.func @printf(!llvm.ptr, ...) -> i32
llvm.mlir.global internal constant @str_0("%.10f\n\00") {addr_space = 0 : i32} : !llvm.array<7 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 private @realloc(!llvm.ptr, i64) -> !llvm.ptr
func.func private @acos(f64) -> f64
func.func private @fabs(f64) -> f64
func.func @abs64(%arg0: i64) -> i64 {
%175 = arith.constant 0 : i32
%177 = arith.extsi %175 : i32 to i64
%176 = arith.cmpi slt, %arg0, %177 : i64
cf.cond_br %176, ^bb42, ^bb43
^bb42:
%178 = arith.constant 0 : i32
%180 = arith.extsi %178 : i32 to i64
%179 = arith.subi %180, %arg0 : i64
func.return %179 : i64
^bb43:
cf.br ^bb44
^bb44:
func.return %arg0 : i64
}
func.func @hget(%arg0: !llvm.ptr, %arg1: !llvm.ptr, %arg2: !llvm.ptr, %arg3: i64, %arg4: i64) -> i64 {
%181 = llvm.mlir.constant(1 : i64) : i64
%182 = llvm.alloca %181 x i64 : (i64) -> !llvm.ptr
llvm.store %arg4, %182 : i64, !llvm.ptr
%183 = llvm.load %182 : !llvm.ptr -> i64
%184 = arith.constant 0 : i32
%186 = arith.extsi %184 : i32 to i64
%185 = arith.cmpi slt, %183, %186 : i64
cf.cond_br %185, ^bb45, ^bb46
^bb45:
%187 = arith.constant 0 : i32
%188 = llvm.load %182 : !llvm.ptr -> i64
%190 = arith.extsi %187 : i32 to i64
%189 = arith.subi %190, %188 : i64
llvm.store %189, %182 : i64, !llvm.ptr
cf.br ^bb47
^bb46:
cf.br ^bb47
^bb47:
%191 = llvm.load %182 : !llvm.ptr -> i64
%192 = arith.constant 1 : i32
%194 = arith.extsi %192 : i32 to i64
%193 = arith.subi %arg3, %194 : i64
%195 = arith.andi %191, %193 : i64
llvm.store %195, %182 : i64, !llvm.ptr
cf.br ^bb48
^bb48:
%197 = llvm.load %182 : !llvm.ptr -> i64
%198 = llvm.getelementptr %arg2[%197] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%196 = llvm.load %198 : !llvm.ptr -> i8
%199 = arith.constant 0 : i32
%201 = arith.extsi %196 : i8 to i32
%200 = arith.cmpi ne, %201, %199 : i32
cf.cond_br %200, ^bb49, ^bb50
^bb49:
%203 = llvm.load %182 : !llvm.ptr -> i64
%204 = llvm.getelementptr %arg0[%203] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%202 = llvm.load %204 : !llvm.ptr -> i64
%205 = arith.cmpi eq, %202, %arg4 : i64
cf.cond_br %205, ^bb51, ^bb52
^bb51:
%207 = llvm.load %182 : !llvm.ptr -> i64
%208 = llvm.getelementptr %arg1[%207] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%206 = llvm.load %208 : !llvm.ptr -> i64
func.return %206 : i64
^bb52:
cf.br ^bb53
^bb53:
%209 = llvm.load %182 : !llvm.ptr -> i64
%210 = arith.constant 1 : i32
%212 = arith.extsi %210 : i32 to i64
%211 = arith.addi %209, %212 : i64
%213 = arith.constant 1 : i32
%215 = arith.extsi %213 : i32 to i64
%214 = arith.subi %arg3, %215 : i64
%216 = arith.andi %211, %214 : i64
llvm.store %216, %182 : i64, !llvm.ptr
cf.br ^bb48
^bb50:
%217 = arith.constant 0 : i32
%218 = arith.constant 1 : i32
%219 = arith.subi %217, %218 : i32
%220 = arith.extsi %219 : i32 to i64
func.return %220 : i64
}
func.func @hput(%arg0: !llvm.ptr, %arg1: !llvm.ptr, %arg2: !llvm.ptr, %arg3: i64, %arg4: i64, %arg5: i64) -> () {
%221 = llvm.mlir.constant(1 : i64) : i64
%222 = llvm.alloca %221 x i64 : (i64) -> !llvm.ptr
llvm.store %arg4, %222 : i64, !llvm.ptr
%223 = llvm.load %222 : !llvm.ptr -> i64
%224 = arith.constant 0 : i32
%226 = arith.extsi %224 : i32 to i64
%225 = arith.cmpi slt, %223, %226 : i64
cf.cond_br %225, ^bb54, ^bb55
^bb54:
%227 = arith.constant 0 : i32
%228 = llvm.load %222 : !llvm.ptr -> i64
%230 = arith.extsi %227 : i32 to i64
%229 = arith.subi %230, %228 : i64
llvm.store %229, %222 : i64, !llvm.ptr
cf.br ^bb56
^bb55:
cf.br ^bb56
^bb56:
%231 = llvm.load %222 : !llvm.ptr -> i64
%232 = arith.constant 1 : i32
%234 = arith.extsi %232 : i32 to i64
%233 = arith.subi %arg3, %234 : i64
%235 = arith.andi %231, %233 : i64
llvm.store %235, %222 : i64, !llvm.ptr
cf.br ^bb57
^bb57:
%237 = llvm.load %222 : !llvm.ptr -> i64
%238 = llvm.getelementptr %arg2[%237] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%236 = llvm.load %238 : !llvm.ptr -> i8
%239 = arith.constant 0 : i32
%241 = arith.extsi %236 : i8 to i32
%240 = arith.cmpi ne, %241, %239 : i32
%242 = scf.if %240 -> (i1) {
%244 = llvm.load %222 : !llvm.ptr -> i64
%245 = llvm.getelementptr %arg0[%244] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%243 = llvm.load %245 : !llvm.ptr -> i64
%246 = arith.cmpi ne, %243, %arg4 : i64
scf.yield %246 : i1
} else {
%247 = arith.constant false
scf.yield %247 : i1
}
cf.cond_br %242, ^bb58, ^bb59
^bb58:
%248 = llvm.load %222 : !llvm.ptr -> i64
%249 = arith.constant 1 : i32
%251 = arith.extsi %249 : i32 to i64
%250 = arith.addi %248, %251 : i64
%252 = arith.constant 1 : i32
%254 = arith.extsi %252 : i32 to i64
%253 = arith.subi %arg3, %254 : i64
%255 = arith.andi %250, %253 : i64
llvm.store %255, %222 : i64, !llvm.ptr
cf.br ^bb57
^bb59:
%256 = arith.constant 1 : i32
%257 = llvm.load %222 : !llvm.ptr -> i64
%258 = arith.trunci %256 : i32 to i8
%259 = llvm.getelementptr %arg2[%257] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %258, %259 : i8, !llvm.ptr
%260 = llvm.load %222 : !llvm.ptr -> i64
%261 = llvm.getelementptr %arg0[%260] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %arg4, %261 : i64, !llvm.ptr
%262 = llvm.load %222 : !llvm.ptr -> i64
%263 = llvm.getelementptr %arg1[%262] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %arg5, %263 : i64, !llvm.ptr
func.return
}
func.func @pack3(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
%264 = arith.constant 200000 : i32
%265 = arith.extsi %264 : i32 to i64
%266 = arith.addi %arg0, %265 : i64
%267 = arith.constant 40 : i32
%269 = arith.extsi %267 : i32 to i64
%268 = arith.shli %266, %269 : i64
%270 = arith.addi %arg1, %265 : i64
%271 = arith.constant 20 : i32
%273 = arith.extsi %271 : i32 to i64
%272 = arith.shli %270, %273 : i64
%274 = arith.ori %268, %272 : i64
%275 = arith.addi %arg2, %265 : i64
%276 = arith.ori %274, %275 : i64
func.return %276 : i64
}
func.func @cellhash(%arg0: i64, %arg1: i64, %arg2: i64, %arg3: i64) -> i64 {
%277 = arith.constant 200000 : i32
%279 = arith.extsi %277 : i32 to i64
%278 = arith.addi %arg0, %279 : i64
%280 = arith.constant -1640531535 : i32
%282 = arith.extsi %280 : i32 to i64
%281 = arith.muli %278, %282 : i64
%283 = arith.constant 200000 : i32
%285 = arith.extsi %283 : i32 to i64
%284 = arith.addi %arg1, %285 : i64
%286 = arith.constant 40503 : i32
%288 = arith.extsi %286 : i32 to i64
%287 = arith.muli %284, %288 : i64
%289 = arith.addi %281, %287 : i64
%290 = arith.constant 200000 : i32
%292 = arith.extsi %290 : i32 to i64
%291 = arith.addi %arg2, %292 : i64
%293 = arith.constant 65599 : i32
%295 = arith.extsi %293 : i32 to i64
%294 = arith.muli %291, %295 : i64
%296 = arith.addi %289, %294 : 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 = llvm.load %298 : !llvm.ptr -> i64
%300 = arith.constant 0 : i32
%302 = arith.extsi %300 : i32 to i64
%301 = arith.cmpi slt, %299, %302 : i64
cf.cond_br %301, ^bb60, ^bb61
^bb60:
%303 = arith.constant 0 : i32
%304 = llvm.load %298 : !llvm.ptr -> i64
%306 = arith.extsi %303 : i32 to i64
%305 = arith.subi %306, %304 : i64
llvm.store %305, %298 : i64, !llvm.ptr
cf.br ^bb62
^bb61:
cf.br ^bb62
^bb62:
%307 = llvm.load %298 : !llvm.ptr -> i64
%308 = arith.constant 1 : i32
%310 = arith.extsi %308 : i32 to i64
%309 = arith.subi %arg3, %310 : i64
%311 = arith.andi %307, %309 : i64
func.return %311 : i64
}
func.func @choose_L(%arg0: i64) -> i64 {
%312 = arith.constant 512 : i32
%314 = arith.extsi %312 : i32 to i64
%313 = arith.cmpi sle, %arg0, %314 : i64
cf.cond_br %313, ^bb63, ^bb64
^bb63:
%315 = arith.constant 2 : i32
%317 = arith.extsi %315 : i32 to i64
%316 = arith.muli %317, %arg0 : i64
func.return %316 : i64
^bb64:
cf.br ^bb65
^bb65:
%318 = arith.constant 8191 : i32
%320 = arith.extsi %318 : i32 to i64
%319 = arith.cmpi slt, %arg0, %320 : i64
cf.cond_br %319, ^bb66, ^bb67
^bb66:
%321 = arith.constant 256 : i32
%322 = arith.extsi %321 : i32 to i64
func.return %322 : i64
^bb67:
cf.br ^bb68
^bb68:
%323 = arith.constant 512 : i32
%324 = arith.extsi %323 : i32 to i64
func.return %324 : i64
}
func.func @main() -> i32 {
%325 = arith.constant 1 : i32
%326 = arith.constant 15 : i32
%327 = arith.shli %325, %326 : i32
%328 = arith.constant 1 : i32
%329 = arith.subi %327, %328 : i32
%330 = arith.extsi %329 : i32 to i64
%331 = arith.constant 2 : i32
%333 = arith.extsi %331 : i32 to i64
%332 = arith.muli %333, %330 : i64
%335 = arith.constant 1 : i32
%337 = arith.extsi %335 : i32 to i64
%336 = arith.addi %332, %337 : i64
%338 = arith.constant 4 : i32
%339 = arith.extsi %338 : i32 to i64
%334 = func.call @calloc(%336, %339) : (i64, i64) -> !llvm.ptr
%340 = arith.constant 0 : i32
%341 = arith.extsi %340 : i32 to i64
%342 = llvm.mlir.constant(1 : i64) : i64
%343 = llvm.alloca %342 x i64 : (i64) -> !llvm.ptr
llvm.store %341, %343 : i64, !llvm.ptr
cf.br ^bb69
^bb69:
%344 = llvm.load %343 : !llvm.ptr -> i64
%345 = arith.cmpi sle, %344, %332 : i64
cf.cond_br %345, ^bb70, ^bb71
^bb70:
%346 = llvm.load %343 : !llvm.ptr -> i64
%347 = arith.trunci %346 : i64 to i32
%348 = llvm.load %343 : !llvm.ptr -> i64
%349 = llvm.getelementptr %334[%348] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %347, %349 : i32, !llvm.ptr
%350 = llvm.load %343 : !llvm.ptr -> i64
%351 = arith.constant 1 : i32
%353 = arith.extsi %351 : i32 to i64
%352 = arith.addi %350, %353 : i64
llvm.store %352, %343 : i64, !llvm.ptr
cf.br ^bb69
^bb71:
%354 = arith.constant 1 : i32
%356 = arith.extsi %354 : i32 to i64
%355 = arith.cmpi sge, %332, %356 : i64
cf.cond_br %355, ^bb72, ^bb73
^bb72:
%357 = arith.constant 1 : i32
%358 = arith.constant 1 : i32
%359 = arith.extsi %358 : i32 to i64
%360 = llvm.getelementptr %334[%359] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %357, %360 : i32, !llvm.ptr
cf.br ^bb74
^bb73:
cf.br ^bb74
^bb74:
%361 = func.call @isqrt(%332) : (i64) -> i64
%362 = arith.constant 2 : i32
%363 = arith.extsi %362 : i32 to i64
llvm.store %363, %343 : i64, !llvm.ptr
cf.br ^bb75
^bb75:
%364 = llvm.load %343 : !llvm.ptr -> i64
%365 = arith.cmpi sle, %364, %361 : i64
cf.cond_br %365, ^bb76, ^bb77
^bb76:
%367 = llvm.load %343 : !llvm.ptr -> i64
%368 = llvm.getelementptr %334[%367] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%366 = llvm.load %368 : !llvm.ptr -> i32
%369 = arith.extsi %366 : i32 to i64
%370 = llvm.load %343 : !llvm.ptr -> i64
%371 = arith.cmpi eq, %369, %370 : i64
cf.cond_br %371, ^bb78, ^bb79
^bb78:
%372 = llvm.load %343 : !llvm.ptr -> i64
%373 = llvm.load %343 : !llvm.ptr -> i64
%374 = arith.muli %372, %373 : i64
%375 = llvm.mlir.constant(1 : i64) : i64
%376 = llvm.alloca %375 x i64 : (i64) -> !llvm.ptr
llvm.store %374, %376 : i64, !llvm.ptr
cf.br ^bb81
^bb81:
%377 = llvm.load %376 : !llvm.ptr -> i64
%378 = arith.cmpi sle, %377, %332 : i64
cf.cond_br %378, ^bb82, ^bb83
^bb82:
%380 = llvm.load %376 : !llvm.ptr -> i64
%381 = llvm.getelementptr %334[%380] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%379 = llvm.load %381 : !llvm.ptr -> i32
%382 = arith.extsi %379 : i32 to i64
%383 = llvm.load %376 : !llvm.ptr -> i64
%384 = arith.cmpi eq, %382, %383 : i64
cf.cond_br %384, ^bb84, ^bb85
^bb84:
%385 = llvm.load %343 : !llvm.ptr -> i64
%386 = arith.trunci %385 : i64 to i32
%387 = llvm.load %376 : !llvm.ptr -> i64
%388 = llvm.getelementptr %334[%387] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %386, %388 : i32, !llvm.ptr
cf.br ^bb86
^bb85:
cf.br ^bb86
^bb86:
%389 = llvm.load %376 : !llvm.ptr -> i64
%390 = llvm.load %343 : !llvm.ptr -> i64
%391 = arith.addi %389, %390 : i64
llvm.store %391, %376 : i64, !llvm.ptr
cf.br ^bb81
^bb83:
cf.br ^bb80
^bb79:
cf.br ^bb80
^bb80:
%392 = llvm.load %343 : !llvm.ptr -> i64
%393 = arith.constant 1 : i32
%395 = arith.extsi %393 : i32 to i64
%394 = arith.addi %392, %395 : i64
llvm.store %394, %343 : i64, !llvm.ptr
cf.br ^bb75
^bb77:
%396 = arith.constant 1 : i32
%397 = arith.constant 17 : i32
%398 = arith.shli %396, %397 : i32
%399 = arith.extsi %398 : i32 to i64
%401 = arith.constant 8 : i32
%402 = arith.extsi %401 : i32 to i64
%400 = func.call @calloc(%399, %402) : (i64, i64) -> !llvm.ptr
%404 = arith.constant 8 : i32
%405 = arith.extsi %404 : i32 to i64
%403 = func.call @calloc(%399, %405) : (i64, i64) -> !llvm.ptr
%407 = arith.constant 1 : i32
%408 = arith.extsi %407 : i32 to i64
%406 = func.call @calloc(%399, %408) : (i64, i64) -> !llvm.ptr
%409 = arith.constant 2 : i32
%410 = arith.extsi %409 : i32 to i64
llvm.store %410, %343 : i64, !llvm.ptr
cf.br ^bb87
^bb87:
%411 = llvm.load %343 : !llvm.ptr -> i64
%412 = arith.cmpi sle, %411, %332 : i64
cf.cond_br %412, ^bb88, ^bb89
^bb88:
%414 = llvm.load %343 : !llvm.ptr -> i64
%415 = llvm.getelementptr %334[%414] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%413 = llvm.load %415 : !llvm.ptr -> i32
%416 = arith.extsi %413 : i32 to i64
%417 = llvm.load %343 : !llvm.ptr -> i64
%418 = arith.cmpi eq, %416, %417 : i64
%419 = scf.if %418 -> (i1) {
%420 = llvm.load %343 : !llvm.ptr -> i64
%421 = arith.constant 3 : i32
%423 = arith.extsi %421 : i32 to i64
%422 = arith.andi %420, %423 : i64
%424 = arith.constant 1 : i32
%426 = arith.extsi %424 : i32 to i64
%425 = arith.cmpi eq, %422, %426 : i64
scf.yield %425 : i1
} else {
%427 = arith.constant false
scf.yield %427 : i1
}
cf.cond_br %419, ^bb90, ^bb91
^bb90:
%429 = llvm.load %343 : !llvm.ptr -> i64
%428 = func.call @isqrt(%429) : (i64) -> i64
%430 = arith.constant 0 : i32
%431 = arith.constant 1 : i32
%432 = arith.subi %430, %431 : i32
%433 = arith.extsi %432 : i32 to i64
%434 = llvm.mlir.constant(1 : i64) : i64
%435 = llvm.alloca %434 x i64 : (i64) -> !llvm.ptr
llvm.store %433, %435 : i64, !llvm.ptr
%436 = arith.constant 0 : i32
%437 = arith.extsi %436 : i32 to i64
%438 = llvm.mlir.constant(1 : i64) : i64
%439 = llvm.alloca %438 x i64 : (i64) -> !llvm.ptr
llvm.store %437, %439 : i64, !llvm.ptr
%440 = arith.constant 1 : i32
%441 = arith.extsi %440 : i32 to i64
%442 = llvm.mlir.constant(1 : i64) : i64
%443 = llvm.alloca %442 x i64 : (i64) -> !llvm.ptr
llvm.store %441, %443 : i64, !llvm.ptr
cf.br ^bb93
^bb93:
%444 = llvm.load %443 : !llvm.ptr -> i64
%445 = arith.cmpi sle, %444, %428 : i64
cf.cond_br %445, ^bb94, ^bb95
^bb94:
%446 = llvm.load %343 : !llvm.ptr -> i64
%447 = llvm.load %443 : !llvm.ptr -> i64
%448 = llvm.load %443 : !llvm.ptr -> i64
%449 = arith.muli %447, %448 : i64
%450 = arith.subi %446, %449 : i64
%451 = func.call @isqrt(%450) : (i64) -> i64
%452 = arith.muli %451, %451 : i64
%453 = arith.cmpi eq, %452, %450 : i64
cf.cond_br %453, ^bb96, ^bb97
^bb96:
%454 = llvm.load %443 : !llvm.ptr -> i64
llvm.store %454, %435 : i64, !llvm.ptr
llvm.store %451, %439 : i64, !llvm.ptr
cf.br ^bb95
^bb97:
cf.br ^bb98
^bb98:
%455 = llvm.load %443 : !llvm.ptr -> i64
%456 = arith.constant 1 : i32
%458 = arith.extsi %456 : i32 to i64
%457 = arith.addi %455, %458 : i64
llvm.store %457, %443 : i64, !llvm.ptr
cf.br ^bb93
^bb95:
%459 = llvm.load %435 : !llvm.ptr -> i64
%460 = llvm.load %439 : !llvm.ptr -> i64
%461 = arith.cmpi slt, %459, %460 : i64
cf.cond_br %461, ^bb99, ^bb100
^bb99:
%462 = llvm.load %435 : !llvm.ptr -> i64
%463 = llvm.load %439 : !llvm.ptr -> i64
llvm.store %463, %435 : i64, !llvm.ptr
llvm.store %462, %439 : i64, !llvm.ptr
cf.br ^bb101
^bb100:
cf.br ^bb101
^bb101:
%465 = llvm.load %343 : !llvm.ptr -> i64
%466 = llvm.load %435 : !llvm.ptr -> i64
%467 = arith.constant 32 : i32
%469 = arith.extsi %467 : i32 to i64
%468 = arith.shli %466, %469 : i64
%470 = llvm.load %439 : !llvm.ptr -> i64
%471 = arith.ori %468, %470 : i64
func.call @hput(%400, %403, %406, %399, %465, %471) : (!llvm.ptr, !llvm.ptr, !llvm.ptr, i64, i64, i64) -> ()
cf.br ^bb92
^bb91:
cf.br ^bb92
^bb92:
%472 = llvm.load %343 : !llvm.ptr -> i64
%473 = arith.constant 1 : i32
%475 = arith.extsi %473 : i32 to i64
%474 = arith.addi %472, %475 : i64
llvm.store %474, %343 : i64, !llvm.ptr
cf.br ^bb87
^bb89:
%476 = arith.constant 3.14159265358979323846 : f32
%477 = arith.extf %476 : f32 to f64
%478 = arith.constant 0.0 : f32
%479 = arith.extf %478 : f32 to f64
%480 = llvm.mlir.constant(1 : i64) : i64
%481 = llvm.alloca %480 x f64 : (i64) -> !llvm.ptr
llvm.store %479, %481 : f64, !llvm.ptr
%482 = arith.constant 1 : i32
%483 = arith.extsi %482 : i32 to i64
%484 = llvm.mlir.constant(1 : i64) : i64
%485 = llvm.alloca %484 x i64 : (i64) -> !llvm.ptr
llvm.store %483, %485 : i64, !llvm.ptr
cf.br ^bb102
^bb102:
%486 = llvm.load %485 : !llvm.ptr -> i64
%487 = arith.constant 15 : i32
%489 = arith.extsi %487 : i32 to i64
%488 = arith.cmpi sle, %486, %489 : i64
cf.cond_br %488, ^bb103, ^bb104
^bb103:
%490 = arith.constant 1 : i32
%491 = llvm.load %485 : !llvm.ptr -> i64
%493 = arith.extsi %490 : i32 to i64
%492 = arith.shli %493, %491 : i64
%494 = arith.constant 1 : i32
%496 = arith.extsi %494 : i32 to i64
%495 = arith.subi %492, %496 : i64
%497 = func.call @choose_L(%495) : (i64) -> i64
%498 = arith.muli %495, %495 : i64
%499 = arith.constant 400000 : i32
%500 = arith.extsi %499 : i32 to i64
%502 = arith.constant 4 : i32
%503 = arith.extsi %502 : i32 to i64
%501 = func.call @calloc(%500, %503) : (i64, i64) -> !llvm.ptr
%505 = arith.constant 4 : i32
%506 = arith.extsi %505 : i32 to i64
%504 = func.call @calloc(%500, %506) : (i64, i64) -> !llvm.ptr
%508 = arith.constant 4 : i32
%509 = arith.extsi %508 : i32 to i64
%507 = func.call @calloc(%500, %509) : (i64, i64) -> !llvm.ptr
%510 = arith.constant 0 : i32
%511 = arith.extsi %510 : i32 to i64
%512 = llvm.mlir.constant(1 : i64) : i64
%513 = llvm.alloca %512 x i64 : (i64) -> !llvm.ptr
llvm.store %511, %513 : i64, !llvm.ptr
%514 = arith.constant 0 : i32
%515 = arith.constant 1 : i32
%516 = arith.subi %514, %515 : i32
%517 = arith.extsi %516 : i32 to i64
%518 = llvm.mlir.constant(1 : i64) : i64
%519 = llvm.alloca %518 x i64 : (i64) -> !llvm.ptr
llvm.store %517, %519 : i64, !llvm.ptr
%520 = arith.constant 0 : i32
%521 = arith.extsi %520 : i32 to i64
%522 = llvm.mlir.constant(1 : i64) : i64
%523 = llvm.alloca %522 x i64 : (i64) -> !llvm.ptr
llvm.store %521, %523 : i64, !llvm.ptr
cf.br ^bb105
^bb105:
%524 = llvm.load %523 : !llvm.ptr -> i64
%525 = arith.cmpi sle, %524, %495 : i64
cf.cond_br %525, ^bb106, ^bb107
^bb106:
%526 = llvm.load %523 : !llvm.ptr -> i64
%527 = llvm.load %523 : !llvm.ptr -> i64
%528 = arith.muli %526, %527 : i64
%529 = arith.subi %498, %528 : i64
%530 = arith.constant 0 : i32
%532 = arith.extsi %530 : i32 to i64
%531 = arith.cmpi eq, %529, %532 : i64
cf.cond_br %531, ^bb108, ^bb109
^bb108:
%533 = arith.constant 0 : i32
%534 = llvm.load %513 : !llvm.ptr -> i64
%535 = llvm.getelementptr %501[%534] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %533, %535 : i32, !llvm.ptr
%536 = arith.constant 0 : i32
%537 = llvm.load %513 : !llvm.ptr -> i64
%538 = llvm.getelementptr %504[%537] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %536, %538 : i32, !llvm.ptr
%539 = llvm.load %523 : !llvm.ptr -> i64
%540 = arith.trunci %539 : i64 to i32
%541 = llvm.load %513 : !llvm.ptr -> i64
%542 = llvm.getelementptr %507[%541] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %540, %542 : i32, !llvm.ptr
%543 = llvm.load %523 : !llvm.ptr -> i64
%544 = arith.cmpi eq, %543, %495 : i64
cf.cond_br %544, ^bb111, ^bb112
^bb111:
%545 = llvm.load %513 : !llvm.ptr -> i64
llvm.store %545, %519 : i64, !llvm.ptr
cf.br ^bb113
^bb112:
cf.br ^bb113
^bb113:
%546 = llvm.load %513 : !llvm.ptr -> i64
%547 = arith.constant 1 : i32
%549 = arith.extsi %547 : i32 to i64
%548 = arith.addi %546, %549 : i64
llvm.store %548, %513 : i64, !llvm.ptr
cf.br ^bb110
^bb109:
%550 = llvm.load %523 : !llvm.ptr -> i64
%551 = arith.subi %495, %550 : i64
%552 = llvm.load %523 : !llvm.ptr -> i64
%553 = arith.addi %495, %552 : i64
%554 = arith.constant 64 : i32
%555 = arith.extsi %554 : i32 to i64
%557 = arith.constant 8 : i32
%558 = arith.extsi %557 : i32 to i64
%556 = func.call @calloc(%555, %558) : (i64, i64) -> !llvm.ptr
%560 = arith.constant 8 : i32
%561 = arith.extsi %560 : i32 to i64
%559 = func.call @calloc(%555, %561) : (i64, i64) -> !llvm.ptr
%562 = arith.constant 0 : i32
%563 = arith.extsi %562 : i32 to i64
%564 = llvm.mlir.constant(1 : i64) : i64
%565 = llvm.alloca %564 x i64 : (i64) -> !llvm.ptr
llvm.store %563, %565 : i64, !llvm.ptr
%566 = llvm.mlir.constant(1 : i64) : i64
%567 = llvm.alloca %566 x i64 : (i64) -> !llvm.ptr
llvm.store %551, %567 : i64, !llvm.ptr
cf.br ^bb114
^bb114:
%568 = llvm.load %567 : !llvm.ptr -> i64
%569 = arith.constant 1 : i32
%571 = arith.extsi %569 : i32 to i64
%570 = arith.cmpi sgt, %568, %571 : i64
cf.cond_br %570, ^bb115, ^bb116
^bb115:
%573 = llvm.load %567 : !llvm.ptr -> i64
%574 = llvm.getelementptr %334[%573] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%572 = llvm.load %574 : !llvm.ptr -> i32
%575 = arith.extsi %572 : i32 to i64
%576 = arith.constant 0 : i32
%577 = arith.extsi %576 : i32 to i64
%578 = llvm.mlir.constant(1 : i64) : i64
%579 = llvm.alloca %578 x i64 : (i64) -> !llvm.ptr
llvm.store %577, %579 : i64, !llvm.ptr
cf.br ^bb117
^bb117:
%580 = llvm.load %567 : !llvm.ptr -> i64
%581 = arith.remsi %580, %575 : i64
%582 = arith.constant 0 : i32
%584 = arith.extsi %582 : i32 to i64
%583 = arith.cmpi eq, %581, %584 : i64
cf.cond_br %583, ^bb118, ^bb119
^bb118:
%585 = llvm.load %567 : !llvm.ptr -> i64
%586 = arith.divsi %585, %575 : i64
llvm.store %586, %567 : i64, !llvm.ptr
%587 = llvm.load %579 : !llvm.ptr -> i64
%588 = arith.constant 1 : i32
%590 = arith.extsi %588 : i32 to i64
%589 = arith.addi %587, %590 : i64
llvm.store %589, %579 : i64, !llvm.ptr
cf.br ^bb117
^bb119:
%591 = arith.constant 0 : i32
%592 = arith.constant 1 : i32
%593 = arith.subi %591, %592 : i32
%594 = arith.extsi %593 : i32 to i64
%595 = llvm.mlir.constant(1 : i64) : i64
%596 = llvm.alloca %595 x i64 : (i64) -> !llvm.ptr
llvm.store %594, %596 : i64, !llvm.ptr
%597 = arith.constant 0 : i32
%598 = arith.extsi %597 : i32 to i64
%599 = llvm.mlir.constant(1 : i64) : i64
%600 = llvm.alloca %599 x i64 : (i64) -> !llvm.ptr
llvm.store %598, %600 : i64, !llvm.ptr
cf.br ^bb120
^bb120:
%601 = llvm.load %600 : !llvm.ptr -> i64
%602 = llvm.load %565 : !llvm.ptr -> i64
%603 = arith.cmpi slt, %601, %602 : i64
cf.cond_br %603, ^bb121, ^bb122
^bb121:
%605 = llvm.load %600 : !llvm.ptr -> i64
%606 = llvm.getelementptr %556[%605] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%604 = llvm.load %606 : !llvm.ptr -> i64
%607 = arith.cmpi eq, %604, %575 : i64
cf.cond_br %607, ^bb123, ^bb124
^bb123:
%608 = llvm.load %600 : !llvm.ptr -> i64
llvm.store %608, %596 : i64, !llvm.ptr
cf.br ^bb122
^bb124:
cf.br ^bb125
^bb125:
%609 = llvm.load %600 : !llvm.ptr -> i64
%610 = arith.constant 1 : i32
%612 = arith.extsi %610 : i32 to i64
%611 = arith.addi %609, %612 : i64
llvm.store %611, %600 : i64, !llvm.ptr
cf.br ^bb120
^bb122:
%613 = llvm.load %596 : !llvm.ptr -> i64
%614 = arith.constant 0 : i32
%616 = arith.extsi %614 : i32 to i64
%615 = arith.cmpi sge, %613, %616 : i64
cf.cond_br %615, ^bb126, ^bb127
^bb126:
%618 = llvm.load %596 : !llvm.ptr -> i64
%619 = llvm.getelementptr %559[%618] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%617 = llvm.load %619 : !llvm.ptr -> i64
%620 = llvm.load %579 : !llvm.ptr -> i64
%621 = arith.addi %617, %620 : i64
%622 = llvm.load %596 : !llvm.ptr -> i64
%623 = llvm.getelementptr %559[%622] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %621, %623 : i64, !llvm.ptr
cf.br ^bb128
^bb127:
%624 = llvm.load %565 : !llvm.ptr -> i64
%625 = llvm.getelementptr %556[%624] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %575, %625 : i64, !llvm.ptr
%626 = llvm.load %579 : !llvm.ptr -> i64
%627 = llvm.load %565 : !llvm.ptr -> i64
%628 = llvm.getelementptr %559[%627] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %626, %628 : i64, !llvm.ptr
%629 = llvm.load %565 : !llvm.ptr -> i64
%630 = arith.constant 1 : i32
%632 = arith.extsi %630 : i32 to i64
%631 = arith.addi %629, %632 : i64
llvm.store %631, %565 : i64, !llvm.ptr
cf.br ^bb128
^bb128:
cf.br ^bb114
^bb116:
llvm.store %553, %567 : i64, !llvm.ptr
cf.br ^bb129
^bb129:
%633 = llvm.load %567 : !llvm.ptr -> i64
%634 = arith.constant 1 : i32
%636 = arith.extsi %634 : i32 to i64
%635 = arith.cmpi sgt, %633, %636 : i64
cf.cond_br %635, ^bb130, ^bb131
^bb130:
%638 = llvm.load %567 : !llvm.ptr -> i64
%639 = llvm.getelementptr %334[%638] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%637 = llvm.load %639 : !llvm.ptr -> i32
%640 = arith.extsi %637 : i32 to i64
%641 = arith.constant 0 : i32
%642 = arith.extsi %641 : i32 to i64
%643 = llvm.mlir.constant(1 : i64) : i64
%644 = llvm.alloca %643 x i64 : (i64) -> !llvm.ptr
llvm.store %642, %644 : i64, !llvm.ptr
cf.br ^bb132
^bb132:
%645 = llvm.load %567 : !llvm.ptr -> i64
%646 = arith.remsi %645, %640 : i64
%647 = arith.constant 0 : i32
%649 = arith.extsi %647 : i32 to i64
%648 = arith.cmpi eq, %646, %649 : i64
cf.cond_br %648, ^bb133, ^bb134
^bb133:
%650 = llvm.load %567 : !llvm.ptr -> i64
%651 = arith.divsi %650, %640 : i64
llvm.store %651, %567 : i64, !llvm.ptr
%652 = llvm.load %644 : !llvm.ptr -> i64
%653 = arith.constant 1 : i32
%655 = arith.extsi %653 : i32 to i64
%654 = arith.addi %652, %655 : i64
llvm.store %654, %644 : i64, !llvm.ptr
cf.br ^bb132
^bb134:
%656 = arith.constant 0 : i32
%657 = arith.constant 1 : i32
%658 = arith.subi %656, %657 : i32
%659 = arith.extsi %658 : i32 to i64
%660 = llvm.mlir.constant(1 : i64) : i64
%661 = llvm.alloca %660 x i64 : (i64) -> !llvm.ptr
llvm.store %659, %661 : i64, !llvm.ptr
%662 = arith.constant 0 : i32
%663 = arith.extsi %662 : i32 to i64
%664 = llvm.mlir.constant(1 : i64) : i64
%665 = llvm.alloca %664 x i64 : (i64) -> !llvm.ptr
llvm.store %663, %665 : i64, !llvm.ptr
cf.br ^bb135
^bb135:
%666 = llvm.load %665 : !llvm.ptr -> i64
%667 = llvm.load %565 : !llvm.ptr -> i64
%668 = arith.cmpi slt, %666, %667 : i64
cf.cond_br %668, ^bb136, ^bb137
^bb136:
%670 = llvm.load %665 : !llvm.ptr -> i64
%671 = llvm.getelementptr %556[%670] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%669 = llvm.load %671 : !llvm.ptr -> i64
%672 = arith.cmpi eq, %669, %640 : i64
cf.cond_br %672, ^bb138, ^bb139
^bb138:
%673 = llvm.load %665 : !llvm.ptr -> i64
llvm.store %673, %661 : i64, !llvm.ptr
cf.br ^bb137
^bb139:
cf.br ^bb140
^bb140:
%674 = llvm.load %665 : !llvm.ptr -> i64
%675 = arith.constant 1 : i32
%677 = arith.extsi %675 : i32 to i64
%676 = arith.addi %674, %677 : i64
llvm.store %676, %665 : i64, !llvm.ptr
cf.br ^bb135
^bb137:
%678 = llvm.load %661 : !llvm.ptr -> i64
%679 = arith.constant 0 : i32
%681 = arith.extsi %679 : i32 to i64
%680 = arith.cmpi sge, %678, %681 : i64
cf.cond_br %680, ^bb141, ^bb142
^bb141:
%683 = llvm.load %661 : !llvm.ptr -> i64
%684 = llvm.getelementptr %559[%683] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%682 = llvm.load %684 : !llvm.ptr -> i64
%685 = llvm.load %644 : !llvm.ptr -> i64
%686 = arith.addi %682, %685 : i64
%687 = llvm.load %661 : !llvm.ptr -> i64
%688 = llvm.getelementptr %559[%687] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %686, %688 : i64, !llvm.ptr
cf.br ^bb143
^bb142:
%689 = llvm.load %565 : !llvm.ptr -> i64
%690 = llvm.getelementptr %556[%689] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %640, %690 : i64, !llvm.ptr
%691 = llvm.load %644 : !llvm.ptr -> i64
%692 = llvm.load %565 : !llvm.ptr -> i64
%693 = llvm.getelementptr %559[%692] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %691, %693 : i64, !llvm.ptr
%694 = llvm.load %565 : !llvm.ptr -> i64
%695 = arith.constant 1 : i32
%697 = arith.extsi %695 : i32 to i64
%696 = arith.addi %694, %697 : i64
llvm.store %696, %565 : i64, !llvm.ptr
cf.br ^bb143
^bb143:
cf.br ^bb129
^bb131:
%698 = arith.constant 1 : i32
%699 = arith.extsi %698 : i32 to i64
%700 = llvm.mlir.constant(1 : i64) : i64
%701 = llvm.alloca %700 x i64 : (i64) -> !llvm.ptr
llvm.store %699, %701 : i64, !llvm.ptr
%702 = arith.constant 0 : i32
%703 = arith.extsi %702 : i32 to i64
%704 = llvm.mlir.constant(1 : i64) : i64
%705 = llvm.alloca %704 x i64 : (i64) -> !llvm.ptr
llvm.store %703, %705 : i64, !llvm.ptr
%706 = arith.constant 0 : i32
%707 = arith.extsi %706 : i32 to i64
%708 = llvm.mlir.constant(1 : i64) : i64
%709 = llvm.alloca %708 x i64 : (i64) -> !llvm.ptr
llvm.store %707, %709 : i64, !llvm.ptr
%710 = arith.constant 0 : i32
%711 = arith.extsi %710 : i32 to i64
%712 = llvm.mlir.constant(1 : i64) : i64
%713 = llvm.alloca %712 x i64 : (i64) -> !llvm.ptr
llvm.store %711, %713 : i64, !llvm.ptr
cf.br ^bb144
^bb144:
%714 = llvm.load %713 : !llvm.ptr -> i64
%715 = llvm.load %565 : !llvm.ptr -> i64
%716 = arith.cmpi slt, %714, %715 : i64
cf.cond_br %716, ^bb145, ^bb146
^bb145:
%718 = llvm.load %713 : !llvm.ptr -> i64
%719 = llvm.getelementptr %556[%718] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%717 = llvm.load %719 : !llvm.ptr -> i64
%720 = arith.constant 2 : i32
%722 = arith.extsi %720 : i32 to i64
%721 = arith.cmpi eq, %717, %722 : i64
cf.cond_br %721, ^bb147, ^bb148
^bb147:
%724 = llvm.load %713 : !llvm.ptr -> i64
%725 = llvm.getelementptr %559[%724] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%723 = llvm.load %725 : !llvm.ptr -> i64
llvm.store %723, %705 : i64, !llvm.ptr
%726 = llvm.load %701 : !llvm.ptr -> i64
%727 = llvm.load %705 : !llvm.ptr -> i64
%728 = arith.constant 2 : i32
%730 = arith.extsi %728 : i32 to i64
%729 = arith.divsi %727, %730 : i64
%731 = arith.shli %726, %729 : i64
llvm.store %731, %701 : i64, !llvm.ptr
%732 = llvm.load %705 : !llvm.ptr -> i64
%733 = arith.constant 1 : i32
%735 = arith.extsi %733 : i32 to i64
%734 = arith.andi %732, %735 : i64
llvm.store %734, %709 : i64, !llvm.ptr
cf.br ^bb149
^bb148:
cf.br ^bb149
^bb149:
%736 = llvm.load %713 : !llvm.ptr -> i64
%737 = arith.constant 1 : i32
%739 = arith.extsi %737 : i32 to i64
%738 = arith.addi %736, %739 : i64
llvm.store %738, %713 : i64, !llvm.ptr
cf.br ^bb144
^bb146:
%740 = arith.constant 1024 : i32
%741 = arith.extsi %740 : i32 to i64
%743 = arith.constant 8 : i32
%744 = arith.extsi %743 : i32 to i64
%742 = func.call @calloc(%741, %744) : (i64, i64) -> !llvm.ptr
%746 = arith.constant 8 : i32
%747 = arith.extsi %746 : i32 to i64
%745 = func.call @calloc(%741, %747) : (i64, i64) -> !llvm.ptr
%748 = arith.constant 1 : i32
%749 = arith.extsi %748 : i32 to i64
%750 = llvm.mlir.constant(1 : i64) : i64
%751 = llvm.alloca %750 x i64 : (i64) -> !llvm.ptr
llvm.store %749, %751 : i64, !llvm.ptr
%752 = arith.constant 1 : i32
%753 = arith.constant 0 : i32
%754 = arith.extsi %752 : i32 to i64
%755 = arith.extsi %753 : i32 to i64
%756 = llvm.getelementptr %742[%755] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %754, %756 : i64, !llvm.ptr
%757 = arith.constant 0 : i32
%758 = arith.constant 0 : i32
%759 = arith.extsi %757 : i32 to i64
%760 = arith.extsi %758 : i32 to i64
%761 = llvm.getelementptr %745[%760] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %759, %761 : i64, !llvm.ptr
%762 = arith.constant 1 : i32
%763 = arith.extsi %762 : i32 to i64
%764 = llvm.mlir.constant(1 : i64) : i64
%765 = llvm.alloca %764 x i64 : (i64) -> !llvm.ptr
llvm.store %763, %765 : i64, !llvm.ptr
%766 = arith.constant 0 : i32
%767 = arith.extsi %766 : i32 to i64
llvm.store %767, %713 : i64, !llvm.ptr
cf.br ^bb150
^bb150:
%768 = llvm.load %713 : !llvm.ptr -> i64
%769 = llvm.load %565 : !llvm.ptr -> i64
%770 = arith.cmpi slt, %768, %769 : i64
cf.cond_br %770, ^bb151, ^bb152
^bb151:
%772 = llvm.load %713 : !llvm.ptr -> i64
%773 = llvm.getelementptr %556[%772] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%771 = llvm.load %773 : !llvm.ptr -> i64
%775 = llvm.load %713 : !llvm.ptr -> i64
%776 = llvm.getelementptr %559[%775] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%774 = llvm.load %776 : !llvm.ptr -> i64
%777 = arith.constant 2 : i32
%779 = arith.extsi %777 : i32 to i64
%778 = arith.cmpi eq, %771, %779 : i64
cf.cond_br %778, ^bb153, ^bb154
^bb153:
%780 = llvm.load %713 : !llvm.ptr -> i64
%781 = arith.constant 1 : i32
%783 = arith.extsi %781 : i32 to i64
%782 = arith.addi %780, %783 : i64
llvm.store %782, %713 : i64, !llvm.ptr
cf.br ^bb150
^bb154:
cf.br ^bb155
^bb155:
%784 = arith.constant 3 : i32
%786 = arith.extsi %784 : i32 to i64
%785 = arith.andi %771, %786 : i64
%787 = arith.constant 3 : i32
%789 = arith.extsi %787 : i32 to i64
%788 = arith.cmpi eq, %785, %789 : i64
cf.cond_br %788, ^bb156, ^bb157
^bb156:
%790 = arith.constant 1 : i32
%792 = arith.extsi %790 : i32 to i64
%791 = arith.andi %774, %792 : i64
%793 = arith.constant 1 : i32
%795 = arith.extsi %793 : i32 to i64
%794 = arith.cmpi eq, %791, %795 : i64
cf.cond_br %794, ^bb159, ^bb160
^bb159:
%796 = arith.constant 0 : i32
%797 = arith.extsi %796 : i32 to i64
llvm.store %797, %765 : i64, !llvm.ptr
cf.br ^bb152
^bb160:
cf.br ^bb161
^bb161:
%798 = arith.constant 0 : i32
%799 = arith.extsi %798 : i32 to i64
%800 = llvm.mlir.constant(1 : i64) : i64
%801 = llvm.alloca %800 x i64 : (i64) -> !llvm.ptr
llvm.store %799, %801 : i64, !llvm.ptr
cf.br ^bb162
^bb162:
%802 = llvm.load %801 : !llvm.ptr -> i64
%803 = arith.constant 2 : i32
%805 = arith.extsi %803 : i32 to i64
%804 = arith.divsi %774, %805 : i64
%806 = arith.cmpi slt, %802, %804 : i64
cf.cond_br %806, ^bb163, ^bb164
^bb163:
%807 = llvm.load %701 : !llvm.ptr -> i64
%808 = arith.muli %807, %771 : i64
llvm.store %808, %701 : i64, !llvm.ptr
%809 = llvm.load %801 : !llvm.ptr -> i64
%810 = arith.constant 1 : i32
%812 = arith.extsi %810 : i32 to i64
%811 = arith.addi %809, %812 : i64
llvm.store %811, %801 : i64, !llvm.ptr
cf.br ^bb162
^bb164:
%813 = llvm.load %713 : !llvm.ptr -> i64
%814 = arith.constant 1 : i32
%816 = arith.extsi %814 : i32 to i64
%815 = arith.addi %813, %816 : i64
llvm.store %815, %713 : i64, !llvm.ptr
cf.br ^bb150
^bb157:
cf.br ^bb158
^bb158:
%817 = func.call @hget(%400, %403, %406, %399, %771) : (!llvm.ptr, !llvm.ptr, !llvm.ptr, i64, i64) -> i64
%818 = arith.constant 32 : i32
%820 = arith.extsi %818 : i32 to i64
%819 = arith.shrsi %817, %820 : i64
%821 = arith.constant -1 : i32
%823 = arith.extsi %821 : i32 to i64
%822 = arith.andi %817, %823 : i64
%825 = arith.constant 2 : i32
%827 = arith.extsi %825 : i32 to i64
%826 = arith.addi %774, %827 : i64
%828 = arith.constant 8 : i32
%829 = arith.extsi %828 : i32 to i64
%824 = func.call @calloc(%826, %829) : (i64, i64) -> !llvm.ptr
%831 = arith.constant 2 : i32
%833 = arith.extsi %831 : i32 to i64
%832 = arith.addi %774, %833 : i64
%834 = arith.constant 8 : i32
%835 = arith.extsi %834 : i32 to i64
%830 = func.call @calloc(%832, %835) : (i64, i64) -> !llvm.ptr
%837 = arith.constant 2 : i32
%839 = arith.extsi %837 : i32 to i64
%838 = arith.addi %774, %839 : i64
%840 = arith.constant 8 : i32
%841 = arith.extsi %840 : i32 to i64
%836 = func.call @calloc(%838, %841) : (i64, i64) -> !llvm.ptr
%843 = arith.constant 2 : i32
%845 = arith.extsi %843 : i32 to i64
%844 = arith.addi %774, %845 : i64
%846 = arith.constant 8 : i32
%847 = arith.extsi %846 : i32 to i64
%842 = func.call @calloc(%844, %847) : (i64, i64) -> !llvm.ptr
%848 = arith.constant 1 : i32
%849 = arith.constant 0 : i32
%850 = arith.extsi %848 : i32 to i64
%851 = arith.extsi %849 : i32 to i64
%852 = llvm.getelementptr %824[%851] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %850, %852 : i64, !llvm.ptr
%853 = arith.constant 0 : i32
%854 = arith.constant 0 : i32
%855 = arith.extsi %853 : i32 to i64
%856 = arith.extsi %854 : i32 to i64
%857 = llvm.getelementptr %830[%856] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %855, %857 : i64, !llvm.ptr
%858 = arith.constant 1 : i32
%859 = arith.constant 0 : i32
%860 = arith.extsi %858 : i32 to i64
%861 = arith.extsi %859 : i32 to i64
%862 = llvm.getelementptr %836[%861] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %860, %862 : i64, !llvm.ptr
%863 = arith.constant 0 : i32
%864 = arith.constant 0 : i32
%865 = arith.extsi %863 : i32 to i64
%866 = arith.extsi %864 : i32 to i64
%867 = llvm.getelementptr %842[%866] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %865, %867 : i64, !llvm.ptr
%868 = arith.constant 0 : i32
%869 = arith.extsi %868 : i32 to i64
%870 = llvm.mlir.constant(1 : i64) : i64
%871 = llvm.alloca %870 x i64 : (i64) -> !llvm.ptr
llvm.store %869, %871 : i64, !llvm.ptr
cf.br ^bb165
^bb165:
%872 = llvm.load %871 : !llvm.ptr -> i64
%873 = arith.cmpi slt, %872, %774 : i64
cf.cond_br %873, ^bb166, ^bb167
^bb166:
%875 = llvm.load %871 : !llvm.ptr -> i64
%876 = llvm.getelementptr %824[%875] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%874 = llvm.load %876 : !llvm.ptr -> i64
%877 = arith.muli %874, %819 : i64
%879 = llvm.load %871 : !llvm.ptr -> i64
%880 = llvm.getelementptr %830[%879] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%878 = llvm.load %880 : !llvm.ptr -> i64
%881 = arith.muli %878, %822 : i64
%882 = arith.subi %877, %881 : i64
%883 = llvm.load %871 : !llvm.ptr -> i64
%884 = arith.constant 1 : i32
%886 = arith.extsi %884 : i32 to i64
%885 = arith.addi %883, %886 : i64
%887 = llvm.getelementptr %824[%885] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %882, %887 : i64, !llvm.ptr
%889 = llvm.load %871 : !llvm.ptr -> i64
%890 = llvm.getelementptr %824[%889] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%888 = llvm.load %890 : !llvm.ptr -> i64
%891 = arith.muli %888, %822 : i64
%893 = llvm.load %871 : !llvm.ptr -> i64
%894 = llvm.getelementptr %830[%893] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%892 = llvm.load %894 : !llvm.ptr -> i64
%895 = arith.muli %892, %819 : i64
%896 = arith.addi %891, %895 : i64
%897 = llvm.load %871 : !llvm.ptr -> i64
%898 = arith.constant 1 : i32
%900 = arith.extsi %898 : i32 to i64
%899 = arith.addi %897, %900 : i64
%901 = llvm.getelementptr %830[%899] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %896, %901 : i64, !llvm.ptr
%903 = llvm.load %871 : !llvm.ptr -> i64
%904 = llvm.getelementptr %836[%903] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%902 = llvm.load %904 : !llvm.ptr -> i64
%905 = arith.muli %902, %819 : i64
%907 = llvm.load %871 : !llvm.ptr -> i64
%908 = llvm.getelementptr %842[%907] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%906 = llvm.load %908 : !llvm.ptr -> i64
%909 = arith.constant 0 : i32
%911 = arith.extsi %909 : i32 to i64
%910 = arith.subi %911, %822 : i64
%912 = arith.muli %906, %910 : i64
%913 = arith.subi %905, %912 : i64
%914 = llvm.load %871 : !llvm.ptr -> i64
%915 = arith.constant 1 : i32
%917 = arith.extsi %915 : i32 to i64
%916 = arith.addi %914, %917 : i64
%918 = llvm.getelementptr %836[%916] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %913, %918 : i64, !llvm.ptr
%920 = llvm.load %871 : !llvm.ptr -> i64
%921 = llvm.getelementptr %836[%920] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%919 = llvm.load %921 : !llvm.ptr -> i64
%922 = arith.constant 0 : i32
%924 = arith.extsi %922 : i32 to i64
%923 = arith.subi %924, %822 : i64
%925 = arith.muli %919, %923 : i64
%927 = llvm.load %871 : !llvm.ptr -> i64
%928 = llvm.getelementptr %842[%927] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%926 = llvm.load %928 : !llvm.ptr -> i64
%929 = arith.muli %926, %819 : i64
%930 = arith.addi %925, %929 : i64
%931 = llvm.load %871 : !llvm.ptr -> i64
%932 = arith.constant 1 : i32
%934 = arith.extsi %932 : i32 to i64
%933 = arith.addi %931, %934 : i64
%935 = llvm.getelementptr %842[%933] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %930, %935 : i64, !llvm.ptr
%936 = llvm.load %871 : !llvm.ptr -> i64
%937 = arith.constant 1 : i32
%939 = arith.extsi %937 : i32 to i64
%938 = arith.addi %936, %939 : i64
llvm.store %938, %871 : i64, !llvm.ptr
cf.br ^bb165
^bb167:
%941 = arith.constant 8 : i32
%942 = arith.extsi %941 : i32 to i64
%940 = func.call @calloc(%741, %942) : (i64, i64) -> !llvm.ptr
%944 = arith.constant 8 : i32
%945 = arith.extsi %944 : i32 to i64
%943 = func.call @calloc(%741, %945) : (i64, i64) -> !llvm.ptr
%946 = arith.constant 0 : i32
%947 = arith.extsi %946 : i32 to i64
%948 = llvm.mlir.constant(1 : i64) : i64
%949 = llvm.alloca %948 x i64 : (i64) -> !llvm.ptr
llvm.store %947, %949 : i64, !llvm.ptr
%950 = arith.constant 0 : i32
%951 = arith.extsi %950 : i32 to i64
%952 = llvm.mlir.constant(1 : i64) : i64
%953 = llvm.alloca %952 x i64 : (i64) -> !llvm.ptr
llvm.store %951, %953 : i64, !llvm.ptr
cf.br ^bb168
^bb168:
%954 = llvm.load %953 : !llvm.ptr -> i64
%955 = llvm.load %751 : !llvm.ptr -> i64
%956 = arith.cmpi slt, %954, %955 : i64
cf.cond_br %956, ^bb169, ^bb170
^bb169:
%957 = arith.constant 0 : i32
%958 = arith.extsi %957 : i32 to i64
llvm.store %958, %871 : i64, !llvm.ptr
cf.br ^bb171
^bb171:
%959 = llvm.load %871 : !llvm.ptr -> i64
%960 = arith.cmpi sle, %959, %774 : i64
cf.cond_br %960, ^bb172, ^bb173
^bb172:
%962 = llvm.load %871 : !llvm.ptr -> i64
%963 = llvm.getelementptr %824[%962] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%961 = llvm.load %963 : !llvm.ptr -> i64
%965 = llvm.load %871 : !llvm.ptr -> i64
%966 = llvm.getelementptr %830[%965] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%964 = llvm.load %966 : !llvm.ptr -> i64
%968 = llvm.load %871 : !llvm.ptr -> i64
%969 = arith.subi %774, %968 : i64
%970 = llvm.getelementptr %836[%969] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%967 = llvm.load %970 : !llvm.ptr -> i64
%972 = llvm.load %871 : !llvm.ptr -> i64
%973 = arith.subi %774, %972 : i64
%974 = llvm.getelementptr %842[%973] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%971 = llvm.load %974 : !llvm.ptr -> i64
%975 = arith.muli %961, %967 : i64
%976 = arith.muli %964, %971 : i64
%977 = arith.subi %975, %976 : i64
%978 = arith.muli %961, %971 : i64
%979 = arith.muli %964, %967 : i64
%980 = arith.addi %978, %979 : i64
%982 = llvm.load %953 : !llvm.ptr -> i64
%983 = llvm.getelementptr %742[%982] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%981 = llvm.load %983 : !llvm.ptr -> i64
%984 = arith.muli %981, %977 : i64
%986 = llvm.load %953 : !llvm.ptr -> i64
%987 = llvm.getelementptr %745[%986] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%985 = llvm.load %987 : !llvm.ptr -> i64
%988 = arith.muli %985, %980 : i64
%989 = arith.subi %984, %988 : i64
%990 = llvm.load %949 : !llvm.ptr -> i64
%991 = llvm.getelementptr %940[%990] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %989, %991 : i64, !llvm.ptr
%993 = llvm.load %953 : !llvm.ptr -> i64
%994 = llvm.getelementptr %742[%993] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%992 = llvm.load %994 : !llvm.ptr -> i64
%995 = arith.muli %992, %980 : i64
%997 = llvm.load %953 : !llvm.ptr -> i64
%998 = llvm.getelementptr %745[%997] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%996 = llvm.load %998 : !llvm.ptr -> i64
%999 = arith.muli %996, %977 : i64
%1000 = arith.addi %995, %999 : i64
%1001 = llvm.load %949 : !llvm.ptr -> i64
%1002 = llvm.getelementptr %943[%1001] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1000, %1002 : i64, !llvm.ptr
%1003 = llvm.load %949 : !llvm.ptr -> i64
%1004 = arith.constant 1 : i32
%1006 = arith.extsi %1004 : i32 to i64
%1005 = arith.addi %1003, %1006 : i64
llvm.store %1005, %949 : i64, !llvm.ptr
%1007 = llvm.load %871 : !llvm.ptr -> i64
%1008 = arith.constant 1 : i32
%1010 = arith.extsi %1008 : i32 to i64
%1009 = arith.addi %1007, %1010 : i64
llvm.store %1009, %871 : i64, !llvm.ptr
cf.br ^bb171
^bb173:
%1011 = llvm.load %953 : !llvm.ptr -> i64
%1012 = arith.constant 1 : i32
%1014 = arith.extsi %1012 : i32 to i64
%1013 = arith.addi %1011, %1014 : i64
llvm.store %1013, %953 : i64, !llvm.ptr
cf.br ^bb168
^bb170:
%1015 = llvm.load %949 : !llvm.ptr -> i64
llvm.store %1015, %751 : i64, !llvm.ptr
%1016 = arith.constant 0 : i32
%1017 = arith.extsi %1016 : i32 to i64
llvm.store %1017, %953 : i64, !llvm.ptr
cf.br ^bb174
^bb174:
%1018 = llvm.load %953 : !llvm.ptr -> i64
%1019 = llvm.load %751 : !llvm.ptr -> i64
%1020 = arith.cmpi slt, %1018, %1019 : i64
cf.cond_br %1020, ^bb175, ^bb176
^bb175:
%1022 = llvm.load %953 : !llvm.ptr -> i64
%1023 = llvm.getelementptr %940[%1022] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1021 = llvm.load %1023 : !llvm.ptr -> i64
%1024 = llvm.load %953 : !llvm.ptr -> i64
%1025 = llvm.getelementptr %742[%1024] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1021, %1025 : i64, !llvm.ptr
%1027 = llvm.load %953 : !llvm.ptr -> i64
%1028 = llvm.getelementptr %943[%1027] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1026 = llvm.load %1028 : !llvm.ptr -> i64
%1029 = llvm.load %953 : !llvm.ptr -> i64
%1030 = llvm.getelementptr %745[%1029] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1026, %1030 : i64, !llvm.ptr
%1031 = llvm.load %953 : !llvm.ptr -> i64
%1032 = arith.constant 1 : i32
%1034 = arith.extsi %1032 : i32 to i64
%1033 = arith.addi %1031, %1034 : i64
llvm.store %1033, %953 : i64, !llvm.ptr
cf.br ^bb174
^bb176:
func.call @free(%943) : (!llvm.ptr) -> ()
func.call @free(%940) : (!llvm.ptr) -> ()
func.call @free(%842) : (!llvm.ptr) -> ()
func.call @free(%836) : (!llvm.ptr) -> ()
func.call @free(%830) : (!llvm.ptr) -> ()
func.call @free(%824) : (!llvm.ptr) -> ()
%1041 = llvm.load %713 : !llvm.ptr -> i64
%1042 = arith.constant 1 : i32
%1044 = arith.extsi %1042 : i32 to i64
%1043 = arith.addi %1041, %1044 : i64
llvm.store %1043, %713 : i64, !llvm.ptr
cf.br ^bb150
^bb152:
%1045 = llvm.load %765 : !llvm.ptr -> i64
%1046 = arith.constant 1 : i32
%1048 = arith.extsi %1046 : i32 to i64
%1047 = arith.cmpi eq, %1045, %1048 : i64
cf.cond_br %1047, ^bb177, ^bb178
^bb177:
%1049 = llvm.load %709 : !llvm.ptr -> i64
%1050 = arith.constant 1 : i32
%1052 = arith.extsi %1050 : i32 to i64
%1051 = arith.cmpi eq, %1049, %1052 : i64
cf.cond_br %1051, ^bb180, ^bb181
^bb180:
%1053 = arith.constant 0 : i32
%1054 = arith.extsi %1053 : i32 to i64
%1055 = llvm.mlir.constant(1 : i64) : i64
%1056 = llvm.alloca %1055 x i64 : (i64) -> !llvm.ptr
llvm.store %1054, %1056 : i64, !llvm.ptr
cf.br ^bb183
^bb183:
%1057 = llvm.load %1056 : !llvm.ptr -> i64
%1058 = llvm.load %751 : !llvm.ptr -> i64
%1059 = arith.cmpi slt, %1057, %1058 : i64
cf.cond_br %1059, ^bb184, ^bb185
^bb184:
%1061 = llvm.load %1056 : !llvm.ptr -> i64
%1062 = llvm.getelementptr %742[%1061] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1060 = llvm.load %1062 : !llvm.ptr -> i64
%1064 = llvm.load %1056 : !llvm.ptr -> i64
%1065 = llvm.getelementptr %745[%1064] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1063 = llvm.load %1065 : !llvm.ptr -> i64
%1066 = arith.subi %1060, %1063 : i64
%1067 = llvm.load %1056 : !llvm.ptr -> i64
%1068 = llvm.getelementptr %742[%1067] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1066, %1068 : i64, !llvm.ptr
%1069 = arith.addi %1060, %1063 : i64
%1070 = llvm.load %1056 : !llvm.ptr -> i64
%1071 = llvm.getelementptr %745[%1070] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1069, %1071 : i64, !llvm.ptr
%1072 = llvm.load %1056 : !llvm.ptr -> i64
%1073 = arith.constant 1 : i32
%1075 = arith.extsi %1073 : i32 to i64
%1074 = arith.addi %1072, %1075 : i64
llvm.store %1074, %1056 : i64, !llvm.ptr
cf.br ^bb183
^bb185:
cf.br ^bb182
^bb181:
cf.br ^bb182
^bb182:
%1076 = llvm.load %701 : !llvm.ptr -> i64
%1077 = arith.constant 1 : i32
%1079 = arith.extsi %1077 : i32 to i64
%1078 = arith.cmpi ne, %1076, %1079 : i64
cf.cond_br %1078, ^bb186, ^bb187
^bb186:
%1080 = arith.constant 0 : i32
%1081 = arith.extsi %1080 : i32 to i64
%1082 = llvm.mlir.constant(1 : i64) : i64
%1083 = llvm.alloca %1082 x i64 : (i64) -> !llvm.ptr
llvm.store %1081, %1083 : i64, !llvm.ptr
cf.br ^bb189
^bb189:
%1084 = llvm.load %1083 : !llvm.ptr -> i64
%1085 = llvm.load %751 : !llvm.ptr -> i64
%1086 = arith.cmpi slt, %1084, %1085 : i64
cf.cond_br %1086, ^bb190, ^bb191
^bb190:
%1088 = llvm.load %1083 : !llvm.ptr -> i64
%1089 = llvm.getelementptr %742[%1088] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1087 = llvm.load %1089 : !llvm.ptr -> i64
%1090 = llvm.load %701 : !llvm.ptr -> i64
%1091 = arith.muli %1087, %1090 : i64
%1092 = llvm.load %1083 : !llvm.ptr -> i64
%1093 = llvm.getelementptr %742[%1092] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1091, %1093 : i64, !llvm.ptr
%1095 = llvm.load %1083 : !llvm.ptr -> i64
%1096 = llvm.getelementptr %745[%1095] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1094 = llvm.load %1096 : !llvm.ptr -> i64
%1097 = llvm.load %701 : !llvm.ptr -> i64
%1098 = arith.muli %1094, %1097 : i64
%1099 = llvm.load %1083 : !llvm.ptr -> i64
%1100 = llvm.getelementptr %745[%1099] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1098, %1100 : i64, !llvm.ptr
%1101 = llvm.load %1083 : !llvm.ptr -> i64
%1102 = arith.constant 1 : i32
%1104 = arith.extsi %1102 : i32 to i64
%1103 = arith.addi %1101, %1104 : i64
llvm.store %1103, %1083 : i64, !llvm.ptr
cf.br ^bb189
^bb191:
cf.br ^bb188
^bb187:
cf.br ^bb188
^bb188:
%1105 = arith.constant 1 : i32
%1106 = arith.constant 10 : i32
%1107 = arith.shli %1105, %1106 : i32
%1108 = arith.extsi %1107 : i32 to i64
%1110 = arith.constant 8 : i32
%1111 = arith.extsi %1110 : i32 to i64
%1109 = func.call @calloc(%1108, %1111) : (i64, i64) -> !llvm.ptr
%1113 = arith.constant 1 : i32
%1114 = arith.extsi %1113 : i32 to i64
%1112 = func.call @calloc(%1108, %1114) : (i64, i64) -> !llvm.ptr
%1115 = arith.constant 0 : i32
%1116 = arith.extsi %1115 : i32 to i64
%1117 = llvm.mlir.constant(1 : i64) : i64
%1118 = llvm.alloca %1117 x i64 : (i64) -> !llvm.ptr
llvm.store %1116, %1118 : i64, !llvm.ptr
cf.br ^bb192
^bb192:
%1119 = llvm.load %1118 : !llvm.ptr -> i64
%1120 = llvm.load %751 : !llvm.ptr -> i64
%1121 = arith.cmpi slt, %1119, %1120 : i64
cf.cond_br %1121, ^bb193, ^bb194
^bb193:
%1124 = llvm.load %1118 : !llvm.ptr -> i64
%1125 = llvm.getelementptr %742[%1124] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1123 = llvm.load %1125 : !llvm.ptr -> i64
%1122 = func.call @abs64(%1123) : (i64) -> i64
%1126 = llvm.mlir.constant(1 : i64) : i64
%1127 = llvm.alloca %1126 x i64 : (i64) -> !llvm.ptr
llvm.store %1122, %1127 : i64, !llvm.ptr
%1130 = llvm.load %1118 : !llvm.ptr -> i64
%1131 = llvm.getelementptr %745[%1130] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1129 = llvm.load %1131 : !llvm.ptr -> i64
%1128 = func.call @abs64(%1129) : (i64) -> i64
%1132 = llvm.mlir.constant(1 : i64) : i64
%1133 = llvm.alloca %1132 x i64 : (i64) -> !llvm.ptr
llvm.store %1128, %1133 : i64, !llvm.ptr
%1134 = llvm.load %1127 : !llvm.ptr -> i64
%1135 = llvm.load %1133 : !llvm.ptr -> i64
%1136 = arith.cmpi slt, %1134, %1135 : i64
cf.cond_br %1136, ^bb195, ^bb196
^bb195:
%1137 = llvm.load %1127 : !llvm.ptr -> i64
%1138 = llvm.load %1133 : !llvm.ptr -> i64
llvm.store %1138, %1127 : i64, !llvm.ptr
llvm.store %1137, %1133 : i64, !llvm.ptr
cf.br ^bb197
^bb196:
cf.br ^bb197
^bb197:
%1139 = llvm.load %1127 : !llvm.ptr -> i64
%1140 = arith.constant 32 : i32
%1142 = arith.extsi %1140 : i32 to i64
%1141 = arith.shli %1139, %1142 : i64
%1143 = llvm.load %1133 : !llvm.ptr -> i64
%1144 = arith.ori %1141, %1143 : i64
%1145 = llvm.mlir.constant(1 : i64) : i64
%1146 = llvm.alloca %1145 x i64 : (i64) -> !llvm.ptr
llvm.store %1144, %1146 : i64, !llvm.ptr
%1147 = llvm.load %1146 : !llvm.ptr -> i64
%1148 = arith.constant 0 : i32
%1150 = arith.extsi %1148 : i32 to i64
%1149 = arith.cmpi slt, %1147, %1150 : i64
cf.cond_br %1149, ^bb198, ^bb199
^bb198:
%1151 = arith.constant 0 : i32
%1152 = llvm.load %1146 : !llvm.ptr -> i64
%1154 = arith.extsi %1151 : i32 to i64
%1153 = arith.subi %1154, %1152 : i64
llvm.store %1153, %1146 : i64, !llvm.ptr
cf.br ^bb200
^bb199:
cf.br ^bb200
^bb200:
%1155 = llvm.load %1146 : !llvm.ptr -> i64
%1156 = arith.constant 1 : i32
%1158 = arith.extsi %1156 : i32 to i64
%1157 = arith.subi %1108, %1158 : i64
%1159 = arith.andi %1155, %1157 : i64
llvm.store %1159, %1146 : i64, !llvm.ptr
%1160 = arith.constant 0 : i32
%1161 = arith.extsi %1160 : i32 to i64
%1162 = llvm.mlir.constant(1 : i64) : i64
%1163 = llvm.alloca %1162 x i64 : (i64) -> !llvm.ptr
llvm.store %1161, %1163 : i64, !llvm.ptr
cf.br ^bb201
^bb201:
%1165 = llvm.load %1146 : !llvm.ptr -> i64
%1166 = llvm.getelementptr %1112[%1165] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%1164 = llvm.load %1166 : !llvm.ptr -> i8
%1167 = arith.constant 0 : i32
%1169 = arith.extsi %1164 : i8 to i32
%1168 = arith.cmpi ne, %1169, %1167 : i32
cf.cond_br %1168, ^bb202, ^bb203
^bb202:
%1171 = llvm.load %1146 : !llvm.ptr -> i64
%1172 = llvm.getelementptr %1109[%1171] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1170 = llvm.load %1172 : !llvm.ptr -> i64
%1173 = arith.cmpi eq, %1170, %1144 : i64
cf.cond_br %1173, ^bb204, ^bb205
^bb204:
%1174 = arith.constant 1 : i32
%1175 = arith.extsi %1174 : i32 to i64
llvm.store %1175, %1163 : i64, !llvm.ptr
cf.br ^bb203
^bb205:
cf.br ^bb206
^bb206:
%1176 = llvm.load %1146 : !llvm.ptr -> i64
%1177 = arith.constant 1 : i32
%1179 = arith.extsi %1177 : i32 to i64
%1178 = arith.addi %1176, %1179 : i64
%1180 = arith.constant 1 : i32
%1182 = arith.extsi %1180 : i32 to i64
%1181 = arith.subi %1108, %1182 : i64
%1183 = arith.andi %1178, %1181 : i64
llvm.store %1183, %1146 : i64, !llvm.ptr
cf.br ^bb201
^bb203:
%1184 = llvm.load %1163 : !llvm.ptr -> i64
%1185 = arith.constant 0 : i32
%1187 = arith.extsi %1185 : i32 to i64
%1186 = arith.cmpi eq, %1184, %1187 : i64
cf.cond_br %1186, ^bb207, ^bb208
^bb207:
%1188 = arith.constant 1 : i32
%1189 = llvm.load %1146 : !llvm.ptr -> i64
%1190 = arith.trunci %1188 : i32 to i8
%1191 = llvm.getelementptr %1112[%1189] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %1190, %1191 : i8, !llvm.ptr
%1192 = llvm.load %1146 : !llvm.ptr -> i64
%1193 = llvm.getelementptr %1109[%1192] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1144, %1193 : i64, !llvm.ptr
%1195 = llvm.load %1127 : !llvm.ptr -> i64
%1196 = arith.constant 0 : i32
%1197 = llvm.load %1127 : !llvm.ptr -> i64
%1199 = arith.extsi %1196 : i32 to i64
%1198 = arith.subi %1199, %1197 : i64
%1200 = llvm.mlir.constant(1 : i64) : i64
%1201 = llvm.alloca %1200 x !llvm.array<2 x i64> : (i64) -> !llvm.ptr
%1202 = llvm.mlir.zero : !llvm.array<2 x i64>
llvm.store %1202, %1201 : !llvm.array<2 x i64>, !llvm.ptr
%1203 = llvm.mlir.constant(0 : i64) : i64
%1204 = llvm.getelementptr %1201[0, %1203] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
llvm.store %1195, %1204 : i64, !llvm.ptr
%1205 = llvm.mlir.constant(1 : i64) : i64
%1206 = llvm.getelementptr %1201[0, %1205] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
llvm.store %1198, %1206 : i64, !llvm.ptr
%1208 = llvm.load %1133 : !llvm.ptr -> i64
%1209 = arith.constant 0 : i32
%1210 = llvm.load %1133 : !llvm.ptr -> i64
%1212 = arith.extsi %1209 : i32 to i64
%1211 = arith.subi %1212, %1210 : i64
%1213 = llvm.mlir.constant(1 : i64) : i64
%1214 = llvm.alloca %1213 x !llvm.array<2 x i64> : (i64) -> !llvm.ptr
%1215 = llvm.mlir.zero : !llvm.array<2 x i64>
llvm.store %1215, %1214 : !llvm.array<2 x i64>, !llvm.ptr
%1216 = llvm.mlir.constant(0 : i64) : i64
%1217 = llvm.getelementptr %1214[0, %1216] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
llvm.store %1208, %1217 : i64, !llvm.ptr
%1218 = llvm.mlir.constant(1 : i64) : i64
%1219 = llvm.getelementptr %1214[0, %1218] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
llvm.store %1211, %1219 : i64, !llvm.ptr
%1220 = arith.constant 2 : i32
%1221 = arith.extsi %1220 : i32 to i64
%1222 = llvm.mlir.constant(1 : i64) : i64
%1223 = llvm.alloca %1222 x i64 : (i64) -> !llvm.ptr
llvm.store %1221, %1223 : i64, !llvm.ptr
%1224 = arith.constant 2 : i32
%1225 = arith.extsi %1224 : i32 to i64
%1226 = llvm.mlir.constant(1 : i64) : i64
%1227 = llvm.alloca %1226 x i64 : (i64) -> !llvm.ptr
llvm.store %1225, %1227 : i64, !llvm.ptr
%1228 = llvm.load %1127 : !llvm.ptr -> i64
%1229 = arith.constant 0 : i32
%1231 = arith.extsi %1229 : i32 to i64
%1230 = arith.cmpi eq, %1228, %1231 : i64
cf.cond_br %1230, ^bb210, ^bb211
^bb210:
%1232 = arith.constant 1 : i32
%1233 = arith.extsi %1232 : i32 to i64
llvm.store %1233, %1223 : i64, !llvm.ptr
%1234 = arith.constant 0 : i32
%1235 = arith.constant 0 : i32
%1236 = arith.extsi %1234 : i32 to i64
%1237 = arith.extsi %1235 : i32 to i64
%1238 = llvm.getelementptr %1201[0, %1237] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
llvm.store %1236, %1238 : i64, !llvm.ptr
cf.br ^bb212
^bb211:
cf.br ^bb212
^bb212:
%1239 = llvm.load %1133 : !llvm.ptr -> i64
%1240 = arith.constant 0 : i32
%1242 = arith.extsi %1240 : i32 to i64
%1241 = arith.cmpi eq, %1239, %1242 : i64
cf.cond_br %1241, ^bb213, ^bb214
^bb213:
%1243 = arith.constant 1 : i32
%1244 = arith.extsi %1243 : i32 to i64
llvm.store %1244, %1227 : i64, !llvm.ptr
%1245 = arith.constant 0 : i32
%1246 = arith.constant 0 : i32
%1247 = arith.extsi %1245 : i32 to i64
%1248 = arith.extsi %1246 : i32 to i64
%1249 = llvm.getelementptr %1214[0, %1248] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
llvm.store %1247, %1249 : i64, !llvm.ptr
cf.br ^bb215
^bb214:
cf.br ^bb215
^bb215:
%1250 = llvm.load %1127 : !llvm.ptr -> i64
%1251 = llvm.load %1133 : !llvm.ptr -> i64
%1252 = arith.cmpi eq, %1250, %1251 : i64
cf.cond_br %1252, ^bb216, ^bb217
^bb216:
%1253 = arith.constant 0 : i32
%1254 = arith.extsi %1253 : i32 to i64
%1255 = llvm.mlir.constant(1 : i64) : i64
%1256 = llvm.alloca %1255 x i64 : (i64) -> !llvm.ptr
llvm.store %1254, %1256 : i64, !llvm.ptr
cf.br ^bb219
^bb219:
%1257 = llvm.load %1256 : !llvm.ptr -> i64
%1258 = llvm.load %1223 : !llvm.ptr -> i64
%1259 = arith.cmpi slt, %1257, %1258 : i64
cf.cond_br %1259, ^bb220, ^bb221
^bb220:
%1260 = arith.constant 0 : i32
%1261 = arith.extsi %1260 : i32 to i64
%1262 = llvm.mlir.constant(1 : i64) : i64
%1263 = llvm.alloca %1262 x i64 : (i64) -> !llvm.ptr
llvm.store %1261, %1263 : i64, !llvm.ptr
cf.br ^bb222
^bb222:
%1264 = llvm.load %1263 : !llvm.ptr -> i64
%1265 = llvm.load %1227 : !llvm.ptr -> i64
%1266 = arith.cmpi slt, %1264, %1265 : i64
cf.cond_br %1266, ^bb223, ^bb224
^bb223:
%1268 = llvm.load %1256 : !llvm.ptr -> i64
%1269 = llvm.getelementptr %1201[0, %1268] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
%1267 = llvm.load %1269 : !llvm.ptr -> i64
%1270 = arith.trunci %1267 : i64 to i32
%1271 = llvm.load %513 : !llvm.ptr -> i64
%1272 = llvm.getelementptr %501[%1271] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1270, %1272 : i32, !llvm.ptr
%1274 = llvm.load %1263 : !llvm.ptr -> i64
%1275 = llvm.getelementptr %1214[0, %1274] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
%1273 = llvm.load %1275 : !llvm.ptr -> i64
%1276 = arith.trunci %1273 : i64 to i32
%1277 = llvm.load %513 : !llvm.ptr -> i64
%1278 = llvm.getelementptr %504[%1277] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1276, %1278 : i32, !llvm.ptr
%1279 = llvm.load %523 : !llvm.ptr -> i64
%1280 = arith.trunci %1279 : i64 to i32
%1281 = llvm.load %513 : !llvm.ptr -> i64
%1282 = llvm.getelementptr %507[%1281] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1280, %1282 : i32, !llvm.ptr
%1283 = llvm.load %513 : !llvm.ptr -> i64
%1284 = arith.constant 1 : i32
%1286 = arith.extsi %1284 : i32 to i64
%1285 = arith.addi %1283, %1286 : i64
llvm.store %1285, %513 : i64, !llvm.ptr
%1287 = llvm.load %1263 : !llvm.ptr -> i64
%1288 = arith.constant 1 : i32
%1290 = arith.extsi %1288 : i32 to i64
%1289 = arith.addi %1287, %1290 : i64
llvm.store %1289, %1263 : i64, !llvm.ptr
cf.br ^bb222
^bb224:
%1291 = llvm.load %1256 : !llvm.ptr -> i64
%1292 = arith.constant 1 : i32
%1294 = arith.extsi %1292 : i32 to i64
%1293 = arith.addi %1291, %1294 : i64
llvm.store %1293, %1256 : i64, !llvm.ptr
cf.br ^bb219
^bb221:
cf.br ^bb218
^bb217:
%1295 = arith.constant 0 : i32
%1296 = arith.extsi %1295 : i32 to i64
%1297 = llvm.mlir.constant(1 : i64) : i64
%1298 = llvm.alloca %1297 x i64 : (i64) -> !llvm.ptr
llvm.store %1296, %1298 : i64, !llvm.ptr
cf.br ^bb225
^bb225:
%1299 = llvm.load %1298 : !llvm.ptr -> i64
%1300 = llvm.load %1223 : !llvm.ptr -> i64
%1301 = arith.cmpi slt, %1299, %1300 : i64
cf.cond_br %1301, ^bb226, ^bb227
^bb226:
%1302 = arith.constant 0 : i32
%1303 = arith.extsi %1302 : i32 to i64
%1304 = llvm.mlir.constant(1 : i64) : i64
%1305 = llvm.alloca %1304 x i64 : (i64) -> !llvm.ptr
llvm.store %1303, %1305 : i64, !llvm.ptr
cf.br ^bb228
^bb228:
%1306 = llvm.load %1305 : !llvm.ptr -> i64
%1307 = llvm.load %1227 : !llvm.ptr -> i64
%1308 = arith.cmpi slt, %1306, %1307 : i64
cf.cond_br %1308, ^bb229, ^bb230
^bb229:
%1310 = llvm.load %1298 : !llvm.ptr -> i64
%1311 = llvm.getelementptr %1201[0, %1310] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
%1309 = llvm.load %1311 : !llvm.ptr -> i64
%1312 = arith.trunci %1309 : i64 to i32
%1313 = llvm.load %513 : !llvm.ptr -> i64
%1314 = llvm.getelementptr %501[%1313] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1312, %1314 : i32, !llvm.ptr
%1316 = llvm.load %1305 : !llvm.ptr -> i64
%1317 = llvm.getelementptr %1214[0, %1316] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
%1315 = llvm.load %1317 : !llvm.ptr -> i64
%1318 = arith.trunci %1315 : i64 to i32
%1319 = llvm.load %513 : !llvm.ptr -> i64
%1320 = llvm.getelementptr %504[%1319] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1318, %1320 : i32, !llvm.ptr
%1321 = llvm.load %523 : !llvm.ptr -> i64
%1322 = arith.trunci %1321 : i64 to i32
%1323 = llvm.load %513 : !llvm.ptr -> i64
%1324 = llvm.getelementptr %507[%1323] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1322, %1324 : i32, !llvm.ptr
%1325 = llvm.load %513 : !llvm.ptr -> i64
%1326 = arith.constant 1 : i32
%1328 = arith.extsi %1326 : i32 to i64
%1327 = arith.addi %1325, %1328 : i64
llvm.store %1327, %513 : i64, !llvm.ptr
%1330 = llvm.load %1305 : !llvm.ptr -> i64
%1331 = llvm.getelementptr %1214[0, %1330] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
%1329 = llvm.load %1331 : !llvm.ptr -> i64
%1332 = arith.trunci %1329 : i64 to i32
%1333 = llvm.load %513 : !llvm.ptr -> i64
%1334 = llvm.getelementptr %501[%1333] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1332, %1334 : i32, !llvm.ptr
%1336 = llvm.load %1298 : !llvm.ptr -> i64
%1337 = llvm.getelementptr %1201[0, %1336] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<2 x i64>
%1335 = llvm.load %1337 : !llvm.ptr -> i64
%1338 = arith.trunci %1335 : i64 to i32
%1339 = llvm.load %513 : !llvm.ptr -> i64
%1340 = llvm.getelementptr %504[%1339] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1338, %1340 : i32, !llvm.ptr
%1341 = llvm.load %523 : !llvm.ptr -> i64
%1342 = arith.trunci %1341 : i64 to i32
%1343 = llvm.load %513 : !llvm.ptr -> i64
%1344 = llvm.getelementptr %507[%1343] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1342, %1344 : i32, !llvm.ptr
%1345 = llvm.load %513 : !llvm.ptr -> i64
%1346 = arith.constant 1 : i32
%1348 = arith.extsi %1346 : i32 to i64
%1347 = arith.addi %1345, %1348 : i64
llvm.store %1347, %513 : i64, !llvm.ptr
%1349 = llvm.load %1305 : !llvm.ptr -> i64
%1350 = arith.constant 1 : i32
%1352 = arith.extsi %1350 : i32 to i64
%1351 = arith.addi %1349, %1352 : i64
llvm.store %1351, %1305 : i64, !llvm.ptr
cf.br ^bb228
^bb230:
%1353 = llvm.load %1298 : !llvm.ptr -> i64
%1354 = arith.constant 1 : i32
%1356 = arith.extsi %1354 : i32 to i64
%1355 = arith.addi %1353, %1356 : i64
llvm.store %1355, %1298 : i64, !llvm.ptr
cf.br ^bb225
^bb227:
cf.br ^bb218
^bb218:
cf.br ^bb209
^bb208:
cf.br ^bb209
^bb209:
%1357 = llvm.load %1118 : !llvm.ptr -> i64
%1358 = arith.constant 1 : i32
%1360 = arith.extsi %1358 : i32 to i64
%1359 = arith.addi %1357, %1360 : i64
llvm.store %1359, %1118 : i64, !llvm.ptr
cf.br ^bb192
^bb194:
func.call @free(%1112) : (!llvm.ptr) -> ()
func.call @free(%1109) : (!llvm.ptr) -> ()
cf.br ^bb179
^bb178:
cf.br ^bb179
^bb179:
func.call @free(%745) : (!llvm.ptr) -> ()
func.call @free(%742) : (!llvm.ptr) -> ()
func.call @free(%559) : (!llvm.ptr) -> ()
func.call @free(%556) : (!llvm.ptr) -> ()
cf.br ^bb110
^bb110:
%1367 = llvm.load %523 : !llvm.ptr -> i64
%1368 = arith.constant 1 : i32
%1370 = arith.extsi %1368 : i32 to i64
%1369 = arith.addi %1367, %1370 : i64
llvm.store %1369, %523 : i64, !llvm.ptr
cf.br ^bb105
^bb107:
%1371 = arith.constant 1.0 : f32
%1372 = arith.sitofp %498 : i64 to f64
%1374 = arith.extf %1371 : f32 to f64
%1373 = arith.divf %1374, %1372 : f64
%1375 = arith.constant 1.0 : f32
%1377 = arith.extf %1375 : f32 to f64
%1376 = arith.divf %1377, %477 : f64
%1379 = arith.constant 1 : i32
%1381 = arith.extsi %1379 : i32 to i64
%1380 = arith.addi %495, %1381 : i64
%1382 = arith.constant 8 : i32
%1383 = arith.extsi %1382 : i32 to i64
%1378 = func.call @calloc(%1380, %1383) : (i64, i64) -> !llvm.ptr
%1384 = arith.constant 0 : i32
%1385 = arith.extsi %1384 : i32 to i64
llvm.store %1385, %523 : i64, !llvm.ptr
cf.br ^bb231
^bb231:
%1386 = llvm.load %523 : !llvm.ptr -> i64
%1387 = arith.cmpi sle, %1386, %495 : i64
cf.cond_br %1387, ^bb232, ^bb233
^bb232:
%1388 = arith.constant 1.0 : f32
%1389 = arith.constant 2.0 : f32
%1390 = llvm.load %523 : !llvm.ptr -> i64
%1391 = llvm.load %523 : !llvm.ptr -> i64
%1392 = arith.muli %1390, %1391 : i64
%1393 = arith.sitofp %1392 : i64 to f64
%1395 = arith.extf %1389 : f32 to f64
%1394 = arith.mulf %1395, %1393 : f64
%1396 = arith.mulf %1394, %1373 : f64
%1398 = arith.extf %1388 : f32 to f64
%1397 = arith.subf %1398, %1396 : f64
%1399 = llvm.mlir.constant(1 : i64) : i64
%1400 = llvm.alloca %1399 x f64 : (i64) -> !llvm.ptr
llvm.store %1397, %1400 : f64, !llvm.ptr
%1401 = llvm.load %1400 : !llvm.ptr -> f64
%1402 = arith.constant 0.0 : f32
%1403 = arith.constant 1.0 : f32
%1404 = arith.subf %1402, %1403 : f32
%1406 = arith.extf %1404 : f32 to f64
%1405 = arith.cmpf olt, %1401, %1406 : f64
cf.cond_br %1405, ^bb234, ^bb235
^bb234:
%1407 = arith.constant 0.0 : f32
%1408 = arith.constant 1.0 : f32
%1409 = arith.subf %1407, %1408 : f32
%1410 = arith.extf %1409 : f32 to f64
llvm.store %1410, %1400 : f64, !llvm.ptr
cf.br ^bb236
^bb235:
cf.br ^bb236
^bb236:
%1412 = llvm.load %1400 : !llvm.ptr -> f64
%1411 = func.call @acos(%1412) : (f64) -> f64
%1413 = arith.mulf %1411, %1376 : f64
%1414 = arith.mulf %1413, %1413 : f64
%1415 = llvm.load %523 : !llvm.ptr -> i64
%1416 = llvm.getelementptr %1378[%1415] : (!llvm.ptr, i64) -> !llvm.ptr, f64
llvm.store %1414, %1416 : f64, !llvm.ptr
%1417 = llvm.load %523 : !llvm.ptr -> i64
%1418 = arith.constant 1 : i32
%1420 = arith.extsi %1418 : i32 to i64
%1419 = arith.addi %1417, %1420 : i64
llvm.store %1419, %523 : i64, !llvm.ptr
cf.br ^bb231
^bb233:
%1421 = arith.constant 1 : i32
%1422 = arith.constant 18 : i32
%1423 = arith.shli %1421, %1422 : i32
%1424 = arith.extsi %1423 : i32 to i64
%1426 = arith.constant 8 : i32
%1427 = arith.extsi %1426 : i32 to i64
%1425 = func.call @calloc(%1424, %1427) : (i64, i64) -> !llvm.ptr
%1429 = arith.constant 4 : i32
%1430 = arith.extsi %1429 : i32 to i64
%1428 = func.call @calloc(%1424, %1430) : (i64, i64) -> !llvm.ptr
%1432 = arith.constant 1 : i32
%1433 = arith.extsi %1432 : i32 to i64
%1431 = func.call @calloc(%1424, %1433) : (i64, i64) -> !llvm.ptr
%1434 = arith.constant 0 : i32
%1435 = arith.extsi %1434 : i32 to i64
%1436 = llvm.mlir.constant(1 : i64) : i64
%1437 = llvm.alloca %1436 x i64 : (i64) -> !llvm.ptr
llvm.store %1435, %1437 : i64, !llvm.ptr
cf.br ^bb237
^bb237:
%1438 = llvm.load %1437 : !llvm.ptr -> i64
%1439 = arith.cmpi slt, %1438, %1424 : i64
cf.cond_br %1439, ^bb238, ^bb239
^bb238:
%1440 = arith.constant 1 : i32
%1442 = arith.constant 0 : i32
%1441 = arith.subi %1442, %1440 : i32
%1443 = llvm.load %1437 : !llvm.ptr -> i64
%1444 = llvm.getelementptr %1428[%1443] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1441, %1444 : i32, !llvm.ptr
%1445 = llvm.load %1437 : !llvm.ptr -> i64
%1446 = arith.constant 1 : i32
%1448 = arith.extsi %1446 : i32 to i64
%1447 = arith.addi %1445, %1448 : i64
llvm.store %1447, %1437 : i64, !llvm.ptr
cf.br ^bb237
^bb239:
%1450 = llvm.load %513 : !llvm.ptr -> i64
%1451 = arith.constant 4 : i32
%1452 = arith.extsi %1451 : i32 to i64
%1449 = func.call @calloc(%1450, %1452) : (i64, i64) -> !llvm.ptr
%1453 = arith.constant 0 : i32
%1454 = arith.extsi %1453 : i32 to i64
llvm.store %1454, %343 : i64, !llvm.ptr
cf.br ^bb240
^bb240:
%1455 = llvm.load %343 : !llvm.ptr -> i64
%1456 = llvm.load %513 : !llvm.ptr -> i64
%1457 = arith.cmpi slt, %1455, %1456 : i64
cf.cond_br %1457, ^bb241, ^bb242
^bb241:
%1459 = llvm.load %343 : !llvm.ptr -> i64
%1460 = llvm.getelementptr %501[%1459] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1458 = llvm.load %1460 : !llvm.ptr -> i32
%1461 = arith.extsi %1458 : i32 to i64
%1462 = arith.divsi %1461, %497 : i64
%1464 = llvm.load %343 : !llvm.ptr -> i64
%1465 = llvm.getelementptr %504[%1464] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1463 = llvm.load %1465 : !llvm.ptr -> i32
%1466 = arith.extsi %1463 : i32 to i64
%1467 = arith.divsi %1466, %497 : i64
%1469 = llvm.load %343 : !llvm.ptr -> i64
%1470 = llvm.getelementptr %507[%1469] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1468 = llvm.load %1470 : !llvm.ptr -> i32
%1471 = arith.extsi %1468 : i32 to i64
%1472 = arith.divsi %1471, %497 : i64
%1473 = llvm.mlir.constant(1 : i64) : i64
%1474 = llvm.alloca %1473 x i64 : (i64) -> !llvm.ptr
llvm.store %1462, %1474 : i64, !llvm.ptr
%1475 = llvm.mlir.constant(1 : i64) : i64
%1476 = llvm.alloca %1475 x i64 : (i64) -> !llvm.ptr
llvm.store %1467, %1476 : i64, !llvm.ptr
%1477 = llvm.mlir.constant(1 : i64) : i64
%1478 = llvm.alloca %1477 x i64 : (i64) -> !llvm.ptr
llvm.store %1472, %1478 : i64, !llvm.ptr
%1480 = llvm.load %343 : !llvm.ptr -> i64
%1481 = llvm.getelementptr %501[%1480] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1479 = llvm.load %1481 : !llvm.ptr -> i32
%1482 = arith.extsi %1479 : i32 to i64
%1483 = arith.constant 0 : i32
%1485 = arith.extsi %1483 : i32 to i64
%1484 = arith.cmpi slt, %1482, %1485 : i64
%1486 = scf.if %1484 -> (i1) {
%1488 = llvm.load %343 : !llvm.ptr -> i64
%1489 = llvm.getelementptr %501[%1488] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1487 = llvm.load %1489 : !llvm.ptr -> i32
%1490 = arith.extsi %1487 : i32 to i64
%1491 = arith.remsi %1490, %497 : i64
%1492 = arith.constant 0 : i32
%1494 = arith.extsi %1492 : i32 to i64
%1493 = arith.cmpi ne, %1491, %1494 : i64
scf.yield %1493 : i1
} else {
%1495 = arith.constant false
scf.yield %1495 : i1
}
cf.cond_br %1486, ^bb243, ^bb244
^bb243:
%1496 = arith.constant 1 : i32
%1498 = arith.extsi %1496 : i32 to i64
%1497 = arith.subi %1462, %1498 : i64
llvm.store %1497, %1474 : i64, !llvm.ptr
cf.br ^bb245
^bb244:
cf.br ^bb245
^bb245:
%1500 = llvm.load %343 : !llvm.ptr -> i64
%1501 = llvm.getelementptr %504[%1500] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1499 = llvm.load %1501 : !llvm.ptr -> i32
%1502 = arith.extsi %1499 : i32 to i64
%1503 = arith.constant 0 : i32
%1505 = arith.extsi %1503 : i32 to i64
%1504 = arith.cmpi slt, %1502, %1505 : i64
%1506 = scf.if %1504 -> (i1) {
%1508 = llvm.load %343 : !llvm.ptr -> i64
%1509 = llvm.getelementptr %504[%1508] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1507 = llvm.load %1509 : !llvm.ptr -> i32
%1510 = arith.extsi %1507 : i32 to i64
%1511 = arith.remsi %1510, %497 : i64
%1512 = arith.constant 0 : i32
%1514 = arith.extsi %1512 : i32 to i64
%1513 = arith.cmpi ne, %1511, %1514 : i64
scf.yield %1513 : i1
} else {
%1515 = arith.constant false
scf.yield %1515 : i1
}
cf.cond_br %1506, ^bb246, ^bb247
^bb246:
%1516 = arith.constant 1 : i32
%1518 = arith.extsi %1516 : i32 to i64
%1517 = arith.subi %1467, %1518 : i64
llvm.store %1517, %1476 : i64, !llvm.ptr
cf.br ^bb248
^bb247:
cf.br ^bb248
^bb248:
%1520 = llvm.load %343 : !llvm.ptr -> i64
%1521 = llvm.getelementptr %507[%1520] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1519 = llvm.load %1521 : !llvm.ptr -> i32
%1522 = arith.extsi %1519 : i32 to i64
%1523 = arith.constant 0 : i32
%1525 = arith.extsi %1523 : i32 to i64
%1524 = arith.cmpi slt, %1522, %1525 : i64
%1526 = scf.if %1524 -> (i1) {
%1528 = llvm.load %343 : !llvm.ptr -> i64
%1529 = llvm.getelementptr %507[%1528] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1527 = llvm.load %1529 : !llvm.ptr -> i32
%1530 = arith.extsi %1527 : i32 to i64
%1531 = arith.remsi %1530, %497 : i64
%1532 = arith.constant 0 : i32
%1534 = arith.extsi %1532 : i32 to i64
%1533 = arith.cmpi ne, %1531, %1534 : i64
scf.yield %1533 : i1
} else {
%1535 = arith.constant false
scf.yield %1535 : i1
}
cf.cond_br %1526, ^bb249, ^bb250
^bb249:
%1536 = arith.constant 1 : i32
%1538 = arith.extsi %1536 : i32 to i64
%1537 = arith.subi %1472, %1538 : i64
llvm.store %1537, %1478 : i64, !llvm.ptr
cf.br ^bb251
^bb250:
cf.br ^bb251
^bb251:
%1540 = llvm.load %1474 : !llvm.ptr -> i64
%1541 = llvm.load %1476 : !llvm.ptr -> i64
%1542 = llvm.load %1478 : !llvm.ptr -> i64
%1539 = func.call @pack3(%1540, %1541, %1542) : (i64, i64, i64) -> i64
%1544 = llvm.load %1474 : !llvm.ptr -> i64
%1545 = llvm.load %1476 : !llvm.ptr -> i64
%1546 = llvm.load %1478 : !llvm.ptr -> i64
%1543 = func.call @cellhash(%1544, %1545, %1546, %1424) : (i64, i64, i64, i64) -> i64
%1547 = llvm.mlir.constant(1 : i64) : i64
%1548 = llvm.alloca %1547 x i64 : (i64) -> !llvm.ptr
llvm.store %1543, %1548 : i64, !llvm.ptr
cf.br ^bb252
^bb252:
%1550 = llvm.load %1548 : !llvm.ptr -> i64
%1551 = llvm.getelementptr %1431[%1550] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%1549 = llvm.load %1551 : !llvm.ptr -> i8
%1552 = arith.constant 0 : i32
%1554 = arith.extsi %1549 : i8 to i32
%1553 = arith.cmpi ne, %1554, %1552 : i32
%1555 = scf.if %1553 -> (i1) {
%1557 = llvm.load %1548 : !llvm.ptr -> i64
%1558 = llvm.getelementptr %1425[%1557] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1556 = llvm.load %1558 : !llvm.ptr -> i64
%1559 = arith.cmpi ne, %1556, %1539 : i64
scf.yield %1559 : i1
} else {
%1560 = arith.constant false
scf.yield %1560 : i1
}
cf.cond_br %1555, ^bb253, ^bb254
^bb253:
%1561 = llvm.load %1548 : !llvm.ptr -> i64
%1562 = arith.constant 1 : i32
%1564 = arith.extsi %1562 : i32 to i64
%1563 = arith.addi %1561, %1564 : i64
%1565 = arith.constant 1 : i32
%1567 = arith.extsi %1565 : i32 to i64
%1566 = arith.subi %1424, %1567 : i64
%1568 = arith.andi %1563, %1566 : i64
llvm.store %1568, %1548 : i64, !llvm.ptr
cf.br ^bb252
^bb254:
%1570 = llvm.load %1548 : !llvm.ptr -> i64
%1571 = llvm.getelementptr %1431[%1570] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%1569 = llvm.load %1571 : !llvm.ptr -> i8
%1572 = arith.constant 0 : i32
%1574 = arith.extsi %1569 : i8 to i32
%1573 = arith.cmpi eq, %1574, %1572 : i32
cf.cond_br %1573, ^bb255, ^bb256
^bb255:
%1575 = arith.constant 1 : i32
%1576 = llvm.load %1548 : !llvm.ptr -> i64
%1577 = arith.trunci %1575 : i32 to i8
%1578 = llvm.getelementptr %1431[%1576] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %1577, %1578 : i8, !llvm.ptr
%1579 = llvm.load %1548 : !llvm.ptr -> i64
%1580 = llvm.getelementptr %1425[%1579] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1539, %1580 : i64, !llvm.ptr
%1581 = arith.constant 1 : i32
%1583 = arith.constant 0 : i32
%1582 = arith.subi %1583, %1581 : i32
%1584 = llvm.load %1548 : !llvm.ptr -> i64
%1585 = llvm.getelementptr %1428[%1584] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1582, %1585 : i32, !llvm.ptr
cf.br ^bb257
^bb256:
cf.br ^bb257
^bb257:
%1587 = llvm.load %1548 : !llvm.ptr -> i64
%1588 = llvm.getelementptr %1428[%1587] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1586 = llvm.load %1588 : !llvm.ptr -> i32
%1589 = llvm.load %343 : !llvm.ptr -> i64
%1590 = llvm.getelementptr %1449[%1589] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1586, %1590 : i32, !llvm.ptr
%1591 = llvm.load %343 : !llvm.ptr -> i64
%1592 = arith.trunci %1591 : i64 to i32
%1593 = llvm.load %1548 : !llvm.ptr -> i64
%1594 = llvm.getelementptr %1428[%1593] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1592, %1594 : i32, !llvm.ptr
%1595 = llvm.load %343 : !llvm.ptr -> i64
%1596 = arith.constant 1 : i32
%1598 = arith.extsi %1596 : i32 to i64
%1597 = arith.addi %1595, %1598 : i64
llvm.store %1597, %343 : i64, !llvm.ptr
cf.br ^bb240
^bb242:
%1599 = arith.constant 10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104 : f32
%1600 = arith.extf %1599 : f32 to f64
%1602 = llvm.load %513 : !llvm.ptr -> i64
%1603 = arith.constant 8 : i32
%1604 = arith.extsi %1603 : i32 to i64
%1601 = func.call @calloc(%1602, %1604) : (i64, i64) -> !llvm.ptr
%1606 = llvm.load %513 : !llvm.ptr -> i64
%1607 = arith.constant 4 : i32
%1608 = arith.extsi %1607 : i32 to i64
%1605 = func.call @calloc(%1606, %1608) : (i64, i64) -> !llvm.ptr
%1610 = llvm.load %513 : !llvm.ptr -> i64
%1611 = arith.constant 4 : i32
%1612 = arith.extsi %1611 : i32 to i64
%1609 = func.call @calloc(%1610, %1612) : (i64, i64) -> !llvm.ptr
%1613 = arith.constant 0 : i32
%1614 = arith.extsi %1613 : i32 to i64
llvm.store %1614, %343 : i64, !llvm.ptr
cf.br ^bb258
^bb258:
%1615 = llvm.load %343 : !llvm.ptr -> i64
%1616 = llvm.load %513 : !llvm.ptr -> i64
%1617 = arith.cmpi slt, %1615, %1616 : i64
cf.cond_br %1617, ^bb259, ^bb260
^bb259:
%1618 = llvm.load %343 : !llvm.ptr -> i64
%1619 = llvm.getelementptr %1601[%1618] : (!llvm.ptr, i64) -> !llvm.ptr, f64
llvm.store %1600, %1619 : f64, !llvm.ptr
%1620 = arith.constant 1 : i32
%1622 = arith.constant 0 : i32
%1621 = arith.subi %1622, %1620 : i32
%1623 = llvm.load %343 : !llvm.ptr -> i64
%1624 = llvm.getelementptr %1609[%1623] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1621, %1624 : i32, !llvm.ptr
%1625 = llvm.load %343 : !llvm.ptr -> i64
%1626 = arith.constant 1 : i32
%1628 = arith.extsi %1626 : i32 to i64
%1627 = arith.addi %1625, %1628 : i64
llvm.store %1627, %343 : i64, !llvm.ptr
cf.br ^bb258
^bb260:
%1629 = arith.constant 0.0 : f32
%1630 = llvm.load %519 : !llvm.ptr -> i64
%1631 = arith.extf %1629 : f32 to f64
%1632 = llvm.getelementptr %1601[%1630] : (!llvm.ptr, i64) -> !llvm.ptr, f64
llvm.store %1631, %1632 : f64, !llvm.ptr
%1633 = llvm.load %519 : !llvm.ptr -> i64
%1634 = arith.trunci %1633 : i64 to i32
%1635 = arith.constant 0 : i32
%1636 = arith.extsi %1635 : i32 to i64
%1637 = llvm.getelementptr %1605[%1636] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1634, %1637 : i32, !llvm.ptr
%1638 = arith.constant 0 : i32
%1639 = llvm.load %519 : !llvm.ptr -> i64
%1640 = llvm.getelementptr %1609[%1639] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1638, %1640 : i32, !llvm.ptr
%1641 = arith.constant 1 : i32
%1642 = arith.extsi %1641 : i32 to i64
%1643 = llvm.mlir.constant(1 : i64) : i64
%1644 = llvm.alloca %1643 x i64 : (i64) -> !llvm.ptr
llvm.store %1642, %1644 : i64, !llvm.ptr
%1645 = arith.constant 0.5 : f32
%1646 = arith.extf %1645 : f32 to f64
%1647 = llvm.mlir.constant(1 : i64) : i64
%1648 = llvm.alloca %1647 x f64 : (i64) -> !llvm.ptr
llvm.store %1646, %1648 : f64, !llvm.ptr
cf.br ^bb261
^bb261:
%1649 = llvm.load %1644 : !llvm.ptr -> i64
%1650 = arith.constant 0 : i32
%1652 = arith.extsi %1650 : i32 to i64
%1651 = arith.cmpi sgt, %1649, %1652 : i64
cf.cond_br %1651, ^bb262, ^bb263
^bb262:
%1654 = arith.constant 0 : i32
%1655 = arith.extsi %1654 : i32 to i64
%1656 = llvm.getelementptr %1605[%1655] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1653 = llvm.load %1656 : !llvm.ptr -> i32
%1657 = arith.extsi %1653 : i32 to i64
%1659 = llvm.getelementptr %1601[%1657] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%1658 = llvm.load %1659 : !llvm.ptr -> f64
%1660 = llvm.load %1644 : !llvm.ptr -> i64
%1661 = arith.constant 1 : i32
%1663 = arith.extsi %1661 : i32 to i64
%1662 = arith.subi %1660, %1663 : i64
llvm.store %1662, %1644 : i64, !llvm.ptr
%1664 = arith.constant 1 : i32
%1666 = arith.constant 0 : i32
%1665 = arith.subi %1666, %1664 : i32
%1667 = llvm.getelementptr %1609[%1657] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1665, %1667 : i32, !llvm.ptr
%1668 = llvm.load %1644 : !llvm.ptr -> i64
%1669 = arith.constant 0 : i32
%1671 = arith.extsi %1669 : i32 to i64
%1670 = arith.cmpi sgt, %1668, %1671 : i64
cf.cond_br %1670, ^bb264, ^bb265
^bb264:
%1673 = llvm.load %1644 : !llvm.ptr -> i64
%1674 = llvm.getelementptr %1605[%1673] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1672 = llvm.load %1674 : !llvm.ptr -> i32
%1675 = arith.extsi %1672 : i32 to i64
%1676 = arith.trunci %1675 : i64 to i32
%1677 = arith.constant 0 : i32
%1678 = arith.extsi %1677 : i32 to i64
%1679 = llvm.getelementptr %1605[%1678] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1676, %1679 : i32, !llvm.ptr
%1680 = arith.constant 0 : i32
%1681 = llvm.getelementptr %1609[%1675] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1680, %1681 : i32, !llvm.ptr
%1682 = arith.constant 0 : i32
%1683 = arith.extsi %1682 : i32 to i64
%1684 = llvm.mlir.constant(1 : i64) : i64
%1685 = llvm.alloca %1684 x i64 : (i64) -> !llvm.ptr
llvm.store %1683, %1685 : i64, !llvm.ptr
cf.br ^bb267
^bb267:
%1686 = arith.constant 1 : i1
cf.cond_br %1686, ^bb268, ^bb269
^bb268:
%1687 = arith.constant 2 : i32
%1688 = llvm.load %1685 : !llvm.ptr -> i64
%1690 = arith.extsi %1687 : i32 to i64
%1689 = arith.muli %1690, %1688 : i64
%1691 = arith.constant 1 : i32
%1693 = arith.extsi %1691 : i32 to i64
%1692 = arith.addi %1689, %1693 : i64
%1694 = arith.constant 1 : i32
%1696 = arith.extsi %1694 : i32 to i64
%1695 = arith.addi %1692, %1696 : i64
%1697 = llvm.load %1685 : !llvm.ptr -> i64
%1698 = llvm.mlir.constant(1 : i64) : i64
%1699 = llvm.alloca %1698 x i64 : (i64) -> !llvm.ptr
llvm.store %1697, %1699 : i64, !llvm.ptr
%1700 = llvm.load %1644 : !llvm.ptr -> i64
%1701 = arith.cmpi slt, %1692, %1700 : i64
%1702 = scf.if %1701 -> (i1) {
%1705 = llvm.getelementptr %1605[%1692] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1704 = llvm.load %1705 : !llvm.ptr -> i32
%1706 = arith.extsi %1704 : i32 to i64
%1707 = llvm.getelementptr %1601[%1706] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%1703 = llvm.load %1707 : !llvm.ptr -> f64
%1710 = llvm.load %1699 : !llvm.ptr -> i64
%1711 = llvm.getelementptr %1605[%1710] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1709 = llvm.load %1711 : !llvm.ptr -> i32
%1712 = arith.extsi %1709 : i32 to i64
%1713 = llvm.getelementptr %1601[%1712] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%1708 = llvm.load %1713 : !llvm.ptr -> f64
%1714 = arith.cmpf olt, %1703, %1708 : f64
scf.yield %1714 : i1
} else {
%1715 = arith.constant false
scf.yield %1715 : i1
}
cf.cond_br %1702, ^bb270, ^bb271
^bb270:
llvm.store %1692, %1699 : i64, !llvm.ptr
cf.br ^bb272
^bb271:
cf.br ^bb272
^bb272:
%1716 = llvm.load %1644 : !llvm.ptr -> i64
%1717 = arith.cmpi slt, %1695, %1716 : i64
%1718 = scf.if %1717 -> (i1) {
%1721 = llvm.getelementptr %1605[%1695] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1720 = llvm.load %1721 : !llvm.ptr -> i32
%1722 = arith.extsi %1720 : i32 to i64
%1723 = llvm.getelementptr %1601[%1722] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%1719 = llvm.load %1723 : !llvm.ptr -> f64
%1726 = llvm.load %1699 : !llvm.ptr -> i64
%1727 = llvm.getelementptr %1605[%1726] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1725 = llvm.load %1727 : !llvm.ptr -> i32
%1728 = arith.extsi %1725 : i32 to i64
%1729 = llvm.getelementptr %1601[%1728] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%1724 = llvm.load %1729 : !llvm.ptr -> f64
%1730 = arith.cmpf olt, %1719, %1724 : f64
scf.yield %1730 : i1
} else {
%1731 = arith.constant false
scf.yield %1731 : i1
}
cf.cond_br %1718, ^bb273, ^bb274
^bb273:
llvm.store %1695, %1699 : i64, !llvm.ptr
cf.br ^bb275
^bb274:
cf.br ^bb275
^bb275:
%1732 = llvm.load %1699 : !llvm.ptr -> i64
%1733 = llvm.load %1685 : !llvm.ptr -> i64
%1734 = arith.cmpi eq, %1732, %1733 : i64
cf.cond_br %1734, ^bb276, ^bb277
^bb276:
cf.br ^bb269
^bb277:
cf.br ^bb278
^bb278:
%1736 = llvm.load %1685 : !llvm.ptr -> i64
%1737 = llvm.getelementptr %1605[%1736] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1735 = llvm.load %1737 : !llvm.ptr -> i32
%1738 = arith.extsi %1735 : i32 to i64
%1740 = llvm.load %1699 : !llvm.ptr -> i64
%1741 = llvm.getelementptr %1605[%1740] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1739 = llvm.load %1741 : !llvm.ptr -> i32
%1742 = arith.extsi %1739 : i32 to i64
%1743 = arith.trunci %1742 : i64 to i32
%1744 = llvm.load %1685 : !llvm.ptr -> i64
%1745 = llvm.getelementptr %1605[%1744] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1743, %1745 : i32, !llvm.ptr
%1746 = arith.trunci %1738 : i64 to i32
%1747 = llvm.load %1699 : !llvm.ptr -> i64
%1748 = llvm.getelementptr %1605[%1747] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1746, %1748 : i32, !llvm.ptr
%1749 = llvm.load %1699 : !llvm.ptr -> i64
%1750 = arith.trunci %1749 : i64 to i32
%1751 = llvm.getelementptr %1609[%1738] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1750, %1751 : i32, !llvm.ptr
%1752 = llvm.load %1685 : !llvm.ptr -> i64
%1753 = arith.trunci %1752 : i64 to i32
%1754 = llvm.getelementptr %1609[%1742] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1753, %1754 : i32, !llvm.ptr
%1755 = llvm.load %1699 : !llvm.ptr -> i64
llvm.store %1755, %1685 : i64, !llvm.ptr
cf.br ^bb267
^bb269:
cf.br ^bb266
^bb265:
cf.br ^bb266
^bb266:
%1756 = arith.constant 2.0 : f32
%1758 = arith.extf %1756 : f32 to f64
%1757 = arith.mulf %1758, %1658 : f64
%1759 = llvm.load %1648 : !llvm.ptr -> f64
%1760 = arith.cmpf oge, %1757, %1759 : f64
cf.cond_br %1760, ^bb279, ^bb280
^bb279:
cf.br ^bb263
^bb280:
cf.br ^bb281
^bb281:
%1762 = llvm.getelementptr %507[%1657] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1761 = llvm.load %1762 : !llvm.ptr -> i32
%1763 = arith.extsi %1761 : i32 to i64
%1764 = arith.constant 2.0 : f32
%1766 = arith.extf %1764 : f32 to f64
%1765 = arith.mulf %1766, %1658 : f64
%1768 = llvm.getelementptr %1378[%1763] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%1767 = llvm.load %1768 : !llvm.ptr -> f64
%1769 = arith.addf %1765, %1767 : f64
%1770 = llvm.load %1648 : !llvm.ptr -> f64
%1771 = arith.cmpf olt, %1769, %1770 : f64
cf.cond_br %1771, ^bb282, ^bb283
^bb282:
llvm.store %1769, %1648 : f64, !llvm.ptr
cf.br ^bb284
^bb283:
cf.br ^bb284
^bb284:
%1773 = llvm.getelementptr %501[%1657] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1772 = llvm.load %1773 : !llvm.ptr -> i32
%1774 = arith.extsi %1772 : i32 to i64
%1776 = llvm.getelementptr %504[%1657] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1775 = llvm.load %1776 : !llvm.ptr -> i32
%1777 = arith.extsi %1775 : i32 to i64
%1778 = arith.divsi %1774, %497 : i64
%1779 = llvm.mlir.constant(1 : i64) : i64
%1780 = llvm.alloca %1779 x i64 : (i64) -> !llvm.ptr
llvm.store %1778, %1780 : i64, !llvm.ptr
%1781 = arith.divsi %1777, %497 : i64
%1782 = llvm.mlir.constant(1 : i64) : i64
%1783 = llvm.alloca %1782 x i64 : (i64) -> !llvm.ptr
llvm.store %1781, %1783 : i64, !llvm.ptr
%1784 = arith.divsi %1763, %497 : i64
%1785 = llvm.mlir.constant(1 : i64) : i64
%1786 = llvm.alloca %1785 x i64 : (i64) -> !llvm.ptr
llvm.store %1784, %1786 : i64, !llvm.ptr
%1787 = arith.constant 0 : i32
%1789 = arith.extsi %1787 : i32 to i64
%1788 = arith.cmpi slt, %1774, %1789 : i64
%1790 = scf.if %1788 -> (i1) {
%1791 = arith.remsi %1774, %497 : i64
%1792 = arith.constant 0 : i32
%1794 = arith.extsi %1792 : i32 to i64
%1793 = arith.cmpi ne, %1791, %1794 : i64
scf.yield %1793 : i1
} else {
%1795 = arith.constant false
scf.yield %1795 : i1
}
cf.cond_br %1790, ^bb285, ^bb286
^bb285:
%1796 = llvm.load %1780 : !llvm.ptr -> i64
%1797 = arith.constant 1 : i32
%1799 = arith.extsi %1797 : i32 to i64
%1798 = arith.subi %1796, %1799 : i64
llvm.store %1798, %1780 : i64, !llvm.ptr
cf.br ^bb287
^bb286:
cf.br ^bb287
^bb287:
%1800 = arith.constant 0 : i32
%1802 = arith.extsi %1800 : i32 to i64
%1801 = arith.cmpi slt, %1777, %1802 : i64
%1803 = scf.if %1801 -> (i1) {
%1804 = arith.remsi %1777, %497 : i64
%1805 = arith.constant 0 : i32
%1807 = arith.extsi %1805 : i32 to i64
%1806 = arith.cmpi ne, %1804, %1807 : i64
scf.yield %1806 : i1
} else {
%1808 = arith.constant false
scf.yield %1808 : i1
}
cf.cond_br %1803, ^bb288, ^bb289
^bb288:
%1809 = llvm.load %1783 : !llvm.ptr -> i64
%1810 = arith.constant 1 : i32
%1812 = arith.extsi %1810 : i32 to i64
%1811 = arith.subi %1809, %1812 : i64
llvm.store %1811, %1783 : i64, !llvm.ptr
cf.br ^bb290
^bb289:
cf.br ^bb290
^bb290:
%1813 = arith.constant 0 : i32
%1815 = arith.extsi %1813 : i32 to i64
%1814 = arith.cmpi slt, %1763, %1815 : i64
%1816 = scf.if %1814 -> (i1) {
%1817 = arith.remsi %1763, %497 : i64
%1818 = arith.constant 0 : i32
%1820 = arith.extsi %1818 : i32 to i64
%1819 = arith.cmpi ne, %1817, %1820 : i64
scf.yield %1819 : i1
} else {
%1821 = arith.constant false
scf.yield %1821 : i1
}
cf.cond_br %1816, ^bb291, ^bb292
^bb291:
%1822 = llvm.load %1786 : !llvm.ptr -> i64
%1823 = arith.constant 1 : i32
%1825 = arith.extsi %1823 : i32 to i64
%1824 = arith.subi %1822, %1825 : i64
llvm.store %1824, %1786 : i64, !llvm.ptr
cf.br ^bb293
^bb292:
cf.br ^bb293
^bb293:
%1826 = arith.constant 0 : i32
%1827 = arith.constant 1 : i32
%1828 = arith.subi %1826, %1827 : i32
%1829 = arith.extsi %1828 : i32 to i64
%1830 = llvm.mlir.constant(1 : i64) : i64
%1831 = llvm.alloca %1830 x i64 : (i64) -> !llvm.ptr
llvm.store %1829, %1831 : i64, !llvm.ptr
cf.br ^bb294
^bb294:
%1832 = llvm.load %1831 : !llvm.ptr -> i64
%1833 = arith.constant 1 : i32
%1835 = arith.extsi %1833 : i32 to i64
%1834 = arith.cmpi sle, %1832, %1835 : i64
cf.cond_br %1834, ^bb295, ^bb296
^bb295:
%1836 = arith.constant 0 : i32
%1837 = arith.constant 1 : i32
%1838 = arith.subi %1836, %1837 : i32
%1839 = arith.extsi %1838 : i32 to i64
%1840 = llvm.mlir.constant(1 : i64) : i64
%1841 = llvm.alloca %1840 x i64 : (i64) -> !llvm.ptr
llvm.store %1839, %1841 : i64, !llvm.ptr
cf.br ^bb297
^bb297:
%1842 = llvm.load %1841 : !llvm.ptr -> i64
%1843 = arith.constant 1 : i32
%1845 = arith.extsi %1843 : i32 to i64
%1844 = arith.cmpi sle, %1842, %1845 : i64
cf.cond_br %1844, ^bb298, ^bb299
^bb298:
%1846 = arith.constant 0 : i32
%1847 = arith.constant 1 : i32
%1848 = arith.subi %1846, %1847 : i32
%1849 = arith.extsi %1848 : i32 to i64
%1850 = llvm.mlir.constant(1 : i64) : i64
%1851 = llvm.alloca %1850 x i64 : (i64) -> !llvm.ptr
llvm.store %1849, %1851 : i64, !llvm.ptr
cf.br ^bb300
^bb300:
%1852 = llvm.load %1851 : !llvm.ptr -> i64
%1853 = arith.constant 1 : i32
%1855 = arith.extsi %1853 : i32 to i64
%1854 = arith.cmpi sle, %1852, %1855 : i64
cf.cond_br %1854, ^bb301, ^bb302
^bb301:
%1857 = llvm.load %1780 : !llvm.ptr -> i64
%1858 = llvm.load %1831 : !llvm.ptr -> i64
%1859 = arith.addi %1857, %1858 : i64
%1860 = llvm.load %1783 : !llvm.ptr -> i64
%1861 = llvm.load %1841 : !llvm.ptr -> i64
%1862 = arith.addi %1860, %1861 : i64
%1863 = llvm.load %1786 : !llvm.ptr -> i64
%1864 = llvm.load %1851 : !llvm.ptr -> i64
%1865 = arith.addi %1863, %1864 : i64
%1856 = func.call @pack3(%1859, %1862, %1865) : (i64, i64, i64) -> i64
%1867 = llvm.load %1780 : !llvm.ptr -> i64
%1868 = llvm.load %1831 : !llvm.ptr -> i64
%1869 = arith.addi %1867, %1868 : i64
%1870 = llvm.load %1783 : !llvm.ptr -> i64
%1871 = llvm.load %1841 : !llvm.ptr -> i64
%1872 = arith.addi %1870, %1871 : i64
%1873 = llvm.load %1786 : !llvm.ptr -> i64
%1874 = llvm.load %1851 : !llvm.ptr -> i64
%1875 = arith.addi %1873, %1874 : i64
%1866 = func.call @cellhash(%1869, %1872, %1875, %1424) : (i64, i64, i64, i64) -> i64
%1876 = llvm.mlir.constant(1 : i64) : i64
%1877 = llvm.alloca %1876 x i64 : (i64) -> !llvm.ptr
llvm.store %1866, %1877 : i64, !llvm.ptr
%1878 = arith.constant 0 : i32
%1879 = arith.extsi %1878 : i32 to i64
%1880 = llvm.mlir.constant(1 : i64) : i64
%1881 = llvm.alloca %1880 x i64 : (i64) -> !llvm.ptr
llvm.store %1879, %1881 : i64, !llvm.ptr
cf.br ^bb303
^bb303:
%1883 = llvm.load %1877 : !llvm.ptr -> i64
%1884 = llvm.getelementptr %1431[%1883] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%1882 = llvm.load %1884 : !llvm.ptr -> i8
%1885 = arith.constant 0 : i32
%1887 = arith.extsi %1882 : i8 to i32
%1886 = arith.cmpi ne, %1887, %1885 : i32
cf.cond_br %1886, ^bb304, ^bb305
^bb304:
%1889 = llvm.load %1877 : !llvm.ptr -> i64
%1890 = llvm.getelementptr %1425[%1889] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1888 = llvm.load %1890 : !llvm.ptr -> i64
%1891 = arith.cmpi eq, %1888, %1856 : i64
cf.cond_br %1891, ^bb306, ^bb307
^bb306:
%1892 = arith.constant 1 : i32
%1893 = arith.extsi %1892 : i32 to i64
llvm.store %1893, %1881 : i64, !llvm.ptr
cf.br ^bb305
^bb307:
cf.br ^bb308
^bb308:
%1894 = llvm.load %1877 : !llvm.ptr -> i64
%1895 = arith.constant 1 : i32
%1897 = arith.extsi %1895 : i32 to i64
%1896 = arith.addi %1894, %1897 : i64
%1898 = arith.constant 1 : i32
%1900 = arith.extsi %1898 : i32 to i64
%1899 = arith.subi %1424, %1900 : i64
%1901 = arith.andi %1896, %1899 : i64
llvm.store %1901, %1877 : i64, !llvm.ptr
cf.br ^bb303
^bb305:
%1902 = llvm.load %1881 : !llvm.ptr -> i64
%1903 = arith.constant 1 : i32
%1905 = arith.extsi %1903 : i32 to i64
%1904 = arith.cmpi eq, %1902, %1905 : i64
cf.cond_br %1904, ^bb309, ^bb310
^bb309:
%1907 = llvm.load %1877 : !llvm.ptr -> i64
%1908 = llvm.getelementptr %1428[%1907] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1906 = llvm.load %1908 : !llvm.ptr -> i32
%1909 = arith.extsi %1906 : i32 to i64
%1910 = llvm.mlir.constant(1 : i64) : i64
%1911 = llvm.alloca %1910 x i64 : (i64) -> !llvm.ptr
llvm.store %1909, %1911 : i64, !llvm.ptr
cf.br ^bb312
^bb312:
%1912 = llvm.load %1911 : !llvm.ptr -> i64
%1913 = arith.constant 0 : i32
%1914 = arith.constant 1 : i32
%1915 = arith.subi %1913, %1914 : i32
%1917 = arith.extsi %1915 : i32 to i64
%1916 = arith.cmpi ne, %1912, %1917 : i64
cf.cond_br %1916, ^bb313, ^bb314
^bb313:
%1918 = llvm.load %1911 : !llvm.ptr -> i64
%1919 = arith.cmpi ne, %1918, %1657 : i64
cf.cond_br %1919, ^bb315, ^bb316
^bb315:
%1921 = llvm.load %1911 : !llvm.ptr -> i64
%1922 = llvm.getelementptr %501[%1921] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1920 = llvm.load %1922 : !llvm.ptr -> i32
%1923 = arith.extsi %1920 : i32 to i64
%1924 = arith.subi %1923, %1774 : i64
%1926 = llvm.load %1911 : !llvm.ptr -> i64
%1927 = llvm.getelementptr %504[%1926] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1925 = llvm.load %1927 : !llvm.ptr -> i32
%1928 = arith.extsi %1925 : i32 to i64
%1929 = arith.subi %1928, %1777 : i64
%1931 = llvm.load %1911 : !llvm.ptr -> i64
%1932 = llvm.getelementptr %507[%1931] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1930 = llvm.load %1932 : !llvm.ptr -> i32
%1933 = arith.extsi %1930 : i32 to i64
%1934 = arith.subi %1933, %1763 : i64
%1935 = arith.cmpi sle, %1924, %497 : i64
%1936 = scf.if %1935 -> (i1) {
%1937 = arith.constant 0 : i32
%1939 = arith.extsi %1937 : i32 to i64
%1938 = arith.subi %1939, %497 : i64
%1940 = arith.cmpi sge, %1924, %1938 : i64
scf.yield %1940 : i1
} else {
%1941 = arith.constant false
scf.yield %1941 : i1
}
%1942 = scf.if %1936 -> (i1) {
%1943 = arith.cmpi sle, %1929, %497 : i64
scf.yield %1943 : i1
} else {
%1944 = arith.constant false
scf.yield %1944 : i1
}
%1945 = scf.if %1942 -> (i1) {
%1946 = arith.constant 0 : i32
%1948 = arith.extsi %1946 : i32 to i64
%1947 = arith.subi %1948, %497 : i64
%1949 = arith.cmpi sge, %1929, %1947 : i64
scf.yield %1949 : i1
} else {
%1950 = arith.constant false
scf.yield %1950 : i1
}
%1951 = scf.if %1945 -> (i1) {
%1952 = arith.cmpi sle, %1934, %497 : i64
scf.yield %1952 : i1
} else {
%1953 = arith.constant false
scf.yield %1953 : i1
}
%1954 = scf.if %1951 -> (i1) {
%1955 = arith.constant 0 : i32
%1957 = arith.extsi %1955 : i32 to i64
%1956 = arith.subi %1957, %497 : i64
%1958 = arith.cmpi sge, %1934, %1956 : i64
scf.yield %1958 : i1
} else {
%1959 = arith.constant false
scf.yield %1959 : i1
}
cf.cond_br %1954, ^bb318, ^bb319
^bb318:
%1961 = llvm.load %1911 : !llvm.ptr -> i64
%1962 = llvm.getelementptr %501[%1961] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1960 = llvm.load %1962 : !llvm.ptr -> i32
%1963 = arith.extsi %1960 : i32 to i64
%1964 = arith.muli %1774, %1963 : i64
%1966 = llvm.load %1911 : !llvm.ptr -> i64
%1967 = llvm.getelementptr %504[%1966] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1965 = llvm.load %1967 : !llvm.ptr -> i32
%1968 = arith.extsi %1965 : i32 to i64
%1969 = arith.muli %1777, %1968 : i64
%1970 = arith.addi %1964, %1969 : i64
%1972 = llvm.load %1911 : !llvm.ptr -> i64
%1973 = llvm.getelementptr %507[%1972] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1971 = llvm.load %1973 : !llvm.ptr -> i32
%1974 = arith.extsi %1971 : i32 to i64
%1975 = arith.muli %1763, %1974 : i64
%1976 = arith.addi %1970, %1975 : i64
%1977 = arith.sitofp %1976 : i64 to f64
%1978 = arith.mulf %1977, %1373 : f64
%1979 = llvm.mlir.constant(1 : i64) : i64
%1980 = llvm.alloca %1979 x f64 : (i64) -> !llvm.ptr
llvm.store %1978, %1980 : f64, !llvm.ptr
%1981 = llvm.load %1980 : !llvm.ptr -> f64
%1982 = arith.constant 1.0 : f32
%1984 = arith.extf %1982 : f32 to f64
%1983 = arith.cmpf ogt, %1981, %1984 : f64
cf.cond_br %1983, ^bb321, ^bb322
^bb321:
%1985 = arith.constant 1.0 : f32
%1986 = arith.extf %1985 : f32 to f64
llvm.store %1986, %1980 : f64, !llvm.ptr
cf.br ^bb323
^bb322:
cf.br ^bb323
^bb323:
%1987 = llvm.load %1980 : !llvm.ptr -> f64
%1988 = arith.constant 0.0 : f32
%1989 = arith.constant 1.0 : f32
%1990 = arith.subf %1988, %1989 : f32
%1992 = arith.extf %1990 : f32 to f64
%1991 = arith.cmpf olt, %1987, %1992 : f64
cf.cond_br %1991, ^bb324, ^bb325
^bb324:
%1993 = arith.constant 0.0 : f32
%1994 = arith.constant 1.0 : f32
%1995 = arith.subf %1993, %1994 : f32
%1996 = arith.extf %1995 : f32 to f64
llvm.store %1996, %1980 : f64, !llvm.ptr
cf.br ^bb326
^bb325:
cf.br ^bb326
^bb326:
%1998 = llvm.load %1980 : !llvm.ptr -> f64
%1997 = func.call @acos(%1998) : (f64) -> f64
%1999 = arith.mulf %1997, %1376 : f64
%2000 = arith.mulf %1999, %1999 : f64
%2001 = arith.addf %1658, %2000 : f64
%2003 = llvm.load %1911 : !llvm.ptr -> i64
%2004 = llvm.getelementptr %1601[%2003] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%2002 = llvm.load %2004 : !llvm.ptr -> f64
%2005 = arith.constant 0 : f32
%2007 = arith.extf %2005 : f32 to f64
%2006 = arith.subf %2002, %2007 : f64
%2008 = arith.cmpf olt, %2001, %2006 : f64
cf.cond_br %2008, ^bb327, ^bb328
^bb327:
%2009 = llvm.load %1911 : !llvm.ptr -> i64
%2010 = llvm.getelementptr %1601[%2009] : (!llvm.ptr, i64) -> !llvm.ptr, f64
llvm.store %2001, %2010 : f64, !llvm.ptr
%2012 = llvm.load %1911 : !llvm.ptr -> i64
%2013 = llvm.getelementptr %1609[%2012] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2011 = llvm.load %2013 : !llvm.ptr -> i32
%2014 = arith.constant 0 : i32
%2015 = arith.cmpi sge, %2011, %2014 : i32
cf.cond_br %2015, ^bb330, ^bb331
^bb330:
%2017 = llvm.load %1911 : !llvm.ptr -> i64
%2018 = llvm.getelementptr %1609[%2017] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2016 = llvm.load %2018 : !llvm.ptr -> i32
%2019 = arith.extsi %2016 : i32 to i64
%2020 = llvm.mlir.constant(1 : i64) : i64
%2021 = llvm.alloca %2020 x i64 : (i64) -> !llvm.ptr
llvm.store %2019, %2021 : i64, !llvm.ptr
cf.br ^bb333
^bb333:
%2022 = llvm.load %2021 : !llvm.ptr -> i64
%2023 = arith.constant 0 : i32
%2025 = arith.extsi %2023 : i32 to i64
%2024 = arith.cmpi sgt, %2022, %2025 : i64
cf.cond_br %2024, ^bb334, ^bb335
^bb334:
%2026 = llvm.load %2021 : !llvm.ptr -> i64
%2027 = arith.constant 1 : i32
%2029 = arith.extsi %2027 : i32 to i64
%2028 = arith.subi %2026, %2029 : i64
%2030 = arith.constant 2 : i32
%2032 = arith.extsi %2030 : i32 to i64
%2031 = arith.divsi %2028, %2032 : i64
%2035 = llvm.getelementptr %1605[%2031] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2034 = llvm.load %2035 : !llvm.ptr -> i32
%2036 = arith.extsi %2034 : i32 to i64
%2037 = llvm.getelementptr %1601[%2036] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%2033 = llvm.load %2037 : !llvm.ptr -> f64
%2040 = llvm.load %2021 : !llvm.ptr -> i64
%2041 = llvm.getelementptr %1605[%2040] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2039 = llvm.load %2041 : !llvm.ptr -> i32
%2042 = arith.extsi %2039 : i32 to i64
%2043 = llvm.getelementptr %1601[%2042] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%2038 = llvm.load %2043 : !llvm.ptr -> f64
%2044 = arith.cmpf ole, %2033, %2038 : f64
cf.cond_br %2044, ^bb336, ^bb337
^bb336:
cf.br ^bb335
^bb337:
cf.br ^bb338
^bb338:
%2046 = llvm.getelementptr %1605[%2031] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2045 = llvm.load %2046 : !llvm.ptr -> i32
%2047 = arith.extsi %2045 : i32 to i64
%2049 = llvm.load %2021 : !llvm.ptr -> i64
%2050 = llvm.getelementptr %1605[%2049] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2048 = llvm.load %2050 : !llvm.ptr -> i32
%2051 = arith.extsi %2048 : i32 to i64
%2052 = arith.trunci %2051 : i64 to i32
%2053 = llvm.getelementptr %1605[%2031] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2052, %2053 : i32, !llvm.ptr
%2054 = arith.trunci %2047 : i64 to i32
%2055 = llvm.load %2021 : !llvm.ptr -> i64
%2056 = llvm.getelementptr %1605[%2055] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2054, %2056 : i32, !llvm.ptr
%2057 = llvm.load %2021 : !llvm.ptr -> i64
%2058 = arith.trunci %2057 : i64 to i32
%2059 = llvm.getelementptr %1609[%2047] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2058, %2059 : i32, !llvm.ptr
%2060 = arith.trunci %2031 : i64 to i32
%2061 = llvm.getelementptr %1609[%2051] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2060, %2061 : i32, !llvm.ptr
llvm.store %2031, %2021 : i64, !llvm.ptr
cf.br ^bb333
^bb335:
cf.br ^bb332
^bb331:
%2062 = llvm.load %1644 : !llvm.ptr -> i64
%2063 = llvm.mlir.constant(1 : i64) : i64
%2064 = llvm.alloca %2063 x i64 : (i64) -> !llvm.ptr
llvm.store %2062, %2064 : i64, !llvm.ptr
%2065 = llvm.load %1911 : !llvm.ptr -> i64
%2066 = arith.trunci %2065 : i64 to i32
%2067 = llvm.load %2064 : !llvm.ptr -> i64
%2068 = llvm.getelementptr %1605[%2067] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2066, %2068 : i32, !llvm.ptr
%2069 = llvm.load %2064 : !llvm.ptr -> i64
%2070 = arith.trunci %2069 : i64 to i32
%2071 = llvm.load %1911 : !llvm.ptr -> i64
%2072 = llvm.getelementptr %1609[%2071] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2070, %2072 : i32, !llvm.ptr
%2073 = llvm.load %1644 : !llvm.ptr -> i64
%2074 = arith.constant 1 : i32
%2076 = arith.extsi %2074 : i32 to i64
%2075 = arith.addi %2073, %2076 : i64
llvm.store %2075, %1644 : i64, !llvm.ptr
cf.br ^bb339
^bb339:
%2077 = llvm.load %2064 : !llvm.ptr -> i64
%2078 = arith.constant 0 : i32
%2080 = arith.extsi %2078 : i32 to i64
%2079 = arith.cmpi sgt, %2077, %2080 : i64
cf.cond_br %2079, ^bb340, ^bb341
^bb340:
%2081 = llvm.load %2064 : !llvm.ptr -> i64
%2082 = arith.constant 1 : i32
%2084 = arith.extsi %2082 : i32 to i64
%2083 = arith.subi %2081, %2084 : i64
%2085 = arith.constant 2 : i32
%2087 = arith.extsi %2085 : i32 to i64
%2086 = arith.divsi %2083, %2087 : i64
%2090 = llvm.getelementptr %1605[%2086] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2089 = llvm.load %2090 : !llvm.ptr -> i32
%2091 = arith.extsi %2089 : i32 to i64
%2092 = llvm.getelementptr %1601[%2091] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%2088 = llvm.load %2092 : !llvm.ptr -> f64
%2095 = llvm.load %2064 : !llvm.ptr -> i64
%2096 = llvm.getelementptr %1605[%2095] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2094 = llvm.load %2096 : !llvm.ptr -> i32
%2097 = arith.extsi %2094 : i32 to i64
%2098 = llvm.getelementptr %1601[%2097] : (!llvm.ptr, i64) -> !llvm.ptr, f64
%2093 = llvm.load %2098 : !llvm.ptr -> f64
%2099 = arith.cmpf ole, %2088, %2093 : f64
cf.cond_br %2099, ^bb342, ^bb343
^bb342:
cf.br ^bb341
^bb343:
cf.br ^bb344
^bb344:
%2101 = llvm.getelementptr %1605[%2086] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2100 = llvm.load %2101 : !llvm.ptr -> i32
%2102 = arith.extsi %2100 : i32 to i64
%2104 = llvm.load %2064 : !llvm.ptr -> i64
%2105 = llvm.getelementptr %1605[%2104] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2103 = llvm.load %2105 : !llvm.ptr -> i32
%2106 = arith.extsi %2103 : i32 to i64
%2107 = arith.trunci %2106 : i64 to i32
%2108 = llvm.getelementptr %1605[%2086] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2107, %2108 : i32, !llvm.ptr
%2109 = arith.trunci %2102 : i64 to i32
%2110 = llvm.load %2064 : !llvm.ptr -> i64
%2111 = llvm.getelementptr %1605[%2110] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2109, %2111 : i32, !llvm.ptr
%2112 = llvm.load %2064 : !llvm.ptr -> i64
%2113 = arith.trunci %2112 : i64 to i32
%2114 = llvm.getelementptr %1609[%2102] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2113, %2114 : i32, !llvm.ptr
%2115 = arith.trunci %2086 : i64 to i32
%2116 = llvm.getelementptr %1609[%2106] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %2115, %2116 : i32, !llvm.ptr
llvm.store %2086, %2064 : i64, !llvm.ptr
cf.br ^bb339
^bb341:
cf.br ^bb332
^bb332:
cf.br ^bb329
^bb328:
cf.br ^bb329
^bb329:
cf.br ^bb320
^bb319:
cf.br ^bb320
^bb320:
cf.br ^bb317
^bb316:
cf.br ^bb317
^bb317:
%2118 = llvm.load %1911 : !llvm.ptr -> i64
%2119 = llvm.getelementptr %1449[%2118] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%2117 = llvm.load %2119 : !llvm.ptr -> i32
%2120 = arith.extsi %2117 : i32 to i64
llvm.store %2120, %1911 : i64, !llvm.ptr
cf.br ^bb312
^bb314:
cf.br ^bb311
^bb310:
cf.br ^bb311
^bb311:
%2121 = llvm.load %1851 : !llvm.ptr -> i64
%2122 = arith.constant 1 : i32
%2124 = arith.extsi %2122 : i32 to i64
%2123 = arith.addi %2121, %2124 : i64
llvm.store %2123, %1851 : i64, !llvm.ptr
cf.br ^bb300
^bb302:
%2125 = llvm.load %1841 : !llvm.ptr -> i64
%2126 = arith.constant 1 : i32
%2128 = arith.extsi %2126 : i32 to i64
%2127 = arith.addi %2125, %2128 : i64
llvm.store %2127, %1841 : i64, !llvm.ptr
cf.br ^bb297
^bb299:
%2129 = llvm.load %1831 : !llvm.ptr -> i64
%2130 = arith.constant 1 : i32
%2132 = arith.extsi %2130 : i32 to i64
%2131 = arith.addi %2129, %2132 : i64
llvm.store %2131, %1831 : i64, !llvm.ptr
cf.br ^bb294
^bb296:
cf.br ^bb261
^bb263:
%2133 = llvm.load %481 : !llvm.ptr -> f64
%2134 = llvm.load %1648 : !llvm.ptr -> f64
%2135 = arith.addf %2133, %2134 : f64
llvm.store %2135, %481 : f64, !llvm.ptr
func.call @free(%1609) : (!llvm.ptr) -> ()
func.call @free(%1605) : (!llvm.ptr) -> ()
func.call @free(%1601) : (!llvm.ptr) -> ()
func.call @free(%1449) : (!llvm.ptr) -> ()
func.call @free(%1431) : (!llvm.ptr) -> ()
func.call @free(%1428) : (!llvm.ptr) -> ()
func.call @free(%1425) : (!llvm.ptr) -> ()
func.call @free(%1378) : (!llvm.ptr) -> ()
func.call @free(%507) : (!llvm.ptr) -> ()
func.call @free(%504) : (!llvm.ptr) -> ()
func.call @free(%501) : (!llvm.ptr) -> ()
%2147 = llvm.load %485 : !llvm.ptr -> i64
%2148 = arith.constant 1 : i32
%2150 = arith.extsi %2148 : i32 to i64
%2149 = arith.addi %2147, %2150 : i64
llvm.store %2149, %485 : i64, !llvm.ptr
cf.br ^bb102
^bb104:
%2151 = llvm.mlir.addressof @str_0 : !llvm.ptr
%2152 = llvm.load %481 : !llvm.ptr -> f64
%2153 = llvm.call @printf(%2151, %2152) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, f64) -> i32
%2154 = arith.constant 0 : i32
func.return %2154 : i32
}
}