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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xd4(%rbp)
movl   $0x0,-0xe8(%rbp)
movl   $0x0,-0xd4(%rbp)
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%esi
lea    0xe7b(%rip),%rdi
call   1050 <scanf@plt>
mov    0x2e57(%rip),%rcx
cmp    (%rcx),%rax
je     11b3 <main+0x73>
jmp    119f <main+0x5f>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1170 <main+0x30>
movq   $0x0,-0xe0(%rbp)
mov    -0xe8(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jge    12bd <main+0x17d>
mov    -0xe0(%rbp),%rax
lea    -0xd0(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
lea    -0xd0(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <hop@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0xd4(%rbp),%esi
mov    -0xe0(%rbp),%rdx
call   1060 <is_in_bound@plt>
cmp    $0x0,%rax
je     1258 <main+0x118>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xe8(%rbp),%esi
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12bd <main+0x17d>
mov    -0xe0(%rbp),%rax
lea    -0xd0(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmpl   $0x0,-0xd0(%rbp,%rax,4)
jne    129d <main+0x15d>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xe8(%rbp),%esi
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x32,-0xe8(%rbp)
jle    12b8 <main+0x178>
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11be <main+0x7e>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):