#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 option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ const member_1;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
char *delimiter_string(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ matchsplit(char *, char **, int);
#define no_argument 129
int /*<<< orphan*/ *open_file(char *);
int /*<<< orphan*/ optarg;
int optind;
int /*<<< orphan*/ printf(char *, char *, ...);
#define required_argument 128
int /*<<< orphan*/ show_help(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
char *strerror(int /*<<< orphan*/);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char **argv) {
  FILE *input[1024];
  char line[(32 * 1024)];
  char *splitsies[(32 * 1024)];
  char *delimiter = "\"";
  char *line_delimiter = "\n";
  int option_index = 0;
  int i, j, c;
  static struct option long_options[] = {
      {"delimiter", required_argument, 0, 'd'},
      {"line-delimiter", required_argument, 0, 'l'},
      {"help", no_argument, 0, 'h'},
      {0, 0, 0, 0}};
  while (1) {
    c = getopt_long(argc, argv, "hl:d:", long_options, &option_index);
    if (c == -1) {
      break;
    }
    switch (c) {
    case 'd':
      delimiter = delimiter_string(optarg);
      if (!delimiter) {
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        exit(errno);
      }
      break;
    case 'l':
      line_delimiter = delimiter_string(optarg);
      if (!line_delimiter) {
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        exit(errno);
      }
      break;
    case 'h':
      show_help(argv[0]);
      exit(EXIT_SUCCESS);
    default:
      show_help(argv[0]);
      exit(EXIT_FAILURE);
      break;
    }
  }
  input[0] = stdin;
  input[1] = NULL;
  if (optind <= argc) {
    if (argc > 1023) {
      fprintf(stderr, "%s: too many arguments\n", argv[0]);
      exit(EXIT_FAILURE);
    }
    for (i = optind; i < argc; i++) {
      if (strncmp(argv[i], "-", 1) == 0) {
        input[i] = stdin;
        continue;
      }
      input[i - optind] = open_file(argv[i]);
      if (input[i - optind] == NULL) {
        fprintf(stderr, "%s: Could not open %s: %s\n", argv[0], argv[i],
                strerror(errno));
        exit(EXIT_FAILURE);
      }
    }
    input[i + 1] = NULL;
  }
  for (j = 0; input[j] != NULL; j++) {
    while (fgets(line, (32 * 1024), input[0]) != NULL) {
      matchsplit(line, splitsies, (32 * 1024));
      for (i = 0; splitsies[i]; i++) {
        printf("%s%s", splitsies[i], delimiter);
      }
      printf("%s", line_delimiter);
    }
    if (ferror(input[0])) {
      fprintf(stderr, "%s: error reading input: %s", argv[0], strerror(errno));
      exit(errno);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4a080,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe20(%rip),%rax
mov    %rax,-0x4a018(%rbp)
lea    0xe61(%rip),%rax
mov    %rax,-0x4a020(%rbp)
movl   $0x0,-0x4a024(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe09(%rip),%rdx
lea    0x2e7c(%rip),%rcx
lea    -0x4a024(%rbp),%r8
call   1070 <getopt_long@plt>
mov    %eax,-0x4a030(%rbp)
cmpl   $0xffffffff,-0x4a030(%rbp)
jne    1238 <main+0x78>
jmp    13b1 <main+0x1f1>
mov    -0x4a030(%rbp),%eax
mov    %eax,-0x4a034(%rbp)
sub    $0x64,%eax
je     127a <main+0xba>
jmp    1252 <main+0x92>
mov    -0x4a034(%rbp),%eax
sub    $0x68,%eax
je     1378 <main+0x1b8>
jmp    1266 <main+0xa6>
mov    -0x4a034(%rbp),%eax
sub    $0x6c,%eax
je     12f9 <main+0x139>
jmp    1392 <main+0x1d2>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
call   10b0 <delimiter_string@plt>
mov    %rax,-0x4a018(%rbp)
cmpq   $0x0,-0x4a018(%rbp)
jne    12f4 <main+0x134>
mov    0x2d24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4a044(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x4a040(%rbp)
mov    0x2cff(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x4a044(%rbp),%edi
mov    -0x4a040(%rbp),%rdx
mov    %rax,%rcx
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2cd3(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    13ac <main+0x1ec>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
call   10b0 <delimiter_string@plt>
mov    %rax,-0x4a020(%rbp)
cmpq   $0x0,-0x4a020(%rbp)
jne    1373 <main+0x1b3>
mov    0x2ca5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4a054(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x4a050(%rbp)
mov    0x2c80(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x4a054(%rbp),%edi
mov    -0x4a050(%rbp),%rdx
mov    %rax,%rcx
lea    0xceb(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2c54(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    13ac <main+0x1ec>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <show_help@plt>
mov    0x2c25(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <show_help@plt>
mov    0x2c13(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    11ff <main+0x3f>
mov    0x2c28(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x2010(%rbp)
movq   $0x0,-0x2008(%rbp)
mov    0x2c04(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jg     1572 <main+0x3b2>
cmpl   $0x3ff,-0x8(%rbp)
jle    1418 <main+0x258>
mov    0x2bd5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc19(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2ba7(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    0x2bb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4a028(%rbp)
mov    -0x4a028(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    155b <main+0x39b>
mov    -0x10(%rbp),%rax
movslq -0x4a028(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbe8(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    147e <main+0x2be>
mov    0x2b79(%rip),%rax
mov    (%rax),%rcx
movslq -0x4a028(%rbp),%rax
mov    %rcx,-0x2010(%rbp,%rax,8)
ff
jmp    1547 <main+0x387>
mov    -0x10(%rbp),%rax
movslq -0x4a028(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <open_file@plt>
mov    %rax,%rcx
mov    -0x4a028(%rbp),%eax
mov    0x2b36(%rip),%rdx
sub    (%rdx),%eax
cltq
mov    %rcx,-0x2010(%rbp,%rax,8)
ff
mov    -0x4a028(%rbp),%eax
mov    0x2b1d(%rip),%rcx
sub    (%rcx),%eax
cltq
cmpq   $0x0,-0x2010(%rbp,%rax,8)
jne    1542 <main+0x382>
mov    0x2af3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4a06c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x4a068(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4a028(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x4a060(%rbp)
mov    0x2ab8(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x4a06c(%rbp),%edi
mov    -0x4a068(%rbp),%rdx
mov    -0x4a060(%rbp),%rcx
mov    %rax,%r8
lea    0xb09(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2a7d(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1547 <main+0x387>
mov    -0x4a028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4a028(%rbp)
jmp    1427 <main+0x267>
mov    -0x4a028(%rbp),%eax
add    $0x1,%eax
cltq
movq   $0x0,-0x2010(%rbp,%rax,8)
movl   $0x0,-0x4a02c(%rbp)
movslq -0x4a02c(%rbp),%rax
cmpq   $0x0,-0x2010(%rbp,%rax,8)
je     16c9 <main+0x509>
jmp    1597 <main+0x3d7>
lea    -0xa010(%rbp),%rdi
mov    -0x2010(%rbp),%rdx
mov    $0x8000,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     1643 <main+0x483>
lea    -0xa010(%rbp),%rdi
lea    -0x4a010(%rbp),%rsi
mov    $0x8000,%edx
call   1030 <matchsplit@plt>
movl   $0x0,-0x4a028(%rbp)
movslq -0x4a028(%rbp),%rax
cmpq   $0x0,-0x4a010(%rbp,%rax,8)
je     1629 <main+0x469>
movslq -0x4a028(%rbp),%rax
mov    -0x4a010(%rbp,%rax,8),%rsi
ff
mov    -0x4a018(%rbp),%rdx
lea    0xa43(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x4a028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4a028(%rbp)
jmp    15db <main+0x41b>
mov    -0x4a020(%rbp),%rsi
lea    0xa38(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1597 <main+0x3d7>
mov    -0x2010(%rbp),%rdi
call   1050 <ferror@plt>
cmp    $0x0,%rax
je     16b0 <main+0x4f0>
mov    0x2968(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4a07c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x4a078(%rbp)
mov    0x2943(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x4a07c(%rbp),%edi
mov    -0x4a078(%rbp),%rdx
mov    %rax,%rcx
lea    0x9bb(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2917(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    16b5 <main+0x4f5>
mov    -0x4a02c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4a02c(%rbp)
jmp    157c <main+0x3bc>
xor    %eax,%eax
add    $0x4a080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4a028,%rsp
mov    %rsi,(%rsp)
mov    %edi,%r12d
movl   $0x0,0xc(%rsp)
lea    0xe19(%rip),%rbx
lea    0xe61(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe1c(%rip),%r14
lea    0x2e8f(%rip),%r15
lea    0xc(%rsp),%rbp
mov    0x2deb(%rip),%r13
nopl   (%rax)
mov    %r12d,%edi
mov    (%rsp),%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %rbp,%r8
call   1070 <getopt_long@plt>
cmp    $0x64,%eax
jne    123d <main+0x7d>
mov    0x0(%r13),%edi
call   10b0 <delimiter_string@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1210 <main+0x50>
jmp    125e <main+0x9e>
cmp    $0xffffffff,%eax
je     1289 <main+0xc9>
cmp    $0x6c,%eax
jne    1486 <main+0x2c6>
mov    0x0(%r13),%edi
call   10b0 <delimiter_string@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
jne    1210 <main+0x50>
mov    0x2d63(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%rax
mov    (%rax),%rbp
mov    0x2d4b(%rip),%r14
mov    (%r14),%edi
call   10e0 <strerror@plt>
lea    0xdc5(%rip),%rsi
jmp    14e5 <main+0x325>
mov    0x2d50(%rip),%rax
mov    (%rax),%r13
mov    %r13,0x20(%rsp)
movq   $0x0,0x28(%rsp)
mov    0x2d30(%rip),%rax
mov    (%rax),%eax
cmp    %r12d,%eax
jg     13a1 <main+0x1e1>
cmp    $0x3ff,%r12d
jg     14fc <main+0x33c>
cmp    %r12d,%eax
jge    1391 <main+0x1d1>
movslq %eax,%rcx
lea    (%rsp,%rcx,8),%r14
add    $0x20,%r14
mov    (%rsp),%rdx
lea    (%rdx,%rcx,8),%rbp
mov    %r12d,%r13d
sub    %eax,%r13d
xor    %r15d,%r15d
jmp    130b <main+0x14b>
nopw   0x0(%rax,%rax,1)
mov    0x2ce9(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%r14,%r15,8)
add    $0x1,%r15
cmp    %r15d,%r13d
je     138e <main+0x1ce>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xd1d(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12f0 <main+0x130>
mov    0x0(%rbp,%r15,8),%rdi
call   1060 <open_file@plt>
mov    0x2ca1(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
mov    %r14,%rdx
sub    %rcx,%rdx
mov    %rax,(%rdx,%r15,8)
test   %rax,%rax
jne    12fe <main+0x13e>
mov    0x2c74(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%rax
mov    (%rax),%r12
mov    0x0(%rbp,%r15,8),%r14
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xcbf(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    14b1 <main+0x2f1>
mov    %r12d,%eax
cltq
movq   $0x0,0x28(%rsp,%rax,8)
mov    0x20(%rsp),%r13
test   %r13,%r13
je     1472 <main+0x2b2>
lea    0x2020(%rsp),%rbp
lea    0xcb6(%rip),%r14
lea    0xc91(%rip),%r15
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,0x18(%rsp)
jmp    13ef <main+0x22f>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    $0x8000,%esi
mov    %r13,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     1450 <main+0x290>
mov    %rbp,%rdi
lea    0xa020(%rsp),%rsi
mov    $0x8000,%edx
call   1030 <matchsplit@plt>
mov    0xa020(%rsp),%rsi
test   %rsi,%rsi
je     13e0 <main+0x220>
lea    0xa028(%rsp),%r12
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r12),%rsi
add    $0x8,%r12
test   %rsi,%rsi
jne    1430 <main+0x270>
jmp    13e0 <main+0x220>
nopl   0x0(%rax)
mov    %r13,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
jne    14bf <main+0x2ff>
mov    0x18(%rsp),%rax
add    $0x1,%rax
cmpq   $0x0,0x20(%rsp,%rax,8)
jne    13d0 <main+0x210>
xor    %eax,%eax
add    $0x4a028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x68,%eax
jne    14a5 <main+0x2e5>
mov    (%rsp),%rax
mov    (%rax),%rdi
call   10c0 <show_help@plt>
mov    0x2b12(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    (%rsp),%rax
mov    (%rax),%rdi
call   10c0 <show_help@plt>
mov    0x2b00(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    0x2b02(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%rax
mov    (%rax),%rbp
mov    0x2aea(%rip),%r14
mov    (%r14),%edi
call   10e0 <strerror@plt>
lea    0xb71(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    (%r14),%edi
call   10d0 <exit@plt>
mov    0x2ac5(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    (%rax),%rdx
lea    0xb09(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    14b1 <main+0x2f1>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32, i32 }
@.str = [2 x i8] c"\22\00"
@.str.1 = [2 x i8] c"\0A\00"
@main.long_options = internal global [4 x %struct.option] [%struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32 0, i32 100 }, %struct.option { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i32 0, i32 0), i8 -128, i32 0, i32 108 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 -127, i32 0, i32 104 }, %struct.option zeroinitializer]
@.str.2 = [10 x i8] c"delimiter\00"
@.str.3 = [15 x i8] c"line-delimiter\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [6 x i8] c"hl:d:\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.6 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
@stdin = global i32* null
@optind = global i32 0
@.str.7 = [24 x i8] c"%s: too many arguments\0A\00"
@.str.8 = [2 x i8] c"-\00"
@.str.9 = [27 x i8] c"%s: Could not open %s: %s\0A\00"
@.str.10 = [5 x i8] c"%s%s\00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [28 x i8] c"%s: error reading input: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i32*]
%7 = alloca [32768 x i8]
%8 = alloca [32768 x i8*]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %10
store i32 0, i32* %11
br label %15
15: ; preds = %2, %70
%16 = load i32, i32* %4
%17 = load i8**, i8*** %5
%18 = call i32 @getopt_long(i32 %16, i8** %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %struct.option* getelementptr inbounds ([4 x %struct.option], [4 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %11)
store i32 %18, i32* %14
%19 = load i32, i32* %14
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %22
21: ; preds = %15
br label %71
22: ; preds = %15
%23 = load i32, i32* %14
switch i32 %23, label %63 [
i32 100, label %24
i32 108, label %40
i32 104, label %56
]
24: ; preds = %22
%25 = load i32, i32* @optarg
%26 = call i8* @delimiter_string(i32 %25)
store i8* %26, i8** %9
%27 = load i8*, i8** %9
%28 = icmp ne i8* %27, null
br i1 %28, label %39, label %29
29: ; preds = %24
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %33, i8* %35)
%37 = load i32, i32* @errno
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %24
br label %70
40: ; preds = %22
%41 = load i32, i32* @optarg
%42 = call i8* @delimiter_string(i32 %41)
store i8* %42, i8** %10
%43 = load i8*, i8** %10
%44 = icmp ne i8* %43, null
br i1 %44, label %55, label %45
45: ; preds = %40
%46 = load i32, i32* @stderr
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 0
%49 = load i8*, i8** %48
%50 = load i32, i32* @errno
%51 = call i8* @strerror(i32 %50)
%52 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %49, i8* %51)
%53 = load i32, i32* @errno
%54 = call i32 @exit(i32 %53)
unreachable
55: ; preds = %40
br label %70
56: ; preds = %22
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 0
%59 = load i8*, i8** %58
%60 = call i32 @show_help(i8* %59)
%61 = load i32, i32* @EXIT_SUCCESS
%62 = call i32 @exit(i32 %61)
unreachable
63: ; preds = %22
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = call i32 @show_help(i8* %66)
%68 = load i32, i32* @EXIT_FAILURE
%69 = call i32 @exit(i32 %68)
unreachable
70: ; preds = %55, %39
br label %15
71: ; preds = %21
%72 = load i32*, i32** @stdin
%73 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 0
store i32* %72, i32** %73
%74 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 1
store i32* null, i32** %74
%75 = load i32, i32* @optind
%76 = load i32, i32* %4
%77 = icmp sle i32 %75, %76
br i1 %77, label %78, label %151
78: ; preds = %71
%79 = load i32, i32* %4
%80 = icmp sgt i32 %79, 1023
br i1 %80, label %81, label %89
81: ; preds = %78
%82 = load i32, i32* @stderr
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 0
%85 = load i8*, i8** %84
%86 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %85)
%87 = load i32, i32* @EXIT_FAILURE
%88 = call i32 @exit(i32 %87)
unreachable
89: ; preds = %78
%90 = load i32, i32* @optind
store i32 %90, i32* %12
br label %91
91: ; preds = %143, %89
%92 = load i32, i32* %12
%93 = load i32, i32* %4
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %146
95: ; preds = %91
%96 = load i8**, i8*** %5
%97 = load i32, i32* %12
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %96, i64 %98
%100 = load i8*, i8** %99
%101 = call i64 @strncmp(i8* %100, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 1)
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %108
103: ; preds = %95
%104 = load i32*, i32** @stdin
%105 = load i32, i32* %12
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 %106
store i32* %104, i32** %107
br label %143
108: ; preds = %95
%109 = load i8**, i8*** %5
%110 = load i32, i32* %12
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8*, i8** %109, i64 %111
%113 = load i8*, i8** %112
%114 = call i32* @open_file(i8* %113)
%115 = load i32, i32* %12
%116 = load i32, i32* @optind
%117 = sub nsw i32 %115, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 %118
store i32* %114, i32** %119
%120 = load i32, i32* %12
%121 = load i32, i32* @optind
%122 = sub nsw i32 %120, %121
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 %123
%125 = load i32*, i32** %124
%126 = icmp eq i32* %125, null
br i1 %126, label %127, label %142
127: ; preds = %108
%128 = load i32, i32* @stderr
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 0
%131 = load i8*, i8** %130
%132 = load i8**, i8*** %5
%133 = load i32, i32* %12
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8*, i8** %132, i64 %134
%136 = load i8*, i8** %135
%137 = load i32, i32* @errno
%138 = call i8* @strerror(i32 %137)
%139 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %131, i8* %136, i8* %138)
%140 = load i32, i32* @EXIT_FAILURE
%141 = call i32 @exit(i32 %140)
unreachable
142: ; preds = %108
br label %143
143: ; preds = %142, %103
%144 = load i32, i32* %12
%145 = add nsw i32 %144, 1
store i32 %145, i32* %12
br label %91
146: ; preds = %91
%147 = load i32, i32* %12
%148 = add nsw i32 %147, 1
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 %149
store i32* null, i32** %150
br label %151
151: ; preds = %146, %71
store i32 0, i32* %13
br label %152
152: ; preds = %204, %151
%153 = load i32, i32* %13
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 %154
%156 = load i32*, i32** %155
%157 = icmp ne i32* %156, null
br i1 %157, label %158, label %207
158: ; preds = %152
br label %159
159: ; preds = %185, %158
%160 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 0
%161 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 0
%162 = load i32*, i32** %161
%163 = call i32* @fgets(i8* %160, i32 32768, i32* %162)
%164 = icmp ne i32* %163, null
br i1 %164, label %165, label %188
165: ; preds = %159
%166 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 0
%167 = getelementptr inbounds [32768 x i8*], [32768 x i8*]* %8, i64 0, i64 0
%168 = call i32 @matchsplit(i8* %166, i8** %167, i32 32768)
store i32 0, i32* %12
br label %169
169: ; preds = %182, %165
%170 = load i32, i32* %12
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [32768 x i8*], [32768 x i8*]* %8, i64 0, i64 %171
%173 = load i8*, i8** %172
%174 = icmp ne i8* %173, null
br i1 %174, label %175, label %185
175: ; preds = %169
%176 = load i32, i32* %12
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [32768 x i8*], [32768 x i8*]* %8, i64 0, i64 %177
%179 = load i8*, i8** %178
%180 = load i8*, i8** %9
%181 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %179, i8* %180)
br label %182
182: ; preds = %175
%183 = load i32, i32* %12
%184 = add nsw i32 %183, 1
store i32 %184, i32* %12
br label %169
185: ; preds = %169
%186 = load i8*, i8** %10
%187 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %186)
br label %159
188: ; preds = %159
%189 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %6, i64 0, i64 0
%190 = load i32*, i32** %189
%191 = call i64 @ferror(i32* %190)
%192 = icmp ne i64 %191, 0
br i1 %192, label %193, label %203
193: ; preds = %188
%194 = load i32, i32* @stderr
%195 = load i8**, i8*** %5
%196 = getelementptr inbounds i8*, i8** %195, i64 0
%197 = load i8*, i8** %196
%198 = load i32, i32* @errno
%199 = call i8* @strerror(i32 %198)
%200 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %194, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i8* %197, i8* %199)
%201 = load i32, i32* @errno
%202 = call i32 @exit(i32 %201)
unreachable
203: ; preds = %188
br label %204
204: ; preds = %203
%205 = load i32, i32* %13
%206 = add nsw i32 %205, 1
store i32 %206, i32* %13
br label %152
207: ; preds = %152
ret i32 0
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32, i32 }
@.str = [2 x i8] c"\22\00"
@.str.1 = [2 x i8] c"\0A\00"
@main.long_options = internal global [4 x %struct.option] [%struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32 0, i32 100 }, %struct.option { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i32 0, i32 0), i8 -128, i32 0, i32 108 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 -127, i32 0, i32 104 }, %struct.option zeroinitializer]
@.str.2 = [10 x i8] c"delimiter\00"
@.str.3 = [15 x i8] c"line-delimiter\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [6 x i8] c"hl:d:\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.6 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
@stdin = global i32* null
@optind = global i32 0
@.str.7 = [24 x i8] c"%s: too many arguments\0A\00"
@.str.8 = [2 x i8] c"-\00"
@.str.9 = [27 x i8] c"%s: Could not open %s: %s\0A\00"
@.str.10 = [5 x i8] c"%s%s\00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [28 x i8] c"%s: error reading input: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [1024 x i32*]
%4 = alloca [32768 x i8]
%5 = alloca [32768 x i8*]
%6 = alloca i32
%7 = bitcast [1024 x i32*]* %3 to i8*
%8 = getelementptr inbounds [32768 x i8], [32768 x i8]* %4, i64 0, i64 0
%9 = bitcast [32768 x i8*]* %5 to i8*
%10 = bitcast i32* %6 to i8*
store i32 0, i32* %6
br label %11
11: ; preds = %29, %2
%12 = phi i8* [ %31, %29 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %2 ]
%13 = phi i8* [ %15, %29 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
br label %14
14: ; preds = %11, %17
%15 = phi i8* [ %19, %17 ], [ %13, %11 ]
%16 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %struct.option* getelementptr inbounds ([4 x %struct.option], [4 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %6)
switch i32 %16, label %46 [
i32 -1, label %51
i32 100, label %17
i32 108, label %29
i32 104, label %41
]
17: ; preds = %14
%18 = load i32, i32* @optarg
%19 = call i8* @delimiter_string(i32 %18)
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %14
21: ; preds = %17
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %1
%24 = load i32, i32* @errno
%25 = call i8* @strerror(i32 %24)
%26 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %23, i8* %25)
%27 = load i32, i32* @errno
%28 = call i32 @exit(i32 %27)
unreachable
29: ; preds = %14
%30 = load i32, i32* @optarg
%31 = call i8* @delimiter_string(i32 %30)
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %11
33: ; preds = %29
%34 = load i32, i32* @stderr
%35 = load i8*, i8** %1
%36 = load i32, i32* @errno
%37 = call i8* @strerror(i32 %36)
%38 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %35, i8* %37)
%39 = load i32, i32* @errno
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %14
%42 = load i8*, i8** %1
%43 = call i32 @show_help(i8* %42)
%44 = load i32, i32* @EXIT_SUCCESS
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %14
%47 = load i8*, i8** %1
%48 = call i32 @show_help(i8* %47)
%49 = load i32, i32* @EXIT_FAILURE
%50 = call i32 @exit(i32 %49)
unreachable
51: ; preds = %14
%52 = load i32*, i32** @stdin
%53 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %3, i64 0, i64 0
store i32* %52, i32** %53
%54 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %3, i64 0, i64 1
store i32* null, i32** %54
%55 = load i32, i32* @optind
%56 = icmp sgt i32 %55, %0
br i1 %56, label %105, label %57
57: ; preds = %51
%58 = icmp sgt i32 %0, 1023
br i1 %58, label %63, label %59
59: ; preds = %57
%60 = icmp slt i32 %55, %0
br i1 %60, label %61, label %99
61: ; preds = %59
%62 = sext i32 %55 to i64
br label %69
63: ; preds = %57
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %1
%66 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %65)
%67 = load i32, i32* @EXIT_FAILURE
%68 = call i32 @exit(i32 %67)
unreachable
69: ; preds = %61, %95
%70 = phi i64 [ %62, %61 ], [ %96, %95 ]
%71 = getelementptr inbounds i8*, i8** %1, i64 %70
%72 = load i8*, i8** %71
%73 = call i64 @strncmp(i8* %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 1)
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %69
%76 = load i32*, i32** @stdin
%77 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %3, i64 0, i64 %70
store i32* %76, i32** %77
br label %95
78: ; preds = %69
%79 = load i8*, i8** %71
%80 = call i32* @open_file(i8* %79)
%81 = load i32, i32* @optind
%82 = sext i32 %81 to i64
%83 = sub nsw i64 %70, %82
%84 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %3, i64 0, i64 %83
store i32* %80, i32** %84
%85 = icmp eq i32* %80, null
br i1 %85, label %86, label %95
86: ; preds = %78
%87 = load i32, i32* @stderr
%88 = load i8*, i8** %1
%89 = load i8*, i8** %71
%90 = load i32, i32* @errno
%91 = call i8* @strerror(i32 %90)
%92 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %88, i8* %89, i8* %91)
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %78, %75
%96 = add nsw i64 %70, 1
%97 = trunc i64 %96 to i32
%98 = icmp eq i32 %97, %0
br i1 %98, label %99, label %69
99: ; preds = %95, %59
%100 = phi i32 [ %55, %59 ], [ %0, %95 ]
%101 = add nsw i32 %100, 1
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %3, i64 0, i64 %102
store i32* null, i32** %103
%104 = load i32*, i32** %53
br label %105
105: ; preds = %99, %51
%106 = phi i32* [ %104, %99 ], [ %52, %51 ]
%107 = icmp eq i32* %106, null
br i1 %107, label %146, label %108
108: ; preds = %105
%109 = getelementptr inbounds [32768 x i8*], [32768 x i8*]* %5, i64 0, i64 0
br label %114
110: ; preds = %134
%111 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* %3, i64 0, i64 %137
%112 = load i32*, i32** %111
%113 = icmp eq i32* %112, null
br i1 %113, label %146, label %114
114: ; preds = %108, %110
%115 = phi i64 [ 0, %108 ], [ %137, %110 ]
%116 = call i32* @fgets(i8* %8, i32 32768, i32* %106)
%117 = icmp eq i32* %116, null
br i1 %117, label %134, label %118
118: ; preds = %114, %130
%119 = call i32 @matchsplit(i8* %8, i8** %109, i32 32768)
%120 = load i8*, i8** %109
%121 = icmp eq i8* %120, null
br i1 %121, label %130, label %122
122: ; preds = %118, %122
%123 = phi i64 [ %126, %122 ], [ 0, %118 ]
%124 = phi i8* [ %128, %122 ], [ %120, %118 ]
%125 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %124, i8* %15)
%126 = add nuw i64 %123, 1
%127 = getelementptr inbounds [32768 x i8*], [32768 x i8*]* %5, i64 0, i64 %126
%128 = load i8*, i8** %127
%129 = icmp eq i8* %128, null
br i1 %129, label %130, label %122
130: ; preds = %122, %118
%131 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %12)
%132 = call i32* @fgets(i8* %8, i32 32768, i32* %106)
%133 = icmp eq i32* %132, null
br i1 %133, label %134, label %118
134: ; preds = %130, %114
%135 = call i64 @ferror(i32* %106)
%136 = icmp eq i64 %135, 0
%137 = add nuw i64 %115, 1
br i1 %136, label %110, label %138
138: ; preds = %134
%139 = load i32, i32* @stderr
%140 = load i8*, i8** %1
%141 = load i32, i32* @errno
%142 = call i8* @strerror(i32 %141)
%143 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %139, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i8* %140, i8* %142)
%144 = load i32, i32* @errno
%145 = call i32 @exit(i32 %144)
unreachable
146: ; preds = %110, %105
ret i32 0
}