#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 */
scalar_t__ EPROTONOSUPPORT;
int /*<<< orphan*/ PF_ROUTE;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ err(int, char *);
scalar_t__ errno;
int /*<<< orphan*/ errx(int, char *, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ socketpair(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int *);
int main(void) {
  int sock, socks[2];
  sock = socket(PF_ROUTE, SOCK_STREAM, 0);
  if (sock >= 0) {
    close(sock);
    errx(-1, "socket(PF_ROUTE, SOCK_STREAM, 0) returned %d", sock);
  }
  if (errno != EPROTONOSUPPORT)
    err(-1, "socket(PF_ROUTE, SOCK_STREAM, 0)");
  sock = socket(PF_ROUTE, SOCK_DGRAM, 0);
  if (sock >= 0) {
    close(sock);
    errx(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0) returned %d", sock);
  }
  if (errno != EPROTONOSUPPORT)
    err(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0)");
  sock = socket(PF_ROUTE, SOCK_RAW, 0);
  if (sock < 0)
    err(-1, "socket(PF_ROUTE, SOCK_RAW, 0)");
  close(sock);
  if (socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) == 0) {
    close(socks[0]);
    close(socks[1]);
    errx(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success");
  }
  if (errno != EPROTONOSUPPORT)
    err(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)");
  if (socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) == 0) {
    close(socks[0]);
    close(socks[1]);
    errx(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success");
  }
  if (errno != EPROTONOSUPPORT)
    err(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)");
  if (socketpair(PF_ROUTE, SOCK_RAW, 0, socks) == 0) {
    close(socks[0]);
    close(socks[1]);
    errx(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1070 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     11a3 <main+0x53>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%edx
mov    $0xffffffff,%edi
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%rax
mov    0x2e14(%rip),%rcx
cmp    (%rcx),%rax
je     11ce <main+0x7e>
mov    $0xffffffff,%edi
lea    0xe64(%rip),%rsi
call   1060 <err@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
mov    0x2dfa(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1070 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1212 <main+0xc2>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%edx
mov    $0xffffffff,%edi
lea    0xe43(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
mov    0x2d9f(%rip),%rax
mov    (%rax),%rax
mov    0x2da5(%rip),%rcx
cmp    (%rcx),%rax
je     123d <main+0xed>
mov    $0xffffffff,%edi
lea    0xe42(%rip),%rsi
call   1060 <err@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
mov    0x2d93(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1070 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1274 <main+0x124>
mov    $0xffffffff,%edi
lea    0xe2b(%rip),%rsi
call   1060 <err@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
mov    0x2d34(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1050 <socketpair@plt>
cmp    $0x0,%rax
jne    12c6 <main+0x176>
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    $0xffffffff,%edi
lea    0xdf9(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%rax
mov    0x2cf1(%rip),%rcx
cmp    (%rcx),%rax
je     12f1 <main+0x1a1>
mov    $0xffffffff,%edi
lea    0xe00(%rip),%rsi
call   1060 <err@plt>
mov    0x2cf0(%rip),%rax
mov    (%rax),%edi
mov    0x2cd7(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1050 <socketpair@plt>
cmp    $0x0,%rax
jne    133b <main+0x1eb>
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    $0xffffffff,%edi
lea    0xde4(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
mov    0x2c76(%rip),%rax
mov    (%rax),%rax
mov    0x2c7c(%rip),%rcx
cmp    (%rcx),%rax
je     1366 <main+0x216>
mov    $0xffffffff,%edi
lea    0xdea(%rip),%rsi
call   1060 <err@plt>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
mov    0x2c6a(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1050 <socketpair@plt>
cmp    $0x0,%rax
jne    13b0 <main+0x260>
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    $0xffffffff,%edi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e86(%rip),%r14
mov    (%r14),%edi
mov    0x2e54(%rip),%r13
mov    0x0(%r13),%esi
xor    %edx,%edx
call   1070 <socket@plt>
test   %eax,%eax
js     1199 <main+0x49>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <close@plt>
lea    0xe75(%rip),%rsi
mov    $0xffffffff,%edi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <errx@plt>
mov    0x2e18(%rip),%r15
mov    (%r15),%rax
mov    0x2e1e(%rip),%r12
cmp    (%r12),%rax
je     11c1 <main+0x71>
lea    0xe76(%rip),%rsi
mov    $0xffffffff,%edi
call   1060 <err@plt>
mov    (%r14),%edi
mov    0x2e0d(%rip),%rbp
mov    0x0(%rbp),%esi
xor    %edx,%edx
call   1070 <socket@plt>
test   %eax,%eax
js     11f7 <main+0xa7>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <close@plt>
lea    0xe65(%rip),%rsi
mov    $0xffffffff,%edi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <errx@plt>
mov    (%r15),%rax
cmp    (%r12),%rax
je     1211 <main+0xc1>
lea    0xe73(%rip),%rsi
mov    $0xffffffff,%edi
call   1060 <err@plt>
mov    (%r14),%edi
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1070 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    123b <main+0xeb>
lea    0xe69(%rip),%rsi
mov    $0xffffffff,%edi
call   1060 <err@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    (%r14),%edi
mov    0x0(%r13),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1050 <socketpair@plt>
test   %rax,%rax
jne    127c <main+0x12c>
mov    (%rsp),%edi
call   1040 <close@plt>
mov    0x4(%rsp),%edi
call   1040 <close@plt>
lea    0xe48(%rip),%rsi
mov    $0xffffffff,%edi
xor    %eax,%eax
call   1030 <errx@plt>
mov    (%r15),%rax
cmp    (%r12),%rax
je     1296 <main+0x146>
lea    0xe60(%rip),%rsi
mov    $0xffffffff,%edi
call   1060 <err@plt>
mov    (%r14),%edi
mov    0x0(%rbp),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1050 <socketpair@plt>
test   %rax,%rax
jne    12cf <main+0x17f>
mov    (%rsp),%edi
call   1040 <close@plt>
mov    0x4(%rsp),%edi
call   1040 <close@plt>
lea    0xe55(%rip),%rsi
mov    $0xffffffff,%edi
xor    %eax,%eax
call   1030 <errx@plt>
mov    (%r15),%rax
cmp    (%r12),%rax
je     12e9 <main+0x199>
lea    0xe6c(%rip),%rsi
mov    $0xffffffff,%edi
call   1060 <err@plt>
mov    (%r14),%edi
mov    0x2ced(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1050 <socketpair@plt>
test   %rax,%rax
jne    1328 <main+0x1d8>
mov    (%rsp),%edi
call   1040 <close@plt>
mov    0x4(%rsp),%edi
call   1040 <close@plt>
lea    0xd9c(%rip),%rsi
mov    $0xffffffff,%edi
xor    %eax,%eax
call   1030 <errx@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@PF_ROUTE = global i32 0
@SOCK_STREAM = global i32 0
@.str = [45 x i8] c"socket(PF_ROUTE, SOCK_STREAM, 0) returned %d\00"
@errno = global i64 0
@EPROTONOSUPPORT = global i64 0
@.str.1 = [33 x i8] c"socket(PF_ROUTE, SOCK_STREAM, 0)\00"
@SOCK_DGRAM = global i32 0
@.str.2 = [44 x i8] c"socket(PF_ROUTE, SOCK_DGRAM, 0) returned %d\00"
@.str.3 = [32 x i8] c"socket(PF_ROUTE, SOCK_DGRAM, 0)\00"
@SOCK_RAW = global i32 0
@.str.4 = [30 x i8] c"socket(PF_ROUTE, SOCK_RAW, 0)\00"
@.str.5 = [52 x i8] c"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success\00"
@.str.6 = [44 x i8] c"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)\00"
@.str.7 = [51 x i8] c"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success\00"
@.str.8 = [43 x i8] c"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 0, i32* %1
%4 = load i32, i32* @PF_ROUTE
%5 = load i32, i32* @SOCK_STREAM
%6 = call i32 @socket(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
%12 = load i32, i32* %2
%13 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9, %0
%15 = load i64, i64* @errno
%16 = load i64, i64* @EPROTONOSUPPORT
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @err(i32 -1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* @PF_ROUTE
%22 = load i32, i32* @SOCK_DGRAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = icmp sge i32 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %20
%27 = load i32, i32* %2
%28 = call i32 @close(i32 %27)
%29 = load i32, i32* %2
%30 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %26, %20
%32 = load i64, i64* @errno
%33 = load i64, i64* @EPROTONOSUPPORT
%34 = icmp ne i64 %32, %33
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @err(i32 -1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35, %31
%38 = load i32, i32* @PF_ROUTE
%39 = load i32, i32* @SOCK_RAW
%40 = call i32 @socket(i32 %38, i32 %39, i32 0)
store i32 %40, i32* %2
%41 = load i32, i32* %2
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = call i32 @err(i32 -1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %45
45: ; preds = %43, %37
%46 = load i32, i32* %2
%47 = call i32 @close(i32 %46)
%48 = load i32, i32* @PF_ROUTE
%49 = load i32, i32* @SOCK_STREAM
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%51 = call i64 @socketpair(i32 %48, i32 %49, i32 0, i32* %50)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %61
53: ; preds = %45
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%55 = load i32, i32* %54
%56 = call i32 @close(i32 %55)
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%58 = load i32, i32* %57
%59 = call i32 @close(i32 %58)
%60 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
br label %61
61: ; preds = %53, %45
%62 = load i64, i64* @errno
%63 = load i64, i64* @EPROTONOSUPPORT
%64 = icmp ne i64 %62, %63
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @err(i32 -1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
%68 = load i32, i32* @PF_ROUTE
%69 = load i32, i32* @SOCK_DGRAM
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%71 = call i64 @socketpair(i32 %68, i32 %69, i32 0, i32* %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %81
73: ; preds = %67
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%75 = load i32, i32* %74
%76 = call i32 @close(i32 %75)
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%78 = load i32, i32* %77
%79 = call i32 @close(i32 %78)
%80 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
br label %81
81: ; preds = %73, %67
%82 = load i64, i64* @errno
%83 = load i64, i64* @EPROTONOSUPPORT
%84 = icmp ne i64 %82, %83
br i1 %84, label %85, label %87
85: ; preds = %81
%86 = call i32 @err(i32 -1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
br label %87
87: ; preds = %85, %81
%88 = load i32, i32* @PF_ROUTE
%89 = load i32, i32* @SOCK_RAW
%90 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%91 = call i64 @socketpair(i32 %88, i32 %89, i32 0, i32* %90)
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %101
93: ; preds = %87
%94 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%95 = load i32, i32* %94
%96 = call i32 @close(i32 %95)
%97 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%98 = load i32, i32* %97
%99 = call i32 @close(i32 %98)
%100 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
br label %101
101: ; preds = %93, %87
ret i32 0
}

LLVM IR (-O2):
@PF_ROUTE = global i32 0
@SOCK_STREAM = global i32 0
@.str = [45 x i8] c"socket(PF_ROUTE, SOCK_STREAM, 0) returned %d\00"
@errno = global i64 0
@EPROTONOSUPPORT = global i64 0
@.str.1 = [33 x i8] c"socket(PF_ROUTE, SOCK_STREAM, 0)\00"
@SOCK_DGRAM = global i32 0
@.str.2 = [44 x i8] c"socket(PF_ROUTE, SOCK_DGRAM, 0) returned %d\00"
@.str.3 = [32 x i8] c"socket(PF_ROUTE, SOCK_DGRAM, 0)\00"
@SOCK_RAW = global i32 0
@.str.4 = [30 x i8] c"socket(PF_ROUTE, SOCK_RAW, 0)\00"
@.str.5 = [52 x i8] c"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success\00"
@.str.6 = [44 x i8] c"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)\00"
@.str.7 = [51 x i8] c"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success\00"
@.str.8 = [43 x i8] c"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = load i32, i32* @PF_ROUTE
%4 = load i32, i32* @SOCK_STREAM
%5 = tail call i32 @socket(i32 %3, i32 %4, i32 0)
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = tail call i32 @close(i32 %5)
%9 = tail call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %7, %0
%11 = load i64, i64* @errno
%12 = load i64, i64* @EPROTONOSUPPORT
%13 = icmp eq i64 %11, %12
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* @PF_ROUTE
%18 = load i32, i32* @SOCK_DGRAM
%19 = tail call i32 @socket(i32 %17, i32 %18, i32 0)
%20 = icmp sgt i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = tail call i32 @close(i32 %19)
%23 = tail call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %24
24: ; preds = %21, %16
%25 = load i64, i64* @errno
%26 = load i64, i64* @EPROTONOSUPPORT
%27 = icmp eq i64 %25, %26
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %24
%31 = load i32, i32* @PF_ROUTE
%32 = load i32, i32* @SOCK_RAW
%33 = tail call i32 @socket(i32 %31, i32 %32, i32 0)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %35, %30
%38 = tail call i32 @close(i32 %33)
%39 = load i32, i32* @PF_ROUTE
%40 = load i32, i32* @SOCK_STREAM
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%42 = call i64 @socketpair(i32 %39, i32 %40, i32 0, i32* %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %51
44: ; preds = %37
%45 = load i32, i32* %41
%46 = call i32 @close(i32 %45)
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%48 = load i32, i32* %47
%49 = call i32 @close(i32 %48)
%50 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
br label %51
51: ; preds = %44, %37
%52 = load i64, i64* @errno
%53 = load i64, i64* @EPROTONOSUPPORT
%54 = icmp eq i64 %52, %53
br i1 %54, label %57, label %55
55: ; preds = %51
%56 = call i32 @err(i32 -1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %57
57: ; preds = %55, %51
%58 = load i32, i32* @PF_ROUTE
%59 = load i32, i32* @SOCK_DGRAM
%60 = call i64 @socketpair(i32 %58, i32 %59, i32 0, i32* %41)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %69
62: ; preds = %57
%63 = load i32, i32* %41
%64 = call i32 @close(i32 %63)
%65 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%66 = load i32, i32* %65
%67 = call i32 @close(i32 %66)
%68 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
br label %69
69: ; preds = %62, %57
%70 = load i64, i64* @errno
%71 = load i64, i64* @EPROTONOSUPPORT
%72 = icmp eq i64 %70, %71
br i1 %72, label %75, label %73
73: ; preds = %69
%74 = call i32 @err(i32 -1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
br label %75
75: ; preds = %73, %69
%76 = load i32, i32* @PF_ROUTE
%77 = load i32, i32* @SOCK_RAW
%78 = call i64 @socketpair(i32 %76, i32 %77, i32 0, i32* %41)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %87
80: ; preds = %75
%81 = load i32, i32* %41
%82 = call i32 @close(i32 %81)
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%84 = load i32, i32* %83
%85 = call i32 @close(i32 %84)
%86 = call i32 (i32, i8*, ...) @errx(i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
br label %87
87: ; preds = %80, %75
ret i32 0
}