#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  FILE *f = NULL, *g = NULL;
  char f_line[256] = {0}, g_line[256] = {0};
  if (argc != 3) {
    printf("\nerror: corect usage ./exec_file f1 f2");
    exit(0);
  }
  if ((f = fopen(argv[1], "r")) == NULL) {
    printf("\nerror:couldn't open %s", argv[1]);
    exit(0);
  }
  if ((g = fopen(argv[2], "r")) == NULL) {
    printf("\nerror:couldn't open %s", argv[2]);
    exit(0);
  }
  while (1) {
    memset(f_line, 0, 256);
    memset(g_line, 0, 256);
    if (fgets(f_line, 256, f) == NULL)
      break;
    if (fgets(g_line, 256, g) == NULL)
      break;
    if (!strcmp(f_line, g_line))
      continue;
    else {
      printf("\nFirst lines that don't match are: \n\t%s\n\t%s", f_line,
             g_line);
      break;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
cmpl   $0x3,-0x8(%rbp)
je     11d5 <main+0x75>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe43(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1214 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe04(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1253 <main+0xf3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
jmp    1258 <main+0xf8>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x130(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
jne    12a2 <main+0x142>
jmp    1303 <main+0x1a3>
lea    -0x230(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
jne    12c6 <main+0x166>
jmp    1303 <main+0x1a3>
lea    -0x130(%rbp),%rdi
lea    -0x230(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12e7 <main+0x187>
jmp    1258 <main+0xf8>
lea    -0x130(%rbp),%rsi
lea    -0x230(%rbp),%rdx
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
cmp    $0x3,%edi
jne    1331 <main+0x1d1>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xdb8(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1346 <main+0x1e6>
mov    %rax,%r15
mov    0x10(%r14),%rdi
lea    0xd9c(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     134c <main+0x1ec>
mov    %rax,%r12
lea    0x100(%rsp),%r14
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    $0x100,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1320 <main+0x1c0>
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1320 <main+0x1c0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12b0 <main+0x150>
lea    0xd33(%rip),%rdi
lea    0x100(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xcc8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    0x8(%r14),%rsi
jmp    1350 <main+0x1f0>
mov    0x10(%r14),%rsi
lea    0xcd2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0Aerror: corect usage ./exec_file f1 f2\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [24 x i8] c"\0Aerror:couldn't open %s\00"
@.str.3 = [44 x i8] c"\0AFirst lines that don't match are: \0A\09%s\0A\09%s\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 i32*
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32* null, i32** %7
store i32* null, i32** %8
%11 = bitcast [256 x i8]* %9 to i8*
%12 = bitcast [256 x i8]* %10 to i8*
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %7
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %30
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = call i32 @exit(i32 0)
unreachable
30: ; preds = %18
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %34, i32** %8
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %42
36: ; preds = %30
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %39)
%41 = call i32 @exit(i32 0)
unreachable
42: ; preds = %30
br label %43
43: ; preds = %42, %64
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%45 = call i32 @memset(i8* %44, i32 0, i32 256)
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%47 = call i32 @memset(i8* %46, i32 0, i32 256)
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%49 = load i32*, i32** %7
%50 = call i32* @fgets(i8* %48, i32 256, i32* %49)
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %53
52: ; preds = %43
br label %69
53: ; preds = %43
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%55 = load i32*, i32** %8
%56 = call i32* @fgets(i8* %54, i32 256, i32* %55)
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %59
58: ; preds = %53
br label %69
59: ; preds = %53
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%61 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%62 = call i32 @strcmp(i8* %60, i8* %61)
%63 = icmp ne i32 %62, 0
br i1 %63, label %65, label %64
64: ; preds = %59
br label %43
65: ; preds = %59
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i8* %66, i8* %67)
br label %69
69: ; preds = %65, %58, %52
%70 = load i32, i32* %6
ret i32 %70
}

LLVM IR (-O2):
@.str = [39 x i8] c"\0Aerror: corect usage ./exec_file f1 f2\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [24 x i8] c"\0Aerror:couldn't open %s\00"
@.str.3 = [44 x i8] c"\0AFirst lines that don't match are: \0A\09%s\0A\09%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i8*, i8** %12
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = tail call i32 @exit(i32 0)
unreachable
20: ; preds = %11
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = load i8*, i8** %21
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = tail call i32 @exit(i32 0)
unreachable
29: ; preds = %20, %37
%30 = call i32 @memset(i8* %5, i32 0, i32 256)
%31 = call i32 @memset(i8* %6, i32 0, i32 256)
%32 = call i32* @fgets(i8* %5, i32 256, i32* %14)
%33 = icmp eq i32* %32, null
br i1 %33, label %42, label %34
34: ; preds = %29
%35 = call i32* @fgets(i8* %6, i32 256, i32* %23)
%36 = icmp eq i32* %35, null
br i1 %36, label %42, label %37
37: ; preds = %34
%38 = call i32 @strcmp(i8* %5, i8* %6)
%39 = icmp eq i32 %38, 0
br i1 %39, label %29, label %40
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i8* %5, i8* %6)
br label %42
42: ; preds = %34, %29, %40
ret i32 0
}