#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*/ append_binary_file_to_script(char *);
int count_parameters(char **);
int /*<<< orphan*/ error_exit(int, char *, int);
int /*<<< orphan*/ free(char *);
char *get_string_argument(char *);
int /*<<< orphan*/ push_file(char *);
void include_command(int is_binary, char **arguments) {
  if (count_parameters(arguments) != 1)
    error_exit(1, "command expects 1 argument(s), got %u",
               count_parameters(arguments));
  char *filename = get_string_argument(*arguments);
  if (is_binary)
    append_binary_file_to_script(filename);
  else
    push_file(filename);
  free(filename);
}


x86 assembly (clang, -O0):
<include_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <count_parameters@plt>
cmp    $0x1,%eax
je     119d <include_command+0x3d>
mov    -0x10(%rbp),%rdi
call   1080 <count_parameters@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe68(%rip),%rsi
call   1050 <error_exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <get_string_argument@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11c5 <include_command+0x65>
mov    -0x18(%rbp),%rdi
call   1040 <append_binary_file_to_script@plt>
jmp    11ce <include_command+0x6e>
mov    -0x18(%rbp),%rdi
call   1070 <push_file@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<include_command>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1080 <count_parameters@plt>
cmp    $0x1,%eax
je     1190 <include_command+0x30>
mov    %rbx,%rdi
call   1080 <count_parameters@plt>
lea    0xe7c(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1050 <error_exit@plt>
mov    (%rbx),%rdi
call   1060 <get_string_argument@plt>
mov    %rax,%rbx
mov    %rax,%rdi
test   %ebp,%ebp
je     11a9 <include_command+0x49>
call   1040 <append_binary_file_to_script@plt>
jmp    11ae <include_command+0x4e>
call   1070 <push_file@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"command expects 1 argument(s), got %u\00"
define void @include_command(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = call i32 @count_parameters(i8** %6)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = call i32 @count_parameters(i8** %10)
%12 = call i32 @error_exit(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %2
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = call i8* @get_string_argument(i8* %15)
store i8* %16, i8** %5
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i8*, i8** %5
%21 = call i32 @append_binary_file_to_script(i8* %20)
br label %25
22: ; preds = %13
%23 = load i8*, i8** %5
%24 = call i32 @push_file(i8* %23)
br label %25
25: ; preds = %22, %19
%26 = load i8*, i8** %5
%27 = call i32 @free(i8* %26)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"command expects 1 argument(s), got %u\00"
define void @include_command(i32 %0, i8** %1) {
%3 = tail call i32 @count_parameters(i8** %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @count_parameters(i8** %1)
%7 = tail call i32 @error_exit(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %2
%9 = load i8*, i8** %1
%10 = tail call i8* @get_string_argument(i8* %9)
%11 = icmp eq i32 %0, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 @append_binary_file_to_script(i8* %10)
br label %16
14: ; preds = %8
%15 = tail call i32 @push_file(i8* %10)
br label %16
16: ; preds = %14, %12
%17 = tail call i32 @free(i8* %10)
ret void
}