#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 */
double P_A_in_C(int **, int **, int **, int, int, double, int, int *);
int **allocate_matrix(int, int, char);
int /*<<< orphan*/ free_matrix(int **, int, int);
int /*<<< orphan*/ printf(char *, int, int, double, int, double);
int /*<<< orphan*/ set_A1(int *, int, int);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ usage(char *, char *, int);
void test_P_A_in_C(int argc, char **argv) {
  int M = 18;
  int N = 18;
  double p = 0.6;
  int argi;
  int **vbonds;
  int **hbonds;
  int **site_marks;
  int A[2];
  int reps = 1000;
  double P;
  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], 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(A, M, N);
  P = P_A_in_C(site_marks, vbonds, hbonds, M, N, p, reps, A);
  printf("M=%d N=%d p=%.4lf reps=%d PAinC=%11.7lf\n", M, N, p, reps, P);
  free_matrix(vbonds, M, N);
  free_matrix(hbonds, M, N);
  free_matrix(site_marks, M, N);
}


x86 assembly (clang, -O0):
<test_P_A_in_C>:
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,-0x4c(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12d3 <test_P_A_in_C+0x163>
mov    -0x10(%rbp),%rax
movslq -0x24(%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_P_A_in_C+0x70>
jmp    12c0 <test_P_A_in_C+0x150>
mov    -0x10(%rbp),%rax
movslq -0x24(%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_P_A_in_C+0x9c>
jmp    12bb <test_P_A_in_C+0x14b>
mov    -0x10(%rbp),%rax
movslq -0x24(%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_P_A_in_C+0xce>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12b6 <test_P_A_in_C+0x146>
mov    -0x10(%rbp),%rax
movslq -0x24(%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_P_A_in_C+0xfa>
jmp    12b1 <test_P_A_in_C+0x141>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9c(%rip),%rsi
lea    -0x4c(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    1296 <test_P_A_in_C+0x126>
jmp    12ac <test_P_A_in_C+0x13c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %edx,%edx
call   1090 <usage@plt>
jmp    12b1 <test_P_A_in_C+0x141>
jmp    12b6 <test_P_A_in_C+0x146>
jmp    12bb <test_P_A_in_C+0x14b>
jmp    12c0 <test_P_A_in_C+0x150>
jmp    12c5 <test_P_A_in_C+0x155>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a8 <test_P_A_in_C+0x38>
cmpl   $0x3,-0x14(%rbp)
jl     12e7 <test_P_A_in_C+0x177>
cmpl   $0x3,-0x18(%rbp)
jge    1300 <test_P_A_in_C+0x190>
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
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <set_A1@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    -0x4c(%rbp),%r9d
lea    -0x48(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <P_A_in_C@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
mov    -0x4c(%rbp),%ecx
movsd  -0x58(%rbp),%xmm1
lea    0xc94(%rip),%rdi
call   1040 <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_P_A_in_C>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%eax
movl   $0x12,0x10(%rsp)
movl   $0x12,0xc(%rsp)
movabs $0x3fe3333333333333,%rcx
33 e3 3f
mov    %rcx,0x18(%rsp)
movl   $0x3e8,0x14(%rsp)
mov    $0x12,%esi
mov    $0x12,%edi
cmp    $0x3,%eax
jl     128e <test_P_A_in_C+0x11e>
mov    %eax,%ebp
mov    $0x2,%r12d
lea    0xe34(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r13
jmp    11ed <test_P_A_in_C+0x7d>
mov    0x10(%rsp),%eax
mov    %eax,0xc(%rsp)
add    $0x1,%r12
cmp    %r12,%rbp
je     1286 <test_P_A_in_C+0x116>
mov    (%rbx,%r12,8),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_P_A_in_C+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_P_A_in_C+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_P_A_in_C+0x68>
mov    (%rbx,%r12,8),%rdi
lea    0xdc9(%rip),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_P_A_in_C+0x70>
mov    (%rbx,%r12,8),%rdi
lea    0xdb3(%rip),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_P_A_in_C+0x70>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
xor    %edx,%edx
call   1090 <usage@plt>
jmp    11e0 <test_P_A_in_C+0x70>
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
cmp    $0x3,%edi
jl     1298 <test_P_A_in_C+0x128>
cmp    $0x2,%esi
jg     12b1 <test_P_A_in_C+0x141>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1,%edx
call   1090 <usage@plt>
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%r14
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%r15
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    $0x2e,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <set_A1@plt>
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%r8d
movsd  0x18(%rsp),%xmm0
mov    0x14(%rsp),%r9d
mov    %rbp,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <P_A_in_C@plt>
movaps %xmm0,%xmm1
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
movsd  0x18(%rsp),%xmm0
mov    0x14(%rsp),%ecx
lea    0xce0(%rip),%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %r14,%rdi
call   1030 <free_matrix@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %r15,%rdi
call   1030 <free_matrix@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
call   1030 <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 = [8 x i8] c"reps=%d\00"
@.str.5 = [41 x i8] c"M=%d N=%d p=%.4lf reps=%d PAinC=%11.7lf\0A\00"
define void @test_P_A_in_C(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 i32
%14 = 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* %13
store i32 2, i32* %8
br label %15
15: ; preds = %78, %2
%16 = load i32, i32* %8
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %81
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 %77
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 %76
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 %75
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 %74
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 i32 (i8*, i8*, ...) @sscanf(i8* %61, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %13)
%63 = icmp eq i32 %62, 1
br i1 %63, label %64, label %65
64: ; preds = %56
br label %73
65: ; preds = %56
%66 = load i8**, i8*** %4
%67 = getelementptr inbounds i8*, i8** %66, i64 0
%68 = load i8*, i8** %67
%69 = load i8**, i8*** %4
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i32 @usage(i8* %68, i8* %71, i32 0)
br label %73
73: ; preds = %65, %64
br label %74
74: ; preds = %73, %55
br label %75
75: ; preds = %74, %45
br label %76
76: ; preds = %75, %36
br label %77
77: ; preds = %76, %27
br label %78
78: ; preds = %77
%79 = load i32, i32* %8
%80 = add nsw i32 %79, 1
store i32 %80, i32* %8
br label %15
81: ; preds = %15
%82 = load i32, i32* %5
%83 = icmp slt i32 %82, 3
br i1 %83, label %87, label %84
84: ; preds = %81
%85 = load i32, i32* %6
%86 = icmp slt i32 %85, 3
br i1 %86, label %87, label %95
87: ; preds = %84, %81
%88 = load i8**, i8*** %4
%89 = getelementptr inbounds i8*, i8** %88, i64 0
%90 = load i8*, i8** %89
%91 = load i8**, i8*** %4
%92 = getelementptr inbounds i8*, i8** %91, i64 1
%93 = load i8*, i8** %92
%94 = call i32 @usage(i8* %90, i8* %93, i32 1)
br label %95
95: ; preds = %87, %84
%96 = load i32, i32* %5
%97 = load i32, i32* %6
%98 = call i32** @allocate_matrix(i32 %96, i32 %97, i8 signext 0)
store i32** %98, i32*** %9
%99 = load i32, i32* %5
%100 = load i32, i32* %6
%101 = call i32** @allocate_matrix(i32 %99, i32 %100, i8 signext 0)
store i32** %101, i32*** %10
%102 = load i32, i32* %5
%103 = load i32, i32* %6
%104 = call i32** @allocate_matrix(i32 %102, i32 %103, i8 signext 46)
store i32** %104, i32*** %11
%105 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%106 = load i32, i32* %5
%107 = load i32, i32* %6
%108 = call i32 @set_A1(i32* %105, i32 %106, i32 %107)
%109 = load i32**, i32*** %11
%110 = load i32**, i32*** %9
%111 = load i32**, i32*** %10
%112 = load i32, i32* %5
%113 = load i32, i32* %6
%114 = load double, double* %7
%115 = load i32, i32* %13
%116 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%117 = call double @P_A_in_C(i32** %109, i32** %110, i32** %111, i32 %112, i32 %113, double %114, i32 %115, i32* %116)
store double %117, double* %14
%118 = load i32, i32* %5
%119 = load i32, i32* %6
%120 = load double, double* %7
%121 = load i32, i32* %13
%122 = load double, double* %14
%123 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %118, i32 %119, double %120, i32 %121, double %122)
%124 = load i32**, i32*** %9
%125 = load i32, i32* %5
%126 = load i32, i32* %6
%127 = call i32 @free_matrix(i32** %124, i32 %125, i32 %126)
%128 = load i32**, i32*** %10
%129 = load i32, i32* %5
%130 = load i32, i32* %6
%131 = call i32 @free_matrix(i32** %128, i32 %129, i32 %130)
%132 = load i32**, i32*** %11
%133 = load i32, i32* %5
%134 = load i32, i32* %6
%135 = call i32 @free_matrix(i32** %132, i32 %133, i32 %134)
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 = [41 x i8] c"M=%d N=%d p=%.4lf reps=%d PAinC=%11.7lf\0A\00"
define void @test_P_A_in_C(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca [2 x i32]
%7 = alloca 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 i32* %7 to i8*
store i32 1000, i32* %7
%13 = icmp sgt i32 %0, 2
br i1 %13, label %14, label %51
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = zext i32 %0 to i64
br label %17
17: ; preds = %14, %45
%18 = phi i64 [ 2, %14 ], [ %46, %45 ]
%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 %45, 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 %45, 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 %45
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 %45, label %37
37: ; preds = %33
%38 = load i8*, i8** %19
%39 = call i32 (i8*, i8*, ...) @sscanf(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%40 = icmp eq i32 %39, 1
br i1 %40, label %45, label %41
41: ; preds = %37
%42 = load i8*, i8** %1
%43 = load i8*, i8** %15
%44 = call i32 @usage(i8* %42, i8* %43, i32 0)
br label %45
45: ; preds = %17, %31, %41, %37, %33, %23
%46 = add nuw nsw i64 %18, 1
%47 = icmp eq i64 %46, %16
br i1 %47, label %48, label %17
48: ; preds = %45
%49 = load i32, i32* %3
%50 = load i32, i32* %4
br label %51
51: ; preds = %48, %2
%52 = phi i32 [ %50, %48 ], [ 18, %2 ]
%53 = phi i32 [ %49, %48 ], [ 18, %2 ]
%54 = icmp slt i32 %53, 3
%55 = icmp slt i32 %52, 3
%56 = select i1 %54, i1 true, i1 %55
br i1 %56, label %57, label %64
57: ; preds = %51
%58 = load i8*, i8** %1
%59 = getelementptr inbounds i8*, i8** %1, i64 1
%60 = load i8*, i8** %59
%61 = call i32 @usage(i8* %58, i8* %60, i32 1)
%62 = load i32, i32* %3
%63 = load i32, i32* %4
br label %64
64: ; preds = %51, %57
%65 = phi i32 [ %52, %51 ], [ %63, %57 ]
%66 = phi i32 [ %53, %51 ], [ %62, %57 ]
%67 = call i32** @allocate_matrix(i32 %66, i32 %65, i8 signext 0)
%68 = load i32, i32* %3
%69 = load i32, i32* %4
%70 = call i32** @allocate_matrix(i32 %68, i32 %69, i8 signext 0)
%71 = load i32, i32* %3
%72 = load i32, i32* %4
%73 = call i32** @allocate_matrix(i32 %71, i32 %72, i8 signext 46)
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%75 = load i32, i32* %3
%76 = load i32, i32* %4
%77 = call i32 @set_A1(i32* %74, i32 %75, i32 %76)
%78 = load i32, i32* %3
%79 = load i32, i32* %4
%80 = load double, double* %5
%81 = load i32, i32* %7
%82 = call double @P_A_in_C(i32** %73, i32** %67, i32** %70, i32 %78, i32 %79, double %80, i32 %81, i32* %74)
%83 = load i32, i32* %3
%84 = load i32, i32* %4
%85 = load double, double* %5
%86 = load i32, i32* %7
%87 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %83, i32 %84, double %85, i32 %86, double %82)
%88 = load i32, i32* %3
%89 = load i32, i32* %4
%90 = call i32 @free_matrix(i32** %67, i32 %88, i32 %89)
%91 = load i32, i32* %3
%92 = load i32, i32* %4
%93 = call i32 @free_matrix(i32** %70, i32 %91, i32 %92)
%94 = load i32, i32* %3
%95 = load i32, i32* %4
%96 = call i32 @free_matrix(i32** %73, i32 %94, i32 %95)
ret void
}