#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 *append_cmd(char *, char *);
char *empty_cmd();
char *build_initial_cmd() {
  char *s = empty_cmd();
  s = append_cmd(s, "(clear)");
  s = append_cmd(s, "(load templates.clp)");
  s = append_cmd(s, "(load phutball.clp)");
  s = append_cmd(s, "(reset)");
  return s;
}


x86 assembly (clang, -O0):
<build_initial_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <empty_cmd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <append_cmd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <append_cmd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <append_cmd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <append_cmd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_initial_cmd>:
push   %rax
xor    %eax,%eax
call   1030 <empty_cmd@plt>
lea    0xed1(%rip),%rsi
mov    %rax,%rdi
call   1040 <append_cmd@plt>
lea    0xeca(%rip),%rsi
mov    %rax,%rdi
call   1040 <append_cmd@plt>
lea    0xed0(%rip),%rsi
mov    %rax,%rdi
call   1040 <append_cmd@plt>
lea    0xed5(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1040 <append_cmd@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"(clear)\00"
@.str.1 = [21 x i8] c"(load templates.clp)\00"
@.str.2 = [20 x i8] c"(load phutball.clp)\00"
@.str.3 = [8 x i8] c"(reset)\00"
define i8* @build_initial_cmd() {
%1 = alloca i8*
%2 = call i8* (...) @empty_cmd()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @append_cmd(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i8* @append_cmd(i8* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = call i8* @append_cmd(i8* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i8* %8, i8** %1
%9 = load i8*, i8** %1
%10 = call i8* @append_cmd(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i8* %10, i8** %1
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"(clear)\00"
@.str.1 = [21 x i8] c"(load templates.clp)\00"
@.str.2 = [20 x i8] c"(load phutball.clp)\00"
@.str.3 = [8 x i8] c"(reset)\00"
define i8* @build_initial_cmd() {
%1 = tail call i8* (...) @empty_cmd()
%2 = tail call i8* @append_cmd(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @append_cmd(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @append_cmd(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i8* @append_cmd(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret i8* %5
}