int main() {
  int a0 = 5;
  int b0 = 10;
  int count0 = 3;
  int return0;
  int argTypes0[count0 + 1];
  void **args0;
  argTypes0[0] = (1 << 30) | (3 << 16);
  argTypes0[1] = (1 << 31) | (3 << 16);
  argTypes0[2] = (1 << 31) | (3 << 16);
  argTypes0[3] = 0;
  args0 = (void **)malloc(count0 * sizeof(void *));
  args0[0] = (void *)&return0;
  args0[1] = (void *)&a0;
  args0[2] = (void *)&b0;
  char a1 = 'a';
  short b1 = 100;
  int c1 = 1000;
  long d1 = 10000;
  int count1 = 5;
  long return1;
  int argTypes1[count1 + 1];
  void **args1;
  argTypes1[0] = (1 << 30) | (4 << 16);
  argTypes1[1] = (1 << 31) | (1 << 16);
  argTypes1[2] = (1 << 31) | (2 << 16);
  argTypes1[3] = (1 << 31) | (3 << 16);
  argTypes1[4] = (1 << 31) | (4 << 16);
  argTypes1[5] = 0;
  args1 = (void **)malloc(count1 * sizeof(void *));
  args1[0] = (void *)&return1;
  args1[1] = (void *)&a1;
  args1[2] = (void *)&b1;
  args1[3] = (void *)&c1;
  args1[4] = (void *)&d1;
  float a2 = 3.14159;
  double b2 = 1234.1001;
  int count2 = 3;
  char *return2 = (char *)malloc(100 * sizeof(char));
  int argTypes2[count2 + 1];
  void **args2;
  argTypes2[0] = (1 << 30) | (1 << 16) | 100;
  argTypes2[1] = (1 << 31) | (6 << 16);
  argTypes2[2] = (1 << 31) | (5 << 16);
  argTypes2[3] = 0;
  args2 = (void **)malloc(count2 * sizeof(void *));
  args2[0] = (void *)return2;
  args2[1] = (void *)&a2;
  args2[2] = (void *)&b2;
  long a3[11] = {11, 109, 107, 105, 103, 101, 102, 104, 106, 108, 110};
  int count3 = 1;
  int argTypes3[count3 + 1];
  void **args3;
  argTypes3[0] = (1 << 30) | (1 << 31) | (4 << 16) | 11;
  argTypes3[1] = 0;
  args3 = (void **)malloc(count3 * sizeof(void *));
  args3[0] = (void *)a3;
  char *a4 = "non_exist_file_to_be_printed";
  int count4 = 1;
  int argTypes4[count4 + 1];
  void **args4;
  argTypes4[0] = (1 << 31) | (1 << 16) | strlen(a4);
  argTypes4[1] = 0;
  args4 = (void **)malloc(count4 * sizeof(void *));
  args4[0] = (void *)a4;
  int s0 = rpcCall("f0", argTypes0, args0);
  printf("\nEXPECTED return of f0 is: %d\n", a0 + b0);
  if (s0 >= 0) {
    printf("ACTUAL return of f0 is: %d\n", *((int *)(args0[0])));
  } else {
    printf("Error: %d\n", s0);
  }
  int s1 = rpcCall("f1", argTypes1, args1);
  printf("\nEXPECTED return of f1 is: %ld\n", a1 + b1 * c1 - d1);
  if (s1 >= 0) {
    printf("ACTUAL return of f1 is: %ld\n", *((long *)(args1[0])));
  } else {
    printf("Error: %d\n", s1);
  }
  int s2 = rpcCall("f2", argTypes2, args2);
  printf("\nEXPECTED return of f2 is: 31234\n");
  if (s2 >= 0) {
    printf("ACTUAL return of f2 is: %s\n", (char *)args2[0]);
  } else {
    printf("Error: %d\n", s2);
  }
  int s3 = rpcCall("g3", argTypes3, args3);
  printf("\nEXPECTED return of g3 is: 110 109 108 107 106 105 104 103 102 101 "
         "11\n");
  if (s3 >= 0) {
    printf("ACTUAL return of f3 is: ");
    int i;
    for (i = 0; i < 11; i++) {
      printf(" %ld", *(((long *)args3[0]) + i));
    }
    printf("\n");
  } else {
    printf("Error: %d\n", s3);
  }
  int s4 = rpcCall("g4", argTypes4, args4);
  printf("\ncalling f4 to print an non existed file on the server");
  printf("\nEXPECTED return of f4: some integer other than 0");
  printf("\nACTUAL return of f4: %d\n", s4);
  int a5 = 5;
  int b5 = 10;
  int count5 = 3;
  int return5;
  int argTypes5[count5 + 1];
  void **args5;
  argTypes5[0] = (1 << 30) | (3 << 16);
  argTypes5[1] = (1 << 31) | (3 << 16);
  argTypes5[2] = (1 << 31) | (3 << 16);
  argTypes5[3] = 0;
  args5 = (void **)malloc(count5 * sizeof(void *));
  args5[0] = (void *)&return5;
  args5[1] = (void *)&a5;
  args5[2] = (void *)&b5;
  int s5 = rpcCall("g5", argTypes5, args5);
  printf("\nEXPECTED return of g5 is: %d\n", a5 * b5);
  if (s5 >= 0) {
    printf("ACTUAL return of g5 is: %d\n", *((int *)(args5[0])));
  } else {
    printf("Error: %d\n", s5);
  }
  printf("\ndo you want to terminate? y/n: ");
  if (getchar() == 'y')
    rpcTerminate();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,%esi
mov    %rsp,%rax
mov    %rax,-0x20(%rbp)
lea    0xf(,%rsi,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
mov    %rax,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x170(%rbp)
mov    %rdx,%rsp
mov    %rsi,-0x28(%rbp)
movl   $0x40030000,(%rdx)
movl   $0x80030000,0x4(%rdx)
movl   $0x80030000,0x8(%rdx)
neg    %rcx
movl   $0x0,0xc(%rax,%rcx,1)
movslq -0x10(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
lea    -0x14(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
lea    -0x8(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x30(%rbp),%rax
lea    -0xc(%rbp),%rcx
mov    %rcx,0x10(%rax)
movb   $0x61,-0x31(%rbp)
movw   $0x64,-0x34(%rbp)
movl   $0x3e8,-0x38(%rbp)
movq   $0x2710,-0x40(%rbp)
movl   $0x5,-0x44(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,%esi
lea    0xf(,%rsi,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
mov    %rax,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x190(%rbp)
mov    %rdx,%rsp
mov    %rsi,-0x58(%rbp)
movl   $0x40040000,(%rdx)
movl   $0x80010000,0x4(%rdx)
movl   $0x80020000,0x8(%rdx)
movl   $0x80030000,0xc(%rdx)
movl   $0x80040000,0x10(%rdx)
neg    %rcx
movl   $0x0,0x14(%rax,%rcx,1)
movslq -0x44(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
lea    -0x50(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x60(%rbp),%rax
lea    -0x31(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x60(%rbp),%rax
lea    -0x34(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    -0x60(%rbp),%rax
lea    -0x38(%rbp),%rcx
mov    %rcx,0x18(%rax)
mov    -0x60(%rbp),%rax
lea    -0x40(%rbp),%rcx
mov    %rcx,0x20(%rax)
movl   $0x40490fd0,-0x64(%rbp)
movabs $0x40934866809d4952,%rax
48 93 40
mov    %rax,-0x70(%rbp)
movl   $0x3,-0x74(%rbp)
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,%esi
lea    0xf(,%rsi,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
mov    %rax,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x188(%rbp)
mov    %rdx,%rsp
mov    %rsi,-0x88(%rbp)
movl   $0x40010064,(%rdx)
movl   $0x80060000,0x4(%rdx)
movl   $0x80050000,0x8(%rdx)
neg    %rcx
movl   $0x0,0xc(%rax,%rcx,1)
movslq -0x74(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    -0x80(%rbp),%rcx
mov    -0x90(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x90(%rbp),%rax
lea    -0x64(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x90(%rbp),%rax
lea    -0x70(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    0xcc2(%rip),%rax
mov    %rax,-0xa0(%rbp)
movaps 0xca4(%rip),%xmm0
movaps %xmm0,-0xb0(%rbp)
movaps 0xc86(%rip),%xmm0
movaps %xmm0,-0xc0(%rbp)
movaps 0xc68(%rip),%xmm0
movaps %xmm0,-0xd0(%rbp)
movaps 0xc4a(%rip),%xmm0
movaps %xmm0,-0xe0(%rbp)
movaps 0xc2c(%rip),%xmm0
movaps %xmm0,-0xf0(%rbp)
movl   $0x1,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%esi
lea    0xf(,%rsi,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
mov    %rax,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x180(%rbp)
mov    %rdx,%rsp
mov    %rsi,-0x100(%rbp)
movl   $0xc004000b,(%rdx)
neg    %rcx
movl   $0x0,0x4(%rax,%rcx,1)
movslq -0xf4(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rax
lea    -0xf0(%rbp),%rcx
mov    %rcx,(%rax)
lea    0xc02(%rip),%rax
mov    %rax,-0x110(%rbp)
movl   $0x1,-0x114(%rbp)
mov    -0x114(%rbp),%eax
add    $0x1,%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x178(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x120(%rbp)
mov    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x178(%rbp),%rax
or     $0xffffffff80010000,%rcx
mov    %ecx,(%rax)
movl   $0x0,0x4(%rax)
movslq -0x114(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    -0x170(%rbp),%rsi
mov    %rax,-0x128(%rbp)
mov    -0x110(%rbp),%rcx
mov    -0x128(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rdx
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1080 <rpcCall@plt>
mov    %eax,-0x12c(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xb6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x12c(%rbp)
jl     153d <main+0x3dd>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xb66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1551 <main+0x3f1>
mov    -0x12c(%rbp),%esi
lea    0xb69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x190(%rbp),%rsi
mov    -0x60(%rbp),%rdx
lea    0xb5b(%rip),%rdi
mov    $0x0,%al
call   1080 <rpcCall@plt>
mov    %eax,-0x130(%rbp)
movsbl -0x31(%rbp),%eax
movswl -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
movslq %eax,%rsi
sub    -0x40(%rbp),%rsi
lea    0xb35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x130(%rbp)
jl     15bd <main+0x45d>
mov    -0x60(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
lea    0xb30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15d1 <main+0x471>
mov    -0x130(%rbp),%esi
lea    0xae9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x188(%rbp),%rsi
mov    -0x90(%rbp),%rdx
lea    0xb18(%rip),%rdi
mov    $0x0,%al
call   1080 <rpcCall@plt>
mov    %eax,-0x134(%rbp)
lea    0xb07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x134(%rbp)
jl     162b <main+0x4cb>
mov    -0x90(%rbp),%rax
mov    (%rax),%rsi
lea    0xb04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    163f <main+0x4df>
mov    -0x134(%rbp),%esi
lea    0xa7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x180(%rbp),%rsi
mov    -0x108(%rbp),%rdx
lea    0xaeb(%rip),%rdi
mov    $0x0,%al
call   1080 <rpcCall@plt>
mov    %eax,-0x138(%rbp)
lea    0xada(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x138(%rbp)
jl     16eb <main+0x58b>
lea    0xb06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x13c(%rbp)
cmpl   $0xb,-0x13c(%rbp)
jge    16d8 <main+0x578>
mov    -0x108(%rbp),%rax
mov    (%rax),%rax
movslq -0x13c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xae5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x13c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13c(%rbp)
jmp    1694 <main+0x534>
lea    0xaa8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16ff <main+0x59f>
mov    -0x138(%rbp),%esi
lea    0x9bb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x178(%rbp),%rsi
mov    -0x128(%rbp),%rdx
lea    0xa93(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x199(%rbp)
call   1080 <rpcCall@plt>
mov    %eax,%ecx
mov    -0x199(%rbp),%al
mov    %ecx,-0x140(%rbp)
lea    0xa74(%rip),%rdi
call   1040 <printf@plt>
mov    -0x199(%rbp),%al
lea    0xa99(%rip),%rdi
call   1040 <printf@plt>
mov    -0x199(%rbp),%al
mov    -0x140(%rbp),%esi
lea    0xab3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x5,-0x144(%rbp)
movl   $0xa,-0x148(%rbp)
movl   $0x3,-0x14c(%rbp)
mov    -0x14c(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x198(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x158(%rbp)
movl   $0x40030000,(%rax)
movl   $0x80030000,0x4(%rax)
movl   $0x80030000,0x8(%rax)
movl   $0x0,0xc(%rax)
movslq -0x14c(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    -0x198(%rbp),%rsi
mov    %rax,-0x160(%rbp)
lea    -0x150(%rbp),%rcx
mov    -0x160(%rbp),%rax
mov    %rcx,(%rax)
lea    -0x144(%rbp),%rcx
mov    -0x160(%rbp),%rax
mov    %rcx,0x8(%rax)
lea    -0x148(%rbp),%rcx
mov    -0x160(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x160(%rbp),%rdx
lea    0xa00(%rip),%rdi
mov    $0x0,%al
call   1080 <rpcCall@plt>
mov    %eax,-0x164(%rbp)
mov    -0x144(%rbp),%esi
imul   -0x148(%rbp),%esi
lea    0x9e2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x164(%rbp)
jl     1881 <main+0x721>
mov    -0x160(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0x9da(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1895 <main+0x735>
mov    -0x164(%rbp),%esi
lea    0x825(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x9cf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
cmp    $0x79,%eax
jne    18ba <main+0x75a>
mov    $0x0,%al
call   1050 <rpcTerminate@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rsp,-0x80(%rbp)
movl   $0x5,-0x40(%rbp)
movl   $0xa,-0x3c(%rbp)
movaps 0xe63(%rip),%xmm0
movaps %xmm0,-0xd0(%rbp)
mov    $0x18,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
lea    -0x90(%rbp),%rax
mov    %rax,0x0(%r13)
lea    -0x40(%rbp),%rax
mov    %rax,0x8(%r13)
lea    -0x3c(%rbp),%rax
mov    %rax,0x10(%r13)
movb   $0x61,-0x29(%rbp)
movw   $0x64,-0x2c(%rbp)
movl   $0x3e8,-0x38(%rbp)
movq   $0x2710,-0x50(%rbp)
movaps 0xe24(%rip),%xmm0
movaps %xmm0,-0xc0(%rbp)
mov    $0x80040000,%eax
mov    %rax,-0xb0(%rbp)
mov    $0x28,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
lea    -0xd8(%rbp),%rax
mov    %rax,(%r14)
lea    -0x29(%rbp),%rax
mov    %rax,0x8(%r14)
lea    -0x2c(%rbp),%rax
mov    %rax,0x10(%r14)
lea    -0x38(%rbp),%rax
mov    %rax,0x18(%r14)
lea    -0x50(%rbp),%rax
mov    %rax,0x20(%r14)
movl   $0x40490fd0,-0x44(%rbp)
movabs $0x40934866809d4952,%rax
48 93 40
mov    %rax,-0x88(%rbp)
mov    $0x64,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
movaps 0xdbe(%rip),%xmm0
movaps %xmm0,-0xa0(%rbp)
mov    $0x18,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    %rbx,(%rax)
lea    -0x44(%rbp),%rax
mov    %rax,0x8(%r15)
lea    -0x88(%rbp),%rax
mov    %rax,0x10(%r15)
mov    0xded(%rip),%rax
mov    %rax,-0xe0(%rbp)
movaps 0xdcf(%rip),%xmm0
movaps %xmm0,-0xf0(%rbp)
movaps 0xdb1(%rip),%xmm0
movaps %xmm0,-0x100(%rbp)
movaps 0xd93(%rip),%xmm0
movaps %xmm0,-0x110(%rbp)
movaps 0xd75(%rip),%xmm0
movaps %xmm0,-0x120(%rbp)
movaps 0xd57(%rip),%xmm0
movaps %xmm0,-0x130(%rbp)
mov    $0xc004000b,%eax
mov    %rax,-0x70(%rbp)
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
lea    -0x130(%rbp),%rax
mov    %rax,(%r12)
mov    $0x8001001c,%eax
mov    %rax,-0x60(%rbp)
mov    $0x8,%edi
call   1080 <malloc@plt>
lea    0xd6d(%rip),%rcx
mov    %rax,-0x78(%rbp)
mov    %rcx,(%rax)
lea    0xd7c(%rip),%rdi
lea    -0xd0(%rbp),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <rpcCall@plt>
mov    %eax,%ebx
mov    -0x3c(%rbp),%esi
add    -0x40(%rbp),%esi
lea    0xd5f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
js     1363 <main+0x1f3>
mov    0x0(%r13),%rax
mov    (%rax),%esi
lea    0xd66(%rip),%rdi
jmp    136c <main+0x1fc>
lea    0xd79(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd74(%rip),%rdi
lea    -0xc0(%rbp),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <rpcCall@plt>
mov    %eax,%ebx
movsbq -0x29(%rbp),%rax
movswq -0x2c(%rbp),%rcx
movslq -0x38(%rbp),%rsi
imul   %rcx,%rsi
add    %rax,%rsi
sub    -0x50(%rbp),%rsi
lea    0xd44(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
js     13ce <main+0x25e>
mov    (%r14),%rax
mov    (%rax),%rsi
lea    0xd4c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    13de <main+0x26e>
lea    0xd0e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd49(%rip),%rdi
lea    -0xa0(%rbp),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1090 <rpcCall@plt>
mov    %eax,%ebx
lea    0xe54(%rip),%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
js     141b <main+0x2ab>
mov    (%r15),%rsi
lea    0xd1f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    142b <main+0x2bb>
lea    0xcc1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd1b(%rip),%rdi
lea    -0x70(%rbp),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <rpcCall@plt>
mov    %eax,%ebx
lea    0xe2b(%rip),%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
js     153c <main+0x3cc>
lea    0xcf3(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    (%rax),%rsi
lea    0xcf7(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x8(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x10(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x18(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x20(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x28(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x30(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x38(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x40(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x48(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rax
mov    0x50(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    154c <main+0x3dc>
lea    0xba0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc1b(%rip),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x78(%rbp),%rdx
xor    %eax,%eax
call   1090 <rpcCall@plt>
mov    %eax,%ebx
lea    0xc06(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc2f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc53(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x5,-0x34(%rbp)
movl   $0xa,-0x30(%rbp)
mov    %rsp,%rax
lea    -0x10(%rax),%r14
mov    %r14,%rsp
movaps 0xa51(%rip),%xmm0
movaps %xmm0,-0x10(%rax)
mov    $0x18,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
lea    -0x8c(%rbp),%rax
mov    %rax,(%rbx)
lea    -0x34(%rbp),%rax
mov    %rax,0x8(%rbx)
lea    -0x30(%rbp),%rax
mov    %rax,0x10(%rbx)
lea    0xc13(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <rpcCall@plt>
mov    %eax,%r14d
mov    -0x30(%rbp),%esi
imul   -0x34(%rbp),%esi
lea    0xbf8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
js     1619 <main+0x4a9>
mov    (%rbx),%rax
mov    (%rax),%esi
lea    0xbff(%rip),%rdi
jmp    1623 <main+0x4b3>
lea    0xac3(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc01(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0x79,%eax
jne    164b <main+0x4db>
xor    %eax,%eax
call   1060 <rpcTerminate@plt>
mov    -0x80(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.a3 = [11 x i64] [i64 11, i64 109, i64 107, i64 105, i64 103, i64 101, i64 102, i64 104, i64 106, i64 108, i64 110]
@.str = [29 x i8] c"non_exist_file_to_be_printed\00"
@.str.1 = [3 x i8] c"f0\00"
@.str.2 = [31 x i8] c"\0AEXPECTED return of f0 is: %d\0A\00"
@.str.3 = [28 x i8] c"ACTUAL return of f0 is: %d\0A\00"
@.str.4 = [11 x i8] c"Error: %d\0A\00"
@.str.5 = [3 x i8] c"f1\00"
@.str.6 = [32 x i8] c"\0AEXPECTED return of f1 is: %ld\0A\00"
@.str.7 = [29 x i8] c"ACTUAL return of f1 is: %ld\0A\00"
@.str.8 = [3 x i8] c"f2\00"
@.str.9 = [34 x i8] c"\0AEXPECTED return of f2 is: 31234\0A\00"
@.str.10 = [28 x i8] c"ACTUAL return of f2 is: %s\0A\00"
@.str.11 = [3 x i8] c"g3\00"
@.str.12 = [71 x i8] c"\0AEXPECTED return of g3 is: 110 109 108 107 106 105 104 103 102 101 11\0A\00"
@.str.13 = [25 x i8] c"ACTUAL return of f3 is: \00"
@.str.14 = [5 x i8] c" %ld\00"
@.str.15 = [2 x i8] c"\0A\00"
@.str.16 = [3 x i8] c"g4\00"
@.str.17 = [55 x i8] c"\0Acalling f4 to print an non existed file on the server\00"
@.str.18 = [50 x i8] c"\0AEXPECTED return of f4: some integer other than 0\00"
@.str.19 = [26 x i8] c"\0AACTUAL return of f4: %d\0A\00"
@.str.20 = [3 x i8] c"g5\00"
@.str.21 = [31 x i8] c"\0AEXPECTED return of g5 is: %d\0A\00"
@.str.22 = [28 x i8] c"ACTUAL return of g5 is: %d\0A\00"
@.str.23 = [33 x i8] c"\0Ado you want to terminate? y/n: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8**
%9 = alloca i8
%10 = alloca i16
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
%14 = alloca i64
%15 = alloca i64
%16 = alloca i8**
%17 = alloca float
%18 = alloca double
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i8**
%23 = alloca [11 x i64]
%24 = alloca i32
%25 = alloca i64
%26 = alloca i8**
%27 = alloca i8*
%28 = alloca i32
%29 = alloca i64
%30 = alloca i8**
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
%41 = alloca i64
%42 = alloca i8**
%43 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 10, i32* %3
store i32 3, i32* %4
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
%46 = zext i32 %45 to i64
%47 = call i8* @llvm.stacksave()
store i8* %47, i8** %6
%48 = alloca i32, i64 %46
store i64 %46, i64* %7
%49 = getelementptr inbounds i32, i32* %48, i64 0
store i32 1073938432, i32* %49
%50 = getelementptr inbounds i32, i32* %48, i64 1
store i32 -2147287040, i32* %50
%51 = getelementptr inbounds i32, i32* %48, i64 2
store i32 -2147287040, i32* %51
%52 = getelementptr inbounds i32, i32* %48, i64 3
store i32 0, i32* %52
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = mul i64 %54, 8
%56 = call i8* @malloc(i64 %55)
%57 = bitcast i8* %56 to i8**
store i8** %57, i8*** %8
%58 = bitcast i32* %5 to i8*
%59 = load i8**, i8*** %8
%60 = getelementptr inbounds i8*, i8** %59, i64 0
store i8* %58, i8** %60
%61 = bitcast i32* %2 to i8*
%62 = load i8**, i8*** %8
%63 = getelementptr inbounds i8*, i8** %62, i64 1
store i8* %61, i8** %63
%64 = bitcast i32* %3 to i8*
%65 = load i8**, i8*** %8
%66 = getelementptr inbounds i8*, i8** %65, i64 2
store i8* %64, i8** %66
store i8 97, i8* %9
store i16 100, i16* %10
store i32 1000, i32* %11
store i64 10000, i64* %12
store i32 5, i32* %13
%67 = load i32, i32* %13
%68 = add nsw i32 %67, 1
%69 = zext i32 %68 to i64
%70 = alloca i32, i64 %69
store i64 %69, i64* %15
%71 = getelementptr inbounds i32, i32* %70, i64 0
store i32 1074003968, i32* %71
%72 = getelementptr inbounds i32, i32* %70, i64 1
store i32 -2147418112, i32* %72
%73 = getelementptr inbounds i32, i32* %70, i64 2
store i32 -2147352576, i32* %73
%74 = getelementptr inbounds i32, i32* %70, i64 3
store i32 -2147287040, i32* %74
%75 = getelementptr inbounds i32, i32* %70, i64 4
store i32 -2147221504, i32* %75
%76 = getelementptr inbounds i32, i32* %70, i64 5
store i32 0, i32* %76
%77 = load i32, i32* %13
%78 = sext i32 %77 to i64
%79 = mul i64 %78, 8
%80 = call i8* @malloc(i64 %79)
%81 = bitcast i8* %80 to i8**
store i8** %81, i8*** %16
%82 = bitcast i64* %14 to i8*
%83 = load i8**, i8*** %16
%84 = getelementptr inbounds i8*, i8** %83, i64 0
store i8* %82, i8** %84
%85 = load i8**, i8*** %16
%86 = getelementptr inbounds i8*, i8** %85, i64 1
store i8* %9, i8** %86
%87 = bitcast i16* %10 to i8*
%88 = load i8**, i8*** %16
%89 = getelementptr inbounds i8*, i8** %88, i64 2
store i8* %87, i8** %89
%90 = bitcast i32* %11 to i8*
%91 = load i8**, i8*** %16
%92 = getelementptr inbounds i8*, i8** %91, i64 3
store i8* %90, i8** %92
%93 = bitcast i64* %12 to i8*
%94 = load i8**, i8*** %16
%95 = getelementptr inbounds i8*, i8** %94, i64 4
store i8* %93, i8** %95
store float 0x400921FA00000000, float* %17
store double 0x40934866809D4952, double* %18
store i32 3, i32* %19
%96 = call i8* @malloc(i64 100)
store i8* %96, i8** %20
%97 = load i32, i32* %19
%98 = add nsw i32 %97, 1
%99 = zext i32 %98 to i64
%100 = alloca i32, i64 %99
store i64 %99, i64* %21
%101 = getelementptr inbounds i32, i32* %100, i64 0
store i32 1073807460, i32* %101
%102 = getelementptr inbounds i32, i32* %100, i64 1
store i32 -2147090432, i32* %102
%103 = getelementptr inbounds i32, i32* %100, i64 2
store i32 -2147155968, i32* %103
%104 = getelementptr inbounds i32, i32* %100, i64 3
store i32 0, i32* %104
%105 = load i32, i32* %19
%106 = sext i32 %105 to i64
%107 = mul i64 %106, 8
%108 = call i8* @malloc(i64 %107)
%109 = bitcast i8* %108 to i8**
store i8** %109, i8*** %22
%110 = load i8*, i8** %20
%111 = load i8**, i8*** %22
%112 = getelementptr inbounds i8*, i8** %111, i64 0
store i8* %110, i8** %112
%113 = bitcast float* %17 to i8*
%114 = load i8**, i8*** %22
%115 = getelementptr inbounds i8*, i8** %114, i64 1
store i8* %113, i8** %115
%116 = bitcast double* %18 to i8*
%117 = load i8**, i8*** %22
%118 = getelementptr inbounds i8*, i8** %117, i64 2
store i8* %116, i8** %118
%119 = bitcast [11 x i64]* %23 to i8*
store i32 1, i32* %24
%120 = load i32, i32* %24
%121 = add nsw i32 %120, 1
%122 = zext i32 %121 to i64
%123 = alloca i32, i64 %122
store i64 %122, i64* %25
%124 = getelementptr inbounds i32, i32* %123, i64 0
store i32 -1073479669, i32* %124
%125 = getelementptr inbounds i32, i32* %123, i64 1
store i32 0, i32* %125
%126 = load i32, i32* %24
%127 = sext i32 %126 to i64
%128 = mul i64 %127, 8
%129 = call i8* @malloc(i64 %128)
%130 = bitcast i8* %129 to i8**
store i8** %130, i8*** %26
%131 = getelementptr inbounds [11 x i64], [11 x i64]* %23, i64 0, i64 0
%132 = bitcast i64* %131 to i8*
%133 = load i8**, i8*** %26
%134 = getelementptr inbounds i8*, i8** %133, i64 0
store i8* %132, i8** %134
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8** %27
store i32 1, i32* %28
%135 = load i32, i32* %28
%136 = add nsw i32 %135, 1
%137 = zext i32 %136 to i64
%138 = alloca i32, i64 %137
store i64 %137, i64* %29
%139 = load i8*, i8** %27
%140 = call i64 @strlen(i8* %139)
%141 = or i64 -2147418112, %140
%142 = trunc i64 %141 to i32
%143 = getelementptr inbounds i32, i32* %138, i64 0
store i32 %142, i32* %143
%144 = getelementptr inbounds i32, i32* %138, i64 1
store i32 0, i32* %144
%145 = load i32, i32* %28
%146 = sext i32 %145 to i64
%147 = mul i64 %146, 8
%148 = call i8* @malloc(i64 %147)
%149 = bitcast i8* %148 to i8**
store i8** %149, i8*** %30
%150 = load i8*, i8** %27
%151 = load i8**, i8*** %30
%152 = getelementptr inbounds i8*, i8** %151, i64 0
store i8* %150, i8** %152
%153 = load i8**, i8*** %8
%154 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %48, i8** %153)
store i32 %154, i32* %31
%155 = load i32, i32* %2
%156 = load i32, i32* %3
%157 = add nsw i32 %155, %156
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %157)
%159 = load i32, i32* %31
%160 = icmp sge i32 %159, 0
br i1 %160, label %161, label %168
161: ; preds = %0
%162 = load i8**, i8*** %8
%163 = getelementptr inbounds i8*, i8** %162, i64 0
%164 = load i8*, i8** %163
%165 = bitcast i8* %164 to i32*
%166 = load i32, i32* %165
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %166)
br label %171
168: ; preds = %0
%169 = load i32, i32* %31
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %169)
br label %171
171: ; preds = %168, %161
%172 = load i8**, i8*** %16
%173 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %70, i8** %172)
store i32 %173, i32* %32
%174 = load i8, i8* %9
%175 = sext i8 %174 to i32
%176 = load i16, i16* %10
%177 = sext i16 %176 to i32
%178 = load i32, i32* %11
%179 = mul nsw i32 %177, %178
%180 = add nsw i32 %175, %179
%181 = sext i32 %180 to i64
%182 = load i64, i64* %12
%183 = sub nsw i64 %181, %182
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 %183)
%185 = load i32, i32* %32
%186 = icmp sge i32 %185, 0
br i1 %186, label %187, label %194
187: ; preds = %171
%188 = load i8**, i8*** %16
%189 = getelementptr inbounds i8*, i8** %188, i64 0
%190 = load i8*, i8** %189
%191 = bitcast i8* %190 to i64*
%192 = load i64, i64* %191
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i64 %192)
br label %197
194: ; preds = %171
%195 = load i32, i32* %32
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %195)
br label %197
197: ; preds = %194, %187
%198 = load i8**, i8*** %22
%199 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %100, i8** %198)
store i32 %199, i32* %33
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0))
%201 = load i32, i32* %33
%202 = icmp sge i32 %201, 0
br i1 %202, label %203, label %208
203: ; preds = %197
%204 = load i8**, i8*** %22
%205 = getelementptr inbounds i8*, i8** %204, i64 0
%206 = load i8*, i8** %205
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %206)
br label %211
208: ; preds = %197
%209 = load i32, i32* %33
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %209)
br label %211
211: ; preds = %208, %203
%212 = load i8**, i8*** %26
%213 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %123, i8** %212)
store i32 %213, i32* %34
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.12, i64 0, i64 0))
%215 = load i32, i32* %34
%216 = icmp sge i32 %215, 0
br i1 %216, label %217, label %237
217: ; preds = %211
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %35
br label %219
219: ; preds = %232, %217
%220 = load i32, i32* %35
%221 = icmp slt i32 %220, 11
br i1 %221, label %222, label %235
222: ; preds = %219
%223 = load i8**, i8*** %26
%224 = getelementptr inbounds i8*, i8** %223, i64 0
%225 = load i8*, i8** %224
%226 = bitcast i8* %225 to i64*
%227 = load i32, i32* %35
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i64, i64* %226, i64 %228
%230 = load i64, i64* %229
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %230)
br label %232
232: ; preds = %222
%233 = load i32, i32* %35
%234 = add nsw i32 %233, 1
store i32 %234, i32* %35
br label %219
235: ; preds = %219
%236 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
br label %240
237: ; preds = %211
%238 = load i32, i32* %34
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %238)
br label %240
240: ; preds = %237, %235
%241 = load i8**, i8*** %30
%242 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32* %138, i8** %241)
store i32 %242, i32* %36
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.17, i64 0, i64 0))
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.18, i64 0, i64 0))
%245 = load i32, i32* %36
%246 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.19, i64 0, i64 0), i32 %245)
store i32 5, i32* %37
store i32 10, i32* %38
store i32 3, i32* %39
%247 = load i32, i32* %39
%248 = add nsw i32 %247, 1
%249 = zext i32 %248 to i64
%250 = alloca i32, i64 %249
store i64 %249, i64* %41
%251 = getelementptr inbounds i32, i32* %250, i64 0
store i32 1073938432, i32* %251
%252 = getelementptr inbounds i32, i32* %250, i64 1
store i32 -2147287040, i32* %252
%253 = getelementptr inbounds i32, i32* %250, i64 2
store i32 -2147287040, i32* %253
%254 = getelementptr inbounds i32, i32* %250, i64 3
store i32 0, i32* %254
%255 = load i32, i32* %39
%256 = sext i32 %255 to i64
%257 = mul i64 %256, 8
%258 = call i8* @malloc(i64 %257)
%259 = bitcast i8* %258 to i8**
store i8** %259, i8*** %42
%260 = bitcast i32* %40 to i8*
%261 = load i8**, i8*** %42
%262 = getelementptr inbounds i8*, i8** %261, i64 0
store i8* %260, i8** %262
%263 = bitcast i32* %37 to i8*
%264 = load i8**, i8*** %42
%265 = getelementptr inbounds i8*, i8** %264, i64 1
store i8* %263, i8** %265
%266 = bitcast i32* %38 to i8*
%267 = load i8**, i8*** %42
%268 = getelementptr inbounds i8*, i8** %267, i64 2
store i8* %266, i8** %268
%269 = load i8**, i8*** %42
%270 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i32* %250, i8** %269)
store i32 %270, i32* %43
%271 = load i32, i32* %37
%272 = load i32, i32* %38
%273 = mul nsw i32 %271, %272
%274 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0), i32 %273)
%275 = load i32, i32* %43
%276 = icmp sge i32 %275, 0
br i1 %276, label %277, label %284
277: ; preds = %240
%278 = load i8**, i8*** %42
%279 = getelementptr inbounds i8*, i8** %278, i64 0
%280 = load i8*, i8** %279
%281 = bitcast i8* %280 to i32*
%282 = load i32, i32* %281
%283 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.22, i64 0, i64 0), i32 %282)
br label %287
284: ; preds = %240
%285 = load i32, i32* %43
%286 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %285)
br label %287
287: ; preds = %284, %277
%288 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.23, i64 0, i64 0))
%289 = call i32 (...) @getchar()
%290 = icmp eq i32 %289, 121
br i1 %290, label %291, label %293
291: ; preds = %287
%292 = call i32 (...) @rpcTerminate()
br label %293
293: ; preds = %291, %287
store i32 0, i32* %1
%294 = load i8*, i8** %6
%295 = load i32, i32* %1
ret i32 %295
}

LLVM IR (-O2):
@__const.main.a3 = [11 x i64] [i64 11, i64 109, i64 107, i64 105, i64 103, i64 101, i64 102, i64 104, i64 106, i64 108, i64 110]
@.str = [29 x i8] c"non_exist_file_to_be_printed\00"
@.str.1 = [3 x i8] c"f0\00"
@.str.2 = [31 x i8] c"\0AEXPECTED return of f0 is: %d\0A\00"
@.str.3 = [28 x i8] c"ACTUAL return of f0 is: %d\0A\00"
@.str.4 = [11 x i8] c"Error: %d\0A\00"
@.str.5 = [3 x i8] c"f1\00"
@.str.6 = [32 x i8] c"\0AEXPECTED return of f1 is: %ld\0A\00"
@.str.7 = [29 x i8] c"ACTUAL return of f1 is: %ld\0A\00"
@.str.8 = [3 x i8] c"f2\00"
@.str.10 = [28 x i8] c"ACTUAL return of f2 is: %s\0A\00"
@.str.11 = [3 x i8] c"g3\00"
@.str.13 = [25 x i8] c"ACTUAL return of f3 is: \00"
@.str.14 = [5 x i8] c" %ld\00"
@.str.16 = [3 x i8] c"g4\00"
@.str.17 = [55 x i8] c"\0Acalling f4 to print an non existed file on the server\00"
@.str.18 = [50 x i8] c"\0AEXPECTED return of f4: some integer other than 0\00"
@.str.19 = [26 x i8] c"\0AACTUAL return of f4: %d\0A\00"
@.str.20 = [3 x i8] c"g5\00"
@.str.21 = [31 x i8] c"\0AEXPECTED return of g5 is: %d\0A\00"
@.str.22 = [28 x i8] c"ACTUAL return of g5 is: %d\0A\00"
@.str.23 = [33 x i8] c"\0Ado you want to terminate? y/n: \00"
@str = [33 x i8] c"\0AEXPECTED return of f2 is: 31234\00"
@str.24 = [70 x i8] c"\0AEXPECTED return of g3 is: 110 109 108 107 106 105 104 103 102 101 11\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i16
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca float
%10 = alloca double
%11 = alloca [11 x i64]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%16 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%17 = bitcast i32* %3 to i8*
%18 = tail call i8* @llvm.stacksave()
%19 = alloca <4 x i32>
%20 = getelementptr inbounds <4 x i32>, <4 x i32>* %19, i64 0, i64 0
store <4 x i32> <i32 1073938432, i32 -2147287040, i32 -2147287040, i32 0>, <4 x i32>* %19
%21 = tail call dereferenceable_or_null(24) i8* @malloc(i64 24)
%22 = bitcast i8* %21 to i8**
%23 = bitcast i8* %21 to i32**
store i32* %3, i32** %23
%24 = getelementptr inbounds i8*, i8** %22, i64 1
%25 = bitcast i8** %24 to i32**
store i32* %1, i32** %25
%26 = getelementptr inbounds i8*, i8** %22, i64 2
%27 = bitcast i8** %26 to i32**
store i32* %2, i32** %27
store i8 97, i8* %4
%28 = bitcast i16* %5 to i8*
store i16 100, i16* %5
%29 = bitcast i32* %6 to i8*
store i32 1000, i32* %6
%30 = bitcast i64* %7 to i8*
store i64 10000, i64* %7
%31 = bitcast i64* %8 to i8*
%32 = alloca [6 x i32]
%33 = getelementptr inbounds [6 x i32], [6 x i32]* %32, i64 0, i64 0
%34 = bitcast [6 x i32]* %32 to <4 x i32>*
store <4 x i32> <i32 1074003968, i32 -2147418112, i32 -2147352576, i32 -2147287040>, <4 x i32>* %34
%35 = getelementptr inbounds [6 x i32], [6 x i32]* %32, i64 0, i64 4
store i32 -2147221504, i32* %35
%36 = getelementptr inbounds [6 x i32], [6 x i32]* %32, i64 0, i64 5
store i32 0, i32* %36
%37 = call dereferenceable_or_null(40) i8* @malloc(i64 40)
%38 = bitcast i8* %37 to i8**
%39 = bitcast i8* %37 to i64**
store i64* %8, i64** %39
%40 = getelementptr inbounds i8*, i8** %38, i64 1
store i8* %4, i8** %40
%41 = getelementptr inbounds i8*, i8** %38, i64 2
%42 = bitcast i8** %41 to i16**
store i16* %5, i16** %42
%43 = getelementptr inbounds i8*, i8** %38, i64 3
%44 = bitcast i8** %43 to i32**
store i32* %6, i32** %44
%45 = getelementptr inbounds i8*, i8** %38, i64 4
%46 = bitcast i8** %45 to i64**
store i64* %7, i64** %46
%47 = bitcast float* %9 to i8*
store float 0x400921FA00000000, float* %9
%48 = bitcast double* %10 to i8*
store double 0x40934866809D4952, double* %10
%49 = call dereferenceable_or_null(100) i8* @malloc(i64 100)
%50 = alloca <4 x i32>
%51 = getelementptr inbounds <4 x i32>, <4 x i32>* %50, i64 0, i64 0
store <4 x i32> <i32 1073807460, i32 -2147090432, i32 -2147155968, i32 0>, <4 x i32>* %50
%52 = call dereferenceable_or_null(24) i8* @malloc(i64 24)
%53 = bitcast i8* %52 to i8**
store i8* %49, i8** %53
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = bitcast i8** %54 to float**
store float* %9, float** %55
%56 = getelementptr inbounds i8*, i8** %53, i64 2
%57 = bitcast i8** %56 to double**
store double* %10, double** %57
%58 = bitcast [11 x i64]* %11 to i8*
%59 = alloca [2 x i32]
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %59, i64 0, i64 0
store i32 -1073479669, i32* %60
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %59, i64 0, i64 1
store i32 0, i32* %61
%62 = call dereferenceable_or_null(8) i8* @malloc(i64 8)
%63 = bitcast i8* %62 to i8**
%64 = bitcast i8* %62 to [11 x i64]**
store [11 x i64]* %11, [11 x i64]** %64
%65 = alloca [2 x i32]
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %65, i64 0, i64 0
store i32 -2147418084, i32* %66
%67 = getelementptr inbounds [2 x i32], [2 x i32]* %65, i64 0, i64 1
store i32 0, i32* %67
%68 = call dereferenceable_or_null(8) i8* @malloc(i64 8)
%69 = bitcast i8* %68 to i8**
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8** %69
%70 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20, i8** %22)
%71 = load i32, i32* %1
%72 = load i32, i32* %2
%73 = add nsw i32 %72, %71
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %73)
%75 = icmp sgt i32 %70, -1
br i1 %75, label %76, label %80
76: ; preds = %0
%77 = load i32*, i32** %23
%78 = load i32, i32* %77
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %78)
br label %82
80: ; preds = %0
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %70)
br label %82
82: ; preds = %80, %76
%83 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %33, i8** %38)
%84 = load i8, i8* %4
%85 = sext i8 %84 to i32
%86 = load i16, i16* %5
%87 = sext i16 %86 to i32
%88 = load i32, i32* %6
%89 = mul nsw i32 %88, %87
%90 = add nsw i32 %89, %85
%91 = sext i32 %90 to i64
%92 = load i64, i64* %7
%93 = sub nsw i64 %91, %92
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 %93)
%95 = icmp sgt i32 %83, -1
br i1 %95, label %96, label %100
96: ; preds = %82
%97 = load i64*, i64** %39
%98 = load i64, i64* %97
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i64 %98)
br label %102
100: ; preds = %82
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %83)
br label %102
102: ; preds = %100, %96
%103 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %51, i8** %53)
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%105 = icmp sgt i32 %103, -1
br i1 %105, label %106, label %109
106: ; preds = %102
%107 = load i8*, i8** %53
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %107)
br label %111
109: ; preds = %102
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %103)
br label %111
111: ; preds = %109, %106
%112 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %60, i8** %63)
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.24, i64 0, i64 0))
%114 = icmp sgt i32 %112, -1
br i1 %114, label %115, label %162
115: ; preds = %111
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
%117 = bitcast i8* %62 to i64**
%118 = load i64*, i64** %117
%119 = load i64, i64* %118
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %119)
%121 = load i64*, i64** %117
%122 = getelementptr inbounds i64, i64* %121, i64 1
%123 = load i64, i64* %122
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %123)
%125 = load i64*, i64** %117
%126 = getelementptr inbounds i64, i64* %125, i64 2
%127 = load i64, i64* %126
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %127)
%129 = load i64*, i64** %117
%130 = getelementptr inbounds i64, i64* %129, i64 3
%131 = load i64, i64* %130
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %131)
%133 = load i64*, i64** %117
%134 = getelementptr inbounds i64, i64* %133, i64 4
%135 = load i64, i64* %134
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %135)
%137 = load i64*, i64** %117
%138 = getelementptr inbounds i64, i64* %137, i64 5
%139 = load i64, i64* %138
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %139)
%141 = load i64*, i64** %117
%142 = getelementptr inbounds i64, i64* %141, i64 6
%143 = load i64, i64* %142
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %143)
%145 = load i64*, i64** %117
%146 = getelementptr inbounds i64, i64* %145, i64 7
%147 = load i64, i64* %146
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %147)
%149 = load i64*, i64** %117
%150 = getelementptr inbounds i64, i64* %149, i64 8
%151 = load i64, i64* %150
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %151)
%153 = load i64*, i64** %117
%154 = getelementptr inbounds i64, i64* %153, i64 9
%155 = load i64, i64* %154
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %155)
%157 = load i64*, i64** %117
%158 = getelementptr inbounds i64, i64* %157, i64 10
%159 = load i64, i64* %158
%160 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 %159)
%161 = call i32 @putchar(i32 10)
br label %164
162: ; preds = %111
%163 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %112)
br label %164
164: ; preds = %162, %115
%165 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32* %66, i8** %69)
%166 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.17, i64 0, i64 0))
%167 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.18, i64 0, i64 0))
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.19, i64 0, i64 0), i32 %165)
%169 = bitcast i32* %12 to i8*
store i32 5, i32* %12
%170 = bitcast i32* %13 to i8*
store i32 10, i32* %13
%171 = bitcast i32* %14 to i8*
%172 = alloca <4 x i32>
%173 = getelementptr inbounds <4 x i32>, <4 x i32>* %172, i64 0, i64 0
store <4 x i32> <i32 1073938432, i32 -2147287040, i32 -2147287040, i32 0>, <4 x i32>* %172
%174 = call dereferenceable_or_null(24) i8* @malloc(i64 24)
%175 = bitcast i8* %174 to i8**
%176 = bitcast i8* %174 to i32**
store i32* %14, i32** %176
%177 = getelementptr inbounds i8*, i8** %175, i64 1
%178 = bitcast i8** %177 to i32**
store i32* %12, i32** %178
%179 = getelementptr inbounds i8*, i8** %175, i64 2
%180 = bitcast i8** %179 to i32**
store i32* %13, i32** %180
%181 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @rpcCall to i32 (i8*, i32*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i32* %173, i8** %175)
%182 = load i32, i32* %12
%183 = load i32, i32* %13
%184 = mul nsw i32 %183, %182
%185 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0), i32 %184)
%186 = icmp sgt i32 %181, -1
br i1 %186, label %187, label %191
187: ; preds = %164
%188 = load i32*, i32** %176
%189 = load i32, i32* %188
%190 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.22, i64 0, i64 0), i32 %189)
br label %193
191: ; preds = %164
%192 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %181)
br label %193
193: ; preds = %191, %187
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.23, i64 0, i64 0))
%195 = call i32 (...) @getchar()
%196 = icmp eq i32 %195, 121
br i1 %196, label %197, label %199
197: ; preds = %193
%198 = call i32 (...) @rpcTerminate()
br label %199
199: ; preds = %197, %193
ret i32 0
}