#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*/ getline(char *, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int brief(FILE *fp1, FILE *fp2, char *fname1, char *fname2) {
  char *fp1line = (char *)malloc(200);
  char *fp2line = (char *)malloc(200);
  while (strcmp(fp1line, "") != 0 && strcmp(fp2line, "") != 0) {
    getline(fp1line, 200, fp1);
    getline(fp2line, 200, fp2);
    if (strcmp(fp1line, fp2line) != 0) {
      printf("Files %s and %s differ\n", fname1, fname2);
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<brief>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x39(%rbp)
je     11b0 <brief+0x70>
mov    -0x38(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    11c0 <brief+0x80>
jmp    1220 <brief+0xe0>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xc8,%esi
call   1060 <getline@plt>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xc8,%esi
call   1060 <getline@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     121b <brief+0xdb>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1227 <brief+0xe7>
jmp    1174 <brief+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brief>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,0x10(%rsp)
mov    %rdx,0x8(%rsp)
mov    %rsi,%r12
mov    %rdi,%r13
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
lea    0xe98(%rip),%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11fc <brief+0xbc>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11fc <brief+0xbc>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r13,%rdx
call   1060 <getline@plt>
mov    %rbp,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   1060 <getline@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1190 <brief+0x50>
lea    0xe19(%rip),%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
call   1030 <printf@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [24 x i8] c"Files %s and %s differ\0A\00"
define i32 @brief(i32* %0, i32* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%12 = call i64 @malloc(i32 200)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %10
%14 = call i64 @malloc(i32 200)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %11
br label %16
16: ; preds = %41, %4
%17 = load i8*, i8** %10
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i8*, i8** %11
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %20, %16
%25 = phi i1 [ false, %16 ], [ %23, %20 ]
br i1 %25, label %26, label %42
26: ; preds = %24
%27 = load i8*, i8** %10
%28 = load i32*, i32** %6
%29 = call i32 @getline(i8* %27, i32 200, i32* %28)
%30 = load i8*, i8** %11
%31 = load i32*, i32** %7
%32 = call i32 @getline(i8* %30, i32 200, i32* %31)
%33 = load i8*, i8** %10
%34 = load i8*, i8** %11
%35 = call i64 @strcmp(i8* %33, i8* %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %26
%38 = load i8*, i8** %8
%39 = load i8*, i8** %9
%40 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %38, i8* %39)
store i32 1, i32* %5
br label %43
41: ; preds = %26
br label %16
42: ; preds = %24
store i32 0, i32* %5
br label %43
43: ; preds = %42, %37
%44 = load i32, i32* %5
ret i32 %44
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [24 x i8] c"Files %s and %s differ\0A\00"
define i32 @brief(i32* %0, i32* %1, i8* %2, i8* %3) {
%5 = tail call i64 @malloc(i32 200)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @malloc(i32 200)
%8 = inttoptr i64 %7 to i8*
br label %9
9: ; preds = %15, %4
%10 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %9
%13 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %22, label %15
15: ; preds = %12
%16 = tail call i32 @getline(i8* %6, i32 200, i32* %0)
%17 = tail call i32 @getline(i8* %8, i32 200, i32* %1)
%18 = tail call i64 @strcmp(i8* %6, i8* %8)
%19 = icmp eq i64 %18, 0
br i1 %19, label %9, label %20
20: ; preds = %15
%21 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3)
br label %22
22: ; preds = %12, %9, %20
%23 = phi i32 [ 1, %20 ], [ 0, %9 ], [ 0, %12 ]
ret i32 %23
}