#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 table_print(int N, float **Q, float **C) {
  int i, j;
  printf("\n\n--------- Q Table ---------\n\n");
  for (j = 0; j < 3; j++) {
    for (i = 0; i < N; i++) {
      printf("%f   ", Q[i][j]);
      if (i == N - 1)
        printf("\n");
    }
  }
  printf("\n\n--------- S Table ---------\n\n");
  for (j = 0; j < 3; j++) {
    for (i = 0; i < N; i++) {
      printf("%f   ", C[i][j]);
      if (i == N - 1)
        printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<table_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    11c1 <table_print+0xb1>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11ae <table_print+0x9e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    119b <table_print+0x8b>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a0 <table_print+0x90>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <table_print+0x39>
jmp    11b3 <table_print+0xa3>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1138 <table_print+0x28>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    125f <table_print+0x14f>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    124c <table_print+0x13c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe0d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1239 <table_print+0x129>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <table_print+0x12e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e7 <table_print+0xd7>
jmp    1251 <table_print+0x141>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11d6 <table_print+0xc6>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table_print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
test   %r14d,%r14d
jle    1241 <table_print+0x111>
lea    -0x1(%r14),%r13d
mov    %r14,(%rsp)
mov    %r14d,%r15d
xor    %r14d,%r14d
lea    0xe92(%rip),%r12
jmp    1179 <table_print+0x49>
add    $0x1,%r14
cmp    %r14,%r15
je     11a0 <table_print+0x70>
mov    (%rbx,%r14,8),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    %r14,%r13
jne    1170 <table_print+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1170 <table_print+0x40>
cmpl   $0x0,(%rsp)
jle    1241 <table_print+0x111>
mov    %rbp,%r14
xor    %ebp,%ebp
lea    0xe4a(%rip),%r12
jmp    11c9 <table_print+0x99>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r15
je     11f1 <table_print+0xc1>
mov    (%rbx,%rbp,8),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    %rbp,%r13
jne    11c0 <table_print+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11c0 <table_print+0x90>
cmpl   $0x0,(%rsp)
jle    1241 <table_print+0x111>
xor    %ebp,%ebp
lea    0xe00(%rip),%r12
jmp    1219 <table_print+0xe9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    %rbp,%r15
je     125b <table_print+0x12b>
mov    (%rbx,%rbp,8),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    %rbp,%r13
jne    1210 <table_print+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1210 <table_print+0xe0>
lea    0xddd(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>
lea    0xdc3(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%r12
test   %r12d,%r12d
jle    1351 <table_print+0x221>
xor    %ebp,%ebp
lea    0xd83(%rip),%rbx
jmp    1289 <table_print+0x159>
nop
add    $0x1,%rbp
cmp    %rbp,%r15
je     12b0 <table_print+0x180>
mov    (%r14,%rbp,8),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    %rbp,%r13
jne    1280 <table_print+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1280 <table_print+0x150>
test   %r12d,%r12d
jle    1351 <table_print+0x221>
xor    %ebp,%ebp
lea    0xd3e(%rip),%rbx
jmp    12d9 <table_print+0x1a9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbp
cmp    %rbp,%r15
je     1301 <table_print+0x1d1>
mov    (%r14,%rbp,8),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    %rbp,%r13
jne    12d0 <table_print+0x1a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    12d0 <table_print+0x1a0>
test   %r12d,%r12d
jle    1351 <table_print+0x221>
xor    %ebp,%ebp
lea    0xcf1(%rip),%rbx
jmp    1329 <table_print+0x1f9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r15
je     1351 <table_print+0x221>
mov    (%r14,%rbp,8),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    %rbp,%r13
jne    1320 <table_print+0x1f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1320 <table_print+0x1f0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0A\0A--------- Q Table ---------\0A\0A\00"
@.str.1 = [6 x i8] c"%f \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [32 x i8] c"\0A\0A--------- S Table ---------\0A\0A\00"
define void @table_print(i32 %0, float** %1, float** %2) {
%4 = alloca i32
%5 = alloca float**
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store float** %1, float*** %5
store float** %2, float*** %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %10
10: ; preds = %41, %3
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %44
13: ; preds = %10
store i32 0, i32* %7
br label %14
14: ; preds = %37, %13
%15 = load i32, i32* %7
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %40
18: ; preds = %14
%19 = load float**, float*** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float*, float** %19, i64 %21
%23 = load float*, float** %22
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %23, i64 %25
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %28)
%30 = load i32, i32* %7
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 1
%33 = icmp eq i32 %30, %32
br i1 %33, label %34, label %36
34: ; preds = %18
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %18
br label %37
37: ; preds = %36
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %14
40: ; preds = %14
br label %41
41: ; preds = %40
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %10
44: ; preds = %10
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %8
br label %46
46: ; preds = %77, %44
%47 = load i32, i32* %8
%48 = icmp slt i32 %47, 3
br i1 %48, label %49, label %80
49: ; preds = %46
store i32 0, i32* %7
br label %50
50: ; preds = %73, %49
%51 = load i32, i32* %7
%52 = load i32, i32* %4
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %76
54: ; preds = %50
%55 = load float**, float*** %6
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds float*, float** %55, i64 %57
%59 = load float*, float** %58
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds float, float* %59, i64 %61
%63 = load float, float* %62
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %64)
%66 = load i32, i32* %7
%67 = load i32, i32* %4
%68 = sub nsw i32 %67, 1
%69 = icmp eq i32 %66, %68
br i1 %69, label %70, label %72
70: ; preds = %54
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %72
72: ; preds = %70, %54
br label %73
73: ; preds = %72
%74 = load i32, i32* %7
%75 = add nsw i32 %74, 1
store i32 %75, i32* %7
br label %50
76: ; preds = %50
br label %77
77: ; preds = %76
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 1
store i32 %79, i32* %8
br label %46
80: ; preds = %46
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%f \00"
@str = [31 x i8] c"\0A\0A--------- Q Table ---------\0A\00"
@str.4 = [31 x i8] c"\0A\0A--------- S Table ---------\0A\00"
define void @table_print(i32 %0, float** nocapture %1, float** nocapture %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%5 = icmp sgt i32 %0, 0
%6 = add nsw i32 %0, -1
%7 = zext i32 %6 to i64
br i1 %5, label %8, label %57
8: ; preds = %3
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %20
%11 = phi i64 [ 0, %8 ], [ %21, %20 ]
%12 = getelementptr inbounds float*, float** %1, i64 %11
%13 = load float*, float** %12
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %15)
%17 = icmp eq i64 %11, %7
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = tail call i32 @putchar(i32 10)
br label %20
20: ; preds = %10, %18
%21 = add nuw nsw i64 %11, 1
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %20
br i1 %5, label %24, label %57
24: ; preds = %23
%25 = zext i32 %0 to i64
br label %26
26: ; preds = %37, %24
%27 = phi i64 [ 0, %24 ], [ %38, %37 ]
%28 = getelementptr inbounds float*, float** %1, i64 %27
%29 = load float*, float** %28
%30 = getelementptr inbounds float, float* %29, i64 1
%31 = load float, float* %30
%32 = fpext float %31 to double
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %32)
%34 = icmp eq i64 %27, %7
br i1 %34, label %35, label %37
35: ; preds = %26
%36 = tail call i32 @putchar(i32 10)
br label %37
37: ; preds = %35, %26
%38 = add nuw nsw i64 %27, 1
%39 = icmp eq i64 %38, %25
br i1 %39, label %40, label %26
40: ; preds = %37
br i1 %5, label %41, label %57
41: ; preds = %40
%42 = zext i32 %0 to i64
br label %43
43: ; preds = %54, %41
%44 = phi i64 [ 0, %41 ], [ %55, %54 ]
%45 = getelementptr inbounds float*, float** %1, i64 %44
%46 = load float*, float** %45
%47 = getelementptr inbounds float, float* %46, i64 2
%48 = load float, float* %47
%49 = fpext float %48 to double
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %49)
%51 = icmp eq i64 %44, %7
br i1 %51, label %52, label %54
52: ; preds = %43
%53 = tail call i32 @putchar(i32 10)
br label %54
54: ; preds = %52, %43
%55 = add nuw nsw i64 %44, 1
%56 = icmp eq i64 %55, %42
br i1 %56, label %59, label %43
57: ; preds = %40, %23, %3
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
br label %110
59: ; preds = %54
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
br i1 %5, label %61, label %110
61: ; preds = %59
%62 = zext i32 %0 to i64
br label %63
63: ; preds = %61, %73
%64 = phi i64 [ 0, %61 ], [ %74, %73 ]
%65 = getelementptr inbounds float*, float** %2, i64 %64
%66 = load float*, float** %65
%67 = load float, float* %66
%68 = fpext float %67 to double
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %68)
%70 = icmp eq i64 %64, %7
br i1 %70, label %71, label %73
71: ; preds = %63
%72 = tail call i32 @putchar(i32 10)
br label %73
73: ; preds = %63, %71
%74 = add nuw nsw i64 %64, 1
%75 = icmp eq i64 %74, %62
br i1 %75, label %76, label %63
76: ; preds = %73
br i1 %5, label %77, label %110
77: ; preds = %76
%78 = zext i32 %0 to i64
br label %79
79: ; preds = %90, %77
%80 = phi i64 [ 0, %77 ], [ %91, %90 ]
%81 = getelementptr inbounds float*, float** %2, i64 %80
%82 = load float*, float** %81
%83 = getelementptr inbounds float, float* %82, i64 1
%84 = load float, float* %83
%85 = fpext float %84 to double
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %85)
%87 = icmp eq i64 %80, %7
br i1 %87, label %88, label %90
88: ; preds = %79
%89 = tail call i32 @putchar(i32 10)
br label %90
90: ; preds = %88, %79
%91 = add nuw nsw i64 %80, 1
%92 = icmp eq i64 %91, %78
br i1 %92, label %93, label %79
93: ; preds = %90
br i1 %5, label %94, label %110
94: ; preds = %93
%95 = zext i32 %0 to i64
br label %96
96: ; preds = %107, %94
%97 = phi i64 [ 0, %94 ], [ %108, %107 ]
%98 = getelementptr inbounds float*, float** %2, i64 %97
%99 = load float*, float** %98
%100 = getelementptr inbounds float, float* %99, i64 2
%101 = load float, float* %100
%102 = fpext float %101 to double
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %102)
%104 = icmp eq i64 %97, %7
br i1 %104, label %105, label %107
105: ; preds = %96
%106 = tail call i32 @putchar(i32 10)
br label %107
107: ; preds = %105, %96
%108 = add nuw nsw i64 %97, 1
%109 = icmp eq i64 %108, %95
br i1 %109, label %110, label %96
110: ; preds = %107, %59, %57, %76, %93
ret void
}