#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 */
char *buildRow(int, long **);
int /*<<< orphan*/ printf(char *, ...);
void buildTable(long times[5][30]) {
  int i;
  for (i = 0; i < 5; i++) {
    printf("%s\n", buildRow(i, times));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<buildTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1168 <buildTable+0x48>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <buildRow@plt>
mov    %rax,%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <buildTable+0x13>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildTable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <buildRow@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1050 <buildRow@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1050 <buildRow@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1050 <buildRow@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1050 <buildRow@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @buildTable([30 x i64]* %0) {
%2 = alloca [30 x i64]*
%3 = alloca i32
store [30 x i64]* %0, [30 x i64]** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load [30 x i64]*, [30 x i64]** %2
%10 = bitcast [30 x i64]* %9 to i64**
%11 = call i8* @buildRow(i32 %8, i64** %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @buildTable([30 x i64]* %0) {
%2 = bitcast [30 x i64]* %0 to i64**
%3 = tail call i8* @buildRow(i32 0, i64** %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i8* @buildRow(i32 1, i64** %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i8* @buildRow(i32 2, i64** %2)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = tail call i8* @buildRow(i32 3, i64** %2)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = tail call i8* @buildRow(i32 4, i64** %2)
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
%13 = tail call i32 @putchar(i32 10)
ret void
}