#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(int argc, char *argv[]) {
  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    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    0x2e52(%rip),%rax
mov    (%rax),%esi
lea    -0x24(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
je     11ed <main+0x8d>
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2e00(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x28(%rbp),%edi
mov    %rax,%rdx
lea    0xe3b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x24(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     124f <main+0xef>
mov    0x2dc2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2d9e(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    %rax,%rdx
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
lea    0xde7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x20(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     12b1 <main+0x151>
mov    0x2d60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d3c(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x30(%rbp),%edi
mov    %rax,%rdx
lea    0xdcf(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
mov    0x2cf7(%rip),%rax
mov    (%rax),%esi
lea    -0x24(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
je     1328 <main+0x1c8>
mov    0x2ce9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2cc5(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    %rax,%rdx
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cba(%rip),%rax
mov    (%rax),%edi
lea    0xd0e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x24(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     138a <main+0x22a>
mov    0x2c87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x2c63(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x38(%rbp),%edi
mov    %rax,%rdx
lea    0xd49(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x20(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     13ec <main+0x28c>
mov    0x2c25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2c01(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%rdx
lea    0xd15(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bf6(%rip),%rax
mov    (%rax),%edi
lea    0xc4a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2bb5(%rip),%rax
mov    (%rax),%edi
mov    0x2bdc(%rip),%rax
mov    (%rax),%esi
lea    -0x24(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
jne    144b <main+0x2eb>
mov    0x2bae(%rip),%rax
mov    (%rax),%edi
lea    0xce4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b97(%rip),%rax
mov    (%rax),%edi
lea    0xbeb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2b5e(%rip),%rax
mov    (%rax),%rax
mov    0x2b64(%rip),%rcx
cmp    (%rcx),%rax
je     14ab <main+0x34b>
mov    0x2b5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2b38(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x40(%rbp),%edi
mov    %rax,%rdx
lea    0xca3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b2d(%rip),%rax
mov    (%rax),%edi
lea    0xb81(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2af6(%rip),%rax
mov    (%rax),%edi
mov    0x2afd(%rip),%rax
mov    (%rax),%esi
lea    -0x24(%rbp),%rcx
xor    %edx,%edx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
jne    150a <main+0x3aa>
mov    0x2aef(%rip),%rax
mov    (%rax),%edi
lea    0xc73(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2ad8(%rip),%rax
mov    (%rax),%edi
lea    0xb2c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2a9f(%rip),%rax
mov    (%rax),%rax
mov    0x2aa5(%rip),%rcx
cmp    (%rcx),%rax
je     156a <main+0x40a>
mov    0x2a9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2a79(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    %rax,%rdx
lea    0xc33(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2a6e(%rip),%rax
mov    (%rax),%edi
lea    0xac2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2a2f(%rip),%rax
mov    (%rax),%edi
call   1030 <dup@plt>
mov    %eax,-0x14(%rbp)
mov    0x2a1e(%rip),%rax
mov    (%rax),%edi
call   1030 <dup@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     15d5 <main+0x475>
mov    0x2a24(%rip),%rax
mov    (%rax),%edi
lea    0xbf8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2a0d(%rip),%rax
mov    (%rax),%edi
lea    0xa61(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2a14(%rip),%rax
mov    (%rax),%edi
mov    0x29f3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1060 <socketpair@plt>
cmp    $0x0,%rax
jne    1634 <main+0x4d4>
mov    0x29c5(%rip),%rax
mov    (%rax),%edi
lea    0xbb7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x29ae(%rip),%rax
mov    (%rax),%edi
lea    0xa02(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x2975(%rip),%rax
mov    (%rax),%rax
mov    0x29b3(%rip),%rcx
cmp    (%rcx),%rax
je     169e <main+0x53e>
mov    0x2973(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    0x294f(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x48(%rbp),%edi
mov    %rax,%rdx
lea    0xb7c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2944(%rip),%rax
mov    (%rax),%edi
lea    0x998(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x28fb(%rip),%rax
mov    (%rax),%edi
call   1030 <dup@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     16f8 <main+0x598>
mov    0x2901(%rip),%rax
mov    (%rax),%edi
lea    0xb4d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x28ea(%rip),%rax
mov    (%rax),%edi
lea    0x93e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    0x28c9(%rip),%rax
mov    (%rax),%edi
lea    0xb42(%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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* @PF_UNIX
%11 = load i32, i32* @SOCK_DGRAM
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%13 = call i64 @socketpair(i32 %10, i32 %11, i32 0, i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i64, i64* @errno
%18 = call i8* @strerror(i64 %17)
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @exit(i32 -1)
unreachable
23: ; preds = %2
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%25 = load i32, i32* %24
%26 = call i64 @close(i32 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %23
%29 = load i32, i32* @stderr
%30 = load i64, i64* @errno
%31 = call i8* @strerror(i64 %30)
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %31)
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 @exit(i32 -1)
unreachable
36: ; preds = %23
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%38 = load i32, i32* %37
%39 = call i64 @close(i32 %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %49
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = load i64, i64* @errno
%44 = call i8* @strerror(i64 %43)
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %44)
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%48 = call i32 @exit(i32 -1)
unreachable
49: ; preds = %36
%50 = load i32, i32* @PF_UNIX
%51 = load i32, i32* @SOCK_STREAM
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%53 = call i64 @socketpair(i32 %50, i32 %51, i32 0, i32* %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %63
55: ; preds = %49
%56 = load i32, i32* @stderr
%57 = load i64, i64* @errno
%58 = call i8* @strerror(i64 %57)
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %58)
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%62 = call i32 @exit(i32 -1)
unreachable
63: ; preds = %49
%64 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%65 = load i32, i32* %64
%66 = call i64 @close(i32 %65)
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %76
68: ; preds = %63
%69 = load i32, i32* @stderr
%70 = load i64, i64* @errno
%71 = call i8* @strerror(i64 %70)
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %71)
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%75 = call i32 @exit(i32 -1)
unreachable
76: ; preds = %63
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%78 = load i32, i32* %77
%79 = call i64 @close(i32 %78)
%80 = icmp ne i64 %79, 0
br i1 %80, label %81, label %89
81: ; preds = %76
%82 = load i32, i32* @stderr
%83 = load i64, i64* @errno
%84 = call i8* @strerror(i64 %83)
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* %84)
%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 = %76
%90 = load i32, i32* @PF_INET
%91 = load i32, i32* @SOCK_DGRAM
%92 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%93 = call i64 @socketpair(i32 %90, i32 %91, i32 0, i32* %92)
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %101
95: ; preds = %89
%96 = load i32, i32* @stderr
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%98 = load i32, i32* @stderr
%99 = call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%100 = call i32 @exit(i32 -1)
unreachable
101: ; preds = %89
%102 = load i64, i64* @errno
%103 = load i64, i64* @EOPNOTSUPP
%104 = icmp ne i64 %102, %103
br i1 %104, label %105, label %112
105: ; preds = %101
%106 = load i32, i32* @stderr
%107 = load i64, i64* @errno
%108 = call i8* @strerror(i64 %107)
%109 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %108)
%110 = load i32, i32* @stderr
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %112
112: ; preds = %105, %101
%113 = load i32, i32* @PF_INET
%114 = load i32, i32* @SOCK_STREAM
%115 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%116 = call i64 @socketpair(i32 %113, i32 %114, i32 0, i32* %115)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %124
118: ; preds = %112
%119 = load i32, i32* @stderr
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
%121 = load i32, i32* @stderr
%122 = call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%123 = call i32 @exit(i32 -1)
unreachable
124: ; preds = %112
%125 = load i64, i64* @errno
%126 = load i64, i64* @EOPNOTSUPP
%127 = icmp ne i64 %125, %126
br i1 %127, label %128, label %135
128: ; preds = %124
%129 = load i32, i32* @stderr
%130 = load i64, i64* @errno
%131 = call i8* @strerror(i64 %130)
%132 = call i32 (i32, i8*, ...) @fprintf(i32 %129, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i8* %131)
%133 = load i32, i32* @stderr
%134 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %135
135: ; preds = %128, %124
%136 = load i32, i32* @STDIN_FILENO
%137 = call i32 @dup(i32 %136)
store i32 %137, i32* %6
%138 = load i32, i32* @STDIN_FILENO
%139 = call i32 @dup(i32 %138)
store i32 %139, i32* %7
%140 = load i32, i32* %7
%141 = load i32, i32* %6
%142 = add nsw i32 %141, 1
%143 = icmp ne i32 %140, %142
br i1 %143, label %144, label %150
144: ; preds = %135
%145 = load i32, i32* @stderr
%146 = call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%147 = load i32, i32* @stderr
%148 = call i32 (i32, i8*, ...) @fprintf(i32 %147, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%149 = call i32 @exit(i32 -1)
unreachable
150: ; preds = %135
%151 = load i32, i32* @PF_UNIX
%152 = load i32, i32* @SOCK_DGRAM
%153 = call i64 @socketpair(i32 %151, i32 %152, i32 0, i32* null)
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %161
155: ; preds = %150
%156 = load i32, i32* @stderr
%157 = call i32 (i32, i8*, ...) @fprintf(i32 %156, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, i64 0, i64 0))
%158 = load i32, i32* @stderr
%159 = call i32 (i32, i8*, ...) @fprintf(i32 %158, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%160 = call i32 @exit(i32 -1)
unreachable
161: ; preds = %150
%162 = load i64, i64* @errno
%163 = load i64, i64* @EFAULT
%164 = icmp ne i64 %162, %163
br i1 %164, label %165, label %173
165: ; preds = %161
%166 = load i32, i32* @stderr
%167 = load i64, i64* @errno
%168 = call i8* @strerror(i64 %167)
%169 = call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), i8* %168)
%170 = load i32, i32* @stderr
%171 = call i32 (i32, i8*, ...) @fprintf(i32 %170, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%172 = call i32 @exit(i32 -1)
unreachable
173: ; preds = %161
%174 = load i32, i32* @STDIN_FILENO
%175 = call i32 @dup(i32 %174)
store i32 %175, i32* %8
%176 = load i32, i32* %8
%177 = load i32, i32* %7
%178 = add nsw i32 %177, 1
%179 = icmp ne i32 %176, %178
br i1 %179, label %180, label %186
180: ; preds = %173
%181 = load i32, i32* @stderr
%182 = call i32 (i32, i8*, ...) @fprintf(i32 %181, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%183 = load i32, i32* @stderr
%184 = call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%185 = call i32 @exit(i32 -1)
unreachable
186: ; preds = %173
%187 = load i32, i32* @stderr
%188 = call i32 (i32, i8*, ...) @fprintf(i32 %187, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%189 = 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(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = load i32, i32* @PF_UNIX
%6 = load i32, i32* @SOCK_DGRAM
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%8 = call i64 @socketpair(i32 %5, i32 %6, i32 0, i32* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i64, i64* @errno
%13 = call i8* @strerror(i64 %12)
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = load i32, i32* %7
%20 = call i64 @close(i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %30, label %22
22: ; preds = %18
%23 = load i32, i32* @stderr
%24 = load i64, i64* @errno
%25 = call i8* @strerror(i64 %24)
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @exit(i32 -1)
unreachable
30: ; preds = %18
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%32 = load i32, i32* %31
%33 = call i64 @close(i32 %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %43, label %35
35: ; preds = %30
%36 = load i32, i32* @stderr
%37 = load i64, i64* @errno
%38 = call i8* @strerror(i64 %37)
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %38)
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%42 = call i32 @exit(i32 -1)
unreachable
43: ; preds = %30
%44 = load i32, i32* @PF_UNIX
%45 = load i32, i32* @SOCK_STREAM
%46 = call i64 @socketpair(i32 %44, i32 %45, i32 0, i32* %7)
%47 = icmp eq i64 %46, 0
br i1 %47, label %56, label %48
48: ; preds = %43
%49 = load i32, i32* @stderr
%50 = load i64, i64* @errno
%51 = call i8* @strerror(i64 %50)
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %51)
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%55 = call i32 @exit(i32 -1)
unreachable
56: ; preds = %43
%57 = load i32, i32* %7
%58 = call i64 @close(i32 %57)
%59 = icmp eq i64 %58, 0
br i1 %59, label %68, label %60
60: ; preds = %56
%61 = load i32, i32* @stderr
%62 = load i64, i64* @errno
%63 = call i8* @strerror(i64 %62)
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %63)
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%67 = call i32 @exit(i32 -1)
unreachable
68: ; preds = %56
%69 = load i32, i32* %31
%70 = call i64 @close(i32 %69)
%71 = icmp eq i64 %70, 0
br i1 %71, label %80, label %72
72: ; preds = %68
%73 = load i32, i32* @stderr
%74 = load i64, i64* @errno
%75 = call i8* @strerror(i64 %74)
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* %75)
%77 = load i32, i32* @stderr
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%79 = call i32 @exit(i32 -1)
unreachable
80: ; preds = %68
%81 = load i32, i32* @PF_INET
%82 = load i32, i32* @SOCK_DGRAM
%83 = call i64 @socketpair(i32 %81, i32 %82, i32 0, i32* %7)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %91
85: ; preds = %80
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%88 = load i32, i32* @stderr
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%90 = call i32 @exit(i32 -1)
unreachable
91: ; preds = %80
%92 = load i64, i64* @errno
%93 = load i64, i64* @EOPNOTSUPP
%94 = icmp eq i64 %92, %93
br i1 %94, label %101, label %95
95: ; preds = %91
%96 = load i32, i32* @stderr
%97 = call i8* @strerror(i64 %92)
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %97)
%99 = load i32, i32* @stderr
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %101
101: ; preds = %95, %91
%102 = load i32, i32* @PF_INET
%103 = load i32, i32* @SOCK_STREAM
%104 = call i64 @socketpair(i32 %102, i32 %103, i32 0, i32* %7)
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %112
106: ; preds = %101
%107 = load i32, i32* @stderr
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %107, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
%109 = load i32, i32* @stderr
%110 = call i32 (i32, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%111 = call i32 @exit(i32 -1)
unreachable
112: ; preds = %101
%113 = load i64, i64* @errno
%114 = load i64, i64* @EOPNOTSUPP
%115 = icmp eq i64 %113, %114
br i1 %115, label %122, label %116
116: ; preds = %112
%117 = load i32, i32* @stderr
%118 = call i8* @strerror(i64 %113)
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i8* %118)
%120 = load i32, i32* @stderr
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %122
122: ; preds = %116, %112
%123 = load i32, i32* @STDIN_FILENO
%124 = call i32 @dup(i32 %123)
%125 = load i32, i32* @STDIN_FILENO
%126 = call i32 @dup(i32 %125)
%127 = add nsw i32 %124, 1
%128 = icmp eq i32 %126, %127
br i1 %128, label %135, label %129
129: ; preds = %122
%130 = load i32, i32* @stderr
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%132 = load i32, i32* @stderr
%133 = call i32 (i32, i8*, ...) @fprintf(i32 %132, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%134 = call i32 @exit(i32 -1)
unreachable
135: ; preds = %122
%136 = load i32, i32* @PF_UNIX
%137 = load i32, i32* @SOCK_DGRAM
%138 = call i64 @socketpair(i32 %136, i32 %137, i32 0, i32* null)
%139 = icmp eq i64 %138, 0
br i1 %139, label %140, label %146
140: ; preds = %135
%141 = load i32, i32* @stderr
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %141, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, 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 = %135
%147 = load i64, i64* @errno
%148 = load i64, i64* @EFAULT
%149 = icmp eq i64 %147, %148
br i1 %149, label %157, label %150
150: ; preds = %146
%151 = load i32, i32* @stderr
%152 = call i8* @strerror(i64 %147)
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), i8* %152)
%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 i32, i32* @STDIN_FILENO
%159 = call i32 @dup(i32 %158)
%160 = add nsw i32 %126, 1
%161 = icmp eq i32 %159, %160
%162 = load i32, i32* @stderr
br i1 %161, label %168, label %163
163: ; preds = %157
%164 = call i32 (i32, i8*, ...) @fprintf(i32 %162, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%165 = load i32, i32* @stderr
%166 = call i32 (i32, i8*, ...) @fprintf(i32 %165, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%167 = call i32 @exit(i32 -1)
unreachable
168: ; preds = %157
%169 = call i32 (i32, i8*, ...) @fprintf(i32 %162, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%170 = call i32 @exit(i32 0)
unreachable
}