#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 */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void diff(char *tmp, char *file, char *loc) {
  char *files, command[5000];
  strcpy(files, file);
  strcat(files, " ");
  strcat(files, tmp);
  if (0) {
    strcpy(command, "FC ");
    strcat(command, files);
  } else {
    system("echo \"Old Items\t\t\t\t\t\t\tNew Items\"\n");
    strcpy(command, "diff --side-by-side ");
    strcat(command, files);
    strcat(command, " | grep -E \'< | >\' ");
  }
  system(command);
  puts("\nProgram successfully quit.");
}


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xeda(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
lea    0xe78(%rip),%rdi
call   1050 <system@plt>
lea    -0x13b0(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x13b0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x13b0(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x13b0(%rbp),%rdi
call   1050 <system@plt>
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
add    $0x13b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
push   %rbx
sub    $0x1390,%rsp
mov    %rdi,%rbx
call   1030 <strcpy@plt>
lea    0xef2(%rip),%rsi
call   1060 <strcat@plt>
mov    %rbx,%rsi
call   1060 <strcat@plt>
lea    0xe95(%rip),%rdi
call   1050 <system@plt>
lea    0xeab(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
add    $0x1390,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [34 x i8] c"echo \22Old Items\09\09\09\09\09\09\09New Items\22\0A\00"
@.str.2 = [21 x i8] c"diff --side-by-side \00"
@.str.3 = [20 x i8] c" | grep -E '< | >' \00"
@.str.4 = [28 x i8] c"\0AProgram successfully quit.\00"
define void @diff(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [5000 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %7
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %7
%15 = load i8*, i8** %4
%16 = call i32 @strcat(i8* %14, i8* %15)
%17 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%18 = getelementptr inbounds [5000 x i8], [5000 x i8]* %8, i64 0, i64 0
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%20 = getelementptr inbounds [5000 x i8], [5000 x i8]* %8, i64 0, i64 0
%21 = load i8*, i8** %7
%22 = call i32 @strcat(i8* %20, i8* %21)
%23 = getelementptr inbounds [5000 x i8], [5000 x i8]* %8, i64 0, i64 0
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%25 = getelementptr inbounds [5000 x i8], [5000 x i8]* %8, i64 0, i64 0
%26 = call i32 @system(i8* %25)
%27 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [34 x i8] c"echo \22Old Items\09\09\09\09\09\09\09New Items\22\0A\00"
@.str.2 = [21 x i8] c"diff --side-by-side \00"
@.str.3 = [20 x i8] c" | grep -E '< | >' \00"
@.str.4 = [28 x i8] c"\0AProgram successfully quit.\00"
define void @diff(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = alloca [5000 x i8]
%5 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @strcpy(i8* undef, i8* %1)
%7 = tail call i32 @strcat(i8* undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @strcat(i8* undef, i8* %0)
%9 = tail call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @strcat(i8* %5, i8* undef)
%12 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @system(i8* %5)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
ret void
}