#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;
  int /*<<< orphan*/ sun_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ address;

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ EXIT_FAILURE;
int NI_MAXHOST;
int /*<<< orphan*/ NI_NUMERICHOST;
int /*<<< orphan*/ PF_UNIX;
int /*<<< orphan*/ SIGCLD;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ SOCK_SEQPACKET;
int accept(int, struct sockaddr *, int *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ communication(int, char *, char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *gai_strerror(int);
int getnameinfo(struct sockaddr *, int, char *, int, int /*<<< orphan*/ *,
                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ memset(struct sockaddr_un *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(int /*<<< orphan*/, int, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ unlink(char *);
int main(int argc, char **argv) {
  int sfd, s, ns, r;
  char buf[512];
  socklen_t addresslen;
  char host[NI_MAXHOST];
  struct sockaddr_un address;
  char *message = "Message a envoyer: ";
  if (argc != 2) {
    printf("Usage: %s  port_serveur\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  unlink("./demo.socket");
  memset(&address, 0, sizeof(struct sockaddr_un));
  address.sun_family = PF_UNIX;
  snprintf(address.sun_path, 108, "./demo.socket");
  sfd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
  if (sfd < 0)
    fprintf(stderr, "erreur creation socket");
  r = bind(sfd, (struct sockaddr *)&address, sizeof(struct sockaddr_un));
  if (r != 0) {
    fprintf(stderr, "bindinfo: %s\n", gai_strerror(r));
    close(sfd);
  }
  listen(sfd, 5);
  for (;;) {
    addresslen = sizeof(address);
    ns = accept(sfd, (struct sockaddr *)&address, &addresslen);
    if (ns == -1) {
      perror("accept");
      exit(EXIT_FAILURE);
    }
    int pid;
    pid = fork();
    switch (pid) {
    case -1:
      perror("fork");
      exit(EXIT_FAILURE);
      break;
    case 0:
      close(sfd);
      s = getnameinfo((struct sockaddr *)&address, addresslen, host, NI_MAXHOST,
                      NULL, 0, NI_NUMERICHOST);
      if (s == 0)
        printf("Debut avec client '%s'\n", host);
      else
        fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s));
      communication(ns, message, buf, host);
      break;
    default:
      signal(SIGCLD, SIG_IGN);
      close(ns);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x230(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x258(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x238(%rbp)
lea    0xd9b(%rip),%rax
mov    %rax,-0x248(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1297 <main+0x87>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd90(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d20(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
lea    0xd8f(%rip),%rdi
call   1030 <unlink@plt>
lea    -0x240(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1070 <memset@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x23c(%rbp)
mov    -0x240(%rbp),%edi
mov    $0x6c,%esi
lea    0xd56(%rip),%rdx
call   1050 <snprintf@plt>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
mov    0x2cb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1319 <main+0x109>
mov    0x2cb7(%rip),%rax
mov    (%rax),%edi
lea    0xd29(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x240(%rbp),%rsi
mov    $0x8,%edx
call   10e0 <bind@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1370 <main+0x160>
mov    0x2c7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x25c(%rbp)
mov    -0x20(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    -0x25c(%rbp),%edi
mov    %rax,%rdx
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10d0 <listen@plt>
movl   $0x8,-0x224(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x240(%rbp),%rsi
lea    -0x224(%rbp),%rdx
call   1100 <accept@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    13c4 <main+0x1b4>
lea    0xcaf(%rip),%rdi
call   10f0 <perror@plt>
mov    0x2bf3(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
xor    %eax,%eax
call   1120 <fork@plt>
mov    %eax,-0x24c(%rbp)
mov    -0x24c(%rbp),%eax
mov    %eax,-0x260(%rbp)
sub    $0xffffffff,%eax
je     13fe <main+0x1ee>
jmp    13eb <main+0x1db>
mov    -0x260(%rbp),%eax
test   %eax,%eax
je     1418 <main+0x208>
jmp    14d1 <main+0x2c1>
lea    0xc62(%rip),%rdi
call   10f0 <perror@plt>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
mov    -0x258(%rbp),%rdx
lea    -0x240(%rbp),%rdi
mov    -0x224(%rbp),%esi
mov    0x2b6d(%rip),%rax
mov    (%rax),%ecx
mov    0x2b74(%rip),%rax
mov    (%rax),%eax
xor    %r8d,%r8d
xor    %r9d,%r9d
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1090 <getnameinfo@plt>
add    $0x10,%rsp
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1481 <main+0x271>
mov    -0x258(%rbp),%rsi
lea    0xbf5(%rip),%rdi
call   1040 <printf@plt>
jmp    14af <main+0x29f>
mov    0x2b38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x264(%rbp)
mov    -0x18(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    -0x264(%rbp),%edi
mov    %rax,%rdx
lea    0xbdc(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x258(%rbp),%rcx
mov    -0x1c(%rbp),%edi
mov    -0x248(%rbp),%rsi
lea    -0x220(%rbp),%rdx
call   10a0 <communication@plt>
jmp    14f0 <main+0x2e0>
mov    0x2b00(%rip),%rax
mov    (%rax),%edi
mov    0x2aef(%rip),%rax
mov    (%rax),%esi
call   10b0 <signal@plt>
mov    -0x1c(%rbp),%edi
call   1080 <close@plt>
jmp    137d <main+0x16d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
mov    0x2d7d(%rip),%r13
mov    0x0(%r13),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cmp    $0x2,%edi
jne    1334 <main+0x124>
lea    0xddd(%rip),%r14
mov    %r14,%rdi
call   1030 <unlink@plt>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1070 <memset@plt>
mov    0x2d89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%edi
mov    $0x6c,%esi
mov    %r14,%rdx
call   1050 <snprintf@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
mov    0x2d0c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%r15d
test   %eax,%eax
jns    12bb <main+0xab>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
lea    0xd87(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
lea    -0x38(%rbp),%rsi
mov    %r15d,%edi
mov    $0x8,%edx
call   10e0 <bind@plt>
test   %eax,%eax
je     12fd <main+0xed>
mov    0x2ce9(%rip),%rcx
mov    (%rcx),%r14d
mov    %eax,%edi
call   1060 <gai_strerror@plt>
lea    0xd6a(%rip),%rsi
mov    %r14d,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    %r15d,%edi
call   1080 <close@plt>
mov    %r15d,%edi
mov    $0x5,%esi
call   10d0 <listen@plt>
movl   $0x8,-0x2c(%rbp)
lea    -0x38(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
mov    %r15d,%edi
call   1100 <accept@plt>
cmp    $0xffffffff,%eax
jne    1351 <main+0x141>
lea    0xd33(%rip),%rdi
call   10f0 <perror@plt>
jmp    1343 <main+0x133>
mov    (%rsi),%rsi
lea    0xcd6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2c66(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    %eax,%r12d
lea    -0x38(%rbp),%r14
mov    %r15d,-0x3c(%rbp)
jmp    141a <main+0x20a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1080 <close@plt>
mov    -0x2c(%rbp),%esi
mov    0x0(%r13),%ecx
mov    0x2c32(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
call   1090 <getnameinfo@plt>
add    $0x10,%rsp
test   %eax,%eax
je     144f <main+0x23f>
mov    %r14,%r15
mov    %r13,%r14
mov    0x2c09(%rip),%rcx
mov    (%rcx),%r13d
mov    %eax,%edi
call   1060 <gai_strerror@plt>
mov    %r13d,%edi
mov    %r14,%r13
mov    %r15,%r14
mov    -0x3c(%rbp),%r15d
lea    0xcaf(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    %r12d,%edi
lea    0xc17(%rip),%rsi
lea    -0x240(%rbp),%rdx
mov    %rbx,%rcx
call   10a0 <communication@plt>
movl   $0x8,-0x2c(%rbp)
mov    %r15d,%edi
mov    %r14,%rsi
lea    -0x2c(%rbp),%rdx
call   1100 <accept@plt>
mov    %eax,%r12d
cmp    $0xffffffff,%eax
je     1326 <main+0x116>
xor    %eax,%eax
call   1120 <fork@plt>
test   %eax,%eax
je     1370 <main+0x160>
cmp    $0xffffffff,%eax
je     1463 <main+0x253>
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
mov    0x2b92(%rip),%rax
mov    (%rax),%esi
call   10b0 <signal@plt>
mov    %r12d,%edi
call   1080 <close@plt>
jmp    13f8 <main+0x1e8>
lea    0xc16(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    13df <main+0x1cf>
lea    0xbfd(%rip),%rdi
jmp    132d <main+0x11d>

LLVM IR (-O0):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@NI_MAXHOST = global i32 0
@.str = [20 x i8] c"Message a envoyer: \00"
@.str.1 = [25 x i8] c"Usage: %s port_serveur\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [14 x i8] c"./demo.socket\00"
@PF_UNIX = global i32 0
@AF_UNIX = global i32 0
@SOCK_SEQPACKET = global i32 0
@stderr = global i32 0
@.str.3 = [23 x i8] c"erreur creation socket\00"
@.str.4 = [14 x i8] c"bindinfo: %s\0A\00"
@.str.5 = [7 x i8] c"accept\00"
@.str.6 = [5 x i8] c"fork\00"
@NI_NUMERICHOST = global i32 0
@.str.7 = [24 x i8] c"Debut avec client '%s'\0A\00"
@.str.8 = [17 x i8] c"getnameinfo: %s\0A\00"
@SIGCLD = global i32 0
@SIG_IGN = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [512 x i8]
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca %struct.sockaddr_un
%15 = alloca i8*
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* @NI_MAXHOST
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %12
%20 = alloca i8, i64 %18
store i64 %18, i64* %13
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %15
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 2
br i1 %22, label %23, label %30
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %2
%31 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 @memset(%struct.sockaddr_un* %14, i32 0, i32 8)
%33 = load i32, i32* @PF_UNIX
%34 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %14, i32 0, i32 1
store i32 %33, i32* %34
%35 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %14, i32 0, i32 0
%36 = load i32, i32* %35
%37 = call i32 @snprintf(i32 %36, i32 108, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* @AF_UNIX
%39 = load i32, i32* @SOCK_SEQPACKET
%40 = call i32 @socket(i32 %38, i32 %39, i32 0)
store i32 %40, i32* %6
%41 = load i32, i32* %6
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %30
%44 = load i32, i32* @stderr
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %46
46: ; preds = %43, %30
%47 = load i32, i32* %6
%48 = bitcast %struct.sockaddr_un* %14 to %struct.sockaddr*
%49 = call i32 @bind(i32 %47, %struct.sockaddr* %48, i32 8)
store i32 %49, i32* %9
%50 = load i32, i32* %9
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %59
52: ; preds = %46
%53 = load i32, i32* @stderr
%54 = load i32, i32* %9
%55 = call i8* @gai_strerror(i32 %54)
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %55)
%57 = load i32, i32* %6
%58 = call i32 @close(i32 %57)
br label %59
59: ; preds = %52, %46
%60 = load i32, i32* %6
%61 = call i32 @listen(i32 %60, i32 5)
br label %62
62: ; preds = %107, %59
store i32 8, i32* %11
%63 = load i32, i32* %6
%64 = bitcast %struct.sockaddr_un* %14 to %struct.sockaddr*
%65 = call i32 @accept(i32 %63, %struct.sockaddr* %64, i32* %11)
store i32 %65, i32* %8
%66 = load i32, i32* %8
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %72
68: ; preds = %62
%69 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%70 = load i32, i32* @EXIT_FAILURE
%71 = call i32 @exit(i32 %70)
unreachable
72: ; preds = %62
%73 = call i32 (...) @fork()
store i32 %73, i32* %16
%74 = load i32, i32* %16
switch i32 %74, label %101 [
i32 -1, label %75
i32 0, label %79
]
75: ; preds = %72
%76 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%77 = load i32, i32* @EXIT_FAILURE
%78 = call i32 @exit(i32 %77)
unreachable
79: ; preds = %72
%80 = load i32, i32* %6
%81 = call i32 @close(i32 %80)
%82 = bitcast %struct.sockaddr_un* %14 to %struct.sockaddr*
%83 = load i32, i32* %11
%84 = load i32, i32* @NI_MAXHOST
%85 = load i32, i32* @NI_NUMERICHOST
%86 = call i32 @getnameinfo(%struct.sockaddr* %82, i32 %83, i8* %20, i32 %84, i32* null, i32 0, i32 %85)
store i32 %86, i32* %7
%87 = load i32, i32* %7
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %91
89: ; preds = %79
%90 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %20)
br label %96
91: ; preds = %79
%92 = load i32, i32* @stderr
%93 = load i32, i32* %7
%94 = call i8* @gai_strerror(i32 %93)
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %94)
br label %96
96: ; preds = %91, %89
%97 = load i32, i32* %8
%98 = load i8*, i8** %15
%99 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%100 = call i32 @communication(i32 %97, i8* %98, i8* %99, i8* %20)
br label %107
101: ; preds = %72
%102 = load i32, i32* @SIGCLD
%103 = load i32, i32* @SIG_IGN
%104 = call i32 @signal(i32 %102, i32 %103)
%105 = load i32, i32* %8
%106 = call i32 @close(i32 %105)
br label %107
107: ; preds = %101, %96
br label %62
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@NI_MAXHOST = global i32 0
@.str = [20 x i8] c"Message a envoyer: \00"
@.str.1 = [25 x i8] c"Usage: %s port_serveur\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [14 x i8] c"./demo.socket\00"
@PF_UNIX = global i32 0
@AF_UNIX = global i32 0
@SOCK_SEQPACKET = global i32 0
@stderr = global i32 0
@.str.3 = [23 x i8] c"erreur creation socket\00"
@.str.4 = [14 x i8] c"bindinfo: %s\0A\00"
@.str.5 = [7 x i8] c"accept\00"
@.str.6 = [5 x i8] c"fork\00"
@NI_NUMERICHOST = global i32 0
@.str.7 = [24 x i8] c"Debut avec client '%s'\0A\00"
@.str.8 = [17 x i8] c"getnameinfo: %s\0A\00"
@SIGCLD = global i32 0
@SIG_IGN = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca i32
%5 = alloca %struct.sockaddr_un
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = load i32, i32* @NI_MAXHOST
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = bitcast %struct.sockaddr_un* %5 to i8*
%12 = icmp eq i32 %0, 2
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
%19 = tail call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @memset(%struct.sockaddr_un* %5, i32 0, i32 8)
%21 = load i32, i32* @PF_UNIX
%22 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i64 0, i32 1
store i32 %21, i32* %22
%23 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i64 0, i32 0
%24 = load i32, i32* %23
%25 = call i32 @snprintf(i32 %24, i32 108, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* @AF_UNIX
%27 = load i32, i32* @SOCK_SEQPACKET
%28 = call i32 @socket(i32 %26, i32 %27, i32 0)
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %18
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %33
33: ; preds = %30, %18
%34 = bitcast %struct.sockaddr_un* %5 to %struct.sockaddr*
%35 = call i32 @bind(i32 %28, %struct.sockaddr* %34, i32 8)
%36 = icmp eq i32 %35, 0
br i1 %36, label %42, label %37
37: ; preds = %33
%38 = load i32, i32* @stderr
%39 = call i8* @gai_strerror(i32 %35)
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %39)
%41 = call i32 @close(i32 %28)
br label %42
42: ; preds = %37, %33
%43 = call i32 @listen(i32 %28, i32 5)
store i32 8, i32* %4
%44 = call i32 @accept(i32 %28, %struct.sockaddr* %34, i32* %4)
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %50
46: ; preds = %77, %42
%47 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%48 = load i32, i32* @EXIT_FAILURE
%49 = call i32 @exit(i32 %48)
unreachable
50: ; preds = %42, %77
%51 = phi i32 [ %78, %77 ], [ %44, %42 ]
%52 = call i32 (...) @fork()
switch i32 %52, label %72 [
i32 -1, label %53
i32 0, label %57
]
53: ; preds = %50
%54 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%55 = load i32, i32* @EXIT_FAILURE
%56 = call i32 @exit(i32 %55)
unreachable
57: ; preds = %50
%58 = call i32 @close(i32 %28)
%59 = load i32, i32* %4
%60 = load i32, i32* @NI_MAXHOST
%61 = load i32, i32* @NI_NUMERICHOST
%62 = call i32 @getnameinfo(%struct.sockaddr* %34, i32 %59, i8* %10, i32 %60, i32* null, i32 0, i32 %61)
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %57
%65 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %10)
br label %70
66: ; preds = %57
%67 = load i32, i32* @stderr
%68 = call i8* @gai_strerror(i32 %62)
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %68)
br label %70
70: ; preds = %66, %64
%71 = call i32 @communication(i32 %51, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %10)
br label %77
72: ; preds = %50
%73 = load i32, i32* @SIGCLD
%74 = load i32, i32* @SIG_IGN
%75 = call i32 @signal(i32 %73, i32 %74)
%76 = call i32 @close(i32 %51)
br label %77
77: ; preds = %72, %70
store i32 8, i32* %4
%78 = call i32 @accept(i32 %28, %struct.sockaddr* %34, i32* %4)
%79 = icmp eq i32 %78, -1
br i1 %79, label %46, label %50
}