#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_A1_or_A2_in_C(int **, int **, int **, int, int, double, int, 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_A2(int *, int *, int, int);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ usage(char *, char *, int);
void test_P_A1_or_A2_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 A1[2], A2[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_A2(A1, A2, M, N);
  P = P_A1_or_A2_in_C(site_marks, vbonds, hbonds, M, N, p, reps, A1, A2);
  printf("M=%d N=%d p=%.4lf reps=%d PU2inC=%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_A1_or_A2_in_C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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,-0x54(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12d3 <test_P_A1_or_A2_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_A1_or_A2_in_C+0x70>
jmp    12c0 <test_P_A1_or_A2_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_A1_or_A2_in_C+0x9c>
jmp    12bb <test_P_A1_or_A2_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_A1_or_A2_in_C+0xce>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12b6 <test_P_A1_or_A2_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_A1_or_A2_in_C+0xfa>
jmp    12b1 <test_P_A1_or_A2_in_C+0x141>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9c(%rip),%rsi
lea    -0x54(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    1296 <test_P_A1_or_A2_in_C+0x126>
jmp    12ac <test_P_A1_or_A2_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_A1_or_A2_in_C+0x141>
jmp    12b6 <test_P_A1_or_A2_in_C+0x146>
jmp    12bb <test_P_A1_or_A2_in_C+0x14b>
jmp    12c0 <test_P_A1_or_A2_in_C+0x150>
jmp    12c5 <test_P_A1_or_A2_in_C+0x155>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a8 <test_P_A1_or_A2_in_C+0x38>
cmpl   $0x3,-0x14(%rbp)
jl     12e7 <test_P_A1_or_A2_in_C+0x177>
cmpl   $0x3,-0x18(%rbp)
jge    1300 <test_P_A1_or_A2_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
lea    -0x50(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <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    -0x54(%rbp),%r9d
lea    -0x48(%rbp),%r10
lea    -0x50(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <P_A1_or_A2_in_C@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
mov    -0x54(%rbp),%ecx
movsd  -0x60(%rbp),%xmm1
lea    0xc87(%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    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_P_A1_or_A2_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,0x8(%rsp)
movl   $0x12,0x4(%rsp)
movabs $0x3fe3333333333333,%rcx
33 e3 3f
mov    %rcx,0x10(%rsp)
movl   $0x3e8,0xc(%rsp)
mov    $0x12,%esi
mov    $0x12,%edi
cmp    $0x3,%eax
jl     128e <test_P_A1_or_A2_in_C+0x11e>
mov    %eax,%ebp
mov    $0x2,%r12d
lea    0xe34(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%r13
jmp    11ed <test_P_A1_or_A2_in_C+0x7d>
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rsp)
add    $0x1,%r12
cmp    %r12,%rbp
je     1286 <test_P_A1_or_A2_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_A1_or_A2_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_A1_or_A2_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_A1_or_A2_in_C+0x68>
mov    (%rbx,%r12,8),%rdi
lea    0xdc9(%rip),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_P_A1_or_A2_in_C+0x70>
mov    (%rbx,%r12,8),%rdi
lea    0xdb3(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     11e0 <test_P_A1_or_A2_in_C+0x70>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
xor    %edx,%edx
call   1090 <usage@plt>
jmp    11e0 <test_P_A1_or_A2_in_C+0x70>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
cmp    $0x3,%edi
jl     1298 <test_P_A1_or_A2_in_C+0x128>
cmp    $0x2,%esi
jg     12b1 <test_P_A1_or_A2_in_C+0x141>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1,%edx
call   1090 <usage@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%r14
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
xor    %edx,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%r12
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
mov    $0x2e,%edx
call   1070 <allocate_matrix@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%rbp
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <set_A1_A2@plt>
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
movsd  0x10(%rsp),%xmm0
mov    0xc(%rsp),%r9d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
push   %rbp
push   %r15
call   1040 <P_A1_or_A2_in_C@plt>
add    $0x10,%rsp
movaps %xmm0,%xmm1
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x10(%rsp),%xmm0
mov    0xc(%rsp),%ecx
lea    0xcd5(%rip),%rdi
call   1060 <printf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r14,%rdi
call   1030 <free_matrix@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r12,%rdi
call   1030 <free_matrix@plt>
mov    0x8(%rsp),%esi
mov    0x4(%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 = [42 x i8] c"M=%d N=%d p=%.4lf reps=%d PU2inC=%11.7lf\0A\00"
define void @test_P_A1_or_A2_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 [2 x i32]
%14 = alloca 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* %14
store i32 2, i32* %8
br label %16
16: ; preds = %79, %2
%17 = load i32, i32* %8
%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* %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 %78
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 %77
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 %76
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 %75
57: ; preds = %48
%58 = load i8**, i8*** %4
%59 = load i32, i32* %8
%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* %14)
%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 0)
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* %8
%81 = add nsw i32 %80, 1
store i32 %81, i32* %8
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*** %9
%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*** %10
%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*** %11
%106 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%107 = getelementptr inbounds [2 x i32], [2 x i32]* %13, 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*** %11
%112 = load i32**, i32*** %9
%113 = load i32**, i32*** %10
%114 = load i32, i32* %5
%115 = load i32, i32* %6
%116 = load double, double* %7
%117 = load i32, i32* %14
%118 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%119 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%120 = call double @P_A1_or_A2_in_C(i32** %111, i32** %112, i32** %113, i32 %114, i32 %115, double %116, i32 %117, i32* %118, i32* %119)
store double %120, double* %15
%121 = load i32, i32* %5
%122 = load i32, i32* %6
%123 = load double, double* %7
%124 = load i32, i32* %14
%125 = load double, double* %15
%126 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %121, i32 %122, double %123, i32 %124, double %125)
%127 = load i32**, i32*** %9
%128 = load i32, i32* %5
%129 = load i32, i32* %6
%130 = call i32 @free_matrix(i32** %127, i32 %128, i32 %129)
%131 = load i32**, i32*** %10
%132 = load i32, i32* %5
%133 = load i32, i32* %6
%134 = call i32 @free_matrix(i32** %131, i32 %132, i32 %133)
%135 = load i32**, i32*** %11
%136 = load i32, i32* %5
%137 = load i32, i32* %6
%138 = call i32 @free_matrix(i32** %135, i32 %136, i32 %137)
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 = [42 x i8] c"M=%d N=%d p=%.4lf reps=%d PU2inC=%11.7lf\0A\00"
define void @test_P_A1_or_A2_in_C(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 = alloca 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 [2 x i32]* %6 to i8*
%13 = bitcast [2 x i32]* %7 to i8*
%14 = bitcast i32* %8 to i8*
store i32 1000, i32* %8
%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* %8)
%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 0)
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]* %6, i64 0, i64 0
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %7, 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* %8
%85 = call double @P_A1_or_A2_in_C(i32** %75, i32** %69, i32** %72, i32 %81, i32 %82, double %83, i32 %84, i32* %76, i32* %77)
%86 = load i32, i32* %3
%87 = load i32, i32* %4
%88 = load double, double* %5
%89 = load i32, i32* %8
%90 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 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
}