int main(void) {
  char *argv[] = {
      "bin/bandicoot", "start", "-p",        "12345", "-d",
      "bin/volume",    "-s",    "bin/state", "-c",    "test/test_calls.b",
      ((void *)0)};
  int pid = sys_exec(argv);
  sys_sleep(1);
  get("/Reset", "");
  get("/Return", "");
  get("/IndirectReturn", "");
  get("/IndirectReturnStore", "");
  post_books("/Echo");
  post_books("/IndirectEcho");
  post_books("/TmpReturn");
  post_books("/IndirectTmpReturn");
  post_books("/StoreReturn");
  post_books("/IndirectStoreReturn");
  post_books("/ReRead");
  post_books("/IndirectReRead");
  get("/NextPrice", "price\n1\n");
  get("/IndirectNextPrice", "price,title\n2,hello1\n");
  sys_kill(pid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x60(%rbp),%rdi
lea    0x2c4d(%rip),%rsi
mov    $0x58,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1030 <sys_exec@plt>
mov    %eax,-0x64(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <sys_sleep@plt>
lea    0xeaf(%rip),%rdi
lea    0xf5b(%rip),%rsi
mov    $0x0,%al
call   1070 <get@plt>
lea    0xea1(%rip),%rdi
lea    0xf46(%rip),%rsi
mov    $0x0,%al
call   1070 <get@plt>
lea    0xe94(%rip),%rdi
lea    0xf31(%rip),%rsi
mov    $0x0,%al
call   1070 <get@plt>
lea    0xe8f(%rip),%rdi
lea    0xf1c(%rip),%rsi
mov    $0x0,%al
call   1070 <get@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <post_books@plt>
lea    0xe8b(%rip),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1070 <get@plt>
lea    0xe8a(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1070 <get@plt>
mov    -0x64(%rbp),%edi
mov    $0x0,%al
call   1080 <sys_kill@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x58,%rsp
mov    0x2cb3(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0x2c97(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2c7b(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2c5f(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c43(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c27(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <sys_exec@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <sys_sleep@plt>
lea    0xe91(%rip),%rdi
lea    0xf3d(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <get@plt>
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <get@plt>
lea    0xe77(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <get@plt>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <get@plt>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1040 <post_books@plt>
lea    0xe76(%rip),%rdi
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
call   1060 <get@plt>
lea    0xe75(%rip),%rdi
lea    0xe81(%rip),%rsi
xor    %eax,%eax
call   1060 <get@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1070 <sys_kill@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"bin/bandicoot\00"
@.str.1 = [6 x i8] c"start\00"
@.str.2 = [3 x i8] c"-p\00"
@.str.3 = [6 x i8] c"12345\00"
@.str.4 = [3 x i8] c"-d\00"
@.str.5 = [11 x i8] c"bin/volume\00"
@.str.6 = [3 x i8] c"-s\00"
@.str.7 = [10 x i8] c"bin/state\00"
@.str.8 = [3 x i8] c"-c\00"
@.str.9 = [18 x i8] c"test/test_calls.b\00"
@__const.main.argv = [11 x i8*] [i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i32 0, i32 0), i8* null]
@.str.10 = [7 x i8] c"/Reset\00"
@.str.11 = [1 x i8] zeroinitializer
@.str.12 = [8 x i8] c"/Return\00"
@.str.13 = [16 x i8] c"/IndirectReturn\00"
@.str.14 = [21 x i8] c"/IndirectReturnStore\00"
@.str.15 = [6 x i8] c"/Echo\00"
@.str.16 = [14 x i8] c"/IndirectEcho\00"
@.str.17 = [11 x i8] c"/TmpReturn\00"
@.str.18 = [19 x i8] c"/IndirectTmpReturn\00"
@.str.19 = [13 x i8] c"/StoreReturn\00"
@.str.20 = [21 x i8] c"/IndirectStoreReturn\00"
@.str.21 = [8 x i8] c"/ReRead\00"
@.str.22 = [16 x i8] c"/IndirectReRead\00"
@.str.23 = [11 x i8] c"/NextPrice\00"
@.str.24 = [9 x i8] c"price\0A1\0A\00"
@.str.25 = [19 x i8] c"/IndirectNextPrice\00"
@.str.26 = [22 x i8] c"price,title\0A2,hello1\0A\00"
define i32 @main() {
%1 = alloca [11 x i8*]
%2 = alloca i32
%3 = bitcast [11 x i8*]* %1 to i8*
%4 = getelementptr inbounds [11 x i8*], [11 x i8*]* %1, i64 0, i64 0
%5 = call i32 (i8**, ...) bitcast (i32 (...)* @sys_exec to i32 (i8**, ...)*)(i8** %4)
store i32 %5, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @sys_sleep to i32 (i32, ...)*)(i32 1)
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0))
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0))
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0))
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0))
%20 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.26, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = call i32 (i32, ...) bitcast (i32 (...)* @sys_kill to i32 (i32, ...)*)(i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"bin/bandicoot\00"
@.str.1 = [6 x i8] c"start\00"
@.str.2 = [3 x i8] c"-p\00"
@.str.3 = [6 x i8] c"12345\00"
@.str.4 = [3 x i8] c"-d\00"
@.str.5 = [11 x i8] c"bin/volume\00"
@.str.6 = [3 x i8] c"-s\00"
@.str.7 = [10 x i8] c"bin/state\00"
@.str.8 = [3 x i8] c"-c\00"
@.str.9 = [18 x i8] c"test/test_calls.b\00"
@__const.main.argv = [11 x i8*] [i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i32 0, i32 0), i8* null]
@.str.10 = [7 x i8] c"/Reset\00"
@.str.11 = [1 x i8] zeroinitializer
@.str.12 = [8 x i8] c"/Return\00"
@.str.13 = [16 x i8] c"/IndirectReturn\00"
@.str.14 = [21 x i8] c"/IndirectReturnStore\00"
@.str.15 = [6 x i8] c"/Echo\00"
@.str.16 = [14 x i8] c"/IndirectEcho\00"
@.str.17 = [11 x i8] c"/TmpReturn\00"
@.str.18 = [19 x i8] c"/IndirectTmpReturn\00"
@.str.19 = [13 x i8] c"/StoreReturn\00"
@.str.20 = [21 x i8] c"/IndirectStoreReturn\00"
@.str.21 = [8 x i8] c"/ReRead\00"
@.str.22 = [16 x i8] c"/IndirectReRead\00"
@.str.23 = [11 x i8] c"/NextPrice\00"
@.str.24 = [9 x i8] c"price\0A1\0A\00"
@.str.25 = [19 x i8] c"/IndirectNextPrice\00"
@.str.26 = [22 x i8] c"price,title\0A2,hello1\0A\00"
define i32 @main() {
%1 = alloca [11 x i8*]
%2 = bitcast [11 x i8*]* %1 to i8*
%3 = getelementptr inbounds [11 x i8*], [11 x i8*]* %1, i64 0, i64 0
%4 = call i32 (i8**, ...) bitcast (i32 (...)* @sys_exec to i32 (i8**, ...)*)(i8** %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @sys_sleep to i32 (i32, ...)*)(i32 1)
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0))
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0))
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0))
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @post_books to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0))
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.26, i64 0, i64 0))
%20 = call i32 (i32, ...) bitcast (i32 (...)* @sys_kill to i32 (i32, ...)*)(i32 %4)
ret i32 0
}