#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*/ free(char *);
int /*<<< orphan*/ grid_sleep(int);
char *malloc(int);
int /*<<< orphan*/ test_bind_impl(char *, int, int, char *);
int /*<<< orphan*/ test_close_impl(char *, int, int);
int /*<<< orphan*/ test_connect_impl(char *, int, int, char *);
int /*<<< orphan*/ test_recv_impl(char *, int, int, char *);
int /*<<< orphan*/ test_send_impl(char *, int, int, char *);
int test_socket_impl(char *, int, int, scalar_t__);
int main() {
  int sb;
  int sc;
  int i;
  int s1, s2;
  int size;
  char *buf;
  sc = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      45, (1), ((1 * 16 + 0)));
  test_connect_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      46, (sc), ("ipc://test.ipc"));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      47, (sc));
  sc = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      50, (1), ((1 * 16 + 0)));
  test_connect_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      51, (sc), ("ipc://test.ipc"));
  grid_sleep(200);
  sb = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      56, (1), ((1 * 16 + 0)));
  test_bind_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      57, (sb), ("ipc://test.ipc"));
  for (i = 0; i != 1; ++i) {
    test_send_impl(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
        61, (sc), ("0123456789012345678901234567890123456789"));
    test_recv_impl(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
        62, (sb), ("0123456789012345678901234567890123456789"));
    test_send_impl(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
        63, (sb), ("0123456789012345678901234567890123456789"));
    test_recv_impl(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
        64, (sc), ("0123456789012345678901234567890123456789"));
  }
  for (i = 0; i != 100; ++i) {
    test_send_impl(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
        69, (sc), ("XYZ"));
  }
  for (i = 0; i != 100; ++i) {
    test_recv_impl(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
        72, (sb), ("XYZ"));
  }
  size = 10000;
  buf = malloc(size);
  for (i = 0; i < size; ++i) {
    buf[i] = 48 + i % 10;
  }
  buf[size - 1] = '\0';
  test_send_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      82, (sc), (buf));
  test_recv_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      83, (sb), (buf));
  free(buf);
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      86, (sc));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      87, (sb));
  sb = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      90, (1), ((1 * 16 + 0)));
  test_bind_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      91, (sb), ("ipc://test.ipc"));
  s1 = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      92, (1), ((1 * 16 + 0)));
  test_connect_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      93, (s1), ("ipc://test.ipc"));
  s2 = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      94, (1), ((1 * 16 + 0)));
  test_connect_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      95, (s2), ("ipc://test.ipc"));
  grid_sleep(100);
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      97, (s2));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      98, (s1));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      99, (sb));
  sb = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      102, (1), ((1 * 16 + 0)));
  test_bind_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      103, (sb), ("ipc://test.ipc"));
  s1 = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      104, (1), ((1 * 16 + 0)));
  test_bind_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      105, (s1), ("ipc://test.ipc"));
  sc = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      106, (1), ((1 * 16 + 0)));
  test_connect_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      107, (sc), ("ipc://test.ipc"));
  grid_sleep(100);
  test_send_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      109, (sb), ("ABC"));
  test_recv_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      110, (sc), ("ABC"));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      111, (sb));
  test_send_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      112, (s1), ("ABC"));
  test_recv_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      113, (sc), ("ABC"));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      114, (sc));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      115, (s1));
  sb = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      118, (1), ((1 * 16 + 0)));
  test_bind_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      119, (sb), ("ipc://test.ipc"));
  grid_sleep(100);
  s1 = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      121, (1), ((1 * 16 + 0)));
  test_bind_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      122, (s1), ("ipc://test.ipc"));
  sc = test_socket_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      123, (1), ((1 * 16 + 0)));
  test_connect_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      124, (sc), ("ipc://test.ipc"));
  grid_sleep(100);
  test_send_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      126, (sb), ("ABC"));
  test_recv_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      127, (sc), ("ABC"));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      128, (s1));
  test_send_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      129, (sb), ("ABC"));
  test_recv_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      130, (sc), ("ABC"));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      131, (sb));
  test_close_impl(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c",
      132, (sc));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5a(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xe39(%rip),%rdi
mov    $0x2e,%esi
lea    0xeaf(%rip),%rcx
call   1090 <test_connect_impl@plt>
mov    -0xc(%rbp),%edx
lea    0xe1e(%rip),%rdi
mov    $0x2f,%esi
call   1050 <test_close_impl@plt>
lea    0xe0d(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xdec(%rip),%rdi
mov    $0x33,%esi
lea    0xe62(%rip),%rcx
call   1090 <test_connect_impl@plt>
mov    $0xc8,%edi
call   1060 <grid_sleep@plt>
lea    0xdca(%rip),%rdi
mov    $0x38,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xda9(%rip),%rdi
mov    $0x39,%esi
lea    0xe1f(%rip),%rcx
call   10a0 <test_bind_impl@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     12f3 <main+0x163>
mov    -0xc(%rbp),%edx
lea    0xd7d(%rip),%rdi
mov    $0x3d,%esi
lea    0xe02(%rip),%rcx
call   1070 <test_send_impl@plt>
mov    -0x8(%rbp),%edx
lea    0xd62(%rip),%rdi
mov    $0x3e,%esi
lea    0xde7(%rip),%rcx
call   1040 <test_recv_impl@plt>
mov    -0x8(%rbp),%edx
lea    0xd47(%rip),%rdi
mov    $0x3f,%esi
lea    0xdcc(%rip),%rcx
call   1070 <test_send_impl@plt>
mov    -0xc(%rbp),%edx
lea    0xd2c(%rip),%rdi
mov    $0x40,%esi
lea    0xdb1(%rip),%rcx
call   1040 <test_recv_impl@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    126f <main+0xdf>
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
je     132d <main+0x19d>
mov    -0xc(%rbp),%edx
lea    0xcf2(%rip),%rdi
mov    $0x45,%esi
lea    0xda0(%rip),%rcx
call   1070 <test_send_impl@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12fa <main+0x16a>
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
je     1367 <main+0x1d7>
mov    -0x8(%rbp),%edx
lea    0xcb8(%rip),%rdi
mov    $0x48,%esi
lea    0xd66(%rip),%rcx
call   1040 <test_recv_impl@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1334 <main+0x1a4>
movl   $0x2710,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13b4 <main+0x224>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x28(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1381 <main+0x1f1>
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%edx
mov    -0x28(%rbp),%rcx
lea    0xc2d(%rip),%rdi
mov    $0x52,%esi
call   1070 <test_send_impl@plt>
mov    -0x8(%rbp),%edx
mov    -0x28(%rbp),%rcx
lea    0xc15(%rip),%rdi
mov    $0x53,%esi
call   1040 <test_recv_impl@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%edx
lea    0xbf8(%rip),%rdi
mov    $0x56,%esi
call   1050 <test_close_impl@plt>
mov    -0x8(%rbp),%edx
lea    0xbe4(%rip),%rdi
mov    $0x57,%esi
call   1050 <test_close_impl@plt>
lea    0xbd3(%rip),%rdi
mov    $0x5a,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xbb2(%rip),%rdi
mov    $0x5b,%esi
lea    0xc28(%rip),%rcx
call   10a0 <test_bind_impl@plt>
lea    0xb9a(%rip),%rdi
mov    $0x5c,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
lea    0xb79(%rip),%rdi
mov    $0x5d,%esi
lea    0xbef(%rip),%rcx
call   1090 <test_connect_impl@plt>
lea    0xb61(%rip),%rdi
mov    $0x5e,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edx
lea    0xb40(%rip),%rdi
mov    $0x5f,%esi
lea    0xbb6(%rip),%rcx
call   1090 <test_connect_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
mov    -0x18(%rbp),%edx
lea    0xb1b(%rip),%rdi
mov    $0x61,%esi
call   1050 <test_close_impl@plt>
mov    -0x14(%rbp),%edx
lea    0xb07(%rip),%rdi
mov    $0x62,%esi
call   1050 <test_close_impl@plt>
mov    -0x8(%rbp),%edx
lea    0xaf3(%rip),%rdi
mov    $0x63,%esi
call   1050 <test_close_impl@plt>
lea    0xae2(%rip),%rdi
mov    $0x66,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xac1(%rip),%rdi
mov    $0x67,%esi
lea    0xb37(%rip),%rcx
call   10a0 <test_bind_impl@plt>
lea    0xaa9(%rip),%rdi
mov    $0x68,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
lea    0xa88(%rip),%rdi
mov    $0x69,%esi
lea    0xafe(%rip),%rcx
call   10a0 <test_bind_impl@plt>
lea    0xa70(%rip),%rdi
mov    $0x6a,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xa4f(%rip),%rdi
mov    $0x6b,%esi
lea    0xac5(%rip),%rcx
call   1090 <test_connect_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
mov    -0x8(%rbp),%edx
lea    0xa2a(%rip),%rdi
mov    $0x6d,%esi
lea    0xadc(%rip),%rcx
call   1070 <test_send_impl@plt>
mov    -0xc(%rbp),%edx
lea    0xa0f(%rip),%rdi
mov    $0x6e,%esi
lea    0xac1(%rip),%rcx
call   1040 <test_recv_impl@plt>
mov    -0x8(%rbp),%edx
lea    0x9f4(%rip),%rdi
mov    $0x6f,%esi
call   1050 <test_close_impl@plt>
mov    -0x14(%rbp),%edx
lea    0x9e0(%rip),%rdi
mov    $0x70,%esi
lea    0xa92(%rip),%rcx
call   1070 <test_send_impl@plt>
mov    -0xc(%rbp),%edx
lea    0x9c5(%rip),%rdi
mov    $0x71,%esi
lea    0xa77(%rip),%rcx
call   1040 <test_recv_impl@plt>
mov    -0xc(%rbp),%edx
lea    0x9aa(%rip),%rdi
mov    $0x72,%esi
call   1050 <test_close_impl@plt>
mov    -0x14(%rbp),%edx
lea    0x996(%rip),%rdi
mov    $0x73,%esi
call   1050 <test_close_impl@plt>
lea    0x985(%rip),%rdi
mov    $0x76,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0x964(%rip),%rdi
mov    $0x77,%esi
lea    0x9da(%rip),%rcx
call   10a0 <test_bind_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
lea    0x942(%rip),%rdi
mov    $0x79,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
lea    0x921(%rip),%rdi
mov    $0x7a,%esi
lea    0x997(%rip),%rcx
call   10a0 <test_bind_impl@plt>
lea    0x909(%rip),%rdi
mov    $0x7b,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   10b0 <test_socket_impl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0x8e8(%rip),%rdi
mov    $0x7c,%esi
lea    0x95e(%rip),%rcx
call   1090 <test_connect_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
mov    -0x8(%rbp),%edx
lea    0x8c3(%rip),%rdi
mov    $0x7e,%esi
lea    0x975(%rip),%rcx
call   1070 <test_send_impl@plt>
mov    -0xc(%rbp),%edx
lea    0x8a8(%rip),%rdi
mov    $0x7f,%esi
lea    0x95a(%rip),%rcx
call   1040 <test_recv_impl@plt>
mov    -0x14(%rbp),%edx
lea    0x88d(%rip),%rdi
mov    $0x80,%esi
call   1050 <test_close_impl@plt>
mov    -0x8(%rbp),%edx
lea    0x879(%rip),%rdi
mov    $0x81,%esi
lea    0x92b(%rip),%rcx
call   1070 <test_send_impl@plt>
mov    -0xc(%rbp),%edx
lea    0x85e(%rip),%rdi
mov    $0x82,%esi
lea    0x910(%rip),%rcx
call   1040 <test_recv_impl@plt>
mov    -0x8(%rbp),%edx
lea    0x843(%rip),%rdi
mov    $0x83,%esi
call   1050 <test_close_impl@plt>
mov    -0xc(%rbp),%edx
lea    0x82f(%rip),%rdi
mov    $0x84,%esi
call   1050 <test_close_impl@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%r14
mov    $0x10,%ecx
mov    %r14,%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%ebx
lea    0xf30(%rip),%rbp
mov    %r14,%rdi
mov    $0x2e,%esi
mov    %eax,%edx
mov    %rbp,%rcx
call   1090 <test_connect_impl@plt>
mov    %r14,%rdi
mov    $0x2f,%esi
mov    %ebx,%edx
call   1050 <test_close_impl@plt>
mov    $0x10,%ecx
mov    %r14,%rdi
mov    $0x32,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%r12d
mov    %r14,%rdi
mov    $0x33,%esi
mov    %eax,%edx
mov    %rbp,%rcx
call   1090 <test_connect_impl@plt>
mov    $0xc8,%edi
call   1060 <grid_sleep@plt>
mov    $0x10,%ecx
mov    %r14,%rdi
mov    $0x38,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%r13d
mov    %r14,%rdi
mov    $0x39,%esi
mov    %eax,%edx
mov    %rbp,%rcx
call   10a0 <test_bind_impl@plt>
lea    0xeb5(%rip),%rbx
mov    %r14,%rdi
mov    $0x3d,%esi
mov    %r12d,%edx
mov    %rbx,%rcx
call   1070 <test_send_impl@plt>
mov    %r14,%rdi
mov    $0x3e,%esi
mov    %r13d,%edx
mov    %rbx,%rcx
call   1040 <test_recv_impl@plt>
mov    %r14,%rdi
mov    $0x3f,%esi
mov    %r13d,%edx
mov    %rbx,%rcx
call   1070 <test_send_impl@plt>
mov    %r14,%rdi
mov    $0x40,%esi
mov    %r12d,%edx
mov    %rbx,%rcx
call   1040 <test_recv_impl@plt>
mov    $0x64,%ebx
lea    0xe86(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    $0x45,%esi
mov    %r12d,%edx
mov    %rbp,%rcx
call   1070 <test_send_impl@plt>
add    $0xffffffff,%ebx
jne    12b0 <main+0x120>
mov    $0x64,%ebp
lea    0xd9c(%rip),%r14
lea    0xe4f(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x48,%esi
mov    %r13d,%edx
mov    %rbx,%rcx
call   1040 <test_recv_impl@plt>
add    $0xffffffff,%ebp
jne    12e0 <main+0x150>
mov    $0x2710,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
movdqa 0xcf3(%rip),%xmm4
movdqa 0xcfb(%rip),%xmm5
mov    $0x10,%eax
movdqa 0xcfe(%rip),%xmm2
movdqa 0xd06(%rip),%xmm3
movdqa 0xd0d(%rip),%xmm9
movdqa 0xd14(%rip),%xmm8
movdqa 0xd1c(%rip),%xmm6
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movdqa %xmm5,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
movdqa %xmm5,%xmm1
psubw  %xmm7,%xmm1
movdqa %xmm4,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
movdqa %xmm4,%xmm0
psubw  %xmm7,%xmm0
packuswb %xmm0,%xmm1
por    %xmm9,%xmm1
movdqu %xmm1,-0x10(%rbp,%rax,1)
cmp    $0x2710,%rax
je     13f5 <main+0x265>
movdqa %xmm4,%xmm0
paddw  %xmm8,%xmm0
movdqa %xmm5,%xmm1
paddw  %xmm8,%xmm1
movdqa %xmm1,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
psubw  %xmm7,%xmm1
movdqa %xmm0,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
psubw  %xmm7,%xmm0
packuswb %xmm0,%xmm1
por    %xmm9,%xmm1
movdqu %xmm1,0x0(%rbp,%rax,1)
paddw  %xmm6,%xmm5
paddw  %xmm6,%xmm4
add    $0x20,%rax
jmp    1350 <main+0x1c0>
movb   $0x0,0x270f(%rbp)
lea    0xc6d(%rip),%r15
mov    %r15,%rdi
mov    $0x52,%esi
mov    %r12d,%edx
mov    %rbp,%rcx
call   1070 <test_send_impl@plt>
mov    %r15,%rdi
mov    $0x53,%esi
mov    %r13d,%edx
mov    %rbp,%rcx
call   1040 <test_recv_impl@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
mov    $0x56,%esi
mov    %r12d,%edx
call   1050 <test_close_impl@plt>
mov    %r15,%rdi
mov    $0x57,%esi
mov    %r13d,%edx
call   1050 <test_close_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x5a,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%r12d
lea    0xc80(%rip),%r14
mov    %r15,%rdi
mov    $0x5b,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   10a0 <test_bind_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x5c,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    $0x5d,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1090 <test_connect_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x5e,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    $0x5f,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1090 <test_connect_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
mov    %r15,%rdi
mov    $0x61,%esi
mov    %ebx,%edx
call   1050 <test_close_impl@plt>
mov    %r15,%rdi
mov    $0x62,%esi
mov    %ebp,%edx
call   1050 <test_close_impl@plt>
mov    %r15,%rdi
mov    $0x63,%esi
mov    %r12d,%edx
call   1050 <test_close_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x66,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    $0x67,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   10a0 <test_bind_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x68,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%r13d
mov    %r15,%rdi
mov    $0x69,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   10a0 <test_bind_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x6a,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    $0x6b,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1090 <test_connect_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
lea    0xb89(%rip),%r12
mov    %r15,%rdi
mov    $0x6d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
call   1070 <test_send_impl@plt>
mov    %r15,%rdi
mov    $0x6e,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   1040 <test_recv_impl@plt>
mov    %r15,%rdi
mov    $0x6f,%esi
mov    %ebx,%edx
call   1050 <test_close_impl@plt>
mov    %r15,%rdi
mov    $0x70,%esi
mov    %r13d,%edx
mov    %r12,%rcx
call   1070 <test_send_impl@plt>
mov    %r15,%rdi
mov    $0x71,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   1040 <test_recv_impl@plt>
mov    %r15,%rdi
mov    $0x72,%esi
mov    %ebp,%edx
call   1050 <test_close_impl@plt>
mov    %r15,%rdi
mov    $0x73,%esi
mov    %r13d,%edx
call   1050 <test_close_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x76,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    $0x77,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   10a0 <test_bind_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x79,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%r13d
mov    %r15,%rdi
mov    $0x7a,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   10a0 <test_bind_impl@plt>
mov    $0x10,%ecx
mov    %r15,%rdi
mov    $0x7b,%esi
mov    $0x1,%edx
call   10b0 <test_socket_impl@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    $0x7c,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1090 <test_connect_impl@plt>
mov    $0x64,%edi
call   1060 <grid_sleep@plt>
mov    %r15,%rdi
mov    $0x7e,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   1070 <test_send_impl@plt>
mov    %r15,%rdi
mov    $0x7f,%esi
mov    %ebx,%edx
mov    %r12,%rcx
call   1040 <test_recv_impl@plt>
mov    %r15,%rdi
mov    $0x80,%esi
mov    %r13d,%edx
call   1050 <test_close_impl@plt>
mov    %r15,%rdi
mov    $0x81,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   1070 <test_send_impl@plt>
mov    %r15,%rdi
mov    $0x82,%esi
mov    %ebx,%edx
mov    %r12,%rcx
call   1040 <test_recv_impl@plt>
mov    %r15,%rdi
mov    $0x83,%esi
mov    %ebp,%edx
call   1050 <test_close_impl@plt>
mov    %r15,%rdi
mov    $0x84,%esi
mov    %ebx,%edx
call   1050 <test_close_impl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c\00"
@.str.1 = [15 x i8] c"ipc://test.ipc\00"
@.str.2 = [41 x i8] c"0123456789012345678901234567890123456789\00"
@.str.3 = [4 x i8] c"XYZ\00"
@.str.4 = [4 x i8] c"ABC\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %1
%9 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 45, i32 1, i64 16)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 46, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 47, i32 %12)
%14 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 50, i32 1, i64 16)
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 51, i32 %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @grid_sleep(i32 200)
%18 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 56, i32 1, i64 16)
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 57, i32 %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %21
21: ; preds = %33, %0
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = load i32, i32* %3
%26 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 61, i32 %25, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%27 = load i32, i32* %2
%28 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 62, i32 %27, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* %2
%30 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 63, i32 %29, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* %3
%32 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 64, i32 %31, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %24
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %21
36: ; preds = %21
store i32 0, i32* %4
br label %37
37: ; preds = %43, %36
%38 = load i32, i32* %4
%39 = icmp ne i32 %38, 100
br i1 %39, label %40, label %46
40: ; preds = %37
%41 = load i32, i32* %3
%42 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 69, i32 %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %40
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %37
46: ; preds = %37
store i32 0, i32* %4
br label %47
47: ; preds = %53, %46
%48 = load i32, i32* %4
%49 = icmp ne i32 %48, 100
br i1 %49, label %50, label %56
50: ; preds = %47
%51 = load i32, i32* %2
%52 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 72, i32 %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %50
%54 = load i32, i32* %4
%55 = add nsw i32 %54, 1
store i32 %55, i32* %4
br label %47
56: ; preds = %47
store i32 10000, i32* %7
%57 = load i32, i32* %7
%58 = call i8* @malloc(i32 %57)
store i8* %58, i8** %8
store i32 0, i32* %4
br label %59
59: ; preds = %72, %56
%60 = load i32, i32* %4
%61 = load i32, i32* %7
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %75
63: ; preds = %59
%64 = load i32, i32* %4
%65 = srem i32 %64, 10
%66 = add nsw i32 48, %65
%67 = trunc i32 %66 to i8
%68 = load i8*, i8** %8
%69 = load i32, i32* %4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
store i8 %67, i8* %71
br label %72
72: ; preds = %63
%73 = load i32, i32* %4
%74 = add nsw i32 %73, 1
store i32 %74, i32* %4
br label %59
75: ; preds = %59
%76 = load i8*, i8** %8
%77 = load i32, i32* %7
%78 = sub nsw i32 %77, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %76, i64 %79
store i8 0, i8* %80
%81 = load i32, i32* %3
%82 = load i8*, i8** %8
%83 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 82, i32 %81, i8* %82)
%84 = load i32, i32* %2
%85 = load i8*, i8** %8
%86 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 83, i32 %84, i8* %85)
%87 = load i8*, i8** %8
%88 = call i32 @free(i8* %87)
%89 = load i32, i32* %3
%90 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 86, i32 %89)
%91 = load i32, i32* %2
%92 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 87, i32 %91)
%93 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 90, i32 1, i64 16)
store i32 %93, i32* %2
%94 = load i32, i32* %2
%95 = call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 91, i32 %94, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%96 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 92, i32 1, i64 16)
store i32 %96, i32* %5
%97 = load i32, i32* %5
%98 = call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 93, i32 %97, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%99 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 94, i32 1, i64 16)
store i32 %99, i32* %6
%100 = load i32, i32* %6
%101 = call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 95, i32 %100, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%102 = call i32 @grid_sleep(i32 100)
%103 = load i32, i32* %6
%104 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 97, i32 %103)
%105 = load i32, i32* %5
%106 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 98, i32 %105)
%107 = load i32, i32* %2
%108 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 99, i32 %107)
%109 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 102, i32 1, i64 16)
store i32 %109, i32* %2
%110 = load i32, i32* %2
%111 = call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 103, i32 %110, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%112 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 104, i32 1, i64 16)
store i32 %112, i32* %5
%113 = load i32, i32* %5
%114 = call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 105, i32 %113, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%115 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 106, i32 1, i64 16)
store i32 %115, i32* %3
%116 = load i32, i32* %3
%117 = call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 107, i32 %116, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%118 = call i32 @grid_sleep(i32 100)
%119 = load i32, i32* %2
%120 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 109, i32 %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%121 = load i32, i32* %3
%122 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 110, i32 %121, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%123 = load i32, i32* %2
%124 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 111, i32 %123)
%125 = load i32, i32* %5
%126 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 112, i32 %125, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%127 = load i32, i32* %3
%128 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 113, i32 %127, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%129 = load i32, i32* %3
%130 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 114, i32 %129)
%131 = load i32, i32* %5
%132 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 115, i32 %131)
%133 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 118, i32 1, i64 16)
store i32 %133, i32* %2
%134 = load i32, i32* %2
%135 = call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 119, i32 %134, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%136 = call i32 @grid_sleep(i32 100)
%137 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 121, i32 1, i64 16)
store i32 %137, i32* %5
%138 = load i32, i32* %5
%139 = call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 122, i32 %138, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%140 = call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 123, i32 1, i64 16)
store i32 %140, i32* %3
%141 = load i32, i32* %3
%142 = call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 124, i32 %141, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%143 = call i32 @grid_sleep(i32 100)
%144 = load i32, i32* %2
%145 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 126, i32 %144, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%146 = load i32, i32* %3
%147 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 127, i32 %146, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%148 = load i32, i32* %5
%149 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 128, i32 %148)
%150 = load i32, i32* %2
%151 = call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 129, i32 %150, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%152 = load i32, i32* %3
%153 = call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 130, i32 %152, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%154 = load i32, i32* %2
%155 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 131, i32 %154)
%156 = load i32, i32* %3
%157 = call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 132, i32 %156)
ret i32 0
}

LLVM IR (-O2):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gridmq/gridmq/refs/heads/master/t/ipc.c\00"
@.str.1 = [15 x i8] c"ipc://test.ipc\00"
@.str.2 = [41 x i8] c"0123456789012345678901234567890123456789\00"
@.str.3 = [4 x i8] c"XYZ\00"
@.str.4 = [4 x i8] c"ABC\00"
define i32 @main() {
%1 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 45, i32 1, i64 16)
%2 = tail call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 46, i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 47, i32 %1)
%4 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 50, i32 1, i64 16)
%5 = tail call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 51, i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @grid_sleep(i32 200)
%7 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 56, i32 1, i64 16)
%8 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 57, i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 61, i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 62, i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 63, i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 64, i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %0, %13
%14 = phi i32 [ 0, %0 ], [ %16, %13 ]
%15 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 69, i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%16 = add nuw nsw i32 %14, 1
%17 = icmp eq i32 %16, 100
br i1 %17, label %18, label %13
18: ; preds = %13, %18
%19 = phi i32 [ %21, %18 ], [ 0, %13 ]
%20 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 72, i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%21 = add nuw nsw i32 %19, 1
%22 = icmp eq i32 %21, 100
br i1 %22, label %23, label %18
23: ; preds = %18
%24 = tail call dereferenceable_or_null(10000) i8* @malloc(i32 10000)
br label %25
25: ; preds = %35, %23
%26 = phi i64 [ 0, %23 ], [ %42, %35 ]
%27 = phi <16 x i16> [ <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, %23 ], [ %43, %35 ]
%28 = urem <16 x i16> %27, <i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10>
%29 = trunc <16 x i16> %28 to <16 x i8>
%30 = or <16 x i8> %29, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%31 = getelementptr inbounds i8, i8* %24, i64 %26
%32 = bitcast i8* %31 to <16 x i8>*
store <16 x i8> %30, <16 x i8>* %32
%33 = or i64 %26, 16
%34 = icmp eq i64 %33, 10000
br i1 %34, label %44, label %35
35: ; preds = %25
%36 = add <16 x i16> %27, <i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16>
%37 = urem <16 x i16> %36, <i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10>
%38 = trunc <16 x i16> %37 to <16 x i8>
%39 = or <16 x i8> %38, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%40 = getelementptr inbounds i8, i8* %24, i64 %33
%41 = bitcast i8* %40 to <16 x i8>*
store <16 x i8> %39, <16 x i8>* %41
%42 = add nuw nsw i64 %26, 32
%43 = add <16 x i16> %27, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
br label %25
44: ; preds = %25
%45 = getelementptr inbounds i8, i8* %24, i64 9999
store i8 0, i8* %45
%46 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 82, i32 %4, i8* %24)
%47 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 83, i32 %7, i8* %24)
%48 = tail call i32 @free(i8* %24)
%49 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 86, i32 %4)
%50 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 87, i32 %7)
%51 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 90, i32 1, i64 16)
%52 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 91, i32 %51, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%53 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 92, i32 1, i64 16)
%54 = tail call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 93, i32 %53, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%55 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 94, i32 1, i64 16)
%56 = tail call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 95, i32 %55, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%57 = tail call i32 @grid_sleep(i32 100)
%58 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 97, i32 %55)
%59 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 98, i32 %53)
%60 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 99, i32 %51)
%61 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 102, i32 1, i64 16)
%62 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 103, i32 %61, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%63 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 104, i32 1, i64 16)
%64 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 105, i32 %63, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%65 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 106, i32 1, i64 16)
%66 = tail call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 107, i32 %65, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%67 = tail call i32 @grid_sleep(i32 100)
%68 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 109, i32 %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%69 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 110, i32 %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%70 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 111, i32 %61)
%71 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 112, i32 %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%72 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 113, i32 %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%73 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 114, i32 %65)
%74 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 115, i32 %63)
%75 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 118, i32 1, i64 16)
%76 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 119, i32 %75, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%77 = tail call i32 @grid_sleep(i32 100)
%78 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 121, i32 1, i64 16)
%79 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 122, i32 %78, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%80 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 123, i32 1, i64 16)
%81 = tail call i32 @test_connect_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 124, i32 %80, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%82 = tail call i32 @grid_sleep(i32 100)
%83 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 126, i32 %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%84 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 127, i32 %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%85 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 128, i32 %78)
%86 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 129, i32 %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%87 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 130, i32 %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%88 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 131, i32 %75)
%89 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 132, i32 %80)
ret i32 0
}