#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 canJump(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int n[] = {2, 3, 1, 1, 4};
  int b[] = {2, 3, 0, 1, 4};
  if (!(canJump(n, 1) == 1)) {
    printf("assert fail: %s\n", "boundary 0");
  };
  if (!(canJump(n, 5) == 1)) {
    printf("assert fail: %s\n", "2 step");
  };
  if (!(canJump(b, 5) == 1)) {
    printf("assert fail: %s\n", "b");
  };
  printf("everything is fine!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x1,%esi
call   1030 <canJump@plt>
cmp    $0x1,%eax
je     11a0 <main+0x80>
lea    0xea2(%rip),%rdi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1030 <canJump@plt>
cmp    $0x1,%eax
je     11cc <main+0xac>
lea    0xe76(%rip),%rdi
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1030 <canJump@plt>
cmp    $0x1,%eax
je     11f8 <main+0xd8>
lea    0xe4a(%rip),%rdi
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xed6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0xee1(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1040 <canJump@plt>
cmp    $0x1,%eax
je     1186 <main+0x56>
lea    0xebc(%rip),%rdi
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <canJump@plt>
cmp    $0x1,%eax
je     11ad <main+0x7d>
lea    0xe95(%rip),%rdi
lea    0xeaa(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x20(%rsp),%rdi
mov    $0x5,%esi
call   1040 <canJump@plt>
cmp    $0x1,%eax
je     11d6 <main+0xa6>
lea    0xe6c(%rip),%rdi
lea    0xe88(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.n = [5 x i32] [i32 2, i32 3, i32 1, i32 1, i32 4]
@__const.main.b = [5 x i32] [i32 2, i32 3, i32 0, i32 1, i32 4]
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [11 x i8] c"boundary 0\00"
@.str.2 = [7 x i8] c"2 step\00"
@.str.3 = [2 x i8] c"b\00"
@.str.4 = [21 x i8] c"everything is fine!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca [5 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i32]* %6 to i8*
%9 = bitcast [5 x i32]* %7 to i8*
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%11 = call i32 @canJump(i32* %10, i32 1)
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%17 = call i32 @canJump(i32* %16, i32 5)
%18 = icmp eq i32 %17, 1
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%23 = call i32 @canJump(i32* %22, i32 5)
%24 = icmp eq i32 %23, 1
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %25, %21
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.n = [5 x i32] [i32 2, i32 3, i32 1, i32 1, i32 4]
@__const.main.b = [5 x i32] [i32 2, i32 3, i32 0, i32 1, i32 4]
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [11 x i8] c"boundary 0\00"
@.str.2 = [7 x i8] c"2 step\00"
@.str.3 = [2 x i8] c"b\00"
@str = [20 x i8] c"everything is fine!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = bitcast [5 x i32]* %3 to i8*
%6 = bitcast [5 x i32]* %4 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = call i32 @canJump(i32* %7, i32 1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = call i32 @canJump(i32* %7, i32 5)
%14 = icmp eq i32 %13, 1
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%19 = call i32 @canJump(i32* %18, i32 5)
%20 = icmp eq i32 %19, 1
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %17
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}