#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  scalar_t__ sin_port;
  void *sin_family;
};
struct sockaddr {
  int dummy;
};
typedef void *sa_family_t;
typedef int /*<<< orphan*/ listen_sock;

/* Variables and functions */
scalar_t__ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int bind(int, struct sockaddr *, int);
int connect(int, struct sockaddr *, int);
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ inet_addr(char *);
char *malloc(int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
scalar_t__ ntohs(int);
int read(int, char *, int);
int socket(scalar_t__, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strerror(int);
int write(int, char *, int);
int main(int argc, char **argv) {
  struct sockaddr_in data_sock, listen_sock;
  int fd_listen_sock, return_value;
  char *buffer = malloc(256);
  char *hostname = NULL;
  if (argc > 1)
    hostname = argv[1];
  else
    hostname = "127.0.0.1";
  listen_sock.sin_family = (sa_family_t)AF_INET;
  listen_sock.sin_port = ntohs(5600);
  listen_sock.sin_addr.s_addr = inet_addr(hostname);
  data_sock.sin_family = (sa_family_t)AF_INET;
  data_sock.sin_port = 0;
  data_sock.sin_addr.s_addr = ntohl(INADDR_ANY);
  fd_listen_sock = socket(AF_INET, SOCK_STREAM, 0);
  if (fd_listen_sock < 0) {
    fprintf(stderr, "[ERROR] %s (%d) : (%d) %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/"
            "t_slave.c",
            63, errno, strerror(errno));
    exit(EXIT_FAILURE);
  }
  return_value =
      bind(fd_listen_sock, (struct sockaddr *)&data_sock, sizeof(listen_sock));
  if (return_value < 0) {
    fprintf(stderr, "[ERROR] %s (%d) : (%d) %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/"
            "t_slave.c",
            74, errno, strerror(errno));
    exit(EXIT_FAILURE);
  }
  return_value = connect(fd_listen_sock, (struct sockaddr *)&listen_sock,
                         sizeof(listen_sock));
  if (return_value < 0) {
    fprintf(stderr, "[ERROR] %s (%d) : (%d) %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/"
            "t_slave.c",
            85, errno, strerror(errno));
    exit(EXIT_FAILURE);
  }
  return_value = write(fd_listen_sock, "PING", 256);
  if (return_value < 0) {
    fprintf(stderr, "[ERROR] %s (%d) : (%d) %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/"
            "t_slave.c",
            96, errno, strerror(errno));
    exit(EXIT_FAILURE);
  }
  return_value = read(fd_listen_sock, buffer, 256);
  if (return_value < 0) {
    fprintf(stderr, "[ERROR] %s (%d) : (%d) %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/"
            "t_slave.c",
            107, errno, strerror(errno));
    exit(EXIT_FAILURE);
  }
  fprintf(stdout, "%s : \"%s\"\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/"
          "t_slave.c",
          buffer);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    120a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    1215 <main+0x55>
lea    0xdef(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0x2dcc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    $0x15e0,%edi
call   1080 <ntohs@plt>
mov    %rax,-0x38(%rbp)
mov    -0x58(%rbp),%rdi
call   1050 <inet_addr@plt>
mov    %eax,-0x40(%rbp)
mov    0x2da4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
call   10c0 <ntohl@plt>
mov    %eax,-0x28(%rbp)
mov    0x2d7d(%rip),%rax
mov    (%rax),%rdi
mov    0x2d53(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    12e3 <main+0x123>
mov    0x2d3e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2d22(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x60(%rbp),%edi
mov    -0x5c(%rbp),%r8d
mov    %rax,%r9
lea    0xd48(%rip),%rsi
lea    0xd5c(%rip),%rdx
mov    $0x3f,%ecx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x44(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x18,%edx
call   1090 <bind@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    1359 <main+0x199>
mov    0x2cc8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x2cac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x68(%rbp),%edi
mov    -0x64(%rbp),%r8d
mov    %rax,%r9
lea    0xcd2(%rip),%rsi
lea    0xce6(%rip),%rdx
mov    $0x4a,%ecx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c66(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x18,%edx
call   10b0 <connect@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    13cf <main+0x20f>
mov    0x2c52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x2c36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    0x2c2a(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%r8d
mov    %rax,%r9
lea    0xc5c(%rip),%rsi
lea    0xc70(%rip),%rdx
mov    $0x55,%ecx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2bf0(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x44(%rbp),%edi
lea    0xcd8(%rip),%rsi
mov    $0x100,%edx
call   1030 <write@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    1448 <main+0x288>
mov    0x2bd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x78(%rbp)
mov    0x2bbd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    0x2bb1(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x78(%rbp),%edi
mov    -0x74(%rbp),%r8d
mov    %rax,%r9
lea    0xbe3(%rip),%rsi
lea    0xbf7(%rip),%rdx
mov    $0x60,%ecx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x44(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    $0x100,%edx
call   1040 <read@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    14be <main+0x2fe>
mov    0x2b63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x80(%rbp)
mov    0x2b47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    0x2b3b(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x80(%rbp),%edi
mov    -0x7c(%rbp),%r8d
mov    %rax,%r9
lea    0xb6d(%rip),%rsi
lea    0xb81(%rip),%rdx
mov    $0x6b,%ecx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2b01(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    0x2aeb(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rcx
lea    0xbe4(%rip),%rsi
lea    0xb4c(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2ac1(%rip),%rax
mov    (%rax),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
cmp    $0x2,%ebx
jl     11e5 <main+0x25>
mov    0x8(%rbp),%rbp
jmp    11ec <main+0x2c>
lea    0xe14(%rip),%rbp
mov    0x2df5(%rip),%rbx
mov    (%rbx),%rax
mov    %rax,0x10(%rsp)
mov    $0x15e0,%edi
call   1080 <ntohs@plt>
mov    %rax,0x8(%rsp)
mov    %rbp,%rdi
call   1050 <inet_addr@plt>
mov    %eax,(%rsp)
mov    (%rbx),%rbx
mov    %rbx,0x28(%rsp)
movq   $0x0,0x20(%rsp)
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
call   10c0 <ntohl@plt>
mov    %eax,0x18(%rsp)
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   10e0 <socket@plt>
test   %eax,%eax
js     12ea <main+0x12a>
mov    %eax,%ebp
lea    0x18(%rsp),%rsi
mov    %eax,%edi
mov    $0x18,%edx
call   1090 <bind@plt>
test   %eax,%eax
js     131d <main+0x15d>
mov    %rsp,%rsi
mov    %ebp,%edi
mov    $0x18,%edx
call   10b0 <connect@plt>
test   %eax,%eax
js     1350 <main+0x190>
lea    0xe25(%rip),%rsi
mov    %ebp,%edi
mov    $0x100,%edx
call   1030 <write@plt>
test   %eax,%eax
js     1380 <main+0x1c0>
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   1040 <read@plt>
test   %eax,%eax
js     13b0 <main+0x1f0>
mov    0x2cf2(%rip),%rax
mov    (%rax),%edi
lea    0xdef(%rip),%rsi
lea    0xd57(%rip),%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2cc9(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2cdf(%rip),%rax
mov    (%rax),%ebx
mov    0x2cc6(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   10d0 <strerror@plt>
lea    0xd00(%rip),%rsi
lea    0xd14(%rip),%rdx
mov    %ebx,%edi
mov    $0x3f,%ecx
jmp    13de <main+0x21e>
mov    0x2cac(%rip),%rax
mov    (%rax),%ebx
mov    0x2c93(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   10d0 <strerror@plt>
lea    0xccd(%rip),%rsi
lea    0xce1(%rip),%rdx
mov    %ebx,%edi
mov    $0x4a,%ecx
jmp    13de <main+0x21e>
mov    0x2c79(%rip),%rax
mov    (%rax),%ebx
mov    0x2c60(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   10d0 <strerror@plt>
lea    0xc9a(%rip),%rsi
lea    0xcae(%rip),%rdx
mov    %ebx,%edi
mov    $0x55,%ecx
jmp    13de <main+0x21e>
mov    0x2c49(%rip),%rax
mov    (%rax),%ebx
mov    0x2c30(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   10d0 <strerror@plt>
lea    0xc6a(%rip),%rsi
lea    0xc7e(%rip),%rdx
mov    %ebx,%edi
mov    $0x60,%ecx
jmp    13de <main+0x21e>
mov    0x2c19(%rip),%rax
mov    (%rax),%ebx
mov    0x2c00(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   10d0 <strerror@plt>
lea    0xc3a(%rip),%rsi
lea    0xc4e(%rip),%rdx
mov    %ebx,%edi
mov    $0x6b,%ecx
mov    %ebp,%r8d
mov    %rax,%r9
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2bc6(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i64, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [10 x i8] c"127.0.0.1\00"
@AF_INET = global i64 0
@INADDR_ANY = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str.1 = [27 x i8] c"[ERROR] %s (%d) : (%d) %s\0A\00"
@.str.2 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/t_slave.c\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.3 = [5 x i8] c"PING\00"
@stdout = global i32 0
@.str.4 = [11 x i8] c"%s : \22%s\22\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca %struct.sockaddr_in
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i8* @malloc(i32 256)
store i8* %12, i8** %10
store i8* null, i8** %11
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %11
br label %20
19: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %11
br label %20
20: ; preds = %19, %15
%21 = load i64, i64* @AF_INET
%22 = inttoptr i64 %21 to i8*
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i8* %22, i8** %23
%24 = call i64 @ntohs(i32 5600)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i64 %24, i64* %25
%26 = load i8*, i8** %11
%27 = call i32 @inet_addr(i8* %26)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%29 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %28, i32 0, i32 0
store i32 %27, i32* %29
%30 = load i64, i64* @AF_INET
%31 = inttoptr i64 %30 to i8*
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i8* %31, i8** %32
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i64 0, i64* %33
%34 = load i32, i32* @INADDR_ANY
%35 = call i32 @ntohl(i32 %34)
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%37 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %36, i32 0, i32 0
store i32 %35, i32* %37
%38 = load i64, i64* @AF_INET
%39 = load i32, i32* @SOCK_STREAM
%40 = call i32 @socket(i64 %38, i32 %39, i32 0)
store i32 %40, i32* %8
%41 = load i32, i32* %8
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %51
43: ; preds = %20
%44 = load i32, i32* @stderr
%45 = load i32, i32* @errno
%46 = load i32, i32* @errno
%47 = call i8* @strerror(i32 %46)
%48 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 63, i32 %45, i8* %47)
%49 = load i32, i32* @EXIT_FAILURE
%50 = call i32 @exit(i32 %49)
unreachable
51: ; preds = %20
%52 = load i32, i32* %8
%53 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%54 = call i32 @bind(i32 %52, %struct.sockaddr* %53, i32 24)
store i32 %54, i32* %9
%55 = load i32, i32* %9
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %65
57: ; preds = %51
%58 = load i32, i32* @stderr
%59 = load i32, i32* @errno
%60 = load i32, i32* @errno
%61 = call i8* @strerror(i32 %60)
%62 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 74, i32 %59, i8* %61)
%63 = load i32, i32* @EXIT_FAILURE
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %51
%66 = load i32, i32* %8
%67 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%68 = call i32 @connect(i32 %66, %struct.sockaddr* %67, i32 24)
store i32 %68, i32* %9
%69 = load i32, i32* %9
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %79
71: ; preds = %65
%72 = load i32, i32* @stderr
%73 = load i32, i32* @errno
%74 = load i32, i32* @errno
%75 = call i8* @strerror(i32 %74)
%76 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 85, i32 %73, i8* %75)
%77 = load i32, i32* @EXIT_FAILURE
%78 = call i32 @exit(i32 %77)
unreachable
79: ; preds = %65
%80 = load i32, i32* %8
%81 = call i32 @write(i32 %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 256)
store i32 %81, i32* %9
%82 = load i32, i32* %9
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %92
84: ; preds = %79
%85 = load i32, i32* @stderr
%86 = load i32, i32* @errno
%87 = load i32, i32* @errno
%88 = call i8* @strerror(i32 %87)
%89 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 96, i32 %86, i8* %88)
%90 = load i32, i32* @EXIT_FAILURE
%91 = call i32 @exit(i32 %90)
unreachable
92: ; preds = %79
%93 = load i32, i32* %8
%94 = load i8*, i8** %10
%95 = call i32 @read(i32 %93, i8* %94, i32 256)
store i32 %95, i32* %9
%96 = load i32, i32* %9
%97 = icmp slt i32 %96, 0
br i1 %97, label %98, label %106
98: ; preds = %92
%99 = load i32, i32* @stderr
%100 = load i32, i32* @errno
%101 = load i32, i32* @errno
%102 = call i8* @strerror(i32 %101)
%103 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 107, i32 %100, i8* %102)
%104 = load i32, i32* @EXIT_FAILURE
%105 = call i32 @exit(i32 %104)
unreachable
106: ; preds = %92
%107 = load i32, i32* @stdout
%108 = load i8*, i8** %10
%109 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %107, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8* %108)
%110 = load i32, i32* @EXIT_SUCCESS
ret i32 %110
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i64, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [10 x i8] c"127.0.0.1\00"
@AF_INET = global i64 0
@INADDR_ANY = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str.1 = [27 x i8] c"[ERROR] %s (%d) : (%d) %s\0A\00"
@.str.2 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RoubyPA/Entangled/refs/heads/master/src/t_slave.c\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.3 = [5 x i8] c"PING\00"
@stdout = global i32 0
@.str.4 = [11 x i8] c"%s : \22%s\22\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = bitcast %struct.sockaddr_in* %4 to i8*
%7 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
br label %12
12: ; preds = %2, %9
%13 = phi i8* [ %11, %9 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ]
%14 = load i64, i64* @AF_INET
%15 = inttoptr i64 %14 to i8*
%16 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i8* %15, i8** %16
%17 = tail call i64 @ntohs(i32 5600)
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
store i64 %17, i64* %18
%19 = tail call i32 @inet_addr(i8* %13)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0, i32 0
store i32 %19, i32* %20
%21 = load i64, i64* @AF_INET
%22 = inttoptr i64 %21 to i8*
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i8* %22, i8** %23
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i64 0, i64* %24
%25 = load i32, i32* @INADDR_ANY
%26 = tail call i32 @ntohl(i32 %25)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i32 %26, i32* %27
%28 = load i32, i32* @SOCK_STREAM
%29 = tail call i32 @socket(i64 %21, i32 %28, i32 0)
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %12
%32 = load i32, i32* @stderr
%33 = load i32, i32* @errno
%34 = tail call i8* @strerror(i32 %33)
%35 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 63, i32 %33, i8* %34)
%36 = load i32, i32* @EXIT_FAILURE
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %12
%39 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%40 = call i32 @bind(i32 %29, %struct.sockaddr* %39, i32 24)
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %38
%43 = load i32, i32* @stderr
%44 = load i32, i32* @errno
%45 = call i8* @strerror(i32 %44)
%46 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 74, i32 %44, i8* %45)
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %38
%50 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%51 = call i32 @connect(i32 %29, %struct.sockaddr* %50, i32 24)
%52 = icmp slt i32 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %49
%54 = load i32, i32* @stderr
%55 = load i32, i32* @errno
%56 = call i8* @strerror(i32 %55)
%57 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 85, i32 %55, i8* %56)
%58 = load i32, i32* @EXIT_FAILURE
%59 = call i32 @exit(i32 %58)
unreachable
60: ; preds = %49
%61 = call i32 @write(i32 %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 256)
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %60
%64 = load i32, i32* @stderr
%65 = load i32, i32* @errno
%66 = call i8* @strerror(i32 %65)
%67 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 96, i32 %65, i8* %66)
%68 = load i32, i32* @EXIT_FAILURE
%69 = call i32 @exit(i32 %68)
unreachable
70: ; preds = %60
%71 = call i32 @read(i32 %29, i8* %7, i32 256)
%72 = icmp slt i32 %71, 0
br i1 %72, label %73, label %80
73: ; preds = %70
%74 = load i32, i32* @stderr
%75 = load i32, i32* @errno
%76 = call i8* @strerror(i32 %75)
%77 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 107, i32 %75, i8* %76)
%78 = load i32, i32* @EXIT_FAILURE
%79 = call i32 @exit(i32 %78)
unreachable
80: ; preds = %70
%81 = load i32, i32* @stdout
%82 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%83 = load i32, i32* @EXIT_SUCCESS
ret i32 %83
}