#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*/ grid_sleep(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 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/bug328.c",
      36, (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/bug328.c",
      37, (sb), ("tcp://127.0.0.1:5777"));
  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/bug328.c",
      38, (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/bug328.c",
      39, (s1), ("tcp://127.0.0.1:5777"));
  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/bug328.c",
      40, (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/bug328.c",
      41, (sc), ("tcp://127.0.0.1:5777"));
  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/bug328.c",
      44, (sc), ("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/bug328.c",
      45, (sb), ("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/bug328.c",
      46, (sb));
  grid_sleep(300);
  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/bug328.c",
      48, (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/bug328.c",
      49, (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/bug328.c",
      51, (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/bug328.c",
      52, (s1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   1090 <test_socket_impl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xe59(%rip),%rdi
mov    $0x25,%esi
lea    0xed2(%rip),%rcx
call   1080 <test_bind_impl@plt>
lea    0xe41(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   1090 <test_socket_impl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
lea    0xe20(%rip),%rdi
mov    $0x27,%esi
lea    0xe99(%rip),%rcx
call   1080 <test_bind_impl@plt>
lea    0xe08(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    $0x10,%ecx
call   1090 <test_socket_impl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xde7(%rip),%rdi
mov    $0x29,%esi
lea    0xe60(%rip),%rcx
call   1070 <test_connect_impl@plt>
mov    $0x64,%edi
call   1050 <grid_sleep@plt>
mov    -0xc(%rbp),%edx
lea    0xdc2(%rip),%rdi
mov    $0x2c,%esi
lea    0xe50(%rip),%rcx
call   1060 <test_send_impl@plt>
mov    -0x8(%rbp),%edx
lea    0xda7(%rip),%rdi
mov    $0x2d,%esi
lea    0xe35(%rip),%rcx
call   1030 <test_recv_impl@plt>
mov    -0x8(%rbp),%edx
lea    0xd8c(%rip),%rdi
mov    $0x2e,%esi
call   1040 <test_close_impl@plt>
mov    $0x12c,%edi
call   1050 <grid_sleep@plt>
mov    -0x10(%rbp),%edx
lea    0xd6e(%rip),%rdi
mov    $0x30,%esi
lea    0xdfc(%rip),%rcx
call   1060 <test_send_impl@plt>
mov    -0xc(%rbp),%edx
lea    0xd53(%rip),%rdi
mov    $0x31,%esi
lea    0xde1(%rip),%rcx
call   1030 <test_recv_impl@plt>
mov    -0xc(%rbp),%edx
lea    0xd38(%rip),%rdi
mov    $0x33,%esi
call   1040 <test_close_impl@plt>
mov    -0x10(%rbp),%edx
lea    0xd24(%rip),%rdi
mov    $0x34,%esi
call   1040 <test_close_impl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xe81(%rip),%rbx
mov    $0x10,%ecx
mov    %rbx,%rdi
mov    $0x24,%esi
mov    $0x1,%edx
call   1090 <test_socket_impl@plt>
mov    %eax,%r15d
lea    0xee5(%rip),%r12
mov    %rbx,%rdi
mov    $0x25,%esi
mov    %eax,%edx
mov    %r12,%rcx
call   1080 <test_bind_impl@plt>
mov    $0x10,%ecx
mov    %rbx,%rdi
mov    $0x26,%esi
mov    $0x1,%edx
call   1090 <test_socket_impl@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    $0x27,%esi
mov    %eax,%edx
mov    %r12,%rcx
call   1080 <test_bind_impl@plt>
mov    $0x10,%ecx
mov    %rbx,%rdi
mov    $0x28,%esi
mov    $0x1,%edx
call   1090 <test_socket_impl@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x29,%esi
mov    %eax,%edx
mov    %r12,%rcx
call   1070 <test_connect_impl@plt>
mov    $0x64,%edi
call   1050 <grid_sleep@plt>
lea    0xe80(%rip),%r12
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   1060 <test_send_impl@plt>
mov    %rbx,%rdi
mov    $0x2d,%esi
mov    %r15d,%edx
mov    %r12,%rcx
call   1030 <test_recv_impl@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
mov    %r15d,%edx
call   1040 <test_close_impl@plt>
mov    $0x12c,%edi
call   1050 <grid_sleep@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
mov    %r14d,%edx
mov    %r12,%rcx
call   1060 <test_send_impl@plt>
mov    %rbx,%rdi
mov    $0x31,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   1030 <test_recv_impl@plt>
mov    %rbx,%rdi
mov    $0x33,%esi
mov    %ebp,%edx
call   1040 <test_close_impl@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %r14d,%edx
call   1040 <test_close_impl@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [133 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/bug328.c\00"
@.str.1 = [21 x i8] c"tcp://127.0.0.1:5777\00"
@.str.2 = [4 x i8] c"ABC\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @test_socket_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 36, i32 1, i64 16)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @test_bind_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 37, i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @test_socket_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 38, i32 1, i64 16)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @test_bind_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 39, i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @test_socket_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 40, i32 1, i64 16)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @test_connect_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 41, i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @grid_sleep(i32 100)
%15 = load i32, i32* %3
%16 = call i32 @test_send_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 44, i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* %2
%18 = call i32 @test_recv_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 45, i32 %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* %2
%20 = call i32 @test_close_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 46, i32 %19)
%21 = call i32 @grid_sleep(i32 300)
%22 = load i32, i32* %4
%23 = call i32 @test_send_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 48, i32 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%24 = load i32, i32* %3
%25 = call i32 @test_recv_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 49, i32 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* %3
%27 = call i32 @test_close_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 51, i32 %26)
%28 = load i32, i32* %4
%29 = call i32 @test_close_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 52, i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [133 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/bug328.c\00"
@.str.1 = [21 x i8] c"tcp://127.0.0.1:5777\00"
@.str.2 = [4 x i8] c"ABC\00"
define i32 @main() {
%1 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 36, i32 1, i64 16)
%2 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 37, i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 38, i32 1, i64 16)
%4 = tail call i32 @test_bind_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 39, i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @test_socket_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 40, i32 1, i64 16)
%6 = tail call i32 @test_connect_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 41, i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @grid_sleep(i32 100)
%8 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 44, i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 45, i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 46, i32 %1)
%11 = tail call i32 @grid_sleep(i32 300)
%12 = tail call i32 @test_send_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 48, i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @test_recv_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 49, i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 51, i32 %5)
%15 = tail call i32 @test_close_impl(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 52, i32 %3)
ret i32 0
}