#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 */
char EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char getc(int /*<<< orphan*/ *);
int main() {
  FILE *f1, *f2;
  f1 = fopen("3a.in", "r");
  f2 = fopen("3b.in", "r");
  char ch1, ch2;
  while (((ch1 = getc(f1)) != EOF) && ((ch2 = getc(f2)) != EOF)) {
    if (ch1 == ch2)
      continue;
    else {
      return 1;
      break;
    }
  }
  fclose(f1);
  fclose(f2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xeab(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x19(%rbp)
movsbl %al,%ecx
mov    0x2e65(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x1b(%rbp)
je     11b4 <main+0x84>
mov    -0x18(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x1a(%rbp)
movsbl %al,%eax
mov    0x2e3f(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
test   $0x1,%al
jne    11c4 <main+0x94>
jmp    11e5 <main+0xb5>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    11d9 <main+0xa9>
jmp    116d <main+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    11fe <main+0xce>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    0xec0(%rip),%rbx
mov    %rbx,%rsi
call   1040 <fopen@plt>
mov    %rax,%r14
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <fopen@plt>
mov    %rax,%r15
mov    0x2e7e(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <getc@plt>
cmp    (%r12),%al
je     1199 <main+0x69>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <getc@plt>
cmp    (%r12),%al
je     1199 <main+0x69>
cmp    %al,%bl
je     1170 <main+0x40>
mov    $0x1,%eax
jmp    11ab <main+0x7b>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"3a.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"3b.in\00"
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %2
%7 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %3
br label %8
8: ; preds = %30, %0
%9 = load i32*, i32** %2
%10 = call signext i8 @getc(i32* %9)
store i8 %10, i8* %4
%11 = sext i8 %10 to i32
%12 = load i8, i8* @EOF
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %11, %13
br i1 %14, label %15, label %22
15: ; preds = %8
%16 = load i32*, i32** %3
%17 = call signext i8 @getc(i32* %16)
store i8 %17, i8* %5
%18 = sext i8 %17 to i32
%19 = load i8, i8* @EOF
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %18, %20
br label %22
22: ; preds = %15, %8
%23 = phi i1 [ false, %8 ], [ %21, %15 ]
br i1 %23, label %24, label %32
24: ; preds = %22
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
%27 = load i8, i8* %5
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %26, %28
br i1 %29, label %30, label %31
30: ; preds = %24
br label %8
31: ; preds = %24
store i32 1, i32* %1
br label %37
32: ; preds = %22
%33 = load i32*, i32** %2
%34 = call i32 @fclose(i32* %33)
%35 = load i32*, i32** %3
%36 = call i32 @fclose(i32* %35)
store i32 0, i32* %1
br label %37
37: ; preds = %32, %31
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [6 x i8] c"3a.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"3b.in\00"
@EOF = global i8 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %3
3: ; preds = %11, %0
%4 = tail call signext i8 @getc(i32* %1)
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = tail call signext i8 @getc(i32* %2)
%9 = load i8, i8* @EOF
%10 = icmp eq i8 %8, %9
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = icmp eq i8 %4, %8
br i1 %12, label %3, label %16
13: ; preds = %3, %7
%14 = tail call i32 @fclose(i32* %1)
%15 = tail call i32 @fclose(i32* %2)
br label %16
16: ; preds = %11, %13
%17 = phi i32 [ 0, %13 ], [ 1, %11 ]
ret i32 %17
}