#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*/ plot_lattice(int **, int **, int **, int, int, int *, int *,
                                char *);
int /*<<< orphan*/ populate_bonds(int **, int **, int, int, double);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ set_A1_A2(int *, int *, int, int);
int sscanf(char *, char *, ...);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ usage(char *, char *, int);
void test_plot_lattice(int argc, char **argv) {
  int M = 200;
  int N = 200;
  double p = 0.6;
  int argi;
  int **vbonds;
  int **hbonds;
  int **site_marks;
  int A1[2];
  int A2[2];
  char *image_file_name = "p2.ppm";
  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 if (strncmp(argv[argi], "f=", 2) == 0)
      image_file_name = &argv[argi][2];
    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);
  plot_lattice(site_marks, vbonds, hbonds, M, N, A1, A2, image_file_name);
  printf("Wrote %s.\n", image_file_name);
  free_matrix(vbonds, M, N);
  free_matrix(hbonds, M, N);
  free_matrix(site_marks, M, N);
}


x86 assembly (clang, -O0):
<test_plot_lattice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc8,-0x14(%rbp)
movl   $0xc8,-0x18(%rbp)
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xe47(%rip),%rax
mov    %rax,-0x58(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    130b <test_plot_lattice+0x17b>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe24(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1204 <test_plot_lattice+0x74>
jmp    12f8 <test_plot_lattice+0x168>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdfe(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1230 <test_plot_lattice+0xa0>
jmp    12f3 <test_plot_lattice+0x163>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdd1(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1262 <test_plot_lattice+0xd2>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12ee <test_plot_lattice+0x15e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xda5(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    128e <test_plot_lattice+0xfe>
jmp    12e9 <test_plot_lattice+0x159>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd7f(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12ce <test_plot_lattice+0x13e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    $0x2,%rax
mov    %rax,-0x58(%rbp)
jmp    12e4 <test_plot_lattice+0x154>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %edx,%edx
call   10b0 <usage@plt>
jmp    12e9 <test_plot_lattice+0x159>
jmp    12ee <test_plot_lattice+0x15e>
jmp    12f3 <test_plot_lattice+0x163>
jmp    12f8 <test_plot_lattice+0x168>
jmp    12fd <test_plot_lattice+0x16d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cc <test_plot_lattice+0x3c>
cmpl   $0x3,-0x14(%rbp)
jl     131f <test_plot_lattice+0x18f>
cmpl   $0x3,-0x18(%rbp)
jge    1338 <test_plot_lattice+0x1a8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x1,%edx
call   10b0 <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),%r10
mov    -0x58(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10a0 <plot_lattice@plt>
mov    -0x58(%rbp),%rsi
lea    0xc52(%rip),%rdi
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <free_matrix@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <free_matrix@plt>
mov    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <free_matrix@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_plot_lattice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movl   $0xc8,0x4(%rsp)
movl   $0xc8,(%rsp)
movabs $0x3fe3333333333333,%rax
33 e3 3f
mov    %rax,0x10(%rsp)
cmp    $0x3,%edi
jl     12b2 <test_plot_lattice+0x122>
mov    %edi,%r14d
lea    0xe2e(%rip),%rax
mov    %rax,0x8(%rsp)
mov    $0x2,%r13d
lea    0xe23(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbp
jmp    120d <test_plot_lattice+0x7d>
mov    0x4(%rsp),%eax
mov    %eax,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r13
cmp    %r13,%r14
je     12ca <test_plot_lattice+0x13a>
mov    (%rbx,%r13,8),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x1,%eax
je     1200 <test_plot_lattice+0x70>
mov    (%rbx,%r13,8),%rdi
lea    0xddf(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x1,%eax
je     1200 <test_plot_lattice+0x70>
mov    (%rbx,%r13,8),%rdi
lea    0xdc4(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x1,%eax
je     11ee <test_plot_lattice+0x5e>
mov    (%rbx,%r13,8),%rdi
lea    0xdb0(%rip),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x1,%eax
je     1200 <test_plot_lattice+0x70>
mov    (%rbx,%r13,8),%rdi
lea    0xd9a(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12a0 <test_plot_lattice+0x110>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
xor    %edx,%edx
call   10b0 <usage@plt>
jmp    1200 <test_plot_lattice+0x70>
mov    (%rbx,%r13,8),%rax
add    $0x2,%rax
mov    %rax,0x8(%rsp)
jmp    1200 <test_plot_lattice+0x70>
lea    0xd47(%rip),%r13
mov    $0xc8,%esi
mov    $0xc8,%edi
cmp    $0x3,%edi
jge    12db <test_plot_lattice+0x14b>
jmp    12e0 <test_plot_lattice+0x150>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    0x8(%rsp),%r13
cmp    $0x3,%edi
jl     12e0 <test_plot_lattice+0x150>
cmp    $0x2,%esi
jg     12f8 <test_plot_lattice+0x168>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1,%edx
call   10b0 <usage@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
xor    %edx,%edx
call   1080 <allocate_matrix@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
xor    %edx,%edx
call   1080 <allocate_matrix@plt>
mov    %rax,%rbp
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    $0x2e,%edx
call   1080 <allocate_matrix@plt>
mov    %rax,%r14
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <set_A1_A2@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <populate_bonds@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r15,%r9
push   %r13
push   %r12
call   10a0 <plot_lattice@plt>
add    $0x10,%rsp
lea    0xc98(%rip),%rdi
mov    %r13,%rsi
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %rbx,%rdi
call   1040 <free_matrix@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %rbp,%rdi
call   1040 <free_matrix@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %r14,%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):
@.str = [7 x i8] c"p2.ppm\00"
@.str.1 = [5 x i8] c"M=%d\00"
@.str.2 = [5 x i8] c"N=%d\00"
@.str.3 = [6 x i8] c"MN=%d\00"
@.str.4 = [6 x i8] c"p=%lf\00"
@.str.5 = [3 x i8] c"f=\00"
@.str.6 = [11 x i8] c"Wrote %s.\0A\00"
define void @test_plot_lattice(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 i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 200, i32* %5
store i32 200, i32* %6
store double 6.000000e-01, double* %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %14
store i32 2, i32* %8
br label %15
15: ; preds = %84, %2
%16 = load i32, i32* %8
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %87
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.1, i64 0, i64 0), i32* %5)
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %28
27: ; preds = %19
br label %83
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.2, i64 0, i64 0), i32* %6)
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %37
36: ; preds = %28
br label %82
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.3, 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 %81
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.4, i64 0, i64 0), double* %7)
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %56
55: ; preds = %47
br label %80
56: ; preds = %47
%57 = load i8**, i8*** %4
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8*, i8** %57, i64 %59
%61 = load i8*, i8** %60
%62 = call i64 @strncmp(i8* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %71
64: ; preds = %56
%65 = load i8**, i8*** %4
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %65, i64 %67
%69 = load i8*, i8** %68
%70 = getelementptr inbounds i8, i8* %69, i64 2
store i8* %70, i8** %14
br label %79
71: ; preds = %56
%72 = load i8**, i8*** %4
%73 = getelementptr inbounds i8*, i8** %72, i64 0
%74 = load i8*, i8** %73
%75 = load i8**, i8*** %4
%76 = getelementptr inbounds i8*, i8** %75, i64 1
%77 = load i8*, i8** %76
%78 = call i32 @usage(i8* %74, i8* %77, i32 0)
br label %79
79: ; preds = %71, %64
br label %80
80: ; preds = %79, %55
br label %81
81: ; preds = %80, %45
br label %82
82: ; preds = %81, %36
br label %83
83: ; preds = %82, %27
br label %84
84: ; preds = %83
%85 = load i32, i32* %8
%86 = add nsw i32 %85, 1
store i32 %86, i32* %8
br label %15
87: ; preds = %15
%88 = load i32, i32* %5
%89 = icmp slt i32 %88, 3
br i1 %89, label %93, label %90
90: ; preds = %87
%91 = load i32, i32* %6
%92 = icmp slt i32 %91, 3
br i1 %92, label %93, label %101
93: ; preds = %90, %87
%94 = load i8**, i8*** %4
%95 = getelementptr inbounds i8*, i8** %94, i64 0
%96 = load i8*, i8** %95
%97 = load i8**, i8*** %4
%98 = getelementptr inbounds i8*, i8** %97, i64 1
%99 = load i8*, i8** %98
%100 = call i32 @usage(i8* %96, i8* %99, i32 1)
br label %101
101: ; preds = %93, %90
%102 = load i32, i32* %5
%103 = load i32, i32* %6
%104 = call i32** @allocate_matrix(i32 %102, i32 %103, i8 signext 0)
store i32** %104, i32*** %9
%105 = load i32, i32* %5
%106 = load i32, i32* %6
%107 = call i32** @allocate_matrix(i32 %105, i32 %106, i8 signext 0)
store i32** %107, i32*** %10
%108 = load i32, i32* %5
%109 = load i32, i32* %6
%110 = call i32** @allocate_matrix(i32 %108, i32 %109, i8 signext 46)
store i32** %110, i32*** %11
%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 = load i32, i32* %5
%114 = load i32, i32* %6
%115 = call i32 @set_A1_A2(i32* %111, i32* %112, i32 %113, i32 %114)
%116 = load i32**, i32*** %9
%117 = load i32**, i32*** %10
%118 = load i32, i32* %5
%119 = load i32, i32* %6
%120 = load double, double* %7
%121 = call i32 @populate_bonds(i32** %116, i32** %117, i32 %118, i32 %119, double %120)
%122 = load i32**, i32*** %11
%123 = load i32**, i32*** %9
%124 = load i32**, i32*** %10
%125 = load i32, i32* %5
%126 = load i32, i32* %6
%127 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%128 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%129 = load i8*, i8** %14
%130 = call i32 @plot_lattice(i32** %122, i32** %123, i32** %124, i32 %125, i32 %126, i32* %127, i32* %128, i8* %129)
%131 = load i8*, i8** %14
%132 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %131)
%133 = load i32**, i32*** %9
%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*** %10
%138 = load i32, i32* %5
%139 = load i32, i32* %6
%140 = call i32 @free_matrix(i32** %137, i32 %138, i32 %139)
%141 = load i32**, i32*** %11
%142 = load i32, i32* %5
%143 = load i32, i32* %6
%144 = call i32 @free_matrix(i32** %141, i32 %142, i32 %143)
ret void
}

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