#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 pollfd {
  int fd;
  int events;
  int revents;
};
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int POLLHUP;
int POLLIN;
int STDERR_FILENO;
int STDIN_FILENO;
int STDOUT_FILENO;
int /*<<< orphan*/ close(int);
int dup2(int, int);
int /*<<< orphan*/ err_sys(char *);
scalar_t__ fork();
scalar_t__ gets(char *);
scalar_t__ pipe(int *);
int poll(struct pollfd *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int read(int, char *, int);
scalar_t__ strncmp(char *, char *, int);
int write(int, char *, int);
int main(int argc, char *argv[]) {
  int fd_in[2] = {0};
  int fd_out[2] = {0};
  if (pipe(fd_in) < 0)
    err_sys("pipe stdin error");
  if (pipe(fd_out) < 0)
    err_sys("pipe stdout error");
  int ret = 0;
  char line[4096] = {0};
  pid_t pid = fork();
  if (pid < 0) {
    err_sys("fork error");
  } else if (pid > 0) {
    close(fd_in[0]);
    close(fd_out[1]);
    struct pollfd pfd[2];
    pfd[0].fd = STDIN_FILENO;
    pfd[0].events = POLLIN;
    pfd[1].fd = fd_out[0];
    pfd[1].events = POLLIN;
    while (1) {
      ret = poll(pfd, 2, -1);
      if (ret == -1) {
        err_sys("poll error");
      } else if (ret == 0) {
        printf("poll over but no event\n");
        continue;
      }
      if (pfd[0].revents & POLLIN) {
        printf("poll stdin\n");
        ret = read(STDIN_FILENO, line, sizeof(line));
        if (ret < 0)
          err_sys("read stdin error");
        else if (ret == 0) {
          printf("read end\n");
          break;
        } else {
          ret = write(fd_in[1], line, ret);
          if (ret < 0)
            err_sys("write pipe error");
          else if (ret == 0) {
            printf("write end\n");
            break;
          }
        }
      }
      if (pfd[1].revents & POLLIN) {
        printf("poll pipe in\n");
        ret = read(pfd[1].fd, line, sizeof(line));
        if (ret < 0)
          err_sys("read pipe error");
        else if (ret == 0) {
          printf("read end\n");
          break;
        } else {
          ret = write(STDOUT_FILENO, line, ret);
          if (ret < 0)
            err_sys("write stdout error");
          else if (ret == 0) {
            printf("write end\n");
            break;
          }
        }
      }
      if (pfd[1].revents & POLLHUP) {
        printf("poll pipe hup\n");
        break;
      }
    }
  } else {
    close(fd_in[1]);
    close(fd_out[0]);
    printf("child begin to redirect pipe to stdin/out/err\n");
    if (fd_in[0] != STDIN_FILENO) {
      if (dup2(fd_in[0], STDIN_FILENO) != STDIN_FILENO)
        err_sys("dup2 stdin error");
      close(fd_in[0]);
    }
    if (fd_out[1] != STDOUT_FILENO) {
      if (dup2(fd_out[1], STDOUT_FILENO) != STDOUT_FILENO)
        err_sys("dup2 stdout error");
    }
    if (fd_out[1] != STDERR_FILENO) {
      if (dup2(fd_out[1], STDERR_FILENO) != STDERR_FILENO)
        err_sys("dup2 stderr error");
      close(fd_out[1]);
    }
    printf("redirect OK\n");
    while (gets(line)) {
      if (strncmp(line, "exit", 4) == 0) {
        break;
      }
      puts(line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
lea    -0x18(%rbp),%rdi
call   10b0 <pipe@plt>
cmp    $0x0,%rax
jge    1228 <main+0x58>
lea    0xddd(%rip),%rdi
call   1050 <err_sys@plt>
lea    -0x20(%rbp),%rdi
call   10b0 <pipe@plt>
cmp    $0x0,%rax
jge    1247 <main+0x77>
lea    0xdcf(%rip),%rdi
call   1050 <err_sys@plt>
movl   $0x0,-0x24(%rbp)
lea    -0x1030(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1090 <memset@plt>
mov    $0x0,%al
call   10f0 <fork@plt>
mov    %rax,-0x1038(%rbp)
cmpq   $0x0,-0x1038(%rbp)
jge    128e <main+0xbe>
lea    0xd9f(%rip),%rdi
call   1050 <err_sys@plt>
jmp    1667 <main+0x497>
cmpq   $0x0,-0x1038(%rbp)
jle    1518 <main+0x348>
mov    -0x18(%rbp),%edi
call   10a0 <close@plt>
mov    -0x1c(%rbp),%edi
call   10a0 <close@plt>
mov    0x2d0d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1050(%rbp)
mov    0x2d16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x104c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1044(%rbp)
mov    0x2cfe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1040(%rbp)
lea    -0x1050(%rbp),%rdi
mov    $0x2,%esi
mov    $0xffffffff,%edx
call   10e0 <poll@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1316 <main+0x146>
lea    0xd22(%rip),%rdi
call   1050 <err_sys@plt>
jmp    1336 <main+0x166>
cmpl   $0x0,-0x24(%rbp)
jne    1331 <main+0x161>
lea    0xd12(%rip),%rdi
call   1080 <printf@plt>
jmp    12e2 <main+0x112>
jmp    1336 <main+0x166>
mov    -0x1048(%rbp),%eax
mov    0x2c95(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     140c <main+0x23c>
lea    0xcfc(%rip),%rdi
call   1080 <printf@plt>
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
lea    -0x1030(%rbp),%rsi
mov    $0x1000,%edx
call   10c0 <read@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1392 <main+0x1c2>
lea    0xcd5(%rip),%rdi
call   1050 <err_sys@plt>
jmp    1407 <main+0x237>
cmpl   $0x0,-0x24(%rbp)
jne    13ad <main+0x1dd>
lea    0xccb(%rip),%rdi
call   1080 <printf@plt>
jmp    1513 <main+0x343>
mov    -0x14(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1060 <write@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    13dd <main+0x20d>
lea    0xca5(%rip),%rdi
call   1050 <err_sys@plt>
jmp    13fd <main+0x22d>
cmpl   $0x0,-0x24(%rbp)
jne    13f8 <main+0x228>
lea    0xc9b(%rip),%rdi
call   1080 <printf@plt>
jmp    1513 <main+0x343>
jmp    13fd <main+0x22d>
jmp    1402 <main+0x232>
jmp    1407 <main+0x237>
jmp    140c <main+0x23c>
mov    -0x103c(%rbp),%eax
mov    0x2bbf(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     14e5 <main+0x315>
lea    0xc69(%rip),%rdi
call   1080 <printf@plt>
mov    -0x1044(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    $0x1000,%edx
call   10c0 <read@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1465 <main+0x295>
lea    0xc47(%rip),%rdi
call   1050 <err_sys@plt>
jmp    14e0 <main+0x310>
cmpl   $0x0,-0x24(%rbp)
jne    1480 <main+0x2b0>
lea    0xbf8(%rip),%rdi
call   1080 <printf@plt>
jmp    1513 <main+0x343>
mov    0x2b69(%rip),%rax
mov    (%rax),%edi
lea    -0x1030(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1060 <write@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    14b6 <main+0x2e6>
lea    0xc06(%rip),%rdi
call   1050 <err_sys@plt>
jmp    14d6 <main+0x306>
cmpl   $0x0,-0x24(%rbp)
jne    14d1 <main+0x301>
lea    0xbc2(%rip),%rdi
call   1080 <printf@plt>
jmp    1513 <main+0x343>
jmp    14d6 <main+0x306>
jmp    14db <main+0x30b>
jmp    14e0 <main+0x310>
jmp    14e5 <main+0x315>
mov    -0x103c(%rbp),%eax
mov    0x2aee(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     150e <main+0x33e>
lea    0xbc1(%rip),%rdi
call   1080 <printf@plt>
jmp    1513 <main+0x343>
jmp    12e2 <main+0x112>
jmp    1662 <main+0x492>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
mov    -0x20(%rbp),%edi
call   10a0 <close@plt>
lea    0xba5(%rip),%rdi
call   1080 <printf@plt>
mov    -0x18(%rbp),%eax
mov    0x2a82(%rip),%rcx
cmp    (%rcx),%eax
je     157a <main+0x3aa>
mov    -0x18(%rbp),%edi
mov    0x2a70(%rip),%rax
mov    (%rax),%esi
call   1070 <dup2@plt>
mov    0x2a62(%rip),%rcx
cmp    (%rcx),%eax
je     1572 <main+0x3a2>
lea    0xb96(%rip),%rdi
call   1050 <err_sys@plt>
mov    -0x18(%rbp),%edi
call   10a0 <close@plt>
mov    -0x1c(%rbp),%eax
mov    0x2a6c(%rip),%rcx
cmp    (%rcx),%eax
je     15bd <main+0x3ed>
mov    -0x1c(%rbp),%edi
mov    0x2a5a(%rip),%rax
mov    (%rax),%esi
call   1070 <dup2@plt>
mov    0x2a4c(%rip),%rcx
cmp    (%rcx),%eax
je     15b8 <main+0x3e8>
lea    0xb61(%rip),%rdi
call   1050 <err_sys@plt>
jmp    15bd <main+0x3ed>
mov    -0x1c(%rbp),%eax
mov    0x2a01(%rip),%rcx
cmp    (%rcx),%eax
je     1603 <main+0x433>
mov    -0x1c(%rbp),%edi
mov    0x29ef(%rip),%rax
mov    (%rax),%esi
call   1070 <dup2@plt>
mov    0x29e1(%rip),%rcx
cmp    (%rcx),%eax
je     15fb <main+0x42b>
lea    0xb30(%rip),%rdi
call   1050 <err_sys@plt>
mov    -0x1c(%rbp),%edi
call   10a0 <close@plt>
lea    0xb2e(%rip),%rdi
call   1080 <printf@plt>
lea    -0x1030(%rbp),%rdi
call   10d0 <gets@plt>
cmp    $0x0,%rax
je     165d <main+0x48d>
lea    -0x1030(%rbp),%rdi
lea    0xb12(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    164c <main+0x47c>
jmp    165d <main+0x48d>
lea    -0x1030(%rbp),%rdi
call   1040 <puts@plt>
jmp    160f <main+0x43f>
jmp    1662 <main+0x492>
jmp    1667 <main+0x497>
xor    %eax,%eax
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1038,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x8(%rsp),%rdi
call   10a0 <pipe@plt>
test   %rax,%rax
jns    11fd <main+0x3d>
lea    0xe08(%rip),%rdi
call   1050 <err_sys@plt>
mov    %rsp,%rdi
call   10a0 <pipe@plt>
test   %rax,%rax
jns    1216 <main+0x56>
lea    0xe00(%rip),%rdi
call   1050 <err_sys@plt>
lea    0x30(%rsp),%rdi
mov    $0x1000,%edx
xor    %esi,%esi
call   1080 <memset@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %rax,%rax
js     13c9 <main+0x209>
je     13da <main+0x21a>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
mov    0x2d6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    0x2d75(%rip),%r12
mov    (%r12),%eax
mov    %eax,0x14(%rsp)
mov    (%rsp),%ecx
mov    %ecx,0x1c(%rsp)
mov    %eax,0x20(%rsp)
lea    0x10(%rsp),%rbx
mov    0x2d5e(%rip),%r13
lea    0x30(%rsp),%rbp
lea    0xe7f(%rip),%r14
lea    0xda4(%rip),%r15
jmp    12b3 <main+0xf3>
nopw   0x0(%rax,%rax,1)
call   1050 <err_sys@plt>
mov    0x0(%r13),%eax
test   %eax,0x24(%rsp)
jne    14dc <main+0x31c>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xffffffff,%edx
call   10d0 <poll@plt>
test   %eax,%eax
je     1330 <main+0x170>
cmp    $0xffffffff,%eax
jne    12da <main+0x11a>
lea    0xd59(%rip),%rdi
call   1050 <err_sys@plt>
mov    (%r12),%eax
test   %eax,0x18(%rsp)
je     1355 <main+0x195>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
mov    %rbp,%rsi
mov    $0x1000,%edx
call   10b0 <read@plt>
mov    %r15,%rdi
test   %eax,%eax
js     1350 <main+0x190>
je     14e5 <main+0x325>
mov    0xc(%rsp),%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <write@plt>
lea    0xd26(%rip),%rdi
test   %eax,%eax
js     1350 <main+0x190>
jne    1355 <main+0x195>
jmp    13bd <main+0x1fd>
nop
lea    0xdf4(%rip),%rdi
call   1040 <puts@plt>
jmp    12b3 <main+0xf3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1050 <err_sys@plt>
mov    (%r12),%eax
test   %eax,0x24(%rsp)
je     12a5 <main+0xe5>
lea    0xd96(%rip),%rdi
call   1040 <puts@plt>
mov    0x1c(%rsp),%edi
mov    %rbp,%rsi
mov    $0x1000,%edx
call   10b0 <read@plt>
lea    0xcd4(%rip),%rdi
test   %eax,%eax
js     12a0 <main+0xe0>
je     14e5 <main+0x325>
mov    0x2c54(%rip),%rcx
mov    (%rcx),%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <write@plt>
lea    0xcbc(%rip),%rdi
test   %eax,%eax
js     12a0 <main+0xe0>
jne    12a5 <main+0xe5>
lea    0xd54(%rip),%rdi
jmp    14ec <main+0x32c>
lea    0xc53(%rip),%rdi
call   1050 <err_sys@plt>
jmp    14f1 <main+0x331>
mov    0xc(%rsp),%edi
call   1090 <close@plt>
mov    (%rsp),%edi
call   1090 <close@plt>
lea    0xcc6(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%edi
mov    0x2bbe(%rip),%rbx
mov    (%rbx),%esi
cmp    %esi,%edi
je     1426 <main+0x266>
call   1070 <dup2@plt>
cmp    (%rbx),%eax
je     141d <main+0x25d>
lea    0xc66(%rip),%rdi
call   1050 <err_sys@plt>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
mov    0x4(%rsp),%edi
mov    0x2bbf(%rip),%rbx
mov    (%rbx),%esi
cmp    %esi,%edi
je     144c <main+0x28c>
call   1070 <dup2@plt>
cmp    (%rbx),%eax
je     144c <main+0x28c>
lea    0xc48(%rip),%rdi
call   1050 <err_sys@plt>
mov    0x4(%rsp),%edi
mov    0x2b71(%rip),%rbx
mov    (%rbx),%esi
cmp    %esi,%edi
je     147b <main+0x2bb>
call   1070 <dup2@plt>
cmp    (%rbx),%eax
je     1472 <main+0x2b2>
lea    0xc34(%rip),%rdi
call   1050 <err_sys@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
lea    0xc64(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rdi
call   10c0 <gets@plt>
test   %rax,%rax
je     14f1 <main+0x331>
lea    0xc16(%rip),%rbx
lea    0x30(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     14f1 <main+0x331>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   10c0 <gets@plt>
test   %rax,%rax
jne    14b0 <main+0x2f0>
jmp    14f1 <main+0x331>
lea    0xc0f(%rip),%rdi
jmp    14ec <main+0x32c>
lea    0xc36(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x1038,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32, i32 }
@.str = [17 x i8] c"pipe stdin error\00"
@.str.1 = [18 x i8] c"pipe stdout error\00"
@.str.2 = [11 x i8] c"fork error\00"
@STDIN_FILENO = global i32 0
@POLLIN = global i32 0
@.str.3 = [11 x i8] c"poll error\00"
@.str.4 = [24 x i8] c"poll over but no event\0A\00"
@.str.5 = [12 x i8] c"poll stdin\0A\00"
@.str.6 = [17 x i8] c"read stdin error\00"
@.str.7 = [10 x i8] c"read end\0A\00"
@.str.8 = [17 x i8] c"write pipe error\00"
@.str.9 = [11 x i8] c"write end\0A\00"
@.str.10 = [14 x i8] c"poll pipe in\0A\00"
@.str.11 = [16 x i8] c"read pipe error\00"
@STDOUT_FILENO = global i32 0
@.str.12 = [19 x i8] c"write stdout error\00"
@POLLHUP = global i32 0
@.str.13 = [15 x i8] c"poll pipe hup\0A\00"
@.str.14 = [47 x i8] c"child begin to redirect pipe to stdin/out/err\0A\00"
@.str.15 = [17 x i8] c"dup2 stdin error\00"
@.str.16 = [18 x i8] c"dup2 stdout error\00"
@STDERR_FILENO = global i32 0
@.str.17 = [18 x i8] c"dup2 stderr error\00"
@.str.18 = [13 x i8] c"redirect OK\0A\00"
@.str.19 = [5 x i8] c"exit\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca [4096 x i8]
%10 = alloca i64
%11 = alloca [2 x %struct.pollfd]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [2 x i32]* %6 to i8*
%13 = bitcast [2 x i32]* %7 to i8*
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%15 = call i64 @pipe(i32* %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%21 = call i64 @pipe(i32* %20)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %19
store i32 0, i32* %8
%26 = bitcast [4096 x i8]* %9 to i8*
%27 = call i64 (...) @fork()
store i64 %27, i64* %10
%28 = load i64, i64* %10
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %234
32: ; preds = %25
%33 = load i64, i64* %10
%34 = icmp sgt i64 %33, 0
br i1 %34, label %35, label %160
35: ; preds = %32
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%37 = load i32, i32* %36
%38 = call i32 @close(i32 %37)
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%40 = load i32, i32* %39
%41 = call i32 @close(i32 %40)
%42 = load i32, i32* @STDIN_FILENO
%43 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 0
%44 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %43, i32 0, i32 0
store i32 %42, i32* %44
%45 = load i32, i32* @POLLIN
%46 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 0
%47 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %46, i32 0, i32 1
store i32 %45, i32* %47
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%49 = load i32, i32* %48
%50 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 1
%51 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %50, i32 0, i32 0
store i32 %49, i32* %51
%52 = load i32, i32* @POLLIN
%53 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 1
%54 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %53, i32 0, i32 1
store i32 %52, i32* %54
br label %55
55: ; preds = %35, %65, %158
%56 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 0
%57 = call i32 @poll(%struct.pollfd* %56, i32 2, i32 -1)
store i32 %57, i32* %8
%58 = load i32, i32* %8
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %62
60: ; preds = %55
%61 = call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %68
62: ; preds = %55
%63 = load i32, i32* %8
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %55
67: ; preds = %62
br label %68
68: ; preds = %67, %60
%69 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 0
%70 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %69, i32 0, i32 2
%71 = load i32, i32* %70
%72 = load i32, i32* @POLLIN
%73 = and i32 %71, %72
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %108
75: ; preds = %68
%76 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%77 = load i32, i32* @STDIN_FILENO
%78 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%79 = call i32 @read(i32 %77, i8* %78, i32 4096)
store i32 %79, i32* %8
%80 = load i32, i32* %8
%81 = icmp slt i32 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %75
%83 = call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %107
84: ; preds = %75
%85 = load i32, i32* %8
%86 = icmp eq i32 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %159
89: ; preds = %84
%90 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%91 = load i32, i32* %90
%92 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%93 = load i32, i32* %8
%94 = call i32 @write(i32 %91, i8* %92, i32 %93)
store i32 %94, i32* %8
%95 = load i32, i32* %8
%96 = icmp slt i32 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %89
%98 = call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br label %105
99: ; preds = %89
%100 = load i32, i32* %8
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %104
102: ; preds = %99
%103 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %159
104: ; preds = %99
br label %105
105: ; preds = %104, %97
br label %106
106: ; preds = %105
br label %107
107: ; preds = %106, %82
br label %108
108: ; preds = %107, %68
%109 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 1
%110 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %109, i32 0, i32 2
%111 = load i32, i32* %110
%112 = load i32, i32* @POLLIN
%113 = and i32 %111, %112
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %149
115: ; preds = %108
%116 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%117 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 1
%118 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %117, i32 0, i32 0
%119 = load i32, i32* %118
%120 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%121 = call i32 @read(i32 %119, i8* %120, i32 4096)
store i32 %121, i32* %8
%122 = load i32, i32* %8
%123 = icmp slt i32 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %115
%125 = call i32 @err_sys(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %148
126: ; preds = %115
%127 = load i32, i32* %8
%128 = icmp eq i32 %127, 0
br i1 %128, label %129, label %131
129: ; preds = %126
%130 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %159
131: ; preds = %126
%132 = load i32, i32* @STDOUT_FILENO
%133 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%134 = load i32, i32* %8
%135 = call i32 @write(i32 %132, i8* %133, i32 %134)
store i32 %135, i32* %8
%136 = load i32, i32* %8
%137 = icmp slt i32 %136, 0
br i1 %137, label %138, label %140
138: ; preds = %131
%139 = call i32 @err_sys(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
br label %146
140: ; preds = %131
%141 = load i32, i32* %8
%142 = icmp eq i32 %141, 0
br i1 %142, label %143, label %145
143: ; preds = %140
%144 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %159
145: ; preds = %140
br label %146
146: ; preds = %145, %138
br label %147
147: ; preds = %146
br label %148
148: ; preds = %147, %124
br label %149
149: ; preds = %148, %108
%150 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %11, i64 0, i64 1
%151 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %150, i32 0, i32 2
%152 = load i32, i32* %151
%153 = load i32, i32* @POLLHUP
%154 = and i32 %152, %153
%155 = icmp ne i32 %154, 0
br i1 %155, label %156, label %158
156: ; preds = %149
%157 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
br label %159
158: ; preds = %149
br label %55
159: ; preds = %156, %143, %129, %102, %87
br label %233
160: ; preds = %32
%161 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%162 = load i32, i32* %161
%163 = call i32 @close(i32 %162)
%164 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%165 = load i32, i32* %164
%166 = call i32 @close(i32 %165)
%167 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.14, i64 0, i64 0))
%168 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%169 = load i32, i32* %168
%170 = load i32, i32* @STDIN_FILENO
%171 = icmp ne i32 %169, %170
br i1 %171, label %172, label %185
172: ; preds = %160
%173 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%174 = load i32, i32* %173
%175 = load i32, i32* @STDIN_FILENO
%176 = call i32 @dup2(i32 %174, i32 %175)
%177 = load i32, i32* @STDIN_FILENO
%178 = icmp ne i32 %176, %177
br i1 %178, label %179, label %181
179: ; preds = %172
%180 = call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
br label %181
181: ; preds = %179, %172
%182 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%183 = load i32, i32* %182
%184 = call i32 @close(i32 %183)
br label %185
185: ; preds = %181, %160
%186 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%187 = load i32, i32* %186
%188 = load i32, i32* @STDOUT_FILENO
%189 = icmp ne i32 %187, %188
br i1 %189, label %190, label %200
190: ; preds = %185
%191 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%192 = load i32, i32* %191
%193 = load i32, i32* @STDOUT_FILENO
%194 = call i32 @dup2(i32 %192, i32 %193)
%195 = load i32, i32* @STDOUT_FILENO
%196 = icmp ne i32 %194, %195
br i1 %196, label %197, label %199
197: ; preds = %190
%198 = call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0))
br label %199
199: ; preds = %197, %190
br label %200
200: ; preds = %199, %185
%201 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%202 = load i32, i32* %201
%203 = load i32, i32* @STDERR_FILENO
%204 = icmp ne i32 %202, %203
br i1 %204, label %205, label %218
205: ; preds = %200
%206 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%207 = load i32, i32* %206
%208 = load i32, i32* @STDERR_FILENO
%209 = call i32 @dup2(i32 %207, i32 %208)
%210 = load i32, i32* @STDERR_FILENO
%211 = icmp ne i32 %209, %210
br i1 %211, label %212, label %214
212: ; preds = %205
%213 = call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %214
214: ; preds = %212, %205
%215 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%216 = load i32, i32* %215
%217 = call i32 @close(i32 %216)
br label %218
218: ; preds = %214, %200
%219 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0))
br label %220
220: ; preds = %229, %218
%221 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%222 = call i64 @gets(i8* %221)
%223 = icmp ne i64 %222, 0
br i1 %223, label %224, label %232
224: ; preds = %220
%225 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%226 = call i64 @strncmp(i8* %225, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 4)
%227 = icmp eq i64 %226, 0
br i1 %227, label %228, label %229
228: ; preds = %224
br label %232
229: ; preds = %224
%230 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%231 = call i32 @puts(i8* %230)
br label %220
232: ; preds = %228, %220
br label %233
233: ; preds = %232, %159
br label %234
234: ; preds = %233, %30
ret i32 0
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32, i32 }
@.str = [17 x i8] c"pipe stdin error\00"
@.str.1 = [18 x i8] c"pipe stdout error\00"
@.str.2 = [11 x i8] c"fork error\00"
@STDIN_FILENO = global i32 0
@POLLIN = global i32 0
@.str.3 = [11 x i8] c"poll error\00"
@.str.6 = [17 x i8] c"read stdin error\00"
@.str.8 = [17 x i8] c"write pipe error\00"
@.str.11 = [16 x i8] c"read pipe error\00"
@STDOUT_FILENO = global i32 0
@.str.12 = [19 x i8] c"write stdout error\00"
@POLLHUP = global i32 0
@.str.15 = [17 x i8] c"dup2 stdin error\00"
@.str.16 = [18 x i8] c"dup2 stdout error\00"
@STDERR_FILENO = global i32 0
@.str.17 = [18 x i8] c"dup2 stderr error\00"
@.str.19 = [5 x i8] c"exit\00"
@str = [46 x i8] c"child begin to redirect pipe to stdin/out/err\00"
@str.20 = [12 x i8] c"redirect OK\00"
@str.21 = [14 x i8] c"poll pipe hup\00"
@str.22 = [13 x i8] c"poll pipe in\00"
@str.25 = [11 x i8] c"poll stdin\00"
@str.26 = [10 x i8] c"write end\00"
@str.27 = [9 x i8] c"read end\00"
@str.28 = [23 x i8] c"poll over but no event\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to [2 x i32]*
%5 = alloca i64
%6 = bitcast i64* %5 to [2 x i32]*
%7 = alloca [4096 x i8]
%8 = alloca [2 x %struct.pollfd]
%9 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%10 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%11 = bitcast i64* %3 to i32*
%12 = call i64 @pipe(i32* %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
%17 = bitcast i64* %5 to i32*
%18 = call i64 @pipe(i32* %17)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%24 = call i64 (...) @fork()
%25 = icmp slt i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %159
28: ; preds = %22
%29 = icmp eq i64 %24, 0
br i1 %29, label %105, label %30
30: ; preds = %28
%31 = load i32, i32* %11
%32 = call i32 @close(i32 %31)
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%34 = load i32, i32* %33
%35 = call i32 @close(i32 %34)
%36 = bitcast [2 x %struct.pollfd]* %8 to i8*
%37 = load i32, i32* @STDIN_FILENO
%38 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %8, i64 0, i64 0
%39 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %8, i64 0, i64 0, i32 0
store i32 %37, i32* %39
%40 = load i32, i32* @POLLIN
%41 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %8, i64 0, i64 0, i32 1
store i32 %40, i32* %41
%42 = load i32, i32* %17
%43 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %8, i64 0, i64 1, i32 0
store i32 %42, i32* %43
%44 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %8, i64 0, i64 1, i32 1
store i32 %40, i32* %44
%45 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %8, i64 0, i64 0, i32 2
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%47 = getelementptr inbounds [2 x %struct.pollfd], [2 x %struct.pollfd]* %8, i64 0, i64 1, i32 2
br label %48
48: ; preds = %54, %30
%49 = call i32 @poll(%struct.pollfd* %38, i32 2, i32 -1)
switch i32 %49, label %55 [
i32 -1, label %50
i32 0, label %52
]
50: ; preds = %48
%51 = call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %55
52: ; preds = %48
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.28, i64 0, i64 0))
br label %54
54: ; preds = %52, %97
br label %48
55: ; preds = %48, %50
%56 = load i32, i32* %45
%57 = load i32, i32* @POLLIN
%58 = and i32 %57, %56
%59 = icmp eq i32 %58, 0
br i1 %59, label %76, label %60
60: ; preds = %55
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.25, i64 0, i64 0))
%62 = load i32, i32* @STDIN_FILENO
%63 = call i32 @read(i32 %62, i8* %23, i32 4096)
%64 = icmp slt i32 %63, 0
br i1 %64, label %73, label %65
65: ; preds = %60
%66 = icmp eq i32 %63, 0
br i1 %66, label %102, label %67
67: ; preds = %65
%68 = load i32, i32* %46
%69 = call i32 @write(i32 %68, i8* %23, i32 %63)
%70 = icmp slt i32 %69, 0
br i1 %70, label %73, label %71
71: ; preds = %67
%72 = icmp eq i32 %69, 0
br i1 %72, label %102, label %76
73: ; preds = %67, %60
%74 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), %60 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), %67 ]
%75 = call i32 @err_sys(i8* %74)
br label %76
76: ; preds = %73, %71, %55
%77 = load i32, i32* %47
%78 = load i32, i32* @POLLIN
%79 = and i32 %78, %77
%80 = icmp eq i32 %79, 0
br i1 %80, label %97, label %81
81: ; preds = %76
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%83 = load i32, i32* %43
%84 = call i32 @read(i32 %83, i8* %23, i32 4096)
%85 = icmp slt i32 %84, 0
br i1 %85, label %94, label %86
86: ; preds = %81
%87 = icmp eq i32 %84, 0
br i1 %87, label %102, label %88
88: ; preds = %86
%89 = load i32, i32* @STDOUT_FILENO
%90 = call i32 @write(i32 %89, i8* %23, i32 %84)
%91 = icmp slt i32 %90, 0
br i1 %91, label %94, label %92
92: ; preds = %88
%93 = icmp eq i32 %90, 0
br i1 %93, label %102, label %97
94: ; preds = %88, %81
%95 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), %81 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), %88 ]
%96 = call i32 @err_sys(i8* %95)
br label %97
97: ; preds = %94, %92, %76
%98 = load i32, i32* %47
%99 = load i32, i32* @POLLHUP
%100 = and i32 %99, %98
%101 = icmp eq i32 %100, 0
br i1 %101, label %54, label %102
102: ; preds = %97, %92, %86, %71, %65
%103 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.27, i64 0, i64 0), %65 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.26, i64 0, i64 0), %71 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.27, i64 0, i64 0), %86 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.26, i64 0, i64 0), %92 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0), %97 ]
%104 = call i32 @puts(i8* dereferenceable(1) %103)
br label %159
105: ; preds = %28
%106 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%107 = load i32, i32* %106
%108 = call i32 @close(i32 %107)
%109 = load i32, i32* %17
%110 = call i32 @close(i32 %109)
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%112 = load i32, i32* %11
%113 = load i32, i32* @STDIN_FILENO
%114 = icmp eq i32 %112, %113
br i1 %114, label %124, label %115
115: ; preds = %105
%116 = call i32 @dup2(i32 %112, i32 %113)
%117 = load i32, i32* @STDIN_FILENO
%118 = icmp eq i32 %116, %117
br i1 %118, label %121, label %119
119: ; preds = %115
%120 = call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
br label %121
121: ; preds = %119, %115
%122 = load i32, i32* %11
%123 = call i32 @close(i32 %122)
br label %124
124: ; preds = %121, %105
%125 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%126 = load i32, i32* %125
%127 = load i32, i32* @STDOUT_FILENO
%128 = icmp eq i32 %126, %127
br i1 %128, label %135, label %129
129: ; preds = %124
%130 = call i32 @dup2(i32 %126, i32 %127)
%131 = load i32, i32* @STDOUT_FILENO
%132 = icmp eq i32 %130, %131
br i1 %132, label %135, label %133
133: ; preds = %129
%134 = call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0))
br label %135
135: ; preds = %129, %133, %124
%136 = load i32, i32* %125
%137 = load i32, i32* @STDERR_FILENO
%138 = icmp eq i32 %136, %137
br i1 %138, label %148, label %139
139: ; preds = %135
%140 = call i32 @dup2(i32 %136, i32 %137)
%141 = load i32, i32* @STDERR_FILENO
%142 = icmp eq i32 %140, %141
br i1 %142, label %145, label %143
143: ; preds = %139
%144 = call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %145
145: ; preds = %143, %139
%146 = load i32, i32* %125
%147 = call i32 @close(i32 %146)
br label %148
148: ; preds = %145, %135
%149 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.20, i64 0, i64 0))
%150 = call i64 @gets(i8* %23)
%151 = icmp eq i64 %150, 0
br i1 %151, label %159, label %152
152: ; preds = %148, %155
%153 = call i64 @strncmp(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 4)
%154 = icmp eq i64 %153, 0
br i1 %154, label %159, label %155
155: ; preds = %152
%156 = call i32 @puts(i8* %23)
%157 = call i64 @gets(i8* %23)
%158 = icmp eq i64 %157, 0
br i1 %158, label %159, label %152
159: ; preds = %155, %152, %148, %102, %26
ret i32 0
}