#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 {
  int dummy;
};
typedef scalar_t__ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ SOCK_DGRAM;
scalar_t__ bind(int, struct sockaddr *, int /*<<< orphan*/);
scalar_t__ connect(int, struct sockaddr *, int /*<<< orphan*/);
int /*<<< orphan*/ err(int, char *, char const *);
int /*<<< orphan*/ errx(int, char *, char const *, scalar_t__);
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
scalar_t__ recv(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                int /*<<< orphan*/);
scalar_t__ send(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int socket(int, int /*<<< orphan*/, int /*<<< orphan*/);
void test(int domain, const char *domainstr, struct sockaddr *sa,
          socklen_t salen) {
  int sock_send, sock_receive;
  ssize_t size;
  sock_send = socket(domain, SOCK_DGRAM, 0);
  if (sock_send < 0)
    err(-1, "socket(%s, SOCK_DGRAM, 0)", domainstr);
  sock_receive = socket(domain, SOCK_DGRAM, 0);
  if (sock_receive < 0)
    err(-1, "socket(%s, SOCK_DGRAM, 0)", domainstr);
  if (bind(sock_receive, sa, salen) < 0)
    err(-1, "Protocol %s bind(sock_receive)", domainstr);
  if (fcntl(sock_receive, F_SETFL, O_NONBLOCK, 1) < 0)
    err(-1,
        "Protocll %s fcntl(sock_receive, FL_SETFL, "
        "O_NONBLOCK)",
        domainstr);
  if (connect(sock_send, sa, salen) < 0)
    err(-1, "Protocol %s connect(sock_send)", domainstr);
  size = recv(sock_receive, NULL, 0, 0);
  if (size > 0)
    errx(-1, "Protocol %s recv(sock_receive, NULL, 0) before: %zd", domainstr,
         size);
  else if (size < 0)
    err(-1, "Protocol %s recv(sock_receive, NULL, 0) before", domainstr);
  size = send(sock_send, NULL, 0, 0);
  if (size < 0)
    err(-1, "Protocol %s send(sock_send, NULL, 0)", domainstr);
  (void)sleep(1);
  size = recv(sock_receive, NULL, 0, 0);
  if (size < 0)
    err(-1, "Protocol %s recv(sock_receive, NULL, 0) test", domainstr);
  size = recv(sock_receive, NULL, 0, 0);
  if (size > 0)
    errx(-1, "Protocol %s recv(sock_receive, NULL, 0) after: %zd", domainstr,
         size);
  else if (size < 0)
    err(-1, "Protocol %s recv(sock_receive, NULL, 0) after", domainstr);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10b0 <socket@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    11db <test+0x4b>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xe2a(%rip),%rsi
call   1070 <err@plt>
mov    -0x4(%rbp),%edi
mov    0x2dfb(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10b0 <socket@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1210 <test+0x80>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xdf5(%rip),%rsi
call   1070 <err@plt>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1080 <bind@plt>
cmp    $0x0,%rax
jge    123e <test+0xae>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xde1(%rip),%rsi
call   1070 <err@plt>
mov    -0x24(%rbp),%edi
mov    0x2d88(%rip),%rax
mov    (%rax),%esi
mov    0x2d97(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%ecx
call   1040 <fcntl@plt>
cmp    $0x0,%rax
jge    127c <test+0xec>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xdc2(%rip),%rsi
call   1070 <err@plt>
mov    -0x20(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1090 <connect@plt>
cmp    $0x0,%rax
jge    12aa <test+0x11a>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xdca(%rip),%rsi
call   1070 <err@plt>
mov    -0x24(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <recv@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jle    12e7 <test+0x157>
mov    -0x10(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0xffffffff,%edi
lea    0xdb1(%rip),%rsi
call   1050 <errx@plt>
jmp    130c <test+0x17c>
cmpq   $0x0,-0x30(%rbp)
jge    1307 <test+0x177>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xdc0(%rip),%rsi
call   1070 <err@plt>
jmp    130c <test+0x17c>
mov    -0x20(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <send@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jge    1340 <test+0x1b0>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xdb6(%rip),%rsi
call   1070 <err@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    -0x24(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <recv@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jge    137e <test+0x1ee>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xd9d(%rip),%rsi
call   1070 <err@plt>
mov    -0x24(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <recv@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jle    13bb <test+0x22b>
mov    -0x10(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0xffffffff,%edi
lea    0xd92(%rip),%rsi
call   1050 <errx@plt>
jmp    13e0 <test+0x250>
cmpq   $0x0,-0x30(%rbp)
jge    13db <test+0x24b>
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xda0(%rip),%rsi
call   1070 <err@plt>
jmp    13e0 <test+0x250>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdx,%r13
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x2e33(%rip),%rbx
mov    (%rbx),%esi
xor    %edx,%edx
call   10b0 <socket@plt>
mov    %eax,%r15d
test   %eax,%eax
jns    11d1 <test+0x41>
lea    0xe3c(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    (%rbx),%esi
mov    %ebp,%edi
xor    %edx,%edx
call   10b0 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    11f6 <test+0x66>
lea    0xe17(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    %r12d,%edx
call   1080 <bind@plt>
test   %rax,%rax
jns    121c <test+0x8c>
lea    0xe0b(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    0x2dad(%rip),%rax
mov    (%rax),%esi
mov    0x2dbc(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    $0x1,%ecx
call   1040 <fcntl@plt>
test   %rax,%rax
jns    1253 <test+0xc3>
lea    0xdf3(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    %r15d,%edi
mov    %r13,%rsi
mov    %r12d,%edx
call   1090 <connect@plt>
test   %rax,%rax
jns    127a <test+0xea>
lea    0xe02(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jle    12a5 <test+0x115>
lea    0xdfb(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <errx@plt>
jmp    12bb <test+0x12b>
jns    12bb <test+0x12b>
lea    0xe14(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    %r15d,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
test   %rax,%rax
jns    12e2 <test+0x152>
lea    0xe1c(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jns    1312 <test+0x182>
lea    0xe11(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
call   1070 <err@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jle    1349 <test+0x1b9>
lea    0xe18(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <errx@plt>
js     135a <test+0x1ca>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe15(%rip),%rsi
mov    $0xffffffff,%edi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <err@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@SOCK_DGRAM = global i32 0
@.str = [26 x i8] c"socket(%s, SOCK_DGRAM, 0)\00"
@.str.1 = [31 x i8] c"Protocol %s bind(sock_receive)\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.2 = [54 x i8] c"Protocll %s fcntl(sock_receive, FL_SETFL, O_NONBLOCK)\00"
@.str.3 = [31 x i8] c"Protocol %s connect(sock_send)\00"
@.str.4 = [52 x i8] c"Protocol %s recv(sock_receive, NULL, 0) before: %zd\00"
@.str.5 = [47 x i8] c"Protocol %s recv(sock_receive, NULL, 0) before\00"
@.str.6 = [37 x i8] c"Protocol %s send(sock_send, NULL, 0)\00"
@.str.7 = [45 x i8] c"Protocol %s recv(sock_receive, NULL, 0) test\00"
@.str.8 = [51 x i8] c"Protocol %s recv(sock_receive, NULL, 0) after: %zd\00"
@.str.9 = [46 x i8] c"Protocol %s recv(sock_receive, NULL, 0) after\00"
define void @test(i32 %0, i8* %1, %struct.sockaddr* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.sockaddr*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.sockaddr* %2, %struct.sockaddr** %7
store i32 %3, i32* %8
%12 = load i32, i32* %5
%13 = load i32, i32* @SOCK_DGRAM
%14 = call i32 @socket(i32 %12, i32 %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %4
%18 = load i8*, i8** %6
%19 = call i32 @err(i32 -1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %4
%21 = load i32, i32* %5
%22 = load i32, i32* @SOCK_DGRAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %10
%24 = load i32, i32* %10
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = load i8*, i8** %6
%28 = call i32 @err(i32 -1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %26, %20
%30 = load i32, i32* %10
%31 = load %struct.sockaddr*, %struct.sockaddr** %7
%32 = load i32, i32* %8
%33 = call i64 @bind(i32 %30, %struct.sockaddr* %31, i32 %32)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %29
%36 = load i8*, i8** %6
%37 = call i32 @err(i32 -1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %36)
br label %38
38: ; preds = %35, %29
%39 = load i32, i32* %10
%40 = load i32, i32* @F_SETFL
%41 = load i32, i32* @O_NONBLOCK
%42 = call i64 @fcntl(i32 %39, i32 %40, i32 %41, i32 1)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %38
%45 = load i8*, i8** %6
%46 = call i32 @err(i32 -1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %44, %38
%48 = load i32, i32* %9
%49 = load %struct.sockaddr*, %struct.sockaddr** %7
%50 = load i32, i32* %8
%51 = call i64 @connect(i32 %48, %struct.sockaddr* %49, i32 %50)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %47
%54 = load i8*, i8** %6
%55 = call i32 @err(i32 -1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %54)
br label %56
56: ; preds = %53, %47
%57 = load i32, i32* %10
%58 = call i64 @recv(i32 %57, i32* null, i32 0, i32 0)
store i64 %58, i64* %11
%59 = load i64, i64* %11
%60 = icmp sgt i64 %59, 0
br i1 %60, label %61, label %65
61: ; preds = %56
%62 = load i8*, i8** %6
%63 = load i64, i64* %11
%64 = call i32 @errx(i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* %62, i64 %63)
br label %72
65: ; preds = %56
%66 = load i64, i64* %11
%67 = icmp slt i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i8*, i8** %6
%70 = call i32 @err(i32 -1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %68, %65
br label %72
72: ; preds = %71, %61
%73 = load i32, i32* %9
%74 = call i64 @send(i32 %73, i32* null, i32 0, i32 0)
store i64 %74, i64* %11
%75 = load i64, i64* %11
%76 = icmp slt i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %72
%78 = load i8*, i8** %6
%79 = call i32 @err(i32 -1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %78)
br label %80
80: ; preds = %77, %72
%81 = call i32 @sleep(i32 1)
%82 = load i32, i32* %10
%83 = call i64 @recv(i32 %82, i32* null, i32 0, i32 0)
store i64 %83, i64* %11
%84 = load i64, i64* %11
%85 = icmp slt i64 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %80
%87 = load i8*, i8** %6
%88 = call i32 @err(i32 -1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i8* %87)
br label %89
89: ; preds = %86, %80
%90 = load i32, i32* %10
%91 = call i64 @recv(i32 %90, i32* null, i32 0, i32 0)
store i64 %91, i64* %11
%92 = load i64, i64* %11
%93 = icmp sgt i64 %92, 0
br i1 %93, label %94, label %98
94: ; preds = %89
%95 = load i8*, i8** %6
%96 = load i64, i64* %11
%97 = call i32 @errx(i32 -1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0), i8* %95, i64 %96)
br label %105
98: ; preds = %89
%99 = load i64, i64* %11
%100 = icmp slt i64 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %98
%102 = load i8*, i8** %6
%103 = call i32 @err(i32 -1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0), i8* %102)
br label %104
104: ; preds = %101, %98
br label %105
105: ; preds = %104, %94
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@SOCK_DGRAM = global i32 0
@.str = [26 x i8] c"socket(%s, SOCK_DGRAM, 0)\00"
@.str.1 = [31 x i8] c"Protocol %s bind(sock_receive)\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.2 = [54 x i8] c"Protocll %s fcntl(sock_receive, FL_SETFL, O_NONBLOCK)\00"
@.str.3 = [31 x i8] c"Protocol %s connect(sock_send)\00"
@.str.4 = [52 x i8] c"Protocol %s recv(sock_receive, NULL, 0) before: %zd\00"
@.str.5 = [47 x i8] c"Protocol %s recv(sock_receive, NULL, 0) before\00"
@.str.6 = [37 x i8] c"Protocol %s send(sock_send, NULL, 0)\00"
@.str.7 = [45 x i8] c"Protocol %s recv(sock_receive, NULL, 0) test\00"
@.str.8 = [51 x i8] c"Protocol %s recv(sock_receive, NULL, 0) after: %zd\00"
@.str.9 = [46 x i8] c"Protocol %s recv(sock_receive, NULL, 0) after\00"
define void @test(i32 %0, i8* %1, %struct.sockaddr* %2, i32 %3) {
%5 = load i32, i32* @SOCK_DGRAM
%6 = tail call i32 @socket(i32 %0, i32 %5, i32 0)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %8, %4
%11 = load i32, i32* @SOCK_DGRAM
%12 = tail call i32 @socket(i32 %0, i32 %11, i32 0)
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %16
16: ; preds = %14, %10
%17 = tail call i64 @bind(i32 %12, %struct.sockaddr* %2, i32 %3)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* @F_SETFL
%23 = load i32, i32* @O_NONBLOCK
%24 = tail call i64 @fcntl(i32 %12, i32 %22, i32 %23, i32 1)
%25 = icmp slt i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i8* %1)
br label %28
28: ; preds = %26, %21
%29 = tail call i64 @connect(i32 %6, %struct.sockaddr* %2, i32 %3)
%30 = icmp slt i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %1)
br label %33
33: ; preds = %31, %28
%34 = tail call i64 @recv(i32 %12, i32* null, i32 0, i32 0)
%35 = icmp sgt i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = tail call i32 @errx(i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* %1, i64 %34)
br label %42
38: ; preds = %33
%39 = icmp slt i64 %34, 0
br i1 %39, label %40, label %42
40: ; preds = %38
%41 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* %1)
br label %42
42: ; preds = %38, %40, %36
%43 = tail call i64 @send(i32 %6, i32* null, i32 0, i32 0)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %1)
br label %47
47: ; preds = %45, %42
%48 = tail call i32 @sleep(i32 1)
%49 = tail call i64 @recv(i32 %12, i32* null, i32 0, i32 0)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i8* %1)
br label %53
53: ; preds = %51, %47
%54 = tail call i64 @recv(i32 %12, i32* null, i32 0, i32 0)
%55 = icmp sgt i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = tail call i32 @errx(i32 -1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0), i8* %1, i64 %54)
br label %62
58: ; preds = %53
%59 = icmp slt i64 %54, 0
br i1 %59, label %60, label %62
60: ; preds = %58
%61 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0), i8* %1)
br label %62
62: ; preds = %58, %60, %56
ret void
}