#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
main(int argc, char **argv) {
  FILE *in1, *in2;
  int crs;
  char line1[255], line2[255];
  if ((in1 = fopen(argv[1], "r")) == 0) {
    printf("cannot open %s for reading\n", argv[1]);
    exit(0);
  }
  if ((in2 = fopen(argv[2], "r")) == 0) {
    printf("cannot open %s for reading\n", argv[2]);
    exit(0);
  }
  crs = 0;
  while (1) {
    {
      int rl_ch;
      int rl_i;
      rl_ch = getc(in1);
      rl_i = 0;
      while (rl_ch != '\n') {
        line1[rl_i] = (char)rl_ch;
        rl_i += 1;
        rl_ch = getc(in1);
        if (rl_ch == EOF)
          exit(1);
      }
      line1[rl_i] = (char)0;
    };
    {
      int rl_ch;
      int rl_i;
      rl_ch = getc(in2);
      rl_i = 0;
      while (rl_ch != '\n') {
        line2[rl_i] = (char)rl_ch;
        rl_i += 1;
        rl_ch = getc(in2);
        if (rl_ch == EOF)
          exit(1);
      }
      line2[rl_i] = (char)0;
    };
    if (strcmp(line1, line2) != 0) {
      printf("files differ in line %d\n", crs);
    }
    crs += 1;
  }
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe88(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11a8 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe49(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    11e7 <main+0x97>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x234(%rbp)
movl   $0x0,-0x238(%rbp)
cmpl   $0xa,-0x234(%rbp)
je     126c <main+0x11c>
mov    -0x234(%rbp),%eax
mov    %al,%cl
movslq -0x238(%rbp),%rax
mov    %cl,-0x130(%rbp,%rax,1)
mov    -0x238(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x238(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x234(%rbp)
mov    -0x234(%rbp),%eax
mov    0x2d93(%rip),%rcx
cmp    (%rcx),%eax
jne    1267 <main+0x117>
mov    $0x1,%edi
call   1060 <exit@plt>
jmp    1207 <main+0xb7>
movslq -0x238(%rbp),%rax
movb   $0x0,-0x130(%rbp,%rax,1)
mov    -0x20(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x23c(%rbp)
movl   $0x0,-0x240(%rbp)
cmpl   $0xa,-0x23c(%rbp)
je     12f9 <main+0x1a9>
mov    -0x23c(%rbp),%eax
mov    %al,%cl
movslq -0x240(%rbp),%rax
mov    %cl,-0x230(%rbp,%rax,1)
mov    -0x240(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x240(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x23c(%rbp)
mov    -0x23c(%rbp),%eax
mov    0x2d06(%rip),%rcx
cmp    (%rcx),%eax
jne    12f4 <main+0x1a4>
mov    $0x1,%edi
call   1060 <exit@plt>
jmp    1294 <main+0x144>
movslq -0x240(%rbp),%rax
movb   $0x0,-0x230(%rbp,%rax,1)
lea    -0x130(%rbp),%rdi
lea    -0x230(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1336 <main+0x1e6>
mov    -0x24(%rbp),%esi
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ee <main+0x9e>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xe91(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     126f <main+0x11f>
mov    %rax,%r14
mov    0x10(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1275 <main+0x125>
mov    %rax,%rbx
mov    0x2e45(%rip),%r13
xor    %r12d,%r12d
jmp    11b4 <main+0x64>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
mov    %r14,%rdi
call   1070 <getc@plt>
xor    %r15d,%r15d
nop
cmp    $0xa,%eax
je     11f0 <main+0xa0>
mov    %al,0x100(%rsp,%r15,1)
add    $0x1,%r15
mov    %r14,%rdi
call   1070 <getc@plt>
cmp    0x0(%r13),%eax
jne    11c0 <main+0x70>
jmp    1265 <main+0x115>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15d,%eax
movb   $0x0,0x100(%rsp,%rax,1)
mov    %rbx,%rdi
call   1070 <getc@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0xa,%eax
je     1230 <main+0xe0>
mov    %al,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1070 <getc@plt>
cmp    0x0(%r13),%eax
jne    1210 <main+0xc0>
jmp    1265 <main+0x115>
nopl   0x0(%rax)
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0x100(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11b0 <main+0x60>
lea    0xdc8(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11b0 <main+0x60>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    0x8(%rbp),%rsi
jmp    1279 <main+0x129>
mov    0x10(%rbp),%rsi
lea    0xd82(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [28 x i8] c"cannot open %s for reading\0A\00"
@EOF = global i32 0
@.str.2 = [25 x i8] c"files differ in line %d\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 i32
%9 = alloca [255 x i8]
%10 = alloca [255 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %18, i32** %6
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %26
20: ; preds = %2
%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 ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 0)
unreachable
26: ; preds = %2
%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 = icmp eq i32* %30, null
br i1 %31, label %32, label %38
32: ; preds = %26
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = call i32 @exit(i32 0)
unreachable
38: ; preds = %26
store i32 0, i32* %8
br label %39
39: ; preds = %38, %97
%40 = load i32*, i32** %6
%41 = call i32 @getc(i32* %40)
store i32 %41, i32* %11
store i32 0, i32* %12
br label %42
42: ; preds = %60, %39
%43 = load i32, i32* %11
%44 = icmp ne i32 %43, 10
br i1 %44, label %45, label %61
45: ; preds = %42
%46 = load i32, i32* %11
%47 = trunc i32 %46 to i8
%48 = load i32, i32* %12
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 %49
store i8 %47, i8* %50
%51 = load i32, i32* %12
%52 = add nsw i32 %51, 1
store i32 %52, i32* %12
%53 = load i32*, i32** %6
%54 = call i32 @getc(i32* %53)
store i32 %54, i32* %11
%55 = load i32, i32* %11
%56 = load i32, i32* @EOF
%57 = icmp eq i32 %55, %56
br i1 %57, label %58, label %60
58: ; preds = %45
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %45
br label %42
61: ; preds = %42
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 %63
store i8 0, i8* %64
%65 = load i32*, i32** %7
%66 = call i32 @getc(i32* %65)
store i32 %66, i32* %13
store i32 0, i32* %14
br label %67
67: ; preds = %85, %61
%68 = load i32, i32* %13
%69 = icmp ne i32 %68, 10
br i1 %69, label %70, label %86
70: ; preds = %67
%71 = load i32, i32* %13
%72 = trunc i32 %71 to i8
%73 = load i32, i32* %14
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 %74
store i8 %72, i8* %75
%76 = load i32, i32* %14
%77 = add nsw i32 %76, 1
store i32 %77, i32* %14
%78 = load i32*, i32** %7
%79 = call i32 @getc(i32* %78)
store i32 %79, i32* %13
%80 = load i32, i32* %13
%81 = load i32, i32* @EOF
%82 = icmp eq i32 %80, %81
br i1 %82, label %83, label %85
83: ; preds = %70
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %70
br label %67
86: ; preds = %67
%87 = load i32, i32* %14
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 %88
store i8 0, i8* %89
%90 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%91 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%92 = call i64 @strcmp(i8* %90, i8* %91)
%93 = icmp ne i64 %92, 0
br i1 %93, label %94, label %97
94: ; preds = %86
%95 = load i32, i32* %8
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %95)
br label %97
97: ; preds = %94, %86
%98 = load i32, i32* %8
%99 = add nsw i32 %98, 1
store i32 %99, i32* %8
br label %39
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [28 x i8] c"cannot open %s for reading\0A\00"
@EOF = global i32 0
@.str.2 = [25 x i8] c"files differ in line %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = alloca [255 x i8]
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %7
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = tail call i32 @exit(i32 0)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = load i8*, i8** %16
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %15, %64
%25 = phi i32 [ %65, %64 ], [ 0, %15 ]
%26 = call i32 @getc(i32* %9)
br label %27
27: ; preds = %31, %24
%28 = phi i64 [ %34, %31 ], [ 0, %24 ]
%29 = phi i32 [ %35, %31 ], [ %26, %24 ]
%30 = icmp eq i32 %29, 10
br i1 %30, label %40, label %31
31: ; preds = %27
%32 = trunc i32 %29 to i8
%33 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %28
store i8 %32, i8* %33
%34 = add nuw i64 %28, 1
%35 = call i32 @getc(i32* %9)
%36 = load i32, i32* @EOF
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %27
38: ; preds = %31
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %27
%41 = and i64 %28, 4294967295
%42 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %41
store i8 0, i8* %42
%43 = call i32 @getc(i32* %18)
br label %44
44: ; preds = %48, %40
%45 = phi i64 [ %51, %48 ], [ 0, %40 ]
%46 = phi i32 [ %52, %48 ], [ %43, %40 ]
%47 = icmp eq i32 %46, 10
br i1 %47, label %57, label %48
48: ; preds = %44
%49 = trunc i32 %46 to i8
%50 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 %45
store i8 %49, i8* %50
%51 = add nuw i64 %45, 1
%52 = call i32 @getc(i32* %18)
%53 = load i32, i32* @EOF
%54 = icmp eq i32 %52, %53
br i1 %54, label %55, label %44
55: ; preds = %48
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %44
%58 = and i64 %45, 4294967295
%59 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 %58
store i8 0, i8* %59
%60 = call i64 @strcmp(i8* %5, i8* %6)
%61 = icmp eq i64 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %57
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %64
64: ; preds = %62, %57
%65 = add nuw nsw i32 %25, 1
br label %24
}