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

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ read(int, char *, scalar_t__);
int socketpair(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
scalar_t__ strlen(char *);
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, ...);
int /*<<< orphan*/ test_waitsig();
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  int ssk_pair_d[2];
  int ssk_pair_s[2];
  char buf_left[64], buf_right[64];
  test_init(argc, argv);
  if (socketpair(AF_UNIX, SOCK_STREAM, 0, ssk_pair_s) == -1) {
    test_msg("FAIL: %s:%d: "
             "socketpair\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             38, errno, strerror(errno));
    exit(1);
  }
  write(ssk_pair_s[0], "packet stream left", sizeof("packet stream left"));
  write(ssk_pair_s[0], "packet stream right", sizeof("packet stream right"));
  write(ssk_pair_s[1], "packet stream right", sizeof("packet stream right"));
  write(ssk_pair_s[1], "packet stream left", sizeof("packet stream left"));
  if (socketpair(AF_UNIX, SOCK_DGRAM, 0, ssk_pair_d) == -1) {
    test_msg("FAIL: %s:%d: "
             "socketpair\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             48, errno, strerror(errno));
    exit(1);
  }
  write(ssk_pair_d[0], "packet dgram left", sizeof("packet dgram left"));
  write(ssk_pair_d[0], "packet dgram right", sizeof("packet dgram right"));
  write(ssk_pair_d[1], "packet dgram right", sizeof("packet dgram right"));
  write(ssk_pair_d[1], "packet dgram left", sizeof("packet dgram left"));
  test_daemon();
  test_waitsig();
  read(ssk_pair_s[1], buf_left, strlen("packet stream left") + 1);
  if (strcmp(buf_left, "packet stream left")) {
    test_msg("FAIL: %s:%d: "
             "SK_DATA_S2: '%s\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             62, "packet stream left", errno, strerror(errno));
    exit(1);
  }
  read(ssk_pair_s[1], buf_right, strlen("packet stream right") + 1);
  if (strcmp(buf_right, "packet stream right")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             67, errno, strerror(errno));
    exit(1);
  }
  test_msg("stream1            : '%s' '%s'\n", buf_left, buf_right);
  read(ssk_pair_s[0], buf_left, strlen("packet stream right") + 1);
  if (strcmp(buf_left, "packet stream right")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             74, errno, strerror(errno));
    exit(1);
  }
  read(ssk_pair_s[0], buf_right, strlen("packet stream left") + 1);
  if (strcmp(buf_right, "packet stream left")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             79, errno, strerror(errno));
    exit(1);
  }
  test_msg("stream2            : '%s' '%s'\n", buf_left, buf_right);
  read(ssk_pair_d[1], buf_left, strlen("packet dgram left") + 1);
  if (strcmp(buf_left, "packet dgram left")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             86, errno, strerror(errno));
    exit(1);
  }
  read(ssk_pair_d[1], buf_right, strlen("packet dgram right") + 1);
  if (strcmp(buf_right, "packet dgram right")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             91, errno, strerror(errno));
    exit(1);
  }
  test_msg("dgram1            : '%s' '%s'\n", buf_left, buf_right);
  read(ssk_pair_d[0], buf_left, strlen("packet dgram right") + 1);
  if (strcmp(buf_left, "packet dgram right")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             98, errno, strerror(errno));
    exit(1);
  }
  read(ssk_pair_d[0], buf_right, strlen("packet dgram left") + 1);
  if (strcmp(buf_right, "packet dgram left")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/"
             "master/test/zdtm/live/static/socket_queues.c",
             103, errno, strerror(errno));
    exit(1);
  }
  test_msg("dgram2            : '%s' '%s'\n", buf_left, buf_right);
  test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
mov    0x2deb(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rcx
xor    %edx,%edx
call   10b0 <socketpair@plt>
cmp    $0xffffffff,%eax
jne    1245 <main+0x95>
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa4(%rbp)
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xa4(%rbp),%ecx
mov    %eax,%r8d
lea    0xdd8(%rip),%rdi
lea    0xdfd(%rip),%rsi
mov    $0x26,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x20(%rbp),%edi
lea    0xe87(%rip),%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    -0x20(%rbp),%edi
lea    0xe86(%rip),%rsi
mov    $0x14,%edx
call   1040 <write@plt>
mov    -0x1c(%rbp),%edi
lea    0xe72(%rip),%rsi
mov    $0x14,%edx
call   1040 <write@plt>
mov    -0x1c(%rbp),%edi
lea    0xe4b(%rip),%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
mov    0x2d3b(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rcx
xor    %edx,%edx
call   10b0 <socketpair@plt>
cmp    $0xffffffff,%eax
jne    1305 <main+0x155>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa8(%rbp)
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xa8(%rbp),%ecx
mov    %eax,%r8d
lea    0xd18(%rip),%rdi
lea    0xd3d(%rip),%rsi
mov    $0x30,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%edi
lea    0xdee(%rip),%rsi
mov    $0x12,%edx
call   1040 <write@plt>
mov    -0x18(%rbp),%edi
lea    0xdec(%rip),%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%edi
lea    0xdd8(%rip),%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%edi
lea    0xdb2(%rip),%rsi
mov    $0x12,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1060 <test_daemon@plt>
mov    $0x0,%al
call   1090 <test_waitsig@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xb4(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    0xd58(%rip),%rdi
call   1050 <strlen@plt>
mov    -0xb4(%rbp),%edi
mov    -0xb0(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0x60(%rbp),%rdi
lea    0xd2f(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1408 <main+0x258>
mov    0x2c0b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xb8(%rbp)
mov    0x2bfc(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xb8(%rbp),%r8d
mov    %eax,%r9d
lea    0xd3e(%rip),%rdi
lea    0xc41(%rip),%rsi
mov    $0x3e,%edx
lea    0xcdf(%rip),%rcx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc4(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    0xcc3(%rip),%rdi
call   1050 <strlen@plt>
mov    -0xc4(%rbp),%edi
mov    -0xc0(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0xa0(%rbp),%rdi
lea    0xc97(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     14ab <main+0x2fb>
mov    0x2b60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc8(%rbp)
mov    0x2b51(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xc8(%rbp),%ecx
mov    %eax,%r8d
lea    0xcc5(%rip),%rdi
lea    0xb97(%rip),%rsi
mov    $0x43,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    -0x60(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0xd4(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    0xc0a(%rip),%rdi
call   1050 <strlen@plt>
mov    -0xd4(%rbp),%edi
mov    -0xd0(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0x60(%rbp),%rdi
lea    0xbe1(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1561 <main+0x3b1>
mov    0x2aaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xd8(%rbp)
mov    0x2a9b(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xd8(%rbp),%ecx
mov    %eax,%r8d
lea    0xc0f(%rip),%rdi
lea    0xae1(%rip),%rsi
mov    $0x4a,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0xe4(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xe0(%rbp)
lea    0xb57(%rip),%rdi
call   1050 <strlen@plt>
mov    -0xe4(%rbp),%edi
mov    -0xe0(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0xa0(%rbp),%rdi
lea    0xb2b(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1604 <main+0x454>
mov    0x2a07(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe8(%rbp)
mov    0x29f8(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xe8(%rbp),%ecx
mov    %eax,%r8d
lea    0xb6c(%rip),%rdi
lea    0xa3e(%rip),%rsi
mov    $0x4f,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    -0x60(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    0xb8d(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0xf4(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    0xac5(%rip),%rdi
call   1050 <strlen@plt>
mov    -0xf4(%rbp),%edi
mov    -0xf0(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0x60(%rbp),%rdi
lea    0xa9c(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     16ba <main+0x50a>
mov    0x2951(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xf8(%rbp)
mov    0x2942(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xf8(%rbp),%ecx
mov    %eax,%r8d
lea    0xab6(%rip),%rdi
lea    0x988(%rip),%rsi
mov    $0x56,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x104(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0x100(%rbp)
lea    0xa37(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x104(%rbp),%edi
mov    -0x100(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0xa0(%rbp),%rdi
lea    0xa0b(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     175d <main+0x5ad>
mov    0x28ae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x108(%rbp)
mov    0x289f(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x108(%rbp),%ecx
mov    %eax,%r8d
lea    0xa13(%rip),%rdi
lea    0x8e5(%rip),%rsi
mov    $0x5b,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    -0x60(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    0xa54(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x114(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x110(%rbp)
lea    0x97e(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x114(%rbp),%edi
mov    -0x110(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0x60(%rbp),%rdi
lea    0x955(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1813 <main+0x663>
mov    0x27f8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x118(%rbp)
mov    0x27e9(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x118(%rbp),%ecx
mov    %eax,%r8d
lea    0x95d(%rip),%rdi
lea    0x82f(%rip),%rsi
mov    $0x62,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x124(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0x120(%rbp)
lea    0x8cc(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x124(%rbp),%edi
mov    -0x120(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <read@plt>
lea    -0xa0(%rbp),%rdi
lea    0x8a0(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     18b6 <main+0x706>
mov    0x2755(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x128(%rbp)
mov    0x2746(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x128(%rbp),%ecx
mov    %eax,%r8d
lea    0x8ba(%rip),%rdi
lea    0x78c(%rip),%rsi
mov    $0x67,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    -0x60(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    0x91a(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
lea    0x92b(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
call   1030 <test_init@plt>
mov    0x2e30(%rip),%r15
mov    (%r15),%edi
mov    0x2e0e(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   10a0 <socketpair@plt>
cmp    $0xffffffff,%eax
je     148d <main+0x2ed>
mov    (%rsp),%edi
lea    0xef5(%rip),%r14
mov    %r14,%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    (%rsp),%edi
lea    0xef1(%rip),%rbx
mov    %rbx,%rsi
mov    $0x14,%edx
call   1040 <write@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0x14,%edx
call   1040 <write@plt>
mov    0x4(%rsp),%edi
mov    %r14,%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    (%r15),%edi
mov    0x2daf(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rcx
xor    %edx,%edx
call   10a0 <socketpair@plt>
cmp    $0xffffffff,%eax
je     14b5 <main+0x315>
mov    0x8(%rsp),%edi
lea    0xeaa(%rip),%r14
mov    %r14,%rsi
mov    $0x12,%edx
call   1040 <write@plt>
mov    0x8(%rsp),%edi
lea    0xea4(%rip),%rbx
mov    %rbx,%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    $0x13,%edx
call   1040 <write@plt>
mov    0xc(%rsp),%edi
mov    %r14,%rsi
mov    $0x12,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1050 <test_daemon@plt>
xor    %eax,%eax
call   1080 <test_waitsig@plt>
mov    0x4(%rsp),%edi
lea    0x50(%rsp),%rbx
mov    $0x13,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xe11(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    14dd <main+0x33d>
mov    0x4(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    $0x14,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xdf6(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    151e <main+0x37e>
lea    0xe78(%rip),%rdi
lea    0x50(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    (%rsp),%edi
mov    $0x14,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xdb3(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1546 <main+0x3a6>
mov    (%rsp),%edi
lea    0x10(%rsp),%rbx
mov    $0x13,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xd73(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    156e <main+0x3ce>
lea    0xe28(%rip),%rdi
lea    0x50(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    0xc(%rsp),%edi
mov    $0x12,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xd56(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1596 <main+0x3f6>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    $0x13,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xd3a(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    15bb <main+0x41b>
lea    0xdd6(%rip),%rdi
lea    0x50(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    0x8(%rsp),%edi
mov    $0x13,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xcf6(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    15e0 <main+0x440>
mov    0x8(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    $0x12,%edx
mov    %rbx,%rsi
call   1070 <read@plt>
lea    0xcb6(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1605 <main+0x465>
lea    0xd83(%rip),%rdi
lea    0x50(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1060 <test_msg@plt>
lea    0xd8a(%rip),%rdi
xor    %eax,%eax
call   1060 <test_msg@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2b34(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xb5c(%rip),%rdi
lea    0xb81(%rip),%rsi
mov    $0x26,%edx
jmp    1628 <main+0x488>
mov    0x2b0c(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xb34(%rip),%rdi
lea    0xb59(%rip),%rsi
mov    $0x30,%edx
jmp    1628 <main+0x488>
mov    0x2ae4(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xc2e(%rip),%rdi
lea    0xb31(%rip),%rsi
lea    0xbd4(%rip),%rcx
mov    $0x3e,%edx
mov    %ebx,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2aa3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xc1e(%rip),%rdi
lea    0xaf0(%rip),%rsi
mov    $0x43,%edx
jmp    1628 <main+0x488>
mov    0x2a7b(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xbf6(%rip),%rdi
lea    0xac8(%rip),%rsi
mov    $0x4a,%edx
jmp    1628 <main+0x488>
mov    0x2a53(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xbce(%rip),%rdi
lea    0xaa0(%rip),%rsi
mov    $0x4f,%edx
jmp    1628 <main+0x488>
mov    0x2a2b(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xba6(%rip),%rdi
lea    0xa78(%rip),%rsi
mov    $0x56,%edx
jmp    1628 <main+0x488>
mov    0x2a06(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xb81(%rip),%rdi
lea    0xa53(%rip),%rsi
mov    $0x5b,%edx
jmp    1628 <main+0x488>
mov    0x29e1(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xb5c(%rip),%rdi
lea    0xa2e(%rip),%rsi
mov    $0x62,%edx
jmp    1628 <main+0x488>
mov    0x29bc(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xb37(%rip),%rdi
lea    0xa09(%rip),%rsi
mov    $0x67,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [44 x i8] c"FAIL: %s:%d: socketpair\0A (errno = %d (%s))\0A\00"
@.str.1 = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/master/test/zdtm/live/static/socket_queues.c\00"
@errno = global i32 0
@.str.2 = [19 x i8] c"packet stream left\00"
@.str.3 = [20 x i8] c"packet stream right\00"
@SOCK_DGRAM = global i32 0
@.str.4 = [18 x i8] c"packet dgram left\00"
@.str.5 = [19 x i8] c"packet dgram right\00"
@.str.6 = [49 x i8] c"FAIL: %s:%d: SK_DATA_S2: '%s\0A (errno = %d (%s))\0A\00"
@.str.7 = [48 x i8] c"FAIL: %s:%d: data corrupted\0A (errno = %d (%s))\0A\00"
@.str.8 = [32 x i8] c"stream1 : '%s' '%s'\0A\00"
@.str.9 = [32 x i8] c"stream2 : '%s' '%s'\0A\00"
@.str.10 = [31 x i8] c"dgram1 : '%s' '%s'\0A\00"
@.str.11 = [31 x i8] c"dgram2 : '%s' '%s'\0A\00"
@.str.12 = [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 [64 x i8]
%9 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @test_init(i32 %10, i8** %11)
%13 = load i32, i32* @AF_UNIX
%14 = load i32, i32* @SOCK_STREAM
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%16 = call i32 @socketpair(i32 %13, i32 %14, i32 0, i32* %15)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i32, i32* @errno
%20 = load i32, i32* @errno
%21 = call i32 @strerror(i32 %20)
%22 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 38, i32 %19, i32 %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %2
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%26 = load i32, i32* %25
%27 = call i32 @write(i32 %26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 19)
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%29 = load i32, i32* %28
%30 = call i32 @write(i32 %29, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 20)
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%32 = load i32, i32* %31
%33 = call i32 @write(i32 %32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 20)
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%35 = load i32, i32* %34
%36 = call i32 @write(i32 %35, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 19)
%37 = load i32, i32* @AF_UNIX
%38 = load i32, i32* @SOCK_DGRAM
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%40 = call i32 @socketpair(i32 %37, i32 %38, i32 0, i32* %39)
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %48
42: ; preds = %24
%43 = load i32, i32* @errno
%44 = load i32, i32* @errno
%45 = call i32 @strerror(i32 %44)
%46 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 48, i32 %43, i32 %45)
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %24
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%50 = load i32, i32* %49
%51 = call i32 @write(i32 %50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 18)
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%53 = load i32, i32* %52
%54 = call i32 @write(i32 %53, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 19)
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%56 = load i32, i32* %55
%57 = call i32 @write(i32 %56, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 19)
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%59 = load i32, i32* %58
%60 = call i32 @write(i32 %59, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 18)
%61 = call i32 (...) @test_daemon()
%62 = call i32 (...) @test_waitsig()
%63 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%64 = load i32, i32* %63
%65 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%66 = call i64 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%67 = add nsw i64 %66, 1
%68 = call i32 @read(i32 %64, i8* %65, i64 %67)
%69 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %78
72: ; preds = %48
%73 = load i32, i32* @errno
%74 = load i32, i32* @errno
%75 = call i32 @strerror(i32 %74)
%76 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 62, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %73, i32 %75)
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %48
%79 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%80 = load i32, i32* %79
%81 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%82 = call i64 @strlen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%83 = add nsw i64 %82, 1
%84 = call i32 @read(i32 %80, i8* %81, i64 %83)
%85 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%87 = icmp ne i64 %86, 0
br i1 %87, label %88, label %94
88: ; preds = %78
%89 = load i32, i32* @errno
%90 = load i32, i32* @errno
%91 = call i32 @strerror(i32 %90)
%92 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 67, i32 %89, i32 %91)
%93 = call i32 @exit(i32 1)
unreachable
94: ; preds = %78
%95 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%96 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%97 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %95, i8* %96)
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%99 = load i32, i32* %98
%100 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%101 = call i64 @strlen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%102 = add nsw i64 %101, 1
%103 = call i32 @read(i32 %99, i8* %100, i64 %102)
%104 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%105 = call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %113
107: ; preds = %94
%108 = load i32, i32* @errno
%109 = load i32, i32* @errno
%110 = call i32 @strerror(i32 %109)
%111 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 74, i32 %108, i32 %110)
%112 = call i32 @exit(i32 1)
unreachable
113: ; preds = %94
%114 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%115 = load i32, i32* %114
%116 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%117 = call i64 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%118 = add nsw i64 %117, 1
%119 = call i32 @read(i32 %115, i8* %116, i64 %118)
%120 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%121 = call i64 @strcmp(i8* %120, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%122 = icmp ne i64 %121, 0
br i1 %122, label %123, label %129
123: ; preds = %113
%124 = load i32, i32* @errno
%125 = load i32, i32* @errno
%126 = call i32 @strerror(i32 %125)
%127 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 79, i32 %124, i32 %126)
%128 = call i32 @exit(i32 1)
unreachable
129: ; preds = %113
%130 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%131 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%132 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %130, i8* %131)
%133 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%134 = load i32, i32* %133
%135 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%136 = call i64 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%137 = add nsw i64 %136, 1
%138 = call i32 @read(i32 %134, i8* %135, i64 %137)
%139 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%140 = call i64 @strcmp(i8* %139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%141 = icmp ne i64 %140, 0
br i1 %141, label %142, label %148
142: ; preds = %129
%143 = load i32, i32* @errno
%144 = load i32, i32* @errno
%145 = call i32 @strerror(i32 %144)
%146 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 86, i32 %143, i32 %145)
%147 = call i32 @exit(i32 1)
unreachable
148: ; preds = %129
%149 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%150 = load i32, i32* %149
%151 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%152 = call i64 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%153 = add nsw i64 %152, 1
%154 = call i32 @read(i32 %150, i8* %151, i64 %153)
%155 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%156 = call i64 @strcmp(i8* %155, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%157 = icmp ne i64 %156, 0
br i1 %157, label %158, label %164
158: ; preds = %148
%159 = load i32, i32* @errno
%160 = load i32, i32* @errno
%161 = call i32 @strerror(i32 %160)
%162 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 91, i32 %159, i32 %161)
%163 = call i32 @exit(i32 1)
unreachable
164: ; preds = %148
%165 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%166 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%167 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %165, i8* %166)
%168 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%169 = load i32, i32* %168
%170 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%171 = call i64 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%172 = add nsw i64 %171, 1
%173 = call i32 @read(i32 %169, i8* %170, i64 %172)
%174 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%175 = call i64 @strcmp(i8* %174, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%176 = icmp ne i64 %175, 0
br i1 %176, label %177, label %183
177: ; preds = %164
%178 = load i32, i32* @errno
%179 = load i32, i32* @errno
%180 = call i32 @strerror(i32 %179)
%181 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 98, i32 %178, i32 %180)
%182 = call i32 @exit(i32 1)
unreachable
183: ; preds = %164
%184 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%185 = load i32, i32* %184
%186 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%187 = call i64 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%188 = add nsw i64 %187, 1
%189 = call i32 @read(i32 %185, i8* %186, i64 %188)
%190 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%191 = call i64 @strcmp(i8* %190, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%192 = icmp ne i64 %191, 0
br i1 %192, label %193, label %199
193: ; preds = %183
%194 = load i32, i32* @errno
%195 = load i32, i32* @errno
%196 = call i32 @strerror(i32 %195)
%197 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 103, i32 %194, i32 %196)
%198 = call i32 @exit(i32 1)
unreachable
199: ; preds = %183
%200 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%201 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%202 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %200, i8* %201)
%203 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [44 x i8] c"FAIL: %s:%d: socketpair\0A (errno = %d (%s))\0A\00"
@.str.1 = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AuthenticEshkinKot/criu/refs/heads/master/test/zdtm/live/static/socket_queues.c\00"
@errno = global i32 0
@.str.2 = [19 x i8] c"packet stream left\00"
@.str.3 = [20 x i8] c"packet stream right\00"
@SOCK_DGRAM = global i32 0
@.str.4 = [18 x i8] c"packet dgram left\00"
@.str.5 = [19 x i8] c"packet dgram right\00"
@.str.6 = [49 x i8] c"FAIL: %s:%d: SK_DATA_S2: '%s\0A (errno = %d (%s))\0A\00"
@.str.7 = [48 x i8] c"FAIL: %s:%d: data corrupted\0A (errno = %d (%s))\0A\00"
@.str.8 = [32 x i8] c"stream1 : '%s' '%s'\0A\00"
@.str.9 = [32 x i8] c"stream2 : '%s' '%s'\0A\00"
@.str.10 = [31 x i8] c"dgram1 : '%s' '%s'\0A\00"
@.str.11 = [31 x i8] c"dgram2 : '%s' '%s'\0A\00"
@.str.12 = [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 [64 x i8]
%6 = alloca [64 x i8]
%7 = bitcast [2 x i32]* %3 to i8*
%8 = bitcast [2 x i32]* %4 to i8*
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%11 = tail call i32 @test_init(i32 %0, i8** %1)
%12 = load i32, i32* @AF_UNIX
%13 = load i32, i32* @SOCK_STREAM
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%15 = call i32 @socketpair(i32 %12, i32 %13, i32 0, i32* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %22
17: ; preds = %2
%18 = load i32, i32* @errno
%19 = call i32 @strerror(i32 %18)
%20 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 38, i32 %18, i32 %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i32, i32* %14
%24 = call i32 @write(i32 %23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 19)
%25 = load i32, i32* %14
%26 = call i32 @write(i32 %25, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 20)
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%28 = load i32, i32* %27
%29 = call i32 @write(i32 %28, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 20)
%30 = load i32, i32* %27
%31 = call i32 @write(i32 %30, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 19)
%32 = load i32, i32* @AF_UNIX
%33 = load i32, i32* @SOCK_DGRAM
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%35 = call i32 @socketpair(i32 %32, i32 %33, i32 0, i32* %34)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %42
37: ; preds = %22
%38 = load i32, i32* @errno
%39 = call i32 @strerror(i32 %38)
%40 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 48, i32 %38, i32 %39)
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %22
%43 = load i32, i32* %34
%44 = call i32 @write(i32 %43, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 18)
%45 = load i32, i32* %34
%46 = call i32 @write(i32 %45, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 19)
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%48 = load i32, i32* %47
%49 = call i32 @write(i32 %48, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 19)
%50 = load i32, i32* %47
%51 = call i32 @write(i32 %50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 18)
%52 = call i32 (...) @test_daemon()
%53 = call i32 (...) @test_waitsig()
%54 = load i32, i32* %27
%55 = call i32 @read(i32 %54, i8* %9, i64 19)
%56 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %63, label %58
58: ; preds = %42
%59 = load i32, i32* @errno
%60 = call i32 @strerror(i32 %59)
%61 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 62, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %59, i32 %60)
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %42
%64 = load i32, i32* %27
%65 = call i32 @read(i32 %64, i8* %10, i64 20)
%66 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %73, label %68
68: ; preds = %63
%69 = load i32, i32* @errno
%70 = call i32 @strerror(i32 %69)
%71 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 67, i32 %69, i32 %70)
%72 = call i32 @exit(i32 1)
unreachable
73: ; preds = %63
%74 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %9, i8* %10)
%75 = load i32, i32* %14
%76 = call i32 @read(i32 %75, i8* %9, i64 20)
%77 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %84, label %79
79: ; preds = %73
%80 = load i32, i32* @errno
%81 = call i32 @strerror(i32 %80)
%82 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 74, i32 %80, i32 %81)
%83 = call i32 @exit(i32 1)
unreachable
84: ; preds = %73
%85 = load i32, i32* %14
%86 = call i32 @read(i32 %85, i8* %10, i64 19)
%87 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %94, label %89
89: ; preds = %84
%90 = load i32, i32* @errno
%91 = call i32 @strerror(i32 %90)
%92 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 79, i32 %90, i32 %91)
%93 = call i32 @exit(i32 1)
unreachable
94: ; preds = %84
%95 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %9, i8* %10)
%96 = load i32, i32* %47
%97 = call i32 @read(i32 %96, i8* %9, i64 18)
%98 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%99 = icmp eq i64 %98, 0
br i1 %99, label %105, label %100
100: ; preds = %94
%101 = load i32, i32* @errno
%102 = call i32 @strerror(i32 %101)
%103 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 86, i32 %101, i32 %102)
%104 = call i32 @exit(i32 1)
unreachable
105: ; preds = %94
%106 = load i32, i32* %47
%107 = call i32 @read(i32 %106, i8* %10, i64 19)
%108 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%109 = icmp eq i64 %108, 0
br i1 %109, label %115, label %110
110: ; preds = %105
%111 = load i32, i32* @errno
%112 = call i32 @strerror(i32 %111)
%113 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 91, i32 %111, i32 %112)
%114 = call i32 @exit(i32 1)
unreachable
115: ; preds = %105
%116 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %9, i8* %10)
%117 = load i32, i32* %34
%118 = call i32 @read(i32 %117, i8* %9, i64 19)
%119 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%120 = icmp eq i64 %119, 0
br i1 %120, label %126, label %121
121: ; preds = %115
%122 = load i32, i32* @errno
%123 = call i32 @strerror(i32 %122)
%124 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 98, i32 %122, i32 %123)
%125 = call i32 @exit(i32 1)
unreachable
126: ; preds = %115
%127 = load i32, i32* %34
%128 = call i32 @read(i32 %127, i8* %10, i64 18)
%129 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%130 = icmp eq i64 %129, 0
br i1 %130, label %136, label %131
131: ; preds = %126
%132 = load i32, i32* @errno
%133 = call i32 @strerror(i32 %132)
%134 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0), i32 103, i32 %132, i32 %133)
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %126
%137 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %9, i8* %10)
%138 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}