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