Problem 480
The Last Question — lex rank/unrank over multiset words, length ≤ 15.
View problem on Project Euler
Performance comparison
| Metric | Our solution | Best known |
| Time complexity | O(n^2) | ? |
| Space complexity | O(n^2) | ? |
| Approach | Flow solution | Not curated |
| Verdict | Unknown |
Flow source
# Project Euler 480
# The Last Question — lex rank/unrank over multiset words, length ≤ 15.
extern {
function calloc(n: i64, size: i64) -> ptr<void>
function free(p: ptr<void>) -> void
}
let mut G_comb: ptr<i64> = null
let mut G_letters: ptr<i8> = null
let mut G_base: ptr<i32> = null
let mut G_nletters: i32 = 18
let mut G_maxlen: i32 = 15
# open-address memo for count_suffix: key = packed counts (low bits) + k
let mut G_memo_k: ptr<i64> = null
let mut G_memo_v: ptr<i128> = null
let mut G_memo_u: ptr<i8> = null
let mut G_memo_cap: i64 = 200003
function pack_counts(counts: ptr<i32>) -> i64 {
# each count fits in 3 bits (max 6); 18*3=54 bits
let mut key: i64 = 0
let mut i: i32 = 0
while i < G_nletters {
key = (key << 3) | (counts[i] as i64)
i = i + 1
}
return key
}
function count_suffix(counts: ptr<i32>, k: i32) -> i128 {
if k < 0 { return 0 }
let pkey: i64 = (pack_counts(counts) << 4) | (k as i64)
let mut slot: i64 = (pkey % G_memo_cap + G_memo_cap) % G_memo_cap
while G_memo_u[slot] != 0 {
if G_memo_k[slot] == pkey {
return G_memo_v[slot]
}
slot = slot + 1
if slot == G_memo_cap { slot = 0 }
}
let dp: ptr<i128> = calloc((k + 1) as i64, 16)
let newdp: ptr<i128> = calloc((k + 1) as i64, 16)
if dp == null || newdp == null { return 0 }
dp[0] = 1
let mut li: i32 = 0
while li < G_nletters {
let c: i32 = counts[li]
let mut l: i32 = 0
while l <= k {
newdp[l] = dp[l]
l = l + 1
}
l = 0
while l <= k {
let v: i128 = dp[l]
if v != 0 {
let mut mt: i32 = c
if k - l < mt { mt = k - l }
let mut t: i32 = 1
while t <= mt {
newdp[l + t] = newdp[l + t] + v * (G_comb[((l + t) * 16 + t) as i64] as i128)
t = t + 1
}
}
l = l + 1
}
l = 0
while l <= k {
dp[l] = newdp[l]
l = l + 1
}
li = li + 1
}
let mut total: i128 = 0
let mut i: i32 = 0
while i <= k {
total = total + dp[i]
i = i + 1
}
free(newdp)
free(dp)
G_memo_u[slot] = 1
G_memo_k[slot] = pkey
G_memo_v[slot] = total
return total
}
function P_word(word: ptr<i8>, wlen: i32) -> i128 {
let counts: ptr<i32> = calloc(G_nletters as i64, 4)
if counts == null { return 0 }
let mut i: i32 = 0
while i < G_nletters {
counts[i] = G_base[i]
i = i + 1
}
let mut rank: i128 = 0
let mut plen: i32 = 0
let mut pos: i32 = 0
while pos < wlen {
let ch: i8 = word[pos]
let mut j: i32 = 0
while j < G_nletters {
if G_letters[j] >= ch { break }
if counts[j] != 0 {
counts[j] = counts[j] - 1
rank = rank + count_suffix(counts, G_maxlen - (plen + 1))
counts[j] = counts[j] + 1
}
j = j + 1
}
# find index of ch
j = 0
while j < G_nletters {
if G_letters[j] == ch { break }
j = j + 1
}
counts[j] = counts[j] - 1
plen = plen + 1
if pos < wlen - 1 {
rank = rank + 1
}
pos = pos + 1
}
free(counts)
return rank + 1
}
function W_pos(p0: i128, out: ptr<i8>, outlen: ptr<i32>) -> void {
let counts: ptr<i32> = calloc(G_nletters as i64, 4)
if counts == null { return }
let mut i: i32 = 0
while i < G_nletters {
counts[i] = G_base[i]
i = i + 1
}
let mut p: i128 = p0
let mut plen: i32 = 0
while true {
if plen > 0 {
if p == 1 {
outlen[0] = plen
free(counts)
return
}
p = p - 1
}
let mut j: i32 = 0
while j < G_nletters {
if counts[j] != 0 {
counts[j] = counts[j] - 1
let cnt: i128 = count_suffix(counts, G_maxlen - (plen + 1))
if p > cnt {
p = p - cnt
counts[j] = counts[j] + 1
} else {
out[plen] = G_letters[j]
plen = plen + 1
break
}
}
j = j + 1
}
}
}
function main() -> i32 {
G_comb = calloc(16 * 16, 8)
G_letters = calloc(32, 1)
G_base = calloc(32, 4)
G_memo_k = calloc(G_memo_cap, 8)
G_memo_v = calloc(G_memo_cap, 16)
G_memo_u = calloc(G_memo_cap, 1)
if G_comb == null || G_letters == null || G_base == null { return 1 }
let letters: array<i8, 18> = [
97, 99, 100, 101, 102, 103, 104, 105, 108, 109, 110, 111, 114, 115, 116, 117, 119, 121
]
let bases: array<i32, 18> = [6, 1, 1, 6, 4, 1, 1, 5, 1, 1, 5, 1, 3, 4, 4, 2, 1, 1]
let mut i: i32 = 0
while i < 18 {
G_letters[i] = letters[i]
G_base[i] = bases[i]
i = i + 1
}
# combinatorics
let mut n: i32 = 0
while n <= 15 {
let mut k: i32 = 0
while k <= n {
if k == 0 || k == n {
G_comb[(n * 16 + k) as i64] = 1
} else {
G_comb[(n * 16 + k) as i64] = G_comb[((n - 1) * 16 + (k - 1)) as i64] + G_comb[((n - 1) * 16 + k) as i64]
}
k = k + 1
}
n = n + 1
}
let w1: array<i8, 16> = [108, 101, 103, 105, 111, 110, 97, 114, 121, 0, 0, 0, 0, 0, 0, 0]
let w2: array<i8, 16> = [99, 97, 108, 111, 114, 105, 109, 101, 116, 101, 114, 115, 0, 0, 0, 0]
let w3: array<i8, 16> = [97, 110, 110, 105, 104, 105, 108, 97, 116, 101, 0, 0, 0, 0, 0, 0]
let w4: array<i8, 16> = [111, 114, 99, 104, 101, 115, 116, 114, 97, 116, 101, 100, 0, 0, 0, 0]
let w5: array<i8, 16> = [102, 108, 117, 116, 116, 101, 114, 105, 110, 103, 0, 0, 0, 0, 0, 0]
let target: i128 = P_word(w1, 9) + P_word(w2, 12) - P_word(w3, 10) + P_word(w4, 12) - P_word(w5, 10)
let out: ptr<i8> = calloc(32, 1)
let outlen: ptr<i32> = calloc(1, 4)
if out == null || outlen == null { return 1 }
W_pos(target, out, outlen)
let mut j: i32 = 0
while j < outlen[0] {
printf("%c", out[j])
j = j + 1
}
printf("\n")
free(outlen)
free(out)
return 0
}
Generated C
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Flow runtime helpers */
typedef struct flow_temp_node { struct flow_temp_node* next; } flow_temp_node;
static flow_temp_node* flow_temp_head = NULL;
static int flow_temp_atexit_set = 0;
__attribute__((unused)) static void flow_temp_free_all(void) {
while (flow_temp_head) {
flow_temp_node* n = flow_temp_head;
flow_temp_head = n->next;
free(n);
}
}
__attribute__((unused)) static void* flow_temp_alloc(size_t nbytes) {
flow_temp_node* node = (flow_temp_node*)malloc(sizeof(flow_temp_node) + nbytes);
if (!node) return NULL;
node->next = flow_temp_head;
flow_temp_head = node;
if (!flow_temp_atexit_set) {
flow_temp_atexit_set = 1;
atexit(flow_temp_free_all);
}
return (void*)(node + 1);
}
#ifndef FLOW_DIAG
#define FLOW_DIAG(msg) fprintf(stderr, "%s", (msg))
#endif
#ifndef FLOW_LOG
#define FLOW_LOG(fmt, ...) printf(fmt, __VA_ARGS__)
#endif
#ifndef FLOW_LOG_EMPTY
#define FLOW_LOG_EMPTY(fmt) printf(fmt)
#endif
static char* flow_strcat(const char* a, const char* b) {
size_t la = strlen(a ? a : ""), lb = strlen(b ? b : "");
char* r = (char*)flow_temp_alloc(la + lb + 1);
if (!r) return NULL;
if (la) memcpy(r, a, la);
if (lb) memcpy(r + la, b, lb);
r[la + lb] = '\0';
return r;
}
#define __flow_in_arr(arr, val) __extension__ ({ \
int _found = 0; \
size_t _n = sizeof(arr)/sizeof((arr)[0]); \
for (size_t _i = 0; _i < _n; _i++) { \
if ((arr)[_i] == (val)) { _found = 1; break; } \
} _found; })
/* Unified fault handler (MISRA #279) — override with -DFLOW_FAULT_HANDLER=fn */
#ifndef FLOW_FAULT_HANDLER
__attribute__((unused)) static inline void flow_fault_handler(const char* msg) {
fprintf(stderr, "flow: %s\n", msg ? msg : "fault");
abort();
#if defined(__GNUC__) || defined(__clang__)
__builtin_unreachable();
#endif
}
#else
#define flow_fault_handler FLOW_FAULT_HANDLER
#endif
#define flow_div_by_zero_handler() flow_fault_handler("division by zero")
#define flow_shift_ub_handler() flow_fault_handler("invalid shift (amount out of range or left-shift of negative)")
#ifndef FLOW_CHECKED_DIV
#define FLOW_CHECKED_DIV(L, R) (((R) != 0) ? ((L) / (R)) : (flow_div_by_zero_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_MOD
#define FLOW_CHECKED_MOD(L, R) (((R) != 0) ? ((L) % (R)) : (flow_div_by_zero_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_SHL
#define FLOW_CHECKED_SHL(L, R) ((((R) >= 0) && ((unsigned long long)(R) < (sizeof(L) * 8ull)) && ((L) >= 0)) ? ((L) << (R)) : (flow_shift_ub_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_SHR
#define FLOW_CHECKED_SHR(L, R) ((((R) >= 0) && ((unsigned long long)(R) < (sizeof(L) * 8ull))) ? ((L) >> (R)) : (flow_shift_ub_handler(), (L) * 0))
#endif
#include <math.h>
void* _ui_state = NULL;
static inline float i32_to_f32(int32_t v) { return (float)v; }
/* Host stub for @gpu kernels (device codegen replaces this). */
static inline int32_t gpu_thread_id(void) { return 0; }
int64_t pack_counts_ptr_i32(int32_t* counts);
__int128 count_suffix_ptr_i32_i32(int32_t* counts, int32_t k);
__int128 P_word_ptr_i8_i32(int8_t* word, int32_t wlen);
void W_pos_i128_ptr_i8_ptr_i32(__int128 p0, int8_t* out, int32_t* outlen);
int32_t main(void);
/* Module statics */
static int64_t* G_comb = NULL;
static int8_t* G_letters = NULL;
static int32_t* G_base = NULL;
static int32_t G_nletters = 18;
static int32_t G_maxlen = 15;
static int64_t* G_memo_k = NULL;
static __int128* G_memo_v = NULL;
static int8_t* G_memo_u = NULL;
static int64_t G_memo_cap = 200003;
int64_t pack_counts_ptr_i32(int32_t* counts) {
int64_t key = 0;
int32_t i = 0;
while (i < G_nletters) {
key = (FLOW_CHECKED_SHL((key), (3)) | ((int64_t)(counts[i])));
i = (i + 1);
}
return key;
}
__int128 count_suffix_ptr_i32_i32(int32_t* counts, int32_t k) {
if (k < 0) {
return 0;
}
int64_t pkey = (FLOW_CHECKED_SHL((pack_counts_ptr_i32(counts)), (4)) | ((int64_t)(k)));
int64_t slot = FLOW_CHECKED_MOD(((FLOW_CHECKED_MOD((pkey), (G_memo_cap)) + G_memo_cap)), (G_memo_cap));
while (G_memo_u[slot] != 0) {
if (G_memo_k[slot] == pkey) {
return G_memo_v[slot];
}
slot = (slot + 1);
if (slot == G_memo_cap) {
slot = 0;
}
}
__int128* dp = (__int128*)(calloc(((int64_t)((k + 1))), 16));
__int128* newdp = (__int128*)(calloc(((int64_t)((k + 1))), 16));
if ((dp == NULL || newdp == NULL)) {
return 0;
}
dp[0] = 1;
int32_t li = 0;
while (li < G_nletters) {
int32_t c = counts[li];
int32_t l = 0;
while (l <= k) {
newdp[l] = dp[l];
l = (l + 1);
}
l = 0;
while (l <= k) {
__int128 v = dp[l];
if (v != 0) {
int32_t mt = c;
if ((k - l) < mt) {
mt = (k - l);
}
int32_t t = 1;
while (t <= mt) {
newdp[(l + t)] = (newdp[(l + t)] + (v * ((__int128)(G_comb[((int64_t)((((l + t) * 16) + t)))]))));
t = (t + 1);
}
}
l = (l + 1);
}
l = 0;
while (l <= k) {
dp[l] = newdp[l];
l = (l + 1);
}
li = (li + 1);
}
__int128 total = 0;
int32_t i = 0;
while (i <= k) {
total = (total + dp[i]);
i = (i + 1);
}
free(newdp);
free(dp);
G_memo_u[slot] = 1;
G_memo_k[slot] = pkey;
G_memo_v[slot] = total;
return total;
}
__int128 P_word_ptr_i8_i32(int8_t* word, int32_t wlen) {
int32_t* counts = (int32_t*)(calloc(((int64_t)(G_nletters)), 4));
if (counts == NULL) {
return 0;
}
int32_t i = 0;
while (i < G_nletters) {
counts[i] = G_base[i];
i = (i + 1);
}
__int128 rank = 0;
int32_t plen = 0;
int32_t pos = 0;
while (pos < wlen) {
int8_t ch = word[pos];
int32_t j = 0;
while (j < G_nletters) {
if (G_letters[j] >= ch) {
break;
}
if (counts[j] != 0) {
counts[j] = (counts[j] - 1);
rank = (rank + count_suffix_ptr_i32_i32(counts, (G_maxlen - (plen + 1))));
counts[j] = (counts[j] + 1);
}
j = (j + 1);
}
j = 0;
while (j < G_nletters) {
if (G_letters[j] == ch) {
break;
}
j = (j + 1);
}
counts[j] = (counts[j] - 1);
plen = (plen + 1);
if (pos < (wlen - 1)) {
rank = (rank + 1);
}
pos = (pos + 1);
}
free(counts);
return (rank + 1);
}
void W_pos_i128_ptr_i8_ptr_i32(__int128 p0, int8_t* out, int32_t* outlen) {
int32_t* counts = (int32_t*)(calloc(((int64_t)(G_nletters)), 4));
if (counts == NULL) {
return;
}
int32_t i = 0;
while (i < G_nletters) {
counts[i] = G_base[i];
i = (i + 1);
}
__int128 p = p0;
int32_t plen = 0;
while (1) {
if (plen > 0) {
if (p == 1) {
outlen[0] = plen;
free(counts);
return;
}
p = (p - 1);
}
int32_t j = 0;
while (j < G_nletters) {
if (counts[j] != 0) {
counts[j] = (counts[j] - 1);
__int128 cnt = count_suffix_ptr_i32_i32(counts, (G_maxlen - (plen + 1)));
if (p > cnt) {
p = (p - cnt);
counts[j] = (counts[j] + 1);
} else {
out[plen] = G_letters[j];
plen = (plen + 1);
break;
}
}
j = (j + 1);
}
}
}
int32_t main(void) {
G_comb = calloc((16 * 16), 8);
G_letters = calloc(32, 1);
G_base = calloc(32, 4);
G_memo_k = calloc(G_memo_cap, 8);
G_memo_v = calloc(G_memo_cap, 16);
G_memo_u = calloc(G_memo_cap, 1);
if (((G_comb == NULL || G_letters == NULL) || G_base == NULL)) {
return 1;
}
int8_t letters[18] = { 97, 99, 100, 101, 102, 103, 104, 105, 108, 109, 110, 111, 114, 115, 116, 117, 119, 121 };
int32_t bases[18] = { 6, 1, 1, 6, 4, 1, 1, 5, 1, 1, 5, 1, 3, 4, 4, 2, 1, 1 };
int32_t i = 0;
while (i < 18) {
G_letters[i] = (((unsigned)(i) < 18) ? letters[i] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(i), 18), flow_fault_handler("array index out of bounds"), letters[0]));
G_base[i] = (((unsigned)(i) < 18) ? bases[i] : (fprintf(stderr, "array index %d out of bounds (size %d)\n", (int)(i), 18), flow_fault_handler("array index out of bounds"), bases[0]));
i = (i + 1);
}
int32_t n = 0;
while (n <= 15) {
int32_t k = 0;
while (k <= n) {
if ((k == 0 || k == n)) {
G_comb[((int64_t)(((n * 16) + k)))] = 1;
} else {
G_comb[((int64_t)(((n * 16) + k)))] = (G_comb[((int64_t)((((n - 1) * 16) + (k - 1))))] + G_comb[((int64_t)((((n - 1) * 16) + k)))]);
}
k = (k + 1);
}
n = (n + 1);
}
int8_t w1[16] = { 108, 101, 103, 105, 111, 110, 97, 114, 121, 0, 0, 0, 0, 0, 0, 0 };
int8_t w2[16] = { 99, 97, 108, 111, 114, 105, 109, 101, 116, 101, 114, 115, 0, 0, 0, 0 };
int8_t w3[16] = { 97, 110, 110, 105, 104, 105, 108, 97, 116, 101, 0, 0, 0, 0, 0, 0 };
int8_t w4[16] = { 111, 114, 99, 104, 101, 115, 116, 114, 97, 116, 101, 100, 0, 0, 0, 0 };
int8_t w5[16] = { 102, 108, 117, 116, 116, 101, 114, 105, 110, 103, 0, 0, 0, 0, 0, 0 };
__int128 target = ((((P_word_ptr_i8_i32(w1, 9) + P_word_ptr_i8_i32(w2, 12)) - P_word_ptr_i8_i32(w3, 10)) + P_word_ptr_i8_i32(w4, 12)) - P_word_ptr_i8_i32(w5, 10));
int8_t* out = (int8_t*)(calloc(32, 1));
int32_t* outlen = (int32_t*)(calloc(1, 4));
if ((out == NULL || outlen == NULL)) {
return 1;
}
W_pos_i128_ptr_i8_ptr_i32(target, out, outlen);
int32_t j = 0;
while (j < outlen[0]) {
printf("%c", out[j]);
j = (j + 1);
}
printf("\n");
free(outlen);
free(out);
return 0;
}
Generated MLIR
module {
llvm.func @printf(!llvm.ptr, ...) -> i32
llvm.mlir.global internal constant @str_0("%c\00") {addr_space = 0 : i32} : !llvm.array<3 x i8>
llvm.mlir.global internal constant @str_1("\n\00") {addr_space = 0 : i32} : !llvm.array<2 x i8>
func.func private @calloc(i64, i64) -> !llvm.ptr
func.func private @free(!llvm.ptr) -> ()
// Module static: G_comb
llvm.mlir.global internal @G_comb() {addr_space = 0 : i32} : !llvm.ptr {
%0 = llvm.mlir.zero : !llvm.ptr
llvm.return %0 : !llvm.ptr
}
// Module static: G_letters
llvm.mlir.global internal @G_letters() {addr_space = 0 : i32} : !llvm.ptr {
%1 = llvm.mlir.zero : !llvm.ptr
llvm.return %1 : !llvm.ptr
}
// Module static: G_base
llvm.mlir.global internal @G_base() {addr_space = 0 : i32} : !llvm.ptr {
%2 = llvm.mlir.zero : !llvm.ptr
llvm.return %2 : !llvm.ptr
}
// Module static: G_nletters
llvm.mlir.global internal @G_nletters(18 : i32) : i32
// Module static: G_maxlen
llvm.mlir.global internal @G_maxlen(15 : i32) : i32
// Module static: G_memo_k
llvm.mlir.global internal @G_memo_k() {addr_space = 0 : i32} : !llvm.ptr {
%3 = llvm.mlir.zero : !llvm.ptr
llvm.return %3 : !llvm.ptr
}
// Module static: G_memo_v
llvm.mlir.global internal @G_memo_v() {addr_space = 0 : i32} : !llvm.ptr {
%4 = llvm.mlir.zero : !llvm.ptr
llvm.return %4 : !llvm.ptr
}
// Module static: G_memo_u
llvm.mlir.global internal @G_memo_u() {addr_space = 0 : i32} : !llvm.ptr {
%5 = llvm.mlir.zero : !llvm.ptr
llvm.return %5 : !llvm.ptr
}
// Module static: G_memo_cap
llvm.mlir.global internal @G_memo_cap(200003 : i64) : i64
func.func @pack_counts(%arg0: !llvm.ptr) -> i64 {
%6 = arith.constant 0 : i32
%7 = arith.extsi %6 : i32 to i64
%8 = llvm.mlir.constant(1 : i64) : i64
%9 = llvm.alloca %8 x i64 : (i64) -> !llvm.ptr
llvm.store %7, %9 : i64, !llvm.ptr
%10 = arith.constant 0 : i32
%11 = llvm.mlir.constant(1 : i64) : i64
%12 = llvm.alloca %11 x i32 : (i64) -> !llvm.ptr
llvm.store %10, %12 : i32, !llvm.ptr
cf.br ^bb0
^bb0:
%13 = llvm.load %12 : !llvm.ptr -> i32
%14 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%15 = llvm.load %14 : !llvm.ptr -> i32
%16 = arith.cmpi slt, %13, %15 : i32
cf.cond_br %16, ^bb1, ^bb2
^bb1:
%17 = llvm.load %9 : !llvm.ptr -> i64
%18 = arith.constant 3 : i32
%20 = arith.extsi %18 : i32 to i64
%19 = arith.shli %17, %20 : i64
%22 = llvm.load %12 : !llvm.ptr -> i32
%23 = arith.extsi %22 : i32 to i64
%24 = llvm.getelementptr %arg0[%23] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%21 = llvm.load %24 : !llvm.ptr -> i32
%25 = arith.extsi %21 : i32 to i64
%26 = arith.ori %19, %25 : i64
llvm.store %26, %9 : i64, !llvm.ptr
%27 = llvm.load %12 : !llvm.ptr -> i32
%28 = arith.constant 1 : i32
%29 = arith.addi %27, %28 : i32
llvm.store %29, %12 : i32, !llvm.ptr
cf.br ^bb0
^bb2:
%30 = llvm.load %9 : !llvm.ptr -> i64
func.return %30 : i64
}
func.func @count_suffix(%arg0: !llvm.ptr, %arg1: i32) -> i128 {
%31 = arith.constant 0 : i32
%32 = arith.cmpi slt, %arg1, %31 : i32
cf.cond_br %32, ^bb3, ^bb4
^bb3:
%33 = arith.constant 0 : i32
%34 = arith.extsi %33 : i32 to i128
func.return %34 : i128
^bb4:
cf.br ^bb5
^bb5:
%35 = func.call @pack_counts(%arg0) : (!llvm.ptr) -> i64
%36 = arith.constant 4 : i32
%38 = arith.extsi %36 : i32 to i64
%37 = arith.shli %35, %38 : i64
%39 = arith.extsi %arg1 : i32 to i64
%40 = arith.ori %37, %39 : i64
%41 = llvm.mlir.addressof @G_memo_cap : !llvm.ptr
%42 = llvm.load %41 : !llvm.ptr -> i64
%43 = arith.remsi %40, %42 : i64
%44 = llvm.mlir.addressof @G_memo_cap : !llvm.ptr
%45 = llvm.load %44 : !llvm.ptr -> i64
%46 = arith.addi %43, %45 : i64
%47 = llvm.mlir.addressof @G_memo_cap : !llvm.ptr
%48 = llvm.load %47 : !llvm.ptr -> i64
%49 = arith.remsi %46, %48 : i64
%50 = llvm.mlir.constant(1 : i64) : i64
%51 = llvm.alloca %50 x i64 : (i64) -> !llvm.ptr
llvm.store %49, %51 : i64, !llvm.ptr
cf.br ^bb6
^bb6:
%53 = llvm.mlir.addressof @G_memo_u : !llvm.ptr
%54 = llvm.load %53 : !llvm.ptr -> !llvm.ptr
%55 = llvm.load %51 : !llvm.ptr -> i64
%56 = llvm.getelementptr %54[%55] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%52 = llvm.load %56 : !llvm.ptr -> i8
%57 = arith.constant 0 : i32
%59 = arith.extsi %52 : i8 to i32
%58 = arith.cmpi ne, %59, %57 : i32
cf.cond_br %58, ^bb7, ^bb8
^bb7:
%61 = llvm.mlir.addressof @G_memo_k : !llvm.ptr
%62 = llvm.load %61 : !llvm.ptr -> !llvm.ptr
%63 = llvm.load %51 : !llvm.ptr -> i64
%64 = llvm.getelementptr %62[%63] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%60 = llvm.load %64 : !llvm.ptr -> i64
%65 = arith.cmpi eq, %60, %40 : i64
cf.cond_br %65, ^bb9, ^bb10
^bb9:
%67 = llvm.mlir.addressof @G_memo_v : !llvm.ptr
%68 = llvm.load %67 : !llvm.ptr -> !llvm.ptr
%69 = llvm.load %51 : !llvm.ptr -> i64
%70 = llvm.getelementptr %68[%69] : (!llvm.ptr, i64) -> !llvm.ptr, i128
%66 = llvm.load %70 : !llvm.ptr -> i128
func.return %66 : i128
^bb10:
cf.br ^bb11
^bb11:
%71 = llvm.load %51 : !llvm.ptr -> i64
%72 = arith.constant 1 : i32
%74 = arith.extsi %72 : i32 to i64
%73 = arith.addi %71, %74 : i64
llvm.store %73, %51 : i64, !llvm.ptr
%75 = llvm.load %51 : !llvm.ptr -> i64
%76 = llvm.mlir.addressof @G_memo_cap : !llvm.ptr
%77 = llvm.load %76 : !llvm.ptr -> i64
%78 = arith.cmpi eq, %75, %77 : i64
cf.cond_br %78, ^bb12, ^bb13
^bb12:
%79 = arith.constant 0 : i32
%80 = arith.extsi %79 : i32 to i64
llvm.store %80, %51 : i64, !llvm.ptr
cf.br ^bb14
^bb13:
cf.br ^bb14
^bb14:
cf.br ^bb6
^bb8:
%82 = arith.constant 1 : i32
%83 = arith.addi %arg1, %82 : i32
%84 = arith.extsi %83 : i32 to i64
%85 = arith.constant 16 : i32
%86 = arith.extsi %85 : i32 to i64
%81 = func.call @calloc(%84, %86) : (i64, i64) -> !llvm.ptr
%88 = arith.constant 1 : i32
%89 = arith.addi %arg1, %88 : i32
%90 = arith.extsi %89 : i32 to i64
%91 = arith.constant 16 : i32
%92 = arith.extsi %91 : i32 to i64
%87 = func.call @calloc(%90, %92) : (i64, i64) -> !llvm.ptr
%93 = llvm.mlir.zero : !llvm.ptr
%94 = llvm.icmp "eq" %81, %93 : !llvm.ptr
%95 = scf.if %94 -> (i1) {
%96 = arith.constant true
scf.yield %96 : i1
} else {
%97 = llvm.mlir.zero : !llvm.ptr
%98 = llvm.icmp "eq" %87, %97 : !llvm.ptr
scf.yield %98 : i1
}
cf.cond_br %95, ^bb15, ^bb16
^bb15:
%99 = arith.constant 0 : i32
%100 = arith.extsi %99 : i32 to i128
func.return %100 : i128
^bb16:
cf.br ^bb17
^bb17:
%101 = arith.constant 1 : i32
%102 = arith.constant 0 : i32
%103 = arith.extsi %101 : i32 to i128
%104 = arith.extsi %102 : i32 to i64
%105 = llvm.getelementptr %81[%104] : (!llvm.ptr, i64) -> !llvm.ptr, i128
llvm.store %103, %105 : i128, !llvm.ptr
%106 = arith.constant 0 : i32
%107 = llvm.mlir.constant(1 : i64) : i64
%108 = llvm.alloca %107 x i32 : (i64) -> !llvm.ptr
llvm.store %106, %108 : i32, !llvm.ptr
cf.br ^bb18
^bb18:
%109 = llvm.load %108 : !llvm.ptr -> i32
%110 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%111 = llvm.load %110 : !llvm.ptr -> i32
%112 = arith.cmpi slt, %109, %111 : i32
cf.cond_br %112, ^bb19, ^bb20
^bb19:
%114 = llvm.load %108 : !llvm.ptr -> i32
%115 = arith.extsi %114 : i32 to i64
%116 = llvm.getelementptr %arg0[%115] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%113 = llvm.load %116 : !llvm.ptr -> i32
%117 = arith.constant 0 : i32
%118 = llvm.mlir.constant(1 : i64) : i64
%119 = llvm.alloca %118 x i32 : (i64) -> !llvm.ptr
llvm.store %117, %119 : i32, !llvm.ptr
cf.br ^bb21
^bb21:
%120 = llvm.load %119 : !llvm.ptr -> i32
%121 = arith.cmpi sle, %120, %arg1 : i32
cf.cond_br %121, ^bb22, ^bb23
^bb22:
%123 = llvm.load %119 : !llvm.ptr -> i32
%124 = arith.extsi %123 : i32 to i64
%125 = llvm.getelementptr %81[%124] : (!llvm.ptr, i64) -> !llvm.ptr, i128
%122 = llvm.load %125 : !llvm.ptr -> i128
%126 = llvm.load %119 : !llvm.ptr -> i32
%127 = arith.extsi %126 : i32 to i64
%128 = llvm.getelementptr %87[%127] : (!llvm.ptr, i64) -> !llvm.ptr, i128
llvm.store %122, %128 : i128, !llvm.ptr
%129 = llvm.load %119 : !llvm.ptr -> i32
%130 = arith.constant 1 : i32
%131 = arith.addi %129, %130 : i32
llvm.store %131, %119 : i32, !llvm.ptr
cf.br ^bb21
^bb23:
%132 = arith.constant 0 : i32
llvm.store %132, %119 : i32, !llvm.ptr
cf.br ^bb24
^bb24:
%133 = llvm.load %119 : !llvm.ptr -> i32
%134 = arith.cmpi sle, %133, %arg1 : i32
cf.cond_br %134, ^bb25, ^bb26
^bb25:
%136 = llvm.load %119 : !llvm.ptr -> i32
%137 = arith.extsi %136 : i32 to i64
%138 = llvm.getelementptr %81[%137] : (!llvm.ptr, i64) -> !llvm.ptr, i128
%135 = llvm.load %138 : !llvm.ptr -> i128
%139 = arith.constant 0 : i32
%141 = arith.trunci %135 : i128 to i64
%142 = arith.extsi %139 : i32 to i64
%140 = arith.cmpi ne, %141, %142 : i64
cf.cond_br %140, ^bb27, ^bb28
^bb27:
%143 = llvm.mlir.constant(1 : i64) : i64
%144 = llvm.alloca %143 x i32 : (i64) -> !llvm.ptr
llvm.store %113, %144 : i32, !llvm.ptr
%145 = llvm.load %119 : !llvm.ptr -> i32
%146 = arith.subi %arg1, %145 : i32
%147 = llvm.load %144 : !llvm.ptr -> i32
%148 = arith.cmpi slt, %146, %147 : i32
cf.cond_br %148, ^bb30, ^bb31
^bb30:
%149 = llvm.load %119 : !llvm.ptr -> i32
%150 = arith.subi %arg1, %149 : i32
llvm.store %150, %144 : i32, !llvm.ptr
cf.br ^bb32
^bb31:
cf.br ^bb32
^bb32:
%151 = arith.constant 1 : i32
%152 = llvm.mlir.constant(1 : i64) : i64
%153 = llvm.alloca %152 x i32 : (i64) -> !llvm.ptr
llvm.store %151, %153 : i32, !llvm.ptr
cf.br ^bb33
^bb33:
%154 = llvm.load %153 : !llvm.ptr -> i32
%155 = llvm.load %144 : !llvm.ptr -> i32
%156 = arith.cmpi sle, %154, %155 : i32
cf.cond_br %156, ^bb34, ^bb35
^bb34:
%158 = llvm.load %119 : !llvm.ptr -> i32
%159 = llvm.load %153 : !llvm.ptr -> i32
%160 = arith.addi %158, %159 : i32
%161 = arith.extsi %160 : i32 to i64
%162 = llvm.getelementptr %87[%161] : (!llvm.ptr, i64) -> !llvm.ptr, i128
%157 = llvm.load %162 : !llvm.ptr -> i128
%164 = llvm.mlir.addressof @G_comb : !llvm.ptr
%165 = llvm.load %164 : !llvm.ptr -> !llvm.ptr
%166 = llvm.load %119 : !llvm.ptr -> i32
%167 = llvm.load %153 : !llvm.ptr -> i32
%168 = arith.addi %166, %167 : i32
%169 = arith.constant 16 : i32
%170 = arith.muli %168, %169 : i32
%171 = llvm.load %153 : !llvm.ptr -> i32
%172 = arith.addi %170, %171 : i32
%173 = arith.extsi %172 : i32 to i64
%174 = llvm.getelementptr %165[%173] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%163 = llvm.load %174 : !llvm.ptr -> i64
%175 = arith.extsi %163 : i64 to i128
%177 = arith.trunci %135 : i128 to i64
%178 = arith.trunci %175 : i128 to i64
%176 = arith.muli %177, %178 : i64
%180 = arith.trunci %157 : i128 to i64
%179 = arith.addi %180, %176 : i64
%181 = llvm.load %119 : !llvm.ptr -> i32
%182 = llvm.load %153 : !llvm.ptr -> i32
%183 = arith.addi %181, %182 : i32
%184 = arith.extsi %179 : i64 to i128
%185 = arith.extsi %183 : i32 to i64
%186 = llvm.getelementptr %87[%185] : (!llvm.ptr, i64) -> !llvm.ptr, i128
llvm.store %184, %186 : i128, !llvm.ptr
%187 = llvm.load %153 : !llvm.ptr -> i32
%188 = arith.constant 1 : i32
%189 = arith.addi %187, %188 : i32
llvm.store %189, %153 : i32, !llvm.ptr
cf.br ^bb33
^bb35:
cf.br ^bb29
^bb28:
cf.br ^bb29
^bb29:
%190 = llvm.load %119 : !llvm.ptr -> i32
%191 = arith.constant 1 : i32
%192 = arith.addi %190, %191 : i32
llvm.store %192, %119 : i32, !llvm.ptr
cf.br ^bb24
^bb26:
%193 = arith.constant 0 : i32
llvm.store %193, %119 : i32, !llvm.ptr
cf.br ^bb36
^bb36:
%194 = llvm.load %119 : !llvm.ptr -> i32
%195 = arith.cmpi sle, %194, %arg1 : i32
cf.cond_br %195, ^bb37, ^bb38
^bb37:
%197 = llvm.load %119 : !llvm.ptr -> i32
%198 = arith.extsi %197 : i32 to i64
%199 = llvm.getelementptr %87[%198] : (!llvm.ptr, i64) -> !llvm.ptr, i128
%196 = llvm.load %199 : !llvm.ptr -> i128
%200 = llvm.load %119 : !llvm.ptr -> i32
%201 = arith.extsi %200 : i32 to i64
%202 = llvm.getelementptr %81[%201] : (!llvm.ptr, i64) -> !llvm.ptr, i128
llvm.store %196, %202 : i128, !llvm.ptr
%203 = llvm.load %119 : !llvm.ptr -> i32
%204 = arith.constant 1 : i32
%205 = arith.addi %203, %204 : i32
llvm.store %205, %119 : i32, !llvm.ptr
cf.br ^bb36
^bb38:
%206 = llvm.load %108 : !llvm.ptr -> i32
%207 = arith.constant 1 : i32
%208 = arith.addi %206, %207 : i32
llvm.store %208, %108 : i32, !llvm.ptr
cf.br ^bb18
^bb20:
%209 = arith.constant 0 : i32
%210 = arith.extsi %209 : i32 to i128
%211 = llvm.mlir.constant(1 : i64) : i64
%212 = llvm.alloca %211 x i128 : (i64) -> !llvm.ptr
llvm.store %210, %212 : i128, !llvm.ptr
%213 = arith.constant 0 : i32
%214 = llvm.mlir.constant(1 : i64) : i64
%215 = llvm.alloca %214 x i32 : (i64) -> !llvm.ptr
llvm.store %213, %215 : i32, !llvm.ptr
cf.br ^bb39
^bb39:
%216 = llvm.load %215 : !llvm.ptr -> i32
%217 = arith.cmpi sle, %216, %arg1 : i32
cf.cond_br %217, ^bb40, ^bb41
^bb40:
%218 = llvm.load %212 : !llvm.ptr -> i128
%220 = llvm.load %215 : !llvm.ptr -> i32
%221 = arith.extsi %220 : i32 to i64
%222 = llvm.getelementptr %81[%221] : (!llvm.ptr, i64) -> !llvm.ptr, i128
%219 = llvm.load %222 : !llvm.ptr -> i128
%224 = arith.trunci %218 : i128 to i64
%225 = arith.trunci %219 : i128 to i64
%223 = arith.addi %224, %225 : i64
%226 = arith.extsi %223 : i64 to i128
llvm.store %226, %212 : i128, !llvm.ptr
%227 = llvm.load %215 : !llvm.ptr -> i32
%228 = arith.constant 1 : i32
%229 = arith.addi %227, %228 : i32
llvm.store %229, %215 : i32, !llvm.ptr
cf.br ^bb39
^bb41:
func.call @free(%87) : (!llvm.ptr) -> ()
func.call @free(%81) : (!llvm.ptr) -> ()
%232 = arith.constant 1 : i32
%233 = llvm.mlir.addressof @G_memo_u : !llvm.ptr
%234 = llvm.load %233 : !llvm.ptr -> !llvm.ptr
%235 = llvm.load %51 : !llvm.ptr -> i64
%236 = arith.trunci %232 : i32 to i8
%237 = llvm.getelementptr %234[%235] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %236, %237 : i8, !llvm.ptr
%238 = llvm.mlir.addressof @G_memo_k : !llvm.ptr
%239 = llvm.load %238 : !llvm.ptr -> !llvm.ptr
%240 = llvm.load %51 : !llvm.ptr -> i64
%241 = llvm.getelementptr %239[%240] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %40, %241 : i64, !llvm.ptr
%242 = llvm.load %212 : !llvm.ptr -> i128
%243 = llvm.mlir.addressof @G_memo_v : !llvm.ptr
%244 = llvm.load %243 : !llvm.ptr -> !llvm.ptr
%245 = llvm.load %51 : !llvm.ptr -> i64
%246 = llvm.getelementptr %244[%245] : (!llvm.ptr, i64) -> !llvm.ptr, i128
llvm.store %242, %246 : i128, !llvm.ptr
%247 = llvm.load %212 : !llvm.ptr -> i128
func.return %247 : i128
}
func.func @P_word(%arg0: !llvm.ptr, %arg1: i32) -> i128 {
%249 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%250 = llvm.load %249 : !llvm.ptr -> i32
%251 = arith.extsi %250 : i32 to i64
%252 = arith.constant 4 : i32
%253 = arith.extsi %252 : i32 to i64
%248 = func.call @calloc(%251, %253) : (i64, i64) -> !llvm.ptr
%254 = llvm.mlir.zero : !llvm.ptr
%255 = llvm.icmp "eq" %248, %254 : !llvm.ptr
cf.cond_br %255, ^bb42, ^bb43
^bb42:
%256 = arith.constant 0 : i32
%257 = arith.extsi %256 : i32 to i128
func.return %257 : i128
^bb43:
cf.br ^bb44
^bb44:
%258 = arith.constant 0 : i32
%259 = llvm.mlir.constant(1 : i64) : i64
%260 = llvm.alloca %259 x i32 : (i64) -> !llvm.ptr
llvm.store %258, %260 : i32, !llvm.ptr
cf.br ^bb45
^bb45:
%261 = llvm.load %260 : !llvm.ptr -> i32
%262 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%263 = llvm.load %262 : !llvm.ptr -> i32
%264 = arith.cmpi slt, %261, %263 : i32
cf.cond_br %264, ^bb46, ^bb47
^bb46:
%266 = llvm.mlir.addressof @G_base : !llvm.ptr
%267 = llvm.load %266 : !llvm.ptr -> !llvm.ptr
%268 = llvm.load %260 : !llvm.ptr -> i32
%269 = arith.extsi %268 : i32 to i64
%270 = llvm.getelementptr %267[%269] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%265 = llvm.load %270 : !llvm.ptr -> i32
%271 = llvm.load %260 : !llvm.ptr -> i32
%272 = arith.extsi %271 : i32 to i64
%273 = llvm.getelementptr %248[%272] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %265, %273 : i32, !llvm.ptr
%274 = llvm.load %260 : !llvm.ptr -> i32
%275 = arith.constant 1 : i32
%276 = arith.addi %274, %275 : i32
llvm.store %276, %260 : i32, !llvm.ptr
cf.br ^bb45
^bb47:
%277 = arith.constant 0 : i32
%278 = arith.extsi %277 : i32 to i128
%279 = llvm.mlir.constant(1 : i64) : i64
%280 = llvm.alloca %279 x i128 : (i64) -> !llvm.ptr
llvm.store %278, %280 : i128, !llvm.ptr
%281 = arith.constant 0 : i32
%282 = llvm.mlir.constant(1 : i64) : i64
%283 = llvm.alloca %282 x i32 : (i64) -> !llvm.ptr
llvm.store %281, %283 : i32, !llvm.ptr
%284 = arith.constant 0 : i32
%285 = llvm.mlir.constant(1 : i64) : i64
%286 = llvm.alloca %285 x i32 : (i64) -> !llvm.ptr
llvm.store %284, %286 : i32, !llvm.ptr
cf.br ^bb48
^bb48:
%287 = llvm.load %286 : !llvm.ptr -> i32
%288 = arith.cmpi slt, %287, %arg1 : i32
cf.cond_br %288, ^bb49, ^bb50
^bb49:
%290 = llvm.load %286 : !llvm.ptr -> i32
%291 = arith.extsi %290 : i32 to i64
%292 = llvm.getelementptr %arg0[%291] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%289 = llvm.load %292 : !llvm.ptr -> i8
%293 = arith.constant 0 : i32
%294 = llvm.mlir.constant(1 : i64) : i64
%295 = llvm.alloca %294 x i32 : (i64) -> !llvm.ptr
llvm.store %293, %295 : i32, !llvm.ptr
cf.br ^bb51
^bb51:
%296 = llvm.load %295 : !llvm.ptr -> i32
%297 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%298 = llvm.load %297 : !llvm.ptr -> i32
%299 = arith.cmpi slt, %296, %298 : i32
cf.cond_br %299, ^bb52, ^bb53
^bb52:
%301 = llvm.mlir.addressof @G_letters : !llvm.ptr
%302 = llvm.load %301 : !llvm.ptr -> !llvm.ptr
%303 = llvm.load %295 : !llvm.ptr -> i32
%304 = arith.extsi %303 : i32 to i64
%305 = llvm.getelementptr %302[%304] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%300 = llvm.load %305 : !llvm.ptr -> i8
%307 = arith.extsi %300 : i8 to i32
%308 = arith.extsi %289 : i8 to i32
%306 = arith.cmpi sge, %307, %308 : i32
cf.cond_br %306, ^bb54, ^bb55
^bb54:
cf.br ^bb53
^bb55:
cf.br ^bb56
^bb56:
%310 = llvm.load %295 : !llvm.ptr -> i32
%311 = arith.extsi %310 : i32 to i64
%312 = llvm.getelementptr %248[%311] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%309 = llvm.load %312 : !llvm.ptr -> i32
%313 = arith.constant 0 : i32
%314 = arith.cmpi ne, %309, %313 : i32
cf.cond_br %314, ^bb57, ^bb58
^bb57:
%316 = llvm.load %295 : !llvm.ptr -> i32
%317 = arith.extsi %316 : i32 to i64
%318 = llvm.getelementptr %248[%317] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%315 = llvm.load %318 : !llvm.ptr -> i32
%319 = arith.constant 1 : i32
%320 = arith.subi %315, %319 : i32
%321 = llvm.load %295 : !llvm.ptr -> i32
%322 = arith.extsi %321 : i32 to i64
%323 = llvm.getelementptr %248[%322] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %320, %323 : i32, !llvm.ptr
%324 = llvm.load %280 : !llvm.ptr -> i128
%326 = llvm.mlir.addressof @G_maxlen : !llvm.ptr
%327 = llvm.load %326 : !llvm.ptr -> i32
%328 = llvm.load %283 : !llvm.ptr -> i32
%329 = arith.constant 1 : i32
%330 = arith.addi %328, %329 : i32
%331 = arith.subi %327, %330 : i32
%325 = func.call @count_suffix(%248, %331) : (!llvm.ptr, i32) -> i128
%333 = arith.trunci %324 : i128 to i64
%334 = arith.trunci %325 : i128 to i64
%332 = arith.addi %333, %334 : i64
%335 = arith.extsi %332 : i64 to i128
llvm.store %335, %280 : i128, !llvm.ptr
%337 = llvm.load %295 : !llvm.ptr -> i32
%338 = arith.extsi %337 : i32 to i64
%339 = llvm.getelementptr %248[%338] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%336 = llvm.load %339 : !llvm.ptr -> i32
%340 = arith.constant 1 : i32
%341 = arith.addi %336, %340 : i32
%342 = llvm.load %295 : !llvm.ptr -> i32
%343 = arith.extsi %342 : i32 to i64
%344 = llvm.getelementptr %248[%343] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %341, %344 : i32, !llvm.ptr
cf.br ^bb59
^bb58:
cf.br ^bb59
^bb59:
%345 = llvm.load %295 : !llvm.ptr -> i32
%346 = arith.constant 1 : i32
%347 = arith.addi %345, %346 : i32
llvm.store %347, %295 : i32, !llvm.ptr
cf.br ^bb51
^bb53:
%348 = arith.constant 0 : i32
llvm.store %348, %295 : i32, !llvm.ptr
cf.br ^bb60
^bb60:
%349 = llvm.load %295 : !llvm.ptr -> i32
%350 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%351 = llvm.load %350 : !llvm.ptr -> i32
%352 = arith.cmpi slt, %349, %351 : i32
cf.cond_br %352, ^bb61, ^bb62
^bb61:
%354 = llvm.mlir.addressof @G_letters : !llvm.ptr
%355 = llvm.load %354 : !llvm.ptr -> !llvm.ptr
%356 = llvm.load %295 : !llvm.ptr -> i32
%357 = arith.extsi %356 : i32 to i64
%358 = llvm.getelementptr %355[%357] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%353 = llvm.load %358 : !llvm.ptr -> i8
%360 = arith.extsi %353 : i8 to i32
%361 = arith.extsi %289 : i8 to i32
%359 = arith.cmpi eq, %360, %361 : i32
cf.cond_br %359, ^bb63, ^bb64
^bb63:
cf.br ^bb62
^bb64:
cf.br ^bb65
^bb65:
%362 = llvm.load %295 : !llvm.ptr -> i32
%363 = arith.constant 1 : i32
%364 = arith.addi %362, %363 : i32
llvm.store %364, %295 : i32, !llvm.ptr
cf.br ^bb60
^bb62:
%366 = llvm.load %295 : !llvm.ptr -> i32
%367 = arith.extsi %366 : i32 to i64
%368 = llvm.getelementptr %248[%367] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%365 = llvm.load %368 : !llvm.ptr -> i32
%369 = arith.constant 1 : i32
%370 = arith.subi %365, %369 : i32
%371 = llvm.load %295 : !llvm.ptr -> i32
%372 = arith.extsi %371 : i32 to i64
%373 = llvm.getelementptr %248[%372] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %370, %373 : i32, !llvm.ptr
%374 = llvm.load %283 : !llvm.ptr -> i32
%375 = arith.constant 1 : i32
%376 = arith.addi %374, %375 : i32
llvm.store %376, %283 : i32, !llvm.ptr
%377 = llvm.load %286 : !llvm.ptr -> i32
%378 = arith.constant 1 : i32
%379 = arith.subi %arg1, %378 : i32
%380 = arith.cmpi slt, %377, %379 : i32
cf.cond_br %380, ^bb66, ^bb67
^bb66:
%381 = llvm.load %280 : !llvm.ptr -> i128
%382 = arith.constant 1 : i32
%384 = arith.trunci %381 : i128 to i64
%385 = arith.extsi %382 : i32 to i64
%383 = arith.addi %384, %385 : i64
%386 = arith.extsi %383 : i64 to i128
llvm.store %386, %280 : i128, !llvm.ptr
cf.br ^bb68
^bb67:
cf.br ^bb68
^bb68:
%387 = llvm.load %286 : !llvm.ptr -> i32
%388 = arith.constant 1 : i32
%389 = arith.addi %387, %388 : i32
llvm.store %389, %286 : i32, !llvm.ptr
cf.br ^bb48
^bb50:
func.call @free(%248) : (!llvm.ptr) -> ()
%391 = llvm.load %280 : !llvm.ptr -> i128
%392 = arith.constant 1 : i32
%394 = arith.trunci %391 : i128 to i64
%395 = arith.extsi %392 : i32 to i64
%393 = arith.addi %394, %395 : i64
%396 = arith.extsi %393 : i64 to i128
func.return %396 : i128
}
func.func @W_pos(%arg0: i128, %arg1: !llvm.ptr, %arg2: !llvm.ptr) -> () {
%398 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%399 = llvm.load %398 : !llvm.ptr -> i32
%400 = arith.extsi %399 : i32 to i64
%401 = arith.constant 4 : i32
%402 = arith.extsi %401 : i32 to i64
%397 = func.call @calloc(%400, %402) : (i64, i64) -> !llvm.ptr
%403 = llvm.mlir.zero : !llvm.ptr
%404 = llvm.icmp "eq" %397, %403 : !llvm.ptr
cf.cond_br %404, ^bb69, ^bb70
^bb69:
func.return
^bb70:
cf.br ^bb71
^bb71:
%405 = arith.constant 0 : i32
%406 = llvm.mlir.constant(1 : i64) : i64
%407 = llvm.alloca %406 x i32 : (i64) -> !llvm.ptr
llvm.store %405, %407 : i32, !llvm.ptr
cf.br ^bb72
^bb72:
%408 = llvm.load %407 : !llvm.ptr -> i32
%409 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%410 = llvm.load %409 : !llvm.ptr -> i32
%411 = arith.cmpi slt, %408, %410 : i32
cf.cond_br %411, ^bb73, ^bb74
^bb73:
%413 = llvm.mlir.addressof @G_base : !llvm.ptr
%414 = llvm.load %413 : !llvm.ptr -> !llvm.ptr
%415 = llvm.load %407 : !llvm.ptr -> i32
%416 = arith.extsi %415 : i32 to i64
%417 = llvm.getelementptr %414[%416] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%412 = llvm.load %417 : !llvm.ptr -> i32
%418 = llvm.load %407 : !llvm.ptr -> i32
%419 = arith.extsi %418 : i32 to i64
%420 = llvm.getelementptr %397[%419] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %412, %420 : i32, !llvm.ptr
%421 = llvm.load %407 : !llvm.ptr -> i32
%422 = arith.constant 1 : i32
%423 = arith.addi %421, %422 : i32
llvm.store %423, %407 : i32, !llvm.ptr
cf.br ^bb72
^bb74:
%424 = llvm.mlir.constant(1 : i64) : i64
%425 = llvm.alloca %424 x i128 : (i64) -> !llvm.ptr
llvm.store %arg0, %425 : i128, !llvm.ptr
%426 = arith.constant 0 : i32
%427 = llvm.mlir.constant(1 : i64) : i64
%428 = llvm.alloca %427 x i32 : (i64) -> !llvm.ptr
llvm.store %426, %428 : i32, !llvm.ptr
cf.br ^bb75
^bb75:
%429 = arith.constant 1 : i1
cf.cond_br %429, ^bb76, ^bb77
^bb76:
%430 = llvm.load %428 : !llvm.ptr -> i32
%431 = arith.constant 0 : i32
%432 = arith.cmpi sgt, %430, %431 : i32
cf.cond_br %432, ^bb78, ^bb79
^bb78:
%433 = llvm.load %425 : !llvm.ptr -> i128
%434 = arith.constant 1 : i32
%436 = arith.trunci %433 : i128 to i64
%437 = arith.extsi %434 : i32 to i64
%435 = arith.cmpi eq, %436, %437 : i64
cf.cond_br %435, ^bb81, ^bb82
^bb81:
%438 = llvm.load %428 : !llvm.ptr -> i32
%439 = arith.constant 0 : i32
%440 = arith.extsi %439 : i32 to i64
%441 = llvm.getelementptr %arg2[%440] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %438, %441 : i32, !llvm.ptr
func.call @free(%397) : (!llvm.ptr) -> ()
func.return
^bb82:
cf.br ^bb83
^bb83:
%443 = llvm.load %425 : !llvm.ptr -> i128
%444 = arith.constant 1 : i32
%446 = arith.trunci %443 : i128 to i64
%447 = arith.extsi %444 : i32 to i64
%445 = arith.subi %446, %447 : i64
%448 = arith.extsi %445 : i64 to i128
llvm.store %448, %425 : i128, !llvm.ptr
cf.br ^bb80
^bb79:
cf.br ^bb80
^bb80:
%449 = arith.constant 0 : i32
%450 = llvm.mlir.constant(1 : i64) : i64
%451 = llvm.alloca %450 x i32 : (i64) -> !llvm.ptr
llvm.store %449, %451 : i32, !llvm.ptr
cf.br ^bb84
^bb84:
%452 = llvm.load %451 : !llvm.ptr -> i32
%453 = llvm.mlir.addressof @G_nletters : !llvm.ptr
%454 = llvm.load %453 : !llvm.ptr -> i32
%455 = arith.cmpi slt, %452, %454 : i32
cf.cond_br %455, ^bb85, ^bb86
^bb85:
%457 = llvm.load %451 : !llvm.ptr -> i32
%458 = arith.extsi %457 : i32 to i64
%459 = llvm.getelementptr %397[%458] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%456 = llvm.load %459 : !llvm.ptr -> i32
%460 = arith.constant 0 : i32
%461 = arith.cmpi ne, %456, %460 : i32
cf.cond_br %461, ^bb87, ^bb88
^bb87:
%463 = llvm.load %451 : !llvm.ptr -> i32
%464 = arith.extsi %463 : i32 to i64
%465 = llvm.getelementptr %397[%464] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%462 = llvm.load %465 : !llvm.ptr -> i32
%466 = arith.constant 1 : i32
%467 = arith.subi %462, %466 : i32
%468 = llvm.load %451 : !llvm.ptr -> i32
%469 = arith.extsi %468 : i32 to i64
%470 = llvm.getelementptr %397[%469] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %467, %470 : i32, !llvm.ptr
%472 = llvm.mlir.addressof @G_maxlen : !llvm.ptr
%473 = llvm.load %472 : !llvm.ptr -> i32
%474 = llvm.load %428 : !llvm.ptr -> i32
%475 = arith.constant 1 : i32
%476 = arith.addi %474, %475 : i32
%477 = arith.subi %473, %476 : i32
%471 = func.call @count_suffix(%397, %477) : (!llvm.ptr, i32) -> i128
%478 = llvm.load %425 : !llvm.ptr -> i128
%480 = arith.trunci %478 : i128 to i64
%481 = arith.trunci %471 : i128 to i64
%479 = arith.cmpi sgt, %480, %481 : i64
cf.cond_br %479, ^bb90, ^bb91
^bb90:
%482 = llvm.load %425 : !llvm.ptr -> i128
%484 = arith.trunci %482 : i128 to i64
%485 = arith.trunci %471 : i128 to i64
%483 = arith.subi %484, %485 : i64
%486 = arith.extsi %483 : i64 to i128
llvm.store %486, %425 : i128, !llvm.ptr
%488 = llvm.load %451 : !llvm.ptr -> i32
%489 = arith.extsi %488 : i32 to i64
%490 = llvm.getelementptr %397[%489] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%487 = llvm.load %490 : !llvm.ptr -> i32
%491 = arith.constant 1 : i32
%492 = arith.addi %487, %491 : i32
%493 = llvm.load %451 : !llvm.ptr -> i32
%494 = arith.extsi %493 : i32 to i64
%495 = llvm.getelementptr %397[%494] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %492, %495 : i32, !llvm.ptr
cf.br ^bb92
^bb91:
%497 = llvm.mlir.addressof @G_letters : !llvm.ptr
%498 = llvm.load %497 : !llvm.ptr -> !llvm.ptr
%499 = llvm.load %451 : !llvm.ptr -> i32
%500 = arith.extsi %499 : i32 to i64
%501 = llvm.getelementptr %498[%500] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%496 = llvm.load %501 : !llvm.ptr -> i8
%502 = llvm.load %428 : !llvm.ptr -> i32
%503 = arith.extsi %502 : i32 to i64
%504 = llvm.getelementptr %arg1[%503] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %496, %504 : i8, !llvm.ptr
%505 = llvm.load %428 : !llvm.ptr -> i32
%506 = arith.constant 1 : i32
%507 = arith.addi %505, %506 : i32
llvm.store %507, %428 : i32, !llvm.ptr
cf.br ^bb86
^bb92:
cf.br ^bb89
^bb88:
cf.br ^bb89
^bb89:
%508 = llvm.load %451 : !llvm.ptr -> i32
%509 = arith.constant 1 : i32
%510 = arith.addi %508, %509 : i32
llvm.store %510, %451 : i32, !llvm.ptr
cf.br ^bb84
^bb86:
cf.br ^bb75
^bb77:
func.return
}
func.func @main() -> i32 {
%512 = arith.constant 16 : i32
%513 = arith.constant 16 : i32
%514 = arith.muli %512, %513 : i32
%515 = arith.constant 8 : i32
%516 = arith.extsi %514 : i32 to i64
%517 = arith.extsi %515 : i32 to i64
%511 = func.call @calloc(%516, %517) : (i64, i64) -> !llvm.ptr
%518 = llvm.mlir.addressof @G_comb : !llvm.ptr
llvm.store %511, %518 : !llvm.ptr, !llvm.ptr
%520 = arith.constant 32 : i32
%521 = arith.constant 1 : i32
%522 = arith.extsi %520 : i32 to i64
%523 = arith.extsi %521 : i32 to i64
%519 = func.call @calloc(%522, %523) : (i64, i64) -> !llvm.ptr
%524 = llvm.mlir.addressof @G_letters : !llvm.ptr
llvm.store %519, %524 : !llvm.ptr, !llvm.ptr
%526 = arith.constant 32 : i32
%527 = arith.constant 4 : i32
%528 = arith.extsi %526 : i32 to i64
%529 = arith.extsi %527 : i32 to i64
%525 = func.call @calloc(%528, %529) : (i64, i64) -> !llvm.ptr
%530 = llvm.mlir.addressof @G_base : !llvm.ptr
llvm.store %525, %530 : !llvm.ptr, !llvm.ptr
%532 = llvm.mlir.addressof @G_memo_cap : !llvm.ptr
%533 = llvm.load %532 : !llvm.ptr -> i64
%534 = arith.constant 8 : i32
%535 = arith.extsi %534 : i32 to i64
%531 = func.call @calloc(%533, %535) : (i64, i64) -> !llvm.ptr
%536 = llvm.mlir.addressof @G_memo_k : !llvm.ptr
llvm.store %531, %536 : !llvm.ptr, !llvm.ptr
%538 = llvm.mlir.addressof @G_memo_cap : !llvm.ptr
%539 = llvm.load %538 : !llvm.ptr -> i64
%540 = arith.constant 16 : i32
%541 = arith.extsi %540 : i32 to i64
%537 = func.call @calloc(%539, %541) : (i64, i64) -> !llvm.ptr
%542 = llvm.mlir.addressof @G_memo_v : !llvm.ptr
llvm.store %537, %542 : !llvm.ptr, !llvm.ptr
%544 = llvm.mlir.addressof @G_memo_cap : !llvm.ptr
%545 = llvm.load %544 : !llvm.ptr -> i64
%546 = arith.constant 1 : i32
%547 = arith.extsi %546 : i32 to i64
%543 = func.call @calloc(%545, %547) : (i64, i64) -> !llvm.ptr
%548 = llvm.mlir.addressof @G_memo_u : !llvm.ptr
llvm.store %543, %548 : !llvm.ptr, !llvm.ptr
%549 = llvm.mlir.addressof @G_comb : !llvm.ptr
%550 = llvm.load %549 : !llvm.ptr -> !llvm.ptr
%551 = llvm.mlir.zero : !llvm.ptr
%552 = llvm.icmp "eq" %550, %551 : !llvm.ptr
%553 = scf.if %552 -> (i1) {
%554 = arith.constant true
scf.yield %554 : i1
} else {
%555 = llvm.mlir.addressof @G_letters : !llvm.ptr
%556 = llvm.load %555 : !llvm.ptr -> !llvm.ptr
%557 = llvm.mlir.zero : !llvm.ptr
%558 = llvm.icmp "eq" %556, %557 : !llvm.ptr
scf.yield %558 : i1
}
%559 = scf.if %553 -> (i1) {
%560 = arith.constant true
scf.yield %560 : i1
} else {
%561 = llvm.mlir.addressof @G_base : !llvm.ptr
%562 = llvm.load %561 : !llvm.ptr -> !llvm.ptr
%563 = llvm.mlir.zero : !llvm.ptr
%564 = llvm.icmp "eq" %562, %563 : !llvm.ptr
scf.yield %564 : i1
}
cf.cond_br %559, ^bb93, ^bb94
^bb93:
%565 = arith.constant 1 : i32
func.return %565 : i32
^bb94:
cf.br ^bb95
^bb95:
%567 = arith.constant 97 : i32
%568 = arith.constant 99 : i32
%569 = arith.constant 100 : i32
%570 = arith.constant 101 : i32
%571 = arith.constant 102 : i32
%572 = arith.constant 103 : i32
%573 = arith.constant 104 : i32
%574 = arith.constant 105 : i32
%575 = arith.constant 108 : i32
%576 = arith.constant 109 : i32
%577 = arith.constant 110 : i32
%578 = arith.constant 111 : i32
%579 = arith.constant 114 : i32
%580 = arith.constant 115 : i32
%581 = arith.constant 116 : i32
%582 = arith.constant 117 : i32
%583 = arith.constant 119 : i32
%584 = arith.constant 121 : i32
%585 = llvm.mlir.constant(1 : i64) : i64
%586 = llvm.alloca %585 x !llvm.array<18 x i8> : (i64) -> !llvm.ptr
%587 = llvm.mlir.zero : !llvm.array<18 x i8>
llvm.store %587, %586 : !llvm.array<18 x i8>, !llvm.ptr
%588 = arith.trunci %567 : i32 to i8
%589 = arith.trunci %568 : i32 to i8
%590 = arith.trunci %569 : i32 to i8
%591 = arith.trunci %570 : i32 to i8
%592 = arith.trunci %571 : i32 to i8
%593 = arith.trunci %572 : i32 to i8
%594 = arith.trunci %573 : i32 to i8
%595 = arith.trunci %574 : i32 to i8
%596 = arith.trunci %575 : i32 to i8
%597 = arith.trunci %576 : i32 to i8
%598 = arith.trunci %577 : i32 to i8
%599 = arith.trunci %578 : i32 to i8
%600 = arith.trunci %579 : i32 to i8
%601 = arith.trunci %580 : i32 to i8
%602 = arith.trunci %581 : i32 to i8
%603 = arith.trunci %582 : i32 to i8
%604 = arith.trunci %583 : i32 to i8
%605 = arith.trunci %584 : i32 to i8
%606 = llvm.mlir.constant(0 : i64) : i64
%607 = llvm.getelementptr %586[0, %606] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %588, %607 : i8, !llvm.ptr
%608 = llvm.mlir.constant(1 : i64) : i64
%609 = llvm.getelementptr %586[0, %608] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %589, %609 : i8, !llvm.ptr
%610 = llvm.mlir.constant(2 : i64) : i64
%611 = llvm.getelementptr %586[0, %610] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %590, %611 : i8, !llvm.ptr
%612 = llvm.mlir.constant(3 : i64) : i64
%613 = llvm.getelementptr %586[0, %612] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %591, %613 : i8, !llvm.ptr
%614 = llvm.mlir.constant(4 : i64) : i64
%615 = llvm.getelementptr %586[0, %614] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %592, %615 : i8, !llvm.ptr
%616 = llvm.mlir.constant(5 : i64) : i64
%617 = llvm.getelementptr %586[0, %616] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %593, %617 : i8, !llvm.ptr
%618 = llvm.mlir.constant(6 : i64) : i64
%619 = llvm.getelementptr %586[0, %618] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %594, %619 : i8, !llvm.ptr
%620 = llvm.mlir.constant(7 : i64) : i64
%621 = llvm.getelementptr %586[0, %620] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %595, %621 : i8, !llvm.ptr
%622 = llvm.mlir.constant(8 : i64) : i64
%623 = llvm.getelementptr %586[0, %622] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %596, %623 : i8, !llvm.ptr
%624 = llvm.mlir.constant(9 : i64) : i64
%625 = llvm.getelementptr %586[0, %624] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %597, %625 : i8, !llvm.ptr
%626 = llvm.mlir.constant(10 : i64) : i64
%627 = llvm.getelementptr %586[0, %626] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %598, %627 : i8, !llvm.ptr
%628 = llvm.mlir.constant(11 : i64) : i64
%629 = llvm.getelementptr %586[0, %628] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %599, %629 : i8, !llvm.ptr
%630 = llvm.mlir.constant(12 : i64) : i64
%631 = llvm.getelementptr %586[0, %630] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %600, %631 : i8, !llvm.ptr
%632 = llvm.mlir.constant(13 : i64) : i64
%633 = llvm.getelementptr %586[0, %632] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %601, %633 : i8, !llvm.ptr
%634 = llvm.mlir.constant(14 : i64) : i64
%635 = llvm.getelementptr %586[0, %634] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %602, %635 : i8, !llvm.ptr
%636 = llvm.mlir.constant(15 : i64) : i64
%637 = llvm.getelementptr %586[0, %636] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %603, %637 : i8, !llvm.ptr
%638 = llvm.mlir.constant(16 : i64) : i64
%639 = llvm.getelementptr %586[0, %638] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %604, %639 : i8, !llvm.ptr
%640 = llvm.mlir.constant(17 : i64) : i64
%641 = llvm.getelementptr %586[0, %640] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
llvm.store %605, %641 : i8, !llvm.ptr
%643 = arith.constant 6 : i32
%644 = arith.constant 1 : i32
%645 = arith.constant 1 : i32
%646 = arith.constant 6 : i32
%647 = arith.constant 4 : i32
%648 = arith.constant 1 : i32
%649 = arith.constant 1 : i32
%650 = arith.constant 5 : i32
%651 = arith.constant 1 : i32
%652 = arith.constant 1 : i32
%653 = arith.constant 5 : i32
%654 = arith.constant 1 : i32
%655 = arith.constant 3 : i32
%656 = arith.constant 4 : i32
%657 = arith.constant 4 : i32
%658 = arith.constant 2 : i32
%659 = arith.constant 1 : i32
%660 = arith.constant 1 : i32
%661 = llvm.mlir.constant(1 : i64) : i64
%662 = llvm.alloca %661 x !llvm.array<18 x i32> : (i64) -> !llvm.ptr
%663 = llvm.mlir.zero : !llvm.array<18 x i32>
llvm.store %663, %662 : !llvm.array<18 x i32>, !llvm.ptr
%664 = llvm.mlir.constant(0 : i64) : i64
%665 = llvm.getelementptr %662[0, %664] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %643, %665 : i32, !llvm.ptr
%666 = llvm.mlir.constant(1 : i64) : i64
%667 = llvm.getelementptr %662[0, %666] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %644, %667 : i32, !llvm.ptr
%668 = llvm.mlir.constant(2 : i64) : i64
%669 = llvm.getelementptr %662[0, %668] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %645, %669 : i32, !llvm.ptr
%670 = llvm.mlir.constant(3 : i64) : i64
%671 = llvm.getelementptr %662[0, %670] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %646, %671 : i32, !llvm.ptr
%672 = llvm.mlir.constant(4 : i64) : i64
%673 = llvm.getelementptr %662[0, %672] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %647, %673 : i32, !llvm.ptr
%674 = llvm.mlir.constant(5 : i64) : i64
%675 = llvm.getelementptr %662[0, %674] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %648, %675 : i32, !llvm.ptr
%676 = llvm.mlir.constant(6 : i64) : i64
%677 = llvm.getelementptr %662[0, %676] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %649, %677 : i32, !llvm.ptr
%678 = llvm.mlir.constant(7 : i64) : i64
%679 = llvm.getelementptr %662[0, %678] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %650, %679 : i32, !llvm.ptr
%680 = llvm.mlir.constant(8 : i64) : i64
%681 = llvm.getelementptr %662[0, %680] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %651, %681 : i32, !llvm.ptr
%682 = llvm.mlir.constant(9 : i64) : i64
%683 = llvm.getelementptr %662[0, %682] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %652, %683 : i32, !llvm.ptr
%684 = llvm.mlir.constant(10 : i64) : i64
%685 = llvm.getelementptr %662[0, %684] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %653, %685 : i32, !llvm.ptr
%686 = llvm.mlir.constant(11 : i64) : i64
%687 = llvm.getelementptr %662[0, %686] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %654, %687 : i32, !llvm.ptr
%688 = llvm.mlir.constant(12 : i64) : i64
%689 = llvm.getelementptr %662[0, %688] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %655, %689 : i32, !llvm.ptr
%690 = llvm.mlir.constant(13 : i64) : i64
%691 = llvm.getelementptr %662[0, %690] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %656, %691 : i32, !llvm.ptr
%692 = llvm.mlir.constant(14 : i64) : i64
%693 = llvm.getelementptr %662[0, %692] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %657, %693 : i32, !llvm.ptr
%694 = llvm.mlir.constant(15 : i64) : i64
%695 = llvm.getelementptr %662[0, %694] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %658, %695 : i32, !llvm.ptr
%696 = llvm.mlir.constant(16 : i64) : i64
%697 = llvm.getelementptr %662[0, %696] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %659, %697 : i32, !llvm.ptr
%698 = llvm.mlir.constant(17 : i64) : i64
%699 = llvm.getelementptr %662[0, %698] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
llvm.store %660, %699 : i32, !llvm.ptr
%700 = arith.constant 0 : i32
%701 = llvm.mlir.constant(1 : i64) : i64
%702 = llvm.alloca %701 x i32 : (i64) -> !llvm.ptr
llvm.store %700, %702 : i32, !llvm.ptr
cf.br ^bb96
^bb96:
%703 = llvm.load %702 : !llvm.ptr -> i32
%704 = arith.constant 18 : i32
%705 = arith.cmpi slt, %703, %704 : i32
cf.cond_br %705, ^bb97, ^bb98
^bb97:
%707 = llvm.load %702 : !llvm.ptr -> i32
%708 = arith.extsi %707 : i32 to i64
%709 = llvm.getelementptr %586[0, %708] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i8>
%706 = llvm.load %709 : !llvm.ptr -> i8
%710 = llvm.mlir.addressof @G_letters : !llvm.ptr
%711 = llvm.load %710 : !llvm.ptr -> !llvm.ptr
%712 = llvm.load %702 : !llvm.ptr -> i32
%713 = arith.extsi %712 : i32 to i64
%714 = llvm.getelementptr %711[%713] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %706, %714 : i8, !llvm.ptr
%716 = llvm.load %702 : !llvm.ptr -> i32
%717 = arith.extsi %716 : i32 to i64
%718 = llvm.getelementptr %662[0, %717] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<18 x i32>
%715 = llvm.load %718 : !llvm.ptr -> i32
%719 = llvm.mlir.addressof @G_base : !llvm.ptr
%720 = llvm.load %719 : !llvm.ptr -> !llvm.ptr
%721 = llvm.load %702 : !llvm.ptr -> i32
%722 = arith.extsi %721 : i32 to i64
%723 = llvm.getelementptr %720[%722] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %715, %723 : i32, !llvm.ptr
%724 = llvm.load %702 : !llvm.ptr -> i32
%725 = arith.constant 1 : i32
%726 = arith.addi %724, %725 : i32
llvm.store %726, %702 : i32, !llvm.ptr
cf.br ^bb96
^bb98:
%727 = arith.constant 0 : i32
%728 = llvm.mlir.constant(1 : i64) : i64
%729 = llvm.alloca %728 x i32 : (i64) -> !llvm.ptr
llvm.store %727, %729 : i32, !llvm.ptr
cf.br ^bb99
^bb99:
%730 = llvm.load %729 : !llvm.ptr -> i32
%731 = arith.constant 15 : i32
%732 = arith.cmpi sle, %730, %731 : i32
cf.cond_br %732, ^bb100, ^bb101
^bb100:
%733 = arith.constant 0 : i32
%734 = llvm.mlir.constant(1 : i64) : i64
%735 = llvm.alloca %734 x i32 : (i64) -> !llvm.ptr
llvm.store %733, %735 : i32, !llvm.ptr
cf.br ^bb102
^bb102:
%736 = llvm.load %735 : !llvm.ptr -> i32
%737 = llvm.load %729 : !llvm.ptr -> i32
%738 = arith.cmpi sle, %736, %737 : i32
cf.cond_br %738, ^bb103, ^bb104
^bb103:
%739 = llvm.load %735 : !llvm.ptr -> i32
%740 = arith.constant 0 : i32
%741 = arith.cmpi eq, %739, %740 : i32
%742 = scf.if %741 -> (i1) {
%743 = arith.constant true
scf.yield %743 : i1
} else {
%744 = llvm.load %735 : !llvm.ptr -> i32
%745 = llvm.load %729 : !llvm.ptr -> i32
%746 = arith.cmpi eq, %744, %745 : i32
scf.yield %746 : i1
}
cf.cond_br %742, ^bb105, ^bb106
^bb105:
%747 = arith.constant 1 : i32
%748 = llvm.mlir.addressof @G_comb : !llvm.ptr
%749 = llvm.load %748 : !llvm.ptr -> !llvm.ptr
%750 = llvm.load %729 : !llvm.ptr -> i32
%751 = arith.constant 16 : i32
%752 = arith.muli %750, %751 : i32
%753 = llvm.load %735 : !llvm.ptr -> i32
%754 = arith.addi %752, %753 : i32
%755 = arith.extsi %754 : i32 to i64
%756 = arith.extsi %747 : i32 to i64
%757 = llvm.getelementptr %749[%755] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %756, %757 : i64, !llvm.ptr
cf.br ^bb107
^bb106:
%759 = llvm.mlir.addressof @G_comb : !llvm.ptr
%760 = llvm.load %759 : !llvm.ptr -> !llvm.ptr
%761 = llvm.load %729 : !llvm.ptr -> i32
%762 = arith.constant 1 : i32
%763 = arith.subi %761, %762 : i32
%764 = arith.constant 16 : i32
%765 = arith.muli %763, %764 : i32
%766 = llvm.load %735 : !llvm.ptr -> i32
%767 = arith.constant 1 : i32
%768 = arith.subi %766, %767 : i32
%769 = arith.addi %765, %768 : i32
%770 = arith.extsi %769 : i32 to i64
%771 = llvm.getelementptr %760[%770] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%758 = llvm.load %771 : !llvm.ptr -> i64
%773 = llvm.mlir.addressof @G_comb : !llvm.ptr
%774 = llvm.load %773 : !llvm.ptr -> !llvm.ptr
%775 = llvm.load %729 : !llvm.ptr -> i32
%776 = arith.constant 1 : i32
%777 = arith.subi %775, %776 : i32
%778 = arith.constant 16 : i32
%779 = arith.muli %777, %778 : i32
%780 = llvm.load %735 : !llvm.ptr -> i32
%781 = arith.addi %779, %780 : i32
%782 = arith.extsi %781 : i32 to i64
%783 = llvm.getelementptr %774[%782] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%772 = llvm.load %783 : !llvm.ptr -> i64
%784 = arith.addi %758, %772 : i64
%785 = llvm.mlir.addressof @G_comb : !llvm.ptr
%786 = llvm.load %785 : !llvm.ptr -> !llvm.ptr
%787 = llvm.load %729 : !llvm.ptr -> i32
%788 = arith.constant 16 : i32
%789 = arith.muli %787, %788 : i32
%790 = llvm.load %735 : !llvm.ptr -> i32
%791 = arith.addi %789, %790 : i32
%792 = arith.extsi %791 : i32 to i64
%793 = llvm.getelementptr %786[%792] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %784, %793 : i64, !llvm.ptr
cf.br ^bb107
^bb107:
%794 = llvm.load %735 : !llvm.ptr -> i32
%795 = arith.constant 1 : i32
%796 = arith.addi %794, %795 : i32
llvm.store %796, %735 : i32, !llvm.ptr
cf.br ^bb102
^bb104:
%797 = llvm.load %729 : !llvm.ptr -> i32
%798 = arith.constant 1 : i32
%799 = arith.addi %797, %798 : i32
llvm.store %799, %729 : i32, !llvm.ptr
cf.br ^bb99
^bb101:
%801 = arith.constant 108 : i32
%802 = arith.constant 101 : i32
%803 = arith.constant 103 : i32
%804 = arith.constant 105 : i32
%805 = arith.constant 111 : i32
%806 = arith.constant 110 : i32
%807 = arith.constant 97 : i32
%808 = arith.constant 114 : i32
%809 = arith.constant 121 : i32
%810 = arith.constant 0 : i32
%811 = arith.constant 0 : i32
%812 = arith.constant 0 : i32
%813 = arith.constant 0 : i32
%814 = arith.constant 0 : i32
%815 = arith.constant 0 : i32
%816 = arith.constant 0 : i32
%817 = llvm.mlir.constant(1 : i64) : i64
%818 = llvm.alloca %817 x !llvm.array<16 x i8> : (i64) -> !llvm.ptr
%819 = llvm.mlir.zero : !llvm.array<16 x i8>
llvm.store %819, %818 : !llvm.array<16 x i8>, !llvm.ptr
%820 = arith.trunci %801 : i32 to i8
%821 = arith.trunci %802 : i32 to i8
%822 = arith.trunci %803 : i32 to i8
%823 = arith.trunci %804 : i32 to i8
%824 = arith.trunci %805 : i32 to i8
%825 = arith.trunci %806 : i32 to i8
%826 = arith.trunci %807 : i32 to i8
%827 = arith.trunci %808 : i32 to i8
%828 = arith.trunci %809 : i32 to i8
%829 = arith.trunci %810 : i32 to i8
%830 = arith.trunci %811 : i32 to i8
%831 = arith.trunci %812 : i32 to i8
%832 = arith.trunci %813 : i32 to i8
%833 = arith.trunci %814 : i32 to i8
%834 = arith.trunci %815 : i32 to i8
%835 = arith.trunci %816 : i32 to i8
%836 = llvm.mlir.constant(0 : i64) : i64
%837 = llvm.getelementptr %818[0, %836] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %820, %837 : i8, !llvm.ptr
%838 = llvm.mlir.constant(1 : i64) : i64
%839 = llvm.getelementptr %818[0, %838] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %821, %839 : i8, !llvm.ptr
%840 = llvm.mlir.constant(2 : i64) : i64
%841 = llvm.getelementptr %818[0, %840] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %822, %841 : i8, !llvm.ptr
%842 = llvm.mlir.constant(3 : i64) : i64
%843 = llvm.getelementptr %818[0, %842] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %823, %843 : i8, !llvm.ptr
%844 = llvm.mlir.constant(4 : i64) : i64
%845 = llvm.getelementptr %818[0, %844] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %824, %845 : i8, !llvm.ptr
%846 = llvm.mlir.constant(5 : i64) : i64
%847 = llvm.getelementptr %818[0, %846] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %825, %847 : i8, !llvm.ptr
%848 = llvm.mlir.constant(6 : i64) : i64
%849 = llvm.getelementptr %818[0, %848] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %826, %849 : i8, !llvm.ptr
%850 = llvm.mlir.constant(7 : i64) : i64
%851 = llvm.getelementptr %818[0, %850] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %827, %851 : i8, !llvm.ptr
%852 = llvm.mlir.constant(8 : i64) : i64
%853 = llvm.getelementptr %818[0, %852] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %828, %853 : i8, !llvm.ptr
%854 = llvm.mlir.constant(9 : i64) : i64
%855 = llvm.getelementptr %818[0, %854] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %829, %855 : i8, !llvm.ptr
%856 = llvm.mlir.constant(10 : i64) : i64
%857 = llvm.getelementptr %818[0, %856] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %830, %857 : i8, !llvm.ptr
%858 = llvm.mlir.constant(11 : i64) : i64
%859 = llvm.getelementptr %818[0, %858] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %831, %859 : i8, !llvm.ptr
%860 = llvm.mlir.constant(12 : i64) : i64
%861 = llvm.getelementptr %818[0, %860] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %832, %861 : i8, !llvm.ptr
%862 = llvm.mlir.constant(13 : i64) : i64
%863 = llvm.getelementptr %818[0, %862] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %833, %863 : i8, !llvm.ptr
%864 = llvm.mlir.constant(14 : i64) : i64
%865 = llvm.getelementptr %818[0, %864] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %834, %865 : i8, !llvm.ptr
%866 = llvm.mlir.constant(15 : i64) : i64
%867 = llvm.getelementptr %818[0, %866] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %835, %867 : i8, !llvm.ptr
%869 = arith.constant 99 : i32
%870 = arith.constant 97 : i32
%871 = arith.constant 108 : i32
%872 = arith.constant 111 : i32
%873 = arith.constant 114 : i32
%874 = arith.constant 105 : i32
%875 = arith.constant 109 : i32
%876 = arith.constant 101 : i32
%877 = arith.constant 116 : i32
%878 = arith.constant 101 : i32
%879 = arith.constant 114 : i32
%880 = arith.constant 115 : i32
%881 = arith.constant 0 : i32
%882 = arith.constant 0 : i32
%883 = arith.constant 0 : i32
%884 = arith.constant 0 : i32
%885 = llvm.mlir.constant(1 : i64) : i64
%886 = llvm.alloca %885 x !llvm.array<16 x i8> : (i64) -> !llvm.ptr
%887 = llvm.mlir.zero : !llvm.array<16 x i8>
llvm.store %887, %886 : !llvm.array<16 x i8>, !llvm.ptr
%888 = arith.trunci %869 : i32 to i8
%889 = arith.trunci %870 : i32 to i8
%890 = arith.trunci %871 : i32 to i8
%891 = arith.trunci %872 : i32 to i8
%892 = arith.trunci %873 : i32 to i8
%893 = arith.trunci %874 : i32 to i8
%894 = arith.trunci %875 : i32 to i8
%895 = arith.trunci %876 : i32 to i8
%896 = arith.trunci %877 : i32 to i8
%897 = arith.trunci %878 : i32 to i8
%898 = arith.trunci %879 : i32 to i8
%899 = arith.trunci %880 : i32 to i8
%900 = arith.trunci %881 : i32 to i8
%901 = arith.trunci %882 : i32 to i8
%902 = arith.trunci %883 : i32 to i8
%903 = arith.trunci %884 : i32 to i8
%904 = llvm.mlir.constant(0 : i64) : i64
%905 = llvm.getelementptr %886[0, %904] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %888, %905 : i8, !llvm.ptr
%906 = llvm.mlir.constant(1 : i64) : i64
%907 = llvm.getelementptr %886[0, %906] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %889, %907 : i8, !llvm.ptr
%908 = llvm.mlir.constant(2 : i64) : i64
%909 = llvm.getelementptr %886[0, %908] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %890, %909 : i8, !llvm.ptr
%910 = llvm.mlir.constant(3 : i64) : i64
%911 = llvm.getelementptr %886[0, %910] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %891, %911 : i8, !llvm.ptr
%912 = llvm.mlir.constant(4 : i64) : i64
%913 = llvm.getelementptr %886[0, %912] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %892, %913 : i8, !llvm.ptr
%914 = llvm.mlir.constant(5 : i64) : i64
%915 = llvm.getelementptr %886[0, %914] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %893, %915 : i8, !llvm.ptr
%916 = llvm.mlir.constant(6 : i64) : i64
%917 = llvm.getelementptr %886[0, %916] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %894, %917 : i8, !llvm.ptr
%918 = llvm.mlir.constant(7 : i64) : i64
%919 = llvm.getelementptr %886[0, %918] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %895, %919 : i8, !llvm.ptr
%920 = llvm.mlir.constant(8 : i64) : i64
%921 = llvm.getelementptr %886[0, %920] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %896, %921 : i8, !llvm.ptr
%922 = llvm.mlir.constant(9 : i64) : i64
%923 = llvm.getelementptr %886[0, %922] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %897, %923 : i8, !llvm.ptr
%924 = llvm.mlir.constant(10 : i64) : i64
%925 = llvm.getelementptr %886[0, %924] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %898, %925 : i8, !llvm.ptr
%926 = llvm.mlir.constant(11 : i64) : i64
%927 = llvm.getelementptr %886[0, %926] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %899, %927 : i8, !llvm.ptr
%928 = llvm.mlir.constant(12 : i64) : i64
%929 = llvm.getelementptr %886[0, %928] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %900, %929 : i8, !llvm.ptr
%930 = llvm.mlir.constant(13 : i64) : i64
%931 = llvm.getelementptr %886[0, %930] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %901, %931 : i8, !llvm.ptr
%932 = llvm.mlir.constant(14 : i64) : i64
%933 = llvm.getelementptr %886[0, %932] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %902, %933 : i8, !llvm.ptr
%934 = llvm.mlir.constant(15 : i64) : i64
%935 = llvm.getelementptr %886[0, %934] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %903, %935 : i8, !llvm.ptr
%937 = arith.constant 97 : i32
%938 = arith.constant 110 : i32
%939 = arith.constant 110 : i32
%940 = arith.constant 105 : i32
%941 = arith.constant 104 : i32
%942 = arith.constant 105 : i32
%943 = arith.constant 108 : i32
%944 = arith.constant 97 : i32
%945 = arith.constant 116 : i32
%946 = arith.constant 101 : i32
%947 = arith.constant 0 : i32
%948 = arith.constant 0 : i32
%949 = arith.constant 0 : i32
%950 = arith.constant 0 : i32
%951 = arith.constant 0 : i32
%952 = arith.constant 0 : i32
%953 = llvm.mlir.constant(1 : i64) : i64
%954 = llvm.alloca %953 x !llvm.array<16 x i8> : (i64) -> !llvm.ptr
%955 = llvm.mlir.zero : !llvm.array<16 x i8>
llvm.store %955, %954 : !llvm.array<16 x i8>, !llvm.ptr
%956 = arith.trunci %937 : i32 to i8
%957 = arith.trunci %938 : i32 to i8
%958 = arith.trunci %939 : i32 to i8
%959 = arith.trunci %940 : i32 to i8
%960 = arith.trunci %941 : i32 to i8
%961 = arith.trunci %942 : i32 to i8
%962 = arith.trunci %943 : i32 to i8
%963 = arith.trunci %944 : i32 to i8
%964 = arith.trunci %945 : i32 to i8
%965 = arith.trunci %946 : i32 to i8
%966 = arith.trunci %947 : i32 to i8
%967 = arith.trunci %948 : i32 to i8
%968 = arith.trunci %949 : i32 to i8
%969 = arith.trunci %950 : i32 to i8
%970 = arith.trunci %951 : i32 to i8
%971 = arith.trunci %952 : i32 to i8
%972 = llvm.mlir.constant(0 : i64) : i64
%973 = llvm.getelementptr %954[0, %972] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %956, %973 : i8, !llvm.ptr
%974 = llvm.mlir.constant(1 : i64) : i64
%975 = llvm.getelementptr %954[0, %974] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %957, %975 : i8, !llvm.ptr
%976 = llvm.mlir.constant(2 : i64) : i64
%977 = llvm.getelementptr %954[0, %976] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %958, %977 : i8, !llvm.ptr
%978 = llvm.mlir.constant(3 : i64) : i64
%979 = llvm.getelementptr %954[0, %978] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %959, %979 : i8, !llvm.ptr
%980 = llvm.mlir.constant(4 : i64) : i64
%981 = llvm.getelementptr %954[0, %980] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %960, %981 : i8, !llvm.ptr
%982 = llvm.mlir.constant(5 : i64) : i64
%983 = llvm.getelementptr %954[0, %982] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %961, %983 : i8, !llvm.ptr
%984 = llvm.mlir.constant(6 : i64) : i64
%985 = llvm.getelementptr %954[0, %984] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %962, %985 : i8, !llvm.ptr
%986 = llvm.mlir.constant(7 : i64) : i64
%987 = llvm.getelementptr %954[0, %986] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %963, %987 : i8, !llvm.ptr
%988 = llvm.mlir.constant(8 : i64) : i64
%989 = llvm.getelementptr %954[0, %988] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %964, %989 : i8, !llvm.ptr
%990 = llvm.mlir.constant(9 : i64) : i64
%991 = llvm.getelementptr %954[0, %990] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %965, %991 : i8, !llvm.ptr
%992 = llvm.mlir.constant(10 : i64) : i64
%993 = llvm.getelementptr %954[0, %992] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %966, %993 : i8, !llvm.ptr
%994 = llvm.mlir.constant(11 : i64) : i64
%995 = llvm.getelementptr %954[0, %994] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %967, %995 : i8, !llvm.ptr
%996 = llvm.mlir.constant(12 : i64) : i64
%997 = llvm.getelementptr %954[0, %996] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %968, %997 : i8, !llvm.ptr
%998 = llvm.mlir.constant(13 : i64) : i64
%999 = llvm.getelementptr %954[0, %998] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %969, %999 : i8, !llvm.ptr
%1000 = llvm.mlir.constant(14 : i64) : i64
%1001 = llvm.getelementptr %954[0, %1000] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %970, %1001 : i8, !llvm.ptr
%1002 = llvm.mlir.constant(15 : i64) : i64
%1003 = llvm.getelementptr %954[0, %1002] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %971, %1003 : i8, !llvm.ptr
%1005 = arith.constant 111 : i32
%1006 = arith.constant 114 : i32
%1007 = arith.constant 99 : i32
%1008 = arith.constant 104 : i32
%1009 = arith.constant 101 : i32
%1010 = arith.constant 115 : i32
%1011 = arith.constant 116 : i32
%1012 = arith.constant 114 : i32
%1013 = arith.constant 97 : i32
%1014 = arith.constant 116 : i32
%1015 = arith.constant 101 : i32
%1016 = arith.constant 100 : i32
%1017 = arith.constant 0 : i32
%1018 = arith.constant 0 : i32
%1019 = arith.constant 0 : i32
%1020 = arith.constant 0 : i32
%1021 = llvm.mlir.constant(1 : i64) : i64
%1022 = llvm.alloca %1021 x !llvm.array<16 x i8> : (i64) -> !llvm.ptr
%1023 = llvm.mlir.zero : !llvm.array<16 x i8>
llvm.store %1023, %1022 : !llvm.array<16 x i8>, !llvm.ptr
%1024 = arith.trunci %1005 : i32 to i8
%1025 = arith.trunci %1006 : i32 to i8
%1026 = arith.trunci %1007 : i32 to i8
%1027 = arith.trunci %1008 : i32 to i8
%1028 = arith.trunci %1009 : i32 to i8
%1029 = arith.trunci %1010 : i32 to i8
%1030 = arith.trunci %1011 : i32 to i8
%1031 = arith.trunci %1012 : i32 to i8
%1032 = arith.trunci %1013 : i32 to i8
%1033 = arith.trunci %1014 : i32 to i8
%1034 = arith.trunci %1015 : i32 to i8
%1035 = arith.trunci %1016 : i32 to i8
%1036 = arith.trunci %1017 : i32 to i8
%1037 = arith.trunci %1018 : i32 to i8
%1038 = arith.trunci %1019 : i32 to i8
%1039 = arith.trunci %1020 : i32 to i8
%1040 = llvm.mlir.constant(0 : i64) : i64
%1041 = llvm.getelementptr %1022[0, %1040] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1024, %1041 : i8, !llvm.ptr
%1042 = llvm.mlir.constant(1 : i64) : i64
%1043 = llvm.getelementptr %1022[0, %1042] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1025, %1043 : i8, !llvm.ptr
%1044 = llvm.mlir.constant(2 : i64) : i64
%1045 = llvm.getelementptr %1022[0, %1044] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1026, %1045 : i8, !llvm.ptr
%1046 = llvm.mlir.constant(3 : i64) : i64
%1047 = llvm.getelementptr %1022[0, %1046] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1027, %1047 : i8, !llvm.ptr
%1048 = llvm.mlir.constant(4 : i64) : i64
%1049 = llvm.getelementptr %1022[0, %1048] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1028, %1049 : i8, !llvm.ptr
%1050 = llvm.mlir.constant(5 : i64) : i64
%1051 = llvm.getelementptr %1022[0, %1050] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1029, %1051 : i8, !llvm.ptr
%1052 = llvm.mlir.constant(6 : i64) : i64
%1053 = llvm.getelementptr %1022[0, %1052] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1030, %1053 : i8, !llvm.ptr
%1054 = llvm.mlir.constant(7 : i64) : i64
%1055 = llvm.getelementptr %1022[0, %1054] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1031, %1055 : i8, !llvm.ptr
%1056 = llvm.mlir.constant(8 : i64) : i64
%1057 = llvm.getelementptr %1022[0, %1056] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1032, %1057 : i8, !llvm.ptr
%1058 = llvm.mlir.constant(9 : i64) : i64
%1059 = llvm.getelementptr %1022[0, %1058] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1033, %1059 : i8, !llvm.ptr
%1060 = llvm.mlir.constant(10 : i64) : i64
%1061 = llvm.getelementptr %1022[0, %1060] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1034, %1061 : i8, !llvm.ptr
%1062 = llvm.mlir.constant(11 : i64) : i64
%1063 = llvm.getelementptr %1022[0, %1062] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1035, %1063 : i8, !llvm.ptr
%1064 = llvm.mlir.constant(12 : i64) : i64
%1065 = llvm.getelementptr %1022[0, %1064] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1036, %1065 : i8, !llvm.ptr
%1066 = llvm.mlir.constant(13 : i64) : i64
%1067 = llvm.getelementptr %1022[0, %1066] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1037, %1067 : i8, !llvm.ptr
%1068 = llvm.mlir.constant(14 : i64) : i64
%1069 = llvm.getelementptr %1022[0, %1068] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1038, %1069 : i8, !llvm.ptr
%1070 = llvm.mlir.constant(15 : i64) : i64
%1071 = llvm.getelementptr %1022[0, %1070] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1039, %1071 : i8, !llvm.ptr
%1073 = arith.constant 102 : i32
%1074 = arith.constant 108 : i32
%1075 = arith.constant 117 : i32
%1076 = arith.constant 116 : i32
%1077 = arith.constant 116 : i32
%1078 = arith.constant 101 : i32
%1079 = arith.constant 114 : i32
%1080 = arith.constant 105 : i32
%1081 = arith.constant 110 : i32
%1082 = arith.constant 103 : i32
%1083 = arith.constant 0 : i32
%1084 = arith.constant 0 : i32
%1085 = arith.constant 0 : i32
%1086 = arith.constant 0 : i32
%1087 = arith.constant 0 : i32
%1088 = arith.constant 0 : i32
%1089 = llvm.mlir.constant(1 : i64) : i64
%1090 = llvm.alloca %1089 x !llvm.array<16 x i8> : (i64) -> !llvm.ptr
%1091 = llvm.mlir.zero : !llvm.array<16 x i8>
llvm.store %1091, %1090 : !llvm.array<16 x i8>, !llvm.ptr
%1092 = arith.trunci %1073 : i32 to i8
%1093 = arith.trunci %1074 : i32 to i8
%1094 = arith.trunci %1075 : i32 to i8
%1095 = arith.trunci %1076 : i32 to i8
%1096 = arith.trunci %1077 : i32 to i8
%1097 = arith.trunci %1078 : i32 to i8
%1098 = arith.trunci %1079 : i32 to i8
%1099 = arith.trunci %1080 : i32 to i8
%1100 = arith.trunci %1081 : i32 to i8
%1101 = arith.trunci %1082 : i32 to i8
%1102 = arith.trunci %1083 : i32 to i8
%1103 = arith.trunci %1084 : i32 to i8
%1104 = arith.trunci %1085 : i32 to i8
%1105 = arith.trunci %1086 : i32 to i8
%1106 = arith.trunci %1087 : i32 to i8
%1107 = arith.trunci %1088 : i32 to i8
%1108 = llvm.mlir.constant(0 : i64) : i64
%1109 = llvm.getelementptr %1090[0, %1108] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1092, %1109 : i8, !llvm.ptr
%1110 = llvm.mlir.constant(1 : i64) : i64
%1111 = llvm.getelementptr %1090[0, %1110] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1093, %1111 : i8, !llvm.ptr
%1112 = llvm.mlir.constant(2 : i64) : i64
%1113 = llvm.getelementptr %1090[0, %1112] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1094, %1113 : i8, !llvm.ptr
%1114 = llvm.mlir.constant(3 : i64) : i64
%1115 = llvm.getelementptr %1090[0, %1114] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1095, %1115 : i8, !llvm.ptr
%1116 = llvm.mlir.constant(4 : i64) : i64
%1117 = llvm.getelementptr %1090[0, %1116] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1096, %1117 : i8, !llvm.ptr
%1118 = llvm.mlir.constant(5 : i64) : i64
%1119 = llvm.getelementptr %1090[0, %1118] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1097, %1119 : i8, !llvm.ptr
%1120 = llvm.mlir.constant(6 : i64) : i64
%1121 = llvm.getelementptr %1090[0, %1120] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1098, %1121 : i8, !llvm.ptr
%1122 = llvm.mlir.constant(7 : i64) : i64
%1123 = llvm.getelementptr %1090[0, %1122] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1099, %1123 : i8, !llvm.ptr
%1124 = llvm.mlir.constant(8 : i64) : i64
%1125 = llvm.getelementptr %1090[0, %1124] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1100, %1125 : i8, !llvm.ptr
%1126 = llvm.mlir.constant(9 : i64) : i64
%1127 = llvm.getelementptr %1090[0, %1126] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1101, %1127 : i8, !llvm.ptr
%1128 = llvm.mlir.constant(10 : i64) : i64
%1129 = llvm.getelementptr %1090[0, %1128] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1102, %1129 : i8, !llvm.ptr
%1130 = llvm.mlir.constant(11 : i64) : i64
%1131 = llvm.getelementptr %1090[0, %1130] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1103, %1131 : i8, !llvm.ptr
%1132 = llvm.mlir.constant(12 : i64) : i64
%1133 = llvm.getelementptr %1090[0, %1132] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1104, %1133 : i8, !llvm.ptr
%1134 = llvm.mlir.constant(13 : i64) : i64
%1135 = llvm.getelementptr %1090[0, %1134] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1105, %1135 : i8, !llvm.ptr
%1136 = llvm.mlir.constant(14 : i64) : i64
%1137 = llvm.getelementptr %1090[0, %1136] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1106, %1137 : i8, !llvm.ptr
%1138 = llvm.mlir.constant(15 : i64) : i64
%1139 = llvm.getelementptr %1090[0, %1138] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<16 x i8>
llvm.store %1107, %1139 : i8, !llvm.ptr
%1141 = arith.constant 9 : i32
%1140 = func.call @P_word(%818, %1141) : (!llvm.ptr, i32) -> i128
%1143 = arith.constant 12 : i32
%1142 = func.call @P_word(%886, %1143) : (!llvm.ptr, i32) -> i128
%1145 = arith.trunci %1140 : i128 to i64
%1146 = arith.trunci %1142 : i128 to i64
%1144 = arith.addi %1145, %1146 : i64
%1148 = arith.constant 10 : i32
%1147 = func.call @P_word(%954, %1148) : (!llvm.ptr, i32) -> i128
%1150 = arith.trunci %1147 : i128 to i64
%1149 = arith.subi %1144, %1150 : i64
%1152 = arith.constant 12 : i32
%1151 = func.call @P_word(%1022, %1152) : (!llvm.ptr, i32) -> i128
%1154 = arith.trunci %1151 : i128 to i64
%1153 = arith.addi %1149, %1154 : i64
%1156 = arith.constant 10 : i32
%1155 = func.call @P_word(%1090, %1156) : (!llvm.ptr, i32) -> i128
%1158 = arith.trunci %1155 : i128 to i64
%1157 = arith.subi %1153, %1158 : i64
%1159 = arith.extsi %1157 : i64 to i128
%1161 = arith.constant 32 : i32
%1162 = arith.constant 1 : i32
%1163 = arith.extsi %1161 : i32 to i64
%1164 = arith.extsi %1162 : i32 to i64
%1160 = func.call @calloc(%1163, %1164) : (i64, i64) -> !llvm.ptr
%1166 = arith.constant 1 : i32
%1167 = arith.constant 4 : i32
%1168 = arith.extsi %1166 : i32 to i64
%1169 = arith.extsi %1167 : i32 to i64
%1165 = func.call @calloc(%1168, %1169) : (i64, i64) -> !llvm.ptr
%1170 = llvm.mlir.zero : !llvm.ptr
%1171 = llvm.icmp "eq" %1160, %1170 : !llvm.ptr
%1172 = scf.if %1171 -> (i1) {
%1173 = arith.constant true
scf.yield %1173 : i1
} else {
%1174 = llvm.mlir.zero : !llvm.ptr
%1175 = llvm.icmp "eq" %1165, %1174 : !llvm.ptr
scf.yield %1175 : i1
}
cf.cond_br %1172, ^bb108, ^bb109
^bb108:
%1176 = arith.constant 1 : i32
func.return %1176 : i32
^bb109:
cf.br ^bb110
^bb110:
func.call @W_pos(%1159, %1160, %1165) : (i128, !llvm.ptr, !llvm.ptr) -> ()
%1178 = arith.constant 0 : i32
%1179 = llvm.mlir.constant(1 : i64) : i64
%1180 = llvm.alloca %1179 x i32 : (i64) -> !llvm.ptr
llvm.store %1178, %1180 : i32, !llvm.ptr
cf.br ^bb111
^bb111:
%1181 = llvm.load %1180 : !llvm.ptr -> i32
%1183 = arith.constant 0 : i32
%1184 = arith.extsi %1183 : i32 to i64
%1185 = llvm.getelementptr %1165[%1184] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1182 = llvm.load %1185 : !llvm.ptr -> i32
%1186 = arith.cmpi slt, %1181, %1182 : i32
cf.cond_br %1186, ^bb112, ^bb113
^bb112:
%1187 = llvm.mlir.addressof @str_0 : !llvm.ptr
%1189 = llvm.load %1180 : !llvm.ptr -> i32
%1190 = arith.extsi %1189 : i32 to i64
%1191 = llvm.getelementptr %1160[%1190] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%1188 = llvm.load %1191 : !llvm.ptr -> i8
%1192 = llvm.call @printf(%1187, %1188) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i8) -> i32
%1193 = llvm.load %1180 : !llvm.ptr -> i32
%1194 = arith.constant 1 : i32
%1195 = arith.addi %1193, %1194 : i32
llvm.store %1195, %1180 : i32, !llvm.ptr
cf.br ^bb111
^bb113:
%1196 = llvm.mlir.addressof @str_1 : !llvm.ptr
%1197 = llvm.call @printf(%1196) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr) -> i32
func.call @free(%1165) : (!llvm.ptr) -> ()
func.call @free(%1160) : (!llvm.ptr) -> ()
%1200 = arith.constant 0 : i32
func.return %1200 : i32
}
}