#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_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int we_wordc;
  int /*<<< orphan*/ *we_wordv;
};
typedef TYPE_1__ wordexp_t;
typedef int ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
#define WRDE_BADCHAR 132
#define WRDE_BADVAL 131
#define WRDE_CMDSUB 130
#define WRDE_NOSPACE 129
int WRDE_SHOWERR;
#define WRDE_SYNTAX 128
int WRDE_UNDEF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memmove(char **, char **, int);
scalar_t__ realloc(char **, int);
int /*<<< orphan*/ stderr;
char *strdup(int /*<<< orphan*/);
int strlen(char *);
int wordexp(char *, TYPE_1__ *, int);
int /*<<< orphan*/ wordfree(TYPE_1__ *);
int config_file_read(FILE *fp, int *argc, char ***argv) {
  char *line = NULL;
  size_t len = 0;
  ssize_t read;
  wordexp_t p;
  int ret;
  size_t i;
  int item_count;
  int new_items = 0;
  item_count = *argc;
  while ((read = getline(&line, &len, fp)) != -1) {
    if (line[0] == '#' || line[0] == ';')
      continue;
    if (line[strlen(line) - 1] == '\n')
      line[strlen(line) - 1] = '\0';
    ret = wordexp(line, &p, WRDE_SHOWERR | WRDE_UNDEF);
    if (ret != 0) {
      switch (ret) {
      case WRDE_BADCHAR:
        fprintf(stderr, "wordexp: WRDE_BADCHAR\n");
        break;
      case WRDE_BADVAL:
        fprintf(stderr, "wordexp: WRDE_BADVAL\n");
        break;
      case WRDE_CMDSUB:
        fprintf(stderr, "wordexp: WRDE_CMDSUB\n");
        break;
      case WRDE_NOSPACE:
        fprintf(stderr, "wordexp: WRDE_NOSPACE\n");
        break;
      case WRDE_SYNTAX:
        fprintf(stderr, "wordexp: WRDE_SYNTAX\n");
        break;
      }
      wordfree(&p);
      continue;
    }
    if (p.we_wordc > 0) {
      new_items = p.we_wordc;
      item_count += p.we_wordc;
      *argv = (char **)realloc(*argv, sizeof(char *) * (item_count + 1));
      memmove((*argv) + p.we_wordc + 1, (*argv) + 1,
              sizeof(char *) * (*argc - 1));
      *argc += p.we_wordc;
      for (i = 0; i < p.we_wordc; i++) {
        (*argv)[i + 1] = strdup(p.we_wordv[i]);
      }
    }
    wordfree(&p);
  }
  free(line);
  return new_items;
}


x86 assembly (clang, -O0):
<config_file_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1080 <getline@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     1410 <config_file_read+0x280>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1201 <config_file_read+0x71>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    1206 <config_file_read+0x76>
jmp    11c4 <config_file_read+0x34>
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1251 <config_file_read+0xc1>
mov    -0x20(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    0x2d8c(%rip),%rax
mov    (%rax),%edx
mov    0x2d6b(%rip),%rax
or     (%rax),%edx
lea    -0x40(%rbp),%rsi
call   10a0 <wordexp@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     1331 <config_file_read+0x1a1>
mov    -0x44(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x70(%rbp)
sub    $0x4,%eax
ja     1323 <config_file_read+0x193>
mov    -0x70(%rbp),%rax
lea    0xd63(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d2b(%rip),%rax
mov    (%rax),%edi
lea    0xd5e(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1323 <config_file_read+0x193>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
lea    0xd5b(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1323 <config_file_read+0x193>
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
lea    0xd57(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1323 <config_file_read+0x193>
mov    0x2cdd(%rip),%rax
mov    (%rax),%edi
lea    0xd53(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1323 <config_file_read+0x193>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
lea    0xd50(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0x40(%rbp),%rdi
call   1090 <wordfree@plt>
jmp    11c4 <config_file_read+0x34>
cmpl   $0x0,-0x40(%rbp)
jle    1402 <config_file_read+0x272>
mov    -0x40(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x40(%rbp),%eax
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x54(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   1060 <realloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
movslq -0x40(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0x8,%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
add    $0x8,%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1070 <memmove@plt>
mov    -0x40(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x40(%rbp),%rcx
cmp    %rcx,%rax
jae    13fd <config_file_read+0x26d>
mov    -0x38(%rbp),%rax
mov    -0x50(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   10b0 <strdup@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x50(%rbp),%rcx
mov    %rdx,0x8(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    13b8 <config_file_read+0x228>
jmp    1402 <config_file_read+0x272>
lea    -0x40(%rbp),%rdi
call   1090 <wordfree@plt>
jmp    11c4 <config_file_read+0x34>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_file_read>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rdi,%r14
movq   $0x0,0x8(%rsp)
movq   $0x0,0x38(%rsp)
mov    (%rsi),%r15d
lea    0x8(%rsp),%rdi
lea    0x38(%rsp),%rsi
mov    %r14,%rdx
call   1080 <getline@plt>
cmp    $0xffffffff,%eax
je     13c4 <config_file_read+0x234>
mov    %r15,0x30(%rsp)
mov    %rbp,0x40(%rsp)
mov    %rbx,0x28(%rsp)
xor    %r15d,%r15d
lea    0x8(%rsp),%r12
lea    0x38(%rsp),%r13
mov    0x2dee(%rip),%rbp
mov    0x2dcf(%rip),%rbx
mov    %r15,0x10(%rsp)
jmp    123f <config_file_read+0xaf>
lea    0xe5f(%rip),%rsi
nop
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
call   1050 <fprintf@plt>
lea    0x18(%rsp),%rdi
call   1090 <wordfree@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1080 <getline@plt>
cmp    $0xffffffff,%eax
je     13bd <config_file_read+0x22d>
mov    0x8(%rsp),%r15
movzbl (%r15),%eax
cmp    $0x3b,%al
je     1228 <config_file_read+0x98>
cmp    $0x23,%al
je     1228 <config_file_read+0x98>
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%r15,1)
jne    1282 <config_file_read+0xf2>
mov    %rbx,%r15
mov    %rbp,%rbx
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbx,%rbp
mov    %r15,%rbx
mov    0x8(%rsp),%rdi
mov    (%rbx),%edx
or     0x0(%rbp),%edx
lea    0x18(%rsp),%rsi
call   10a0 <wordexp@plt>
lea    -0x80(%rax),%ecx
cmp    $0x4,%ecx
ja     12c1 <config_file_read+0x131>
lea    0xd5b(%rip),%rdx
movslq (%rdx,%rcx,4),%rax
add    %rdx,%rax
lea    0xd61(%rip),%rsi
jmp    *%rax
lea    0xd9b(%rip),%rsi
jmp    1210 <config_file_read+0x80>
test   %eax,%eax
jne    121e <config_file_read+0x8e>
jmp    12e3 <config_file_read+0x153>
lea    0xd6f(%rip),%rsi
jmp    1210 <config_file_read+0x80>
lea    0xd4d(%rip),%rsi
jmp    1210 <config_file_read+0x80>
mov    0x18(%rsp),%r15d
test   %r15d,%r15d
jle    138c <config_file_read+0x1fc>
mov    0x30(%rsp),%rax
add    %r15d,%eax
mov    0x28(%rsp),%rbp
mov    0x0(%rbp),%rdi
mov    %rax,0x30(%rsp)
lea    0x8(,%rax,8),%esi
call   1060 <realloc@plt>
mov    %rax,0x0(%rbp)
movslq 0x18(%rsp),%rcx
lea    (%rax,%rcx,8),%rdi
add    $0x8,%rdi
lea    0x8(%rax),%rsi
mov    0x40(%rsp),%rbp
mov    0x0(%rbp),%eax
lea    -0x8(,%rax,8),%edx
call   1070 <memmove@plt>
mov    0x18(%rsp),%eax
add    %eax,0x0(%rbp)
test   %eax,%eax
je     1393 <config_file_read+0x203>
mov    %r15d,0x10(%rsp)
xor    %ebp,%ebp
mov    0x28(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x20(%rsp),%rax
mov    (%rax,%rbp,4),%edi
call   10b0 <strdup@plt>
mov    (%r15),%rcx
mov    %rax,0x8(%rcx,%rbp,8)
add    $0x1,%rbp
movslq 0x18(%rsp),%rax
cmp    %rax,%rbp
jb     1360 <config_file_read+0x1d0>
mov    0x10(%rsp),%eax
mov    %eax,%r15d
jmp    1393 <config_file_read+0x203>
mov    0x10(%rsp),%r15
jmp    139a <config_file_read+0x20a>
mov    0x2c4e(%rip),%rbp
lea    0x18(%rsp),%rdi
call   1090 <wordfree@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1080 <getline@plt>
cmp    $0xffffffff,%eax
jne    1201 <config_file_read+0x71>
jmp    13c7 <config_file_read+0x237>
mov    0x10(%rsp),%r15
jmp    13c7 <config_file_read+0x237>
xor    %r15d,%r15d
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r15d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32* }
@WRDE_SHOWERR = global i32 0
@WRDE_UNDEF = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"wordexp: WRDE_BADCHAR\0A\00"
@.str.1 = [22 x i8] c"wordexp: WRDE_BADVAL\0A\00"
@.str.2 = [22 x i8] c"wordexp: WRDE_CMDSUB\0A\00"
@.str.3 = [23 x i8] c"wordexp: WRDE_NOSPACE\0A\00"
@.str.4 = [22 x i8] c"wordexp: WRDE_SYNTAX\0A\00"
define i32 @config_file_read(i32* %0, i32* %1, i8*** %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8***
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca %struct.TYPE_4__
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8*** %2, i8**** %6
store i8* null, i8** %7
store i64 0, i64* %8
store i32 0, i32* %14
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
store i32 %16, i32* %13
br label %17
17: ; preds = %143, %76, %33, %3
%18 = load i32*, i32** %4
%19 = call i32 @getline(i8** %7, i64* %8, i32* %18)
store i32 %19, i32* %9
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %145
21: ; preds = %17
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 35
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i8*, i8** %7
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 59
br i1 %32, label %33, label %34
33: ; preds = %27, %21
br label %17
34: ; preds = %27
%35 = load i8*, i8** %7
%36 = load i8*, i8** %7
%37 = call i32 @strlen(i8* %36)
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %35, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 10
br i1 %43, label %44, label %51
44: ; preds = %34
%45 = load i8*, i8** %7
%46 = load i8*, i8** %7
%47 = call i32 @strlen(i8* %46)
%48 = sub nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %45, i64 %49
store i8 0, i8* %50
br label %51
51: ; preds = %44, %34
%52 = load i8*, i8** %7
%53 = load i32, i32* @WRDE_SHOWERR
%54 = load i32, i32* @WRDE_UNDEF
%55 = or i32 %53, %54
%56 = call i32 @wordexp(i8* %52, %struct.TYPE_4__* %10, i32 %55)
store i32 %56, i32* %11
%57 = load i32, i32* %11
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %78
59: ; preds = %51
%60 = load i32, i32* %11
switch i32 %60, label %76 [
i32 132, label %61
i32 131, label %64
i32 130, label %67
i32 129, label %70
i32 128, label %73
]
61: ; preds = %59
%62 = load i32, i32* @stderr
%63 = call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %76
64: ; preds = %59
%65 = load i32, i32* @stderr
%66 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %76
67: ; preds = %59
%68 = load i32, i32* @stderr
%69 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %76
70: ; preds = %59
%71 = load i32, i32* @stderr
%72 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %76
73: ; preds = %59
%74 = load i32, i32* @stderr
%75 = call i32 @fprintf(i32 %74, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %76
76: ; preds = %59, %73, %70, %67, %64, %61
%77 = call i32 @wordfree(%struct.TYPE_4__* %10)
br label %17
78: ; preds = %51
%79 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%80 = load i32, i32* %79
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %143
82: ; preds = %78
%83 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%84 = load i32, i32* %83
store i32 %84, i32* %14
%85 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%86 = load i32, i32* %85
%87 = load i32, i32* %13
%88 = add nsw i32 %87, %86
store i32 %88, i32* %13
%89 = load i8***, i8**** %6
%90 = load i8**, i8*** %89
%91 = load i32, i32* %13
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = mul i64 8, %93
%95 = trunc i64 %94 to i32
%96 = call i64 @realloc(i8** %90, i32 %95)
%97 = inttoptr i64 %96 to i8**
%98 = load i8***, i8**** %6
store i8** %97, i8*** %98
%99 = load i8***, i8**** %6
%100 = load i8**, i8*** %99
%101 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%102 = load i32, i32* %101
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8*, i8** %100, i64 %103
%105 = getelementptr inbounds i8*, i8** %104, i64 1
%106 = load i8***, i8**** %6
%107 = load i8**, i8*** %106
%108 = getelementptr inbounds i8*, i8** %107, i64 1
%109 = load i32*, i32** %5
%110 = load i32, i32* %109
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = mul i64 8, %112
%114 = trunc i64 %113 to i32
%115 = call i32 @memmove(i8** %105, i8** %108, i32 %114)
%116 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%117 = load i32, i32* %116
%118 = load i32*, i32** %5
%119 = load i32, i32* %118
%120 = add nsw i32 %119, %117
store i32 %120, i32* %118
store i64 0, i64* %12
br label %121
121: ; preds = %139, %82
%122 = load i64, i64* %12
%123 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%124 = load i32, i32* %123
%125 = sext i32 %124 to i64
%126 = icmp ult i64 %122, %125
br i1 %126, label %127, label %142
127: ; preds = %121
%128 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 1
%129 = load i32*, i32** %128
%130 = load i64, i64* %12
%131 = getelementptr inbounds i32, i32* %129, i64 %130
%132 = load i32, i32* %131
%133 = call i8* @strdup(i32 %132)
%134 = load i8***, i8**** %6
%135 = load i8**, i8*** %134
%136 = load i64, i64* %12
%137 = add i64 %136, 1
%138 = getelementptr inbounds i8*, i8** %135, i64 %137
store i8* %133, i8** %138
br label %139
139: ; preds = %127
%140 = load i64, i64* %12
%141 = add i64 %140, 1
store i64 %141, i64* %12
br label %121
142: ; preds = %121
br label %143
143: ; preds = %142, %78
%144 = call i32 @wordfree(%struct.TYPE_4__* %10)
br label %17
145: ; preds = %17
%146 = load i8*, i8** %7
%147 = call i32 @free(i8* %146)
%148 = load i32, i32* %14
ret i32 %148
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32* }
@WRDE_SHOWERR = global i32 0
@WRDE_UNDEF = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"wordexp: WRDE_BADCHAR\0A\00"
@.str.1 = [22 x i8] c"wordexp: WRDE_BADVAL\0A\00"
@.str.2 = [22 x i8] c"wordexp: WRDE_CMDSUB\0A\00"
@.str.3 = [23 x i8] c"wordexp: WRDE_NOSPACE\0A\00"
@.str.4 = [22 x i8] c"wordexp: WRDE_SYNTAX\0A\00"
define i32 @config_file_read(i32* %0, i32* nocapture %1, i8*** nocapture %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.TYPE_4__
%7 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%8 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%9 = bitcast %struct.TYPE_4__* %6 to i8*
%10 = load i32, i32* %1
%11 = call i32 @getline(i8** %4, i64* %5, i32* %0)
%12 = icmp eq i32 %11, -1
br i1 %12, label %95, label %13
13: ; preds = %3
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 1
br label %16
16: ; preds = %13, %89
%17 = phi i32 [ 0, %13 ], [ %91, %89 ]
%18 = phi i32 [ %10, %13 ], [ %90, %89 ]
br label %19
19: ; preds = %16, %22
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
switch i8 %21, label %25 [
i8 35, label %22
i8 59, label %22
]
22: ; preds = %19, %19, %52
%23 = call i32 @getline(i8** %4, i64* %5, i32* %0)
%24 = icmp eq i32 %23, -1
br i1 %24, label %95, label %19
25: ; preds = %19
%26 = call i32 @strlen(i8* %20)
%27 = add nsw i32 %26, -1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %20, i64 %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 10
br i1 %31, label %32, label %38
32: ; preds = %25
%33 = load i8*, i8** %4
%34 = call i32 @strlen(i8* %33)
%35 = add nsw i32 %34, -1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %33, i64 %36
store i8 0, i8* %37
br label %38
38: ; preds = %32, %25
%39 = load i8*, i8** %4
%40 = load i32, i32* @WRDE_SHOWERR
%41 = load i32, i32* @WRDE_UNDEF
%42 = or i32 %41, %40
%43 = call i32 @wordexp(i8* %39, %struct.TYPE_4__* %6, i32 %42)
switch i32 %43, label %52 [
i32 0, label %54
i32 132, label %48
i32 131, label %44
i32 130, label %45
i32 129, label %46
i32 128, label %47
]
44: ; preds = %38
br label %48
45: ; preds = %38
br label %48
46: ; preds = %38
br label %48
47: ; preds = %38
br label %48
48: ; preds = %38, %44, %45, %46, %47
%49 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), %47 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), %46 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), %45 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), %44 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), %38 ]
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* %49)
br label %52
52: ; preds = %48, %38
%53 = call i32 @wordfree(%struct.TYPE_4__* %6)
br label %22
54: ; preds = %38
%55 = load i32, i32* %14
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %89
57: ; preds = %54
%58 = add nsw i32 %55, %18
%59 = load i8**, i8*** %2
%60 = shl i32 %58, 3
%61 = add i32 %60, 8
%62 = call i64 @realloc(i8** %59, i32 %61)
%63 = inttoptr i64 %62 to i8**
store i8** %63, i8*** %2
%64 = load i32, i32* %14
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 1
%67 = getelementptr inbounds i8*, i8** %66, i64 %65
%68 = getelementptr inbounds i8*, i8** %63, i64 1
%69 = load i32, i32* %1
%70 = shl i32 %69, 3
%71 = add i32 %70, -8
%72 = call i32 @memmove(i8** %67, i8** %68, i32 %71)
%73 = load i32, i32* %14
%74 = load i32, i32* %1
%75 = add nsw i32 %74, %73
store i32 %75, i32* %1
%76 = icmp eq i32 %73, 0
br i1 %76, label %89, label %77
77: ; preds = %57, %77
%78 = phi i64 [ %84, %77 ], [ 0, %57 ]
%79 = load i32*, i32** %15
%80 = getelementptr inbounds i32, i32* %79, i64 %78
%81 = load i32, i32* %80
%82 = call i8* @strdup(i32 %81)
%83 = load i8**, i8*** %2
%84 = add nuw i64 %78, 1
%85 = getelementptr inbounds i8*, i8** %83, i64 %84
store i8* %82, i8** %85
%86 = load i32, i32* %14
%87 = sext i32 %86 to i64
%88 = icmp ult i64 %84, %87
br i1 %88, label %77, label %89
89: ; preds = %77, %57, %54
%90 = phi i32 [ %18, %54 ], [ %58, %57 ], [ %58, %77 ]
%91 = phi i32 [ %17, %54 ], [ %55, %57 ], [ %55, %77 ]
%92 = call i32 @wordfree(%struct.TYPE_4__* %6)
%93 = call i32 @getline(i8** %4, i64* %5, i32* %0)
%94 = icmp eq i32 %93, -1
br i1 %94, label %95, label %16
95: ; preds = %89, %22, %3
%96 = phi i32 [ 0, %3 ], [ %17, %22 ], [ %91, %89 ]
%97 = load i8*, i8** %4
%98 = call i32 @free(i8* %97)
ret i32 %96
}