Problem 166

4x4 grids of digits 0-9 with equal row/column/diagonal sums.

Answer7130034
Output7130034
StatusPASS
Native helperno
Runtime70 ms
Peak memory1072 KB
Time complexityO(n^8) (estimated)
Space complexityO(1) (estimated)

Performance comparison

MetricOur solutionBest known
Time complexityO(n^8)O(n^d)
Space complexityO(1)O(n^d)
ApproachFlow solutionBrute-force grid search
VerdictUnknown

Flow source

# Project Euler 166
# 4x4 grids of digits 0-9 with equal row/column/diagonal sums.

function main() -> i32 {
    let mut ans: i64 = 0
    let mut b: i32 = 0
    while b <= 9 {
        let mut c: i32 = 0
        while c <= 9 {
            let mut d: i32 = 0
            while d <= 9 {
                let mut e: i32 = 0
                while e <= 9 {
                    let mut ii: i32 = 0
                    while ii <= 9 {
                        let m: i32 = b + c + d - e - ii
                        if m >= 0 && m <= 9 {
                            let mut k: i32 = 0
                            while k <= 9 {
                                let f: i32 = b + c + d * 2 - e - ii - k
                                if f >= 0 && f <= 9 {
                                    let mut a: i32 = 0
                                    while a <= 9 {
                                        let mut g: i32 = 0
                                        while g <= 9 {
                                            let o: i32 = a + b + d - g - k
                                            if o >= 0 && o <= 9 {
                                                let j: i32 = a + b + c - g - m
                                                if j >= 0 && j <= 9 {
                                                    let l: i32 = a + b + c + d - ii - j - k
                                                    if l >= 0 && l <= 9 {
                                                        let h: i32 = a + b + c + d - e - f - g
                                                        if h >= 0 && h <= 9 {
                                                            let n: i32 = a + c + d - f - j
                                                            if n >= 0 && n <= 9 {
                                                                let p: i32 = a + b + c - h - l
                                                                if p >= 0 && p <= 9 {
                                                                    ans = ans + 1
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            g = g + 1
                                        }
                                        a = a + 1
                                    }
                                }
                                k = k + 1
                            }
                        }
                        ii = ii + 1
                    }
                    e = e + 1
                }
                d = d + 1
            }
            c = c + 1
        }
        b = b + 1
    }
    printf("%lld\n", ans)
    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; }

int32_t main(void);

int32_t main(void) {
    int64_t ans = 0;
    int32_t b = 0;
    while (b <= 9) {
        int32_t c = 0;
        while (c <= 9) {
            int32_t d = 0;
            while (d <= 9) {
                int32_t e = 0;
                while (e <= 9) {
                    int32_t ii = 0;
                    while (ii <= 9) {
                        int32_t m = ((((b + c) + d) - e) - ii);
                        if ((m >= 0 && m <= 9)) {
                            int32_t k = 0;
                            while (k <= 9) {
                                int32_t f = (((((b + c) + (d * 2)) - e) - ii) - k);
                                if ((f >= 0 && f <= 9)) {
                                    int32_t a = 0;
                                    while (a <= 9) {
                                        int32_t g = 0;
                                        while (g <= 9) {
                                            int32_t o = ((((a + b) + d) - g) - k);
                                            if ((o >= 0 && o <= 9)) {
                                                int32_t j = ((((a + b) + c) - g) - m);
                                                if ((j >= 0 && j <= 9)) {
                                                    int32_t l = ((((((a + b) + c) + d) - ii) - j) - k);
                                                    if ((l >= 0 && l <= 9)) {
                                                        int32_t h = ((((((a + b) + c) + d) - e) - f) - g);
                                                        if ((h >= 0 && h <= 9)) {
                                                            int32_t n = ((((a + c) + d) - f) - j);
                                                            if ((n >= 0 && n <= 9)) {
                                                                int32_t p = ((((a + b) + c) - h) - l);
                                                                if ((p >= 0 && p <= 9)) {
                                                                    ans = (ans + 1);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            g = (g + 1);
                                        }
                                        a = (a + 1);
                                    }
                                }
                                k = (k + 1);
                            }
                        }
                        ii = (ii + 1);
                    }
                    e = (e + 1);
                }
                d = (d + 1);
            }
            c = (c + 1);
        }
        b = (b + 1);
    }
    printf("%lld\n", ans);
    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 @main() -> i32 {
    %0 = arith.constant 0 : i32
    %1 = arith.extsi %0 : i32 to i64
    %2 = llvm.mlir.constant(1 : i64) : i64
    %3 = llvm.alloca %2 x i64 : (i64) -> !llvm.ptr
    llvm.store %1, %3 : i64, !llvm.ptr
    %4 = arith.constant 0 : i32
    %5 = llvm.mlir.constant(1 : i64) : i64
    %6 = llvm.alloca %5 x i32 : (i64) -> !llvm.ptr
    llvm.store %4, %6 : i32, !llvm.ptr
    cf.br ^bb0
    ^bb0:
    %7 = llvm.load %6 : !llvm.ptr -> i32
    %8 = arith.constant 9 : i32
    %9 = arith.cmpi sle, %7, %8 : i32
    cf.cond_br %9, ^bb1, ^bb2
    ^bb1:
      %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 ^bb3
      ^bb3:
      %13 = llvm.load %12 : !llvm.ptr -> i32
      %14 = arith.constant 9 : i32
      %15 = arith.cmpi sle, %13, %14 : i32
      cf.cond_br %15, ^bb4, ^bb5
      ^bb4:
        %16 = arith.constant 0 : i32
        %17 = llvm.mlir.constant(1 : i64) : i64
        %18 = llvm.alloca %17 x i32 : (i64) -> !llvm.ptr
        llvm.store %16, %18 : i32, !llvm.ptr
        cf.br ^bb6
        ^bb6:
        %19 = llvm.load %18 : !llvm.ptr -> i32
        %20 = arith.constant 9 : i32
        %21 = arith.cmpi sle, %19, %20 : i32
        cf.cond_br %21, ^bb7, ^bb8
        ^bb7:
          %22 = arith.constant 0 : i32
          %23 = llvm.mlir.constant(1 : i64) : i64
          %24 = llvm.alloca %23 x i32 : (i64) -> !llvm.ptr
          llvm.store %22, %24 : i32, !llvm.ptr
          cf.br ^bb9
          ^bb9:
          %25 = llvm.load %24 : !llvm.ptr -> i32
          %26 = arith.constant 9 : i32
          %27 = arith.cmpi sle, %25, %26 : i32
          cf.cond_br %27, ^bb10, ^bb11
          ^bb10:
            %28 = arith.constant 0 : i32
            %29 = llvm.mlir.constant(1 : i64) : i64
            %30 = llvm.alloca %29 x i32 : (i64) -> !llvm.ptr
            llvm.store %28, %30 : i32, !llvm.ptr
            cf.br ^bb12
            ^bb12:
            %31 = llvm.load %30 : !llvm.ptr -> i32
            %32 = arith.constant 9 : i32
            %33 = arith.cmpi sle, %31, %32 : i32
            cf.cond_br %33, ^bb13, ^bb14
            ^bb13:
              %34 = llvm.load %6 : !llvm.ptr -> i32
              %35 = llvm.load %12 : !llvm.ptr -> i32
              %36 = arith.addi %34, %35 : i32
              %37 = llvm.load %18 : !llvm.ptr -> i32
              %38 = arith.addi %36, %37 : i32
              %39 = llvm.load %24 : !llvm.ptr -> i32
              %40 = arith.subi %38, %39 : i32
              %41 = llvm.load %30 : !llvm.ptr -> i32
              %42 = arith.subi %40, %41 : i32
              %43 = arith.constant 0 : i32
              %44 = arith.cmpi sge, %42, %43 : i32
              %45 = scf.if %44 -> (i1) {
                %46 = arith.constant 9 : i32
                %47 = arith.cmpi sle, %42, %46 : i32
                scf.yield %47 : i1
              } else {
                %48 = arith.constant false
                scf.yield %48 : i1
              }
              cf.cond_br %45, ^bb15, ^bb16
              ^bb15:
                %49 = arith.constant 0 : i32
                %50 = llvm.mlir.constant(1 : i64) : i64
                %51 = llvm.alloca %50 x i32 : (i64) -> !llvm.ptr
                llvm.store %49, %51 : i32, !llvm.ptr
                cf.br ^bb18
                ^bb18:
                %52 = llvm.load %51 : !llvm.ptr -> i32
                %53 = arith.constant 9 : i32
                %54 = arith.cmpi sle, %52, %53 : i32
                cf.cond_br %54, ^bb19, ^bb20
                ^bb19:
                  %55 = llvm.load %6 : !llvm.ptr -> i32
                  %56 = llvm.load %12 : !llvm.ptr -> i32
                  %57 = arith.addi %55, %56 : i32
                  %58 = llvm.load %18 : !llvm.ptr -> i32
                  %59 = arith.constant 2 : i32
                  %60 = arith.muli %58, %59 : i32
                  %61 = arith.addi %57, %60 : i32
                  %62 = llvm.load %24 : !llvm.ptr -> i32
                  %63 = arith.subi %61, %62 : i32
                  %64 = llvm.load %30 : !llvm.ptr -> i32
                  %65 = arith.subi %63, %64 : i32
                  %66 = llvm.load %51 : !llvm.ptr -> i32
                  %67 = arith.subi %65, %66 : i32
                  %68 = arith.constant 0 : i32
                  %69 = arith.cmpi sge, %67, %68 : i32
                  %70 = scf.if %69 -> (i1) {
                    %71 = arith.constant 9 : i32
                    %72 = arith.cmpi sle, %67, %71 : i32
                    scf.yield %72 : i1
                  } else {
                    %73 = arith.constant false
                    scf.yield %73 : i1
                  }
                  cf.cond_br %70, ^bb21, ^bb22
                  ^bb21:
                    %74 = arith.constant 0 : i32
                    %75 = llvm.mlir.constant(1 : i64) : i64
                    %76 = llvm.alloca %75 x i32 : (i64) -> !llvm.ptr
                    llvm.store %74, %76 : i32, !llvm.ptr
                    cf.br ^bb24
                    ^bb24:
                    %77 = llvm.load %76 : !llvm.ptr -> i32
                    %78 = arith.constant 9 : i32
                    %79 = arith.cmpi sle, %77, %78 : i32
                    cf.cond_br %79, ^bb25, ^bb26
                    ^bb25:
                      %80 = arith.constant 0 : i32
                      %81 = llvm.mlir.constant(1 : i64) : i64
                      %82 = llvm.alloca %81 x i32 : (i64) -> !llvm.ptr
                      llvm.store %80, %82 : i32, !llvm.ptr
                      cf.br ^bb27
                      ^bb27:
                      %83 = llvm.load %82 : !llvm.ptr -> i32
                      %84 = arith.constant 9 : i32
                      %85 = arith.cmpi sle, %83, %84 : i32
                      cf.cond_br %85, ^bb28, ^bb29
                      ^bb28:
                        %86 = llvm.load %76 : !llvm.ptr -> i32
                        %87 = llvm.load %6 : !llvm.ptr -> i32
                        %88 = arith.addi %86, %87 : i32
                        %89 = llvm.load %18 : !llvm.ptr -> i32
                        %90 = arith.addi %88, %89 : i32
                        %91 = llvm.load %82 : !llvm.ptr -> i32
                        %92 = arith.subi %90, %91 : i32
                        %93 = llvm.load %51 : !llvm.ptr -> i32
                        %94 = arith.subi %92, %93 : i32
                        %95 = arith.constant 0 : i32
                        %96 = arith.cmpi sge, %94, %95 : i32
                        %97 = scf.if %96 -> (i1) {
                          %98 = arith.constant 9 : i32
                          %99 = arith.cmpi sle, %94, %98 : i32
                          scf.yield %99 : i1
                        } else {
                          %100 = arith.constant false
                          scf.yield %100 : i1
                        }
                        cf.cond_br %97, ^bb30, ^bb31
                        ^bb30:
                          %101 = llvm.load %76 : !llvm.ptr -> i32
                          %102 = llvm.load %6 : !llvm.ptr -> i32
                          %103 = arith.addi %101, %102 : i32
                          %104 = llvm.load %12 : !llvm.ptr -> i32
                          %105 = arith.addi %103, %104 : i32
                          %106 = llvm.load %82 : !llvm.ptr -> i32
                          %107 = arith.subi %105, %106 : i32
                          %108 = arith.subi %107, %42 : i32
                          %109 = arith.constant 0 : i32
                          %110 = arith.cmpi sge, %108, %109 : i32
                          %111 = scf.if %110 -> (i1) {
                            %112 = arith.constant 9 : i32
                            %113 = arith.cmpi sle, %108, %112 : i32
                            scf.yield %113 : i1
                          } else {
                            %114 = arith.constant false
                            scf.yield %114 : i1
                          }
                          cf.cond_br %111, ^bb33, ^bb34
                          ^bb33:
                            %115 = llvm.load %76 : !llvm.ptr -> i32
                            %116 = llvm.load %6 : !llvm.ptr -> i32
                            %117 = arith.addi %115, %116 : i32
                            %118 = llvm.load %12 : !llvm.ptr -> i32
                            %119 = arith.addi %117, %118 : i32
                            %120 = llvm.load %18 : !llvm.ptr -> i32
                            %121 = arith.addi %119, %120 : i32
                            %122 = llvm.load %30 : !llvm.ptr -> i32
                            %123 = arith.subi %121, %122 : i32
                            %124 = arith.subi %123, %108 : i32
                            %125 = llvm.load %51 : !llvm.ptr -> i32
                            %126 = arith.subi %124, %125 : i32
                            %127 = arith.constant 0 : i32
                            %128 = arith.cmpi sge, %126, %127 : i32
                            %129 = scf.if %128 -> (i1) {
                              %130 = arith.constant 9 : i32
                              %131 = arith.cmpi sle, %126, %130 : i32
                              scf.yield %131 : i1
                            } else {
                              %132 = arith.constant false
                              scf.yield %132 : i1
                            }
                            cf.cond_br %129, ^bb36, ^bb37
                            ^bb36:
                              %133 = llvm.load %76 : !llvm.ptr -> i32
                              %134 = llvm.load %6 : !llvm.ptr -> i32
                              %135 = arith.addi %133, %134 : i32
                              %136 = llvm.load %12 : !llvm.ptr -> i32
                              %137 = arith.addi %135, %136 : i32
                              %138 = llvm.load %18 : !llvm.ptr -> i32
                              %139 = arith.addi %137, %138 : i32
                              %140 = llvm.load %24 : !llvm.ptr -> i32
                              %141 = arith.subi %139, %140 : i32
                              %142 = arith.subi %141, %67 : i32
                              %143 = llvm.load %82 : !llvm.ptr -> i32
                              %144 = arith.subi %142, %143 : i32
                              %145 = arith.constant 0 : i32
                              %146 = arith.cmpi sge, %144, %145 : i32
                              %147 = scf.if %146 -> (i1) {
                                %148 = arith.constant 9 : i32
                                %149 = arith.cmpi sle, %144, %148 : i32
                                scf.yield %149 : i1
                              } else {
                                %150 = arith.constant false
                                scf.yield %150 : i1
                              }
                              cf.cond_br %147, ^bb39, ^bb40
                              ^bb39:
                                %151 = llvm.load %76 : !llvm.ptr -> i32
                                %152 = llvm.load %12 : !llvm.ptr -> i32
                                %153 = arith.addi %151, %152 : i32
                                %154 = llvm.load %18 : !llvm.ptr -> i32
                                %155 = arith.addi %153, %154 : i32
                                %156 = arith.subi %155, %67 : i32
                                %157 = arith.subi %156, %108 : i32
                                %158 = arith.constant 0 : i32
                                %159 = arith.cmpi sge, %157, %158 : i32
                                %160 = scf.if %159 -> (i1) {
                                  %161 = arith.constant 9 : i32
                                  %162 = arith.cmpi sle, %157, %161 : i32
                                  scf.yield %162 : i1
                                } else {
                                  %163 = arith.constant false
                                  scf.yield %163 : i1
                                }
                                cf.cond_br %160, ^bb42, ^bb43
                                ^bb42:
                                  %164 = llvm.load %76 : !llvm.ptr -> i32
                                  %165 = llvm.load %6 : !llvm.ptr -> i32
                                  %166 = arith.addi %164, %165 : i32
                                  %167 = llvm.load %12 : !llvm.ptr -> i32
                                  %168 = arith.addi %166, %167 : i32
                                  %169 = arith.subi %168, %144 : i32
                                  %170 = arith.subi %169, %126 : i32
                                  %171 = arith.constant 0 : i32
                                  %172 = arith.cmpi sge, %170, %171 : i32
                                  %173 = scf.if %172 -> (i1) {
                                    %174 = arith.constant 9 : i32
                                    %175 = arith.cmpi sle, %170, %174 : i32
                                    scf.yield %175 : i1
                                  } else {
                                    %176 = arith.constant false
                                    scf.yield %176 : i1
                                  }
                                  cf.cond_br %173, ^bb45, ^bb46
                                  ^bb45:
                                    %177 = llvm.load %3 : !llvm.ptr -> i64
                                    %178 = arith.constant 1 : i32
                                    %180 = arith.extsi %178 : i32 to i64
                                    %179 = arith.addi %177, %180 : i64
                                    llvm.store %179, %3 : i64, !llvm.ptr
                                    cf.br ^bb47
                                  ^bb46:
                                    cf.br ^bb47
                                  ^bb47:
                                  cf.br ^bb44
                                ^bb43:
                                  cf.br ^bb44
                                ^bb44:
                                cf.br ^bb41
                              ^bb40:
                                cf.br ^bb41
                              ^bb41:
                              cf.br ^bb38
                            ^bb37:
                              cf.br ^bb38
                            ^bb38:
                            cf.br ^bb35
                          ^bb34:
                            cf.br ^bb35
                          ^bb35:
                          cf.br ^bb32
                        ^bb31:
                          cf.br ^bb32
                        ^bb32:
                        %181 = llvm.load %82 : !llvm.ptr -> i32
                        %182 = arith.constant 1 : i32
                        %183 = arith.addi %181, %182 : i32
                        llvm.store %183, %82 : i32, !llvm.ptr
                        cf.br ^bb27
                      ^bb29:
                      %184 = llvm.load %76 : !llvm.ptr -> i32
                      %185 = arith.constant 1 : i32
                      %186 = arith.addi %184, %185 : i32
                      llvm.store %186, %76 : i32, !llvm.ptr
                      cf.br ^bb24
                    ^bb26:
                    cf.br ^bb23
                  ^bb22:
                    cf.br ^bb23
                  ^bb23:
                  %187 = llvm.load %51 : !llvm.ptr -> i32
                  %188 = arith.constant 1 : i32
                  %189 = arith.addi %187, %188 : i32
                  llvm.store %189, %51 : i32, !llvm.ptr
                  cf.br ^bb18
                ^bb20:
                cf.br ^bb17
              ^bb16:
                cf.br ^bb17
              ^bb17:
              %190 = llvm.load %30 : !llvm.ptr -> i32
              %191 = arith.constant 1 : i32
              %192 = arith.addi %190, %191 : i32
              llvm.store %192, %30 : i32, !llvm.ptr
              cf.br ^bb12
            ^bb14:
            %193 = llvm.load %24 : !llvm.ptr -> i32
            %194 = arith.constant 1 : i32
            %195 = arith.addi %193, %194 : i32
            llvm.store %195, %24 : i32, !llvm.ptr
            cf.br ^bb9
          ^bb11:
          %196 = llvm.load %18 : !llvm.ptr -> i32
          %197 = arith.constant 1 : i32
          %198 = arith.addi %196, %197 : i32
          llvm.store %198, %18 : i32, !llvm.ptr
          cf.br ^bb6
        ^bb8:
        %199 = llvm.load %12 : !llvm.ptr -> i32
        %200 = arith.constant 1 : i32
        %201 = arith.addi %199, %200 : i32
        llvm.store %201, %12 : i32, !llvm.ptr
        cf.br ^bb3
      ^bb5:
      %202 = llvm.load %6 : !llvm.ptr -> i32
      %203 = arith.constant 1 : i32
      %204 = arith.addi %202, %203 : i32
      llvm.store %204, %6 : i32, !llvm.ptr
      cf.br ^bb0
    ^bb2:
    %205 = llvm.mlir.addressof @str_0 : !llvm.ptr
    %206 = llvm.load %3 : !llvm.ptr -> i64
    %207 = llvm.call @printf(%205, %206) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
    %208 = arith.constant 0 : i32
    func.return %208 : i32
  }
}