#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ get_fieldname(char *, char *);
int /*<<< orphan*/ get_formalparmtype(char *, char *);
char *get_parm(int);
scalar_t__ is_noreturn_func(char *);
scalar_t__ is_union(char *);
scalar_t__ is_vararg(char *, int, int);
int /*<<< orphan*/ *open_proxy();
int /*<<< orphan*/ print_formalparm(int /*<<< orphan*/ *, char *, int);
scalar_t__ strcmp(char *, char *);
scalar_t__ strlen(char *);
void generate_proxy(int nparms) {
  FILE *stream = open_proxy();
  char formal[128];
  char fieldname[128];
  bool bvarargs = false;
  int nformal;
  int nactual;
  char *cond_parm;
  int i;
  fprintf(stream, "/* Auto-generated %s proxy file -- do not edit */\n\n",
          get_parm(0));
  fprintf(stream, "#include <tinyara/config.h>\n");
  if (is_vararg(get_parm(4 + nparms - 1), nparms - 1, nparms)) {
    nformal = nparms - 1;
    bvarargs = true;
    fprintf(stream, "#include <stdarg.h>\n");
  } else
    nformal = nparms;
  if (get_parm(1) && strlen(get_parm(1)) > 0)
    fprintf(stream, "#include <%s>\n", get_parm(1));
  fprintf(stream, "#include <syscall.h>\n\n");
  cond_parm = get_parm(2);
  if (cond_parm[0] != '\0')
    fprintf(stream, "#if %s\n\n", cond_parm);
  fprintf(stream, "%s %s(", get_parm(3), get_parm(0));
  if (nformal <= 0)
    fprintf(stream, "void");
  else {
    for (i = 0; i < nformal; i++) {
      get_formalparmtype(get_parm(4 + i), formal);
      if (i > 0)
        fprintf(stream, ", ");
      print_formalparm(stream, formal, i + 1);
    }
  }
  if (bvarargs) {
    fprintf(stream, ", ...)\n{\n");
    if (nparms < 7) {
      fprintf(stream, "  va_list ap;\n");
      for (i = nparms; i < 7; i++)
        fprintf(stream, "  uintptr_t parm%d;\n", i);
      fprintf(stream, "\n  va_start(ap, parm%d);\n", nparms - 1);
      for (i = nparms; i < 7; i++)
        fprintf(stream, "  parm%d = va_arg(ap, uintptr_t);\n", i);
      fprintf(stream, "  va_end(ap);\n\n");
    }
  } else
    fprintf(stream, ")\n{\n");
  nactual = bvarargs ? 6 : nparms;
  if (strcmp(get_parm(3), "void") == 0)
    fprintf(stream, "  (void)sys_call%d(", nactual);
  else
    fprintf(stream, "  return (%s)sys_call%d(", get_parm(3), nactual);
  fprintf(stream, "(unsigned int)SYS_%s", get_parm(0));
  for (i = 0; i < nactual; i++) {
    if (i < nparms && is_union(get_parm(4 + i))) {
      get_fieldname(get_parm(4 + i), fieldname);
      fprintf(stream, ", (uintptr_t)parm%d.%s", i + 1, fieldname);
    } else
      fprintf(stream, ", (uintptr_t)parm%d", i + 1);
  }
  if (is_noreturn_func(get_parm(0))) {
    fprintf(stream, ");%s\n}\n\n", "\n  while (1);");
  } else {
    fprintf(stream, ");\n}\n\n");
  }
  cond_parm = get_parm(2);
  if (cond_parm[0] != '\0')
    fprintf(stream, "#endif /* %s */\n", cond_parm);
  fclose(stream);
}


x86 assembly (clang, -O0):
<generate_proxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   10c0 <open_proxy@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x114(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x138(%rbp)
xor    %edi,%edi
call   1030 <get_parm@plt>
mov    -0x138(%rbp),%rdi
mov    %rax,%rdx
lea    0xdfa(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x4(%rbp),%edi
add    $0x4,%edi
sub    $0x1,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    -0x4(%rbp),%edx
call   10e0 <is_vararg@plt>
cmp    $0x0,%rax
je     1275 <generate_proxy+0xb5>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x118(%rbp)
movl   $0x1,-0x114(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    127e <generate_proxy+0xbe>
mov    -0x4(%rbp),%eax
mov    %eax,-0x118(%rbp)
mov    $0x1,%edi
call   1030 <get_parm@plt>
cmp    $0x0,%rax
je     12db <generate_proxy+0x11b>
mov    $0x1,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jle    12db <generate_proxy+0x11b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x140(%rbp)
mov    $0x1,%edi
call   1030 <get_parm@plt>
mov    -0x140(%rbp),%rdi
mov    %rax,%rdx
lea    0xd92(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd8f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x2,%edi
call   1030 <get_parm@plt>
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     132a <generate_proxy+0x16a>
mov    -0x10(%rbp),%rdi
mov    -0x128(%rbp),%rdx
lea    0xd69(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x150(%rbp)
mov    $0x3,%edi
call   1030 <get_parm@plt>
mov    %rax,-0x148(%rbp)
xor    %edi,%edi
call   1030 <get_parm@plt>
mov    -0x150(%rbp),%rdi
mov    -0x148(%rbp),%rdx
mov    %rax,%rcx
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpl   $0x0,-0x118(%rbp)
jg     1390 <generate_proxy+0x1d0>
mov    -0x10(%rbp),%rdi
lea    0xd18(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    141a <generate_proxy+0x25a>
movl   $0x0,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x118(%rbp),%eax
jge    1415 <generate_proxy+0x255>
mov    -0x12c(%rbp),%edi
add    $0x4,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
lea    -0x90(%rbp),%rsi
call   1080 <get_formalparmtype@plt>
cmpl   $0x0,-0x12c(%rbp)
jle    13e8 <generate_proxy+0x228>
mov    -0x10(%rbp),%rdi
lea    0xcc0(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    -0x12c(%rbp),%edx
add    $0x1,%edx
call   1070 <print_formalparm@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    139a <generate_proxy+0x1da>
jmp    141a <generate_proxy+0x25a>
cmpl   $0x0,-0x114(%rbp)
je     1508 <generate_proxy+0x348>
mov    -0x10(%rbp),%rdi
lea    0xc72(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpl   $0x7,-0x4(%rbp)
jge    1503 <generate_proxy+0x343>
mov    -0x10(%rbp),%rdi
lea    0xc60(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x12c(%rbp)
cmpl   $0x7,-0x12c(%rbp)
jge    1497 <generate_proxy+0x2d7>
mov    -0x10(%rbp),%rdi
mov    -0x12c(%rbp),%edx
lea    0xc41(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    145e <generate_proxy+0x29e>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xc2a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x12c(%rbp)
cmpl   $0x7,-0x12c(%rbp)
jge    14f1 <generate_proxy+0x331>
mov    -0x10(%rbp),%rdi
mov    -0x12c(%rbp),%edx
lea    0xc16(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    14b8 <generate_proxy+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xc13(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    151a <generate_proxy+0x35a>
mov    -0x10(%rbp),%rdi
lea    0xb96(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpl   $0x0,-0x114(%rbp)
je     1537 <generate_proxy+0x377>
mov    $0x6,%eax
mov    %eax,-0x154(%rbp)
jmp    1540 <generate_proxy+0x380>
mov    -0x4(%rbp),%eax
mov    %eax,-0x154(%rbp)
mov    -0x154(%rbp),%eax
mov    %eax,-0x11c(%rbp)
mov    $0x3,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
lea    0xb3c(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    158c <generate_proxy+0x3cc>
mov    -0x10(%rbp),%rdi
mov    -0x11c(%rbp),%edx
lea    0xb9f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    15bf <generate_proxy+0x3ff>
mov    -0x10(%rbp),%rax
mov    %rax,-0x160(%rbp)
mov    $0x3,%edi
call   1030 <get_parm@plt>
mov    -0x160(%rbp),%rdi
mov    %rax,%rdx
mov    -0x11c(%rbp),%ecx
lea    0xb7b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x168(%rbp)
xor    %edi,%edi
call   1030 <get_parm@plt>
mov    -0x168(%rbp),%rdi
mov    %rax,%rdx
lea    0xb6a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x0,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    16ac <generate_proxy+0x4ec>
mov    -0x12c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1678 <generate_proxy+0x4b8>
mov    -0x12c(%rbp),%edi
add    $0x4,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
call   1060 <is_union@plt>
cmp    $0x0,%rax
je     1678 <generate_proxy+0x4b8>
mov    -0x12c(%rbp),%edi
add    $0x4,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
lea    -0x110(%rbp),%rsi
call   10b0 <get_fieldname@plt>
mov    -0x10(%rbp),%rdi
mov    -0x12c(%rbp),%edx
add    $0x1,%edx
lea    -0x110(%rbp),%rcx
lea    0xaf5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1693 <generate_proxy+0x4d3>
mov    -0x10(%rbp),%rdi
mov    -0x12c(%rbp),%edx
add    $0x1,%edx
lea    0xaec(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1698 <generate_proxy+0x4d8>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    15f3 <generate_proxy+0x433>
xor    %edi,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
call   10d0 <is_noreturn_func@plt>
cmp    $0x0,%rax
je     16e3 <generate_proxy+0x523>
mov    -0x10(%rbp),%rdi
lea    0xabc(%rip),%rsi
lea    0xabe(%rip),%rdx
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    16f5 <generate_proxy+0x535>
mov    -0x10(%rbp),%rdi
lea    0xab5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x2,%edi
call   1030 <get_parm@plt>
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1732 <generate_proxy+0x572>
mov    -0x10(%rbp),%rdi
mov    -0x128(%rbp),%rdx
lea    0xa7f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_proxy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %edi,%r15d
xor    %eax,%eax
call   10c0 <open_proxy@plt>
mov    %rax,%r14
xor    %edi,%edi
call   1030 <get_parm@plt>
lea    0xe04(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0xe24(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
lea    0x3(%r15),%edi
call   1030 <get_parm@plt>
lea    -0x1(%r15),%ebx
mov    %rax,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   10f0 <is_vararg@plt>
mov    %rax,%r12
mov    %r15,%rax
mov    %r15,(%rsp)
test   %r12,%r12
je     1267 <generate_proxy+0x97>
lea    0xdff(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
mov    %ebx,%r15d
mov    $0x1,%edi
call   1030 <get_parm@plt>
test   %rax,%rax
je     12ab <generate_proxy+0xdb>
mov    $0x1,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jle    12ab <generate_proxy+0xdb>
mov    $0x1,%edi
call   1030 <get_parm@plt>
lea    0xdc8(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %ebx,0xc(%rsp)
lea    0xdbf(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
mov    $0x2,%edi
call   1030 <get_parm@plt>
cmpb   $0x0,(%rax)
je     12eb <generate_proxy+0x11b>
lea    0xdae(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x3,%edi
call   1030 <get_parm@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1030 <get_parm@plt>
lea    0xd8f(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
test   %r15d,%r15d
jle    1492 <generate_proxy+0x2c2>
mov    $0x4,%edi
call   1030 <get_parm@plt>
lea    0x10(%rsp),%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1080 <get_formalparmtype@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <print_formalparm@plt>
cmp    $0x1,%r15d
je     13b8 <generate_proxy+0x1e8>
neg    %r15d
mov    $0x2,%ebx
lea    0x10(%rsp),%rbp
lea    0xd3e(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x3(%rbx),%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
mov    %rbp,%rsi
call   1080 <get_formalparmtype@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %r14,%rcx
call   10e0 <fwrite@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
call   1070 <print_formalparm@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1370 <generate_proxy+0x1a0>
test   %r12,%r12
je     14b4 <generate_proxy+0x2e4>
lea    0xcdc(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
mov    $0x6,%r15d
mov    (%rsp),%r12
cmp    $0x6,%r12d
jg     14d4 <generate_proxy+0x304>
lea    0xcb9(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
lea    0xcaf(%rip),%rbx
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
add    $0x1,%ebp
cmp    $0x7,%ebp
jne    1420 <generate_proxy+0x250>
lea    0xc94(%rip),%rsi
mov    %r14,%rdi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0xc99(%rip),%rbx
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
add    $0x1,%ebp
cmp    $0x7,%ebp
jne    1460 <generate_proxy+0x290>
lea    0xc91(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
jmp    14d4 <generate_proxy+0x304>
lea    0xc03(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
test   %r12,%r12
jne    13c1 <generate_proxy+0x1f1>
lea    0xbee(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
mov    (%rsp),%rax
mov    %eax,%r15d
mov    $0x3,%edi
call   1030 <get_parm@plt>
lea    0xbb7(%rip),%rsi
mov    %rax,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1515 <generate_proxy+0x345>
mov    $0x3,%edi
call   1030 <get_parm@plt>
lea    0xc30(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1529 <generate_proxy+0x359>
lea    0xc03(%rip),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
xor    %edi,%edi
call   1030 <get_parm@plt>
lea    0xc15(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
test   %r15d,%r15d
jle    15da <generate_proxy+0x40a>
lea    0x90(%rsp),%rbx
lea    0xc1c(%rip),%r13
xor    %r12d,%r12d
jmp    1589 <generate_proxy+0x3b9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
cmp    %r15d,%r12d
je     15da <generate_proxy+0x40a>
cmp    (%rsp),%r12d
jge    1570 <generate_proxy+0x3a0>
lea    0x4(%r12),%ebp
mov    %ebp,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
call   1060 <is_union@plt>
test   %rax,%rax
je     1570 <generate_proxy+0x3a0>
mov    %ebp,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   10b0 <get_fieldname@plt>
add    $0x1,%r12d
mov    %r14,%rdi
lea    0xb99(%rip),%rsi
mov    %r12d,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
cmp    %r15d,%r12d
jne    1589 <generate_proxy+0x3b9>
xor    %edi,%edi
call   1030 <get_parm@plt>
mov    %rax,%rdi
call   10d0 <is_noreturn_func@plt>
test   %rax,%rax
je     1608 <generate_proxy+0x438>
lea    0xb97(%rip),%rsi
lea    0xb99(%rip),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1621 <generate_proxy+0x451>
lea    0xb94(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
mov    $0x2,%edi
call   1030 <get_parm@plt>
cmpb   $0x0,(%rax)
je     1644 <generate_proxy+0x474>
lea    0xb73(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [52 x i8] c"/* Auto-generated %s proxy file -- do not edit */\0A\0A\00"
@.str.1 = [29 x i8] c"#include <tinyara/config.h>\0A\00"
@.str.2 = [21 x i8] c"#include <stdarg.h>\0A\00"
@.str.3 = [15 x i8] c"#include <%s>\0A\00"
@.str.4 = [23 x i8] c"#include <syscall.h>\0A\0A\00"
@.str.5 = [9 x i8] c"#if %s\0A\0A\00"
@.str.6 = [7 x i8] c"%s %s(\00"
@.str.7 = [5 x i8] c"void\00"
@.str.8 = [3 x i8] c", \00"
@.str.9 = [10 x i8] c", ...)\0A{\0A\00"
@.str.10 = [15 x i8] c" va_list ap;\0A\00"
@.str.11 = [21 x i8] c" uintptr_t parm%d;\0A\00"
@.str.12 = [26 x i8] c"\0A va_start(ap, parm%d);\0A\00"
@.str.13 = [35 x i8] c" parm%d = va_arg(ap, uintptr_t);\0A\00"
@.str.14 = [16 x i8] c" va_end(ap);\0A\0A\00"
@.str.15 = [5 x i8] c")\0A{\0A\00"
@.str.16 = [20 x i8] c" (void)sys_call%d(\00"
@.str.17 = [25 x i8] c" return (%s)sys_call%d(\00"
@.str.18 = [21 x i8] c"(unsigned int)SYS_%s\00"
@.str.19 = [23 x i8] c", (uintptr_t)parm%d.%s\00"
@.str.20 = [20 x i8] c", (uintptr_t)parm%d\00"
@.str.21 = [9 x i8] c");%s\0A}\0A\0A\00"
@.str.22 = [14 x i8] c"\0A while (1);\00"
@.str.23 = [7 x i8] c");\0A}\0A\0A\00"
@.str.24 = [17 x i8] c"#endif /* %s */\0A\00"
define void @generate_proxy(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %2
%11 = call i32* (...) @open_proxy()
store i32* %11, i32** %3
store i32 0, i32* %6
%12 = load i32*, i32** %3
%13 = call i8* @get_parm(i32 0)
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32*, i32** %3
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %2
%18 = add nsw i32 4, %17
%19 = sub nsw i32 %18, 1
%20 = call i8* @get_parm(i32 %19)
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, 1
%23 = load i32, i32* %2
%24 = call i64 @is_vararg(i8* %20, i32 %22, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %1
%27 = load i32, i32* %2
%28 = sub nsw i32 %27, 1
store i32 %28, i32* %7
store i32 1, i32* %6
%29 = load i32*, i32** %3
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %33
31: ; preds = %1
%32 = load i32, i32* %2
store i32 %32, i32* %7
br label %33
33: ; preds = %31, %26
%34 = call i8* @get_parm(i32 1)
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %44
36: ; preds = %33
%37 = call i8* @get_parm(i32 1)
%38 = call i64 @strlen(i8* %37)
%39 = icmp sgt i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %36
%41 = load i32*, i32** %3
%42 = call i8* @get_parm(i32 1)
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %40, %36, %33
%45 = load i32*, i32** %3
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%47 = call i8* @get_parm(i32 2)
store i8* %47, i8** %9
%48 = load i8*, i8** %9
%49 = getelementptr inbounds i8, i8* %48, i64 0
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %44
%54 = load i32*, i32** %3
%55 = load i8*, i8** %9
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %55)
br label %57
57: ; preds = %53, %44
%58 = load i32*, i32** %3
%59 = call i8* @get_parm(i32 3)
%60 = call i8* @get_parm(i32 0)
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %59, i8* %60)
%62 = load i32, i32* %7
%63 = icmp sle i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %57
%65 = load i32*, i32** %3
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %93
67: ; preds = %57
store i32 0, i32* %10
br label %68
68: ; preds = %89, %67
%69 = load i32, i32* %10
%70 = load i32, i32* %7
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %92
72: ; preds = %68
%73 = load i32, i32* %10
%74 = add nsw i32 4, %73
%75 = call i8* @get_parm(i32 %74)
%76 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%77 = call i32 @get_formalparmtype(i8* %75, i8* %76)
%78 = load i32, i32* %10
%79 = icmp sgt i32 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %72
%81 = load i32*, i32** %3
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %83
83: ; preds = %80, %72
%84 = load i32*, i32** %3
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
%88 = call i32 @print_formalparm(i32* %84, i8* %85, i32 %87)
br label %89
89: ; preds = %83
%90 = load i32, i32* %10
%91 = add nsw i32 %90, 1
store i32 %91, i32* %10
br label %68
92: ; preds = %68
br label %93
93: ; preds = %92, %64
%94 = load i32, i32* %6
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %135
96: ; preds = %93
%97 = load i32*, i32** %3
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%99 = load i32, i32* %2
%100 = icmp slt i32 %99, 7
br i1 %100, label %101, label %134
101: ; preds = %96
%102 = load i32*, i32** %3
%103 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0))
%104 = load i32, i32* %2
store i32 %104, i32* %10
br label %105
105: ; preds = %112, %101
%106 = load i32, i32* %10
%107 = icmp slt i32 %106, 7
br i1 %107, label %108, label %115
108: ; preds = %105
%109 = load i32*, i32** %3
%110 = load i32, i32* %10
%111 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %110)
br label %112
112: ; preds = %108
%113 = load i32, i32* %10
%114 = add nsw i32 %113, 1
store i32 %114, i32* %10
br label %105
115: ; preds = %105
%116 = load i32*, i32** %3
%117 = load i32, i32* %2
%118 = sub nsw i32 %117, 1
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i32 %118)
%120 = load i32, i32* %2
store i32 %120, i32* %10
br label %121
121: ; preds = %128, %115
%122 = load i32, i32* %10
%123 = icmp slt i32 %122, 7
br i1 %123, label %124, label %131
124: ; preds = %121
%125 = load i32*, i32** %3
%126 = load i32, i32* %10
%127 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0), i32 %126)
br label %128
128: ; preds = %124
%129 = load i32, i32* %10
%130 = add nsw i32 %129, 1
store i32 %130, i32* %10
br label %121
131: ; preds = %121
%132 = load i32*, i32** %3
%133 = call i32 (i32*, i8*, ...) @fprintf(i32* %132, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
br label %134
134: ; preds = %131, %96
br label %138
135: ; preds = %93
%136 = load i32*, i32** %3
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %138
138: ; preds = %135, %134
%139 = load i32, i32* %6
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %142
141: ; preds = %138
br label %144
142: ; preds = %138
%143 = load i32, i32* %2
br label %144
144: ; preds = %142, %141
%145 = phi i32 [ 6, %141 ], [ %143, %142 ]
store i32 %145, i32* %8
%146 = call i8* @get_parm(i32 3)
%147 = call i64 @strcmp(i8* %146, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%148 = icmp eq i64 %147, 0
br i1 %148, label %149, label %153
149: ; preds = %144
%150 = load i32*, i32** %3
%151 = load i32, i32* %8
%152 = call i32 (i32*, i8*, ...) @fprintf(i32* %150, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), i32 %151)
br label %158
153: ; preds = %144
%154 = load i32*, i32** %3
%155 = call i8* @get_parm(i32 3)
%156 = load i32, i32* %8
%157 = call i32 (i32*, i8*, ...) @fprintf(i32* %154, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i8* %155, i32 %156)
br label %158
158: ; preds = %153, %149
%159 = load i32*, i32** %3
%160 = call i8* @get_parm(i32 0)
%161 = call i32 (i32*, i8*, ...) @fprintf(i32* %159, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0), i8* %160)
store i32 0, i32* %10
br label %162
162: ; preds = %193, %158
%163 = load i32, i32* %10
%164 = load i32, i32* %8
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %196
166: ; preds = %162
%167 = load i32, i32* %10
%168 = load i32, i32* %2
%169 = icmp slt i32 %167, %168
br i1 %169, label %170, label %187
170: ; preds = %166
%171 = load i32, i32* %10
%172 = add nsw i32 4, %171
%173 = call i8* @get_parm(i32 %172)
%174 = call i64 @is_union(i8* %173)
%175 = icmp ne i64 %174, 0
br i1 %175, label %176, label %187
176: ; preds = %170
%177 = load i32, i32* %10
%178 = add nsw i32 4, %177
%179 = call i8* @get_parm(i32 %178)
%180 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%181 = call i32 @get_fieldname(i8* %179, i8* %180)
%182 = load i32*, i32** %3
%183 = load i32, i32* %10
%184 = add nsw i32 %183, 1
%185 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %182, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0), i32 %184, i8* %185)
br label %192
187: ; preds = %170, %166
%188 = load i32*, i32** %3
%189 = load i32, i32* %10
%190 = add nsw i32 %189, 1
%191 = call i32 (i32*, i8*, ...) @fprintf(i32* %188, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), i32 %190)
br label %192
192: ; preds = %187, %176
br label %193
193: ; preds = %192
%194 = load i32, i32* %10
%195 = add nsw i32 %194, 1
store i32 %195, i32* %10
br label %162
196: ; preds = %162
%197 = call i8* @get_parm(i32 0)
%198 = call i64 @is_noreturn_func(i8* %197)
%199 = icmp ne i64 %198, 0
br i1 %199, label %200, label %203
200: ; preds = %196
%201 = load i32*, i32** %3
%202 = call i32 (i32*, i8*, ...) @fprintf(i32* %201, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0))
br label %206
203: ; preds = %196
%204 = load i32*, i32** %3
%205 = call i32 (i32*, i8*, ...) @fprintf(i32* %204, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
br label %206
206: ; preds = %203, %200
%207 = call i8* @get_parm(i32 2)
store i8* %207, i8** %9
%208 = load i8*, i8** %9
%209 = getelementptr inbounds i8, i8* %208, i64 0
%210 = load i8, i8* %209
%211 = sext i8 %210 to i32
%212 = icmp ne i32 %211, 0
br i1 %212, label %213, label %217
213: ; preds = %206
%214 = load i32*, i32** %3
%215 = load i8*, i8** %9
%216 = call i32 (i32*, i8*, ...) @fprintf(i32* %214, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i8* %215)
br label %217
217: ; preds = %213, %206
%218 = load i32*, i32** %3
%219 = call i32 @fclose(i32* %218)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"/* Auto-generated %s proxy file -- do not edit */\0A\0A\00"
@.str.1 = [29 x i8] c"#include <tinyara/config.h>\0A\00"
@.str.2 = [21 x i8] c"#include <stdarg.h>\0A\00"
@.str.3 = [15 x i8] c"#include <%s>\0A\00"
@.str.4 = [23 x i8] c"#include <syscall.h>\0A\0A\00"
@.str.5 = [9 x i8] c"#if %s\0A\0A\00"
@.str.6 = [7 x i8] c"%s %s(\00"
@.str.7 = [5 x i8] c"void\00"
@.str.8 = [3 x i8] c", \00"
@.str.9 = [10 x i8] c", ...)\0A{\0A\00"
@.str.10 = [15 x i8] c" va_list ap;\0A\00"
@.str.11 = [21 x i8] c" uintptr_t parm%d;\0A\00"
@.str.12 = [26 x i8] c"\0A va_start(ap, parm%d);\0A\00"
@.str.13 = [35 x i8] c" parm%d = va_arg(ap, uintptr_t);\0A\00"
@.str.14 = [16 x i8] c" va_end(ap);\0A\0A\00"
@.str.15 = [5 x i8] c")\0A{\0A\00"
@.str.16 = [20 x i8] c" (void)sys_call%d(\00"
@.str.17 = [25 x i8] c" return (%s)sys_call%d(\00"
@.str.18 = [21 x i8] c"(unsigned int)SYS_%s\00"
@.str.19 = [23 x i8] c", (uintptr_t)parm%d.%s\00"
@.str.20 = [20 x i8] c", (uintptr_t)parm%d\00"
@.str.21 = [9 x i8] c");%s\0A}\0A\0A\00"
@.str.22 = [14 x i8] c"\0A while (1);\00"
@.str.23 = [7 x i8] c");\0A}\0A\0A\00"
@.str.24 = [17 x i8] c"#endif /* %s */\0A\00"
define void @generate_proxy(i32 %0) {
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = tail call i32* (...) @open_proxy()
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = tail call i8* @get_parm(i32 0)
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i64 28, i64 1, i32* %4)
%10 = add nsw i32 %0, 3
%11 = tail call i8* @get_parm(i32 %10)
%12 = add nsw i32 %0, -1
%13 = tail call i64 @is_vararg(i8* %11, i32 %12, i32 %0)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %1
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i64 20, i64 1, i32* %4)
br label %17
17: ; preds = %1, %15
%18 = phi i32 [ %12, %15 ], [ %0, %1 ]
%19 = tail call i8* @get_parm(i32 1)
%20 = icmp eq i8* %19, null
br i1 %20, label %28, label %21
21: ; preds = %17
%22 = tail call i8* @get_parm(i32 1)
%23 = tail call i64 @strlen(i8* dereferenceable(1) %22)
%24 = icmp sgt i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = tail call i8* @get_parm(i32 1)
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %25, %21, %17
%29 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i64 22, i64 1, i32* %4)
%30 = tail call i8* @get_parm(i32 2)
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %28
%34 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %30)
br label %35
35: ; preds = %33, %28
%36 = tail call i8* @get_parm(i32 3)
%37 = tail call i8* @get_parm(i32 0)
%38 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %36, i8* %37)
%39 = icmp slt i32 %18, 1
br i1 %39, label %45, label %40
40: ; preds = %35
%41 = call i8* @get_parm(i32 4)
%42 = call i32 @get_formalparmtype(i8* %41, i8* %5)
%43 = call i32 @print_formalparm(i32* %4, i8* %5, i32 1)
%44 = icmp eq i32 %18, 1
br i1 %44, label %56, label %47
45: ; preds = %35
%46 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 4, i64 1, i32* %4)
br label %56
47: ; preds = %40, %47
%48 = phi i32 [ %53, %47 ], [ 1, %40 ]
%49 = add nuw nsw i32 %48, 4
%50 = call i8* @get_parm(i32 %49)
%51 = call i32 @get_formalparmtype(i8* %50, i8* %5)
%52 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 2, i64 1, i32* %4)
%53 = add nuw nsw i32 %48, 1
%54 = call i32 @print_formalparm(i32* %4, i8* %5, i32 %53)
%55 = icmp eq i32 %53, %18
br i1 %55, label %56, label %47
56: ; preds = %47, %40, %45
br i1 %14, label %76, label %57
57: ; preds = %56
%58 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i64 9, i64 1, i32* %4)
%59 = icmp slt i32 %0, 7
br i1 %59, label %60, label %78
60: ; preds = %57
%61 = call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i64 14, i64 1, i32* %4)
br label %62
62: ; preds = %60, %62
%63 = phi i32 [ %0, %60 ], [ %65, %62 ]
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %63)
%65 = add i32 %63, 1
%66 = icmp eq i32 %65, 7
br i1 %66, label %67, label %62
67: ; preds = %62
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i32 %12)
br label %69
69: ; preds = %67, %69
%70 = phi i32 [ %72, %69 ], [ %0, %67 ]
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0), i32 %70)
%72 = add i32 %70, 1
%73 = icmp eq i32 %72, 7
br i1 %73, label %74, label %69
74: ; preds = %69
%75 = call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i64 15, i64 1, i32* %4)
br label %78
76: ; preds = %56
%77 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i64 4, i64 1, i32* %4)
br label %78
78: ; preds = %57, %74, %76
%79 = phi i32 [ 6, %57 ], [ 6, %74 ], [ %0, %76 ]
%80 = call i8* @get_parm(i32 3)
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %78
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), i32 %79)
br label %88
85: ; preds = %78
%86 = call i8* @get_parm(i32 3)
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i8* %86, i32 %79)
br label %88
88: ; preds = %85, %83
%89 = call i8* @get_parm(i32 0)
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0), i8* %89)
%91 = icmp sgt i32 %79, 0
br i1 %91, label %92, label %111
92: ; preds = %88, %108
%93 = phi i32 [ %109, %108 ], [ 0, %88 ]
%94 = icmp slt i32 %93, %0
br i1 %94, label %95, label %105
95: ; preds = %92
%96 = add nuw nsw i32 %93, 4
%97 = call i8* @get_parm(i32 %96)
%98 = call i64 @is_union(i8* %97)
%99 = icmp eq i64 %98, 0
br i1 %99, label %105, label %100
100: ; preds = %95
%101 = call i8* @get_parm(i32 %96)
%102 = call i32 @get_fieldname(i8* %101, i8* %6)
%103 = add nuw nsw i32 %93, 1
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0), i32 %103, i8* %6)
br label %108
105: ; preds = %95, %92
%106 = add nuw nsw i32 %93, 1
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), i32 %106)
br label %108
108: ; preds = %100, %105
%109 = phi i32 [ %103, %100 ], [ %106, %105 ]
%110 = icmp eq i32 %109, %79
br i1 %110, label %111, label %92
111: ; preds = %108, %88
%112 = call i8* @get_parm(i32 0)
%113 = call i64 @is_noreturn_func(i8* %112)
%114 = icmp eq i64 %113, 0
br i1 %114, label %117, label %115
115: ; preds = %111
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0))
br label %119
117: ; preds = %111
%118 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), i64 6, i64 1, i32* %4)
br label %119
119: ; preds = %117, %115
%120 = call i8* @get_parm(i32 2)
%121 = load i8, i8* %120
%122 = icmp eq i8 %121, 0
br i1 %122, label %125, label %123
123: ; preds = %119
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i8* %120)
br label %125
125: ; preds = %123, %119
%126 = call i32 @fclose(i32* %4)
ret void
}