#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int A1_oo_A2(int **, int **, int **, int, int, int *, int *);
int **allocate_matrix(int, int, char);
int /*<<< orphan*/ free_matrix(int **, int, int);
int /*<<< orphan*/ populate_bonds(int **, int **, int, int, double);
int /*<<< orphan*/ print_lattice(int **, int **, int **, int, int, int *,
                                 int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_A1_A2(int *, int *, int, int);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ usage(char *, char *, int);
void test_A1_oo_A2(int argc, char **argv) {
  int M = 18;
  int N = 18;
  double p = 0.6;
  int argi;
  int **vbonds;
  int **hbonds;
  int **site_marks;
  int A1[2];
  int A2[2];
  int ctd;
  for (argi = 2; argi < argc; argi++) {
    if (sscanf(argv[argi], "M=%d", &M) == 1)
      ;
    else if (sscanf(argv[argi], "N=%d", &N) == 1)
      ;
    else if (sscanf(argv[argi], "MN=%d", &M) == 1)
      N = M;
    else if (sscanf(argv[argi], "p=%lf", &p) == 1)
      ;
    else
      usage(argv[0], argv[1], 0);
  }
  if ((M < 3) || (N < 3))
    usage(argv[0], argv[1], 1);
  vbonds = allocate_matrix(M, N, 0);
  hbonds = allocate_matrix(M, N, 0);
  site_marks = allocate_matrix(M, N, '.');
  set_A1_A2(A1, A2, M, N);
  populate_bonds(vbonds, hbonds, M, N, p);
  print_lattice(site_marks, vbonds, hbonds, M, N, A1, A2);
  printf("\n");
  ctd = A1_oo_A2(site_marks, vbonds, hbonds, M, N, A1, A2);
  print_lattice(site_marks, vbonds, hbonds, M, N, A1, A2);
  if (ctd)
    printf("Yes\n");
  else
    printf("No\n");
  free_matrix(vbonds, M, N);
  free_matrix(hbonds, M, N);
  free_matrix(site_marks, M, N);
}


x86 assembly (clang, -O0):
<test_A1_oo_A2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x12,-0x14(%rbp)
movl   $0x12,-0x18(%rbp)
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12bb <test_A1_oo_A2+0x12b>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe28(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    11f9 <test_A1_oo_A2+0x69>
jmp    12a8 <test_A1_oo_A2+0x118>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe02(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1225 <test_A1_oo_A2+0x95>
jmp    12a3 <test_A1_oo_A2+0x113>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdd5(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1257 <test_A1_oo_A2+0xc7>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    129e <test_A1_oo_A2+0x10e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xda9(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1283 <test_A1_oo_A2+0xf3>
jmp    1299 <test_A1_oo_A2+0x109>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %edx,%edx
call   10a0 <usage@plt>
jmp    129e <test_A1_oo_A2+0x10e>
jmp    12a3 <test_A1_oo_A2+0x113>
jmp    12a8 <test_A1_oo_A2+0x118>
jmp    12ad <test_A1_oo_A2+0x11d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c1 <test_A1_oo_A2+0x31>
cmpl   $0x3,-0x14(%rbp)
jl     12cf <test_A1_oo_A2+0x13f>
cmpl   $0x3,-0x18(%rbp)
jge    12e8 <test_A1_oo_A2+0x158>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x1,%edx
call   10a0 <usage@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
xor    %edx,%edx
call   1080 <allocate_matrix@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
xor    %edx,%edx
call   1080 <allocate_matrix@plt>
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    $0x2e,%edx
call   1080 <allocate_matrix@plt>
mov    %rax,-0x40(%rbp)
lea    -0x48(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <set_A1_A2@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
call   1070 <populate_bonds@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    -0x48(%rbp),%r9
lea    -0x50(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <print_lattice@plt>
lea    0xcac(%rip),%rdi
call   1060 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    -0x48(%rbp),%r9
lea    -0x50(%rbp),%rax
mov    %rax,(%rsp)
call   10b0 <A1_oo_A2@plt>
mov    %eax,-0x54(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    -0x48(%rbp),%r9
lea    -0x50(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <print_lattice@plt>
cmpl   $0x0,-0x54(%rbp)
je     13df <test_A1_oo_A2+0x24f>
lea    0xc44(%rip),%rdi
call   1060 <printf@plt>
jmp    13eb <test_A1_oo_A2+0x25b>
lea    0xc38(%rip),%rdi
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <free_matrix@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <free_matrix@plt>
mov    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <free_matrix@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_A1_oo_A2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%eax
movl   $0x12,0xc(%rsp)
movl   $0x12,0x8(%rsp)
movabs $0x3fe3333333333333,%rcx
33 e3 3f
mov    %rcx,0x10(%rsp)
mov    $0x12,%esi
mov    $0x12,%edi
cmp    $0x3,%eax
jl     1297 <test_A1_oo_A2+0xf7>
mov    %eax,%ebp
mov    $0x2,%r12d
lea    0xe0c(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r13
jmp    1219 <test_A1_oo_A2+0x79>
mov    0xc(%rsp),%eax
mov    %eax,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,%rbp
je     128f <test_A1_oo_A2+0xef>
mov    (%rbx,%r12,8),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
je     1210 <test_A1_oo_A2+0x70>
mov    (%rbx,%r12,8),%rdi
lea    0xdcc(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
je     1210 <test_A1_oo_A2+0x70>
mov    (%rbx,%r12,8),%rdi
lea    0xdb1(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
je     1200 <test_A1_oo_A2+0x60>
mov    (%rbx,%r12,8),%rdi
lea    0xd9d(%rip),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
je     1210 <test_A1_oo_A2+0x70>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
xor    %edx,%edx
call   10b0 <usage@plt>
jmp    1210 <test_A1_oo_A2+0x70>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
cmp    $0x3,%edi
jl     12a1 <test_A1_oo_A2+0x101>
cmp    $0x2,%esi
jg     12ba <test_A1_oo_A2+0x11a>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1,%edx
call   10b0 <usage@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
xor    %edx,%edx
call   1090 <allocate_matrix@plt>
mov    %rax,%r14
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
xor    %edx,%edx
call   1090 <allocate_matrix@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    $0x2e,%edx
call   1090 <allocate_matrix@plt>
mov    %rax,%r15
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0x20(%rsp),%r12
lea    0x18(%rsp),%r13
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <set_A1_A2@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
movsd  0x10(%rsp),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <populate_bonds@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %r13,(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%r9
call   1060 <print_lattice@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %r13,(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%r9
call   10c0 <A1_oo_A2@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %r13,(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%r9
call   1060 <print_lattice@plt>
test   %ebp,%ebp
lea    0xc81(%rip),%rax
lea    0xc7d(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r14,%rdi
call   1050 <free_matrix@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1050 <free_matrix@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r15,%rdi
call   1050 <free_matrix@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"M=%d\00"
@.str.1 = [5 x i8] c"N=%d\00"
@.str.2 = [6 x i8] c"MN=%d\00"
@.str.3 = [6 x i8] c"p=%lf\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [5 x i8] c"Yes\0A\00"
@.str.6 = [4 x i8] c"No\0A\00"
define void @test_A1_oo_A2(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca i32**
%10 = alloca i32**
%11 = alloca i32**
%12 = alloca [2 x i32]
%13 = alloca [2 x i32]
%14 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 18, i32* %5
store i32 18, i32* %6
store double 6.000000e-01, double* %7
store i32 2, i32* %8
br label %15
15: ; preds = %68, %2
%16 = load i32, i32* %8
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %71
19: ; preds = %15
%20 = load i8**, i8*** %4
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 (i8*, i8*, ...) @sscanf(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %5)
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %28
27: ; preds = %19
br label %67
28: ; preds = %19
%29 = load i8**, i8*** %4
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %37
36: ; preds = %28
br label %66
37: ; preds = %28
%38 = load i8**, i8*** %4
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 (i8*, i8*, ...) @sscanf(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %47
45: ; preds = %37
%46 = load i32, i32* %5
store i32 %46, i32* %6
br label %65
47: ; preds = %37
%48 = load i8**, i8*** %4
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %48, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 (i8*, i8*, ...) @sscanf(i8* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double* %7)
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %56
55: ; preds = %47
br label %64
56: ; preds = %47
%57 = load i8**, i8*** %4
%58 = getelementptr inbounds i8*, i8** %57, i64 0
%59 = load i8*, i8** %58
%60 = load i8**, i8*** %4
%61 = getelementptr inbounds i8*, i8** %60, i64 1
%62 = load i8*, i8** %61
%63 = call i32 @usage(i8* %59, i8* %62, i32 0)
br label %64
64: ; preds = %56, %55
br label %65
65: ; preds = %64, %45
br label %66
66: ; preds = %65, %36
br label %67
67: ; preds = %66, %27
br label %68
68: ; preds = %67
%69 = load i32, i32* %8
%70 = add nsw i32 %69, 1
store i32 %70, i32* %8
br label %15
71: ; preds = %15
%72 = load i32, i32* %5
%73 = icmp slt i32 %72, 3
br i1 %73, label %77, label %74
74: ; preds = %71
%75 = load i32, i32* %6
%76 = icmp slt i32 %75, 3
br i1 %76, label %77, label %85
77: ; preds = %74, %71
%78 = load i8**, i8*** %4
%79 = getelementptr inbounds i8*, i8** %78, i64 0
%80 = load i8*, i8** %79
%81 = load i8**, i8*** %4
%82 = getelementptr inbounds i8*, i8** %81, i64 1
%83 = load i8*, i8** %82
%84 = call i32 @usage(i8* %80, i8* %83, i32 1)
br label %85
85: ; preds = %77, %74
%86 = load i32, i32* %5
%87 = load i32, i32* %6
%88 = call i32** @allocate_matrix(i32 %86, i32 %87, i8 signext 0)
store i32** %88, i32*** %9
%89 = load i32, i32* %5
%90 = load i32, i32* %6
%91 = call i32** @allocate_matrix(i32 %89, i32 %90, i8 signext 0)
store i32** %91, i32*** %10
%92 = load i32, i32* %5
%93 = load i32, i32* %6
%94 = call i32** @allocate_matrix(i32 %92, i32 %93, i8 signext 46)
store i32** %94, i32*** %11
%95 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%96 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%97 = load i32, i32* %5
%98 = load i32, i32* %6
%99 = call i32 @set_A1_A2(i32* %95, i32* %96, i32 %97, i32 %98)
%100 = load i32**, i32*** %9
%101 = load i32**, i32*** %10
%102 = load i32, i32* %5
%103 = load i32, i32* %6
%104 = load double, double* %7
%105 = call i32 @populate_bonds(i32** %100, i32** %101, i32 %102, i32 %103, double %104)
%106 = load i32**, i32*** %11
%107 = load i32**, i32*** %9
%108 = load i32**, i32*** %10
%109 = load i32, i32* %5
%110 = load i32, i32* %6
%111 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%112 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%113 = call i32 @print_lattice(i32** %106, i32** %107, i32** %108, i32 %109, i32 %110, i32* %111, i32* %112)
%114 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%115 = load i32**, i32*** %11
%116 = load i32**, i32*** %9
%117 = load i32**, i32*** %10
%118 = load i32, i32* %5
%119 = load i32, i32* %6
%120 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%121 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%122 = call i32 @A1_oo_A2(i32** %115, i32** %116, i32** %117, i32 %118, i32 %119, i32* %120, i32* %121)
store i32 %122, i32* %14
%123 = load i32**, i32*** %11
%124 = load i32**, i32*** %9
%125 = load i32**, i32*** %10
%126 = load i32, i32* %5
%127 = load i32, i32* %6
%128 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%129 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%130 = call i32 @print_lattice(i32** %123, i32** %124, i32** %125, i32 %126, i32 %127, i32* %128, i32* %129)
%131 = load i32, i32* %14
%132 = icmp ne i32 %131, 0
br i1 %132, label %133, label %135
133: ; preds = %85
%134 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %137
135: ; preds = %85
%136 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %137
137: ; preds = %135, %133
%138 = load i32**, i32*** %9
%139 = load i32, i32* %5
%140 = load i32, i32* %6
%141 = call i32 @free_matrix(i32** %138, i32 %139, i32 %140)
%142 = load i32**, i32*** %10
%143 = load i32, i32* %5
%144 = load i32, i32* %6
%145 = call i32 @free_matrix(i32** %142, i32 %143, i32 %144)
%146 = load i32**, i32*** %11
%147 = load i32, i32* %5
%148 = load i32, i32* %6
%149 = call i32 @free_matrix(i32** %146, i32 %147, i32 %148)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"M=%d\00"
@.str.1 = [5 x i8] c"N=%d\00"
@.str.2 = [6 x i8] c"MN=%d\00"
@.str.3 = [6 x i8] c"p=%lf\00"
@str = [3 x i8] c"No\00"
@str.7 = [4 x i8] c"Yes\00"
define void @test_A1_oo_A2(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = bitcast i32* %3 to i8*
store i32 18, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 18, i32* %4
%10 = bitcast double* %5 to i8*
store double 6.000000e-01, double* %5
%11 = bitcast [2 x i32]* %6 to i8*
%12 = bitcast [2 x i32]* %7 to i8*
%13 = icmp sgt i32 %0, 2
br i1 %13, label %14, label %47
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = zext i32 %0 to i64
br label %17
17: ; preds = %14, %41
%18 = phi i64 [ 2, %14 ], [ %42, %41 ]
%19 = getelementptr inbounds i8*, i8** %1, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 (i8*, i8*, ...) @sscanf(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%22 = icmp eq i32 %21, 1
br i1 %22, label %41, label %23
23: ; preds = %17
%24 = load i8*, i8** %19
%25 = call i32 (i8*, i8*, ...) @sscanf(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%26 = icmp eq i32 %25, 1
br i1 %26, label %41, label %27
27: ; preds = %23
%28 = load i8*, i8** %19
%29 = call i32 (i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load i32, i32* %3
store i32 %32, i32* %4
br label %41
33: ; preds = %27
%34 = load i8*, i8** %19
%35 = call i32 (i8*, i8*, ...) @sscanf(i8* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double* %5)
%36 = icmp eq i32 %35, 1
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i8*, i8** %1
%39 = load i8*, i8** %15
%40 = call i32 @usage(i8* %38, i8* %39, i32 0)
br label %41
41: ; preds = %17, %31, %33, %37, %23
%42 = add nuw nsw i64 %18, 1
%43 = icmp eq i64 %42, %16
br i1 %43, label %44, label %17
44: ; preds = %41
%45 = load i32, i32* %3
%46 = load i32, i32* %4
br label %47
47: ; preds = %44, %2
%48 = phi i32 [ %46, %44 ], [ 18, %2 ]
%49 = phi i32 [ %45, %44 ], [ 18, %2 ]
%50 = icmp slt i32 %49, 3
%51 = icmp slt i32 %48, 3
%52 = select i1 %50, i1 true, i1 %51
br i1 %52, label %53, label %60
53: ; preds = %47
%54 = load i8*, i8** %1
%55 = getelementptr inbounds i8*, i8** %1, i64 1
%56 = load i8*, i8** %55
%57 = call i32 @usage(i8* %54, i8* %56, i32 1)
%58 = load i32, i32* %3
%59 = load i32, i32* %4
br label %60
60: ; preds = %47, %53
%61 = phi i32 [ %48, %47 ], [ %59, %53 ]
%62 = phi i32 [ %49, %47 ], [ %58, %53 ]
%63 = call i32** @allocate_matrix(i32 %62, i32 %61, i8 signext 0)
%64 = load i32, i32* %3
%65 = load i32, i32* %4
%66 = call i32** @allocate_matrix(i32 %64, i32 %65, i8 signext 0)
%67 = load i32, i32* %3
%68 = load i32, i32* %4
%69 = call i32** @allocate_matrix(i32 %67, i32 %68, i8 signext 46)
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%72 = load i32, i32* %3
%73 = load i32, i32* %4
%74 = call i32 @set_A1_A2(i32* %70, i32* %71, i32 %72, i32 %73)
%75 = load i32, i32* %3
%76 = load i32, i32* %4
%77 = load double, double* %5
%78 = call i32 @populate_bonds(i32** %63, i32** %66, i32 %75, i32 %76, double %77)
%79 = load i32, i32* %3
%80 = load i32, i32* %4
%81 = call i32 @print_lattice(i32** %69, i32** %63, i32** %66, i32 %79, i32 %80, i32* %70, i32* %71)
%82 = call i32 @putchar(i32 10)
%83 = load i32, i32* %3
%84 = load i32, i32* %4
%85 = call i32 @A1_oo_A2(i32** %69, i32** %63, i32** %66, i32 %83, i32 %84, i32* %70, i32* %71)
%86 = load i32, i32* %3
%87 = load i32, i32* %4
%88 = call i32 @print_lattice(i32** %69, i32** %63, i32** %66, i32 %86, i32 %87, i32* %70, i32* %71)
%89 = icmp eq i32 %85, 0
%90 = select i1 %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0)
%91 = call i32 @puts(i8* dereferenceable(1) %90)
%92 = load i32, i32* %3
%93 = load i32, i32* %4
%94 = call i32 @free_matrix(i32** %63, i32 %92, i32 %93)
%95 = load i32, i32* %3
%96 = load i32, i32* %4
%97 = call i32 @free_matrix(i32** %66, i32 %95, i32 %96)
%98 = load i32, i32* %3
%99 = load i32, i32* %4
%100 = call i32 @free_matrix(i32** %69, i32 %98, i32 %99)
ret void
}