#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 *, ...);
int /*<<< orphan*/ putchar(char);
void output_matrix(float **m, int nrl, int nrh, int ncl, int nch) {
  int i, j;
  for (i = nrl; i <= nrh; i++) {
    for (j = ncl; j <= nch; j++) {
      printf("%.2f", m[i][j]);
      if (j < nch)
        putchar(' ');
      else
        putchar('\n');
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<output_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11cf <output_matrix+0xaf>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11bc <output_matrix+0x9c>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    119f <output_matrix+0x7f>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11a9 <output_matrix+0x89>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11ae <output_matrix+0x8e>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1151 <output_matrix+0x31>
jmp    11c1 <output_matrix+0xa1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <output_matrix+0x1f>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0x8(%rsp)
mov    %ecx,0x4(%rsp)
mov    %edx,(%rsp)
cmp    %edx,%esi
jle    1156 <output_matrix+0x36>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
mov    %rdi,%rbp
movslq 0x4(%rsp),%rax
movslq 0x8(%rsp),%r13
movslq %esi,%r14
addl   $0x1,(%rsp)
mov    %r13d,%ecx
mov    %rax,0x10(%rsp)
sub    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0xc(%rsp)
lea    0xe7e(%rip),%r15
jmp    119a <output_matrix+0x7a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r14
cmp    %r14d,(%rsp)
je     113e <output_matrix+0x1e>
mov    0x4(%rsp),%eax
cmp    0x8(%rsp),%eax
jg     1190 <output_matrix+0x70>
mov    0xc(%rsp),%r12d
mov    0x10(%rsp),%rbx
xchg   %ax,%ax
mov    0x0(%rbp,%r14,8),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmp    %r13,%rbx
mov    $0xa,%edi
mov    $0x20,%eax
cmovl  %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
add    $0xffffffff,%r12d
jne    11b0 <output_matrix+0x90>
jmp    1190 <output_matrix+0x70>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @output_matrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %1, %2
br i1 %6, label %35, label %7
7: ; preds = %5
%8 = icmp sgt i32 %3, %4
%9 = sext i32 %3 to i64
%10 = sext i32 %4 to i64
%11 = add i32 %4, 1
%12 = sext i32 %1 to i64
%13 = add i32 %2, 1
br label %14
14: ; preds = %7, %31
%15 = phi i64 [ %12, %7 ], [ %32, %31 ]
br i1 %8, label %31, label %16
16: ; preds = %14
%17 = getelementptr inbounds float*, float** %0, i64 %15
br label %18
18: ; preds = %16, %18
%19 = phi i64 [ %9, %16 ], [ %28, %18 ]
%20 = load float*, float** %17
%21 = getelementptr inbounds float, float* %20, i64 %19
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %23)
%25 = icmp slt i64 %19, %10
%26 = select i1 %25, i8 32, i8 10
%27 = tail call i32 @putchar(i8 signext %26)
%28 = add nsw i64 %19, 1
%29 = trunc i64 %28 to i32
%30 = icmp eq i32 %11, %29
br i1 %30, label %31, label %18
31: ; preds = %18, %14
%32 = add nsw i64 %15, 1
%33 = trunc i64 %32 to i32
%34 = icmp eq i32 %13, %33
br i1 %34, label %35, label %14
35: ; preds = %31, %5
%36 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}