#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 /*<<< orphan*/ printf(char *, ...);
void print_arr(double matrix_real[], double matrix_imag[], int size) {
  int i, j;
  for (i = 0; i < size; i++) {
    printf("\n");
    for (j = 0; j < size; j++)
      printf("%lf+I*%lf  ", matrix_real[i + size * j],
             matrix_imag[i + size * j]);
  }
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b6 <print_arr+0xa6>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a3 <print_arr+0x93>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe74(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <print_arr+0x3b>
jmp    11a8 <print_arr+0x98>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <print_arr+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edx,%edx
jle    11b9 <print_arr+0x99>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%r12d
lea    0x0(,%r12,8),%r13
xor    %eax,%eax
lea    0xeb0(%rip),%r15
mov    %r12,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,0x10(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rbp,1),%xmm0
movsd  (%r14,%rbp,1),%xmm1
mov    %r15,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    %r13,%rbp
add    $0xffffffffffffffff,%r12
jne    1180 <print_arr+0x60>
mov    0x10(%rsp),%rax
add    $0x1,%rax
add    $0x8,%rbx
add    $0x8,%r14
mov    0x8(%rsp),%r12
cmp    %r12,%rax
jne    1160 <print_arr+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c"%lf+I*%lf \00"
define void @print_arr(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %43, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %46
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %15
15: ; preds = %39, %13
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %42
19: ; preds = %15
%20 = load double*, double** %4
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %8
%24 = mul nsw i32 %22, %23
%25 = add nsw i32 %21, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %20, i64 %26
%28 = load double, double* %27
%29 = load double*, double** %5
%30 = load i32, i32* %7
%31 = load i32, i32* %6
%32 = load i32, i32* %8
%33 = mul nsw i32 %31, %32
%34 = add nsw i32 %30, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %29, i64 %35
%37 = load double, double* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %28, double %37)
br label %39
39: ; preds = %19
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
br label %15
42: ; preds = %15
br label %43
43: ; preds = %42
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %9
46: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"%lf+I*%lf \00"
define void @print_arr(double* nocapture %0, double* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %25
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %22, %5
%9 = phi i64 [ 0, %5 ], [ %23, %22 ]
%10 = tail call i32 @putchar(i32 10)
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %20, %11 ]
%13 = mul nsw i64 %12, %6
%14 = add nuw nsw i64 %13, %9
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %1, i64 %14
%18 = load double, double* %17
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %16, double %18)
%20 = add nuw nsw i64 %12, 1
%21 = icmp eq i64 %20, %7
br i1 %21, label %22, label %11
22: ; preds = %11
%23 = add nuw nsw i64 %9, 1
%24 = icmp eq i64 %23, %7
br i1 %24, label %25, label %8
25: ; preds = %22, %3
ret void
}