#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*/ uint16_t;
struct stat {
  size_t st_size;
};
typedef size_t ssize_t;
typedef int /*<<< orphan*/ dump_path;

/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_NOTICE;
int O_CREAT;
int O_DIRECTORY;
int O_EXCL;
int O_RDONLY;
int O_WRONLY;
int PATH_MAX;
int S_IRGRP;
int S_IRUSR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dump_get_file_name(char *, size_t, char *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ free(char *);
int fsync(int);
scalar_t__ malloc(size_t);
int open(char const *, int, ...);
size_t read(int, char *, size_t);
int /*<<< orphan*/ remove_dump_files(char *);
int rename(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, ...);
int stat(char *, struct stat *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ unlink(char *);
size_t write(int, char *, size_t);
int process_dump(const char *dump_dir_path, const char *output_dir) {
  int in_fd = -1;
  int out_fd = -1;
  int dir_fd = -1;
  char dump_path[PATH_MAX];
  char final_dump_path[PATH_MAX];
  char *buf;
  size_t bufsz;
  struct stat sbuf;
  int ret = -1;
  ssize_t sz = 0;
  ssize_t readsz = 0;
  char outfname[48];
  uint16_t prefix_size;
  int rc;
  snprintf(dump_path, sizeof(dump_path), "%s/dump", dump_dir_path);
  if (stat(dump_path, &sbuf) == -1)
    return -1;
  bufsz = sbuf.st_size;
  buf = (char *)malloc(bufsz);
  if (!buf) {
    syslog(LOG_ERR, "Failed to allocate memory for dump\n");
    return -1;
  }
  in_fd = open(dump_path, O_RDONLY);
  if (in_fd == -1) {
    syslog(LOG_ERR, "Failed to open platform dump: %s (%d:%s)\n", dump_path,
           errno, strerror(errno));
    goto err;
  }
  do {
    readsz = read(in_fd, buf + sz, bufsz - sz);
    if (readsz == -1) {
      syslog(LOG_ERR,
             "Failed to read platform dump: %s "
             "(%d:%s)\n",
             dump_path, errno, strerror(errno));
      goto err;
    }
    sz += readsz;
  } while (sz != bufsz);
  dump_get_file_name(buf, bufsz, outfname, &prefix_size);
  snprintf(dump_path, sizeof(dump_path), "%s/%s.tmp", output_dir, outfname);
  snprintf(final_dump_path, sizeof(dump_path), "%s/%s", output_dir, outfname);
  remove_dump_files(outfname);
  out_fd = open(dump_path, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IRGRP);
  if (out_fd == -1) {
    syslog(LOG_ERR, "Failed to write platform dump: %s (%d:%s)\n", dump_path,
           errno, strerror(errno));
    goto err;
  }
  sz = write(out_fd, buf, bufsz);
  if (sz != bufsz) {
    syslog(LOG_ERR, "Failed to write platform dump: %s (%d:%s)\n", dump_path,
           errno, strerror(errno));
    unlink(dump_path);
    goto err;
  }
  dir_fd = open(output_dir, O_RDONLY | O_DIRECTORY);
  rc = fsync(out_fd);
  if (rc == -1) {
    syslog(LOG_ERR, "Failed to sync platform dump: %s (%d:%s)\n", dump_path,
           errno, strerror(errno));
    goto err;
  }
  rc = rename(dump_path, final_dump_path);
  if (rc == -1) {
    syslog(LOG_ERR,
           "Failed to rename platform dump %s to %s"
           "(%d: %s)\n",
           dump_path, final_dump_path, errno, strerror(errno));
    goto err;
  }
  rc = fsync(dir_fd);
  if (rc == -1) {
    syslog(LOG_ERR,
           "Failed to sync platform dump directory: %s"
           " (%d:%s)\n",
           output_dir, errno, strerror(errno));
  }
  syslog(LOG_NOTICE, "New platform dump available. File: %s/%s\n", output_dir,
         outfname);
  ret = 0;
err:
  if (in_fd != -1)
    close(in_fd);
  if (out_fd != -1)
    close(out_fd);
  if (dir_fd != -1)
    close(dir_fd);
  free(buf);
  return ret;
}


x86 assembly (clang, -O0):
<process_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
mov    0x2dc9(%rip),%rcx
mov    (%rcx),%eax
mov    %rax,-0xc8(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rdi
sub    %rdx,%rdi
mov    %rdi,-0xb8(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
mov    (%rcx),%ecx
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xc0(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x40(%rbp)
movl   $0xffffffff,-0x5c(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x70(%rbp)
mov    %eax,%esi
mov    -0x10(%rbp),%rcx
lea    0xd6d(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    -0xb8(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1090 <stat@plt>
cmp    $0xffffffff,%eax
jne    12c9 <process_dump+0xd9>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0xac(%rbp)
jmp    17c4 <process_dump+0x5d4>
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1316 <process_dump+0x126>
mov    0x2c98(%rip),%rax
mov    (%rax),%edi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0xac(%rbp)
jmp    17c4 <process_dump+0x5d4>
mov    -0xb8(%rbp),%rdi
mov    0x2cb4(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   10e0 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    138f <process_dump+0x19f>
mov    0x2c47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xd0(%rbp)
mov    0x2c68(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xcc(%rbp)
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xd0(%rbp),%edi
mov    -0xb8(%rbp),%rdx
mov    -0xcc(%rbp),%ecx
mov    %eax,%r8d
lea    0xca9(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
jmp    1775 <process_dump+0x585>
jmp    1394 <process_dump+0x1a4>
mov    -0x1c(%rbp),%edi
mov    -0x48(%rbp),%rsi
add    -0x68(%rbp),%rsi
mov    -0x50(%rbp),%rdx
sub    -0x68(%rbp),%rdx
call   1080 <read@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0xffffffffffffffff,-0x70(%rbp)
jne    1410 <process_dump+0x220>
mov    0x2bc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xd8(%rbp)
mov    0x2be7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xd4(%rbp)
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xd8(%rbp),%edi
mov    -0xb8(%rbp),%rdx
mov    -0xd4(%rbp),%ecx
mov    %eax,%r8d
lea    0xc52(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
jmp    1775 <process_dump+0x585>
mov    -0x70(%rbp),%rax
add    -0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x50(%rbp),%rax
jne    1394 <process_dump+0x1a4>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    -0xa4(%rbp),%rcx
call   10a0 <dump_get_file_name@plt>
mov    -0xb8(%rbp),%rdi
mov    -0xc8(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
lea    -0xa0(%rbp),%r8
lea    0xc19(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    -0xc0(%rbp),%rdi
mov    -0xc8(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
lea    -0xa0(%rbp),%r8
lea    0xbfa(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1100 <remove_dump_files@plt>
mov    -0xb8(%rbp),%rdi
mov    0x2adf(%rip),%rax
mov    (%rax),%esi
mov    0x2b3e(%rip),%rax
or     (%rax),%esi
mov    0x2afd(%rip),%rax
or     (%rax),%esi
mov    0x2adc(%rip),%rax
mov    (%rax),%edx
mov    0x2adb(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   10e0 <open@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1540 <process_dump+0x350>
mov    0x2a96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe0(%rbp)
mov    0x2ab7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xdc(%rbp)
mov    0x2aa8(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xe0(%rbp),%edi
mov    -0xb8(%rbp),%rdx
mov    -0xdc(%rbp),%ecx
mov    %eax,%r8d
lea    0xb5c(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
jmp    1775 <process_dump+0x585>
mov    -0x20(%rbp),%edi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
call   1050 <write@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x50(%rbp),%rax
je     15c3 <process_dump+0x3d3>
mov    0x2a1f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe8(%rbp)
mov    0x2a40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe4(%rbp)
mov    0x2a31(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xe8(%rbp),%edi
mov    -0xe4(%rbp),%ecx
mov    -0xb8(%rbp),%rdx
mov    %eax,%r8d
lea    0xae5(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
mov    -0xb8(%rbp),%rdi
call   1040 <unlink@plt>
jmp    1775 <process_dump+0x585>
mov    -0x18(%rbp),%rdi
mov    0x2a0a(%rip),%rax
mov    (%rax),%esi
mov    0x29f1(%rip),%rax
or     (%rax),%esi
mov    $0x0,%al
call   10e0 <open@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%edi
call   10d0 <fsync@plt>
mov    %eax,-0xa8(%rbp)
cmpl   $0xffffffff,-0xa8(%rbp)
jne    1653 <process_dump+0x463>
mov    0x2983(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xf0(%rbp)
mov    0x29a4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xec(%rbp)
mov    0x2995(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xf0(%rbp),%edi
mov    -0xb8(%rbp),%rdx
mov    -0xec(%rbp),%ecx
mov    %eax,%r8d
lea    0xa74(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
jmp    1775 <process_dump+0x585>
mov    -0xc0(%rbp),%rsi
mov    -0xb8(%rbp),%rdi
call   10f0 <rename@plt>
mov    %eax,-0xa8(%rbp)
cmpl   $0xffffffff,-0xa8(%rbp)
jne    16d6 <process_dump+0x4e6>
mov    0x2908(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xf8(%rbp)
mov    0x2929(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xf4(%rbp)
mov    0x291a(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xf8(%rbp),%edi
mov    -0xb8(%rbp),%rdx
mov    -0xc0(%rbp),%rcx
mov    -0xf4(%rbp),%r8d
mov    %eax,%r9d
lea    0xa1b(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
jmp    1775 <process_dump+0x585>
mov    -0x24(%rbp),%edi
call   10d0 <fsync@plt>
mov    %eax,-0xa8(%rbp)
cmpl   $0xffffffff,-0xa8(%rbp)
jne    174c <process_dump+0x55c>
mov    0x2890(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    0x28a6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xfc(%rbp)
mov    0x2897(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0x10c(%rbp),%edi
mov    -0x108(%rbp),%rdx
mov    -0xfc(%rbp),%ecx
mov    %eax,%r8d
lea    0x9d1(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
mov    0x284d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
lea    0x9e3(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
movl   $0x0,-0x5c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
je     1787 <process_dump+0x597>
mov    -0x1c(%rbp),%edi
call   1070 <close@plt>
cmpl   $0xffffffff,-0x20(%rbp)
je     1799 <process_dump+0x5a9>
mov    -0x20(%rbp),%edi
call   1070 <close@plt>
cmpl   $0xffffffff,-0x24(%rbp)
je     17ab <process_dump+0x5bb>
mov    -0x24(%rbp),%edi
call   1070 <close@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0xac(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_dump>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%r12
mov    %rdi,%rcx
mov    0x2dda(%rip),%rax
mov    (%rax),%r14d
mov    %rsp,%r13
mov    %r14,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xdcb(%rip),%rdx
mov    %r13,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <snprintf@plt>
lea    -0x50(%rbp),%rsi
mov    %r13,%rdi
call   1090 <stat@plt>
mov    $0xffffffff,%r15d
cmp    $0xffffffff,%eax
je     160c <process_dump+0x41c>
mov    %r12,-0x38(%rbp)
mov    %rbx,-0x48(%rbp)
mov    -0x50(%rbp),%r12
mov    %r12,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x40(%rbp)
test   %rax,%rax
je     144b <process_dump+0x25b>
mov    0x2d53(%rip),%rax
mov    (%rax),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   10e0 <open@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     1467 <process_dump+0x277>
xor    %ebx,%ebx
mov    -0x40(%rbp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%r15,%rbx,1),%rsi
mov    %r12,%rdx
sub    %rbx,%rdx
mov    -0x2c(%rbp),%edi
call   1080 <read@plt>
cmp    $0xffffffffffffffff,%rax
je     14a8 <process_dump+0x2b8>
add    %rax,%rbx
cmp    %r12,%rbx
jne    12b0 <process_dump+0xc0>
mov    %r15,%rdi
lea    -0x90(%rbp),%r15
lea    -0x54(%rbp),%rcx
mov    %r12,%rsi
mov    %r15,%rdx
call   10a0 <dump_get_file_name@plt>
lea    0xd8c(%rip),%rdx
mov    %r13,%rdi
mov    %r14d,%esi
mov    -0x38(%rbp),%rbx
mov    %rbx,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1060 <snprintf@plt>
lea    0xd78(%rip),%rdx
mov    -0x48(%rbp),%rdi
mov    %r14d,%esi
mov    %rbx,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    %r15,%rdi
call   1100 <remove_dump_files@plt>
mov    0x2c5b(%rip),%rax
mov    0x2cbc(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2c79(%rip),%rax
or     (%rax),%esi
mov    0x2c58(%rip),%rax
mov    0x2c59(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %r13,%rdi
xor    %eax,%eax
call   10e0 <open@plt>
cmp    $0xffffffff,%eax
je     14cd <process_dump+0x2dd>
mov    %eax,%ebx
mov    %eax,%edi
mov    -0x40(%rbp),%rsi
mov    %r12,%rdx
call   1050 <write@plt>
cmp    %r12,%rax
jne    1516 <process_dump+0x326>
mov    0x2c3a(%rip),%rax
mov    (%rax),%esi
mov    0x2c41(%rip),%rax
or     (%rax),%esi
mov    -0x38(%rbp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   10e0 <open@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   10d0 <fsync@plt>
cmp    $0xffffffff,%eax
je     1565 <process_dump+0x375>
mov    %r12d,-0x30(%rbp)
mov    %r13,%rdi
mov    -0x48(%rbp),%r12
mov    %r12,%rsi
call   10f0 <rename@plt>
cmp    $0xffffffff,%eax
je     15a3 <process_dump+0x3b3>
mov    -0x30(%rbp),%r12d
mov    %r12d,%edi
call   10d0 <fsync@plt>
cmp    $0xffffffff,%eax
jne    1422 <process_dump+0x232>
mov    0x2b9a(%rip),%rax
mov    (%rax),%r14d
mov    0x2bc0(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1110 <strerror@plt>
lea    0xd0c(%rip),%rsi
mov    %r14d,%edi
mov    -0x38(%rbp),%rdx
mov    %r15d,%ecx
mov    -0x38(%rbp),%r14
mov    %eax,%r8d
xor    %eax,%eax
call   10c0 <syslog@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%edi
lea    0xd18(%rip),%rsi
xor    %r15d,%r15d
lea    -0x90(%rbp),%rcx
mov    %r14,%rdx
xor    %eax,%eax
call   10c0 <syslog@plt>
jmp    15e6 <process_dump+0x3f6>
mov    0x2b36(%rip),%rax
mov    (%rax),%edi
lea    0xbad(%rip),%rsi
xor    %eax,%eax
call   10c0 <syslog@plt>
jmp    160c <process_dump+0x41c>
mov    0x2b1a(%rip),%rax
mov    (%rax),%r14d
mov    0x2b40(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1110 <strerror@plt>
lea    0xba2(%rip),%rsi
mov    %r14d,%edi
mov    %r13,%rdx
mov    %r15d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10c0 <syslog@plt>
mov    $0xffffffff,%r15d
jmp    1603 <process_dump+0x413>
mov    0x2ad9(%rip),%rax
mov    (%rax),%r14d
mov    0x2aff(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1110 <strerror@plt>
lea    0xb8b(%rip),%rsi
jmp    14f0 <process_dump+0x300>
mov    0x2ab4(%rip),%rax
mov    (%rax),%r14d
mov    0x2ada(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1110 <strerror@plt>
lea    0xba0(%rip),%rsi
mov    %r14d,%edi
mov    %r13,%rdx
mov    %r15d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10c0 <syslog@plt>
mov    -0x2c(%rbp),%edi
call   1070 <close@plt>
mov    $0xffffffff,%r15d
jmp    1603 <process_dump+0x413>
mov    0x2a6b(%rip),%rax
mov    (%rax),%r14d
mov    0x2a91(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1110 <strerror@plt>
lea    0xb57(%rip),%rsi
mov    %r14d,%edi
mov    %r13,%rdx
mov    %r15d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10c0 <syslog@plt>
mov    %r13,%rdi
call   1040 <unlink@plt>
mov    $0xffffffff,%r12d
mov    $0xffffffff,%r15d
jmp    15e6 <process_dump+0x3f6>
mov    0x2a1c(%rip),%rax
mov    (%rax),%r14d
mov    0x2a42(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1110 <strerror@plt>
lea    0xb33(%rip),%rsi
mov    %r14d,%edi
mov    %r13,%rdx
mov    %r15d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10c0 <syslog@plt>
mov    $0xffffffff,%r15d
jmp    15e6 <process_dump+0x3f6>
mov    0x29de(%rip),%rax
mov    (%rax),%r14d
mov    0x2a04(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1110 <strerror@plt>
lea    0xb1f(%rip),%rsi
mov    %r14d,%edi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   10c0 <syslog@plt>
mov    $0xffffffff,%r15d
mov    -0x30(%rbp),%r12d
mov    -0x2c(%rbp),%edi
call   1070 <close@plt>
mov    %ebx,%edi
call   1070 <close@plt>
cmp    $0xffffffff,%r12d
je     1603 <process_dump+0x413>
mov    %r12d,%edi
call   1070 <close@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@PATH_MAX = global i32 0
@.str = [8 x i8] c"%s/dump\00"
@LOG_ERR = global i32 0
@.str.1 = [36 x i8] c"Failed to allocate memory for dump\0A\00"
@O_RDONLY = global i32 0
@.str.2 = [42 x i8] c"Failed to open platform dump: %s (%d:%s)\0A\00"
@errno = global i32 0
@.str.3 = [42 x i8] c"Failed to read platform dump: %s (%d:%s)\0A\00"
@.str.4 = [10 x i8] c"%s/%s.tmp\00"
@.str.5 = [6 x i8] c"%s/%s\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_EXCL = global i32 0
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@.str.6 = [43 x i8] c"Failed to write platform dump: %s (%d:%s)\0A\00"
@O_DIRECTORY = global i32 0
@.str.7 = [42 x i8] c"Failed to sync platform dump: %s (%d:%s)\0A\00"
@.str.8 = [49 x i8] c"Failed to rename platform dump %s to %s(%d: %s)\0A\00"
@.str.9 = [52 x i8] c"Failed to sync platform dump directory: %s (%d:%s)\0A\00"
@LOG_NOTICE = global i32 0
@.str.10 = [42 x i8] c"New platform dump available. File: %s/%s\0A\00"
define i32 @process_dump(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca %struct.stat
%15 = alloca i32
%16 = alloca i64
%17 = alloca i64
%18 = alloca [48 x i8]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 -1, i32* %6
store i32 -1, i32* %7
store i32 -1, i32* %8
%22 = load i32, i32* @PATH_MAX
%23 = zext i32 %22 to i64
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %9
%25 = alloca i8, i64 %23
store i64 %23, i64* %10
%26 = load i32, i32* @PATH_MAX
%27 = zext i32 %26 to i64
%28 = alloca i8, i64 %27
store i64 %27, i64* %11
store i32 -1, i32* %15
store i64 0, i64* %16
store i64 0, i64* %17
%29 = trunc i64 %23 to i32
%30 = load i8*, i8** %4
%31 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %25, i32 %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = call i32 @stat(i8* %25, %struct.stat* %14)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %35
34: ; preds = %2
store i32 -1, i32* %3
store i32 1, i32* %21
br label %195
35: ; preds = %2
%36 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%37 = load i64, i64* %36
store i64 %37, i64* %13
%38 = load i64, i64* %13
%39 = call i64 @malloc(i64 %38)
%40 = inttoptr i64 %39 to i8*
store i8* %40, i8** %12
%41 = load i8*, i8** %12
%42 = icmp ne i8* %41, null
br i1 %42, label %46, label %43
43: ; preds = %35
%44 = load i32, i32* @LOG_ERR
%45 = call i32 (i32, i8*, ...) @syslog(i32 %44, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
store i32 1, i32* %21
br label %195
46: ; preds = %35
%47 = load i32, i32* @O_RDONLY
%48 = call i32 (i8*, i32, ...) @open(i8* %25, i32 %47)
store i32 %48, i32* %6
%49 = load i32, i32* %6
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %57
51: ; preds = %46
%52 = load i32, i32* @LOG_ERR
%53 = load i32, i32* @errno
%54 = load i32, i32* @errno
%55 = call i32 @strerror(i32 %54)
%56 = call i32 (i32, i8*, ...) @syslog(i32 %52, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %25, i32 %53, i32 %55)
br label %173
57: ; preds = %46
br label %58
58: ; preds = %79, %57
%59 = load i32, i32* %6
%60 = load i8*, i8** %12
%61 = load i64, i64* %16
%62 = getelementptr inbounds i8, i8* %60, i64 %61
%63 = load i64, i64* %13
%64 = load i64, i64* %16
%65 = sub i64 %63, %64
%66 = call i64 @read(i32 %59, i8* %62, i64 %65)
store i64 %66, i64* %17
%67 = load i64, i64* %17
%68 = icmp eq i64 %67, -1
br i1 %68, label %69, label %75
69: ; preds = %58
%70 = load i32, i32* @LOG_ERR
%71 = load i32, i32* @errno
%72 = load i32, i32* @errno
%73 = call i32 @strerror(i32 %72)
%74 = call i32 (i32, i8*, ...) @syslog(i32 %70, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %25, i32 %71, i32 %73)
br label %173
75: ; preds = %58
%76 = load i64, i64* %17
%77 = load i64, i64* %16
%78 = add i64 %77, %76
store i64 %78, i64* %16
br label %79
79: ; preds = %75
%80 = load i64, i64* %16
%81 = load i64, i64* %13
%82 = icmp ne i64 %80, %81
br i1 %82, label %58, label %83
83: ; preds = %79
%84 = load i8*, i8** %12
%85 = load i64, i64* %13
%86 = getelementptr inbounds [48 x i8], [48 x i8]* %18, i64 0, i64 0
%87 = call i32 @dump_get_file_name(i8* %84, i64 %85, i8* %86, i32* %19)
%88 = trunc i64 %23 to i32
%89 = load i8*, i8** %5
%90 = getelementptr inbounds [48 x i8], [48 x i8]* %18, i64 0, i64 0
%91 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %25, i32 %88, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %89, i8* %90)
%92 = trunc i64 %23 to i32
%93 = load i8*, i8** %5
%94 = getelementptr inbounds [48 x i8], [48 x i8]* %18, i64 0, i64 0
%95 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %28, i32 %92, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %93, i8* %94)
%96 = getelementptr inbounds [48 x i8], [48 x i8]* %18, i64 0, i64 0
%97 = call i32 @remove_dump_files(i8* %96)
%98 = load i32, i32* @O_WRONLY
%99 = load i32, i32* @O_CREAT
%100 = or i32 %98, %99
%101 = load i32, i32* @O_EXCL
%102 = or i32 %100, %101
%103 = load i32, i32* @S_IRUSR
%104 = load i32, i32* @S_IRGRP
%105 = or i32 %103, %104
%106 = call i32 (i8*, i32, ...) @open(i8* %25, i32 %102, i32 %105)
store i32 %106, i32* %7
%107 = load i32, i32* %7
%108 = icmp eq i32 %107, -1
br i1 %108, label %109, label %115
109: ; preds = %83
%110 = load i32, i32* @LOG_ERR
%111 = load i32, i32* @errno
%112 = load i32, i32* @errno
%113 = call i32 @strerror(i32 %112)
%114 = call i32 (i32, i8*, ...) @syslog(i32 %110, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %25, i32 %111, i32 %113)
br label %173
115: ; preds = %83
%116 = load i32, i32* %7
%117 = load i8*, i8** %12
%118 = load i64, i64* %13
%119 = call i64 @write(i32 %116, i8* %117, i64 %118)
store i64 %119, i64* %16
%120 = load i64, i64* %16
%121 = load i64, i64* %13
%122 = icmp ne i64 %120, %121
br i1 %122, label %123, label %130
123: ; preds = %115
%124 = load i32, i32* @LOG_ERR
%125 = load i32, i32* @errno
%126 = load i32, i32* @errno
%127 = call i32 @strerror(i32 %126)
%128 = call i32 (i32, i8*, ...) @syslog(i32 %124, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %25, i32 %125, i32 %127)
%129 = call i32 @unlink(i8* %25)
br label %173
130: ; preds = %115
%131 = load i8*, i8** %5
%132 = load i32, i32* @O_RDONLY
%133 = load i32, i32* @O_DIRECTORY
%134 = or i32 %132, %133
%135 = call i32 (i8*, i32, ...) @open(i8* %131, i32 %134)
store i32 %135, i32* %8
%136 = load i32, i32* %7
%137 = call i32 @fsync(i32 %136)
store i32 %137, i32* %20
%138 = load i32, i32* %20
%139 = icmp eq i32 %138, -1
br i1 %139, label %140, label %146
140: ; preds = %130
%141 = load i32, i32* @LOG_ERR
%142 = load i32, i32* @errno
%143 = load i32, i32* @errno
%144 = call i32 @strerror(i32 %143)
%145 = call i32 (i32, i8*, ...) @syslog(i32 %141, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), i8* %25, i32 %142, i32 %144)
br label %173
146: ; preds = %130
%147 = call i32 @rename(i8* %25, i8* %28)
store i32 %147, i32* %20
%148 = load i32, i32* %20
%149 = icmp eq i32 %148, -1
br i1 %149, label %150, label %156
150: ; preds = %146
%151 = load i32, i32* @LOG_ERR
%152 = load i32, i32* @errno
%153 = load i32, i32* @errno
%154 = call i32 @strerror(i32 %153)
%155 = call i32 (i32, i8*, ...) @syslog(i32 %151, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i8* %25, i8* %28, i32 %152, i32 %154)
br label %173
156: ; preds = %146
%157 = load i32, i32* %8
%158 = call i32 @fsync(i32 %157)
store i32 %158, i32* %20
%159 = load i32, i32* %20
%160 = icmp eq i32 %159, -1
br i1 %160, label %161, label %168
161: ; preds = %156
%162 = load i32, i32* @LOG_ERR
%163 = load i8*, i8** %5
%164 = load i32, i32* @errno
%165 = load i32, i32* @errno
%166 = call i32 @strerror(i32 %165)
%167 = call i32 (i32, i8*, ...) @syslog(i32 %162, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i8* %163, i32 %164, i32 %166)
br label %168
168: ; preds = %161, %156
%169 = load i32, i32* @LOG_NOTICE
%170 = load i8*, i8** %5
%171 = getelementptr inbounds [48 x i8], [48 x i8]* %18, i64 0, i64 0
%172 = call i32 (i32, i8*, ...) @syslog(i32 %169, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i8* %170, i8* %171)
store i32 0, i32* %15
br label %173
173: ; preds = %168, %150, %140, %123, %109, %69, %51
%174 = load i32, i32* %6
%175 = icmp ne i32 %174, -1
br i1 %175, label %176, label %179
176: ; preds = %173
%177 = load i32, i32* %6
%178 = call i32 @close(i32 %177)
br label %179
179: ; preds = %176, %173
%180 = load i32, i32* %7
%181 = icmp ne i32 %180, -1
br i1 %181, label %182, label %185
182: ; preds = %179
%183 = load i32, i32* %7
%184 = call i32 @close(i32 %183)
br label %185
185: ; preds = %182, %179
%186 = load i32, i32* %8
%187 = icmp ne i32 %186, -1
br i1 %187, label %188, label %191
188: ; preds = %185
%189 = load i32, i32* %8
%190 = call i32 @close(i32 %189)
br label %191
191: ; preds = %188, %185
%192 = load i8*, i8** %12
%193 = call i32 @free(i8* %192)
%194 = load i32, i32* %15
store i32 %194, i32* %3
store i32 1, i32* %21
br label %195
195: ; preds = %191, %43, %34
%196 = load i8*, i8** %9
%197 = load i32, i32* %3
ret i32 %197
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@PATH_MAX = global i32 0
@.str = [8 x i8] c"%s/dump\00"
@LOG_ERR = global i32 0
@.str.1 = [36 x i8] c"Failed to allocate memory for dump\0A\00"
@O_RDONLY = global i32 0
@.str.2 = [42 x i8] c"Failed to open platform dump: %s (%d:%s)\0A\00"
@errno = global i32 0
@.str.3 = [42 x i8] c"Failed to read platform dump: %s (%d:%s)\0A\00"
@.str.4 = [10 x i8] c"%s/%s.tmp\00"
@.str.5 = [6 x i8] c"%s/%s\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_EXCL = global i32 0
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@.str.6 = [43 x i8] c"Failed to write platform dump: %s (%d:%s)\0A\00"
@O_DIRECTORY = global i32 0
@.str.7 = [42 x i8] c"Failed to sync platform dump: %s (%d:%s)\0A\00"
@.str.8 = [49 x i8] c"Failed to rename platform dump %s to %s(%d: %s)\0A\00"
@.str.9 = [52 x i8] c"Failed to sync platform dump directory: %s (%d:%s)\0A\00"
@LOG_NOTICE = global i32 0
@.str.10 = [42 x i8] c"New platform dump available. File: %s/%s\0A\00"
define i32 @process_dump(i8* %0, i8* %1) {
%3 = alloca %struct.stat
%4 = alloca [48 x i8]
%5 = alloca i32
%6 = load i32, i32* @PATH_MAX
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = alloca i8, i64 %7
%10 = bitcast %struct.stat* %3 to i8*
%11 = getelementptr inbounds [48 x i8], [48 x i8]* %4, i64 0, i64 0
%12 = bitcast i32* %5 to i8*
%13 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %8, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%14 = call i32 @stat(i8* %8, %struct.stat* %3)
%15 = icmp eq i32 %14, -1
br i1 %15, label %121, label %16
16: ; preds = %2
%17 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%18 = load i64, i64* %17
%19 = call i64 @malloc(i64 %18)
%20 = inttoptr i64 %19 to i8*
%21 = icmp eq i64 %19, 0
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i32, i32* @LOG_ERR
%24 = call i32 (i32, i8*, ...) @syslog(i32 %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %121
25: ; preds = %16
%26 = load i32, i32* @O_RDONLY
%27 = call i32 (i8*, i32, ...) @open(i8* %8, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32, i32* @LOG_ERR
%31 = load i32, i32* @errno
%32 = call i32 @strerror(i32 %31)
%33 = call i32 (i32, i8*, ...) @syslog(i32 %30, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %8, i32 %31, i32 %32)
br label %118
34: ; preds = %25, %45
%35 = phi i64 [ %46, %45 ], [ 0, %25 ]
%36 = getelementptr inbounds i8, i8* %20, i64 %35
%37 = sub i64 %18, %35
%38 = call i64 @read(i32 %27, i8* %36, i64 %37)
%39 = icmp eq i64 %38, -1
br i1 %39, label %40, label %45
40: ; preds = %34
%41 = load i32, i32* @LOG_ERR
%42 = load i32, i32* @errno
%43 = call i32 @strerror(i32 %42)
%44 = call i32 (i32, i8*, ...) @syslog(i32 %41, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %8, i32 %42, i32 %43)
br label %108
45: ; preds = %34
%46 = add i64 %38, %35
%47 = icmp eq i64 %46, %18
br i1 %47, label %48, label %34
48: ; preds = %45
%49 = call i32 @dump_get_file_name(i8* %20, i64 %18, i8* %11, i32* %5)
%50 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %8, i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %1, i8* %11)
%51 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %9, i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %1, i8* %11)
%52 = call i32 @remove_dump_files(i8* %11)
%53 = load i32, i32* @O_WRONLY
%54 = load i32, i32* @O_CREAT
%55 = or i32 %54, %53
%56 = load i32, i32* @O_EXCL
%57 = or i32 %55, %56
%58 = load i32, i32* @S_IRUSR
%59 = load i32, i32* @S_IRGRP
%60 = or i32 %59, %58
%61 = call i32 (i8*, i32, ...) @open(i8* %8, i32 %57, i32 %60)
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %68
63: ; preds = %48
%64 = load i32, i32* @LOG_ERR
%65 = load i32, i32* @errno
%66 = call i32 @strerror(i32 %65)
%67 = call i32 (i32, i8*, ...) @syslog(i32 %64, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %8, i32 %65, i32 %66)
br label %108
68: ; preds = %48
%69 = call i64 @write(i32 %61, i8* %20, i64 %18)
%70 = icmp eq i64 %69, %18
br i1 %70, label %77, label %71
71: ; preds = %68
%72 = load i32, i32* @LOG_ERR
%73 = load i32, i32* @errno
%74 = call i32 @strerror(i32 %73)
%75 = call i32 (i32, i8*, ...) @syslog(i32 %72, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %8, i32 %73, i32 %74)
%76 = call i32 @unlink(i8* %8)
br label %110
77: ; preds = %68
%78 = load i32, i32* @O_RDONLY
%79 = load i32, i32* @O_DIRECTORY
%80 = or i32 %79, %78
%81 = call i32 (i8*, i32, ...) @open(i8* %1, i32 %80)
%82 = call i32 @fsync(i32 %61)
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %89
84: ; preds = %77
%85 = load i32, i32* @LOG_ERR
%86 = load i32, i32* @errno
%87 = call i32 @strerror(i32 %86)
%88 = call i32 (i32, i8*, ...) @syslog(i32 %85, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), i8* %8, i32 %86, i32 %87)
br label %110
89: ; preds = %77
%90 = call i32 @rename(i8* %8, i8* %9)
%91 = icmp eq i32 %90, -1
br i1 %91, label %92, label %97
92: ; preds = %89
%93 = load i32, i32* @LOG_ERR
%94 = load i32, i32* @errno
%95 = call i32 @strerror(i32 %94)
%96 = call i32 (i32, i8*, ...) @syslog(i32 %93, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i8* %8, i8* %9, i32 %94, i32 %95)
br label %110
97: ; preds = %89
%98 = call i32 @fsync(i32 %81)
%99 = icmp eq i32 %98, -1
br i1 %99, label %100, label %105
100: ; preds = %97
%101 = load i32, i32* @LOG_ERR
%102 = load i32, i32* @errno
%103 = call i32 @strerror(i32 %102)
%104 = call i32 (i32, i8*, ...) @syslog(i32 %101, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i8* %1, i32 %102, i32 %103)
br label %105
105: ; preds = %100, %97
%106 = load i32, i32* @LOG_NOTICE
%107 = call i32 (i32, i8*, ...) @syslog(i32 %106, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i8* %1, i8* %11)
br label %110
108: ; preds = %40, %63
%109 = call i32 @close(i32 %27)
br label %118
110: ; preds = %105, %92, %84, %71
%111 = phi i32 [ %81, %105 ], [ %81, %92 ], [ %81, %84 ], [ -1, %71 ]
%112 = phi i32 [ 0, %105 ], [ -1, %92 ], [ -1, %84 ], [ -1, %71 ]
%113 = call i32 @close(i32 %27)
%114 = call i32 @close(i32 %61)
%115 = icmp eq i32 %111, -1
br i1 %115, label %118, label %116
116: ; preds = %110
%117 = call i32 @close(i32 %111)
br label %118
118: ; preds = %108, %29, %116, %110
%119 = phi i32 [ -1, %29 ], [ %112, %116 ], [ %112, %110 ], [ -1, %108 ]
%120 = call i32 @free(i8* %20)
br label %121
121: ; preds = %2, %118, %22
%122 = phi i32 [ %119, %118 ], [ -1, %22 ], [ -1, %2 ]
ret i32 %122
}