← All problems
Problem 157
Count solutions to 1/a + 1/b = p / 10^n for n=1..9.
View problem on Project Euler
Performance comparison
Metric Our solution Best known
Time complexity O(n^3)O(n log n)
Space complexity O(1)O(1)
Approach Flow solution Divisor-based Diophantine solver
Verdict Suboptimal
Flow source
# Project Euler 157
# Count solutions to 1/a + 1/b = p / 10^n for n=1..9.
import euler.nt { gcd }
function divisor_count(m: i64, s0: i64) -> i64 {
let mut a2: i64 = 0
let mut a5: i64 = 0
let mut mm: i64 = m
while mm % 2 == 0 { mm = mm / 2; a2 = a2 + 1 }
while mm % 5 == 0 { mm = mm / 5; a5 = a5 + 1 }
let mut ss: i64 = s0
while ss % 2 == 0 { ss = ss / 2; a2 = a2 + 1 }
while ss % 5 == 0 { ss = ss / 5; a5 = a5 + 1 }
let mut d: i64 = (a2 + 1) * (a5 + 1)
# factor ss
let mut x: i64 = ss
let mut p: i64 = 3
while p * p <= x {
if x % p == 0 {
let mut e: i64 = 0
while x % p == 0 {
x = x / p
e = e + 1
}
d = d * (e + 1)
}
p = p + 2
}
if x > 1 { d = d * 2 }
return d
}
function ipow10(n: i32) -> i64 {
let mut r: i64 = 1
for i in 0..n {
r = r * 10
}
return r
}
function count_for_n(n: i32) -> i64 {
let N: i64 = ipow10(n)
# divisors of 10^n: 2^i * 5^j
let mut divs: array<i64, 100> = [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
]
let mut nd: i32 = 0
for i in 0..(n + 1) {
let mut p2: i64 = 1
for t in 0..i { p2 = p2 * 2 }
for j in 0..(n + 1) {
let mut p5: i64 = 1
for t in 0..j { p5 = p5 * 5 }
divs[nd] = p2 * p5
nd = nd + 1
}
}
# sort divs (small)
for a in 0..nd {
for b in (a + 1)..nd {
if divs[b] < divs[a] {
let tmp: i64 = divs[a]
divs[a] = divs[b]
divs[b] = tmp
}
}
}
let mut total: i64 = 0
for xi in 0..nd {
for yi in xi..nd {
let x: i64 = divs[xi]
let y: i64 = divs[yi]
if gcd(x, y) == 1 {
let xy: i64 = x * y
if xy <= N {
let m: i64 = N / xy
total = total + divisor_count(m, x + y)
}
}
}
}
return total
}
function main() -> i32 {
let mut ans: i64 = 0
for n in 1..10 {
ans = ans + count_for_n(n)
}
printf("%lld\n", ans)
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);
int64_t divisor_count_i64_i64(int64_t m, int64_t s0);
int64_t ipow10_i32(int32_t n);
int64_t count_for_n_i32(int32_t n);
int32_t main(void);
int64_t gcd_i64_i64(int64_t a0, int64_t b0) {
int64_t a = a0;
int64_t b = b0;
while (b != 0) {
int64_t t = FLOW_CHECKED_MOD((a), (b));
a = b;
b = t;
}
return a;
}
int64_t lcm_i64_i64(int64_t a, int64_t b) {
if ((a == 0 || b == 0)) {
return 0;
}
return (FLOW_CHECKED_DIV((a), (gcd_i64_i64(a, b))) * b);
}
int64_t isqrt_i64(int64_t n) {
if (n < 2) {
return n;
}
int64_t x = n;
int64_t y = FLOW_CHECKED_DIV(((x + 1)), (2));
while (y < x) {
x = y;
y = FLOW_CHECKED_DIV(((x + FLOW_CHECKED_DIV((n), (x)))), (2));
}
return x;
}
int64_t mulmod_i64_i64_i64(int64_t a0, int64_t b0, int64_t mod) {
int64_t a = FLOW_CHECKED_MOD((a0), (mod));
int64_t b = FLOW_CHECKED_MOD((b0), (mod));
int64_t result = 0;
while (b > 0) {
if (FLOW_CHECKED_MOD((b), (2)) == 1) {
result = FLOW_CHECKED_MOD(((result + a)), (mod));
}
a = FLOW_CHECKED_MOD(((a * 2)), (mod));
b = FLOW_CHECKED_DIV((b), (2));
}
return result;
}
int64_t mod_pow_i64_i64_i64(int64_t base, int64_t exp, int64_t mod) {
if (mod == 1) {
return 0;
}
int64_t result = 1;
int64_t b = FLOW_CHECKED_MOD((base), (mod));
int64_t e = exp;
while (e > 0) {
if (FLOW_CHECKED_MOD((e), (2)) == 1) {
result = mulmod_i64_i64_i64(result, b, mod);
}
b = mulmod_i64_i64_i64(b, b, mod);
e = FLOW_CHECKED_DIV((e), (2));
}
return result;
}
bool is_prime_i64(int64_t n) {
if (n < 2) {
return 0;
}
if (n < 4) {
return 1;
}
if ((FLOW_CHECKED_MOD((n), (2)) == 0 || FLOW_CHECKED_MOD((n), (3)) == 0)) {
return 0;
}
int64_t i = 5;
while ((i * i) <= n) {
if ((FLOW_CHECKED_MOD((n), (i)) == 0 || FLOW_CHECKED_MOD((n), ((i + 2))) == 0)) {
return 0;
}
i = (i + 6);
}
return 1;
}
int64_t divisor_count_i64_i64(int64_t m, int64_t s0) {
int64_t a2 = 0;
int64_t a5 = 0;
int64_t mm = m;
while (FLOW_CHECKED_MOD((mm), (2)) == 0) {
mm = FLOW_CHECKED_DIV((mm), (2));
a2 = (a2 + 1);
}
while (FLOW_CHECKED_MOD((mm), (5)) == 0) {
mm = FLOW_CHECKED_DIV((mm), (5));
a5 = (a5 + 1);
}
int64_t ss = s0;
while (FLOW_CHECKED_MOD((ss), (2)) == 0) {
ss = FLOW_CHECKED_DIV((ss), (2));
a2 = (a2 + 1);
}
while (FLOW_CHECKED_MOD((ss), (5)) == 0) {
ss = FLOW_CHECKED_DIV((ss), (5));
a5 = (a5 + 1);
}
int64_t d = ((a2 + 1) * (a5 + 1));
int64_t x = ss;
int64_t p = 3;
while ((p * p) <= x) {
if (FLOW_CHECKED_MOD((x), (p)) == 0) {
int64_t e = 0;
while (FLOW_CHECKED_MOD((x), (p)) == 0) {
x = FLOW_CHECKED_DIV((x), (p));
e = (e + 1);
}
d = (d * (e + 1));
}
p = (p + 2);
}
if (x > 1) {
d = (d * 2);
}
return d;
}
int64_t ipow10_i32(int32_t n) {
int64_t r = 1;
int32_t __flow_step_1 = 1;
for (int32_t i = 0; (0 <= n) ? i < n : i > n; i += (0 <= n) ? 1 : -1) {
r = (r * 10);
}
return r;
}
int64_t count_for_n_i32(int32_t n) {
int64_t N = ipow10_i32(n);
int64_t divs[100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int32_t nd = 0;
int32_t __flow_step_2 = 1;
for (int32_t i = 0; (0 <= (n + 1)) ? i < (n + 1) : i > (n + 1); i += (0 <= (n + 1)) ? 1 : -1) {
int64_t p2 = 1;
int32_t __flow_step_3 = 1;
for (int32_t t = 0; (0 <= i) ? t < i : t > i; t += (0 <= i) ? 1 : -1) {
p2 = (p2 * 2);
}
int32_t __flow_step_4 = 1;
for (int32_t j = 0; (0 <= (n + 1)) ? j < (n + 1) : j > (n + 1); j += (0 <= (n + 1)) ? 1 : -1) {
int64_t p5 = 1;
int32_t __flow_step_5 = 1;
for (int32_t t = 0; (0 <= j) ? t < j : t > j; t += (0 <= j) ? 1 : -1) {
p5 = (p5 * 5);
}
divs[nd] = (p2 * p5);
nd = (nd + 1);
}
}
int32_t __flow_step_6 = 1;
for (int32_t a = 0; (0 <= nd) ? a < nd : a > nd; a += (0 <= nd) ? 1 : -1) {
int32_t __flow_step_7 = 1;
for (int32_t b = (a + 1); ((a + 1) <= nd) ? b < nd : b > nd; b += ((a + 1) <= nd) ? 1 : -1) {
if ((((unsigned)(b) < 100) ? divs[b] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(b), 100), flow_fault_handler("array index out of bounds"), divs[0])) < (((unsigned)(a) < 100) ? divs[a] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(a), 100), flow_fault_handler("array index out of bounds"), divs[0]))) {
int64_t tmp = (((unsigned)(a) < 100) ? divs[a] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(a), 100), flow_fault_handler("array index out of bounds"), divs[0]));
divs[a] = (((unsigned)(b) < 100) ? divs[b] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(b), 100), flow_fault_handler("array index out of bounds"), divs[0]));
divs[b] = tmp;
}
}
}
int64_t total = 0;
int32_t __flow_step_8 = 1;
for (int32_t xi = 0; (0 <= nd) ? xi < nd : xi > nd; xi += (0 <= nd) ? 1 : -1) {
int32_t __flow_step_9 = 1;
for (int32_t yi = xi; (xi <= nd) ? yi < nd : yi > nd; yi += (xi <= nd) ? 1 : -1) {
int64_t x = (((unsigned)(xi) < 100) ? divs[xi] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(xi), 100), flow_fault_handler("array index out of bounds"), divs[0]));
int64_t y = (((unsigned)(yi) < 100) ? divs[yi] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(yi), 100), flow_fault_handler("array index out of bounds"), divs[0]));
if (gcd_i64_i64(x, y) == 1) {
int64_t xy = (x * y);
if (xy <= N) {
int64_t m = FLOW_CHECKED_DIV((N), (xy));
total = (total + divisor_count_i64_i64(m, (x + y)));
}
}
}
}
return total;
}
int32_t main(void) {
int64_t ans = 0;
int32_t __flow_step_10 = 1;
for (int32_t n = 1; (1 <= 10) ? n < 10 : n > 10; n += (1 <= 10) ? 1 : -1) {
ans = (ans + count_for_n_i32(n));
}
printf("%lld\n", ans);
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 @divisor_count(%arg0: i64, %arg1: i64) -> i64 {
%175 = arith.constant 0 : i32
%176 = arith.extsi %175 : i32 to i64
%177 = llvm.mlir.constant(1 : i64) : i64
%178 = llvm.alloca %177 x i64 : (i64) -> !llvm.ptr
llvm.store %176, %178 : i64, !llvm.ptr
%179 = arith.constant 0 : i32
%180 = arith.extsi %179 : i32 to i64
%181 = llvm.mlir.constant(1 : i64) : i64
%182 = llvm.alloca %181 x i64 : (i64) -> !llvm.ptr
llvm.store %180, %182 : i64, !llvm.ptr
%183 = llvm.mlir.constant(1 : i64) : i64
%184 = llvm.alloca %183 x i64 : (i64) -> !llvm.ptr
llvm.store %arg0, %184 : i64, !llvm.ptr
cf.br ^bb42
^bb42:
%185 = llvm.load %184 : !llvm.ptr -> i64
%186 = arith.constant 2 : i32
%188 = arith.extsi %186 : i32 to i64
%187 = arith.remsi %185, %188 : i64
%189 = arith.constant 0 : i32
%191 = arith.extsi %189 : i32 to i64
%190 = arith.cmpi eq, %187, %191 : i64
cf.cond_br %190, ^bb43, ^bb44
^bb43:
%192 = llvm.load %184 : !llvm.ptr -> i64
%193 = arith.constant 2 : i32
%195 = arith.extsi %193 : i32 to i64
%194 = arith.divsi %192, %195 : i64
llvm.store %194, %184 : i64, !llvm.ptr
%196 = llvm.load %178 : !llvm.ptr -> i64
%197 = arith.constant 1 : i32
%199 = arith.extsi %197 : i32 to i64
%198 = arith.addi %196, %199 : i64
llvm.store %198, %178 : i64, !llvm.ptr
cf.br ^bb42
^bb44:
cf.br ^bb45
^bb45:
%200 = llvm.load %184 : !llvm.ptr -> i64
%201 = arith.constant 5 : i32
%203 = arith.extsi %201 : i32 to i64
%202 = arith.remsi %200, %203 : i64
%204 = arith.constant 0 : i32
%206 = arith.extsi %204 : i32 to i64
%205 = arith.cmpi eq, %202, %206 : i64
cf.cond_br %205, ^bb46, ^bb47
^bb46:
%207 = llvm.load %184 : !llvm.ptr -> i64
%208 = arith.constant 5 : i32
%210 = arith.extsi %208 : i32 to i64
%209 = arith.divsi %207, %210 : i64
llvm.store %209, %184 : i64, !llvm.ptr
%211 = llvm.load %182 : !llvm.ptr -> i64
%212 = arith.constant 1 : i32
%214 = arith.extsi %212 : i32 to i64
%213 = arith.addi %211, %214 : i64
llvm.store %213, %182 : i64, !llvm.ptr
cf.br ^bb45
^bb47:
%215 = llvm.mlir.constant(1 : i64) : i64
%216 = llvm.alloca %215 x i64 : (i64) -> !llvm.ptr
llvm.store %arg1, %216 : i64, !llvm.ptr
cf.br ^bb48
^bb48:
%217 = llvm.load %216 : !llvm.ptr -> i64
%218 = arith.constant 2 : i32
%220 = arith.extsi %218 : i32 to i64
%219 = arith.remsi %217, %220 : i64
%221 = arith.constant 0 : i32
%223 = arith.extsi %221 : i32 to i64
%222 = arith.cmpi eq, %219, %223 : i64
cf.cond_br %222, ^bb49, ^bb50
^bb49:
%224 = llvm.load %216 : !llvm.ptr -> i64
%225 = arith.constant 2 : i32
%227 = arith.extsi %225 : i32 to i64
%226 = arith.divsi %224, %227 : i64
llvm.store %226, %216 : i64, !llvm.ptr
%228 = llvm.load %178 : !llvm.ptr -> i64
%229 = arith.constant 1 : i32
%231 = arith.extsi %229 : i32 to i64
%230 = arith.addi %228, %231 : i64
llvm.store %230, %178 : i64, !llvm.ptr
cf.br ^bb48
^bb50:
cf.br ^bb51
^bb51:
%232 = llvm.load %216 : !llvm.ptr -> i64
%233 = arith.constant 5 : i32
%235 = arith.extsi %233 : i32 to i64
%234 = arith.remsi %232, %235 : i64
%236 = arith.constant 0 : i32
%238 = arith.extsi %236 : i32 to i64
%237 = arith.cmpi eq, %234, %238 : i64
cf.cond_br %237, ^bb52, ^bb53
^bb52:
%239 = llvm.load %216 : !llvm.ptr -> i64
%240 = arith.constant 5 : i32
%242 = arith.extsi %240 : i32 to i64
%241 = arith.divsi %239, %242 : i64
llvm.store %241, %216 : i64, !llvm.ptr
%243 = llvm.load %182 : !llvm.ptr -> i64
%244 = arith.constant 1 : i32
%246 = arith.extsi %244 : i32 to i64
%245 = arith.addi %243, %246 : i64
llvm.store %245, %182 : i64, !llvm.ptr
cf.br ^bb51
^bb53:
%247 = llvm.load %178 : !llvm.ptr -> i64
%248 = arith.constant 1 : i32
%250 = arith.extsi %248 : i32 to i64
%249 = arith.addi %247, %250 : i64
%251 = llvm.load %182 : !llvm.ptr -> i64
%252 = arith.constant 1 : i32
%254 = arith.extsi %252 : i32 to i64
%253 = arith.addi %251, %254 : i64
%255 = arith.muli %249, %253 : i64
%256 = llvm.mlir.constant(1 : i64) : i64
%257 = llvm.alloca %256 x i64 : (i64) -> !llvm.ptr
llvm.store %255, %257 : i64, !llvm.ptr
%258 = llvm.load %216 : !llvm.ptr -> i64
%259 = llvm.mlir.constant(1 : i64) : i64
%260 = llvm.alloca %259 x i64 : (i64) -> !llvm.ptr
llvm.store %258, %260 : i64, !llvm.ptr
%261 = arith.constant 3 : i32
%262 = arith.extsi %261 : i32 to i64
%263 = llvm.mlir.constant(1 : i64) : i64
%264 = llvm.alloca %263 x i64 : (i64) -> !llvm.ptr
llvm.store %262, %264 : i64, !llvm.ptr
cf.br ^bb54
^bb54:
%265 = llvm.load %264 : !llvm.ptr -> i64
%266 = llvm.load %264 : !llvm.ptr -> i64
%267 = arith.muli %265, %266 : i64
%268 = llvm.load %260 : !llvm.ptr -> i64
%269 = arith.cmpi sle, %267, %268 : i64
cf.cond_br %269, ^bb55, ^bb56
^bb55:
%270 = llvm.load %260 : !llvm.ptr -> i64
%271 = llvm.load %264 : !llvm.ptr -> i64
%272 = arith.remsi %270, %271 : i64
%273 = arith.constant 0 : i32
%275 = arith.extsi %273 : i32 to i64
%274 = arith.cmpi eq, %272, %275 : i64
cf.cond_br %274, ^bb57, ^bb58
^bb57:
%276 = arith.constant 0 : i32
%277 = arith.extsi %276 : i32 to i64
%278 = llvm.mlir.constant(1 : i64) : i64
%279 = llvm.alloca %278 x i64 : (i64) -> !llvm.ptr
llvm.store %277, %279 : i64, !llvm.ptr
cf.br ^bb60
^bb60:
%280 = llvm.load %260 : !llvm.ptr -> i64
%281 = llvm.load %264 : !llvm.ptr -> i64
%282 = arith.remsi %280, %281 : i64
%283 = arith.constant 0 : i32
%285 = arith.extsi %283 : i32 to i64
%284 = arith.cmpi eq, %282, %285 : i64
cf.cond_br %284, ^bb61, ^bb62
^bb61:
%286 = llvm.load %260 : !llvm.ptr -> i64
%287 = llvm.load %264 : !llvm.ptr -> i64
%288 = arith.divsi %286, %287 : i64
llvm.store %288, %260 : i64, !llvm.ptr
%289 = llvm.load %279 : !llvm.ptr -> i64
%290 = arith.constant 1 : i32
%292 = arith.extsi %290 : i32 to i64
%291 = arith.addi %289, %292 : i64
llvm.store %291, %279 : i64, !llvm.ptr
cf.br ^bb60
^bb62:
%293 = llvm.load %257 : !llvm.ptr -> i64
%294 = llvm.load %279 : !llvm.ptr -> i64
%295 = arith.constant 1 : i32
%297 = arith.extsi %295 : i32 to i64
%296 = arith.addi %294, %297 : i64
%298 = arith.muli %293, %296 : i64
llvm.store %298, %257 : i64, !llvm.ptr
cf.br ^bb59
^bb58:
cf.br ^bb59
^bb59:
%299 = llvm.load %264 : !llvm.ptr -> i64
%300 = arith.constant 2 : i32
%302 = arith.extsi %300 : i32 to i64
%301 = arith.addi %299, %302 : i64
llvm.store %301, %264 : i64, !llvm.ptr
cf.br ^bb54
^bb56:
%303 = llvm.load %260 : !llvm.ptr -> i64
%304 = arith.constant 1 : i32
%306 = arith.extsi %304 : i32 to i64
%305 = arith.cmpi sgt, %303, %306 : i64
cf.cond_br %305, ^bb63, ^bb64
^bb63:
%307 = llvm.load %257 : !llvm.ptr -> i64
%308 = arith.constant 2 : i32
%310 = arith.extsi %308 : i32 to i64
%309 = arith.muli %307, %310 : i64
llvm.store %309, %257 : i64, !llvm.ptr
cf.br ^bb65
^bb64:
cf.br ^bb65
^bb65:
%311 = llvm.load %257 : !llvm.ptr -> i64
func.return %311 : i64
}
func.func @ipow10(%arg0: i32) -> i64 {
%312 = arith.constant 1 : 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
%316 = arith.constant 0 : i32
%317 = arith.index_cast %316 : i32 to index
%318 = arith.index_cast %arg0 : i32 to index
%320 = arith.constant 1 : index
%321 = arith.constant -1 : index
%322 = arith.cmpi sle, %317, %318 : index
%319 = arith.select %322, %320, %321 : index
cf.br ^bb66(%317 : index)
^bb66(%323: index):
%324 = arith.cmpi slt, %323, %318 : index
%325 = arith.cmpi sgt, %323, %318 : index
%326 = arith.select %322, %324, %325 : i1
cf.cond_br %326, ^bb67(%323 : index), ^bb68(%323 : index)
^bb67(%327: index):
%328 = llvm.load %315 : !llvm.ptr -> i64
%329 = arith.constant 10 : i32
%331 = arith.extsi %329 : i32 to i64
%330 = arith.muli %328, %331 : i64
llvm.store %330, %315 : i64, !llvm.ptr
%332 = arith.addi %327, %319 : index
cf.br ^bb66(%332 : index)
^bb68(%333: index):
%334 = llvm.load %315 : !llvm.ptr -> i64
func.return %334 : i64
}
func.func @count_for_n(%arg0: i32) -> i64 {
%335 = func.call @ipow10(%arg0) : (i32) -> i64
%337 = arith.constant 0 : i32
%338 = arith.constant 0 : i32
%339 = arith.constant 0 : i32
%340 = arith.constant 0 : i32
%341 = arith.constant 0 : i32
%342 = arith.constant 0 : i32
%343 = arith.constant 0 : i32
%344 = arith.constant 0 : i32
%345 = arith.constant 0 : i32
%346 = arith.constant 0 : i32
%347 = arith.constant 0 : i32
%348 = arith.constant 0 : i32
%349 = arith.constant 0 : i32
%350 = arith.constant 0 : i32
%351 = arith.constant 0 : i32
%352 = arith.constant 0 : i32
%353 = arith.constant 0 : i32
%354 = arith.constant 0 : i32
%355 = arith.constant 0 : i32
%356 = arith.constant 0 : i32
%357 = arith.constant 0 : i32
%358 = arith.constant 0 : i32
%359 = arith.constant 0 : i32
%360 = arith.constant 0 : i32
%361 = arith.constant 0 : i32
%362 = arith.constant 0 : i32
%363 = arith.constant 0 : i32
%364 = arith.constant 0 : i32
%365 = arith.constant 0 : i32
%366 = arith.constant 0 : i32
%367 = arith.constant 0 : i32
%368 = arith.constant 0 : i32
%369 = arith.constant 0 : i32
%370 = arith.constant 0 : i32
%371 = arith.constant 0 : i32
%372 = arith.constant 0 : i32
%373 = arith.constant 0 : i32
%374 = arith.constant 0 : i32
%375 = arith.constant 0 : i32
%376 = arith.constant 0 : i32
%377 = arith.constant 0 : i32
%378 = arith.constant 0 : i32
%379 = arith.constant 0 : i32
%380 = arith.constant 0 : i32
%381 = arith.constant 0 : i32
%382 = arith.constant 0 : i32
%383 = arith.constant 0 : i32
%384 = arith.constant 0 : i32
%385 = arith.constant 0 : i32
%386 = arith.constant 0 : i32
%387 = arith.constant 0 : i32
%388 = arith.constant 0 : i32
%389 = arith.constant 0 : i32
%390 = arith.constant 0 : i32
%391 = arith.constant 0 : i32
%392 = arith.constant 0 : i32
%393 = arith.constant 0 : i32
%394 = arith.constant 0 : i32
%395 = arith.constant 0 : i32
%396 = arith.constant 0 : i32
%397 = arith.constant 0 : i32
%398 = arith.constant 0 : i32
%399 = arith.constant 0 : i32
%400 = arith.constant 0 : i32
%401 = arith.constant 0 : i32
%402 = arith.constant 0 : i32
%403 = arith.constant 0 : i32
%404 = arith.constant 0 : i32
%405 = arith.constant 0 : i32
%406 = arith.constant 0 : i32
%407 = arith.constant 0 : i32
%408 = arith.constant 0 : i32
%409 = arith.constant 0 : i32
%410 = arith.constant 0 : i32
%411 = arith.constant 0 : i32
%412 = arith.constant 0 : i32
%413 = arith.constant 0 : i32
%414 = arith.constant 0 : i32
%415 = arith.constant 0 : i32
%416 = arith.constant 0 : i32
%417 = arith.constant 0 : i32
%418 = arith.constant 0 : i32
%419 = arith.constant 0 : i32
%420 = arith.constant 0 : i32
%421 = arith.constant 0 : i32
%422 = arith.constant 0 : i32
%423 = arith.constant 0 : i32
%424 = arith.constant 0 : i32
%425 = arith.constant 0 : i32
%426 = arith.constant 0 : i32
%427 = arith.constant 0 : i32
%428 = arith.constant 0 : i32
%429 = arith.constant 0 : i32
%430 = arith.constant 0 : i32
%431 = arith.constant 0 : i32
%432 = arith.constant 0 : i32
%433 = arith.constant 0 : i32
%434 = arith.constant 0 : i32
%435 = arith.constant 0 : i32
%436 = arith.constant 0 : i32
%437 = llvm.mlir.constant(1 : i64) : i64
%438 = llvm.alloca %437 x !llvm.array<100 x i64> : (i64) -> !llvm.ptr
%439 = llvm.mlir.zero : !llvm.array<100 x i64>
llvm.store %439, %438 : !llvm.array<100 x i64>, !llvm.ptr
%440 = arith.extsi %337 : i32 to i64
%441 = arith.extsi %338 : i32 to i64
%442 = arith.extsi %339 : i32 to i64
%443 = arith.extsi %340 : i32 to i64
%444 = arith.extsi %341 : i32 to i64
%445 = arith.extsi %342 : i32 to i64
%446 = arith.extsi %343 : i32 to i64
%447 = arith.extsi %344 : i32 to i64
%448 = arith.extsi %345 : i32 to i64
%449 = arith.extsi %346 : i32 to i64
%450 = arith.extsi %347 : i32 to i64
%451 = arith.extsi %348 : i32 to i64
%452 = arith.extsi %349 : i32 to i64
%453 = arith.extsi %350 : i32 to i64
%454 = arith.extsi %351 : i32 to i64
%455 = arith.extsi %352 : i32 to i64
%456 = arith.extsi %353 : i32 to i64
%457 = arith.extsi %354 : i32 to i64
%458 = arith.extsi %355 : i32 to i64
%459 = arith.extsi %356 : i32 to i64
%460 = arith.extsi %357 : i32 to i64
%461 = arith.extsi %358 : i32 to i64
%462 = arith.extsi %359 : i32 to i64
%463 = arith.extsi %360 : i32 to i64
%464 = arith.extsi %361 : i32 to i64
%465 = arith.extsi %362 : i32 to i64
%466 = arith.extsi %363 : i32 to i64
%467 = arith.extsi %364 : i32 to i64
%468 = arith.extsi %365 : i32 to i64
%469 = arith.extsi %366 : i32 to i64
%470 = arith.extsi %367 : i32 to i64
%471 = arith.extsi %368 : i32 to i64
%472 = arith.extsi %369 : i32 to i64
%473 = arith.extsi %370 : i32 to i64
%474 = arith.extsi %371 : i32 to i64
%475 = arith.extsi %372 : i32 to i64
%476 = arith.extsi %373 : i32 to i64
%477 = arith.extsi %374 : i32 to i64
%478 = arith.extsi %375 : i32 to i64
%479 = arith.extsi %376 : i32 to i64
%480 = arith.extsi %377 : i32 to i64
%481 = arith.extsi %378 : i32 to i64
%482 = arith.extsi %379 : i32 to i64
%483 = arith.extsi %380 : i32 to i64
%484 = arith.extsi %381 : i32 to i64
%485 = arith.extsi %382 : i32 to i64
%486 = arith.extsi %383 : i32 to i64
%487 = arith.extsi %384 : i32 to i64
%488 = arith.extsi %385 : i32 to i64
%489 = arith.extsi %386 : i32 to i64
%490 = arith.extsi %387 : i32 to i64
%491 = arith.extsi %388 : i32 to i64
%492 = arith.extsi %389 : i32 to i64
%493 = arith.extsi %390 : i32 to i64
%494 = arith.extsi %391 : i32 to i64
%495 = arith.extsi %392 : i32 to i64
%496 = arith.extsi %393 : i32 to i64
%497 = arith.extsi %394 : i32 to i64
%498 = arith.extsi %395 : i32 to i64
%499 = arith.extsi %396 : i32 to i64
%500 = arith.extsi %397 : i32 to i64
%501 = arith.extsi %398 : i32 to i64
%502 = arith.extsi %399 : i32 to i64
%503 = arith.extsi %400 : i32 to i64
%504 = arith.extsi %401 : i32 to i64
%505 = arith.extsi %402 : i32 to i64
%506 = arith.extsi %403 : i32 to i64
%507 = arith.extsi %404 : i32 to i64
%508 = arith.extsi %405 : i32 to i64
%509 = arith.extsi %406 : i32 to i64
%510 = arith.extsi %407 : i32 to i64
%511 = arith.extsi %408 : i32 to i64
%512 = arith.extsi %409 : i32 to i64
%513 = arith.extsi %410 : i32 to i64
%514 = arith.extsi %411 : i32 to i64
%515 = arith.extsi %412 : i32 to i64
%516 = arith.extsi %413 : i32 to i64
%517 = arith.extsi %414 : i32 to i64
%518 = arith.extsi %415 : i32 to i64
%519 = arith.extsi %416 : i32 to i64
%520 = arith.extsi %417 : i32 to i64
%521 = arith.extsi %418 : i32 to i64
%522 = arith.extsi %419 : i32 to i64
%523 = arith.extsi %420 : i32 to i64
%524 = arith.extsi %421 : i32 to i64
%525 = arith.extsi %422 : i32 to i64
%526 = arith.extsi %423 : i32 to i64
%527 = arith.extsi %424 : i32 to i64
%528 = arith.extsi %425 : i32 to i64
%529 = arith.extsi %426 : i32 to i64
%530 = arith.extsi %427 : i32 to i64
%531 = arith.extsi %428 : i32 to i64
%532 = arith.extsi %429 : i32 to i64
%533 = arith.extsi %430 : i32 to i64
%534 = arith.extsi %431 : i32 to i64
%535 = arith.extsi %432 : i32 to i64
%536 = arith.extsi %433 : i32 to i64
%537 = arith.extsi %434 : i32 to i64
%538 = arith.extsi %435 : i32 to i64
%539 = arith.extsi %436 : i32 to i64
%540 = llvm.mlir.constant(0 : i64) : i64
%541 = llvm.getelementptr %438[0, %540] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %440, %541 : i64, !llvm.ptr
%542 = llvm.mlir.constant(1 : i64) : i64
%543 = llvm.getelementptr %438[0, %542] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %441, %543 : i64, !llvm.ptr
%544 = llvm.mlir.constant(2 : i64) : i64
%545 = llvm.getelementptr %438[0, %544] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %442, %545 : i64, !llvm.ptr
%546 = llvm.mlir.constant(3 : i64) : i64
%547 = llvm.getelementptr %438[0, %546] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %443, %547 : i64, !llvm.ptr
%548 = llvm.mlir.constant(4 : i64) : i64
%549 = llvm.getelementptr %438[0, %548] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %444, %549 : i64, !llvm.ptr
%550 = llvm.mlir.constant(5 : i64) : i64
%551 = llvm.getelementptr %438[0, %550] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %445, %551 : i64, !llvm.ptr
%552 = llvm.mlir.constant(6 : i64) : i64
%553 = llvm.getelementptr %438[0, %552] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %446, %553 : i64, !llvm.ptr
%554 = llvm.mlir.constant(7 : i64) : i64
%555 = llvm.getelementptr %438[0, %554] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %447, %555 : i64, !llvm.ptr
%556 = llvm.mlir.constant(8 : i64) : i64
%557 = llvm.getelementptr %438[0, %556] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %448, %557 : i64, !llvm.ptr
%558 = llvm.mlir.constant(9 : i64) : i64
%559 = llvm.getelementptr %438[0, %558] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %449, %559 : i64, !llvm.ptr
%560 = llvm.mlir.constant(10 : i64) : i64
%561 = llvm.getelementptr %438[0, %560] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %450, %561 : i64, !llvm.ptr
%562 = llvm.mlir.constant(11 : i64) : i64
%563 = llvm.getelementptr %438[0, %562] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %451, %563 : i64, !llvm.ptr
%564 = llvm.mlir.constant(12 : i64) : i64
%565 = llvm.getelementptr %438[0, %564] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %452, %565 : i64, !llvm.ptr
%566 = llvm.mlir.constant(13 : i64) : i64
%567 = llvm.getelementptr %438[0, %566] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %453, %567 : i64, !llvm.ptr
%568 = llvm.mlir.constant(14 : i64) : i64
%569 = llvm.getelementptr %438[0, %568] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %454, %569 : i64, !llvm.ptr
%570 = llvm.mlir.constant(15 : i64) : i64
%571 = llvm.getelementptr %438[0, %570] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %455, %571 : i64, !llvm.ptr
%572 = llvm.mlir.constant(16 : i64) : i64
%573 = llvm.getelementptr %438[0, %572] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %456, %573 : i64, !llvm.ptr
%574 = llvm.mlir.constant(17 : i64) : i64
%575 = llvm.getelementptr %438[0, %574] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %457, %575 : i64, !llvm.ptr
%576 = llvm.mlir.constant(18 : i64) : i64
%577 = llvm.getelementptr %438[0, %576] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %458, %577 : i64, !llvm.ptr
%578 = llvm.mlir.constant(19 : i64) : i64
%579 = llvm.getelementptr %438[0, %578] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %459, %579 : i64, !llvm.ptr
%580 = llvm.mlir.constant(20 : i64) : i64
%581 = llvm.getelementptr %438[0, %580] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %460, %581 : i64, !llvm.ptr
%582 = llvm.mlir.constant(21 : i64) : i64
%583 = llvm.getelementptr %438[0, %582] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %461, %583 : i64, !llvm.ptr
%584 = llvm.mlir.constant(22 : i64) : i64
%585 = llvm.getelementptr %438[0, %584] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %462, %585 : i64, !llvm.ptr
%586 = llvm.mlir.constant(23 : i64) : i64
%587 = llvm.getelementptr %438[0, %586] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %463, %587 : i64, !llvm.ptr
%588 = llvm.mlir.constant(24 : i64) : i64
%589 = llvm.getelementptr %438[0, %588] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %464, %589 : i64, !llvm.ptr
%590 = llvm.mlir.constant(25 : i64) : i64
%591 = llvm.getelementptr %438[0, %590] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %465, %591 : i64, !llvm.ptr
%592 = llvm.mlir.constant(26 : i64) : i64
%593 = llvm.getelementptr %438[0, %592] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %466, %593 : i64, !llvm.ptr
%594 = llvm.mlir.constant(27 : i64) : i64
%595 = llvm.getelementptr %438[0, %594] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %467, %595 : i64, !llvm.ptr
%596 = llvm.mlir.constant(28 : i64) : i64
%597 = llvm.getelementptr %438[0, %596] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %468, %597 : i64, !llvm.ptr
%598 = llvm.mlir.constant(29 : i64) : i64
%599 = llvm.getelementptr %438[0, %598] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %469, %599 : i64, !llvm.ptr
%600 = llvm.mlir.constant(30 : i64) : i64
%601 = llvm.getelementptr %438[0, %600] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %470, %601 : i64, !llvm.ptr
%602 = llvm.mlir.constant(31 : i64) : i64
%603 = llvm.getelementptr %438[0, %602] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %471, %603 : i64, !llvm.ptr
%604 = llvm.mlir.constant(32 : i64) : i64
%605 = llvm.getelementptr %438[0, %604] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %472, %605 : i64, !llvm.ptr
%606 = llvm.mlir.constant(33 : i64) : i64
%607 = llvm.getelementptr %438[0, %606] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %473, %607 : i64, !llvm.ptr
%608 = llvm.mlir.constant(34 : i64) : i64
%609 = llvm.getelementptr %438[0, %608] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %474, %609 : i64, !llvm.ptr
%610 = llvm.mlir.constant(35 : i64) : i64
%611 = llvm.getelementptr %438[0, %610] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %475, %611 : i64, !llvm.ptr
%612 = llvm.mlir.constant(36 : i64) : i64
%613 = llvm.getelementptr %438[0, %612] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %476, %613 : i64, !llvm.ptr
%614 = llvm.mlir.constant(37 : i64) : i64
%615 = llvm.getelementptr %438[0, %614] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %477, %615 : i64, !llvm.ptr
%616 = llvm.mlir.constant(38 : i64) : i64
%617 = llvm.getelementptr %438[0, %616] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %478, %617 : i64, !llvm.ptr
%618 = llvm.mlir.constant(39 : i64) : i64
%619 = llvm.getelementptr %438[0, %618] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %479, %619 : i64, !llvm.ptr
%620 = llvm.mlir.constant(40 : i64) : i64
%621 = llvm.getelementptr %438[0, %620] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %480, %621 : i64, !llvm.ptr
%622 = llvm.mlir.constant(41 : i64) : i64
%623 = llvm.getelementptr %438[0, %622] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %481, %623 : i64, !llvm.ptr
%624 = llvm.mlir.constant(42 : i64) : i64
%625 = llvm.getelementptr %438[0, %624] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %482, %625 : i64, !llvm.ptr
%626 = llvm.mlir.constant(43 : i64) : i64
%627 = llvm.getelementptr %438[0, %626] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %483, %627 : i64, !llvm.ptr
%628 = llvm.mlir.constant(44 : i64) : i64
%629 = llvm.getelementptr %438[0, %628] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %484, %629 : i64, !llvm.ptr
%630 = llvm.mlir.constant(45 : i64) : i64
%631 = llvm.getelementptr %438[0, %630] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %485, %631 : i64, !llvm.ptr
%632 = llvm.mlir.constant(46 : i64) : i64
%633 = llvm.getelementptr %438[0, %632] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %486, %633 : i64, !llvm.ptr
%634 = llvm.mlir.constant(47 : i64) : i64
%635 = llvm.getelementptr %438[0, %634] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %487, %635 : i64, !llvm.ptr
%636 = llvm.mlir.constant(48 : i64) : i64
%637 = llvm.getelementptr %438[0, %636] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %488, %637 : i64, !llvm.ptr
%638 = llvm.mlir.constant(49 : i64) : i64
%639 = llvm.getelementptr %438[0, %638] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %489, %639 : i64, !llvm.ptr
%640 = llvm.mlir.constant(50 : i64) : i64
%641 = llvm.getelementptr %438[0, %640] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %490, %641 : i64, !llvm.ptr
%642 = llvm.mlir.constant(51 : i64) : i64
%643 = llvm.getelementptr %438[0, %642] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %491, %643 : i64, !llvm.ptr
%644 = llvm.mlir.constant(52 : i64) : i64
%645 = llvm.getelementptr %438[0, %644] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %492, %645 : i64, !llvm.ptr
%646 = llvm.mlir.constant(53 : i64) : i64
%647 = llvm.getelementptr %438[0, %646] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %493, %647 : i64, !llvm.ptr
%648 = llvm.mlir.constant(54 : i64) : i64
%649 = llvm.getelementptr %438[0, %648] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %494, %649 : i64, !llvm.ptr
%650 = llvm.mlir.constant(55 : i64) : i64
%651 = llvm.getelementptr %438[0, %650] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %495, %651 : i64, !llvm.ptr
%652 = llvm.mlir.constant(56 : i64) : i64
%653 = llvm.getelementptr %438[0, %652] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %496, %653 : i64, !llvm.ptr
%654 = llvm.mlir.constant(57 : i64) : i64
%655 = llvm.getelementptr %438[0, %654] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %497, %655 : i64, !llvm.ptr
%656 = llvm.mlir.constant(58 : i64) : i64
%657 = llvm.getelementptr %438[0, %656] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %498, %657 : i64, !llvm.ptr
%658 = llvm.mlir.constant(59 : i64) : i64
%659 = llvm.getelementptr %438[0, %658] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %499, %659 : i64, !llvm.ptr
%660 = llvm.mlir.constant(60 : i64) : i64
%661 = llvm.getelementptr %438[0, %660] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %500, %661 : i64, !llvm.ptr
%662 = llvm.mlir.constant(61 : i64) : i64
%663 = llvm.getelementptr %438[0, %662] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %501, %663 : i64, !llvm.ptr
%664 = llvm.mlir.constant(62 : i64) : i64
%665 = llvm.getelementptr %438[0, %664] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %502, %665 : i64, !llvm.ptr
%666 = llvm.mlir.constant(63 : i64) : i64
%667 = llvm.getelementptr %438[0, %666] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %503, %667 : i64, !llvm.ptr
%668 = llvm.mlir.constant(64 : i64) : i64
%669 = llvm.getelementptr %438[0, %668] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %504, %669 : i64, !llvm.ptr
%670 = llvm.mlir.constant(65 : i64) : i64
%671 = llvm.getelementptr %438[0, %670] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %505, %671 : i64, !llvm.ptr
%672 = llvm.mlir.constant(66 : i64) : i64
%673 = llvm.getelementptr %438[0, %672] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %506, %673 : i64, !llvm.ptr
%674 = llvm.mlir.constant(67 : i64) : i64
%675 = llvm.getelementptr %438[0, %674] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %507, %675 : i64, !llvm.ptr
%676 = llvm.mlir.constant(68 : i64) : i64
%677 = llvm.getelementptr %438[0, %676] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %508, %677 : i64, !llvm.ptr
%678 = llvm.mlir.constant(69 : i64) : i64
%679 = llvm.getelementptr %438[0, %678] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %509, %679 : i64, !llvm.ptr
%680 = llvm.mlir.constant(70 : i64) : i64
%681 = llvm.getelementptr %438[0, %680] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %510, %681 : i64, !llvm.ptr
%682 = llvm.mlir.constant(71 : i64) : i64
%683 = llvm.getelementptr %438[0, %682] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %511, %683 : i64, !llvm.ptr
%684 = llvm.mlir.constant(72 : i64) : i64
%685 = llvm.getelementptr %438[0, %684] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %512, %685 : i64, !llvm.ptr
%686 = llvm.mlir.constant(73 : i64) : i64
%687 = llvm.getelementptr %438[0, %686] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %513, %687 : i64, !llvm.ptr
%688 = llvm.mlir.constant(74 : i64) : i64
%689 = llvm.getelementptr %438[0, %688] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %514, %689 : i64, !llvm.ptr
%690 = llvm.mlir.constant(75 : i64) : i64
%691 = llvm.getelementptr %438[0, %690] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %515, %691 : i64, !llvm.ptr
%692 = llvm.mlir.constant(76 : i64) : i64
%693 = llvm.getelementptr %438[0, %692] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %516, %693 : i64, !llvm.ptr
%694 = llvm.mlir.constant(77 : i64) : i64
%695 = llvm.getelementptr %438[0, %694] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %517, %695 : i64, !llvm.ptr
%696 = llvm.mlir.constant(78 : i64) : i64
%697 = llvm.getelementptr %438[0, %696] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %518, %697 : i64, !llvm.ptr
%698 = llvm.mlir.constant(79 : i64) : i64
%699 = llvm.getelementptr %438[0, %698] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %519, %699 : i64, !llvm.ptr
%700 = llvm.mlir.constant(80 : i64) : i64
%701 = llvm.getelementptr %438[0, %700] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %520, %701 : i64, !llvm.ptr
%702 = llvm.mlir.constant(81 : i64) : i64
%703 = llvm.getelementptr %438[0, %702] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %521, %703 : i64, !llvm.ptr
%704 = llvm.mlir.constant(82 : i64) : i64
%705 = llvm.getelementptr %438[0, %704] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %522, %705 : i64, !llvm.ptr
%706 = llvm.mlir.constant(83 : i64) : i64
%707 = llvm.getelementptr %438[0, %706] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %523, %707 : i64, !llvm.ptr
%708 = llvm.mlir.constant(84 : i64) : i64
%709 = llvm.getelementptr %438[0, %708] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %524, %709 : i64, !llvm.ptr
%710 = llvm.mlir.constant(85 : i64) : i64
%711 = llvm.getelementptr %438[0, %710] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %525, %711 : i64, !llvm.ptr
%712 = llvm.mlir.constant(86 : i64) : i64
%713 = llvm.getelementptr %438[0, %712] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %526, %713 : i64, !llvm.ptr
%714 = llvm.mlir.constant(87 : i64) : i64
%715 = llvm.getelementptr %438[0, %714] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %527, %715 : i64, !llvm.ptr
%716 = llvm.mlir.constant(88 : i64) : i64
%717 = llvm.getelementptr %438[0, %716] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %528, %717 : i64, !llvm.ptr
%718 = llvm.mlir.constant(89 : i64) : i64
%719 = llvm.getelementptr %438[0, %718] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %529, %719 : i64, !llvm.ptr
%720 = llvm.mlir.constant(90 : i64) : i64
%721 = llvm.getelementptr %438[0, %720] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %530, %721 : i64, !llvm.ptr
%722 = llvm.mlir.constant(91 : i64) : i64
%723 = llvm.getelementptr %438[0, %722] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %531, %723 : i64, !llvm.ptr
%724 = llvm.mlir.constant(92 : i64) : i64
%725 = llvm.getelementptr %438[0, %724] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %532, %725 : i64, !llvm.ptr
%726 = llvm.mlir.constant(93 : i64) : i64
%727 = llvm.getelementptr %438[0, %726] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %533, %727 : i64, !llvm.ptr
%728 = llvm.mlir.constant(94 : i64) : i64
%729 = llvm.getelementptr %438[0, %728] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %534, %729 : i64, !llvm.ptr
%730 = llvm.mlir.constant(95 : i64) : i64
%731 = llvm.getelementptr %438[0, %730] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %535, %731 : i64, !llvm.ptr
%732 = llvm.mlir.constant(96 : i64) : i64
%733 = llvm.getelementptr %438[0, %732] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %536, %733 : i64, !llvm.ptr
%734 = llvm.mlir.constant(97 : i64) : i64
%735 = llvm.getelementptr %438[0, %734] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %537, %735 : i64, !llvm.ptr
%736 = llvm.mlir.constant(98 : i64) : i64
%737 = llvm.getelementptr %438[0, %736] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %538, %737 : i64, !llvm.ptr
%738 = llvm.mlir.constant(99 : i64) : i64
%739 = llvm.getelementptr %438[0, %738] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %539, %739 : i64, !llvm.ptr
%740 = arith.constant 0 : i32
%741 = llvm.mlir.constant(1 : i64) : i64
%742 = llvm.alloca %741 x i32 : (i64) -> !llvm.ptr
llvm.store %740, %742 : i32, !llvm.ptr
%743 = arith.constant 0 : i32
%744 = arith.constant 1 : i32
%745 = arith.addi %arg0, %744 : i32
%746 = arith.index_cast %743 : i32 to index
%747 = arith.index_cast %745 : i32 to index
%749 = arith.constant 1 : index
%750 = arith.constant -1 : index
%751 = arith.cmpi sle, %746, %747 : index
%748 = arith.select %751, %749, %750 : index
cf.br ^bb69(%746 : index)
^bb69(%752: index):
%753 = arith.cmpi slt, %752, %747 : index
%754 = arith.cmpi sgt, %752, %747 : index
%755 = arith.select %751, %753, %754 : i1
cf.cond_br %755, ^bb70(%752 : index), ^bb71(%752 : index)
^bb70(%756: index):
%757 = arith.constant 1 : i32
%758 = arith.extsi %757 : i32 to i64
%759 = llvm.mlir.constant(1 : i64) : i64
%760 = llvm.alloca %759 x i64 : (i64) -> !llvm.ptr
llvm.store %758, %760 : i64, !llvm.ptr
%761 = arith.constant 0 : i32
%762 = arith.index_cast %761 : i32 to index
%763 = arith.index_cast %756 : i32 to index
%765 = arith.constant 1 : index
%766 = arith.constant -1 : index
%767 = arith.cmpi sle, %762, %763 : index
%764 = arith.select %767, %765, %766 : index
cf.br ^bb72(%762 : index)
^bb72(%768: index):
%769 = arith.cmpi slt, %768, %763 : index
%770 = arith.cmpi sgt, %768, %763 : index
%771 = arith.select %767, %769, %770 : i1
cf.cond_br %771, ^bb73(%768 : index), ^bb74(%768 : index)
^bb73(%772: index):
%773 = llvm.load %760 : !llvm.ptr -> i64
%774 = arith.constant 2 : i32
%776 = arith.extsi %774 : i32 to i64
%775 = arith.muli %773, %776 : i64
llvm.store %775, %760 : i64, !llvm.ptr
%777 = arith.addi %772, %764 : index
cf.br ^bb72(%777 : index)
^bb74(%778: index):
%779 = arith.constant 0 : i32
%780 = arith.constant 1 : i32
%781 = arith.addi %arg0, %780 : i32
%782 = arith.index_cast %779 : i32 to index
%783 = arith.index_cast %781 : i32 to index
%785 = arith.constant 1 : index
%786 = arith.constant -1 : index
%787 = arith.cmpi sle, %782, %783 : index
%784 = arith.select %787, %785, %786 : index
cf.br ^bb75(%782 : index)
^bb75(%788: index):
%789 = arith.cmpi slt, %788, %783 : index
%790 = arith.cmpi sgt, %788, %783 : index
%791 = arith.select %787, %789, %790 : i1
cf.cond_br %791, ^bb76(%788 : index), ^bb77(%788 : index)
^bb76(%792: index):
%793 = arith.constant 1 : i32
%794 = arith.extsi %793 : i32 to i64
%795 = llvm.mlir.constant(1 : i64) : i64
%796 = llvm.alloca %795 x i64 : (i64) -> !llvm.ptr
llvm.store %794, %796 : i64, !llvm.ptr
%797 = arith.constant 0 : i32
%798 = arith.index_cast %797 : i32 to index
%799 = arith.index_cast %792 : i32 to index
%801 = arith.constant 1 : index
%802 = arith.constant -1 : index
%803 = arith.cmpi sle, %798, %799 : index
%800 = arith.select %803, %801, %802 : index
cf.br ^bb78(%798 : index)
^bb78(%804: index):
%805 = arith.cmpi slt, %804, %799 : index
%806 = arith.cmpi sgt, %804, %799 : index
%807 = arith.select %803, %805, %806 : i1
cf.cond_br %807, ^bb79(%804 : index), ^bb80(%804 : index)
^bb79(%808: index):
%809 = llvm.load %796 : !llvm.ptr -> i64
%810 = arith.constant 5 : i32
%812 = arith.extsi %810 : i32 to i64
%811 = arith.muli %809, %812 : i64
llvm.store %811, %796 : i64, !llvm.ptr
%813 = arith.addi %808, %800 : index
cf.br ^bb78(%813 : index)
^bb80(%814: index):
%815 = llvm.load %760 : !llvm.ptr -> i64
%816 = llvm.load %796 : !llvm.ptr -> i64
%817 = arith.muli %815, %816 : i64
%818 = llvm.load %742 : !llvm.ptr -> i32
%819 = arith.extsi %818 : i32 to i64
%820 = llvm.getelementptr %438[0, %819] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %817, %820 : i64, !llvm.ptr
%821 = llvm.load %742 : !llvm.ptr -> i32
%822 = arith.constant 1 : i32
%823 = arith.addi %821, %822 : i32
llvm.store %823, %742 : i32, !llvm.ptr
%824 = arith.addi %792, %784 : index
cf.br ^bb75(%824 : index)
^bb77(%825: index):
%826 = arith.addi %756, %748 : index
cf.br ^bb69(%826 : index)
^bb71(%827: index):
%828 = arith.constant 0 : i32
%829 = llvm.load %742 : !llvm.ptr -> i32
%830 = arith.index_cast %828 : i32 to index
%831 = arith.index_cast %829 : i32 to index
%833 = arith.constant 1 : index
%834 = arith.constant -1 : index
%835 = arith.cmpi sle, %830, %831 : index
%832 = arith.select %835, %833, %834 : index
cf.br ^bb81(%830 : index)
^bb81(%836: index):
%837 = arith.cmpi slt, %836, %831 : index
%838 = arith.cmpi sgt, %836, %831 : index
%839 = arith.select %835, %837, %838 : i1
cf.cond_br %839, ^bb82(%836 : index), ^bb83(%836 : index)
^bb82(%840: index):
%841 = arith.constant 1 : i32
%843 = arith.index_cast %840 : index to i32
%842 = arith.addi %843, %841 : i32
%844 = llvm.load %742 : !llvm.ptr -> i32
%845 = arith.index_cast %842 : i32 to index
%846 = arith.index_cast %844 : i32 to index
%848 = arith.constant 1 : index
%849 = arith.constant -1 : index
%850 = arith.cmpi sle, %845, %846 : index
%847 = arith.select %850, %848, %849 : index
cf.br ^bb84(%845 : index)
^bb84(%851: index):
%852 = arith.cmpi slt, %851, %846 : index
%853 = arith.cmpi sgt, %851, %846 : index
%854 = arith.select %850, %852, %853 : i1
cf.cond_br %854, ^bb85(%851 : index), ^bb86(%851 : index)
^bb85(%855: index):
%857 = arith.index_cast %855 : index to i64
%858 = llvm.getelementptr %438[0, %857] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
%856 = llvm.load %858 : !llvm.ptr -> i64
%860 = arith.index_cast %840 : index to i64
%861 = llvm.getelementptr %438[0, %860] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
%859 = llvm.load %861 : !llvm.ptr -> i64
%862 = arith.cmpi slt, %856, %859 : i64
cf.cond_br %862, ^bb87, ^bb88
^bb87:
%864 = arith.index_cast %840 : index to i64
%865 = llvm.getelementptr %438[0, %864] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
%863 = llvm.load %865 : !llvm.ptr -> i64
%867 = arith.index_cast %855 : index to i64
%868 = llvm.getelementptr %438[0, %867] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
%866 = llvm.load %868 : !llvm.ptr -> i64
%869 = arith.index_cast %840 : index to i64
%870 = llvm.getelementptr %438[0, %869] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %866, %870 : i64, !llvm.ptr
%871 = arith.index_cast %855 : index to i64
%872 = llvm.getelementptr %438[0, %871] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
llvm.store %863, %872 : i64, !llvm.ptr
cf.br ^bb89
^bb88:
cf.br ^bb89
^bb89:
%873 = arith.addi %855, %847 : index
cf.br ^bb84(%873 : index)
^bb86(%874: index):
%875 = arith.addi %840, %832 : index
cf.br ^bb81(%875 : index)
^bb83(%876: index):
%877 = arith.constant 0 : i32
%878 = arith.extsi %877 : i32 to i64
%879 = llvm.mlir.constant(1 : i64) : i64
%880 = llvm.alloca %879 x i64 : (i64) -> !llvm.ptr
llvm.store %878, %880 : i64, !llvm.ptr
%881 = arith.constant 0 : i32
%882 = llvm.load %742 : !llvm.ptr -> i32
%883 = arith.index_cast %881 : i32 to index
%884 = arith.index_cast %882 : i32 to index
%886 = arith.constant 1 : index
%887 = arith.constant -1 : index
%888 = arith.cmpi sle, %883, %884 : index
%885 = arith.select %888, %886, %887 : index
cf.br ^bb90(%883 : index)
^bb90(%889: index):
%890 = arith.cmpi slt, %889, %884 : index
%891 = arith.cmpi sgt, %889, %884 : index
%892 = arith.select %888, %890, %891 : i1
cf.cond_br %892, ^bb91(%889 : index), ^bb92(%889 : index)
^bb91(%893: index):
%894 = llvm.load %742 : !llvm.ptr -> i32
%895 = arith.index_cast %893 : i32 to index
%896 = arith.index_cast %894 : i32 to index
%898 = arith.constant 1 : index
%899 = arith.constant -1 : index
%900 = arith.cmpi sle, %895, %896 : index
%897 = arith.select %900, %898, %899 : index
cf.br ^bb93(%895 : index)
^bb93(%901: index):
%902 = arith.cmpi slt, %901, %896 : index
%903 = arith.cmpi sgt, %901, %896 : index
%904 = arith.select %900, %902, %903 : i1
cf.cond_br %904, ^bb94(%901 : index), ^bb95(%901 : index)
^bb94(%905: index):
%907 = arith.index_cast %893 : index to i64
%908 = llvm.getelementptr %438[0, %907] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
%906 = llvm.load %908 : !llvm.ptr -> i64
%910 = arith.index_cast %905 : index to i64
%911 = llvm.getelementptr %438[0, %910] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i64>
%909 = llvm.load %911 : !llvm.ptr -> i64
%912 = func.call @gcd(%906, %909) : (i64, i64) -> i64
%913 = arith.constant 1 : i32
%915 = arith.extsi %913 : i32 to i64
%914 = arith.cmpi eq, %912, %915 : i64
cf.cond_br %914, ^bb96, ^bb97
^bb96:
%916 = arith.muli %906, %909 : i64
%917 = arith.cmpi sle, %916, %335 : i64
cf.cond_br %917, ^bb99, ^bb100
^bb99:
%918 = arith.divsi %335, %916 : i64
%919 = llvm.load %880 : !llvm.ptr -> i64
%921 = arith.addi %906, %909 : i64
%920 = func.call @divisor_count(%918, %921) : (i64, i64) -> i64
%922 = arith.addi %919, %920 : i64
llvm.store %922, %880 : i64, !llvm.ptr
cf.br ^bb101
^bb100:
cf.br ^bb101
^bb101:
cf.br ^bb98
^bb97:
cf.br ^bb98
^bb98:
%923 = arith.addi %905, %897 : index
cf.br ^bb93(%923 : index)
^bb95(%924: index):
%925 = arith.addi %893, %885 : index
cf.br ^bb90(%925 : index)
^bb92(%926: index):
%927 = llvm.load %880 : !llvm.ptr -> i64
func.return %927 : i64
}
func.func @main() -> i32 {
%928 = arith.constant 0 : i32
%929 = arith.extsi %928 : i32 to i64
%930 = llvm.mlir.constant(1 : i64) : i64
%931 = llvm.alloca %930 x i64 : (i64) -> !llvm.ptr
llvm.store %929, %931 : i64, !llvm.ptr
%932 = arith.constant 1 : i32
%933 = arith.constant 10 : i32
%934 = arith.index_cast %932 : i32 to index
%935 = arith.index_cast %933 : i32 to index
%937 = arith.constant 1 : index
%938 = arith.constant -1 : index
%939 = arith.cmpi sle, %934, %935 : index
%936 = arith.select %939, %937, %938 : index
cf.br ^bb102(%934 : index)
^bb102(%940: index):
%941 = arith.cmpi slt, %940, %935 : index
%942 = arith.cmpi sgt, %940, %935 : index
%943 = arith.select %939, %941, %942 : i1
cf.cond_br %943, ^bb103(%940 : index), ^bb104(%940 : index)
^bb103(%944: index):
%945 = llvm.load %931 : !llvm.ptr -> i64
%947 = arith.index_cast %944 : index to i32
%946 = func.call @count_for_n(%947) : (i32) -> i64
%948 = arith.addi %945, %946 : i64
llvm.store %948, %931 : i64, !llvm.ptr
%949 = arith.addi %944, %936 : index
cf.br ^bb102(%949 : index)
^bb104(%950: index):
%951 = llvm.mlir.addressof @str_0 : !llvm.ptr
%952 = llvm.load %931 : !llvm.ptr -> i64
%953 = llvm.call @printf(%951, %952) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
%954 = arith.constant 0 : i32
func.return %954 : i32
}
}