#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ reuse;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ INADDR_ANY;
int O_NONBLOCK;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ STDOUT_FILENO;
void *atoi(char *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fcntl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int open(char *, int /*<<< orphan*/);
int read(int, unsigned char *, int);
scalar_t__ recv(int, unsigned char *, int, int /*<<< orphan*/);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ write(int /*<<< orphan*/, unsigned char *, int);
int main(int argc, char *argv[]) {
  int input_file1;
  int input_file2;
  int byte_read;
  unsigned char choice;
  int port;
  unsigned char packet[188];
  if (argc >= 5) {
    input_file1 = open(argv[1], O_RDONLY);
    if (input_file1 < 0) {
      fprintf(stderr, "Can't open file %s\n", argv[1]);
      return 0;
    }
    input_file2 = open(argv[2], O_RDONLY);
    if (input_file2 < 0) {
      fprintf(stderr, "Can't open file %s\n", argv[2]);
      return 0;
    }
    port = atoi(argv[3]);
    if (port <= 0) {
      fprintf(stderr, "Can't open port %s\n", argv[3]);
      return 0;
    }
    choice = atoi(argv[4]);
    if (choice < 0) {
      fprintf(stderr, "Default choice is %d\n", choice);
      return 0;
    }
  } else {
    fprintf(
        stderr,
        "Usage: 'tsinputswitch inputfile1.ts inputfile2.ts port default'\n");
    fprintf(
        stderr,
        "0 output from inputfile1, read and discard input from inputfile2\n");
    fprintf(
        stderr,
        "1 output from inputfile2, read and discard input from inputfil1\n");
    fprintf(stderr,
            "2 output from inputfile1, stop reading input from inputfile2\n");
    fprintf(stderr,
            "3 output from inputfile2, stop reading input from inputfile1\n");
    fprintf(stderr, "Default: 0\n");
    return 0;
  }
  int listen_sd;
  listen_sd = socket(AF_INET, SOCK_DGRAM, 0);
  if (listen_sd < 0) {
    fprintf(stderr, "secsocket - socket() error\n");
    exit(-1);
  } else {
    fprintf(stderr, "secsocket - socket() is OK\n");
  }
  int flags;
  flags = fcntl(listen_sd, F_GETFL, 0);
  fcntl(listen_sd, F_SETFL, flags | O_NONBLOCK);
  int reuse = 1;
  if (setsockopt(listen_sd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse,
                 sizeof(reuse)) < 0) {
    fprintf(stderr, "setting SO_REUSEADDR failed\n");
    close(listen_sd);
    exit(-1);
  }
  struct sockaddr_in addr;
  memset(&addr, 0, sizeof(addr));
  addr.sin_family = AF_INET;
  addr.sin_addr.s_addr = INADDR_ANY;
  addr.sin_port = htons(port);
  int result = bind(listen_sd, (struct sockaddr *)&addr, sizeof(addr));
  if (result < 0) {
    fprintf(stderr, "secsocket - bind() error\n");
    close(listen_sd);
    exit(-1);
  } else {
  }
  byte_read = 1;
  choice = 0;
  unsigned char received = 0;
  while (byte_read) {
    if (recv(listen_sd, &received, 1, 0) > 0) {
      fprintf(stderr, "received %d\n", received - 48);
      choice = received - 48;
    }
    if (choice == 0) {
      byte_read = read(input_file2, packet, 188);
      byte_read = read(input_file1, packet, 188);
    } else if (choice == 1) {
      byte_read = read(input_file1, packet, 188);
      byte_read = read(input_file2, packet, 188);
    } else if (choice == 2) {
      byte_read = read(input_file1, packet, 188);
    } else if (choice == 3) {
      byte_read = read(input_file2, packet, 188);
    }
    if (byte_read > 0) {
      write(STDOUT_FILENO, packet, 188);
    }
  }
  close(input_file1);
  close(input_file2);
  close(listen_sd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jl     132d <main+0x14d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
call   10d0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1251 <main+0x71>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16fe <main+0x51e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2d68(%rip),%rax
mov    (%rax),%esi
call   10d0 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    129f <main+0xbf>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd74(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16fe <main+0x51e>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jg     12e4 <main+0x104>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xd43(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16fe <main+0x51e>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10e0 <atoi@plt>
mov    %al,-0x1d(%rbp)
movzbl -0x1d(%rbp),%eax
cmp    $0x0,%eax
jge    1328 <main+0x148>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
movzbl -0x1d(%rbp),%edx
lea    0xd13(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16fe <main+0x51e>
jmp    13c3 <main+0x1e3>
mov    0x2c74(%rip),%rax
mov    (%rax),%edi
lea    0xd01(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x2c5d(%rip),%rax
mov    (%rax),%edi
lea    0xd2b(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
lea    0xd56(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x2c2f(%rip),%rax
mov    (%rax),%edi
lea    0xd80(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x2c18(%rip),%rax
mov    (%rax),%edi
lea    0xda7(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x2c01(%rip),%rax
mov    (%rax),%edi
lea    0xdce(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16fe <main+0x51e>
mov    0x2c0e(%rip),%rax
mov    (%rax),%edi
mov    0x2be5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0xe4(%rbp)
jge    1410 <main+0x230>
mov    0x2bb2(%rip),%rax
mov    (%rax),%edi
lea    0xd8b(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
mov    0x2b91(%rip),%rax
mov    (%rax),%edi
lea    0xd86(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0xe4(%rbp),%edi
mov    0x2b64(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <fcntl@plt>
mov    %eax,-0xe8(%rbp)
mov    -0xe4(%rbp),%edi
mov    0x2b50(%rip),%rax
mov    (%rax),%esi
mov    -0xe8(%rbp),%edx
mov    0x2b71(%rip),%rax
or     (%rax),%edx
call   1050 <fcntl@plt>
movl   $0x1,-0xec(%rbp)
mov    -0xe4(%rbp),%edi
mov    0x2b63(%rip),%rax
mov    (%rax),%esi
mov    0x2b0a(%rip),%rax
mov    (%rax),%edx
lea    -0xec(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0x0,%rax
jge    14d0 <main+0x2f0>
mov    0x2afd(%rip),%rax
mov    (%rax),%edi
lea    0xd0e(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0xe4(%rbp),%edi
call   1090 <close@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
lea    -0xf8(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2aee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xf0(%rbp)
mov    0x2ac7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xf4(%rbp)
mov    -0x24(%rbp),%edi
call   1070 <htons@plt>
mov    %eax,-0xf8(%rbp)
mov    -0xe4(%rbp),%edi
lea    -0xf8(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
mov    %eax,-0xfc(%rbp)
cmpl   $0x0,-0xfc(%rbp)
jge    1565 <main+0x385>
mov    0x2a68(%rip),%rax
mov    (%rax),%edi
lea    0xc96(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0xe4(%rbp),%edi
call   1090 <close@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
jmp    156a <main+0x38a>
movl   $0x1,-0x1c(%rbp)
movb   $0x0,-0x1d(%rbp)
movb   $0x0,-0xfd(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     16dc <main+0x4fc>
mov    -0xe4(%rbp),%edi
lea    -0xfd(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x0,%rax
jle    15d7 <main+0x3f7>
mov    0x29f8(%rip),%rax
mov    (%rax),%edi
movzbl -0xfd(%rbp),%edx
sub    $0x30,%edx
lea    0xc36(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movzbl -0xfd(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1d(%rbp)
movzbl -0x1d(%rbp),%eax
cmp    $0x0,%eax
jne    1617 <main+0x437>
mov    -0x18(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
jmp    16b3 <main+0x4d3>
movzbl -0x1d(%rbp),%eax
cmp    $0x1,%eax
jne    1657 <main+0x477>
mov    -0x14(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
jmp    16ae <main+0x4ce>
movzbl -0x1d(%rbp),%eax
cmp    $0x2,%eax
jne    1680 <main+0x4a0>
mov    -0x14(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
jmp    16a9 <main+0x4c9>
movzbl -0x1d(%rbp),%eax
cmp    $0x3,%eax
jne    16a4 <main+0x4c4>
mov    -0x18(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
jmp    16a9 <main+0x4c9>
jmp    16ae <main+0x4ce>
jmp    16b3 <main+0x4d3>
cmpl   $0x0,-0x1c(%rbp)
jle    16d7 <main+0x4f7>
mov    0x292c(%rip),%rax
mov    (%rax),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   1060 <write@plt>
jmp    157c <main+0x39c>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
mov    -0xe4(%rbp),%edi
call   1090 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
cmp    $0x5,%edi
jl     1427 <main+0x247>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
mov    0x2dc0(%rip),%r14
mov    (%r14),%esi
call   10d0 <open@plt>
test   %eax,%eax
js     1490 <main+0x2b0>
mov    %eax,%ebx
mov    0x10(%rbp),%rdi
mov    (%r14),%esi
call   10d0 <open@plt>
mov    %eax,0x8(%rsp)
test   %eax,%eax
js     14b9 <main+0x2d9>
mov    0x18(%rbp),%rbp
mov    %rbp,%rdi
call   10e0 <atoi@plt>
mov    %rax,%r15
test   %r15d,%r15d
jle    14e8 <main+0x308>
mov    0x2d87(%rip),%r14
mov    (%r14),%edi
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,%r13d
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
test   %r13d,%r13d
js     14fd <main+0x31d>
lea    0xf20(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    0x2d0a(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
xor    %edx,%edx
call   1050 <fcntl@plt>
mov    0x2cff(%rip),%rcx
mov    (%rcx),%esi
mov    0x2d26(%rip),%rcx
or     (%rcx),%eax
mov    %r13d,%edi
mov    %eax,%edx
call   1050 <fcntl@plt>
movl   $0x1,0xc(%rsp)
mov    0x2d1b(%rip),%rax
mov    (%rax),%esi
mov    0x2cc2(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %r13d,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %rax,%rax
js     1515 <main+0x335>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    (%r14),%eax
mov    %eax,0x18(%rsp)
mov    0x2cb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    %r15d,%edi
call   1070 <htons@plt>
mov    %eax,0x10(%rsp)
mov    %r13d,%edi
mov    %rbp,%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
test   %eax,%eax
js     1527 <main+0x347>
movb   $0x0,0x7(%rsp)
mov    $0x1,%r12d
lea    0x20(%rsp),%rbp
lea    0xcb1(%rip),%r14
xor    %r15d,%r15d
jmp    1369 <main+0x189>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r12d,%r12d
je     149f <main+0x2bf>
mov    %r13d,%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jle    13ab <main+0x1cb>
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
movzbl 0x7(%rsp),%edx
add    $0xffffffd0,%edx
lea    0xe59(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
movzbl 0x7(%rsp),%r15d
add    $0xd0,%r15b
cmp    $0x3,%r15b
ja     1403 <main+0x223>
movzbl %r15b,%eax
movslq (%r14,%rax,4),%rax
add    %r14,%rax
mov    %ebx,%edi
jmp    *%rax
mov    0x8(%rsp),%edi
mov    %rbp,%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %ebx,%edi
jmp    13f3 <main+0x213>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    0x8(%rsp),%edi
mov    %rbp,%rsi
mov    $0xbc,%edx
call   10a0 <read@plt>
mov    %eax,%r12d
test   %r12d,%r12d
jle    1360 <main+0x180>
mov    0x2bdd(%rip),%rax
mov    (%rax),%edi
mov    %rbp,%rsi
mov    $0xbc,%edx
call   1060 <write@plt>
jmp    1360 <main+0x180>
mov    0x2b7a(%rip),%rbx
mov    (%rbx),%edi
lea    0xc01(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc32(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc64(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc95(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xcc3(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xcf1(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    14d4 <main+0x2f4>
mov    0x2b11(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
jmp    14c6 <main+0x2e6>
mov    %ebx,%edi
call   1090 <close@plt>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
mov    %r13d,%edi
call   1090 <close@plt>
jmp    14d4 <main+0x2f4>
mov    0x2ae8(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbp),%rdx
lea    0xb43(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2ab9(%rip),%rax
mov    (%rax),%edi
lea    0xb2c(%rip),%rsi
mov    %rbp,%rdx
jmp    14cd <main+0x2ed>
lea    0xc80(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
mov    0x2a8c(%rip),%rax
mov    (%rax),%edi
lea    0xc97(%rip),%rsi
jmp    1537 <main+0x357>
mov    0x2a7a(%rip),%rax
mov    (%rax),%edi
lea    0xca2(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    %r13d,%edi
call   1090 <close@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [20 x i8] c"Can't open file %s\0A\00"
@.str.1 = [20 x i8] c"Can't open port %s\0A\00"
@.str.2 = [22 x i8] c"Default choice is %d\0A\00"
@.str.3 = [65 x i8] c"Usage: 'tsinputswitch inputfile1.ts inputfile2.ts port default'\0A\00"
@.str.4 = [66 x i8] c"0 output from inputfile1, read and discard input from inputfile2\0A\00"
@.str.5 = [65 x i8] c"1 output from inputfile2, read and discard input from inputfil1\0A\00"
@.str.6 = [62 x i8] c"2 output from inputfile1, stop reading input from inputfile2\0A\00"
@.str.7 = [62 x i8] c"3 output from inputfile2, stop reading input from inputfile1\0A\00"
@.str.8 = [12 x i8] c"Default: 0\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.9 = [28 x i8] c"secsocket - socket() error\0A\00"
@.str.10 = [28 x i8] c"secsocket - socket() is OK\0A\00"
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.11 = [29 x i8] c"setting SO_REUSEADDR failed\0A\00"
@INADDR_ANY = global i32 0
@.str.12 = [26 x i8] c"secsocket - bind() error\0A\00"
@.str.13 = [13 x i8] c"received %d\0A\00"
@STDOUT_FILENO = global i32 0
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 i8
%10 = alloca i32
%11 = alloca [188 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca %struct.sockaddr_in
%16 = alloca i32
%17 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = icmp sge i32 %18, 5
br i1 %19, label %20, label %77
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = load i32, i32* @O_RDONLY
%25 = call i32 @open(i8* %23, i32 %24)
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %20
%29 = load i32, i32* @stderr
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %32)
store i32 0, i32* %3
br label %221
34: ; preds = %20
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = load i32, i32* @O_RDONLY
%39 = call i32 @open(i8* %37, i32 %38)
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %48
42: ; preds = %34
%43 = load i32, i32* @stderr
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %46)
store i32 0, i32* %3
br label %221
48: ; preds = %34
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 3
%51 = load i8*, i8** %50
%52 = call i8* @atoi(i8* %51)
%53 = ptrtoint i8* %52 to i32
store i32 %53, i32* %10
%54 = load i32, i32* %10
%55 = icmp sle i32 %54, 0
br i1 %55, label %56, label %62
56: ; preds = %48
%57 = load i32, i32* @stderr
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 3
%60 = load i8*, i8** %59
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %60)
store i32 0, i32* %3
br label %221
62: ; preds = %48
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 4
%65 = load i8*, i8** %64
%66 = call i8* @atoi(i8* %65)
%67 = ptrtoint i8* %66 to i8
store i8 %67, i8* %9
%68 = load i8, i8* %9
%69 = zext i8 %68 to i32
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %76
71: ; preds = %62
%72 = load i32, i32* @stderr
%73 = load i8, i8* %9
%74 = zext i8 %73 to i32
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %74)
store i32 0, i32* %3
br label %221
76: ; preds = %62
br label %90
77: ; preds = %2
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
%82 = load i32, i32* @stderr
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0))
%84 = load i32, i32* @stderr
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0))
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i64 0, i64 0))
%88 = load i32, i32* @stderr
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %3
br label %221
90: ; preds = %76
%91 = load i32, i32* @AF_INET
%92 = load i32, i32* @SOCK_DGRAM
%93 = call i32 @socket(i32 %91, i32 %92, i32 0)
store i32 %93, i32* %12
%94 = load i32, i32* %12
%95 = icmp slt i32 %94, 0
br i1 %95, label %96, label %100
96: ; preds = %90
%97 = load i32, i32* @stderr
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%99 = call i32 @exit(i32 -1)
unreachable
100: ; preds = %90
%101 = load i32, i32* @stderr
%102 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
br label %103
103: ; preds = %100
%104 = load i32, i32* %12
%105 = load i32, i32* @F_GETFL
%106 = call i32 @fcntl(i32 %104, i32 %105, i32 0)
store i32 %106, i32* %13
%107 = load i32, i32* %12
%108 = load i32, i32* @F_SETFL
%109 = load i32, i32* %13
%110 = load i32, i32* @O_NONBLOCK
%111 = or i32 %109, %110
%112 = call i32 @fcntl(i32 %107, i32 %108, i32 %111)
store i32 1, i32* %14
%113 = load i32, i32* %12
%114 = load i32, i32* @SOL_SOCKET
%115 = load i32, i32* @SO_REUSEADDR
%116 = bitcast i32* %14 to i8*
%117 = call i64 @setsockopt(i32 %113, i32 %114, i32 %115, i8* %116, i32 4)
%118 = icmp slt i64 %117, 0
br i1 %118, label %119, label %125
119: ; preds = %103
%120 = load i32, i32* @stderr
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%122 = load i32, i32* %12
%123 = call i32 @close(i32 %122)
%124 = call i32 @exit(i32 -1)
unreachable
125: ; preds = %103
%126 = call i32 @memset(%struct.sockaddr_in* %15, i32 0, i32 12)
%127 = load i32, i32* @AF_INET
%128 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 2
store i32 %127, i32* %128
%129 = load i32, i32* @INADDR_ANY
%130 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 1
%131 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %130, i32 0, i32 0
store i32 %129, i32* %131
%132 = load i32, i32* %10
%133 = call i32 @htons(i32 %132)
%134 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 0
store i32 %133, i32* %134
%135 = load i32, i32* %12
%136 = bitcast %struct.sockaddr_in* %15 to %struct.sockaddr*
%137 = call i32 @bind(i32 %135, %struct.sockaddr* %136, i32 12)
store i32 %137, i32* %16
%138 = load i32, i32* %16
%139 = icmp slt i32 %138, 0
br i1 %139, label %140, label %146
140: ; preds = %125
%141 = load i32, i32* @stderr
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %141, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0))
%143 = load i32, i32* %12
%144 = call i32 @close(i32 %143)
%145 = call i32 @exit(i32 -1)
unreachable
146: ; preds = %125
br label %147
147: ; preds = %146
store i32 1, i32* %8
store i8 0, i8* %9
store i8 0, i8* %17
br label %148
148: ; preds = %213, %147
%149 = load i32, i32* %8
%150 = icmp ne i32 %149, 0
br i1 %150, label %151, label %214
151: ; preds = %148
%152 = load i32, i32* %12
%153 = call i64 @recv(i32 %152, i8* %17, i32 1, i32 0)
%154 = icmp sgt i64 %153, 0
br i1 %154, label %155, label %165
155: ; preds = %151
%156 = load i32, i32* @stderr
%157 = load i8, i8* %17
%158 = zext i8 %157 to i32
%159 = sub nsw i32 %158, 48
%160 = call i32 (i32, i8*, ...) @fprintf(i32 %156, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %159)
%161 = load i8, i8* %17
%162 = zext i8 %161 to i32
%163 = sub nsw i32 %162, 48
%164 = trunc i32 %163 to i8
store i8 %164, i8* %9
br label %165
165: ; preds = %155, %151
%166 = load i8, i8* %9
%167 = zext i8 %166 to i32
%168 = icmp eq i32 %167, 0
br i1 %168, label %169, label %176
169: ; preds = %165
%170 = load i32, i32* %7
%171 = getelementptr inbounds [188 x i8], [188 x i8]* %11, i64 0, i64 0
%172 = call i32 @read(i32 %170, i8* %171, i32 188)
store i32 %172, i32* %8
%173 = load i32, i32* %6
%174 = getelementptr inbounds [188 x i8], [188 x i8]* %11, i64 0, i64 0
%175 = call i32 @read(i32 %173, i8* %174, i32 188)
store i32 %175, i32* %8
br label %206
176: ; preds = %165
%177 = load i8, i8* %9
%178 = zext i8 %177 to i32
%179 = icmp eq i32 %178, 1
br i1 %179, label %180, label %187
180: ; preds = %176
%181 = load i32, i32* %6
%182 = getelementptr inbounds [188 x i8], [188 x i8]* %11, i64 0, i64 0
%183 = call i32 @read(i32 %181, i8* %182, i32 188)
store i32 %183, i32* %8
%184 = load i32, i32* %7
%185 = getelementptr inbounds [188 x i8], [188 x i8]* %11, i64 0, i64 0
%186 = call i32 @read(i32 %184, i8* %185, i32 188)
store i32 %186, i32* %8
br label %205
187: ; preds = %176
%188 = load i8, i8* %9
%189 = zext i8 %188 to i32
%190 = icmp eq i32 %189, 2
br i1 %190, label %191, label %195
191: ; preds = %187
%192 = load i32, i32* %6
%193 = getelementptr inbounds [188 x i8], [188 x i8]* %11, i64 0, i64 0
%194 = call i32 @read(i32 %192, i8* %193, i32 188)
store i32 %194, i32* %8
br label %204
195: ; preds = %187
%196 = load i8, i8* %9
%197 = zext i8 %196 to i32
%198 = icmp eq i32 %197, 3
br i1 %198, label %199, label %203
199: ; preds = %195
%200 = load i32, i32* %7
%201 = getelementptr inbounds [188 x i8], [188 x i8]* %11, i64 0, i64 0
%202 = call i32 @read(i32 %200, i8* %201, i32 188)
store i32 %202, i32* %8
br label %203
203: ; preds = %199, %195
br label %204
204: ; preds = %203, %191
br label %205
205: ; preds = %204, %180
br label %206
206: ; preds = %205, %169
%207 = load i32, i32* %8
%208 = icmp sgt i32 %207, 0
br i1 %208, label %209, label %213
209: ; preds = %206
%210 = load i32, i32* @STDOUT_FILENO
%211 = getelementptr inbounds [188 x i8], [188 x i8]* %11, i64 0, i64 0
%212 = call i32 @write(i32 %210, i8* %211, i32 188)
br label %213
213: ; preds = %209, %206
br label %148
214: ; preds = %148
%215 = load i32, i32* %6
%216 = call i32 @close(i32 %215)
%217 = load i32, i32* %7
%218 = call i32 @close(i32 %217)
%219 = load i32, i32* %12
%220 = call i32 @close(i32 %219)
store i32 0, i32* %3
br label %221
221: ; preds = %214, %77, %71, %56, %42, %28
%222 = load i32, i32* %3
ret i32 %222
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [20 x i8] c"Can't open file %s\0A\00"
@.str.1 = [20 x i8] c"Can't open port %s\0A\00"
@.str.3 = [65 x i8] c"Usage: 'tsinputswitch inputfile1.ts inputfile2.ts port default'\0A\00"
@.str.4 = [66 x i8] c"0 output from inputfile1, read and discard input from inputfile2\0A\00"
@.str.5 = [65 x i8] c"1 output from inputfile2, read and discard input from inputfil1\0A\00"
@.str.6 = [62 x i8] c"2 output from inputfile1, stop reading input from inputfile2\0A\00"
@.str.7 = [62 x i8] c"3 output from inputfile2, stop reading input from inputfile1\0A\00"
@.str.8 = [12 x i8] c"Default: 0\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.9 = [28 x i8] c"secsocket - socket() error\0A\00"
@.str.10 = [28 x i8] c"secsocket - socket() is OK\0A\00"
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.11 = [29 x i8] c"setting SO_REUSEADDR failed\0A\00"
@INADDR_ANY = global i32 0
@.str.12 = [26 x i8] c"secsocket - bind() error\0A\00"
@.str.13 = [13 x i8] c"received %d\0A\00"
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [188 x i8]
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = alloca i8
%7 = getelementptr inbounds [188 x i8], [188 x i8]* %3, i64 0, i64 0
%8 = icmp sgt i32 %0, 4
br i1 %8, label %9, label %39
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i32, i32* @O_RDONLY
%13 = tail call i32 @open(i8* %11, i32 %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %10
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %132
19: ; preds = %9
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = load i32, i32* @O_RDONLY
%23 = tail call i32 @open(i8* %21, i32 %22)
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %20
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %27)
br label %132
29: ; preds = %19
%30 = getelementptr inbounds i8*, i8** %1, i64 3
%31 = load i8*, i8** %30
%32 = tail call i8* @atoi(i8* %31)
%33 = ptrtoint i8* %32 to i64
%34 = trunc i64 %33 to i32
%35 = icmp slt i32 %34, 1
br i1 %35, label %36, label %52
36: ; preds = %29
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %31)
br label %132
39: ; preds = %2
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i64 0, i64 0))
%50 = load i32, i32* @stderr
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %132
52: ; preds = %29
%53 = load i32, i32* @AF_INET
%54 = load i32, i32* @SOCK_DGRAM
%55 = tail call i32 @socket(i32 %53, i32 %54, i32 0)
%56 = icmp slt i32 %55, 0
%57 = load i32, i32* @stderr
br i1 %56, label %58, label %61
58: ; preds = %52
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%60 = tail call i32 @exit(i32 -1)
unreachable
61: ; preds = %52
%62 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%63 = load i32, i32* @F_GETFL
%64 = tail call i32 @fcntl(i32 %55, i32 %63, i32 0)
%65 = load i32, i32* @F_SETFL
%66 = load i32, i32* @O_NONBLOCK
%67 = or i32 %66, %64
%68 = tail call i32 @fcntl(i32 %55, i32 %65, i32 %67)
%69 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%70 = load i32, i32* @SOL_SOCKET
%71 = load i32, i32* @SO_REUSEADDR
%72 = call i64 @setsockopt(i32 %55, i32 %70, i32 %71, i8* %69, i32 4)
%73 = icmp slt i64 %72, 0
br i1 %73, label %74, label %79
74: ; preds = %61
%75 = load i32, i32* @stderr
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%77 = call i32 @close(i32 %55)
%78 = call i32 @exit(i32 -1)
unreachable
79: ; preds = %61
%80 = bitcast %struct.sockaddr_in* %5 to i8*
%81 = call i32 @memset(%struct.sockaddr_in* %5, i32 0, i32 12)
%82 = load i32, i32* @AF_INET
%83 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %82, i32* %83
%84 = load i32, i32* @INADDR_ANY
%85 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1, i32 0
store i32 %84, i32* %85
%86 = call i32 @htons(i32 %34)
%87 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0
store i32 %86, i32* %87
%88 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%89 = call i32 @bind(i32 %55, %struct.sockaddr* %88, i32 12)
%90 = icmp slt i32 %89, 0
br i1 %90, label %91, label %96
91: ; preds = %79
%92 = load i32, i32* @stderr
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0))
%94 = call i32 @close(i32 %55)
%95 = call i32 @exit(i32 -1)
unreachable
96: ; preds = %79
store i8 0, i8* %6
br label %97
97: ; preds = %96, %126
%98 = phi i32 [ 1, %96 ], [ %121, %126 ]
%99 = phi i8 [ 0, %96 ], [ %111, %126 ]
%100 = call i64 @recv(i32 %55, i8* %6, i32 1, i32 0)
%101 = icmp sgt i64 %100, 0
br i1 %101, label %102, label %110
102: ; preds = %97
%103 = load i32, i32* @stderr
%104 = load i8, i8* %6
%105 = zext i8 %104 to i32
%106 = add nsw i32 %105, -48
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %106)
%108 = load i8, i8* %6
%109 = add i8 %108, -48
br label %110
110: ; preds = %102, %97
%111 = phi i8 [ %109, %102 ], [ %99, %97 ]
switch i8 %111, label %120 [
i8 0, label %112
i8 1, label %114
i8 2, label %117
i8 3, label %116
]
112: ; preds = %110
%113 = call i32 @read(i32 %23, i8* %7, i32 188)
br label %117
114: ; preds = %110
%115 = call i32 @read(i32 %13, i8* %7, i32 188)
br label %117
116: ; preds = %110
br label %117
117: ; preds = %110, %112, %116, %114
%118 = phi i32 [ %23, %114 ], [ %23, %116 ], [ %13, %112 ], [ %13, %110 ]
%119 = call i32 @read(i32 %118, i8* %7, i32 188)
br label %120
120: ; preds = %117, %110
%121 = phi i32 [ %98, %110 ], [ %119, %117 ]
%122 = icmp sgt i32 %121, 0
br i1 %122, label %123, label %126
123: ; preds = %120
%124 = load i32, i32* @STDOUT_FILENO
%125 = call i32 @write(i32 %124, i8* %7, i32 188)
br label %126
126: ; preds = %123, %120
%127 = icmp eq i32 %121, 0
br i1 %127, label %128, label %97
128: ; preds = %126
%129 = call i32 @close(i32 %13)
%130 = call i32 @close(i32 %23)
%131 = call i32 @close(i32 %55)
br label %132
132: ; preds = %128, %39, %36, %25, %15
ret i32 0
}