#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 */
struct variable_s {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ compare_variables(struct variable_s *, struct variable_s *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ parse_file(int /*<<< orphan*/ *, struct variable_s **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ show_usage(char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char **argv, char **envp) {
  struct variable_s *list1 = 0;
  struct variable_s *list2 = 0;
  FILE *stream1;
  FILE *stream2;
  if (argc != 3) {
    fprintf(stderr, "Unexpected number of arguments: %d\n\n", argc);
    show_usage(argv[0]);
  }
  stream1 = fopen(argv[1], "r");
  if (!stream1) {
    fprintf(stderr, "Failed to open %s for reading: %s\n\n", argv[1],
            strerror(errno));
    show_usage(argv[0]);
  }
  stream2 = fopen(argv[2], "r");
  if (!stream2) {
    fprintf(stderr, "Failed to open %s for reading: %s\n\n", argv[2],
            strerror(errno));
    show_usage(argv[0]);
  }
  parse_file(stream1, &list1);
  parse_file(stream2, &list2);
  fclose(stream1);
  fclose(stream2);
  printf("Comparing:\n\n");
  printf("  file1 = %s\n", argv[1]);
  printf("  file2 = %s\n\n", argv[2]);
  compare_variables(list1, list2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11da <main+0x5a>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe39(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <show_usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3c(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1247 <main+0xc7>
mov    0x2ddc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%rdx
mov    %rax,%rcx
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <show_usage@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdcf(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12b4 <main+0x134>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    0x2d4f(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x54(%rbp),%edi
mov    -0x50(%rbp),%rdx
mov    %rax,%rcx
lea    0xd86(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <show_usage@plt>
mov    -0x30(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1080 <parse_file@plt>
mov    -0x38(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1080 <parse_file@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <compare_variables@plt>
mov    0x2ca2(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
cmp    $0x3,%edi
je     11d6 <main+0x46>
mov    %edi,%edx
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
lea    0xe39(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r15),%rdi
call   1070 <show_usage@plt>
mov    0x8(%r15),%rdi
lea    0xe44(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1227 <main+0x97>
mov    0x2deb(%rip),%rax
mov    (%rax),%ebx
mov    0x8(%r15),%r12
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
lea    0xe17(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r15),%rdi
call   1070 <show_usage@plt>
mov    0x10(%r15),%rdi
lea    0xdf3(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1278 <main+0xe8>
mov    0x2d9a(%rip),%rax
mov    (%rax),%ebp
mov    0x10(%r15),%r12
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
lea    0xdc6(%rip),%rsi
mov    %ebp,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r15),%rdi
call   1070 <show_usage@plt>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1090 <parse_file@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1090 <parse_file@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xdc1(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%r15),%rsi
lea    0xd94(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%r15),%rsi
lea    0xd90(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rsi
call   10a0 <compare_variables@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.variable_s = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"Unexpected number of arguments: %d\0A\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [36 x i8] c"Failed to open %s for reading: %s\0A\0A\00"
@errno = global i32 0
@.str.3 = [13 x i8] c"Comparing:\0A\0A\00"
@.str.4 = [14 x i8] c" file1 = %s\0A\00"
@.str.5 = [15 x i8] c" file2 = %s\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca %struct.variable_s*
%9 = alloca %struct.variable_s*
%10 = alloca i32*
%11 = alloca i32*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store %struct.variable_s* null, %struct.variable_s** %8
store %struct.variable_s* null, %struct.variable_s** %9
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %22
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = load i32, i32* %5
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i8**, i8*** %6
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @show_usage(i8* %20)
br label %22
22: ; preds = %14, %3
%23 = load i8**, i8*** %6
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %26, i32** %10
%27 = load i32*, i32** %10
%28 = icmp ne i32* %27, null
br i1 %28, label %41, label %29
29: ; preds = %22
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %6
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %33, i8* %35)
%37 = load i8**, i8*** %6
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = call i32 @show_usage(i8* %39)
br label %41
41: ; preds = %29, %22
%42 = load i8**, i8*** %6
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32* @fopen(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %45, i32** %11
%46 = load i32*, i32** %11
%47 = icmp ne i32* %46, null
br i1 %47, label %60, label %48
48: ; preds = %41
%49 = load i32, i32* @stderr
%50 = load i8**, i8*** %6
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = load i32, i32* @errno
%54 = call i8* @strerror(i32 %53)
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %52, i8* %54)
%56 = load i8**, i8*** %6
%57 = getelementptr inbounds i8*, i8** %56, i64 0
%58 = load i8*, i8** %57
%59 = call i32 @show_usage(i8* %58)
br label %60
60: ; preds = %48, %41
%61 = load i32*, i32** %10
%62 = call i32 @parse_file(i32* %61, %struct.variable_s** %8)
%63 = load i32*, i32** %11
%64 = call i32 @parse_file(i32* %63, %struct.variable_s** %9)
%65 = load i32*, i32** %10
%66 = call i32 @fclose(i32* %65)
%67 = load i32*, i32** %11
%68 = call i32 @fclose(i32* %67)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%70 = load i8**, i8*** %6
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %72)
%74 = load i8**, i8*** %6
%75 = getelementptr inbounds i8*, i8** %74, i64 2
%76 = load i8*, i8** %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %76)
%78 = load %struct.variable_s*, %struct.variable_s** %8
%79 = load %struct.variable_s*, %struct.variable_s** %9
%80 = call i32 @compare_variables(%struct.variable_s* %78, %struct.variable_s* %79)
%81 = load i32, i32* @EXIT_SUCCESS
ret i32 %81
}

LLVM IR (-O2):
%struct.variable_s = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"Unexpected number of arguments: %d\0A\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [36 x i8] c"Failed to open %s for reading: %s\0A\0A\00"
@errno = global i32 0
@.str.4 = [14 x i8] c" file1 = %s\0A\00"
@.str.5 = [15 x i8] c" file2 = %s\0A\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"Comparing:\0A\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = alloca %struct.variable_s*
%5 = alloca %struct.variable_s*
%6 = bitcast %struct.variable_s** %4 to i8*
store %struct.variable_s* null, %struct.variable_s** %4
%7 = bitcast %struct.variable_s** %5 to i8*
store %struct.variable_s* null, %struct.variable_s** %5
%8 = icmp eq i32 %0, 3
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%12 = load i8*, i8** %1
%13 = tail call i32 @show_usage(i8* %12)
br label %14
14: ; preds = %9, %3
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %27
19: ; preds = %14
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %15
%22 = load i32, i32* @errno
%23 = tail call i8* @strerror(i32 %22)
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %21, i8* %23)
%25 = load i8*, i8** %1
%26 = tail call i32 @show_usage(i8* %25)
br label %27
27: ; preds = %19, %14
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %40
32: ; preds = %27
%33 = load i32, i32* @stderr
%34 = load i8*, i8** %28
%35 = load i32, i32* @errno
%36 = tail call i8* @strerror(i32 %35)
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %34, i8* %36)
%38 = load i8*, i8** %1
%39 = tail call i32 @show_usage(i8* %38)
br label %40
40: ; preds = %32, %27
%41 = call i32 @parse_file(i32* %17, %struct.variable_s** %4)
%42 = call i32 @parse_file(i32* %30, %struct.variable_s** %5)
%43 = call i32 @fclose(i32* %17)
%44 = call i32 @fclose(i32* %30)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%46 = load i8*, i8** %15
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %46)
%48 = load i8*, i8** %28
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %48)
%50 = load %struct.variable_s*, %struct.variable_s** %4
%51 = load %struct.variable_s*, %struct.variable_s** %5
%52 = call i32 @compare_variables(%struct.variable_s* %50, %struct.variable_s* %51)
%53 = load i32, i32* @EXIT_SUCCESS
ret i32 %53
}