#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 final_print(double solver[10 * 10][10 * 10 + 1], int cols, int rows) {
  int i, j, k = 0;
  for (i = 0; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      printf("  %6.2lf", solver[k][rows * cols]);
      k++;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<final_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b1 <final_print+0xa1>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1195 <final_print+0x85>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x328,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe89(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1143 <final_print+0x33>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <final_print+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<final_print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
test   %edx,%edx
jle    11c4 <final_print+0xa4>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ebx
imul   %ebx,%eax
cltq
lea    (%rdi,%rax,8),%rax
mov    %rax,0x10(%rsp)
neg    %ebx
xor    %r13d,%r13d
lea    0xea0(%rip),%rbp
xor    %r15d,%r15d
jmp    1185 <final_print+0x65>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
je     11c4 <final_print+0xa4>
cmpl   $0x0,0x8(%rsp)
jle    1170 <final_print+0x50>
movslq %r13d,%rax
imul   $0x328,%rax,%r14
add    0x10(%rsp),%r14
xor    %r12d,%r12d
xchg   %ax,%ax
movsd  (%r14),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x328,%r14
add    $0xffffffff,%r12d
cmp    %r12d,%ebx
jne    11a0 <final_print+0x80>
sub    %r12d,%r13d
jmp    1170 <final_print+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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