Problem 200

200th prime-proof sqube containing substring "200".

Answer229161792008
Output229161792008
StatusPASS
Native helperno
Runtime10 ms
Peak memory2416 KB
Time complexityO(n^3) (estimated)
Space complexityO(n^2) (estimated)

Performance comparison

MetricOur solutionBest known
Time complexityO(n^3)O(n log log n)
Space complexityO(n^2)O(n)
ApproachFlow solutionSieve of Eratosthenes
VerdictSuboptimal

Flow source

# Project Euler 200
# 200th prime-proof sqube containing substring "200".

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

function mulmod(a: i64, b: i64, mod: i64) -> i64 {
    let r: i128 = ((a as i128) * (b as i128)) % (mod as i128)
    return r as i64
}

function modpow(base: i64, exp: i64, mod: i64) -> i64 {
    let mut r: i64 = 1
    let mut b: i64 = base % mod
    let mut e: i64 = exp
    while e > 0 {
        if e % 2 == 1 { r = mulmod(r, b, mod) }
        b = mulmod(b, b, mod)
        e = e / 2
    }
    return r
}

function is_prime(value: i64) -> bool {
    if value < 2 { return false }
    if value % 2 == 0 { return value == 2 }
    if value % 3 == 0 { return value == 3 }
    if value % 5 == 0 { return value == 5 }
    if value % 7 == 0 { return value == 7 }
    if value % 11 == 0 { return value == 11 }
    if value % 13 == 0 { return value == 13 }
    if value % 17 == 0 { return value == 17 }
    if value % 19 == 0 { return value == 19 }
    if value % 23 == 0 { return value == 23 }
    if value % 29 == 0 { return value == 29 }

    let mut d: i64 = value - 1
    let mut shifts: i32 = 0
    while d % 2 == 0 {
        d = d / 2
        shifts = shifts + 1
    }
    let bases: ptr<i64> = calloc(7, 8)
    bases[0] = 2; bases[1] = 325; bases[2] = 9375; bases[3] = 28178
    bases[4] = 450775; bases[5] = 9780504; bases[6] = 1795265022
    let mut bi: i32 = 0
    while bi < 7 {
        let base: i64 = bases[bi] % value
        if base != 0 {
            let mut x: i64 = modpow(base, d, value)
            if !(x == 1 || x == value - 1) {
                let mut ok: bool = false
                let mut r: i32 = 0
                while r < shifts - 1 {
                    x = mulmod(x, x, value)
                    if x == value - 1 {
                        ok = true
                        break
                    }
                    r = r + 1
                }
                if !ok {
                    free(bases)
                    return false
                }
            }
        }
        bi = bi + 1
    }
    free(bases)
    return true
}

function contains_200(value: i64) -> bool {
    let mut v: i64 = value
    while v >= 200 {
        if v % 1000 == 200 { return true }
        v = v / 10
    }
    return false
}

function is_prime_proof(value: i64) -> bool {
    let digits: ptr<i32> = calloc(20, 4)
    let powers: ptr<i64> = calloc(20, 8)
    let mut len: i32 = 0
    let mut rem: i64 = value
    let mut power: i64 = 1
    while rem > 0 {
        digits[len] = (rem % 10) as i32
        powers[len] = power
        rem = rem / 10
        power = power * 10
        len = len + 1
    }
    let leading: i32 = len - 1
    let mut pos: i32 = 0
    while pos < len {
        let orig: i32 = digits[pos]
        let mut first: i32 = 0
        if pos == leading { first = 1 }
        let mut digit: i32 = first
        while digit <= 9 {
            if digit != orig {
                if !(pos == 0 && (digit % 2 == 0 || digit == 5)) {
                    let modified: i64 = value + ((digit - orig) as i64) * powers[pos]
                    if is_prime(modified) {
                        free(digits); free(powers)
                        return false
                    }
                }
            }
            digit = digit + 1
        }
        pos = pos + 1
    }
    free(digits); free(powers)
    return true
}

function isqrt(n: i64) -> i64 {
    if n <= 0 { return 0 }
    let mut x: i64 = n
    let mut y: i64 = (x + 1) / 2
    while y < x {
        x = y
        y = (x + n / x) / 2
    }
    return x
}

function main() -> i32 {
    let limit: i64 = 1000000000000
    let pmax: i64 = isqrt(limit / 8) + 1
    let sieve: ptr<i8> = calloc(pmax + 1, 1)
    if sieve == null { return 1 }
    let mut i: i64 = 0
    while i <= pmax {
        sieve[i] = 1
        i = i + 1
    }
    sieve[0] = 0; sieve[1] = 0
    let mut p: i64 = 2
    while p * p <= pmax {
        if sieve[p] == 1 {
            let mut m: i64 = p * p
            while m <= pmax {
                sieve[m] = 0
                m = m + p
            }
        }
        p = p + 1
    }
    let mut pc: i64 = 0
    i = 2
    while i <= pmax {
        if sieve[i] == 1 { pc = pc + 1 }
        i = i + 1
    }
    let primes: ptr<i64> = calloc(pc, 8)
    let mut idx: i64 = 0
    i = 2
    while i <= pmax {
        if sieve[i] == 1 {
            primes[idx] = i
            idx = idx + 1
        }
        i = i + 1
    }

    let squbes: ptr<i64> = calloc(5000000, 8)
    let mut sc: i64 = 0
    let mut ii: i64 = 0
    while ii < pc {
        let pp: i64 = primes[ii]
        let p2: i64 = pp * pp
        if p2 > limit / 8 { break }
        let mut jj: i64 = 0
        while jj < pc {
            let qq: i64 = primes[jj]
            if qq != pp {
                if qq > 1000000 { break }
                # q^3 may overflow; check carefully
                if qq > 100000 { 
                    # q^3 > 1e15 > limit
                    # still need smaller q
                }
                let q2: i64 = qq * qq
                if q2 > limit / qq { break }
                let q3: i64 = q2 * qq
                if q3 > limit / p2 { break }
                let value: i64 = p2 * q3
                squbes[sc] = value
                sc = sc + 1
            }
            jj = jj + 1
        }
        ii = ii + 1
    }

    # shell sort
    let mut gap: i64 = sc / 2
    while gap > 0 {
        let mut i2: i64 = gap
        while i2 < sc {
            let tmp: i64 = squbes[i2]
            let mut j2: i64 = i2
            while j2 >= gap && squbes[j2 - gap] > tmp {
                squbes[j2] = squbes[j2 - gap]
                j2 = j2 - gap
            }
            squbes[j2] = tmp
            i2 = i2 + 1
        }
        gap = gap / 2
    }

    let mut count: i64 = 0
    let mut ans: i64 = 0
    i = 0
    while i < sc {
        let v: i64 = squbes[i]
        if contains_200(v) {
            if is_prime_proof(v) {
                count = count + 1
                if count == 200 {
                    ans = v
                    break
                }
            }
        }
        i = i + 1
    }
    printf("%lld\n", ans)
    free(sieve); free(primes); free(squbes)
    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 mulmod_i64_i64_i64(int64_t a, int64_t b, int64_t mod);
int64_t modpow_i64_i64_i64(int64_t base, int64_t exp, int64_t mod);
bool is_prime_i64(int64_t value);
bool contains_200_i64(int64_t value);
bool is_prime_proof_i64(int64_t value);
int64_t isqrt_i64(int64_t n);
int32_t main(void);



int64_t mulmod_i64_i64_i64(int64_t a, int64_t b, int64_t mod) {
    __int128 r = FLOW_CHECKED_MOD(((((__int128)(a)) * ((__int128)(b)))), (((__int128)(mod))));
    return ((int64_t)(r));
}

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

bool is_prime_i64(int64_t value) {
    if (value < 2) {
        return 0;
    }
    if (FLOW_CHECKED_MOD((value), (2)) == 0) {
        return value == 2;
    }
    if (FLOW_CHECKED_MOD((value), (3)) == 0) {
        return value == 3;
    }
    if (FLOW_CHECKED_MOD((value), (5)) == 0) {
        return value == 5;
    }
    if (FLOW_CHECKED_MOD((value), (7)) == 0) {
        return value == 7;
    }
    if (FLOW_CHECKED_MOD((value), (11)) == 0) {
        return value == 11;
    }
    if (FLOW_CHECKED_MOD((value), (13)) == 0) {
        return value == 13;
    }
    if (FLOW_CHECKED_MOD((value), (17)) == 0) {
        return value == 17;
    }
    if (FLOW_CHECKED_MOD((value), (19)) == 0) {
        return value == 19;
    }
    if (FLOW_CHECKED_MOD((value), (23)) == 0) {
        return value == 23;
    }
    if (FLOW_CHECKED_MOD((value), (29)) == 0) {
        return value == 29;
    }
    int64_t d = (value - 1);
    int32_t shifts = 0;
    while (FLOW_CHECKED_MOD((d), (2)) == 0) {
        d = FLOW_CHECKED_DIV((d), (2));
        shifts = (shifts + 1);
    }
    int64_t* bases = (int64_t*)(calloc(7, 8));
    bases[0] = 2;
    bases[1] = 325;
    bases[2] = 9375;
    bases[3] = 28178;
    bases[4] = 450775;
    bases[5] = 9780504;
    bases[6] = 1795265022;
    int32_t bi = 0;
    while (bi < 7) {
        int64_t base = FLOW_CHECKED_MOD((bases[bi]), (value));
        if (base != 0) {
            int64_t x = modpow_i64_i64_i64(base, d, value);
            if ((!((x == 1 || x == (value - 1))))) {
                bool ok = 0;
                int32_t r = 0;
                while (r < (shifts - 1)) {
                    x = mulmod_i64_i64_i64(x, x, value);
                    if (x == (value - 1)) {
                        ok = 1;
                        break;
                    }
                    r = (r + 1);
                }
                if ((!(ok))) {
                    free(bases);
                    return 0;
                }
            }
        }
        bi = (bi + 1);
    }
    free(bases);
    return 1;
}

bool contains_200_i64(int64_t value) {
    int64_t v = value;
    while (v >= 200) {
        if (FLOW_CHECKED_MOD((v), (1000)) == 200) {
            return 1;
        }
        v = FLOW_CHECKED_DIV((v), (10));
    }
    return 0;
}

bool is_prime_proof_i64(int64_t value) {
    int32_t* digits = (int32_t*)(calloc(20, 4));
    int64_t* powers = (int64_t*)(calloc(20, 8));
    int32_t len = 0;
    int64_t rem = value;
    int64_t power = 1;
    while (rem > 0) {
        digits[len] = ((int32_t)(FLOW_CHECKED_MOD((rem), (10))));
        powers[len] = power;
        rem = FLOW_CHECKED_DIV((rem), (10));
        power = (power * 10);
        len = (len + 1);
    }
    int32_t leading = (len - 1);
    int32_t pos = 0;
    while (pos < len) {
        int32_t orig = digits[pos];
        int32_t first = 0;
        if (pos == leading) {
            first = 1;
        }
        int32_t digit = first;
        while (digit <= 9) {
            if (digit != orig) {
                if ((!((pos == 0 && (FLOW_CHECKED_MOD((digit), (2)) == 0 || digit == 5))))) {
                    int64_t modified = (value + (((int64_t)((digit - orig))) * powers[pos]));
                    if (is_prime_i64(modified)) {
                        free(digits);
                        free(powers);
                        return 0;
                    }
                }
            }
            digit = (digit + 1);
        }
        pos = (pos + 1);
    }
    free(digits);
    free(powers);
    return 1;
}

int64_t isqrt_i64(int64_t n) {
    if (n <= 0) {
        return 0;
    }
    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;
}

int32_t main(void) {
    int64_t limit = 1000000000000;
    int64_t pmax = (isqrt_i64(FLOW_CHECKED_DIV((limit), (8))) + 1);
    int8_t* sieve = (int8_t*)(calloc((pmax + 1), 1));
    if (sieve == NULL) {
        return 1;
    }
    int64_t i = 0;
    while (i <= pmax) {
        sieve[i] = 1;
        i = (i + 1);
    }
    sieve[0] = 0;
    sieve[1] = 0;
    int64_t p = 2;
    while ((p * p) <= pmax) {
        if (sieve[p] == 1) {
            int64_t m = (p * p);
            while (m <= pmax) {
                sieve[m] = 0;
                m = (m + p);
            }
        }
        p = (p + 1);
    }
    int64_t pc = 0;
    i = 2;
    while (i <= pmax) {
        if (sieve[i] == 1) {
            pc = (pc + 1);
        }
        i = (i + 1);
    }
    int64_t* primes = (int64_t*)(calloc(pc, 8));
    int64_t idx = 0;
    i = 2;
    while (i <= pmax) {
        if (sieve[i] == 1) {
            primes[idx] = i;
            idx = (idx + 1);
        }
        i = (i + 1);
    }
    int64_t* squbes = (int64_t*)(calloc(5000000, 8));
    int64_t sc = 0;
    int64_t ii = 0;
    while (ii < pc) {
        int64_t pp = primes[ii];
        int64_t p2 = (pp * pp);
        if (p2 > FLOW_CHECKED_DIV((limit), (8))) {
            break;
        }
        int64_t jj = 0;
        while (jj < pc) {
            int64_t qq = primes[jj];
            if (qq != pp) {
                if (qq > 1000000) {
                    break;
                }
                if (qq > 100000) {
                }
                int64_t q2 = (qq * qq);
                if (q2 > FLOW_CHECKED_DIV((limit), (qq))) {
                    break;
                }
                int64_t q3 = (q2 * qq);
                if (q3 > FLOW_CHECKED_DIV((limit), (p2))) {
                    break;
                }
                int64_t value = (p2 * q3);
                squbes[sc] = value;
                sc = (sc + 1);
            }
            jj = (jj + 1);
        }
        ii = (ii + 1);
    }
    int64_t gap = FLOW_CHECKED_DIV((sc), (2));
    while (gap > 0) {
        int64_t i2 = gap;
        while (i2 < sc) {
            int64_t tmp = squbes[i2];
            int64_t j2 = i2;
            while ((j2 >= gap && squbes[(j2 - gap)] > tmp)) {
                squbes[j2] = squbes[(j2 - gap)];
                j2 = (j2 - gap);
            }
            squbes[j2] = tmp;
            i2 = (i2 + 1);
        }
        gap = FLOW_CHECKED_DIV((gap), (2));
    }
    int64_t count = 0;
    int64_t ans = 0;
    i = 0;
    while (i < sc) {
        int64_t v = squbes[i];
        if (contains_200_i64(v)) {
            if (is_prime_proof_i64(v)) {
                count = (count + 1);
                if (count == 200) {
                    ans = v;
                    break;
                }
            }
        }
        i = (i + 1);
    }
    printf("%lld\n", ans);
    free(sieve);
    free(primes);
    free(squbes);
    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) -> ()
  func.func @mulmod(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
    %0 = arith.extsi %arg0 : i64 to i128
    %1 = arith.extsi %arg1 : i64 to i128
    %3 = arith.trunci %0 : i128 to i64
    %4 = arith.trunci %1 : i128 to i64
    %2 = arith.muli %3, %4 : i64
    %5 = arith.extsi %arg2 : i64 to i128
    %7 = arith.trunci %5 : i128 to i64
    %6 = arith.remsi %2, %7 : i64
    %8 = arith.extsi %6 : i64 to i128
    %9 = arith.trunci %8 : i128 to i64
    func.return %9 : i64
  }
  func.func @modpow(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
    %10 = arith.constant 1 : i32
    %11 = arith.extsi %10 : i32 to i64
    %12 = llvm.mlir.constant(1 : i64) : i64
    %13 = llvm.alloca %12 x i64 : (i64) -> !llvm.ptr
    llvm.store %11, %13 : i64, !llvm.ptr
    %14 = arith.remsi %arg0, %arg2 : i64
    %15 = llvm.mlir.constant(1 : i64) : i64
    %16 = llvm.alloca %15 x i64 : (i64) -> !llvm.ptr
    llvm.store %14, %16 : i64, !llvm.ptr
    %17 = llvm.mlir.constant(1 : i64) : i64
    %18 = llvm.alloca %17 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg1, %18 : i64, !llvm.ptr
    cf.br ^bb0
    ^bb0:
    %19 = llvm.load %18 : !llvm.ptr -> i64
    %20 = arith.constant 0 : i32
    %22 = arith.extsi %20 : i32 to i64
    %21 = arith.cmpi sgt, %19, %22 : i64
    cf.cond_br %21, ^bb1, ^bb2
    ^bb1:
      %23 = llvm.load %18 : !llvm.ptr -> i64
      %24 = arith.constant 2 : i32
      %26 = arith.extsi %24 : i32 to i64
      %25 = arith.remsi %23, %26 : i64
      %27 = arith.constant 1 : i32
      %29 = arith.extsi %27 : i32 to i64
      %28 = arith.cmpi eq, %25, %29 : i64
      cf.cond_br %28, ^bb3, ^bb4
      ^bb3:
        %31 = llvm.load %13 : !llvm.ptr -> i64
        %32 = llvm.load %16 : !llvm.ptr -> i64
        %30 = func.call @mulmod(%31, %32, %arg2) : (i64, i64, i64) -> i64
        llvm.store %30, %13 : i64, !llvm.ptr
        cf.br ^bb5
      ^bb4:
        cf.br ^bb5
      ^bb5:
      %34 = llvm.load %16 : !llvm.ptr -> i64
      %35 = llvm.load %16 : !llvm.ptr -> i64
      %33 = func.call @mulmod(%34, %35, %arg2) : (i64, i64, i64) -> i64
      llvm.store %33, %16 : i64, !llvm.ptr
      %36 = llvm.load %18 : !llvm.ptr -> i64
      %37 = arith.constant 2 : i32
      %39 = arith.extsi %37 : i32 to i64
      %38 = arith.divsi %36, %39 : i64
      llvm.store %38, %18 : i64, !llvm.ptr
      cf.br ^bb0
    ^bb2:
    %40 = llvm.load %13 : !llvm.ptr -> i64
    func.return %40 : i64
  }
  func.func @is_prime(%arg0: i64) -> i1 {
    %41 = arith.constant 2 : i32
    %43 = arith.extsi %41 : i32 to i64
    %42 = arith.cmpi slt, %arg0, %43 : i64
    cf.cond_br %42, ^bb6, ^bb7
    ^bb6:
      %44 = arith.constant 0 : i1
      func.return %44 : i1
    ^bb7:
      cf.br ^bb8
    ^bb8:
    %45 = arith.constant 2 : i32
    %47 = arith.extsi %45 : i32 to i64
    %46 = arith.remsi %arg0, %47 : i64
    %48 = arith.constant 0 : i32
    %50 = arith.extsi %48 : i32 to i64
    %49 = arith.cmpi eq, %46, %50 : i64
    cf.cond_br %49, ^bb9, ^bb10
    ^bb9:
      %51 = arith.constant 2 : i32
      %53 = arith.extsi %51 : i32 to i64
      %52 = arith.cmpi eq, %arg0, %53 : i64
      func.return %52 : i1
    ^bb10:
      cf.br ^bb11
    ^bb11:
    %54 = arith.constant 3 : i32
    %56 = arith.extsi %54 : i32 to i64
    %55 = arith.remsi %arg0, %56 : i64
    %57 = arith.constant 0 : i32
    %59 = arith.extsi %57 : i32 to i64
    %58 = arith.cmpi eq, %55, %59 : i64
    cf.cond_br %58, ^bb12, ^bb13
    ^bb12:
      %60 = arith.constant 3 : i32
      %62 = arith.extsi %60 : i32 to i64
      %61 = arith.cmpi eq, %arg0, %62 : i64
      func.return %61 : i1
    ^bb13:
      cf.br ^bb14
    ^bb14:
    %63 = arith.constant 5 : i32
    %65 = arith.extsi %63 : i32 to i64
    %64 = arith.remsi %arg0, %65 : i64
    %66 = arith.constant 0 : i32
    %68 = arith.extsi %66 : i32 to i64
    %67 = arith.cmpi eq, %64, %68 : i64
    cf.cond_br %67, ^bb15, ^bb16
    ^bb15:
      %69 = arith.constant 5 : i32
      %71 = arith.extsi %69 : i32 to i64
      %70 = arith.cmpi eq, %arg0, %71 : i64
      func.return %70 : i1
    ^bb16:
      cf.br ^bb17
    ^bb17:
    %72 = arith.constant 7 : i32
    %74 = arith.extsi %72 : i32 to i64
    %73 = arith.remsi %arg0, %74 : i64
    %75 = arith.constant 0 : i32
    %77 = arith.extsi %75 : i32 to i64
    %76 = arith.cmpi eq, %73, %77 : i64
    cf.cond_br %76, ^bb18, ^bb19
    ^bb18:
      %78 = arith.constant 7 : i32
      %80 = arith.extsi %78 : i32 to i64
      %79 = arith.cmpi eq, %arg0, %80 : i64
      func.return %79 : i1
    ^bb19:
      cf.br ^bb20
    ^bb20:
    %81 = arith.constant 11 : i32
    %83 = arith.extsi %81 : i32 to i64
    %82 = arith.remsi %arg0, %83 : i64
    %84 = arith.constant 0 : i32
    %86 = arith.extsi %84 : i32 to i64
    %85 = arith.cmpi eq, %82, %86 : i64
    cf.cond_br %85, ^bb21, ^bb22
    ^bb21:
      %87 = arith.constant 11 : i32
      %89 = arith.extsi %87 : i32 to i64
      %88 = arith.cmpi eq, %arg0, %89 : i64
      func.return %88 : i1
    ^bb22:
      cf.br ^bb23
    ^bb23:
    %90 = arith.constant 13 : i32
    %92 = arith.extsi %90 : i32 to i64
    %91 = arith.remsi %arg0, %92 : i64
    %93 = arith.constant 0 : i32
    %95 = arith.extsi %93 : i32 to i64
    %94 = arith.cmpi eq, %91, %95 : i64
    cf.cond_br %94, ^bb24, ^bb25
    ^bb24:
      %96 = arith.constant 13 : i32
      %98 = arith.extsi %96 : i32 to i64
      %97 = arith.cmpi eq, %arg0, %98 : i64
      func.return %97 : i1
    ^bb25:
      cf.br ^bb26
    ^bb26:
    %99 = arith.constant 17 : i32
    %101 = arith.extsi %99 : i32 to i64
    %100 = arith.remsi %arg0, %101 : i64
    %102 = arith.constant 0 : i32
    %104 = arith.extsi %102 : i32 to i64
    %103 = arith.cmpi eq, %100, %104 : i64
    cf.cond_br %103, ^bb27, ^bb28
    ^bb27:
      %105 = arith.constant 17 : i32
      %107 = arith.extsi %105 : i32 to i64
      %106 = arith.cmpi eq, %arg0, %107 : i64
      func.return %106 : i1
    ^bb28:
      cf.br ^bb29
    ^bb29:
    %108 = arith.constant 19 : i32
    %110 = arith.extsi %108 : i32 to i64
    %109 = arith.remsi %arg0, %110 : i64
    %111 = arith.constant 0 : i32
    %113 = arith.extsi %111 : i32 to i64
    %112 = arith.cmpi eq, %109, %113 : i64
    cf.cond_br %112, ^bb30, ^bb31
    ^bb30:
      %114 = arith.constant 19 : i32
      %116 = arith.extsi %114 : i32 to i64
      %115 = arith.cmpi eq, %arg0, %116 : i64
      func.return %115 : i1
    ^bb31:
      cf.br ^bb32
    ^bb32:
    %117 = arith.constant 23 : i32
    %119 = arith.extsi %117 : i32 to i64
    %118 = arith.remsi %arg0, %119 : i64
    %120 = arith.constant 0 : i32
    %122 = arith.extsi %120 : i32 to i64
    %121 = arith.cmpi eq, %118, %122 : i64
    cf.cond_br %121, ^bb33, ^bb34
    ^bb33:
      %123 = arith.constant 23 : i32
      %125 = arith.extsi %123 : i32 to i64
      %124 = arith.cmpi eq, %arg0, %125 : i64
      func.return %124 : i1
    ^bb34:
      cf.br ^bb35
    ^bb35:
    %126 = arith.constant 29 : i32
    %128 = arith.extsi %126 : i32 to i64
    %127 = arith.remsi %arg0, %128 : i64
    %129 = arith.constant 0 : i32
    %131 = arith.extsi %129 : i32 to i64
    %130 = arith.cmpi eq, %127, %131 : i64
    cf.cond_br %130, ^bb36, ^bb37
    ^bb36:
      %132 = arith.constant 29 : i32
      %134 = arith.extsi %132 : i32 to i64
      %133 = arith.cmpi eq, %arg0, %134 : i64
      func.return %133 : i1
    ^bb37:
      cf.br ^bb38
    ^bb38:
    %135 = arith.constant 1 : i32
    %137 = arith.extsi %135 : i32 to i64
    %136 = arith.subi %arg0, %137 : i64
    %138 = llvm.mlir.constant(1 : i64) : i64
    %139 = llvm.alloca %138 x i64 : (i64) -> !llvm.ptr
    llvm.store %136, %139 : i64, !llvm.ptr
    %140 = arith.constant 0 : i32
    %141 = llvm.mlir.constant(1 : i64) : i64
    %142 = llvm.alloca %141 x i32 : (i64) -> !llvm.ptr
    llvm.store %140, %142 : i32, !llvm.ptr
    cf.br ^bb39
    ^bb39:
    %143 = llvm.load %139 : !llvm.ptr -> i64
    %144 = arith.constant 2 : i32
    %146 = arith.extsi %144 : i32 to i64
    %145 = arith.remsi %143, %146 : i64
    %147 = arith.constant 0 : i32
    %149 = arith.extsi %147 : i32 to i64
    %148 = arith.cmpi eq, %145, %149 : i64
    cf.cond_br %148, ^bb40, ^bb41
    ^bb40:
      %150 = llvm.load %139 : !llvm.ptr -> i64
      %151 = arith.constant 2 : i32
      %153 = arith.extsi %151 : i32 to i64
      %152 = arith.divsi %150, %153 : i64
      llvm.store %152, %139 : i64, !llvm.ptr
      %154 = llvm.load %142 : !llvm.ptr -> i32
      %155 = arith.constant 1 : i32
      %156 = arith.addi %154, %155 : i32
      llvm.store %156, %142 : i32, !llvm.ptr
      cf.br ^bb39
    ^bb41:
    %158 = arith.constant 7 : i32
    %159 = arith.constant 8 : i32
    %160 = arith.extsi %158 : i32 to i64
    %161 = arith.extsi %159 : i32 to i64
    %157 = func.call @calloc(%160, %161) : (i64, i64) -> !llvm.ptr
    %162 = arith.constant 2 : i32
    %163 = arith.constant 0 : i32
    %164 = arith.extsi %162 : i32 to i64
    %165 = arith.extsi %163 : i32 to i64
    %166 = llvm.getelementptr %157[%165] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %164, %166 : i64, !llvm.ptr
    %167 = arith.constant 325 : i32
    %168 = arith.constant 1 : i32
    %169 = arith.extsi %167 : i32 to i64
    %170 = arith.extsi %168 : i32 to i64
    %171 = llvm.getelementptr %157[%170] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %169, %171 : i64, !llvm.ptr
    %172 = arith.constant 9375 : i32
    %173 = arith.constant 2 : i32
    %174 = arith.extsi %172 : i32 to i64
    %175 = arith.extsi %173 : i32 to i64
    %176 = llvm.getelementptr %157[%175] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %174, %176 : i64, !llvm.ptr
    %177 = arith.constant 28178 : i32
    %178 = arith.constant 3 : i32
    %179 = arith.extsi %177 : i32 to i64
    %180 = arith.extsi %178 : i32 to i64
    %181 = llvm.getelementptr %157[%180] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %179, %181 : i64, !llvm.ptr
    %182 = arith.constant 450775 : i32
    %183 = arith.constant 4 : i32
    %184 = arith.extsi %182 : i32 to i64
    %185 = arith.extsi %183 : i32 to i64
    %186 = llvm.getelementptr %157[%185] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %184, %186 : i64, !llvm.ptr
    %187 = arith.constant 9780504 : i32
    %188 = arith.constant 5 : i32
    %189 = arith.extsi %187 : i32 to i64
    %190 = arith.extsi %188 : i32 to i64
    %191 = llvm.getelementptr %157[%190] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %189, %191 : i64, !llvm.ptr
    %192 = arith.constant 1795265022 : i32
    %193 = arith.constant 6 : i32
    %194 = arith.extsi %192 : i32 to i64
    %195 = arith.extsi %193 : i32 to i64
    %196 = llvm.getelementptr %157[%195] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %194, %196 : i64, !llvm.ptr
    %197 = arith.constant 0 : i32
    %198 = llvm.mlir.constant(1 : i64) : i64
    %199 = llvm.alloca %198 x i32 : (i64) -> !llvm.ptr
    llvm.store %197, %199 : i32, !llvm.ptr
    cf.br ^bb42
    ^bb42:
    %200 = llvm.load %199 : !llvm.ptr -> i32
    %201 = arith.constant 7 : i32
    %202 = arith.cmpi slt, %200, %201 : i32
    cf.cond_br %202, ^bb43, ^bb44
    ^bb43:
      %204 = llvm.load %199 : !llvm.ptr -> i32
      %205 = arith.extsi %204 : i32 to i64
      %206 = llvm.getelementptr %157[%205] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %203 = llvm.load %206 : !llvm.ptr -> i64
      %207 = arith.remsi %203, %arg0 : i64
      %208 = arith.constant 0 : i32
      %210 = arith.extsi %208 : i32 to i64
      %209 = arith.cmpi ne, %207, %210 : i64
      cf.cond_br %209, ^bb45, ^bb46
      ^bb45:
        %212 = llvm.load %139 : !llvm.ptr -> i64
        %211 = func.call @modpow(%207, %212, %arg0) : (i64, i64, i64) -> i64
        %213 = llvm.mlir.constant(1 : i64) : i64
        %214 = llvm.alloca %213 x i64 : (i64) -> !llvm.ptr
        llvm.store %211, %214 : i64, !llvm.ptr
        %215 = llvm.load %214 : !llvm.ptr -> i64
        %216 = arith.constant 1 : i32
        %218 = arith.extsi %216 : i32 to i64
        %217 = arith.cmpi eq, %215, %218 : i64
        %219 = scf.if %217 -> (i1) {
          %220 = arith.constant true
          scf.yield %220 : i1
        } else {
          %221 = llvm.load %214 : !llvm.ptr -> i64
          %222 = arith.constant 1 : i32
          %224 = arith.extsi %222 : i32 to i64
          %223 = arith.subi %arg0, %224 : i64
          %225 = arith.cmpi eq, %221, %223 : i64
          scf.yield %225 : i1
        }
        %227 = arith.constant 1 : i1
        %226 = arith.xori %219, %227 : i1
        cf.cond_br %226, ^bb48, ^bb49
        ^bb48:
          %229 = arith.constant 0 : i1
          %230 = llvm.mlir.constant(1 : i64) : i64
          %231 = llvm.alloca %230 x i1 : (i64) -> !llvm.ptr
          llvm.store %229, %231 : i1, !llvm.ptr
          %232 = arith.constant 0 : i32
          %233 = llvm.mlir.constant(1 : i64) : i64
          %234 = llvm.alloca %233 x i32 : (i64) -> !llvm.ptr
          llvm.store %232, %234 : i32, !llvm.ptr
          cf.br ^bb51
          ^bb51:
          %235 = llvm.load %234 : !llvm.ptr -> i32
          %236 = llvm.load %142 : !llvm.ptr -> i32
          %237 = arith.constant 1 : i32
          %238 = arith.subi %236, %237 : i32
          %239 = arith.cmpi slt, %235, %238 : i32
          cf.cond_br %239, ^bb52, ^bb53
          ^bb52:
            %241 = llvm.load %214 : !llvm.ptr -> i64
            %242 = llvm.load %214 : !llvm.ptr -> i64
            %240 = func.call @mulmod(%241, %242, %arg0) : (i64, i64, i64) -> i64
            llvm.store %240, %214 : i64, !llvm.ptr
            %243 = llvm.load %214 : !llvm.ptr -> i64
            %244 = arith.constant 1 : i32
            %246 = arith.extsi %244 : i32 to i64
            %245 = arith.subi %arg0, %246 : i64
            %247 = arith.cmpi eq, %243, %245 : i64
            cf.cond_br %247, ^bb54, ^bb55
            ^bb54:
              %248 = arith.constant 1 : i1
              llvm.store %248, %231 : i1, !llvm.ptr
              cf.br ^bb53
            ^bb55:
              cf.br ^bb56
            ^bb56:
            %249 = llvm.load %234 : !llvm.ptr -> i32
            %250 = arith.constant 1 : i32
            %251 = arith.addi %249, %250 : i32
            llvm.store %251, %234 : i32, !llvm.ptr
            cf.br ^bb51
          ^bb53:
          %252 = llvm.load %231 : !llvm.ptr -> i1
          %254 = arith.constant 1 : i1
          %253 = arith.xori %252, %254 : i1
          cf.cond_br %253, ^bb57, ^bb58
          ^bb57:
            func.call @free(%157) : (!llvm.ptr) -> ()
            %257 = arith.constant 0 : i1
            func.return %257 : i1
          ^bb58:
            cf.br ^bb59
          ^bb59:
          cf.br ^bb50
        ^bb49:
          cf.br ^bb50
        ^bb50:
        cf.br ^bb47
      ^bb46:
        cf.br ^bb47
      ^bb47:
      %258 = llvm.load %199 : !llvm.ptr -> i32
      %259 = arith.constant 1 : i32
      %260 = arith.addi %258, %259 : i32
      llvm.store %260, %199 : i32, !llvm.ptr
      cf.br ^bb42
    ^bb44:
    func.call @free(%157) : (!llvm.ptr) -> ()
    %262 = arith.constant 1 : i1
    func.return %262 : i1
  }
  func.func @contains_200(%arg0: i64) -> i1 {
    %263 = llvm.mlir.constant(1 : i64) : i64
    %264 = llvm.alloca %263 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %264 : i64, !llvm.ptr
    cf.br ^bb60
    ^bb60:
    %265 = llvm.load %264 : !llvm.ptr -> i64
    %266 = arith.constant 200 : i32
    %268 = arith.extsi %266 : i32 to i64
    %267 = arith.cmpi sge, %265, %268 : i64
    cf.cond_br %267, ^bb61, ^bb62
    ^bb61:
      %269 = llvm.load %264 : !llvm.ptr -> i64
      %270 = arith.constant 1000 : i32
      %272 = arith.extsi %270 : i32 to i64
      %271 = arith.remsi %269, %272 : i64
      %273 = arith.constant 200 : i32
      %275 = arith.extsi %273 : i32 to i64
      %274 = arith.cmpi eq, %271, %275 : i64
      cf.cond_br %274, ^bb63, ^bb64
      ^bb63:
        %276 = arith.constant 1 : i1
        func.return %276 : i1
      ^bb64:
        cf.br ^bb65
      ^bb65:
      %277 = llvm.load %264 : !llvm.ptr -> i64
      %278 = arith.constant 10 : i32
      %280 = arith.extsi %278 : i32 to i64
      %279 = arith.divsi %277, %280 : i64
      llvm.store %279, %264 : i64, !llvm.ptr
      cf.br ^bb60
    ^bb62:
    %281 = arith.constant 0 : i1
    func.return %281 : i1
  }
  func.func @is_prime_proof(%arg0: i64) -> i1 {
    %283 = arith.constant 20 : i32
    %284 = arith.constant 4 : i32
    %285 = arith.extsi %283 : i32 to i64
    %286 = arith.extsi %284 : i32 to i64
    %282 = func.call @calloc(%285, %286) : (i64, i64) -> !llvm.ptr
    %288 = arith.constant 20 : i32
    %289 = arith.constant 8 : i32
    %290 = arith.extsi %288 : i32 to i64
    %291 = arith.extsi %289 : i32 to i64
    %287 = func.call @calloc(%290, %291) : (i64, i64) -> !llvm.ptr
    %292 = arith.constant 0 : i32
    %293 = llvm.mlir.constant(1 : i64) : i64
    %294 = llvm.alloca %293 x i32 : (i64) -> !llvm.ptr
    llvm.store %292, %294 : i32, !llvm.ptr
    %295 = llvm.mlir.constant(1 : i64) : i64
    %296 = llvm.alloca %295 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %296 : i64, !llvm.ptr
    %297 = arith.constant 1 : i32
    %298 = arith.extsi %297 : i32 to i64
    %299 = llvm.mlir.constant(1 : i64) : i64
    %300 = llvm.alloca %299 x i64 : (i64) -> !llvm.ptr
    llvm.store %298, %300 : i64, !llvm.ptr
    cf.br ^bb66
    ^bb66:
    %301 = llvm.load %296 : !llvm.ptr -> i64
    %302 = arith.constant 0 : i32
    %304 = arith.extsi %302 : i32 to i64
    %303 = arith.cmpi sgt, %301, %304 : i64
    cf.cond_br %303, ^bb67, ^bb68
    ^bb67:
      %305 = llvm.load %296 : !llvm.ptr -> i64
      %306 = arith.constant 10 : i32
      %308 = arith.extsi %306 : i32 to i64
      %307 = arith.remsi %305, %308 : i64
      %309 = arith.trunci %307 : i64 to i32
      %310 = llvm.load %294 : !llvm.ptr -> i32
      %311 = arith.extsi %310 : i32 to i64
      %312 = llvm.getelementptr %282[%311] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      llvm.store %309, %312 : i32, !llvm.ptr
      %313 = llvm.load %300 : !llvm.ptr -> i64
      %314 = llvm.load %294 : !llvm.ptr -> i32
      %315 = arith.extsi %314 : i32 to i64
      %316 = llvm.getelementptr %287[%315] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %313, %316 : i64, !llvm.ptr
      %317 = llvm.load %296 : !llvm.ptr -> i64
      %318 = arith.constant 10 : i32
      %320 = arith.extsi %318 : i32 to i64
      %319 = arith.divsi %317, %320 : i64
      llvm.store %319, %296 : i64, !llvm.ptr
      %321 = llvm.load %300 : !llvm.ptr -> i64
      %322 = arith.constant 10 : i32
      %324 = arith.extsi %322 : i32 to i64
      %323 = arith.muli %321, %324 : i64
      llvm.store %323, %300 : i64, !llvm.ptr
      %325 = llvm.load %294 : !llvm.ptr -> i32
      %326 = arith.constant 1 : i32
      %327 = arith.addi %325, %326 : i32
      llvm.store %327, %294 : i32, !llvm.ptr
      cf.br ^bb66
    ^bb68:
    %328 = llvm.load %294 : !llvm.ptr -> i32
    %329 = arith.constant 1 : i32
    %330 = arith.subi %328, %329 : i32
    %331 = arith.constant 0 : i32
    %332 = llvm.mlir.constant(1 : i64) : i64
    %333 = llvm.alloca %332 x i32 : (i64) -> !llvm.ptr
    llvm.store %331, %333 : i32, !llvm.ptr
    cf.br ^bb69
    ^bb69:
    %334 = llvm.load %333 : !llvm.ptr -> i32
    %335 = llvm.load %294 : !llvm.ptr -> i32
    %336 = arith.cmpi slt, %334, %335 : i32
    cf.cond_br %336, ^bb70, ^bb71
    ^bb70:
      %338 = llvm.load %333 : !llvm.ptr -> i32
      %339 = arith.extsi %338 : i32 to i64
      %340 = llvm.getelementptr %282[%339] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %337 = llvm.load %340 : !llvm.ptr -> i32
      %341 = arith.constant 0 : i32
      %342 = llvm.mlir.constant(1 : i64) : i64
      %343 = llvm.alloca %342 x i32 : (i64) -> !llvm.ptr
      llvm.store %341, %343 : i32, !llvm.ptr
      %344 = llvm.load %333 : !llvm.ptr -> i32
      %345 = arith.cmpi eq, %344, %330 : i32
      cf.cond_br %345, ^bb72, ^bb73
      ^bb72:
        %346 = arith.constant 1 : i32
        llvm.store %346, %343 : i32, !llvm.ptr
        cf.br ^bb74
      ^bb73:
        cf.br ^bb74
      ^bb74:
      %347 = llvm.load %343 : !llvm.ptr -> i32
      %348 = llvm.mlir.constant(1 : i64) : i64
      %349 = llvm.alloca %348 x i32 : (i64) -> !llvm.ptr
      llvm.store %347, %349 : i32, !llvm.ptr
      cf.br ^bb75
      ^bb75:
      %350 = llvm.load %349 : !llvm.ptr -> i32
      %351 = arith.constant 9 : i32
      %352 = arith.cmpi sle, %350, %351 : i32
      cf.cond_br %352, ^bb76, ^bb77
      ^bb76:
        %353 = llvm.load %349 : !llvm.ptr -> i32
        %354 = arith.cmpi ne, %353, %337 : i32
        cf.cond_br %354, ^bb78, ^bb79
        ^bb78:
          %355 = llvm.load %333 : !llvm.ptr -> i32
          %356 = arith.constant 0 : i32
          %357 = arith.cmpi eq, %355, %356 : i32
          %358 = scf.if %357 -> (i1) {
            %359 = llvm.load %349 : !llvm.ptr -> i32
            %360 = arith.constant 2 : i32
            %361 = arith.remsi %359, %360 : i32
            %362 = arith.constant 0 : i32
            %363 = arith.cmpi eq, %361, %362 : i32
            %364 = scf.if %363 -> (i1) {
              %365 = arith.constant true
              scf.yield %365 : i1
            } else {
              %366 = llvm.load %349 : !llvm.ptr -> i32
              %367 = arith.constant 5 : i32
              %368 = arith.cmpi eq, %366, %367 : i32
              scf.yield %368 : i1
            }
            scf.yield %364 : i1
          } else {
            %369 = arith.constant false
            scf.yield %369 : i1
          }
          %371 = arith.constant 1 : i1
          %370 = arith.xori %358, %371 : i1
          cf.cond_br %370, ^bb81, ^bb82
          ^bb81:
            %373 = llvm.load %349 : !llvm.ptr -> i32
            %374 = arith.subi %373, %337 : i32
            %375 = arith.extsi %374 : i32 to i64
            %377 = llvm.load %333 : !llvm.ptr -> i32
            %378 = arith.extsi %377 : i32 to i64
            %379 = llvm.getelementptr %287[%378] : (!llvm.ptr, i64) -> !llvm.ptr, i64
            %376 = llvm.load %379 : !llvm.ptr -> i64
            %380 = arith.muli %375, %376 : i64
            %381 = arith.addi %arg0, %380 : i64
            %382 = func.call @is_prime(%381) : (i64) -> i1
            cf.cond_br %382, ^bb84, ^bb85
            ^bb84:
              func.call @free(%282) : (!llvm.ptr) -> ()
              func.call @free(%287) : (!llvm.ptr) -> ()
              %385 = arith.constant 0 : i1
              func.return %385 : i1
            ^bb85:
              cf.br ^bb86
            ^bb86:
            cf.br ^bb83
          ^bb82:
            cf.br ^bb83
          ^bb83:
          cf.br ^bb80
        ^bb79:
          cf.br ^bb80
        ^bb80:
        %386 = llvm.load %349 : !llvm.ptr -> i32
        %387 = arith.constant 1 : i32
        %388 = arith.addi %386, %387 : i32
        llvm.store %388, %349 : i32, !llvm.ptr
        cf.br ^bb75
      ^bb77:
      %389 = llvm.load %333 : !llvm.ptr -> i32
      %390 = arith.constant 1 : i32
      %391 = arith.addi %389, %390 : i32
      llvm.store %391, %333 : i32, !llvm.ptr
      cf.br ^bb69
    ^bb71:
    func.call @free(%282) : (!llvm.ptr) -> ()
    func.call @free(%287) : (!llvm.ptr) -> ()
    %394 = arith.constant 1 : i1
    func.return %394 : i1
  }
  func.func @isqrt(%arg0: i64) -> i64 {
    %395 = arith.constant 0 : i32
    %397 = arith.extsi %395 : i32 to i64
    %396 = arith.cmpi sle, %arg0, %397 : i64
    cf.cond_br %396, ^bb87, ^bb88
    ^bb87:
      %398 = arith.constant 0 : i32
      %399 = arith.extsi %398 : i32 to i64
      func.return %399 : i64
    ^bb88:
      cf.br ^bb89
    ^bb89:
    %400 = llvm.mlir.constant(1 : i64) : i64
    %401 = llvm.alloca %400 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %401 : i64, !llvm.ptr
    %402 = llvm.load %401 : !llvm.ptr -> i64
    %403 = arith.constant 1 : i32
    %405 = arith.extsi %403 : i32 to i64
    %404 = arith.addi %402, %405 : i64
    %406 = arith.constant 2 : i32
    %408 = arith.extsi %406 : i32 to i64
    %407 = arith.divsi %404, %408 : i64
    %409 = llvm.mlir.constant(1 : i64) : i64
    %410 = llvm.alloca %409 x i64 : (i64) -> !llvm.ptr
    llvm.store %407, %410 : i64, !llvm.ptr
    cf.br ^bb90
    ^bb90:
    %411 = llvm.load %410 : !llvm.ptr -> i64
    %412 = llvm.load %401 : !llvm.ptr -> i64
    %413 = arith.cmpi slt, %411, %412 : i64
    cf.cond_br %413, ^bb91, ^bb92
    ^bb91:
      %414 = llvm.load %410 : !llvm.ptr -> i64
      llvm.store %414, %401 : i64, !llvm.ptr
      %415 = llvm.load %401 : !llvm.ptr -> i64
      %416 = llvm.load %401 : !llvm.ptr -> i64
      %417 = arith.divsi %arg0, %416 : i64
      %418 = arith.addi %415, %417 : i64
      %419 = arith.constant 2 : i32
      %421 = arith.extsi %419 : i32 to i64
      %420 = arith.divsi %418, %421 : i64
      llvm.store %420, %410 : i64, !llvm.ptr
      cf.br ^bb90
    ^bb92:
    %422 = llvm.load %401 : !llvm.ptr -> i64
    func.return %422 : i64
  }
  func.func @main() -> i32 {
    %423 = arith.constant 995705032704 : i32
    %424 = arith.extsi %423 : i32 to i64
    %426 = arith.constant 8 : i32
    %428 = arith.extsi %426 : i32 to i64
    %427 = arith.divsi %424, %428 : i64
    %425 = func.call @isqrt(%427) : (i64) -> i64
    %429 = arith.constant 1 : i32
    %431 = arith.extsi %429 : i32 to i64
    %430 = arith.addi %425, %431 : i64
    %433 = arith.constant 1 : i32
    %435 = arith.extsi %433 : i32 to i64
    %434 = arith.addi %430, %435 : i64
    %436 = arith.constant 1 : i32
    %437 = arith.extsi %436 : i32 to i64
    %432 = func.call @calloc(%434, %437) : (i64, i64) -> !llvm.ptr
    %438 = llvm.mlir.zero : !llvm.ptr
    %439 = llvm.icmp "eq" %432, %438 : !llvm.ptr
    cf.cond_br %439, ^bb93, ^bb94
    ^bb93:
      %440 = arith.constant 1 : i32
      func.return %440 : i32
    ^bb94:
      cf.br ^bb95
    ^bb95:
    %441 = arith.constant 0 : i32
    %442 = arith.extsi %441 : i32 to i64
    %443 = llvm.mlir.constant(1 : i64) : i64
    %444 = llvm.alloca %443 x i64 : (i64) -> !llvm.ptr
    llvm.store %442, %444 : i64, !llvm.ptr
    cf.br ^bb96
    ^bb96:
    %445 = llvm.load %444 : !llvm.ptr -> i64
    %446 = arith.cmpi sle, %445, %430 : i64
    cf.cond_br %446, ^bb97, ^bb98
    ^bb97:
      %447 = arith.constant 1 : i32
      %448 = llvm.load %444 : !llvm.ptr -> i64
      %449 = arith.trunci %447 : i32 to i8
      %450 = llvm.getelementptr %432[%448] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      llvm.store %449, %450 : i8, !llvm.ptr
      %451 = llvm.load %444 : !llvm.ptr -> i64
      %452 = arith.constant 1 : i32
      %454 = arith.extsi %452 : i32 to i64
      %453 = arith.addi %451, %454 : i64
      llvm.store %453, %444 : i64, !llvm.ptr
      cf.br ^bb96
    ^bb98:
    %455 = arith.constant 0 : i32
    %456 = arith.constant 0 : i32
    %457 = arith.trunci %455 : i32 to i8
    %458 = arith.extsi %456 : i32 to i64
    %459 = llvm.getelementptr %432[%458] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %457, %459 : i8, !llvm.ptr
    %460 = arith.constant 0 : i32
    %461 = arith.constant 1 : i32
    %462 = arith.trunci %460 : i32 to i8
    %463 = arith.extsi %461 : i32 to i64
    %464 = llvm.getelementptr %432[%463] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %462, %464 : i8, !llvm.ptr
    %465 = arith.constant 2 : i32
    %466 = arith.extsi %465 : i32 to i64
    %467 = llvm.mlir.constant(1 : i64) : i64
    %468 = llvm.alloca %467 x i64 : (i64) -> !llvm.ptr
    llvm.store %466, %468 : i64, !llvm.ptr
    cf.br ^bb99
    ^bb99:
    %469 = llvm.load %468 : !llvm.ptr -> i64
    %470 = llvm.load %468 : !llvm.ptr -> i64
    %471 = arith.muli %469, %470 : i64
    %472 = arith.cmpi sle, %471, %430 : i64
    cf.cond_br %472, ^bb100, ^bb101
    ^bb100:
      %474 = llvm.load %468 : !llvm.ptr -> i64
      %475 = llvm.getelementptr %432[%474] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %473 = llvm.load %475 : !llvm.ptr -> i8
      %476 = arith.constant 1 : i32
      %478 = arith.extsi %473 : i8 to i32
      %477 = arith.cmpi eq, %478, %476 : i32
      cf.cond_br %477, ^bb102, ^bb103
      ^bb102:
        %479 = llvm.load %468 : !llvm.ptr -> i64
        %480 = llvm.load %468 : !llvm.ptr -> i64
        %481 = arith.muli %479, %480 : i64
        %482 = llvm.mlir.constant(1 : i64) : i64
        %483 = llvm.alloca %482 x i64 : (i64) -> !llvm.ptr
        llvm.store %481, %483 : i64, !llvm.ptr
        cf.br ^bb105
        ^bb105:
        %484 = llvm.load %483 : !llvm.ptr -> i64
        %485 = arith.cmpi sle, %484, %430 : i64
        cf.cond_br %485, ^bb106, ^bb107
        ^bb106:
          %486 = arith.constant 0 : i32
          %487 = llvm.load %483 : !llvm.ptr -> i64
          %488 = arith.trunci %486 : i32 to i8
          %489 = llvm.getelementptr %432[%487] : (!llvm.ptr, i64) -> !llvm.ptr, i8
          llvm.store %488, %489 : i8, !llvm.ptr
          %490 = llvm.load %483 : !llvm.ptr -> i64
          %491 = llvm.load %468 : !llvm.ptr -> i64
          %492 = arith.addi %490, %491 : i64
          llvm.store %492, %483 : i64, !llvm.ptr
          cf.br ^bb105
        ^bb107:
        cf.br ^bb104
      ^bb103:
        cf.br ^bb104
      ^bb104:
      %493 = llvm.load %468 : !llvm.ptr -> i64
      %494 = arith.constant 1 : i32
      %496 = arith.extsi %494 : i32 to i64
      %495 = arith.addi %493, %496 : i64
      llvm.store %495, %468 : i64, !llvm.ptr
      cf.br ^bb99
    ^bb101:
    %497 = arith.constant 0 : i32
    %498 = arith.extsi %497 : i32 to i64
    %499 = llvm.mlir.constant(1 : i64) : i64
    %500 = llvm.alloca %499 x i64 : (i64) -> !llvm.ptr
    llvm.store %498, %500 : i64, !llvm.ptr
    %501 = arith.constant 2 : i32
    %502 = arith.extsi %501 : i32 to i64
    llvm.store %502, %444 : i64, !llvm.ptr
    cf.br ^bb108
    ^bb108:
    %503 = llvm.load %444 : !llvm.ptr -> i64
    %504 = arith.cmpi sle, %503, %430 : i64
    cf.cond_br %504, ^bb109, ^bb110
    ^bb109:
      %506 = llvm.load %444 : !llvm.ptr -> i64
      %507 = llvm.getelementptr %432[%506] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %505 = llvm.load %507 : !llvm.ptr -> i8
      %508 = arith.constant 1 : i32
      %510 = arith.extsi %505 : i8 to i32
      %509 = arith.cmpi eq, %510, %508 : i32
      cf.cond_br %509, ^bb111, ^bb112
      ^bb111:
        %511 = llvm.load %500 : !llvm.ptr -> i64
        %512 = arith.constant 1 : i32
        %514 = arith.extsi %512 : i32 to i64
        %513 = arith.addi %511, %514 : i64
        llvm.store %513, %500 : i64, !llvm.ptr
        cf.br ^bb113
      ^bb112:
        cf.br ^bb113
      ^bb113:
      %515 = llvm.load %444 : !llvm.ptr -> i64
      %516 = arith.constant 1 : i32
      %518 = arith.extsi %516 : i32 to i64
      %517 = arith.addi %515, %518 : i64
      llvm.store %517, %444 : i64, !llvm.ptr
      cf.br ^bb108
    ^bb110:
    %520 = llvm.load %500 : !llvm.ptr -> i64
    %521 = arith.constant 8 : i32
    %522 = arith.extsi %521 : i32 to i64
    %519 = func.call @calloc(%520, %522) : (i64, i64) -> !llvm.ptr
    %523 = arith.constant 0 : i32
    %524 = arith.extsi %523 : i32 to i64
    %525 = llvm.mlir.constant(1 : i64) : i64
    %526 = llvm.alloca %525 x i64 : (i64) -> !llvm.ptr
    llvm.store %524, %526 : i64, !llvm.ptr
    %527 = arith.constant 2 : i32
    %528 = arith.extsi %527 : i32 to i64
    llvm.store %528, %444 : i64, !llvm.ptr
    cf.br ^bb114
    ^bb114:
    %529 = llvm.load %444 : !llvm.ptr -> i64
    %530 = arith.cmpi sle, %529, %430 : i64
    cf.cond_br %530, ^bb115, ^bb116
    ^bb115:
      %532 = llvm.load %444 : !llvm.ptr -> i64
      %533 = llvm.getelementptr %432[%532] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      %531 = llvm.load %533 : !llvm.ptr -> i8
      %534 = arith.constant 1 : i32
      %536 = arith.extsi %531 : i8 to i32
      %535 = arith.cmpi eq, %536, %534 : i32
      cf.cond_br %535, ^bb117, ^bb118
      ^bb117:
        %537 = llvm.load %444 : !llvm.ptr -> i64
        %538 = llvm.load %526 : !llvm.ptr -> i64
        %539 = llvm.getelementptr %519[%538] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %537, %539 : i64, !llvm.ptr
        %540 = llvm.load %526 : !llvm.ptr -> i64
        %541 = arith.constant 1 : i32
        %543 = arith.extsi %541 : i32 to i64
        %542 = arith.addi %540, %543 : i64
        llvm.store %542, %526 : i64, !llvm.ptr
        cf.br ^bb119
      ^bb118:
        cf.br ^bb119
      ^bb119:
      %544 = llvm.load %444 : !llvm.ptr -> i64
      %545 = arith.constant 1 : i32
      %547 = arith.extsi %545 : i32 to i64
      %546 = arith.addi %544, %547 : i64
      llvm.store %546, %444 : i64, !llvm.ptr
      cf.br ^bb114
    ^bb116:
    %549 = arith.constant 5000000 : i32
    %550 = arith.constant 8 : i32
    %551 = arith.extsi %549 : i32 to i64
    %552 = arith.extsi %550 : i32 to i64
    %548 = func.call @calloc(%551, %552) : (i64, i64) -> !llvm.ptr
    %553 = arith.constant 0 : i32
    %554 = arith.extsi %553 : i32 to i64
    %555 = llvm.mlir.constant(1 : i64) : i64
    %556 = llvm.alloca %555 x i64 : (i64) -> !llvm.ptr
    llvm.store %554, %556 : i64, !llvm.ptr
    %557 = arith.constant 0 : i32
    %558 = arith.extsi %557 : i32 to i64
    %559 = llvm.mlir.constant(1 : i64) : i64
    %560 = llvm.alloca %559 x i64 : (i64) -> !llvm.ptr
    llvm.store %558, %560 : i64, !llvm.ptr
    cf.br ^bb120
    ^bb120:
    %561 = llvm.load %560 : !llvm.ptr -> i64
    %562 = llvm.load %500 : !llvm.ptr -> i64
    %563 = arith.cmpi slt, %561, %562 : i64
    cf.cond_br %563, ^bb121, ^bb122
    ^bb121:
      %565 = llvm.load %560 : !llvm.ptr -> i64
      %566 = llvm.getelementptr %519[%565] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %564 = llvm.load %566 : !llvm.ptr -> i64
      %567 = arith.muli %564, %564 : i64
      %568 = arith.constant 8 : i32
      %570 = arith.extsi %568 : i32 to i64
      %569 = arith.divsi %424, %570 : i64
      %571 = arith.cmpi sgt, %567, %569 : i64
      cf.cond_br %571, ^bb123, ^bb124
      ^bb123:
        cf.br ^bb122
      ^bb124:
        cf.br ^bb125
      ^bb125:
      %572 = arith.constant 0 : i32
      %573 = arith.extsi %572 : i32 to i64
      %574 = llvm.mlir.constant(1 : i64) : i64
      %575 = llvm.alloca %574 x i64 : (i64) -> !llvm.ptr
      llvm.store %573, %575 : i64, !llvm.ptr
      cf.br ^bb126
      ^bb126:
      %576 = llvm.load %575 : !llvm.ptr -> i64
      %577 = llvm.load %500 : !llvm.ptr -> i64
      %578 = arith.cmpi slt, %576, %577 : i64
      cf.cond_br %578, ^bb127, ^bb128
      ^bb127:
        %580 = llvm.load %575 : !llvm.ptr -> i64
        %581 = llvm.getelementptr %519[%580] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %579 = llvm.load %581 : !llvm.ptr -> i64
        %582 = arith.cmpi ne, %579, %564 : i64
        cf.cond_br %582, ^bb129, ^bb130
        ^bb129:
          %583 = arith.constant 1000000 : i32
          %585 = arith.extsi %583 : i32 to i64
          %584 = arith.cmpi sgt, %579, %585 : i64
          cf.cond_br %584, ^bb132, ^bb133
          ^bb132:
            cf.br ^bb128
          ^bb133:
            cf.br ^bb134
          ^bb134:
          %586 = arith.constant 100000 : i32
          %588 = arith.extsi %586 : i32 to i64
          %587 = arith.cmpi sgt, %579, %588 : i64
          cf.cond_br %587, ^bb135, ^bb136
          ^bb135:
            cf.br ^bb137
          ^bb136:
            cf.br ^bb137
          ^bb137:
          %589 = arith.muli %579, %579 : i64
          %590 = arith.divsi %424, %579 : i64
          %591 = arith.cmpi sgt, %589, %590 : i64
          cf.cond_br %591, ^bb138, ^bb139
          ^bb138:
            cf.br ^bb128
          ^bb139:
            cf.br ^bb140
          ^bb140:
          %592 = arith.muli %589, %579 : i64
          %593 = arith.divsi %424, %567 : i64
          %594 = arith.cmpi sgt, %592, %593 : i64
          cf.cond_br %594, ^bb141, ^bb142
          ^bb141:
            cf.br ^bb128
          ^bb142:
            cf.br ^bb143
          ^bb143:
          %595 = arith.muli %567, %592 : i64
          %596 = llvm.load %556 : !llvm.ptr -> i64
          %597 = llvm.getelementptr %548[%596] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %595, %597 : i64, !llvm.ptr
          %598 = llvm.load %556 : !llvm.ptr -> i64
          %599 = arith.constant 1 : i32
          %601 = arith.extsi %599 : i32 to i64
          %600 = arith.addi %598, %601 : i64
          llvm.store %600, %556 : i64, !llvm.ptr
          cf.br ^bb131
        ^bb130:
          cf.br ^bb131
        ^bb131:
        %602 = llvm.load %575 : !llvm.ptr -> i64
        %603 = arith.constant 1 : i32
        %605 = arith.extsi %603 : i32 to i64
        %604 = arith.addi %602, %605 : i64
        llvm.store %604, %575 : i64, !llvm.ptr
        cf.br ^bb126
      ^bb128:
      %606 = llvm.load %560 : !llvm.ptr -> i64
      %607 = arith.constant 1 : i32
      %609 = arith.extsi %607 : i32 to i64
      %608 = arith.addi %606, %609 : i64
      llvm.store %608, %560 : i64, !llvm.ptr
      cf.br ^bb120
    ^bb122:
    %610 = llvm.load %556 : !llvm.ptr -> i64
    %611 = arith.constant 2 : i32
    %613 = arith.extsi %611 : i32 to i64
    %612 = arith.divsi %610, %613 : i64
    %614 = llvm.mlir.constant(1 : i64) : i64
    %615 = llvm.alloca %614 x i64 : (i64) -> !llvm.ptr
    llvm.store %612, %615 : i64, !llvm.ptr
    cf.br ^bb144
    ^bb144:
    %616 = llvm.load %615 : !llvm.ptr -> i64
    %617 = arith.constant 0 : i32
    %619 = arith.extsi %617 : i32 to i64
    %618 = arith.cmpi sgt, %616, %619 : i64
    cf.cond_br %618, ^bb145, ^bb146
    ^bb145:
      %620 = llvm.load %615 : !llvm.ptr -> i64
      %621 = llvm.mlir.constant(1 : i64) : i64
      %622 = llvm.alloca %621 x i64 : (i64) -> !llvm.ptr
      llvm.store %620, %622 : i64, !llvm.ptr
      cf.br ^bb147
      ^bb147:
      %623 = llvm.load %622 : !llvm.ptr -> i64
      %624 = llvm.load %556 : !llvm.ptr -> i64
      %625 = arith.cmpi slt, %623, %624 : i64
      cf.cond_br %625, ^bb148, ^bb149
      ^bb148:
        %627 = llvm.load %622 : !llvm.ptr -> i64
        %628 = llvm.getelementptr %548[%627] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %626 = llvm.load %628 : !llvm.ptr -> i64
        %629 = llvm.load %622 : !llvm.ptr -> i64
        %630 = llvm.mlir.constant(1 : i64) : i64
        %631 = llvm.alloca %630 x i64 : (i64) -> !llvm.ptr
        llvm.store %629, %631 : i64, !llvm.ptr
        cf.br ^bb150
        ^bb150:
        %632 = llvm.load %631 : !llvm.ptr -> i64
        %633 = llvm.load %615 : !llvm.ptr -> i64
        %634 = arith.cmpi sge, %632, %633 : i64
        %635 = scf.if %634 -> (i1) {
          %637 = llvm.load %631 : !llvm.ptr -> i64
          %638 = llvm.load %615 : !llvm.ptr -> i64
          %639 = arith.subi %637, %638 : i64
          %640 = llvm.getelementptr %548[%639] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %636 = llvm.load %640 : !llvm.ptr -> i64
          %641 = arith.cmpi sgt, %636, %626 : i64
          scf.yield %641 : i1
        } else {
          %642 = arith.constant false
          scf.yield %642 : i1
        }
        cf.cond_br %635, ^bb151, ^bb152
        ^bb151:
          %644 = llvm.load %631 : !llvm.ptr -> i64
          %645 = llvm.load %615 : !llvm.ptr -> i64
          %646 = arith.subi %644, %645 : i64
          %647 = llvm.getelementptr %548[%646] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %643 = llvm.load %647 : !llvm.ptr -> i64
          %648 = llvm.load %631 : !llvm.ptr -> i64
          %649 = llvm.getelementptr %548[%648] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %643, %649 : i64, !llvm.ptr
          %650 = llvm.load %631 : !llvm.ptr -> i64
          %651 = llvm.load %615 : !llvm.ptr -> i64
          %652 = arith.subi %650, %651 : i64
          llvm.store %652, %631 : i64, !llvm.ptr
          cf.br ^bb150
        ^bb152:
        %653 = llvm.load %631 : !llvm.ptr -> i64
        %654 = llvm.getelementptr %548[%653] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %626, %654 : i64, !llvm.ptr
        %655 = llvm.load %622 : !llvm.ptr -> i64
        %656 = arith.constant 1 : i32
        %658 = arith.extsi %656 : i32 to i64
        %657 = arith.addi %655, %658 : i64
        llvm.store %657, %622 : i64, !llvm.ptr
        cf.br ^bb147
      ^bb149:
      %659 = llvm.load %615 : !llvm.ptr -> i64
      %660 = arith.constant 2 : i32
      %662 = arith.extsi %660 : i32 to i64
      %661 = arith.divsi %659, %662 : i64
      llvm.store %661, %615 : i64, !llvm.ptr
      cf.br ^bb144
    ^bb146:
    %663 = arith.constant 0 : i32
    %664 = arith.extsi %663 : i32 to i64
    %665 = llvm.mlir.constant(1 : i64) : i64
    %666 = llvm.alloca %665 x i64 : (i64) -> !llvm.ptr
    llvm.store %664, %666 : i64, !llvm.ptr
    %667 = arith.constant 0 : i32
    %668 = arith.extsi %667 : i32 to i64
    %669 = llvm.mlir.constant(1 : i64) : i64
    %670 = llvm.alloca %669 x i64 : (i64) -> !llvm.ptr
    llvm.store %668, %670 : i64, !llvm.ptr
    %671 = arith.constant 0 : i32
    %672 = arith.extsi %671 : i32 to i64
    llvm.store %672, %444 : i64, !llvm.ptr
    cf.br ^bb153
    ^bb153:
    %673 = llvm.load %444 : !llvm.ptr -> i64
    %674 = llvm.load %556 : !llvm.ptr -> i64
    %675 = arith.cmpi slt, %673, %674 : i64
    cf.cond_br %675, ^bb154, ^bb155
    ^bb154:
      %677 = llvm.load %444 : !llvm.ptr -> i64
      %678 = llvm.getelementptr %548[%677] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %676 = llvm.load %678 : !llvm.ptr -> i64
      %679 = func.call @contains_200(%676) : (i64) -> i1
      cf.cond_br %679, ^bb156, ^bb157
      ^bb156:
        %680 = func.call @is_prime_proof(%676) : (i64) -> i1
        cf.cond_br %680, ^bb159, ^bb160
        ^bb159:
          %681 = llvm.load %666 : !llvm.ptr -> i64
          %682 = arith.constant 1 : i32
          %684 = arith.extsi %682 : i32 to i64
          %683 = arith.addi %681, %684 : i64
          llvm.store %683, %666 : i64, !llvm.ptr
          %685 = llvm.load %666 : !llvm.ptr -> i64
          %686 = arith.constant 200 : i32
          %688 = arith.extsi %686 : i32 to i64
          %687 = arith.cmpi eq, %685, %688 : i64
          cf.cond_br %687, ^bb162, ^bb163
          ^bb162:
            llvm.store %676, %670 : i64, !llvm.ptr
            cf.br ^bb155
          ^bb163:
            cf.br ^bb164
          ^bb164:
          cf.br ^bb161
        ^bb160:
          cf.br ^bb161
        ^bb161:
        cf.br ^bb158
      ^bb157:
        cf.br ^bb158
      ^bb158:
      %689 = llvm.load %444 : !llvm.ptr -> i64
      %690 = arith.constant 1 : i32
      %692 = arith.extsi %690 : i32 to i64
      %691 = arith.addi %689, %692 : i64
      llvm.store %691, %444 : i64, !llvm.ptr
      cf.br ^bb153
    ^bb155:
    %693 = llvm.mlir.addressof @str_0 : !llvm.ptr
    %694 = llvm.load %670 : !llvm.ptr -> i64
    %695 = llvm.call @printf(%693, %694) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
    func.call @free(%432) : (!llvm.ptr) -> ()
    func.call @free(%519) : (!llvm.ptr) -> ()
    func.call @free(%548) : (!llvm.ptr) -> ()
    %699 = arith.constant 0 : i32
    func.return %699 : i32
  }
}