#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*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void compare(FILE *fp1, FILE *fp2) {
  char str1[80], str2[80];
  while (fgets(str1, 80, fp1) != NULL && fgets(str2, 80, fp2) != NULL)
    if (strcmp(str1, str2) != 0) {
      printf("%s%s", str1, str2);
      break;
    }
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xb1(%rbp)
je     118c <compare+0x5c>
lea    -0xb0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x50,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xb1(%rbp)
mov    -0xb1(%rbp),%al
test   $0x1,%al
jne    119f <compare+0x6f>
jmp    11da <compare+0xaa>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11d5 <compare+0xa5>
lea    -0x60(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <compare+0xaa>
jmp    1143 <compare+0x13>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x50(%rsp),%r15
mov    %rsp,%r12
nopl   0x0(%rax)
mov    %r15,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     119e <compare+0x6e>
mov    %r12,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     119e <compare+0x6e>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1150 <compare+0x20>
lea    0xe6f(%rip),%rdi
lea    0x50(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <printf@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define void @compare(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [80 x i8]
%6 = alloca [80 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %7
7: ; preds = %28, %2
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i32* @fgets(i8* %8, i32 80, i32* %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%14 = load i32*, i32** %4
%15 = call i32* @fgets(i8* %13, i32 80, i32* %14)
%16 = icmp ne i32* %15, null
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %29
19: ; preds = %17
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%26 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%27 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %25, i8* %26)
br label %29
28: ; preds = %19
br label %7
29: ; preds = %24, %17
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define void @compare(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
br label %7
7: ; preds = %13, %2
%8 = call i32* @fgets(i8* %5, i32 80, i32* %0)
%9 = icmp eq i32* %8, null
br i1 %9, label %18, label %10
10: ; preds = %7
%11 = call i32* @fgets(i8* %6, i32 80, i32* %1)
%12 = icmp eq i32* %11, null
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = call i64 @strcmp(i8* %5, i8* %6)
%15 = icmp eq i64 %14, 0
br i1 %15, label %7, label %16
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
br label %18
18: ; preds = %7, %10, %16
ret void
}