Problem 272

Sum of n <= 10^11 with C(n)=242.

Answer8495585919506151122
Output8495585919506151122
StatusPASS
Native helperno
Runtime80 ms
Peak memory26688 KB
Time complexityO(n^2) (estimated)
Space complexityO(n^2) (estimated)

Performance comparison

MetricOur solutionBest known
Time complexityO(n^2)O(n log log n)
Space complexityO(n^2)O(n)
ApproachFlow solutionSieve or enumeration
VerdictSuboptimal

Flow source

# Project Euler 272
# Sum of n <= 10^11 with C(n)=242.

import euler.nt { isqrt }

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

let mut G_primes: ptr<i64> = null
let mut G_L: i64 = 0
let mut G_min_prod: ptr<i64> = null
let mut G_pref: ptr<i64> = null
let mut G_N: i64 = 100000000000
let mut G_total: i64 = 0

function dfs(start: i64, remaining: i64, prod: i64) -> void {
    if remaining == 1 {
        let max_n: i64 = G_N / prod
        let mut j: i64 = start
        while j < G_L {
            let pj: i64 = G_primes[j]
            if pj > max_n { break }
            let mut powv: i64 = pj
            while powv <= max_n {
                let n0: i64 = prod * powv
                G_total = G_total + n0 * G_pref[G_N / n0]
                if powv > max_n / pj { break }
                powv = powv * pj
            }
            j = j + 1
        }
        return
    }
    let last: i64 = G_L - remaining
    let mut j: i64 = start
    while j <= last {
        let pj: i64 = G_primes[j]
        let mp: i64 = G_min_prod[(remaining - 1) * (G_L + 1) + (j + 1)]
        if prod > G_N / pj / mp { break }
        let max_pow: i64 = G_N / (prod * mp)
        let mut powv: i64 = pj
        while powv <= max_pow {
            dfs(j + 1, remaining - 1, prod * powv)
            if powv > max_pow / pj { break }
            powv = powv * pj
        }
        j = j + 1
    }
}

function sum_pick(rem: i64, pref: ptr<i64>, initial_prod: i64) -> i64 {
    G_pref = pref
    G_total = 0
    dfs(0, rem, initial_prod)
    return G_total
}

function main() -> i32 {
    let N: i64 = 100000000000
    G_N = N
    let max_good_prime: i64 = N / (9 * 7 * 13 * 19)
    let lim: i64 = max_good_prime
    let sieve: ptr<i8> = calloc(lim + 1, 1)
    let mut i: i64 = 0
    while i <= lim { sieve[i] = 1; i = i + 1 }
    sieve[0] = 0; sieve[1] = 0
    if lim >= 4 {
        i = 4
        while i <= lim { sieve[i] = 0; i = i + 2 }
    }
    let r: i64 = isqrt(lim)
    let mut p: i64 = 3
    while p <= r {
        if sieve[p] != 0 {
            let mut j: i64 = p * p
            while j <= lim {
                sieve[j] = 0
                j = j + 2 * p
            }
        }
        p = p + 2
    }
    let primes_all: ptr<i64> = calloc(lim / 5 + 10, 8)
    let mut pc: i64 = 0
    if lim >= 2 {
        primes_all[pc] = 2
        pc = pc + 1
    }
    i = 3
    while i <= lim {
        if sieve[i] != 0 {
            primes_all[pc] = i
            pc = pc + 1
        }
        i = i + 2
    }
    let primes: ptr<i64> = calloc(pc, 8)
    let mut L: i64 = 0
    i = 0
    while i < pc {
        if primes_all[i] % 3 == 1 {
            primes[L] = primes_all[i]
            L = L + 1
        }
        i = i + 1
    }
    G_primes = primes
    G_L = L

    let min_good_part: i64 = 9 * 7 * 13 * 19 * 31
    let b_limit_max: i64 = N / min_good_part
    let allow3: ptr<i8> = calloc(b_limit_max + 1, 1)
    let no3: ptr<i8> = calloc(b_limit_max + 1, 1)
    i = 0
    while i <= b_limit_max { allow3[i] = 1; i = i + 1 }
    allow3[0] = 0
    if b_limit_max >= 9 {
        i = 9
        while i <= b_limit_max { allow3[i] = 0; i = i + 9 }
    }
    i = 0
    while i < pc {
        let pr: i64 = primes_all[i]
        if pr % 3 == 1 {
            let mut j: i64 = pr
            while j <= b_limit_max {
                allow3[j] = 0
                j = j + pr
            }
        }
        i = i + 1
    }
    i = 0
    while i <= b_limit_max {
        no3[i] = allow3[i]
        i = i + 1
    }
    if b_limit_max >= 3 {
        i = 3
        while i <= b_limit_max { no3[i] = 0; i = i + 3 }
    }
    let pref_allow3: ptr<i64> = calloc(b_limit_max + 1, 8)
    let pref_no3: ptr<i64> = calloc(b_limit_max + 1, 8)
    let mut s1: i64 = 0
    let mut s2: i64 = 0
    i = 1
    while i <= b_limit_max {
        if allow3[i] != 0 { s1 = s1 + i }
        if no3[i] != 0 { s2 = s2 + i }
        pref_allow3[i] = s1
        pref_no3[i] = s2
        i = i + 1
    }

    G_min_prod = calloc(6 * (L + 1), 8)
    let mut kk: i64 = 1
    while kk <= 5 {
        G_min_prod[kk * (L + 1) + L] = N + 1
        kk = kk + 1
    }
    i = L - 1
    while i >= 0 {
        G_min_prod[0 * (L + 1) + i] = 1
        let pi: i64 = primes[i]
        kk = 1
        while kk <= 5 {
            let v: i64 = pi * G_min_prod[(kk - 1) * (L + 1) + (i + 1)]
            if v > N || G_min_prod[(kk - 1) * (L + 1) + (i + 1)] > N / pi {
                G_min_prod[kk * (L + 1) + i] = N + 1
            } else {
                G_min_prod[kk * (L + 1) + i] = v
            }
            kk = kk + 1
        }
        i = i - 1
    }

    let mut total: i64 = sum_pick(5, pref_allow3, 1)
    let mut p3: i64 = 9
    while p3 <= N / G_min_prod[4 * (L + 1) + 0] {
        total = total + sum_pick(4, pref_no3, p3)
        if p3 > N / 3 { break }
        p3 = p3 * 3
    }
    printf("%lld\n", total)
    return 0
}

Generated C

#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* Flow runtime helpers */
typedef struct flow_temp_node { struct flow_temp_node* next; } flow_temp_node;
static flow_temp_node* flow_temp_head = NULL;
static int flow_temp_atexit_set = 0;
__attribute__((unused)) static void flow_temp_free_all(void) {
    while (flow_temp_head) {
        flow_temp_node* n = flow_temp_head;
        flow_temp_head = n->next;
        free(n);
    }
}
__attribute__((unused)) static void* flow_temp_alloc(size_t nbytes) {
    flow_temp_node* node = (flow_temp_node*)malloc(sizeof(flow_temp_node) + nbytes);
    if (!node) return NULL;
    node->next = flow_temp_head;
    flow_temp_head = node;
    if (!flow_temp_atexit_set) {
        flow_temp_atexit_set = 1;
        atexit(flow_temp_free_all);
    }
    return (void*)(node + 1);
}
#ifndef FLOW_DIAG
#define FLOW_DIAG(msg) fprintf(stderr, "%s", (msg))
#endif
#ifndef FLOW_LOG
#define FLOW_LOG(fmt, ...) printf(fmt, __VA_ARGS__)
#endif
#ifndef FLOW_LOG_EMPTY
#define FLOW_LOG_EMPTY(fmt) printf(fmt)
#endif
static char* flow_strcat(const char* a, const char* b) {
    size_t la = strlen(a ? a : ""), lb = strlen(b ? b : "");
    char* r = (char*)flow_temp_alloc(la + lb + 1);
    if (!r) return NULL;
    if (la) memcpy(r, a, la);
    if (lb) memcpy(r + la, b, lb);
    r[la + lb] = '\0';
    return r;
}

#define __flow_in_arr(arr, val) __extension__ ({ \
    int _found = 0; \
    size_t _n = sizeof(arr)/sizeof((arr)[0]); \
    for (size_t _i = 0; _i < _n; _i++) { \
        if ((arr)[_i] == (val)) { _found = 1; break; } \
    } _found; })

/* Unified fault handler (MISRA #279) — override with -DFLOW_FAULT_HANDLER=fn */
#ifndef FLOW_FAULT_HANDLER
__attribute__((unused)) static inline void flow_fault_handler(const char* msg) {
    fprintf(stderr, "flow: %s\n", msg ? msg : "fault");
    abort();
#if defined(__GNUC__) || defined(__clang__)
    __builtin_unreachable();
#endif
}
#else
#define flow_fault_handler FLOW_FAULT_HANDLER
#endif
#define flow_div_by_zero_handler() flow_fault_handler("division by zero")
#define flow_shift_ub_handler() flow_fault_handler("invalid shift (amount out of range or left-shift of negative)")

#ifndef FLOW_CHECKED_DIV
#define FLOW_CHECKED_DIV(L, R) (((R) != 0) ? ((L) / (R)) : (flow_div_by_zero_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_MOD
#define FLOW_CHECKED_MOD(L, R) (((R) != 0) ? ((L) % (R)) : (flow_div_by_zero_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_SHL
#define FLOW_CHECKED_SHL(L, R) ((((R) >= 0) && ((unsigned long long)(R) < (sizeof(L) * 8ull)) && ((L) >= 0)) ? ((L) << (R)) : (flow_shift_ub_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_SHR
#define FLOW_CHECKED_SHR(L, R) ((((R) >= 0) && ((unsigned long long)(R) < (sizeof(L) * 8ull))) ? ((L) >> (R)) : (flow_shift_ub_handler(), (L) * 0))
#endif

#include <math.h>

void* _ui_state = NULL;

static inline float i32_to_f32(int32_t v) { return (float)v; }

/* Host stub for @gpu kernels (device codegen replaces this). */
static inline int32_t gpu_thread_id(void) { return 0; }

int64_t gcd_i64_i64(int64_t a0, int64_t b0);
int64_t lcm_i64_i64(int64_t a, int64_t b);
int64_t isqrt_i64(int64_t n);
int64_t mulmod_i64_i64_i64(int64_t a0, int64_t b0, int64_t mod);
int64_t mod_pow_i64_i64_i64(int64_t base, int64_t exp, int64_t mod);
bool is_prime_i64(int64_t n);
void dfs_i64_i64_i64(int64_t start, int64_t remaining, int64_t prod);
int64_t sum_pick_i64_ptr_i64_i64(int64_t rem, int64_t* pref, int64_t initial_prod);
int32_t main(void);

/* Module statics */
static int64_t* G_primes = NULL;
static int64_t G_L = 0;
static int64_t* G_min_prod = NULL;
static int64_t* G_pref = NULL;
static int64_t G_N = 100000000000;
static int64_t G_total = 0;

int64_t gcd_i64_i64(int64_t a0, int64_t b0) {
    int64_t a = a0;
    int64_t b = b0;
    while (b != 0) {
        int64_t t = FLOW_CHECKED_MOD((a), (b));
        a = b;
        b = t;
    }
    return a;
}

int64_t lcm_i64_i64(int64_t a, int64_t b) {
    if ((a == 0 || b == 0)) {
        return 0;
    }
    return (FLOW_CHECKED_DIV((a), (gcd_i64_i64(a, b))) * b);
}

int64_t isqrt_i64(int64_t n) {
    if (n < 2) {
        return n;
    }
    int64_t x = n;
    int64_t y = FLOW_CHECKED_DIV(((x + 1)), (2));
    while (y < x) {
        x = y;
        y = FLOW_CHECKED_DIV(((x + FLOW_CHECKED_DIV((n), (x)))), (2));
    }
    return x;
}

int64_t mulmod_i64_i64_i64(int64_t a0, int64_t b0, int64_t mod) {
    int64_t a = FLOW_CHECKED_MOD((a0), (mod));
    int64_t b = FLOW_CHECKED_MOD((b0), (mod));
    int64_t result = 0;
    while (b > 0) {
        if (FLOW_CHECKED_MOD((b), (2)) == 1) {
            result = FLOW_CHECKED_MOD(((result + a)), (mod));
        }
        a = FLOW_CHECKED_MOD(((a * 2)), (mod));
        b = FLOW_CHECKED_DIV((b), (2));
    }
    return result;
}

int64_t mod_pow_i64_i64_i64(int64_t base, int64_t exp, int64_t mod) {
    if (mod == 1) {
        return 0;
    }
    int64_t result = 1;
    int64_t b = FLOW_CHECKED_MOD((base), (mod));
    int64_t e = exp;
    while (e > 0) {
        if (FLOW_CHECKED_MOD((e), (2)) == 1) {
            result = mulmod_i64_i64_i64(result, b, mod);
        }
        b = mulmod_i64_i64_i64(b, b, mod);
        e = FLOW_CHECKED_DIV((e), (2));
    }
    return result;
}

bool is_prime_i64(int64_t n) {
    if (n < 2) {
        return 0;
    }
    if (n < 4) {
        return 1;
    }
    if ((FLOW_CHECKED_MOD((n), (2)) == 0 || FLOW_CHECKED_MOD((n), (3)) == 0)) {
        return 0;
    }
    int64_t i = 5;
    while ((i * i) <= n) {
        if ((FLOW_CHECKED_MOD((n), (i)) == 0 || FLOW_CHECKED_MOD((n), ((i + 2))) == 0)) {
            return 0;
        }
        i = (i + 6);
    }
    return 1;
}



void dfs_i64_i64_i64(int64_t start, int64_t remaining, int64_t prod) {
    if (remaining == 1) {
        int64_t max_n = FLOW_CHECKED_DIV((G_N), (prod));
        int64_t j = start;
        while (j < G_L) {
            int64_t pj = G_primes[j];
            if (pj > max_n) {
                break;
            }
            int64_t powv = pj;
            while (powv <= max_n) {
                int64_t n0 = (prod * powv);
                G_total = (G_total + (n0 * G_pref[FLOW_CHECKED_DIV((G_N), (n0))]));
                if (powv > FLOW_CHECKED_DIV((max_n), (pj))) {
                    break;
                }
                powv = (powv * pj);
            }
            j = (j + 1);
        }
        return;
    }
    int64_t last = (G_L - remaining);
    int64_t j = start;
    while (j <= last) {
        int64_t pj = G_primes[j];
        int64_t mp = G_min_prod[(((remaining - 1) * (G_L + 1)) + (j + 1))];
        if (prod > FLOW_CHECKED_DIV((FLOW_CHECKED_DIV((G_N), (pj))), (mp))) {
            break;
        }
        int64_t max_pow = FLOW_CHECKED_DIV((G_N), ((prod * mp)));
        int64_t powv = pj;
        while (powv <= max_pow) {
            dfs_i64_i64_i64((j + 1), (remaining - 1), (prod * powv));
            if (powv > FLOW_CHECKED_DIV((max_pow), (pj))) {
                break;
            }
            powv = (powv * pj);
        }
        j = (j + 1);
    }
}

int64_t sum_pick_i64_ptr_i64_i64(int64_t rem, int64_t* pref, int64_t initial_prod) {
    G_pref = pref;
    G_total = 0;
    dfs_i64_i64_i64(0, rem, initial_prod);
    return G_total;
}

int32_t main(void) {
    int64_t N = 100000000000;
    G_N = N;
    int64_t max_good_prime = FLOW_CHECKED_DIV((N), ((((9 * 7) * 13) * 19)));
    int64_t lim = max_good_prime;
    int8_t* sieve = (int8_t*)(calloc((lim + 1), 1));
    int64_t i = 0;
    while (i <= lim) {
        sieve[i] = 1;
        i = (i + 1);
    }
    sieve[0] = 0;
    sieve[1] = 0;
    if (lim >= 4) {
        i = 4;
        while (i <= lim) {
            sieve[i] = 0;
            i = (i + 2);
        }
    }
    int64_t r = isqrt_i64(lim);
    int64_t p = 3;
    while (p <= r) {
        if (sieve[p] != 0) {
            int64_t j = (p * p);
            while (j <= lim) {
                sieve[j] = 0;
                j = (j + (2 * p));
            }
        }
        p = (p + 2);
    }
    int64_t* primes_all = (int64_t*)(calloc((FLOW_CHECKED_DIV((lim), (5)) + 10), 8));
    int64_t pc = 0;
    if (lim >= 2) {
        primes_all[pc] = 2;
        pc = (pc + 1);
    }
    i = 3;
    while (i <= lim) {
        if (sieve[i] != 0) {
            primes_all[pc] = i;
            pc = (pc + 1);
        }
        i = (i + 2);
    }
    int64_t* primes = (int64_t*)(calloc(pc, 8));
    int64_t L = 0;
    i = 0;
    while (i < pc) {
        if (FLOW_CHECKED_MOD((primes_all[i]), (3)) == 1) {
            primes[L] = primes_all[i];
            L = (L + 1);
        }
        i = (i + 1);
    }
    G_primes = primes;
    G_L = L;
    int64_t min_good_part = ((((9 * 7) * 13) * 19) * 31);
    int64_t b_limit_max = FLOW_CHECKED_DIV((N), (min_good_part));
    int8_t* allow3 = (int8_t*)(calloc((b_limit_max + 1), 1));
    int8_t* no3 = (int8_t*)(calloc((b_limit_max + 1), 1));
    i = 0;
    while (i <= b_limit_max) {
        allow3[i] = 1;
        i = (i + 1);
    }
    allow3[0] = 0;
    if (b_limit_max >= 9) {
        i = 9;
        while (i <= b_limit_max) {
            allow3[i] = 0;
            i = (i + 9);
        }
    }
    i = 0;
    while (i < pc) {
        int64_t pr = primes_all[i];
        if (FLOW_CHECKED_MOD((pr), (3)) == 1) {
            int64_t j = pr;
            while (j <= b_limit_max) {
                allow3[j] = 0;
                j = (j + pr);
            }
        }
        i = (i + 1);
    }
    i = 0;
    while (i <= b_limit_max) {
        no3[i] = allow3[i];
        i = (i + 1);
    }
    if (b_limit_max >= 3) {
        i = 3;
        while (i <= b_limit_max) {
            no3[i] = 0;
            i = (i + 3);
        }
    }
    int64_t* pref_allow3 = (int64_t*)(calloc((b_limit_max + 1), 8));
    int64_t* pref_no3 = (int64_t*)(calloc((b_limit_max + 1), 8));
    int64_t s1 = 0;
    int64_t s2 = 0;
    i = 1;
    while (i <= b_limit_max) {
        if (allow3[i] != 0) {
            s1 = (s1 + i);
        }
        if (no3[i] != 0) {
            s2 = (s2 + i);
        }
        pref_allow3[i] = s1;
        pref_no3[i] = s2;
        i = (i + 1);
    }
    G_min_prod = calloc((6 * (L + 1)), 8);
    int64_t kk = 1;
    while (kk <= 5) {
        G_min_prod[((kk * (L + 1)) + L)] = (N + 1);
        kk = (kk + 1);
    }
    i = (L - 1);
    while (i >= 0) {
        G_min_prod[((0 * (L + 1)) + i)] = 1;
        int64_t pi = primes[i];
        kk = 1;
        while (kk <= 5) {
            int64_t v = (pi * G_min_prod[(((kk - 1) * (L + 1)) + (i + 1))]);
            if ((v > N || G_min_prod[(((kk - 1) * (L + 1)) + (i + 1))] > FLOW_CHECKED_DIV((N), (pi)))) {
                G_min_prod[((kk * (L + 1)) + i)] = (N + 1);
            } else {
                G_min_prod[((kk * (L + 1)) + i)] = v;
            }
            kk = (kk + 1);
        }
        i = (i - 1);
    }
    int64_t total = sum_pick_i64_ptr_i64_i64(5, pref_allow3, 1);
    int64_t p3 = 9;
    while (p3 <= FLOW_CHECKED_DIV((N), (G_min_prod[((4 * (L + 1)) + 0)]))) {
        total = (total + sum_pick_i64_ptr_i64_i64(4, pref_no3, p3));
        if (p3 > FLOW_CHECKED_DIV((N), (3))) {
            break;
        }
        p3 = (p3 * 3);
    }
    printf("%lld\n", total);
    return 0;
}

Generated MLIR

module {
  llvm.func @printf(!llvm.ptr, ...) -> i32
  llvm.mlir.global internal constant @str_0("%lld\n\00") {addr_space = 0 : i32} : !llvm.array<6 x i8>
  func.func @gcd(%arg0: i64, %arg1: i64) -> i64 {
    %0 = llvm.mlir.constant(1 : i64) : i64
    %1 = llvm.alloca %0 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %1 : i64, !llvm.ptr
    %2 = llvm.mlir.constant(1 : i64) : i64
    %3 = llvm.alloca %2 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg1, %3 : i64, !llvm.ptr
    cf.br ^bb0
    ^bb0:
    %4 = llvm.load %3 : !llvm.ptr -> i64
    %5 = arith.constant 0 : i32
    %7 = arith.extsi %5 : i32 to i64
    %6 = arith.cmpi ne, %4, %7 : i64
    cf.cond_br %6, ^bb1, ^bb2
    ^bb1:
      %8 = llvm.load %1 : !llvm.ptr -> i64
      %9 = llvm.load %3 : !llvm.ptr -> i64
      %10 = arith.remsi %8, %9 : i64
      %11 = llvm.load %3 : !llvm.ptr -> i64
      llvm.store %11, %1 : i64, !llvm.ptr
      llvm.store %10, %3 : i64, !llvm.ptr
      cf.br ^bb0
    ^bb2:
    %12 = llvm.load %1 : !llvm.ptr -> i64
    func.return %12 : i64
  }
  func.func @lcm(%arg0: i64, %arg1: i64) -> i64 {
    %13 = arith.constant 0 : i32
    %15 = arith.extsi %13 : i32 to i64
    %14 = arith.cmpi eq, %arg0, %15 : i64
    %16 = scf.if %14 -> (i1) {
      %17 = arith.constant true
      scf.yield %17 : i1
    } else {
      %18 = arith.constant 0 : i32
      %20 = arith.extsi %18 : i32 to i64
      %19 = arith.cmpi eq, %arg1, %20 : i64
      scf.yield %19 : i1
    }
    cf.cond_br %16, ^bb3, ^bb4
    ^bb3:
      %21 = arith.constant 0 : i32
      %22 = arith.extsi %21 : i32 to i64
      func.return %22 : i64
    ^bb4:
      cf.br ^bb5
    ^bb5:
    %23 = func.call @gcd(%arg0, %arg1) : (i64, i64) -> i64
    %24 = arith.divsi %arg0, %23 : i64
    %25 = arith.muli %24, %arg1 : i64
    func.return %25 : i64
  }
  func.func @isqrt(%arg0: i64) -> i64 {
    %26 = arith.constant 2 : i32
    %28 = arith.extsi %26 : i32 to i64
    %27 = arith.cmpi slt, %arg0, %28 : i64
    cf.cond_br %27, ^bb6, ^bb7
    ^bb6:
      func.return %arg0 : i64
    ^bb7:
      cf.br ^bb8
    ^bb8:
    %29 = llvm.mlir.constant(1 : i64) : i64
    %30 = llvm.alloca %29 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %30 : i64, !llvm.ptr
    %31 = llvm.load %30 : !llvm.ptr -> i64
    %32 = arith.constant 1 : i32
    %34 = arith.extsi %32 : i32 to i64
    %33 = arith.addi %31, %34 : i64
    %35 = arith.constant 2 : i32
    %37 = arith.extsi %35 : i32 to i64
    %36 = arith.divsi %33, %37 : i64
    %38 = llvm.mlir.constant(1 : i64) : i64
    %39 = llvm.alloca %38 x i64 : (i64) -> !llvm.ptr
    llvm.store %36, %39 : i64, !llvm.ptr
    cf.br ^bb9
    ^bb9:
    %40 = llvm.load %39 : !llvm.ptr -> i64
    %41 = llvm.load %30 : !llvm.ptr -> i64
    %42 = arith.cmpi slt, %40, %41 : i64
    cf.cond_br %42, ^bb10, ^bb11
    ^bb10:
      %43 = llvm.load %39 : !llvm.ptr -> i64
      llvm.store %43, %30 : i64, !llvm.ptr
      %44 = llvm.load %30 : !llvm.ptr -> i64
      %45 = llvm.load %30 : !llvm.ptr -> i64
      %46 = arith.divsi %arg0, %45 : i64
      %47 = arith.addi %44, %46 : i64
      %48 = arith.constant 2 : i32
      %50 = arith.extsi %48 : i32 to i64
      %49 = arith.divsi %47, %50 : i64
      llvm.store %49, %39 : i64, !llvm.ptr
      cf.br ^bb9
    ^bb11:
    %51 = llvm.load %30 : !llvm.ptr -> i64
    func.return %51 : i64
  }
  func.func @mulmod(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
    %52 = arith.remsi %arg0, %arg2 : i64
    %53 = llvm.mlir.constant(1 : i64) : i64
    %54 = llvm.alloca %53 x i64 : (i64) -> !llvm.ptr
    llvm.store %52, %54 : i64, !llvm.ptr
    %55 = arith.remsi %arg1, %arg2 : i64
    %56 = llvm.mlir.constant(1 : i64) : i64
    %57 = llvm.alloca %56 x i64 : (i64) -> !llvm.ptr
    llvm.store %55, %57 : i64, !llvm.ptr
    %58 = arith.constant 0 : i32
    %59 = arith.extsi %58 : i32 to i64
    %60 = llvm.mlir.constant(1 : i64) : i64
    %61 = llvm.alloca %60 x i64 : (i64) -> !llvm.ptr
    llvm.store %59, %61 : i64, !llvm.ptr
    cf.br ^bb12
    ^bb12:
    %62 = llvm.load %57 : !llvm.ptr -> i64
    %63 = arith.constant 0 : i32
    %65 = arith.extsi %63 : i32 to i64
    %64 = arith.cmpi sgt, %62, %65 : i64
    cf.cond_br %64, ^bb13, ^bb14
    ^bb13:
      %66 = llvm.load %57 : !llvm.ptr -> i64
      %67 = arith.constant 2 : i32
      %69 = arith.extsi %67 : i32 to i64
      %68 = arith.remsi %66, %69 : i64
      %70 = arith.constant 1 : i32
      %72 = arith.extsi %70 : i32 to i64
      %71 = arith.cmpi eq, %68, %72 : i64
      cf.cond_br %71, ^bb15, ^bb16
      ^bb15:
        %73 = llvm.load %61 : !llvm.ptr -> i64
        %74 = llvm.load %54 : !llvm.ptr -> i64
        %75 = arith.addi %73, %74 : i64
        %76 = arith.remsi %75, %arg2 : i64
        llvm.store %76, %61 : i64, !llvm.ptr
        cf.br ^bb17
      ^bb16:
        cf.br ^bb17
      ^bb17:
      %77 = llvm.load %54 : !llvm.ptr -> i64
      %78 = arith.constant 2 : i32
      %80 = arith.extsi %78 : i32 to i64
      %79 = arith.muli %77, %80 : i64
      %81 = arith.remsi %79, %arg2 : i64
      llvm.store %81, %54 : i64, !llvm.ptr
      %82 = llvm.load %57 : !llvm.ptr -> i64
      %83 = arith.constant 2 : i32
      %85 = arith.extsi %83 : i32 to i64
      %84 = arith.divsi %82, %85 : i64
      llvm.store %84, %57 : i64, !llvm.ptr
      cf.br ^bb12
    ^bb14:
    %86 = llvm.load %61 : !llvm.ptr -> i64
    func.return %86 : i64
  }
  func.func @mod_pow(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
    %87 = arith.constant 1 : i32
    %89 = arith.extsi %87 : i32 to i64
    %88 = arith.cmpi eq, %arg2, %89 : i64
    cf.cond_br %88, ^bb18, ^bb19
    ^bb18:
      %90 = arith.constant 0 : i32
      %91 = arith.extsi %90 : i32 to i64
      func.return %91 : i64
    ^bb19:
      cf.br ^bb20
    ^bb20:
    %92 = arith.constant 1 : i32
    %93 = arith.extsi %92 : i32 to i64
    %94 = llvm.mlir.constant(1 : i64) : i64
    %95 = llvm.alloca %94 x i64 : (i64) -> !llvm.ptr
    llvm.store %93, %95 : i64, !llvm.ptr
    %96 = arith.remsi %arg0, %arg2 : i64
    %97 = llvm.mlir.constant(1 : i64) : i64
    %98 = llvm.alloca %97 x i64 : (i64) -> !llvm.ptr
    llvm.store %96, %98 : i64, !llvm.ptr
    %99 = llvm.mlir.constant(1 : i64) : i64
    %100 = llvm.alloca %99 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg1, %100 : i64, !llvm.ptr
    cf.br ^bb21
    ^bb21:
    %101 = llvm.load %100 : !llvm.ptr -> i64
    %102 = arith.constant 0 : i32
    %104 = arith.extsi %102 : i32 to i64
    %103 = arith.cmpi sgt, %101, %104 : i64
    cf.cond_br %103, ^bb22, ^bb23
    ^bb22:
      %105 = llvm.load %100 : !llvm.ptr -> i64
      %106 = arith.constant 2 : i32
      %108 = arith.extsi %106 : i32 to i64
      %107 = arith.remsi %105, %108 : i64
      %109 = arith.constant 1 : i32
      %111 = arith.extsi %109 : i32 to i64
      %110 = arith.cmpi eq, %107, %111 : i64
      cf.cond_br %110, ^bb24, ^bb25
      ^bb24:
        %113 = llvm.load %95 : !llvm.ptr -> i64
        %114 = llvm.load %98 : !llvm.ptr -> i64
        %112 = func.call @mulmod(%113, %114, %arg2) : (i64, i64, i64) -> i64
        llvm.store %112, %95 : i64, !llvm.ptr
        cf.br ^bb26
      ^bb25:
        cf.br ^bb26
      ^bb26:
      %116 = llvm.load %98 : !llvm.ptr -> i64
      %117 = llvm.load %98 : !llvm.ptr -> i64
      %115 = func.call @mulmod(%116, %117, %arg2) : (i64, i64, i64) -> i64
      llvm.store %115, %98 : i64, !llvm.ptr
      %118 = llvm.load %100 : !llvm.ptr -> i64
      %119 = arith.constant 2 : i32
      %121 = arith.extsi %119 : i32 to i64
      %120 = arith.divsi %118, %121 : i64
      llvm.store %120, %100 : i64, !llvm.ptr
      cf.br ^bb21
    ^bb23:
    %122 = llvm.load %95 : !llvm.ptr -> i64
    func.return %122 : i64
  }
  func.func @is_prime(%arg0: i64) -> i1 {
    %123 = arith.constant 2 : i32
    %125 = arith.extsi %123 : i32 to i64
    %124 = arith.cmpi slt, %arg0, %125 : i64
    cf.cond_br %124, ^bb27, ^bb28
    ^bb27:
      %126 = arith.constant 0 : i1
      func.return %126 : i1
    ^bb28:
      cf.br ^bb29
    ^bb29:
    %127 = arith.constant 4 : i32
    %129 = arith.extsi %127 : i32 to i64
    %128 = arith.cmpi slt, %arg0, %129 : i64
    cf.cond_br %128, ^bb30, ^bb31
    ^bb30:
      %130 = arith.constant 1 : i1
      func.return %130 : i1
    ^bb31:
      cf.br ^bb32
    ^bb32:
    %131 = arith.constant 2 : i32
    %133 = arith.extsi %131 : i32 to i64
    %132 = arith.remsi %arg0, %133 : i64
    %134 = arith.constant 0 : i32
    %136 = arith.extsi %134 : i32 to i64
    %135 = arith.cmpi eq, %132, %136 : i64
    %137 = scf.if %135 -> (i1) {
      %138 = arith.constant true
      scf.yield %138 : i1
    } else {
      %139 = arith.constant 3 : i32
      %141 = arith.extsi %139 : i32 to i64
      %140 = arith.remsi %arg0, %141 : i64
      %142 = arith.constant 0 : i32
      %144 = arith.extsi %142 : i32 to i64
      %143 = arith.cmpi eq, %140, %144 : i64
      scf.yield %143 : i1
    }
    cf.cond_br %137, ^bb33, ^bb34
    ^bb33:
      %145 = arith.constant 0 : i1
      func.return %145 : i1
    ^bb34:
      cf.br ^bb35
    ^bb35:
    %146 = arith.constant 5 : i32
    %147 = arith.extsi %146 : i32 to i64
    %148 = llvm.mlir.constant(1 : i64) : i64
    %149 = llvm.alloca %148 x i64 : (i64) -> !llvm.ptr
    llvm.store %147, %149 : i64, !llvm.ptr
    cf.br ^bb36
    ^bb36:
    %150 = llvm.load %149 : !llvm.ptr -> i64
    %151 = llvm.load %149 : !llvm.ptr -> i64
    %152 = arith.muli %150, %151 : i64
    %153 = arith.cmpi sle, %152, %arg0 : i64
    cf.cond_br %153, ^bb37, ^bb38
    ^bb37:
      %154 = llvm.load %149 : !llvm.ptr -> i64
      %155 = arith.remsi %arg0, %154 : i64
      %156 = arith.constant 0 : i32
      %158 = arith.extsi %156 : i32 to i64
      %157 = arith.cmpi eq, %155, %158 : i64
      %159 = scf.if %157 -> (i1) {
        %160 = arith.constant true
        scf.yield %160 : i1
      } else {
        %161 = llvm.load %149 : !llvm.ptr -> i64
        %162 = arith.constant 2 : i32
        %164 = arith.extsi %162 : i32 to i64
        %163 = arith.addi %161, %164 : i64
        %165 = arith.remsi %arg0, %163 : i64
        %166 = arith.constant 0 : i32
        %168 = arith.extsi %166 : i32 to i64
        %167 = arith.cmpi eq, %165, %168 : i64
        scf.yield %167 : i1
      }
      cf.cond_br %159, ^bb39, ^bb40
      ^bb39:
        %169 = arith.constant 0 : i1
        func.return %169 : i1
      ^bb40:
        cf.br ^bb41
      ^bb41:
      %170 = llvm.load %149 : !llvm.ptr -> i64
      %171 = arith.constant 6 : i32
      %173 = arith.extsi %171 : i32 to i64
      %172 = arith.addi %170, %173 : i64
      llvm.store %172, %149 : i64, !llvm.ptr
      cf.br ^bb36
    ^bb38:
    %174 = arith.constant 1 : i1
    func.return %174 : i1
  }
  func.func private @calloc(i64, i64) -> !llvm.ptr
  func.func private @free(!llvm.ptr) -> ()
  // Module static: G_primes
  llvm.mlir.global internal @G_primes() {addr_space = 0 : i32} : !llvm.ptr {
    %175 = llvm.mlir.zero : !llvm.ptr
    llvm.return %175 : !llvm.ptr
  }
  // Module static: G_L
  llvm.mlir.global internal @G_L(0 : i64) : i64
  // Module static: G_min_prod
  llvm.mlir.global internal @G_min_prod() {addr_space = 0 : i32} : !llvm.ptr {
    %176 = llvm.mlir.zero : !llvm.ptr
    llvm.return %176 : !llvm.ptr
  }
  // Module static: G_pref
  llvm.mlir.global internal @G_pref() {addr_space = 0 : i32} : !llvm.ptr {
    %177 = llvm.mlir.zero : !llvm.ptr
    llvm.return %177 : !llvm.ptr
  }
  // Module static: G_N
  llvm.mlir.global internal @G_N(100000000000 : i64) : i64
  // Module static: G_total
  llvm.mlir.global internal @G_total(0 : i64) : i64
  func.func @dfs(%arg0: i64, %arg1: i64, %arg2: i64) -> () {
    %178 = arith.constant 1 : i32
    %180 = arith.extsi %178 : i32 to i64
    %179 = arith.cmpi eq, %arg1, %180 : i64
    cf.cond_br %179, ^bb42, ^bb43
    ^bb42:
      %181 = llvm.mlir.addressof @G_N : !llvm.ptr
      %182 = llvm.load %181 : !llvm.ptr -> i64
      %183 = arith.divsi %182, %arg2 : i64
      %184 = llvm.mlir.constant(1 : i64) : i64
      %185 = llvm.alloca %184 x i64 : (i64) -> !llvm.ptr
      llvm.store %arg0, %185 : i64, !llvm.ptr
      cf.br ^bb45
      ^bb45:
      %186 = llvm.load %185 : !llvm.ptr -> i64
      %187 = llvm.mlir.addressof @G_L : !llvm.ptr
      %188 = llvm.load %187 : !llvm.ptr -> i64
      %189 = arith.cmpi slt, %186, %188 : i64
      cf.cond_br %189, ^bb46, ^bb47
      ^bb46:
        %191 = llvm.mlir.addressof @G_primes : !llvm.ptr
        %192 = llvm.load %191 : !llvm.ptr -> !llvm.ptr
        %193 = llvm.load %185 : !llvm.ptr -> i64
        %194 = llvm.getelementptr %192[%193] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %190 = llvm.load %194 : !llvm.ptr -> i64
        %195 = arith.cmpi sgt, %190, %183 : i64
        cf.cond_br %195, ^bb48, ^bb49
        ^bb48:
          cf.br ^bb47
        ^bb49:
          cf.br ^bb50
        ^bb50:
        %196 = llvm.mlir.constant(1 : i64) : i64
        %197 = llvm.alloca %196 x i64 : (i64) -> !llvm.ptr
        llvm.store %190, %197 : i64, !llvm.ptr
        cf.br ^bb51
        ^bb51:
        %198 = llvm.load %197 : !llvm.ptr -> i64
        %199 = arith.cmpi sle, %198, %183 : i64
        cf.cond_br %199, ^bb52, ^bb53
        ^bb52:
          %200 = llvm.load %197 : !llvm.ptr -> i64
          %201 = arith.muli %arg2, %200 : i64
          %202 = llvm.mlir.addressof @G_total : !llvm.ptr
          %203 = llvm.load %202 : !llvm.ptr -> i64
          %205 = llvm.mlir.addressof @G_pref : !llvm.ptr
          %206 = llvm.load %205 : !llvm.ptr -> !llvm.ptr
          %207 = llvm.mlir.addressof @G_N : !llvm.ptr
          %208 = llvm.load %207 : !llvm.ptr -> i64
          %209 = arith.divsi %208, %201 : i64
          %210 = llvm.getelementptr %206[%209] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %204 = llvm.load %210 : !llvm.ptr -> i64
          %211 = arith.muli %201, %204 : i64
          %212 = arith.addi %203, %211 : i64
          %213 = llvm.mlir.addressof @G_total : !llvm.ptr
          llvm.store %212, %213 : i64, !llvm.ptr
          %214 = llvm.load %197 : !llvm.ptr -> i64
          %215 = arith.divsi %183, %190 : i64
          %216 = arith.cmpi sgt, %214, %215 : i64
          cf.cond_br %216, ^bb54, ^bb55
          ^bb54:
            cf.br ^bb53
          ^bb55:
            cf.br ^bb56
          ^bb56:
          %217 = llvm.load %197 : !llvm.ptr -> i64
          %218 = arith.muli %217, %190 : i64
          llvm.store %218, %197 : i64, !llvm.ptr
          cf.br ^bb51
        ^bb53:
        %219 = llvm.load %185 : !llvm.ptr -> i64
        %220 = arith.constant 1 : i32
        %222 = arith.extsi %220 : i32 to i64
        %221 = arith.addi %219, %222 : i64
        llvm.store %221, %185 : i64, !llvm.ptr
        cf.br ^bb45
      ^bb47:
      func.return
    ^bb43:
      cf.br ^bb44
    ^bb44:
    %223 = llvm.mlir.addressof @G_L : !llvm.ptr
    %224 = llvm.load %223 : !llvm.ptr -> i64
    %225 = arith.subi %224, %arg1 : i64
    %226 = llvm.mlir.constant(1 : i64) : i64
    %227 = llvm.alloca %226 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %227 : i64, !llvm.ptr
    cf.br ^bb57
    ^bb57:
    %228 = llvm.load %227 : !llvm.ptr -> i64
    %229 = arith.cmpi sle, %228, %225 : i64
    cf.cond_br %229, ^bb58, ^bb59
    ^bb58:
      %231 = llvm.mlir.addressof @G_primes : !llvm.ptr
      %232 = llvm.load %231 : !llvm.ptr -> !llvm.ptr
      %233 = llvm.load %227 : !llvm.ptr -> i64
      %234 = llvm.getelementptr %232[%233] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %230 = llvm.load %234 : !llvm.ptr -> i64
      %236 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
      %237 = llvm.load %236 : !llvm.ptr -> !llvm.ptr
      %238 = arith.constant 1 : i32
      %240 = arith.extsi %238 : i32 to i64
      %239 = arith.subi %arg1, %240 : i64
      %241 = llvm.mlir.addressof @G_L : !llvm.ptr
      %242 = llvm.load %241 : !llvm.ptr -> i64
      %243 = arith.constant 1 : i32
      %245 = arith.extsi %243 : i32 to i64
      %244 = arith.addi %242, %245 : i64
      %246 = arith.muli %239, %244 : i64
      %247 = llvm.load %227 : !llvm.ptr -> i64
      %248 = arith.constant 1 : i32
      %250 = arith.extsi %248 : i32 to i64
      %249 = arith.addi %247, %250 : i64
      %251 = arith.addi %246, %249 : i64
      %252 = llvm.getelementptr %237[%251] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %235 = llvm.load %252 : !llvm.ptr -> i64
      %253 = llvm.mlir.addressof @G_N : !llvm.ptr
      %254 = llvm.load %253 : !llvm.ptr -> i64
      %255 = arith.divsi %254, %230 : i64
      %256 = arith.divsi %255, %235 : i64
      %257 = arith.cmpi sgt, %arg2, %256 : i64
      cf.cond_br %257, ^bb60, ^bb61
      ^bb60:
        cf.br ^bb59
      ^bb61:
        cf.br ^bb62
      ^bb62:
      %258 = llvm.mlir.addressof @G_N : !llvm.ptr
      %259 = llvm.load %258 : !llvm.ptr -> i64
      %260 = arith.muli %arg2, %235 : i64
      %261 = arith.divsi %259, %260 : i64
      %262 = llvm.mlir.constant(1 : i64) : i64
      %263 = llvm.alloca %262 x i64 : (i64) -> !llvm.ptr
      llvm.store %230, %263 : i64, !llvm.ptr
      cf.br ^bb63
      ^bb63:
      %264 = llvm.load %263 : !llvm.ptr -> i64
      %265 = arith.cmpi sle, %264, %261 : i64
      cf.cond_br %265, ^bb64, ^bb65
      ^bb64:
        %267 = llvm.load %227 : !llvm.ptr -> i64
        %268 = arith.constant 1 : i32
        %270 = arith.extsi %268 : i32 to i64
        %269 = arith.addi %267, %270 : i64
        %271 = arith.constant 1 : i32
        %273 = arith.extsi %271 : i32 to i64
        %272 = arith.subi %arg1, %273 : i64
        %274 = llvm.load %263 : !llvm.ptr -> i64
        %275 = arith.muli %arg2, %274 : i64
        func.call @dfs(%269, %272, %275) : (i64, i64, i64) -> ()
        %276 = llvm.load %263 : !llvm.ptr -> i64
        %277 = arith.divsi %261, %230 : i64
        %278 = arith.cmpi sgt, %276, %277 : i64
        cf.cond_br %278, ^bb66, ^bb67
        ^bb66:
          cf.br ^bb65
        ^bb67:
          cf.br ^bb68
        ^bb68:
        %279 = llvm.load %263 : !llvm.ptr -> i64
        %280 = arith.muli %279, %230 : i64
        llvm.store %280, %263 : i64, !llvm.ptr
        cf.br ^bb63
      ^bb65:
      %281 = llvm.load %227 : !llvm.ptr -> i64
      %282 = arith.constant 1 : i32
      %284 = arith.extsi %282 : i32 to i64
      %283 = arith.addi %281, %284 : i64
      llvm.store %283, %227 : i64, !llvm.ptr
      cf.br ^bb57
    ^bb59:
    func.return
  }
  func.func @sum_pick(%arg0: i64, %arg1: !llvm.ptr, %arg2: i64) -> i64 {
    %285 = llvm.mlir.addressof @G_pref : !llvm.ptr
    llvm.store %arg1, %285 : !llvm.ptr, !llvm.ptr
    %286 = arith.constant 0 : i32
    %287 = arith.extsi %286 : i32 to i64
    %288 = llvm.mlir.addressof @G_total : !llvm.ptr
    llvm.store %287, %288 : i64, !llvm.ptr
    %290 = arith.constant 0 : i32
    %291 = arith.extsi %290 : i32 to i64
    func.call @dfs(%291, %arg0, %arg2) : (i64, i64, i64) -> ()
    %292 = llvm.mlir.addressof @G_total : !llvm.ptr
    %293 = llvm.load %292 : !llvm.ptr -> i64
    func.return %293 : i64
  }
  func.func @main() -> i32 {
    %294 = arith.constant 95705032704 : i32
    %295 = arith.extsi %294 : i32 to i64
    %296 = llvm.mlir.addressof @G_N : !llvm.ptr
    llvm.store %295, %296 : i64, !llvm.ptr
    %297 = arith.constant 9 : i32
    %298 = arith.constant 7 : i32
    %299 = arith.muli %297, %298 : i32
    %300 = arith.constant 13 : i32
    %301 = arith.muli %299, %300 : i32
    %302 = arith.constant 19 : i32
    %303 = arith.muli %301, %302 : i32
    %305 = arith.extsi %303 : i32 to i64
    %304 = arith.divsi %295, %305 : i64
    %307 = arith.constant 1 : i32
    %309 = arith.extsi %307 : i32 to i64
    %308 = arith.addi %304, %309 : i64
    %310 = arith.constant 1 : i32
    %311 = arith.extsi %310 : i32 to i64
    %306 = func.call @calloc(%308, %311) : (i64, i64) -> !llvm.ptr
    %312 = arith.constant 0 : i32
    %313 = arith.extsi %312 : i32 to i64
    %314 = llvm.mlir.constant(1 : i64) : i64
    %315 = llvm.alloca %314 x i64 : (i64) -> !llvm.ptr
    llvm.store %313, %315 : i64, !llvm.ptr
    cf.br ^bb69
    ^bb69:
    %316 = llvm.load %315 : !llvm.ptr -> i64
    %317 = arith.cmpi sle, %316, %304 : i64
    cf.cond_br %317, ^bb70, ^bb71
    ^bb70:
      %318 = arith.constant 1 : i32
      %319 = llvm.load %315 : !llvm.ptr -> i64
      %320 = arith.trunci %318 : i32 to i8
      %321 = llvm.getelementptr %306[%319] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      llvm.store %320, %321 : i8, !llvm.ptr
      %322 = llvm.load %315 : !llvm.ptr -> i64
      %323 = arith.constant 1 : i32
      %325 = arith.extsi %323 : i32 to i64
      %324 = arith.addi %322, %325 : i64
      llvm.store %324, %315 : i64, !llvm.ptr
      cf.br ^bb69
    ^bb71:
    %326 = arith.constant 0 : i32
    %327 = arith.constant 0 : i32
    %328 = arith.trunci %326 : i32 to i8
    %329 = arith.extsi %327 : i32 to i64
    %330 = llvm.getelementptr %306[%329] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %328, %330 : i8, !llvm.ptr
    %331 = arith.constant 0 : i32
    %332 = arith.constant 1 : i32
    %333 = arith.trunci %331 : i32 to i8
    %334 = arith.extsi %332 : i32 to i64
    %335 = llvm.getelementptr %306[%334] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %333, %335 : i8, !llvm.ptr
    %336 = arith.constant 4 : i32
    %338 = arith.extsi %336 : i32 to i64
    %337 = arith.cmpi sge, %304, %338 : i64
    cf.cond_br %337, ^bb72, ^bb73
    ^bb72:
      %339 = arith.constant 4 : i32
      %340 = arith.extsi %339 : i32 to i64
      llvm.store %340, %315 : i64, !llvm.ptr
      cf.br ^bb75
      ^bb75:
      %341 = llvm.load %315 : !llvm.ptr -> i64
      %342 = arith.cmpi sle, %341, %304 : i64
      cf.cond_br %342, ^bb76, ^bb77
      ^bb76:
        %343 = arith.constant 0 : i32
        %344 = llvm.load %315 : !llvm.ptr -> i64
        %345 = arith.trunci %343 : i32 to i8
        %346 = llvm.getelementptr %306[%344] : (!llvm.ptr, i64) -> !llvm.ptr, i8
        llvm.store %345, %346 : i8, !llvm.ptr
        %347 = llvm.load %315 : !llvm.ptr -> i64
        %348 = arith.constant 2 : i32
        %350 = arith.extsi %348 : i32 to i64
        %349 = arith.addi %347, %350 : i64
        llvm.store %349, %315 : i64, !llvm.ptr
        cf.br ^bb75
      ^bb77:
      cf.br ^bb74
    ^bb73:
      cf.br ^bb74
    ^bb74:
    %351 = func.call @isqrt(%304) : (i64) -> i64
    %352 = arith.constant 3 : i32
    %353 = arith.extsi %352 : i32 to i64
    %354 = llvm.mlir.constant(1 : i64) : i64
    %355 = llvm.alloca %354 x i64 : (i64) -> !llvm.ptr
    llvm.store %353, %355 : i64, !llvm.ptr
    cf.br ^bb78
    ^bb78:
    %356 = llvm.load %355 : !llvm.ptr -> i64
    %357 = arith.cmpi sle, %356, %351 : i64
    cf.cond_br %357, ^bb79, ^bb80
    ^bb79:
      %359 = llvm.load %355 : !llvm.ptr -> i64
      %360 = llvm.getelementptr %306[%359] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %358 = llvm.load %360 : !llvm.ptr -> i8
      %361 = arith.constant 0 : i32
      %363 = arith.extsi %358 : i8 to i32
      %362 = arith.cmpi ne, %363, %361 : i32
      cf.cond_br %362, ^bb81, ^bb82
      ^bb81:
        %364 = llvm.load %355 : !llvm.ptr -> i64
        %365 = llvm.load %355 : !llvm.ptr -> i64
        %366 = arith.muli %364, %365 : i64
        %367 = llvm.mlir.constant(1 : i64) : i64
        %368 = llvm.alloca %367 x i64 : (i64) -> !llvm.ptr
        llvm.store %366, %368 : i64, !llvm.ptr
        cf.br ^bb84
        ^bb84:
        %369 = llvm.load %368 : !llvm.ptr -> i64
        %370 = arith.cmpi sle, %369, %304 : i64
        cf.cond_br %370, ^bb85, ^bb86
        ^bb85:
          %371 = arith.constant 0 : i32
          %372 = llvm.load %368 : !llvm.ptr -> i64
          %373 = arith.trunci %371 : i32 to i8
          %374 = llvm.getelementptr %306[%372] : (!llvm.ptr, i64) -> !llvm.ptr, i8
          llvm.store %373, %374 : i8, !llvm.ptr
          %375 = llvm.load %368 : !llvm.ptr -> i64
          %376 = arith.constant 2 : i32
          %377 = llvm.load %355 : !llvm.ptr -> i64
          %379 = arith.extsi %376 : i32 to i64
          %378 = arith.muli %379, %377 : i64
          %380 = arith.addi %375, %378 : i64
          llvm.store %380, %368 : i64, !llvm.ptr
          cf.br ^bb84
        ^bb86:
        cf.br ^bb83
      ^bb82:
        cf.br ^bb83
      ^bb83:
      %381 = llvm.load %355 : !llvm.ptr -> i64
      %382 = arith.constant 2 : i32
      %384 = arith.extsi %382 : i32 to i64
      %383 = arith.addi %381, %384 : i64
      llvm.store %383, %355 : i64, !llvm.ptr
      cf.br ^bb78
    ^bb80:
    %386 = arith.constant 5 : i32
    %388 = arith.extsi %386 : i32 to i64
    %387 = arith.divsi %304, %388 : i64
    %389 = arith.constant 10 : i32
    %391 = arith.extsi %389 : i32 to i64
    %390 = arith.addi %387, %391 : i64
    %392 = arith.constant 8 : i32
    %393 = arith.extsi %392 : i32 to i64
    %385 = func.call @calloc(%390, %393) : (i64, i64) -> !llvm.ptr
    %394 = arith.constant 0 : i32
    %395 = arith.extsi %394 : i32 to i64
    %396 = llvm.mlir.constant(1 : i64) : i64
    %397 = llvm.alloca %396 x i64 : (i64) -> !llvm.ptr
    llvm.store %395, %397 : i64, !llvm.ptr
    %398 = arith.constant 2 : i32
    %400 = arith.extsi %398 : i32 to i64
    %399 = arith.cmpi sge, %304, %400 : i64
    cf.cond_br %399, ^bb87, ^bb88
    ^bb87:
      %401 = arith.constant 2 : i32
      %402 = llvm.load %397 : !llvm.ptr -> i64
      %403 = arith.extsi %401 : i32 to i64
      %404 = llvm.getelementptr %385[%402] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %403, %404 : i64, !llvm.ptr
      %405 = llvm.load %397 : !llvm.ptr -> i64
      %406 = arith.constant 1 : i32
      %408 = arith.extsi %406 : i32 to i64
      %407 = arith.addi %405, %408 : i64
      llvm.store %407, %397 : i64, !llvm.ptr
      cf.br ^bb89
    ^bb88:
      cf.br ^bb89
    ^bb89:
    %409 = arith.constant 3 : i32
    %410 = arith.extsi %409 : i32 to i64
    llvm.store %410, %315 : i64, !llvm.ptr
    cf.br ^bb90
    ^bb90:
    %411 = llvm.load %315 : !llvm.ptr -> i64
    %412 = arith.cmpi sle, %411, %304 : i64
    cf.cond_br %412, ^bb91, ^bb92
    ^bb91:
      %414 = llvm.load %315 : !llvm.ptr -> i64
      %415 = llvm.getelementptr %306[%414] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %413 = llvm.load %415 : !llvm.ptr -> i8
      %416 = arith.constant 0 : i32
      %418 = arith.extsi %413 : i8 to i32
      %417 = arith.cmpi ne, %418, %416 : i32
      cf.cond_br %417, ^bb93, ^bb94
      ^bb93:
        %419 = llvm.load %315 : !llvm.ptr -> i64
        %420 = llvm.load %397 : !llvm.ptr -> i64
        %421 = llvm.getelementptr %385[%420] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %419, %421 : i64, !llvm.ptr
        %422 = llvm.load %397 : !llvm.ptr -> i64
        %423 = arith.constant 1 : i32
        %425 = arith.extsi %423 : i32 to i64
        %424 = arith.addi %422, %425 : i64
        llvm.store %424, %397 : i64, !llvm.ptr
        cf.br ^bb95
      ^bb94:
        cf.br ^bb95
      ^bb95:
      %426 = llvm.load %315 : !llvm.ptr -> i64
      %427 = arith.constant 2 : i32
      %429 = arith.extsi %427 : i32 to i64
      %428 = arith.addi %426, %429 : i64
      llvm.store %428, %315 : i64, !llvm.ptr
      cf.br ^bb90
    ^bb92:
    %431 = llvm.load %397 : !llvm.ptr -> i64
    %432 = arith.constant 8 : i32
    %433 = arith.extsi %432 : i32 to i64
    %430 = func.call @calloc(%431, %433) : (i64, i64) -> !llvm.ptr
    %434 = arith.constant 0 : i32
    %435 = arith.extsi %434 : i32 to i64
    %436 = llvm.mlir.constant(1 : i64) : i64
    %437 = llvm.alloca %436 x i64 : (i64) -> !llvm.ptr
    llvm.store %435, %437 : i64, !llvm.ptr
    %438 = arith.constant 0 : i32
    %439 = arith.extsi %438 : i32 to i64
    llvm.store %439, %315 : i64, !llvm.ptr
    cf.br ^bb96
    ^bb96:
    %440 = llvm.load %315 : !llvm.ptr -> i64
    %441 = llvm.load %397 : !llvm.ptr -> i64
    %442 = arith.cmpi slt, %440, %441 : i64
    cf.cond_br %442, ^bb97, ^bb98
    ^bb97:
      %444 = llvm.load %315 : !llvm.ptr -> i64
      %445 = llvm.getelementptr %385[%444] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %443 = llvm.load %445 : !llvm.ptr -> i64
      %446 = arith.constant 3 : i32
      %448 = arith.extsi %446 : i32 to i64
      %447 = arith.remsi %443, %448 : i64
      %449 = arith.constant 1 : i32
      %451 = arith.extsi %449 : i32 to i64
      %450 = arith.cmpi eq, %447, %451 : i64
      cf.cond_br %450, ^bb99, ^bb100
      ^bb99:
        %453 = llvm.load %315 : !llvm.ptr -> i64
        %454 = llvm.getelementptr %385[%453] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %452 = llvm.load %454 : !llvm.ptr -> i64
        %455 = llvm.load %437 : !llvm.ptr -> i64
        %456 = llvm.getelementptr %430[%455] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %452, %456 : i64, !llvm.ptr
        %457 = llvm.load %437 : !llvm.ptr -> i64
        %458 = arith.constant 1 : i32
        %460 = arith.extsi %458 : i32 to i64
        %459 = arith.addi %457, %460 : i64
        llvm.store %459, %437 : i64, !llvm.ptr
        cf.br ^bb101
      ^bb100:
        cf.br ^bb101
      ^bb101:
      %461 = llvm.load %315 : !llvm.ptr -> i64
      %462 = arith.constant 1 : i32
      %464 = arith.extsi %462 : i32 to i64
      %463 = arith.addi %461, %464 : i64
      llvm.store %463, %315 : i64, !llvm.ptr
      cf.br ^bb96
    ^bb98:
    %465 = llvm.mlir.addressof @G_primes : !llvm.ptr
    llvm.store %430, %465 : !llvm.ptr, !llvm.ptr
    %466 = llvm.load %437 : !llvm.ptr -> i64
    %467 = llvm.mlir.addressof @G_L : !llvm.ptr
    llvm.store %466, %467 : i64, !llvm.ptr
    %468 = arith.constant 9 : i32
    %469 = arith.constant 7 : i32
    %470 = arith.muli %468, %469 : i32
    %471 = arith.constant 13 : i32
    %472 = arith.muli %470, %471 : i32
    %473 = arith.constant 19 : i32
    %474 = arith.muli %472, %473 : i32
    %475 = arith.constant 31 : i32
    %476 = arith.muli %474, %475 : i32
    %477 = arith.extsi %476 : i32 to i64
    %478 = arith.divsi %295, %477 : i64
    %480 = arith.constant 1 : i32
    %482 = arith.extsi %480 : i32 to i64
    %481 = arith.addi %478, %482 : i64
    %483 = arith.constant 1 : i32
    %484 = arith.extsi %483 : i32 to i64
    %479 = func.call @calloc(%481, %484) : (i64, i64) -> !llvm.ptr
    %486 = arith.constant 1 : i32
    %488 = arith.extsi %486 : i32 to i64
    %487 = arith.addi %478, %488 : i64
    %489 = arith.constant 1 : i32
    %490 = arith.extsi %489 : i32 to i64
    %485 = func.call @calloc(%487, %490) : (i64, i64) -> !llvm.ptr
    %491 = arith.constant 0 : i32
    %492 = arith.extsi %491 : i32 to i64
    llvm.store %492, %315 : i64, !llvm.ptr
    cf.br ^bb102
    ^bb102:
    %493 = llvm.load %315 : !llvm.ptr -> i64
    %494 = arith.cmpi sle, %493, %478 : i64
    cf.cond_br %494, ^bb103, ^bb104
    ^bb103:
      %495 = arith.constant 1 : i32
      %496 = llvm.load %315 : !llvm.ptr -> i64
      %497 = arith.trunci %495 : i32 to i8
      %498 = llvm.getelementptr %479[%496] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      llvm.store %497, %498 : i8, !llvm.ptr
      %499 = llvm.load %315 : !llvm.ptr -> i64
      %500 = arith.constant 1 : i32
      %502 = arith.extsi %500 : i32 to i64
      %501 = arith.addi %499, %502 : i64
      llvm.store %501, %315 : i64, !llvm.ptr
      cf.br ^bb102
    ^bb104:
    %503 = arith.constant 0 : i32
    %504 = arith.constant 0 : i32
    %505 = arith.trunci %503 : i32 to i8
    %506 = arith.extsi %504 : i32 to i64
    %507 = llvm.getelementptr %479[%506] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %505, %507 : i8, !llvm.ptr
    %508 = arith.constant 9 : i32
    %510 = arith.extsi %508 : i32 to i64
    %509 = arith.cmpi sge, %478, %510 : i64
    cf.cond_br %509, ^bb105, ^bb106
    ^bb105:
      %511 = arith.constant 9 : i32
      %512 = arith.extsi %511 : i32 to i64
      llvm.store %512, %315 : i64, !llvm.ptr
      cf.br ^bb108
      ^bb108:
      %513 = llvm.load %315 : !llvm.ptr -> i64
      %514 = arith.cmpi sle, %513, %478 : i64
      cf.cond_br %514, ^bb109, ^bb110
      ^bb109:
        %515 = arith.constant 0 : i32
        %516 = llvm.load %315 : !llvm.ptr -> i64
        %517 = arith.trunci %515 : i32 to i8
        %518 = llvm.getelementptr %479[%516] : (!llvm.ptr, i64) -> !llvm.ptr, i8
        llvm.store %517, %518 : i8, !llvm.ptr
        %519 = llvm.load %315 : !llvm.ptr -> i64
        %520 = arith.constant 9 : i32
        %522 = arith.extsi %520 : i32 to i64
        %521 = arith.addi %519, %522 : i64
        llvm.store %521, %315 : i64, !llvm.ptr
        cf.br ^bb108
      ^bb110:
      cf.br ^bb107
    ^bb106:
      cf.br ^bb107
    ^bb107:
    %523 = arith.constant 0 : i32
    %524 = arith.extsi %523 : i32 to i64
    llvm.store %524, %315 : i64, !llvm.ptr
    cf.br ^bb111
    ^bb111:
    %525 = llvm.load %315 : !llvm.ptr -> i64
    %526 = llvm.load %397 : !llvm.ptr -> i64
    %527 = arith.cmpi slt, %525, %526 : i64
    cf.cond_br %527, ^bb112, ^bb113
    ^bb112:
      %529 = llvm.load %315 : !llvm.ptr -> i64
      %530 = llvm.getelementptr %385[%529] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %528 = llvm.load %530 : !llvm.ptr -> i64
      %531 = arith.constant 3 : i32
      %533 = arith.extsi %531 : i32 to i64
      %532 = arith.remsi %528, %533 : i64
      %534 = arith.constant 1 : i32
      %536 = arith.extsi %534 : i32 to i64
      %535 = arith.cmpi eq, %532, %536 : i64
      cf.cond_br %535, ^bb114, ^bb115
      ^bb114:
        %537 = llvm.mlir.constant(1 : i64) : i64
        %538 = llvm.alloca %537 x i64 : (i64) -> !llvm.ptr
        llvm.store %528, %538 : i64, !llvm.ptr
        cf.br ^bb117
        ^bb117:
        %539 = llvm.load %538 : !llvm.ptr -> i64
        %540 = arith.cmpi sle, %539, %478 : i64
        cf.cond_br %540, ^bb118, ^bb119
        ^bb118:
          %541 = arith.constant 0 : i32
          %542 = llvm.load %538 : !llvm.ptr -> i64
          %543 = arith.trunci %541 : i32 to i8
          %544 = llvm.getelementptr %479[%542] : (!llvm.ptr, i64) -> !llvm.ptr, i8
          llvm.store %543, %544 : i8, !llvm.ptr
          %545 = llvm.load %538 : !llvm.ptr -> i64
          %546 = arith.addi %545, %528 : i64
          llvm.store %546, %538 : i64, !llvm.ptr
          cf.br ^bb117
        ^bb119:
        cf.br ^bb116
      ^bb115:
        cf.br ^bb116
      ^bb116:
      %547 = llvm.load %315 : !llvm.ptr -> i64
      %548 = arith.constant 1 : i32
      %550 = arith.extsi %548 : i32 to i64
      %549 = arith.addi %547, %550 : i64
      llvm.store %549, %315 : i64, !llvm.ptr
      cf.br ^bb111
    ^bb113:
    %551 = arith.constant 0 : i32
    %552 = arith.extsi %551 : i32 to i64
    llvm.store %552, %315 : i64, !llvm.ptr
    cf.br ^bb120
    ^bb120:
    %553 = llvm.load %315 : !llvm.ptr -> i64
    %554 = arith.cmpi sle, %553, %478 : i64
    cf.cond_br %554, ^bb121, ^bb122
    ^bb121:
      %556 = llvm.load %315 : !llvm.ptr -> i64
      %557 = llvm.getelementptr %479[%556] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %555 = llvm.load %557 : !llvm.ptr -> i8
      %558 = llvm.load %315 : !llvm.ptr -> i64
      %559 = llvm.getelementptr %485[%558] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      llvm.store %555, %559 : i8, !llvm.ptr
      %560 = llvm.load %315 : !llvm.ptr -> i64
      %561 = arith.constant 1 : i32
      %563 = arith.extsi %561 : i32 to i64
      %562 = arith.addi %560, %563 : i64
      llvm.store %562, %315 : i64, !llvm.ptr
      cf.br ^bb120
    ^bb122:
    %564 = arith.constant 3 : i32
    %566 = arith.extsi %564 : i32 to i64
    %565 = arith.cmpi sge, %478, %566 : i64
    cf.cond_br %565, ^bb123, ^bb124
    ^bb123:
      %567 = arith.constant 3 : i32
      %568 = arith.extsi %567 : i32 to i64
      llvm.store %568, %315 : i64, !llvm.ptr
      cf.br ^bb126
      ^bb126:
      %569 = llvm.load %315 : !llvm.ptr -> i64
      %570 = arith.cmpi sle, %569, %478 : i64
      cf.cond_br %570, ^bb127, ^bb128
      ^bb127:
        %571 = arith.constant 0 : i32
        %572 = llvm.load %315 : !llvm.ptr -> i64
        %573 = arith.trunci %571 : i32 to i8
        %574 = llvm.getelementptr %485[%572] : (!llvm.ptr, i64) -> !llvm.ptr, i8
        llvm.store %573, %574 : i8, !llvm.ptr
        %575 = llvm.load %315 : !llvm.ptr -> i64
        %576 = arith.constant 3 : i32
        %578 = arith.extsi %576 : i32 to i64
        %577 = arith.addi %575, %578 : i64
        llvm.store %577, %315 : i64, !llvm.ptr
        cf.br ^bb126
      ^bb128:
      cf.br ^bb125
    ^bb124:
      cf.br ^bb125
    ^bb125:
    %580 = arith.constant 1 : i32
    %582 = arith.extsi %580 : i32 to i64
    %581 = arith.addi %478, %582 : i64
    %583 = arith.constant 8 : i32
    %584 = arith.extsi %583 : i32 to i64
    %579 = func.call @calloc(%581, %584) : (i64, i64) -> !llvm.ptr
    %586 = arith.constant 1 : i32
    %588 = arith.extsi %586 : i32 to i64
    %587 = arith.addi %478, %588 : i64
    %589 = arith.constant 8 : i32
    %590 = arith.extsi %589 : i32 to i64
    %585 = func.call @calloc(%587, %590) : (i64, i64) -> !llvm.ptr
    %591 = arith.constant 0 : i32
    %592 = arith.extsi %591 : i32 to i64
    %593 = llvm.mlir.constant(1 : i64) : i64
    %594 = llvm.alloca %593 x i64 : (i64) -> !llvm.ptr
    llvm.store %592, %594 : i64, !llvm.ptr
    %595 = arith.constant 0 : i32
    %596 = arith.extsi %595 : i32 to i64
    %597 = llvm.mlir.constant(1 : i64) : i64
    %598 = llvm.alloca %597 x i64 : (i64) -> !llvm.ptr
    llvm.store %596, %598 : i64, !llvm.ptr
    %599 = arith.constant 1 : i32
    %600 = arith.extsi %599 : i32 to i64
    llvm.store %600, %315 : i64, !llvm.ptr
    cf.br ^bb129
    ^bb129:
    %601 = llvm.load %315 : !llvm.ptr -> i64
    %602 = arith.cmpi sle, %601, %478 : i64
    cf.cond_br %602, ^bb130, ^bb131
    ^bb130:
      %604 = llvm.load %315 : !llvm.ptr -> i64
      %605 = llvm.getelementptr %479[%604] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %603 = llvm.load %605 : !llvm.ptr -> i8
      %606 = arith.constant 0 : i32
      %608 = arith.extsi %603 : i8 to i32
      %607 = arith.cmpi ne, %608, %606 : i32
      cf.cond_br %607, ^bb132, ^bb133
      ^bb132:
        %609 = llvm.load %594 : !llvm.ptr -> i64
        %610 = llvm.load %315 : !llvm.ptr -> i64
        %611 = arith.addi %609, %610 : i64
        llvm.store %611, %594 : i64, !llvm.ptr
        cf.br ^bb134
      ^bb133:
        cf.br ^bb134
      ^bb134:
      %613 = llvm.load %315 : !llvm.ptr -> i64
      %614 = llvm.getelementptr %485[%613] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %612 = llvm.load %614 : !llvm.ptr -> i8
      %615 = arith.constant 0 : i32
      %617 = arith.extsi %612 : i8 to i32
      %616 = arith.cmpi ne, %617, %615 : i32
      cf.cond_br %616, ^bb135, ^bb136
      ^bb135:
        %618 = llvm.load %598 : !llvm.ptr -> i64
        %619 = llvm.load %315 : !llvm.ptr -> i64
        %620 = arith.addi %618, %619 : i64
        llvm.store %620, %598 : i64, !llvm.ptr
        cf.br ^bb137
      ^bb136:
        cf.br ^bb137
      ^bb137:
      %621 = llvm.load %594 : !llvm.ptr -> i64
      %622 = llvm.load %315 : !llvm.ptr -> i64
      %623 = llvm.getelementptr %579[%622] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %621, %623 : i64, !llvm.ptr
      %624 = llvm.load %598 : !llvm.ptr -> i64
      %625 = llvm.load %315 : !llvm.ptr -> i64
      %626 = llvm.getelementptr %585[%625] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %624, %626 : i64, !llvm.ptr
      %627 = llvm.load %315 : !llvm.ptr -> i64
      %628 = arith.constant 1 : i32
      %630 = arith.extsi %628 : i32 to i64
      %629 = arith.addi %627, %630 : i64
      llvm.store %629, %315 : i64, !llvm.ptr
      cf.br ^bb129
    ^bb131:
    %632 = arith.constant 6 : i32
    %633 = llvm.load %437 : !llvm.ptr -> i64
    %634 = arith.constant 1 : i32
    %636 = arith.extsi %634 : i32 to i64
    %635 = arith.addi %633, %636 : i64
    %638 = arith.extsi %632 : i32 to i64
    %637 = arith.muli %638, %635 : i64
    %639 = arith.constant 8 : i32
    %640 = arith.extsi %639 : i32 to i64
    %631 = func.call @calloc(%637, %640) : (i64, i64) -> !llvm.ptr
    %641 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
    llvm.store %631, %641 : !llvm.ptr, !llvm.ptr
    %642 = arith.constant 1 : i32
    %643 = arith.extsi %642 : i32 to i64
    %644 = llvm.mlir.constant(1 : i64) : i64
    %645 = llvm.alloca %644 x i64 : (i64) -> !llvm.ptr
    llvm.store %643, %645 : i64, !llvm.ptr
    cf.br ^bb138
    ^bb138:
    %646 = llvm.load %645 : !llvm.ptr -> i64
    %647 = arith.constant 5 : i32
    %649 = arith.extsi %647 : i32 to i64
    %648 = arith.cmpi sle, %646, %649 : i64
    cf.cond_br %648, ^bb139, ^bb140
    ^bb139:
      %650 = arith.constant 1 : i32
      %652 = arith.extsi %650 : i32 to i64
      %651 = arith.addi %295, %652 : i64
      %653 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
      %654 = llvm.load %653 : !llvm.ptr -> !llvm.ptr
      %655 = llvm.load %645 : !llvm.ptr -> i64
      %656 = llvm.load %437 : !llvm.ptr -> i64
      %657 = arith.constant 1 : i32
      %659 = arith.extsi %657 : i32 to i64
      %658 = arith.addi %656, %659 : i64
      %660 = arith.muli %655, %658 : i64
      %661 = llvm.load %437 : !llvm.ptr -> i64
      %662 = arith.addi %660, %661 : i64
      %663 = llvm.getelementptr %654[%662] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %651, %663 : i64, !llvm.ptr
      %664 = llvm.load %645 : !llvm.ptr -> i64
      %665 = arith.constant 1 : i32
      %667 = arith.extsi %665 : i32 to i64
      %666 = arith.addi %664, %667 : i64
      llvm.store %666, %645 : i64, !llvm.ptr
      cf.br ^bb138
    ^bb140:
    %668 = llvm.load %437 : !llvm.ptr -> i64
    %669 = arith.constant 1 : i32
    %671 = arith.extsi %669 : i32 to i64
    %670 = arith.subi %668, %671 : i64
    llvm.store %670, %315 : i64, !llvm.ptr
    cf.br ^bb141
    ^bb141:
    %672 = llvm.load %315 : !llvm.ptr -> i64
    %673 = arith.constant 0 : i32
    %675 = arith.extsi %673 : i32 to i64
    %674 = arith.cmpi sge, %672, %675 : i64
    cf.cond_br %674, ^bb142, ^bb143
    ^bb142:
      %676 = arith.constant 1 : i32
      %677 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
      %678 = llvm.load %677 : !llvm.ptr -> !llvm.ptr
      %679 = arith.constant 0 : i32
      %680 = llvm.load %437 : !llvm.ptr -> i64
      %681 = arith.constant 1 : i32
      %683 = arith.extsi %681 : i32 to i64
      %682 = arith.addi %680, %683 : i64
      %685 = arith.extsi %679 : i32 to i64
      %684 = arith.muli %685, %682 : i64
      %686 = llvm.load %315 : !llvm.ptr -> i64
      %687 = arith.addi %684, %686 : i64
      %688 = arith.extsi %676 : i32 to i64
      %689 = llvm.getelementptr %678[%687] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %688, %689 : i64, !llvm.ptr
      %691 = llvm.load %315 : !llvm.ptr -> i64
      %692 = llvm.getelementptr %430[%691] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %690 = llvm.load %692 : !llvm.ptr -> i64
      %693 = arith.constant 1 : i32
      %694 = arith.extsi %693 : i32 to i64
      llvm.store %694, %645 : i64, !llvm.ptr
      cf.br ^bb144
      ^bb144:
      %695 = llvm.load %645 : !llvm.ptr -> i64
      %696 = arith.constant 5 : i32
      %698 = arith.extsi %696 : i32 to i64
      %697 = arith.cmpi sle, %695, %698 : i64
      cf.cond_br %697, ^bb145, ^bb146
      ^bb145:
        %700 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
        %701 = llvm.load %700 : !llvm.ptr -> !llvm.ptr
        %702 = llvm.load %645 : !llvm.ptr -> i64
        %703 = arith.constant 1 : i32
        %705 = arith.extsi %703 : i32 to i64
        %704 = arith.subi %702, %705 : i64
        %706 = llvm.load %437 : !llvm.ptr -> i64
        %707 = arith.constant 1 : i32
        %709 = arith.extsi %707 : i32 to i64
        %708 = arith.addi %706, %709 : i64
        %710 = arith.muli %704, %708 : i64
        %711 = llvm.load %315 : !llvm.ptr -> i64
        %712 = arith.constant 1 : i32
        %714 = arith.extsi %712 : i32 to i64
        %713 = arith.addi %711, %714 : i64
        %715 = arith.addi %710, %713 : i64
        %716 = llvm.getelementptr %701[%715] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %699 = llvm.load %716 : !llvm.ptr -> i64
        %717 = arith.muli %690, %699 : i64
        %718 = arith.cmpi sgt, %717, %295 : i64
        %719 = scf.if %718 -> (i1) {
          %720 = arith.constant true
          scf.yield %720 : i1
        } else {
          %722 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
          %723 = llvm.load %722 : !llvm.ptr -> !llvm.ptr
          %724 = llvm.load %645 : !llvm.ptr -> i64
          %725 = arith.constant 1 : i32
          %727 = arith.extsi %725 : i32 to i64
          %726 = arith.subi %724, %727 : i64
          %728 = llvm.load %437 : !llvm.ptr -> i64
          %729 = arith.constant 1 : i32
          %731 = arith.extsi %729 : i32 to i64
          %730 = arith.addi %728, %731 : i64
          %732 = arith.muli %726, %730 : i64
          %733 = llvm.load %315 : !llvm.ptr -> i64
          %734 = arith.constant 1 : i32
          %736 = arith.extsi %734 : i32 to i64
          %735 = arith.addi %733, %736 : i64
          %737 = arith.addi %732, %735 : i64
          %738 = llvm.getelementptr %723[%737] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %721 = llvm.load %738 : !llvm.ptr -> i64
          %739 = arith.divsi %295, %690 : i64
          %740 = arith.cmpi sgt, %721, %739 : i64
          scf.yield %740 : i1
        }
        cf.cond_br %719, ^bb147, ^bb148
        ^bb147:
          %741 = arith.constant 1 : i32
          %743 = arith.extsi %741 : i32 to i64
          %742 = arith.addi %295, %743 : i64
          %744 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
          %745 = llvm.load %744 : !llvm.ptr -> !llvm.ptr
          %746 = llvm.load %645 : !llvm.ptr -> i64
          %747 = llvm.load %437 : !llvm.ptr -> i64
          %748 = arith.constant 1 : i32
          %750 = arith.extsi %748 : i32 to i64
          %749 = arith.addi %747, %750 : i64
          %751 = arith.muli %746, %749 : i64
          %752 = llvm.load %315 : !llvm.ptr -> i64
          %753 = arith.addi %751, %752 : i64
          %754 = llvm.getelementptr %745[%753] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %742, %754 : i64, !llvm.ptr
          cf.br ^bb149
        ^bb148:
          %755 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
          %756 = llvm.load %755 : !llvm.ptr -> !llvm.ptr
          %757 = llvm.load %645 : !llvm.ptr -> i64
          %758 = llvm.load %437 : !llvm.ptr -> i64
          %759 = arith.constant 1 : i32
          %761 = arith.extsi %759 : i32 to i64
          %760 = arith.addi %758, %761 : i64
          %762 = arith.muli %757, %760 : i64
          %763 = llvm.load %315 : !llvm.ptr -> i64
          %764 = arith.addi %762, %763 : i64
          %765 = llvm.getelementptr %756[%764] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %717, %765 : i64, !llvm.ptr
          cf.br ^bb149
        ^bb149:
        %766 = llvm.load %645 : !llvm.ptr -> i64
        %767 = arith.constant 1 : i32
        %769 = arith.extsi %767 : i32 to i64
        %768 = arith.addi %766, %769 : i64
        llvm.store %768, %645 : i64, !llvm.ptr
        cf.br ^bb144
      ^bb146:
      %770 = llvm.load %315 : !llvm.ptr -> i64
      %771 = arith.constant 1 : i32
      %773 = arith.extsi %771 : i32 to i64
      %772 = arith.subi %770, %773 : i64
      llvm.store %772, %315 : i64, !llvm.ptr
      cf.br ^bb141
    ^bb143:
    %775 = arith.constant 5 : i32
    %776 = arith.constant 1 : i32
    %777 = arith.extsi %775 : i32 to i64
    %778 = arith.extsi %776 : i32 to i64
    %774 = func.call @sum_pick(%777, %579, %778) : (i64, !llvm.ptr, i64) -> i64
    %779 = llvm.mlir.constant(1 : i64) : i64
    %780 = llvm.alloca %779 x i64 : (i64) -> !llvm.ptr
    llvm.store %774, %780 : i64, !llvm.ptr
    %781 = arith.constant 9 : i32
    %782 = arith.extsi %781 : i32 to i64
    %783 = llvm.mlir.constant(1 : i64) : i64
    %784 = llvm.alloca %783 x i64 : (i64) -> !llvm.ptr
    llvm.store %782, %784 : i64, !llvm.ptr
    cf.br ^bb150
    ^bb150:
    %785 = llvm.load %784 : !llvm.ptr -> i64
    %787 = llvm.mlir.addressof @G_min_prod : !llvm.ptr
    %788 = llvm.load %787 : !llvm.ptr -> !llvm.ptr
    %789 = arith.constant 4 : i32
    %790 = llvm.load %437 : !llvm.ptr -> i64
    %791 = arith.constant 1 : i32
    %793 = arith.extsi %791 : i32 to i64
    %792 = arith.addi %790, %793 : i64
    %795 = arith.extsi %789 : i32 to i64
    %794 = arith.muli %795, %792 : i64
    %796 = arith.constant 0 : i32
    %798 = arith.extsi %796 : i32 to i64
    %797 = arith.addi %794, %798 : i64
    %799 = llvm.getelementptr %788[%797] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    %786 = llvm.load %799 : !llvm.ptr -> i64
    %800 = arith.divsi %295, %786 : i64
    %801 = arith.cmpi sle, %785, %800 : i64
    cf.cond_br %801, ^bb151, ^bb152
    ^bb151:
      %802 = llvm.load %780 : !llvm.ptr -> i64
      %804 = arith.constant 4 : i32
      %805 = llvm.load %784 : !llvm.ptr -> i64
      %806 = arith.extsi %804 : i32 to i64
      %803 = func.call @sum_pick(%806, %585, %805) : (i64, !llvm.ptr, i64) -> i64
      %807 = arith.addi %802, %803 : i64
      llvm.store %807, %780 : i64, !llvm.ptr
      %808 = llvm.load %784 : !llvm.ptr -> i64
      %809 = arith.constant 3 : i32
      %811 = arith.extsi %809 : i32 to i64
      %810 = arith.divsi %295, %811 : i64
      %812 = arith.cmpi sgt, %808, %810 : i64
      cf.cond_br %812, ^bb153, ^bb154
      ^bb153:
        cf.br ^bb152
      ^bb154:
        cf.br ^bb155
      ^bb155:
      %813 = llvm.load %784 : !llvm.ptr -> i64
      %814 = arith.constant 3 : i32
      %816 = arith.extsi %814 : i32 to i64
      %815 = arith.muli %813, %816 : i64
      llvm.store %815, %784 : i64, !llvm.ptr
      cf.br ^bb150
    ^bb152:
    %817 = llvm.mlir.addressof @str_0 : !llvm.ptr
    %818 = llvm.load %780 : !llvm.ptr -> i64
    %819 = llvm.call @printf(%817, %818) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
    %820 = arith.constant 0 : i32
    func.return %820 : i32
  }
}