#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 *);
int /*<<< orphan*/ test(int *, int);
int main() {
  int n = 10;
  for (int i = 0; i < n; ++i) {
    int data[20];
    test(data, 20);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1171 <main+0x51>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1040 <test@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @test(i32* %3, i32 20)
%5 = call i32 @putchar(i32 10)
%6 = call i32 @test(i32* %3, i32 20)
%7 = call i32 @putchar(i32 10)
%8 = call i32 @test(i32* %3, i32 20)
%9 = call i32 @putchar(i32 10)
%10 = call i32 @test(i32* %3, i32 20)
%11 = call i32 @putchar(i32 10)
%12 = call i32 @test(i32* %3, i32 20)
%13 = call i32 @putchar(i32 10)
%14 = call i32 @test(i32* %3, i32 20)
%15 = call i32 @putchar(i32 10)
%16 = call i32 @test(i32* %3, i32 20)
%17 = call i32 @putchar(i32 10)
%18 = call i32 @test(i32* %3, i32 20)
%19 = call i32 @putchar(i32 10)
%20 = call i32 @test(i32* %3, i32 20)
%21 = call i32 @putchar(i32 10)
%22 = call i32 @test(i32* %3, i32 20)
%23 = call i32 @putchar(i32 10)
ret i32 0
}