#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 */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
scalar_t__ EEXIST;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_WRONLY;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ client(int, int);
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
scalar_t__ mkfifo(char *, int);
int open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ server(int, int);
char *strerror(scalar_t__);
int /*<<< orphan*/ unlink(char *);
int waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int readfd;
  int writefd;
  pid_t childpid;
  if ((0 > mkfifo("/tmp/fifo.1", (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) &&
      (EEXIST != errno)) {
    printf("mkfifo %s error: %s", "/tmp/fifo.1", strerror(errno));
    exit(EXIT_FAILURE);
  }
  if ((0 > mkfifo("/tmp/fifo.2", (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) &&
      (EEXIST != errno)) {
    printf("mkfifo %s error: %s", "/tmp/fifo.2", strerror(errno));
    unlink("/tmp/fifo.1");
    exit(EXIT_FAILURE);
  }
  if (0 == (childpid = fork())) {
    if (0 > (readfd = open("/tmp/fifo.1", O_RDONLY, 0))) {
      printf("open %s error: %s", "/tmp/fifo.1", strerror(errno));
    }
    if (0 > (writefd = open("/tmp/fifo.2", O_WRONLY, 0))) {
      printf("open %s error: %s", "/tmp/fifo.2", strerror(errno));
    }
    server(readfd, writefd);
    exit(EXIT_SUCCESS);
  }
  if (0 > (writefd = open("/tmp/fifo.1", O_WRONLY, 0))) {
    printf("open %s error: %s", "/tmp/fifo.1", strerror(errno));
  }
  if (0 > (readfd = open("/tmp/fifo.2", O_RDONLY, 0))) {
    printf("open %s error: %s", "/tmp/fifo.2", strerror(errno));
  }
  client(readfd, writefd);
  if (-1 == waitpid(childpid, NULL, 0)) {
    perror("waitpid error");
  }
  close(readfd);
  close(writefd);
  unlink("/tmp/fifo.1");
  unlink("/tmp/fifo.2");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
mov    0x2dfa(%rip),%rax
or     (%rax),%esi
mov    0x2dd1(%rip),%rax
or     (%rax),%esi
mov    0x2dc0(%rip),%rax
or     (%rax),%esi
lea    0xdff(%rip),%rdi
call   1060 <mkfifo@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1261 <main+0xa1>
mov    0x2db5(%rip),%rax
mov    (%rax),%rax
mov    0x2da3(%rip),%rcx
cmp    (%rcx),%rax
je     1261 <main+0xa1>
mov    0x2d93(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    %rax,%rdx
lea    0xdc5(%rip),%rdi
lea    0xdb2(%rip),%rsi
call   1040 <printf@plt>
mov    0x2d56(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x2d40(%rip),%rax
mov    (%rax),%esi
mov    0x2d6f(%rip),%rax
or     (%rax),%esi
mov    0x2d46(%rip),%rax
or     (%rax),%esi
mov    0x2d35(%rip),%rax
or     (%rax),%esi
lea    0xd94(%rip),%rdi
call   1060 <mkfifo@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    12f8 <main+0x138>
mov    0x2d2a(%rip),%rax
mov    (%rax),%rax
mov    0x2d18(%rip),%rcx
cmp    (%rcx),%rax
je     12f8 <main+0x138>
mov    0x2d08(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    %rax,%rdx
lea    0xd3a(%rip),%rdi
lea    0xd47(%rip),%rsi
call   1040 <printf@plt>
lea    0xd1b(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   10e0 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jne    13bd <main+0x1fd>
mov    0x2cd3(%rip),%rax
mov    (%rax),%esi
lea    0xce2(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    1359 <main+0x199>
mov    0x2c8d(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    %rax,%rdx
lea    0xcdf(%rip),%rdi
lea    0xcac(%rip),%rsi
call   1040 <printf@plt>
mov    0x2c30(%rip),%rax
mov    (%rax),%esi
lea    0xcb7(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    13a4 <main+0x1e4>
mov    0x2c42(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    %rax,%rdx
lea    0xc94(%rip),%rdi
lea    0xc81(%rip),%rsi
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1070 <server@plt>
mov    0x2bea(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x2bcc(%rip),%rax
mov    (%rax),%esi
lea    0xc33(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    1408 <main+0x248>
mov    0x2bde(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    %rax,%rdx
lea    0xc30(%rip),%rdi
lea    0xbfd(%rip),%rsi
call   1040 <printf@plt>
mov    0x2bd9(%rip),%rax
mov    (%rax),%esi
lea    0xc08(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    1453 <main+0x293>
mov    0x2b93(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    %rax,%rdx
lea    0xbe5(%rip),%rdi
lea    0xbd2(%rip),%rsi
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   10b0 <client@plt>
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1080 <waitpid@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1487 <main+0x2c7>
lea    0xbbc(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
mov    -0x18(%rbp),%edi
call   1050 <close@plt>
lea    0xb62(%rip),%rdi
call   1030 <unlink@plt>
lea    0xb76(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2aea(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2dda(%rip),%r14
mov    0x2e0b(%rip),%rbp
mov    0x0(%rbp),%esi
or     (%r14),%esi
mov    0x2dde(%rip),%r15
or     (%r15),%esi
mov    0x2dcc(%rip),%rbx
or     (%rbx),%esi
lea    0xe0b(%rip),%rdi
call   1060 <mkfifo@plt>
test   %rax,%rax
jns    1219 <main+0x59>
mov    0x2dca(%rip),%rax
mov    0x2dbb(%rip),%rcx
mov    (%rcx),%rdi
cmp    %rdi,(%rax)
jne    13d2 <main+0x212>
mov    0x0(%rbp),%esi
or     (%r14),%esi
or     (%r15),%esi
or     (%rbx),%esi
lea    0xdf5(%rip),%rdi
call   1060 <mkfifo@plt>
test   %rax,%rax
jns    124f <main+0x8f>
mov    0x2d94(%rip),%rax
mov    0x2d85(%rip),%rcx
mov    (%rcx),%rdi
cmp    %rdi,(%rax)
jne    13ef <main+0x22f>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
jne    12f0 <main+0x130>
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
lea    0xd92(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    12a0 <main+0xe0>
mov    0x2d46(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xd9b(%rip),%rdi
lea    0xd68(%rip),%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    0x2ce9(%rip),%rax
mov    (%rax),%esi
lea    0xd70(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    12e2 <main+0x122>
mov    0x2d04(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xd59(%rip),%rdi
lea    0xd46(%rip),%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1070 <server@plt>
jmp    13c4 <main+0x204>
mov    %eax,%ebp
mov    0x2c97(%rip),%rax
mov    (%rax),%esi
lea    0xcfe(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%r14d
test   %eax,%eax
jns    1335 <main+0x175>
mov    0x2cb1(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xd06(%rip),%rdi
lea    0xcd3(%rip),%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    0x2cac(%rip),%rax
mov    (%rax),%esi
lea    0xcdb(%rip),%rdi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1377 <main+0x1b7>
mov    0x2c6f(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xcc4(%rip),%rdi
lea    0xcb1(%rip),%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %r14d,%esi
call   10b0 <client@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <waitpid@plt>
cmp    $0xffffffff,%eax
jne    139d <main+0x1dd>
lea    0xca6(%rip),%rdi
call   10a0 <perror@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    %r14d,%edi
call   1050 <close@plt>
lea    0xc4d(%rip),%rdi
call   1030 <unlink@plt>
lea    0xc61(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2bd5(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
call   10d0 <strerror@plt>
lea    0xc2e(%rip),%rdi
lea    0xc1b(%rip),%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
jmp    1416 <main+0x256>
call   10d0 <strerror@plt>
lea    0xc11(%rip),%rdi
lea    0xc1e(%rip),%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
lea    0xbef(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2b93(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"/tmp/fifo.1\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@EEXIST = global i64 0
@errno = global i64 0
@.str.1 = [20 x i8] c"mkfifo %s error: %s\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [12 x i8] c"/tmp/fifo.2\00"
@O_RDONLY = global i32 0
@.str.3 = [18 x i8] c"open %s error: %s\00"
@O_WRONLY = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.4 = [14 x i8] c"waitpid error\00"
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @S_IRUSR
%10 = load i32, i32* @S_IWUSR
%11 = or i32 %9, %10
%12 = load i32, i32* @S_IRGRP
%13 = or i32 %11, %12
%14 = load i32, i32* @S_IROTH
%15 = or i32 %13, %14
%16 = call i64 @mkfifo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = icmp sgt i64 0, %16
br i1 %17, label %18, label %28
18: ; preds = %2
%19 = load i64, i64* @EEXIST
%20 = load i64, i64* @errno
%21 = icmp ne i64 %19, %20
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = load i64, i64* @errno
%24 = call i8* @strerror(i64 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @EXIT_FAILURE
%27 = call i32 @exit(i32 %26)
unreachable
28: ; preds = %18, %2
%29 = load i32, i32* @S_IRUSR
%30 = load i32, i32* @S_IWUSR
%31 = or i32 %29, %30
%32 = load i32, i32* @S_IRGRP
%33 = or i32 %31, %32
%34 = load i32, i32* @S_IROTH
%35 = or i32 %33, %34
%36 = call i64 @mkfifo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = icmp sgt i64 0, %36
br i1 %37, label %38, label %49
38: ; preds = %28
%39 = load i64, i64* @EEXIST
%40 = load i64, i64* @errno
%41 = icmp ne i64 %39, %40
br i1 %41, label %42, label %49
42: ; preds = %38
%43 = load i64, i64* @errno
%44 = call i8* @strerror(i64 %43)
%45 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %44)
%46 = call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %38, %28
%50 = call i32 (...) @fork()
store i32 %50, i32* %8
%51 = icmp eq i32 0, %50
br i1 %51, label %52, label %74
52: ; preds = %49
%53 = load i32, i32* @O_RDONLY
%54 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %53, i32 0)
store i32 %54, i32* %6
%55 = icmp sgt i32 0, %54
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = load i64, i64* @errno
%58 = call i8* @strerror(i64 %57)
%59 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %56, %52
%61 = load i32, i32* @O_WRONLY
%62 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %61, i32 0)
store i32 %62, i32* %7
%63 = icmp sgt i32 0, %62
br i1 %63, label %64, label %68
64: ; preds = %60
%65 = load i64, i64* @errno
%66 = call i8* @strerror(i64 %65)
%67 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %66)
br label %68
68: ; preds = %64, %60
%69 = load i32, i32* %6
%70 = load i32, i32* %7
%71 = call i32 @server(i32 %69, i32 %70)
%72 = load i32, i32* @EXIT_SUCCESS
%73 = call i32 @exit(i32 %72)
unreachable
74: ; preds = %49
%75 = load i32, i32* @O_WRONLY
%76 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %75, i32 0)
store i32 %76, i32* %7
%77 = icmp sgt i32 0, %76
br i1 %77, label %78, label %82
78: ; preds = %74
%79 = load i64, i64* @errno
%80 = call i8* @strerror(i64 %79)
%81 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %80)
br label %82
82: ; preds = %78, %74
%83 = load i32, i32* @O_RDONLY
%84 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %83, i32 0)
store i32 %84, i32* %6
%85 = icmp sgt i32 0, %84
br i1 %85, label %86, label %90
86: ; preds = %82
%87 = load i64, i64* @errno
%88 = call i8* @strerror(i64 %87)
%89 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %88)
br label %90
90: ; preds = %86, %82
%91 = load i32, i32* %6
%92 = load i32, i32* %7
%93 = call i32 @client(i32 %91, i32 %92)
%94 = load i32, i32* %8
%95 = call i32 @waitpid(i32 %94, i32* null, i32 0)
%96 = icmp eq i32 -1, %95
br i1 %96, label %97, label %99
97: ; preds = %90
%98 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %99
99: ; preds = %97, %90
%100 = load i32, i32* %6
%101 = call i32 @close(i32 %100)
%102 = load i32, i32* %7
%103 = call i32 @close(i32 %102)
%104 = call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%105 = call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%106 = load i32, i32* @EXIT_SUCCESS
%107 = call i32 @exit(i32 %106)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"/tmp/fifo.1\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@EEXIST = global i64 0
@errno = global i64 0
@.str.1 = [20 x i8] c"mkfifo %s error: %s\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [12 x i8] c"/tmp/fifo.2\00"
@O_RDONLY = global i32 0
@.str.3 = [18 x i8] c"open %s error: %s\00"
@O_WRONLY = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.4 = [14 x i8] c"waitpid error\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @S_IRUSR
%4 = load i32, i32* @S_IWUSR
%5 = or i32 %4, %3
%6 = load i32, i32* @S_IRGRP
%7 = or i32 %5, %6
%8 = load i32, i32* @S_IROTH
%9 = or i32 %7, %8
%10 = tail call i64 @mkfifo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %2
%13 = load i64, i64* @EEXIST
%14 = load i64, i64* @errno
%15 = icmp eq i64 %13, %14
br i1 %15, label %21, label %16
16: ; preds = %12
%17 = tail call i8* @strerror(i64 %14)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @EXIT_FAILURE
%20 = tail call i32 @exit(i32 %19)
unreachable
21: ; preds = %12, %2
%22 = load i32, i32* @S_IRUSR
%23 = load i32, i32* @S_IWUSR
%24 = or i32 %23, %22
%25 = load i32, i32* @S_IRGRP
%26 = or i32 %24, %25
%27 = load i32, i32* @S_IROTH
%28 = or i32 %26, %27
%29 = tail call i64 @mkfifo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = icmp slt i64 %29, 0
br i1 %30, label %31, label %41
31: ; preds = %21
%32 = load i64, i64* @EEXIST
%33 = load i64, i64* @errno
%34 = icmp eq i64 %32, %33
br i1 %34, label %41, label %35
35: ; preds = %31
%36 = tail call i8* @strerror(i64 %33)
%37 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = tail call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%39 = load i32, i32* @EXIT_FAILURE
%40 = tail call i32 @exit(i32 %39)
unreachable
41: ; preds = %31, %21
%42 = tail call i32 (...) @fork()
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %64
44: ; preds = %41
%45 = load i32, i32* @O_RDONLY
%46 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %45, i32 0)
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %44
%49 = load i64, i64* @errno
%50 = tail call i8* @strerror(i64 %49)
%51 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %48, %44
%53 = load i32, i32* @O_WRONLY
%54 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %53, i32 0)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = load i64, i64* @errno
%58 = tail call i8* @strerror(i64 %57)
%59 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %56, %52
%61 = tail call i32 @server(i32 %46, i32 %54)
%62 = load i32, i32* @EXIT_SUCCESS
%63 = tail call i32 @exit(i32 %62)
unreachable
64: ; preds = %41
%65 = load i32, i32* @O_WRONLY
%66 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %65, i32 0)
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %64
%69 = load i64, i64* @errno
%70 = tail call i8* @strerror(i64 %69)
%71 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %70)
br label %72
72: ; preds = %68, %64
%73 = load i32, i32* @O_RDONLY
%74 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %73, i32 0)
%75 = icmp slt i32 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %72
%77 = load i64, i64* @errno
%78 = tail call i8* @strerror(i64 %77)
%79 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %78)
br label %80
80: ; preds = %76, %72
%81 = tail call i32 @client(i32 %74, i32 %66)
%82 = tail call i32 @waitpid(i32 %42, i32* null, i32 0)
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %86
84: ; preds = %80
%85 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %86
86: ; preds = %84, %80
%87 = tail call i32 @close(i32 %74)
%88 = tail call i32 @close(i32 %66)
%89 = tail call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%90 = tail call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%91 = load i32, i32* @EXIT_SUCCESS
%92 = tail call i32 @exit(i32 %91)
unreachable
}