Problem 385

A(10^9): sum of areas of integer triangles with Steiner foci at (±√13, 0).

Answer3776957309612153700
Output3776957309612153700
StatusPASS
Native helperno
Runtime10 ms
Peak memory1120 KB
Time complexityO(n^2) (estimated)
Space complexityO(n) (estimated)

Performance comparison

MetricOur solutionBest known
Time complexityO(n^2)O(n^2)
Space complexityO(n)O(n^2)
ApproachFlow solutionBottom-up DP
VerdictOptimal

Flow source

# Project Euler 385
# A(10^9): sum of areas of integer triangles with Steiner foci at (±√13, 0).

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

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

function iabs(x: i64) -> i64 {
    if x < 0 { return 0 - x }
    return x
}

function pt_less(ax: i64, ay: i64, bx: i64, by: i64) -> i64 {
    if ax < bx { return 1 }
    if ax > bx { return 0 }
    if ay < by { return 1 }
    return 0
}

function tri_seen(sx: ptr<i64>, sy: ptr<i64>, nseen: i64,
                  x1: i64, y1: i64, x2: i64, y2: i64, x3: i64, y3: i64) -> i64 {
    let mut i: i64 = 0
    while i < nseen {
        let b: i64 = i * 3
        if sx[b] == x1 && sy[b] == y1 && sx[b + 1] == x2 && sy[b + 1] == y2 && sx[b + 2] == x3 && sy[b + 2] == y3 {
            return 1
        }
        i = i + 1
    }
    return 0
}

function main() -> i32 {
    let N: i64 = 1000000000
    # Pell seeds packed: K, then pairs (s,t). We hardcode the four K groups.
    let seeds_k: array<i64, 4> = [468, 117, 36, 9]
    let seeds_s: array<i64, 6> = [24, 30, 12, 15, 6, 3]
    let seeds_t: array<i64, 6> = [6, 12, 3, 6, 0, 0]
    let seeds_cnt: array<i64, 4> = [2, 2, 1, 1]
    let seeds_off: array<i64, 4> = [0, 2, 4, 5]

    let sx: ptr<i64> = calloc(500 * 3, 8)
    let sy: ptr<i64> = calloc(500 * 3, 8)
    if sx == null || sy == null { return 1 }
    let mut nseen: i64 = 0
    let mut total: i128 = 0

    let mut m: i64 = 0 - 12
    while m <= 12 {
        let mut n: i64 = 0 - 21
        while n <= 21 {
            if m == 0 && n == 0 {
                n = n + 1
                continue
            }
            if igcd(iabs(m), iabs(n)) != 1 {
                n = n + 1
                continue
            }
            let D: i64 = n * n + 3 * m * m
            if D == 0 || 468 % D != 0 {
                n = n + 1
                continue
            }
            let K: i64 = 468 / D
            let mut ki: i64 = 0
            let mut found: i64 = 0
            while ki < 4 {
                if seeds_k[ki] == K {
                    found = 1
                    break
                }
                ki = ki + 1
            }
            if found == 0 {
                n = n + 1
                continue
            }

            let cnt: i64 = seeds_cnt[ki]
            let off: i64 = seeds_off[ki]
            let mut si: i64 = 0
            while si < cnt {
                let mut s: i64 = seeds_s[off + si]
                let mut t: i64 = seeds_t[off + si]
                while 1 == 1 {
                    let mut mx: i64 = s
                    if t > mx { mx = t }
                    if mx > 6 * N + 10 { break }

                    if s != 0 && t != 0 {
                        let mut ssign: i64 = 0
                        while ssign < 2 {
                            let mut tsign: i64 = 0
                            while tsign < 2 {
                                let mut ss: i64 = s
                                if ssign == 1 { ss = 0 - s }
                                let mut tt: i64 = t
                                if tsign == 1 { tt = 0 - t }

                                if (ss * n) % 3 == 0 {
                                    let a: i64 = ss * m
                                    let b: i64 = 0 - tt * n
                                    let c: i64 = (ss * n) / 3
                                    let d: i64 = tt * m
                                    if ((a + c) & 1) == 0 && ((b + d) & 1) == 0 {
                                        let x1: i64 = (a + c) / 2
                                        let y1: i64 = (b + d) / 2
                                        let x2: i64 = (c - a) / 2
                                        let y2: i64 = (d - b) / 2
                                        let x3: i64 = 0 - c
                                        let y3: i64 = 0 - d
                                        let mut big: i64 = iabs(x1)
                                        if iabs(y1) > big { big = iabs(y1) }
                                        if iabs(x2) > big { big = iabs(x2) }
                                        if iabs(y2) > big { big = iabs(y2) }
                                        if iabs(x3) > big { big = iabs(x3) }
                                        if iabs(y3) > big { big = iabs(y3) }
                                        if big <= N {
                                            # sort three points
                                            let mut p1x: i64 = x1
                                            let mut p1y: i64 = y1
                                            let mut p2x: i64 = x2
                                            let mut p2y: i64 = y2
                                            let mut p3x: i64 = x3
                                            let mut p3y: i64 = y3
                                            if pt_less(p2x, p2y, p1x, p1y) == 1 {
                                                let tx: i64 = p1x
                                                let ty: i64 = p1y
                                                p1x = p2x
                                                p1y = p2y
                                                p2x = tx
                                                p2y = ty
                                            }
                                            if pt_less(p3x, p3y, p2x, p2y) == 1 {
                                                let tx2: i64 = p2x
                                                let ty2: i64 = p2y
                                                p2x = p3x
                                                p2y = p3y
                                                p3x = tx2
                                                p3y = ty2
                                            }
                                            if pt_less(p2x, p2y, p1x, p1y) == 1 {
                                                let tx3: i64 = p1x
                                                let ty3: i64 = p1y
                                                p1x = p2x
                                                p1y = p2y
                                                p2x = tx3
                                                p2y = ty3
                                            }
                                            if tri_seen(sx, sy, nseen, p1x, p1y, p2x, p2y, p3x, p3y) == 0 {
                                                let bidx: i64 = nseen * 3
                                                sx[bidx] = p1x
                                                sy[bidx] = p1y
                                                sx[bidx + 1] = p2x
                                                sy[bidx + 1] = p2y
                                                sx[bidx + 2] = p3x
                                                sy[bidx + 2] = p3y
                                                nseen = nseen + 1
                                                let prod: i128 = (D as i128) * (iabs(s) as i128) * (iabs(t) as i128)
                                                total = total + prod
                                            }
                                        }
                                    }
                                }
                                tsign = tsign + 1
                            }
                            ssign = ssign + 1
                        }
                    }
                    let ns: i64 = 2 * s + 3 * t
                    let nt: i64 = s + 2 * t
                    s = ns
                    t = nt
                }
                si = si + 1
            }
            n = n + 1
        }
        m = m + 1
    }

    let ans: i64 = (total / (4 as i128)) as i64
    printf("%lld\n", ans)
    free(sy)
    free(sx)
    return 0
}

Generated C

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

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

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

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

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

#include <math.h>

void* _ui_state = NULL;

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

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

int64_t igcd_i64_i64(int64_t a0, int64_t b0);
int64_t iabs_i64(int64_t x);
int64_t pt_less_i64_i64_i64_i64(int64_t ax, int64_t ay, int64_t bx, int64_t by);
int64_t tri_seen_ptr_i64_ptr_i64_i64_i64_i64_i64_i64_i64_i64(int64_t* sx, int64_t* sy, int64_t nseen, int64_t x1, int64_t y1, int64_t x2, int64_t y2, int64_t x3, int64_t y3);
int32_t main(void);



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

int64_t iabs_i64(int64_t x) {
    if (x < 0) {
        return (0 - x);
    }
    return x;
}

int64_t pt_less_i64_i64_i64_i64(int64_t ax, int64_t ay, int64_t bx, int64_t by) {
    if (ax < bx) {
        return 1;
    }
    if (ax > bx) {
        return 0;
    }
    if (ay < by) {
        return 1;
    }
    return 0;
}

int64_t tri_seen_ptr_i64_ptr_i64_i64_i64_i64_i64_i64_i64_i64(int64_t* sx, int64_t* sy, int64_t nseen, int64_t x1, int64_t y1, int64_t x2, int64_t y2, int64_t x3, int64_t y3) {
    int64_t i = 0;
    while (i < nseen) {
        int64_t b = (i * 3);
        if ((((((sx[b] == x1 && sy[b] == y1) && sx[(b + 1)] == x2) && sy[(b + 1)] == y2) && sx[(b + 2)] == x3) && sy[(b + 2)] == y3)) {
            return 1;
        }
        i = (i + 1);
    }
    return 0;
}

int32_t main(void) {
    int64_t N = 1000000000;
    int64_t seeds_k[4] = { 468, 117, 36, 9 };
    int64_t seeds_s[6] = { 24, 30, 12, 15, 6, 3 };
    int64_t seeds_t[6] = { 6, 12, 3, 6, 0, 0 };
    int64_t seeds_cnt[4] = { 2, 2, 1, 1 };
    int64_t seeds_off[4] = { 0, 2, 4, 5 };
    int64_t* sx = (int64_t*)(calloc((500 * 3), 8));
    int64_t* sy = (int64_t*)(calloc((500 * 3), 8));
    if ((sx == NULL || sy == NULL)) {
        return 1;
    }
    int64_t nseen = 0;
    __int128 total = 0;
    int64_t m = (0 - 12);
    while (m <= 12) {
        int64_t n = (0 - 21);
        while (n <= 21) {
            if ((m == 0 && n == 0)) {
                n = (n + 1);
                continue;
            }
            if (igcd_i64_i64(iabs_i64(m), iabs_i64(n)) != 1) {
                n = (n + 1);
                continue;
            }
            int64_t D = ((n * n) + ((3 * m) * m));
            if ((D == 0 || FLOW_CHECKED_MOD((468), (D)) != 0)) {
                n = (n + 1);
                continue;
            }
            int64_t K = FLOW_CHECKED_DIV((468), (D));
            int64_t ki = 0;
            int64_t found = 0;
            while (ki < 4) {
                if ((((unsigned)(ki) < 4) ? seeds_k[ki] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(ki), 4), flow_fault_handler("array index out of bounds"), seeds_k[0])) == K) {
                    found = 1;
                    break;
                }
                ki = (ki + 1);
            }
            if (found == 0) {
                n = (n + 1);
                continue;
            }
            int64_t cnt = (((unsigned)(ki) < 4) ? seeds_cnt[ki] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(ki), 4), flow_fault_handler("array index out of bounds"), seeds_cnt[0]));
            int64_t off = (((unsigned)(ki) < 4) ? seeds_off[ki] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(ki), 4), flow_fault_handler("array index out of bounds"), seeds_off[0]));
            int64_t si = 0;
            while (si < cnt) {
                int64_t s = (((unsigned)((off + si)) < 6) ? seeds_s[(off + si)] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)((off + si)), 6), flow_fault_handler("array index out of bounds"), seeds_s[0]));
                int64_t t = (((unsigned)((off + si)) < 6) ? seeds_t[(off + si)] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)((off + si)), 6), flow_fault_handler("array index out of bounds"), seeds_t[0]));
                while (1 == 1) {
                    int64_t mx = s;
                    if (t > mx) {
                        mx = t;
                    }
                    if (mx > ((6 * N) + 10)) {
                        break;
                    }
                    if ((s != 0 && t != 0)) {
                        int64_t ssign = 0;
                        while (ssign < 2) {
                            int64_t tsign = 0;
                            while (tsign < 2) {
                                int64_t ss = s;
                                if (ssign == 1) {
                                    ss = (0 - s);
                                }
                                int64_t tt = t;
                                if (tsign == 1) {
                                    tt = (0 - t);
                                }
                                if (FLOW_CHECKED_MOD(((ss * n)), (3)) == 0) {
                                    int64_t a = (ss * m);
                                    int64_t b = (0 - (tt * n));
                                    int64_t c = FLOW_CHECKED_DIV(((ss * n)), (3));
                                    int64_t d = (tt * m);
                                    if ((((a + c) & 1) == 0 && ((b + d) & 1) == 0)) {
                                        int64_t x1 = FLOW_CHECKED_DIV(((a + c)), (2));
                                        int64_t y1 = FLOW_CHECKED_DIV(((b + d)), (2));
                                        int64_t x2 = FLOW_CHECKED_DIV(((c - a)), (2));
                                        int64_t y2 = FLOW_CHECKED_DIV(((d - b)), (2));
                                        int64_t x3 = (0 - c);
                                        int64_t y3 = (0 - d);
                                        int64_t big = iabs_i64(x1);
                                        if (iabs_i64(y1) > big) {
                                            big = iabs_i64(y1);
                                        }
                                        if (iabs_i64(x2) > big) {
                                            big = iabs_i64(x2);
                                        }
                                        if (iabs_i64(y2) > big) {
                                            big = iabs_i64(y2);
                                        }
                                        if (iabs_i64(x3) > big) {
                                            big = iabs_i64(x3);
                                        }
                                        if (iabs_i64(y3) > big) {
                                            big = iabs_i64(y3);
                                        }
                                        if (big <= N) {
                                            int64_t p1x = x1;
                                            int64_t p1y = y1;
                                            int64_t p2x = x2;
                                            int64_t p2y = y2;
                                            int64_t p3x = x3;
                                            int64_t p3y = y3;
                                            if (pt_less_i64_i64_i64_i64(p2x, p2y, p1x, p1y) == 1) {
                                                int64_t tx = p1x;
                                                int64_t ty = p1y;
                                                p1x = p2x;
                                                p1y = p2y;
                                                p2x = tx;
                                                p2y = ty;
                                            }
                                            if (pt_less_i64_i64_i64_i64(p3x, p3y, p2x, p2y) == 1) {
                                                int64_t tx2 = p2x;
                                                int64_t ty2 = p2y;
                                                p2x = p3x;
                                                p2y = p3y;
                                                p3x = tx2;
                                                p3y = ty2;
                                            }
                                            if (pt_less_i64_i64_i64_i64(p2x, p2y, p1x, p1y) == 1) {
                                                int64_t tx3 = p1x;
                                                int64_t ty3 = p1y;
                                                p1x = p2x;
                                                p1y = p2y;
                                                p2x = tx3;
                                                p2y = ty3;
                                            }
                                            if (tri_seen_ptr_i64_ptr_i64_i64_i64_i64_i64_i64_i64_i64(sx, sy, nseen, p1x, p1y, p2x, p2y, p3x, p3y) == 0) {
                                                int64_t bidx = (nseen * 3);
                                                sx[bidx] = p1x;
                                                sy[bidx] = p1y;
                                                sx[(bidx + 1)] = p2x;
                                                sy[(bidx + 1)] = p2y;
                                                sx[(bidx + 2)] = p3x;
                                                sy[(bidx + 2)] = p3y;
                                                nseen = (nseen + 1);
                                                __int128 prod = ((((__int128)(D)) * ((__int128)(iabs_i64(s)))) * ((__int128)(iabs_i64(t))));
                                                total = (total + prod);
                                            }
                                        }
                                    }
                                }
                                tsign = (tsign + 1);
                            }
                            ssign = (ssign + 1);
                        }
                    }
                    int64_t ns = ((2 * s) + (3 * t));
                    int64_t nt = (s + (2 * t));
                    s = ns;
                    t = nt;
                }
                si = (si + 1);
            }
            n = (n + 1);
        }
        m = (m + 1);
    }
    int64_t ans = ((int64_t)(FLOW_CHECKED_DIV((total), (((__int128)(4))))));
    printf("%lld\n", ans);
    free(sy);
    free(sx);
    return 0;
}

Generated MLIR

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