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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main(int argc, char const *argv[]) {
  if (argc > 2) {
    FILE *f1, *f2;
    char buff1[32], buff2[32];
    unsigned int line = 1;
    f1 = fopen(argv[1], "r");
    if (!f1) {
      printf("Can not open file %s\n", argv[1]);
      exit(1);
    }
    f2 = fopen(argv[2], "r");
    if (!f2) {
      printf("Can not open file %s\n", argv[2]);
      exit(1);
    }
    while (fgets(buff1, sizeof(buff1), f1) != NULL &&
           fgets(buff2, sizeof(buff2), f2) != NULL) {
      if (strcmp(buff1, buff2) != 0) {
        printf("Diff at line %d:\n", line);
        printf("%s:\n", argv[1]);
        printf("\t%s\n", buff1);
        printf("%s:\n", argv[2]);
        printf("\t%s\n", buff2);
        break;
      }
      line++;
    }
    fclose(f1);
    fclose(f2);
  } else {
    printf("Error: Argument count less than two.\n");
    exit(2);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1304 <main+0x1a4>
movl   $0x1,-0x64(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11ca <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe27(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    120d <main+0xad>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    1212 <main+0xb2>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x20,%esi
call   1050 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x65(%rbp)
je     1252 <main+0xf2>
lea    -0x60(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x20,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x65(%rbp)
mov    -0x65(%rbp),%al
test   $0x1,%al
jne    1262 <main+0x102>
jmp    12ed <main+0x18d>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     12df <main+0x17f>
mov    -0x64(%rbp),%esi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xd5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ed <main+0x18d>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1212 <main+0xb2>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
jmp    131c <main+0x1bc>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1080 <exit@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x3,%edi
jl     11a1 <main+0x31>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xe6f(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
jne    11b7 <main+0x47>
mov    0x8(%r14),%rsi
jmp    11d3 <main+0x63>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1090 <exit@plt>
mov    %rax,%r15
mov    0x10(%r14),%rdi
lea    0xe3b(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
jne    11eb <main+0x7b>
mov    0x10(%r14),%rsi
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    %rax,%r12
mov    %rsp,%rdi
mov    $0x20,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     12b9 <main+0x149>
mov    $0x1,%ebp
lea    0x20(%rsp),%r13
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
mov    $0x20,%esi
mov    %r12,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     12b9 <main+0x149>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1263 <main+0xf3>
add    $0x1,%ebp
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
jne    1220 <main+0xb0>
jmp    12b9 <main+0x149>
lea    0xdae(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%r14),%rsi
lea    0xdac(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xda0(%rip),%rbp
mov    %rsp,%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%r14),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [22 x i8] c"Can not open file %s\0A\00"
@.str.2 = [18 x i8] c"Diff at line %d:\0A\00"
@.str.3 = [5 x i8] c"%s:\0A\00"
@.str.4 = [5 x i8] c"\09%s\0A\00"
@.str.5 = [38 x i8] c"Error: Argument count less than two.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [32 x i8]
%9 = alloca [32 x i8]
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 2
br i1 %12, label %13, label %80
13: ; preds = %2
store i32 1, i32* %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %17, i32** %6
%18 = load i32*, i32** %6
%19 = icmp ne i32* %18, null
br i1 %19, label %26, label %20
20: ; preds = %13
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %13
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %30, i32** %7
%31 = load i32*, i32** %7
%32 = icmp ne i32* %31, null
br i1 %32, label %39, label %33
33: ; preds = %26
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 2
%36 = load i8*, i8** %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %36)
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %26
br label %40
40: ; preds = %72, %39
%41 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%42 = load i32*, i32** %6
%43 = call i32* @fgets(i8* %41, i32 32, i32* %42)
%44 = icmp ne i32* %43, null
br i1 %44, label %45, label %50
45: ; preds = %40
%46 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%47 = load i32*, i32** %7
%48 = call i32* @fgets(i8* %46, i32 32, i32* %47)
%49 = icmp ne i32* %48, null
br label %50
50: ; preds = %45, %40
%51 = phi i1 [ false, %40 ], [ %49, %45 ]
br i1 %51, label %52, label %75
52: ; preds = %50
%53 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%54 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%55 = call i64 @strcmp(i8* %53, i8* %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %72
57: ; preds = %52
%58 = load i32, i32* %10
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %58)
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 1
%62 = load i8*, i8** %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %62)
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %64)
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 2
%68 = load i8*, i8** %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %68)
%70 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %70)
br label %75
72: ; preds = %52
%73 = load i32, i32* %10
%74 = add i32 %73, 1
store i32 %74, i32* %10
br label %40
75: ; preds = %57, %50
%76 = load i32*, i32** %6
%77 = call i32 @fclose(i32* %76)
%78 = load i32*, i32** %7
%79 = call i32 @fclose(i32* %78)
br label %83
80: ; preds = %2
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%82 = call i32 @exit(i32 2)
unreachable
83: ; preds = %75
%84 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [22 x i8] c"Can not open file %s\0A\00"
@.str.2 = [18 x i8] c"Diff at line %d:\0A\00"
@.str.3 = [5 x i8] c"%s:\0A\00"
@.str.4 = [5 x i8] c"\09%s\0A\00"
@str = [37 x i8] c"Error: Argument count less than two.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i8]
%4 = alloca [32 x i8]
%5 = icmp sgt i32 %0, 2
br i1 %5, label %6, label %52
6: ; preds = %2
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i8*, i8** %9
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %6
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = call i32* @fgets(i8* %7, i32 32, i32* %11)
%24 = icmp eq i32* %23, null
br i1 %24, label %48, label %29
25: ; preds = %17
%26 = load i8*, i8** %18
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = tail call i32 @exit(i32 1)
unreachable
29: ; preds = %22, %44
%30 = phi i32 [ %45, %44 ], [ 1, %22 ]
%31 = call i32* @fgets(i8* %8, i32 32, i32* %20)
%32 = icmp eq i32* %31, null
br i1 %32, label %48, label %33
33: ; preds = %29
%34 = call i64 @strcmp(i8* %7, i8* %8)
%35 = icmp eq i64 %34, 0
br i1 %35, label %44, label %36
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%38 = load i8*, i8** %9
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %38)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%41 = load i8*, i8** %18
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %8)
br label %48
44: ; preds = %33
%45 = add i32 %30, 1
%46 = call i32* @fgets(i8* %7, i32 32, i32* %11)
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %29
48: ; preds = %29, %44, %22, %36
%49 = call i32 @fclose(i32* %11)
%50 = call i32 @fclose(i32* %20)
%51 = call i32 @exit(i32 0)
unreachable
52: ; preds = %2
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%54 = tail call i32 @exit(i32 2)
unreachable
}