#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*/ writeDebugStream(char *, ...);
int /*<<< orphan*/ writeDebugStreamLine(char *);
void matrixPrintF(float *matrix, int numRows, int numCols, char *label) {
  int i, j;
  writeDebugStreamLine(label);
  for (i = 0; i < numRows; i++) {
    for (j = 0; j < numCols; j++) {
      writeDebugStream("%f", matrix[numCols * i + j]);
      writeDebugStream("\t");
    }
    writeDebugStreamLine("");
  }
}


x86 assembly (clang, -O0):
<matrixPrintF>:
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),%rdi
call   1030 <writeDebugStreamLine@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c3 <matrixPrintF+0xa3>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a9 <matrixPrintF+0x89>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1040 <writeDebugStream@plt>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <writeDebugStream@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1159 <matrixPrintF+0x39>
lea    0xe54(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <matrixPrintF+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixPrintF>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0x4(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rcx,%rdi
call   1030 <writeDebugStreamLine@plt>
test   %ebp,%ebp
jle    11d9 <matrixPrintF+0xb9>
movslq 0x4(%rsp),%rax
mov    %ebp,%ecx
mov    %rcx,0x8(%rsp)
mov    %eax,%r14d
shl    $0x2,%rax
mov    %rax,0x10(%rsp)
lea    0xe9a(%rip),%r15
lea    0xe96(%rip),%rbp
xor    %r12d,%r12d
jmp    119c <matrixPrintF+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe7d(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
add    $0x1,%r12
add    0x10(%rsp),%rbx
cmp    0x8(%rsp),%r12
je     11d9 <matrixPrintF+0xb9>
cmpl   $0x0,0x4(%rsp)
jle    1180 <matrixPrintF+0x60>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
movss  (%rbx,%r13,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <writeDebugStream@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <writeDebugStream@plt>
add    $0x1,%r13
cmp    %r13,%r14
jne    11b0 <matrixPrintF+0x90>
jmp    1180 <matrixPrintF+0x60>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [2 x i8] c"\09\00"
@.str.2 = [1 x i8] zeroinitializer
define void @matrixPrintF(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 @writeDebugStreamLine(i8* %11)
store i32 0, i32* %9
br label %13
13: ; preds = %40, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %43
17: ; preds = %13
store i32 0, i32* %10
br label %18
18: ; preds = %35, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
%23 = load float*, float** %5
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%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*, ...) @writeDebugStream(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %32)
%34 = call i32 (i8*, ...) @writeDebugStream(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %22
%36 = load i32, i32* %10
%37 = add nsw i32 %36, 1
store i32 %37, i32* %10
br label %18
38: ; preds = %18
%39 = call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
br label %13
43: ; preds = %13
ret void
}

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