#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 dumpMatrix(float *matrix, int rows, int columns, const char *label) {
  printf("matriz %s\n", label);
  for (int i = 0; i < rows; i++) {
    for (int j = 0; j < columns; j++) {
      printf("\t%f ", matrix[i * columns + j]);
      if (j == columns - 1) {
        printf("\n");
      }
    }
  }
}


x86 assembly (clang, -O0):
<dumpMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11cb <dumpMatrix+0xbb>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b8 <dumpMatrix+0xa8>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11a5 <dumpMatrix+0x95>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11aa <dumpMatrix+0x9a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1152 <dumpMatrix+0x42>
jmp    11bd <dumpMatrix+0xad>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <dumpMatrix+0x2f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,(%rsp)
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
mov    %rcx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    11ce <dumpMatrix+0xae>
mov    (%rsp),%rax
lea    -0x1(%rax),%ebp
cltq
mov    %r15d,%ecx
mov    %rcx,0x8(%rsp)
mov    %eax,%r14d
shl    $0x2,%rax
mov    %rax,0x10(%rsp)
xor    %r13d,%r13d
lea    0xe92(%rip),%r15
jmp    1190 <dumpMatrix+0x70>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
add    0x10(%rsp),%rbx
cmp    0x8(%rsp),%r13
je     11ce <dumpMatrix+0xae>
cmpl   $0x0,(%rsp)
jle    1180 <dumpMatrix+0x60>
xor    %r12d,%r12d
jmp    11a9 <dumpMatrix+0x89>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,%r14
je     1180 <dumpMatrix+0x60>
movss  (%rbx,%r12,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmp    %r12,%rbp
jne    11a0 <dumpMatrix+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11a0 <dumpMatrix+0x80>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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