#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int p1 = 1564861237, p2 = 5456186217, p3 = 15441213215, in = 0;
  while (p1 != p3 || p2 != p3) {
    scanf("%d", &in);
    if (in % 2) {
      printf("odd\n");
    } else {
      printf("even\n");
    }
    p3 = p2;
    p2 = p1;
    p1 = in;
  }
  printf("Goodbye!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5d45e335,-0x8(%rbp)
movl   $0x4536cb69,-0xc(%rbp)
movl   $0x985e371f,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0x10(%rbp),%ecx
mov    %al,-0x15(%rbp)
jne    1168 <main+0x48>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1178 <main+0x58>
jmp    11d0 <main+0xb0>
lea    0xe81(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11ad <main+0x8d>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <main+0x99>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114b <main+0x2b>
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%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
movl   $0x0,0x4(%rsp)
mov    $0x5d45e335,%eax
mov    $0x4536cb69,%ecx
lea    0xeac(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xeac(%rip),%r12
lea    0xeaa(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebp
mov    %ecx,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
testb  $0x1,0x4(%rsp)
mov    %r13,%rdi
cmove  %r12,%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
mov    %ebp,%ecx
cmp    %ebx,%eax
jne    1170 <main+0x40>
mov    %ebp,%ecx
cmp    %ebx,%ebp
jne    1170 <main+0x40>
lea    0xe5c(%rip),%rdi
call   1040 <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 = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"odd\0A\00"
@.str.2 = [6 x i8] c"even\0A\00"
@.str.3 = [9 x i8] c"Goodbye!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1564861237, i32* %2
store i32 1161218921, i32* %3
store i32 -1738655969, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp ne i32 %11, %12
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br i1 %15, label %16, label %29
16: ; preds = %14
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%18 = load i32, i32* %5
%19 = srem i32 %18, 2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %16
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = load i32, i32* %3
store i32 %26, i32* %4
%27 = load i32, i32* %2
store i32 %27, i32* %3
%28 = load i32, i32* %5
store i32 %28, i32* %2
br label %6
29: ; preds = %14
%30 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.3 = [9 x i8] c"Goodbye!\00"
@str = [5 x i8] c"even\00"
@str.4 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1161218921, %0 ], [ %5, %3 ]
%5 = phi i32 [ 1564861237, %0 ], [ %12, %3 ]
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
%12 = load i32, i32* %1
%13 = icmp ne i32 %12, %4
%14 = icmp ne i32 %5, %4
%15 = or i1 %13, %14
br i1 %15, label %3, label %16
16: ; preds = %3
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}