#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void printTable(double **X, unsigned int x, unsigned int y, unsigned int rank,
                unsigned int offset) {
  int i, j;
  fprintf(stdout, "----Taula X del procés %d (x: %d, y: %d, off: %d):\n\t",
          rank, x, y, offset);
  for (i = 0; i < x; i++) {
    fprintf(stdout, "%d|\t", offset + i);
    for (j = 0; j < y; j++)
      fprintf(stdout, "%.1f\t", X[i][j]);
    fprintf(stdout, "\n\t");
  }
  fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<printTable>:
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    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    11f0 <printTable+0xe0>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
add    -0x1c(%rbp),%edx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    11cb <printTable+0xbb>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe85(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1185 <printTable+0x75>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xe58(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <printTable+0x45>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%r9d
mov    %edx,%r8d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb0(%rip),%r15
mov    (%r15),%edi
lea    0xec6(%rip),%rsi
mov    %ecx,%edx
mov    %ebp,%ecx
mov    %r8d,0x4(%rsp)
mov    %r9,0x10(%rsp)
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebp,%ebp
je     11d2 <printTable+0xc2>
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
mov    0x4(%rsp),%r14d
lea    0xed5(%rip),%rbp
xor    %r13d,%r13d
jmp    118c <printTable+0x7c>
nopl   0x0(%rax,%rax,1)
mov    (%r15),%edi
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r13
cmp    0x8(%rsp),%r13
je     11d2 <printTable+0xc2>
mov    (%r15),%edi
mov    0x10(%rsp),%rax
lea    (%rax,%r13,1),%edx
lea    0xe97(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
cmpl   $0x0,0x4(%rsp)
je     1170 <printTable+0x60>
xor    %r12d,%r12d
mov    (%r15),%edi
mov    (%rbx,%r13,8),%rax
movsd  (%rax,%r12,8),%xmm0
mov    %rbp,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x1,%r12
cmp    %r12,%r14
jne    11b0 <printTable+0xa0>
jmp    1170 <printTable+0x60>
mov    (%r15),%edi
lea    0xe65(%rip),%rsi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [54 x i8] c"----Taula X del proc\C3\A9s %d (x: %d, y: %d, off: %d):\0A\09\00"
@.str.1 = [5 x i8] c"%d|\09\00"
@.str.2 = [6 x i8] c"%.1f\09\00"
@.str.3 = [3 x i8] c"\0A\09\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @printTable(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store double** %0, double*** %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* @stdout
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %10
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
store i32 0, i32* %11
br label %19
19: ; preds = %51, %5
%20 = load i32, i32* %11
%21 = load i32, i32* %7
%22 = icmp ult i32 %20, %21
br i1 %22, label %23, label %54
23: ; preds = %19
%24 = load i32, i32* @stdout
%25 = load i32, i32* %10
%26 = load i32, i32* %11
%27 = add i32 %25, %26
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %27)
store i32 0, i32* %12
br label %29
29: ; preds = %45, %23
%30 = load i32, i32* %12
%31 = load i32, i32* %8
%32 = icmp ult i32 %30, %31
br i1 %32, label %33, label %48
33: ; preds = %29
%34 = load i32, i32* @stdout
%35 = load double**, double*** %6
%36 = load i32, i32* %11
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double*, double** %35, i64 %37
%39 = load double*, double** %38
%40 = load i32, i32* %12
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %39, i64 %41
%43 = load double, double* %42
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %43)
br label %45
45: ; preds = %33
%46 = load i32, i32* %12
%47 = add nsw i32 %46, 1
store i32 %47, i32* %12
br label %29
48: ; preds = %29
%49 = load i32, i32* @stdout
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %48
%52 = load i32, i32* %11
%53 = add nsw i32 %52, 1
store i32 %53, i32* %11
br label %19
54: ; preds = %19
%55 = load i32, i32* @stdout
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [54 x i8] c"----Taula X del proc\C3\A9s %d (x: %d, y: %d, off: %d):\0A\09\00"
@.str.1 = [5 x i8] c"%d|\09\00"
@.str.2 = [6 x i8] c"%.1f\09\00"
@.str.3 = [3 x i8] c"\0A\09\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @printTable(double** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1, i32 %2, i32 %4)
%8 = icmp eq i32 %1, 0
br i1 %8, label %35, label %9
9: ; preds = %5
%10 = icmp eq i32 %2, 0
%11 = zext i32 %1 to i64
%12 = zext i32 %2 to i64
br label %13
13: ; preds = %9, %30
%14 = phi i64 [ 0, %9 ], [ %33, %30 ]
%15 = load i32, i32* @stdout
%16 = trunc i64 %14 to i32
%17 = add i32 %16, %4
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br i1 %10, label %30, label %19
19: ; preds = %13
%20 = getelementptr inbounds double*, double** %0, i64 %14
br label %21
21: ; preds = %19, %21
%22 = phi i64 [ 0, %19 ], [ %28, %21 ]
%23 = load i32, i32* @stdout
%24 = load double*, double** %20
%25 = getelementptr inbounds double, double* %24, i64 %22
%26 = load double, double* %25
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %26)
%28 = add nuw nsw i64 %22, 1
%29 = icmp eq i64 %28, %12
br i1 %29, label %30, label %21
30: ; preds = %21, %13
%31 = load i32, i32* @stdout
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%33 = add nuw nsw i64 %14, 1
%34 = icmp eq i64 %33, %11
br i1 %34, label %35, label %13
35: ; preds = %30, %5
%36 = load i32, i32* @stdout
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}