#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_matrix(char *label, double m[256 + 1][20], int len) {
  int b, j;
  printf("%s:\n", label);
  for (b = 0; b < 20; b++) {
    printf("%d: ", b);
    for (j = 0; j < len; j++)
      printf("%g ", m[j][b]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x14,-0x18(%rbp)
jge    11bd <print_matrix+0xad>
mov    -0x18(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a1 <print_matrix+0x91>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0xa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115e <print_matrix+0x4e>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <print_matrix+0x2c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%eax
shl    $0x5,%rax
lea    (%rax,%rax,4),%rbp
lea    0xeb6(%rip),%r13
xor    %r12d,%r12d
jmp    1178 <print_matrix+0x58>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    $0x8,%rbx
cmp    $0x14,%r12
je     11be <print_matrix+0x9e>
lea    0xe86(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    1160 <print_matrix+0x40>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%r14,1),%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0xa0,%r14
cmp    %r14,%rbp
jne    11a0 <print_matrix+0x80>
jmp    1160 <print_matrix+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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