#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 */

/* Variables and functions */
char *filename_full(char *, int, char const *);
int strcmp(char *, char *);
int filename_compare(const char *filename1, const char *filename2) {
  char *str1, *str2;
  char FileName1[260], FileName2[260];
  str1 = filename_full(FileName1, 260, filename1);
  if (str1 == (char *)NULL)
    str1 = "";
  str2 = filename_full(FileName2, 260, filename2);
  if (str2 == (char *)NULL)
    str2 = "";
  return (strcmp(str1, str2));
}


x86 assembly (clang, -O0):
<filename_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x130(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x104,%esi
call   1040 <filename_full@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <filename_compare+0x42>
lea    0xea2(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x240(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x104,%esi
call   1040 <filename_full@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1191 <filename_compare+0x71>
lea    0xe73(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename_compare>:
push   %r15
push   %r14
push   %rbx
sub    $0x220,%rsp
mov    %rsi,%r14
mov    %rdi,%rdx
lea    0x110(%rsp),%rdi
mov    $0x104,%esi
call   1040 <filename_full@plt>
mov    %rax,%r15
test   %rax,%rax
lea    0xeaf(%rip),%rbx
cmove  %rbx,%r15
mov    %rsp,%rdi
mov    $0x104,%esi
mov    %r14,%rdx
call   1040 <filename_full@plt>
test   %rax,%rax
cmovne %rax,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
add    $0x220,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @filename_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [260 x i8]
%8 = alloca [260 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = getelementptr inbounds [260 x i8], [260 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i8* @filename_full(i8* %9, i32 260, i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %5
br label %15
15: ; preds = %14, %2
%16 = getelementptr inbounds [260 x i8], [260 x i8]* %8, i64 0, i64 0
%17 = load i8*, i8** %4
%18 = call i8* @filename_full(i8* %16, i32 260, i8* %17)
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %22
21: ; preds = %15
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %6
br label %22
22: ; preds = %21, %15
%23 = load i8*, i8** %5
%24 = load i8*, i8** %6
%25 = call i32 @strcmp(i8* %23, i8* %24)
ret i32 %25
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @filename_compare(i8* %0, i8* %1) {
%3 = alloca [260 x i8]
%4 = alloca [260 x i8]
%5 = getelementptr inbounds [260 x i8], [260 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [260 x i8], [260 x i8]* %4, i64 0, i64 0
%7 = call i8* @filename_full(i8* %5, i32 260, i8* %0)
%8 = icmp eq i8* %7, null
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %7
%10 = call i8* @filename_full(i8* %6, i32 260, i8* %1)
%11 = icmp eq i8* %10, null
%12 = select i1 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %10
%13 = call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(1) %12)
ret i32 %13
}