#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__ EFAULT;
scalar_t__ EOPNOTSUPP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ PF_UNIX;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ STDIN_FILENO;
scalar_t__ close(int);
int dup(int /*<<< orphan*/);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ socketpair(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int *);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
int main(void) {
  int fd1, fd2, fd3;
  int sv[2];
  if (socketpair(PF_UNIX, SOCK_DGRAM, 0, sv) != 0) {
    fprintf(stderr, "socketpair(PF_UNIX, SOCK_DGRAM): %s\n", strerror(errno));
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (close(sv[0]) != 0) {
    fprintf(stderr, "socketpair(PF_UNIX, SOCK_DGRAM) close 0: %s\n",
            strerror(errno));
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (close(sv[1]) != 0) {
    fprintf(stderr, "socketpair(PF_UNIX, SOCK_DGRAM) close 1: %s\n",
            strerror(errno));
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) != 0) {
    fprintf(stderr, "socketpair(PF_UNIX, SOCK_STREAM): %s\n", strerror(errno));
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (close(sv[0]) != 0) {
    fprintf(stderr, "socketpair(PF_UNIX, SOCK_STREAM) close 0: %s\n",
            strerror(errno));
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (close(sv[1]) != 0) {
    fprintf(stderr,
            "socketpair(PF_UNIX, SOCK_STREAM) close 1: "
            "%s\n",
            strerror(errno));
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (socketpair(PF_INET, SOCK_DGRAM, 0, sv) == 0) {
    fprintf(stderr, "socketpair(PF_INET, SOCK_DGRAM): opened\n");
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (errno != EOPNOTSUPP) {
    fprintf(stderr, "socketpair(PF_INET, SOCK_DGRAM): %s\n", strerror(errno));
    fprintf(stderr, "FAIL\n");
  }
  if (socketpair(PF_INET, SOCK_STREAM, 0, sv) == 0) {
    fprintf(stderr, "socketpair(PF_INET, SOCK_STREAM): opened\n");
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (errno != EOPNOTSUPP) {
    fprintf(stderr, "socketpair(PF_INET, SOCK_STREAM): %s\n", strerror(errno));
    fprintf(stderr, "FAIL\n");
  }
  fd1 = dup(STDIN_FILENO);
  fd2 = dup(STDIN_FILENO);
  if (fd2 != fd1 + 1) {
    fprintf(stderr, "Non-sequential fd allocation\n");
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (socketpair(PF_UNIX, SOCK_DGRAM, 0, NULL) == 0) {
    fprintf(stderr, "socketpair(PF_UNIX, SOCK_DGRAM, NULL): opened\n");
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  if (errno != EFAULT) {
    fprintf(stderr, "socketpair(PF_UNIX, SOCK_DGRAM, NULL): %s\n",
            strerror(errno));
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  fd3 = dup(STDIN_FILENO);
  if (fd3 != fd2 + 1) {
    fprintf(stderr, "socketpair(..., NULL) allocated descriptors\n");
    fprintf(stderr, "FAIL\n");
    exit(-1);
  }
  fprintf(stderr, "PASS\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    0x2e59(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
je     11e6 <main+0x86>
mov    0x2e2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2e07(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rdx
lea    0xe42(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1248 <main+0xe8>
mov    0x2dc9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2da5(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x20(%rbp),%edi
mov    %rax,%rdx
lea    0xe0b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
lea    0xdee(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     12aa <main+0x14a>
mov    0x2d67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d43(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x24(%rbp),%edi
mov    %rax,%rdx
lea    0xdd6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
mov    0x2cfe(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
je     1321 <main+0x1c1>
mov    0x2cf0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2ccc(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x28(%rbp),%edi
mov    %rax,%rdx
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
lea    0xd15(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1383 <main+0x223>
mov    0x2c8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2c6a(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    %rax,%rdx
lea    0xd50(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
lea    0xcb3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     13e5 <main+0x285>
mov    0x2c2c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2c08(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x30(%rbp),%edi
mov    %rax,%rdx
lea    0xd1c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bfd(%rip),%rax
mov    (%rax),%edi
lea    0xc51(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2bbc(%rip),%rax
mov    (%rax),%edi
mov    0x2be3(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
jne    1444 <main+0x2e4>
mov    0x2bb5(%rip),%rax
mov    (%rax),%edi
lea    0xceb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b9e(%rip),%rax
mov    (%rax),%edi
lea    0xbf2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2b65(%rip),%rax
mov    (%rax),%rax
mov    0x2b6b(%rip),%rcx
cmp    (%rcx),%rax
je     14a4 <main+0x344>
mov    0x2b63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2b3f(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    %rax,%rdx
lea    0xcaa(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b34(%rip),%rax
mov    (%rax),%edi
lea    0xb88(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2afd(%rip),%rax
mov    (%rax),%edi
mov    0x2b04(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
jne    1503 <main+0x3a3>
mov    0x2af6(%rip),%rax
mov    (%rax),%edi
lea    0xc7a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2adf(%rip),%rax
mov    (%rax),%edi
lea    0xb33(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2aa6(%rip),%rax
mov    (%rax),%rax
mov    0x2aac(%rip),%rcx
cmp    (%rcx),%rax
je     1563 <main+0x403>
mov    0x2aa4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x2a80(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x38(%rbp),%edi
mov    %rax,%rdx
lea    0xc3a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2a75(%rip),%rax
mov    (%rax),%edi
lea    0xac9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2a36(%rip),%rax
mov    (%rax),%edi
call   1030 <dup@plt>
mov    %eax,-0x8(%rbp)
mov    0x2a25(%rip),%rax
mov    (%rax),%edi
call   1030 <dup@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     15ce <main+0x46e>
mov    0x2a2b(%rip),%rax
mov    (%rax),%edi
lea    0xbff(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2a14(%rip),%rax
mov    (%rax),%edi
lea    0xa68(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2a1b(%rip),%rax
mov    (%rax),%edi
mov    0x29fa(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
jne    162d <main+0x4cd>
mov    0x29cc(%rip),%rax
mov    (%rax),%edi
lea    0xbbe(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x29b5(%rip),%rax
mov    (%rax),%edi
lea    0xa09(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x297c(%rip),%rax
mov    (%rax),%rax
mov    0x29ba(%rip),%rcx
cmp    (%rcx),%rax
je     1697 <main+0x537>
mov    0x297a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2956(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%rdx
lea    0xb83(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x294b(%rip),%rax
mov    (%rax),%edi
lea    0x99f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2902(%rip),%rax
mov    (%rax),%edi
call   1030 <dup@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     16f1 <main+0x591>
mov    0x2908(%rip),%rax
mov    (%rax),%edi
lea    0xb54(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x28f1(%rip),%rax
mov    (%rax),%edi
lea    0x945(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x28d0(%rip),%rax
mov    (%rax),%edi
lea    0xb49(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e7e(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e5d(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
test   %rax,%rax
jne    122c <main+0xcc>
mov    (%rsp),%edi
call   1040 <close@plt>
test   %rax,%rax
jne    1251 <main+0xf1>
mov    0x4(%rsp),%edi
call   1040 <close@plt>
test   %rax,%rax
jne    1276 <main+0x116>
mov    (%rbx),%edi
mov    0x2dfb(%rip),%r15
mov    (%r15),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
test   %rax,%rax
jne    1298 <main+0x138>
mov    (%rsp),%edi
call   1040 <close@plt>
test   %rax,%rax
jne    12ba <main+0x15a>
mov    0x4(%rsp),%edi
call   1040 <close@plt>
test   %rax,%rax
jne    12dc <main+0x17c>
mov    0x2dab(%rip),%r13
mov    0x0(%r13),%edi
mov    0x0(%rbp),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
test   %rax,%rax
jne    1323 <main+0x1c3>
mov    0x2daa(%rip),%rbx
mov    (%rbx),%edi
lea    0xee0(%rip),%rsi
jmp    1442 <main+0x2e2>
mov    0x2d95(%rip),%rbp
mov    0x0(%rbp),%ebx
mov    0x2d73(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
lea    0xdb4(%rip),%rsi
jmp    12fc <main+0x19c>
mov    0x2d70(%rip),%rbp
mov    0x0(%rbp),%ebx
mov    0x2d4e(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
lea    0xdba(%rip),%rsi
jmp    12fc <main+0x19c>
mov    0x2d4b(%rip),%rbp
mov    0x0(%rbp),%ebx
mov    0x2d29(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
lea    0xdc2(%rip),%rsi
jmp    12fc <main+0x19c>
mov    0x2d29(%rip),%rbp
mov    0x0(%rbp),%ebx
mov    0x2d07(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
lea    0xdcd(%rip),%rsi
jmp    12fc <main+0x19c>
mov    0x2d07(%rip),%rbp
mov    0x0(%rbp),%ebx
mov    0x2ce5(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
lea    0xdd1(%rip),%rsi
jmp    12fc <main+0x19c>
mov    0x2ce5(%rip),%rbp
mov    0x0(%rbp),%ebx
mov    0x2cc3(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
lea    0xddd(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xd13(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2c86(%rip),%rax
mov    (%rax),%rdi
mov    0x2c8c(%rip),%r14
cmp    (%r14),%rdi
je     1376 <main+0x216>
mov    0x2c88(%rip),%r12
mov    (%r12),%r14d
call   1080 <strerror@plt>
lea    0xde0(%rip),%rsi
mov    %r14d,%edi
mov    0x2c66(%rip),%r14
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r12),%edi
lea    0xcb6(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%r13),%edi
mov    (%r15),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
test   %rax,%rax
jne    13a1 <main+0x241>
mov    0x2c35(%rip),%rbx
mov    (%rbx),%edi
lea    0xdb9(%rip),%rsi
jmp    1442 <main+0x2e2>
mov    0x2c08(%rip),%r13
mov    0x0(%r13),%rdi
cmp    (%r14),%rdi
je     13e5 <main+0x285>
mov    0x2c10(%rip),%r15
mov    (%r15),%r14d
call   1080 <strerror@plt>
lea    0xdb8(%rip),%rsi
mov    %r14d,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xc47(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2bb4(%rip),%r12
mov    (%r12),%edi
call   1030 <dup@plt>
mov    %eax,%r15d
mov    (%r12),%edi
call   1030 <dup@plt>
add    $0x1,%r15d
cmp    %r15d,%eax
jne    1432 <main+0x2d2>
mov    %eax,%r14d
mov    (%rbx),%edi
mov    0x0(%rbp),%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <socketpair@plt>
test   %rax,%rax
jne    1450 <main+0x2f0>
mov    0x2ba1(%rip),%rbx
mov    (%rbx),%edi
lea    0xd93(%rip),%rsi
jmp    1442 <main+0x2e2>
mov    0x2b8f(%rip),%rbx
mov    (%rbx),%edi
lea    0xd63(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx),%edi
jmp    130b <main+0x1ab>
mov    0x0(%r13),%rdi
mov    0x2b9d(%rip),%rax
cmp    (%rax),%rdi
jne    1490 <main+0x330>
mov    (%r12),%edi
call   1030 <dup@plt>
add    $0x1,%r14d
mov    0x2b54(%rip),%rbx
mov    (%rbx),%edi
cmp    %r14d,%eax
jne    14ab <main+0x34b>
lea    0xdc8(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    0x2b31(%rip),%rbp
mov    0x0(%rbp),%ebx
call   1080 <strerror@plt>
lea    0xd4c(%rip),%rsi
jmp    12fc <main+0x19c>
lea    0xd6b(%rip),%rsi
jmp    1442 <main+0x2e2>

LLVM IR (-O0):
@PF_UNIX = global i32 0
@SOCK_DGRAM = global i32 0
@stderr = global i32 0
@.str = [37 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM): %s\0A\00"
@errno = global i64 0
@.str.1 = [6 x i8] c"FAIL\0A\00"
@.str.2 = [45 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM) close 0: %s\0A\00"
@.str.3 = [45 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM) close 1: %s\0A\00"
@SOCK_STREAM = global i32 0
@.str.4 = [38 x i8] c"socketpair(PF_UNIX, SOCK_STREAM): %s\0A\00"
@.str.5 = [46 x i8] c"socketpair(PF_UNIX, SOCK_STREAM) close 0: %s\0A\00"
@.str.6 = [46 x i8] c"socketpair(PF_UNIX, SOCK_STREAM) close 1: %s\0A\00"
@PF_INET = global i32 0
@.str.7 = [41 x i8] c"socketpair(PF_INET, SOCK_DGRAM): opened\0A\00"
@EOPNOTSUPP = global i64 0
@.str.8 = [37 x i8] c"socketpair(PF_INET, SOCK_DGRAM): %s\0A\00"
@.str.9 = [42 x i8] c"socketpair(PF_INET, SOCK_STREAM): opened\0A\00"
@.str.10 = [38 x i8] c"socketpair(PF_INET, SOCK_STREAM): %s\0A\00"
@STDIN_FILENO = global i32 0
@.str.11 = [30 x i8] c"Non-sequential fd allocation\0A\00"
@.str.12 = [47 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM, NULL): opened\0A\00"
@EFAULT = global i64 0
@.str.13 = [43 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM, NULL): %s\0A\00"
@.str.14 = [45 x i8] c"socketpair(..., NULL) allocated descriptors\0A\00"
@.str.15 = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 0, i32* %1
%6 = load i32, i32* @PF_UNIX
%7 = load i32, i32* @SOCK_DGRAM
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%9 = call i64 @socketpair(i32 %6, i32 %7, i32 0, i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = load i64, i64* @errno
%14 = call i8* @strerror(i64 %13)
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %0
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%21 = load i32, i32* %20
%22 = call i64 @close(i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %19
%25 = load i32, i32* @stderr
%26 = load i64, i64* @errno
%27 = call i8* @strerror(i64 %26)
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @exit(i32 -1)
unreachable
32: ; preds = %19
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%34 = load i32, i32* %33
%35 = call i64 @close(i32 %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %32
%38 = load i32, i32* @stderr
%39 = load i64, i64* @errno
%40 = call i8* @strerror(i64 %39)
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %40)
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%44 = call i32 @exit(i32 -1)
unreachable
45: ; preds = %32
%46 = load i32, i32* @PF_UNIX
%47 = load i32, i32* @SOCK_STREAM
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%49 = call i64 @socketpair(i32 %46, i32 %47, i32 0, i32* %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %59
51: ; preds = %45
%52 = load i32, i32* @stderr
%53 = load i64, i64* @errno
%54 = call i8* @strerror(i64 %53)
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %54)
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%58 = call i32 @exit(i32 -1)
unreachable
59: ; preds = %45
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%61 = load i32, i32* %60
%62 = call i64 @close(i32 %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %72
64: ; preds = %59
%65 = load i32, i32* @stderr
%66 = load i64, i64* @errno
%67 = call i8* @strerror(i64 %66)
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %67)
%69 = load i32, i32* @stderr
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%71 = call i32 @exit(i32 -1)
unreachable
72: ; preds = %59
%73 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%74 = load i32, i32* %73
%75 = call i64 @close(i32 %74)
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %85
77: ; preds = %72
%78 = load i32, i32* @stderr
%79 = load i64, i64* @errno
%80 = call i8* @strerror(i64 %79)
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* %80)
%82 = load i32, i32* @stderr
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%84 = call i32 @exit(i32 -1)
unreachable
85: ; preds = %72
%86 = load i32, i32* @PF_INET
%87 = load i32, i32* @SOCK_DGRAM
%88 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%89 = call i64 @socketpair(i32 %86, i32 %87, i32 0, i32* %88)
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %97
91: ; preds = %85
%92 = load i32, i32* @stderr
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%94 = load i32, i32* @stderr
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%96 = call i32 @exit(i32 -1)
unreachable
97: ; preds = %85
%98 = load i64, i64* @errno
%99 = load i64, i64* @EOPNOTSUPP
%100 = icmp ne i64 %98, %99
br i1 %100, label %101, label %108
101: ; preds = %97
%102 = load i32, i32* @stderr
%103 = load i64, i64* @errno
%104 = call i8* @strerror(i64 %103)
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %104)
%106 = load i32, i32* @stderr
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %108
108: ; preds = %101, %97
%109 = load i32, i32* @PF_INET
%110 = load i32, i32* @SOCK_STREAM
%111 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%112 = call i64 @socketpair(i32 %109, i32 %110, i32 0, i32* %111)
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %120
114: ; preds = %108
%115 = load i32, i32* @stderr
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
%117 = load i32, i32* @stderr
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%119 = call i32 @exit(i32 -1)
unreachable
120: ; preds = %108
%121 = load i64, i64* @errno
%122 = load i64, i64* @EOPNOTSUPP
%123 = icmp ne i64 %121, %122
br i1 %123, label %124, label %131
124: ; preds = %120
%125 = load i32, i32* @stderr
%126 = load i64, i64* @errno
%127 = call i8* @strerror(i64 %126)
%128 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i8* %127)
%129 = load i32, i32* @stderr
%130 = call i32 (i32, i8*, ...) @fprintf(i32 %129, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %131
131: ; preds = %124, %120
%132 = load i32, i32* @STDIN_FILENO
%133 = call i32 @dup(i32 %132)
store i32 %133, i32* %2
%134 = load i32, i32* @STDIN_FILENO
%135 = call i32 @dup(i32 %134)
store i32 %135, i32* %3
%136 = load i32, i32* %3
%137 = load i32, i32* %2
%138 = add nsw i32 %137, 1
%139 = icmp ne i32 %136, %138
br i1 %139, label %140, label %146
140: ; preds = %131
%141 = load i32, i32* @stderr
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %141, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%143 = load i32, i32* @stderr
%144 = call i32 (i32, i8*, ...) @fprintf(i32 %143, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%145 = call i32 @exit(i32 -1)
unreachable
146: ; preds = %131
%147 = load i32, i32* @PF_UNIX
%148 = load i32, i32* @SOCK_DGRAM
%149 = call i64 @socketpair(i32 %147, i32 %148, i32 0, i32* null)
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %157
151: ; preds = %146
%152 = load i32, i32* @stderr
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %152, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, i64 0, i64 0))
%154 = load i32, i32* @stderr
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%156 = call i32 @exit(i32 -1)
unreachable
157: ; preds = %146
%158 = load i64, i64* @errno
%159 = load i64, i64* @EFAULT
%160 = icmp ne i64 %158, %159
br i1 %160, label %161, label %169
161: ; preds = %157
%162 = load i32, i32* @stderr
%163 = load i64, i64* @errno
%164 = call i8* @strerror(i64 %163)
%165 = call i32 (i32, i8*, ...) @fprintf(i32 %162, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), i8* %164)
%166 = load i32, i32* @stderr
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%168 = call i32 @exit(i32 -1)
unreachable
169: ; preds = %157
%170 = load i32, i32* @STDIN_FILENO
%171 = call i32 @dup(i32 %170)
store i32 %171, i32* %4
%172 = load i32, i32* %4
%173 = load i32, i32* %3
%174 = add nsw i32 %173, 1
%175 = icmp ne i32 %172, %174
br i1 %175, label %176, label %182
176: ; preds = %169
%177 = load i32, i32* @stderr
%178 = call i32 (i32, i8*, ...) @fprintf(i32 %177, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%179 = load i32, i32* @stderr
%180 = call i32 (i32, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%181 = call i32 @exit(i32 -1)
unreachable
182: ; preds = %169
%183 = load i32, i32* @stderr
%184 = call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%185 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@PF_UNIX = global i32 0
@SOCK_DGRAM = global i32 0
@stderr = global i32 0
@.str = [37 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM): %s\0A\00"
@errno = global i64 0
@.str.1 = [6 x i8] c"FAIL\0A\00"
@.str.2 = [45 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM) close 0: %s\0A\00"
@.str.3 = [45 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM) close 1: %s\0A\00"
@SOCK_STREAM = global i32 0
@.str.4 = [38 x i8] c"socketpair(PF_UNIX, SOCK_STREAM): %s\0A\00"
@.str.5 = [46 x i8] c"socketpair(PF_UNIX, SOCK_STREAM) close 0: %s\0A\00"
@.str.6 = [46 x i8] c"socketpair(PF_UNIX, SOCK_STREAM) close 1: %s\0A\00"
@PF_INET = global i32 0
@.str.7 = [41 x i8] c"socketpair(PF_INET, SOCK_DGRAM): opened\0A\00"
@EOPNOTSUPP = global i64 0
@.str.8 = [37 x i8] c"socketpair(PF_INET, SOCK_DGRAM): %s\0A\00"
@.str.9 = [42 x i8] c"socketpair(PF_INET, SOCK_STREAM): opened\0A\00"
@.str.10 = [38 x i8] c"socketpair(PF_INET, SOCK_STREAM): %s\0A\00"
@STDIN_FILENO = global i32 0
@.str.11 = [30 x i8] c"Non-sequential fd allocation\0A\00"
@.str.12 = [47 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM, NULL): opened\0A\00"
@EFAULT = global i64 0
@.str.13 = [43 x i8] c"socketpair(PF_UNIX, SOCK_DGRAM, NULL): %s\0A\00"
@.str.14 = [45 x i8] c"socketpair(..., NULL) allocated descriptors\0A\00"
@.str.15 = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = load i32, i32* @PF_UNIX
%4 = load i32, i32* @SOCK_DGRAM
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = call i64 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = load i64, i64* @errno
%11 = call i8* @strerror(i64 %10)
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %0
%17 = load i32, i32* %5
%18 = call i64 @close(i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %28, label %20
20: ; preds = %16
%21 = load i32, i32* @stderr
%22 = load i64, i64* @errno
%23 = call i8* @strerror(i64 %22)
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 @exit(i32 -1)
unreachable
28: ; preds = %16
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%30 = load i32, i32* %29
%31 = call i64 @close(i32 %30)
%32 = icmp eq i64 %31, 0
br i1 %32, label %41, label %33
33: ; preds = %28
%34 = load i32, i32* @stderr
%35 = load i64, i64* @errno
%36 = call i8* @strerror(i64 %35)
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %36)
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%40 = call i32 @exit(i32 -1)
unreachable
41: ; preds = %28
%42 = load i32, i32* @PF_UNIX
%43 = load i32, i32* @SOCK_STREAM
%44 = call i64 @socketpair(i32 %42, i32 %43, i32 0, i32* %5)
%45 = icmp eq i64 %44, 0
br i1 %45, label %54, label %46
46: ; preds = %41
%47 = load i32, i32* @stderr
%48 = load i64, i64* @errno
%49 = call i8* @strerror(i64 %48)
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %49)
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%53 = call i32 @exit(i32 -1)
unreachable
54: ; preds = %41
%55 = load i32, i32* %5
%56 = call i64 @close(i32 %55)
%57 = icmp eq i64 %56, 0
br i1 %57, label %66, label %58
58: ; preds = %54
%59 = load i32, i32* @stderr
%60 = load i64, i64* @errno
%61 = call i8* @strerror(i64 %60)
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %61)
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%65 = call i32 @exit(i32 -1)
unreachable
66: ; preds = %54
%67 = load i32, i32* %29
%68 = call i64 @close(i32 %67)
%69 = icmp eq i64 %68, 0
br i1 %69, label %78, label %70
70: ; preds = %66
%71 = load i32, i32* @stderr
%72 = load i64, i64* @errno
%73 = call i8* @strerror(i64 %72)
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* %73)
%75 = load i32, i32* @stderr
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%77 = call i32 @exit(i32 -1)
unreachable
78: ; preds = %66
%79 = load i32, i32* @PF_INET
%80 = load i32, i32* @SOCK_DGRAM
%81 = call i64 @socketpair(i32 %79, i32 %80, i32 0, i32* %5)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %89
83: ; preds = %78
%84 = load i32, i32* @stderr
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%88 = call i32 @exit(i32 -1)
unreachable
89: ; preds = %78
%90 = load i64, i64* @errno
%91 = load i64, i64* @EOPNOTSUPP
%92 = icmp eq i64 %90, %91
br i1 %92, label %99, label %93
93: ; preds = %89
%94 = load i32, i32* @stderr
%95 = call i8* @strerror(i64 %90)
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %95)
%97 = load i32, i32* @stderr
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %99
99: ; preds = %93, %89
%100 = load i32, i32* @PF_INET
%101 = load i32, i32* @SOCK_STREAM
%102 = call i64 @socketpair(i32 %100, i32 %101, i32 0, i32* %5)
%103 = icmp eq i64 %102, 0
br i1 %103, label %104, label %110
104: ; preds = %99
%105 = load i32, i32* @stderr
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
%107 = load i32, i32* @stderr
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %107, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%109 = call i32 @exit(i32 -1)
unreachable
110: ; preds = %99
%111 = load i64, i64* @errno
%112 = load i64, i64* @EOPNOTSUPP
%113 = icmp eq i64 %111, %112
br i1 %113, label %120, label %114
114: ; preds = %110
%115 = load i32, i32* @stderr
%116 = call i8* @strerror(i64 %111)
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i8* %116)
%118 = load i32, i32* @stderr
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %120
120: ; preds = %114, %110
%121 = load i32, i32* @STDIN_FILENO
%122 = call i32 @dup(i32 %121)
%123 = load i32, i32* @STDIN_FILENO
%124 = call i32 @dup(i32 %123)
%125 = add nsw i32 %122, 1
%126 = icmp eq i32 %124, %125
br i1 %126, label %133, label %127
127: ; preds = %120
%128 = load i32, i32* @stderr
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %128, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%130 = load i32, i32* @stderr
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%132 = call i32 @exit(i32 -1)
unreachable
133: ; preds = %120
%134 = load i32, i32* @PF_UNIX
%135 = load i32, i32* @SOCK_DGRAM
%136 = call i64 @socketpair(i32 %134, i32 %135, i32 0, i32* null)
%137 = icmp eq i64 %136, 0
br i1 %137, label %138, label %144
138: ; preds = %133
%139 = load i32, i32* @stderr
%140 = call i32 (i32, i8*, ...) @fprintf(i32 %139, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, i64 0, i64 0))
%141 = load i32, i32* @stderr
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %141, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%143 = call i32 @exit(i32 -1)
unreachable
144: ; preds = %133
%145 = load i64, i64* @errno
%146 = load i64, i64* @EFAULT
%147 = icmp eq i64 %145, %146
br i1 %147, label %155, label %148
148: ; preds = %144
%149 = load i32, i32* @stderr
%150 = call i8* @strerror(i64 %145)
%151 = call i32 (i32, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), i8* %150)
%152 = load i32, i32* @stderr
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %152, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%154 = call i32 @exit(i32 -1)
unreachable
155: ; preds = %144
%156 = load i32, i32* @STDIN_FILENO
%157 = call i32 @dup(i32 %156)
%158 = add nsw i32 %124, 1
%159 = icmp eq i32 %157, %158
%160 = load i32, i32* @stderr
br i1 %159, label %166, label %161
161: ; preds = %155
%162 = call i32 (i32, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%163 = load i32, i32* @stderr
%164 = call i32 (i32, i8*, ...) @fprintf(i32 %163, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%165 = call i32 @exit(i32 -1)
unreachable
166: ; preds = %155
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%168 = call i32 @exit(i32 0)
unreachable
}