#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*/ assert(int);
int canJump(int *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int arr1[] = {2, 3, 1, 1, 4};
  int arr2[] = {3, 2, 1, 0, 4};
  int arr3[] = {0, 2, 3};
  int arr4[] = {0};
  int arr5[] = {3, 0, 8, 2, 0, 0, 1};
  assert(canJump(arr1, 5) == true);
  assert(canJump(arr2, 5) == false);
  assert(canJump(arr3, 3) == false);
  assert(canJump(arr4, 1) == true);
  assert(canJump(arr5, 7) == true);
  printf("All passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xea6(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x4c(%rbp)
mov    0xe9e(%rip),%eax
mov    %eax,-0x44(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    0xe88(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe82(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe80(%rip),%eax
mov    %eax,-0x58(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <canJump@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1030 <canJump@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x4c(%rbp),%rdi
mov    $0x3,%esi
call   1030 <canJump@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x50(%rbp),%rdi
mov    $0x1,%esi
call   1030 <canJump@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x70(%rbp),%rdi
mov    $0x7,%esi
call   1030 <canJump@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xde4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
mov    0xed3(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xedd(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xed3(%rip),%eax
mov    %eax,0x18(%rsp)
mov    0xec0(%rip),%rax
mov    %rax,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movups 0xec4(%rip),%xmm0
movups %xmm0,0x6c(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
lea    0x40(%rsp),%rdi
mov    $0x5,%esi
call   1040 <canJump@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0x20(%rsp),%rdi
mov    $0x5,%esi
call   1040 <canJump@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0x10(%rsp),%rdi
mov    $0x3,%esi
call   1040 <canJump@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
call   1040 <canJump@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0x60(%rsp),%rdi
mov    $0x7,%esi
call   1040 <canJump@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe2d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
@__const.main.arr1 = [5 x i32] [i32 2, i32 3, i32 1, i32 1, i32 4]
@__const.main.arr2 = [5 x i32] [i32 3, i32 2, i32 1, i32 0, i32 4]
@__const.main.arr3 = [3 x i32] [i32 0, i32 2, i32 3]
@__const.main.arr5 = [7 x i32] [i32 3, i32 0, i32 8, i32 2, i32 0, i32 0, i32 1]
@.str = [12 x i8] c"All passed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = alloca [3 x i32]
%5 = alloca [1 x i32]
%6 = alloca [7 x i32]
store i32 0, i32* %1
%7 = bitcast [5 x i32]* %2 to i8*
%8 = bitcast [5 x i32]* %3 to i8*
%9 = bitcast [3 x i32]* %4 to i8*
%10 = bitcast [1 x i32]* %5 to i8*
%11 = bitcast [7 x i32]* %6 to i8*
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%13 = call i32 @canJump(i32* %12, i32 5)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%18 = call i32 @canJump(i32* %17, i32 5)
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%23 = call i32 @canJump(i32* %22, i32 3)
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%28 = call i32 @canJump(i32* %27, i32 1)
%29 = icmp eq i32 %28, 1
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%33 = call i32 @canJump(i32* %32, i32 7)
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
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 = [5 x i32] [i32 3, i32 2, i32 1, i32 0, i32 4]
@__const.main.arr3 = [3 x i32] [i32 0, i32 2, i32 3]
@__const.main.arr5 = [7 x i32] [i32 3, i32 0, i32 8, i32 2, i32 0, i32 0, i32 1]
@str = [11 x i8] c"All passed\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [3 x i32]
%4 = alloca [1 x i32]
%5 = alloca [7 x i32]
%6 = bitcast [5 x i32]* %1 to i8*
%7 = bitcast [5 x i32]* %2 to i8*
%8 = bitcast [3 x i32]* %3 to i8*
%9 = bitcast [1 x i32]* %4 to i8*
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 0, i32* %10
%11 = bitcast [7 x i32]* %5 to i8*
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%13 = call i32 @canJump(i32* %12, i32 5)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%18 = call i32 @canJump(i32* %17, i32 5)
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%23 = call i32 @canJump(i32* %22, i32 3)
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = call i32 @canJump(i32* %10, i32 1)
%28 = icmp eq i32 %27, 1
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = getelementptr inbounds [7 x i32], [7 x i32]* %5, i64 0, i64 0
%32 = call i32 @canJump(i32* %31, i32 7)
%33 = icmp eq i32 %32, 1
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}