#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 /*<<< orphan*/ error(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc != 3)
    error("args: <file> <file>");
  char *fn1 = argv[1];
  char *fn2 = argv[2];
  FILE *f1 = fopen(fn1, "r");
  FILE *f2 = fopen(fn2, "r");
  if (f1 == NULL || f2 == NULL)
    error("file error");
  char buf1[0x100];
  char buf2[0x100];
  while (fgets(buf1, 0x100, f1) != NULL && fgets(buf2, 0x100, f2) != NULL) {
    if (strcmp(buf1, buf2) != 0) {
      printf("%s", buf1);
      printf("%s", buf2);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     117f <main+0x2f>
lea    0xe86(%rip),%rdi
call   1060 <error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11d5 <main+0x85>
cmpq   $0x0,-0x30(%rbp)
jne    11e1 <main+0x91>
lea    0xe38(%rip),%rdi
call   1060 <error@plt>
jmp    11e6 <main+0x96>
lea    -0x130(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x100,%esi
call   1040 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x231(%rbp)
je     1232 <main+0xe2>
lea    -0x230(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x231(%rbp)
mov    -0x231(%rbp),%al
test   $0x1,%al
jne    1245 <main+0xf5>
jmp    1292 <main+0x142>
lea    -0x130(%rbp),%rdi
lea    -0x230(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     128d <main+0x13d>
lea    -0x130(%rbp),%rsi
lea    0xdaf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x230(%rbp),%rsi
lea    0xd9c(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x142>
jmp    11e6 <main+0x96>
xor    %eax,%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1172 <main+0x22>
lea    0xe93(%rip),%rdi
call   1060 <error@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rbx
lea    0xe9c(%rip),%r15
mov    %r15,%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <fopen@plt>
mov    %rax,%r15
test   %r14,%r14
je     11a4 <main+0x54>
test   %r15,%r15
jne    11b0 <main+0x60>
lea    0xe69(%rip),%rdi
call   1060 <error@plt>
lea    0x100(%rsp),%r12
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     121c <main+0xcc>
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     121c <main+0xcc>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11c0 <main+0x70>
lea    0xe1e(%rip),%rbx
lea    0x100(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"args: <file> <file>\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"file error\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
store i8* %19, i8** %6
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
store i8* %22, i8** %7
%23 = load i8*, i8** %6
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %8
%25 = load i8*, i8** %7
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %26, i32** %9
%27 = load i32*, i32** %8
%28 = icmp eq i32* %27, null
br i1 %28, label %32, label %29
29: ; preds = %16
%30 = load i32*, i32** %9
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %34
32: ; preds = %29, %16
%33 = call i32 @error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
br label %35
35: ; preds = %57, %34
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%37 = load i32*, i32** %8
%38 = call i32* @fgets(i8* %36, i32 256, i32* %37)
%39 = icmp ne i32* %38, null
br i1 %39, label %40, label %45
40: ; preds = %35
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%42 = load i32*, i32** %9
%43 = call i32* @fgets(i8* %41, i32 256, i32* %42)
%44 = icmp ne i32* %43, null
br label %45
45: ; preds = %40, %35
%46 = phi i1 [ false, %35 ], [ %44, %40 ]
br i1 %46, label %47, label %58
47: ; preds = %45
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%50 = call i64 @strcmp(i8* %48, i8* %49)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %57
52: ; preds = %47
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%54 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %53)
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%56 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %55)
br label %58
57: ; preds = %47
br label %35
58: ; preds = %52, %45
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"args: <file> <file>\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"file error\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = icmp eq i32 %0, 3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %13, null
%16 = icmp eq i32* %14, null
%17 = or i1 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %8
%19 = tail call i32 @error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %8, %18
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
br label %23
23: ; preds = %29, %20
%24 = call i32* @fgets(i8* %21, i32 256, i32* %13)
%25 = icmp eq i32* %24, null
br i1 %25, label %35, label %26
26: ; preds = %23
%27 = call i32* @fgets(i8* %22, i32 256, i32* %14)
%28 = icmp eq i32* %27, null
br i1 %28, label %35, label %29
29: ; preds = %26
%30 = call i64 @strcmp(i8* %21, i8* %22)
%31 = icmp eq i64 %30, 0
br i1 %31, label %23, label %32
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %35
35: ; preds = %23, %26, %32
ret i32 0
}