#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
int main(void) {
  int n;
  char s[100];
  printf("1\n");
  printf("3 1 2 2\n3 3 4 4\n");
  fflush(stdout);
  scanf("%d", &n);
  if (n == 0) {
    printf("2\n5");
  } else if (n == 2) {
    printf("2\n2");
  } else if (n == 1)
    printf("2\n1");
  else if (n == -1)
    printf("2\n3");
  else if (n == -2)
    printf("2\n4");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xea8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1190 <main+0x60>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xdb>
cmpl   $0x2,-0x8(%rbp)
jne    11ab <main+0x7b>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1206 <main+0xd6>
cmpl   $0x1,-0x8(%rbp)
jne    11c6 <main+0x96>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    1201 <main+0xd1>
cmpl   $0xffffffff,-0x8(%rbp)
jne    11e1 <main+0xb1>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
jmp    11fc <main+0xcc>
cmpl   $0xfffffffe,-0x8(%rbp)
jne    11f7 <main+0xc7>
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    11fc <main+0xcc>
jmp    1201 <main+0xd1>
jmp    1206 <main+0xd6>
jmp    120b <main+0xdb>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe92(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0x2,%eax
cmp    $0x4,%eax
ja     1199 <main+0x59>
cltq
lea    0xe9b(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [17 x i8] c"3 1 2 2\0A3 3 4 4\0A\00"
@stdout = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"2\0A5\00"
@.str.4 = [4 x i8] c"2\0A2\00"
@.str.5 = [4 x i8] c"2\0A1\00"
@.str.6 = [4 x i8] c"2\0A3\00"
@.str.7 = [4 x i8] c"2\0A4\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %37
13: ; preds = %0
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %36
18: ; preds = %13
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %35
23: ; preds = %18
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %34
28: ; preds = %23
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, -2
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
br label %34
34: ; preds = %33, %26
br label %35
35: ; preds = %34, %21
br label %36
36: ; preds = %35, %16
br label %37
37: ; preds = %36, %11
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"2\0A5\00"
@.str.4 = [4 x i8] c"2\0A2\00"
@.str.5 = [4 x i8] c"2\0A1\00"
@.str.6 = [4 x i8] c"2\0A3\00"
@.str.7 = [4 x i8] c"2\0A4\00"
@str = [2 x i8] c"1\00"
@str.8 = [16 x i8] c"3 1 2 2\0A3 3 4 4\00"
@reltable.main = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.8, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add i32 %8, 2
%10 = icmp ult i32 %9, 5
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = sext i32 %9 to i64
%13 = shl i64 %12, 2
%14 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.main to i8*), i64 %13)
%15 = call i32 @printf(i8* dereferenceable(1) %14)
br label %16
16: ; preds = %0, %11
ret i32 0
}