#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 getchar();
int /*<<< orphan*/ putchar(int);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(scalar_t__);
scalar_t__ time(int /*<<< orphan*/);
int main(void) {
  int i = 1, temp0, temp1, temp2, c, test0, test1, test2;
  srand(time(0));
  temp0 = rand();
  temp1 = rand();
  temp2 = rand();
  scanf("%d", &test0);
  scanf("%d", &test1);
  scanf("%d", &test2);
  while (temp0 != test0 || temp1 != test1 || temp2 != test2) {
    srand(time(0) - i);
    temp0 = rand();
    temp1 = rand();
    temp2 = rand();
    ++i;
  }
  getchar();
  while (1) {
    if ((c = getchar()) == EOF)
      break;
    else
      putchar(c ^ rand());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %rax,%rdi
call   1040 <srand@plt>
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0x14(%rbp)
lea    0xe56(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe46(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe36(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%al
cmp    -0x1c(%rbp),%ecx
mov    %al,-0x25(%rbp)
jne    1201 <main+0xa1>
mov    -0x10(%rbp),%ecx
mov    $0x1,%al
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
jne    1201 <main+0xa1>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
setne  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    1211 <main+0xb1>
jmp    1253 <main+0xf3>
xor    %edi,%edi
call   1060 <time@plt>
mov    %rax,%rdi
movslq -0x8(%rbp),%rax
sub    %rax,%rdi
call   1040 <srand@plt>
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d3 <main+0x73>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d7d(%rip),%rcx
cmp    (%rcx),%eax
jne    1278 <main+0x118>
jmp    1294 <main+0x134>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    -0x2c(%rbp),%edi
xor    %eax,%edi
call   1030 <putchar@plt>
jmp    125a <main+0xfa>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %rax,%rdi
call   1040 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%r14d
lea    0xe63(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
cmp    0x14(%rsp),%ebp
jne    11d8 <main+0x78>
cmp    0x10(%rsp),%r15d
jne    11d8 <main+0x78>
cmp    0xc(%rsp),%r14d
je     121f <main+0xbf>
mov    $0xffffffffffffffff,%r14
nop
xor    %edi,%edi
call   1060 <time@plt>
lea    (%rax,%r14,1),%rdi
call   1040 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <rand@plt>
add    $0xffffffffffffffff,%r14
cmp    0x14(%rsp),%ebp
jne    11e0 <main+0x80>
cmp    0x10(%rsp),%ebx
jne    11e0 <main+0x80>
cmp    0xc(%rsp),%eax
jne    11e0 <main+0x80>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2db4(%rip),%rbp
cmp    0x0(%rbp),%eax
je     125e <main+0xfe>
mov    %eax,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <rand@plt>
xor    %eax,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    0x0(%rbp),%eax
jne    1240 <main+0xe0>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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