#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void fxor(FILE *in1, FILE *in2, FILE *fp_out) {
  int x, y;
  x = fgetc(in1);
  y = fgetc(in2);
  while (x != EOF && y != EOF) {
    x = fgetc(in1);
    y = fgetc(in2);
    fputc(x ^ y, fp_out);
  }
}


x86 assembly (clang, -O0):
<fxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
mov    0x2e90(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x21(%rbp)
je     1175 <fxor+0x55>
mov    -0x20(%rbp),%eax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1185 <fxor+0x65>
jmp    11b1 <fxor+0x91>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
xor    -0x20(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <fputc@plt>
jmp    114c <fxor+0x2c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    0x2e9e(%rip),%r13
mov    0x0(%r13),%ecx
cmp    %ecx,%ebp
je     118c <fxor+0x6c>
cmp    %ecx,%eax
je     118c <fxor+0x6c>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
xor    %ebx,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    0x0(%r13),%eax
cmp    %eax,%ebx
je     118c <fxor+0x6c>
cmp    %eax,%ebp
jne    1160 <fxor+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @fxor(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %4
%10 = call i32 @fgetc(i32* %9)
store i32 %10, i32* %7
%11 = load i32*, i32** %5
%12 = call i32 @fgetc(i32* %11)
store i32 %12, i32* %8
br label %13
13: ; preds = %23, %3
%14 = load i32, i32* %7
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %8
%19 = load i32, i32* @EOF
%20 = icmp ne i32 %18, %19
br label %21
21: ; preds = %17, %13
%22 = phi i1 [ false, %13 ], [ %20, %17 ]
br i1 %22, label %23, label %33
23: ; preds = %21
%24 = load i32*, i32** %4
%25 = call i32 @fgetc(i32* %24)
store i32 %25, i32* %7
%26 = load i32*, i32** %5
%27 = call i32 @fgetc(i32* %26)
store i32 %27, i32* %8
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = xor i32 %28, %29
%31 = load i32*, i32** %6
%32 = call i32 @fputc(i32 %30, i32* %31)
br label %13
33: ; preds = %21
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @fxor(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = tail call i32 @fgetc(i32* %0)
%5 = tail call i32 @fgetc(i32* %1)
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = icmp ne i32 %5, %6
%9 = and i1 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %3, %10
%11 = tail call i32 @fgetc(i32* %0)
%12 = tail call i32 @fgetc(i32* %1)
%13 = xor i32 %12, %11
%14 = tail call i32 @fputc(i32 %13, i32* %2)
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %11, %15
%17 = icmp ne i32 %12, %15
%18 = and i1 %16, %17
br i1 %18, label %10, label %19
19: ; preds = %10, %3
ret void
}