#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*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, int, char, char);
int main(void) {
  FILE *f1, *f2;
  char r1[2810], r2[2810];
  int i;
  memset(r1, 2810, sizeof(char));
  memset(r2, 2810, sizeof(char));
  f1 = fopen("cronosII1.png", "r");
  f2 = fopen("cronosII2.png", "r");
  fread(r1, 2810, sizeof(char), f1);
  fread(r2, 2810, sizeof(char), f2);
  for (i = 0; i < 2810; i++) {
    if (r1[i] != r2[i])
      printf("Diferencia en %d [%c, %c]\n", i, r1[i], r2[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1630,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb20(%rbp),%rdi
mov    $0xafa,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    -0x1620(%rbp),%rdi
mov    $0xafa,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    0xe7b(%rip),%rdi
lea    0xe82(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe74(%rip),%rdi
lea    0xe6b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0xb20(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0xafa,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
lea    -0x1620(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0xafa,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movl   $0x0,-0x1624(%rbp)
cmpl   $0xafa,-0x1624(%rbp)
jge    126b <main+0x12b>
movslq -0x1624(%rbp),%rax
movsbl -0xb20(%rbp,%rax,1),%eax
ff
movslq -0x1624(%rbp),%rcx
movsbl -0x1620(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     1252 <main+0x112>
mov    -0x1624(%rbp),%esi
movslq -0x1624(%rbp),%rax
mov    -0xb20(%rbp,%rax,1),%cl
movslq -0x1624(%rbp),%rax
lea    0xddc(%rip),%rdi
movsbl %cl,%edx
movsbl -0x1620(%rbp,%rax,1),%ecx
ff
call   1040 <printf@plt>
jmp    1257 <main+0x117>
mov    -0x1624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1624(%rbp)
jmp    11ea <main+0xaa>
xor    %eax,%eax
add    $0x1630,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1608,%rsp
lea    0xb00(%rsp),%r14
mov    %r14,%rdi
mov    $0xafa,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xafa,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    0xe7c(%rip),%rdi
lea    0xe83(%rip),%r12
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe73(%rip),%rdi
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%r12
mov    %r14,%rdi
mov    $0xafa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r15,%rdi
mov    $0xafa,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fread@plt>
xor    %ebx,%ebx
lea    0xe43(%rip),%r14
jmp    11ed <main+0xad>
nopl   (%rax)
add    $0x1,%rbx
cmp    $0xafa,%rbx
je     120f <main+0xcf>
movzbl 0xb00(%rsp,%rbx,1),%eax
movzbl (%rsp,%rbx,1),%ecx
cmp    %cl,%al
je     11e0 <main+0xa0>
movsbl %al,%edx
movsbl %cl,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    11e0 <main+0xa0>
xor    %eax,%eax
add    $0x1608,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"cronosII1.png\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [14 x i8] c"cronosII2.png\00"
@.str.3 = [27 x i8] c"Diferencia en %d [%c, %c]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [2810 x i8]
%5 = alloca [2810 x i8]
%6 = alloca i32
store i32 0, i32* %1
%7 = getelementptr inbounds [2810 x i8], [2810 x i8]* %4, i64 0, i64 0
%8 = call i32 @memset(i8* %7, i32 2810, i32 1)
%9 = getelementptr inbounds [2810 x i8], [2810 x i8]* %5, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 2810, i32 1)
%11 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %2
%12 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %12, i32** %3
%13 = getelementptr inbounds [2810 x i8], [2810 x i8]* %4, i64 0, i64 0
%14 = load i32*, i32** %2
%15 = call i32 @fread(i8* %13, i32 2810, i32 1, i32* %14)
%16 = getelementptr inbounds [2810 x i8], [2810 x i8]* %5, i64 0, i64 0
%17 = load i32*, i32** %3
%18 = call i32 @fread(i8* %16, i32 2810, i32 1, i32* %17)
store i32 0, i32* %6
br label %19
19: ; preds = %46, %0
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 2810
br i1 %21, label %22, label %49
22: ; preds = %19
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2810 x i8], [2810 x i8]* %4, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [2810 x i8], [2810 x i8]* %5, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %27, %32
br i1 %33, label %34, label %45
34: ; preds = %22
%35 = load i32, i32* %6
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [2810 x i8], [2810 x i8]* %4, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [2810 x i8], [2810 x i8]* %5, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %35, i8 signext %39, i8 signext %43)
br label %45
45: ; preds = %34, %22
br label %46
46: ; preds = %45
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %19
49: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"cronosII1.png\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [14 x i8] c"cronosII2.png\00"
@.str.3 = [27 x i8] c"Diferencia en %d [%c, %c]\0A\00"
define i32 @main() {
%1 = alloca [2810 x i8]
%2 = alloca [2810 x i8]
%3 = getelementptr inbounds [2810 x i8], [2810 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2810 x i8], [2810 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %3, i32 2810, i32 1)
%6 = call i32 @memset(i8* %4, i32 2810, i32 1)
%7 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @fread(i8* %3, i32 2810, i32 1, i32* %7)
%10 = call i32 @fread(i8* %4, i32 2810, i32 1, i32* %8)
br label %11
11: ; preds = %0, %21
%12 = phi i64 [ 0, %0 ], [ %22, %21 ]
%13 = getelementptr inbounds [2810 x i8], [2810 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = getelementptr inbounds [2810 x i8], [2810 x i8]* %2, i64 0, i64 %12
%16 = load i8, i8* %15
%17 = icmp eq i8 %14, %16
br i1 %17, label %21, label %18
18: ; preds = %11
%19 = trunc i64 %12 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %19, i8 signext %14, i8 signext %16)
br label %21
21: ; preds = %11, %18
%22 = add nuw nsw i64 %12, 1
%23 = icmp eq i64 %22, 2810
br i1 %23, label %24, label %11
24: ; preds = %21
ret i32 0
}