Problem 987

Count disjoint straights from one deck, excluding straight flushes. Answer for target=8 exceeds LLONG_MAX, so use i128 and print as u64. Port of the C reference solver to pure Flow.

Answer11044580082199135512
Output11044580082199135512
StatusPASS
Native helperno
Runtime40 ms
Peak memory1120 KB
Time complexityO(n^4) (estimated)
Space complexityO(1) (estimated)

Performance comparison

MetricOur solutionBest known
Time complexityO(n^4)?
Space complexityO(1)?
ApproachFlow solutionNot curated
VerdictUnknown

Flow source

# Project Euler 987
# Count disjoint straights from one deck, excluding straight flushes.
# Answer for target=8 exceeds LLONG_MAX, so use i128 and print as u64.
# Port of the C reference solver to pure Flow.

extern {
    function calloc(n: i64, size: i64) -> ptr<void>
    function free(p: ptr<void>) -> void
    function malloc(n: i64) -> ptr<void>
    function memset(p: ptr<void>, c: i64, n: i64) -> ptr<void>
    function memcpy(dst: ptr<void>, src: ptr<void>, n: i64) -> ptr<void>
    function printf(fmt: ptr<i8>) -> i32
}

# 10 rank windows for straights. Ranks: 0=A,1=2,...,8=9,9=10,10=J,11=Q,12=K
# Stored flat: WINDOWS[10][5]
const W0: i64 = 0
const W1: i64 = 1
const W2: i64 = 2
const W3: i64 = 3
const W4: i64 = 4
const W5: i64 = 5
const W6: i64 = 6
const W7: i64 = 7
const W8: i64 = 8
const W9: i64 = 9

let mut g_windows: ptr<i64> = null
let mut g_overlap: ptr<i64> = null

function widx(i: i64, j: i64) -> i64 {
    return i * 5 + j
}

function oidx(i: i64, j: i64) -> i64 {
    return i * 10 + j
}

function build_overlap() -> void {
    let mut i: i64 = 0
    while i < 10 {
        let mut j: i64 = 0
        while j < 10 {
            let mut shared: i64 = 0
            let mut a: i64 = 0
            while a < 5 {
                if shared == 0 {
                    let mut b: i64 = 0
                    while b < 5 {
                        if g_windows[widx(i, a)] == g_windows[widx(j, b)] { shared = 1; b = 5 }
                        b = b + 1
                    }
                }
                a = a + 1
            }
            g_overlap[oidx(i, j)] = shared
            j = j + 1
        }
        i = i + 1
    }
}

# PERMS[n][k] = P(n,k) = n!/(n-k)!  stored as i128 flat 5x5
let mut g_perms: ptr<i128> = null

function pidx(n: i64, k: i64) -> i64 {
    return n * 5 + k
}

function build_perms() -> void {
    let mut n: i64 = 0
    while n < 5 {
        g_perms[pidx(n, 0)] = 1 as i128
        let mut v: i128 = 1 as i128
        let mut k: i64 = 1
        while k < 5 {
            if k <= n {
                v = v * ((n - (k - 1)) as i128)
                g_perms[pidx(n, k)] = v
            } else {
                g_perms[pidx(n, k)] = 0 as i128
            }
            k = k + 1
        }
        n = n + 1
    }
}

function factorial(n: i64) -> i128 {
    let mut r: i128 = 1 as i128
    let mut i: i64 = 2
    while i <= n {
        r = r * (i as i128)
        i = i + 1
    }
    return r
}

function popcount(x: i64) -> i64 {
    let mut c: i64 = 0
    let mut v: i64 = x
    while v != 0 {
        c = c + 1
        v = v & (v - 1)
    }
    return c
}

function ctz(x: i64) -> i64 {
    if x == 0 { return 64 }
    let mut n: i64 = 0
    let mut v: i64 = x
    while (v & 1) == 0 {
        n = n + 1
        v = v >> 1
    }
    return n
}

# coloring_dp[256] as i128
let mut g_coloring_dp: ptr<i128> = null

function colorings_of_all_subsets(starts: ptr<i64>, k: i64) -> void {
    let full: i64 = 1 << k
    let adjacency: ptr<i64> = calloc(8, 8) as ptr<i64>
    let mut i: i64 = 0
    while i < k {
        let mut j: i64 = i + 1
        while j < k {
            if g_overlap[oidx(starts[i], starts[j])] != 0 {
                adjacency[i] = adjacency[i] | (1 << j)
                adjacency[j] = adjacency[j] | (1 << i)
            }
            j = j + 1
        }
        i = i + 1
    }

    let independent: ptr<i64> = calloc(256, 8) as ptr<i64>
    independent[0] = 1
    let mut mask: i64 = 1
    while mask < full {
        let bit: i64 = mask & (-mask)
        let vertex: i64 = ctz(bit)
        let rest: i64 = mask ^ bit
        if independent[rest] != 0 && (adjacency[vertex] & rest) == 0 {
            independent[mask] = 1
        } else {
            independent[mask] = 0
        }
        mask = mask + 1
    }

    let dp: ptr<i128> = calloc(256, 16) as ptr<i128>
    let new_dp: ptr<i128> = calloc(256, 16) as ptr<i128>
    dp[0] = 1 as i128
    let mut c: i64 = 0
    while c < 4 {
        mask = 0
        while mask < full {
            let mut total: i128 = 0 as i128
            let mut sub: i64 = mask
            while 1 != 0 {
                if independent[sub] != 0 {
                    total = total + dp[mask ^ sub]
                }
                if sub == 0 { break }
                sub = (sub - 1) & mask
            }
            new_dp[mask] = total
            mask = mask + 1
        }
        let mut m2: i64 = 0
        while m2 < full {
            dp[m2] = new_dp[m2]
            m2 = m2 + 1
        }
        c = c + 1
    }
    let mut m3: i64 = 0
    while m3 < full {
        g_coloring_dp[m3] = dp[m3]
        m3 = m3 + 1
    }
    free(adjacency as ptr<void>)
    free(independent as ptr<void>)
    free(dp as ptr<void>)
    free(new_dp as ptr<void>)
}

function labeled_count(starts: ptr<i64>, k: i64) -> i128 {
    let full: i64 = 1 << k
    colorings_of_all_subsets(starts, k)

    let total_active: ptr<i64> = calloc(13, 8) as ptr<i64>
    let active_masks_by_rank: ptr<i64> = calloc(13, 8) as ptr<i64>
    let mut idx: i64 = 0
    while idx < k {
        let bit: i64 = 1 << idx
        let mut r: i64 = 0
        while r < 5 {
            let rank: i64 = g_windows[widx(starts[idx], r)]
            total_active[rank] = total_active[rank] + 1
            active_masks_by_rank[rank] = active_masks_by_rank[rank] | bit
            r = r + 1
        }
        idx = idx + 1
    }

    let mut total: i128 = 0 as i128
    let mut mask: i64 = 0
    while mask < full {
        let mut ways: i128 = 1 as i128
        let mut ok: i64 = 1
        let mut rank: i64 = 0
        while rank < 13 {
            if ok != 0 {
                let mono: i64 = popcount(active_masks_by_rank[rank] & mask)
                let flex: i64 = total_active[rank] - mono
                let wr: i128 = g_perms[pidx(4 - mono, flex)]
                if wr == 0 as i128 { ok = 0 }
                else { ways = ways * wr }
            }
            rank = rank + 1
        }
        if ok != 0 {
            let term: i128 = g_coloring_dp[mask] * ways
            if (popcount(mask) & 1) != 0 {
                total = total - term
            } else {
                total = total + term
            }
        }
        mask = mask + 1
    }
    free(total_active as ptr<void>)
    free(active_masks_by_rank as ptr<void>)
    return total
}

# Backtracking state
let mut bt_counts: ptr<i64> = null
let mut bt_coverage: ptr<i64> = null
let mut bt_result: i128 = 0 as i128

function process_type_count() -> i128 {
    let starts: ptr<i64> = calloc(8, 8) as ptr<i64>
    let mut k: i64 = 0
    let mut divisor: i128 = 1 as i128
    let mut s: i64 = 0
    while s < 10 {
        let mut a: i64 = 0
        while a < bt_counts[s] {
            starts[k] = s
            k = k + 1
            a = a + 1
        }
        divisor = divisor * factorial(bt_counts[s])
        s = s + 1
    }
    let result: i128 = labeled_count(starts, k) / divisor
    free(starts as ptr<void>)
    return result
}

function backtrack(pos: i64, remaining: i64) -> void {
    if pos == 10 {
        if remaining == 0 {
            bt_result = bt_result + process_type_count()
        }
        return
    }
    let mut amount: i64 = 0
    while amount <= remaining {
        let mut ok: i64 = 1
        let mut r: i64 = 0
        while r < 5 {
            bt_coverage[g_windows[widx(pos, r)]] = bt_coverage[g_windows[widx(pos, r)]] + amount
            if bt_coverage[g_windows[widx(pos, r)]] > 4 { ok = 0 }
            r = r + 1
        }
        bt_counts[pos] = amount
        if ok != 0 {
            backtrack(pos + 1, remaining - amount)
        }
        r = 0
        while r < 5 {
            bt_coverage[g_windows[widx(pos, r)]] = bt_coverage[g_windows[widx(pos, r)]] - amount
            r = r + 1
        }
        amount = amount + 1
    }
    bt_counts[pos] = 0
}

function count_disjoint_straights(target: i64) -> i128 {
    bt_result = 0 as i128
    memset(bt_coverage as ptr<void>, 0, 13 * 8)
    backtrack(0, target)
    return bt_result
}

function print_u128(val: i128) -> void {
    # Print as unsigned 128-bit by repeated division by 10
    if val == 0 as i128 {
        printf("0\n")
        return
    }
    let mut buf: ptr<i8> = malloc(40) as ptr<i8>
    let mut pos: i64 = 39
    buf[pos] = 0
    let mut v: i128 = val
    while v > 0 as i128 {
        pos = pos - 1
        let digit: i128 = v % 10 as i128
        buf[pos] = (digit + 48) as i8
        v = v / 10 as i128
    }
    printf("%s\n", buf + pos)
    free(buf as ptr<void>)
}

function main() -> i32 {
    g_windows = calloc(50, 8) as ptr<i64>
    # Fill WINDOWS table
    g_windows[widx(0, 0)] = 0; g_windows[widx(0, 1)] = 1; g_windows[widx(0, 2)] = 2; g_windows[widx(0, 3)] = 3; g_windows[widx(0, 4)] = 4
    g_windows[widx(1, 0)] = 1; g_windows[widx(1, 1)] = 2; g_windows[widx(1, 2)] = 3; g_windows[widx(1, 3)] = 4; g_windows[widx(1, 4)] = 5
    g_windows[widx(2, 0)] = 2; g_windows[widx(2, 1)] = 3; g_windows[widx(2, 2)] = 4; g_windows[widx(2, 3)] = 5; g_windows[widx(2, 4)] = 6
    g_windows[widx(3, 0)] = 3; g_windows[widx(3, 1)] = 4; g_windows[widx(3, 2)] = 5; g_windows[widx(3, 3)] = 6; g_windows[widx(3, 4)] = 7
    g_windows[widx(4, 0)] = 4; g_windows[widx(4, 1)] = 5; g_windows[widx(4, 2)] = 6; g_windows[widx(4, 3)] = 7; g_windows[widx(4, 4)] = 8
    g_windows[widx(5, 0)] = 5; g_windows[widx(5, 1)] = 6; g_windows[widx(5, 2)] = 7; g_windows[widx(5, 3)] = 8; g_windows[widx(5, 4)] = 9
    g_windows[widx(6, 0)] = 6; g_windows[widx(6, 1)] = 7; g_windows[widx(6, 2)] = 8; g_windows[widx(6, 3)] = 9; g_windows[widx(6, 4)] = 10
    g_windows[widx(7, 0)] = 7; g_windows[widx(7, 1)] = 8; g_windows[widx(7, 2)] = 9; g_windows[widx(7, 3)] = 10; g_windows[widx(7, 4)] = 11
    g_windows[widx(8, 0)] = 8; g_windows[widx(8, 1)] = 9; g_windows[widx(8, 2)] = 10; g_windows[widx(8, 3)] = 11; g_windows[widx(8, 4)] = 12
    g_windows[widx(9, 0)] = 9; g_windows[widx(9, 1)] = 10; g_windows[widx(9, 2)] = 11; g_windows[widx(9, 3)] = 12; g_windows[widx(9, 4)] = 0

    g_overlap = calloc(100, 8) as ptr<i64>
    g_perms = calloc(25, 16) as ptr<i128>
    g_coloring_dp = calloc(256, 16) as ptr<i128>
    bt_counts = calloc(10, 8) as ptr<i64>
    bt_coverage = calloc(13, 8) as ptr<i64>

    build_overlap()
    build_perms()
    let result: i128 = count_disjoint_straights(8)
    print_u128(result)
    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 widx_i64_i64(int64_t i, int64_t j);
int64_t oidx_i64_i64(int64_t i, int64_t j);
void build_overlap(void);
int64_t pidx_i64_i64(int64_t n, int64_t k);
void build_perms(void);
__int128 factorial_i64(int64_t n);
int64_t popcount_i64(int64_t x);
int64_t ctz_i64(int64_t x);
void colorings_of_all_subsets_ptr_i64_i64(int64_t* starts, int64_t k);
__int128 labeled_count_ptr_i64_i64(int64_t* starts, int64_t k);
__int128 process_type_count(void);
void backtrack_i64_i64(int64_t pos, int64_t remaining);
__int128 count_disjoint_straights_i64(int64_t target);
void print_u128_i128(__int128 val);
int32_t main(void);

static const int64_t W0 = 0;
static const int64_t W1 = 1;
static const int64_t W2 = 2;
static const int64_t W3 = 3;
static const int64_t W4 = 4;
static const int64_t W5 = 5;
static const int64_t W6 = 6;
static const int64_t W7 = 7;
static const int64_t W8 = 8;
static const int64_t W9 = 9;

/* Module statics */
static int64_t* g_windows = NULL;
static int64_t* g_overlap = NULL;
static __int128* g_perms = NULL;
static __int128* g_coloring_dp = NULL;
static int64_t* bt_counts = NULL;
static int64_t* bt_coverage = NULL;
static __int128 bt_result = ((__int128)(0));







int64_t widx_i64_i64(int64_t i, int64_t j) {
    return ((i * 5) + j);
}

int64_t oidx_i64_i64(int64_t i, int64_t j) {
    return ((i * 10) + j);
}

void build_overlap(void) {
    int64_t i = 0;
    while (i < 10) {
        int64_t j = 0;
        while (j < 10) {
            int64_t shared = 0;
            int64_t a = 0;
            while (a < 5) {
                if (shared == 0) {
                    int64_t b = 0;
                    while (b < 5) {
                        if (g_windows[widx_i64_i64(i, a)] == g_windows[widx_i64_i64(j, b)]) {
                            shared = 1;
                            b = 5;
                        }
                        b = (b + 1);
                    }
                }
                a = (a + 1);
            }
            g_overlap[oidx_i64_i64(i, j)] = shared;
            j = (j + 1);
        }
        i = (i + 1);
    }
}

int64_t pidx_i64_i64(int64_t n, int64_t k) {
    return ((n * 5) + k);
}

void build_perms(void) {
    int64_t n = 0;
    while (n < 5) {
        g_perms[pidx_i64_i64(n, 0)] = ((__int128)(1));
        __int128 v = ((__int128)(1));
        int64_t k = 1;
        while (k < 5) {
            if (k <= n) {
                v = (v * ((__int128)((n - (k - 1)))));
                g_perms[pidx_i64_i64(n, k)] = v;
            } else {
                g_perms[pidx_i64_i64(n, k)] = ((__int128)(0));
            }
            k = (k + 1);
        }
        n = (n + 1);
    }
}

__int128 factorial_i64(int64_t n) {
    __int128 r = ((__int128)(1));
    int64_t i = 2;
    while (i <= n) {
        r = (r * ((__int128)(i)));
        i = (i + 1);
    }
    return r;
}

int64_t popcount_i64(int64_t x) {
    int64_t c = 0;
    int64_t v = x;
    while (v != 0) {
        c = (c + 1);
        v = (v & (v - 1));
    }
    return c;
}

int64_t ctz_i64(int64_t x) {
    if (x == 0) {
        return 64;
    }
    int64_t n = 0;
    int64_t v = x;
    while ((v & 1) == 0) {
        n = (n + 1);
        v = FLOW_CHECKED_SHR((v), (1));
    }
    return n;
}

void colorings_of_all_subsets_ptr_i64_i64(int64_t* starts, int64_t k) {
    int64_t full = FLOW_CHECKED_SHL((1), (k));
    int64_t* adjacency = (int64_t*)(((int64_t*)(calloc(8, 8))));
    int64_t i = 0;
    while (i < k) {
        int64_t j = (i + 1);
        while (j < k) {
            if (g_overlap[oidx_i64_i64(starts[i], starts[j])] != 0) {
                adjacency[i] = (adjacency[i] | FLOW_CHECKED_SHL((1), (j)));
                adjacency[j] = (adjacency[j] | FLOW_CHECKED_SHL((1), (i)));
            }
            j = (j + 1);
        }
        i = (i + 1);
    }
    int64_t* independent = (int64_t*)(((int64_t*)(calloc(256, 8))));
    independent[0] = 1;
    int64_t mask = 1;
    while (mask < full) {
        int64_t bit = (mask & (-mask));
        int64_t vertex = ctz_i64(bit);
        int64_t rest = (mask ^ bit);
        if ((independent[rest] != 0 && (adjacency[vertex] & rest) == 0)) {
            independent[mask] = 1;
        } else {
            independent[mask] = 0;
        }
        mask = (mask + 1);
    }
    __int128* dp = (__int128*)(((__int128*)(calloc(256, 16))));
    __int128* new_dp = (__int128*)(((__int128*)(calloc(256, 16))));
    dp[0] = ((__int128)(1));
    int64_t c = 0;
    while (c < 4) {
        mask = 0;
        while (mask < full) {
            __int128 total = ((__int128)(0));
            int64_t sub = mask;
            while (1 != 0) {
                if (independent[sub] != 0) {
                    total = (total + dp[(mask ^ sub)]);
                }
                if (sub == 0) {
                    break;
                }
                sub = ((sub - 1) & mask);
            }
            new_dp[mask] = total;
            mask = (mask + 1);
        }
        int64_t m2 = 0;
        while (m2 < full) {
            dp[m2] = new_dp[m2];
            m2 = (m2 + 1);
        }
        c = (c + 1);
    }
    int64_t m3 = 0;
    while (m3 < full) {
        g_coloring_dp[m3] = dp[m3];
        m3 = (m3 + 1);
    }
    free(((void*)(adjacency)));
    free(((void*)(independent)));
    free(((void*)(dp)));
    free(((void*)(new_dp)));
}

__int128 labeled_count_ptr_i64_i64(int64_t* starts, int64_t k) {
    int64_t full = FLOW_CHECKED_SHL((1), (k));
    colorings_of_all_subsets_ptr_i64_i64(starts, k);
    int64_t* total_active = (int64_t*)(((int64_t*)(calloc(13, 8))));
    int64_t* active_masks_by_rank = (int64_t*)(((int64_t*)(calloc(13, 8))));
    int64_t idx = 0;
    while (idx < k) {
        int64_t bit = FLOW_CHECKED_SHL((1), (idx));
        int64_t r = 0;
        while (r < 5) {
            int64_t rank = g_windows[widx_i64_i64(starts[idx], r)];
            total_active[rank] = (total_active[rank] + 1);
            active_masks_by_rank[rank] = (active_masks_by_rank[rank] | bit);
            r = (r + 1);
        }
        idx = (idx + 1);
    }
    __int128 total = ((__int128)(0));
    int64_t mask = 0;
    while (mask < full) {
        __int128 ways = ((__int128)(1));
        int64_t ok = 1;
        int64_t rank = 0;
        while (rank < 13) {
            if (ok != 0) {
                int64_t mono = popcount_i64((active_masks_by_rank[rank] & mask));
                int64_t flex = (total_active[rank] - mono);
                __int128 wr = g_perms[pidx_i64_i64((4 - mono), flex)];
                if (wr == ((__int128)(0))) {
                    ok = 0;
                } else {
                    ways = (ways * wr);
                }
            }
            rank = (rank + 1);
        }
        if (ok != 0) {
            __int128 term = (g_coloring_dp[mask] * ways);
            if ((popcount_i64(mask) & 1) != 0) {
                total = (total - term);
            } else {
                total = (total + term);
            }
        }
        mask = (mask + 1);
    }
    free(((void*)(total_active)));
    free(((void*)(active_masks_by_rank)));
    return total;
}

__int128 process_type_count(void) {
    int64_t* starts = (int64_t*)(((int64_t*)(calloc(8, 8))));
    int64_t k = 0;
    __int128 divisor = ((__int128)(1));
    int64_t s = 0;
    while (s < 10) {
        int64_t a = 0;
        while (a < bt_counts[s]) {
            starts[k] = s;
            k = (k + 1);
            a = (a + 1);
        }
        divisor = (divisor * factorial_i64(bt_counts[s]));
        s = (s + 1);
    }
    __int128 result = FLOW_CHECKED_DIV((labeled_count_ptr_i64_i64(starts, k)), (divisor));
    free(((void*)(starts)));
    return result;
}

void backtrack_i64_i64(int64_t pos, int64_t remaining) {
    if (pos == 10) {
        if (remaining == 0) {
            bt_result = (bt_result + process_type_count());
        }
        return;
    }
    int64_t amount = 0;
    while (amount <= remaining) {
        int64_t ok = 1;
        int64_t r = 0;
        while (r < 5) {
            bt_coverage[g_windows[widx_i64_i64(pos, r)]] = (bt_coverage[g_windows[widx_i64_i64(pos, r)]] + amount);
            if (bt_coverage[g_windows[widx_i64_i64(pos, r)]] > 4) {
                ok = 0;
            }
            r = (r + 1);
        }
        bt_counts[pos] = amount;
        if (ok != 0) {
            backtrack_i64_i64((pos + 1), (remaining - amount));
        }
        r = 0;
        while (r < 5) {
            bt_coverage[g_windows[widx_i64_i64(pos, r)]] = (bt_coverage[g_windows[widx_i64_i64(pos, r)]] - amount);
            r = (r + 1);
        }
        amount = (amount + 1);
    }
    bt_counts[pos] = 0;
}

__int128 count_disjoint_straights_i64(int64_t target) {
    bt_result = ((__int128)(0));
    memset(((void*)(bt_coverage)), 0, (13 * 8));
    backtrack_i64_i64(0, target);
    return bt_result;
}

void print_u128_i128(__int128 val) {
    if (val == ((__int128)(0))) {
        printf("0\n");
        return;
    }
    int8_t* buf = (int8_t*)(((int8_t*)(malloc(40))));
    int64_t pos = 39;
    buf[pos] = 0;
    __int128 v = val;
    while (v > ((__int128)(0))) {
        pos = (pos - 1);
        __int128 digit = FLOW_CHECKED_MOD((v), (((__int128)(10))));
        buf[pos] = ((int8_t)((digit + 48)));
        v = FLOW_CHECKED_DIV((v), (((__int128)(10))));
    }
    printf("%s\n", (buf + pos));
    free(((void*)(buf)));
}

int32_t main(void) {
    g_windows = ((int64_t*)(calloc(50, 8)));
    g_windows[widx_i64_i64(0, 0)] = 0;
    g_windows[widx_i64_i64(0, 1)] = 1;
    g_windows[widx_i64_i64(0, 2)] = 2;
    g_windows[widx_i64_i64(0, 3)] = 3;
    g_windows[widx_i64_i64(0, 4)] = 4;
    g_windows[widx_i64_i64(1, 0)] = 1;
    g_windows[widx_i64_i64(1, 1)] = 2;
    g_windows[widx_i64_i64(1, 2)] = 3;
    g_windows[widx_i64_i64(1, 3)] = 4;
    g_windows[widx_i64_i64(1, 4)] = 5;
    g_windows[widx_i64_i64(2, 0)] = 2;
    g_windows[widx_i64_i64(2, 1)] = 3;
    g_windows[widx_i64_i64(2, 2)] = 4;
    g_windows[widx_i64_i64(2, 3)] = 5;
    g_windows[widx_i64_i64(2, 4)] = 6;
    g_windows[widx_i64_i64(3, 0)] = 3;
    g_windows[widx_i64_i64(3, 1)] = 4;
    g_windows[widx_i64_i64(3, 2)] = 5;
    g_windows[widx_i64_i64(3, 3)] = 6;
    g_windows[widx_i64_i64(3, 4)] = 7;
    g_windows[widx_i64_i64(4, 0)] = 4;
    g_windows[widx_i64_i64(4, 1)] = 5;
    g_windows[widx_i64_i64(4, 2)] = 6;
    g_windows[widx_i64_i64(4, 3)] = 7;
    g_windows[widx_i64_i64(4, 4)] = 8;
    g_windows[widx_i64_i64(5, 0)] = 5;
    g_windows[widx_i64_i64(5, 1)] = 6;
    g_windows[widx_i64_i64(5, 2)] = 7;
    g_windows[widx_i64_i64(5, 3)] = 8;
    g_windows[widx_i64_i64(5, 4)] = 9;
    g_windows[widx_i64_i64(6, 0)] = 6;
    g_windows[widx_i64_i64(6, 1)] = 7;
    g_windows[widx_i64_i64(6, 2)] = 8;
    g_windows[widx_i64_i64(6, 3)] = 9;
    g_windows[widx_i64_i64(6, 4)] = 10;
    g_windows[widx_i64_i64(7, 0)] = 7;
    g_windows[widx_i64_i64(7, 1)] = 8;
    g_windows[widx_i64_i64(7, 2)] = 9;
    g_windows[widx_i64_i64(7, 3)] = 10;
    g_windows[widx_i64_i64(7, 4)] = 11;
    g_windows[widx_i64_i64(8, 0)] = 8;
    g_windows[widx_i64_i64(8, 1)] = 9;
    g_windows[widx_i64_i64(8, 2)] = 10;
    g_windows[widx_i64_i64(8, 3)] = 11;
    g_windows[widx_i64_i64(8, 4)] = 12;
    g_windows[widx_i64_i64(9, 0)] = 9;
    g_windows[widx_i64_i64(9, 1)] = 10;
    g_windows[widx_i64_i64(9, 2)] = 11;
    g_windows[widx_i64_i64(9, 3)] = 12;
    g_windows[widx_i64_i64(9, 4)] = 0;
    g_overlap = ((int64_t*)(calloc(100, 8)));
    g_perms = ((__int128*)(calloc(25, 16)));
    g_coloring_dp = ((__int128*)(calloc(256, 16)));
    bt_counts = ((int64_t*)(calloc(10, 8)));
    bt_coverage = ((int64_t*)(calloc(13, 8)));
    build_overlap();
    build_perms();
    __int128 result = count_disjoint_straights_i64(8);
    print_u128_i128(result);
    return 0;
}

Generated MLIR

module {
  llvm.func @printf(!llvm.ptr, ...) -> i32
  llvm.mlir.global internal constant @str_0("0\n\00") {addr_space = 0 : i32} : !llvm.array<3 x i8>
  llvm.mlir.global internal constant @str_1("%s\n\00") {addr_space = 0 : i32} : !llvm.array<4 x i8>
  func.func private @calloc(i64, i64) -> !llvm.ptr
  func.func private @free(!llvm.ptr) -> ()
  func.func private @malloc(i64) -> !llvm.ptr
  func.func private @memset(!llvm.ptr, i64, i64) -> !llvm.ptr
  func.func private @memcpy(!llvm.ptr, !llvm.ptr, i64) -> !llvm.ptr

  // Constant: W0
  llvm.mlir.global internal constant @W0(0 : i64) : i64
  // Constant: W1
  llvm.mlir.global internal constant @W1(1 : i64) : i64
  // Constant: W2
  llvm.mlir.global internal constant @W2(2 : i64) : i64
  // Constant: W3
  llvm.mlir.global internal constant @W3(3 : i64) : i64
  // Constant: W4
  llvm.mlir.global internal constant @W4(4 : i64) : i64
  // Constant: W5
  llvm.mlir.global internal constant @W5(5 : i64) : i64
  // Constant: W6
  llvm.mlir.global internal constant @W6(6 : i64) : i64
  // Constant: W7
  llvm.mlir.global internal constant @W7(7 : i64) : i64
  // Constant: W8
  llvm.mlir.global internal constant @W8(8 : i64) : i64
  // Constant: W9
  llvm.mlir.global internal constant @W9(9 : i64) : i64
  // Module static: g_windows
  llvm.mlir.global internal @g_windows() {addr_space = 0 : i32} : !llvm.ptr {
    %0 = llvm.mlir.zero : !llvm.ptr
    llvm.return %0 : !llvm.ptr
  }
  // Module static: g_overlap
  llvm.mlir.global internal @g_overlap() {addr_space = 0 : i32} : !llvm.ptr {
    %1 = llvm.mlir.zero : !llvm.ptr
    llvm.return %1 : !llvm.ptr
  }
  func.func @widx(%arg0: i64, %arg1: i64) -> i64 {
    %2 = arith.constant 5 : i32
    %4 = arith.extsi %2 : i32 to i64
    %3 = arith.muli %arg0, %4 : i64
    %5 = arith.addi %3, %arg1 : i64
    func.return %5 : i64
  }
  func.func @oidx(%arg0: i64, %arg1: i64) -> i64 {
    %6 = arith.constant 10 : i32
    %8 = arith.extsi %6 : i32 to i64
    %7 = arith.muli %arg0, %8 : i64
    %9 = arith.addi %7, %arg1 : i64
    func.return %9 : i64
  }
  func.func @build_overlap() -> () {
    %10 = arith.constant 0 : i32
    %11 = arith.extsi %10 : i32 to i64
    %12 = llvm.mlir.constant(1 : i64) : i64
    %13 = llvm.alloca %12 x i64 : (i64) -> !llvm.ptr
    llvm.store %11, %13 : i64, !llvm.ptr
    cf.br ^bb0
    ^bb0:
    %14 = llvm.load %13 : !llvm.ptr -> i64
    %15 = arith.constant 10 : i32
    %17 = arith.extsi %15 : i32 to i64
    %16 = arith.cmpi slt, %14, %17 : i64
    cf.cond_br %16, ^bb1, ^bb2
    ^bb1:
      %18 = arith.constant 0 : i32
      %19 = arith.extsi %18 : i32 to i64
      %20 = llvm.mlir.constant(1 : i64) : i64
      %21 = llvm.alloca %20 x i64 : (i64) -> !llvm.ptr
      llvm.store %19, %21 : i64, !llvm.ptr
      cf.br ^bb3
      ^bb3:
      %22 = llvm.load %21 : !llvm.ptr -> i64
      %23 = arith.constant 10 : i32
      %25 = arith.extsi %23 : i32 to i64
      %24 = arith.cmpi slt, %22, %25 : i64
      cf.cond_br %24, ^bb4, ^bb5
      ^bb4:
        %26 = arith.constant 0 : i32
        %27 = arith.extsi %26 : i32 to i64
        %28 = llvm.mlir.constant(1 : i64) : i64
        %29 = llvm.alloca %28 x i64 : (i64) -> !llvm.ptr
        llvm.store %27, %29 : i64, !llvm.ptr
        %30 = arith.constant 0 : i32
        %31 = arith.extsi %30 : i32 to i64
        %32 = llvm.mlir.constant(1 : i64) : i64
        %33 = llvm.alloca %32 x i64 : (i64) -> !llvm.ptr
        llvm.store %31, %33 : i64, !llvm.ptr
        cf.br ^bb6
        ^bb6:
        %34 = llvm.load %33 : !llvm.ptr -> i64
        %35 = arith.constant 5 : i32
        %37 = arith.extsi %35 : i32 to i64
        %36 = arith.cmpi slt, %34, %37 : i64
        cf.cond_br %36, ^bb7, ^bb8
        ^bb7:
          %38 = llvm.load %29 : !llvm.ptr -> i64
          %39 = arith.constant 0 : i32
          %41 = arith.extsi %39 : i32 to i64
          %40 = arith.cmpi eq, %38, %41 : i64
          cf.cond_br %40, ^bb9, ^bb10
          ^bb9:
            %42 = arith.constant 0 : i32
            %43 = arith.extsi %42 : i32 to i64
            %44 = llvm.mlir.constant(1 : i64) : i64
            %45 = llvm.alloca %44 x i64 : (i64) -> !llvm.ptr
            llvm.store %43, %45 : i64, !llvm.ptr
            cf.br ^bb12
            ^bb12:
            %46 = llvm.load %45 : !llvm.ptr -> i64
            %47 = arith.constant 5 : i32
            %49 = arith.extsi %47 : i32 to i64
            %48 = arith.cmpi slt, %46, %49 : i64
            cf.cond_br %48, ^bb13, ^bb14
            ^bb13:
              %51 = llvm.mlir.addressof @g_windows : !llvm.ptr
              %52 = llvm.load %51 : !llvm.ptr -> !llvm.ptr
              %54 = llvm.load %13 : !llvm.ptr -> i64
              %55 = llvm.load %33 : !llvm.ptr -> i64
              %53 = func.call @widx(%54, %55) : (i64, i64) -> i64
              %56 = llvm.getelementptr %52[%53] : (!llvm.ptr, i64) -> !llvm.ptr, i64
              %50 = llvm.load %56 : !llvm.ptr -> i64
              %58 = llvm.mlir.addressof @g_windows : !llvm.ptr
              %59 = llvm.load %58 : !llvm.ptr -> !llvm.ptr
              %61 = llvm.load %21 : !llvm.ptr -> i64
              %62 = llvm.load %45 : !llvm.ptr -> i64
              %60 = func.call @widx(%61, %62) : (i64, i64) -> i64
              %63 = llvm.getelementptr %59[%60] : (!llvm.ptr, i64) -> !llvm.ptr, i64
              %57 = llvm.load %63 : !llvm.ptr -> i64
              %64 = arith.cmpi eq, %50, %57 : i64
              cf.cond_br %64, ^bb15, ^bb16
              ^bb15:
                %65 = arith.constant 1 : i32
                %66 = arith.extsi %65 : i32 to i64
                llvm.store %66, %29 : i64, !llvm.ptr
                %67 = arith.constant 5 : i32
                %68 = arith.extsi %67 : i32 to i64
                llvm.store %68, %45 : i64, !llvm.ptr
                cf.br ^bb17
              ^bb16:
                cf.br ^bb17
              ^bb17:
              %69 = llvm.load %45 : !llvm.ptr -> i64
              %70 = arith.constant 1 : i32
              %72 = arith.extsi %70 : i32 to i64
              %71 = arith.addi %69, %72 : i64
              llvm.store %71, %45 : i64, !llvm.ptr
              cf.br ^bb12
            ^bb14:
            cf.br ^bb11
          ^bb10:
            cf.br ^bb11
          ^bb11:
          %73 = llvm.load %33 : !llvm.ptr -> i64
          %74 = arith.constant 1 : i32
          %76 = arith.extsi %74 : i32 to i64
          %75 = arith.addi %73, %76 : i64
          llvm.store %75, %33 : i64, !llvm.ptr
          cf.br ^bb6
        ^bb8:
        %77 = llvm.load %29 : !llvm.ptr -> i64
        %78 = llvm.mlir.addressof @g_overlap : !llvm.ptr
        %79 = llvm.load %78 : !llvm.ptr -> !llvm.ptr
        %81 = llvm.load %13 : !llvm.ptr -> i64
        %82 = llvm.load %21 : !llvm.ptr -> i64
        %80 = func.call @oidx(%81, %82) : (i64, i64) -> i64
        %83 = llvm.getelementptr %79[%80] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %77, %83 : i64, !llvm.ptr
        %84 = llvm.load %21 : !llvm.ptr -> i64
        %85 = arith.constant 1 : i32
        %87 = arith.extsi %85 : i32 to i64
        %86 = arith.addi %84, %87 : i64
        llvm.store %86, %21 : i64, !llvm.ptr
        cf.br ^bb3
      ^bb5:
      %88 = llvm.load %13 : !llvm.ptr -> i64
      %89 = arith.constant 1 : i32
      %91 = arith.extsi %89 : i32 to i64
      %90 = arith.addi %88, %91 : i64
      llvm.store %90, %13 : i64, !llvm.ptr
      cf.br ^bb0
    ^bb2:
    func.return
  }
  // Module static: g_perms
  llvm.mlir.global internal @g_perms() {addr_space = 0 : i32} : !llvm.ptr {
    %92 = llvm.mlir.zero : !llvm.ptr
    llvm.return %92 : !llvm.ptr
  }
  func.func @pidx(%arg0: i64, %arg1: i64) -> i64 {
    %93 = arith.constant 5 : i32
    %95 = arith.extsi %93 : i32 to i64
    %94 = arith.muli %arg0, %95 : i64
    %96 = arith.addi %94, %arg1 : i64
    func.return %96 : i64
  }
  func.func @build_perms() -> () {
    %97 = arith.constant 0 : i32
    %98 = arith.extsi %97 : i32 to i64
    %99 = llvm.mlir.constant(1 : i64) : i64
    %100 = llvm.alloca %99 x i64 : (i64) -> !llvm.ptr
    llvm.store %98, %100 : i64, !llvm.ptr
    cf.br ^bb18
    ^bb18:
    %101 = llvm.load %100 : !llvm.ptr -> i64
    %102 = arith.constant 5 : i32
    %104 = arith.extsi %102 : i32 to i64
    %103 = arith.cmpi slt, %101, %104 : i64
    cf.cond_br %103, ^bb19, ^bb20
    ^bb19:
      %105 = arith.constant 1 : i32
      %106 = arith.extsi %105 : i32 to i128
      %107 = llvm.mlir.addressof @g_perms : !llvm.ptr
      %108 = llvm.load %107 : !llvm.ptr -> !llvm.ptr
      %110 = llvm.load %100 : !llvm.ptr -> i64
      %111 = arith.constant 0 : i32
      %112 = arith.extsi %111 : i32 to i64
      %109 = func.call @pidx(%110, %112) : (i64, i64) -> i64
      %113 = llvm.getelementptr %108[%109] : (!llvm.ptr, i64) -> !llvm.ptr, i128
      llvm.store %106, %113 : i128, !llvm.ptr
      %114 = arith.constant 1 : i32
      %115 = arith.extsi %114 : i32 to i128
      %116 = llvm.mlir.constant(1 : i64) : i64
      %117 = llvm.alloca %116 x i128 : (i64) -> !llvm.ptr
      llvm.store %115, %117 : i128, !llvm.ptr
      %118 = arith.constant 1 : i32
      %119 = arith.extsi %118 : i32 to i64
      %120 = llvm.mlir.constant(1 : i64) : i64
      %121 = llvm.alloca %120 x i64 : (i64) -> !llvm.ptr
      llvm.store %119, %121 : i64, !llvm.ptr
      cf.br ^bb21
      ^bb21:
      %122 = llvm.load %121 : !llvm.ptr -> i64
      %123 = arith.constant 5 : i32
      %125 = arith.extsi %123 : i32 to i64
      %124 = arith.cmpi slt, %122, %125 : i64
      cf.cond_br %124, ^bb22, ^bb23
      ^bb22:
        %126 = llvm.load %121 : !llvm.ptr -> i64
        %127 = llvm.load %100 : !llvm.ptr -> i64
        %128 = arith.cmpi sle, %126, %127 : i64
        cf.cond_br %128, ^bb24, ^bb25
        ^bb24:
          %129 = llvm.load %117 : !llvm.ptr -> i128
          %130 = llvm.load %100 : !llvm.ptr -> i64
          %131 = llvm.load %121 : !llvm.ptr -> i64
          %132 = arith.constant 1 : i32
          %134 = arith.extsi %132 : i32 to i64
          %133 = arith.subi %131, %134 : i64
          %135 = arith.subi %130, %133 : i64
          %136 = arith.extsi %135 : i64 to i128
          %138 = arith.trunci %129 : i128 to i64
          %139 = arith.trunci %136 : i128 to i64
          %137 = arith.muli %138, %139 : i64
          %140 = arith.extsi %137 : i64 to i128
          llvm.store %140, %117 : i128, !llvm.ptr
          %141 = llvm.load %117 : !llvm.ptr -> i128
          %142 = llvm.mlir.addressof @g_perms : !llvm.ptr
          %143 = llvm.load %142 : !llvm.ptr -> !llvm.ptr
          %145 = llvm.load %100 : !llvm.ptr -> i64
          %146 = llvm.load %121 : !llvm.ptr -> i64
          %144 = func.call @pidx(%145, %146) : (i64, i64) -> i64
          %147 = llvm.getelementptr %143[%144] : (!llvm.ptr, i64) -> !llvm.ptr, i128
          llvm.store %141, %147 : i128, !llvm.ptr
          cf.br ^bb26
        ^bb25:
          %148 = arith.constant 0 : i32
          %149 = arith.extsi %148 : i32 to i128
          %150 = llvm.mlir.addressof @g_perms : !llvm.ptr
          %151 = llvm.load %150 : !llvm.ptr -> !llvm.ptr
          %153 = llvm.load %100 : !llvm.ptr -> i64
          %154 = llvm.load %121 : !llvm.ptr -> i64
          %152 = func.call @pidx(%153, %154) : (i64, i64) -> i64
          %155 = llvm.getelementptr %151[%152] : (!llvm.ptr, i64) -> !llvm.ptr, i128
          llvm.store %149, %155 : i128, !llvm.ptr
          cf.br ^bb26
        ^bb26:
        %156 = llvm.load %121 : !llvm.ptr -> i64
        %157 = arith.constant 1 : i32
        %159 = arith.extsi %157 : i32 to i64
        %158 = arith.addi %156, %159 : i64
        llvm.store %158, %121 : i64, !llvm.ptr
        cf.br ^bb21
      ^bb23:
      %160 = llvm.load %100 : !llvm.ptr -> i64
      %161 = arith.constant 1 : i32
      %163 = arith.extsi %161 : i32 to i64
      %162 = arith.addi %160, %163 : i64
      llvm.store %162, %100 : i64, !llvm.ptr
      cf.br ^bb18
    ^bb20:
    func.return
  }
  func.func @factorial(%arg0: i64) -> i128 {
    %164 = arith.constant 1 : i32
    %165 = arith.extsi %164 : i32 to i128
    %166 = llvm.mlir.constant(1 : i64) : i64
    %167 = llvm.alloca %166 x i128 : (i64) -> !llvm.ptr
    llvm.store %165, %167 : i128, !llvm.ptr
    %168 = arith.constant 2 : i32
    %169 = arith.extsi %168 : i32 to i64
    %170 = llvm.mlir.constant(1 : i64) : i64
    %171 = llvm.alloca %170 x i64 : (i64) -> !llvm.ptr
    llvm.store %169, %171 : i64, !llvm.ptr
    cf.br ^bb27
    ^bb27:
    %172 = llvm.load %171 : !llvm.ptr -> i64
    %173 = arith.cmpi sle, %172, %arg0 : i64
    cf.cond_br %173, ^bb28, ^bb29
    ^bb28:
      %174 = llvm.load %167 : !llvm.ptr -> i128
      %175 = llvm.load %171 : !llvm.ptr -> i64
      %176 = arith.extsi %175 : i64 to i128
      %178 = arith.trunci %174 : i128 to i64
      %179 = arith.trunci %176 : i128 to i64
      %177 = arith.muli %178, %179 : i64
      %180 = arith.extsi %177 : i64 to i128
      llvm.store %180, %167 : i128, !llvm.ptr
      %181 = llvm.load %171 : !llvm.ptr -> i64
      %182 = arith.constant 1 : i32
      %184 = arith.extsi %182 : i32 to i64
      %183 = arith.addi %181, %184 : i64
      llvm.store %183, %171 : i64, !llvm.ptr
      cf.br ^bb27
    ^bb29:
    %185 = llvm.load %167 : !llvm.ptr -> i128
    func.return %185 : i128
  }
  func.func @popcount(%arg0: i64) -> i64 {
    %186 = arith.constant 0 : i32
    %187 = arith.extsi %186 : i32 to i64
    %188 = llvm.mlir.constant(1 : i64) : i64
    %189 = llvm.alloca %188 x i64 : (i64) -> !llvm.ptr
    llvm.store %187, %189 : i64, !llvm.ptr
    %190 = llvm.mlir.constant(1 : i64) : i64
    %191 = llvm.alloca %190 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %191 : i64, !llvm.ptr
    cf.br ^bb30
    ^bb30:
    %192 = llvm.load %191 : !llvm.ptr -> i64
    %193 = arith.constant 0 : i32
    %195 = arith.extsi %193 : i32 to i64
    %194 = arith.cmpi ne, %192, %195 : i64
    cf.cond_br %194, ^bb31, ^bb32
    ^bb31:
      %196 = llvm.load %189 : !llvm.ptr -> i64
      %197 = arith.constant 1 : i32
      %199 = arith.extsi %197 : i32 to i64
      %198 = arith.addi %196, %199 : i64
      llvm.store %198, %189 : i64, !llvm.ptr
      %200 = llvm.load %191 : !llvm.ptr -> i64
      %201 = llvm.load %191 : !llvm.ptr -> i64
      %202 = arith.constant 1 : i32
      %204 = arith.extsi %202 : i32 to i64
      %203 = arith.subi %201, %204 : i64
      %205 = arith.andi %200, %203 : i64
      llvm.store %205, %191 : i64, !llvm.ptr
      cf.br ^bb30
    ^bb32:
    %206 = llvm.load %189 : !llvm.ptr -> i64
    func.return %206 : i64
  }
  func.func @ctz(%arg0: i64) -> i64 {
    %207 = arith.constant 0 : i32
    %209 = arith.extsi %207 : i32 to i64
    %208 = arith.cmpi eq, %arg0, %209 : i64
    cf.cond_br %208, ^bb33, ^bb34
    ^bb33:
      %210 = arith.constant 64 : i32
      %211 = arith.extsi %210 : i32 to i64
      func.return %211 : i64
    ^bb34:
      cf.br ^bb35
    ^bb35:
    %212 = arith.constant 0 : i32
    %213 = arith.extsi %212 : i32 to i64
    %214 = llvm.mlir.constant(1 : i64) : i64
    %215 = llvm.alloca %214 x i64 : (i64) -> !llvm.ptr
    llvm.store %213, %215 : i64, !llvm.ptr
    %216 = llvm.mlir.constant(1 : i64) : i64
    %217 = llvm.alloca %216 x i64 : (i64) -> !llvm.ptr
    llvm.store %arg0, %217 : i64, !llvm.ptr
    cf.br ^bb36
    ^bb36:
    %218 = llvm.load %217 : !llvm.ptr -> i64
    %219 = arith.constant 1 : i32
    %221 = arith.extsi %219 : i32 to i64
    %220 = arith.andi %218, %221 : i64
    %222 = arith.constant 0 : i32
    %224 = arith.extsi %222 : i32 to i64
    %223 = arith.cmpi eq, %220, %224 : i64
    cf.cond_br %223, ^bb37, ^bb38
    ^bb37:
      %225 = llvm.load %215 : !llvm.ptr -> i64
      %226 = arith.constant 1 : i32
      %228 = arith.extsi %226 : i32 to i64
      %227 = arith.addi %225, %228 : i64
      llvm.store %227, %215 : i64, !llvm.ptr
      %229 = llvm.load %217 : !llvm.ptr -> i64
      %230 = arith.constant 1 : i32
      %232 = arith.extsi %230 : i32 to i64
      %231 = arith.shrsi %229, %232 : i64
      llvm.store %231, %217 : i64, !llvm.ptr
      cf.br ^bb36
    ^bb38:
    %233 = llvm.load %215 : !llvm.ptr -> i64
    func.return %233 : i64
  }
  // Module static: g_coloring_dp
  llvm.mlir.global internal @g_coloring_dp() {addr_space = 0 : i32} : !llvm.ptr {
    %234 = llvm.mlir.zero : !llvm.ptr
    llvm.return %234 : !llvm.ptr
  }
  func.func @colorings_of_all_subsets(%arg0: !llvm.ptr, %arg1: i64) -> () {
    %235 = arith.constant 1 : i32
    %237 = arith.extsi %235 : i32 to i64
    %236 = arith.shli %237, %arg1 : i64
    %239 = arith.constant 8 : i32
    %240 = arith.constant 8 : i32
    %241 = arith.extsi %239 : i32 to i64
    %242 = arith.extsi %240 : i32 to i64
    %238 = func.call @calloc(%241, %242) : (i64, i64) -> !llvm.ptr
    %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
    cf.br ^bb39
    ^bb39:
    %247 = llvm.load %246 : !llvm.ptr -> i64
    %248 = arith.cmpi slt, %247, %arg1 : i64
    cf.cond_br %248, ^bb40, ^bb41
    ^bb40:
      %249 = llvm.load %246 : !llvm.ptr -> i64
      %250 = arith.constant 1 : i32
      %252 = arith.extsi %250 : i32 to i64
      %251 = arith.addi %249, %252 : i64
      %253 = llvm.mlir.constant(1 : i64) : i64
      %254 = llvm.alloca %253 x i64 : (i64) -> !llvm.ptr
      llvm.store %251, %254 : i64, !llvm.ptr
      cf.br ^bb42
      ^bb42:
      %255 = llvm.load %254 : !llvm.ptr -> i64
      %256 = arith.cmpi slt, %255, %arg1 : i64
      cf.cond_br %256, ^bb43, ^bb44
      ^bb43:
        %258 = llvm.mlir.addressof @g_overlap : !llvm.ptr
        %259 = llvm.load %258 : !llvm.ptr -> !llvm.ptr
        %262 = llvm.load %246 : !llvm.ptr -> i64
        %263 = llvm.getelementptr %arg0[%262] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %261 = llvm.load %263 : !llvm.ptr -> i64
        %265 = llvm.load %254 : !llvm.ptr -> i64
        %266 = llvm.getelementptr %arg0[%265] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %264 = llvm.load %266 : !llvm.ptr -> i64
        %260 = func.call @oidx(%261, %264) : (i64, i64) -> i64
        %267 = llvm.getelementptr %259[%260] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %257 = llvm.load %267 : !llvm.ptr -> i64
        %268 = arith.constant 0 : i32
        %270 = arith.extsi %268 : i32 to i64
        %269 = arith.cmpi ne, %257, %270 : i64
        cf.cond_br %269, ^bb45, ^bb46
        ^bb45:
          %272 = llvm.load %246 : !llvm.ptr -> i64
          %273 = llvm.getelementptr %238[%272] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %271 = llvm.load %273 : !llvm.ptr -> i64
          %274 = arith.constant 1 : i32
          %275 = llvm.load %254 : !llvm.ptr -> i64
          %277 = arith.extsi %274 : i32 to i64
          %276 = arith.shli %277, %275 : i64
          %278 = arith.ori %271, %276 : i64
          %279 = llvm.load %246 : !llvm.ptr -> i64
          %280 = llvm.getelementptr %238[%279] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %278, %280 : i64, !llvm.ptr
          %282 = llvm.load %254 : !llvm.ptr -> i64
          %283 = llvm.getelementptr %238[%282] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %281 = llvm.load %283 : !llvm.ptr -> i64
          %284 = arith.constant 1 : i32
          %285 = llvm.load %246 : !llvm.ptr -> i64
          %287 = arith.extsi %284 : i32 to i64
          %286 = arith.shli %287, %285 : i64
          %288 = arith.ori %281, %286 : i64
          %289 = llvm.load %254 : !llvm.ptr -> i64
          %290 = llvm.getelementptr %238[%289] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          llvm.store %288, %290 : i64, !llvm.ptr
          cf.br ^bb47
        ^bb46:
          cf.br ^bb47
        ^bb47:
        %291 = llvm.load %254 : !llvm.ptr -> i64
        %292 = arith.constant 1 : i32
        %294 = arith.extsi %292 : i32 to i64
        %293 = arith.addi %291, %294 : i64
        llvm.store %293, %254 : i64, !llvm.ptr
        cf.br ^bb42
      ^bb44:
      %295 = llvm.load %246 : !llvm.ptr -> i64
      %296 = arith.constant 1 : i32
      %298 = arith.extsi %296 : i32 to i64
      %297 = arith.addi %295, %298 : i64
      llvm.store %297, %246 : i64, !llvm.ptr
      cf.br ^bb39
    ^bb41:
    %300 = arith.constant 256 : i32
    %301 = arith.constant 8 : i32
    %302 = arith.extsi %300 : i32 to i64
    %303 = arith.extsi %301 : i32 to i64
    %299 = func.call @calloc(%302, %303) : (i64, i64) -> !llvm.ptr
    %304 = arith.constant 1 : i32
    %305 = arith.constant 0 : i32
    %306 = arith.extsi %304 : i32 to i64
    %307 = arith.extsi %305 : i32 to i64
    %308 = llvm.getelementptr %299[%307] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %306, %308 : i64, !llvm.ptr
    %309 = arith.constant 1 : i32
    %310 = arith.extsi %309 : i32 to i64
    %311 = llvm.mlir.constant(1 : i64) : i64
    %312 = llvm.alloca %311 x i64 : (i64) -> !llvm.ptr
    llvm.store %310, %312 : i64, !llvm.ptr
    cf.br ^bb48
    ^bb48:
    %313 = llvm.load %312 : !llvm.ptr -> i64
    %314 = arith.cmpi slt, %313, %236 : i64
    cf.cond_br %314, ^bb49, ^bb50
    ^bb49:
      %315 = llvm.load %312 : !llvm.ptr -> i64
      %316 = llvm.load %312 : !llvm.ptr -> i64
      %318 = arith.constant 0 : i64
      %317 = arith.subi %318, %316 : i64
      %319 = arith.andi %315, %317 : i64
      %320 = func.call @ctz(%319) : (i64) -> i64
      %321 = llvm.load %312 : !llvm.ptr -> i64
      %322 = arith.xori %321, %319 : i64
      %324 = llvm.getelementptr %299[%322] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %323 = llvm.load %324 : !llvm.ptr -> i64
      %325 = arith.constant 0 : i32
      %327 = arith.extsi %325 : i32 to i64
      %326 = arith.cmpi ne, %323, %327 : i64
      %328 = scf.if %326 -> (i1) {
        %330 = llvm.getelementptr %238[%320] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %329 = llvm.load %330 : !llvm.ptr -> i64
        %331 = arith.andi %329, %322 : i64
        %332 = arith.constant 0 : i32
        %334 = arith.extsi %332 : i32 to i64
        %333 = arith.cmpi eq, %331, %334 : i64
        scf.yield %333 : i1
      } else {
        %335 = arith.constant false
        scf.yield %335 : i1
      }
      cf.cond_br %328, ^bb51, ^bb52
      ^bb51:
        %336 = arith.constant 1 : i32
        %337 = llvm.load %312 : !llvm.ptr -> i64
        %338 = arith.extsi %336 : i32 to i64
        %339 = llvm.getelementptr %299[%337] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %338, %339 : i64, !llvm.ptr
        cf.br ^bb53
      ^bb52:
        %340 = arith.constant 0 : i32
        %341 = llvm.load %312 : !llvm.ptr -> i64
        %342 = arith.extsi %340 : i32 to i64
        %343 = llvm.getelementptr %299[%341] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %342, %343 : i64, !llvm.ptr
        cf.br ^bb53
      ^bb53:
      %344 = llvm.load %312 : !llvm.ptr -> i64
      %345 = arith.constant 1 : i32
      %347 = arith.extsi %345 : i32 to i64
      %346 = arith.addi %344, %347 : i64
      llvm.store %346, %312 : i64, !llvm.ptr
      cf.br ^bb48
    ^bb50:
    %349 = arith.constant 256 : i32
    %350 = arith.constant 16 : i32
    %351 = arith.extsi %349 : i32 to i64
    %352 = arith.extsi %350 : i32 to i64
    %348 = func.call @calloc(%351, %352) : (i64, i64) -> !llvm.ptr
    %354 = arith.constant 256 : i32
    %355 = arith.constant 16 : i32
    %356 = arith.extsi %354 : i32 to i64
    %357 = arith.extsi %355 : i32 to i64
    %353 = func.call @calloc(%356, %357) : (i64, i64) -> !llvm.ptr
    %358 = arith.constant 1 : i32
    %359 = arith.extsi %358 : i32 to i128
    %360 = arith.constant 0 : i32
    %361 = arith.extsi %360 : i32 to i64
    %362 = llvm.getelementptr %348[%361] : (!llvm.ptr, i64) -> !llvm.ptr, i128
    llvm.store %359, %362 : i128, !llvm.ptr
    %363 = arith.constant 0 : i32
    %364 = arith.extsi %363 : i32 to i64
    %365 = llvm.mlir.constant(1 : i64) : i64
    %366 = llvm.alloca %365 x i64 : (i64) -> !llvm.ptr
    llvm.store %364, %366 : i64, !llvm.ptr
    cf.br ^bb54
    ^bb54:
    %367 = llvm.load %366 : !llvm.ptr -> i64
    %368 = arith.constant 4 : i32
    %370 = arith.extsi %368 : i32 to i64
    %369 = arith.cmpi slt, %367, %370 : i64
    cf.cond_br %369, ^bb55, ^bb56
    ^bb55:
      %371 = arith.constant 0 : i32
      %372 = arith.extsi %371 : i32 to i64
      llvm.store %372, %312 : i64, !llvm.ptr
      cf.br ^bb57
      ^bb57:
      %373 = llvm.load %312 : !llvm.ptr -> i64
      %374 = arith.cmpi slt, %373, %236 : i64
      cf.cond_br %374, ^bb58, ^bb59
      ^bb58:
        %375 = arith.constant 0 : i32
        %376 = arith.extsi %375 : i32 to i128
        %377 = llvm.mlir.constant(1 : i64) : i64
        %378 = llvm.alloca %377 x i128 : (i64) -> !llvm.ptr
        llvm.store %376, %378 : i128, !llvm.ptr
        %379 = llvm.load %312 : !llvm.ptr -> i64
        %380 = llvm.mlir.constant(1 : i64) : i64
        %381 = llvm.alloca %380 x i64 : (i64) -> !llvm.ptr
        llvm.store %379, %381 : i64, !llvm.ptr
        cf.br ^bb60
        ^bb60:
        %382 = arith.constant 1 : i32
        %383 = arith.constant 0 : i32
        %384 = arith.cmpi ne, %382, %383 : i32
        cf.cond_br %384, ^bb61, ^bb62
        ^bb61:
          %386 = llvm.load %381 : !llvm.ptr -> i64
          %387 = llvm.getelementptr %299[%386] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %385 = llvm.load %387 : !llvm.ptr -> i64
          %388 = arith.constant 0 : i32
          %390 = arith.extsi %388 : i32 to i64
          %389 = arith.cmpi ne, %385, %390 : i64
          cf.cond_br %389, ^bb63, ^bb64
          ^bb63:
            %391 = llvm.load %378 : !llvm.ptr -> i128
            %393 = llvm.load %312 : !llvm.ptr -> i64
            %394 = llvm.load %381 : !llvm.ptr -> i64
            %395 = arith.xori %393, %394 : i64
            %396 = llvm.getelementptr %348[%395] : (!llvm.ptr, i64) -> !llvm.ptr, i128
            %392 = llvm.load %396 : !llvm.ptr -> i128
            %398 = arith.trunci %391 : i128 to i64
            %399 = arith.trunci %392 : i128 to i64
            %397 = arith.addi %398, %399 : i64
            %400 = arith.extsi %397 : i64 to i128
            llvm.store %400, %378 : i128, !llvm.ptr
            cf.br ^bb65
          ^bb64:
            cf.br ^bb65
          ^bb65:
          %401 = llvm.load %381 : !llvm.ptr -> i64
          %402 = arith.constant 0 : i32
          %404 = arith.extsi %402 : i32 to i64
          %403 = arith.cmpi eq, %401, %404 : i64
          cf.cond_br %403, ^bb66, ^bb67
          ^bb66:
            cf.br ^bb62
          ^bb67:
            cf.br ^bb68
          ^bb68:
          %405 = llvm.load %381 : !llvm.ptr -> i64
          %406 = arith.constant 1 : i32
          %408 = arith.extsi %406 : i32 to i64
          %407 = arith.subi %405, %408 : i64
          %409 = llvm.load %312 : !llvm.ptr -> i64
          %410 = arith.andi %407, %409 : i64
          llvm.store %410, %381 : i64, !llvm.ptr
          cf.br ^bb60
        ^bb62:
        %411 = llvm.load %378 : !llvm.ptr -> i128
        %412 = llvm.load %312 : !llvm.ptr -> i64
        %413 = llvm.getelementptr %353[%412] : (!llvm.ptr, i64) -> !llvm.ptr, i128
        llvm.store %411, %413 : i128, !llvm.ptr
        %414 = llvm.load %312 : !llvm.ptr -> i64
        %415 = arith.constant 1 : i32
        %417 = arith.extsi %415 : i32 to i64
        %416 = arith.addi %414, %417 : i64
        llvm.store %416, %312 : i64, !llvm.ptr
        cf.br ^bb57
      ^bb59:
      %418 = arith.constant 0 : i32
      %419 = arith.extsi %418 : i32 to i64
      %420 = llvm.mlir.constant(1 : i64) : i64
      %421 = llvm.alloca %420 x i64 : (i64) -> !llvm.ptr
      llvm.store %419, %421 : i64, !llvm.ptr
      cf.br ^bb69
      ^bb69:
      %422 = llvm.load %421 : !llvm.ptr -> i64
      %423 = arith.cmpi slt, %422, %236 : i64
      cf.cond_br %423, ^bb70, ^bb71
      ^bb70:
        %425 = llvm.load %421 : !llvm.ptr -> i64
        %426 = llvm.getelementptr %353[%425] : (!llvm.ptr, i64) -> !llvm.ptr, i128
        %424 = llvm.load %426 : !llvm.ptr -> i128
        %427 = llvm.load %421 : !llvm.ptr -> i64
        %428 = llvm.getelementptr %348[%427] : (!llvm.ptr, i64) -> !llvm.ptr, i128
        llvm.store %424, %428 : i128, !llvm.ptr
        %429 = llvm.load %421 : !llvm.ptr -> i64
        %430 = arith.constant 1 : i32
        %432 = arith.extsi %430 : i32 to i64
        %431 = arith.addi %429, %432 : i64
        llvm.store %431, %421 : i64, !llvm.ptr
        cf.br ^bb69
      ^bb71:
      %433 = llvm.load %366 : !llvm.ptr -> i64
      %434 = arith.constant 1 : i32
      %436 = arith.extsi %434 : i32 to i64
      %435 = arith.addi %433, %436 : i64
      llvm.store %435, %366 : i64, !llvm.ptr
      cf.br ^bb54
    ^bb56:
    %437 = arith.constant 0 : i32
    %438 = arith.extsi %437 : i32 to i64
    %439 = llvm.mlir.constant(1 : i64) : i64
    %440 = llvm.alloca %439 x i64 : (i64) -> !llvm.ptr
    llvm.store %438, %440 : i64, !llvm.ptr
    cf.br ^bb72
    ^bb72:
    %441 = llvm.load %440 : !llvm.ptr -> i64
    %442 = arith.cmpi slt, %441, %236 : i64
    cf.cond_br %442, ^bb73, ^bb74
    ^bb73:
      %444 = llvm.load %440 : !llvm.ptr -> i64
      %445 = llvm.getelementptr %348[%444] : (!llvm.ptr, i64) -> !llvm.ptr, i128
      %443 = llvm.load %445 : !llvm.ptr -> i128
      %446 = llvm.mlir.addressof @g_coloring_dp : !llvm.ptr
      %447 = llvm.load %446 : !llvm.ptr -> !llvm.ptr
      %448 = llvm.load %440 : !llvm.ptr -> i64
      %449 = llvm.getelementptr %447[%448] : (!llvm.ptr, i64) -> !llvm.ptr, i128
      llvm.store %443, %449 : i128, !llvm.ptr
      %450 = llvm.load %440 : !llvm.ptr -> i64
      %451 = arith.constant 1 : i32
      %453 = arith.extsi %451 : i32 to i64
      %452 = arith.addi %450, %453 : i64
      llvm.store %452, %440 : i64, !llvm.ptr
      cf.br ^bb72
    ^bb74:
    func.call @free(%238) : (!llvm.ptr) -> ()
    func.call @free(%299) : (!llvm.ptr) -> ()
    func.call @free(%348) : (!llvm.ptr) -> ()
    func.call @free(%353) : (!llvm.ptr) -> ()
    func.return
  }
  func.func @labeled_count(%arg0: !llvm.ptr, %arg1: i64) -> i128 {
    %458 = arith.constant 1 : i32
    %460 = arith.extsi %458 : i32 to i64
    %459 = arith.shli %460, %arg1 : i64
    func.call @colorings_of_all_subsets(%arg0, %arg1) : (!llvm.ptr, i64) -> ()
    %463 = arith.constant 13 : i32
    %464 = arith.constant 8 : i32
    %465 = arith.extsi %463 : i32 to i64
    %466 = arith.extsi %464 : i32 to i64
    %462 = func.call @calloc(%465, %466) : (i64, i64) -> !llvm.ptr
    %468 = arith.constant 13 : i32
    %469 = arith.constant 8 : i32
    %470 = arith.extsi %468 : i32 to i64
    %471 = arith.extsi %469 : i32 to i64
    %467 = func.call @calloc(%470, %471) : (i64, i64) -> !llvm.ptr
    %472 = arith.constant 0 : i32
    %473 = arith.extsi %472 : i32 to i64
    %474 = llvm.mlir.constant(1 : i64) : i64
    %475 = llvm.alloca %474 x i64 : (i64) -> !llvm.ptr
    llvm.store %473, %475 : i64, !llvm.ptr
    cf.br ^bb75
    ^bb75:
    %476 = llvm.load %475 : !llvm.ptr -> i64
    %477 = arith.cmpi slt, %476, %arg1 : i64
    cf.cond_br %477, ^bb76, ^bb77
    ^bb76:
      %478 = arith.constant 1 : i32
      %479 = llvm.load %475 : !llvm.ptr -> i64
      %481 = arith.extsi %478 : i32 to i64
      %480 = arith.shli %481, %479 : i64
      %482 = arith.constant 0 : i32
      %483 = arith.extsi %482 : i32 to i64
      %484 = llvm.mlir.constant(1 : i64) : i64
      %485 = llvm.alloca %484 x i64 : (i64) -> !llvm.ptr
      llvm.store %483, %485 : i64, !llvm.ptr
      cf.br ^bb78
      ^bb78:
      %486 = llvm.load %485 : !llvm.ptr -> i64
      %487 = arith.constant 5 : i32
      %489 = arith.extsi %487 : i32 to i64
      %488 = arith.cmpi slt, %486, %489 : i64
      cf.cond_br %488, ^bb79, ^bb80
      ^bb79:
        %491 = llvm.mlir.addressof @g_windows : !llvm.ptr
        %492 = llvm.load %491 : !llvm.ptr -> !llvm.ptr
        %495 = llvm.load %475 : !llvm.ptr -> i64
        %496 = llvm.getelementptr %arg0[%495] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %494 = llvm.load %496 : !llvm.ptr -> i64
        %497 = llvm.load %485 : !llvm.ptr -> i64
        %493 = func.call @widx(%494, %497) : (i64, i64) -> i64
        %498 = llvm.getelementptr %492[%493] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %490 = llvm.load %498 : !llvm.ptr -> i64
        %500 = llvm.getelementptr %462[%490] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %499 = llvm.load %500 : !llvm.ptr -> i64
        %501 = arith.constant 1 : i32
        %503 = arith.extsi %501 : i32 to i64
        %502 = arith.addi %499, %503 : i64
        %504 = llvm.getelementptr %462[%490] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %502, %504 : i64, !llvm.ptr
        %506 = llvm.getelementptr %467[%490] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %505 = llvm.load %506 : !llvm.ptr -> i64
        %507 = arith.ori %505, %480 : i64
        %508 = llvm.getelementptr %467[%490] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %507, %508 : i64, !llvm.ptr
        %509 = llvm.load %485 : !llvm.ptr -> i64
        %510 = arith.constant 1 : i32
        %512 = arith.extsi %510 : i32 to i64
        %511 = arith.addi %509, %512 : i64
        llvm.store %511, %485 : i64, !llvm.ptr
        cf.br ^bb78
      ^bb80:
      %513 = llvm.load %475 : !llvm.ptr -> i64
      %514 = arith.constant 1 : i32
      %516 = arith.extsi %514 : i32 to i64
      %515 = arith.addi %513, %516 : i64
      llvm.store %515, %475 : i64, !llvm.ptr
      cf.br ^bb75
    ^bb77:
    %517 = arith.constant 0 : i32
    %518 = arith.extsi %517 : i32 to i128
    %519 = llvm.mlir.constant(1 : i64) : i64
    %520 = llvm.alloca %519 x i128 : (i64) -> !llvm.ptr
    llvm.store %518, %520 : i128, !llvm.ptr
    %521 = arith.constant 0 : i32
    %522 = arith.extsi %521 : i32 to i64
    %523 = llvm.mlir.constant(1 : i64) : i64
    %524 = llvm.alloca %523 x i64 : (i64) -> !llvm.ptr
    llvm.store %522, %524 : i64, !llvm.ptr
    cf.br ^bb81
    ^bb81:
    %525 = llvm.load %524 : !llvm.ptr -> i64
    %526 = arith.cmpi slt, %525, %459 : i64
    cf.cond_br %526, ^bb82, ^bb83
    ^bb82:
      %527 = arith.constant 1 : i32
      %528 = arith.extsi %527 : i32 to i128
      %529 = llvm.mlir.constant(1 : i64) : i64
      %530 = llvm.alloca %529 x i128 : (i64) -> !llvm.ptr
      llvm.store %528, %530 : i128, !llvm.ptr
      %531 = arith.constant 1 : i32
      %532 = arith.extsi %531 : i32 to i64
      %533 = llvm.mlir.constant(1 : i64) : i64
      %534 = llvm.alloca %533 x i64 : (i64) -> !llvm.ptr
      llvm.store %532, %534 : i64, !llvm.ptr
      %535 = arith.constant 0 : i32
      %536 = arith.extsi %535 : i32 to i64
      %537 = llvm.mlir.constant(1 : i64) : i64
      %538 = llvm.alloca %537 x i64 : (i64) -> !llvm.ptr
      llvm.store %536, %538 : i64, !llvm.ptr
      cf.br ^bb84
      ^bb84:
      %539 = llvm.load %538 : !llvm.ptr -> i64
      %540 = arith.constant 13 : i32
      %542 = arith.extsi %540 : i32 to i64
      %541 = arith.cmpi slt, %539, %542 : i64
      cf.cond_br %541, ^bb85, ^bb86
      ^bb85:
        %543 = llvm.load %534 : !llvm.ptr -> i64
        %544 = arith.constant 0 : i32
        %546 = arith.extsi %544 : i32 to i64
        %545 = arith.cmpi ne, %543, %546 : i64
        cf.cond_br %545, ^bb87, ^bb88
        ^bb87:
          %549 = llvm.load %538 : !llvm.ptr -> i64
          %550 = llvm.getelementptr %467[%549] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %548 = llvm.load %550 : !llvm.ptr -> i64
          %551 = llvm.load %524 : !llvm.ptr -> i64
          %552 = arith.andi %548, %551 : i64
          %547 = func.call @popcount(%552) : (i64) -> i64
          %554 = llvm.load %538 : !llvm.ptr -> i64
          %555 = llvm.getelementptr %462[%554] : (!llvm.ptr, i64) -> !llvm.ptr, i64
          %553 = llvm.load %555 : !llvm.ptr -> i64
          %556 = arith.subi %553, %547 : i64
          %558 = llvm.mlir.addressof @g_perms : !llvm.ptr
          %559 = llvm.load %558 : !llvm.ptr -> !llvm.ptr
          %561 = arith.constant 4 : i32
          %563 = arith.extsi %561 : i32 to i64
          %562 = arith.subi %563, %547 : i64
          %560 = func.call @pidx(%562, %556) : (i64, i64) -> i64
          %564 = llvm.getelementptr %559[%560] : (!llvm.ptr, i64) -> !llvm.ptr, i128
          %557 = llvm.load %564 : !llvm.ptr -> i128
          %565 = arith.constant 0 : i32
          %566 = arith.extsi %565 : i32 to i128
          %568 = arith.trunci %557 : i128 to i64
          %569 = arith.trunci %566 : i128 to i64
          %567 = arith.cmpi eq, %568, %569 : i64
          cf.cond_br %567, ^bb90, ^bb91
          ^bb90:
            %570 = arith.constant 0 : i32
            %571 = arith.extsi %570 : i32 to i64
            llvm.store %571, %534 : i64, !llvm.ptr
            cf.br ^bb92
          ^bb91:
            %572 = llvm.load %530 : !llvm.ptr -> i128
            %574 = arith.trunci %572 : i128 to i64
            %575 = arith.trunci %557 : i128 to i64
            %573 = arith.muli %574, %575 : i64
            %576 = arith.extsi %573 : i64 to i128
            llvm.store %576, %530 : i128, !llvm.ptr
            cf.br ^bb92
          ^bb92:
          cf.br ^bb89
        ^bb88:
          cf.br ^bb89
        ^bb89:
        %577 = llvm.load %538 : !llvm.ptr -> i64
        %578 = arith.constant 1 : i32
        %580 = arith.extsi %578 : i32 to i64
        %579 = arith.addi %577, %580 : i64
        llvm.store %579, %538 : i64, !llvm.ptr
        cf.br ^bb84
      ^bb86:
      %581 = llvm.load %534 : !llvm.ptr -> i64
      %582 = arith.constant 0 : i32
      %584 = arith.extsi %582 : i32 to i64
      %583 = arith.cmpi ne, %581, %584 : i64
      cf.cond_br %583, ^bb93, ^bb94
      ^bb93:
        %586 = llvm.mlir.addressof @g_coloring_dp : !llvm.ptr
        %587 = llvm.load %586 : !llvm.ptr -> !llvm.ptr
        %588 = llvm.load %524 : !llvm.ptr -> i64
        %589 = llvm.getelementptr %587[%588] : (!llvm.ptr, i64) -> !llvm.ptr, i128
        %585 = llvm.load %589 : !llvm.ptr -> i128
        %590 = llvm.load %530 : !llvm.ptr -> i128
        %592 = arith.trunci %585 : i128 to i64
        %593 = arith.trunci %590 : i128 to i64
        %591 = arith.muli %592, %593 : i64
        %594 = arith.extsi %591 : i64 to i128
        %596 = llvm.load %524 : !llvm.ptr -> i64
        %595 = func.call @popcount(%596) : (i64) -> i64
        %597 = arith.constant 1 : i32
        %599 = arith.extsi %597 : i32 to i64
        %598 = arith.andi %595, %599 : i64
        %600 = arith.constant 0 : i32
        %602 = arith.extsi %600 : i32 to i64
        %601 = arith.cmpi ne, %598, %602 : i64
        cf.cond_br %601, ^bb96, ^bb97
        ^bb96:
          %603 = llvm.load %520 : !llvm.ptr -> i128
          %605 = arith.trunci %603 : i128 to i64
          %606 = arith.trunci %594 : i128 to i64
          %604 = arith.subi %605, %606 : i64
          %607 = arith.extsi %604 : i64 to i128
          llvm.store %607, %520 : i128, !llvm.ptr
          cf.br ^bb98
        ^bb97:
          %608 = llvm.load %520 : !llvm.ptr -> i128
          %610 = arith.trunci %608 : i128 to i64
          %611 = arith.trunci %594 : i128 to i64
          %609 = arith.addi %610, %611 : i64
          %612 = arith.extsi %609 : i64 to i128
          llvm.store %612, %520 : i128, !llvm.ptr
          cf.br ^bb98
        ^bb98:
        cf.br ^bb95
      ^bb94:
        cf.br ^bb95
      ^bb95:
      %613 = llvm.load %524 : !llvm.ptr -> i64
      %614 = arith.constant 1 : i32
      %616 = arith.extsi %614 : i32 to i64
      %615 = arith.addi %613, %616 : i64
      llvm.store %615, %524 : i64, !llvm.ptr
      cf.br ^bb81
    ^bb83:
    func.call @free(%462) : (!llvm.ptr) -> ()
    func.call @free(%467) : (!llvm.ptr) -> ()
    %619 = llvm.load %520 : !llvm.ptr -> i128
    func.return %619 : i128
  }
  // Module static: bt_counts
  llvm.mlir.global internal @bt_counts() {addr_space = 0 : i32} : !llvm.ptr {
    %620 = llvm.mlir.zero : !llvm.ptr
    llvm.return %620 : !llvm.ptr
  }
  // Module static: bt_coverage
  llvm.mlir.global internal @bt_coverage() {addr_space = 0 : i32} : !llvm.ptr {
    %621 = llvm.mlir.zero : !llvm.ptr
    llvm.return %621 : !llvm.ptr
  }
  // Module static: bt_result
  llvm.mlir.global internal @bt_result(0 : i128) : i128
  func.func @process_type_count() -> i128 {
    %623 = arith.constant 8 : i32
    %624 = arith.constant 8 : i32
    %625 = arith.extsi %623 : i32 to i64
    %626 = arith.extsi %624 : i32 to i64
    %622 = func.call @calloc(%625, %626) : (i64, i64) -> !llvm.ptr
    %627 = arith.constant 0 : i32
    %628 = arith.extsi %627 : i32 to i64
    %629 = llvm.mlir.constant(1 : i64) : i64
    %630 = llvm.alloca %629 x i64 : (i64) -> !llvm.ptr
    llvm.store %628, %630 : i64, !llvm.ptr
    %631 = arith.constant 1 : i32
    %632 = arith.extsi %631 : i32 to i128
    %633 = llvm.mlir.constant(1 : i64) : i64
    %634 = llvm.alloca %633 x i128 : (i64) -> !llvm.ptr
    llvm.store %632, %634 : i128, !llvm.ptr
    %635 = arith.constant 0 : i32
    %636 = arith.extsi %635 : i32 to i64
    %637 = llvm.mlir.constant(1 : i64) : i64
    %638 = llvm.alloca %637 x i64 : (i64) -> !llvm.ptr
    llvm.store %636, %638 : i64, !llvm.ptr
    cf.br ^bb99
    ^bb99:
    %639 = llvm.load %638 : !llvm.ptr -> i64
    %640 = arith.constant 10 : i32
    %642 = arith.extsi %640 : i32 to i64
    %641 = arith.cmpi slt, %639, %642 : i64
    cf.cond_br %641, ^bb100, ^bb101
    ^bb100:
      %643 = arith.constant 0 : i32
      %644 = arith.extsi %643 : i32 to i64
      %645 = llvm.mlir.constant(1 : i64) : i64
      %646 = llvm.alloca %645 x i64 : (i64) -> !llvm.ptr
      llvm.store %644, %646 : i64, !llvm.ptr
      cf.br ^bb102
      ^bb102:
      %647 = llvm.load %646 : !llvm.ptr -> i64
      %649 = llvm.mlir.addressof @bt_counts : !llvm.ptr
      %650 = llvm.load %649 : !llvm.ptr -> !llvm.ptr
      %651 = llvm.load %638 : !llvm.ptr -> i64
      %652 = llvm.getelementptr %650[%651] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %648 = llvm.load %652 : !llvm.ptr -> i64
      %653 = arith.cmpi slt, %647, %648 : i64
      cf.cond_br %653, ^bb103, ^bb104
      ^bb103:
        %654 = llvm.load %638 : !llvm.ptr -> i64
        %655 = llvm.load %630 : !llvm.ptr -> i64
        %656 = llvm.getelementptr %622[%655] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %654, %656 : i64, !llvm.ptr
        %657 = llvm.load %630 : !llvm.ptr -> i64
        %658 = arith.constant 1 : i32
        %660 = arith.extsi %658 : i32 to i64
        %659 = arith.addi %657, %660 : i64
        llvm.store %659, %630 : i64, !llvm.ptr
        %661 = llvm.load %646 : !llvm.ptr -> i64
        %662 = arith.constant 1 : i32
        %664 = arith.extsi %662 : i32 to i64
        %663 = arith.addi %661, %664 : i64
        llvm.store %663, %646 : i64, !llvm.ptr
        cf.br ^bb102
      ^bb104:
      %665 = llvm.load %634 : !llvm.ptr -> i128
      %668 = llvm.mlir.addressof @bt_counts : !llvm.ptr
      %669 = llvm.load %668 : !llvm.ptr -> !llvm.ptr
      %670 = llvm.load %638 : !llvm.ptr -> i64
      %671 = llvm.getelementptr %669[%670] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      %667 = llvm.load %671 : !llvm.ptr -> i64
      %666 = func.call @factorial(%667) : (i64) -> i128
      %673 = arith.trunci %665 : i128 to i64
      %674 = arith.trunci %666 : i128 to i64
      %672 = arith.muli %673, %674 : i64
      %675 = arith.extsi %672 : i64 to i128
      llvm.store %675, %634 : i128, !llvm.ptr
      %676 = llvm.load %638 : !llvm.ptr -> i64
      %677 = arith.constant 1 : i32
      %679 = arith.extsi %677 : i32 to i64
      %678 = arith.addi %676, %679 : i64
      llvm.store %678, %638 : i64, !llvm.ptr
      cf.br ^bb99
    ^bb101:
    %681 = llvm.load %630 : !llvm.ptr -> i64
    %680 = func.call @labeled_count(%622, %681) : (!llvm.ptr, i64) -> i128
    %682 = llvm.load %634 : !llvm.ptr -> i128
    %684 = arith.trunci %680 : i128 to i64
    %685 = arith.trunci %682 : i128 to i64
    %683 = arith.divsi %684, %685 : i64
    %686 = arith.extsi %683 : i64 to i128
    func.call @free(%622) : (!llvm.ptr) -> ()
    func.return %686 : i128
  }
  func.func @backtrack(%arg0: i64, %arg1: i64) -> () {
    %688 = arith.constant 10 : i32
    %690 = arith.extsi %688 : i32 to i64
    %689 = arith.cmpi eq, %arg0, %690 : i64
    cf.cond_br %689, ^bb105, ^bb106
    ^bb105:
      %691 = arith.constant 0 : i32
      %693 = arith.extsi %691 : i32 to i64
      %692 = arith.cmpi eq, %arg1, %693 : i64
      cf.cond_br %692, ^bb108, ^bb109
      ^bb108:
        %694 = llvm.mlir.addressof @bt_result : !llvm.ptr
        %695 = llvm.load %694 : !llvm.ptr -> i128
        %696 = func.call @process_type_count() : () -> i128
        %698 = arith.trunci %695 : i128 to i64
        %699 = arith.trunci %696 : i128 to i64
        %697 = arith.addi %698, %699 : i64
        %700 = arith.extsi %697 : i64 to i128
        %701 = llvm.mlir.addressof @bt_result : !llvm.ptr
        llvm.store %700, %701 : i128, !llvm.ptr
        cf.br ^bb110
      ^bb109:
        cf.br ^bb110
      ^bb110:
      func.return
    ^bb106:
      cf.br ^bb107
    ^bb107:
    %702 = arith.constant 0 : i32
    %703 = arith.extsi %702 : i32 to i64
    %704 = llvm.mlir.constant(1 : i64) : i64
    %705 = llvm.alloca %704 x i64 : (i64) -> !llvm.ptr
    llvm.store %703, %705 : i64, !llvm.ptr
    cf.br ^bb111
    ^bb111:
    %706 = llvm.load %705 : !llvm.ptr -> i64
    %707 = arith.cmpi sle, %706, %arg1 : i64
    cf.cond_br %707, ^bb112, ^bb113
    ^bb112:
      %708 = arith.constant 1 : i32
      %709 = arith.extsi %708 : i32 to i64
      %710 = llvm.mlir.constant(1 : i64) : i64
      %711 = llvm.alloca %710 x i64 : (i64) -> !llvm.ptr
      llvm.store %709, %711 : i64, !llvm.ptr
      %712 = arith.constant 0 : i32
      %713 = arith.extsi %712 : i32 to i64
      %714 = llvm.mlir.constant(1 : i64) : i64
      %715 = llvm.alloca %714 x i64 : (i64) -> !llvm.ptr
      llvm.store %713, %715 : i64, !llvm.ptr
      cf.br ^bb114
      ^bb114:
      %716 = llvm.load %715 : !llvm.ptr -> i64
      %717 = arith.constant 5 : i32
      %719 = arith.extsi %717 : i32 to i64
      %718 = arith.cmpi slt, %716, %719 : i64
      cf.cond_br %718, ^bb115, ^bb116
      ^bb115:
        %721 = llvm.mlir.addressof @bt_coverage : !llvm.ptr
        %722 = llvm.load %721 : !llvm.ptr -> !llvm.ptr
        %724 = llvm.mlir.addressof @g_windows : !llvm.ptr
        %725 = llvm.load %724 : !llvm.ptr -> !llvm.ptr
        %727 = llvm.load %715 : !llvm.ptr -> i64
        %726 = func.call @widx(%arg0, %727) : (i64, i64) -> i64
        %728 = llvm.getelementptr %725[%726] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %723 = llvm.load %728 : !llvm.ptr -> i64
        %729 = llvm.getelementptr %722[%723] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %720 = llvm.load %729 : !llvm.ptr -> i64
        %730 = llvm.load %705 : !llvm.ptr -> i64
        %731 = arith.addi %720, %730 : i64
        %732 = llvm.mlir.addressof @bt_coverage : !llvm.ptr
        %733 = llvm.load %732 : !llvm.ptr -> !llvm.ptr
        %735 = llvm.mlir.addressof @g_windows : !llvm.ptr
        %736 = llvm.load %735 : !llvm.ptr -> !llvm.ptr
        %738 = llvm.load %715 : !llvm.ptr -> i64
        %737 = func.call @widx(%arg0, %738) : (i64, i64) -> i64
        %739 = llvm.getelementptr %736[%737] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %734 = llvm.load %739 : !llvm.ptr -> i64
        %740 = llvm.getelementptr %733[%734] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %731, %740 : i64, !llvm.ptr
        %742 = llvm.mlir.addressof @bt_coverage : !llvm.ptr
        %743 = llvm.load %742 : !llvm.ptr -> !llvm.ptr
        %745 = llvm.mlir.addressof @g_windows : !llvm.ptr
        %746 = llvm.load %745 : !llvm.ptr -> !llvm.ptr
        %748 = llvm.load %715 : !llvm.ptr -> i64
        %747 = func.call @widx(%arg0, %748) : (i64, i64) -> i64
        %749 = llvm.getelementptr %746[%747] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %744 = llvm.load %749 : !llvm.ptr -> i64
        %750 = llvm.getelementptr %743[%744] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %741 = llvm.load %750 : !llvm.ptr -> i64
        %751 = arith.constant 4 : i32
        %753 = arith.extsi %751 : i32 to i64
        %752 = arith.cmpi sgt, %741, %753 : i64
        cf.cond_br %752, ^bb117, ^bb118
        ^bb117:
          %754 = arith.constant 0 : i32
          %755 = arith.extsi %754 : i32 to i64
          llvm.store %755, %711 : i64, !llvm.ptr
          cf.br ^bb119
        ^bb118:
          cf.br ^bb119
        ^bb119:
        %756 = llvm.load %715 : !llvm.ptr -> i64
        %757 = arith.constant 1 : i32
        %759 = arith.extsi %757 : i32 to i64
        %758 = arith.addi %756, %759 : i64
        llvm.store %758, %715 : i64, !llvm.ptr
        cf.br ^bb114
      ^bb116:
      %760 = llvm.load %705 : !llvm.ptr -> i64
      %761 = llvm.mlir.addressof @bt_counts : !llvm.ptr
      %762 = llvm.load %761 : !llvm.ptr -> !llvm.ptr
      %763 = llvm.getelementptr %762[%arg0] : (!llvm.ptr, i64) -> !llvm.ptr, i64
      llvm.store %760, %763 : i64, !llvm.ptr
      %764 = llvm.load %711 : !llvm.ptr -> i64
      %765 = arith.constant 0 : i32
      %767 = arith.extsi %765 : i32 to i64
      %766 = arith.cmpi ne, %764, %767 : i64
      cf.cond_br %766, ^bb120, ^bb121
      ^bb120:
        %769 = arith.constant 1 : i32
        %771 = arith.extsi %769 : i32 to i64
        %770 = arith.addi %arg0, %771 : i64
        %772 = llvm.load %705 : !llvm.ptr -> i64
        %773 = arith.subi %arg1, %772 : i64
        func.call @backtrack(%770, %773) : (i64, i64) -> ()
        cf.br ^bb122
      ^bb121:
        cf.br ^bb122
      ^bb122:
      %774 = arith.constant 0 : i32
      %775 = arith.extsi %774 : i32 to i64
      llvm.store %775, %715 : i64, !llvm.ptr
      cf.br ^bb123
      ^bb123:
      %776 = llvm.load %715 : !llvm.ptr -> i64
      %777 = arith.constant 5 : i32
      %779 = arith.extsi %777 : i32 to i64
      %778 = arith.cmpi slt, %776, %779 : i64
      cf.cond_br %778, ^bb124, ^bb125
      ^bb124:
        %781 = llvm.mlir.addressof @bt_coverage : !llvm.ptr
        %782 = llvm.load %781 : !llvm.ptr -> !llvm.ptr
        %784 = llvm.mlir.addressof @g_windows : !llvm.ptr
        %785 = llvm.load %784 : !llvm.ptr -> !llvm.ptr
        %787 = llvm.load %715 : !llvm.ptr -> i64
        %786 = func.call @widx(%arg0, %787) : (i64, i64) -> i64
        %788 = llvm.getelementptr %785[%786] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %783 = llvm.load %788 : !llvm.ptr -> i64
        %789 = llvm.getelementptr %782[%783] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %780 = llvm.load %789 : !llvm.ptr -> i64
        %790 = llvm.load %705 : !llvm.ptr -> i64
        %791 = arith.subi %780, %790 : i64
        %792 = llvm.mlir.addressof @bt_coverage : !llvm.ptr
        %793 = llvm.load %792 : !llvm.ptr -> !llvm.ptr
        %795 = llvm.mlir.addressof @g_windows : !llvm.ptr
        %796 = llvm.load %795 : !llvm.ptr -> !llvm.ptr
        %798 = llvm.load %715 : !llvm.ptr -> i64
        %797 = func.call @widx(%arg0, %798) : (i64, i64) -> i64
        %799 = llvm.getelementptr %796[%797] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        %794 = llvm.load %799 : !llvm.ptr -> i64
        %800 = llvm.getelementptr %793[%794] : (!llvm.ptr, i64) -> !llvm.ptr, i64
        llvm.store %791, %800 : i64, !llvm.ptr
        %801 = llvm.load %715 : !llvm.ptr -> i64
        %802 = arith.constant 1 : i32
        %804 = arith.extsi %802 : i32 to i64
        %803 = arith.addi %801, %804 : i64
        llvm.store %803, %715 : i64, !llvm.ptr
        cf.br ^bb123
      ^bb125:
      %805 = llvm.load %705 : !llvm.ptr -> i64
      %806 = arith.constant 1 : i32
      %808 = arith.extsi %806 : i32 to i64
      %807 = arith.addi %805, %808 : i64
      llvm.store %807, %705 : i64, !llvm.ptr
      cf.br ^bb111
    ^bb113:
    %809 = arith.constant 0 : i32
    %810 = llvm.mlir.addressof @bt_counts : !llvm.ptr
    %811 = llvm.load %810 : !llvm.ptr -> !llvm.ptr
    %812 = arith.extsi %809 : i32 to i64
    %813 = llvm.getelementptr %811[%arg0] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %812, %813 : i64, !llvm.ptr
    func.return
  }
  func.func @count_disjoint_straights(%arg0: i64) -> i128 {
    %814 = arith.constant 0 : i32
    %815 = arith.extsi %814 : i32 to i128
    %816 = llvm.mlir.addressof @bt_result : !llvm.ptr
    llvm.store %815, %816 : i128, !llvm.ptr
    %818 = llvm.mlir.addressof @bt_coverage : !llvm.ptr
    %819 = llvm.load %818 : !llvm.ptr -> !llvm.ptr
    %820 = arith.constant 0 : i32
    %821 = arith.constant 13 : i32
    %822 = arith.constant 8 : i32
    %823 = arith.muli %821, %822 : i32
    %824 = arith.extsi %820 : i32 to i64
    %825 = arith.extsi %823 : i32 to i64
    %817 = func.call @memset(%819, %824, %825) : (!llvm.ptr, i64, i64) -> !llvm.ptr
    %827 = arith.constant 0 : i32
    %828 = arith.extsi %827 : i32 to i64
    func.call @backtrack(%828, %arg0) : (i64, i64) -> ()
    %829 = llvm.mlir.addressof @bt_result : !llvm.ptr
    %830 = llvm.load %829 : !llvm.ptr -> i128
    func.return %830 : i128
  }
  func.func @print_u128(%arg0: i128) -> () {
    %831 = arith.constant 0 : i32
    %832 = arith.extsi %831 : i32 to i128
    %834 = arith.trunci %arg0 : i128 to i64
    %835 = arith.trunci %832 : i128 to i64
    %833 = arith.cmpi eq, %834, %835 : i64
    cf.cond_br %833, ^bb126, ^bb127
    ^bb126:
      %836 = llvm.mlir.addressof @str_0 : !llvm.ptr
      %837 = llvm.call @printf(%836) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr) -> i32
      func.return
    ^bb127:
      cf.br ^bb128
    ^bb128:
    %839 = arith.constant 40 : i32
    %840 = arith.extsi %839 : i32 to i64
    %838 = func.call @malloc(%840) : (i64) -> !llvm.ptr
    %841 = llvm.mlir.constant(1 : i64) : i64
    %842 = llvm.alloca %841 x !llvm.ptr : (i64) -> !llvm.ptr
    llvm.store %838, %842 : !llvm.ptr, !llvm.ptr
    %843 = arith.constant 39 : i32
    %844 = arith.extsi %843 : i32 to i64
    %845 = llvm.mlir.constant(1 : i64) : i64
    %846 = llvm.alloca %845 x i64 : (i64) -> !llvm.ptr
    llvm.store %844, %846 : i64, !llvm.ptr
    %847 = arith.constant 0 : i32
    %848 = llvm.load %842 : !llvm.ptr -> !llvm.ptr
    %849 = llvm.load %846 : !llvm.ptr -> i64
    %850 = arith.trunci %847 : i32 to i8
    %851 = llvm.getelementptr %848[%849] : (!llvm.ptr, i64) -> !llvm.ptr, i8
    llvm.store %850, %851 : i8, !llvm.ptr
    %852 = llvm.mlir.constant(1 : i64) : i64
    %853 = llvm.alloca %852 x i128 : (i64) -> !llvm.ptr
    llvm.store %arg0, %853 : i128, !llvm.ptr
    cf.br ^bb129
    ^bb129:
    %854 = llvm.load %853 : !llvm.ptr -> i128
    %855 = arith.constant 0 : i32
    %856 = arith.extsi %855 : i32 to i128
    %858 = arith.trunci %854 : i128 to i64
    %859 = arith.trunci %856 : i128 to i64
    %857 = arith.cmpi sgt, %858, %859 : i64
    cf.cond_br %857, ^bb130, ^bb131
    ^bb130:
      %860 = llvm.load %846 : !llvm.ptr -> i64
      %861 = arith.constant 1 : i32
      %863 = arith.extsi %861 : i32 to i64
      %862 = arith.subi %860, %863 : i64
      llvm.store %862, %846 : i64, !llvm.ptr
      %864 = llvm.load %853 : !llvm.ptr -> i128
      %865 = arith.constant 10 : i32
      %866 = arith.extsi %865 : i32 to i128
      %868 = arith.trunci %864 : i128 to i64
      %869 = arith.trunci %866 : i128 to i64
      %867 = arith.remsi %868, %869 : i64
      %870 = arith.extsi %867 : i64 to i128
      %871 = arith.constant 48 : i32
      %873 = arith.trunci %870 : i128 to i64
      %874 = arith.extsi %871 : i32 to i64
      %872 = arith.addi %873, %874 : i64
      %875 = arith.trunci %872 : i64 to i8
      %876 = llvm.load %842 : !llvm.ptr -> !llvm.ptr
      %877 = llvm.load %846 : !llvm.ptr -> i64
      %878 = llvm.getelementptr %876[%877] : (!llvm.ptr, i64) -> !llvm.ptr, i8
      llvm.store %875, %878 : i8, !llvm.ptr
      %879 = llvm.load %853 : !llvm.ptr -> i128
      %880 = arith.constant 10 : i32
      %881 = arith.extsi %880 : i32 to i128
      %883 = arith.trunci %879 : i128 to i64
      %884 = arith.trunci %881 : i128 to i64
      %882 = arith.divsi %883, %884 : i64
      %885 = arith.extsi %882 : i64 to i128
      llvm.store %885, %853 : i128, !llvm.ptr
      cf.br ^bb129
    ^bb131:
    %886 = llvm.mlir.addressof @str_1 : !llvm.ptr
    # String concatenation: !llvm.ptr + i64
    %888 = llvm.call @printf(%886, %887) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, !llvm.ptr) -> i32
    %890 = llvm.load %842 : !llvm.ptr -> !llvm.ptr
    func.call @free(%890) : (!llvm.ptr) -> ()
    func.return
  }
  func.func @main() -> i32 {
    %892 = arith.constant 50 : i32
    %893 = arith.constant 8 : i32
    %894 = arith.extsi %892 : i32 to i64
    %895 = arith.extsi %893 : i32 to i64
    %891 = func.call @calloc(%894, %895) : (i64, i64) -> !llvm.ptr
    %896 = llvm.mlir.addressof @g_windows : !llvm.ptr
    llvm.store %891, %896 : !llvm.ptr, !llvm.ptr
    %897 = arith.constant 0 : i32
    %898 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %899 = llvm.load %898 : !llvm.ptr -> !llvm.ptr
    %901 = arith.constant 0 : i32
    %902 = arith.constant 0 : i32
    %903 = arith.extsi %901 : i32 to i64
    %904 = arith.extsi %902 : i32 to i64
    %900 = func.call @widx(%903, %904) : (i64, i64) -> i64
    %905 = arith.extsi %897 : i32 to i64
    %906 = llvm.getelementptr %899[%900] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %905, %906 : i64, !llvm.ptr
    %907 = arith.constant 1 : i32
    %908 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %909 = llvm.load %908 : !llvm.ptr -> !llvm.ptr
    %911 = arith.constant 0 : i32
    %912 = arith.constant 1 : i32
    %913 = arith.extsi %911 : i32 to i64
    %914 = arith.extsi %912 : i32 to i64
    %910 = func.call @widx(%913, %914) : (i64, i64) -> i64
    %915 = arith.extsi %907 : i32 to i64
    %916 = llvm.getelementptr %909[%910] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %915, %916 : i64, !llvm.ptr
    %917 = arith.constant 2 : i32
    %918 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %919 = llvm.load %918 : !llvm.ptr -> !llvm.ptr
    %921 = arith.constant 0 : i32
    %922 = arith.constant 2 : i32
    %923 = arith.extsi %921 : i32 to i64
    %924 = arith.extsi %922 : i32 to i64
    %920 = func.call @widx(%923, %924) : (i64, i64) -> i64
    %925 = arith.extsi %917 : i32 to i64
    %926 = llvm.getelementptr %919[%920] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %925, %926 : i64, !llvm.ptr
    %927 = arith.constant 3 : i32
    %928 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %929 = llvm.load %928 : !llvm.ptr -> !llvm.ptr
    %931 = arith.constant 0 : i32
    %932 = arith.constant 3 : i32
    %933 = arith.extsi %931 : i32 to i64
    %934 = arith.extsi %932 : i32 to i64
    %930 = func.call @widx(%933, %934) : (i64, i64) -> i64
    %935 = arith.extsi %927 : i32 to i64
    %936 = llvm.getelementptr %929[%930] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %935, %936 : i64, !llvm.ptr
    %937 = arith.constant 4 : i32
    %938 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %939 = llvm.load %938 : !llvm.ptr -> !llvm.ptr
    %941 = arith.constant 0 : i32
    %942 = arith.constant 4 : i32
    %943 = arith.extsi %941 : i32 to i64
    %944 = arith.extsi %942 : i32 to i64
    %940 = func.call @widx(%943, %944) : (i64, i64) -> i64
    %945 = arith.extsi %937 : i32 to i64
    %946 = llvm.getelementptr %939[%940] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %945, %946 : i64, !llvm.ptr
    %947 = arith.constant 1 : i32
    %948 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %949 = llvm.load %948 : !llvm.ptr -> !llvm.ptr
    %951 = arith.constant 1 : i32
    %952 = arith.constant 0 : i32
    %953 = arith.extsi %951 : i32 to i64
    %954 = arith.extsi %952 : i32 to i64
    %950 = func.call @widx(%953, %954) : (i64, i64) -> i64
    %955 = arith.extsi %947 : i32 to i64
    %956 = llvm.getelementptr %949[%950] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %955, %956 : i64, !llvm.ptr
    %957 = arith.constant 2 : i32
    %958 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %959 = llvm.load %958 : !llvm.ptr -> !llvm.ptr
    %961 = arith.constant 1 : i32
    %962 = arith.constant 1 : i32
    %963 = arith.extsi %961 : i32 to i64
    %964 = arith.extsi %962 : i32 to i64
    %960 = func.call @widx(%963, %964) : (i64, i64) -> i64
    %965 = arith.extsi %957 : i32 to i64
    %966 = llvm.getelementptr %959[%960] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %965, %966 : i64, !llvm.ptr
    %967 = arith.constant 3 : i32
    %968 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %969 = llvm.load %968 : !llvm.ptr -> !llvm.ptr
    %971 = arith.constant 1 : i32
    %972 = arith.constant 2 : i32
    %973 = arith.extsi %971 : i32 to i64
    %974 = arith.extsi %972 : i32 to i64
    %970 = func.call @widx(%973, %974) : (i64, i64) -> i64
    %975 = arith.extsi %967 : i32 to i64
    %976 = llvm.getelementptr %969[%970] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %975, %976 : i64, !llvm.ptr
    %977 = arith.constant 4 : i32
    %978 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %979 = llvm.load %978 : !llvm.ptr -> !llvm.ptr
    %981 = arith.constant 1 : i32
    %982 = arith.constant 3 : i32
    %983 = arith.extsi %981 : i32 to i64
    %984 = arith.extsi %982 : i32 to i64
    %980 = func.call @widx(%983, %984) : (i64, i64) -> i64
    %985 = arith.extsi %977 : i32 to i64
    %986 = llvm.getelementptr %979[%980] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %985, %986 : i64, !llvm.ptr
    %987 = arith.constant 5 : i32
    %988 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %989 = llvm.load %988 : !llvm.ptr -> !llvm.ptr
    %991 = arith.constant 1 : i32
    %992 = arith.constant 4 : i32
    %993 = arith.extsi %991 : i32 to i64
    %994 = arith.extsi %992 : i32 to i64
    %990 = func.call @widx(%993, %994) : (i64, i64) -> i64
    %995 = arith.extsi %987 : i32 to i64
    %996 = llvm.getelementptr %989[%990] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %995, %996 : i64, !llvm.ptr
    %997 = arith.constant 2 : i32
    %998 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %999 = llvm.load %998 : !llvm.ptr -> !llvm.ptr
    %1001 = arith.constant 2 : i32
    %1002 = arith.constant 0 : i32
    %1003 = arith.extsi %1001 : i32 to i64
    %1004 = arith.extsi %1002 : i32 to i64
    %1000 = func.call @widx(%1003, %1004) : (i64, i64) -> i64
    %1005 = arith.extsi %997 : i32 to i64
    %1006 = llvm.getelementptr %999[%1000] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1005, %1006 : i64, !llvm.ptr
    %1007 = arith.constant 3 : i32
    %1008 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1009 = llvm.load %1008 : !llvm.ptr -> !llvm.ptr
    %1011 = arith.constant 2 : i32
    %1012 = arith.constant 1 : i32
    %1013 = arith.extsi %1011 : i32 to i64
    %1014 = arith.extsi %1012 : i32 to i64
    %1010 = func.call @widx(%1013, %1014) : (i64, i64) -> i64
    %1015 = arith.extsi %1007 : i32 to i64
    %1016 = llvm.getelementptr %1009[%1010] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1015, %1016 : i64, !llvm.ptr
    %1017 = arith.constant 4 : i32
    %1018 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1019 = llvm.load %1018 : !llvm.ptr -> !llvm.ptr
    %1021 = arith.constant 2 : i32
    %1022 = arith.constant 2 : i32
    %1023 = arith.extsi %1021 : i32 to i64
    %1024 = arith.extsi %1022 : i32 to i64
    %1020 = func.call @widx(%1023, %1024) : (i64, i64) -> i64
    %1025 = arith.extsi %1017 : i32 to i64
    %1026 = llvm.getelementptr %1019[%1020] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1025, %1026 : i64, !llvm.ptr
    %1027 = arith.constant 5 : i32
    %1028 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1029 = llvm.load %1028 : !llvm.ptr -> !llvm.ptr
    %1031 = arith.constant 2 : i32
    %1032 = arith.constant 3 : i32
    %1033 = arith.extsi %1031 : i32 to i64
    %1034 = arith.extsi %1032 : i32 to i64
    %1030 = func.call @widx(%1033, %1034) : (i64, i64) -> i64
    %1035 = arith.extsi %1027 : i32 to i64
    %1036 = llvm.getelementptr %1029[%1030] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1035, %1036 : i64, !llvm.ptr
    %1037 = arith.constant 6 : i32
    %1038 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1039 = llvm.load %1038 : !llvm.ptr -> !llvm.ptr
    %1041 = arith.constant 2 : i32
    %1042 = arith.constant 4 : i32
    %1043 = arith.extsi %1041 : i32 to i64
    %1044 = arith.extsi %1042 : i32 to i64
    %1040 = func.call @widx(%1043, %1044) : (i64, i64) -> i64
    %1045 = arith.extsi %1037 : i32 to i64
    %1046 = llvm.getelementptr %1039[%1040] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1045, %1046 : i64, !llvm.ptr
    %1047 = arith.constant 3 : i32
    %1048 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1049 = llvm.load %1048 : !llvm.ptr -> !llvm.ptr
    %1051 = arith.constant 3 : i32
    %1052 = arith.constant 0 : i32
    %1053 = arith.extsi %1051 : i32 to i64
    %1054 = arith.extsi %1052 : i32 to i64
    %1050 = func.call @widx(%1053, %1054) : (i64, i64) -> i64
    %1055 = arith.extsi %1047 : i32 to i64
    %1056 = llvm.getelementptr %1049[%1050] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1055, %1056 : i64, !llvm.ptr
    %1057 = arith.constant 4 : i32
    %1058 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1059 = llvm.load %1058 : !llvm.ptr -> !llvm.ptr
    %1061 = arith.constant 3 : i32
    %1062 = arith.constant 1 : i32
    %1063 = arith.extsi %1061 : i32 to i64
    %1064 = arith.extsi %1062 : i32 to i64
    %1060 = func.call @widx(%1063, %1064) : (i64, i64) -> i64
    %1065 = arith.extsi %1057 : i32 to i64
    %1066 = llvm.getelementptr %1059[%1060] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1065, %1066 : i64, !llvm.ptr
    %1067 = arith.constant 5 : i32
    %1068 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1069 = llvm.load %1068 : !llvm.ptr -> !llvm.ptr
    %1071 = arith.constant 3 : i32
    %1072 = arith.constant 2 : i32
    %1073 = arith.extsi %1071 : i32 to i64
    %1074 = arith.extsi %1072 : i32 to i64
    %1070 = func.call @widx(%1073, %1074) : (i64, i64) -> i64
    %1075 = arith.extsi %1067 : i32 to i64
    %1076 = llvm.getelementptr %1069[%1070] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1075, %1076 : i64, !llvm.ptr
    %1077 = arith.constant 6 : i32
    %1078 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1079 = llvm.load %1078 : !llvm.ptr -> !llvm.ptr
    %1081 = arith.constant 3 : i32
    %1082 = arith.constant 3 : i32
    %1083 = arith.extsi %1081 : i32 to i64
    %1084 = arith.extsi %1082 : i32 to i64
    %1080 = func.call @widx(%1083, %1084) : (i64, i64) -> i64
    %1085 = arith.extsi %1077 : i32 to i64
    %1086 = llvm.getelementptr %1079[%1080] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1085, %1086 : i64, !llvm.ptr
    %1087 = arith.constant 7 : i32
    %1088 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1089 = llvm.load %1088 : !llvm.ptr -> !llvm.ptr
    %1091 = arith.constant 3 : i32
    %1092 = arith.constant 4 : i32
    %1093 = arith.extsi %1091 : i32 to i64
    %1094 = arith.extsi %1092 : i32 to i64
    %1090 = func.call @widx(%1093, %1094) : (i64, i64) -> i64
    %1095 = arith.extsi %1087 : i32 to i64
    %1096 = llvm.getelementptr %1089[%1090] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1095, %1096 : i64, !llvm.ptr
    %1097 = arith.constant 4 : i32
    %1098 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1099 = llvm.load %1098 : !llvm.ptr -> !llvm.ptr
    %1101 = arith.constant 4 : i32
    %1102 = arith.constant 0 : i32
    %1103 = arith.extsi %1101 : i32 to i64
    %1104 = arith.extsi %1102 : i32 to i64
    %1100 = func.call @widx(%1103, %1104) : (i64, i64) -> i64
    %1105 = arith.extsi %1097 : i32 to i64
    %1106 = llvm.getelementptr %1099[%1100] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1105, %1106 : i64, !llvm.ptr
    %1107 = arith.constant 5 : i32
    %1108 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1109 = llvm.load %1108 : !llvm.ptr -> !llvm.ptr
    %1111 = arith.constant 4 : i32
    %1112 = arith.constant 1 : i32
    %1113 = arith.extsi %1111 : i32 to i64
    %1114 = arith.extsi %1112 : i32 to i64
    %1110 = func.call @widx(%1113, %1114) : (i64, i64) -> i64
    %1115 = arith.extsi %1107 : i32 to i64
    %1116 = llvm.getelementptr %1109[%1110] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1115, %1116 : i64, !llvm.ptr
    %1117 = arith.constant 6 : i32
    %1118 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1119 = llvm.load %1118 : !llvm.ptr -> !llvm.ptr
    %1121 = arith.constant 4 : i32
    %1122 = arith.constant 2 : i32
    %1123 = arith.extsi %1121 : i32 to i64
    %1124 = arith.extsi %1122 : i32 to i64
    %1120 = func.call @widx(%1123, %1124) : (i64, i64) -> i64
    %1125 = arith.extsi %1117 : i32 to i64
    %1126 = llvm.getelementptr %1119[%1120] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1125, %1126 : i64, !llvm.ptr
    %1127 = arith.constant 7 : i32
    %1128 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1129 = llvm.load %1128 : !llvm.ptr -> !llvm.ptr
    %1131 = arith.constant 4 : i32
    %1132 = arith.constant 3 : i32
    %1133 = arith.extsi %1131 : i32 to i64
    %1134 = arith.extsi %1132 : i32 to i64
    %1130 = func.call @widx(%1133, %1134) : (i64, i64) -> i64
    %1135 = arith.extsi %1127 : i32 to i64
    %1136 = llvm.getelementptr %1129[%1130] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1135, %1136 : i64, !llvm.ptr
    %1137 = arith.constant 8 : i32
    %1138 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1139 = llvm.load %1138 : !llvm.ptr -> !llvm.ptr
    %1141 = arith.constant 4 : i32
    %1142 = arith.constant 4 : i32
    %1143 = arith.extsi %1141 : i32 to i64
    %1144 = arith.extsi %1142 : i32 to i64
    %1140 = func.call @widx(%1143, %1144) : (i64, i64) -> i64
    %1145 = arith.extsi %1137 : i32 to i64
    %1146 = llvm.getelementptr %1139[%1140] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1145, %1146 : i64, !llvm.ptr
    %1147 = arith.constant 5 : i32
    %1148 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1149 = llvm.load %1148 : !llvm.ptr -> !llvm.ptr
    %1151 = arith.constant 5 : i32
    %1152 = arith.constant 0 : i32
    %1153 = arith.extsi %1151 : i32 to i64
    %1154 = arith.extsi %1152 : i32 to i64
    %1150 = func.call @widx(%1153, %1154) : (i64, i64) -> i64
    %1155 = arith.extsi %1147 : i32 to i64
    %1156 = llvm.getelementptr %1149[%1150] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1155, %1156 : i64, !llvm.ptr
    %1157 = arith.constant 6 : i32
    %1158 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1159 = llvm.load %1158 : !llvm.ptr -> !llvm.ptr
    %1161 = arith.constant 5 : i32
    %1162 = arith.constant 1 : i32
    %1163 = arith.extsi %1161 : i32 to i64
    %1164 = arith.extsi %1162 : i32 to i64
    %1160 = func.call @widx(%1163, %1164) : (i64, i64) -> i64
    %1165 = arith.extsi %1157 : i32 to i64
    %1166 = llvm.getelementptr %1159[%1160] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1165, %1166 : i64, !llvm.ptr
    %1167 = arith.constant 7 : i32
    %1168 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1169 = llvm.load %1168 : !llvm.ptr -> !llvm.ptr
    %1171 = arith.constant 5 : i32
    %1172 = arith.constant 2 : i32
    %1173 = arith.extsi %1171 : i32 to i64
    %1174 = arith.extsi %1172 : i32 to i64
    %1170 = func.call @widx(%1173, %1174) : (i64, i64) -> i64
    %1175 = arith.extsi %1167 : i32 to i64
    %1176 = llvm.getelementptr %1169[%1170] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1175, %1176 : i64, !llvm.ptr
    %1177 = arith.constant 8 : i32
    %1178 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1179 = llvm.load %1178 : !llvm.ptr -> !llvm.ptr
    %1181 = arith.constant 5 : i32
    %1182 = arith.constant 3 : i32
    %1183 = arith.extsi %1181 : i32 to i64
    %1184 = arith.extsi %1182 : i32 to i64
    %1180 = func.call @widx(%1183, %1184) : (i64, i64) -> i64
    %1185 = arith.extsi %1177 : i32 to i64
    %1186 = llvm.getelementptr %1179[%1180] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1185, %1186 : i64, !llvm.ptr
    %1187 = arith.constant 9 : i32
    %1188 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1189 = llvm.load %1188 : !llvm.ptr -> !llvm.ptr
    %1191 = arith.constant 5 : i32
    %1192 = arith.constant 4 : i32
    %1193 = arith.extsi %1191 : i32 to i64
    %1194 = arith.extsi %1192 : i32 to i64
    %1190 = func.call @widx(%1193, %1194) : (i64, i64) -> i64
    %1195 = arith.extsi %1187 : i32 to i64
    %1196 = llvm.getelementptr %1189[%1190] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1195, %1196 : i64, !llvm.ptr
    %1197 = arith.constant 6 : i32
    %1198 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1199 = llvm.load %1198 : !llvm.ptr -> !llvm.ptr
    %1201 = arith.constant 6 : i32
    %1202 = arith.constant 0 : i32
    %1203 = arith.extsi %1201 : i32 to i64
    %1204 = arith.extsi %1202 : i32 to i64
    %1200 = func.call @widx(%1203, %1204) : (i64, i64) -> i64
    %1205 = arith.extsi %1197 : i32 to i64
    %1206 = llvm.getelementptr %1199[%1200] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1205, %1206 : i64, !llvm.ptr
    %1207 = arith.constant 7 : i32
    %1208 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1209 = llvm.load %1208 : !llvm.ptr -> !llvm.ptr
    %1211 = arith.constant 6 : i32
    %1212 = arith.constant 1 : i32
    %1213 = arith.extsi %1211 : i32 to i64
    %1214 = arith.extsi %1212 : i32 to i64
    %1210 = func.call @widx(%1213, %1214) : (i64, i64) -> i64
    %1215 = arith.extsi %1207 : i32 to i64
    %1216 = llvm.getelementptr %1209[%1210] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1215, %1216 : i64, !llvm.ptr
    %1217 = arith.constant 8 : i32
    %1218 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1219 = llvm.load %1218 : !llvm.ptr -> !llvm.ptr
    %1221 = arith.constant 6 : i32
    %1222 = arith.constant 2 : i32
    %1223 = arith.extsi %1221 : i32 to i64
    %1224 = arith.extsi %1222 : i32 to i64
    %1220 = func.call @widx(%1223, %1224) : (i64, i64) -> i64
    %1225 = arith.extsi %1217 : i32 to i64
    %1226 = llvm.getelementptr %1219[%1220] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1225, %1226 : i64, !llvm.ptr
    %1227 = arith.constant 9 : i32
    %1228 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1229 = llvm.load %1228 : !llvm.ptr -> !llvm.ptr
    %1231 = arith.constant 6 : i32
    %1232 = arith.constant 3 : i32
    %1233 = arith.extsi %1231 : i32 to i64
    %1234 = arith.extsi %1232 : i32 to i64
    %1230 = func.call @widx(%1233, %1234) : (i64, i64) -> i64
    %1235 = arith.extsi %1227 : i32 to i64
    %1236 = llvm.getelementptr %1229[%1230] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1235, %1236 : i64, !llvm.ptr
    %1237 = arith.constant 10 : i32
    %1238 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1239 = llvm.load %1238 : !llvm.ptr -> !llvm.ptr
    %1241 = arith.constant 6 : i32
    %1242 = arith.constant 4 : i32
    %1243 = arith.extsi %1241 : i32 to i64
    %1244 = arith.extsi %1242 : i32 to i64
    %1240 = func.call @widx(%1243, %1244) : (i64, i64) -> i64
    %1245 = arith.extsi %1237 : i32 to i64
    %1246 = llvm.getelementptr %1239[%1240] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1245, %1246 : i64, !llvm.ptr
    %1247 = arith.constant 7 : i32
    %1248 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1249 = llvm.load %1248 : !llvm.ptr -> !llvm.ptr
    %1251 = arith.constant 7 : i32
    %1252 = arith.constant 0 : i32
    %1253 = arith.extsi %1251 : i32 to i64
    %1254 = arith.extsi %1252 : i32 to i64
    %1250 = func.call @widx(%1253, %1254) : (i64, i64) -> i64
    %1255 = arith.extsi %1247 : i32 to i64
    %1256 = llvm.getelementptr %1249[%1250] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1255, %1256 : i64, !llvm.ptr
    %1257 = arith.constant 8 : i32
    %1258 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1259 = llvm.load %1258 : !llvm.ptr -> !llvm.ptr
    %1261 = arith.constant 7 : i32
    %1262 = arith.constant 1 : i32
    %1263 = arith.extsi %1261 : i32 to i64
    %1264 = arith.extsi %1262 : i32 to i64
    %1260 = func.call @widx(%1263, %1264) : (i64, i64) -> i64
    %1265 = arith.extsi %1257 : i32 to i64
    %1266 = llvm.getelementptr %1259[%1260] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1265, %1266 : i64, !llvm.ptr
    %1267 = arith.constant 9 : i32
    %1268 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1269 = llvm.load %1268 : !llvm.ptr -> !llvm.ptr
    %1271 = arith.constant 7 : i32
    %1272 = arith.constant 2 : i32
    %1273 = arith.extsi %1271 : i32 to i64
    %1274 = arith.extsi %1272 : i32 to i64
    %1270 = func.call @widx(%1273, %1274) : (i64, i64) -> i64
    %1275 = arith.extsi %1267 : i32 to i64
    %1276 = llvm.getelementptr %1269[%1270] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1275, %1276 : i64, !llvm.ptr
    %1277 = arith.constant 10 : i32
    %1278 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1279 = llvm.load %1278 : !llvm.ptr -> !llvm.ptr
    %1281 = arith.constant 7 : i32
    %1282 = arith.constant 3 : i32
    %1283 = arith.extsi %1281 : i32 to i64
    %1284 = arith.extsi %1282 : i32 to i64
    %1280 = func.call @widx(%1283, %1284) : (i64, i64) -> i64
    %1285 = arith.extsi %1277 : i32 to i64
    %1286 = llvm.getelementptr %1279[%1280] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1285, %1286 : i64, !llvm.ptr
    %1287 = arith.constant 11 : i32
    %1288 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1289 = llvm.load %1288 : !llvm.ptr -> !llvm.ptr
    %1291 = arith.constant 7 : i32
    %1292 = arith.constant 4 : i32
    %1293 = arith.extsi %1291 : i32 to i64
    %1294 = arith.extsi %1292 : i32 to i64
    %1290 = func.call @widx(%1293, %1294) : (i64, i64) -> i64
    %1295 = arith.extsi %1287 : i32 to i64
    %1296 = llvm.getelementptr %1289[%1290] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1295, %1296 : i64, !llvm.ptr
    %1297 = arith.constant 8 : i32
    %1298 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1299 = llvm.load %1298 : !llvm.ptr -> !llvm.ptr
    %1301 = arith.constant 8 : i32
    %1302 = arith.constant 0 : i32
    %1303 = arith.extsi %1301 : i32 to i64
    %1304 = arith.extsi %1302 : i32 to i64
    %1300 = func.call @widx(%1303, %1304) : (i64, i64) -> i64
    %1305 = arith.extsi %1297 : i32 to i64
    %1306 = llvm.getelementptr %1299[%1300] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1305, %1306 : i64, !llvm.ptr
    %1307 = arith.constant 9 : i32
    %1308 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1309 = llvm.load %1308 : !llvm.ptr -> !llvm.ptr
    %1311 = arith.constant 8 : i32
    %1312 = arith.constant 1 : i32
    %1313 = arith.extsi %1311 : i32 to i64
    %1314 = arith.extsi %1312 : i32 to i64
    %1310 = func.call @widx(%1313, %1314) : (i64, i64) -> i64
    %1315 = arith.extsi %1307 : i32 to i64
    %1316 = llvm.getelementptr %1309[%1310] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1315, %1316 : i64, !llvm.ptr
    %1317 = arith.constant 10 : i32
    %1318 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1319 = llvm.load %1318 : !llvm.ptr -> !llvm.ptr
    %1321 = arith.constant 8 : i32
    %1322 = arith.constant 2 : i32
    %1323 = arith.extsi %1321 : i32 to i64
    %1324 = arith.extsi %1322 : i32 to i64
    %1320 = func.call @widx(%1323, %1324) : (i64, i64) -> i64
    %1325 = arith.extsi %1317 : i32 to i64
    %1326 = llvm.getelementptr %1319[%1320] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1325, %1326 : i64, !llvm.ptr
    %1327 = arith.constant 11 : i32
    %1328 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1329 = llvm.load %1328 : !llvm.ptr -> !llvm.ptr
    %1331 = arith.constant 8 : i32
    %1332 = arith.constant 3 : i32
    %1333 = arith.extsi %1331 : i32 to i64
    %1334 = arith.extsi %1332 : i32 to i64
    %1330 = func.call @widx(%1333, %1334) : (i64, i64) -> i64
    %1335 = arith.extsi %1327 : i32 to i64
    %1336 = llvm.getelementptr %1329[%1330] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1335, %1336 : i64, !llvm.ptr
    %1337 = arith.constant 12 : i32
    %1338 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1339 = llvm.load %1338 : !llvm.ptr -> !llvm.ptr
    %1341 = arith.constant 8 : i32
    %1342 = arith.constant 4 : i32
    %1343 = arith.extsi %1341 : i32 to i64
    %1344 = arith.extsi %1342 : i32 to i64
    %1340 = func.call @widx(%1343, %1344) : (i64, i64) -> i64
    %1345 = arith.extsi %1337 : i32 to i64
    %1346 = llvm.getelementptr %1339[%1340] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1345, %1346 : i64, !llvm.ptr
    %1347 = arith.constant 9 : i32
    %1348 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1349 = llvm.load %1348 : !llvm.ptr -> !llvm.ptr
    %1351 = arith.constant 9 : i32
    %1352 = arith.constant 0 : i32
    %1353 = arith.extsi %1351 : i32 to i64
    %1354 = arith.extsi %1352 : i32 to i64
    %1350 = func.call @widx(%1353, %1354) : (i64, i64) -> i64
    %1355 = arith.extsi %1347 : i32 to i64
    %1356 = llvm.getelementptr %1349[%1350] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1355, %1356 : i64, !llvm.ptr
    %1357 = arith.constant 10 : i32
    %1358 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1359 = llvm.load %1358 : !llvm.ptr -> !llvm.ptr
    %1361 = arith.constant 9 : i32
    %1362 = arith.constant 1 : i32
    %1363 = arith.extsi %1361 : i32 to i64
    %1364 = arith.extsi %1362 : i32 to i64
    %1360 = func.call @widx(%1363, %1364) : (i64, i64) -> i64
    %1365 = arith.extsi %1357 : i32 to i64
    %1366 = llvm.getelementptr %1359[%1360] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1365, %1366 : i64, !llvm.ptr
    %1367 = arith.constant 11 : i32
    %1368 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1369 = llvm.load %1368 : !llvm.ptr -> !llvm.ptr
    %1371 = arith.constant 9 : i32
    %1372 = arith.constant 2 : i32
    %1373 = arith.extsi %1371 : i32 to i64
    %1374 = arith.extsi %1372 : i32 to i64
    %1370 = func.call @widx(%1373, %1374) : (i64, i64) -> i64
    %1375 = arith.extsi %1367 : i32 to i64
    %1376 = llvm.getelementptr %1369[%1370] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1375, %1376 : i64, !llvm.ptr
    %1377 = arith.constant 12 : i32
    %1378 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1379 = llvm.load %1378 : !llvm.ptr -> !llvm.ptr
    %1381 = arith.constant 9 : i32
    %1382 = arith.constant 3 : i32
    %1383 = arith.extsi %1381 : i32 to i64
    %1384 = arith.extsi %1382 : i32 to i64
    %1380 = func.call @widx(%1383, %1384) : (i64, i64) -> i64
    %1385 = arith.extsi %1377 : i32 to i64
    %1386 = llvm.getelementptr %1379[%1380] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1385, %1386 : i64, !llvm.ptr
    %1387 = arith.constant 0 : i32
    %1388 = llvm.mlir.addressof @g_windows : !llvm.ptr
    %1389 = llvm.load %1388 : !llvm.ptr -> !llvm.ptr
    %1391 = arith.constant 9 : i32
    %1392 = arith.constant 4 : i32
    %1393 = arith.extsi %1391 : i32 to i64
    %1394 = arith.extsi %1392 : i32 to i64
    %1390 = func.call @widx(%1393, %1394) : (i64, i64) -> i64
    %1395 = arith.extsi %1387 : i32 to i64
    %1396 = llvm.getelementptr %1389[%1390] : (!llvm.ptr, i64) -> !llvm.ptr, i64
    llvm.store %1395, %1396 : i64, !llvm.ptr
    %1398 = arith.constant 100 : i32
    %1399 = arith.constant 8 : i32
    %1400 = arith.extsi %1398 : i32 to i64
    %1401 = arith.extsi %1399 : i32 to i64
    %1397 = func.call @calloc(%1400, %1401) : (i64, i64) -> !llvm.ptr
    %1402 = llvm.mlir.addressof @g_overlap : !llvm.ptr
    llvm.store %1397, %1402 : !llvm.ptr, !llvm.ptr
    %1404 = arith.constant 25 : i32
    %1405 = arith.constant 16 : i32
    %1406 = arith.extsi %1404 : i32 to i64
    %1407 = arith.extsi %1405 : i32 to i64
    %1403 = func.call @calloc(%1406, %1407) : (i64, i64) -> !llvm.ptr
    %1408 = llvm.mlir.addressof @g_perms : !llvm.ptr
    llvm.store %1403, %1408 : !llvm.ptr, !llvm.ptr
    %1410 = arith.constant 256 : i32
    %1411 = arith.constant 16 : i32
    %1412 = arith.extsi %1410 : i32 to i64
    %1413 = arith.extsi %1411 : i32 to i64
    %1409 = func.call @calloc(%1412, %1413) : (i64, i64) -> !llvm.ptr
    %1414 = llvm.mlir.addressof @g_coloring_dp : !llvm.ptr
    llvm.store %1409, %1414 : !llvm.ptr, !llvm.ptr
    %1416 = arith.constant 10 : i32
    %1417 = arith.constant 8 : i32
    %1418 = arith.extsi %1416 : i32 to i64
    %1419 = arith.extsi %1417 : i32 to i64
    %1415 = func.call @calloc(%1418, %1419) : (i64, i64) -> !llvm.ptr
    %1420 = llvm.mlir.addressof @bt_counts : !llvm.ptr
    llvm.store %1415, %1420 : !llvm.ptr, !llvm.ptr
    %1422 = arith.constant 13 : i32
    %1423 = arith.constant 8 : i32
    %1424 = arith.extsi %1422 : i32 to i64
    %1425 = arith.extsi %1423 : i32 to i64
    %1421 = func.call @calloc(%1424, %1425) : (i64, i64) -> !llvm.ptr
    %1426 = llvm.mlir.addressof @bt_coverage : !llvm.ptr
    llvm.store %1421, %1426 : !llvm.ptr, !llvm.ptr
    func.call @build_overlap() : () -> ()
    func.call @build_perms() : () -> ()
    %1430 = arith.constant 8 : i32
    %1431 = arith.extsi %1430 : i32 to i64
    %1429 = func.call @count_disjoint_straights(%1431) : (i64) -> i128
    func.call @print_u128(%1429) : (i128) -> ()
    %1433 = arith.constant 0 : i32
    func.return %1433 : i32
  }
}