#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);
double get_corrlen(int **, int **, int **, int, int, double, int, int *);
int /*<<< orphan*/ printf(char *, int, int, double, int, double);
int /*<<< orphan*/ set_A1_A2(int *, int *, int, int);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ usage(char *, char *, int);
void test_corrlen(int argc, char **argv) {
  int M = 18;
  int N = 18;
  double p = 0.6;
  int reps = 1000;
  int argi;
  int **vbonds;
  int **hbonds;
  int **site_marks;
  int A1[2];
  int A2[2];
  double corrlen;
  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 (sscanf(argv[argi], "reps=%d", &reps) == 1)
      ;
    else
      usage(argv[0], argv[1], 1);
  }
  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);
  corrlen = get_corrlen(site_marks, vbonds, hbonds, M, N, p, reps, A1);
  printf("M=%d N=%d p=%.4lf reps=%d corrlen=%11.7lf\n", M, N, p, reps, corrlen);
  free_matrix(vbonds, M, N);
  free_matrix(hbonds, M, N);
  free_matrix(site_marks, M, N);
}


x86 assembly (clang, -O0):
<test_corrlen>:
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  0xe6b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x3e8,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12d6 <test_corrlen+0x166>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe41(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    11e0 <test_corrlen+0x70>
jmp    12c3 <test_corrlen+0x153>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe1b(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    120c <test_corrlen+0x9c>
jmp    12be <test_corrlen+0x14e>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdee(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    123e <test_corrlen+0xce>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12b9 <test_corrlen+0x149>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdc2(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    126a <test_corrlen+0xfa>
jmp    12b4 <test_corrlen+0x144>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9c(%rip),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    1296 <test_corrlen+0x126>
jmp    12af <test_corrlen+0x13f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x1,%edx
call   1090 <usage@plt>
jmp    12b4 <test_corrlen+0x144>
jmp    12b9 <test_corrlen+0x149>
jmp    12be <test_corrlen+0x14e>
jmp    12c3 <test_corrlen+0x153>
jmp    12c8 <test_corrlen+0x158>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11a8 <test_corrlen+0x38>
cmpl   $0x3,-0x14(%rbp)
jl     12ea <test_corrlen+0x17a>
cmpl   $0x3,-0x18(%rbp)
jge    1303 <test_corrlen+0x193>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x1,%edx
call   1090 <usage@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    $0x2e,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,-0x40(%rbp)
lea    -0x48(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <set_A1_A2@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
movsd  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%r9d
lea    -0x48(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <get_corrlen@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%ecx
movsd  -0x58(%rbp),%xmm1
lea    0xc8d(%rip),%rdi
call   1050 <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_corrlen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%eax
movl   $0x12,0x18(%rsp)
movl   $0x12,0x14(%rsp)
movabs $0x3fe3333333333333,%rcx
33 e3 3f
mov    %rcx,0x20(%rsp)
movl   $0x3e8,0x1c(%rsp)
mov    $0x12,%esi
mov    $0x12,%edi
cmp    $0x3,%eax
jl     1291 <test_corrlen+0x121>
mov    %eax,%ebp
mov    $0x2,%r12d
lea    0xe34(%rip),%r14
lea    0x18(%rsp),%r15
lea    0x14(%rsp),%r13
jmp    11ed <test_corrlen+0x7d>
mov    0x18(%rsp),%eax
mov    %eax,0x14(%rsp)
add    $0x1,%r12
cmp    %r12,%rbp
je     1289 <test_corrlen+0x119>
mov    (%rbx,%r12,8),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_corrlen+0x70>
mov    (%rbx,%r12,8),%rdi
lea    0xdf8(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_corrlen+0x70>
mov    (%rbx,%r12,8),%rdi
lea    0xddd(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11d8 <test_corrlen+0x68>
mov    (%rbx,%r12,8),%rdi
lea    0xdc9(%rip),%rsi
lea    0x20(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_corrlen+0x70>
mov    (%rbx,%r12,8),%rdi
lea    0xdb3(%rip),%rsi
lea    0x1c(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_corrlen+0x70>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1,%edx
call   1090 <usage@plt>
jmp    11e0 <test_corrlen+0x70>
mov    0x18(%rsp),%edi
mov    0x14(%rsp),%esi
cmp    $0x3,%edi
jl     129b <test_corrlen+0x12b>
cmp    $0x2,%esi
jg     12b4 <test_corrlen+0x144>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1,%edx
call   1090 <usage@plt>
mov    0x18(%rsp),%edi
mov    0x14(%rsp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%r14
mov    0x18(%rsp),%edi
mov    0x14(%rsp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%r15
mov    0x18(%rsp),%edi
mov    0x14(%rsp),%esi
mov    $0x2e,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%rbx
mov    0x18(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0x30(%rsp),%rbp
lea    0x28(%rsp),%rsi
mov    %rbp,%rdi
call   1040 <set_A1_A2@plt>
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
movsd  0x20(%rsp),%xmm0
mov    0x1c(%rsp),%r9d
mov    %rbp,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <get_corrlen@plt>
movaps %xmm0,%xmm1
mov    0x18(%rsp),%esi
mov    0x14(%rsp),%edx
movsd  0x20(%rsp),%xmm0
mov    0x1c(%rsp),%ecx
lea    0xcd8(%rip),%rdi
call   1050 <printf@plt>
mov    0x18(%rsp),%esi
mov    0x14(%rsp),%edx
mov    %r14,%rdi
call   1030 <free_matrix@plt>
mov    0x18(%rsp),%esi
mov    0x14(%rsp),%edx
mov    %r15,%rdi
call   1030 <free_matrix@plt>
mov    0x18(%rsp),%esi
mov    0x14(%rsp),%edx
mov    %rbx,%rdi
call   1030 <free_matrix@plt>
add    $0x38,%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 = [8 x i8] c"reps=%d\00"
@.str.5 = [43 x i8] c"M=%d N=%d p=%.4lf reps=%d corrlen=%11.7lf\0A\00"
define void @test_corrlen(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 i32**
%13 = alloca [2 x i32]
%14 = alloca [2 x i32]
%15 = alloca double
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 1000, i32* %8
store i32 2, i32* %9
br label %16
16: ; preds = %79, %2
%17 = load i32, i32* %9
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %82
20: ; preds = %16
%21 = load i8**, i8*** %4
%22 = load i32, i32* %9
%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 %78
29: ; preds = %20
%30 = load i8**, i8*** %4
%31 = load i32, i32* %9
%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 %77
38: ; preds = %29
%39 = load i8**, i8*** %4
%40 = load i32, i32* %9
%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 %76
48: ; preds = %38
%49 = load i8**, i8*** %4
%50 = load i32, i32* %9
%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 %75
57: ; preds = %48
%58 = load i8**, i8*** %4
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 (i8*, i8*, ...) @sscanf(i8* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %8)
%64 = icmp eq i32 %63, 1
br i1 %64, label %65, label %66
65: ; preds = %57
br label %74
66: ; preds = %57
%67 = load i8**, i8*** %4
%68 = getelementptr inbounds i8*, i8** %67, i64 0
%69 = load i8*, i8** %68
%70 = load i8**, i8*** %4
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
%73 = call i32 @usage(i8* %69, i8* %72, i32 1)
br label %74
74: ; preds = %66, %65
br label %75
75: ; preds = %74, %56
br label %76
76: ; preds = %75, %46
br label %77
77: ; preds = %76, %37
br label %78
78: ; preds = %77, %28
br label %79
79: ; preds = %78
%80 = load i32, i32* %9
%81 = add nsw i32 %80, 1
store i32 %81, i32* %9
br label %16
82: ; preds = %16
%83 = load i32, i32* %5
%84 = icmp slt i32 %83, 3
br i1 %84, label %88, label %85
85: ; preds = %82
%86 = load i32, i32* %6
%87 = icmp slt i32 %86, 3
br i1 %87, label %88, label %96
88: ; preds = %85, %82
%89 = load i8**, i8*** %4
%90 = getelementptr inbounds i8*, i8** %89, i64 0
%91 = load i8*, i8** %90
%92 = load i8**, i8*** %4
%93 = getelementptr inbounds i8*, i8** %92, i64 1
%94 = load i8*, i8** %93
%95 = call i32 @usage(i8* %91, i8* %94, i32 1)
br label %96
96: ; preds = %88, %85
%97 = load i32, i32* %5
%98 = load i32, i32* %6
%99 = call i32** @allocate_matrix(i32 %97, i32 %98, i8 signext 0)
store i32** %99, i32*** %10
%100 = load i32, i32* %5
%101 = load i32, i32* %6
%102 = call i32** @allocate_matrix(i32 %100, i32 %101, i8 signext 0)
store i32** %102, i32*** %11
%103 = load i32, i32* %5
%104 = load i32, i32* %6
%105 = call i32** @allocate_matrix(i32 %103, i32 %104, i8 signext 46)
store i32** %105, i32*** %12
%106 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%107 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
%108 = load i32, i32* %5
%109 = load i32, i32* %6
%110 = call i32 @set_A1_A2(i32* %106, i32* %107, i32 %108, i32 %109)
%111 = load i32**, i32*** %12
%112 = load i32**, i32*** %10
%113 = load i32**, i32*** %11
%114 = load i32, i32* %5
%115 = load i32, i32* %6
%116 = load double, double* %7
%117 = load i32, i32* %8
%118 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%119 = call double @get_corrlen(i32** %111, i32** %112, i32** %113, i32 %114, i32 %115, double %116, i32 %117, i32* %118)
store double %119, double* %15
%120 = load i32, i32* %5
%121 = load i32, i32* %6
%122 = load double, double* %7
%123 = load i32, i32* %8
%124 = load double, double* %15
%125 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %120, i32 %121, double %122, i32 %123, double %124)
%126 = load i32**, i32*** %10
%127 = load i32, i32* %5
%128 = load i32, i32* %6
%129 = call i32 @free_matrix(i32** %126, i32 %127, i32 %128)
%130 = load i32**, i32*** %11
%131 = load i32, i32* %5
%132 = load i32, i32* %6
%133 = call i32 @free_matrix(i32** %130, i32 %131, i32 %132)
%134 = load i32**, i32*** %12
%135 = load i32, i32* %5
%136 = load i32, i32* %6
%137 = call i32 @free_matrix(i32** %134, i32 %135, i32 %136)
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.4 = [8 x i8] c"reps=%d\00"
@.str.5 = [43 x i8] c"M=%d N=%d p=%.4lf reps=%d corrlen=%11.7lf\0A\00"
define void @test_corrlen(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca [2 x i32]
%8 = alloca [2 x i32]
%9 = bitcast i32* %3 to i8*
store i32 18, i32* %3
%10 = bitcast i32* %4 to i8*
store i32 18, i32* %4
%11 = bitcast double* %5 to i8*
store double 6.000000e-01, double* %5
%12 = bitcast i32* %6 to i8*
store i32 1000, i32* %6
%13 = bitcast [2 x i32]* %7 to i8*
%14 = bitcast [2 x i32]* %8 to i8*
%15 = icmp sgt i32 %0, 2
br i1 %15, label %16, label %53
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = zext i32 %0 to i64
br label %19
19: ; preds = %16, %47
%20 = phi i64 [ 2, %16 ], [ %48, %47 ]
%21 = getelementptr inbounds i8*, i8** %1, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 (i8*, i8*, ...) @sscanf(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%24 = icmp eq i32 %23, 1
br i1 %24, label %47, label %25
25: ; preds = %19
%26 = load i8*, i8** %21
%27 = call i32 (i8*, i8*, ...) @sscanf(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%28 = icmp eq i32 %27, 1
br i1 %28, label %47, label %29
29: ; preds = %25
%30 = load i8*, i8** %21
%31 = call i32 (i8*, i8*, ...) @sscanf(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = load i32, i32* %3
store i32 %34, i32* %4
br label %47
35: ; preds = %29
%36 = load i8*, i8** %21
%37 = call i32 (i8*, i8*, ...) @sscanf(i8* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double* %5)
%38 = icmp eq i32 %37, 1
br i1 %38, label %47, label %39
39: ; preds = %35
%40 = load i8*, i8** %21
%41 = call i32 (i8*, i8*, ...) @sscanf(i8* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%42 = icmp eq i32 %41, 1
br i1 %42, label %47, label %43
43: ; preds = %39
%44 = load i8*, i8** %1
%45 = load i8*, i8** %17
%46 = call i32 @usage(i8* %44, i8* %45, i32 1)
br label %47
47: ; preds = %19, %33, %43, %39, %35, %25
%48 = add nuw nsw i64 %20, 1
%49 = icmp eq i64 %48, %18
br i1 %49, label %50, label %19
50: ; preds = %47
%51 = load i32, i32* %3
%52 = load i32, i32* %4
br label %53
53: ; preds = %50, %2
%54 = phi i32 [ %52, %50 ], [ 18, %2 ]
%55 = phi i32 [ %51, %50 ], [ 18, %2 ]
%56 = icmp slt i32 %55, 3
%57 = icmp slt i32 %54, 3
%58 = select i1 %56, i1 true, i1 %57
br i1 %58, label %59, label %66
59: ; preds = %53
%60 = load i8*, i8** %1
%61 = getelementptr inbounds i8*, i8** %1, i64 1
%62 = load i8*, i8** %61
%63 = call i32 @usage(i8* %60, i8* %62, i32 1)
%64 = load i32, i32* %3
%65 = load i32, i32* %4
br label %66
66: ; preds = %53, %59
%67 = phi i32 [ %54, %53 ], [ %65, %59 ]
%68 = phi i32 [ %55, %53 ], [ %64, %59 ]
%69 = call i32** @allocate_matrix(i32 %68, i32 %67, i8 signext 0)
%70 = load i32, i32* %3
%71 = load i32, i32* %4
%72 = call i32** @allocate_matrix(i32 %70, i32 %71, i8 signext 0)
%73 = load i32, i32* %3
%74 = load i32, i32* %4
%75 = call i32** @allocate_matrix(i32 %73, i32 %74, i8 signext 46)
%76 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%78 = load i32, i32* %3
%79 = load i32, i32* %4
%80 = call i32 @set_A1_A2(i32* %76, i32* %77, i32 %78, i32 %79)
%81 = load i32, i32* %3
%82 = load i32, i32* %4
%83 = load double, double* %5
%84 = load i32, i32* %6
%85 = call double @get_corrlen(i32** %75, i32** %69, i32** %72, i32 %81, i32 %82, double %83, i32 %84, i32* %76)
%86 = load i32, i32* %3
%87 = load i32, i32* %4
%88 = load double, double* %5
%89 = load i32, i32* %6
%90 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %86, i32 %87, double %88, i32 %89, double %85)
%91 = load i32, i32* %3
%92 = load i32, i32* %4
%93 = call i32 @free_matrix(i32** %69, i32 %91, i32 %92)
%94 = load i32, i32* %3
%95 = load i32, i32* %4
%96 = call i32 @free_matrix(i32** %72, i32 %94, i32 %95)
%97 = load i32, i32* %3
%98 = load i32, i32* %4
%99 = call i32 @free_matrix(i32** %75, i32 %97, i32 %98)
ret void
}