#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 */
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
  void *sun_family;
};
typedef int /*<<< orphan*/ path;
typedef int /*<<< orphan*/ name_conn;
typedef int /*<<< orphan*/ name_bound_conn;
typedef int /*<<< orphan*/ name_bound;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
void *AF_UNIX;
int PATH_MAX;
int /*<<< orphan*/ SOCK_DGRAM;
int bind(int, struct sockaddr_un *, int);
int connect(int, struct sockaddr_un *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
char *get_current_dir_name();
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ read(int, char **, int);
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr_un *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int socket(void *, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, ...);
int /*<<< orphan*/ test_waitsig();
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  struct sockaddr_un name_bound;
  struct sockaddr_un name_conn;
  struct sockaddr_un name_bound_conn;
  int sk_dgram_bound_client;
  int sk_dgram_bound_server;
  int sk_dgram_conn_client;
  int sk_dgram_conn_client2;
  int sk_dgram_conn_server;
  int sk_dgram_bound_conn;
  char path[PATH_MAX];
  char buf[64];
  char *cwd;
  int ret;
  test_init(argc, argv);
  cwd = get_current_dir_name();
  if (!cwd) {
    test_msg("FAIL: %s:%d: "
             "getcwd\n"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             47, errno);
    exit(1);
  }
  snprintf(path, sizeof(path), "%s/test-socket", cwd);
  unlink(path);
  sk_dgram_bound_client = socket(AF_UNIX, SOCK_DGRAM, 0);
  sk_dgram_bound_server = socket(AF_UNIX, SOCK_DGRAM, 0);
  sk_dgram_conn_client = socket(AF_UNIX, SOCK_DGRAM, 0);
  sk_dgram_conn_client2 = socket(AF_UNIX, SOCK_DGRAM, 0);
  sk_dgram_conn_server = socket(AF_UNIX, SOCK_DGRAM, 0);
  sk_dgram_bound_conn = socket(AF_UNIX, SOCK_DGRAM, 0);
  if (sk_dgram_conn_server < 0 || sk_dgram_bound_server < 0 ||
      sk_dgram_conn_client < 0 || sk_dgram_conn_client2 < 0 ||
      sk_dgram_conn_server < 0 || sk_dgram_bound_conn < 0) {
    test_msg("FAIL: %s:%d: "
             "socket"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             67, errno);
    exit(1);
  }
  snprintf(path, sizeof(path), "%s/test-socket-bound", cwd);
  unlink(path);
  name_bound.sun_family = AF_UNIX;
  strncpy(name_bound.sun_path, path, sizeof(name_bound.sun_path));
  snprintf(path, sizeof(path), "%s/test-socket-conn", cwd);
  unlink(path);
  name_conn.sun_family = AF_UNIX;
  strncpy(name_conn.sun_path, path, sizeof(name_conn.sun_path));
  snprintf(path, sizeof(path), "%s/test-socket-bound-conn", cwd);
  unlink(path);
  name_bound_conn.sun_family = AF_UNIX;
  strncpy(name_bound_conn.sun_path, path, sizeof(name_bound_conn.sun_path));
  ret = bind(sk_dgram_bound_server, &name_bound, sizeof(name_bound));
  if (ret) {
    test_msg("FAIL: %s:%d: "
             "bind"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             91, errno);
    exit(1);
  }
  ret = bind(sk_dgram_conn_server, &name_conn, sizeof(name_conn));
  if (ret) {
    test_msg("FAIL: %s:%d: "
             "bind"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             97, errno);
    exit(1);
  }
  ret = connect(sk_dgram_conn_client, &name_conn, sizeof(name_conn));
  if (ret) {
    test_msg("FAIL: %s:%d: "
             "connect"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             103, errno);
    exit(1);
  }
  ret = connect(sk_dgram_conn_client2, &name_conn, sizeof(name_conn));
  if (ret) {
    test_msg("FAIL: %s:%d: "
             "connect"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             109, errno);
    exit(1);
  }
  ret = bind(sk_dgram_bound_conn, &name_bound_conn, sizeof(name_bound_conn));
  if (ret) {
    test_msg("FAIL: %s:%d: "
             "bind"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             115, errno);
    exit(1);
  }
  ret = connect(sk_dgram_bound_conn, &name_bound_conn, sizeof(name_bound_conn));
  if (ret) {
    test_msg("FAIL: %s:%d: "
             "connect"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             122, errno);
    exit(1);
  }
  memset(buf, 0, sizeof(buf));
  sendto(sk_dgram_bound_client, "data-packet-bound",
         sizeof("data-packet-bound"), 0, &name_bound, sizeof(name_bound));
  read(sk_dgram_bound_server, &buf, sizeof(buf));
  if (strcmp(buf, "data-packet-bound")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             131, errno);
    exit(1);
  }
  test_msg("dgram-bound       : '%s'\n", buf);
  memset(buf, 0, sizeof(buf));
  write(sk_dgram_conn_client, "data-packet-conn", sizeof("data-packet-conn"));
  read(sk_dgram_conn_server, &buf, sizeof(buf));
  if (strcmp(buf, "data-packet-conn")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             140, errno);
    exit(1);
  }
  test_msg("dgram-conn        : '%s'\n", buf);
  memset(buf, 0, sizeof(buf));
  write(sk_dgram_bound_conn, "data-packet-bound-conn",
        sizeof("data-packet-bound-conn"));
  read(sk_dgram_bound_conn, &buf, sizeof(buf));
  if (strcmp(buf, "data-packet-bound-conn")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             149, errno);
    exit(1);
  }
  test_msg("dgram-bound-conn  : '%s'\n", buf);
  test_daemon();
  test_waitsig();
  memset(buf, 0, sizeof(buf));
  sendto(sk_dgram_bound_client, "data-packet-bound",
         sizeof("data-packet-bound"), 0, &name_bound, sizeof(name_bound));
  read(sk_dgram_bound_server, &buf, sizeof(buf));
  if (strcmp(buf, "data-packet-bound")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             162, errno);
    exit(1);
  }
  test_msg("dgram-bound       : '%s'\n", buf);
  memset(buf, 0, sizeof(buf));
  write(sk_dgram_conn_client, "data-packet-conn", sizeof("data-packet-conn"));
  read(sk_dgram_conn_server, &buf, sizeof(buf));
  if (strcmp(buf, "data-packet-conn")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             171, errno);
    exit(1);
  }
  test_msg("dgram-conn        : '%s'\n", buf);
  memset(buf, 0, sizeof(buf));
  write(sk_dgram_bound_conn, "data-packet-bound-conn",
        sizeof("data-packet-bound-conn"));
  read(sk_dgram_bound_conn, &buf, sizeof(buf));
  if (strcmp(buf, "data-packet-bound-conn")) {
    test_msg("FAIL: %s:%d: "
             "data corrupted\n"
             " (errno = %d)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/"
             "zdtm/live/static/sockets_dgram.c",
             180, errno);
    exit(1);
  }
  test_msg("dgram-bound-conn  : '%s'\n", buf);
  test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dc0(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0xd0(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xc8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <test_init@plt>
mov    $0x0,%al
call   10f0 <get_current_dir_name@plt>
mov    %rax,-0xb8(%rbp)
cmpq   $0x0,-0xb8(%rbp)
jne    12b4 <main+0xa4>
mov    0x2d3a(%rip),%rax
mov    (%rax),%ecx
lea    0xd69(%rip),%rdi
lea    0xd85(%rip),%rsi
mov    $0x2f,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xd0(%rbp),%rax
mov    %eax,%esi
mov    -0xb8(%rbp),%rcx
lea    0xdef(%rip),%rdx
call   1080 <snprintf@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <unlink@plt>
mov    0x2cf6(%rip),%rax
mov    (%rax),%rdi
mov    0x2ce4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x44(%rbp)
mov    0x2cd9(%rip),%rax
mov    (%rax),%rdi
mov    0x2cc7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x48(%rbp)
mov    0x2cbc(%rip),%rax
mov    (%rax),%rdi
mov    0x2caa(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x4c(%rbp)
mov    0x2c9f(%rip),%rax
mov    (%rax),%rdi
mov    0x2c8d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x50(%rbp)
mov    0x2c82(%rip),%rax
mov    (%rax),%rdi
mov    0x2c70(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x54(%rbp)
mov    0x2c65(%rip),%rax
mov    (%rax),%rdi
mov    0x2c53(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x54(%rbp)
jl     13cd <main+0x1bd>
cmpl   $0x0,-0x48(%rbp)
jl     13cd <main+0x1bd>
cmpl   $0x0,-0x4c(%rbp)
jl     13cd <main+0x1bd>
cmpl   $0x0,-0x50(%rbp)
jl     13cd <main+0x1bd>
cmpl   $0x0,-0x54(%rbp)
jl     13cd <main+0x1bd>
cmpl   $0x0,-0x58(%rbp)
jge    13fa <main+0x1ea>
mov    0x2bf4(%rip),%rax
mov    (%rax),%ecx
lea    0xcf3(%rip),%rdi
lea    0xc3f(%rip),%rsi
mov    $0x43,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xd0(%rbp),%rax
mov    %eax,%esi
mov    -0xb8(%rbp),%rcx
lea    0xcda(%rip),%rdx
call   1080 <snprintf@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0xc8(%rbp),%rsi
mov    0x2ba9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x4,%edx
call   1040 <strncpy@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xd0(%rbp),%rax
mov    %eax,%esi
mov    -0xb8(%rbp),%rcx
lea    0xc9e(%rip),%rdx
call   1080 <snprintf@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0xc8(%rbp),%rsi
mov    0x2b58(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%edi
mov    $0x4,%edx
call   1040 <strncpy@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xd0(%rbp),%rax
mov    %eax,%esi
mov    -0xb8(%rbp),%rcx
lea    0xc61(%rip),%rdx
call   1080 <snprintf@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0xc8(%rbp),%rsi
mov    0x2b07(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%edi
mov    $0x4,%edx
call   1040 <strncpy@plt>
mov    -0x48(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1100 <bind@plt>
mov    %eax,-0xbc(%rbp)
cmpl   $0x0,-0xbc(%rbp)
je     153e <main+0x32e>
mov    0x2ab0(%rip),%rax
mov    (%rax),%ecx
lea    0xc14(%rip),%rdi
lea    0xafb(%rip),%rsi
mov    $0x5b,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x54(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1100 <bind@plt>
mov    %eax,-0xbc(%rbp)
cmpl   $0x0,-0xbc(%rbp)
je     158f <main+0x37f>
mov    0x2a5f(%rip),%rax
mov    (%rax),%ecx
lea    0xbc3(%rip),%rdi
lea    0xaaa(%rip),%rsi
mov    $0x61,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x4c(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1120 <connect@plt>
mov    %eax,-0xbc(%rbp)
cmpl   $0x0,-0xbc(%rbp)
je     15e0 <main+0x3d0>
mov    0x2a0e(%rip),%rax
mov    (%rax),%ecx
lea    0xb92(%rip),%rdi
lea    0xa59(%rip),%rsi
mov    $0x67,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x50(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1120 <connect@plt>
mov    %eax,-0xbc(%rbp)
cmpl   $0x0,-0xbc(%rbp)
je     1631 <main+0x421>
mov    0x29bd(%rip),%rax
mov    (%rax),%ecx
lea    0xb41(%rip),%rdi
lea    0xa08(%rip),%rsi
mov    $0x6d,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x58(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x10,%edx
call   1100 <bind@plt>
mov    %eax,-0xbc(%rbp)
cmpl   $0x0,-0xbc(%rbp)
je     1682 <main+0x472>
mov    0x296c(%rip),%rax
mov    (%rax),%ecx
lea    0xad0(%rip),%rdi
lea    0x9b7(%rip),%rsi
mov    $0x73,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x58(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x10,%edx
call   1120 <connect@plt>
mov    %eax,-0xbc(%rbp)
cmpl   $0x0,-0xbc(%rbp)
je     16d3 <main+0x4c3>
mov    0x291b(%rip),%rax
mov    (%rax),%ecx
lea    0xa9f(%rip),%rdi
lea    0x966(%rip),%rsi
mov    $0x7a,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
mov    -0x44(%rbp),%edi
lea    0xa88(%rip),%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
lea    -0x20(%rbp),%r8
mov    $0x10,%r9d
call   10a0 <sendto@plt>
mov    -0x48(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
lea    -0xb0(%rbp),%rdi
lea    0xa50(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     1764 <main+0x554>
mov    0x288a(%rip),%rax
mov    (%rax),%ecx
lea    0xa43(%rip),%rdi
lea    0x8d5(%rip),%rsi
mov    $0x83,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0xb0(%rbp),%rsi
lea    0xa43(%rip),%rdi
mov    $0x0,%al
call   10b0 <test_msg@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
mov    -0x4c(%rbp),%edi
lea    0xa39(%rip),%rsi
mov    $0x11,%edx
call   1060 <write@plt>
mov    -0x54(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
lea    -0xb0(%rbp),%rdi
lea    0xa0d(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     17fe <main+0x5ee>
mov    0x27f0(%rip),%rax
mov    (%rax),%ecx
lea    0x9a9(%rip),%rdi
lea    0x83b(%rip),%rsi
mov    $0x8c,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0xb0(%rbp),%rsi
lea    0x9d4(%rip),%rdi
mov    $0x0,%al
call   10b0 <test_msg@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
mov    -0x58(%rbp),%edi
lea    0x9ca(%rip),%rsi
mov    $0x17,%edx
call   1060 <write@plt>
mov    -0x58(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
lea    -0xb0(%rbp),%rdi
lea    0x99e(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     1898 <main+0x688>
mov    0x2756(%rip),%rax
mov    (%rax),%ecx
lea    0x90f(%rip),%rdi
lea    0x7a1(%rip),%rsi
mov    $0x95,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0xb0(%rbp),%rsi
lea    0x96b(%rip),%rdi
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x0,%al
call   1070 <test_daemon@plt>
mov    $0x0,%al
call   10d0 <test_waitsig@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
mov    -0x44(%rbp),%edi
lea    0x8a0(%rip),%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
lea    -0x20(%rbp),%r8
mov    $0x10,%r9d
call   10a0 <sendto@plt>
mov    -0x48(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
lea    -0xb0(%rbp),%rdi
lea    0x868(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     194c <main+0x73c>
mov    0x26a2(%rip),%rax
mov    (%rax),%ecx
lea    0x85b(%rip),%rdi
lea    0x6ed(%rip),%rsi
mov    $0xa2,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0xb0(%rbp),%rsi
lea    0x85b(%rip),%rdi
mov    $0x0,%al
call   10b0 <test_msg@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
mov    -0x4c(%rbp),%edi
lea    0x851(%rip),%rsi
mov    $0x11,%edx
call   1060 <write@plt>
mov    -0x54(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
lea    -0xb0(%rbp),%rdi
lea    0x825(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     19e6 <main+0x7d6>
mov    0x2608(%rip),%rax
mov    (%rax),%ecx
lea    0x7c1(%rip),%rdi
lea    0x653(%rip),%rsi
mov    $0xab,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0xb0(%rbp),%rsi
lea    0x7ec(%rip),%rdi
mov    $0x0,%al
call   10b0 <test_msg@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
mov    -0x58(%rbp),%edi
lea    0x7e2(%rip),%rsi
mov    $0x17,%edx
call   1060 <write@plt>
mov    -0x58(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
lea    -0xb0(%rbp),%rdi
lea    0x7b6(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     1a80 <main+0x870>
mov    0x256e(%rip),%rax
mov    (%rax),%ecx
lea    0x727(%rip),%rdi
lea    0x5b9(%rip),%rsi
mov    $0xb4,%edx
mov    $0x0,%al
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0xb0(%rbp),%rsi
lea    0x783(%rip),%rdi
mov    $0x0,%al
call   10b0 <test_msg@plt>
lea    0x78f(%rip),%rdi
mov    $0x0,%al
call   10b0 <test_msg@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rsp,-0x48(%rbp)
mov    0x2dc1(%rip),%rax
mov    (%rax),%ebx
mov    %rsp,%r13
lea    0xf(%rbx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
call   1050 <test_init@plt>
xor    %eax,%eax
call   10f0 <get_current_dir_name@plt>
test   %rax,%rax
je     170a <main+0x4fa>
lea    0xe63(%rip),%rdx
mov    %r13,%rdi
mov    %rbx,-0x58(%rbp)
mov    %ebx,%esi
mov    %rax,-0x50(%rbp)
mov    %rax,%rcx
call   1080 <snprintf@plt>
mov    %r13,%rdi
call   1030 <unlink@plt>
mov    0x2d5e(%rip),%rbx
mov    (%rbx),%rdi
mov    0x2d4c(%rip),%r15
mov    (%r15),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x34(%rbp)
mov    (%rbx),%rdi
mov    (%r15),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x30(%rbp)
mov    (%rbx),%rdi
mov    (%r15),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x38(%rbp)
mov    (%rbx),%rdi
mov    (%r15),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%r14d
mov    (%rbx),%rdi
mov    (%r15),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%r12d
mov    (%rbx),%rdi
mov    (%r15),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %r12d,-0x2c(%rbp)
test   %r12d,%r12d
js     172b <main+0x51b>
cmpl   $0x0,-0x30(%rbp)
js     172b <main+0x51b>
cmpl   $0x0,-0x38(%rbp)
js     172b <main+0x51b>
mov    %r14d,%r12d
test   %r14d,%r14d
js     172b <main+0x51b>
cmpl   $0x0,-0x2c(%rbp)
js     172b <main+0x51b>
test   %eax,%eax
js     172b <main+0x51b>
mov    %eax,-0x3c(%rbp)
lea    0xdc3(%rip),%rdx
mov    %r13,%rdi
mov    -0x58(%rbp),%rbx
mov    %ebx,%esi
mov    -0x50(%rbp),%r14
mov    %r14,%rcx
call   1080 <snprintf@plt>
mov    %r13,%rdi
call   1030 <unlink@plt>
mov    0x2c8d(%rip),%r15
mov    (%r15),%rax
mov    %rax,-0x70(%rbp)
mov    %r13,%rsi
mov    $0x4,%edx
call   1040 <strncpy@plt>
lea    0xd99(%rip),%rdx
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r14,%rcx
call   1080 <snprintf@plt>
mov    %r13,%rdi
call   1030 <unlink@plt>
mov    (%r15),%rax
mov    %rax,-0x60(%rbp)
mov    %r13,%rsi
mov    $0x4,%edx
call   1040 <strncpy@plt>
lea    0xd7d(%rip),%rdx
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r14,%rcx
call   1080 <snprintf@plt>
mov    %r13,%rdi
call   1030 <unlink@plt>
mov    (%r15),%rax
mov    %rax,-0x80(%rbp)
mov    %r13,%rsi
mov    $0x4,%edx
call   1040 <strncpy@plt>
lea    -0x78(%rbp),%rsi
mov    -0x30(%rbp),%edi
mov    $0x10,%edx
call   1100 <bind@plt>
test   %eax,%eax
jne    174c <main+0x53c>
lea    -0x68(%rbp),%rsi
mov    -0x2c(%rbp),%edi
mov    $0x10,%edx
call   1100 <bind@plt>
test   %eax,%eax
mov    -0x38(%rbp),%r13d
jne    176d <main+0x55d>
lea    -0x68(%rbp),%rsi
mov    %r13d,%edi
mov    $0x10,%edx
call   1120 <connect@plt>
test   %eax,%eax
mov    -0x3c(%rbp),%ebx
jne    178e <main+0x57e>
lea    -0x68(%rbp),%rsi
mov    %r12d,%edi
mov    $0x10,%edx
call   1120 <connect@plt>
test   %eax,%eax
jne    17af <main+0x59f>
lea    -0x88(%rbp),%rsi
mov    %ebx,%edi
mov    $0x10,%edx
call   1100 <bind@plt>
test   %eax,%eax
jne    17d0 <main+0x5c0>
lea    -0x88(%rbp),%rsi
mov    %ebx,%r12d
mov    %ebx,%edi
mov    $0x10,%edx
call   1120 <connect@plt>
test   %eax,%eax
jne    17f1 <main+0x5e1>
lea    -0xd0(%rbp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
lea    0xcf0(%rip),%r14
lea    -0x78(%rbp),%r8
mov    -0x34(%rbp),%edi
mov    %r14,%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
mov    $0x10,%r9d
call   10a0 <sendto@plt>
mov    -0x30(%rbp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    1812 <main+0x602>
lea    0xce6(%rip),%rdi
lea    -0xd0(%rbp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <test_msg@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
lea    0xcd9(%rip),%r14
mov    %r13d,%edi
mov    %r14,%rsi
mov    $0x11,%edx
call   1060 <write@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    1833 <main+0x623>
lea    0xcaf(%rip),%rdi
lea    -0xd0(%rbp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <test_msg@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
lea    0xca2(%rip),%r14
mov    %r12d,%ebx
mov    %r12d,%edi
mov    %r14,%rsi
mov    $0x17,%edx
call   1060 <write@plt>
mov    %r12d,%edi
mov    %r15,%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    1851 <main+0x641>
lea    0xc7b(%rip),%rdi
lea    -0xd0(%rbp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <test_msg@plt>
xor    %eax,%eax
call   1070 <test_daemon@plt>
xor    %eax,%eax
call   10d0 <test_waitsig@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
lea    0xbad(%rip),%r14
lea    -0x78(%rbp),%r8
mov    -0x34(%rbp),%edi
mov    %r14,%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
mov    $0x10,%r9d
call   10a0 <sendto@plt>
mov    -0x30(%rbp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    186f <main+0x65f>
lea    0xba3(%rip),%rdi
lea    -0xd0(%rbp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <test_msg@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
lea    0xb96(%rip),%r14
mov    %r13d,%edi
mov    %r14,%rsi
mov    $0x11,%edx
call   1060 <write@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    188d <main+0x67d>
lea    0xb6c(%rip),%rdi
lea    -0xd0(%rbp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <test_msg@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
lea    0xb5f(%rip),%r14
mov    %r12d,%ebx
mov    %r12d,%edi
mov    %r14,%rsi
mov    $0x17,%edx
call   1060 <write@plt>
mov    %r12d,%edi
mov    %r15,%rsi
mov    $0x40,%edx
call   10c0 <read@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    18ab <main+0x69b>
lea    0xb38(%rip),%rdi
lea    -0xd0(%rbp),%rsi
xor    %eax,%eax
call   10b0 <test_msg@plt>
lea    0xb3d(%rip),%rdi
xor    %eax,%eax
call   10b0 <test_msg@plt>
mov    -0x48(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x28b7(%rip),%rax
mov    (%rax),%ecx
lea    0x8e6(%rip),%rdi
lea    0x902(%rip),%rsi
mov    $0x2f,%edx
jmp    18c7 <main+0x6b7>
mov    0x2896(%rip),%rax
mov    (%rax),%ecx
lea    0x995(%rip),%rdi
lea    0x8e1(%rip),%rsi
mov    $0x43,%edx
jmp    18c7 <main+0x6b7>
mov    0x2875(%rip),%rax
mov    (%rax),%ecx
lea    0x9d9(%rip),%rdi
lea    0x8c0(%rip),%rsi
mov    $0x5b,%edx
jmp    18c7 <main+0x6b7>
mov    0x2854(%rip),%rax
mov    (%rax),%ecx
lea    0x9b8(%rip),%rdi
lea    0x89f(%rip),%rsi
mov    $0x61,%edx
jmp    18c7 <main+0x6b7>
mov    0x2833(%rip),%rax
mov    (%rax),%ecx
lea    0x9b7(%rip),%rdi
lea    0x87e(%rip),%rsi
mov    $0x67,%edx
jmp    18c7 <main+0x6b7>
mov    0x2812(%rip),%rax
mov    (%rax),%ecx
lea    0x996(%rip),%rdi
lea    0x85d(%rip),%rsi
mov    $0x6d,%edx
jmp    18c7 <main+0x6b7>
mov    0x27f1(%rip),%rax
mov    (%rax),%ecx
lea    0x955(%rip),%rdi
lea    0x83c(%rip),%rsi
mov    $0x73,%edx
jmp    18c7 <main+0x6b7>
mov    0x27d0(%rip),%rax
mov    (%rax),%ecx
lea    0x954(%rip),%rdi
lea    0x81b(%rip),%rsi
mov    $0x7a,%edx
jmp    18c7 <main+0x6b7>
mov    0x27af(%rip),%rax
mov    (%rax),%ecx
lea    0x968(%rip),%rdi
lea    0x7fa(%rip),%rsi
mov    $0x83,%edx
jmp    18c7 <main+0x6b7>
mov    0x278e(%rip),%rax
mov    (%rax),%ecx
lea    0x947(%rip),%rdi
lea    0x7d9(%rip),%rsi
mov    $0x8c,%edx
jmp    18c7 <main+0x6b7>
mov    0x2770(%rip),%rax
mov    (%rax),%ecx
lea    0x929(%rip),%rdi
lea    0x7bb(%rip),%rsi
mov    $0x95,%edx
jmp    18c7 <main+0x6b7>
mov    0x2752(%rip),%rax
mov    (%rax),%ecx
lea    0x90b(%rip),%rdi
lea    0x79d(%rip),%rsi
mov    $0xa2,%edx
jmp    18c7 <main+0x6b7>
mov    0x2734(%rip),%rax
mov    (%rax),%ecx
lea    0x8ed(%rip),%rdi
lea    0x77f(%rip),%rsi
mov    $0xab,%edx
jmp    18c7 <main+0x6b7>
mov    0x2716(%rip),%rax
mov    (%rax),%ecx
lea    0x8cf(%rip),%rdi
lea    0x761(%rip),%rsi
mov    $0xb4,%edx
xor    %eax,%eax
call   10b0 <test_msg@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_un = type { i32, i8* }
@PATH_MAX = global i32 0
@.str = [35 x i8] c"FAIL: %s:%d: getcwd\0A (errno = %d)\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/zdtm/live/static/sockets_dgram.c\00"
@errno = global i32 0
@.str.2 = [15 x i8] c"%s/test-socket\00"
@AF_UNIX = global i8* null
@SOCK_DGRAM = global i32 0
@.str.3 = [34 x i8] c"FAIL: %s:%d: socket (errno = %d)\0A\00"
@.str.4 = [21 x i8] c"%s/test-socket-bound\00"
@.str.5 = [20 x i8] c"%s/test-socket-conn\00"
@.str.6 = [26 x i8] c"%s/test-socket-bound-conn\00"
@.str.7 = [32 x i8] c"FAIL: %s:%d: bind (errno = %d)\0A\00"
@.str.8 = [35 x i8] c"FAIL: %s:%d: connect (errno = %d)\0A\00"
@.str.9 = [18 x i8] c"data-packet-bound\00"
@.str.10 = [43 x i8] c"FAIL: %s:%d: data corrupted\0A (errno = %d)\0A\00"
@.str.11 = [26 x i8] c"dgram-bound : '%s'\0A\00"
@.str.12 = [17 x i8] c"data-packet-conn\00"
@.str.13 = [26 x i8] c"dgram-conn : '%s'\0A\00"
@.str.14 = [23 x i8] c"data-packet-bound-conn\00"
@.str.15 = [26 x i8] c"dgram-bound-conn : '%s'\0A\00"
@.str.16 = [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 %struct.sockaddr_un
%7 = alloca %struct.sockaddr_un
%8 = alloca %struct.sockaddr_un
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i64
%17 = alloca [64 x i8]
%18 = alloca i8*
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* @PATH_MAX
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %15
%23 = alloca i8, i64 %21
store i64 %21, i64* %16
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = call i32 @test_init(i32 %24, i8** %25)
%27 = call i8* (...) @get_current_dir_name()
store i8* %27, i8** %18
%28 = load i8*, i8** %18
%29 = icmp ne i8* %28, null
br i1 %29, label %34, label %30
30: ; preds = %2
%31 = load i32, i32* @errno
%32 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 47, i32 %31)
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %2
%35 = trunc i64 %21 to i32
%36 = load i8*, i8** %18
%37 = call i32 @snprintf(i8* %23, i32 %35, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = call i32 @unlink(i8* %23)
%39 = load i8*, i8** @AF_UNIX
%40 = load i32, i32* @SOCK_DGRAM
%41 = call i32 @socket(i8* %39, i32 %40, i32 0)
store i32 %41, i32* %9
%42 = load i8*, i8** @AF_UNIX
%43 = load i32, i32* @SOCK_DGRAM
%44 = call i32 @socket(i8* %42, i32 %43, i32 0)
store i32 %44, i32* %10
%45 = load i8*, i8** @AF_UNIX
%46 = load i32, i32* @SOCK_DGRAM
%47 = call i32 @socket(i8* %45, i32 %46, i32 0)
store i32 %47, i32* %11
%48 = load i8*, i8** @AF_UNIX
%49 = load i32, i32* @SOCK_DGRAM
%50 = call i32 @socket(i8* %48, i32 %49, i32 0)
store i32 %50, i32* %12
%51 = load i8*, i8** @AF_UNIX
%52 = load i32, i32* @SOCK_DGRAM
%53 = call i32 @socket(i8* %51, i32 %52, i32 0)
store i32 %53, i32* %13
%54 = load i8*, i8** @AF_UNIX
%55 = load i32, i32* @SOCK_DGRAM
%56 = call i32 @socket(i8* %54, i32 %55, i32 0)
store i32 %56, i32* %14
%57 = load i32, i32* %13
%58 = icmp slt i32 %57, 0
br i1 %58, label %74, label %59
59: ; preds = %34
%60 = load i32, i32* %10
%61 = icmp slt i32 %60, 0
br i1 %61, label %74, label %62
62: ; preds = %59
%63 = load i32, i32* %11
%64 = icmp slt i32 %63, 0
br i1 %64, label %74, label %65
65: ; preds = %62
%66 = load i32, i32* %12
%67 = icmp slt i32 %66, 0
br i1 %67, label %74, label %68
68: ; preds = %65
%69 = load i32, i32* %13
%70 = icmp slt i32 %69, 0
br i1 %70, label %74, label %71
71: ; preds = %68
%72 = load i32, i32* %14
%73 = icmp slt i32 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %71, %68, %65, %62, %59, %34
%75 = load i32, i32* @errno
%76 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 67, i32 %75)
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %71
%79 = trunc i64 %21 to i32
%80 = load i8*, i8** %18
%81 = call i32 @snprintf(i8* %23, i32 %79, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %80)
%82 = call i32 @unlink(i8* %23)
%83 = load i8*, i8** @AF_UNIX
%84 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %6, i32 0, i32 1
store i8* %83, i8** %84
%85 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %6, i32 0, i32 0
%86 = load i32, i32* %85
%87 = call i32 @strncpy(i32 %86, i8* %23, i32 4)
%88 = trunc i64 %21 to i32
%89 = load i8*, i8** %18
%90 = call i32 @snprintf(i8* %23, i32 %88, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %89)
%91 = call i32 @unlink(i8* %23)
%92 = load i8*, i8** @AF_UNIX
%93 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %7, i32 0, i32 1
store i8* %92, i8** %93
%94 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %7, i32 0, i32 0
%95 = load i32, i32* %94
%96 = call i32 @strncpy(i32 %95, i8* %23, i32 4)
%97 = trunc i64 %21 to i32
%98 = load i8*, i8** %18
%99 = call i32 @snprintf(i8* %23, i32 %97, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %98)
%100 = call i32 @unlink(i8* %23)
%101 = load i8*, i8** @AF_UNIX
%102 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %8, i32 0, i32 1
store i8* %101, i8** %102
%103 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %8, i32 0, i32 0
%104 = load i32, i32* %103
%105 = call i32 @strncpy(i32 %104, i8* %23, i32 4)
%106 = load i32, i32* %10
%107 = call i32 @bind(i32 %106, %struct.sockaddr_un* %6, i32 16)
store i32 %107, i32* %19
%108 = load i32, i32* %19
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %114
110: ; preds = %78
%111 = load i32, i32* @errno
%112 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 91, i32 %111)
%113 = call i32 @exit(i32 1)
unreachable
114: ; preds = %78
%115 = load i32, i32* %13
%116 = call i32 @bind(i32 %115, %struct.sockaddr_un* %7, i32 16)
store i32 %116, i32* %19
%117 = load i32, i32* %19
%118 = icmp ne i32 %117, 0
br i1 %118, label %119, label %123
119: ; preds = %114
%120 = load i32, i32* @errno
%121 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 97, i32 %120)
%122 = call i32 @exit(i32 1)
unreachable
123: ; preds = %114
%124 = load i32, i32* %11
%125 = call i32 @connect(i32 %124, %struct.sockaddr_un* %7, i32 16)
store i32 %125, i32* %19
%126 = load i32, i32* %19
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %132
128: ; preds = %123
%129 = load i32, i32* @errno
%130 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 103, i32 %129)
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %123
%133 = load i32, i32* %12
%134 = call i32 @connect(i32 %133, %struct.sockaddr_un* %7, i32 16)
store i32 %134, i32* %19
%135 = load i32, i32* %19
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %141
137: ; preds = %132
%138 = load i32, i32* @errno
%139 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 109, i32 %138)
%140 = call i32 @exit(i32 1)
unreachable
141: ; preds = %132
%142 = load i32, i32* %14
%143 = call i32 @bind(i32 %142, %struct.sockaddr_un* %8, i32 16)
store i32 %143, i32* %19
%144 = load i32, i32* %19
%145 = icmp ne i32 %144, 0
br i1 %145, label %146, label %150
146: ; preds = %141
%147 = load i32, i32* @errno
%148 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 115, i32 %147)
%149 = call i32 @exit(i32 1)
unreachable
150: ; preds = %141
%151 = load i32, i32* %14
%152 = call i32 @connect(i32 %151, %struct.sockaddr_un* %8, i32 16)
store i32 %152, i32* %19
%153 = load i32, i32* %19
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %159
155: ; preds = %150
%156 = load i32, i32* @errno
%157 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 122, i32 %156)
%158 = call i32 @exit(i32 1)
unreachable
159: ; preds = %150
%160 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%161 = call i32 @memset(i8* %160, i32 0, i32 64)
%162 = load i32, i32* %9
%163 = call i32 @sendto(i32 %162, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 18, i32 0, %struct.sockaddr_un* %6, i32 16)
%164 = load i32, i32* %10
%165 = bitcast [64 x i8]* %17 to i8**
%166 = call i32 @read(i32 %164, i8** %165, i32 64)
%167 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%168 = call i64 @strcmp(i8* %167, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%169 = icmp ne i64 %168, 0
br i1 %169, label %170, label %174
170: ; preds = %159
%171 = load i32, i32* @errno
%172 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 131, i32 %171)
%173 = call i32 @exit(i32 1)
unreachable
174: ; preds = %159
%175 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%176 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* %175)
%177 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%178 = call i32 @memset(i8* %177, i32 0, i32 64)
%179 = load i32, i32* %11
%180 = call i32 @write(i32 %179, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 17)
%181 = load i32, i32* %13
%182 = bitcast [64 x i8]* %17 to i8**
%183 = call i32 @read(i32 %181, i8** %182, i32 64)
%184 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%185 = call i64 @strcmp(i8* %184, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%186 = icmp ne i64 %185, 0
br i1 %186, label %187, label %191
187: ; preds = %174
%188 = load i32, i32* @errno
%189 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 140, i32 %188)
%190 = call i32 @exit(i32 1)
unreachable
191: ; preds = %174
%192 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%193 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* %192)
%194 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%195 = call i32 @memset(i8* %194, i32 0, i32 64)
%196 = load i32, i32* %14
%197 = call i32 @write(i32 %196, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 23)
%198 = load i32, i32* %14
%199 = bitcast [64 x i8]* %17 to i8**
%200 = call i32 @read(i32 %198, i8** %199, i32 64)
%201 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%202 = call i64 @strcmp(i8* %201, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%203 = icmp ne i64 %202, 0
br i1 %203, label %204, label %208
204: ; preds = %191
%205 = load i32, i32* @errno
%206 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 149, i32 %205)
%207 = call i32 @exit(i32 1)
unreachable
208: ; preds = %191
%209 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%210 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* %209)
%211 = call i32 (...) @test_daemon()
%212 = call i32 (...) @test_waitsig()
%213 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%214 = call i32 @memset(i8* %213, i32 0, i32 64)
%215 = load i32, i32* %9
%216 = call i32 @sendto(i32 %215, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 18, i32 0, %struct.sockaddr_un* %6, i32 16)
%217 = load i32, i32* %10
%218 = bitcast [64 x i8]* %17 to i8**
%219 = call i32 @read(i32 %217, i8** %218, i32 64)
%220 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%221 = call i64 @strcmp(i8* %220, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%222 = icmp ne i64 %221, 0
br i1 %222, label %223, label %227
223: ; preds = %208
%224 = load i32, i32* @errno
%225 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 162, i32 %224)
%226 = call i32 @exit(i32 1)
unreachable
227: ; preds = %208
%228 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%229 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* %228)
%230 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%231 = call i32 @memset(i8* %230, i32 0, i32 64)
%232 = load i32, i32* %11
%233 = call i32 @write(i32 %232, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 17)
%234 = load i32, i32* %13
%235 = bitcast [64 x i8]* %17 to i8**
%236 = call i32 @read(i32 %234, i8** %235, i32 64)
%237 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%238 = call i64 @strcmp(i8* %237, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%239 = icmp ne i64 %238, 0
br i1 %239, label %240, label %244
240: ; preds = %227
%241 = load i32, i32* @errno
%242 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 171, i32 %241)
%243 = call i32 @exit(i32 1)
unreachable
244: ; preds = %227
%245 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%246 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* %245)
%247 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%248 = call i32 @memset(i8* %247, i32 0, i32 64)
%249 = load i32, i32* %14
%250 = call i32 @write(i32 %249, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 23)
%251 = load i32, i32* %14
%252 = bitcast [64 x i8]* %17 to i8**
%253 = call i32 @read(i32 %251, i8** %252, i32 64)
%254 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%255 = call i64 @strcmp(i8* %254, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%256 = icmp ne i64 %255, 0
br i1 %256, label %257, label %261
257: ; preds = %244
%258 = load i32, i32* @errno
%259 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 180, i32 %258)
%260 = call i32 @exit(i32 1)
unreachable
261: ; preds = %244
%262 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%263 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* %262)
%264 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %3
%265 = load i8*, i8** %15
%266 = load i32, i32* %3
ret i32 %266
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32, i8* }
@PATH_MAX = global i32 0
@.str = [35 x i8] c"FAIL: %s:%d: getcwd\0A (errno = %d)\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/zdtm/live/static/sockets_dgram.c\00"
@errno = global i32 0
@.str.2 = [15 x i8] c"%s/test-socket\00"
@AF_UNIX = global i8* null
@SOCK_DGRAM = global i32 0
@.str.3 = [34 x i8] c"FAIL: %s:%d: socket (errno = %d)\0A\00"
@.str.4 = [21 x i8] c"%s/test-socket-bound\00"
@.str.5 = [20 x i8] c"%s/test-socket-conn\00"
@.str.6 = [26 x i8] c"%s/test-socket-bound-conn\00"
@.str.7 = [32 x i8] c"FAIL: %s:%d: bind (errno = %d)\0A\00"
@.str.8 = [35 x i8] c"FAIL: %s:%d: connect (errno = %d)\0A\00"
@.str.9 = [18 x i8] c"data-packet-bound\00"
@.str.10 = [43 x i8] c"FAIL: %s:%d: data corrupted\0A (errno = %d)\0A\00"
@.str.11 = [26 x i8] c"dgram-bound : '%s'\0A\00"
@.str.12 = [17 x i8] c"data-packet-conn\00"
@.str.13 = [26 x i8] c"dgram-conn : '%s'\0A\00"
@.str.14 = [23 x i8] c"data-packet-bound-conn\00"
@.str.15 = [26 x i8] c"dgram-bound-conn : '%s'\0A\00"
@.str.16 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_un
%4 = alloca %struct.sockaddr_un
%5 = alloca %struct.sockaddr_un
%6 = alloca [64 x i8]
%7 = bitcast %struct.sockaddr_un* %3 to i8*
%8 = bitcast %struct.sockaddr_un* %4 to i8*
%9 = bitcast %struct.sockaddr_un* %5 to i8*
%10 = load i32, i32* @PATH_MAX
%11 = zext i32 %10 to i64
%12 = tail call i8* @llvm.stacksave()
%13 = alloca i8, i64 %11
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%15 = tail call i32 @test_init(i32 %0, i8** %1)
%16 = tail call i8* (...) @get_current_dir_name()
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32, i32* @errno
%20 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 47, i32 %19)
%21 = tail call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = call i32 @snprintf(i8* %13, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%24 = call i32 @unlink(i8* %13)
%25 = load i8*, i8** @AF_UNIX
%26 = load i32, i32* @SOCK_DGRAM
%27 = call i32 @socket(i8* %25, i32 %26, i32 0)
%28 = load i8*, i8** @AF_UNIX
%29 = load i32, i32* @SOCK_DGRAM
%30 = call i32 @socket(i8* %28, i32 %29, i32 0)
%31 = load i8*, i8** @AF_UNIX
%32 = load i32, i32* @SOCK_DGRAM
%33 = call i32 @socket(i8* %31, i32 %32, i32 0)
%34 = load i8*, i8** @AF_UNIX
%35 = load i32, i32* @SOCK_DGRAM
%36 = call i32 @socket(i8* %34, i32 %35, i32 0)
%37 = load i8*, i8** @AF_UNIX
%38 = load i32, i32* @SOCK_DGRAM
%39 = call i32 @socket(i8* %37, i32 %38, i32 0)
%40 = load i8*, i8** @AF_UNIX
%41 = load i32, i32* @SOCK_DGRAM
%42 = call i32 @socket(i8* %40, i32 %41, i32 0)
%43 = icmp slt i32 %39, 0
%44 = icmp slt i32 %30, 0
%45 = select i1 %43, i1 true, i1 %44
%46 = icmp slt i32 %33, 0
%47 = select i1 %45, i1 true, i1 %46
%48 = icmp slt i32 %36, 0
%49 = select i1 %47, i1 true, i1 %48
%50 = select i1 %49, i1 true, i1 %43
%51 = icmp slt i32 %42, 0
%52 = select i1 %50, i1 true, i1 %51
br i1 %52, label %53, label %57
53: ; preds = %22
%54 = load i32, i32* @errno
%55 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 67, i32 %54)
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %22
%58 = call i32 @snprintf(i8* %13, i32 %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%59 = call i32 @unlink(i8* %13)
%60 = load i8*, i8** @AF_UNIX
%61 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 1
store i8* %60, i8** %61
%62 = call i32 @strncpy(i32 undef, i8* %13, i32 4)
%63 = call i32 @snprintf(i8* %13, i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %16)
%64 = call i32 @unlink(i8* %13)
%65 = load i8*, i8** @AF_UNIX
%66 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %4, i64 0, i32 1
store i8* %65, i8** %66
%67 = call i32 @strncpy(i32 undef, i8* %13, i32 4)
%68 = call i32 @snprintf(i8* %13, i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %16)
%69 = call i32 @unlink(i8* %13)
%70 = load i8*, i8** @AF_UNIX
%71 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i64 0, i32 1
store i8* %70, i8** %71
%72 = call i32 @strncpy(i32 undef, i8* %13, i32 4)
%73 = call i32 @bind(i32 %30, %struct.sockaddr_un* %3, i32 16)
%74 = icmp eq i32 %73, 0
br i1 %74, label %79, label %75
75: ; preds = %57
%76 = load i32, i32* @errno
%77 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 91, i32 %76)
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %57
%80 = call i32 @bind(i32 %39, %struct.sockaddr_un* %4, i32 16)
%81 = icmp eq i32 %80, 0
br i1 %81, label %86, label %82
82: ; preds = %79
%83 = load i32, i32* @errno
%84 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 97, i32 %83)
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %79
%87 = call i32 @connect(i32 %33, %struct.sockaddr_un* %4, i32 16)
%88 = icmp eq i32 %87, 0
br i1 %88, label %93, label %89
89: ; preds = %86
%90 = load i32, i32* @errno
%91 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 103, i32 %90)
%92 = call i32 @exit(i32 1)
unreachable
93: ; preds = %86
%94 = call i32 @connect(i32 %36, %struct.sockaddr_un* %4, i32 16)
%95 = icmp eq i32 %94, 0
br i1 %95, label %100, label %96
96: ; preds = %93
%97 = load i32, i32* @errno
%98 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 109, i32 %97)
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %93
%101 = call i32 @bind(i32 %42, %struct.sockaddr_un* %5, i32 16)
%102 = icmp eq i32 %101, 0
br i1 %102, label %107, label %103
103: ; preds = %100
%104 = load i32, i32* @errno
%105 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 115, i32 %104)
%106 = call i32 @exit(i32 1)
unreachable
107: ; preds = %100
%108 = call i32 @connect(i32 %42, %struct.sockaddr_un* %5, i32 16)
%109 = icmp eq i32 %108, 0
br i1 %109, label %114, label %110
110: ; preds = %107
%111 = load i32, i32* @errno
%112 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 122, i32 %111)
%113 = call i32 @exit(i32 1)
unreachable
114: ; preds = %107
%115 = call i32 @memset(i8* %14, i32 0, i32 64)
%116 = call i32 @sendto(i32 %27, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 18, i32 0, %struct.sockaddr_un* %3, i32 16)
%117 = bitcast [64 x i8]* %6 to i8**
%118 = call i32 @read(i32 %30, i8** %117, i32 64)
%119 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%120 = icmp eq i64 %119, 0
br i1 %120, label %125, label %121
121: ; preds = %114
%122 = load i32, i32* @errno
%123 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 131, i32 %122)
%124 = call i32 @exit(i32 1)
unreachable
125: ; preds = %114
%126 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* %14)
%127 = call i32 @memset(i8* %14, i32 0, i32 64)
%128 = call i32 @write(i32 %33, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 17)
%129 = call i32 @read(i32 %39, i8** %117, i32 64)
%130 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%131 = icmp eq i64 %130, 0
br i1 %131, label %136, label %132
132: ; preds = %125
%133 = load i32, i32* @errno
%134 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 140, i32 %133)
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %125
%137 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* %14)
%138 = call i32 @memset(i8* %14, i32 0, i32 64)
%139 = call i32 @write(i32 %42, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 23)
%140 = call i32 @read(i32 %42, i8** %117, i32 64)
%141 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%142 = icmp eq i64 %141, 0
br i1 %142, label %147, label %143
143: ; preds = %136
%144 = load i32, i32* @errno
%145 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 149, i32 %144)
%146 = call i32 @exit(i32 1)
unreachable
147: ; preds = %136
%148 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* %14)
%149 = call i32 (...) @test_daemon()
%150 = call i32 (...) @test_waitsig()
%151 = call i32 @memset(i8* %14, i32 0, i32 64)
%152 = call i32 @sendto(i32 %27, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 18, i32 0, %struct.sockaddr_un* %3, i32 16)
%153 = call i32 @read(i32 %30, i8** %117, i32 64)
%154 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%155 = icmp eq i64 %154, 0
br i1 %155, label %160, label %156
156: ; preds = %147
%157 = load i32, i32* @errno
%158 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 162, i32 %157)
%159 = call i32 @exit(i32 1)
unreachable
160: ; preds = %147
%161 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* %14)
%162 = call i32 @memset(i8* %14, i32 0, i32 64)
%163 = call i32 @write(i32 %33, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 17)
%164 = call i32 @read(i32 %39, i8** %117, i32 64)
%165 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%166 = icmp eq i64 %165, 0
br i1 %166, label %171, label %167
167: ; preds = %160
%168 = load i32, i32* @errno
%169 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 171, i32 %168)
%170 = call i32 @exit(i32 1)
unreachable
171: ; preds = %160
%172 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* %14)
%173 = call i32 @memset(i8* %14, i32 0, i32 64)
%174 = call i32 @write(i32 %42, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 23)
%175 = call i32 @read(i32 %42, i8** %117, i32 64)
%176 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%177 = icmp eq i64 %176, 0
br i1 %177, label %182, label %178
178: ; preds = %171
%179 = load i32, i32* @errno
%180 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 180, i32 %179)
%181 = call i32 @exit(i32 1)
unreachable
182: ; preds = %171
%183 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* %14)
%184 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
ret i32 0
}