#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 timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
scalar_t__ close(int);
int /*<<< orphan*/ memcmp(char *, char *, int);
scalar_t__ pipe(int *);
int /*<<< orphan*/ printf(char *, char *, int);
int read(int, char *, int);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int write(int, char *, int);
int test_create_pipe(void) {
  int fds[2] = {-1, -1};
  char buffer[10];
  fd_set fdset;
  struct timeval tv;
  int r;
  do {
    if (!(0 == pipe(fds))) {
      printf("expression '%s' untrue at %d\n", "0 == pipe(fds)", 38);
      return 0;
    }
  } while (0);
  do {
    if (!(5 == write(fds[1], "hello", 5))) {
      printf("expression '%s' untrue at %d\n",
             "5 == write(fds[1], \"hello\", 5)", 40);
      return 0;
    }
  } while (0);
  do {
    if (!(5 == read(fds[0], buffer, 5))) {
      printf("expression '%s' untrue at %d\n", "5 == read(fds[0], buffer, 5)",
             41);
      return 0;
    }
  } while (0);
  do {
    if (!(!memcmp(buffer, "hello", 5))) {
      printf("expression '%s' untrue at %d\n", "!memcmp(buffer, \"hello\", 5)",
             42);
      return 0;
    }
  } while (0);
  do {
    if (!(3 == write(fds[1], "bye", 3))) {
      printf("expression '%s' untrue at %d\n", "3 == write(fds[1], \"bye\", 3)",
             44);
      return 0;
    }
  } while (0);
  do {
    if (!(3 == read(fds[0], buffer, 3))) {
      printf("expression '%s' untrue at %d\n", "3 == read(fds[0], buffer, 3)",
             45);
      return 0;
    }
  } while (0);
  do {
    if (!(!memcmp(buffer, "bye", 3))) {
      printf("expression '%s' untrue at %d\n", "!memcmp(buffer, \"bye\", 3)",
             46);
      return 0;
    }
  } while (0);
  do {
    if (!(5 == write(fds[1], "hello", 5))) {
      printf("expression '%s' untrue at %d\n",
             "5 == write(fds[1], \"hello\", 5)", 48);
      return 0;
    }
  } while (0);
  do {
    if (!(5 == read(fds[0], buffer, 5))) {
      printf("expression '%s' untrue at %d\n", "5 == read(fds[0], buffer, 5)",
             49);
      return 0;
    }
  } while (0);
  do {
    if (!(!memcmp(buffer, "hello", 5))) {
      printf("expression '%s' untrue at %d\n", "!memcmp(buffer, \"hello\", 5)",
             50);
      return 0;
    }
  } while (0);
  do {
    if (!(5 == write(fds[1], "hello", 5))) {
      printf("expression '%s' untrue at %d\n",
             "5 == write(fds[1], \"hello\", 5)", 52);
      return 0;
    }
  } while (0);
  do {
    if (!(2 == read(fds[0], buffer, 2))) {
      printf("expression '%s' untrue at %d\n", "2 == read(fds[0], buffer, 2)",
             53);
      return 0;
    }
  } while (0);
  do {
    if (!(!memcmp(buffer, "he", 2))) {
      printf("expression '%s' untrue at %d\n", "!memcmp(buffer, \"he\", 2)",
             54);
      return 0;
    }
  } while (0);
  do {
    if (!(3 == read(fds[0], buffer, 3))) {
      printf("expression '%s' untrue at %d\n", "3 == read(fds[0], buffer, 3)",
             55);
      return 0;
    }
  } while (0);
  do {
    if (!(!memcmp(buffer, "llo", 3))) {
      printf("expression '%s' untrue at %d\n", "!memcmp(buffer, \"llo\", 3)",
             56);
      return 0;
    }
  } while (0);
  FD_ZERO(&fdset);
  FD_SET(fds[0], &fdset);
  tv.tv_sec = 0;
  tv.tv_usec = 0;
  r = select(fds[0] + 1, &fdset, NULL, NULL, &tv);
  do {
    if (!(r == 0)) {
      printf("expression '%s' untrue at %d\n", "r == 0", 64);
      return 0;
    }
  } while (0);
  do {
    if (!(!FD_ISSET(fds[0], &fdset))) {
      printf("expression '%s' untrue at %d\n", "!FD_ISSET(fds[0], &fdset)", 65);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == write(fds[1], "x", 1))) {
      printf("expression '%s' untrue at %d\n", "1 == write(fds[1], \"x\", 1)",
             68);
      return 0;
    }
  } while (0);
  FD_ZERO(&fdset);
  FD_SET(fds[0], &fdset);
  tv.tv_sec = 0;
  tv.tv_usec = 0;
  r = select(fds[0] + 1, &fdset, NULL, NULL, &tv);
  do {
    if (!(r == 1)) {
      printf("expression '%s' untrue at %d\n", "r == 1", 74);
      return 0;
    }
  } while (0);
  do {
    if (!(FD_ISSET(fds[0], &fdset))) {
      printf("expression '%s' untrue at %d\n", "FD_ISSET(fds[0], &fdset)", 75);
      return 0;
    }
  } while (0);
  do {
    if (!(0 == close(fds[0]))) {
      printf("expression '%s' untrue at %d\n", "0 == close(fds[0])", 77);
      return 0;
    }
  } while (0);
  do {
    if (!(0 == close(fds[1]))) {
      printf("expression '%s' untrue at %d\n", "0 == close(fds[1])", 78);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_create_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xe51(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1070 <pipe@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     11ee <test_create_pipe+0x4e>
lea    0xe37(%rip),%rdi
lea    0xe4e(%rip),%rsi
mov    $0x26,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    11f3 <test_create_pipe+0x53>
jmp    11f8 <test_create_pipe+0x58>
mov    -0x8(%rbp),%edi
lea    0xe33(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
je     123f <test_create_pipe+0x9f>
lea    0xde6(%rip),%rdi
lea    0xe12(%rip),%rsi
mov    $0x28,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1244 <test_create_pipe+0xa4>
jmp    1249 <test_create_pipe+0xa9>
mov    -0xc(%rbp),%edi
lea    -0x16(%rbp),%rsi
mov    $0x5,%edx
call   1080 <read@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
je     128d <test_create_pipe+0xed>
lea    0xd98(%rip),%rdi
lea    0xde3(%rip),%rsi
mov    $0x29,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1292 <test_create_pipe+0xf2>
jmp    1297 <test_create_pipe+0xf7>
lea    -0x16(%rbp),%rdi
lea    0xd93(%rip),%rsi
mov    $0x5,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%eax
je     12d9 <test_create_pipe+0x139>
lea    0xd4c(%rip),%rdi
lea    0xdb4(%rip),%rsi
mov    $0x2a,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    12de <test_create_pipe+0x13e>
jmp    12e3 <test_create_pipe+0x143>
mov    -0x8(%rbp),%edi
lea    0xda6(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
je     132a <test_create_pipe+0x18a>
lea    0xcfb(%rip),%rdi
lea    0xd83(%rip),%rsi
mov    $0x2c,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    132f <test_create_pipe+0x18f>
jmp    1334 <test_create_pipe+0x194>
mov    -0xc(%rbp),%edi
lea    -0x16(%rbp),%rsi
mov    $0x3,%edx
call   1080 <read@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
je     1378 <test_create_pipe+0x1d8>
lea    0xcad(%rip),%rdi
lea    0xd52(%rip),%rsi
mov    $0x2d,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    137d <test_create_pipe+0x1dd>
jmp    1382 <test_create_pipe+0x1e2>
lea    -0x16(%rbp),%rdi
lea    0xd06(%rip),%rsi
mov    $0x3,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%eax
je     13c4 <test_create_pipe+0x224>
lea    0xc61(%rip),%rdi
lea    0xd23(%rip),%rsi
mov    $0x2e,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    13c9 <test_create_pipe+0x229>
jmp    13ce <test_create_pipe+0x22e>
mov    -0x8(%rbp),%edi
lea    0xc5d(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
je     1415 <test_create_pipe+0x275>
lea    0xc10(%rip),%rdi
lea    0xc3c(%rip),%rsi
mov    $0x30,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    141a <test_create_pipe+0x27a>
jmp    141f <test_create_pipe+0x27f>
mov    -0xc(%rbp),%edi
lea    -0x16(%rbp),%rsi
mov    $0x5,%edx
call   1080 <read@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
je     1463 <test_create_pipe+0x2c3>
lea    0xbc2(%rip),%rdi
lea    0xc0d(%rip),%rsi
mov    $0x31,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1468 <test_create_pipe+0x2c8>
jmp    146d <test_create_pipe+0x2cd>
lea    -0x16(%rbp),%rdi
lea    0xbbd(%rip),%rsi
mov    $0x5,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%eax
je     14af <test_create_pipe+0x30f>
lea    0xb76(%rip),%rdi
lea    0xbde(%rip),%rsi
mov    $0x32,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    14b4 <test_create_pipe+0x314>
jmp    14b9 <test_create_pipe+0x319>
mov    -0x8(%rbp),%edi
lea    0xb72(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
je     1500 <test_create_pipe+0x360>
lea    0xb25(%rip),%rdi
lea    0xb51(%rip),%rsi
mov    $0x34,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1505 <test_create_pipe+0x365>
jmp    150a <test_create_pipe+0x36a>
mov    -0xc(%rbp),%edi
lea    -0x16(%rbp),%rsi
mov    $0x2,%edx
call   1080 <read@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     154e <test_create_pipe+0x3ae>
lea    0xad7(%rip),%rdi
lea    0xbb3(%rip),%rsi
mov    $0x35,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1553 <test_create_pipe+0x3b3>
jmp    1558 <test_create_pipe+0x3b8>
lea    -0x16(%rbp),%rdi
lea    0xba5(%rip),%rsi
mov    $0x2,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%eax
je     159a <test_create_pipe+0x3fa>
lea    0xa8b(%rip),%rdi
lea    0xb87(%rip),%rsi
mov    $0x36,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    159f <test_create_pipe+0x3ff>
jmp    15a4 <test_create_pipe+0x404>
mov    -0xc(%rbp),%edi
lea    -0x16(%rbp),%rsi
mov    $0x3,%edx
call   1080 <read@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
je     15e8 <test_create_pipe+0x448>
lea    0xa3d(%rip),%rdi
lea    0xae2(%rip),%rsi
mov    $0x37,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    15ed <test_create_pipe+0x44d>
jmp    15f2 <test_create_pipe+0x452>
lea    -0x16(%rbp),%rdi
lea    0xa3a(%rip),%rsi
mov    $0x3,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%eax
je     1634 <test_create_pipe+0x494>
lea    0x9f1(%rip),%rdi
lea    0xb06(%rip),%rsi
mov    $0x38,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1639 <test_create_pipe+0x499>
lea    -0x1c(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
mov    -0xc(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   10c0 <FD_SET@plt>
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
lea    -0x1c(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x30(%rbp),%r8
mov    %rcx,%rdx
call   10b0 <select@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     16a9 <test_create_pipe+0x509>
lea    0x97c(%rip),%rdi
lea    0xaab(%rip),%rsi
mov    $0x40,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    16ae <test_create_pipe+0x50e>
jmp    16b3 <test_create_pipe+0x513>
mov    -0xc(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%eax
je     16ec <test_create_pipe+0x54c>
lea    0x939(%rip),%rdi
lea    0xa6f(%rip),%rsi
mov    $0x41,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    16f1 <test_create_pipe+0x551>
jmp    16f6 <test_create_pipe+0x556>
mov    -0x8(%rbp),%edi
lea    0xa5f(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     173d <test_create_pipe+0x59d>
lea    0x8e8(%rip),%rdi
lea    0xa3a(%rip),%rsi
mov    $0x44,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1742 <test_create_pipe+0x5a2>
lea    -0x1c(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
mov    -0xc(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   10c0 <FD_SET@plt>
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
lea    -0x1c(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x30(%rbp),%r8
mov    %rcx,%rdx
call   10b0 <select@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
je     17b2 <test_create_pipe+0x612>
lea    0x873(%rip),%rdi
lea    0x9e0(%rip),%rsi
mov    $0x4a,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    17b7 <test_create_pipe+0x617>
jmp    17bc <test_create_pipe+0x61c>
mov    -0xc(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%eax
jne    17f5 <test_create_pipe+0x655>
lea    0x830(%rip),%rdi
lea    0x967(%rip),%rsi
mov    $0x4b,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    17fa <test_create_pipe+0x65a>
jmp    17ff <test_create_pipe+0x65f>
mov    -0xc(%rbp),%edi
call   1060 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1839 <test_create_pipe+0x699>
lea    0x7ec(%rip),%rdi
lea    0x960(%rip),%rsi
mov    $0x4d,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    183e <test_create_pipe+0x69e>
jmp    1843 <test_create_pipe+0x6a3>
mov    -0x8(%rbp),%edi
call   1060 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     187d <test_create_pipe+0x6dd>
lea    0x7a8(%rip),%rdi
lea    0x92f(%rip),%rsi
mov    $0x4e,%edx
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1889 <test_create_pipe+0x6e9>
jmp    1882 <test_create_pipe+0x6e2>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_create_pipe>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movq   $0xffffffffffffffff,0x8(%rsp)
ff ff
lea    0x8(%rsp),%rdi
call   1070 <pipe@plt>
test   %rax,%rax
je     11d7 <test_create_pipe+0x37>
lea    0xe3a(%rip),%rdi
lea    0xe51(%rip),%rsi
mov    $0x26,%edx
jmp    1260 <test_create_pipe+0xc0>
mov    0xc(%rsp),%edi
lea    0xe4b(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
cmp    $0x5,%eax
jne    1238 <test_create_pipe+0x98>
mov    0x8(%rsp),%edi
lea    0x16(%rsp),%rsi
mov    $0x5,%edx
call   1080 <read@plt>
cmp    $0x5,%eax
jne    124d <test_create_pipe+0xad>
lea    0xe1d(%rip),%rsi
lea    0x16(%rsp),%rdi
mov    $0x5,%edx
call   1090 <memcmp@plt>
test   %eax,%eax
je     1271 <test_create_pipe+0xd1>
lea    0xdd6(%rip),%rdi
lea    0xe3e(%rip),%rsi
mov    $0x2a,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xdc1(%rip),%rdi
lea    0xded(%rip),%rsi
mov    $0x28,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xdac(%rip),%rdi
lea    0xdf7(%rip),%rsi
mov    $0x29,%edx
call   1050 <printf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret
mov    0xc(%rsp),%edi
lea    0xe0f(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
cmp    $0x3,%eax
jne    12d2 <test_create_pipe+0x132>
mov    0x8(%rsp),%edi
lea    0x16(%rsp),%rsi
mov    $0x3,%edx
call   1080 <read@plt>
cmp    $0x3,%eax
jne    12ea <test_create_pipe+0x14a>
lea    0xde1(%rip),%rsi
lea    0x16(%rsp),%rdi
mov    $0x3,%edx
call   1090 <memcmp@plt>
test   %eax,%eax
je     1302 <test_create_pipe+0x162>
lea    0xd3c(%rip),%rdi
lea    0xdfe(%rip),%rsi
mov    $0x2e,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xd27(%rip),%rdi
lea    0xdaf(%rip),%rsi
mov    $0x2c,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xd0f(%rip),%rdi
lea    0xdb4(%rip),%rsi
mov    $0x2d,%edx
jmp    1260 <test_create_pipe+0xc0>
mov    0xc(%rsp),%edi
lea    0xd20(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
cmp    $0x5,%eax
jne    1366 <test_create_pipe+0x1c6>
mov    0x8(%rsp),%edi
lea    0x16(%rsp),%rsi
mov    $0x5,%edx
call   1080 <read@plt>
cmp    $0x5,%eax
jne    137e <test_create_pipe+0x1de>
lea    0xcf2(%rip),%rsi
lea    0x16(%rsp),%rdi
mov    $0x5,%edx
call   1090 <memcmp@plt>
test   %eax,%eax
je     1396 <test_create_pipe+0x1f6>
lea    0xcab(%rip),%rdi
lea    0xd13(%rip),%rsi
mov    $0x32,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xc93(%rip),%rdi
lea    0xcbf(%rip),%rsi
mov    $0x30,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xc7b(%rip),%rdi
lea    0xcc6(%rip),%rsi
mov    $0x31,%edx
jmp    1260 <test_create_pipe+0xc0>
mov    0xc(%rsp),%edi
lea    0xc8c(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
cmp    $0x5,%eax
jne    13fa <test_create_pipe+0x25a>
mov    0x8(%rsp),%edi
lea    0x16(%rsp),%rsi
mov    $0x2,%edx
call   1080 <read@plt>
cmp    $0x2,%eax
jne    1412 <test_create_pipe+0x272>
lea    0xd31(%rip),%rsi
lea    0x16(%rsp),%rdi
mov    $0x2,%edx
call   1090 <memcmp@plt>
test   %eax,%eax
je     142a <test_create_pipe+0x28a>
lea    0xc17(%rip),%rdi
lea    0xd13(%rip),%rsi
mov    $0x36,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xbff(%rip),%rdi
lea    0xc2b(%rip),%rsi
mov    $0x34,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xbe7(%rip),%rdi
lea    0xcc3(%rip),%rsi
mov    $0x35,%edx
jmp    1260 <test_create_pipe+0xc0>
mov    0x8(%rsp),%edi
lea    0x16(%rsp),%rsi
mov    $0x3,%edx
call   1080 <read@plt>
cmp    $0x3,%eax
jne    1474 <test_create_pipe+0x2d4>
lea    0xbe6(%rip),%rsi
lea    0x16(%rsp),%rdi
mov    $0x3,%edx
call   1090 <memcmp@plt>
test   %eax,%eax
je     148c <test_create_pipe+0x2ec>
lea    0xb9d(%rip),%rdi
lea    0xcb2(%rip),%rsi
mov    $0x38,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0xb85(%rip),%rdi
lea    0xc2a(%rip),%rsi
mov    $0x37,%edx
jmp    1260 <test_create_pipe+0xc0>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   10a0 <FD_ZERO@plt>
mov    0x8(%rsp),%edi
mov    %r14,%rsi
call   10c0 <FD_SET@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
mov    0x8(%rsp),%edi
add    $0x1,%edi
xor    %ebx,%ebx
lea    0x20(%rsp),%r8
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   10b0 <select@plt>
test   %eax,%eax
je     14e3 <test_create_pipe+0x343>
lea    0xb2e(%rip),%rdi
lea    0xc5d(%rip),%rsi
mov    $0x40,%edx
jmp    15fc <test_create_pipe+0x45c>
mov    0x8(%rsp),%edi
lea    0x10(%rsp),%rsi
call   1040 <FD_ISSET@plt>
test   %eax,%eax
je     150d <test_create_pipe+0x36d>
lea    0xb04(%rip),%rdi
lea    0xc3a(%rip),%rsi
mov    $0x41,%edx
jmp    15fc <test_create_pipe+0x45c>
mov    0xc(%rsp),%edi
lea    0xc3f(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
jne    159c <test_create_pipe+0x3fc>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   10a0 <FD_ZERO@plt>
mov    0x8(%rsp),%edi
mov    %r14,%rsi
call   10c0 <FD_SET@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
mov    0x8(%rsp),%edi
add    $0x1,%edi
xor    %ebx,%ebx
lea    0x20(%rsp),%r8
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   10b0 <select@plt>
cmp    $0x1,%eax
jne    15b1 <test_create_pipe+0x411>
mov    0x8(%rsp),%edi
lea    0x10(%rsp),%rsi
call   1040 <FD_ISSET@plt>
test   %eax,%eax
je     15c6 <test_create_pipe+0x426>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
test   %rax,%rax
je     15db <test_create_pipe+0x43b>
lea    0xa72(%rip),%rdi
lea    0xbe6(%rip),%rsi
mov    $0x4d,%edx
jmp    15fc <test_create_pipe+0x45c>
lea    0xa5d(%rip),%rdi
lea    0xbaf(%rip),%rsi
mov    $0x44,%edx
jmp    15fc <test_create_pipe+0x45c>
lea    0xa48(%rip),%rdi
lea    0xbb5(%rip),%rsi
mov    $0x4a,%edx
jmp    15fc <test_create_pipe+0x45c>
lea    0xa33(%rip),%rdi
lea    0xb6a(%rip),%rsi
mov    $0x4b,%edx
jmp    15fc <test_create_pipe+0x45c>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
test   %rax,%rax
je     1606 <test_create_pipe+0x466>
lea    0xa10(%rip),%rdi
lea    0xb97(%rip),%rsi
mov    $0x4e,%edx
call   1050 <printf@plt>
jmp    1267 <test_create_pipe+0xc7>
mov    $0x1,%ebx
jmp    1267 <test_create_pipe+0xc7>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@__const.test_create_pipe.fds = [2 x i32] [i32 -1, i32 -1]
@.str = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.1 = [15 x i8] c"0 == pipe(fds)\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [31 x i8] c"5 == write(fds[1], \22hello\22, 5)\00"
@.str.4 = [29 x i8] c"5 == read(fds[0], buffer, 5)\00"
@.str.5 = [28 x i8] c"!memcmp(buffer, \22hello\22, 5)\00"
@.str.6 = [4 x i8] c"bye\00"
@.str.7 = [29 x i8] c"3 == write(fds[1], \22bye\22, 3)\00"
@.str.8 = [29 x i8] c"3 == read(fds[0], buffer, 3)\00"
@.str.9 = [26 x i8] c"!memcmp(buffer, \22bye\22, 3)\00"
@.str.10 = [29 x i8] c"2 == read(fds[0], buffer, 2)\00"
@.str.11 = [3 x i8] c"he\00"
@.str.12 = [25 x i8] c"!memcmp(buffer, \22he\22, 2)\00"
@.str.13 = [4 x i8] c"llo\00"
@.str.14 = [26 x i8] c"!memcmp(buffer, \22llo\22, 3)\00"
@.str.15 = [7 x i8] c"r == 0\00"
@.str.16 = [26 x i8] c"!FD_ISSET(fds[0], &fdset)\00"
@.str.17 = [2 x i8] c"x\00"
@.str.18 = [27 x i8] c"1 == write(fds[1], \22x\22, 1)\00"
@.str.19 = [7 x i8] c"r == 1\00"
@.str.20 = [25 x i8] c"FD_ISSET(fds[0], &fdset)\00"
@.str.21 = [19 x i8] c"0 == close(fds[0])\00"
@.str.22 = [19 x i8] c"0 == close(fds[1])\00"
define i32 @test_create_pipe() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca %struct.timeval
%6 = alloca i32
%7 = bitcast [2 x i32]* %2 to i8*
br label %8
8: ; preds = %0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%10 = call i64 @pipe(i32* %9)
%11 = icmp eq i64 0, %10
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 38)
store i32 0, i32* %1
br label %221
14: ; preds = %8
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%18 = load i32, i32* %17
%19 = call i32 @write(i32 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%20 = icmp eq i32 5, %19
br i1 %20, label %23, label %21
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 40)
store i32 0, i32* %1
br label %221
23: ; preds = %16
br label %24
24: ; preds = %23
br label %25
25: ; preds = %24
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%27 = load i32, i32* %26
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%29 = call i32 @read(i32 %27, i8* %28, i32 5)
%30 = icmp eq i32 5, %29
br i1 %30, label %33, label %31
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 41)
store i32 0, i32* %1
br label %221
33: ; preds = %25
br label %34
34: ; preds = %33
br label %35
35: ; preds = %34
%36 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%37 = call i32 @memcmp(i8* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 42)
store i32 0, i32* %1
br label %221
41: ; preds = %35
br label %42
42: ; preds = %41
br label %43
43: ; preds = %42
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%45 = load i32, i32* %44
%46 = call i32 @write(i32 %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%47 = icmp eq i32 3, %46
br i1 %47, label %50, label %48
48: ; preds = %43
%49 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 44)
store i32 0, i32* %1
br label %221
50: ; preds = %43
br label %51
51: ; preds = %50
br label %52
52: ; preds = %51
%53 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%54 = load i32, i32* %53
%55 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%56 = call i32 @read(i32 %54, i8* %55, i32 3)
%57 = icmp eq i32 3, %56
br i1 %57, label %60, label %58
58: ; preds = %52
%59 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 45)
store i32 0, i32* %1
br label %221
60: ; preds = %52
br label %61
61: ; preds = %60
br label %62
62: ; preds = %61
%63 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%64 = call i32 @memcmp(i8* %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 46)
store i32 0, i32* %1
br label %221
68: ; preds = %62
br label %69
69: ; preds = %68
br label %70
70: ; preds = %69
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%72 = load i32, i32* %71
%73 = call i32 @write(i32 %72, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%74 = icmp eq i32 5, %73
br i1 %74, label %77, label %75
75: ; preds = %70
%76 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 48)
store i32 0, i32* %1
br label %221
77: ; preds = %70
br label %78
78: ; preds = %77
br label %79
79: ; preds = %78
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%81 = load i32, i32* %80
%82 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%83 = call i32 @read(i32 %81, i8* %82, i32 5)
%84 = icmp eq i32 5, %83
br i1 %84, label %87, label %85
85: ; preds = %79
%86 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 49)
store i32 0, i32* %1
br label %221
87: ; preds = %79
br label %88
88: ; preds = %87
br label %89
89: ; preds = %88
%90 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%91 = call i32 @memcmp(i8* %90, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 50)
store i32 0, i32* %1
br label %221
95: ; preds = %89
br label %96
96: ; preds = %95
br label %97
97: ; preds = %96
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%99 = load i32, i32* %98
%100 = call i32 @write(i32 %99, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%101 = icmp eq i32 5, %100
br i1 %101, label %104, label %102
102: ; preds = %97
%103 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 52)
store i32 0, i32* %1
br label %221
104: ; preds = %97
br label %105
105: ; preds = %104
br label %106
106: ; preds = %105
%107 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%108 = load i32, i32* %107
%109 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%110 = call i32 @read(i32 %108, i8* %109, i32 2)
%111 = icmp eq i32 2, %110
br i1 %111, label %114, label %112
112: ; preds = %106
%113 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32 53)
store i32 0, i32* %1
br label %221
114: ; preds = %106
br label %115
115: ; preds = %114
br label %116
116: ; preds = %115
%117 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%118 = call i32 @memcmp(i8* %117, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 2)
%119 = icmp ne i32 %118, 0
br i1 %119, label %120, label %122
120: ; preds = %116
%121 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i32 54)
store i32 0, i32* %1
br label %221
122: ; preds = %116
br label %123
123: ; preds = %122
br label %124
124: ; preds = %123
%125 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%126 = load i32, i32* %125
%127 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%128 = call i32 @read(i32 %126, i8* %127, i32 3)
%129 = icmp eq i32 3, %128
br i1 %129, label %132, label %130
130: ; preds = %124
%131 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 55)
store i32 0, i32* %1
br label %221
132: ; preds = %124
br label %133
133: ; preds = %132
br label %134
134: ; preds = %133
%135 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%136 = call i32 @memcmp(i8* %135, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 3)
%137 = icmp ne i32 %136, 0
br i1 %137, label %138, label %140
138: ; preds = %134
%139 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 56)
store i32 0, i32* %1
br label %221
140: ; preds = %134
br label %141
141: ; preds = %140
%142 = call i32 @FD_ZERO(i32* %4)
%143 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%144 = load i32, i32* %143
%145 = call i32 @FD_SET(i32 %144, i32* %4)
%146 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i64 0, i64* %146
%147 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i64 0, i64* %147
%148 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%149 = load i32, i32* %148
%150 = add nsw i32 %149, 1
%151 = call i32 @select(i32 %150, i32* %4, i32* null, i32* null, %struct.timeval* %5)
store i32 %151, i32* %6
br label %152
152: ; preds = %141
%153 = load i32, i32* %6
%154 = icmp eq i32 %153, 0
br i1 %154, label %157, label %155
155: ; preds = %152
%156 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i32 64)
store i32 0, i32* %1
br label %221
157: ; preds = %152
br label %158
158: ; preds = %157
br label %159
159: ; preds = %158
%160 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%161 = load i32, i32* %160
%162 = call i32 @FD_ISSET(i32 %161, i32* %4)
%163 = icmp ne i32 %162, 0
br i1 %163, label %164, label %166
164: ; preds = %159
%165 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), i32 65)
store i32 0, i32* %1
br label %221
166: ; preds = %159
br label %167
167: ; preds = %166
br label %168
168: ; preds = %167
%169 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%170 = load i32, i32* %169
%171 = call i32 @write(i32 %170, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0), i32 1)
%172 = icmp eq i32 1, %171
br i1 %172, label %175, label %173
173: ; preds = %168
%174 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i32 68)
store i32 0, i32* %1
br label %221
175: ; preds = %168
br label %176
176: ; preds = %175
%177 = call i32 @FD_ZERO(i32* %4)
%178 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%179 = load i32, i32* %178
%180 = call i32 @FD_SET(i32 %179, i32* %4)
%181 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i64 0, i64* %181
%182 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i64 0, i64* %182
%183 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%184 = load i32, i32* %183
%185 = add nsw i32 %184, 1
%186 = call i32 @select(i32 %185, i32* %4, i32* null, i32* null, %struct.timeval* %5)
store i32 %186, i32* %6
br label %187
187: ; preds = %176
%188 = load i32, i32* %6
%189 = icmp eq i32 %188, 1
br i1 %189, label %192, label %190
190: ; preds = %187
%191 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 74)
store i32 0, i32* %1
br label %221
192: ; preds = %187
br label %193
193: ; preds = %192
br label %194
194: ; preds = %193
%195 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%196 = load i32, i32* %195
%197 = call i32 @FD_ISSET(i32 %196, i32* %4)
%198 = icmp ne i32 %197, 0
br i1 %198, label %201, label %199
199: ; preds = %194
%200 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0), i32 75)
store i32 0, i32* %1
br label %221
201: ; preds = %194
br label %202
202: ; preds = %201
br label %203
203: ; preds = %202
%204 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%205 = load i32, i32* %204
%206 = call i64 @close(i32 %205)
%207 = icmp eq i64 0, %206
br i1 %207, label %210, label %208
208: ; preds = %203
%209 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i32 77)
store i32 0, i32* %1
br label %221
210: ; preds = %203
br label %211
211: ; preds = %210
br label %212
212: ; preds = %211
%213 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%214 = load i32, i32* %213
%215 = call i64 @close(i32 %214)
%216 = icmp eq i64 0, %215
br i1 %216, label %219, label %217
217: ; preds = %212
%218 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.22, i64 0, i64 0), i32 78)
store i32 0, i32* %1
br label %221
219: ; preds = %212
br label %220
220: ; preds = %219
store i32 1, i32* %1
br label %221
221: ; preds = %220, %217, %208, %199, %190, %173, %164, %155, %138, %130, %120, %112, %102, %93, %85, %75, %66, %58, %48, %39, %31, %21, %12
%222 = load i32, i32* %1
ret i32 %222
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.1 = [15 x i8] c"0 == pipe(fds)\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [31 x i8] c"5 == write(fds[1], \22hello\22, 5)\00"
@.str.4 = [29 x i8] c"5 == read(fds[0], buffer, 5)\00"
@.str.5 = [28 x i8] c"!memcmp(buffer, \22hello\22, 5)\00"
@.str.6 = [4 x i8] c"bye\00"
@.str.7 = [29 x i8] c"3 == write(fds[1], \22bye\22, 3)\00"
@.str.8 = [29 x i8] c"3 == read(fds[0], buffer, 3)\00"
@.str.9 = [26 x i8] c"!memcmp(buffer, \22bye\22, 3)\00"
@.str.10 = [29 x i8] c"2 == read(fds[0], buffer, 2)\00"
@.str.11 = [3 x i8] c"he\00"
@.str.12 = [25 x i8] c"!memcmp(buffer, \22he\22, 2)\00"
@.str.13 = [4 x i8] c"llo\00"
@.str.14 = [26 x i8] c"!memcmp(buffer, \22llo\22, 3)\00"
@.str.15 = [7 x i8] c"r == 0\00"
@.str.16 = [26 x i8] c"!FD_ISSET(fds[0], &fdset)\00"
@.str.17 = [2 x i8] c"x\00"
@.str.18 = [27 x i8] c"1 == write(fds[1], \22x\22, 1)\00"
@.str.19 = [7 x i8] c"r == 1\00"
@.str.20 = [25 x i8] c"FD_ISSET(fds[0], &fdset)\00"
@.str.21 = [19 x i8] c"0 == close(fds[0])\00"
@.str.22 = [19 x i8] c"0 == close(fds[1])\00"
define i32 @test_create_pipe() {
%1 = alloca i64
%2 = alloca [10 x i8]
%3 = alloca i32
%4 = alloca %struct.timeval
%5 = bitcast i64* %1 to i8*
store i64 -1, i64* %1
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %3 to i8*
%8 = bitcast %struct.timeval* %4 to i8*
%9 = bitcast i64* %1 to i32*
%10 = call i64 @pipe(i32* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 38)
br label %147
14: ; preds = %0
%15 = bitcast i64* %1 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
%17 = load i32, i32* %16
%18 = call i32 @write(i32 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%19 = icmp eq i32 %18, 5
br i1 %19, label %22, label %20
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 40)
br label %147
22: ; preds = %14
%23 = load i32, i32* %9
%24 = call i32 @read(i32 %23, i8* %6, i32 5)
%25 = icmp eq i32 %24, 5
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 41)
br label %147
28: ; preds = %22
%29 = call i32 @memcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%30 = icmp eq i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 42)
br label %147
33: ; preds = %28
%34 = load i32, i32* %16
%35 = call i32 @write(i32 %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%36 = icmp eq i32 %35, 3
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 44)
br label %147
39: ; preds = %33
%40 = load i32, i32* %9
%41 = call i32 @read(i32 %40, i8* %6, i32 3)
%42 = icmp eq i32 %41, 3
br i1 %42, label %45, label %43
43: ; preds = %39
%44 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 45)
br label %147
45: ; preds = %39
%46 = call i32 @memcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%47 = icmp eq i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 46)
br label %147
50: ; preds = %45
%51 = load i32, i32* %16
%52 = call i32 @write(i32 %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%53 = icmp eq i32 %52, 5
br i1 %53, label %56, label %54
54: ; preds = %50
%55 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 48)
br label %147
56: ; preds = %50
%57 = load i32, i32* %9
%58 = call i32 @read(i32 %57, i8* %6, i32 5)
%59 = icmp eq i32 %58, 5
br i1 %59, label %62, label %60
60: ; preds = %56
%61 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 49)
br label %147
62: ; preds = %56
%63 = call i32 @memcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%64 = icmp eq i32 %63, 0
br i1 %64, label %67, label %65
65: ; preds = %62
%66 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 50)
br label %147
67: ; preds = %62
%68 = load i32, i32* %16
%69 = call i32 @write(i32 %68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%70 = icmp eq i32 %69, 5
br i1 %70, label %73, label %71
71: ; preds = %67
%72 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 52)
br label %147
73: ; preds = %67
%74 = load i32, i32* %9
%75 = call i32 @read(i32 %74, i8* %6, i32 2)
%76 = icmp eq i32 %75, 2
br i1 %76, label %79, label %77
77: ; preds = %73
%78 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32 53)
br label %147
79: ; preds = %73
%80 = call i32 @memcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 2)
%81 = icmp eq i32 %80, 0
br i1 %81, label %84, label %82
82: ; preds = %79
%83 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i32 54)
br label %147
84: ; preds = %79
%85 = load i32, i32* %9
%86 = call i32 @read(i32 %85, i8* %6, i32 3)
%87 = icmp eq i32 %86, 3
br i1 %87, label %90, label %88
88: ; preds = %84
%89 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 55)
br label %147
90: ; preds = %84
%91 = call i32 @memcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 3)
%92 = icmp eq i32 %91, 0
br i1 %92, label %95, label %93
93: ; preds = %90
%94 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 56)
br label %147
95: ; preds = %90
%96 = call i32 @FD_ZERO(i32* %3)
%97 = load i32, i32* %9
%98 = call i32 @FD_SET(i32 %97, i32* %3)
%99 = bitcast %struct.timeval* %4 to i8*
%100 = load i32, i32* %9
%101 = add nsw i32 %100, 1
%102 = call i32 @select(i32 %101, i32* %3, i32* null, i32* null, %struct.timeval* %4)
%103 = icmp eq i32 %102, 0
br i1 %103, label %106, label %104
104: ; preds = %95
%105 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i32 64)
br label %147
106: ; preds = %95
%107 = load i32, i32* %9
%108 = call i32 @FD_ISSET(i32 %107, i32* %3)
%109 = icmp eq i32 %108, 0
br i1 %109, label %112, label %110
110: ; preds = %106
%111 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), i32 65)
br label %147
112: ; preds = %106
%113 = load i32, i32* %16
%114 = call i32 @write(i32 %113, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0), i32 1)
%115 = icmp eq i32 %114, 1
br i1 %115, label %118, label %116
116: ; preds = %112
%117 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i32 68)
br label %147
118: ; preds = %112
%119 = call i32 @FD_ZERO(i32* %3)
%120 = load i32, i32* %9
%121 = call i32 @FD_SET(i32 %120, i32* %3)
%122 = bitcast %struct.timeval* %4 to i8*
%123 = load i32, i32* %9
%124 = add nsw i32 %123, 1
%125 = call i32 @select(i32 %124, i32* %3, i32* null, i32* null, %struct.timeval* %4)
%126 = icmp eq i32 %125, 1
br i1 %126, label %129, label %127
127: ; preds = %118
%128 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 74)
br label %147
129: ; preds = %118
%130 = load i32, i32* %9
%131 = call i32 @FD_ISSET(i32 %130, i32* %3)
%132 = icmp eq i32 %131, 0
br i1 %132, label %133, label %135
133: ; preds = %129
%134 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0), i32 75)
br label %147
135: ; preds = %129
%136 = load i32, i32* %9
%137 = call i64 @close(i32 %136)
%138 = icmp eq i64 %137, 0
br i1 %138, label %141, label %139
139: ; preds = %135
%140 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i32 77)
br label %147
141: ; preds = %135
%142 = load i32, i32* %16
%143 = call i64 @close(i32 %142)
%144 = icmp eq i64 %143, 0
br i1 %144, label %147, label %145
145: ; preds = %141
%146 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.22, i64 0, i64 0), i32 78)
br label %147
147: ; preds = %141, %145, %139, %133, %127, %116, %110, %104, %93, %88, %82, %77, %71, %65, %60, %54, %48, %43, %37, %31, %26, %20, %12
%148 = phi i32 [ 0, %31 ], [ 0, %48 ], [ 0, %65 ], [ 0, %82 ], [ 0, %93 ], [ 0, %110 ], [ 0, %145 ], [ 0, %139 ], [ 0, %133 ], [ 0, %127 ], [ 0, %116 ], [ 0, %104 ], [ 0, %88 ], [ 0, %77 ], [ 0, %71 ], [ 0, %60 ], [ 0, %54 ], [ 0, %43 ], [ 0, %37 ], [ 0, %26 ], [ 0, %20 ], [ 0, %12 ], [ 1, %141 ]
ret i32 %148
}