#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 **allocate_matrix(int, int, char);
int /*<<< orphan*/ free_matrix(int **, int, int);
int /*<<< orphan*/ mark_cluster_numbers(int **, int **, int **, int, int,
                                        int /*<<< orphan*/);
int /*<<< orphan*/ populate_bonds(int **, int **, int, int, double);
int /*<<< orphan*/ print_lattice(int **, int **, int **, int, int, int *,
                                 int *);
int /*<<< orphan*/ print_lattice_and_cluster_numbers(int **, int **, int **,
                                                     int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sanity_check_cluster_numbers(int **, int **, int **, int,
                                                int);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ usage(char *, char *, int);
void test_cluster_numbers(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] = {-1, -1};
  int A2[2] = {-1, -1};
  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, '.');
  populate_bonds(vbonds, hbonds, M, N, p);
  print_lattice(site_marks, vbonds, hbonds, M, N, A1, A2);
  printf("\n");
  mark_cluster_numbers(site_marks, vbonds, hbonds, M, N, 0);
  print_lattice_and_cluster_numbers(site_marks, vbonds, hbonds, M, N);
  sanity_check_cluster_numbers(site_marks, vbonds, hbonds, M, N);
  free_matrix(vbonds, M, N);
  free_matrix(hbonds, M, N);
  free_matrix(site_marks, M, N);
}


x86 assembly (clang, -O0):
<test_cluster_numbers>:
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  0xe3b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0xe37(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe2c(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12e1 <test_cluster_numbers+0x141>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe0a(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    121f <test_cluster_numbers+0x7f>
jmp    12ce <test_cluster_numbers+0x12e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde4(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    124b <test_cluster_numbers+0xab>
jmp    12c9 <test_cluster_numbers+0x129>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdb7(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    127d <test_cluster_numbers+0xdd>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12c4 <test_cluster_numbers+0x124>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd8b(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    12a9 <test_cluster_numbers+0x109>
jmp    12bf <test_cluster_numbers+0x11f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %edx,%edx
call   10c0 <usage@plt>
jmp    12c4 <test_cluster_numbers+0x124>
jmp    12c9 <test_cluster_numbers+0x129>
jmp    12ce <test_cluster_numbers+0x12e>
jmp    12d3 <test_cluster_numbers+0x133>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e7 <test_cluster_numbers+0x47>
cmpl   $0x3,-0x14(%rbp)
jl     12f5 <test_cluster_numbers+0x155>
cmpl   $0x3,-0x18(%rbp)
jge    130e <test_cluster_numbers+0x16e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x1,%edx
call   10c0 <usage@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
xor    %edx,%edx
call   10a0 <allocate_matrix@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
xor    %edx,%edx
call   10a0 <allocate_matrix@plt>
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    $0x2e,%edx
call   10a0 <allocate_matrix@plt>
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
call   1090 <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   1050 <print_lattice@plt>
lea    0xc9a(%rip),%rdi
call   1070 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
xor    %r9d,%r9d
call   1060 <mark_cluster_numbers@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1080 <print_lattice_and_cluster_numbers@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1040 <sanity_check_cluster_numbers@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_cluster_numbers>:
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)
movq   $0xffffffffffffffff,0x20(%rsp)
ff ff
movq   $0xffffffffffffffff,0x18(%rsp)
ff ff
mov    $0x12,%esi
mov    $0x12,%edi
cmp    $0x3,%eax
jl     12a7 <test_cluster_numbers+0x107>
mov    %eax,%ebp
mov    $0x2,%r12d
lea    0xdfa(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r13
jmp    1229 <test_cluster_numbers+0x89>
mov    0xc(%rsp),%eax
mov    %eax,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,%rbp
je     129f <test_cluster_numbers+0xff>
mov    (%rbx,%r12,8),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
je     1220 <test_cluster_numbers+0x80>
mov    (%rbx,%r12,8),%rdi
lea    0xdbc(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
je     1220 <test_cluster_numbers+0x80>
mov    (%rbx,%r12,8),%rdi
lea    0xda1(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
je     1212 <test_cluster_numbers+0x72>
mov    (%rbx,%r12,8),%rdi
lea    0xd8d(%rip),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
je     1220 <test_cluster_numbers+0x80>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
xor    %edx,%edx
call   10c0 <usage@plt>
jmp    1220 <test_cluster_numbers+0x80>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
cmp    $0x3,%edi
jl     12b1 <test_cluster_numbers+0x111>
cmp    $0x2,%esi
jg     12ca <test_cluster_numbers+0x12a>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1,%edx
call   10c0 <usage@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
xor    %edx,%edx
call   10a0 <allocate_matrix@plt>
mov    %rax,%r14
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
xor    %edx,%edx
call   10a0 <allocate_matrix@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    $0x2e,%edx
call   10a0 <allocate_matrix@plt>
mov    %rax,%r15
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
movsd  0x10(%rsp),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <populate_bonds@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
lea    0x18(%rsp),%rax
mov    %rax,(%rsp)
lea    0x20(%rsp),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <print_lattice@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %r9d,%r9d
call   1070 <mark_cluster_numbers@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1080 <print_lattice_and_cluster_numbers@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <sanity_check_cluster_numbers@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r14,%rdi
call   1040 <free_matrix@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1040 <free_matrix@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r15,%rdi
call   1040 <free_matrix@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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