Problem 489

Common Factors Between Two Sequences H(18, 1900) = sum G(a,b) via Hensel lift + CRT.

Answer1791954757162
Output1791954757162
StatusPASS
Native helperno
Runtime150 ms
Peak memory1424 KB
Time complexityO(n^2) (estimated)
Space complexityO(n^2) (estimated)

Performance comparison

MetricOur solutionBest known
Time complexityO(n^2)O(n log n)
Space complexityO(n^2)O(n)
ApproachFlow solutionChinese Remainder Theorem
VerdictSuboptimal

Flow source

# Project Euler 489
# Common Factors Between Two Sequences
# H(18, 1900) = sum G(a,b) via Hensel lift + CRT.

extern {
    function calloc(n: i64, size: i64) -> ptr<void>
    function free(p: ptr<void>) -> void
}

let mut PRIMES: ptr<i64> = null
let mut PC: i64 = 0
let mut A3: ptr<i64> = null
let mut A6: ptr<i64> = null
let mut FAC_A_P: ptr<i64> = null
let mut FAC_A_E: ptr<i64> = null
let mut FAC_AN: ptr<i64> = null

function igcd(a0: i64, b0: i64) -> i64 {
    let mut a: i64 = a0
    let mut b: i64 = b0
    if a < 0 { a = 0 - a }
    if b < 0 { b = 0 - b }
    while b != 0 {
        let t: i64 = a % b
        a = b
        b = t
    }
    return a
}

function modpow(base0: i64, exp0: i64, mod: i64) -> i64 {
    let mut r: i64 = 1
    let mut b: i64 = base0 % mod
    if b < 0 { b = b + mod }
    let mut e: i64 = exp0
    while e > 0 {
        if e % 2 == 1 {
            r = ((r as i128) * (b as i128) % (mod as i128)) as i64
        }
        b = ((b as i128) * (b as i128) % (mod as i128)) as i64
        e = e / 2
    }
    return r
}

function modinv(a0: i64, m: i64) -> i64 {
    let mut old_r: i64 = a0 % m
    if old_r < 0 { old_r = old_r + m }
    let mut r: i64 = m
    let mut old_s: i64 = 1
    let mut s: i64 = 0
    while r != 0 {
        let q: i64 = old_r / r
        let nr: i64 = old_r - q * r
        old_r = r
        r = nr
        let ns: i64 = old_s - q * s
        old_s = s
        s = ns
    }
    let mut x: i64 = old_s % m
    if x < 0 { x = x + m }
    return x
}

function tonelli(n0: i64, p: i64) -> i64 {
    # returns sqrt or -1 if none
    let mut n: i64 = n0 % p
    if n < 0 { n = n + p }
    if n == 0 { return 0 }
    if p == 2 { return n }
    if modpow(n, (p - 1) / 2, p) != 1 { return -1 }
    if p % 4 == 3 {
        return modpow(n, (p + 1) / 4, p)
    }
    let mut q: i64 = p - 1
    let mut s: i64 = 0
    while q % 2 == 0 {
        q = q / 2
        s = s + 1
    }
    let mut z: i64 = 2
    while modpow(z, (p - 1) / 2, p) != p - 1 {
        z = z + 1
    }
    let mut m: i64 = s
    let mut c: i64 = modpow(z, q, p)
    let mut t: i64 = modpow(n, q, p)
    let mut r: i64 = modpow(n, (q + 1) / 2, p)
    while t != 1 {
        let mut i: i64 = 1
        let mut t2i: i64 = (t * t) % p
        while i < m {
            if t2i == 1 { break }
            t2i = (t2i * t2i) % p
            i = i + 1
        }
        if i == m { return -1 }
        let mut exp: i64 = 1
        let mut k: i64 = 0
        while k < m - i - 1 {
            exp = exp * 2
            k = k + 1
        }
        let b: i64 = modpow(c, exp, p)
        r = (r * b) % p
        c = (b * b) % p
        t = (t * c) % p
        m = i
    }
    return r
}

function factor_into(n0: i64, ps: ptr<i64>, es: ptr<i64>) -> i64 {
    let mut n: i64 = n0
    let mut on: i64 = 0
    let mut i: i64 = 0
    while i < PC {
        if PRIMES[i] * PRIMES[i] > n { break }
        if n % PRIMES[i] == 0 {
            let mut e: i64 = 0
            while n % PRIMES[i] == 0 {
                n = n / PRIMES[i]
                e = e + 1
            }
            ps[on] = PRIMES[i]
            es[on] = e
            on = on + 1
        }
        i = i + 1
    }
    if n > 1 {
        ps[on] = n
        es[on] = 1
        on = on + 1
    }
    return on
}

function init_sols(a: i64, b: i64, p: i64, sols: ptr<i64>) -> i64 {
    let bmod: i64 = b % p
    let mut ns: i64 = 0
    if a % p == 0 {
        let mut n: i64 = 0
        while n < p {
            if (modpow(n, 3, p) + bmod) % p == 0 {
                if (modpow((n + a) % p, 3, p) + bmod) % p == 0 {
                    sols[ns] = n
                    ns = ns + 1
                }
            }
            n = n + 1
        }
        return ns
    }
    if p == 3 { return 0 }
    if p == 2 {
        let mut n2: i64 = 0
        while n2 < 2 {
            let c1: i64 = (n2 * n2 * n2 + b) % 2
            let na: i64 = n2 + a
            let c2: i64 = (na * na * na + b) % 2
            if c1 == 0 {
                if c2 == 0 {
                    sols[ns] = n2
                    ns = ns + 1
                }
            }
            n2 = n2 + 1
        }
        return ns
    }
    let a_mod: i64 = a % p
    let mut disc: i64 = (0 - 3 * a_mod * a_mod) % p
    if disc < 0 { disc = disc + p }
    let sqrt_disc: i64 = tonelli(disc, p)
    if sqrt_disc < 0 { return 0 }
    let inv6: i64 = modinv(6 % p, p)
    let mut tt: i64 = (0 - 3 * a_mod) % p
    if tt < 0 { tt = tt + p }
    let n1: i64 = ((tt + sqrt_disc) % p * inv6) % p
    let mut n2b: i64 = (tt - sqrt_disc) % p
    if n2b < 0 { n2b = n2b + p }
    n2b = (n2b * inv6) % p
    let mut ci: i64 = 0
    while ci < 2 {
        let mut n: i64 = n1
        if ci == 1 { n = n2b }
        let mut ok: i64 = 1
        let mut j: i64 = 0
        while j < ns {
            if sols[j] == n { ok = 0 }
            j = j + 1
        }
        if ok != 0 {
            if (modpow(n, 3, p) + bmod) % p == 0 {
                if (modpow((n + a) % p, 3, p) + bmod) % p == 0 {
                    sols[ns] = n
                    ns = ns + 1
                }
            }
        }
        ci = ci + 1
    }
    return ns
}

function linear_sols(A0: i64, B0: i64, p: i64, out: ptr<i64>) -> i64 {
    let mut A: i64 = A0 % p
    let mut B: i64 = B0 % p
    if A < 0 { A = A + p }
    if B < 0 { B = B + p }
    if A == 0 {
        if B == 0 {
            let mut i: i64 = 0
            while i < p {
                out[i] = i
                i = i + 1
            }
            return p
        }
        return 0
    }
    out[0] = (B * modinv(A, p)) % p
    return 1
}

function lift(a: i64, b: i64, p: i64, e_max: i64, sols_out: ptr<i64>, e_out: ptr<i64>) -> i64 {
    let sols: ptr<i64> = calloc(512, 8)
    let new_sols: ptr<i64> = calloc(512, 8)
    let t1: ptr<i64> = calloc(256, 8)
    let t2: ptr<i64> = calloc(256, 8)
    let ts: ptr<i64> = calloc(256, 8)
    if sols == null || new_sols == null { return 0 }
    let mut ns: i64 = init_sols(a, b, p, sols)
    if ns == 0 {
        e_out[0] = 0
        free(sols); free(new_sols); free(t1); free(t2); free(ts)
        return 0
    }
    let mut modv: i64 = p
    let mut e: i64 = 1
    while e < e_max {
        let mod2: i64 = modv * p
        let mut nn: i64 = 0
        let mut si: i64 = 0
        while si < ns {
            let r: i64 = sols[si]
            let v1: i64 = (modpow(r % mod2, 3, mod2) + b) % mod2
            let v2: i64 = (modpow((r + a) % mod2, 3, mod2) + b) % mod2
            if v1 % modv == 0 {
                if v2 % modv == 0 {
                    let c1: i64 = (v1 / modv) % p
                    let c2: i64 = (v2 / modv) % p
                    let r_mod_p: i64 = r % p
                    let s_mod_p: i64 = (r + a) % p
                    let A1: i64 = (3 * r_mod_p * r_mod_p) % p
                    let A2: i64 = (3 * s_mod_p * s_mod_p) % p
                    let B1: i64 = (0 - c1) % p
                    let B2: i64 = (0 - c2) % p
                    if B1 < 0 { }
                    let mut bb1: i64 = (0 - c1) % p
                    if bb1 < 0 { bb1 = bb1 + p }
                    let mut bb2: i64 = (0 - c2) % p
                    if bb2 < 0 { bb2 = bb2 + p }
                    let n1: i64 = linear_sols(A1, bb1, p, t1)
                    if n1 != 0 {
                        let n2: i64 = linear_sols(A2, bb2, p, t2)
                        if n2 != 0 {
                            let mut nt: i64 = 0
                            if n1 == p {
                                if n2 == p {
                                    let mut t: i64 = 0
                                    while t < p {
                                        ts[nt] = t
                                        nt = nt + 1
                                        t = t + 1
                                    }
                                } else {
                                    let mut i2: i64 = 0
                                    while i2 < n2 {
                                        ts[nt] = t2[i2]
                                        nt = nt + 1
                                        i2 = i2 + 1
                                    }
                                }
                            } else {
                                if n2 == p {
                                    let mut i1: i64 = 0
                                    while i1 < n1 {
                                        ts[nt] = t1[i1]
                                        nt = nt + 1
                                        i1 = i1 + 1
                                    }
                                } else {
                                    if t1[0] == t2[0] {
                                        ts[nt] = t1[0]
                                        nt = nt + 1
                                    }
                                }
                            }
                            let mut ii: i64 = 0
                            while ii < nt {
                                let v: i64 = r + ts[ii] * modv
                                let mut ok: i64 = 1
                                let mut jj: i64 = 0
                                while jj < nn {
                                    if new_sols[jj] == v { ok = 0 }
                                    jj = jj + 1
                                }
                                if ok != 0 {
                                    new_sols[nn] = v
                                    nn = nn + 1
                                }
                                ii = ii + 1
                            }
                        }
                    }
                }
            }
            si = si + 1
        }
        if nn == 0 { break }
        ns = nn
        let mut k: i64 = 0
        while k < ns {
            sols[k] = new_sols[k]
            k = k + 1
        }
        modv = mod2
        e = e + 1
    }
    e_out[0] = e
    let mut o: i64 = 0
    while o < ns {
        sols_out[o] = sols[o]
        o = o + 1
    }
    free(sols); free(new_sols); free(t1); free(t2); free(ts)
    return ns
}

function combine(
    s1: ptr<i64>, n1: i64, m1: i64,
    s2: ptr<i64>, n2: i64, m2: i64,
    out: ptr<i64>, mout: ptr<i64>
) -> i64 {
    if m1 == 1 {
        let mut i: i64 = 0
        while i < n2 {
            out[i] = s2[i] % m2
            i = i + 1
        }
        mout[0] = m2
        return n2
    }
    if m2 == 1 {
        let mut i2: i64 = 0
        while i2 < n1 {
            out[i2] = s1[i2] % m1
            i2 = i2 + 1
        }
        mout[0] = m1
        return n1
    }
    let inv: i64 = modinv(m1 % m2, m2)
    let nm: i64 = m1 * m2
    let mut nn: i64 = 0
    let mut i: i64 = 0
    while i < n1 {
        let mut x: i64 = s1[i] % m1
        if x < 0 { x = x + m1 }
        let mut j: i64 = 0
        while j < n2 {
            let mut y: i64 = s2[j] % m2
            if y < 0 { y = y + m2 }
            let mut diff: i64 = (y - x) % m2
            if diff < 0 { diff = diff + m2 }
            let t: i64 = (diff * inv) % m2
            let v: i64 = x + m1 * t
            let mut ok: i64 = 1
            let mut k: i64 = 0
            while k < nn {
                if out[k] == v { ok = 0 }
                k = k + 1
            }
            if ok != 0 {
                out[nn] = v
                nn = nn + 1
            }
            j = j + 1
        }
        i = i + 1
    }
    mout[0] = nm
    return nn
}

function compute_G(a: i64, b: i64) -> i64 {
    let R: i64 = A6[a] + 27 * b * b
    let fac_p: ptr<i64> = calloc(64, 8)
    let fac_e: ptr<i64> = calloc(64, 8)
    if fac_p == null || fac_e == null { return -1 }
    let nr: i64 = factor_into(R, fac_p, fac_e)
    let mp: ptr<i64> = calloc(64, 8)
    let me: ptr<i64> = calloc(64, 8)
    if mp == null || me == null { return -1 }
    let mut nm: i64 = 0
    let mut i: i64 = 0
    while i < nr {
        mp[nm] = fac_p[i]
        me[nm] = fac_e[i]
        nm = nm + 1
        i = i + 1
    }
    i = 0
    while i < FAC_AN[a] {
        let p: i64 = FAC_A_P[a * 8 + i]
        let e: i64 = 3 * FAC_A_E[a * 8 + i]
        let mut f: i64 = -1
        let mut j: i64 = 0
        while j < nm {
            if mp[j] == p { f = j }
            j = j + 1
        }
        if f >= 0 {
            me[f] = me[f] + e
        } else {
            mp[nm] = p
            me[nm] = e
            nm = nm + 1
        }
        i = i + 1
    }
    # sort by p
    i = 0
    while i < nm {
        let mut j: i64 = i + 1
        while j < nm {
            if mp[j] < mp[i] {
                let tp: i64 = mp[i]
                mp[i] = mp[j]
                mp[j] = tp
                let te: i64 = me[i]
                me[i] = me[j]
                me[j] = te
            }
            j = j + 1
        }
        i = i + 1
    }

    let sols: ptr<i64> = calloc(1024, 8)
    let out: ptr<i64> = calloc(1024, 8)
    let ps: ptr<i64> = calloc(512, 8)
    let ebox: ptr<i64> = calloc(1, 8)
    let mbox: ptr<i64> = calloc(1, 8)
    if sols == null || out == null || ps == null { return -1 }
    sols[0] = 0
    let mut ns: i64 = 1
    let mut modv: i64 = 1
    let mut any: i64 = 0
    i = 0
    while i < nm {
        let nps: i64 = lift(a, b, mp[i], me[i], ps, ebox)
        let e: i64 = ebox[0]
        if e > 0 {
            any = 1
            let mut pe: i64 = 1
            let mut k: i64 = 0
            while k < e {
                pe = pe * mp[i]
                k = k + 1
            }
            let on: i64 = combine(sols, ns, modv, ps, nps, pe, out, mbox)
            ns = on
            modv = mbox[0]
            k = 0
            while k < ns {
                sols[k] = out[k]
                k = k + 1
            }
        }
        i = i + 1
    }
    let mut ans: i64 = 0
    if any != 0 {
        ans = sols[0]
        i = 1
        while i < ns {
            if sols[i] < ans { ans = sols[i] }
            i = i + 1
        }
    }
    free(mbox); free(ebox); free(ps); free(out); free(sols)
    free(me); free(mp); free(fac_e); free(fac_p)
    return ans
}

function main() -> i32 {
    let lim: i64 = 12000
    let sieve: ptr<i8> = calloc(lim + 1, 1)
    PRIMES = calloc(lim, 8)
    A3 = calloc(20, 8)
    A6 = calloc(20, 8)
    FAC_A_P = calloc(20 * 8, 8)
    FAC_A_E = calloc(20 * 8, 8)
    FAC_AN = calloc(20, 8)
    if sieve == null || PRIMES == null { return 1 }
    let mut i: i64 = 0
    while i <= lim {
        sieve[i] = 1
        i = i + 1
    }
    sieve[0] = 0
    sieve[1] = 0
    i = 2
    while i * i <= lim {
        if sieve[i] != 0 {
            let mut j: i64 = i * i
            while j <= lim {
                sieve[j] = 0
                j = j + i
            }
        }
        i = i + 1
    }
    PC = 0
    i = 2
    while i <= lim {
        if sieve[i] != 0 {
            PRIMES[PC] = i
            PC = PC + 1
        }
        i = i + 1
    }
    free(sieve)

    let mut a: i64 = 1
    while a <= 18 {
        A3[a] = a * a * a
        A6[a] = A3[a] * A3[a]
        let ps: ptr<i64> = calloc(8, 8)
        let es: ptr<i64> = calloc(8, 8)
        let n: i64 = factor_into(a, ps, es)
        FAC_AN[a] = n
        let mut k: i64 = 0
        while k < n {
            FAC_A_P[a * 8 + k] = ps[k]
            FAC_A_E[a * 8 + k] = es[k]
            k = k + 1
        }
        free(ps)
        free(es)
        a = a + 1
    }

    let mut total: i64 = 0
    a = 1
    while a <= 18 {
        let mut b: i64 = 1
        while b <= 1900 {
            total = total + compute_G(a, b)
            b = b + 1
        }
        a = a + 1
    }
    printf("%lld\n", total)
    free(FAC_AN)
    free(FAC_A_E)
    free(FAC_A_P)
    free(A6)
    free(A3)
    free(PRIMES)
    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 igcd_i64_i64(int64_t a0, int64_t b0);
int64_t modpow_i64_i64_i64(int64_t base0, int64_t exp0, int64_t mod);
int64_t modinv_i64_i64(int64_t a0, int64_t m);
int64_t tonelli_i64_i64(int64_t n0, int64_t p);
int64_t factor_into_i64_ptr_i64_ptr_i64(int64_t n0, int64_t* ps, int64_t* es);
int64_t init_sols_i64_i64_i64_ptr_i64(int64_t a, int64_t b, int64_t p, int64_t* sols);
int64_t linear_sols_i64_i64_i64_ptr_i64(int64_t A0, int64_t B0, int64_t p, int64_t* out);
int64_t lift_i64_i64_i64_i64_ptr_i64_ptr_i64(int64_t a, int64_t b, int64_t p, int64_t e_max, int64_t* sols_out, int64_t* e_out);
int64_t combine_ptr_i64_i64_i64_ptr_i64_i64_i64_ptr_i64_ptr_i64(int64_t* s1, int64_t n1, int64_t m1, int64_t* s2, int64_t n2, int64_t m2, int64_t* out, int64_t* mout);
int64_t compute_G_i64_i64(int64_t a, int64_t b);
int32_t main(void);

/* Module statics */
static int64_t* PRIMES = NULL;
static int64_t PC = 0;
static int64_t* A3 = NULL;
static int64_t* A6 = NULL;
static int64_t* FAC_A_P = NULL;
static int64_t* FAC_A_E = NULL;
static int64_t* FAC_AN = NULL;



int64_t igcd_i64_i64(int64_t a0, int64_t b0) {
    int64_t a = a0;
    int64_t b = b0;
    if (a < 0) {
        a = (0 - a);
    }
    if (b < 0) {
        b = (0 - b);
    }
    while (b != 0) {
        int64_t t = FLOW_CHECKED_MOD((a), (b));
        a = b;
        b = t;
    }
    return a;
}

int64_t modpow_i64_i64_i64(int64_t base0, int64_t exp0, int64_t mod) {
    int64_t r = 1;
    int64_t b = FLOW_CHECKED_MOD((base0), (mod));
    if (b < 0) {
        b = (b + mod);
    }
    int64_t e = exp0;
    while (e > 0) {
        if (FLOW_CHECKED_MOD((e), (2)) == 1) {
            r = ((int64_t)(FLOW_CHECKED_MOD(((((__int128)(r)) * ((__int128)(b)))), (((__int128)(mod))))));
        }
        b = ((int64_t)(FLOW_CHECKED_MOD(((((__int128)(b)) * ((__int128)(b)))), (((__int128)(mod))))));
        e = FLOW_CHECKED_DIV((e), (2));
    }
    return r;
}

int64_t modinv_i64_i64(int64_t a0, int64_t m) {
    int64_t old_r = FLOW_CHECKED_MOD((a0), (m));
    if (old_r < 0) {
        old_r = (old_r + m);
    }
    int64_t r = m;
    int64_t old_s = 1;
    int64_t s = 0;
    while (r != 0) {
        int64_t q = FLOW_CHECKED_DIV((old_r), (r));
        int64_t nr = (old_r - (q * r));
        old_r = r;
        r = nr;
        int64_t ns = (old_s - (q * s));
        old_s = s;
        s = ns;
    }
    int64_t x = FLOW_CHECKED_MOD((old_s), (m));
    if (x < 0) {
        x = (x + m);
    }
    return x;
}

int64_t tonelli_i64_i64(int64_t n0, int64_t p) {
    int64_t n = FLOW_CHECKED_MOD((n0), (p));
    if (n < 0) {
        n = (n + p);
    }
    if (n == 0) {
        return 0;
    }
    if (p == 2) {
        return n;
    }
    if (modpow_i64_i64_i64(n, FLOW_CHECKED_DIV(((p - 1)), (2)), p) != 1) {
        return (-1);
    }
    if (FLOW_CHECKED_MOD((p), (4)) == 3) {
        return modpow_i64_i64_i64(n, FLOW_CHECKED_DIV(((p + 1)), (4)), p);
    }
    int64_t q = (p - 1);
    int64_t s = 0;
    while (FLOW_CHECKED_MOD((q), (2)) == 0) {
        q = FLOW_CHECKED_DIV((q), (2));
        s = (s + 1);
    }
    int64_t z = 2;
    while (modpow_i64_i64_i64(z, FLOW_CHECKED_DIV(((p - 1)), (2)), p) != (p - 1)) {
        z = (z + 1);
    }
    int64_t m = s;
    int64_t c = modpow_i64_i64_i64(z, q, p);
    int64_t t = modpow_i64_i64_i64(n, q, p);
    int64_t r = modpow_i64_i64_i64(n, FLOW_CHECKED_DIV(((q + 1)), (2)), p);
    while (t != 1) {
        int64_t i = 1;
        int64_t t2i = FLOW_CHECKED_MOD(((t * t)), (p));
        while (i < m) {
            if (t2i == 1) {
                break;
            }
            t2i = FLOW_CHECKED_MOD(((t2i * t2i)), (p));
            i = (i + 1);
        }
        if (i == m) {
            return (-1);
        }
        int64_t exp = 1;
        int64_t k = 0;
        while (k < ((m - i) - 1)) {
            exp = (exp * 2);
            k = (k + 1);
        }
        int64_t b = modpow_i64_i64_i64(c, exp, p);
        r = FLOW_CHECKED_MOD(((r * b)), (p));
        c = FLOW_CHECKED_MOD(((b * b)), (p));
        t = FLOW_CHECKED_MOD(((t * c)), (p));
        m = i;
    }
    return r;
}

int64_t factor_into_i64_ptr_i64_ptr_i64(int64_t n0, int64_t* ps, int64_t* es) {
    int64_t n = n0;
    int64_t on = 0;
    int64_t i = 0;
    while (i < PC) {
        if ((PRIMES[i] * PRIMES[i]) > n) {
            break;
        }
        if (FLOW_CHECKED_MOD((n), (PRIMES[i])) == 0) {
            int64_t e = 0;
            while (FLOW_CHECKED_MOD((n), (PRIMES[i])) == 0) {
                n = FLOW_CHECKED_DIV((n), (PRIMES[i]));
                e = (e + 1);
            }
            ps[on] = PRIMES[i];
            es[on] = e;
            on = (on + 1);
        }
        i = (i + 1);
    }
    if (n > 1) {
        ps[on] = n;
        es[on] = 1;
        on = (on + 1);
    }
    return on;
}

int64_t init_sols_i64_i64_i64_ptr_i64(int64_t a, int64_t b, int64_t p, int64_t* sols) {
    int64_t bmod = FLOW_CHECKED_MOD((b), (p));
    int64_t ns = 0;
    if (FLOW_CHECKED_MOD((a), (p)) == 0) {
        int64_t n = 0;
        while (n < p) {
            if (FLOW_CHECKED_MOD(((modpow_i64_i64_i64(n, 3, p) + bmod)), (p)) == 0) {
                if (FLOW_CHECKED_MOD(((modpow_i64_i64_i64(FLOW_CHECKED_MOD(((n + a)), (p)), 3, p) + bmod)), (p)) == 0) {
                    sols[ns] = n;
                    ns = (ns + 1);
                }
            }
            n = (n + 1);
        }
        return ns;
    }
    if (p == 3) {
        return 0;
    }
    if (p == 2) {
        int64_t n2 = 0;
        while (n2 < 2) {
            int64_t c1 = FLOW_CHECKED_MOD(((((n2 * n2) * n2) + b)), (2));
            int64_t na = (n2 + a);
            int64_t c2 = FLOW_CHECKED_MOD(((((na * na) * na) + b)), (2));
            if (c1 == 0) {
                if (c2 == 0) {
                    sols[ns] = n2;
                    ns = (ns + 1);
                }
            }
            n2 = (n2 + 1);
        }
        return ns;
    }
    int64_t a_mod = FLOW_CHECKED_MOD((a), (p));
    int64_t disc = FLOW_CHECKED_MOD(((0 - ((3 * a_mod) * a_mod))), (p));
    if (disc < 0) {
        disc = (disc + p);
    }
    int64_t sqrt_disc = tonelli_i64_i64(disc, p);
    if (sqrt_disc < 0) {
        return 0;
    }
    int64_t inv6 = modinv_i64_i64(FLOW_CHECKED_MOD((6), (p)), p);
    int64_t tt = FLOW_CHECKED_MOD(((0 - (3 * a_mod))), (p));
    if (tt < 0) {
        tt = (tt + p);
    }
    int64_t n1 = FLOW_CHECKED_MOD(((FLOW_CHECKED_MOD(((tt + sqrt_disc)), (p)) * inv6)), (p));
    int64_t n2b = FLOW_CHECKED_MOD(((tt - sqrt_disc)), (p));
    if (n2b < 0) {
        n2b = (n2b + p);
    }
    n2b = FLOW_CHECKED_MOD(((n2b * inv6)), (p));
    int64_t ci = 0;
    while (ci < 2) {
        int64_t n = n1;
        if (ci == 1) {
            n = n2b;
        }
        int64_t ok = 1;
        int64_t j = 0;
        while (j < ns) {
            if (sols[j] == n) {
                ok = 0;
            }
            j = (j + 1);
        }
        if (ok != 0) {
            if (FLOW_CHECKED_MOD(((modpow_i64_i64_i64(n, 3, p) + bmod)), (p)) == 0) {
                if (FLOW_CHECKED_MOD(((modpow_i64_i64_i64(FLOW_CHECKED_MOD(((n + a)), (p)), 3, p) + bmod)), (p)) == 0) {
                    sols[ns] = n;
                    ns = (ns + 1);
                }
            }
        }
        ci = (ci + 1);
    }
    return ns;
}

int64_t linear_sols_i64_i64_i64_ptr_i64(int64_t A0, int64_t B0, int64_t p, int64_t* out) {
    int64_t A = FLOW_CHECKED_MOD((A0), (p));
    int64_t B = FLOW_CHECKED_MOD((B0), (p));
    if (A < 0) {
        A = (A + p);
    }
    if (B < 0) {
        B = (B + p);
    }
    if (A == 0) {
        if (B == 0) {
            int64_t i = 0;
            while (i < p) {
                out[i] = i;
                i = (i + 1);
            }
            return p;
        }
        return 0;
    }
    out[0] = FLOW_CHECKED_MOD(((B * modinv_i64_i64(A, p))), (p));
    return 1;
}

int64_t lift_i64_i64_i64_i64_ptr_i64_ptr_i64(int64_t a, int64_t b, int64_t p, int64_t e_max, int64_t* sols_out, int64_t* e_out) {
    int64_t* sols = (int64_t*)(calloc(512, 8));
    int64_t* new_sols = (int64_t*)(calloc(512, 8));
    int64_t* t1 = (int64_t*)(calloc(256, 8));
    int64_t* t2 = (int64_t*)(calloc(256, 8));
    int64_t* ts = (int64_t*)(calloc(256, 8));
    if ((sols == NULL || new_sols == NULL)) {
        return 0;
    }
    int64_t ns = init_sols_i64_i64_i64_ptr_i64(a, b, p, sols);
    if (ns == 0) {
        e_out[0] = 0;
        free(sols);
        free(new_sols);
        free(t1);
        free(t2);
        free(ts);
        return 0;
    }
    int64_t modv = p;
    int64_t e = 1;
    while (e < e_max) {
        int64_t mod2 = (modv * p);
        int64_t nn = 0;
        int64_t si = 0;
        while (si < ns) {
            int64_t r = sols[si];
            int64_t v1 = FLOW_CHECKED_MOD(((modpow_i64_i64_i64(FLOW_CHECKED_MOD((r), (mod2)), 3, mod2) + b)), (mod2));
            int64_t v2 = FLOW_CHECKED_MOD(((modpow_i64_i64_i64(FLOW_CHECKED_MOD(((r + a)), (mod2)), 3, mod2) + b)), (mod2));
            if (FLOW_CHECKED_MOD((v1), (modv)) == 0) {
                if (FLOW_CHECKED_MOD((v2), (modv)) == 0) {
                    int64_t c1 = FLOW_CHECKED_MOD((FLOW_CHECKED_DIV((v1), (modv))), (p));
                    int64_t c2 = FLOW_CHECKED_MOD((FLOW_CHECKED_DIV((v2), (modv))), (p));
                    int64_t r_mod_p = FLOW_CHECKED_MOD((r), (p));
                    int64_t s_mod_p = FLOW_CHECKED_MOD(((r + a)), (p));
                    int64_t A1 = FLOW_CHECKED_MOD((((3 * r_mod_p) * r_mod_p)), (p));
                    int64_t A2 = FLOW_CHECKED_MOD((((3 * s_mod_p) * s_mod_p)), (p));
                    int64_t B1 = FLOW_CHECKED_MOD(((0 - c1)), (p));
                    int64_t B2 = FLOW_CHECKED_MOD(((0 - c2)), (p));
                    if (B1 < 0) {
                    }
                    int64_t bb1 = FLOW_CHECKED_MOD(((0 - c1)), (p));
                    if (bb1 < 0) {
                        bb1 = (bb1 + p);
                    }
                    int64_t bb2 = FLOW_CHECKED_MOD(((0 - c2)), (p));
                    if (bb2 < 0) {
                        bb2 = (bb2 + p);
                    }
                    int64_t n1 = linear_sols_i64_i64_i64_ptr_i64(A1, bb1, p, t1);
                    if (n1 != 0) {
                        int64_t n2 = linear_sols_i64_i64_i64_ptr_i64(A2, bb2, p, t2);
                        if (n2 != 0) {
                            int64_t nt = 0;
                            if (n1 == p) {
                                if (n2 == p) {
                                    int64_t t = 0;
                                    while (t < p) {
                                        ts[nt] = t;
                                        nt = (nt + 1);
                                        t = (t + 1);
                                    }
                                } else {
                                    int64_t i2 = 0;
                                    while (i2 < n2) {
                                        ts[nt] = t2[i2];
                                        nt = (nt + 1);
                                        i2 = (i2 + 1);
                                    }
                                }
                            } else {
                                if (n2 == p) {
                                    int64_t i1 = 0;
                                    while (i1 < n1) {
                                        ts[nt] = t1[i1];
                                        nt = (nt + 1);
                                        i1 = (i1 + 1);
                                    }
                                } else {
                                    if (t1[0] == t2[0]) {
                                        ts[nt] = t1[0];
                                        nt = (nt + 1);
                                    }
                                }
                            }
                            int64_t ii = 0;
                            while (ii < nt) {
                                int64_t v = (r + (ts[ii] * modv));
                                int64_t ok = 1;
                                int64_t jj = 0;
                                while (jj < nn) {
                                    if (new_sols[jj] == v) {
                                        ok = 0;
                                    }
                                    jj = (jj + 1);
                                }
                                if (ok != 0) {
                                    new_sols[nn] = v;
                                    nn = (nn + 1);
                                }
                                ii = (ii + 1);
                            }
                        }
                    }
                }
            }
            si = (si + 1);
        }
        if (nn == 0) {
            break;
        }
        ns = nn;
        int64_t k = 0;
        while (k < ns) {
            sols[k] = new_sols[k];
            k = (k + 1);
        }
        modv = mod2;
        e = (e + 1);
    }
    e_out[0] = e;
    int64_t o = 0;
    while (o < ns) {
        sols_out[o] = sols[o];
        o = (o + 1);
    }
    free(sols);
    free(new_sols);
    free(t1);
    free(t2);
    free(ts);
    return ns;
}

int64_t combine_ptr_i64_i64_i64_ptr_i64_i64_i64_ptr_i64_ptr_i64(int64_t* s1, int64_t n1, int64_t m1, int64_t* s2, int64_t n2, int64_t m2, int64_t* out, int64_t* mout) {
    if (m1 == 1) {
        int64_t i = 0;
        while (i < n2) {
            out[i] = FLOW_CHECKED_MOD((s2[i]), (m2));
            i = (i + 1);
        }
        mout[0] = m2;
        return n2;
    }
    if (m2 == 1) {
        int64_t i2 = 0;
        while (i2 < n1) {
            out[i2] = FLOW_CHECKED_MOD((s1[i2]), (m1));
            i2 = (i2 + 1);
        }
        mout[0] = m1;
        return n1;
    }
    int64_t inv = modinv_i64_i64(FLOW_CHECKED_MOD((m1), (m2)), m2);
    int64_t nm = (m1 * m2);
    int64_t nn = 0;
    int64_t i = 0;
    while (i < n1) {
        int64_t x = FLOW_CHECKED_MOD((s1[i]), (m1));
        if (x < 0) {
            x = (x + m1);
        }
        int64_t j = 0;
        while (j < n2) {
            int64_t y = FLOW_CHECKED_MOD((s2[j]), (m2));
            if (y < 0) {
                y = (y + m2);
            }
            int64_t diff = FLOW_CHECKED_MOD(((y - x)), (m2));
            if (diff < 0) {
                diff = (diff + m2);
            }
            int64_t t = FLOW_CHECKED_MOD(((diff * inv)), (m2));
            int64_t v = (x + (m1 * t));
            int64_t ok = 1;
            int64_t k = 0;
            while (k < nn) {
                if (out[k] == v) {
                    ok = 0;
                }
                k = (k + 1);
            }
            if (ok != 0) {
                out[nn] = v;
                nn = (nn + 1);
            }
            j = (j + 1);
        }
        i = (i + 1);
    }
    mout[0] = nm;
    return nn;
}

int64_t compute_G_i64_i64(int64_t a, int64_t b) {
    int64_t R = (A6[a] + ((27 * b) * b));
    int64_t* fac_p = (int64_t*)(calloc(64, 8));
    int64_t* fac_e = (int64_t*)(calloc(64, 8));
    if ((fac_p == NULL || fac_e == NULL)) {
        return (-1);
    }
    int64_t nr = factor_into_i64_ptr_i64_ptr_i64(R, fac_p, fac_e);
    int64_t* mp = (int64_t*)(calloc(64, 8));
    int64_t* me = (int64_t*)(calloc(64, 8));
    if ((mp == NULL || me == NULL)) {
        return (-1);
    }
    int64_t nm = 0;
    int64_t i = 0;
    while (i < nr) {
        mp[nm] = fac_p[i];
        me[nm] = fac_e[i];
        nm = (nm + 1);
        i = (i + 1);
    }
    i = 0;
    while (i < FAC_AN[a]) {
        int64_t p = FAC_A_P[((a * 8) + i)];
        int64_t e = (3 * FAC_A_E[((a * 8) + i)]);
        int64_t f = (-1);
        int64_t j = 0;
        while (j < nm) {
            if (mp[j] == p) {
                f = j;
            }
            j = (j + 1);
        }
        if (f >= 0) {
            me[f] = (me[f] + e);
        } else {
            mp[nm] = p;
            me[nm] = e;
            nm = (nm + 1);
        }
        i = (i + 1);
    }
    i = 0;
    while (i < nm) {
        int64_t j = (i + 1);
        while (j < nm) {
            if (mp[j] < mp[i]) {
                int64_t tp = mp[i];
                mp[i] = mp[j];
                mp[j] = tp;
                int64_t te = me[i];
                me[i] = me[j];
                me[j] = te;
            }
            j = (j + 1);
        }
        i = (i + 1);
    }
    int64_t* sols = (int64_t*)(calloc(1024, 8));
    int64_t* out = (int64_t*)(calloc(1024, 8));
    int64_t* ps = (int64_t*)(calloc(512, 8));
    int64_t* ebox = (int64_t*)(calloc(1, 8));
    int64_t* mbox = (int64_t*)(calloc(1, 8));
    if (((sols == NULL || out == NULL) || ps == NULL)) {
        return (-1);
    }
    sols[0] = 0;
    int64_t ns = 1;
    int64_t modv = 1;
    int64_t any = 0;
    i = 0;
    while (i < nm) {
        int64_t nps = lift_i64_i64_i64_i64_ptr_i64_ptr_i64(a, b, mp[i], me[i], ps, ebox);
        int64_t e = ebox[0];
        if (e > 0) {
            any = 1;
            int64_t pe = 1;
            int64_t k = 0;
            while (k < e) {
                pe = (pe * mp[i]);
                k = (k + 1);
            }
            int64_t on = combine_ptr_i64_i64_i64_ptr_i64_i64_i64_ptr_i64_ptr_i64(sols, ns, modv, ps, nps, pe, out, mbox);
            ns = on;
            modv = mbox[0];
            k = 0;
            while (k < ns) {
                sols[k] = out[k];
                k = (k + 1);
            }
        }
        i = (i + 1);
    }
    int64_t ans = 0;
    if (any != 0) {
        ans = sols[0];
        i = 1;
        while (i < ns) {
            if (sols[i] < ans) {
                ans = sols[i];
            }
            i = (i + 1);
        }
    }
    free(mbox);
    free(ebox);
    free(ps);
    free(out);
    free(sols);
    free(me);
    free(mp);
    free(fac_e);
    free(fac_p);
    return ans;
}

int32_t main(void) {
    int64_t lim = 12000;
    int8_t* sieve = (int8_t*)(calloc((lim + 1), 1));
    PRIMES = calloc(lim, 8);
    A3 = calloc(20, 8);
    A6 = calloc(20, 8);
    FAC_A_P = calloc((20 * 8), 8);
    FAC_A_E = calloc((20 * 8), 8);
    FAC_AN = calloc(20, 8);
    if ((sieve == NULL || PRIMES == NULL)) {
        return 1;
    }
    int64_t i = 0;
    while (i <= lim) {
        sieve[i] = 1;
        i = (i + 1);
    }
    sieve[0] = 0;
    sieve[1] = 0;
    i = 2;
    while ((i * i) <= lim) {
        if (sieve[i] != 0) {
            int64_t j = (i * i);
            while (j <= lim) {
                sieve[j] = 0;
                j = (j + i);
            }
        }
        i = (i + 1);
    }
    PC = 0;
    i = 2;
    while (i <= lim) {
        if (sieve[i] != 0) {
            PRIMES[PC] = i;
            PC = (PC + 1);
        }
        i = (i + 1);
    }
    free(sieve);
    int64_t a = 1;
    while (a <= 18) {
        A3[a] = ((a * a) * a);
        A6[a] = (A3[a] * A3[a]);
        int64_t* ps = (int64_t*)(calloc(8, 8));
        int64_t* es = (int64_t*)(calloc(8, 8));
        int64_t n = factor_into_i64_ptr_i64_ptr_i64(a, ps, es);
        FAC_AN[a] = n;
        int64_t k = 0;
        while (k < n) {
            FAC_A_P[((a * 8) + k)] = ps[k];
            FAC_A_E[((a * 8) + k)] = es[k];
            k = (k + 1);
        }
        free(ps);
        free(es);
        a = (a + 1);
    }
    int64_t total = 0;
    a = 1;
    while (a <= 18) {
        int64_t b = 1;
        while (b <= 1900) {
            total = (total + compute_G_i64_i64(a, b));
            b = (b + 1);
        }
        a = (a + 1);
    }
    printf("%lld\n", total);
    free(FAC_AN);
    free(FAC_A_E);
    free(FAC_A_P);
    free(A6);
    free(A3);
    free(PRIMES);
    return 0;
}

Generated MLIR

module {
  llvm.func @printf(!llvm.ptr, ...) -> i32
  llvm.mlir.global internal constant @str_0("%lld\n\00") {addr_space = 0 : i32} : !llvm.array<6 x i8>
  func.func private @calloc(i64, i64) -> !llvm.ptr
  func.func private @free(!llvm.ptr) -> ()
  // Module static: PRIMES
  llvm.mlir.global internal @PRIMES() {addr_space = 0 : i32} : !llvm.ptr {
    %0 = llvm.mlir.zero : !llvm.ptr
    llvm.return %0 : !llvm.ptr
  }
  // Module static: PC
  llvm.mlir.global internal @PC(0 : i64) : i64
  // Module static: A3
  llvm.mlir.global internal @A3() {addr_space = 0 : i32} : !llvm.ptr {
    %1 = llvm.mlir.zero : !llvm.ptr
    llvm.return %1 : !llvm.ptr
  }
  // Module static: A6
  llvm.mlir.global internal @A6() {addr_space = 0 : i32} : !llvm.ptr {
    %2 = llvm.mlir.zero : !llvm.ptr
    llvm.return %2 : !llvm.ptr
  }
  // Module static: FAC_A_P
  llvm.mlir.global internal @FAC_A_P() {addr_space = 0 : i32} : !llvm.ptr {
    %3 = llvm.mlir.zero : !llvm.ptr
    llvm.return %3 : !llvm.ptr
  }
  // Module static: FAC_A_E
  llvm.mlir.global internal @FAC_A_E() {addr_space = 0 : i32} : !llvm.ptr {
    %4 = llvm.mlir.zero : !llvm.ptr
    llvm.return %4 : !llvm.ptr
  }
  // Module static: FAC_AN
  llvm.mlir.global internal @FAC_AN() {addr_space = 0 : i32} : !llvm.ptr {
    %5 = llvm.mlir.zero : !llvm.ptr
    llvm.return %5 : !llvm.ptr
  }
  func.func @igcd(%arg0: i64, %arg1: i64) -> i64 {
    %6 = llvm.mlir.constant(1 : i64) : i64
    %7 = llvm.alloca %6 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %7 : i64, !llvm.ptr
    %8 = llvm.mlir.constant(1 : i64) : i64
    %9 = llvm.alloca %8 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg1, %9 : i64, !llvm.ptr
    %10 = llvm.load %7 : !llvm.ptr -> i64
    %11 = arith.constant 0 : i32
    %13 = arith.extsi %11 : i32 to i64
    %12 = arith.cmpi slt, %10, %13 : i64
    cf.cond_br %12, ^bb0, ^bb1
    ^bb0:
      %14 = arith.constant 0 : i32
      %15 = llvm.load %7 : !llvm.ptr -> i64
      %17 = arith.extsi %14 : i32 to i64
      %16 = arith.subi %17, %15 : i64
      llvm.store %16, %7 : i64, !llvm.ptr
      cf.br ^bb2
    ^bb1:
      cf.br ^bb2
    ^bb2:
    %18 = llvm.load %9 : !llvm.ptr -> i64
    %19 = arith.constant 0 : i32
    %21 = arith.extsi %19 : i32 to i64
    %20 = arith.cmpi slt, %18, %21 : i64
    cf.cond_br %20, ^bb3, ^bb4
    ^bb3:
      %22 = arith.constant 0 : i32
      %23 = llvm.load %9 : !llvm.ptr -> i64
      %25 = arith.extsi %22 : i32 to i64
      %24 = arith.subi %25, %23 : i64
      llvm.store %24, %9 : i64, !llvm.ptr
      cf.br ^bb5
    ^bb4:
      cf.br ^bb5
    ^bb5:
    cf.br ^bb6
    ^bb6:
    %26 = llvm.load %9 : !llvm.ptr -> i64
    %27 = arith.constant 0 : i32
    %29 = arith.extsi %27 : i32 to i64
    %28 = arith.cmpi ne, %26, %29 : i64
    cf.cond_br %28, ^bb7, ^bb8
    ^bb7:
      %30 = llvm.load %7 : !llvm.ptr -> i64
      %31 = llvm.load %9 : !llvm.ptr -> i64
      %32 = arith.remsi %30, %31 : i64
      %33 = llvm.load %9 : !llvm.ptr -> i64
      llvm.store %33, %7 : i64, !llvm.ptr
      llvm.store %32, %9 : i64, !llvm.ptr
      cf.br ^bb6
    ^bb8:
    %34 = llvm.load %7 : !llvm.ptr -> i64
    func.return %34 : i64
  }
  func.func @modpow(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
    %35 = arith.constant 1 : i32
    %36 = arith.extsi %35 : i32 to i64
    %37 = llvm.mlir.constant(1 : i64) : i64
    %38 = llvm.alloca %37 x i64 : (i64) -> !llvm.ptr
    llvm.store %36, %38 : i64, !llvm.ptr
    %39 = arith.remsi %arg0, %arg2 : i64
    %40 = llvm.mlir.constant(1 : i64) : i64
    %41 = llvm.alloca %40 x i64 : (i64) -> !llvm.ptr
    llvm.store %39, %41 : i64, !llvm.ptr
    %42 = llvm.load %41 : !llvm.ptr -> i64
    %43 = arith.constant 0 : i32
    %45 = arith.extsi %43 : i32 to i64
    %44 = arith.cmpi slt, %42, %45 : i64
    cf.cond_br %44, ^bb9, ^bb10
    ^bb9:
      %46 = llvm.load %41 : !llvm.ptr -> i64
      %47 = arith.addi %46, %arg2 : i64
      llvm.store %47, %41 : i64, !llvm.ptr
      cf.br ^bb11
    ^bb10:
      cf.br ^bb11
    ^bb11:
    %48 = llvm.mlir.constant(1 : i64) : i64
    %49 = llvm.alloca %48 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg1, %49 : i64, !llvm.ptr
    cf.br ^bb12
    ^bb12:
    %50 = llvm.load %49 : !llvm.ptr -> i64
    %51 = arith.constant 0 : i32
    %53 = arith.extsi %51 : i32 to i64
    %52 = arith.cmpi sgt, %50, %53 : i64
    cf.cond_br %52, ^bb13, ^bb14
    ^bb13:
      %54 = llvm.load %49 : !llvm.ptr -> i64
      %55 = arith.constant 2 : i32
      %57 = arith.extsi %55 : i32 to i64
      %56 = arith.remsi %54, %57 : i64
      %58 = arith.constant 1 : i32
      %60 = arith.extsi %58 : i32 to i64
      %59 = arith.cmpi eq, %56, %60 : i64
      cf.cond_br %59, ^bb15, ^bb16
      ^bb15:
        %61 = llvm.load %38 : !llvm.ptr -> i64
        %62 = arith.extsi %61 : i64 to i128
        %63 = llvm.load %41 : !llvm.ptr -> i64
        %64 = arith.extsi %63 : i64 to i128
        %66 = arith.trunci %62 : i128 to i64
        %67 = arith.trunci %64 : i128 to i64
        %65 = arith.muli %66, %67 : i64
        %68 = arith.extsi %arg2 : i64 to i128
        %70 = arith.trunci %68 : i128 to i64
        %69 = arith.remsi %65, %70 : i64
        llvm.store %69, %38 : i64, !llvm.ptr
        cf.br ^bb17
      ^bb16:
        cf.br ^bb17
      ^bb17:
      %71 = llvm.load %41 : !llvm.ptr -> i64
      %72 = arith.extsi %71 : i64 to i128
      %73 = llvm.load %41 : !llvm.ptr -> i64
      %74 = arith.extsi %73 : i64 to i128
      %76 = arith.trunci %72 : i128 to i64
      %77 = arith.trunci %74 : i128 to i64
      %75 = arith.muli %76, %77 : i64
      %78 = arith.extsi %arg2 : i64 to i128
      %80 = arith.trunci %78 : i128 to i64
      %79 = arith.remsi %75, %80 : i64
      llvm.store %79, %41 : i64, !llvm.ptr
      %81 = llvm.load %49 : !llvm.ptr -> i64
      %82 = arith.constant 2 : i32
      %84 = arith.extsi %82 : i32 to i64
      %83 = arith.divsi %81, %84 : i64
      llvm.store %83, %49 : i64, !llvm.ptr
      cf.br ^bb12
    ^bb14:
    %85 = llvm.load %38 : !llvm.ptr -> i64
    func.return %85 : i64
  }
  func.func @modinv(%arg0: i64, %arg1: i64) -> i64 {
    %86 = arith.remsi %arg0, %arg1 : i64
    %87 = llvm.mlir.constant(1 : i64) : i64
    %88 = llvm.alloca %87 x i64 : (i64) -> !llvm.ptr
    llvm.store %86, %88 : i64, !llvm.ptr
    %89 = llvm.load %88 : !llvm.ptr -> i64
    %90 = arith.constant 0 : i32
    %92 = arith.extsi %90 : i32 to i64
    %91 = arith.cmpi slt, %89, %92 : i64
    cf.cond_br %91, ^bb18, ^bb19
    ^bb18:
      %93 = llvm.load %88 : !llvm.ptr -> i64
      %94 = arith.addi %93, %arg1 : i64
      llvm.store %94, %88 : i64, !llvm.ptr
      cf.br ^bb20
    ^bb19:
      cf.br ^bb20
    ^bb20:
    %95 = llvm.mlir.constant(1 : i64) : i64
    %96 = llvm.alloca %95 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg1, %96 : i64, !llvm.ptr
    %97 = arith.constant 1 : i32
    %98 = arith.extsi %97 : i32 to i64
    %99 = llvm.mlir.constant(1 : i64) : i64
    %100 = llvm.alloca %99 x i64 : (i64) -> !llvm.ptr
    llvm.store %98, %100 : i64, !llvm.ptr
    %101 = arith.constant 0 : i32
    %102 = arith.extsi %101 : i32 to i64
    %103 = llvm.mlir.constant(1 : i64) : i64
    %104 = llvm.alloca %103 x i64 : (i64) -> !llvm.ptr
    llvm.store %102, %104 : i64, !llvm.ptr
    cf.br ^bb21
    ^bb21:
    %105 = llvm.load %96 : !llvm.ptr -> i64
    %106 = arith.constant 0 : i32
    %108 = arith.extsi %106 : i32 to i64
    %107 = arith.cmpi ne, %105, %108 : i64
    cf.cond_br %107, ^bb22, ^bb23
    ^bb22:
      %109 = llvm.load %88 : !llvm.ptr -> i64
      %110 = llvm.load %96 : !llvm.ptr -> i64
      %111 = arith.divsi %109, %110 : i64
      %112 = llvm.load %88 : !llvm.ptr -> i64
      %113 = llvm.load %96 : !llvm.ptr -> i64
      %114 = arith.muli %111, %113 : i64
      %115 = arith.subi %112, %114 : i64
      %116 = llvm.load %96 : !llvm.ptr -> i64
      llvm.store %116, %88 : i64, !llvm.ptr
      llvm.store %115, %96 : i64, !llvm.ptr
      %117 = llvm.load %100 : !llvm.ptr -> i64
      %118 = llvm.load %104 : !llvm.ptr -> i64
      %119 = arith.muli %111, %118 : i64
      %120 = arith.subi %117, %119 : i64
      %121 = llvm.load %104 : !llvm.ptr -> i64
      llvm.store %121, %100 : i64, !llvm.ptr
      llvm.store %120, %104 : i64, !llvm.ptr
      cf.br ^bb21
    ^bb23:
    %122 = llvm.load %100 : !llvm.ptr -> i64
    %123 = arith.remsi %122, %arg1 : i64
    %124 = llvm.mlir.constant(1 : i64) : i64
    %125 = llvm.alloca %124 x i64 : (i64) -> !llvm.ptr
    llvm.store %123, %125 : i64, !llvm.ptr
    %126 = llvm.load %125 : !llvm.ptr -> i64
    %127 = arith.constant 0 : i32
    %129 = arith.extsi %127 : i32 to i64
    %128 = arith.cmpi slt, %126, %129 : i64
    cf.cond_br %128, ^bb24, ^bb25
    ^bb24:
      %130 = llvm.load %125 : !llvm.ptr -> i64
      %131 = arith.addi %130, %arg1 : i64
      llvm.store %131, %125 : i64, !llvm.ptr
      cf.br ^bb26
    ^bb25:
      cf.br ^bb26
    ^bb26:
    %132 = llvm.load %125 : !llvm.ptr -> i64
    func.return %132 : i64
  }
  func.func @tonelli(%arg0: i64, %arg1: i64) -> i64 {
    %133 = arith.remsi %arg0, %arg1 : i64
    %134 = llvm.mlir.constant(1 : i64) : i64
    %135 = llvm.alloca %134 x i64 : (i64) -> !llvm.ptr
    llvm.store %133, %135 : i64, !llvm.ptr
    %136 = llvm.load %135 : !llvm.ptr -> i64
    %137 = arith.constant 0 : i32
    %139 = arith.extsi %137 : i32 to i64
    %138 = arith.cmpi slt, %136, %139 : i64
    cf.cond_br %138, ^bb27, ^bb28
    ^bb27:
      %140 = llvm.load %135 : !llvm.ptr -> i64
      %141 = arith.addi %140, %arg1 : i64
      llvm.store %141, %135 : i64, !llvm.ptr
      cf.br ^bb29
    ^bb28:
      cf.br ^bb29
    ^bb29:
    %142 = llvm.load %135 : !llvm.ptr -> i64
    %143 = arith.constant 0 : i32
    %145 = arith.extsi %143 : i32 to i64
    %144 = arith.cmpi eq, %142, %145 : i64
    cf.cond_br %144, ^bb30, ^bb31
    ^bb30:
      %146 = arith.constant 0 : i32
      %147 = arith.extsi %146 : i32 to i64
      func.return %147 : i64
    ^bb31:
      cf.br ^bb32
    ^bb32:
    %148 = arith.constant 2 : i32
    %150 = arith.extsi %148 : i32 to i64
    %149 = arith.cmpi eq, %arg1, %150 : i64
    cf.cond_br %149, ^bb33, ^bb34
    ^bb33:
      %151 = llvm.load %135 : !llvm.ptr -> i64
      func.return %151 : i64
    ^bb34:
      cf.br ^bb35
    ^bb35:
    %153 = llvm.load %135 : !llvm.ptr -> i64
    %154 = arith.constant 1 : i32
    %156 = arith.extsi %154 : i32 to i64
    %155 = arith.subi %arg1, %156 : i64
    %157 = arith.constant 2 : i32
    %159 = arith.extsi %157 : i32 to i64
    %158 = arith.divsi %155, %159 : i64
    %152 = func.call @modpow(%153, %158, %arg1) : (i64, i64, i64) -> i64
    %160 = arith.constant 1 : i32
    %162 = arith.extsi %160 : i32 to i64
    %161 = arith.cmpi ne, %152, %162 : i64
    cf.cond_br %161, ^bb36, ^bb37
    ^bb36:
      %163 = arith.constant 1 : i32
      %165 = arith.constant 0 : i32
      %164 = arith.subi %165, %163 : i32
      %166 = arith.extsi %164 : i32 to i64
      func.return %166 : i64
    ^bb37:
      cf.br ^bb38
    ^bb38:
    %167 = arith.constant 4 : i32
    %169 = arith.extsi %167 : i32 to i64
    %168 = arith.remsi %arg1, %169 : i64
    %170 = arith.constant 3 : i32
    %172 = arith.extsi %170 : i32 to i64
    %171 = arith.cmpi eq, %168, %172 : i64
    cf.cond_br %171, ^bb39, ^bb40
    ^bb39:
      %174 = llvm.load %135 : !llvm.ptr -> i64
      %175 = arith.constant 1 : i32
      %177 = arith.extsi %175 : i32 to i64
      %176 = arith.addi %arg1, %177 : i64
      %178 = arith.constant 4 : i32
      %180 = arith.extsi %178 : i32 to i64
      %179 = arith.divsi %176, %180 : i64
      %173 = func.call @modpow(%174, %179, %arg1) : (i64, i64, i64) -> i64
      func.return %173 : i64
    ^bb40:
      cf.br ^bb41
    ^bb41:
    %181 = arith.constant 1 : i32
    %183 = arith.extsi %181 : i32 to i64
    %182 = arith.subi %arg1, %183 : i64
    %184 = llvm.mlir.constant(1 : i64) : i64
    %185 = llvm.alloca %184 x i64 : (i64) -> !llvm.ptr
    llvm.store %182, %185 : i64, !llvm.ptr
    %186 = arith.constant 0 : i32
    %187 = arith.extsi %186 : i32 to i64
    %188 = llvm.mlir.constant(1 : i64) : i64
    %189 = llvm.alloca %188 x i64 : (i64) -> !llvm.ptr
    llvm.store %187, %189 : i64, !llvm.ptr
    cf.br ^bb42
    ^bb42:
    %190 = llvm.load %185 : !llvm.ptr -> i64
    %191 = arith.constant 2 : i32
    %193 = arith.extsi %191 : i32 to i64
    %192 = arith.remsi %190, %193 : i64
    %194 = arith.constant 0 : i32
    %196 = arith.extsi %194 : i32 to i64
    %195 = arith.cmpi eq, %192, %196 : i64
    cf.cond_br %195, ^bb43, ^bb44
    ^bb43:
      %197 = llvm.load %185 : !llvm.ptr -> i64
      %198 = arith.constant 2 : i32
      %200 = arith.extsi %198 : i32 to i64
      %199 = arith.divsi %197, %200 : i64
      llvm.store %199, %185 : i64, !llvm.ptr
      %201 = llvm.load %189 : !llvm.ptr -> i64
      %202 = arith.constant 1 : i32
      %204 = arith.extsi %202 : i32 to i64
      %203 = arith.addi %201, %204 : i64
      llvm.store %203, %189 : i64, !llvm.ptr
      cf.br ^bb42
    ^bb44:
    %205 = arith.constant 2 : i32
    %206 = arith.extsi %205 : i32 to i64
    %207 = llvm.mlir.constant(1 : i64) : i64
    %208 = llvm.alloca %207 x i64 : (i64) -> !llvm.ptr
    llvm.store %206, %208 : i64, !llvm.ptr
    cf.br ^bb45
    ^bb45:
    %210 = llvm.load %208 : !llvm.ptr -> i64
    %211 = arith.constant 1 : i32
    %213 = arith.extsi %211 : i32 to i64
    %212 = arith.subi %arg1, %213 : i64
    %214 = arith.constant 2 : i32
    %216 = arith.extsi %214 : i32 to i64
    %215 = arith.divsi %212, %216 : i64
    %209 = func.call @modpow(%210, %215, %arg1) : (i64, i64, i64) -> i64
    %217 = arith.constant 1 : i32
    %219 = arith.extsi %217 : i32 to i64
    %218 = arith.subi %arg1, %219 : i64
    %220 = arith.cmpi ne, %209, %218 : i64
    cf.cond_br %220, ^bb46, ^bb47
    ^bb46:
      %221 = llvm.load %208 : !llvm.ptr -> i64
      %222 = arith.constant 1 : i32
      %224 = arith.extsi %222 : i32 to i64
      %223 = arith.addi %221, %224 : i64
      llvm.store %223, %208 : i64, !llvm.ptr
      cf.br ^bb45
    ^bb47:
    %225 = llvm.load %189 : !llvm.ptr -> i64
    %226 = llvm.mlir.constant(1 : i64) : i64
    %227 = llvm.alloca %226 x i64 : (i64) -> !llvm.ptr
    llvm.store %225, %227 : i64, !llvm.ptr
    %229 = llvm.load %208 : !llvm.ptr -> i64
    %230 = llvm.load %185 : !llvm.ptr -> i64
    %228 = func.call @modpow(%229, %230, %arg1) : (i64, i64, i64) -> i64
    %231 = llvm.mlir.constant(1 : i64) : i64
    %232 = llvm.alloca %231 x i64 : (i64) -> !llvm.ptr
    llvm.store %228, %232 : i64, !llvm.ptr
    %234 = llvm.load %135 : !llvm.ptr -> i64
    %235 = llvm.load %185 : !llvm.ptr -> i64
    %233 = func.call @modpow(%234, %235, %arg1) : (i64, i64, i64) -> i64
    %236 = llvm.mlir.constant(1 : i64) : i64
    %237 = llvm.alloca %236 x i64 : (i64) -> !llvm.ptr
    llvm.store %233, %237 : i64, !llvm.ptr
    %239 = llvm.load %135 : !llvm.ptr -> i64
    %240 = llvm.load %185 : !llvm.ptr -> i64
    %241 = arith.constant 1 : i32
    %243 = arith.extsi %241 : i32 to i64
    %242 = arith.addi %240, %243 : i64
    %244 = arith.constant 2 : i32
    %246 = arith.extsi %244 : i32 to i64
    %245 = arith.divsi %242, %246 : i64
    %238 = func.call @modpow(%239, %245, %arg1) : (i64, i64, i64) -> i64
    %247 = llvm.mlir.constant(1 : i64) : i64
    %248 = llvm.alloca %247 x i64 : (i64) -> !llvm.ptr
    llvm.store %238, %248 : i64, !llvm.ptr
    cf.br ^bb48
    ^bb48:
    %249 = llvm.load %237 : !llvm.ptr -> i64
    %250 = arith.constant 1 : i32
    %252 = arith.extsi %250 : i32 to i64
    %251 = arith.cmpi ne, %249, %252 : i64
    cf.cond_br %251, ^bb49, ^bb50
    ^bb49:
      %253 = arith.constant 1 : i32
      %254 = arith.extsi %253 : i32 to i64
      %255 = llvm.mlir.constant(1 : i64) : i64
      %256 = llvm.alloca %255 x i64 : (i64) -> !llvm.ptr
      llvm.store %254, %256 : i64, !llvm.ptr
      %257 = llvm.load %237 : !llvm.ptr -> i64
      %258 = llvm.load %237 : !llvm.ptr -> i64
      %259 = arith.muli %257, %258 : i64
      %260 = arith.remsi %259, %arg1 : i64
      %261 = llvm.mlir.constant(1 : i64) : i64
      %262 = llvm.alloca %261 x i64 : (i64) -> !llvm.ptr
      llvm.store %260, %262 : i64, !llvm.ptr
      cf.br ^bb51
      ^bb51:
      %263 = llvm.load %256 : !llvm.ptr -> i64
      %264 = llvm.load %227 : !llvm.ptr -> i64
      %265 = arith.cmpi slt, %263, %264 : i64
      cf.cond_br %265, ^bb52, ^bb53
      ^bb52:
        %266 = llvm.load %262 : !llvm.ptr -> i64
        %267 = arith.constant 1 : i32
        %269 = arith.extsi %267 : i32 to i64
        %268 = arith.cmpi eq, %266, %269 : i64
        cf.cond_br %268, ^bb54, ^bb55
        ^bb54:
          cf.br ^bb53
        ^bb55:
          cf.br ^bb56
        ^bb56:
        %270 = llvm.load %262 : !llvm.ptr -> i64
        %271 = llvm.load %262 : !llvm.ptr -> i64
        %272 = arith.muli %270, %271 : i64
        %273 = arith.remsi %272, %arg1 : i64
        llvm.store %273, %262 : i64, !llvm.ptr
        %274 = llvm.load %256 : !llvm.ptr -> i64
        %275 = arith.constant 1 : i32
        %277 = arith.extsi %275 : i32 to i64
        %276 = arith.addi %274, %277 : i64
        llvm.store %276, %256 : i64, !llvm.ptr
        cf.br ^bb51
      ^bb53:
      %278 = llvm.load %256 : !llvm.ptr -> i64
      %279 = llvm.load %227 : !llvm.ptr -> i64
      %280 = arith.cmpi eq, %278, %279 : i64
      cf.cond_br %280, ^bb57, ^bb58
      ^bb57:
        %281 = arith.constant 1 : i32
        %283 = arith.constant 0 : i32
        %282 = arith.subi %283, %281 : i32
        %284 = arith.extsi %282 : i32 to i64
        func.return %284 : i64
      ^bb58:
        cf.br ^bb59
      ^bb59:
      %285 = arith.constant 1 : i32
      %286 = arith.extsi %285 : i32 to i64
      %287 = llvm.mlir.constant(1 : i64) : i64
      %288 = llvm.alloca %287 x i64 : (i64) -> !llvm.ptr
      llvm.store %286, %288 : i64, !llvm.ptr
      %289 = arith.constant 0 : i32
      %290 = arith.extsi %289 : i32 to i64
      %291 = llvm.mlir.constant(1 : i64) : i64
      %292 = llvm.alloca %291 x i64 : (i64) -> !llvm.ptr
      llvm.store %290, %292 : i64, !llvm.ptr
      cf.br ^bb60
      ^bb60:
      %293 = llvm.load %292 : !llvm.ptr -> i64
      %294 = llvm.load %227 : !llvm.ptr -> i64
      %295 = llvm.load %256 : !llvm.ptr -> i64
      %296 = arith.subi %294, %295 : i64
      %297 = arith.constant 1 : i32
      %299 = arith.extsi %297 : i32 to i64
      %298 = arith.subi %296, %299 : i64
      %300 = arith.cmpi slt, %293, %298 : i64
      cf.cond_br %300, ^bb61, ^bb62
      ^bb61:
        %301 = llvm.load %288 : !llvm.ptr -> i64
        %302 = arith.constant 2 : i32
        %304 = arith.extsi %302 : i32 to i64
        %303 = arith.muli %301, %304 : i64
        llvm.store %303, %288 : i64, !llvm.ptr
        %305 = llvm.load %292 : !llvm.ptr -> i64
        %306 = arith.constant 1 : i32
        %308 = arith.extsi %306 : i32 to i64
        %307 = arith.addi %305, %308 : i64
        llvm.store %307, %292 : i64, !llvm.ptr
        cf.br ^bb60
      ^bb62:
      %310 = llvm.load %232 : !llvm.ptr -> i64
      %311 = llvm.load %288 : !llvm.ptr -> i64
      %309 = func.call @modpow(%310, %311, %arg1) : (i64, i64, i64) -> i64
      %312 = llvm.load %248 : !llvm.ptr -> i64
      %313 = arith.muli %312, %309 : i64
      %314 = arith.remsi %313, %arg1 : i64
      llvm.store %314, %248 : i64, !llvm.ptr
      %315 = arith.muli %309, %309 : i64
      %316 = arith.remsi %315, %arg1 : i64
      llvm.store %316, %232 : i64, !llvm.ptr
      %317 = llvm.load %237 : !llvm.ptr -> i64
      %318 = llvm.load %232 : !llvm.ptr -> i64
      %319 = arith.muli %317, %318 : i64
      %320 = arith.remsi %319, %arg1 : i64
      llvm.store %320, %237 : i64, !llvm.ptr
      %321 = llvm.load %256 : !llvm.ptr -> i64
      llvm.store %321, %227 : i64, !llvm.ptr
      cf.br ^bb48
    ^bb50:
    %322 = llvm.load %248 : !llvm.ptr -> i64
    func.return %322 : i64
  }
  func.func @factor_into(%arg0: i64, %arg1: !llvm.ptr, %arg2: !llvm.ptr) -> i64 {
    %323 = llvm.mlir.constant(1 : i64) : i64
    %324 = llvm.alloca %323 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %324 : i64, !llvm.ptr
    %325 = arith.constant 0 : i32
    %326 = arith.extsi %325 : i32 to i64
    %327 = llvm.mlir.constant(1 : i64) : i64
    %328 = llvm.alloca %327 x i64 : (i64) -> !llvm.ptr
    llvm.store %326, %328 : i64, !llvm.ptr
    %329 = arith.constant 0 : i32
    %330 = arith.extsi %329 : i32 to i64
    %331 = llvm.mlir.constant(1 : i64) : i64
    %332 = llvm.alloca %331 x i64 : (i64) -> !llvm.ptr
    llvm.store %330, %332 : i64, !llvm.ptr
    cf.br ^bb63
    ^bb63:
    %333 = llvm.load %332 : !llvm.ptr -> i64
    %334 = llvm.mlir.addressof @PC : !llvm.ptr
    %335 = llvm.load %334 : !llvm.ptr -> i64
    %336 = arith.cmpi slt, %333, %335 : i64
    cf.cond_br %336, ^bb64, ^bb65
    ^bb64:
      %338 = llvm.mlir.addressof @PRIMES : !llvm.ptr
      %339 = llvm.load %338 : !llvm.ptr -> !llvm.ptr
      %340 = llvm.load %332 : !llvm.ptr -> i64
      %341 = llvm.getelementptr %339[%340] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %337 = llvm.load %341 : !llvm.ptr -> i64
      %343 = llvm.mlir.addressof @PRIMES : !llvm.ptr
      %344 = llvm.load %343 : !llvm.ptr -> !llvm.ptr
      %345 = llvm.load %332 : !llvm.ptr -> i64
      %346 = llvm.getelementptr %344[%345] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %342 = llvm.load %346 : !llvm.ptr -> i64
      %347 = arith.muli %337, %342 : i64
      %348 = llvm.load %324 : !llvm.ptr -> i64
      %349 = arith.cmpi sgt, %347, %348 : i64
      cf.cond_br %349, ^bb66, ^bb67
      ^bb66:
        cf.br ^bb65
      ^bb67:
        cf.br ^bb68
      ^bb68:
      %350 = llvm.load %324 : !llvm.ptr -> i64
      %352 = llvm.mlir.addressof @PRIMES : !llvm.ptr
      %353 = llvm.load %352 : !llvm.ptr -> !llvm.ptr
      %354 = llvm.load %332 : !llvm.ptr -> i64
      %355 = llvm.getelementptr %353[%354] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %351 = llvm.load %355 : !llvm.ptr -> i64
      %356 = arith.remsi %350, %351 : i64
      %357 = arith.constant 0 : i32
      %359 = arith.extsi %357 : i32 to i64
      %358 = arith.cmpi eq, %356, %359 : i64
      cf.cond_br %358, ^bb69, ^bb70
      ^bb69:
        %360 = arith.constant 0 : i32
        %361 = arith.extsi %360 : i32 to i64
        %362 = llvm.mlir.constant(1 : i64) : i64
        %363 = llvm.alloca %362 x i64 : (i64) -> !llvm.ptr
        llvm.store %361, %363 : i64, !llvm.ptr
        cf.br ^bb72
        ^bb72:
        %364 = llvm.load %324 : !llvm.ptr -> i64
        %366 = llvm.mlir.addressof @PRIMES : !llvm.ptr
        %367 = llvm.load %366 : !llvm.ptr -> !llvm.ptr
        %368 = llvm.load %332 : !llvm.ptr -> i64
        %369 = llvm.getelementptr %367[%368] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %365 = llvm.load %369 : !llvm.ptr -> i64
        %370 = arith.remsi %364, %365 : i64
        %371 = arith.constant 0 : i32
        %373 = arith.extsi %371 : i32 to i64
        %372 = arith.cmpi eq, %370, %373 : i64
        cf.cond_br %372, ^bb73, ^bb74
        ^bb73:
          %374 = llvm.load %324 : !llvm.ptr -> i64
          %376 = llvm.mlir.addressof @PRIMES : !llvm.ptr
          %377 = llvm.load %376 : !llvm.ptr -> !llvm.ptr
          %378 = llvm.load %332 : !llvm.ptr -> i64
          %379 = llvm.getelementptr %377[%378] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %375 = llvm.load %379 : !llvm.ptr -> i64
          %380 = arith.divsi %374, %375 : i64
          llvm.store %380, %324 : i64, !llvm.ptr
          %381 = llvm.load %363 : !llvm.ptr -> i64
          %382 = arith.constant 1 : i32
          %384 = arith.extsi %382 : i32 to i64
          %383 = arith.addi %381, %384 : i64
          llvm.store %383, %363 : i64, !llvm.ptr
          cf.br ^bb72
        ^bb74:
        %386 = llvm.mlir.addressof @PRIMES : !llvm.ptr
        %387 = llvm.load %386 : !llvm.ptr -> !llvm.ptr
        %388 = llvm.load %332 : !llvm.ptr -> i64
        %389 = llvm.getelementptr %387[%388] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %385 = llvm.load %389 : !llvm.ptr -> i64
        %390 = llvm.load %328 : !llvm.ptr -> i64
        %391 = llvm.getelementptr %arg1[%390] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %385, %391 : i64, !llvm.ptr
        %392 = llvm.load %363 : !llvm.ptr -> i64
        %393 = llvm.load %328 : !llvm.ptr -> i64
        %394 = llvm.getelementptr %arg2[%393] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %392, %394 : i64, !llvm.ptr
        %395 = llvm.load %328 : !llvm.ptr -> i64
        %396 = arith.constant 1 : i32
        %398 = arith.extsi %396 : i32 to i64
        %397 = arith.addi %395, %398 : i64
        llvm.store %397, %328 : i64, !llvm.ptr
        cf.br ^bb71
      ^bb70:
        cf.br ^bb71
      ^bb71:
      %399 = llvm.load %332 : !llvm.ptr -> i64
      %400 = arith.constant 1 : i32
      %402 = arith.extsi %400 : i32 to i64
      %401 = arith.addi %399, %402 : i64
      llvm.store %401, %332 : i64, !llvm.ptr
      cf.br ^bb63
    ^bb65:
    %403 = llvm.load %324 : !llvm.ptr -> i64
    %404 = arith.constant 1 : i32
    %406 = arith.extsi %404 : i32 to i64
    %405 = arith.cmpi sgt, %403, %406 : i64
    cf.cond_br %405, ^bb75, ^bb76
    ^bb75:
      %407 = llvm.load %324 : !llvm.ptr -> i64
      %408 = llvm.load %328 : !llvm.ptr -> i64
      %409 = llvm.getelementptr %arg1[%408] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %407, %409 : i64, !llvm.ptr
      %410 = arith.constant 1 : i32
      %411 = llvm.load %328 : !llvm.ptr -> i64
      %412 = arith.extsi %410 : i32 to i64
      %413 = llvm.getelementptr %arg2[%411] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %412, %413 : i64, !llvm.ptr
      %414 = llvm.load %328 : !llvm.ptr -> i64
      %415 = arith.constant 1 : i32
      %417 = arith.extsi %415 : i32 to i64
      %416 = arith.addi %414, %417 : i64
      llvm.store %416, %328 : i64, !llvm.ptr
      cf.br ^bb77
    ^bb76:
      cf.br ^bb77
    ^bb77:
    %418 = llvm.load %328 : !llvm.ptr -> i64
    func.return %418 : i64
  }
  func.func @init_sols(%arg0: i64, %arg1: i64, %arg2: i64, %arg3: !llvm.ptr) -> i64 {
    %419 = arith.remsi %arg1, %arg2 : i64
    %420 = arith.constant 0 : i32
    %421 = arith.extsi %420 : i32 to i64
    %422 = llvm.mlir.constant(1 : i64) : i64
    %423 = llvm.alloca %422 x i64 : (i64) -> !llvm.ptr
    llvm.store %421, %423 : i64, !llvm.ptr
    %424 = arith.remsi %arg0, %arg2 : i64
    %425 = arith.constant 0 : i32
    %427 = arith.extsi %425 : i32 to i64
    %426 = arith.cmpi eq, %424, %427 : i64
    cf.cond_br %426, ^bb78, ^bb79
    ^bb78:
      %428 = arith.constant 0 : i32
      %429 = arith.extsi %428 : i32 to i64
      %430 = llvm.mlir.constant(1 : i64) : i64
      %431 = llvm.alloca %430 x i64 : (i64) -> !llvm.ptr
      llvm.store %429, %431 : i64, !llvm.ptr
      cf.br ^bb81
      ^bb81:
      %432 = llvm.load %431 : !llvm.ptr -> i64
      %433 = arith.cmpi slt, %432, %arg2 : i64
      cf.cond_br %433, ^bb82, ^bb83
      ^bb82:
        %435 = llvm.load %431 : !llvm.ptr -> i64
        %436 = arith.constant 3 : i32
        %437 = arith.extsi %436 : i32 to i64
        %434 = func.call @modpow(%435, %437, %arg2) : (i64, i64, i64) -> i64
        %438 = arith.addi %434, %419 : i64
        %439 = arith.remsi %438, %arg2 : i64
        %440 = arith.constant 0 : i32
        %442 = arith.extsi %440 : i32 to i64
        %441 = arith.cmpi eq, %439, %442 : i64
        cf.cond_br %441, ^bb84, ^bb85
        ^bb84:
          %444 = llvm.load %431 : !llvm.ptr -> i64
          %445 = arith.addi %444, %arg0 : i64
          %446 = arith.remsi %445, %arg2 : i64
          %447 = arith.constant 3 : i32
          %448 = arith.extsi %447 : i32 to i64
          %443 = func.call @modpow(%446, %448, %arg2) : (i64, i64, i64) -> i64
          %449 = arith.addi %443, %419 : i64
          %450 = arith.remsi %449, %arg2 : i64
          %451 = arith.constant 0 : i32
          %453 = arith.extsi %451 : i32 to i64
          %452 = arith.cmpi eq, %450, %453 : i64
          cf.cond_br %452, ^bb87, ^bb88
          ^bb87:
            %454 = llvm.load %431 : !llvm.ptr -> i64
            %455 = llvm.load %423 : !llvm.ptr -> i64
            %456 = llvm.getelementptr %arg3[%455] : (!llvm.ptr, i64) -> !llvm.ptr, i64
            llvm.store %454, %456 : i64, !llvm.ptr
            %457 = llvm.load %423 : !llvm.ptr -> i64
            %458 = arith.constant 1 : i32
            %460 = arith.extsi %458 : i32 to i64
            %459 = arith.addi %457, %460 : i64
            llvm.store %459, %423 : i64, !llvm.ptr
            cf.br ^bb89
          ^bb88:
            cf.br ^bb89
          ^bb89:
          cf.br ^bb86
        ^bb85:
          cf.br ^bb86
        ^bb86:
        %461 = llvm.load %431 : !llvm.ptr -> i64
        %462 = arith.constant 1 : i32
        %464 = arith.extsi %462 : i32 to i64
        %463 = arith.addi %461, %464 : i64
        llvm.store %463, %431 : i64, !llvm.ptr
        cf.br ^bb81
      ^bb83:
      %465 = llvm.load %423 : !llvm.ptr -> i64
      func.return %465 : i64
    ^bb79:
      cf.br ^bb80
    ^bb80:
    %466 = arith.constant 3 : i32
    %468 = arith.extsi %466 : i32 to i64
    %467 = arith.cmpi eq, %arg2, %468 : i64
    cf.cond_br %467, ^bb90, ^bb91
    ^bb90:
      %469 = arith.constant 0 : i32
      %470 = arith.extsi %469 : i32 to i64
      func.return %470 : i64
    ^bb91:
      cf.br ^bb92
    ^bb92:
    %471 = arith.constant 2 : i32
    %473 = arith.extsi %471 : i32 to i64
    %472 = arith.cmpi eq, %arg2, %473 : i64
    cf.cond_br %472, ^bb93, ^bb94
    ^bb93:
      %474 = arith.constant 0 : i32
      %475 = arith.extsi %474 : i32 to i64
      %476 = llvm.mlir.constant(1 : i64) : i64
      %477 = llvm.alloca %476 x i64 : (i64) -> !llvm.ptr
      llvm.store %475, %477 : i64, !llvm.ptr
      cf.br ^bb96
      ^bb96:
      %478 = llvm.load %477 : !llvm.ptr -> i64
      %479 = arith.constant 2 : i32
      %481 = arith.extsi %479 : i32 to i64
      %480 = arith.cmpi slt, %478, %481 : i64
      cf.cond_br %480, ^bb97, ^bb98
      ^bb97:
        %482 = llvm.load %477 : !llvm.ptr -> i64
        %483 = llvm.load %477 : !llvm.ptr -> i64
        %484 = arith.muli %482, %483 : i64
        %485 = llvm.load %477 : !llvm.ptr -> i64
        %486 = arith.muli %484, %485 : i64
        %487 = arith.addi %486, %arg1 : i64
        %488 = arith.constant 2 : i32
        %490 = arith.extsi %488 : i32 to i64
        %489 = arith.remsi %487, %490 : i64
        %491 = llvm.load %477 : !llvm.ptr -> i64
        %492 = arith.addi %491, %arg0 : i64
        %493 = arith.muli %492, %492 : i64
        %494 = arith.muli %493, %492 : i64
        %495 = arith.addi %494, %arg1 : i64
        %496 = arith.constant 2 : i32
        %498 = arith.extsi %496 : i32 to i64
        %497 = arith.remsi %495, %498 : i64
        %499 = arith.constant 0 : i32
        %501 = arith.extsi %499 : i32 to i64
        %500 = arith.cmpi eq, %489, %501 : i64
        cf.cond_br %500, ^bb99, ^bb100
        ^bb99:
          %502 = arith.constant 0 : i32
          %504 = arith.extsi %502 : i32 to i64
          %503 = arith.cmpi eq, %497, %504 : i64
          cf.cond_br %503, ^bb102, ^bb103
          ^bb102:
            %505 = llvm.load %477 : !llvm.ptr -> i64
            %506 = llvm.load %423 : !llvm.ptr -> i64
            %507 = llvm.getelementptr %arg3[%506] : (!llvm.ptr, i64) -> !llvm.ptr, i64
            llvm.store %505, %507 : i64, !llvm.ptr
            %508 = llvm.load %423 : !llvm.ptr -> i64
            %509 = arith.constant 1 : i32
            %511 = arith.extsi %509 : i32 to i64
            %510 = arith.addi %508, %511 : i64
            llvm.store %510, %423 : i64, !llvm.ptr
            cf.br ^bb104
          ^bb103:
            cf.br ^bb104
          ^bb104:
          cf.br ^bb101
        ^bb100:
          cf.br ^bb101
        ^bb101:
        %512 = llvm.load %477 : !llvm.ptr -> i64
        %513 = arith.constant 1 : i32
        %515 = arith.extsi %513 : i32 to i64
        %514 = arith.addi %512, %515 : i64
        llvm.store %514, %477 : i64, !llvm.ptr
        cf.br ^bb96
      ^bb98:
      %516 = llvm.load %423 : !llvm.ptr -> i64
      func.return %516 : i64
    ^bb94:
      cf.br ^bb95
    ^bb95:
    %517 = arith.remsi %arg0, %arg2 : i64
    %518 = arith.constant 0 : i32
    %519 = arith.constant 3 : i32
    %521 = arith.extsi %519 : i32 to i64
    %520 = arith.muli %521, %517 : i64
    %522 = arith.muli %520, %517 : i64
    %524 = arith.extsi %518 : i32 to i64
    %523 = arith.subi %524, %522 : i64
    %525 = arith.remsi %523, %arg2 : i64
    %526 = llvm.mlir.constant(1 : i64) : i64
    %527 = llvm.alloca %526 x i64 : (i64) -> !llvm.ptr
    llvm.store %525, %527 : i64, !llvm.ptr
    %528 = llvm.load %527 : !llvm.ptr -> i64
    %529 = arith.constant 0 : i32
    %531 = arith.extsi %529 : i32 to i64
    %530 = arith.cmpi slt, %528, %531 : i64
    cf.cond_br %530, ^bb105, ^bb106
    ^bb105:
      %532 = llvm.load %527 : !llvm.ptr -> i64
      %533 = arith.addi %532, %arg2 : i64
      llvm.store %533, %527 : i64, !llvm.ptr
      cf.br ^bb107
    ^bb106:
      cf.br ^bb107
    ^bb107:
    %535 = llvm.load %527 : !llvm.ptr -> i64
    %534 = func.call @tonelli(%535, %arg2) : (i64, i64) -> i64
    %536 = arith.constant 0 : i32
    %538 = arith.extsi %536 : i32 to i64
    %537 = arith.cmpi slt, %534, %538 : i64
    cf.cond_br %537, ^bb108, ^bb109
    ^bb108:
      %539 = arith.constant 0 : i32
      %540 = arith.extsi %539 : i32 to i64
      func.return %540 : i64
    ^bb109:
      cf.br ^bb110
    ^bb110:
    %542 = arith.constant 6 : i32
    %544 = arith.extsi %542 : i32 to i64
    %543 = arith.remsi %544, %arg2 : i64
    %541 = func.call @modinv(%543, %arg2) : (i64, i64) -> i64
    %545 = arith.constant 0 : i32
    %546 = arith.constant 3 : i32
    %548 = arith.extsi %546 : i32 to i64
    %547 = arith.muli %548, %517 : i64
    %550 = arith.extsi %545 : i32 to i64
    %549 = arith.subi %550, %547 : i64
    %551 = arith.remsi %549, %arg2 : i64
    %552 = llvm.mlir.constant(1 : i64) : i64
    %553 = llvm.alloca %552 x i64 : (i64) -> !llvm.ptr
    llvm.store %551, %553 : i64, !llvm.ptr
    %554 = llvm.load %553 : !llvm.ptr -> i64
    %555 = arith.constant 0 : i32
    %557 = arith.extsi %555 : i32 to i64
    %556 = arith.cmpi slt, %554, %557 : i64
    cf.cond_br %556, ^bb111, ^bb112
    ^bb111:
      %558 = llvm.load %553 : !llvm.ptr -> i64
      %559 = arith.addi %558, %arg2 : i64
      llvm.store %559, %553 : i64, !llvm.ptr
      cf.br ^bb113
    ^bb112:
      cf.br ^bb113
    ^bb113:
    %560 = llvm.load %553 : !llvm.ptr -> i64
    %561 = arith.addi %560, %534 : i64
    %562 = arith.remsi %561, %arg2 : i64
    %563 = arith.muli %562, %541 : i64
    %564 = arith.remsi %563, %arg2 : i64
    %565 = llvm.load %553 : !llvm.ptr -> i64
    %566 = arith.subi %565, %534 : i64
    %567 = arith.remsi %566, %arg2 : i64
    %568 = llvm.mlir.constant(1 : i64) : i64
    %569 = llvm.alloca %568 x i64 : (i64) -> !llvm.ptr
    llvm.store %567, %569 : i64, !llvm.ptr
    %570 = llvm.load %569 : !llvm.ptr -> i64
    %571 = arith.constant 0 : i32
    %573 = arith.extsi %571 : i32 to i64
    %572 = arith.cmpi slt, %570, %573 : i64
    cf.cond_br %572, ^bb114, ^bb115
    ^bb114:
      %574 = llvm.load %569 : !llvm.ptr -> i64
      %575 = arith.addi %574, %arg2 : i64
      llvm.store %575, %569 : i64, !llvm.ptr
      cf.br ^bb116
    ^bb115:
      cf.br ^bb116
    ^bb116:
    %576 = llvm.load %569 : !llvm.ptr -> i64
    %577 = arith.muli %576, %541 : i64
    %578 = arith.remsi %577, %arg2 : i64
    llvm.store %578, %569 : i64, !llvm.ptr
    %579 = arith.constant 0 : i32
    %580 = arith.extsi %579 : i32 to i64
    %581 = llvm.mlir.constant(1 : i64) : i64
    %582 = llvm.alloca %581 x i64 : (i64) -> !llvm.ptr
    llvm.store %580, %582 : i64, !llvm.ptr
    cf.br ^bb117
    ^bb117:
    %583 = llvm.load %582 : !llvm.ptr -> i64
    %584 = arith.constant 2 : i32
    %586 = arith.extsi %584 : i32 to i64
    %585 = arith.cmpi slt, %583, %586 : i64
    cf.cond_br %585, ^bb118, ^bb119
    ^bb118:
      %587 = llvm.mlir.constant(1 : i64) : i64
      %588 = llvm.alloca %587 x i64 : (i64) -> !llvm.ptr
      llvm.store %564, %588 : i64, !llvm.ptr
      %589 = llvm.load %582 : !llvm.ptr -> i64
      %590 = arith.constant 1 : i32
      %592 = arith.extsi %590 : i32 to i64
      %591 = arith.cmpi eq, %589, %592 : i64
      cf.cond_br %591, ^bb120, ^bb121
      ^bb120:
        %593 = llvm.load %569 : !llvm.ptr -> i64
        llvm.store %593, %588 : i64, !llvm.ptr
        cf.br ^bb122
      ^bb121:
        cf.br ^bb122
      ^bb122:
      %594 = arith.constant 1 : i32
      %595 = arith.extsi %594 : i32 to i64
      %596 = llvm.mlir.constant(1 : i64) : i64
      %597 = llvm.alloca %596 x i64 : (i64) -> !llvm.ptr
      llvm.store %595, %597 : i64, !llvm.ptr
      %598 = arith.constant 0 : i32
      %599 = arith.extsi %598 : i32 to i64
      %600 = llvm.mlir.constant(1 : i64) : i64
      %601 = llvm.alloca %600 x i64 : (i64) -> !llvm.ptr
      llvm.store %599, %601 : i64, !llvm.ptr
      cf.br ^bb123
      ^bb123:
      %602 = llvm.load %601 : !llvm.ptr -> i64
      %603 = llvm.load %423 : !llvm.ptr -> i64
      %604 = arith.cmpi slt, %602, %603 : i64
      cf.cond_br %604, ^bb124, ^bb125
      ^bb124:
        %606 = llvm.load %601 : !llvm.ptr -> i64
        %607 = llvm.getelementptr %arg3[%606] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %605 = llvm.load %607 : !llvm.ptr -> i64
        %608 = llvm.load %588 : !llvm.ptr -> i64
        %609 = arith.cmpi eq, %605, %608 : i64
        cf.cond_br %609, ^bb126, ^bb127
        ^bb126:
          %610 = arith.constant 0 : i32
          %611 = arith.extsi %610 : i32 to i64
          llvm.store %611, %597 : i64, !llvm.ptr
          cf.br ^bb128
        ^bb127:
          cf.br ^bb128
        ^bb128:
        %612 = llvm.load %601 : !llvm.ptr -> i64
        %613 = arith.constant 1 : i32
        %615 = arith.extsi %613 : i32 to i64
        %614 = arith.addi %612, %615 : i64
        llvm.store %614, %601 : i64, !llvm.ptr
        cf.br ^bb123
      ^bb125:
      %616 = llvm.load %597 : !llvm.ptr -> i64
      %617 = arith.constant 0 : i32
      %619 = arith.extsi %617 : i32 to i64
      %618 = arith.cmpi ne, %616, %619 : i64
      cf.cond_br %618, ^bb129, ^bb130
      ^bb129:
        %621 = llvm.load %588 : !llvm.ptr -> i64
        %622 = arith.constant 3 : i32
        %623 = arith.extsi %622 : i32 to i64
        %620 = func.call @modpow(%621, %623, %arg2) : (i64, i64, i64) -> i64
        %624 = arith.addi %620, %419 : i64
        %625 = arith.remsi %624, %arg2 : i64
        %626 = arith.constant 0 : i32
        %628 = arith.extsi %626 : i32 to i64
        %627 = arith.cmpi eq, %625, %628 : i64
        cf.cond_br %627, ^bb132, ^bb133
        ^bb132:
          %630 = llvm.load %588 : !llvm.ptr -> i64
          %631 = arith.addi %630, %arg0 : i64
          %632 = arith.remsi %631, %arg2 : i64
          %633 = arith.constant 3 : i32
          %634 = arith.extsi %633 : i32 to i64
          %629 = func.call @modpow(%632, %634, %arg2) : (i64, i64, i64) -> i64
          %635 = arith.addi %629, %419 : i64
          %636 = arith.remsi %635, %arg2 : i64
          %637 = arith.constant 0 : i32
          %639 = arith.extsi %637 : i32 to i64
          %638 = arith.cmpi eq, %636, %639 : i64
          cf.cond_br %638, ^bb135, ^bb136
          ^bb135:
            %640 = llvm.load %588 : !llvm.ptr -> i64
            %641 = llvm.load %423 : !llvm.ptr -> i64
            %642 = llvm.getelementptr %arg3[%641] : (!llvm.ptr, i64) -> !llvm.ptr, i64
            llvm.store %640, %642 : i64, !llvm.ptr
            %643 = llvm.load %423 : !llvm.ptr -> i64
            %644 = arith.constant 1 : i32
            %646 = arith.extsi %644 : i32 to i64
            %645 = arith.addi %643, %646 : i64
            llvm.store %645, %423 : i64, !llvm.ptr
            cf.br ^bb137
          ^bb136:
            cf.br ^bb137
          ^bb137:
          cf.br ^bb134
        ^bb133:
          cf.br ^bb134
        ^bb134:
        cf.br ^bb131
      ^bb130:
        cf.br ^bb131
      ^bb131:
      %647 = llvm.load %582 : !llvm.ptr -> i64
      %648 = arith.constant 1 : i32
      %650 = arith.extsi %648 : i32 to i64
      %649 = arith.addi %647, %650 : i64
      llvm.store %649, %582 : i64, !llvm.ptr
      cf.br ^bb117
    ^bb119:
    %651 = llvm.load %423 : !llvm.ptr -> i64
    func.return %651 : i64
  }
  func.func @linear_sols(%arg0: i64, %arg1: i64, %arg2: i64, %arg3: !llvm.ptr) -> i64 {
    %652 = arith.remsi %arg0, %arg2 : i64
    %653 = llvm.mlir.constant(1 : i64) : i64
    %654 = llvm.alloca %653 x i64 : (i64) -> !llvm.ptr
    llvm.store %652, %654 : i64, !llvm.ptr
    %655 = arith.remsi %arg1, %arg2 : i64
    %656 = llvm.mlir.constant(1 : i64) : i64
    %657 = llvm.alloca %656 x i64 : (i64) -> !llvm.ptr
    llvm.store %655, %657 : i64, !llvm.ptr
    %658 = llvm.load %654 : !llvm.ptr -> i64
    %659 = arith.constant 0 : i32
    %661 = arith.extsi %659 : i32 to i64
    %660 = arith.cmpi slt, %658, %661 : i64
    cf.cond_br %660, ^bb138, ^bb139
    ^bb138:
      %662 = llvm.load %654 : !llvm.ptr -> i64
      %663 = arith.addi %662, %arg2 : i64
      llvm.store %663, %654 : i64, !llvm.ptr
      cf.br ^bb140
    ^bb139:
      cf.br ^bb140
    ^bb140:
    %664 = llvm.load %657 : !llvm.ptr -> i64
    %665 = arith.constant 0 : i32
    %667 = arith.extsi %665 : i32 to i64
    %666 = arith.cmpi slt, %664, %667 : i64
    cf.cond_br %666, ^bb141, ^bb142
    ^bb141:
      %668 = llvm.load %657 : !llvm.ptr -> i64
      %669 = arith.addi %668, %arg2 : i64
      llvm.store %669, %657 : i64, !llvm.ptr
      cf.br ^bb143
    ^bb142:
      cf.br ^bb143
    ^bb143:
    %670 = llvm.load %654 : !llvm.ptr -> i64
    %671 = arith.constant 0 : i32
    %673 = arith.extsi %671 : i32 to i64
    %672 = arith.cmpi eq, %670, %673 : i64
    cf.cond_br %672, ^bb144, ^bb145
    ^bb144:
      %674 = llvm.load %657 : !llvm.ptr -> i64
      %675 = arith.constant 0 : i32
      %677 = arith.extsi %675 : i32 to i64
      %676 = arith.cmpi eq, %674, %677 : i64
      cf.cond_br %676, ^bb147, ^bb148
      ^bb147:
        %678 = arith.constant 0 : i32
        %679 = arith.extsi %678 : i32 to i64
        %680 = llvm.mlir.constant(1 : i64) : i64
        %681 = llvm.alloca %680 x i64 : (i64) -> !llvm.ptr
        llvm.store %679, %681 : i64, !llvm.ptr
        cf.br ^bb150
        ^bb150:
        %682 = llvm.load %681 : !llvm.ptr -> i64
        %683 = arith.cmpi slt, %682, %arg2 : i64
        cf.cond_br %683, ^bb151, ^bb152
        ^bb151:
          %684 = llvm.load %681 : !llvm.ptr -> i64
          %685 = llvm.load %681 : !llvm.ptr -> i64
          %686 = llvm.getelementptr %arg3[%685] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %684, %686 : i64, !llvm.ptr
          %687 = llvm.load %681 : !llvm.ptr -> i64
          %688 = arith.constant 1 : i32
          %690 = arith.extsi %688 : i32 to i64
          %689 = arith.addi %687, %690 : i64
          llvm.store %689, %681 : i64, !llvm.ptr
          cf.br ^bb150
        ^bb152:
        func.return %arg2 : i64
      ^bb148:
        cf.br ^bb149
      ^bb149:
      %691 = arith.constant 0 : i32
      %692 = arith.extsi %691 : i32 to i64
      func.return %692 : i64
    ^bb145:
      cf.br ^bb146
    ^bb146:
    %693 = llvm.load %657 : !llvm.ptr -> i64
    %695 = llvm.load %654 : !llvm.ptr -> i64
    %694 = func.call @modinv(%695, %arg2) : (i64, i64) -> i64
    %696 = arith.muli %693, %694 : i64
    %697 = arith.remsi %696, %arg2 : i64
    %698 = arith.constant 0 : i32
    %699 = arith.extsi %698 : i32 to i64
    %700 = llvm.getelementptr %arg3[%699] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %697, %700 : i64, !llvm.ptr
    %701 = arith.constant 1 : i32
    %702 = arith.extsi %701 : i32 to i64
    func.return %702 : i64
  }
  func.func @lift(%arg0: i64, %arg1: i64, %arg2: i64, %arg3: i64, %arg4: !llvm.ptr, %arg5: !llvm.ptr) -> i64 {
    %704 = arith.constant 512 : i32
    %705 = arith.constant 8 : i32
    %706 = arith.extsi %704 : i32 to i64
    %707 = arith.extsi %705 : i32 to i64
    %703 = func.call @calloc(%706, %707) : (i64, i64) -> !llvm.ptr
    %709 = arith.constant 512 : i32
    %710 = arith.constant 8 : i32
    %711 = arith.extsi %709 : i32 to i64
    %712 = arith.extsi %710 : i32 to i64
    %708 = func.call @calloc(%711, %712) : (i64, i64) -> !llvm.ptr
    %714 = arith.constant 256 : i32
    %715 = arith.constant 8 : i32
    %716 = arith.extsi %714 : i32 to i64
    %717 = arith.extsi %715 : i32 to i64
    %713 = func.call @calloc(%716, %717) : (i64, i64) -> !llvm.ptr
    %719 = arith.constant 256 : i32
    %720 = arith.constant 8 : i32
    %721 = arith.extsi %719 : i32 to i64
    %722 = arith.extsi %720 : i32 to i64
    %718 = func.call @calloc(%721, %722) : (i64, i64) -> !llvm.ptr
    %724 = arith.constant 256 : i32
    %725 = arith.constant 8 : i32
    %726 = arith.extsi %724 : i32 to i64
    %727 = arith.extsi %725 : i32 to i64
    %723 = func.call @calloc(%726, %727) : (i64, i64) -> !llvm.ptr
    %728 = llvm.mlir.zero : !llvm.ptr
    %729 = llvm.icmp "eq" %703, %728 : !llvm.ptr
    %730 = scf.if %729 -> (i1) {
      %731 = arith.constant true
      scf.yield %731 : i1
    } else {
      %732 = llvm.mlir.zero : !llvm.ptr
      %733 = llvm.icmp "eq" %708, %732 : !llvm.ptr
      scf.yield %733 : i1
    }
    cf.cond_br %730, ^bb153, ^bb154
    ^bb153:
      %734 = arith.constant 0 : i32
      %735 = arith.extsi %734 : i32 to i64
      func.return %735 : i64
    ^bb154:
      cf.br ^bb155
    ^bb155:
    %736 = func.call @init_sols(%arg0, %arg1, %arg2, %703) : (i64, i64, i64, !llvm.ptr) -> i64
    %737 = llvm.mlir.constant(1 : i64) : i64
    %738 = llvm.alloca %737 x i64 : (i64) -> !llvm.ptr
    llvm.store %736, %738 : i64, !llvm.ptr
    %739 = llvm.load %738 : !llvm.ptr -> i64
    %740 = arith.constant 0 : i32
    %742 = arith.extsi %740 : i32 to i64
    %741 = arith.cmpi eq, %739, %742 : i64
    cf.cond_br %741, ^bb156, ^bb157
    ^bb156:
      %743 = arith.constant 0 : i32
      %744 = arith.constant 0 : i32
      %745 = arith.extsi %743 : i32 to i64
      %746 = arith.extsi %744 : i32 to i64
      %747 = llvm.getelementptr %arg5[%746] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %745, %747 : i64, !llvm.ptr
      func.call @free(%703) : (!llvm.ptr) -> ()
      func.call @free(%708) : (!llvm.ptr) -> ()
      func.call @free(%713) : (!llvm.ptr) -> ()
      func.call @free(%718) : (!llvm.ptr) -> ()
      func.call @free(%723) : (!llvm.ptr) -> ()
      %753 = arith.constant 0 : i32
      %754 = arith.extsi %753 : i32 to i64
      func.return %754 : i64
    ^bb157:
      cf.br ^bb158
    ^bb158:
    %755 = llvm.mlir.constant(1 : i64) : i64
    %756 = llvm.alloca %755 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg2, %756 : i64, !llvm.ptr
    %757 = arith.constant 1 : i32
    %758 = arith.extsi %757 : i32 to i64
    %759 = llvm.mlir.constant(1 : i64) : i64
    %760 = llvm.alloca %759 x i64 : (i64) -> !llvm.ptr
    llvm.store %758, %760 : i64, !llvm.ptr
    cf.br ^bb159
    ^bb159:
    %761 = llvm.load %760 : !llvm.ptr -> i64
    %762 = arith.cmpi slt, %761, %arg3 : i64
    cf.cond_br %762, ^bb160, ^bb161
    ^bb160:
      %763 = llvm.load %756 : !llvm.ptr -> i64
      %764 = arith.muli %763, %arg2 : i64
      %765 = arith.constant 0 : i32
      %766 = arith.extsi %765 : i32 to i64
      %767 = llvm.mlir.constant(1 : i64) : i64
      %768 = llvm.alloca %767 x i64 : (i64) -> !llvm.ptr
      llvm.store %766, %768 : i64, !llvm.ptr
      %769 = arith.constant 0 : i32
      %770 = arith.extsi %769 : i32 to i64
      %771 = llvm.mlir.constant(1 : i64) : i64
      %772 = llvm.alloca %771 x i64 : (i64) -> !llvm.ptr
      llvm.store %770, %772 : i64, !llvm.ptr
      cf.br ^bb162
      ^bb162:
      %773 = llvm.load %772 : !llvm.ptr -> i64
      %774 = llvm.load %738 : !llvm.ptr -> i64
      %775 = arith.cmpi slt, %773, %774 : i64
      cf.cond_br %775, ^bb163, ^bb164
      ^bb163:
        %777 = llvm.load %772 : !llvm.ptr -> i64
        %778 = llvm.getelementptr %703[%777] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %776 = llvm.load %778 : !llvm.ptr -> i64
        %780 = arith.remsi %776, %764 : i64
        %781 = arith.constant 3 : i32
        %782 = arith.extsi %781 : i32 to i64
        %779 = func.call @modpow(%780, %782, %764) : (i64, i64, i64) -> i64
        %783 = arith.addi %779, %arg1 : i64
        %784 = arith.remsi %783, %764 : i64
        %786 = arith.addi %776, %arg0 : i64
        %787 = arith.remsi %786, %764 : i64
        %788 = arith.constant 3 : i32
        %789 = arith.extsi %788 : i32 to i64
        %785 = func.call @modpow(%787, %789, %764) : (i64, i64, i64) -> i64
        %790 = arith.addi %785, %arg1 : i64
        %791 = arith.remsi %790, %764 : i64
        %792 = llvm.load %756 : !llvm.ptr -> i64
        %793 = arith.remsi %784, %792 : i64
        %794 = arith.constant 0 : i32
        %796 = arith.extsi %794 : i32 to i64
        %795 = arith.cmpi eq, %793, %796 : i64
        cf.cond_br %795, ^bb165, ^bb166
        ^bb165:
          %797 = llvm.load %756 : !llvm.ptr -> i64
          %798 = arith.remsi %791, %797 : i64
          %799 = arith.constant 0 : i32
          %801 = arith.extsi %799 : i32 to i64
          %800 = arith.cmpi eq, %798, %801 : i64
          cf.cond_br %800, ^bb168, ^bb169
          ^bb168:
            %802 = llvm.load %756 : !llvm.ptr -> i64
            %803 = arith.divsi %784, %802 : i64
            %804 = arith.remsi %803, %arg2 : i64
            %805 = llvm.load %756 : !llvm.ptr -> i64
            %806 = arith.divsi %791, %805 : i64
            %807 = arith.remsi %806, %arg2 : i64
            %808 = arith.remsi %776, %arg2 : i64
            %809 = arith.addi %776, %arg0 : i64
            %810 = arith.remsi %809, %arg2 : i64
            %811 = arith.constant 3 : i32
            %813 = arith.extsi %811 : i32 to i64
            %812 = arith.muli %813, %808 : i64
            %814 = arith.muli %812, %808 : i64
            %815 = arith.remsi %814, %arg2 : i64
            %816 = arith.constant 3 : i32
            %818 = arith.extsi %816 : i32 to i64
            %817 = arith.muli %818, %810 : i64
            %819 = arith.muli %817, %810 : i64
            %820 = arith.remsi %819, %arg2 : i64
            %821 = arith.constant 0 : i32
            %823 = arith.extsi %821 : i32 to i64
            %822 = arith.subi %823, %804 : i64
            %824 = arith.remsi %822, %arg2 : i64
            %825 = arith.constant 0 : i32
            %827 = arith.extsi %825 : i32 to i64
            %826 = arith.subi %827, %807 : i64
            %828 = arith.remsi %826, %arg2 : i64
            %829 = arith.constant 0 : i32
            %831 = arith.extsi %829 : i32 to i64
            %830 = arith.cmpi slt, %824, %831 : i64
            cf.cond_br %830, ^bb171, ^bb172
            ^bb171:
              cf.br ^bb173
            ^bb172:
              cf.br ^bb173
            ^bb173:
            %832 = arith.constant 0 : i32
            %834 = arith.extsi %832 : i32 to i64
            %833 = arith.subi %834, %804 : i64
            %835 = arith.remsi %833, %arg2 : i64
            %836 = llvm.mlir.constant(1 : i64) : i64
            %837 = llvm.alloca %836 x i64 : (i64) -> !llvm.ptr
            llvm.store %835, %837 : i64, !llvm.ptr
            %838 = llvm.load %837 : !llvm.ptr -> i64
            %839 = arith.constant 0 : i32
            %841 = arith.extsi %839 : i32 to i64
            %840 = arith.cmpi slt, %838, %841 : i64
            cf.cond_br %840, ^bb174, ^bb175
            ^bb174:
              %842 = llvm.load %837 : !llvm.ptr -> i64
              %843 = arith.addi %842, %arg2 : i64
              llvm.store %843, %837 : i64, !llvm.ptr
              cf.br ^bb176
            ^bb175:
              cf.br ^bb176
            ^bb176:
            %844 = arith.constant 0 : i32
            %846 = arith.extsi %844 : i32 to i64
            %845 = arith.subi %846, %807 : i64
            %847 = arith.remsi %845, %arg2 : i64
            %848 = llvm.mlir.constant(1 : i64) : i64
            %849 = llvm.alloca %848 x i64 : (i64) -> !llvm.ptr
            llvm.store %847, %849 : i64, !llvm.ptr
            %850 = llvm.load %849 : !llvm.ptr -> i64
            %851 = arith.constant 0 : i32
            %853 = arith.extsi %851 : i32 to i64
            %852 = arith.cmpi slt, %850, %853 : i64
            cf.cond_br %852, ^bb177, ^bb178
            ^bb177:
              %854 = llvm.load %849 : !llvm.ptr -> i64
              %855 = arith.addi %854, %arg2 : i64
              llvm.store %855, %849 : i64, !llvm.ptr
              cf.br ^bb179
            ^bb178:
              cf.br ^bb179
            ^bb179:
            %857 = llvm.load %837 : !llvm.ptr -> i64
            %856 = func.call @linear_sols(%815, %857, %arg2, %713) : (i64, i64, i64, !llvm.ptr) -> i64
            %858 = arith.constant 0 : i32
            %860 = arith.extsi %858 : i32 to i64
            %859 = arith.cmpi ne, %856, %860 : i64
            cf.cond_br %859, ^bb180, ^bb181
            ^bb180:
              %862 = llvm.load %849 : !llvm.ptr -> i64
              %861 = func.call @linear_sols(%820, %862, %arg2, %718) : (i64, i64, i64, !llvm.ptr) -> i64
              %863 = arith.constant 0 : i32
              %865 = arith.extsi %863 : i32 to i64
              %864 = arith.cmpi ne, %861, %865 : i64
              cf.cond_br %864, ^bb183, ^bb184
              ^bb183:
                %866 = arith.constant 0 : i32
                %867 = arith.extsi %866 : i32 to i64
                %868 = llvm.mlir.constant(1 : i64) : i64
                %869 = llvm.alloca %868 x i64 : (i64) -> !llvm.ptr
                llvm.store %867, %869 : i64, !llvm.ptr
                %870 = arith.cmpi eq, %856, %arg2 : i64
                cf.cond_br %870, ^bb186, ^bb187
                ^bb186:
                  %871 = arith.cmpi eq, %861, %arg2 : i64
                  cf.cond_br %871, ^bb189, ^bb190
                  ^bb189:
                    %872 = arith.constant 0 : i32
                    %873 = arith.extsi %872 : i32 to i64
                    %874 = llvm.mlir.constant(1 : i64) : i64
                    %875 = llvm.alloca %874 x i64 : (i64) -> !llvm.ptr
                    llvm.store %873, %875 : i64, !llvm.ptr
                    cf.br ^bb192
                    ^bb192:
                    %876 = llvm.load %875 : !llvm.ptr -> i64
                    %877 = arith.cmpi slt, %876, %arg2 : i64
                    cf.cond_br %877, ^bb193, ^bb194
                    ^bb193:
                      %878 = llvm.load %875 : !llvm.ptr -> i64
                      %879 = llvm.load %869 : !llvm.ptr -> i64
                      %880 = llvm.getelementptr %723[%879] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                      llvm.store %878, %880 : i64, !llvm.ptr
                      %881 = llvm.load %869 : !llvm.ptr -> i64
                      %882 = arith.constant 1 : i32
                      %884 = arith.extsi %882 : i32 to i64
                      %883 = arith.addi %881, %884 : i64
                      llvm.store %883, %869 : i64, !llvm.ptr
                      %885 = llvm.load %875 : !llvm.ptr -> i64
                      %886 = arith.constant 1 : i32
                      %888 = arith.extsi %886 : i32 to i64
                      %887 = arith.addi %885, %888 : i64
                      llvm.store %887, %875 : i64, !llvm.ptr
                      cf.br ^bb192
                    ^bb194:
                    cf.br ^bb191
                  ^bb190:
                    %889 = arith.constant 0 : i32
                    %890 = arith.extsi %889 : i32 to i64
                    %891 = llvm.mlir.constant(1 : i64) : i64
                    %892 = llvm.alloca %891 x i64 : (i64) -> !llvm.ptr
                    llvm.store %890, %892 : i64, !llvm.ptr
                    cf.br ^bb195
                    ^bb195:
                    %893 = llvm.load %892 : !llvm.ptr -> i64
                    %894 = arith.cmpi slt, %893, %861 : i64
                    cf.cond_br %894, ^bb196, ^bb197
                    ^bb196:
                      %896 = llvm.load %892 : !llvm.ptr -> i64
                      %897 = llvm.getelementptr %718[%896] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                      %895 = llvm.load %897 : !llvm.ptr -> i64
                      %898 = llvm.load %869 : !llvm.ptr -> i64
                      %899 = llvm.getelementptr %723[%898] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                      llvm.store %895, %899 : i64, !llvm.ptr
                      %900 = llvm.load %869 : !llvm.ptr -> i64
                      %901 = arith.constant 1 : i32
                      %903 = arith.extsi %901 : i32 to i64
                      %902 = arith.addi %900, %903 : i64
                      llvm.store %902, %869 : i64, !llvm.ptr
                      %904 = llvm.load %892 : !llvm.ptr -> i64
                      %905 = arith.constant 1 : i32
                      %907 = arith.extsi %905 : i32 to i64
                      %906 = arith.addi %904, %907 : i64
                      llvm.store %906, %892 : i64, !llvm.ptr
                      cf.br ^bb195
                    ^bb197:
                    cf.br ^bb191
                  ^bb191:
                  cf.br ^bb188
                ^bb187:
                  %908 = arith.cmpi eq, %861, %arg2 : i64
                  cf.cond_br %908, ^bb198, ^bb199
                  ^bb198:
                    %909 = arith.constant 0 : i32
                    %910 = arith.extsi %909 : i32 to i64
                    %911 = llvm.mlir.constant(1 : i64) : i64
                    %912 = llvm.alloca %911 x i64 : (i64) -> !llvm.ptr
                    llvm.store %910, %912 : i64, !llvm.ptr
                    cf.br ^bb201
                    ^bb201:
                    %913 = llvm.load %912 : !llvm.ptr -> i64
                    %914 = arith.cmpi slt, %913, %856 : i64
                    cf.cond_br %914, ^bb202, ^bb203
                    ^bb202:
                      %916 = llvm.load %912 : !llvm.ptr -> i64
                      %917 = llvm.getelementptr %713[%916] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                      %915 = llvm.load %917 : !llvm.ptr -> i64
                      %918 = llvm.load %869 : !llvm.ptr -> i64
                      %919 = llvm.getelementptr %723[%918] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                      llvm.store %915, %919 : i64, !llvm.ptr
                      %920 = llvm.load %869 : !llvm.ptr -> i64
                      %921 = arith.constant 1 : i32
                      %923 = arith.extsi %921 : i32 to i64
                      %922 = arith.addi %920, %923 : i64
                      llvm.store %922, %869 : i64, !llvm.ptr
                      %924 = llvm.load %912 : !llvm.ptr -> i64
                      %925 = arith.constant 1 : i32
                      %927 = arith.extsi %925 : i32 to i64
                      %926 = arith.addi %924, %927 : i64
                      llvm.store %926, %912 : i64, !llvm.ptr
                      cf.br ^bb201
                    ^bb203:
                    cf.br ^bb200
                  ^bb199:
                    %929 = arith.constant 0 : i32
                    %930 = arith.extsi %929 : i32 to i64
                    %931 = llvm.getelementptr %713[%930] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                    %928 = llvm.load %931 : !llvm.ptr -> i64
                    %933 = arith.constant 0 : i32
                    %934 = arith.extsi %933 : i32 to i64
                    %935 = llvm.getelementptr %718[%934] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                    %932 = llvm.load %935 : !llvm.ptr -> i64
                    %936 = arith.cmpi eq, %928, %932 : i64
                    cf.cond_br %936, ^bb204, ^bb205
                    ^bb204:
                      %938 = arith.constant 0 : i32
                      %939 = arith.extsi %938 : i32 to i64
                      %940 = llvm.getelementptr %713[%939] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                      %937 = llvm.load %940 : !llvm.ptr -> i64
                      %941 = llvm.load %869 : !llvm.ptr -> i64
                      %942 = llvm.getelementptr %723[%941] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                      llvm.store %937, %942 : i64, !llvm.ptr
                      %943 = llvm.load %869 : !llvm.ptr -> i64
                      %944 = arith.constant 1 : i32
                      %946 = arith.extsi %944 : i32 to i64
                      %945 = arith.addi %943, %946 : i64
                      llvm.store %945, %869 : i64, !llvm.ptr
                      cf.br ^bb206
                    ^bb205:
                      cf.br ^bb206
                    ^bb206:
                    cf.br ^bb200
                  ^bb200:
                  cf.br ^bb188
                ^bb188:
                %947 = arith.constant 0 : i32
                %948 = arith.extsi %947 : i32 to i64
                %949 = llvm.mlir.constant(1 : i64) : i64
                %950 = llvm.alloca %949 x i64 : (i64) -> !llvm.ptr
                llvm.store %948, %950 : i64, !llvm.ptr
                cf.br ^bb207
                ^bb207:
                %951 = llvm.load %950 : !llvm.ptr -> i64
                %952 = llvm.load %869 : !llvm.ptr -> i64
                %953 = arith.cmpi slt, %951, %952 : i64
                cf.cond_br %953, ^bb208, ^bb209
                ^bb208:
                  %955 = llvm.load %950 : !llvm.ptr -> i64
                  %956 = llvm.getelementptr %723[%955] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                  %954 = llvm.load %956 : !llvm.ptr -> i64
                  %957 = llvm.load %756 : !llvm.ptr -> i64
                  %958 = arith.muli %954, %957 : i64
                  %959 = arith.addi %776, %958 : i64
                  %960 = arith.constant 1 : i32
                  %961 = arith.extsi %960 : i32 to i64
                  %962 = llvm.mlir.constant(1 : i64) : i64
                  %963 = llvm.alloca %962 x i64 : (i64) -> !llvm.ptr
                  llvm.store %961, %963 : i64, !llvm.ptr
                  %964 = arith.constant 0 : i32
                  %965 = arith.extsi %964 : i32 to i64
                  %966 = llvm.mlir.constant(1 : i64) : i64
                  %967 = llvm.alloca %966 x i64 : (i64) -> !llvm.ptr
                  llvm.store %965, %967 : i64, !llvm.ptr
                  cf.br ^bb210
                  ^bb210:
                  %968 = llvm.load %967 : !llvm.ptr -> i64
                  %969 = llvm.load %768 : !llvm.ptr -> i64
                  %970 = arith.cmpi slt, %968, %969 : i64
                  cf.cond_br %970, ^bb211, ^bb212
                  ^bb211:
                    %972 = llvm.load %967 : !llvm.ptr -> i64
                    %973 = llvm.getelementptr %708[%972] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                    %971 = llvm.load %973 : !llvm.ptr -> i64
                    %974 = arith.cmpi eq, %971, %959 : i64
                    cf.cond_br %974, ^bb213, ^bb214
                    ^bb213:
                      %975 = arith.constant 0 : i32
                      %976 = arith.extsi %975 : i32 to i64
                      llvm.store %976, %963 : i64, !llvm.ptr
                      cf.br ^bb215
                    ^bb214:
                      cf.br ^bb215
                    ^bb215:
                    %977 = llvm.load %967 : !llvm.ptr -> i64
                    %978 = arith.constant 1 : i32
                    %980 = arith.extsi %978 : i32 to i64
                    %979 = arith.addi %977, %980 : i64
                    llvm.store %979, %967 : i64, !llvm.ptr
                    cf.br ^bb210
                  ^bb212:
                  %981 = llvm.load %963 : !llvm.ptr -> i64
                  %982 = arith.constant 0 : i32
                  %984 = arith.extsi %982 : i32 to i64
                  %983 = arith.cmpi ne, %981, %984 : i64
                  cf.cond_br %983, ^bb216, ^bb217
                  ^bb216:
                    %985 = llvm.load %768 : !llvm.ptr -> i64
                    %986 = llvm.getelementptr %708[%985] : (!llvm.ptr, i64) -> !llvm.ptr, i64
                    llvm.store %959, %986 : i64, !llvm.ptr
                    %987 = llvm.load %768 : !llvm.ptr -> i64
                    %988 = arith.constant 1 : i32
                    %990 = arith.extsi %988 : i32 to i64
                    %989 = arith.addi %987, %990 : i64
                    llvm.store %989, %768 : i64, !llvm.ptr
                    cf.br ^bb218
                  ^bb217:
                    cf.br ^bb218
                  ^bb218:
                  %991 = llvm.load %950 : !llvm.ptr -> i64
                  %992 = arith.constant 1 : i32
                  %994 = arith.extsi %992 : i32 to i64
                  %993 = arith.addi %991, %994 : i64
                  llvm.store %993, %950 : i64, !llvm.ptr
                  cf.br ^bb207
                ^bb209:
                cf.br ^bb185
              ^bb184:
                cf.br ^bb185
              ^bb185:
              cf.br ^bb182
            ^bb181:
              cf.br ^bb182
            ^bb182:
            cf.br ^bb170
          ^bb169:
            cf.br ^bb170
          ^bb170:
          cf.br ^bb167
        ^bb166:
          cf.br ^bb167
        ^bb167:
        %995 = llvm.load %772 : !llvm.ptr -> i64
        %996 = arith.constant 1 : i32
        %998 = arith.extsi %996 : i32 to i64
        %997 = arith.addi %995, %998 : i64
        llvm.store %997, %772 : i64, !llvm.ptr
        cf.br ^bb162
      ^bb164:
      %999 = llvm.load %768 : !llvm.ptr -> i64
      %1000 = arith.constant 0 : i32
      %1002 = arith.extsi %1000 : i32 to i64
      %1001 = arith.cmpi eq, %999, %1002 : i64
      cf.cond_br %1001, ^bb219, ^bb220
      ^bb219:
        cf.br ^bb161
      ^bb220:
        cf.br ^bb221
      ^bb221:
      %1003 = llvm.load %768 : !llvm.ptr -> i64
      llvm.store %1003, %738 : i64, !llvm.ptr
      %1004 = arith.constant 0 : i32
      %1005 = arith.extsi %1004 : i32 to i64
      %1006 = llvm.mlir.constant(1 : i64) : i64
      %1007 = llvm.alloca %1006 x i64 : (i64) -> !llvm.ptr
      llvm.store %1005, %1007 : i64, !llvm.ptr
      cf.br ^bb222
      ^bb222:
      %1008 = llvm.load %1007 : !llvm.ptr -> i64
      %1009 = llvm.load %738 : !llvm.ptr -> i64
      %1010 = arith.cmpi slt, %1008, %1009 : i64
      cf.cond_br %1010, ^bb223, ^bb224
      ^bb223:
        %1012 = llvm.load %1007 : !llvm.ptr -> i64
        %1013 = llvm.getelementptr %708[%1012] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1011 = llvm.load %1013 : !llvm.ptr -> i64
        %1014 = llvm.load %1007 : !llvm.ptr -> i64
        %1015 = llvm.getelementptr %703[%1014] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1011, %1015 : i64, !llvm.ptr
        %1016 = llvm.load %1007 : !llvm.ptr -> i64
        %1017 = arith.constant 1 : i32
        %1019 = arith.extsi %1017 : i32 to i64
        %1018 = arith.addi %1016, %1019 : i64
        llvm.store %1018, %1007 : i64, !llvm.ptr
        cf.br ^bb222
      ^bb224:
      llvm.store %764, %756 : i64, !llvm.ptr
      %1020 = llvm.load %760 : !llvm.ptr -> i64
      %1021 = arith.constant 1 : i32
      %1023 = arith.extsi %1021 : i32 to i64
      %1022 = arith.addi %1020, %1023 : i64
      llvm.store %1022, %760 : i64, !llvm.ptr
      cf.br ^bb159
    ^bb161:
    %1024 = llvm.load %760 : !llvm.ptr -> i64
    %1025 = arith.constant 0 : i32
    %1026 = arith.extsi %1025 : i32 to i64
    %1027 = llvm.getelementptr %arg5[%1026] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1024, %1027 : i64, !llvm.ptr
    %1028 = arith.constant 0 : i32
    %1029 = arith.extsi %1028 : i32 to i64
    %1030 = llvm.mlir.constant(1 : i64) : i64
    %1031 = llvm.alloca %1030 x i64 : (i64) -> !llvm.ptr
    llvm.store %1029, %1031 : i64, !llvm.ptr
    cf.br ^bb225
    ^bb225:
    %1032 = llvm.load %1031 : !llvm.ptr -> i64
    %1033 = llvm.load %738 : !llvm.ptr -> i64
    %1034 = arith.cmpi slt, %1032, %1033 : i64
    cf.cond_br %1034, ^bb226, ^bb227
    ^bb226:
      %1036 = llvm.load %1031 : !llvm.ptr -> i64
      %1037 = llvm.getelementptr %703[%1036] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1035 = llvm.load %1037 : !llvm.ptr -> i64
      %1038 = llvm.load %1031 : !llvm.ptr -> i64
      %1039 = llvm.getelementptr %arg4[%1038] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %1035, %1039 : i64, !llvm.ptr
      %1040 = llvm.load %1031 : !llvm.ptr -> i64
      %1041 = arith.constant 1 : i32
      %1043 = arith.extsi %1041 : i32 to i64
      %1042 = arith.addi %1040, %1043 : i64
      llvm.store %1042, %1031 : i64, !llvm.ptr
      cf.br ^bb225
    ^bb227:
    func.call @free(%703) : (!llvm.ptr) -> ()
    func.call @free(%708) : (!llvm.ptr) -> ()
    func.call @free(%713) : (!llvm.ptr) -> ()
    func.call @free(%718) : (!llvm.ptr) -> ()
    func.call @free(%723) : (!llvm.ptr) -> ()
    %1049 = llvm.load %738 : !llvm.ptr -> i64
    func.return %1049 : i64
  }
  func.func @combine(%arg0: !llvm.ptr, %arg1: i64, %arg2: i64, %arg3: !llvm.ptr, %arg4: i64, %arg5: i64, %arg6: !llvm.ptr, %arg7: !llvm.ptr) -> i64 {
    %1050 = arith.constant 1 : i32
    %1052 = arith.extsi %1050 : i32 to i64
    %1051 = arith.cmpi eq, %arg2, %1052 : i64
    cf.cond_br %1051, ^bb228, ^bb229
    ^bb228:
      %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 ^bb231
      ^bb231:
      %1057 = llvm.load %1056 : !llvm.ptr -> i64
      %1058 = arith.cmpi slt, %1057, %arg4 : i64
      cf.cond_br %1058, ^bb232, ^bb233
      ^bb232:
        %1060 = llvm.load %1056 : !llvm.ptr -> i64
        %1061 = llvm.getelementptr %arg3[%1060] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1059 = llvm.load %1061 : !llvm.ptr -> i64
        %1062 = arith.remsi %1059, %arg5 : i64
        %1063 = llvm.load %1056 : !llvm.ptr -> i64
        %1064 = llvm.getelementptr %arg6[%1063] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1062, %1064 : i64, !llvm.ptr
        %1065 = llvm.load %1056 : !llvm.ptr -> i64
        %1066 = arith.constant 1 : i32
        %1068 = arith.extsi %1066 : i32 to i64
        %1067 = arith.addi %1065, %1068 : i64
        llvm.store %1067, %1056 : i64, !llvm.ptr
        cf.br ^bb231
      ^bb233:
      %1069 = arith.constant 0 : i32
      %1070 = arith.extsi %1069 : i32 to i64
      %1071 = llvm.getelementptr %arg7[%1070] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %arg5, %1071 : i64, !llvm.ptr
      func.return %arg4 : i64
    ^bb229:
      cf.br ^bb230
    ^bb230:
    %1072 = arith.constant 1 : i32
    %1074 = arith.extsi %1072 : i32 to i64
    %1073 = arith.cmpi eq, %arg5, %1074 : i64
    cf.cond_br %1073, ^bb234, ^bb235
    ^bb234:
      %1075 = arith.constant 0 : i32
      %1076 = arith.extsi %1075 : i32 to i64
      %1077 = llvm.mlir.constant(1 : i64) : i64
      %1078 = llvm.alloca %1077 x i64 : (i64) -> !llvm.ptr
      llvm.store %1076, %1078 : i64, !llvm.ptr
      cf.br ^bb237
      ^bb237:
      %1079 = llvm.load %1078 : !llvm.ptr -> i64
      %1080 = arith.cmpi slt, %1079, %arg1 : i64
      cf.cond_br %1080, ^bb238, ^bb239
      ^bb238:
        %1082 = llvm.load %1078 : !llvm.ptr -> i64
        %1083 = llvm.getelementptr %arg0[%1082] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1081 = llvm.load %1083 : !llvm.ptr -> i64
        %1084 = arith.remsi %1081, %arg2 : i64
        %1085 = llvm.load %1078 : !llvm.ptr -> i64
        %1086 = llvm.getelementptr %arg6[%1085] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1084, %1086 : i64, !llvm.ptr
        %1087 = llvm.load %1078 : !llvm.ptr -> i64
        %1088 = arith.constant 1 : i32
        %1090 = arith.extsi %1088 : i32 to i64
        %1089 = arith.addi %1087, %1090 : i64
        llvm.store %1089, %1078 : i64, !llvm.ptr
        cf.br ^bb237
      ^bb239:
      %1091 = arith.constant 0 : i32
      %1092 = arith.extsi %1091 : i32 to i64
      %1093 = llvm.getelementptr %arg7[%1092] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %arg2, %1093 : i64, !llvm.ptr
      func.return %arg1 : i64
    ^bb235:
      cf.br ^bb236
    ^bb236:
    %1095 = arith.remsi %arg2, %arg5 : i64
    %1094 = func.call @modinv(%1095, %arg5) : (i64, i64) -> i64
    %1096 = arith.muli %arg2, %arg5 : i64
    %1097 = arith.constant 0 : i32
    %1098 = arith.extsi %1097 : i32 to i64
    %1099 = llvm.mlir.constant(1 : i64) : i64
    %1100 = llvm.alloca %1099 x i64 : (i64) -> !llvm.ptr
    llvm.store %1098, %1100 : i64, !llvm.ptr
    %1101 = arith.constant 0 : i32
    %1102 = arith.extsi %1101 : i32 to i64
    %1103 = llvm.mlir.constant(1 : i64) : i64
    %1104 = llvm.alloca %1103 x i64 : (i64) -> !llvm.ptr
    llvm.store %1102, %1104 : i64, !llvm.ptr
    cf.br ^bb240
    ^bb240:
    %1105 = llvm.load %1104 : !llvm.ptr -> i64
    %1106 = arith.cmpi slt, %1105, %arg1 : i64
    cf.cond_br %1106, ^bb241, ^bb242
    ^bb241:
      %1108 = llvm.load %1104 : !llvm.ptr -> i64
      %1109 = llvm.getelementptr %arg0[%1108] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1107 = llvm.load %1109 : !llvm.ptr -> i64
      %1110 = arith.remsi %1107, %arg2 : i64
      %1111 = llvm.mlir.constant(1 : i64) : i64
      %1112 = llvm.alloca %1111 x i64 : (i64) -> !llvm.ptr
      llvm.store %1110, %1112 : i64, !llvm.ptr
      %1113 = llvm.load %1112 : !llvm.ptr -> i64
      %1114 = arith.constant 0 : i32
      %1116 = arith.extsi %1114 : i32 to i64
      %1115 = arith.cmpi slt, %1113, %1116 : i64
      cf.cond_br %1115, ^bb243, ^bb244
      ^bb243:
        %1117 = llvm.load %1112 : !llvm.ptr -> i64
        %1118 = arith.addi %1117, %arg2 : i64
        llvm.store %1118, %1112 : i64, !llvm.ptr
        cf.br ^bb245
      ^bb244:
        cf.br ^bb245
      ^bb245:
      %1119 = arith.constant 0 : i32
      %1120 = arith.extsi %1119 : i32 to i64
      %1121 = llvm.mlir.constant(1 : i64) : i64
      %1122 = llvm.alloca %1121 x i64 : (i64) -> !llvm.ptr
      llvm.store %1120, %1122 : i64, !llvm.ptr
      cf.br ^bb246
      ^bb246:
      %1123 = llvm.load %1122 : !llvm.ptr -> i64
      %1124 = arith.cmpi slt, %1123, %arg4 : i64
      cf.cond_br %1124, ^bb247, ^bb248
      ^bb247:
        %1126 = llvm.load %1122 : !llvm.ptr -> i64
        %1127 = llvm.getelementptr %arg3[%1126] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1125 = llvm.load %1127 : !llvm.ptr -> i64
        %1128 = arith.remsi %1125, %arg5 : i64
        %1129 = llvm.mlir.constant(1 : i64) : i64
        %1130 = llvm.alloca %1129 x i64 : (i64) -> !llvm.ptr
        llvm.store %1128, %1130 : i64, !llvm.ptr
        %1131 = llvm.load %1130 : !llvm.ptr -> i64
        %1132 = arith.constant 0 : i32
        %1134 = arith.extsi %1132 : i32 to i64
        %1133 = arith.cmpi slt, %1131, %1134 : i64
        cf.cond_br %1133, ^bb249, ^bb250
        ^bb249:
          %1135 = llvm.load %1130 : !llvm.ptr -> i64
          %1136 = arith.addi %1135, %arg5 : i64
          llvm.store %1136, %1130 : i64, !llvm.ptr
          cf.br ^bb251
        ^bb250:
          cf.br ^bb251
        ^bb251:
        %1137 = llvm.load %1130 : !llvm.ptr -> i64
        %1138 = llvm.load %1112 : !llvm.ptr -> i64
        %1139 = arith.subi %1137, %1138 : i64
        %1140 = arith.remsi %1139, %arg5 : i64
        %1141 = llvm.mlir.constant(1 : i64) : i64
        %1142 = llvm.alloca %1141 x i64 : (i64) -> !llvm.ptr
        llvm.store %1140, %1142 : i64, !llvm.ptr
        %1143 = llvm.load %1142 : !llvm.ptr -> i64
        %1144 = arith.constant 0 : i32
        %1146 = arith.extsi %1144 : i32 to i64
        %1145 = arith.cmpi slt, %1143, %1146 : i64
        cf.cond_br %1145, ^bb252, ^bb253
        ^bb252:
          %1147 = llvm.load %1142 : !llvm.ptr -> i64
          %1148 = arith.addi %1147, %arg5 : i64
          llvm.store %1148, %1142 : i64, !llvm.ptr
          cf.br ^bb254
        ^bb253:
          cf.br ^bb254
        ^bb254:
        %1149 = llvm.load %1142 : !llvm.ptr -> i64
        %1150 = arith.muli %1149, %1094 : i64
        %1151 = arith.remsi %1150, %arg5 : i64
        %1152 = llvm.load %1112 : !llvm.ptr -> i64
        %1153 = arith.muli %arg2, %1151 : i64
        %1154 = arith.addi %1152, %1153 : i64
        %1155 = arith.constant 1 : i32
        %1156 = arith.extsi %1155 : i32 to i64
        %1157 = llvm.mlir.constant(1 : i64) : i64
        %1158 = llvm.alloca %1157 x i64 : (i64) -> !llvm.ptr
        llvm.store %1156, %1158 : i64, !llvm.ptr
        %1159 = arith.constant 0 : i32
        %1160 = arith.extsi %1159 : i32 to i64
        %1161 = llvm.mlir.constant(1 : i64) : i64
        %1162 = llvm.alloca %1161 x i64 : (i64) -> !llvm.ptr
        llvm.store %1160, %1162 : i64, !llvm.ptr
        cf.br ^bb255
        ^bb255:
        %1163 = llvm.load %1162 : !llvm.ptr -> i64
        %1164 = llvm.load %1100 : !llvm.ptr -> i64
        %1165 = arith.cmpi slt, %1163, %1164 : i64
        cf.cond_br %1165, ^bb256, ^bb257
        ^bb256:
          %1167 = llvm.load %1162 : !llvm.ptr -> i64
          %1168 = llvm.getelementptr %arg6[%1167] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1166 = llvm.load %1168 : !llvm.ptr -> i64
          %1169 = arith.cmpi eq, %1166, %1154 : i64
          cf.cond_br %1169, ^bb258, ^bb259
          ^bb258:
            %1170 = arith.constant 0 : i32
            %1171 = arith.extsi %1170 : i32 to i64
            llvm.store %1171, %1158 : i64, !llvm.ptr
            cf.br ^bb260
          ^bb259:
            cf.br ^bb260
          ^bb260:
          %1172 = llvm.load %1162 : !llvm.ptr -> i64
          %1173 = arith.constant 1 : i32
          %1175 = arith.extsi %1173 : i32 to i64
          %1174 = arith.addi %1172, %1175 : i64
          llvm.store %1174, %1162 : i64, !llvm.ptr
          cf.br ^bb255
        ^bb257:
        %1176 = llvm.load %1158 : !llvm.ptr -> i64
        %1177 = arith.constant 0 : i32
        %1179 = arith.extsi %1177 : i32 to i64
        %1178 = arith.cmpi ne, %1176, %1179 : i64
        cf.cond_br %1178, ^bb261, ^bb262
        ^bb261:
          %1180 = llvm.load %1100 : !llvm.ptr -> i64
          %1181 = llvm.getelementptr %arg6[%1180] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %1154, %1181 : i64, !llvm.ptr
          %1182 = llvm.load %1100 : !llvm.ptr -> i64
          %1183 = arith.constant 1 : i32
          %1185 = arith.extsi %1183 : i32 to i64
          %1184 = arith.addi %1182, %1185 : i64
          llvm.store %1184, %1100 : i64, !llvm.ptr
          cf.br ^bb263
        ^bb262:
          cf.br ^bb263
        ^bb263:
        %1186 = llvm.load %1122 : !llvm.ptr -> i64
        %1187 = arith.constant 1 : i32
        %1189 = arith.extsi %1187 : i32 to i64
        %1188 = arith.addi %1186, %1189 : i64
        llvm.store %1188, %1122 : i64, !llvm.ptr
        cf.br ^bb246
      ^bb248:
      %1190 = llvm.load %1104 : !llvm.ptr -> i64
      %1191 = arith.constant 1 : i32
      %1193 = arith.extsi %1191 : i32 to i64
      %1192 = arith.addi %1190, %1193 : i64
      llvm.store %1192, %1104 : i64, !llvm.ptr
      cf.br ^bb240
    ^bb242:
    %1194 = arith.constant 0 : i32
    %1195 = arith.extsi %1194 : i32 to i64
    %1196 = llvm.getelementptr %arg7[%1195] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1096, %1196 : i64, !llvm.ptr
    %1197 = llvm.load %1100 : !llvm.ptr -> i64
    func.return %1197 : i64
  }
  func.func @compute_G(%arg0: i64, %arg1: i64) -> i64 {
    %1199 = llvm.mlir.addressof @A6 : !llvm.ptr
    %1200 = llvm.load %1199 : !llvm.ptr -> !llvm.ptr
    %1201 = llvm.getelementptr %1200[%arg0] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    %1198 = llvm.load %1201 : !llvm.ptr -> i64
    %1202 = arith.constant 27 : i32
    %1204 = arith.extsi %1202 : i32 to i64
    %1203 = arith.muli %1204, %arg1 : i64
    %1205 = arith.muli %1203, %arg1 : i64
    %1206 = arith.addi %1198, %1205 : i64
    %1208 = arith.constant 64 : i32
    %1209 = arith.constant 8 : i32
    %1210 = arith.extsi %1208 : i32 to i64
    %1211 = arith.extsi %1209 : i32 to i64
    %1207 = func.call @calloc(%1210, %1211) : (i64, i64) -> !llvm.ptr
    %1213 = arith.constant 64 : i32
    %1214 = arith.constant 8 : i32
    %1215 = arith.extsi %1213 : i32 to i64
    %1216 = arith.extsi %1214 : i32 to i64
    %1212 = func.call @calloc(%1215, %1216) : (i64, i64) -> !llvm.ptr
    %1217 = llvm.mlir.zero : !llvm.ptr
    %1218 = llvm.icmp "eq" %1207, %1217 : !llvm.ptr
    %1219 = scf.if %1218 -> (i1) {
      %1220 = arith.constant true
      scf.yield %1220 : i1
    } else {
      %1221 = llvm.mlir.zero : !llvm.ptr
      %1222 = llvm.icmp "eq" %1212, %1221 : !llvm.ptr
      scf.yield %1222 : i1
    }
    cf.cond_br %1219, ^bb264, ^bb265
    ^bb264:
      %1223 = arith.constant 1 : i32
      %1225 = arith.constant 0 : i32
      %1224 = arith.subi %1225, %1223 : i32
      %1226 = arith.extsi %1224 : i32 to i64
      func.return %1226 : i64
    ^bb265:
      cf.br ^bb266
    ^bb266:
    %1227 = func.call @factor_into(%1206, %1207, %1212) : (i64, !llvm.ptr, !llvm.ptr) -> i64
    %1229 = arith.constant 64 : i32
    %1230 = arith.constant 8 : i32
    %1231 = arith.extsi %1229 : i32 to i64
    %1232 = arith.extsi %1230 : i32 to i64
    %1228 = func.call @calloc(%1231, %1232) : (i64, i64) -> !llvm.ptr
    %1234 = arith.constant 64 : i32
    %1235 = arith.constant 8 : i32
    %1236 = arith.extsi %1234 : i32 to i64
    %1237 = arith.extsi %1235 : i32 to i64
    %1233 = func.call @calloc(%1236, %1237) : (i64, i64) -> !llvm.ptr
    %1238 = llvm.mlir.zero : !llvm.ptr
    %1239 = llvm.icmp "eq" %1228, %1238 : !llvm.ptr
    %1240 = scf.if %1239 -> (i1) {
      %1241 = arith.constant true
      scf.yield %1241 : i1
    } else {
      %1242 = llvm.mlir.zero : !llvm.ptr
      %1243 = llvm.icmp "eq" %1233, %1242 : !llvm.ptr
      scf.yield %1243 : i1
    }
    cf.cond_br %1240, ^bb267, ^bb268
    ^bb267:
      %1244 = arith.constant 1 : i32
      %1246 = arith.constant 0 : i32
      %1245 = arith.subi %1246, %1244 : i32
      %1247 = arith.extsi %1245 : i32 to i64
      func.return %1247 : i64
    ^bb268:
      cf.br ^bb269
    ^bb269:
    %1248 = arith.constant 0 : i32
    %1249 = arith.extsi %1248 : i32 to i64
    %1250 = llvm.mlir.constant(1 : i64) : i64
    %1251 = llvm.alloca %1250 x i64 : (i64) -> !llvm.ptr
    llvm.store %1249, %1251 : i64, !llvm.ptr
    %1252 = arith.constant 0 : i32
    %1253 = arith.extsi %1252 : i32 to i64
    %1254 = llvm.mlir.constant(1 : i64) : i64
    %1255 = llvm.alloca %1254 x i64 : (i64) -> !llvm.ptr
    llvm.store %1253, %1255 : i64, !llvm.ptr
    cf.br ^bb270
    ^bb270:
    %1256 = llvm.load %1255 : !llvm.ptr -> i64
    %1257 = arith.cmpi slt, %1256, %1227 : i64
    cf.cond_br %1257, ^bb271, ^bb272
    ^bb271:
      %1259 = llvm.load %1255 : !llvm.ptr -> i64
      %1260 = llvm.getelementptr %1207[%1259] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1258 = llvm.load %1260 : !llvm.ptr -> i64
      %1261 = llvm.load %1251 : !llvm.ptr -> i64
      %1262 = llvm.getelementptr %1228[%1261] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %1258, %1262 : i64, !llvm.ptr
      %1264 = llvm.load %1255 : !llvm.ptr -> i64
      %1265 = llvm.getelementptr %1212[%1264] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1263 = llvm.load %1265 : !llvm.ptr -> i64
      %1266 = llvm.load %1251 : !llvm.ptr -> i64
      %1267 = llvm.getelementptr %1233[%1266] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %1263, %1267 : i64, !llvm.ptr
      %1268 = llvm.load %1251 : !llvm.ptr -> i64
      %1269 = arith.constant 1 : i32
      %1271 = arith.extsi %1269 : i32 to i64
      %1270 = arith.addi %1268, %1271 : i64
      llvm.store %1270, %1251 : i64, !llvm.ptr
      %1272 = llvm.load %1255 : !llvm.ptr -> i64
      %1273 = arith.constant 1 : i32
      %1275 = arith.extsi %1273 : i32 to i64
      %1274 = arith.addi %1272, %1275 : i64
      llvm.store %1274, %1255 : i64, !llvm.ptr
      cf.br ^bb270
    ^bb272:
    %1276 = arith.constant 0 : i32
    %1277 = arith.extsi %1276 : i32 to i64
    llvm.store %1277, %1255 : i64, !llvm.ptr
    cf.br ^bb273
    ^bb273:
    %1278 = llvm.load %1255 : !llvm.ptr -> i64
    %1280 = llvm.mlir.addressof @FAC_AN : !llvm.ptr
    %1281 = llvm.load %1280 : !llvm.ptr -> !llvm.ptr
    %1282 = llvm.getelementptr %1281[%arg0] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    %1279 = llvm.load %1282 : !llvm.ptr -> i64
    %1283 = arith.cmpi slt, %1278, %1279 : i64
    cf.cond_br %1283, ^bb274, ^bb275
    ^bb274:
      %1285 = llvm.mlir.addressof @FAC_A_P : !llvm.ptr
      %1286 = llvm.load %1285 : !llvm.ptr -> !llvm.ptr
      %1287 = arith.constant 8 : i32
      %1289 = arith.extsi %1287 : i32 to i64
      %1288 = arith.muli %arg0, %1289 : i64
      %1290 = llvm.load %1255 : !llvm.ptr -> i64
      %1291 = arith.addi %1288, %1290 : i64
      %1292 = llvm.getelementptr %1286[%1291] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1284 = llvm.load %1292 : !llvm.ptr -> i64
      %1293 = arith.constant 3 : i32
      %1295 = llvm.mlir.addressof @FAC_A_E : !llvm.ptr
      %1296 = llvm.load %1295 : !llvm.ptr -> !llvm.ptr
      %1297 = arith.constant 8 : i32
      %1299 = arith.extsi %1297 : i32 to i64
      %1298 = arith.muli %arg0, %1299 : i64
      %1300 = llvm.load %1255 : !llvm.ptr -> i64
      %1301 = arith.addi %1298, %1300 : i64
      %1302 = llvm.getelementptr %1296[%1301] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1294 = llvm.load %1302 : !llvm.ptr -> i64
      %1304 = arith.extsi %1293 : i32 to i64
      %1303 = arith.muli %1304, %1294 : i64
      %1305 = arith.constant 1 : i32
      %1307 = arith.constant 0 : i32
      %1306 = arith.subi %1307, %1305 : i32
      %1308 = arith.extsi %1306 : i32 to i64
      %1309 = llvm.mlir.constant(1 : i64) : i64
      %1310 = llvm.alloca %1309 x i64 : (i64) -> !llvm.ptr
      llvm.store %1308, %1310 : i64, !llvm.ptr
      %1311 = arith.constant 0 : i32
      %1312 = arith.extsi %1311 : i32 to i64
      %1313 = llvm.mlir.constant(1 : i64) : i64
      %1314 = llvm.alloca %1313 x i64 : (i64) -> !llvm.ptr
      llvm.store %1312, %1314 : i64, !llvm.ptr
      cf.br ^bb276
      ^bb276:
      %1315 = llvm.load %1314 : !llvm.ptr -> i64
      %1316 = llvm.load %1251 : !llvm.ptr -> i64
      %1317 = arith.cmpi slt, %1315, %1316 : i64
      cf.cond_br %1317, ^bb277, ^bb278
      ^bb277:
        %1319 = llvm.load %1314 : !llvm.ptr -> i64
        %1320 = llvm.getelementptr %1228[%1319] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1318 = llvm.load %1320 : !llvm.ptr -> i64
        %1321 = arith.cmpi eq, %1318, %1284 : i64
        cf.cond_br %1321, ^bb279, ^bb280
        ^bb279:
          %1322 = llvm.load %1314 : !llvm.ptr -> i64
          llvm.store %1322, %1310 : i64, !llvm.ptr
          cf.br ^bb281
        ^bb280:
          cf.br ^bb281
        ^bb281:
        %1323 = llvm.load %1314 : !llvm.ptr -> i64
        %1324 = arith.constant 1 : i32
        %1326 = arith.extsi %1324 : i32 to i64
        %1325 = arith.addi %1323, %1326 : i64
        llvm.store %1325, %1314 : i64, !llvm.ptr
        cf.br ^bb276
      ^bb278:
      %1327 = llvm.load %1310 : !llvm.ptr -> i64
      %1328 = arith.constant 0 : i32
      %1330 = arith.extsi %1328 : i32 to i64
      %1329 = arith.cmpi sge, %1327, %1330 : i64
      cf.cond_br %1329, ^bb282, ^bb283
      ^bb282:
        %1332 = llvm.load %1310 : !llvm.ptr -> i64
        %1333 = llvm.getelementptr %1233[%1332] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1331 = llvm.load %1333 : !llvm.ptr -> i64
        %1334 = arith.addi %1331, %1303 : i64
        %1335 = llvm.load %1310 : !llvm.ptr -> i64
        %1336 = llvm.getelementptr %1233[%1335] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1334, %1336 : i64, !llvm.ptr
        cf.br ^bb284
      ^bb283:
        %1337 = llvm.load %1251 : !llvm.ptr -> i64
        %1338 = llvm.getelementptr %1228[%1337] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1284, %1338 : i64, !llvm.ptr
        %1339 = llvm.load %1251 : !llvm.ptr -> i64
        %1340 = llvm.getelementptr %1233[%1339] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1303, %1340 : i64, !llvm.ptr
        %1341 = llvm.load %1251 : !llvm.ptr -> i64
        %1342 = arith.constant 1 : i32
        %1344 = arith.extsi %1342 : i32 to i64
        %1343 = arith.addi %1341, %1344 : i64
        llvm.store %1343, %1251 : i64, !llvm.ptr
        cf.br ^bb284
      ^bb284:
      %1345 = llvm.load %1255 : !llvm.ptr -> i64
      %1346 = arith.constant 1 : i32
      %1348 = arith.extsi %1346 : i32 to i64
      %1347 = arith.addi %1345, %1348 : i64
      llvm.store %1347, %1255 : i64, !llvm.ptr
      cf.br ^bb273
    ^bb275:
    %1349 = arith.constant 0 : i32
    %1350 = arith.extsi %1349 : i32 to i64
    llvm.store %1350, %1255 : i64, !llvm.ptr
    cf.br ^bb285
    ^bb285:
    %1351 = llvm.load %1255 : !llvm.ptr -> i64
    %1352 = llvm.load %1251 : !llvm.ptr -> i64
    %1353 = arith.cmpi slt, %1351, %1352 : i64
    cf.cond_br %1353, ^bb286, ^bb287
    ^bb286:
      %1354 = llvm.load %1255 : !llvm.ptr -> i64
      %1355 = arith.constant 1 : i32
      %1357 = arith.extsi %1355 : i32 to i64
      %1356 = arith.addi %1354, %1357 : i64
      %1358 = llvm.mlir.constant(1 : i64) : i64
      %1359 = llvm.alloca %1358 x i64 : (i64) -> !llvm.ptr
      llvm.store %1356, %1359 : i64, !llvm.ptr
      cf.br ^bb288
      ^bb288:
      %1360 = llvm.load %1359 : !llvm.ptr -> i64
      %1361 = llvm.load %1251 : !llvm.ptr -> i64
      %1362 = arith.cmpi slt, %1360, %1361 : i64
      cf.cond_br %1362, ^bb289, ^bb290
      ^bb289:
        %1364 = llvm.load %1359 : !llvm.ptr -> i64
        %1365 = llvm.getelementptr %1228[%1364] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1363 = llvm.load %1365 : !llvm.ptr -> i64
        %1367 = llvm.load %1255 : !llvm.ptr -> i64
        %1368 = llvm.getelementptr %1228[%1367] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1366 = llvm.load %1368 : !llvm.ptr -> i64
        %1369 = arith.cmpi slt, %1363, %1366 : i64
        cf.cond_br %1369, ^bb291, ^bb292
        ^bb291:
          %1371 = llvm.load %1255 : !llvm.ptr -> i64
          %1372 = llvm.getelementptr %1228[%1371] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1370 = llvm.load %1372 : !llvm.ptr -> i64
          %1374 = llvm.load %1359 : !llvm.ptr -> i64
          %1375 = llvm.getelementptr %1228[%1374] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1373 = llvm.load %1375 : !llvm.ptr -> i64
          %1376 = llvm.load %1255 : !llvm.ptr -> i64
          %1377 = llvm.getelementptr %1228[%1376] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %1373, %1377 : i64, !llvm.ptr
          %1378 = llvm.load %1359 : !llvm.ptr -> i64
          %1379 = llvm.getelementptr %1228[%1378] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %1370, %1379 : i64, !llvm.ptr
          %1381 = llvm.load %1255 : !llvm.ptr -> i64
          %1382 = llvm.getelementptr %1233[%1381] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1380 = llvm.load %1382 : !llvm.ptr -> i64
          %1384 = llvm.load %1359 : !llvm.ptr -> i64
          %1385 = llvm.getelementptr %1233[%1384] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1383 = llvm.load %1385 : !llvm.ptr -> i64
          %1386 = llvm.load %1255 : !llvm.ptr -> i64
          %1387 = llvm.getelementptr %1233[%1386] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %1383, %1387 : i64, !llvm.ptr
          %1388 = llvm.load %1359 : !llvm.ptr -> i64
          %1389 = llvm.getelementptr %1233[%1388] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %1380, %1389 : i64, !llvm.ptr
          cf.br ^bb293
        ^bb292:
          cf.br ^bb293
        ^bb293:
        %1390 = llvm.load %1359 : !llvm.ptr -> i64
        %1391 = arith.constant 1 : i32
        %1393 = arith.extsi %1391 : i32 to i64
        %1392 = arith.addi %1390, %1393 : i64
        llvm.store %1392, %1359 : i64, !llvm.ptr
        cf.br ^bb288
      ^bb290:
      %1394 = llvm.load %1255 : !llvm.ptr -> i64
      %1395 = arith.constant 1 : i32
      %1397 = arith.extsi %1395 : i32 to i64
      %1396 = arith.addi %1394, %1397 : i64
      llvm.store %1396, %1255 : i64, !llvm.ptr
      cf.br ^bb285
    ^bb287:
    %1399 = arith.constant 1024 : i32
    %1400 = arith.constant 8 : i32
    %1401 = arith.extsi %1399 : i32 to i64
    %1402 = arith.extsi %1400 : i32 to i64
    %1398 = func.call @calloc(%1401, %1402) : (i64, i64) -> !llvm.ptr
    %1404 = arith.constant 1024 : i32
    %1405 = arith.constant 8 : i32
    %1406 = arith.extsi %1404 : i32 to i64
    %1407 = arith.extsi %1405 : i32 to i64
    %1403 = func.call @calloc(%1406, %1407) : (i64, i64) -> !llvm.ptr
    %1409 = arith.constant 512 : i32
    %1410 = arith.constant 8 : i32
    %1411 = arith.extsi %1409 : i32 to i64
    %1412 = arith.extsi %1410 : i32 to i64
    %1408 = func.call @calloc(%1411, %1412) : (i64, i64) -> !llvm.ptr
    %1414 = arith.constant 1 : i32
    %1415 = arith.constant 8 : i32
    %1416 = arith.extsi %1414 : i32 to i64
    %1417 = arith.extsi %1415 : i32 to i64
    %1413 = func.call @calloc(%1416, %1417) : (i64, i64) -> !llvm.ptr
    %1419 = arith.constant 1 : i32
    %1420 = arith.constant 8 : i32
    %1421 = arith.extsi %1419 : i32 to i64
    %1422 = arith.extsi %1420 : i32 to i64
    %1418 = func.call @calloc(%1421, %1422) : (i64, i64) -> !llvm.ptr
    %1423 = llvm.mlir.zero : !llvm.ptr
    %1424 = llvm.icmp "eq" %1398, %1423 : !llvm.ptr
    %1425 = scf.if %1424 -> (i1) {
      %1426 = arith.constant true
      scf.yield %1426 : i1
    } else {
      %1427 = llvm.mlir.zero : !llvm.ptr
      %1428 = llvm.icmp "eq" %1403, %1427 : !llvm.ptr
      scf.yield %1428 : i1
    }
    %1429 = scf.if %1425 -> (i1) {
      %1430 = arith.constant true
      scf.yield %1430 : i1
    } else {
      %1431 = llvm.mlir.zero : !llvm.ptr
      %1432 = llvm.icmp "eq" %1408, %1431 : !llvm.ptr
      scf.yield %1432 : i1
    }
    cf.cond_br %1429, ^bb294, ^bb295
    ^bb294:
      %1433 = arith.constant 1 : i32
      %1435 = arith.constant 0 : i32
      %1434 = arith.subi %1435, %1433 : i32
      %1436 = arith.extsi %1434 : i32 to i64
      func.return %1436 : i64
    ^bb295:
      cf.br ^bb296
    ^bb296:
    %1437 = arith.constant 0 : i32
    %1438 = arith.constant 0 : i32
    %1439 = arith.extsi %1437 : i32 to i64
    %1440 = arith.extsi %1438 : i32 to i64
    %1441 = llvm.getelementptr %1398[%1440] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1439, %1441 : i64, !llvm.ptr
    %1442 = arith.constant 1 : i32
    %1443 = arith.extsi %1442 : i32 to i64
    %1444 = llvm.mlir.constant(1 : i64) : i64
    %1445 = llvm.alloca %1444 x i64 : (i64) -> !llvm.ptr
    llvm.store %1443, %1445 : i64, !llvm.ptr
    %1446 = arith.constant 1 : i32
    %1447 = arith.extsi %1446 : i32 to i64
    %1448 = llvm.mlir.constant(1 : i64) : i64
    %1449 = llvm.alloca %1448 x i64 : (i64) -> !llvm.ptr
    llvm.store %1447, %1449 : i64, !llvm.ptr
    %1450 = arith.constant 0 : i32
    %1451 = arith.extsi %1450 : i32 to i64
    %1452 = llvm.mlir.constant(1 : i64) : i64
    %1453 = llvm.alloca %1452 x i64 : (i64) -> !llvm.ptr
    llvm.store %1451, %1453 : i64, !llvm.ptr
    %1454 = arith.constant 0 : i32
    %1455 = arith.extsi %1454 : i32 to i64
    llvm.store %1455, %1255 : i64, !llvm.ptr
    cf.br ^bb297
    ^bb297:
    %1456 = llvm.load %1255 : !llvm.ptr -> i64
    %1457 = llvm.load %1251 : !llvm.ptr -> i64
    %1458 = arith.cmpi slt, %1456, %1457 : i64
    cf.cond_br %1458, ^bb298, ^bb299
    ^bb298:
      %1461 = llvm.load %1255 : !llvm.ptr -> i64
      %1462 = llvm.getelementptr %1228[%1461] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1460 = llvm.load %1462 : !llvm.ptr -> i64
      %1464 = llvm.load %1255 : !llvm.ptr -> i64
      %1465 = llvm.getelementptr %1233[%1464] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1463 = llvm.load %1465 : !llvm.ptr -> i64
      %1459 = func.call @lift(%arg0, %arg1, %1460, %1463, %1408, %1413) : (i64, i64, i64, i64, !llvm.ptr, !llvm.ptr) -> i64
      %1467 = arith.constant 0 : i32
      %1468 = arith.extsi %1467 : i32 to i64
      %1469 = llvm.getelementptr %1413[%1468] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1466 = llvm.load %1469 : !llvm.ptr -> i64
      %1470 = arith.constant 0 : i32
      %1472 = arith.extsi %1470 : i32 to i64
      %1471 = arith.cmpi sgt, %1466, %1472 : i64
      cf.cond_br %1471, ^bb300, ^bb301
      ^bb300:
        %1473 = arith.constant 1 : i32
        %1474 = arith.extsi %1473 : i32 to i64
        llvm.store %1474, %1453 : i64, !llvm.ptr
        %1475 = arith.constant 1 : i32
        %1476 = arith.extsi %1475 : i32 to i64
        %1477 = llvm.mlir.constant(1 : i64) : i64
        %1478 = llvm.alloca %1477 x i64 : (i64) -> !llvm.ptr
        llvm.store %1476, %1478 : i64, !llvm.ptr
        %1479 = arith.constant 0 : i32
        %1480 = arith.extsi %1479 : i32 to i64
        %1481 = llvm.mlir.constant(1 : i64) : i64
        %1482 = llvm.alloca %1481 x i64 : (i64) -> !llvm.ptr
        llvm.store %1480, %1482 : i64, !llvm.ptr
        cf.br ^bb303
        ^bb303:
        %1483 = llvm.load %1482 : !llvm.ptr -> i64
        %1484 = arith.cmpi slt, %1483, %1466 : i64
        cf.cond_br %1484, ^bb304, ^bb305
        ^bb304:
          %1485 = llvm.load %1478 : !llvm.ptr -> i64
          %1487 = llvm.load %1255 : !llvm.ptr -> i64
          %1488 = llvm.getelementptr %1228[%1487] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1486 = llvm.load %1488 : !llvm.ptr -> i64
          %1489 = arith.muli %1485, %1486 : i64
          llvm.store %1489, %1478 : i64, !llvm.ptr
          %1490 = llvm.load %1482 : !llvm.ptr -> i64
          %1491 = arith.constant 1 : i32
          %1493 = arith.extsi %1491 : i32 to i64
          %1492 = arith.addi %1490, %1493 : i64
          llvm.store %1492, %1482 : i64, !llvm.ptr
          cf.br ^bb303
        ^bb305:
        %1495 = llvm.load %1445 : !llvm.ptr -> i64
        %1496 = llvm.load %1449 : !llvm.ptr -> i64
        %1497 = llvm.load %1478 : !llvm.ptr -> i64
        %1494 = func.call @combine(%1398, %1495, %1496, %1408, %1459, %1497, %1403, %1418) : (!llvm.ptr, i64, i64, !llvm.ptr, i64, i64, !llvm.ptr, !llvm.ptr) -> i64
        llvm.store %1494, %1445 : i64, !llvm.ptr
        %1499 = arith.constant 0 : i32
        %1500 = arith.extsi %1499 : i32 to i64
        %1501 = llvm.getelementptr %1418[%1500] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1498 = llvm.load %1501 : !llvm.ptr -> i64
        llvm.store %1498, %1449 : i64, !llvm.ptr
        %1502 = arith.constant 0 : i32
        %1503 = arith.extsi %1502 : i32 to i64
        llvm.store %1503, %1482 : i64, !llvm.ptr
        cf.br ^bb306
        ^bb306:
        %1504 = llvm.load %1482 : !llvm.ptr -> i64
        %1505 = llvm.load %1445 : !llvm.ptr -> i64
        %1506 = arith.cmpi slt, %1504, %1505 : i64
        cf.cond_br %1506, ^bb307, ^bb308
        ^bb307:
          %1508 = llvm.load %1482 : !llvm.ptr -> i64
          %1509 = llvm.getelementptr %1403[%1508] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1507 = llvm.load %1509 : !llvm.ptr -> i64
          %1510 = llvm.load %1482 : !llvm.ptr -> i64
          %1511 = llvm.getelementptr %1398[%1510] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %1507, %1511 : i64, !llvm.ptr
          %1512 = llvm.load %1482 : !llvm.ptr -> i64
          %1513 = arith.constant 1 : i32
          %1515 = arith.extsi %1513 : i32 to i64
          %1514 = arith.addi %1512, %1515 : i64
          llvm.store %1514, %1482 : i64, !llvm.ptr
          cf.br ^bb306
        ^bb308:
        cf.br ^bb302
      ^bb301:
        cf.br ^bb302
      ^bb302:
      %1516 = llvm.load %1255 : !llvm.ptr -> i64
      %1517 = arith.constant 1 : i32
      %1519 = arith.extsi %1517 : i32 to i64
      %1518 = arith.addi %1516, %1519 : i64
      llvm.store %1518, %1255 : i64, !llvm.ptr
      cf.br ^bb297
    ^bb299:
    %1520 = arith.constant 0 : i32
    %1521 = arith.extsi %1520 : i32 to i64
    %1522 = llvm.mlir.constant(1 : i64) : i64
    %1523 = llvm.alloca %1522 x i64 : (i64) -> !llvm.ptr
    llvm.store %1521, %1523 : i64, !llvm.ptr
    %1524 = llvm.load %1453 : !llvm.ptr -> i64
    %1525 = arith.constant 0 : i32
    %1527 = arith.extsi %1525 : i32 to i64
    %1526 = arith.cmpi ne, %1524, %1527 : i64
    cf.cond_br %1526, ^bb309, ^bb310
    ^bb309:
      %1529 = arith.constant 0 : i32
      %1530 = arith.extsi %1529 : i32 to i64
      %1531 = llvm.getelementptr %1398[%1530] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1528 = llvm.load %1531 : !llvm.ptr -> i64
      llvm.store %1528, %1523 : i64, !llvm.ptr
      %1532 = arith.constant 1 : i32
      %1533 = arith.extsi %1532 : i32 to i64
      llvm.store %1533, %1255 : i64, !llvm.ptr
      cf.br ^bb312
      ^bb312:
      %1534 = llvm.load %1255 : !llvm.ptr -> i64
      %1535 = llvm.load %1445 : !llvm.ptr -> i64
      %1536 = arith.cmpi slt, %1534, %1535 : i64
      cf.cond_br %1536, ^bb313, ^bb314
      ^bb313:
        %1538 = llvm.load %1255 : !llvm.ptr -> i64
        %1539 = llvm.getelementptr %1398[%1538] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1537 = llvm.load %1539 : !llvm.ptr -> i64
        %1540 = llvm.load %1523 : !llvm.ptr -> i64
        %1541 = arith.cmpi slt, %1537, %1540 : i64
        cf.cond_br %1541, ^bb315, ^bb316
        ^bb315:
          %1543 = llvm.load %1255 : !llvm.ptr -> i64
          %1544 = llvm.getelementptr %1398[%1543] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %1542 = llvm.load %1544 : !llvm.ptr -> i64
          llvm.store %1542, %1523 : i64, !llvm.ptr
          cf.br ^bb317
        ^bb316:
          cf.br ^bb317
        ^bb317:
        %1545 = llvm.load %1255 : !llvm.ptr -> i64
        %1546 = arith.constant 1 : i32
        %1548 = arith.extsi %1546 : i32 to i64
        %1547 = arith.addi %1545, %1548 : i64
        llvm.store %1547, %1255 : i64, !llvm.ptr
        cf.br ^bb312
      ^bb314:
      cf.br ^bb311
    ^bb310:
      cf.br ^bb311
    ^bb311:
    func.call @free(%1418) : (!llvm.ptr) -> ()
    func.call @free(%1413) : (!llvm.ptr) -> ()
    func.call @free(%1408) : (!llvm.ptr) -> ()
    func.call @free(%1403) : (!llvm.ptr) -> ()
    func.call @free(%1398) : (!llvm.ptr) -> ()
    func.call @free(%1233) : (!llvm.ptr) -> ()
    func.call @free(%1228) : (!llvm.ptr) -> ()
    func.call @free(%1212) : (!llvm.ptr) -> ()
    func.call @free(%1207) : (!llvm.ptr) -> ()
    %1558 = llvm.load %1523 : !llvm.ptr -> i64
    func.return %1558 : i64
  }
  func.func @main() -> i32 {
    %1559 = arith.constant 12000 : i32
    %1560 = arith.extsi %1559 : i32 to i64
    %1562 = arith.constant 1 : i32
    %1564 = arith.extsi %1562 : i32 to i64
    %1563 = arith.addi %1560, %1564 : i64
    %1565 = arith.constant 1 : i32
    %1566 = arith.extsi %1565 : i32 to i64
    %1561 = func.call @calloc(%1563, %1566) : (i64, i64) -> !llvm.ptr
    %1568 = arith.constant 8 : i32
    %1569 = arith.extsi %1568 : i32 to i64
    %1567 = func.call @calloc(%1560, %1569) : (i64, i64) -> !llvm.ptr
    %1570 = llvm.mlir.addressof @PRIMES : !llvm.ptr
    llvm.store %1567, %1570 : !llvm.ptr, !llvm.ptr
    %1572 = arith.constant 20 : i32
    %1573 = arith.constant 8 : i32
    %1574 = arith.extsi %1572 : i32 to i64
    %1575 = arith.extsi %1573 : i32 to i64
    %1571 = func.call @calloc(%1574, %1575) : (i64, i64) -> !llvm.ptr
    %1576 = llvm.mlir.addressof @A3 : !llvm.ptr
    llvm.store %1571, %1576 : !llvm.ptr, !llvm.ptr
    %1578 = arith.constant 20 : i32
    %1579 = arith.constant 8 : i32
    %1580 = arith.extsi %1578 : i32 to i64
    %1581 = arith.extsi %1579 : i32 to i64
    %1577 = func.call @calloc(%1580, %1581) : (i64, i64) -> !llvm.ptr
    %1582 = llvm.mlir.addressof @A6 : !llvm.ptr
    llvm.store %1577, %1582 : !llvm.ptr, !llvm.ptr
    %1584 = arith.constant 20 : i32
    %1585 = arith.constant 8 : i32
    %1586 = arith.muli %1584, %1585 : i32
    %1587 = arith.constant 8 : i32
    %1588 = arith.extsi %1586 : i32 to i64
    %1589 = arith.extsi %1587 : i32 to i64
    %1583 = func.call @calloc(%1588, %1589) : (i64, i64) -> !llvm.ptr
    %1590 = llvm.mlir.addressof @FAC_A_P : !llvm.ptr
    llvm.store %1583, %1590 : !llvm.ptr, !llvm.ptr
    %1592 = arith.constant 20 : i32
    %1593 = arith.constant 8 : i32
    %1594 = arith.muli %1592, %1593 : i32
    %1595 = arith.constant 8 : i32
    %1596 = arith.extsi %1594 : i32 to i64
    %1597 = arith.extsi %1595 : i32 to i64
    %1591 = func.call @calloc(%1596, %1597) : (i64, i64) -> !llvm.ptr
    %1598 = llvm.mlir.addressof @FAC_A_E : !llvm.ptr
    llvm.store %1591, %1598 : !llvm.ptr, !llvm.ptr
    %1600 = arith.constant 20 : i32
    %1601 = arith.constant 8 : i32
    %1602 = arith.extsi %1600 : i32 to i64
    %1603 = arith.extsi %1601 : i32 to i64
    %1599 = func.call @calloc(%1602, %1603) : (i64, i64) -> !llvm.ptr
    %1604 = llvm.mlir.addressof @FAC_AN : !llvm.ptr
    llvm.store %1599, %1604 : !llvm.ptr, !llvm.ptr
    %1605 = llvm.mlir.zero : !llvm.ptr
    %1606 = llvm.icmp "eq" %1561, %1605 : !llvm.ptr
    %1607 = scf.if %1606 -> (i1) {
      %1608 = arith.constant true
      scf.yield %1608 : i1
    } else {
      %1609 = llvm.mlir.addressof @PRIMES : !llvm.ptr
      %1610 = llvm.load %1609 : !llvm.ptr -> !llvm.ptr
      %1611 = llvm.mlir.zero : !llvm.ptr
      %1612 = llvm.icmp "eq" %1610, %1611 : !llvm.ptr
      scf.yield %1612 : i1
    }
    cf.cond_br %1607, ^bb318, ^bb319
    ^bb318:
      %1613 = arith.constant 1 : i32
      func.return %1613 : i32
    ^bb319:
      cf.br ^bb320
    ^bb320:
    %1614 = arith.constant 0 : i32
    %1615 = arith.extsi %1614 : i32 to i64
    %1616 = llvm.mlir.constant(1 : i64) : i64
    %1617 = llvm.alloca %1616 x i64 : (i64) -> !llvm.ptr
    llvm.store %1615, %1617 : i64, !llvm.ptr
    cf.br ^bb321
    ^bb321:
    %1618 = llvm.load %1617 : !llvm.ptr -> i64
    %1619 = arith.cmpi sle, %1618, %1560 : i64
    cf.cond_br %1619, ^bb322, ^bb323
    ^bb322:
      %1620 = arith.constant 1 : i32
      %1621 = llvm.load %1617 : !llvm.ptr -> i64
      %1622 = arith.trunci %1620 : i32 to i8
      %1623 = llvm.getelementptr %1561[%1621] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      llvm.store %1622, %1623 : i8, !llvm.ptr
      %1624 = llvm.load %1617 : !llvm.ptr -> i64
      %1625 = arith.constant 1 : i32
      %1627 = arith.extsi %1625 : i32 to i64
      %1626 = arith.addi %1624, %1627 : i64
      llvm.store %1626, %1617 : i64, !llvm.ptr
      cf.br ^bb321
    ^bb323:
    %1628 = arith.constant 0 : i32
    %1629 = arith.constant 0 : i32
    %1630 = arith.trunci %1628 : i32 to i8
    %1631 = arith.extsi %1629 : i32 to i64
    %1632 = llvm.getelementptr %1561[%1631] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %1630, %1632 : i8, !llvm.ptr
    %1633 = arith.constant 0 : i32
    %1634 = arith.constant 1 : i32
    %1635 = arith.trunci %1633 : i32 to i8
    %1636 = arith.extsi %1634 : i32 to i64
    %1637 = llvm.getelementptr %1561[%1636] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %1635, %1637 : i8, !llvm.ptr
    %1638 = arith.constant 2 : i32
    %1639 = arith.extsi %1638 : i32 to i64
    llvm.store %1639, %1617 : i64, !llvm.ptr
    cf.br ^bb324
    ^bb324:
    %1640 = llvm.load %1617 : !llvm.ptr -> i64
    %1641 = llvm.load %1617 : !llvm.ptr -> i64
    %1642 = arith.muli %1640, %1641 : i64
    %1643 = arith.cmpi sle, %1642, %1560 : i64
    cf.cond_br %1643, ^bb325, ^bb326
    ^bb325:
      %1645 = llvm.load %1617 : !llvm.ptr -> i64
      %1646 = llvm.getelementptr %1561[%1645] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %1644 = llvm.load %1646 : !llvm.ptr -> i8
      %1647 = arith.constant 0 : i32
      %1649 = arith.extsi %1644 : i8 to i32
      %1648 = arith.cmpi ne, %1649, %1647 : i32
      cf.cond_br %1648, ^bb327, ^bb328
      ^bb327:
        %1650 = llvm.load %1617 : !llvm.ptr -> i64
        %1651 = llvm.load %1617 : !llvm.ptr -> i64
        %1652 = arith.muli %1650, %1651 : i64
        %1653 = llvm.mlir.constant(1 : i64) : i64
        %1654 = llvm.alloca %1653 x i64 : (i64) -> !llvm.ptr
        llvm.store %1652, %1654 : i64, !llvm.ptr
        cf.br ^bb330
        ^bb330:
        %1655 = llvm.load %1654 : !llvm.ptr -> i64
        %1656 = arith.cmpi sle, %1655, %1560 : i64
        cf.cond_br %1656, ^bb331, ^bb332
        ^bb331:
          %1657 = arith.constant 0 : i32
          %1658 = llvm.load %1654 : !llvm.ptr -> i64
          %1659 = arith.trunci %1657 : i32 to i8
          %1660 = llvm.getelementptr %1561[%1658] : (!llvm.ptr, i64) -> !llvm.ptr, i8
          llvm.store %1659, %1660 : i8, !llvm.ptr
          %1661 = llvm.load %1654 : !llvm.ptr -> i64
          %1662 = llvm.load %1617 : !llvm.ptr -> i64
          %1663 = arith.addi %1661, %1662 : i64
          llvm.store %1663, %1654 : i64, !llvm.ptr
          cf.br ^bb330
        ^bb332:
        cf.br ^bb329
      ^bb328:
        cf.br ^bb329
      ^bb329:
      %1664 = llvm.load %1617 : !llvm.ptr -> i64
      %1665 = arith.constant 1 : i32
      %1667 = arith.extsi %1665 : i32 to i64
      %1666 = arith.addi %1664, %1667 : i64
      llvm.store %1666, %1617 : i64, !llvm.ptr
      cf.br ^bb324
    ^bb326:
    %1668 = arith.constant 0 : i32
    %1669 = arith.extsi %1668 : i32 to i64
    %1670 = llvm.mlir.addressof @PC : !llvm.ptr
    llvm.store %1669, %1670 : i64, !llvm.ptr
    %1671 = arith.constant 2 : i32
    %1672 = arith.extsi %1671 : i32 to i64
    llvm.store %1672, %1617 : i64, !llvm.ptr
    cf.br ^bb333
    ^bb333:
    %1673 = llvm.load %1617 : !llvm.ptr -> i64
    %1674 = arith.cmpi sle, %1673, %1560 : i64
    cf.cond_br %1674, ^bb334, ^bb335
    ^bb334:
      %1676 = llvm.load %1617 : !llvm.ptr -> i64
      %1677 = llvm.getelementptr %1561[%1676] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %1675 = llvm.load %1677 : !llvm.ptr -> i8
      %1678 = arith.constant 0 : i32
      %1680 = arith.extsi %1675 : i8 to i32
      %1679 = arith.cmpi ne, %1680, %1678 : i32
      cf.cond_br %1679, ^bb336, ^bb337
      ^bb336:
        %1681 = llvm.load %1617 : !llvm.ptr -> i64
        %1682 = llvm.mlir.addressof @PRIMES : !llvm.ptr
        %1683 = llvm.load %1682 : !llvm.ptr -> !llvm.ptr
        %1684 = llvm.mlir.addressof @PC : !llvm.ptr
        %1685 = llvm.load %1684 : !llvm.ptr -> i64
        %1686 = llvm.getelementptr %1683[%1685] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1681, %1686 : i64, !llvm.ptr
        %1687 = llvm.mlir.addressof @PC : !llvm.ptr
        %1688 = llvm.load %1687 : !llvm.ptr -> i64
        %1689 = arith.constant 1 : i32
        %1691 = arith.extsi %1689 : i32 to i64
        %1690 = arith.addi %1688, %1691 : i64
        %1692 = llvm.mlir.addressof @PC : !llvm.ptr
        llvm.store %1690, %1692 : i64, !llvm.ptr
        cf.br ^bb338
      ^bb337:
        cf.br ^bb338
      ^bb338:
      %1693 = llvm.load %1617 : !llvm.ptr -> i64
      %1694 = arith.constant 1 : i32
      %1696 = arith.extsi %1694 : i32 to i64
      %1695 = arith.addi %1693, %1696 : i64
      llvm.store %1695, %1617 : i64, !llvm.ptr
      cf.br ^bb333
    ^bb335:
    func.call @free(%1561) : (!llvm.ptr) -> ()
    %1698 = arith.constant 1 : i32
    %1699 = arith.extsi %1698 : i32 to i64
    %1700 = llvm.mlir.constant(1 : i64) : i64
    %1701 = llvm.alloca %1700 x i64 : (i64) -> !llvm.ptr
    llvm.store %1699, %1701 : i64, !llvm.ptr
    cf.br ^bb339
    ^bb339:
    %1702 = llvm.load %1701 : !llvm.ptr -> i64
    %1703 = arith.constant 18 : i32
    %1705 = arith.extsi %1703 : i32 to i64
    %1704 = arith.cmpi sle, %1702, %1705 : i64
    cf.cond_br %1704, ^bb340, ^bb341
    ^bb340:
      %1706 = llvm.load %1701 : !llvm.ptr -> i64
      %1707 = llvm.load %1701 : !llvm.ptr -> i64
      %1708 = arith.muli %1706, %1707 : i64
      %1709 = llvm.load %1701 : !llvm.ptr -> i64
      %1710 = arith.muli %1708, %1709 : i64
      %1711 = llvm.mlir.addressof @A3 : !llvm.ptr
      %1712 = llvm.load %1711 : !llvm.ptr -> !llvm.ptr
      %1713 = llvm.load %1701 : !llvm.ptr -> i64
      %1714 = llvm.getelementptr %1712[%1713] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %1710, %1714 : i64, !llvm.ptr
      %1716 = llvm.mlir.addressof @A3 : !llvm.ptr
      %1717 = llvm.load %1716 : !llvm.ptr -> !llvm.ptr
      %1718 = llvm.load %1701 : !llvm.ptr -> i64
      %1719 = llvm.getelementptr %1717[%1718] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1715 = llvm.load %1719 : !llvm.ptr -> i64
      %1721 = llvm.mlir.addressof @A3 : !llvm.ptr
      %1722 = llvm.load %1721 : !llvm.ptr -> !llvm.ptr
      %1723 = llvm.load %1701 : !llvm.ptr -> i64
      %1724 = llvm.getelementptr %1722[%1723] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %1720 = llvm.load %1724 : !llvm.ptr -> i64
      %1725 = arith.muli %1715, %1720 : i64
      %1726 = llvm.mlir.addressof @A6 : !llvm.ptr
      %1727 = llvm.load %1726 : !llvm.ptr -> !llvm.ptr
      %1728 = llvm.load %1701 : !llvm.ptr -> i64
      %1729 = llvm.getelementptr %1727[%1728] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %1725, %1729 : i64, !llvm.ptr
      %1731 = arith.constant 8 : i32
      %1732 = arith.constant 8 : i32
      %1733 = arith.extsi %1731 : i32 to i64
      %1734 = arith.extsi %1732 : i32 to i64
      %1730 = func.call @calloc(%1733, %1734) : (i64, i64) -> !llvm.ptr
      %1736 = arith.constant 8 : i32
      %1737 = arith.constant 8 : i32
      %1738 = arith.extsi %1736 : i32 to i64
      %1739 = arith.extsi %1737 : i32 to i64
      %1735 = func.call @calloc(%1738, %1739) : (i64, i64) -> !llvm.ptr
      %1741 = llvm.load %1701 : !llvm.ptr -> i64
      %1740 = func.call @factor_into(%1741, %1730, %1735) : (i64, !llvm.ptr, !llvm.ptr) -> i64
      %1742 = llvm.mlir.addressof @FAC_AN : !llvm.ptr
      %1743 = llvm.load %1742 : !llvm.ptr -> !llvm.ptr
      %1744 = llvm.load %1701 : !llvm.ptr -> i64
      %1745 = llvm.getelementptr %1743[%1744] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %1740, %1745 : i64, !llvm.ptr
      %1746 = arith.constant 0 : i32
      %1747 = arith.extsi %1746 : i32 to i64
      %1748 = llvm.mlir.constant(1 : i64) : i64
      %1749 = llvm.alloca %1748 x i64 : (i64) -> !llvm.ptr
      llvm.store %1747, %1749 : i64, !llvm.ptr
      cf.br ^bb342
      ^bb342:
      %1750 = llvm.load %1749 : !llvm.ptr -> i64
      %1751 = arith.cmpi slt, %1750, %1740 : i64
      cf.cond_br %1751, ^bb343, ^bb344
      ^bb343:
        %1753 = llvm.load %1749 : !llvm.ptr -> i64
        %1754 = llvm.getelementptr %1730[%1753] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1752 = llvm.load %1754 : !llvm.ptr -> i64
        %1755 = llvm.mlir.addressof @FAC_A_P : !llvm.ptr
        %1756 = llvm.load %1755 : !llvm.ptr -> !llvm.ptr
        %1757 = llvm.load %1701 : !llvm.ptr -> i64
        %1758 = arith.constant 8 : i32
        %1760 = arith.extsi %1758 : i32 to i64
        %1759 = arith.muli %1757, %1760 : i64
        %1761 = llvm.load %1749 : !llvm.ptr -> i64
        %1762 = arith.addi %1759, %1761 : i64
        %1763 = llvm.getelementptr %1756[%1762] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1752, %1763 : i64, !llvm.ptr
        %1765 = llvm.load %1749 : !llvm.ptr -> i64
        %1766 = llvm.getelementptr %1735[%1765] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %1764 = llvm.load %1766 : !llvm.ptr -> i64
        %1767 = llvm.mlir.addressof @FAC_A_E : !llvm.ptr
        %1768 = llvm.load %1767 : !llvm.ptr -> !llvm.ptr
        %1769 = llvm.load %1701 : !llvm.ptr -> i64
        %1770 = arith.constant 8 : i32
        %1772 = arith.extsi %1770 : i32 to i64
        %1771 = arith.muli %1769, %1772 : i64
        %1773 = llvm.load %1749 : !llvm.ptr -> i64
        %1774 = arith.addi %1771, %1773 : i64
        %1775 = llvm.getelementptr %1768[%1774] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %1764, %1775 : i64, !llvm.ptr
        %1776 = llvm.load %1749 : !llvm.ptr -> i64
        %1777 = arith.constant 1 : i32
        %1779 = arith.extsi %1777 : i32 to i64
        %1778 = arith.addi %1776, %1779 : i64
        llvm.store %1778, %1749 : i64, !llvm.ptr
        cf.br ^bb342
      ^bb344:
      func.call @free(%1730) : (!llvm.ptr) -> ()
      func.call @free(%1735) : (!llvm.ptr) -> ()
      %1782 = llvm.load %1701 : !llvm.ptr -> i64
      %1783 = arith.constant 1 : i32
      %1785 = arith.extsi %1783 : i32 to i64
      %1784 = arith.addi %1782, %1785 : i64
      llvm.store %1784, %1701 : i64, !llvm.ptr
      cf.br ^bb339
    ^bb341:
    %1786 = arith.constant 0 : i32
    %1787 = arith.extsi %1786 : i32 to i64
    %1788 = llvm.mlir.constant(1 : i64) : i64
    %1789 = llvm.alloca %1788 x i64 : (i64) -> !llvm.ptr
    llvm.store %1787, %1789 : i64, !llvm.ptr
    %1790 = arith.constant 1 : i32
    %1791 = arith.extsi %1790 : i32 to i64
    llvm.store %1791, %1701 : i64, !llvm.ptr
    cf.br ^bb345
    ^bb345:
    %1792 = llvm.load %1701 : !llvm.ptr -> i64
    %1793 = arith.constant 18 : i32
    %1795 = arith.extsi %1793 : i32 to i64
    %1794 = arith.cmpi sle, %1792, %1795 : i64
    cf.cond_br %1794, ^bb346, ^bb347
    ^bb346:
      %1796 = arith.constant 1 : i32
      %1797 = arith.extsi %1796 : i32 to i64
      %1798 = llvm.mlir.constant(1 : i64) : i64
      %1799 = llvm.alloca %1798 x i64 : (i64) -> !llvm.ptr
      llvm.store %1797, %1799 : i64, !llvm.ptr
      cf.br ^bb348
      ^bb348:
      %1800 = llvm.load %1799 : !llvm.ptr -> i64
      %1801 = arith.constant 1900 : i32
      %1803 = arith.extsi %1801 : i32 to i64
      %1802 = arith.cmpi sle, %1800, %1803 : i64
      cf.cond_br %1802, ^bb349, ^bb350
      ^bb349:
        %1804 = llvm.load %1789 : !llvm.ptr -> i64
        %1806 = llvm.load %1701 : !llvm.ptr -> i64
        %1807 = llvm.load %1799 : !llvm.ptr -> i64
        %1805 = func.call @compute_G(%1806, %1807) : (i64, i64) -> i64
        %1808 = arith.addi %1804, %1805 : i64
        llvm.store %1808, %1789 : i64, !llvm.ptr
        %1809 = llvm.load %1799 : !llvm.ptr -> i64
        %1810 = arith.constant 1 : i32
        %1812 = arith.extsi %1810 : i32 to i64
        %1811 = arith.addi %1809, %1812 : i64
        llvm.store %1811, %1799 : i64, !llvm.ptr
        cf.br ^bb348
      ^bb350:
      %1813 = llvm.load %1701 : !llvm.ptr -> i64
      %1814 = arith.constant 1 : i32
      %1816 = arith.extsi %1814 : i32 to i64
      %1815 = arith.addi %1813, %1816 : i64
      llvm.store %1815, %1701 : i64, !llvm.ptr
      cf.br ^bb345
    ^bb347:
    %1817 = llvm.mlir.addressof @str_0 : !llvm.ptr
    %1818 = llvm.load %1789 : !llvm.ptr -> i64
    %1819 = llvm.call @printf(%1817, %1818) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
    %1821 = llvm.mlir.addressof @FAC_AN : !llvm.ptr
    %1822 = llvm.load %1821 : !llvm.ptr -> !llvm.ptr
    func.call @free(%1822) : (!llvm.ptr) -> ()
    %1824 = llvm.mlir.addressof @FAC_A_E : !llvm.ptr
    %1825 = llvm.load %1824 : !llvm.ptr -> !llvm.ptr
    func.call @free(%1825) : (!llvm.ptr) -> ()
    %1827 = llvm.mlir.addressof @FAC_A_P : !llvm.ptr
    %1828 = llvm.load %1827 : !llvm.ptr -> !llvm.ptr
    func.call @free(%1828) : (!llvm.ptr) -> ()
    %1830 = llvm.mlir.addressof @A6 : !llvm.ptr
    %1831 = llvm.load %1830 : !llvm.ptr -> !llvm.ptr
    func.call @free(%1831) : (!llvm.ptr) -> ()
    %1833 = llvm.mlir.addressof @A3 : !llvm.ptr
    %1834 = llvm.load %1833 : !llvm.ptr -> !llvm.ptr
    func.call @free(%1834) : (!llvm.ptr) -> ()
    %1836 = llvm.mlir.addressof @PRIMES : !llvm.ptr
    %1837 = llvm.load %1836 : !llvm.ptr -> !llvm.ptr
    func.call @free(%1837) : (!llvm.ptr) -> ()
    %1838 = arith.constant 0 : i32
    func.return %1838 : i32
  }
}