#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*/ stdout;
void smr_dump(double smr[2][32], int nch) {
  int ch, sb;
  fprintf(stdout, "SMR:");
  for (ch = 0; ch < nch; ch++) {
    if (ch == 1)
      fprintf(stdout, "    ");
    for (sb = 0; sb < 32; sb++)
      fprintf(stdout, "%3.0f ", smr[ch][sb]);
    fprintf(stdout, "\n");
  }
}


x86 assembly (clang, -O0):
<smr_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11dd <smr_dump+0xcd>
cmpl   $0x1,-0x10(%rbp)
jne    116a <smr_dump+0x5a>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    11b8 <smr_dump+0xa8>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe67(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1171 <smr_dump+0x61>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <smr_dump+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smr_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2eb8(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r14d,%r14d
jle    11ae <smr_dump+0x9e>
mov    %r14d,%r13d
lea    0xec2(%rip),%r15
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%r14
jne    1167 <smr_dump+0x57>
mov    0x0(%rbp),%edi
lea    0xea5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
movsd  (%rbx,%r12,8),%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x1,%r12
cmp    $0x20,%r12
jne    1170 <smr_dump+0x60>
mov    0x0(%rbp),%edi
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r14
add    $0x100,%rbx
cmp    %r13,%r14
jne    1150 <smr_dump+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"SMR:\00"
@.str.1 = [5 x i8] c" \00"
@.str.2 = [7 x i8] c"%3.0f \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @smr_dump([32 x double]* nocapture %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %28
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %23
%9 = phi i64 [ 0, %6 ], [ %26, %23 ]
%10 = icmp eq i64 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* @stdout
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %8
br label %15
15: ; preds = %14, %15
%16 = phi i64 [ %21, %15 ], [ 0, %14 ]
%17 = load i32, i32* @stdout
%18 = getelementptr inbounds [32 x double], [32 x double]* %0, i64 %9, i64 %16
%19 = load double, double* %18
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %19)
%21 = add nuw nsw i64 %16, 1
%22 = icmp eq i64 %21, 32
br i1 %22, label %23, label %15
23: ; preds = %15
%24 = load i32, i32* @stdout
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = add nuw nsw i64 %9, 1
%27 = icmp eq i64 %26, %7
br i1 %27, label %28, label %8
28: ; preds = %23, %2
ret void
}