#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_array(int ni, int nl, float D[1024 + 0][1024 + 0]) {
  int i, j;
  fprintf(stderr, "==BEGIN DUMP_ARRAYS==\n");
  fprintf(stderr, "begin dump: %s", "D");
  for (i = 0; i < ni; i++)
    for (j = 0; j < nl; j++) {
      if ((i * ni + j) % 20 == 0)
        fprintf(stderr, "\n");
      fprintf(stderr, "%0.2f ", D[i][j]);
    }
  fprintf(stderr, "\nend   dump: %s\n", "D");
  fprintf(stderr, "==END   DUMP_ARRAYS==\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
lea    0xed6(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1203 <print_array+0xf3>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f0 <print_array+0xe0>
mov    -0x14(%rbp),%eax
imul   -0x4(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11af <print_array+0x9f>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0xc,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4d(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1171 <print_array+0x61>
jmp    11f5 <print_array+0xe5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <print_array+0x4e>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
lea    0xe1c(%rip),%rsi
lea    0xe0c(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
lea    0xe0f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,0x4(%rsp)
mov    %edi,%ebp
mov    0x2eb2(%rip),%r12
mov    (%r12),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xecc(%rip),%rsi
lea    0xed4(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebp,%ebp
jle    11fe <print_array+0xee>
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
mov    0x4(%rsp),%r14d
lea    0xeb4(%rip),%rbp
xor    %r13d,%r13d
xor    %ecx,%ecx
jmp    119d <print_array+0x8d>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rcx
add    $0x1,%rcx
mov    0x8(%rsp),%rax
add    %rax,%r13
add    $0x1000,%rbx
cmp    %rax,%rcx
je     11fe <print_array+0xee>
mov    %rcx,0x10(%rsp)
cmpl   $0x0,0x4(%rsp)
jle    1180 <print_array+0x70>
xor    %r15d,%r15d
jmp    11d1 <print_array+0xc1>
xchg   %ax,%ax
mov    (%r12),%edi
movss  (%rbx,%r15,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x1,%r15
cmp    %r15,%r14
je     1180 <print_array+0x70>
lea    (%r15,%r13,1),%eax
imul   $0xcccccccd,%eax,%eax
add    $0x19999998,%eax
ror    $0x2,%eax
cmp    $0xccccccc,%eax
ja     11b0 <print_array+0xa0>
mov    (%r12),%edi
lea    0xe60(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    11b0 <print_array+0xa0>
mov    (%r12),%edi
lea    0xe26(%rip),%rsi
lea    0xe16(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xe1e(%rip),%rsi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"==BEGIN DUMP_ARRAYS==\0A\00"
@.str.1 = [15 x i8] c"begin dump: %s\00"
@.str.2 = [2 x i8] c"D\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [7 x i8] c"%0.2f \00"
@.str.5 = [17 x i8] c"\0Aend dump: %s\0A\00"
@.str.6 = [23 x i8] c"==END DUMP_ARRAYS==\0A\00"
define void @print_array(i32 %0, i32 %1, [1024 x float]* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1024 x float]*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store [1024 x float]* %2, [1024 x float]** %6
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %13
13: ; preds = %49, %3
%14 = load i32, i32* %7
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %52
17: ; preds = %13
store i32 0, i32* %8
br label %18
18: ; preds = %45, %17
%19 = load i32, i32* %8
%20 = load i32, i32* %5
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %48
22: ; preds = %18
%23 = load i32, i32* %7
%24 = load i32, i32* %4
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %8
%27 = add nsw i32 %25, %26
%28 = srem i32 %27, 20
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %22
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %33
33: ; preds = %30, %22
%34 = load i32, i32* @stderr
%35 = load [1024 x float]*, [1024 x float]** %6
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [1024 x float], [1024 x float]* %35, i64 %37
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1024 x float], [1024 x float]* %38, i64 0, i64 %40
%42 = load float, float* %41
%43 = fpext float %42 to double
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %43)
br label %45
45: ; preds = %33
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %18
48: ; preds = %18
br label %49
49: ; preds = %48
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %13
52: ; preds = %13
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"==BEGIN DUMP_ARRAYS==\0A\00"
@.str.1 = [15 x i8] c"begin dump: %s\00"
@.str.2 = [2 x i8] c"D\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [7 x i8] c"%0.2f \00"
@.str.5 = [17 x i8] c"\0Aend dump: %s\0A\00"
@.str.6 = [23 x i8] c"==END DUMP_ARRAYS==\0A\00"
define void @print_array(i32 %0, i32 %1, [1024 x float]* nocapture %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %38
9: ; preds = %3
%10 = icmp sgt i32 %1, 0
%11 = zext i32 %0 to i64
%12 = zext i32 %1 to i64
br label %13
13: ; preds = %9, %35
%14 = phi i64 [ 0, %9 ], [ %36, %35 ]
br i1 %10, label %15, label %35
15: ; preds = %13
%16 = trunc i64 %14 to i32
%17 = mul nsw i32 %16, %0
br label %18
18: ; preds = %15, %27
%19 = phi i64 [ 0, %15 ], [ %33, %27 ]
%20 = trunc i64 %19 to i32
%21 = add nsw i32 %17, %20
%22 = srem i32 %21, 20
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %18
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %24, %18
%28 = load i32, i32* @stderr
%29 = getelementptr inbounds [1024 x float], [1024 x float]* %2, i64 %14, i64 %19
%30 = load float, float* %29
%31 = fpext float %30 to double
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %31)
%33 = add nuw nsw i64 %19, 1
%34 = icmp eq i64 %33, %12
br i1 %34, label %35, label %18
35: ; preds = %27, %13
%36 = add nuw nsw i64 %14, 1
%37 = icmp eq i64 %36, %11
br i1 %37, label %38, label %13
38: ; preds = %35, %3
%39 = load i32, i32* @stderr
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%41 = load i32, i32* @stderr
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
ret void
}