#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, int);
int main(int argc, char **argv) {
  int int_buf[32] = {
      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
  };
  int int_buf2[32] = {
      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
  };
  int i;
  if (argc > 2) {
    int_buf[32] = 2222;
    for (i = 0; i < 33; i++)
      printf("buf[%d]=%d\n", i, int_buf[i]);
  } else {
    int_buf[32] = 1111;
    for (i = 0; i < 33; i++)
      printf("buf[%d]=%d\n", i, int_buf2[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0xf21(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
cmpl   $0x2,-0x8(%rbp)
jle    11ca <main+0xaa>
movl   $0x8ae,-0x10(%rbp)
movl   $0x0,-0x114(%rbp)
cmpl   $0x21,-0x114(%rbp)
jge    11c5 <main+0xa5>
mov    -0x114(%rbp),%esi
movslq -0x114(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%edx
lea    0xf54(%rip),%rdi
call   1030 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1184 <main+0x64>
jmp    1221 <main+0x101>
movl   $0x457,-0x10(%rbp)
movl   $0x0,-0x114(%rbp)
cmpl   $0x21,-0x114(%rbp)
jge    121c <main+0xfc>
mov    -0x114(%rbp),%esi
movslq -0x114(%rbp),%rax
mov    -0x110(%rbp,%rax,4),%edx
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    11db <main+0xbb>
jmp    1221 <main+0x101>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movaps 0xf4d(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe89(%rip),%xmm0
movaps %xmm0,(%rsp)
cmp    $0x2,%edi
jle    11b9 <main+0xa9>
movl   $0x8ae,0x80(%rsp)
xor    %ebx,%ebx
lea    0xeec(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsp,%rbx,4),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x21,%rbx
jne    11a0 <main+0x90>
jmp    11eb <main+0xdb>
lea    0xe40(%rip),%r15
xor    %ebx,%ebx
lea    0xeb7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0x4,%r15
cmp    $0x21,%rbx
jne    11d0 <main+0xc0>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.int_buf = <{ [11 x i32], [21 x i32] }> <{ [11 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10], [21 x i32] zeroinitializer }>
@__const.main.int_buf2 = <{ [11 x i32], [21 x i32] }> <{ [11 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10], [21 x i32] zeroinitializer }>
@.str = [12 x i8] c"buf[%d]=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i32]
%7 = alloca [32 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [32 x i32]* %6 to i8*
%10 = bitcast [32 x i32]* %7 to i8*
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 2
br i1 %12, label %13, label %29
13: ; preds = %2
%14 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 32
store i32 2222, i32* %14
store i32 0, i32* %8
br label %15
15: ; preds = %25, %13
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 33
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load i32, i32* %8
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %15
28: ; preds = %15
br label %45
29: ; preds = %2
%30 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 32
store i32 1111, i32* %30
store i32 0, i32* %8
br label %31
31: ; preds = %41, %29
%32 = load i32, i32* %8
%33 = icmp slt i32 %32, 33
br i1 %33, label %34, label %44
34: ; preds = %31
%35 = load i32, i32* %8
%36 = load i32, i32* %8
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %39)
br label %41
41: ; preds = %34
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %31
44: ; preds = %31
br label %45
45: ; preds = %44, %28
ret i32 0
}

LLVM IR (-O2):
@__const.main.int_buf2 = <{ [11 x i32], [21 x i32] }> <{ [11 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10], [21 x i32] zeroinitializer }>
@.str = [12 x i8] c"buf[%d]=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i32]
%4 = bitcast [32 x i32]* %3 to i8*
%5 = icmp sgt i32 %0, 2
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 32
store i32 2222, i32* %7
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %14, %8 ]
%10 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = trunc i64 %9 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %11)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, 33
br i1 %15, label %24, label %8
16: ; preds = %2, %16
%17 = phi i64 [ %22, %16 ], [ 0, %2 ]
%18 = getelementptr inbounds [32 x i32], [32 x i32]* bitcast (<{ [11 x i32], [21 x i32] }>* @__const.main.int_buf2 to [32 x i32]*), i64 0, i64 %17
%19 = load i32, i32* %18
%20 = trunc i64 %17 to i32
%21 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %19)
%22 = add nuw nsw i64 %17, 1
%23 = icmp eq i64 %22, 33
br i1 %23, label %24, label %16
24: ; preds = %16, %8
ret i32 0
}