#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *prog = argv[0];
  if (argc != 3) {
    fprintf(stderr, "Usage:%s file1 file2\n", prog);
    return 1;
  }
  char *file1, *file2;
  file1 = argv[1], file2 = argv[2];
  FILE *fp1, *fp2;
  if ((fp1 = fopen(file1, "r")) == NULL) {
    fprintf(stderr, "open %s fail,pleasr check is this file exist.\n", file1);
    return 1;
  }
  if ((fp2 = fopen(file2, "r")) == NULL) {
    fprintf(stderr, "open %s fail,pleasr check is this file exist.\n", file2);
    return 1;
  }
  char line1[1000], line2[1000];
  int linenum = 0;
  while (fgets(line1, 1000, fp1) != NULL && fgets(line2, 1000, fp2) != NULL) {
    linenum++;
    if (strcmp(line1, line2) != 0) {
      printf("%dc%d\n", linenum, linenum);
      printf("< %s---\n> %s", line1, line2);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11a3 <main+0x53>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe6e(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    131d <main+0x1cd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe50(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11fe <main+0xae>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe2b(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    131d <main+0x1cd>
mov    -0x28(%rbp),%rdi
lea    0xe0d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1241 <main+0xf1>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xde8(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    131d <main+0x1cd>
movl   $0x0,-0x814(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    $0x3e8,%esi
call   1040 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x815(%rbp)
je     1297 <main+0x147>
lea    -0x810(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x3e8,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x815(%rbp)
mov    -0x815(%rbp),%al
test   $0x1,%al
jne    12aa <main+0x15a>
jmp    1316 <main+0x1c6>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
lea    -0x420(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1311 <main+0x1c1>
mov    -0x814(%rbp),%esi
mov    -0x814(%rbp),%edx
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x420(%rbp),%rsi
lea    -0x810(%rbp),%rdx
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1316 <main+0x1c6>
jmp    124b <main+0xfb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x7e0,%rsp
cmp    $0x3,%edi
jne    122c <main+0xdc>
mov    0x8(%rsi),%rbp
mov    0x10(%rsi),%r15
lea    0xe9f(%rip),%rsi
mov    %rbp,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     1241 <main+0xf1>
mov    %rax,%rbx
lea    0xe84(%rip),%rsi
mov    %r15,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     1256 <main+0x106>
mov    %rax,%r14
xor    %ebp,%ebp
lea    0x3f0(%rsp),%r15
mov    %rsp,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    $0x3e8,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1228 <main+0xd8>
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1228 <main+0xd8>
add    $0x1,%ebp
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11c0 <main+0x70>
lea    0xe43(%rip),%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
lea    0x3f0(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
jmp    1273 <main+0x123>
mov    (%rsi),%rdx
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
lea    0xdc1(%rip),%rsi
jmp    1269 <main+0x119>
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
lea    0xdc7(%rip),%rsi
mov    %rbp,%rdx
jmp    1269 <main+0x119>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
lea    0xdb2(%rip),%rsi
mov    %r15,%rdx
call   1060 <fprintf@plt>
mov    $0x1,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage:%s file1 file2\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [47 x i8] c"open %s fail,pleasr check is this file exist.\0A\00"
@.str.3 = [7 x i8] c"%dc%d\0A\00"
@.str.4 = [13 x i8] c"< %s---\0A> %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 i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [1000 x i8]
%12 = alloca [1000 x i8]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
store i8* %16, i8** %6
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 3
br i1 %18, label %19, label %23
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %6
%22 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 1, i32* %3
br label %74
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
store i8* %26, i8** %7
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
store i8* %29, i8** %8
%30 = load i8*, i8** %7
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %31, i32** %9
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %37
33: ; preds = %23
%34 = load i32, i32* @stderr
%35 = load i8*, i8** %7
%36 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %35)
store i32 1, i32* %3
br label %74
37: ; preds = %23
%38 = load i8*, i8** %8
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %39, i32** %10
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = load i32, i32* @stderr
%43 = load i8*, i8** %8
%44 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %43)
store i32 1, i32* %3
br label %74
45: ; preds = %37
store i32 0, i32* %13
br label %46
46: ; preds = %72, %45
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%48 = load i32*, i32** %9
%49 = call i32* @fgets(i8* %47, i32 1000, i32* %48)
%50 = icmp ne i32* %49, null
br i1 %50, label %51, label %56
51: ; preds = %46
%52 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%53 = load i32*, i32** %10
%54 = call i32* @fgets(i8* %52, i32 1000, i32* %53)
%55 = icmp ne i32* %54, null
br label %56
56: ; preds = %51, %46
%57 = phi i1 [ false, %46 ], [ %55, %51 ]
br i1 %57, label %58, label %73
58: ; preds = %56
%59 = load i32, i32* %13
%60 = add nsw i32 %59, 1
store i32 %60, i32* %13
%61 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%62 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%63 = call i64 @strcmp(i8* %61, i8* %62)
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %72
65: ; preds = %58
%66 = load i32, i32* %13
%67 = load i32, i32* %13
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %66, i32 %67)
%69 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%70 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %69, i8* %70)
br label %73
72: ; preds = %58
br label %46
73: ; preds = %65, %56
store i32 0, i32* %3
br label %74
74: ; preds = %73, %41, %33, %19
%75 = load i32, i32* %3
ret i32 %75
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage:%s file1 file2\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [47 x i8] c"open %s fail,pleasr check is this file exist.\0A\00"
@.str.3 = [7 x i8] c"%dc%d\0A\00"
@.str.4 = [13 x i8] c"< %s---\0A> %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
%5 = icmp eq i32 %0, 3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %44
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %44
20: ; preds = %10
%21 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %14)
br label %44
26: ; preds = %20
%27 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%28 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
br label %29
29: ; preds = %36, %26
%30 = phi i32 [ 0, %26 ], [ %37, %36 ]
%31 = call i32* @fgets(i8* %27, i32 1000, i32* %15)
%32 = icmp eq i32* %31, null
br i1 %32, label %43, label %33
33: ; preds = %29
%34 = call i32* @fgets(i8* %28, i32 1000, i32* %21)
%35 = icmp eq i32* %34, null
br i1 %35, label %43, label %36
36: ; preds = %33
%37 = add nuw nsw i32 %30, 1
%38 = call i64 @strcmp(i8* %27, i8* %28)
%39 = icmp eq i64 %38, 0
br i1 %39, label %29, label %40
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %37, i32 %37)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %27, i8* %28)
br label %43
43: ; preds = %29, %33, %40
br label %44
44: ; preds = %17, %23, %43, %6
%45 = phi i32 [ 1, %6 ], [ 1, %17 ], [ 1, %23 ], [ 0, %43 ]
ret i32 %45
}