#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*/ print_round(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[32];
  int i;
  for (i = 0; i < 32; i++)
    x[i] = i;
  for (i = 0; i < 2; i++) {
    printf("/* round %d */\n", i);
    print_round(x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    1171 <main+0x51>
mov    -0x94(%rbp),%ecx
movslq -0x94(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    113c <main+0x1c>
movl   $0x0,-0x94(%rbp)
cmpl   $0x2,-0x94(%rbp)
jge    11ba <main+0x9a>
mov    -0x94(%rbp),%esi
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <print_round@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    117b <main+0x5b>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
lea    0xef0(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <print_round@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <print_round@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/* round %d */\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
store i32 0, i32* %3
br label %16
16: ; preds = %24, %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 0
%23 = call i32 @print_round(i32* %22)
br label %24
24: ; preds = %19
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %16
27: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"/* round %d */\0A\00"
define i32 @main() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%4 = bitcast [32 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %4
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 4
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %6
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 8
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %8
%9 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 12
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %10
%11 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 16
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %12
%13 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 20
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, <4 x i32>* %14
%15 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 24
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, <4 x i32>* %16
%17 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 28
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, <4 x i32>* %18
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%20 = call i32 @print_round(i32* %3)
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
%22 = call i32 @print_round(i32* %3)
ret i32 0
}