#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 dump_T_matrix(int nr_rows, int nr_cols, long double *mtx) {
  int i, j;
  printf("T matrix dump:\n");
  printf("nr rows: %d\n", nr_rows);
  printf("nr columns: %d\n", nr_cols);
  for (i = 0; i < nr_rows; i++) {
    for (j = 0; j < nr_cols; j++) {
      printf("%Lf  ", *mtx);
      mtx++;
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_T_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11c7 <dump_T_matrix+0xb7>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ab <dump_T_matrix+0x9b>
mov    -0x10(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116c <dump_T_matrix+0x5c>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <dump_T_matrix+0x49>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_T_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%r14d
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
lea    0xea6(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea2(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
jle    11ca <dump_T_matrix+0x9a>
lea    0xe9c(%rip),%r13
xor    %r12d,%r12d
jmp    11a3 <dump_T_matrix+0x73>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    %r14d,%r12d
je     11ca <dump_T_matrix+0x9a>
test   %r15d,%r15d
jle    1190 <dump_T_matrix+0x60>
mov    %r15d,%ebp
nopl   0x0(%rax,%rax,1)
fldt   (%rbx)
fstpt  (%rsp)
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x10,%rbx
add    $0xffffffff,%ebp
jne    11b0 <dump_T_matrix+0x80>
jmp    1190 <dump_T_matrix+0x60>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str.1 = [13 x i8] c"nr rows: %d\0A\00"
@.str.2 = [16 x i8] c"nr columns: %d\0A\00"
@.str.3 = [6 x i8] c"%Lf \00"
@str = [15 x i8] c"T matrix dump:\00"
define void @dump_T_matrix(i32 %0, i32 %1, x86_fp80* nocapture %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %26
8: ; preds = %3
%9 = icmp sgt i32 %1, 0
br label %10
10: ; preds = %8, %21
%11 = phi i32 [ 0, %8 ], [ %24, %21 ]
%12 = phi x86_fp80* [ %2, %8 ], [ %22, %21 ]
br i1 %9, label %13, label %21
13: ; preds = %10, %13
%14 = phi i32 [ %19, %13 ], [ 0, %10 ]
%15 = phi x86_fp80* [ %18, %13 ], [ %12, %10 ]
%16 = load x86_fp80, x86_fp80* %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %16)
%18 = getelementptr inbounds x86_fp80, x86_fp80* %15, i64 1
%19 = add nuw nsw i32 %14, 1
%20 = icmp eq i32 %19, %1
br i1 %20, label %21, label %13
21: ; preds = %13, %10
%22 = phi x86_fp80* [ %12, %10 ], [ %18, %13 ]
%23 = tail call i32 @putchar(i32 10)
%24 = add nuw nsw i32 %11, 1
%25 = icmp eq i32 %24, %0
br i1 %25, label %26, label %10
26: ; preds = %21, %3
%27 = tail call i32 @putchar(i32 10)
ret void
}