#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*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int school, home, maxVal = 8, maxDay = 0;
  for (int i = 1; i <= 7; i++) {
    scanf("%d %d", &school, &home);
    if (school + home > maxVal) {
      maxDay = i;
      maxVal = school + home;
    }
  }
  printf("%d\n", maxDay);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x7,-0x18(%rbp)
jg     1193 <main+0x73>
lea    0xeab(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1180 <main+0x60>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1185 <main+0x65>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1144 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%r15
lea    0x4(%rsp),%rbp
mov    %rsp,%r12
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
add    0x4(%rsp),%eax
xor    %r13d,%r13d
cmp    $0x9,%eax
setge  %r13b
mov    $0x8,%ebx
cmovge %eax,%ebx
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbp,%r15
mov    %r12,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%ebp
add    0x4(%rsp),%ebp
cmp    %ebx,%ebp
cmovle %ebx,%ebp
mov    $0x2,%r14d
cmovle %r13d,%r14d
lea    0xe71(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%ebx
add    0x4(%rsp),%ebx
cmp    %ebp,%ebx
cmovle %ebp,%ebx
mov    $0x3,%r13d
cmovle %r14d,%r13d
lea    0xe49(%rip),%rdi
mov    %rdi,%r12
mov    %r15,%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%ebp
add    0x4(%rsp),%ebp
cmp    %ebx,%ebp
cmovle %ebx,%ebp
mov    $0x4,%r14d
cmovle %r13d,%r14d
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rsp,%rdx
mov    %rdx,%r15
call   1040 <scanf@plt>
mov    (%rsp),%ebx
add    0x4(%rsp),%ebx
cmp    %ebp,%ebx
cmovle %ebp,%ebx
mov    $0x5,%r13d
cmovle %r14d,%r13d
mov    %r12,%rdi
lea    0x4(%rsp),%r14
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%ebp
add    0x4(%rsp),%ebp
cmp    %ebx,%ebp
cmovle %ebx,%ebp
mov    $0x6,%ebx
cmovle %r13d,%ebx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
add    0x4(%rsp),%eax
cmp    %ebp,%eax
mov    $0x7,%esi
cmovle %ebx,%esi
lea    0xdb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 8, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
br label %7
7: ; preds = %23, %0
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %10
%18 = load i32, i32* %6
store i32 %18, i32* %5
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %19, %20
store i32 %21, i32* %4
br label %22
22: ; preds = %17, %10
br label %23
23: ; preds = %22
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
%27 = load i32, i32* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = icmp sgt i32 %8, 8
%10 = select i1 %9, i32 %8, i32 8
%11 = zext i1 %9 to i32
%12 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
%16 = icmp sgt i32 %15, %10
%17 = select i1 %16, i32 %15, i32 %10
%18 = select i1 %16, i32 2, i32 %11
%19 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
%23 = icmp sgt i32 %22, %17
%24 = select i1 %23, i32 %22, i32 %17
%25 = select i1 %23, i32 3, i32 %18
%26 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%27 = load i32, i32* %1
%28 = load i32, i32* %2
%29 = add nsw i32 %28, %27
%30 = icmp sgt i32 %29, %24
%31 = select i1 %30, i32 %29, i32 %24
%32 = select i1 %30, i32 4, i32 %25
%33 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%34 = load i32, i32* %1
%35 = load i32, i32* %2
%36 = add nsw i32 %35, %34
%37 = icmp sgt i32 %36, %31
%38 = select i1 %37, i32 %36, i32 %31
%39 = select i1 %37, i32 5, i32 %32
%40 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%41 = load i32, i32* %1
%42 = load i32, i32* %2
%43 = add nsw i32 %42, %41
%44 = icmp sgt i32 %43, %38
%45 = select i1 %44, i32 %43, i32 %38
%46 = select i1 %44, i32 6, i32 %39
%47 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%48 = load i32, i32* %1
%49 = load i32, i32* %2
%50 = add nsw i32 %49, %48
%51 = icmp sgt i32 %50, %45
%52 = select i1 %51, i32 7, i32 %46
%53 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %52)
ret i32 0
}