Problem 483

Repeated Integer Partitions / expected squared LCM of cycle type g(350) via LPF-ordered cycle DP with LCM-state compression.

Answer4.993401567e22
Output4.993401567e22
StatusPASS
Native helperno
Runtime60 ms
Peak memory3712 KB
Time complexityO(n^5) (estimated)
Space complexityO(n^2) (estimated)

Performance comparison

MetricOur solutionBest known
Time complexityO(n^5)O(n * m)
Space complexityO(n^2)O(n)
ApproachFlow solutionDynamic programming or generating function
VerdictUnknown

Flow source

# Project Euler 483
# Repeated Integer Partitions / expected squared LCM of cycle type
# g(350) via LPF-ordered cycle DP with LCM-state compression.

extern {
    function calloc(n: i64, size: i64) -> ptr<void>
    function free(p: ptr<void>) -> void
    function log10(x: f64) -> f64
    function floor(x: f64) -> f64
    function pow(x: f64, y: f64) -> f64
}

const N: i64 = 350
const CAP: i64 = 256

let mut KEYS: ptr<i32> = null
let mut VALS: ptr<f64> = null
let mut CNT: ptr<i32> = null

function idx(buf: i64, used: i64, i: i64) -> i64 {
    return ((buf * (N + 1) + used) * CAP) + i
}

function cnt_at(buf: i64, used: i64) -> i64 {
    return CNT[buf * (N + 1) + used] as i64
}

function set_cnt(buf: i64, used: i64, v: i64) -> void {
    CNT[buf * (N + 1) + used] = v as i32
}

function find_key(buf: i64, used: i64, key: i64) -> i64 {
    let n: i64 = cnt_at(buf, used)
    let mut i: i64 = 0
    while i < n {
        if (KEYS[idx(buf, used, i)] as i64) == key { return i }
        i = i + 1
    }
    return -1
}

function add_to(buf: i64, used: i64, key: i64, v: f64) -> void {
    let i: i64 = find_key(buf, used, key)
    if i >= 0 {
        let p: i64 = idx(buf, used, i)
        VALS[p] = VALS[p] + v
    } else {
        let n: i64 = cnt_at(buf, used)
        let p: i64 = idx(buf, used, n)
        KEYS[p] = key as i32
        VALS[p] = v
        set_cnt(buf, used, n + 1)
    }
}

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

function ilcm(a: i64, b: i64) -> i64 {
    return a / igcd(a, b) * b
}

function print_sci10(x0: f64) -> void {
    let mut x: f64 = x0
    let mut expv: i64 = floor(log10(x)) as i64
    let mut mant: f64 = x / pow(10.0, expv as f64)
    while mant >= 10.0 {
        mant = mant / 10.0
        expv = expv + 1
    }
    while mant < 1.0 {
        mant = mant * 10.0
        expv = expv - 1
    }
    printf("%.9fe%lld\n", mant, expv)
}

function main() -> i32 {
    let lpf: ptr<i32> = calloc(N + 1, 4)
    let primes: ptr<i32> = calloc(N, 4)
    let by_lpf: ptr<i32> = calloc((N + 1) * (N + 1), 4)
    let by_cnt: ptr<i32> = calloc(N + 1, 4)
    KEYS = calloc(2 * (N + 1) * CAP, 4)
    VALS = calloc(2 * (N + 1) * CAP, 8)
    CNT = calloc(2 * (N + 1), 4)
    let factors: ptr<f64> = calloc(N + 1, 8)
    if lpf == null || primes == null || KEYS == null || VALS == null || CNT == null { return 1 }

    let mut pc: i64 = 0
    let mut p: i64 = 2
    while p <= N {
        if lpf[p] == 0 {
            primes[pc] = p as i32
            pc = pc + 1
            let mut m: i64 = p
            while m <= N {
                lpf[m] = p as i32
                m = m + p
            }
        }
        p = p + 1
    }
    let mut c: i64 = 2
    while c <= N {
        let lp: i64 = lpf[c] as i64
        let k: i64 = by_cnt[lp] as i64
        by_lpf[lp * (N + 1) + k] = c as i32
        by_cnt[lp] = (k + 1) as i32
        c = c + 1
    }

    let mut cur: i64 = 0
    let mut nxt: i64 = 1
    set_cnt(cur, 0, 1)
    KEYS[idx(cur, 0, 0)] = 1
    VALS[idx(cur, 0, 0)] = 1.0
    let mut fw: f64 = 1.0
    let mut used: i64 = 1
    while used <= N {
        fw = fw / (used as f64)
        set_cnt(cur, used, 1)
        KEYS[idx(cur, used, 0)] = 1
        VALS[idx(cur, used, 0)] = fw
        used = used + 1
    }

    let mut pi: i64 = pc - 1
    while pi >= 0 {
        let pv: i64 = primes[pi] as i64
        let mut ci: i64 = 0
        let bcnt: i64 = by_cnt[pv] as i64
        while ci < bcnt {
            let cv: i64 = by_lpf[pv * (N + 1) + ci] as i64
            # copy cur -> nxt
            used = 0
            while used <= N {
                let n0: i64 = cnt_at(cur, used)
                set_cnt(nxt, used, n0)
                let mut i: i64 = 0
                while i < n0 {
                    KEYS[idx(nxt, used, i)] = KEYS[idx(cur, used, i)]
                    VALS[idx(nxt, used, i)] = VALS[idx(cur, used, i)]
                    i = i + 1
                }
                used = used + 1
            }
            let mut term: f64 = 1.0
            let mf: i64 = N / cv
            let mut m: i64 = 1
            while m <= mf {
                term = term / ((cv as f64) * (m as f64))
                factors[m - 1] = term
                m = m + 1
            }
            used = 0
            while used <= N - cv {
                let nc: i64 = cnt_at(cur, used)
                let mut i2: i64 = 0
                while i2 < nc {
                    let L0: i64 = KEYS[idx(cur, used, i2)] as i64
                    let v0: f64 = VALS[idx(cur, used, i2)]
                    let L1: i64 = ilcm(L0, cv)
                    let mut used1: i64 = used
                    let max_m: i64 = (N - used) / cv
                    let mut mm: i64 = 0
                    while mm < max_m {
                        used1 = used1 + cv
                        add_to(nxt, used1, L1, v0 * factors[mm])
                        mm = mm + 1
                    }
                    i2 = i2 + 1
                }
                used = used + 1
            }
            let tmp: i64 = cur
            cur = nxt
            nxt = tmp
            ci = ci + 1
        }
        let p2: f64 = (pv as f64) * (pv as f64)
        used = 0
        while used <= N {
            set_cnt(nxt, used, 0)
            let n0: i64 = cnt_at(cur, used)
            let mut i3: i64 = 0
            while i3 < n0 {
                let mut l: i64 = KEYS[idx(cur, used, i3)] as i64
                let mut val: f64 = VALS[idx(cur, used, i3)]
                while l % pv == 0 {
                    l = l / pv
                    val = val * p2
                }
                add_to(nxt, used, l, val)
                i3 = i3 + 1
            }
            used = used + 1
        }
        let tmp2: i64 = cur
        cur = nxt
        nxt = tmp2
        pi = pi - 1
    }

    let mut ans: f64 = 0.0
    let nf: i64 = cnt_at(cur, N)
    let mut i: i64 = 0
    while i < nf {
        let L: f64 = KEYS[idx(cur, N, i)] as f64
        ans = ans + L * L * VALS[idx(cur, N, i)]
        i = i + 1
    }
    print_sci10(ans)

    free(factors)
    free(CNT)
    free(VALS)
    free(KEYS)
    free(by_cnt)
    free(by_lpf)
    free(primes)
    free(lpf)
    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 idx_i64_i64_i64(int64_t buf, int64_t used, int64_t i);
int64_t cnt_at_i64_i64(int64_t buf, int64_t used);
void set_cnt_i64_i64_i64(int64_t buf, int64_t used, int64_t v);
int64_t find_key_i64_i64_i64(int64_t buf, int64_t used, int64_t key);
void add_to_i64_i64_i64_f64(int64_t buf, int64_t used, int64_t key, double v);
int64_t igcd_i64_i64(int64_t a0, int64_t b0);
int64_t ilcm_i64_i64(int64_t a, int64_t b);
void print_sci10_f64(double x0);
int32_t main(void);

static const int64_t N = 350;
static const int64_t CAP = 256;

/* Module statics */
static int32_t* KEYS = NULL;
static double* VALS = NULL;
static int32_t* CNT = NULL;






int64_t idx_i64_i64_i64(int64_t buf, int64_t used, int64_t i) {
    return ((((buf * (N + 1)) + used) * CAP) + i);
}

int64_t cnt_at_i64_i64(int64_t buf, int64_t used) {
    return ((int64_t)(CNT[((buf * (N + 1)) + used)]));
}

void set_cnt_i64_i64_i64(int64_t buf, int64_t used, int64_t v) {
    CNT[((buf * (N + 1)) + used)] = ((int32_t)(v));
}

int64_t find_key_i64_i64_i64(int64_t buf, int64_t used, int64_t key) {
    int64_t n = cnt_at_i64_i64(buf, used);
    int64_t i = 0;
    while (i < n) {
        if (((int64_t)(KEYS[idx_i64_i64_i64(buf, used, i)])) == key) {
            return i;
        }
        i = (i + 1);
    }
    return (-1);
}

void add_to_i64_i64_i64_f64(int64_t buf, int64_t used, int64_t key, double v) {
    int64_t i = find_key_i64_i64_i64(buf, used, key);
    if (i >= 0) {
        int64_t p = idx_i64_i64_i64(buf, used, i);
        VALS[p] = (VALS[p] + v);
    } else {
        int64_t n = cnt_at_i64_i64(buf, used);
        int64_t p = idx_i64_i64_i64(buf, used, n);
        KEYS[p] = ((int32_t)(key));
        VALS[p] = v;
        set_cnt_i64_i64_i64(buf, used, (n + 1));
    }
}

int64_t igcd_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 ilcm_i64_i64(int64_t a, int64_t b) {
    return (FLOW_CHECKED_DIV((a), (igcd_i64_i64(a, b))) * b);
}

void print_sci10_f64(double x0) {
    double x = x0;
    int64_t expv = ((int64_t)(floor(log10(x))));
    double mant = (x / pow(10.0, ((double)(expv))));
    while (mant >= 10.0) {
        mant = (mant / 10.0);
        expv = (expv + 1);
    }
    while (mant < 1.0) {
        mant = (mant * 10.0);
        expv = (expv - 1);
    }
    printf("%.9fe%lld\n", mant, expv);
}

int32_t main(void) {
    int32_t* lpf = (int32_t*)(calloc((N + 1), 4));
    int32_t* primes = (int32_t*)(calloc(N, 4));
    int32_t* by_lpf = (int32_t*)(calloc(((N + 1) * (N + 1)), 4));
    int32_t* by_cnt = (int32_t*)(calloc((N + 1), 4));
    KEYS = calloc(((2 * (N + 1)) * CAP), 4);
    VALS = calloc(((2 * (N + 1)) * CAP), 8);
    CNT = calloc((2 * (N + 1)), 4);
    double* factors = (double*)(calloc((N + 1), 8));
    if (((((lpf == NULL || primes == NULL) || KEYS == NULL) || VALS == NULL) || CNT == NULL)) {
        return 1;
    }
    int64_t pc = 0;
    int64_t p = 2;
    while (p <= N) {
        if (lpf[p] == 0) {
            primes[pc] = ((int32_t)(p));
            pc = (pc + 1);
            int64_t m = p;
            while (m <= N) {
                lpf[m] = ((int32_t)(p));
                m = (m + p);
            }
        }
        p = (p + 1);
    }
    int64_t c = 2;
    while (c <= N) {
        int64_t lp = ((int64_t)(lpf[c]));
        int64_t k = ((int64_t)(by_cnt[lp]));
        by_lpf[((lp * (N + 1)) + k)] = ((int32_t)(c));
        by_cnt[lp] = ((int32_t)((k + 1)));
        c = (c + 1);
    }
    int64_t cur = 0;
    int64_t nxt = 1;
    set_cnt_i64_i64_i64(cur, 0, 1);
    KEYS[idx_i64_i64_i64(cur, 0, 0)] = 1;
    VALS[idx_i64_i64_i64(cur, 0, 0)] = 1.0;
    double fw = 1.0;
    int64_t used = 1;
    while (used <= N) {
        fw = (fw / ((double)(used)));
        set_cnt_i64_i64_i64(cur, used, 1);
        KEYS[idx_i64_i64_i64(cur, used, 0)] = 1;
        VALS[idx_i64_i64_i64(cur, used, 0)] = fw;
        used = (used + 1);
    }
    int64_t pi = (pc - 1);
    while (pi >= 0) {
        int64_t pv = ((int64_t)(primes[pi]));
        int64_t ci = 0;
        int64_t bcnt = ((int64_t)(by_cnt[pv]));
        while (ci < bcnt) {
            int64_t cv = ((int64_t)(by_lpf[((pv * (N + 1)) + ci)]));
            used = 0;
            while (used <= N) {
                int64_t n0 = cnt_at_i64_i64(cur, used);
                set_cnt_i64_i64_i64(nxt, used, n0);
                int64_t i = 0;
                while (i < n0) {
                    KEYS[idx_i64_i64_i64(nxt, used, i)] = KEYS[idx_i64_i64_i64(cur, used, i)];
                    VALS[idx_i64_i64_i64(nxt, used, i)] = VALS[idx_i64_i64_i64(cur, used, i)];
                    i = (i + 1);
                }
                used = (used + 1);
            }
            double term = 1.0;
            int64_t mf = FLOW_CHECKED_DIV((N), (cv));
            int64_t m = 1;
            while (m <= mf) {
                term = (term / (((double)(cv)) * ((double)(m))));
                factors[(m - 1)] = term;
                m = (m + 1);
            }
            used = 0;
            while (used <= (N - cv)) {
                int64_t nc = cnt_at_i64_i64(cur, used);
                int64_t i2 = 0;
                while (i2 < nc) {
                    int64_t L0 = ((int64_t)(KEYS[idx_i64_i64_i64(cur, used, i2)]));
                    double v0 = VALS[idx_i64_i64_i64(cur, used, i2)];
                    int64_t L1 = ilcm_i64_i64(L0, cv);
                    int64_t used1 = used;
                    int64_t max_m = FLOW_CHECKED_DIV(((N - used)), (cv));
                    int64_t mm = 0;
                    while (mm < max_m) {
                        used1 = (used1 + cv);
                        add_to_i64_i64_i64_f64(nxt, used1, L1, (v0 * factors[mm]));
                        mm = (mm + 1);
                    }
                    i2 = (i2 + 1);
                }
                used = (used + 1);
            }
            int64_t tmp = cur;
            cur = nxt;
            nxt = tmp;
            ci = (ci + 1);
        }
        double p2 = (((double)(pv)) * ((double)(pv)));
        used = 0;
        while (used <= N) {
            set_cnt_i64_i64_i64(nxt, used, 0);
            int64_t n0 = cnt_at_i64_i64(cur, used);
            int64_t i3 = 0;
            while (i3 < n0) {
                int64_t l = ((int64_t)(KEYS[idx_i64_i64_i64(cur, used, i3)]));
                double val = VALS[idx_i64_i64_i64(cur, used, i3)];
                while (FLOW_CHECKED_MOD((l), (pv)) == 0) {
                    l = FLOW_CHECKED_DIV((l), (pv));
                    val = (val * p2);
                }
                add_to_i64_i64_i64_f64(nxt, used, l, val);
                i3 = (i3 + 1);
            }
            used = (used + 1);
        }
        int64_t tmp2 = cur;
        cur = nxt;
        nxt = tmp2;
        pi = (pi - 1);
    }
    double ans = 0.0;
    int64_t nf = cnt_at_i64_i64(cur, N);
    int64_t i = 0;
    while (i < nf) {
        double L = ((double)(KEYS[idx_i64_i64_i64(cur, N, i)]));
        ans = (ans + ((L * L) * VALS[idx_i64_i64_i64(cur, N, i)]));
        i = (i + 1);
    }
    print_sci10_f64(ans);
    free(factors);
    free(CNT);
    free(VALS);
    free(KEYS);
    free(by_cnt);
    free(by_lpf);
    free(primes);
    free(lpf);
    return 0;
}

Generated MLIR

module {
  llvm.func @printf(!llvm.ptr, ...) -> i32
  llvm.mlir.global internal constant @str_0("%.9fe%lld\n\00") {addr_space = 0 : i32} : !llvm.array<11 x i8>
  func.func private @calloc(i64, i64) -> !llvm.ptr
  func.func private @free(!llvm.ptr) -> ()
  func.func private @log10(f64) -> f64
  func.func private @floor(f64) -> f64
  func.func private @pow(f64, f64) -> f64
  // Constant: N
  llvm.mlir.global internal constant @N(350 : i64) : i64
  // Constant: CAP
  llvm.mlir.global internal constant @CAP(256 : i64) : i64
  // Module static: KEYS
  llvm.mlir.global internal @KEYS() {addr_space = 0 : i32} : !llvm.ptr {
    %0 = llvm.mlir.zero : !llvm.ptr
    llvm.return %0 : !llvm.ptr
  }
  // Module static: VALS
  llvm.mlir.global internal @VALS() {addr_space = 0 : i32} : !llvm.ptr {
    %1 = llvm.mlir.zero : !llvm.ptr
    llvm.return %1 : !llvm.ptr
  }
  // Module static: CNT
  llvm.mlir.global internal @CNT() {addr_space = 0 : i32} : !llvm.ptr {
    %2 = llvm.mlir.zero : !llvm.ptr
    llvm.return %2 : !llvm.ptr
  }
  func.func @idx(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
    %3 = llvm.mlir.addressof @N : !llvm.ptr
    %4 = llvm.load %3 : !llvm.ptr -> i64
    %5 = arith.constant 1 : i32
    %7 = arith.extsi %5 : i32 to i64
    %6 = arith.addi %4, %7 : i64
    %8 = arith.muli %arg0, %6 : i64
    %9 = arith.addi %8, %arg1 : i64
    %10 = llvm.mlir.addressof @CAP : !llvm.ptr
    %11 = llvm.load %10 : !llvm.ptr -> i64
    %12 = arith.muli %9, %11 : i64
    %13 = arith.addi %12, %arg2 : i64
    func.return %13 : i64
  }
  func.func @cnt_at(%arg0: i64, %arg1: i64) -> i64 {
    %15 = llvm.mlir.addressof @CNT : !llvm.ptr
    %16 = llvm.load %15 : !llvm.ptr -> !llvm.ptr
    %17 = llvm.mlir.addressof @N : !llvm.ptr
    %18 = llvm.load %17 : !llvm.ptr -> i64
    %19 = arith.constant 1 : i32
    %21 = arith.extsi %19 : i32 to i64
    %20 = arith.addi %18, %21 : i64
    %22 = arith.muli %arg0, %20 : i64
    %23 = arith.addi %22, %arg1 : i64
    %24 = llvm.getelementptr %16[%23] : (!llvm.ptr, i64) -> !llvm.ptr, i32
    %14 = llvm.load %24 : !llvm.ptr -> i32
    %25 = arith.extsi %14 : i32 to i64
    func.return %25 : i64
  }
  func.func @set_cnt(%arg0: i64, %arg1: i64, %arg2: i64) -> () {
    %26 = arith.trunci %arg2 : i64 to i32
    %27 = llvm.mlir.addressof @CNT : !llvm.ptr
    %28 = llvm.load %27 : !llvm.ptr -> !llvm.ptr
    %29 = llvm.mlir.addressof @N : !llvm.ptr
    %30 = llvm.load %29 : !llvm.ptr -> i64
    %31 = arith.constant 1 : i32
    %33 = arith.extsi %31 : i32 to i64
    %32 = arith.addi %30, %33 : i64
    %34 = arith.muli %arg0, %32 : i64
    %35 = arith.addi %34, %arg1 : i64
    %36 = llvm.getelementptr %28[%35] : (!llvm.ptr, i64) -> !llvm.ptr, i32
    llvm.store %26, %36 : i32, !llvm.ptr
    func.return
  }
  func.func @find_key(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
    %37 = func.call @cnt_at(%arg0, %arg1) : (i64, i64) -> i64
    %38 = arith.constant 0 : i32
    %39 = arith.extsi %38 : i32 to i64
    %40 = llvm.mlir.constant(1 : i64) : i64
    %41 = llvm.alloca %40 x i64 : (i64) -> !llvm.ptr
    llvm.store %39, %41 : i64, !llvm.ptr
    cf.br ^bb0
    ^bb0:
    %42 = llvm.load %41 : !llvm.ptr -> i64
    %43 = arith.cmpi slt, %42, %37 : i64
    cf.cond_br %43, ^bb1, ^bb2
    ^bb1:
      %45 = llvm.mlir.addressof @KEYS : !llvm.ptr
      %46 = llvm.load %45 : !llvm.ptr -> !llvm.ptr
      %48 = llvm.load %41 : !llvm.ptr -> i64
      %47 = func.call @idx(%arg0, %arg1, %48) : (i64, i64, i64) -> i64
      %49 = llvm.getelementptr %46[%47] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %44 = llvm.load %49 : !llvm.ptr -> i32
      %50 = arith.extsi %44 : i32 to i64
      %51 = arith.cmpi eq, %50, %arg2 : i64
      cf.cond_br %51, ^bb3, ^bb4
      ^bb3:
        %52 = llvm.load %41 : !llvm.ptr -> i64
        func.return %52 : i64
      ^bb4:
        cf.br ^bb5
      ^bb5:
      %53 = llvm.load %41 : !llvm.ptr -> i64
      %54 = arith.constant 1 : i32
      %56 = arith.extsi %54 : i32 to i64
      %55 = arith.addi %53, %56 : i64
      llvm.store %55, %41 : i64, !llvm.ptr
      cf.br ^bb0
    ^bb2:
    %57 = arith.constant 1 : i32
    %59 = arith.constant 0 : i32
    %58 = arith.subi %59, %57 : i32
    %60 = arith.extsi %58 : i32 to i64
    func.return %60 : i64
  }
  func.func @add_to(%arg0: i64, %arg1: i64, %arg2: i64, %arg3: f64) -> () {
    %61 = func.call @find_key(%arg0, %arg1, %arg2) : (i64, i64, i64) -> i64
    %62 = arith.constant 0 : i32
    %64 = arith.extsi %62 : i32 to i64
    %63 = arith.cmpi sge, %61, %64 : i64
    cf.cond_br %63, ^bb6, ^bb7
    ^bb6:
      %65 = func.call @idx(%arg0, %arg1, %61) : (i64, i64, i64) -> i64
      %67 = llvm.mlir.addressof @VALS : !llvm.ptr
      %68 = llvm.load %67 : !llvm.ptr -> !llvm.ptr
      %69 = llvm.getelementptr %68[%65] : (!llvm.ptr, i64) -> !llvm.ptr, f64
      %66 = llvm.load %69 : !llvm.ptr -> f64
      %70 = arith.addf %66, %arg3 : f64
      %71 = llvm.mlir.addressof @VALS : !llvm.ptr
      %72 = llvm.load %71 : !llvm.ptr -> !llvm.ptr
      %73 = llvm.getelementptr %72[%65] : (!llvm.ptr, i64) -> !llvm.ptr, f64
      llvm.store %70, %73 : f64, !llvm.ptr
      cf.br ^bb8
    ^bb7:
      %74 = func.call @cnt_at(%arg0, %arg1) : (i64, i64) -> i64
      %75 = func.call @idx(%arg0, %arg1, %74) : (i64, i64, i64) -> i64
      %76 = arith.trunci %arg2 : i64 to i32
      %77 = llvm.mlir.addressof @KEYS : !llvm.ptr
      %78 = llvm.load %77 : !llvm.ptr -> !llvm.ptr
      %79 = llvm.getelementptr %78[%75] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      llvm.store %76, %79 : i32, !llvm.ptr
      %80 = llvm.mlir.addressof @VALS : !llvm.ptr
      %81 = llvm.load %80 : !llvm.ptr -> !llvm.ptr
      %82 = llvm.getelementptr %81[%75] : (!llvm.ptr, i64) -> !llvm.ptr, f64
      llvm.store %arg3, %82 : f64, !llvm.ptr
      %84 = arith.constant 1 : i32
      %86 = arith.extsi %84 : i32 to i64
      %85 = arith.addi %74, %86 : i64
      func.call @set_cnt(%arg0, %arg1, %85) : (i64, i64, i64) -> ()
      cf.br ^bb8
    ^bb8:
    func.return
  }
  func.func @igcd(%arg0: i64, %arg1: i64) -> i64 {
    %87 = llvm.mlir.constant(1 : i64) : i64
    %88 = llvm.alloca %87 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %88 : i64, !llvm.ptr
    %89 = llvm.mlir.constant(1 : i64) : i64
    %90 = llvm.alloca %89 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg1, %90 : i64, !llvm.ptr
    cf.br ^bb9
    ^bb9:
    %91 = llvm.load %90 : !llvm.ptr -> i64
    %92 = arith.constant 0 : i32
    %94 = arith.extsi %92 : i32 to i64
    %93 = arith.cmpi ne, %91, %94 : i64
    cf.cond_br %93, ^bb10, ^bb11
    ^bb10:
      %95 = llvm.load %88 : !llvm.ptr -> i64
      %96 = llvm.load %90 : !llvm.ptr -> i64
      %97 = arith.remsi %95, %96 : i64
      %98 = llvm.load %90 : !llvm.ptr -> i64
      llvm.store %98, %88 : i64, !llvm.ptr
      llvm.store %97, %90 : i64, !llvm.ptr
      cf.br ^bb9
    ^bb11:
    %99 = llvm.load %88 : !llvm.ptr -> i64
    func.return %99 : i64
  }
  func.func @ilcm(%arg0: i64, %arg1: i64) -> i64 {
    %100 = func.call @igcd(%arg0, %arg1) : (i64, i64) -> i64
    %101 = arith.divsi %arg0, %100 : i64
    %102 = arith.muli %101, %arg1 : i64
    func.return %102 : i64
  }
  func.func @print_sci10(%arg0: f64) -> () {
    %103 = llvm.mlir.constant(1 : i64) : i64
    %104 = llvm.alloca %103 x f64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %104 : f64, !llvm.ptr
    %107 = llvm.load %104 : !llvm.ptr -> f64
    %106 = func.call @log10(%107) : (f64) -> f64
    %105 = func.call @floor(%106) : (f64) -> f64
    %108 = arith.fptosi %105 : f64 to i64
    %109 = llvm.mlir.constant(1 : i64) : i64
    %110 = llvm.alloca %109 x i64 : (i64) -> !llvm.ptr
    llvm.store %108, %110 : i64, !llvm.ptr
    %111 = llvm.load %104 : !llvm.ptr -> f64
    %113 = arith.constant 10.0 : f32
    %114 = llvm.load %110 : !llvm.ptr -> i64
    %115 = arith.sitofp %114 : i64 to f64
    %116 = arith.extf %113 : f32 to f64
    %112 = func.call @pow(%116, %115) : (f64, f64) -> f64
    %117 = arith.divf %111, %112 : f64
    %118 = llvm.mlir.constant(1 : i64) : i64
    %119 = llvm.alloca %118 x f64 : (i64) -> !llvm.ptr
    llvm.store %117, %119 : f64, !llvm.ptr
    cf.br ^bb12
    ^bb12:
    %120 = llvm.load %119 : !llvm.ptr -> f64
    %121 = arith.constant 10.0 : f32
    %123 = arith.extf %121 : f32 to f64
    %122 = arith.cmpf oge, %120, %123 : f64
    cf.cond_br %122, ^bb13, ^bb14
    ^bb13:
      %124 = llvm.load %119 : !llvm.ptr -> f64
      %125 = arith.constant 10.0 : f32
      %127 = arith.extf %125 : f32 to f64
      %126 = arith.divf %124, %127 : f64
      llvm.store %126, %119 : f64, !llvm.ptr
      %128 = llvm.load %110 : !llvm.ptr -> i64
      %129 = arith.constant 1 : i32
      %131 = arith.extsi %129 : i32 to i64
      %130 = arith.addi %128, %131 : i64
      llvm.store %130, %110 : i64, !llvm.ptr
      cf.br ^bb12
    ^bb14:
    cf.br ^bb15
    ^bb15:
    %132 = llvm.load %119 : !llvm.ptr -> f64
    %133 = arith.constant 1.0 : f32
    %135 = arith.extf %133 : f32 to f64
    %134 = arith.cmpf olt, %132, %135 : f64
    cf.cond_br %134, ^bb16, ^bb17
    ^bb16:
      %136 = llvm.load %119 : !llvm.ptr -> f64
      %137 = arith.constant 10.0 : f32
      %139 = arith.extf %137 : f32 to f64
      %138 = arith.mulf %136, %139 : f64
      llvm.store %138, %119 : f64, !llvm.ptr
      %140 = llvm.load %110 : !llvm.ptr -> i64
      %141 = arith.constant 1 : i32
      %143 = arith.extsi %141 : i32 to i64
      %142 = arith.subi %140, %143 : i64
      llvm.store %142, %110 : i64, !llvm.ptr
      cf.br ^bb15
    ^bb17:
    %144 = llvm.mlir.addressof @str_0 : !llvm.ptr
    %145 = llvm.load %119 : !llvm.ptr -> f64
    %146 = llvm.load %110 : !llvm.ptr -> i64
    %147 = llvm.call @printf(%144, %145, %146) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, f64, i64) -> i32
    func.return
  }
  func.func @main() -> i32 {
    %149 = llvm.mlir.addressof @N : !llvm.ptr
    %150 = llvm.load %149 : !llvm.ptr -> i64
    %151 = arith.constant 1 : i32
    %153 = arith.extsi %151 : i32 to i64
    %152 = arith.addi %150, %153 : i64
    %154 = arith.constant 4 : i32
    %155 = arith.extsi %154 : i32 to i64
    %148 = func.call @calloc(%152, %155) : (i64, i64) -> !llvm.ptr
    %157 = llvm.mlir.addressof @N : !llvm.ptr
    %158 = llvm.load %157 : !llvm.ptr -> i64
    %159 = arith.constant 4 : i32
    %160 = arith.extsi %159 : i32 to i64
    %156 = func.call @calloc(%158, %160) : (i64, i64) -> !llvm.ptr
    %162 = llvm.mlir.addressof @N : !llvm.ptr
    %163 = llvm.load %162 : !llvm.ptr -> i64
    %164 = arith.constant 1 : i32
    %166 = arith.extsi %164 : i32 to i64
    %165 = arith.addi %163, %166 : i64
    %167 = llvm.mlir.addressof @N : !llvm.ptr
    %168 = llvm.load %167 : !llvm.ptr -> i64
    %169 = arith.constant 1 : i32
    %171 = arith.extsi %169 : i32 to i64
    %170 = arith.addi %168, %171 : i64
    %172 = arith.muli %165, %170 : i64
    %173 = arith.constant 4 : i32
    %174 = arith.extsi %173 : i32 to i64
    %161 = func.call @calloc(%172, %174) : (i64, i64) -> !llvm.ptr
    %176 = llvm.mlir.addressof @N : !llvm.ptr
    %177 = llvm.load %176 : !llvm.ptr -> i64
    %178 = arith.constant 1 : i32
    %180 = arith.extsi %178 : i32 to i64
    %179 = arith.addi %177, %180 : i64
    %181 = arith.constant 4 : i32
    %182 = arith.extsi %181 : i32 to i64
    %175 = func.call @calloc(%179, %182) : (i64, i64) -> !llvm.ptr
    %184 = arith.constant 2 : i32
    %185 = llvm.mlir.addressof @N : !llvm.ptr
    %186 = llvm.load %185 : !llvm.ptr -> i64
    %187 = arith.constant 1 : i32
    %189 = arith.extsi %187 : i32 to i64
    %188 = arith.addi %186, %189 : i64
    %191 = arith.extsi %184 : i32 to i64
    %190 = arith.muli %191, %188 : i64
    %192 = llvm.mlir.addressof @CAP : !llvm.ptr
    %193 = llvm.load %192 : !llvm.ptr -> i64
    %194 = arith.muli %190, %193 : i64
    %195 = arith.constant 4 : i32
    %196 = arith.extsi %195 : i32 to i64
    %183 = func.call @calloc(%194, %196) : (i64, i64) -> !llvm.ptr
    %197 = llvm.mlir.addressof @KEYS : !llvm.ptr
    llvm.store %183, %197 : !llvm.ptr, !llvm.ptr
    %199 = arith.constant 2 : i32
    %200 = llvm.mlir.addressof @N : !llvm.ptr
    %201 = llvm.load %200 : !llvm.ptr -> i64
    %202 = arith.constant 1 : i32
    %204 = arith.extsi %202 : i32 to i64
    %203 = arith.addi %201, %204 : i64
    %206 = arith.extsi %199 : i32 to i64
    %205 = arith.muli %206, %203 : i64
    %207 = llvm.mlir.addressof @CAP : !llvm.ptr
    %208 = llvm.load %207 : !llvm.ptr -> i64
    %209 = arith.muli %205, %208 : i64
    %210 = arith.constant 8 : i32
    %211 = arith.extsi %210 : i32 to i64
    %198 = func.call @calloc(%209, %211) : (i64, i64) -> !llvm.ptr
    %212 = llvm.mlir.addressof @VALS : !llvm.ptr
    llvm.store %198, %212 : !llvm.ptr, !llvm.ptr
    %214 = arith.constant 2 : i32
    %215 = llvm.mlir.addressof @N : !llvm.ptr
    %216 = llvm.load %215 : !llvm.ptr -> i64
    %217 = arith.constant 1 : i32
    %219 = arith.extsi %217 : i32 to i64
    %218 = arith.addi %216, %219 : i64
    %221 = arith.extsi %214 : i32 to i64
    %220 = arith.muli %221, %218 : i64
    %222 = arith.constant 4 : i32
    %223 = arith.extsi %222 : i32 to i64
    %213 = func.call @calloc(%220, %223) : (i64, i64) -> !llvm.ptr
    %224 = llvm.mlir.addressof @CNT : !llvm.ptr
    llvm.store %213, %224 : !llvm.ptr, !llvm.ptr
    %226 = llvm.mlir.addressof @N : !llvm.ptr
    %227 = llvm.load %226 : !llvm.ptr -> i64
    %228 = arith.constant 1 : i32
    %230 = arith.extsi %228 : i32 to i64
    %229 = arith.addi %227, %230 : i64
    %231 = arith.constant 8 : i32
    %232 = arith.extsi %231 : i32 to i64
    %225 = func.call @calloc(%229, %232) : (i64, i64) -> !llvm.ptr
    %233 = llvm.mlir.zero : !llvm.ptr
    %234 = llvm.icmp "eq" %148, %233 : !llvm.ptr
    %235 = scf.if %234 -> (i1) {
      %236 = arith.constant true
      scf.yield %236 : i1
    } else {
      %237 = llvm.mlir.zero : !llvm.ptr
      %238 = llvm.icmp "eq" %156, %237 : !llvm.ptr
      scf.yield %238 : i1
    }
    %239 = scf.if %235 -> (i1) {
      %240 = arith.constant true
      scf.yield %240 : i1
    } else {
      %241 = llvm.mlir.addressof @KEYS : !llvm.ptr
      %242 = llvm.load %241 : !llvm.ptr -> !llvm.ptr
      %243 = llvm.mlir.zero : !llvm.ptr
      %244 = llvm.icmp "eq" %242, %243 : !llvm.ptr
      scf.yield %244 : i1
    }
    %245 = scf.if %239 -> (i1) {
      %246 = arith.constant true
      scf.yield %246 : i1
    } else {
      %247 = llvm.mlir.addressof @VALS : !llvm.ptr
      %248 = llvm.load %247 : !llvm.ptr -> !llvm.ptr
      %249 = llvm.mlir.zero : !llvm.ptr
      %250 = llvm.icmp "eq" %248, %249 : !llvm.ptr
      scf.yield %250 : i1
    }
    %251 = scf.if %245 -> (i1) {
      %252 = arith.constant true
      scf.yield %252 : i1
    } else {
      %253 = llvm.mlir.addressof @CNT : !llvm.ptr
      %254 = llvm.load %253 : !llvm.ptr -> !llvm.ptr
      %255 = llvm.mlir.zero : !llvm.ptr
      %256 = llvm.icmp "eq" %254, %255 : !llvm.ptr
      scf.yield %256 : i1
    }
    cf.cond_br %251, ^bb18, ^bb19
    ^bb18:
      %257 = arith.constant 1 : i32
      func.return %257 : i32
    ^bb19:
      cf.br ^bb20
    ^bb20:
    %258 = arith.constant 0 : i32
    %259 = arith.extsi %258 : i32 to i64
    %260 = llvm.mlir.constant(1 : i64) : i64
    %261 = llvm.alloca %260 x i64 : (i64) -> !llvm.ptr
    llvm.store %259, %261 : i64, !llvm.ptr
    %262 = arith.constant 2 : i32
    %263 = arith.extsi %262 : i32 to i64
    %264 = llvm.mlir.constant(1 : i64) : i64
    %265 = llvm.alloca %264 x i64 : (i64) -> !llvm.ptr
    llvm.store %263, %265 : i64, !llvm.ptr
    cf.br ^bb21
    ^bb21:
    %266 = llvm.load %265 : !llvm.ptr -> i64
    %267 = llvm.mlir.addressof @N : !llvm.ptr
    %268 = llvm.load %267 : !llvm.ptr -> i64
    %269 = arith.cmpi sle, %266, %268 : i64
    cf.cond_br %269, ^bb22, ^bb23
    ^bb22:
      %271 = llvm.load %265 : !llvm.ptr -> i64
      %272 = llvm.getelementptr %148[%271] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %270 = llvm.load %272 : !llvm.ptr -> i32
      %273 = arith.constant 0 : i32
      %274 = arith.cmpi eq, %270, %273 : i32
      cf.cond_br %274, ^bb24, ^bb25
      ^bb24:
        %275 = llvm.load %265 : !llvm.ptr -> i64
        %276 = arith.trunci %275 : i64 to i32
        %277 = llvm.load %261 : !llvm.ptr -> i64
        %278 = llvm.getelementptr %156[%277] : (!llvm.ptr, i64) -> !llvm.ptr, i32
        llvm.store %276, %278 : i32, !llvm.ptr
        %279 = llvm.load %261 : !llvm.ptr -> i64
        %280 = arith.constant 1 : i32
        %282 = arith.extsi %280 : i32 to i64
        %281 = arith.addi %279, %282 : i64
        llvm.store %281, %261 : i64, !llvm.ptr
        %283 = llvm.load %265 : !llvm.ptr -> i64
        %284 = llvm.mlir.constant(1 : i64) : i64
        %285 = llvm.alloca %284 x i64 : (i64) -> !llvm.ptr
        llvm.store %283, %285 : i64, !llvm.ptr
        cf.br ^bb27
        ^bb27:
        %286 = llvm.load %285 : !llvm.ptr -> i64
        %287 = llvm.mlir.addressof @N : !llvm.ptr
        %288 = llvm.load %287 : !llvm.ptr -> i64
        %289 = arith.cmpi sle, %286, %288 : i64
        cf.cond_br %289, ^bb28, ^bb29
        ^bb28:
          %290 = llvm.load %265 : !llvm.ptr -> i64
          %291 = arith.trunci %290 : i64 to i32
          %292 = llvm.load %285 : !llvm.ptr -> i64
          %293 = llvm.getelementptr %148[%292] : (!llvm.ptr, i64) -> !llvm.ptr, i32
          llvm.store %291, %293 : i32, !llvm.ptr
          %294 = llvm.load %285 : !llvm.ptr -> i64
          %295 = llvm.load %265 : !llvm.ptr -> i64
          %296 = arith.addi %294, %295 : i64
          llvm.store %296, %285 : i64, !llvm.ptr
          cf.br ^bb27
        ^bb29:
        cf.br ^bb26
      ^bb25:
        cf.br ^bb26
      ^bb26:
      %297 = llvm.load %265 : !llvm.ptr -> i64
      %298 = arith.constant 1 : i32
      %300 = arith.extsi %298 : i32 to i64
      %299 = arith.addi %297, %300 : i64
      llvm.store %299, %265 : i64, !llvm.ptr
      cf.br ^bb21
    ^bb23:
    %301 = arith.constant 2 : i32
    %302 = arith.extsi %301 : i32 to i64
    %303 = llvm.mlir.constant(1 : i64) : i64
    %304 = llvm.alloca %303 x i64 : (i64) -> !llvm.ptr
    llvm.store %302, %304 : i64, !llvm.ptr
    cf.br ^bb30
    ^bb30:
    %305 = llvm.load %304 : !llvm.ptr -> i64
    %306 = llvm.mlir.addressof @N : !llvm.ptr
    %307 = llvm.load %306 : !llvm.ptr -> i64
    %308 = arith.cmpi sle, %305, %307 : i64
    cf.cond_br %308, ^bb31, ^bb32
    ^bb31:
      %310 = llvm.load %304 : !llvm.ptr -> i64
      %311 = llvm.getelementptr %148[%310] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %309 = llvm.load %311 : !llvm.ptr -> i32
      %312 = arith.extsi %309 : i32 to i64
      %314 = llvm.getelementptr %175[%312] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %313 = llvm.load %314 : !llvm.ptr -> i32
      %315 = arith.extsi %313 : i32 to i64
      %316 = llvm.load %304 : !llvm.ptr -> i64
      %317 = arith.trunci %316 : i64 to i32
      %318 = llvm.mlir.addressof @N : !llvm.ptr
      %319 = llvm.load %318 : !llvm.ptr -> i64
      %320 = arith.constant 1 : i32
      %322 = arith.extsi %320 : i32 to i64
      %321 = arith.addi %319, %322 : i64
      %323 = arith.muli %312, %321 : i64
      %324 = arith.addi %323, %315 : i64
      %325 = llvm.getelementptr %161[%324] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      llvm.store %317, %325 : i32, !llvm.ptr
      %326 = arith.constant 1 : i32
      %328 = arith.extsi %326 : i32 to i64
      %327 = arith.addi %315, %328 : i64
      %329 = arith.trunci %327 : i64 to i32
      %330 = llvm.getelementptr %175[%312] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      llvm.store %329, %330 : i32, !llvm.ptr
      %331 = llvm.load %304 : !llvm.ptr -> i64
      %332 = arith.constant 1 : i32
      %334 = arith.extsi %332 : i32 to i64
      %333 = arith.addi %331, %334 : i64
      llvm.store %333, %304 : i64, !llvm.ptr
      cf.br ^bb30
    ^bb32:
    %335 = arith.constant 0 : i32
    %336 = arith.extsi %335 : i32 to i64
    %337 = llvm.mlir.constant(1 : i64) : i64
    %338 = llvm.alloca %337 x i64 : (i64) -> !llvm.ptr
    llvm.store %336, %338 : i64, !llvm.ptr
    %339 = arith.constant 1 : i32
    %340 = arith.extsi %339 : i32 to i64
    %341 = llvm.mlir.constant(1 : i64) : i64
    %342 = llvm.alloca %341 x i64 : (i64) -> !llvm.ptr
    llvm.store %340, %342 : i64, !llvm.ptr
    %344 = llvm.load %338 : !llvm.ptr -> i64
    %345 = arith.constant 0 : i32
    %346 = arith.constant 1 : i32
    %347 = arith.extsi %345 : i32 to i64
    %348 = arith.extsi %346 : i32 to i64
    func.call @set_cnt(%344, %347, %348) : (i64, i64, i64) -> ()
    %349 = arith.constant 1 : i32
    %350 = llvm.mlir.addressof @KEYS : !llvm.ptr
    %351 = llvm.load %350 : !llvm.ptr -> !llvm.ptr
    %353 = llvm.load %338 : !llvm.ptr -> i64
    %354 = arith.constant 0 : i32
    %355 = arith.constant 0 : i32
    %356 = arith.extsi %354 : i32 to i64
    %357 = arith.extsi %355 : i32 to i64
    %352 = func.call @idx(%353, %356, %357) : (i64, i64, i64) -> i64
    %358 = llvm.getelementptr %351[%352] : (!llvm.ptr, i64) -> !llvm.ptr, i32
    llvm.store %349, %358 : i32, !llvm.ptr
    %359 = arith.constant 1.0 : f32
    %360 = llvm.mlir.addressof @VALS : !llvm.ptr
    %361 = llvm.load %360 : !llvm.ptr -> !llvm.ptr
    %363 = llvm.load %338 : !llvm.ptr -> i64
    %364 = arith.constant 0 : i32
    %365 = arith.constant 0 : i32
    %366 = arith.extsi %364 : i32 to i64
    %367 = arith.extsi %365 : i32 to i64
    %362 = func.call @idx(%363, %366, %367) : (i64, i64, i64) -> i64
    %368 = arith.extf %359 : f32 to f64
    %369 = llvm.getelementptr %361[%362] : (!llvm.ptr, i64) -> !llvm.ptr, f64
    llvm.store %368, %369 : f64, !llvm.ptr
    %370 = arith.constant 1.0 : f32
    %371 = arith.extf %370 : f32 to f64
    %372 = llvm.mlir.constant(1 : i64) : i64
    %373 = llvm.alloca %372 x f64 : (i64) -> !llvm.ptr
    llvm.store %371, %373 : f64, !llvm.ptr
    %374 = arith.constant 1 : i32
    %375 = arith.extsi %374 : i32 to i64
    %376 = llvm.mlir.constant(1 : i64) : i64
    %377 = llvm.alloca %376 x i64 : (i64) -> !llvm.ptr
    llvm.store %375, %377 : i64, !llvm.ptr
    cf.br ^bb33
    ^bb33:
    %378 = llvm.load %377 : !llvm.ptr -> i64
    %379 = llvm.mlir.addressof @N : !llvm.ptr
    %380 = llvm.load %379 : !llvm.ptr -> i64
    %381 = arith.cmpi sle, %378, %380 : i64
    cf.cond_br %381, ^bb34, ^bb35
    ^bb34:
      %382 = llvm.load %373 : !llvm.ptr -> f64
      %383 = llvm.load %377 : !llvm.ptr -> i64
      %384 = arith.sitofp %383 : i64 to f64
      %385 = arith.divf %382, %384 : f64
      llvm.store %385, %373 : f64, !llvm.ptr
      %387 = llvm.load %338 : !llvm.ptr -> i64
      %388 = llvm.load %377 : !llvm.ptr -> i64
      %389 = arith.constant 1 : i32
      %390 = arith.extsi %389 : i32 to i64
      func.call @set_cnt(%387, %388, %390) : (i64, i64, i64) -> ()
      %391 = arith.constant 1 : i32
      %392 = llvm.mlir.addressof @KEYS : !llvm.ptr
      %393 = llvm.load %392 : !llvm.ptr -> !llvm.ptr
      %395 = llvm.load %338 : !llvm.ptr -> i64
      %396 = llvm.load %377 : !llvm.ptr -> i64
      %397 = arith.constant 0 : i32
      %398 = arith.extsi %397 : i32 to i64
      %394 = func.call @idx(%395, %396, %398) : (i64, i64, i64) -> i64
      %399 = llvm.getelementptr %393[%394] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      llvm.store %391, %399 : i32, !llvm.ptr
      %400 = llvm.load %373 : !llvm.ptr -> f64
      %401 = llvm.mlir.addressof @VALS : !llvm.ptr
      %402 = llvm.load %401 : !llvm.ptr -> !llvm.ptr
      %404 = llvm.load %338 : !llvm.ptr -> i64
      %405 = llvm.load %377 : !llvm.ptr -> i64
      %406 = arith.constant 0 : i32
      %407 = arith.extsi %406 : i32 to i64
      %403 = func.call @idx(%404, %405, %407) : (i64, i64, i64) -> i64
      %408 = llvm.getelementptr %402[%403] : (!llvm.ptr, i64) -> !llvm.ptr, f64
      llvm.store %400, %408 : f64, !llvm.ptr
      %409 = llvm.load %377 : !llvm.ptr -> i64
      %410 = arith.constant 1 : i32
      %412 = arith.extsi %410 : i32 to i64
      %411 = arith.addi %409, %412 : i64
      llvm.store %411, %377 : i64, !llvm.ptr
      cf.br ^bb33
    ^bb35:
    %413 = llvm.load %261 : !llvm.ptr -> i64
    %414 = arith.constant 1 : i32
    %416 = arith.extsi %414 : i32 to i64
    %415 = arith.subi %413, %416 : i64
    %417 = llvm.mlir.constant(1 : i64) : i64
    %418 = llvm.alloca %417 x i64 : (i64) -> !llvm.ptr
    llvm.store %415, %418 : i64, !llvm.ptr
    cf.br ^bb36
    ^bb36:
    %419 = llvm.load %418 : !llvm.ptr -> i64
    %420 = arith.constant 0 : i32
    %422 = arith.extsi %420 : i32 to i64
    %421 = arith.cmpi sge, %419, %422 : i64
    cf.cond_br %421, ^bb37, ^bb38
    ^bb37:
      %424 = llvm.load %418 : !llvm.ptr -> i64
      %425 = llvm.getelementptr %156[%424] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %423 = llvm.load %425 : !llvm.ptr -> i32
      %426 = arith.extsi %423 : i32 to i64
      %427 = arith.constant 0 : i32
      %428 = arith.extsi %427 : i32 to i64
      %429 = llvm.mlir.constant(1 : i64) : i64
      %430 = llvm.alloca %429 x i64 : (i64) -> !llvm.ptr
      llvm.store %428, %430 : i64, !llvm.ptr
      %432 = llvm.getelementptr %175[%426] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %431 = llvm.load %432 : !llvm.ptr -> i32
      %433 = arith.extsi %431 : i32 to i64
      cf.br ^bb39
      ^bb39:
      %434 = llvm.load %430 : !llvm.ptr -> i64
      %435 = arith.cmpi slt, %434, %433 : i64
      cf.cond_br %435, ^bb40, ^bb41
      ^bb40:
        %437 = llvm.mlir.addressof @N : !llvm.ptr
        %438 = llvm.load %437 : !llvm.ptr -> i64
        %439 = arith.constant 1 : i32
        %441 = arith.extsi %439 : i32 to i64
        %440 = arith.addi %438, %441 : i64
        %442 = arith.muli %426, %440 : i64
        %443 = llvm.load %430 : !llvm.ptr -> i64
        %444 = arith.addi %442, %443 : i64
        %445 = llvm.getelementptr %161[%444] : (!llvm.ptr, i64) -> !llvm.ptr, i32
        %436 = llvm.load %445 : !llvm.ptr -> i32
        %446 = arith.extsi %436 : i32 to i64
        %447 = arith.constant 0 : i32
        %448 = arith.extsi %447 : i32 to i64
        llvm.store %448, %377 : i64, !llvm.ptr
        cf.br ^bb42
        ^bb42:
        %449 = llvm.load %377 : !llvm.ptr -> i64
        %450 = llvm.mlir.addressof @N : !llvm.ptr
        %451 = llvm.load %450 : !llvm.ptr -> i64
        %452 = arith.cmpi sle, %449, %451 : i64
        cf.cond_br %452, ^bb43, ^bb44
        ^bb43:
          %454 = llvm.load %338 : !llvm.ptr -> i64
          %455 = llvm.load %377 : !llvm.ptr -> i64
          %453 = func.call @cnt_at(%454, %455) : (i64, i64) -> i64
          %457 = llvm.load %342 : !llvm.ptr -> i64
          %458 = llvm.load %377 : !llvm.ptr -> i64
          func.call @set_cnt(%457, %458, %453) : (i64, i64, i64) -> ()
          %459 = arith.constant 0 : i32
          %460 = arith.extsi %459 : i32 to i64
          %461 = llvm.mlir.constant(1 : i64) : i64
          %462 = llvm.alloca %461 x i64 : (i64) -> !llvm.ptr
          llvm.store %460, %462 : i64, !llvm.ptr
          cf.br ^bb45
          ^bb45:
          %463 = llvm.load %462 : !llvm.ptr -> i64
          %464 = arith.cmpi slt, %463, %453 : i64
          cf.cond_br %464, ^bb46, ^bb47
          ^bb46:
            %466 = llvm.mlir.addressof @KEYS : !llvm.ptr
            %467 = llvm.load %466 : !llvm.ptr -> !llvm.ptr
            %469 = llvm.load %338 : !llvm.ptr -> i64
            %470 = llvm.load %377 : !llvm.ptr -> i64
            %471 = llvm.load %462 : !llvm.ptr -> i64
            %468 = func.call @idx(%469, %470, %471) : (i64, i64, i64) -> i64
            %472 = llvm.getelementptr %467[%468] : (!llvm.ptr, i64) -> !llvm.ptr, i32
            %465 = llvm.load %472 : !llvm.ptr -> i32
            %473 = llvm.mlir.addressof @KEYS : !llvm.ptr
            %474 = llvm.load %473 : !llvm.ptr -> !llvm.ptr
            %476 = llvm.load %342 : !llvm.ptr -> i64
            %477 = llvm.load %377 : !llvm.ptr -> i64
            %478 = llvm.load %462 : !llvm.ptr -> i64
            %475 = func.call @idx(%476, %477, %478) : (i64, i64, i64) -> i64
            %479 = llvm.getelementptr %474[%475] : (!llvm.ptr, i64) -> !llvm.ptr, i32
            llvm.store %465, %479 : i32, !llvm.ptr
            %481 = llvm.mlir.addressof @VALS : !llvm.ptr
            %482 = llvm.load %481 : !llvm.ptr -> !llvm.ptr
            %484 = llvm.load %338 : !llvm.ptr -> i64
            %485 = llvm.load %377 : !llvm.ptr -> i64
            %486 = llvm.load %462 : !llvm.ptr -> i64
            %483 = func.call @idx(%484, %485, %486) : (i64, i64, i64) -> i64
            %487 = llvm.getelementptr %482[%483] : (!llvm.ptr, i64) -> !llvm.ptr, f64
            %480 = llvm.load %487 : !llvm.ptr -> f64
            %488 = llvm.mlir.addressof @VALS : !llvm.ptr
            %489 = llvm.load %488 : !llvm.ptr -> !llvm.ptr
            %491 = llvm.load %342 : !llvm.ptr -> i64
            %492 = llvm.load %377 : !llvm.ptr -> i64
            %493 = llvm.load %462 : !llvm.ptr -> i64
            %490 = func.call @idx(%491, %492, %493) : (i64, i64, i64) -> i64
            %494 = llvm.getelementptr %489[%490] : (!llvm.ptr, i64) -> !llvm.ptr, f64
            llvm.store %480, %494 : f64, !llvm.ptr
            %495 = llvm.load %462 : !llvm.ptr -> i64
            %496 = arith.constant 1 : i32
            %498 = arith.extsi %496 : i32 to i64
            %497 = arith.addi %495, %498 : i64
            llvm.store %497, %462 : i64, !llvm.ptr
            cf.br ^bb45
          ^bb47:
          %499 = llvm.load %377 : !llvm.ptr -> i64
          %500 = arith.constant 1 : i32
          %502 = arith.extsi %500 : i32 to i64
          %501 = arith.addi %499, %502 : i64
          llvm.store %501, %377 : i64, !llvm.ptr
          cf.br ^bb42
        ^bb44:
        %503 = arith.constant 1.0 : f32
        %504 = arith.extf %503 : f32 to f64
        %505 = llvm.mlir.constant(1 : i64) : i64
        %506 = llvm.alloca %505 x f64 : (i64) -> !llvm.ptr
        llvm.store %504, %506 : f64, !llvm.ptr
        %507 = llvm.mlir.addressof @N : !llvm.ptr
        %508 = llvm.load %507 : !llvm.ptr -> i64
        %509 = arith.divsi %508, %446 : i64
        %510 = arith.constant 1 : i32
        %511 = arith.extsi %510 : i32 to i64
        %512 = llvm.mlir.constant(1 : i64) : i64
        %513 = llvm.alloca %512 x i64 : (i64) -> !llvm.ptr
        llvm.store %511, %513 : i64, !llvm.ptr
        cf.br ^bb48
        ^bb48:
        %514 = llvm.load %513 : !llvm.ptr -> i64
        %515 = arith.cmpi sle, %514, %509 : i64
        cf.cond_br %515, ^bb49, ^bb50
        ^bb49:
          %516 = llvm.load %506 : !llvm.ptr -> f64
          %517 = arith.sitofp %446 : i64 to f64
          %518 = llvm.load %513 : !llvm.ptr -> i64
          %519 = arith.sitofp %518 : i64 to f64
          %520 = arith.mulf %517, %519 : f64
          %521 = arith.divf %516, %520 : f64
          llvm.store %521, %506 : f64, !llvm.ptr
          %522 = llvm.load %506 : !llvm.ptr -> f64
          %523 = llvm.load %513 : !llvm.ptr -> i64
          %524 = arith.constant 1 : i32
          %526 = arith.extsi %524 : i32 to i64
          %525 = arith.subi %523, %526 : i64
          %527 = llvm.getelementptr %225[%525] : (!llvm.ptr, i64) -> !llvm.ptr, f64
          llvm.store %522, %527 : f64, !llvm.ptr
          %528 = llvm.load %513 : !llvm.ptr -> i64
          %529 = arith.constant 1 : i32
          %531 = arith.extsi %529 : i32 to i64
          %530 = arith.addi %528, %531 : i64
          llvm.store %530, %513 : i64, !llvm.ptr
          cf.br ^bb48
        ^bb50:
        %532 = arith.constant 0 : i32
        %533 = arith.extsi %532 : i32 to i64
        llvm.store %533, %377 : i64, !llvm.ptr
        cf.br ^bb51
        ^bb51:
        %534 = llvm.load %377 : !llvm.ptr -> i64
        %535 = llvm.mlir.addressof @N : !llvm.ptr
        %536 = llvm.load %535 : !llvm.ptr -> i64
        %537 = arith.subi %536, %446 : i64
        %538 = arith.cmpi sle, %534, %537 : i64
        cf.cond_br %538, ^bb52, ^bb53
        ^bb52:
          %540 = llvm.load %338 : !llvm.ptr -> i64
          %541 = llvm.load %377 : !llvm.ptr -> i64
          %539 = func.call @cnt_at(%540, %541) : (i64, i64) -> i64
          %542 = arith.constant 0 : i32
          %543 = arith.extsi %542 : i32 to i64
          %544 = llvm.mlir.constant(1 : i64) : i64
          %545 = llvm.alloca %544 x i64 : (i64) -> !llvm.ptr
          llvm.store %543, %545 : i64, !llvm.ptr
          cf.br ^bb54
          ^bb54:
          %546 = llvm.load %545 : !llvm.ptr -> i64
          %547 = arith.cmpi slt, %546, %539 : i64
          cf.cond_br %547, ^bb55, ^bb56
          ^bb55:
            %549 = llvm.mlir.addressof @KEYS : !llvm.ptr
            %550 = llvm.load %549 : !llvm.ptr -> !llvm.ptr
            %552 = llvm.load %338 : !llvm.ptr -> i64
            %553 = llvm.load %377 : !llvm.ptr -> i64
            %554 = llvm.load %545 : !llvm.ptr -> i64
            %551 = func.call @idx(%552, %553, %554) : (i64, i64, i64) -> i64
            %555 = llvm.getelementptr %550[%551] : (!llvm.ptr, i64) -> !llvm.ptr, i32
            %548 = llvm.load %555 : !llvm.ptr -> i32
            %556 = arith.extsi %548 : i32 to i64
            %558 = llvm.mlir.addressof @VALS : !llvm.ptr
            %559 = llvm.load %558 : !llvm.ptr -> !llvm.ptr
            %561 = llvm.load %338 : !llvm.ptr -> i64
            %562 = llvm.load %377 : !llvm.ptr -> i64
            %563 = llvm.load %545 : !llvm.ptr -> i64
            %560 = func.call @idx(%561, %562, %563) : (i64, i64, i64) -> i64
            %564 = llvm.getelementptr %559[%560] : (!llvm.ptr, i64) -> !llvm.ptr, f64
            %557 = llvm.load %564 : !llvm.ptr -> f64
            %565 = func.call @ilcm(%556, %446) : (i64, i64) -> i64
            %566 = llvm.load %377 : !llvm.ptr -> i64
            %567 = llvm.mlir.constant(1 : i64) : i64
            %568 = llvm.alloca %567 x i64 : (i64) -> !llvm.ptr
            llvm.store %566, %568 : i64, !llvm.ptr
            %569 = llvm.mlir.addressof @N : !llvm.ptr
            %570 = llvm.load %569 : !llvm.ptr -> i64
            %571 = llvm.load %377 : !llvm.ptr -> i64
            %572 = arith.subi %570, %571 : i64
            %573 = arith.divsi %572, %446 : i64
            %574 = arith.constant 0 : i32
            %575 = arith.extsi %574 : i32 to i64
            %576 = llvm.mlir.constant(1 : i64) : i64
            %577 = llvm.alloca %576 x i64 : (i64) -> !llvm.ptr
            llvm.store %575, %577 : i64, !llvm.ptr
            cf.br ^bb57
            ^bb57:
            %578 = llvm.load %577 : !llvm.ptr -> i64
            %579 = arith.cmpi slt, %578, %573 : i64
            cf.cond_br %579, ^bb58, ^bb59
            ^bb58:
              %580 = llvm.load %568 : !llvm.ptr -> i64
              %581 = arith.addi %580, %446 : i64
              llvm.store %581, %568 : i64, !llvm.ptr
              %583 = llvm.load %342 : !llvm.ptr -> i64
              %584 = llvm.load %568 : !llvm.ptr -> i64
              %586 = llvm.load %577 : !llvm.ptr -> i64
              %587 = llvm.getelementptr %225[%586] : (!llvm.ptr, i64) -> !llvm.ptr, f64
              %585 = llvm.load %587 : !llvm.ptr -> f64
              %588 = arith.mulf %557, %585 : f64
              func.call @add_to(%583, %584, %565, %588) : (i64, i64, i64, f64) -> ()
              %589 = llvm.load %577 : !llvm.ptr -> i64
              %590 = arith.constant 1 : i32
              %592 = arith.extsi %590 : i32 to i64
              %591 = arith.addi %589, %592 : i64
              llvm.store %591, %577 : i64, !llvm.ptr
              cf.br ^bb57
            ^bb59:
            %593 = llvm.load %545 : !llvm.ptr -> i64
            %594 = arith.constant 1 : i32
            %596 = arith.extsi %594 : i32 to i64
            %595 = arith.addi %593, %596 : i64
            llvm.store %595, %545 : i64, !llvm.ptr
            cf.br ^bb54
          ^bb56:
          %597 = llvm.load %377 : !llvm.ptr -> i64
          %598 = arith.constant 1 : i32
          %600 = arith.extsi %598 : i32 to i64
          %599 = arith.addi %597, %600 : i64
          llvm.store %599, %377 : i64, !llvm.ptr
          cf.br ^bb51
        ^bb53:
        %601 = llvm.load %338 : !llvm.ptr -> i64
        %602 = llvm.load %342 : !llvm.ptr -> i64
        llvm.store %602, %338 : i64, !llvm.ptr
        llvm.store %601, %342 : i64, !llvm.ptr
        %603 = llvm.load %430 : !llvm.ptr -> i64
        %604 = arith.constant 1 : i32
        %606 = arith.extsi %604 : i32 to i64
        %605 = arith.addi %603, %606 : i64
        llvm.store %605, %430 : i64, !llvm.ptr
        cf.br ^bb39
      ^bb41:
      %607 = arith.sitofp %426 : i64 to f64
      %608 = arith.sitofp %426 : i64 to f64
      %609 = arith.mulf %607, %608 : f64
      %610 = arith.constant 0 : i32
      %611 = arith.extsi %610 : i32 to i64
      llvm.store %611, %377 : i64, !llvm.ptr
      cf.br ^bb60
      ^bb60:
      %612 = llvm.load %377 : !llvm.ptr -> i64
      %613 = llvm.mlir.addressof @N : !llvm.ptr
      %614 = llvm.load %613 : !llvm.ptr -> i64
      %615 = arith.cmpi sle, %612, %614 : i64
      cf.cond_br %615, ^bb61, ^bb62
      ^bb61:
        %617 = llvm.load %342 : !llvm.ptr -> i64
        %618 = llvm.load %377 : !llvm.ptr -> i64
        %619 = arith.constant 0 : i32
        %620 = arith.extsi %619 : i32 to i64
        func.call @set_cnt(%617, %618, %620) : (i64, i64, i64) -> ()
        %622 = llvm.load %338 : !llvm.ptr -> i64
        %623 = llvm.load %377 : !llvm.ptr -> i64
        %621 = func.call @cnt_at(%622, %623) : (i64, i64) -> i64
        %624 = arith.constant 0 : i32
        %625 = arith.extsi %624 : i32 to i64
        %626 = llvm.mlir.constant(1 : i64) : i64
        %627 = llvm.alloca %626 x i64 : (i64) -> !llvm.ptr
        llvm.store %625, %627 : i64, !llvm.ptr
        cf.br ^bb63
        ^bb63:
        %628 = llvm.load %627 : !llvm.ptr -> i64
        %629 = arith.cmpi slt, %628, %621 : i64
        cf.cond_br %629, ^bb64, ^bb65
        ^bb64:
          %631 = llvm.mlir.addressof @KEYS : !llvm.ptr
          %632 = llvm.load %631 : !llvm.ptr -> !llvm.ptr
          %634 = llvm.load %338 : !llvm.ptr -> i64
          %635 = llvm.load %377 : !llvm.ptr -> i64
          %636 = llvm.load %627 : !llvm.ptr -> i64
          %633 = func.call @idx(%634, %635, %636) : (i64, i64, i64) -> i64
          %637 = llvm.getelementptr %632[%633] : (!llvm.ptr, i64) -> !llvm.ptr, i32
          %630 = llvm.load %637 : !llvm.ptr -> i32
          %638 = arith.extsi %630 : i32 to i64
          %639 = llvm.mlir.constant(1 : i64) : i64
          %640 = llvm.alloca %639 x i64 : (i64) -> !llvm.ptr
          llvm.store %638, %640 : i64, !llvm.ptr
          %642 = llvm.mlir.addressof @VALS : !llvm.ptr
          %643 = llvm.load %642 : !llvm.ptr -> !llvm.ptr
          %645 = llvm.load %338 : !llvm.ptr -> i64
          %646 = llvm.load %377 : !llvm.ptr -> i64
          %647 = llvm.load %627 : !llvm.ptr -> i64
          %644 = func.call @idx(%645, %646, %647) : (i64, i64, i64) -> i64
          %648 = llvm.getelementptr %643[%644] : (!llvm.ptr, i64) -> !llvm.ptr, f64
          %641 = llvm.load %648 : !llvm.ptr -> f64
          %649 = llvm.mlir.constant(1 : i64) : i64
          %650 = llvm.alloca %649 x f64 : (i64) -> !llvm.ptr
          llvm.store %641, %650 : f64, !llvm.ptr
          cf.br ^bb66
          ^bb66:
          %651 = llvm.load %640 : !llvm.ptr -> i64
          %652 = arith.remsi %651, %426 : i64
          %653 = arith.constant 0 : i32
          %655 = arith.extsi %653 : i32 to i64
          %654 = arith.cmpi eq, %652, %655 : i64
          cf.cond_br %654, ^bb67, ^bb68
          ^bb67:
            %656 = llvm.load %640 : !llvm.ptr -> i64
            %657 = arith.divsi %656, %426 : i64
            llvm.store %657, %640 : i64, !llvm.ptr
            %658 = llvm.load %650 : !llvm.ptr -> f64
            %659 = arith.mulf %658, %609 : f64
            llvm.store %659, %650 : f64, !llvm.ptr
            cf.br ^bb66
          ^bb68:
          %661 = llvm.load %342 : !llvm.ptr -> i64
          %662 = llvm.load %377 : !llvm.ptr -> i64
          %663 = llvm.load %640 : !llvm.ptr -> i64
          %664 = llvm.load %650 : !llvm.ptr -> f64
          func.call @add_to(%661, %662, %663, %664) : (i64, i64, i64, f64) -> ()
          %665 = llvm.load %627 : !llvm.ptr -> i64
          %666 = arith.constant 1 : i32
          %668 = arith.extsi %666 : i32 to i64
          %667 = arith.addi %665, %668 : i64
          llvm.store %667, %627 : i64, !llvm.ptr
          cf.br ^bb63
        ^bb65:
        %669 = llvm.load %377 : !llvm.ptr -> i64
        %670 = arith.constant 1 : i32
        %672 = arith.extsi %670 : i32 to i64
        %671 = arith.addi %669, %672 : i64
        llvm.store %671, %377 : i64, !llvm.ptr
        cf.br ^bb60
      ^bb62:
      %673 = llvm.load %338 : !llvm.ptr -> i64
      %674 = llvm.load %342 : !llvm.ptr -> i64
      llvm.store %674, %338 : i64, !llvm.ptr
      llvm.store %673, %342 : i64, !llvm.ptr
      %675 = llvm.load %418 : !llvm.ptr -> i64
      %676 = arith.constant 1 : i32
      %678 = arith.extsi %676 : i32 to i64
      %677 = arith.subi %675, %678 : i64
      llvm.store %677, %418 : i64, !llvm.ptr
      cf.br ^bb36
    ^bb38:
    %679 = arith.constant 0.0 : f32
    %680 = arith.extf %679 : f32 to f64
    %681 = llvm.mlir.constant(1 : i64) : i64
    %682 = llvm.alloca %681 x f64 : (i64) -> !llvm.ptr
    llvm.store %680, %682 : f64, !llvm.ptr
    %684 = llvm.load %338 : !llvm.ptr -> i64
    %685 = llvm.mlir.addressof @N : !llvm.ptr
    %686 = llvm.load %685 : !llvm.ptr -> i64
    %683 = func.call @cnt_at(%684, %686) : (i64, i64) -> i64
    %687 = arith.constant 0 : i32
    %688 = arith.extsi %687 : i32 to i64
    %689 = llvm.mlir.constant(1 : i64) : i64
    %690 = llvm.alloca %689 x i64 : (i64) -> !llvm.ptr
    llvm.store %688, %690 : i64, !llvm.ptr
    cf.br ^bb69
    ^bb69:
    %691 = llvm.load %690 : !llvm.ptr -> i64
    %692 = arith.cmpi slt, %691, %683 : i64
    cf.cond_br %692, ^bb70, ^bb71
    ^bb70:
      %694 = llvm.mlir.addressof @KEYS : !llvm.ptr
      %695 = llvm.load %694 : !llvm.ptr -> !llvm.ptr
      %697 = llvm.load %338 : !llvm.ptr -> i64
      %698 = llvm.mlir.addressof @N : !llvm.ptr
      %699 = llvm.load %698 : !llvm.ptr -> i64
      %700 = llvm.load %690 : !llvm.ptr -> i64
      %696 = func.call @idx(%697, %699, %700) : (i64, i64, i64) -> i64
      %701 = llvm.getelementptr %695[%696] : (!llvm.ptr, i64) -> !llvm.ptr, i32
      %693 = llvm.load %701 : !llvm.ptr -> i32
      %702 = arith.sitofp %693 : i32 to f64
      %703 = llvm.load %682 : !llvm.ptr -> f64
      %704 = arith.mulf %702, %702 : f64
      %706 = llvm.mlir.addressof @VALS : !llvm.ptr
      %707 = llvm.load %706 : !llvm.ptr -> !llvm.ptr
      %709 = llvm.load %338 : !llvm.ptr -> i64
      %710 = llvm.mlir.addressof @N : !llvm.ptr
      %711 = llvm.load %710 : !llvm.ptr -> i64
      %712 = llvm.load %690 : !llvm.ptr -> i64
      %708 = func.call @idx(%709, %711, %712) : (i64, i64, i64) -> i64
      %713 = llvm.getelementptr %707[%708] : (!llvm.ptr, i64) -> !llvm.ptr, f64
      %705 = llvm.load %713 : !llvm.ptr -> f64
      %714 = arith.mulf %704, %705 : f64
      %715 = arith.addf %703, %714 : f64
      llvm.store %715, %682 : f64, !llvm.ptr
      %716 = llvm.load %690 : !llvm.ptr -> i64
      %717 = arith.constant 1 : i32
      %719 = arith.extsi %717 : i32 to i64
      %718 = arith.addi %716, %719 : i64
      llvm.store %718, %690 : i64, !llvm.ptr
      cf.br ^bb69
    ^bb71:
    %721 = llvm.load %682 : !llvm.ptr -> f64
    func.call @print_sci10(%721) : (f64) -> ()
    func.call @free(%225) : (!llvm.ptr) -> ()
    %724 = llvm.mlir.addressof @CNT : !llvm.ptr
    %725 = llvm.load %724 : !llvm.ptr -> !llvm.ptr
    func.call @free(%725) : (!llvm.ptr) -> ()
    %727 = llvm.mlir.addressof @VALS : !llvm.ptr
    %728 = llvm.load %727 : !llvm.ptr -> !llvm.ptr
    func.call @free(%728) : (!llvm.ptr) -> ()
    %730 = llvm.mlir.addressof @KEYS : !llvm.ptr
    %731 = llvm.load %730 : !llvm.ptr -> !llvm.ptr
    func.call @free(%731) : (!llvm.ptr) -> ()
    func.call @free(%175) : (!llvm.ptr) -> ()
    func.call @free(%161) : (!llvm.ptr) -> ()
    func.call @free(%156) : (!llvm.ptr) -> ()
    func.call @free(%148) : (!llvm.ptr) -> ()
    %736 = arith.constant 0 : i32
    func.return %736 : i32
  }
}