#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 EOF;
int *hop(int *);
scalar_t__ is_in_bound(int *, int, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int *point;
  int i, size;
  int arr[50];
  for (i = 0; arr[i] != EOF; i++) {
    scanf("%d", &arr[i]);
    if (i == 50)
      break;
  }
  point = arr;
  size = i;
  for (i = 0; i < 50 && is_in_bound(arr, size, point) != 0;) {
    if (*point == 0) {
      printf("1");
      printf("\n%d", i);
      return 0;
    }
    point = hop(point);
    i++;
  }
  printf("0");
  if (is_in_bound(arr, size, point) == 0)
    printf("\n%d", i - 1);
  else
    printf("\n%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%eax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%eax
je     11b3 <main+0x73>
movslq -0x14(%rbp),%rax
lea    -0xe0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe77(%rip),%rdi
call   1050 <scanf@plt>
cmpl   $0x32,-0x14(%rbp)
jne    11a0 <main+0x60>
jmp    11b3 <main+0x73>
jmp    11a5 <main+0x65>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x19>
lea    -0xe0(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x32,-0x14(%rbp)
mov    %al,-0xe1(%rbp)
jge    11fd <main+0xbd>
lea    -0xe0(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1060 <is_in_bound@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xe1(%rbp)
mov    -0xe1(%rbp),%al
test   $0x1,%al
jne    1210 <main+0xd0>
jmp    1263 <main+0x123>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1248 <main+0x108>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12bf <main+0x17f>
mov    -0x10(%rbp),%rdi
call   1030 <hop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cb <main+0x8b>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1060 <is_in_bound@plt>
cmp    $0x0,%rax
jne    12a7 <main+0x167>
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12b8 <main+0x178>
mov    -0x14(%rbp),%esi
lea    0xd51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rsp,%rbp
xor    %ebx,%ebx
lea    0xe98(%rip),%r14
mov    0x2e78(%rip),%r15
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
cmp    $0xffffffffffffffce,%rbx
je     1195 <main+0x45>
mov    0x4(%rbp),%eax
add    $0x4,%rbp
add    $0xffffffffffffffff,%rbx
cmp    (%r15),%eax
jne    1170 <main+0x20>
neg    %ebx
jmp    119a <main+0x4a>
mov    $0x32,%ebx
xor    %r14d,%r14d
mov    %rsp,%r15
mov    %r15,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
call   1070 <is_in_bound@plt>
test   %rax,%rax
je     11e3 <main+0x93>
cmpl   $0x0,0x0(%rbp)
je     1204 <main+0xb4>
mov    %rbp,%rdi
call   1040 <hop@plt>
mov    %rax,%rbp
add    $0x1,%r14d
cmp    $0x32,%r14d
jne    11b0 <main+0x60>
mov    $0x32,%r14d
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
call   1070 <is_in_bound@plt>
cmp    $0x1,%rax
sbb    $0x0,%r14d
jmp    120e <main+0xbe>
mov    $0x31,%edi
call   1030 <putchar@plt>
lea    0xdeb(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [4 x i8] c"\0A%d\00"
@.str.3 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [50 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [50 x i32], [50 x i32]* %5, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %6
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [50 x i32], [50 x i32]* %5, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 50
br i1 %19, label %20, label %21
20: ; preds = %13
br label %25
21: ; preds = %13
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %6
25: ; preds = %20, %6
%26 = getelementptr inbounds [50 x i32], [50 x i32]* %5, i64 0, i64 0
store i32* %26, i32** %2
%27 = load i32, i32* %3
store i32 %27, i32* %4
store i32 0, i32* %3
br label %28
28: ; preds = %47, %25
%29 = load i32, i32* %3
%30 = icmp slt i32 %29, 50
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = getelementptr inbounds [50 x i32], [50 x i32]* %5, i64 0, i64 0
%33 = load i32, i32* %4
%34 = load i32*, i32** %2
%35 = call i64 @is_in_bound(i32* %32, i32 %33, i32* %34)
%36 = icmp ne i64 %35, 0
br label %37
37: ; preds = %31, %28
%38 = phi i1 [ false, %28 ], [ %36, %31 ]
br i1 %38, label %39, label %52
39: ; preds = %37
%40 = load i32*, i32** %2
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%45 = load i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %45)
store i32 0, i32* %1
br label %67
47: ; preds = %39
%48 = load i32*, i32** %2
%49 = call i32* @hop(i32* %48)
store i32* %49, i32** %2
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 1
store i32 %51, i32* %3
br label %28
52: ; preds = %37
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%54 = getelementptr inbounds [50 x i32], [50 x i32]* %5, i64 0, i64 0
%55 = load i32, i32* %4
%56 = load i32*, i32** %2
%57 = call i64 @is_in_bound(i32* %54, i32 %55, i32* %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %63
59: ; preds = %52
%60 = load i32, i32* %3
%61 = sub nsw i32 %60, 1
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %61)
br label %66
63: ; preds = %52
%64 = load i32, i32* %3
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %64)
br label %66
66: ; preds = %63, %59
store i32 0, i32* %1
br label %67
67: ; preds = %66, %43
%68 = load i32, i32* %1
ret i32 %68
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca [50 x i32]
%2 = bitcast [50 x i32]* %1 to i8*
%3 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
br label %4
4: ; preds = %0, %9
%5 = phi i64 [ 0, %0 ], [ %10, %9 ]
%6 = phi i32* [ %3, %0 ], [ %11, %9 ]
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = icmp eq i64 %5, 50
br i1 %8, label %17, label %9
9: ; preds = %4
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %4
15: ; preds = %9
%16 = trunc i64 %10 to i32
br label %17
17: ; preds = %4, %15
%18 = phi i32 [ %16, %15 ], [ 50, %4 ]
br label %19
19: ; preds = %17, %29
%20 = phi i32 [ 0, %17 ], [ %31, %29 ]
%21 = phi i32* [ %3, %17 ], [ %30, %29 ]
%22 = call i64 @is_in_bound(i32* %3, i32 %18, i32* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %33, label %24
24: ; preds = %19
%25 = load i32, i32* %21
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @putchar(i32 49)
br label %41
29: ; preds = %24
%30 = call i32* @hop(i32* %21)
%31 = add nuw nsw i32 %20, 1
%32 = icmp eq i32 %31, 50
br i1 %32, label %33, label %19
33: ; preds = %29, %19
%34 = phi i32* [ %30, %29 ], [ %21, %19 ]
%35 = phi i32 [ 50, %29 ], [ %20, %19 ]
%36 = call i32 @putchar(i32 48)
%37 = call i64 @is_in_bound(i32* %3, i32 %18, i32* %34)
%38 = icmp eq i64 %37, 0
%39 = sext i1 %38 to i32
%40 = add nsw i32 %35, %39
br label %41
41: ; preds = %33, %27
%42 = phi i32 [ %20, %27 ], [ %40, %33 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %42)
ret i32 0
}