#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 jump(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arr1[] = {2, 3, 1, 1, 4};
  int arr2[] = {7, 0, 9, 6, 9, 6, 1, 7, 9, 0, 1, 2, 9, 0, 3};
  int arr3[] = {1, 1, 1, 1, 1};
  printf("%d\n", jump(arr1, 5));
  printf("%d\n", jump(arr2, 15));
  printf("%d\n", jump(arr3, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
mov    0xee3(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xee0(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xede(%rip),%eax
mov    %eax,-0x70(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <jump@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0xf,%esi
call   1050 <jump@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x5,%esi
call   1050 <jump@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
mov    0xee2(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xf07(%rip),%xmm0
movups %xmm0,0x6c(%rsp)
movaps 0xeef(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xefc(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x5,%esi
call   1040 <jump@plt>
lea    0xedb(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x40(%rsp),%rdi
mov    $0xf,%esi
call   1040 <jump@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <jump@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr1 = [5 x i32] [i32 2, i32 3, i32 1, i32 1, i32 4]
@__const.main.arr2 = [15 x i32] [i32 7, i32 0, i32 9, i32 6, i32 9, i32 6, i32 1, i32 7, i32 9, i32 0, i32 1, i32 2, i32 9, i32 0, i32 3]
@__const.main.arr3 = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [15 x i32]
%4 = alloca [5 x i32]
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = bitcast [15 x i32]* %3 to i8*
%7 = bitcast [5 x i32]* %4 to i8*
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = call i32 @jump(i32* %8, i32 5)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%12 = call i32 @jump(i32* %11, i32 15)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%15 = call i32 @jump(i32* %14, i32 5)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr1 = [5 x i32] [i32 2, i32 3, i32 1, i32 1, i32 4]
@__const.main.arr2 = [15 x i32] [i32 7, i32 0, i32 9, i32 6, i32 9, i32 6, i32 1, i32 7, i32 9, i32 0, i32 1, i32 2, i32 9, i32 0, i32 3]
@__const.main.arr3 = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [15 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [15 x i32]* %2 to i8*
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = call i32 @jump(i32* %7, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 0
%11 = call i32 @jump(i32* %10, i32 15)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%14 = call i32 @jump(i32* %13, i32 5)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}