#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 */
struct timeval {
  int dummy;
};
struct complex {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ check_result(struct complex **, struct complex **, int, int);
int /*<<< orphan*/ control_matmul(struct complex **, struct complex **,
                                  struct complex **, int, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ free_matrix(struct complex **);
struct complex **gen_random_matrix(int, int);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ matmul(struct complex **, struct complex **,
                          struct complex **, int, int, int);
struct complex **new_empty_matrix(int, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ stderr;
long long time_diff(struct timeval *, struct timeval *);
int main(int argc, char **argv) {
  struct complex **A, **B, **C;
  struct complex **ctrl_matrix;
  long long ctrl_time, mult_time;
  int a_dim1, a_dim2, b_dim1, b_dim2;
  struct timeval time0, time1, time2;
  double speedup;
  if (argc != 5) {
    fputs("Usage: matMul <A nrows> <A ncols> <B nrows> <B ncols>\n", stderr);
    return EXIT_FAILURE;
  } else {
    a_dim1 = atoi(argv[1]);
    a_dim2 = atoi(argv[2]);
    b_dim1 = atoi(argv[3]);
    b_dim2 = atoi(argv[4]);
  }
  if (a_dim2 != b_dim1) {
    fprintf(stderr,
            "FATAL number of columns of A (%d) does not "
            "match number of rows of B (%d)\n",
            a_dim2, b_dim1);
    return EXIT_FAILURE;
  }
  A = gen_random_matrix(a_dim1, a_dim2);
  B = gen_random_matrix(b_dim1, b_dim2);
  C = new_empty_matrix(a_dim1, b_dim2);
  ctrl_matrix = new_empty_matrix(a_dim1, b_dim2);

  gettimeofday(&time0, NULL);
  control_matmul(A, B, ctrl_matrix, a_dim1, a_dim2, b_dim2);
  gettimeofday(&time1, NULL);
  matmul(A, B, C, a_dim1, a_dim2, b_dim2);
  gettimeofday(&time2, NULL);
  ctrl_time = time_diff(&time0, &time1);
  mult_time = time_diff(&time1, &time2);
  speedup = (float)ctrl_time / mult_time;
  printf("Control time: %lld μs\n", ctrl_time);
  printf("Matmul  time: %lld μs\n", mult_time);
  if ((mult_time > 0) && (ctrl_time > 0)) {
    printf("Speedup:      %.2fx\n", speedup);
  }
  check_result(C, ctrl_matrix, a_dim1, b_dim2);

  free_matrix(A);
  free_matrix(B);
  free_matrix(C);
  free_matrix(ctrl_matrix);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1206 <main+0x46>
mov    0x2df9(%rip),%rax
mov    (%rax),%esi
lea    0xe10(%rip),%rdi
call   1070 <fputs@plt>
mov    0x2ddc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13e2 <main+0x222>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x50(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x4c(%rbp),%eax
je     127e <main+0xbe>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%edx
mov    -0x4c(%rbp),%ecx
lea    0xdcf(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2d64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13e2 <main+0x222>
mov    -0x44(%rbp),%edi
mov    -0x48(%rbp),%esi
call   1090 <gen_random_matrix@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x50(%rbp),%esi
call   1090 <gen_random_matrix@plt>
mov    %rax,-0x20(%rbp)
mov    -0x44(%rbp),%edi
mov    -0x50(%rbp),%esi
call   10a0 <new_empty_matrix@plt>
mov    %rax,-0x28(%rbp)
mov    -0x44(%rbp),%edi
mov    -0x50(%rbp),%esi
call   10a0 <new_empty_matrix@plt>
mov    %rax,-0x30(%rbp)
lea    -0x58(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%r8d
mov    -0x50(%rbp),%r9d
call   1030 <control_matmul@plt>
lea    -0x60(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%r8d
mov    -0x50(%rbp),%r9d
call   10d0 <matmul@plt>
lea    -0x68(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
lea    -0x58(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   10c0 <time_diff@plt>
mov    %rax,-0x38(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   10c0 <time_diff@plt>
mov    %rax,-0x40(%rbp)
cvtsi2ssq -0x38(%rbp),%xmm0
cvtsi2ssq -0x40(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
cvtsi2sdq -0x38(%rbp),%xmm0
lea    0xd21(%rip),%rdi
call   1050 <printf@plt>
cvtsi2sdq -0x40(%rbp),%xmm0
lea    0xd27(%rip),%rdi
call   1050 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
jle    139f <main+0x1df>
cmpq   $0x0,-0x38(%rbp)
jle    139f <main+0x1df>
movsd  -0x70(%rbp),%xmm0
lea    0xd18(%rip),%rdi
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x44(%rbp),%edx
mov    -0x50(%rbp),%ecx
call   10b0 <check_result@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free_matrix@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free_matrix@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free_matrix@plt>
mov    -0x30(%rbp),%rdi
call   1040 <free_matrix@plt>
mov    0x2bf3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x5,%edi
jne    136a <main+0x1aa>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r13d
mov    0x10(%rbx),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r14d
mov    0x18(%rbx),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
call   10e0 <atoi@plt>
cmp    %ebp,%r14d
jne    1381 <main+0x1c1>
mov    %eax,%r12d
mov    %r13d,%edi
mov    %r14d,%esi
call   1090 <gen_random_matrix@plt>
mov    %rax,%rbx
mov    %r14d,%edi
mov    %r12d,%esi
call   1090 <gen_random_matrix@plt>
mov    %rax,%rbp
mov    %r13d,%edi
mov    %r12d,%esi
call   10a0 <new_empty_matrix@plt>
mov    %rax,0x8(%rsp)
mov    %r13d,%edi
mov    %r12d,%esi
call   10a0 <new_empty_matrix@plt>
mov    %rax,%r15
mov    %rsp,%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,0x10(%rsp)
mov    %r15,%rdx
mov    %r13d,%r15d
mov    %r13d,%ecx
mov    %r14d,%r8d
mov    %r12d,%r9d
call   1030 <control_matmul@plt>
lea    0x30(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    %rbx,0x20(%rsp)
mov    %rbx,%rdi
mov    %rbp,0x18(%rsp)
mov    %rbp,%rsi
mov    0x8(%rsp),%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %r12d,%r9d
call   10d0 <matmul@plt>
lea    0x28(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    %rsp,%rdi
mov    %r13,%rsi
call   10c0 <time_diff@plt>
mov    %rax,%rbx
mov    %r13,%rdi
mov    %rbp,%rsi
call   10c0 <time_diff@plt>
mov    %rax,%rbp
cvtsi2sd %rbx,%xmm0
lea    0xda4(%rip),%rdi
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
lea    0xda8(%rip),%rdi
call   1050 <printf@plt>
test   %rbp,%rbp
jle    1322 <main+0x162>
test   %rbx,%rbx
jle    1322 <main+0x162>
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
cvtsi2ss %rbp,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd95(%rip),%rdi
call   1050 <printf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    0x10(%rsp),%rbp
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
call   10b0 <check_result@plt>
mov    0x20(%rsp),%rdi
call   1040 <free_matrix@plt>
mov    0x18(%rsp),%rdi
call   1040 <free_matrix@plt>
mov    %rbx,%rdi
call   1040 <free_matrix@plt>
mov    %rbp,%rdi
call   1040 <free_matrix@plt>
mov    0x2c68(%rip),%rax
jmp    13a2 <main+0x1e2>
mov    0x2c6f(%rip),%rax
mov    (%rax),%esi
lea    0xc86(%rip),%rdi
call   1070 <fputs@plt>
jmp    139b <main+0x1db>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
lea    0xca6(%rip),%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1080 <fprintf@plt>
mov    0x2c36(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.complex = type { i32 }
%struct.timeval = type { i32 }
@.str = [55 x i8] c"Usage: matMul <A nrows> <A ncols> <B nrows> <B ncols>\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [75 x i8] c"FATAL number of columns of A (%d) does not match number of rows of B (%d)\0A\00"
@.str.2 = [24 x i8] c"Control time: %lld \CE\BCs\0A\00"
@.str.3 = [24 x i8] c"Matmul time: %lld \CE\BCs\0A\00"
@.str.4 = [21 x i8] c"Speedup: %.2fx\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.complex**
%7 = alloca %struct.complex**
%8 = alloca %struct.complex**
%9 = alloca %struct.complex**
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca %struct.timeval
%17 = alloca %struct.timeval
%18 = alloca %struct.timeval
%19 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 5
br i1 %21, label %22, label %26
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32, i32* @EXIT_FAILURE
store i32 %25, i32* %3
br label %120
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %12
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %13
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 3
%37 = load i8*, i8** %36
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %14
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 4
%41 = load i8*, i8** %40
%42 = call i32 @atoi(i8* %41)
store i32 %42, i32* %15
br label %43
43: ; preds = %26
%44 = load i32, i32* %13
%45 = load i32, i32* %14
%46 = icmp ne i32 %44, %45
br i1 %46, label %47, label %53
47: ; preds = %43
%48 = load i32, i32* @stderr
%49 = load i32, i32* %13
%50 = load i32, i32* %14
%51 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0), i32 %49, i32 %50)
%52 = load i32, i32* @EXIT_FAILURE
store i32 %52, i32* %3
br label %120
53: ; preds = %43
%54 = load i32, i32* %12
%55 = load i32, i32* %13
%56 = call %struct.complex** @gen_random_matrix(i32 %54, i32 %55)
store %struct.complex** %56, %struct.complex*** %6
%57 = load i32, i32* %14
%58 = load i32, i32* %15
%59 = call %struct.complex** @gen_random_matrix(i32 %57, i32 %58)
store %struct.complex** %59, %struct.complex*** %7
%60 = load i32, i32* %12
%61 = load i32, i32* %15
%62 = call %struct.complex** @new_empty_matrix(i32 %60, i32 %61)
store %struct.complex** %62, %struct.complex*** %8
%63 = load i32, i32* %12
%64 = load i32, i32* %15
%65 = call %struct.complex** @new_empty_matrix(i32 %63, i32 %64)
store %struct.complex** %65, %struct.complex*** %9
%66 = call i32 @gettimeofday(%struct.timeval* %16, i32* null)
%67 = load %struct.complex**, %struct.complex*** %6
%68 = load %struct.complex**, %struct.complex*** %7
%69 = load %struct.complex**, %struct.complex*** %9
%70 = load i32, i32* %12
%71 = load i32, i32* %13
%72 = load i32, i32* %15
%73 = call i32 @control_matmul(%struct.complex** %67, %struct.complex** %68, %struct.complex** %69, i32 %70, i32 %71, i32 %72)
%74 = call i32 @gettimeofday(%struct.timeval* %17, i32* null)
%75 = load %struct.complex**, %struct.complex*** %6
%76 = load %struct.complex**, %struct.complex*** %7
%77 = load %struct.complex**, %struct.complex*** %8
%78 = load i32, i32* %12
%79 = load i32, i32* %13
%80 = load i32, i32* %15
%81 = call i32 @matmul(%struct.complex** %75, %struct.complex** %76, %struct.complex** %77, i32 %78, i32 %79, i32 %80)
%82 = call i32 @gettimeofday(%struct.timeval* %18, i32* null)
%83 = call i64 @time_diff(%struct.timeval* %16, %struct.timeval* %17)
store i64 %83, i64* %10
%84 = call i64 @time_diff(%struct.timeval* %17, %struct.timeval* %18)
store i64 %84, i64* %11
%85 = load i64, i64* %10
%86 = sitofp i64 %85 to float
%87 = load i64, i64* %11
%88 = sitofp i64 %87 to float
%89 = fdiv float %86, %88
%90 = fpext float %89 to double
store double %90, double* %19
%91 = load i64, i64* %10
%92 = sitofp i64 %91 to double
%93 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %92)
%94 = load i64, i64* %11
%95 = sitofp i64 %94 to double
%96 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %95)
%97 = load i64, i64* %11
%98 = icmp sgt i64 %97, 0
br i1 %98, label %99, label %105
99: ; preds = %53
%100 = load i64, i64* %10
%101 = icmp sgt i64 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %99
%103 = load double, double* %19
%104 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %103)
br label %105
105: ; preds = %102, %99, %53
%106 = load %struct.complex**, %struct.complex*** %8
%107 = load %struct.complex**, %struct.complex*** %9
%108 = load i32, i32* %12
%109 = load i32, i32* %15
%110 = call i32 @check_result(%struct.complex** %106, %struct.complex** %107, i32 %108, i32 %109)
%111 = load %struct.complex**, %struct.complex*** %6
%112 = call i32 @free_matrix(%struct.complex** %111)
%113 = load %struct.complex**, %struct.complex*** %7
%114 = call i32 @free_matrix(%struct.complex** %113)
%115 = load %struct.complex**, %struct.complex*** %8
%116 = call i32 @free_matrix(%struct.complex** %115)
%117 = load %struct.complex**, %struct.complex*** %9
%118 = call i32 @free_matrix(%struct.complex** %117)
%119 = load i32, i32* @EXIT_SUCCESS
store i32 %119, i32* %3
br label %120
120: ; preds = %105, %47, %22
%121 = load i32, i32* %3
ret i32 %121
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.complex = type { i32 }
@.str = [55 x i8] c"Usage: matMul <A nrows> <A ncols> <B nrows> <B ncols>\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [75 x i8] c"FATAL number of columns of A (%d) does not match number of rows of B (%d)\0A\00"
@.str.2 = [24 x i8] c"Control time: %lld \CE\BCs\0A\00"
@.str.3 = [24 x i8] c"Matmul time: %lld \CE\BCs\0A\00"
@.str.4 = [21 x i8] c"Speedup: %.2fx\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = bitcast %struct.timeval* %3 to i8*
%7 = bitcast %struct.timeval* %4 to i8*
%8 = bitcast %struct.timeval* %5 to i8*
%9 = icmp eq i32 %0, 5
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %61
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call i32 @atoi(i8* %18)
%20 = getelementptr inbounds i8*, i8** %1, i64 3
%21 = load i8*, i8** %20
%22 = tail call i32 @atoi(i8* %21)
%23 = getelementptr inbounds i8*, i8** %1, i64 4
%24 = load i8*, i8** %23
%25 = tail call i32 @atoi(i8* %24)
%26 = icmp eq i32 %19, %22
br i1 %26, label %30, label %27
27: ; preds = %13
%28 = load i32, i32* @stderr
%29 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %22)
br label %61
30: ; preds = %13
%31 = tail call %struct.complex** @gen_random_matrix(i32 %16, i32 %19)
%32 = tail call %struct.complex** @gen_random_matrix(i32 %19, i32 %25)
%33 = tail call %struct.complex** @new_empty_matrix(i32 %16, i32 %25)
%34 = tail call %struct.complex** @new_empty_matrix(i32 %16, i32 %25)
%35 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%36 = tail call i32 @control_matmul(%struct.complex** %31, %struct.complex** %32, %struct.complex** %34, i32 %16, i32 %19, i32 %25)
%37 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%38 = tail call i32 @matmul(%struct.complex** %31, %struct.complex** %32, %struct.complex** %33, i32 %16, i32 %19, i32 %25)
%39 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%40 = call i64 @time_diff(%struct.timeval* %3, %struct.timeval* %4)
%41 = call i64 @time_diff(%struct.timeval* %4, %struct.timeval* %5)
%42 = sitofp i64 %40 to double
%43 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %42)
%44 = sitofp i64 %41 to double
%45 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %44)
%46 = icmp sgt i64 %41, 0
%47 = icmp sgt i64 %40, 0
%48 = select i1 %46, i1 %47, i1 false
br i1 %48, label %49, label %55
49: ; preds = %30
%50 = sitofp i64 %40 to float
%51 = sitofp i64 %41 to float
%52 = fdiv float %50, %51
%53 = fpext float %52 to double
%54 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %53)
br label %55
55: ; preds = %49, %30
%56 = call i32 @check_result(%struct.complex** %33, %struct.complex** %34, i32 %16, i32 %25)
%57 = call i32 @free_matrix(%struct.complex** %31)
%58 = call i32 @free_matrix(%struct.complex** %32)
%59 = call i32 @free_matrix(%struct.complex** %33)
%60 = call i32 @free_matrix(%struct.complex** %34)
br label %61
61: ; preds = %55, %27, %10
%62 = phi i32* [ @EXIT_FAILURE, %10 ], [ @EXIT_FAILURE, %27 ], [ @EXIT_SUCCESS, %55 ]
%63 = load i32, i32* %62
ret i32 %63
}