#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*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WEXITSTATUS(int);
int /*<<< orphan*/ WIFEXITED(int);
int chmod(char *, int);
int /*<<< orphan*/ close(int);
int dumpable_server();
int dup2(int, int);
int /*<<< orphan*/ errno;
int execl(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fork();
int get_dumpable_from_pipes(int, int);
scalar_t__ getenv(char *);
int pipe(int *);
int setenv(char *, char *, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, ...);
int /*<<< orphan*/ test_waitsig();
int /*<<< orphan*/ wait(int *);
int main(int argc, char **argv) {
  int pipe_input[2];
  int pipe_output[2];
  int save_dumpable;
  int dumpable;
  int ret;
  pid_t pid;
  pid_t waited;
  int status;
  if (getenv("DUMPABLE_SERVER"))
    return dumpable_server();
  ret = chmod(argv[0], 0111);
  if (ret < 0) {
    test_msg("ERR: %s:%d: "
             "error chmodding %s"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             89, argv[0], errno, strerror(errno));
    return 1;
  }
  test_init(argc, argv);
  ret = pipe(pipe_input);
  if (ret < 0) {
    test_msg("ERR: %s:%d: "
             "error creating input pipe"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             97, errno, strerror(errno));
    return 1;
  }
  ret = pipe(pipe_output);
  if (ret < 0) {
    test_msg("ERR: %s:%d: "
             "error creating output pipe"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             103, errno, strerror(errno));
    return 1;
  }
  pid = fork();
  if (pid < 0) {
    test_msg("ERR: %s:%d: "
             "error forking the dumpable server"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             109, errno, strerror(errno));
    return 1;
  }
  if (pid == 0) {
    close(0);
    close(1);
    ret = dup2(pipe_input[0], 0);
    if (ret < 0) {
      test_msg("ERR: %s:%d: "
               "could not dup2 pipe into child's stdin"
               " (errno = %d (%s))\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/"
               "test/zdtm/live/static/dumpable02.c",
               124, errno, strerror(errno));
      return 1;
    }
    ret = dup2(pipe_output[1], 1);
    if (ret < 0) {
      test_msg("ERR: %s:%d: "
               "could not dup2 pipe into child's stdout"
               " (errno = %d (%s))\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/"
               "test/zdtm/live/static/dumpable02.c",
               130, errno, strerror(errno));
      return 1;
    }
    close(pipe_output[0]);
    close(pipe_output[1]);
    close(pipe_input[0]);
    close(pipe_input[1]);
    ret = setenv("DUMPABLE_SERVER", "yes", 1);
    if (ret < 0) {
      test_msg("ERR: %s:%d: "
               "could not set the DUMPABLE_SERVER env variable"
               " (errno = %d (%s))\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/"
               "test/zdtm/live/static/dumpable02.c",
               141, errno, strerror(errno));
      return 1;
    }
    ret = execl(argv[0], "dumpable_server", NULL);
    test_msg("ERR: %s:%d: "
             "could not execv %s as a dumpable_server"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             146, argv[0], errno, strerror(errno));
    return 1;
  }
  close(pipe_input[0]);
  close(pipe_output[1]);
  save_dumpable = get_dumpable_from_pipes(pipe_input[1], pipe_output[0]);
  if (save_dumpable < 0)
    return 1;
  test_daemon();
  test_waitsig();
  dumpable = get_dumpable_from_pipes(pipe_input[1], pipe_output[0]);
  if (dumpable < 0)
    return 1;
  if (dumpable != save_dumpable) {
    errno = 0;
    test_msg("FAIL: %s:%d: "
             "dumpable flag was not preserved over migration"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             175, errno, strerror(errno));
    return 1;
  }
  close(pipe_input[1]);
  close(pipe_output[0]);
  waited = wait(&status);
  if (waited < 0) {
    test_msg("ERR: %s:%d: "
             "error calling wait on the child"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             185, errno, strerror(errno));
    return 1;
  }
  errno = 0;
  if (waited != pid) {
    test_msg("ERR: %s:%d: "
             "waited pid %d did not match child pid %d"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             190, waited, pid, errno, strerror(errno));
    return 1;
  }
  if (!WIFEXITED(status)) {
    test_msg("ERR: %s:%d: "
             "child dumpable server returned abnormally with status=%d"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             195, status, errno, strerror(errno));
    return 1;
  }
  if (WEXITSTATUS(status) != 0) {
    test_msg("ERR: %s:%d: "
             "child dumpable server returned rc=%d"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/dumpable02.c",
             200, WEXITSTATUS(status), errno, strerror(errno));
    return 1;
  }
  test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xdc0(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     125e <main+0x3e>
mov    $0x0,%al
call   1120 <dumpable_server@plt>
mov    %eax,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x49,%esi
call   10d0 <chmod@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    12d2 <main+0xb2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    0x2d52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x48(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    %eax,%r9d
lea    0xd5d(%rip),%rdi
lea    0xd88(%rip),%rsi
mov    $0x59,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <test_init@plt>
lea    -0x18(%rbp),%rdi
call   1090 <pipe@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    133a <main+0x11a>
mov    0x2ce5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x4c(%rbp),%ecx
mov    %eax,%r8d
lea    0xdc1(%rip),%rdi
lea    0xd20(%rip),%rsi
mov    $0x61,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
lea    -0x20(%rbp),%rdi
call   1090 <pipe@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1396 <main+0x176>
mov    0x2c89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2c7d(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x50(%rbp),%ecx
mov    %eax,%r8d
lea    0xd9e(%rip),%rdi
lea    0xcc4(%rip),%rsi
mov    $0x67,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    $0x0,%al
call   1140 <fork@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    13f0 <main+0x1d0>
mov    0x2c2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x54(%rbp),%ecx
mov    %eax,%r8d
lea    0xd7e(%rip),%rdi
lea    0xc6a(%rip),%rsi
mov    $0x6d,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
cmpl   $0x0,-0x30(%rbp)
jne    15c3 <main+0x3a3>
xor    %edi,%edi
call   1080 <close@plt>
mov    $0x1,%edi
call   1080 <close@plt>
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   1060 <dup2@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1468 <main+0x248>
mov    0x2bb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x58(%rbp),%ecx
mov    %eax,%r8d
lea    0xd47(%rip),%rdi
lea    0xbf2(%rip),%rsi
mov    $0x7c,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1060 <dup2@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    14c8 <main+0x2a8>
mov    0x2b57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2b4b(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x5c(%rbp),%ecx
mov    %eax,%r8d
lea    0xd2d(%rip),%rdi
lea    0xb92(%rip),%rsi
mov    $0x82,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x20(%rbp),%edi
call   1080 <close@plt>
mov    -0x1c(%rbp),%edi
call   1080 <close@plt>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
lea    0xb11(%rip),%rdi
lea    0xd27(%rip),%rsi
mov    $0x1,%edx
call   1050 <setenv@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1553 <main+0x333>
mov    0x2acc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2ac0(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x60(%rbp),%ecx
mov    %eax,%r8d
lea    0xced(%rip),%rdi
lea    0xb07(%rip),%rsi
mov    $0x8d,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd0e(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1110 <execl@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
mov    0x2a61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    0x2a55(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x70(%rbp),%rcx
mov    -0x64(%rbp),%r8d
mov    %eax,%r9d
lea    0xcdb(%rip),%rdi
lea    0xa97(%rip),%rsi
mov    $0x92,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
mov    -0x1c(%rbp),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%esi
call   10c0 <get_dumpable_from_pipes@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    15f7 <main+0x3d7>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    $0x0,%al
call   1070 <test_daemon@plt>
mov    $0x0,%al
call   10b0 <test_waitsig@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%esi
call   10c0 <get_dumpable_from_pipes@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jge    1629 <main+0x409>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1688 <main+0x468>
mov    0x29a4(%rip),%rax
movl   $0x0,(%rax)
mov    0x2997(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    0x298b(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x74(%rbp),%ecx
mov    %eax,%r8d
lea    0xc5d(%rip),%rdi
lea    0x9d2(%rip),%rsi
mov    $0xaf,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
mov    -0x20(%rbp),%edi
call   1080 <close@plt>
lea    -0x38(%rbp),%rdi
call   1130 <wait@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    16f4 <main+0x4d4>
mov    0x292b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x78(%rbp)
mov    0x291f(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x78(%rbp),%ecx
mov    %eax,%r8d
lea    0xc40(%rip),%rdi
lea    0x966(%rip),%rsi
mov    $0xb9,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    0x28e5(%rip),%rax
movl   $0x0,(%rax)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
je     176d <main+0x54d>
mov    -0x34(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    0x28bd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    0x28b1(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x84(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
lea    0xc09(%rip),%rdi
lea    0x8f0(%rip),%rsi
mov    $0xbe,%edx
mov    %eax,(%rsp)
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x38(%rbp),%edi
call   10f0 <WIFEXITED@plt>
cmp    $0x0,%eax
jne    17da <main+0x5ba>
mov    -0x38(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    0x2852(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x88(%rbp)
mov    0x2843(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x8c(%rbp),%ecx
mov    -0x88(%rbp),%r8d
mov    %eax,%r9d
lea    0xbe1(%rip),%rdi
lea    0x880(%rip),%rsi
mov    $0xc3,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
mov    -0x38(%rbp),%edi
call   10e0 <WEXITSTATUS@plt>
cmp    $0x0,%eax
je     184c <main+0x62c>
mov    -0x38(%rbp),%edi
call   10e0 <WEXITSTATUS@plt>
mov    %eax,-0x94(%rbp)
mov    0x27e0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x90(%rbp)
mov    0x27d1(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x94(%rbp),%ecx
mov    -0x90(%rbp),%r8d
mov    %eax,%r9d
lea    0xbc7(%rip),%rdi
lea    0x80e(%rip),%rsi
mov    $0xc8,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x1,-0x4(%rbp)
jmp    1861 <main+0x641>
lea    0xbe5(%rip),%rdi
mov    $0x0,%al
call   10a0 <test_msg@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xdca(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1251 <main+0x31>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1120 <dumpable_server@plt>
mov    (%rbx),%rdi
mov    $0x49,%esi
call   10d0 <chmod@plt>
test   %eax,%eax
js     139a <main+0x17a>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <test_init@plt>
lea    0x20(%rsp),%rdi
call   1090 <pipe@plt>
test   %eax,%eax
js     13d2 <main+0x1b2>
lea    0x18(%rsp),%rdi
call   1090 <pipe@plt>
test   %eax,%eax
js     13f7 <main+0x1d7>
xor    %eax,%eax
call   1140 <fork@plt>
test   %eax,%eax
js     141c <main+0x1fc>
je     145d <main+0x23d>
mov    %eax,%r14d
mov    0x20(%rsp),%edi
call   1080 <close@plt>
mov    0x1c(%rsp),%edi
call   1080 <close@plt>
mov    0x24(%rsp),%edi
mov    0x18(%rsp),%esi
call   10c0 <get_dumpable_from_pipes@plt>
mov    $0x1,%ebp
test   %eax,%eax
js     1450 <main+0x230>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <test_daemon@plt>
xor    %eax,%eax
call   10b0 <test_waitsig@plt>
mov    0x24(%rsp),%edi
mov    0x18(%rsp),%esi
call   10c0 <get_dumpable_from_pipes@plt>
test   %eax,%eax
js     1450 <main+0x230>
cmp    %ebx,%eax
jne    155e <main+0x33e>
mov    0x24(%rsp),%edi
call   1080 <close@plt>
mov    0x18(%rsp),%edi
call   1080 <close@plt>
lea    0x14(%rsp),%rdi
call   1130 <wait@plt>
test   %eax,%eax
js     15d3 <main+0x3b3>
mov    %eax,%ebx
mov    0x2cae(%rip),%r15
movl   $0x0,(%r15)
cmp    %r14d,%eax
jne    1607 <main+0x3e7>
mov    0x14(%rsp),%edi
call   10f0 <WIFEXITED@plt>
mov    0x14(%rsp),%ebx
test   %eax,%eax
je     162e <main+0x40e>
mov    %ebx,%edi
call   10e0 <WEXITSTATUS@plt>
test   %eax,%eax
je     1660 <main+0x440>
mov    0x14(%rsp),%edi
call   10e0 <WEXITSTATUS@plt>
mov    %eax,%r14d
mov    (%r15),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0x1071(%rip),%rdi
lea    0xcb8(%rip),%rsi
mov    $0xc8,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
jmp    1651 <main+0x431>
mov    (%rbx),%rbx
mov    0x2c3c(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1100 <strerror@plt>
lea    0xc5c(%rip),%rdi
lea    0xc87(%rip),%rsi
mov    $0x59,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   10a0 <test_msg@plt>
jmp    144b <main+0x22b>
mov    0x2c07(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xcf3(%rip),%rdi
lea    0xc52(%rip),%rsi
mov    $0x61,%edx
jmp    143f <main+0x21f>
mov    0x2be2(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xd07(%rip),%rdi
lea    0xc2d(%rip),%rsi
mov    $0x67,%edx
jmp    143f <main+0x21f>
mov    0x2bbd(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xd1c(%rip),%rdi
lea    0xc08(%rip),%rsi
mov    $0x6d,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10a0 <test_msg@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   1080 <close@plt>
mov    $0x1,%ebp
mov    $0x1,%edi
call   1080 <close@plt>
mov    0x20(%rsp),%edi
xor    %esi,%esi
call   1060 <dup2@plt>
test   %eax,%eax
js     1536 <main+0x316>
mov    0x1c(%rsp),%edi
mov    $0x1,%ebp
mov    $0x1,%esi
call   1060 <dup2@plt>
test   %eax,%eax
js     1589 <main+0x369>
mov    0x18(%rsp),%edi
call   1080 <close@plt>
mov    0x1c(%rsp),%edi
call   1080 <close@plt>
mov    0x20(%rsp),%edi
call   1080 <close@plt>
mov    0x24(%rsp),%edi
call   1080 <close@plt>
lea    0xb34(%rip),%rdi
lea    0xd4a(%rip),%rsi
mov    $0x1,%ebp
mov    $0x1,%edx
call   1050 <setenv@plt>
test   %eax,%eax
js     15ae <main+0x38e>
mov    (%rbx),%rdi
lea    0xd7b(%rip),%rsi
xor    %edx,%edx
call   1110 <execl@plt>
mov    (%rbx),%r14
mov    0x2adb(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xd6a(%rip),%rdi
lea    0xb26(%rip),%rsi
mov    $0x92,%edx
mov    %r14,%rcx
mov    %ebx,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   10a0 <test_msg@plt>
jmp    1450 <main+0x230>
mov    0x2aa3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xc43(%rip),%rdi
lea    0xaee(%rip),%rsi
mov    $0x7c,%edx
jmp    15f6 <main+0x3d6>
mov    0x2a7b(%rip),%rax
movl   $0x0,(%rax)
xor    %edi,%edi
call   1100 <strerror@plt>
lea    0xd4d(%rip),%rdi
lea    0xac2(%rip),%rsi
mov    $0xaf,%edx
xor    %ecx,%ecx
jmp    15f8 <main+0x3d8>
mov    0x2a50(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xc36(%rip),%rdi
lea    0xa9b(%rip),%rsi
mov    $0x82,%edx
jmp    15f6 <main+0x3d6>
mov    0x2a2b(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xc5c(%rip),%rdi
lea    0xa76(%rip),%rsi
mov    $0x8d,%edx
jmp    15f6 <main+0x3d6>
mov    0x2a06(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1100 <strerror@plt>
lea    0xd2b(%rip),%rdi
lea    0xa51(%rip),%rsi
mov    $0xb9,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10a0 <test_msg@plt>
jmp    1450 <main+0x230>
xor    %edi,%edi
call   1100 <strerror@plt>
mov    %eax,(%rsp)
lea    0xd3c(%rip),%rdi
lea    0xa23(%rip),%rsi
mov    $0xbe,%edx
mov    %ebx,%ecx
mov    %r14d,%r8d
xor    %r9d,%r9d
jmp    1654 <main+0x434>
mov    (%r15),%r14d
mov    %r14d,%edi
call   1100 <strerror@plt>
lea    0xd5c(%rip),%rdi
lea    0x9fb(%rip),%rsi
mov    $0xc3,%edx
mov    %ebx,%ecx
mov    %r14d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   10a0 <test_msg@plt>
jmp    1450 <main+0x230>
lea    0xdd1(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   10a0 <test_msg@plt>
jmp    1450 <main+0x230>

LLVM IR (-O0):
@.str = [16 x i8] c"DUMPABLE_SERVER\00"
@.str.1 = [50 x i8] c"ERR: %s:%d: error chmodding %s (errno = %d (%s))\0A\00"
@.str.2 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/dumpable02.c\00"
@errno = global i32 0
@.str.3 = [57 x i8] c"ERR: %s:%d: error creating input pipe (errno = %d (%s))\0A\00"
@.str.4 = [58 x i8] c"ERR: %s:%d: error creating output pipe (errno = %d (%s))\0A\00"
@.str.5 = [65 x i8] c"ERR: %s:%d: error forking the dumpable server (errno = %d (%s))\0A\00"
@.str.6 = [70 x i8] c"ERR: %s:%d: could not dup2 pipe into child's stdin (errno = %d (%s))\0A\00"
@.str.7 = [71 x i8] c"ERR: %s:%d: could not dup2 pipe into child's stdout (errno = %d (%s))\0A\00"
@.str.8 = [4 x i8] c"yes\00"
@.str.9 = [78 x i8] c"ERR: %s:%d: could not set the DUMPABLE_SERVER env variable (errno = %d (%s))\0A\00"
@.str.10 = [16 x i8] c"dumpable_server\00"
@.str.11 = [71 x i8] c"ERR: %s:%d: could not execv %s as a dumpable_server (errno = %d (%s))\0A\00"
@.str.12 = [79 x i8] c"FAIL: %s:%d: dumpable flag was not preserved over migration (errno = %d (%s))\0A\00"
@.str.13 = [63 x i8] c"ERR: %s:%d: error calling wait on the child (errno = %d (%s))\0A\00"
@.str.14 = [72 x i8] c"ERR: %s:%d: waited pid %d did not match child pid %d (errno = %d (%s))\0A\00"
@.str.15 = [88 x i8] c"ERR: %s:%d: child dumpable server returned abnormally with status=%d (errno = %d (%s))\0A\00"
@.str.16 = [68 x i8] c"ERR: %s:%d: child dumpable server returned rc=%d (errno = %d (%s))\0A\00"
@.str.17 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i64 @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (...) @dumpable_server()
store i32 %17, i32* %3
br label %209
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @chmod(i8* %21, i32 73)
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %18
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = load i32, i32* @errno
%30 = load i32, i32* @errno
%31 = call i32 @strerror(i32 %30)
%32 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 89, i8* %28, i32 %29, i32 %31)
store i32 1, i32* %3
br label %209
33: ; preds = %18
%34 = load i32, i32* %4
%35 = load i8**, i8*** %5
%36 = call i32 @test_init(i32 %34, i8** %35)
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%38 = call i32 @pipe(i32* %37)
store i32 %38, i32* %10
%39 = load i32, i32* %10
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %33
%42 = load i32, i32* @errno
%43 = load i32, i32* @errno
%44 = call i32 @strerror(i32 %43)
%45 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 97, i32 %42, i32 %44)
store i32 1, i32* %3
br label %209
46: ; preds = %33
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%48 = call i32 @pipe(i32* %47)
store i32 %48, i32* %10
%49 = load i32, i32* %10
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %46
%52 = load i32, i32* @errno
%53 = load i32, i32* @errno
%54 = call i32 @strerror(i32 %53)
%55 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 103, i32 %52, i32 %54)
store i32 1, i32* %3
br label %209
56: ; preds = %46
%57 = call i32 (...) @fork()
store i32 %57, i32* %11
%58 = load i32, i32* %11
%59 = icmp slt i32 %58, 0
br i1 %59, label %60, label %65
60: ; preds = %56
%61 = load i32, i32* @errno
%62 = load i32, i32* @errno
%63 = call i32 @strerror(i32 %62)
%64 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 109, i32 %61, i32 %63)
store i32 1, i32* %3
br label %209
65: ; preds = %56
%66 = load i32, i32* %11
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %125
68: ; preds = %65
%69 = call i32 @close(i32 0)
%70 = call i32 @close(i32 1)
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%72 = load i32, i32* %71
%73 = call i32 @dup2(i32 %72, i32 0)
store i32 %73, i32* %10
%74 = load i32, i32* %10
%75 = icmp slt i32 %74, 0
br i1 %75, label %76, label %81
76: ; preds = %68
%77 = load i32, i32* @errno
%78 = load i32, i32* @errno
%79 = call i32 @strerror(i32 %78)
%80 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 124, i32 %77, i32 %79)
store i32 1, i32* %3
br label %209
81: ; preds = %68
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%83 = load i32, i32* %82
%84 = call i32 @dup2(i32 %83, i32 1)
store i32 %84, i32* %10
%85 = load i32, i32* %10
%86 = icmp slt i32 %85, 0
br i1 %86, label %87, label %92
87: ; preds = %81
%88 = load i32, i32* @errno
%89 = load i32, i32* @errno
%90 = call i32 @strerror(i32 %89)
%91 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 130, i32 %88, i32 %90)
store i32 1, i32* %3
br label %209
92: ; preds = %81
%93 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%94 = load i32, i32* %93
%95 = call i32 @close(i32 %94)
%96 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%97 = load i32, i32* %96
%98 = call i32 @close(i32 %97)
%99 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%100 = load i32, i32* %99
%101 = call i32 @close(i32 %100)
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%103 = load i32, i32* %102
%104 = call i32 @close(i32 %103)
%105 = call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 1)
store i32 %105, i32* %10
%106 = load i32, i32* %10
%107 = icmp slt i32 %106, 0
br i1 %107, label %108, label %113
108: ; preds = %92
%109 = load i32, i32* @errno
%110 = load i32, i32* @errno
%111 = call i32 @strerror(i32 %110)
%112 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 141, i32 %109, i32 %111)
store i32 1, i32* %3
br label %209
113: ; preds = %92
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 0
%116 = load i8*, i8** %115
%117 = call i32 @execl(i8* %116, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32* null)
store i32 %117, i32* %10
%118 = load i8**, i8*** %5
%119 = getelementptr inbounds i8*, i8** %118, i64 0
%120 = load i8*, i8** %119
%121 = load i32, i32* @errno
%122 = load i32, i32* @errno
%123 = call i32 @strerror(i32 %122)
%124 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 146, i8* %120, i32 %121, i32 %123)
store i32 1, i32* %3
br label %209
125: ; preds = %65
%126 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%127 = load i32, i32* %126
%128 = call i32 @close(i32 %127)
%129 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%130 = load i32, i32* %129
%131 = call i32 @close(i32 %130)
%132 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%133 = load i32, i32* %132
%134 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%135 = load i32, i32* %134
%136 = call i32 @get_dumpable_from_pipes(i32 %133, i32 %135)
store i32 %136, i32* %8
%137 = load i32, i32* %8
%138 = icmp slt i32 %137, 0
br i1 %138, label %139, label %140
139: ; preds = %125
store i32 1, i32* %3
br label %209
140: ; preds = %125
%141 = call i32 (...) @test_daemon()
%142 = call i32 (...) @test_waitsig()
%143 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%144 = load i32, i32* %143
%145 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%146 = load i32, i32* %145
%147 = call i32 @get_dumpable_from_pipes(i32 %144, i32 %146)
store i32 %147, i32* %9
%148 = load i32, i32* %9
%149 = icmp slt i32 %148, 0
br i1 %149, label %150, label %151
150: ; preds = %140
store i32 1, i32* %3
br label %209
151: ; preds = %140
%152 = load i32, i32* %9
%153 = load i32, i32* %8
%154 = icmp ne i32 %152, %153
br i1 %154, label %155, label %160
155: ; preds = %151
store i32 0, i32* @errno
%156 = load i32, i32* @errno
%157 = load i32, i32* @errno
%158 = call i32 @strerror(i32 %157)
%159 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 175, i32 %156, i32 %158)
store i32 1, i32* %3
br label %209
160: ; preds = %151
%161 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%162 = load i32, i32* %161
%163 = call i32 @close(i32 %162)
%164 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%165 = load i32, i32* %164
%166 = call i32 @close(i32 %165)
%167 = call i32 @wait(i32* %13)
store i32 %167, i32* %12
%168 = load i32, i32* %12
%169 = icmp slt i32 %168, 0
br i1 %169, label %170, label %175
170: ; preds = %160
%171 = load i32, i32* @errno
%172 = load i32, i32* @errno
%173 = call i32 @strerror(i32 %172)
%174 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 185, i32 %171, i32 %173)
store i32 1, i32* %3
br label %209
175: ; preds = %160
store i32 0, i32* @errno
%176 = load i32, i32* %12
%177 = load i32, i32* %11
%178 = icmp ne i32 %176, %177
br i1 %178, label %179, label %186
179: ; preds = %175
%180 = load i32, i32* %12
%181 = load i32, i32* %11
%182 = load i32, i32* @errno
%183 = load i32, i32* @errno
%184 = call i32 @strerror(i32 %183)
%185 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 190, i32 %180, i32 %181, i32 %182, i32 %184)
store i32 1, i32* %3
br label %209
186: ; preds = %175
%187 = load i32, i32* %13
%188 = call i32 @WIFEXITED(i32 %187)
%189 = icmp ne i32 %188, 0
br i1 %189, label %196, label %190
190: ; preds = %186
%191 = load i32, i32* %13
%192 = load i32, i32* @errno
%193 = load i32, i32* @errno
%194 = call i32 @strerror(i32 %193)
%195 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 195, i32 %191, i32 %192, i32 %194)
store i32 1, i32* %3
br label %209
196: ; preds = %186
%197 = load i32, i32* %13
%198 = call i32 @WEXITSTATUS(i32 %197)
%199 = icmp ne i32 %198, 0
br i1 %199, label %200, label %207
200: ; preds = %196
%201 = load i32, i32* %13
%202 = call i32 @WEXITSTATUS(i32 %201)
%203 = load i32, i32* @errno
%204 = load i32, i32* @errno
%205 = call i32 @strerror(i32 %204)
%206 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 200, i32 %202, i32 %203, i32 %205)
store i32 1, i32* %3
br label %209
207: ; preds = %196
%208 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %3
br label %209
209: ; preds = %207, %200, %190, %179, %170, %155, %150, %139, %113, %108, %87, %76, %60, %51, %41, %25, %16
%210 = load i32, i32* %3
ret i32 %210
}

LLVM IR (-O2):
@.str = [16 x i8] c"DUMPABLE_SERVER\00"
@.str.1 = [50 x i8] c"ERR: %s:%d: error chmodding %s (errno = %d (%s))\0A\00"
@.str.2 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/dumpable02.c\00"
@errno = global i32 0
@.str.3 = [57 x i8] c"ERR: %s:%d: error creating input pipe (errno = %d (%s))\0A\00"
@.str.4 = [58 x i8] c"ERR: %s:%d: error creating output pipe (errno = %d (%s))\0A\00"
@.str.5 = [65 x i8] c"ERR: %s:%d: error forking the dumpable server (errno = %d (%s))\0A\00"
@.str.6 = [70 x i8] c"ERR: %s:%d: could not dup2 pipe into child's stdin (errno = %d (%s))\0A\00"
@.str.7 = [71 x i8] c"ERR: %s:%d: could not dup2 pipe into child's stdout (errno = %d (%s))\0A\00"
@.str.8 = [4 x i8] c"yes\00"
@.str.9 = [78 x i8] c"ERR: %s:%d: could not set the DUMPABLE_SERVER env variable (errno = %d (%s))\0A\00"
@.str.10 = [16 x i8] c"dumpable_server\00"
@.str.11 = [71 x i8] c"ERR: %s:%d: could not execv %s as a dumpable_server (errno = %d (%s))\0A\00"
@.str.12 = [79 x i8] c"FAIL: %s:%d: dumpable flag was not preserved over migration (errno = %d (%s))\0A\00"
@.str.13 = [63 x i8] c"ERR: %s:%d: error calling wait on the child (errno = %d (%s))\0A\00"
@.str.14 = [72 x i8] c"ERR: %s:%d: waited pid %d did not match child pid %d (errno = %d (%s))\0A\00"
@.str.15 = [88 x i8] c"ERR: %s:%d: child dumpable server returned abnormally with status=%d (errno = %d (%s))\0A\00"
@.str.16 = [68 x i8] c"ERR: %s:%d: child dumpable server returned rc=%d (errno = %d (%s))\0A\00"
@.str.17 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = bitcast [2 x i32]* %3 to i8*
%7 = bitcast [2 x i32]* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i64 @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = tail call i32 (...) @dumpable_server()
br label %149
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = tail call i32 @chmod(i8* %14, i32 73)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8*, i8** %1
%19 = load i32, i32* @errno
%20 = tail call i32 @strerror(i32 %19)
%21 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 89, i8* %18, i32 %19, i32 %20)
br label %149
22: ; preds = %13
%23 = tail call i32 @test_init(i32 %0, i8** %1)
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%25 = call i32 @pipe(i32* %24)
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = load i32, i32* @errno
%29 = call i32 @strerror(i32 %28)
%30 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 97, i32 %28, i32 %29)
br label %149
31: ; preds = %22
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%33 = call i32 @pipe(i32* %32)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i32, i32* @errno
%37 = call i32 @strerror(i32 %36)
%38 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 103, i32 %36, i32 %37)
br label %149
39: ; preds = %31
%40 = call i32 (...) @fork()
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = load i32, i32* @errno
%44 = call i32 @strerror(i32 %43)
%45 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 109, i32 %43, i32 %44)
br label %149
46: ; preds = %39
%47 = icmp eq i32 %40, 0
br i1 %47, label %48, label %90
48: ; preds = %46
%49 = call i32 @close(i32 0)
%50 = call i32 @close(i32 1)
%51 = load i32, i32* %24
%52 = call i32 @dup2(i32 %51, i32 0)
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %48
%55 = load i32, i32* @errno
%56 = call i32 @strerror(i32 %55)
%57 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 124, i32 %55, i32 %56)
br label %149
58: ; preds = %48
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%60 = load i32, i32* %59
%61 = call i32 @dup2(i32 %60, i32 1)
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %58
%64 = load i32, i32* @errno
%65 = call i32 @strerror(i32 %64)
%66 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 130, i32 %64, i32 %65)
br label %149
67: ; preds = %58
%68 = load i32, i32* %32
%69 = call i32 @close(i32 %68)
%70 = load i32, i32* %59
%71 = call i32 @close(i32 %70)
%72 = load i32, i32* %24
%73 = call i32 @close(i32 %72)
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%75 = load i32, i32* %74
%76 = call i32 @close(i32 %75)
%77 = call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 1)
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %83
79: ; preds = %67
%80 = load i32, i32* @errno
%81 = call i32 @strerror(i32 %80)
%82 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 141, i32 %80, i32 %81)
br label %149
83: ; preds = %67
%84 = load i8*, i8** %1
%85 = call i32 @execl(i8* %84, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32* null)
%86 = load i8*, i8** %1
%87 = load i32, i32* @errno
%88 = call i32 @strerror(i32 %87)
%89 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 146, i8* %86, i32 %87, i32 %88)
br label %149
90: ; preds = %46
%91 = load i32, i32* %24
%92 = call i32 @close(i32 %91)
%93 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%94 = load i32, i32* %93
%95 = call i32 @close(i32 %94)
%96 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%97 = load i32, i32* %96
%98 = load i32, i32* %32
%99 = call i32 @get_dumpable_from_pipes(i32 %97, i32 %98)
%100 = icmp slt i32 %99, 0
br i1 %100, label %149, label %101
101: ; preds = %90
%102 = call i32 (...) @test_daemon()
%103 = call i32 (...) @test_waitsig()
%104 = load i32, i32* %96
%105 = load i32, i32* %32
%106 = call i32 @get_dumpable_from_pipes(i32 %104, i32 %105)
%107 = icmp slt i32 %106, 0
br i1 %107, label %149, label %108
108: ; preds = %101
%109 = icmp eq i32 %106, %99
br i1 %109, label %113, label %110
110: ; preds = %108
store i32 0, i32* @errno
%111 = call i32 @strerror(i32 0)
%112 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 175, i32 0, i32 %111)
br label %149
113: ; preds = %108
%114 = load i32, i32* %96
%115 = call i32 @close(i32 %114)
%116 = load i32, i32* %32
%117 = call i32 @close(i32 %116)
%118 = call i32 @wait(i32* %5)
%119 = icmp slt i32 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %113
%121 = load i32, i32* @errno
%122 = call i32 @strerror(i32 %121)
%123 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 185, i32 %121, i32 %122)
br label %149
124: ; preds = %113
store i32 0, i32* @errno
%125 = icmp eq i32 %118, %40
br i1 %125, label %129, label %126
126: ; preds = %124
%127 = call i32 @strerror(i32 0)
%128 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 190, i32 %118, i32 %40, i32 0, i32 %127)
br label %149
129: ; preds = %124
%130 = load i32, i32* %5
%131 = call i32 @WIFEXITED(i32 %130)
%132 = icmp eq i32 %131, 0
%133 = load i32, i32* %5
br i1 %132, label %134, label %138
134: ; preds = %129
%135 = load i32, i32* @errno
%136 = call i32 @strerror(i32 %135)
%137 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 195, i32 %133, i32 %135, i32 %136)
br label %149
138: ; preds = %129
%139 = call i32 @WEXITSTATUS(i32 %133)
%140 = icmp eq i32 %139, 0
br i1 %140, label %147, label %141
141: ; preds = %138
%142 = load i32, i32* %5
%143 = call i32 @WEXITSTATUS(i32 %142)
%144 = load i32, i32* @errno
%145 = call i32 @strerror(i32 %144)
%146 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 200, i32 %143, i32 %144, i32 %145)
br label %149
147: ; preds = %138
%148 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
br label %149
149: ; preds = %101, %90, %147, %141, %134, %126, %120, %110, %83, %79, %63, %54, %42, %35, %27, %17, %11
%150 = phi i32 [ %12, %11 ], [ 1, %17 ], [ 1, %27 ], [ 1, %35 ], [ 1, %42 ], [ 1, %54 ], [ 1, %63 ], [ 1, %79 ], [ 1, %83 ], [ 1, %110 ], [ 1, %120 ], [ 1, %126 ], [ 1, %141 ], [ 0, %147 ], [ 1, %134 ], [ 1, %90 ], [ 1, %101 ]
ret i32 %150
}