#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_ar(int *, int);
main() {
  for (int i = 0; i < 10; i++) {
    int x[] = {4, 3, 2};
    x[1] = i;
    print_ar(x, 3);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1166 <main+0x56>
mov    0xec9(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xec7(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0xee1(%rip),%r14
mov    %r14,(%rsp)
mov    0xedf(%rip),%ebp
mov    %ebp,0x8(%rsp)
movl   $0x0,0x4(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x1,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x2,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x3,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x4,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x5,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x6,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x7,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x8,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
mov    %r14,(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x9,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <print_ar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@__const.main.x = [3 x i32] [i32 4, i32 3, i32 2]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32 0, i32* %3
%5 = call i32 @print_ar(i32* %4, i32 3)
store i32 1, i32* %3
%6 = call i32 @print_ar(i32* %4, i32 3)
store i32 2, i32* %3
%7 = call i32 @print_ar(i32* %4, i32 3)
store i32 3, i32* %3
%8 = call i32 @print_ar(i32* %4, i32 3)
store i32 4, i32* %3
%9 = call i32 @print_ar(i32* %4, i32 3)
store i32 5, i32* %3
%10 = call i32 @print_ar(i32* %4, i32 3)
store i32 6, i32* %3
%11 = call i32 @print_ar(i32* %4, i32 3)
store i32 7, i32* %3
%12 = call i32 @print_ar(i32* %4, i32 3)
store i32 8, i32* %3
%13 = call i32 @print_ar(i32* %4, i32 3)
store i32 9, i32* %3
%14 = call i32 @print_ar(i32* %4, i32 3)
ret i32 0
}