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

/* Type definitions */
struct TYPE_9__ {
  int we_offs;
  scalar_t__ we_wordc;
  int /*<<< orphan*/ *we_wordv;
};
typedef TYPE_1__ wordexp_t;

/* Variables and functions */
int WRDE_APPEND;
int WRDE_BADCHAR;
int WRDE_CMDSUB;
int WRDE_DOOFFS;
int WRDE_NOCMD;
int WRDE_NOSPACE;
int WRDE_REUSE;
void *calloc(int, int);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
int parse_backslash(char **, size_t *, size_t *, char const *, size_t *);
int parse_backtick(char **, size_t *, size_t *, char const *, size_t *, int,
                   TYPE_1__ *, char *, char *);
int parse_dollars(char **, size_t *, size_t *, char const *, size_t *, int,
                  TYPE_1__ *, char *, char *, int /*<<< orphan*/);
int parse_dquote(char **, size_t *, size_t *, char const *, size_t *, int,
                 TYPE_1__ *, char *, char *);
int parse_glob(char **, size_t *, size_t *, char const *, size_t *, int,
               TYPE_1__ *, char *, char *);
int parse_squote(char **, size_t *, size_t *, char const *, size_t *);
int parse_tilde(char **, size_t *, size_t *, char const *, size_t *,
                scalar_t__);
int /*<<< orphan*/ *strchr(char *, char const);
char *strcpy(char *, char *);
char *w_addchar(char *, size_t *, size_t *, char);
int w_addword(TYPE_1__ *, char *);
char *w_newword(size_t *, size_t *);
int /*<<< orphan*/ wordfree(TYPE_1__ *);
int wordexp(const char *words, wordexp_t *we, int flags) {
  size_t words_offset;
  size_t word_length;
  size_t max_length;
  char *word = w_newword(&word_length, &max_length);
  int error;
  char *ifs;
  char ifs_white[4];
  wordexp_t old_word = *we;
  if (flags & WRDE_REUSE) {
    wordfree(we);
    old_word.we_wordv = NULL;
  }
  if ((flags & WRDE_APPEND) == 0) {
    we->we_wordc = 0;
    if (flags & WRDE_DOOFFS) {
      we->we_wordv = calloc(1 + we->we_offs, sizeof(char *));
      if (we->we_wordv == NULL) {
        error = WRDE_NOSPACE;
        goto do_error;
      }
    } else {
      we->we_wordv = calloc(1, sizeof(char *));
      if (we->we_wordv == NULL) {
        error = WRDE_NOSPACE;
        goto do_error;
      }
      we->we_offs = 0;
    }
  }
  ifs = getenv("IFS");
  if (!ifs)
    ifs = strcpy(ifs_white, " \t\n");
  else {
    char *ifsch = ifs;
    char *whch = ifs_white;
    ifs_white[0] = '\0';
    while (*ifsch != '\0') {
      if ((*ifsch == ' ') || (*ifsch == '\t') || (*ifsch == '\n')) {
        char *runp = ifs_white;
        while (runp < whch && *runp != '\0' && *runp != *ifsch)
          ++runp;
        if (runp == whch)
          *whch++ = *ifsch;
      }
      ++ifsch;
    }
    *whch = '\0';
  }
  for (words_offset = 0; words[words_offset]; ++words_offset)
    switch (words[words_offset]) {
    case '\\':
      error = parse_backslash(&word, &word_length, &max_length, words,
                              &words_offset);
      if (error)
        goto do_error;
      break;
    case '$':
      error = parse_dollars(&word, &word_length, &max_length, words,
                            &words_offset, flags, we, ifs, ifs_white, 0);
      if (error)
        goto do_error;
      break;
    case '`':
      if (flags & WRDE_NOCMD) {
        error = WRDE_CMDSUB;
        goto do_error;
      }
      ++words_offset;
      error = parse_backtick(&word, &word_length, &max_length, words,
                             &words_offset, flags, we, ifs, ifs_white);
      if (error)
        goto do_error;
      break;
    case '"':
      ++words_offset;
      error = parse_dquote(&word, &word_length, &max_length, words,
                           &words_offset, flags, we, ifs, ifs_white);
      if (error)
        goto do_error;
      if (!word_length) {
        error = w_addword(we, NULL);
        if (error)
          return error;
      }
      break;
    case '\'':
      ++words_offset;
      error =
          parse_squote(&word, &word_length, &max_length, words, &words_offset);
      if (error)
        goto do_error;
      if (!word_length) {
        error = w_addword(we, NULL);
        if (error)
          return error;
      }
      break;
    case '~':
      error = parse_tilde(&word, &word_length, &max_length, words,
                          &words_offset, we->we_wordc);
      if (error)
        goto do_error;
      break;
    case '*':
    case '[':
    case '?':
      error = parse_glob(&word, &word_length, &max_length, words, &words_offset,
                         flags, we, ifs, ifs_white);
      if (error)
        goto do_error;
      break;
    default:
      if (strchr(" \t", words[words_offset]) == NULL) {
        char ch = words[words_offset];
        if (strchr("\n|&;<>(){}", ch)) {
          error = WRDE_BADCHAR;
          goto do_error;
        }
        word = w_addchar(word, &word_length, &max_length, ch);
        if (word == NULL) {
          error = WRDE_NOSPACE;
          goto do_error;
        }
        break;
      }
      if (word != NULL) {
        error = w_addword(we, word);
        if (error)
          goto do_error;
      }
      word = w_newword(&word_length, &max_length);
    }
  if (word == NULL)
    return 0;
  return w_addword(we, word);
do_error:
  if (word != NULL)
    free(word);
  if (error == WRDE_NOSPACE)
    return WRDE_NOSPACE;
  if ((flags & WRDE_APPEND) == 0)
    wordfree(we);
  *we = old_word;
  return error;
}


x86 assembly (clang, -O0):
<wordexp>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10e0 <w_newword@plt>
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,-0x78(%rbp)
mov    0x8(%rax),%rcx
mov    %rcx,-0x70(%rbp)
mov    0x10(%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2da3(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1269 <wordexp+0x69>
mov    -0x20(%rbp),%rdi
call   1100 <wordfree@plt>
movq   $0x0,-0x68(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2d6d(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    132b <wordexp+0x12b>
mov    -0x20(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x24(%rbp),%eax
mov    0x2d1c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12e2 <wordexp+0xe2>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   10d0 <calloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    12dd <wordexp+0xdd>
mov    0x2cfd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
jmp    1917 <wordexp+0x717>
jmp    1326 <wordexp+0x126>
mov    $0x1,%edi
mov    $0x8,%esi
call   10d0 <calloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    131c <wordexp+0x11c>
mov    0x2cbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
jmp    1917 <wordexp+0x717>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    132b <wordexp+0x12b>
lea    0xcce(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    135f <wordexp+0x15f>
lea    -0x5c(%rbp),%rdi
lea    0xcb3(%rip),%rsi
call   1060 <strcpy@plt>
mov    %rax,-0x58(%rbp)
jmp    148f <wordexp+0x28f>
mov    -0x58(%rbp),%rax
mov    %rax,-0x80(%rbp)
lea    -0x5c(%rbp),%rax
mov    %rax,-0x88(%rbp)
movb   $0x0,-0x5c(%rbp)
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1485 <wordexp+0x285>
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     13b6 <wordexp+0x1b6>
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     13b6 <wordexp+0x1b6>
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1474 <wordexp+0x274>
lea    -0x5c(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rcx
xor    %eax,%eax
cmp    -0x88(%rbp),%rcx
mov    %al,-0x92(%rbp)
jae    1414 <wordexp+0x214>
mov    -0x90(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x92(%rbp)
je     1414 <wordexp+0x214>
mov    -0x90(%rbp),%rax
movsbl (%rax),%eax
mov    -0x80(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x92(%rbp)
mov    -0x92(%rbp),%al
test   $0x1,%al
jne    1427 <wordexp+0x227>
jmp    143e <wordexp+0x23e>
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
jmp    13c1 <wordexp+0x1c1>
mov    -0x90(%rbp),%rax
cmp    -0x88(%rbp),%rax
jne    146f <wordexp+0x26f>
mov    -0x80(%rbp),%rax
mov    (%rax),%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
jmp    1474 <wordexp+0x274>
mov    -0x80(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80(%rbp)
jmp    1376 <wordexp+0x176>
mov    -0x88(%rbp),%rax
movb   $0x0,(%rax)
movq   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     18eb <wordexp+0x6eb>
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x98(%rbp)
sub    $0x22,%eax
je     1671 <wordexp+0x471>
jmp    14c9 <wordexp+0x2c9>
mov    -0x98(%rbp),%eax
sub    $0x24,%eax
je     1599 <wordexp+0x399>
jmp    14dd <wordexp+0x2dd>
mov    -0x98(%rbp),%eax
sub    $0x27,%eax
je     1700 <wordexp+0x500>
jmp    14f1 <wordexp+0x2f1>
mov    -0x98(%rbp),%eax
sub    $0x2a,%eax
je     17a9 <wordexp+0x5a9>
jmp    1505 <wordexp+0x305>
mov    -0x98(%rbp),%eax
sub    $0x3f,%eax
je     17a9 <wordexp+0x5a9>
jmp    1519 <wordexp+0x319>
mov    -0x98(%rbp),%eax
sub    $0x5b,%eax
je     17a9 <wordexp+0x5a9>
jmp    152d <wordexp+0x32d>
mov    -0x98(%rbp),%eax
sub    $0x5c,%eax
je     1569 <wordexp+0x369>
jmp    1541 <wordexp+0x341>
mov    -0x98(%rbp),%eax
sub    $0x60,%eax
je     15f1 <wordexp+0x3f1>
jmp    1555 <wordexp+0x355>
mov    -0x98(%rbp),%eax
sub    $0x7e,%eax
je     1771 <wordexp+0x571>
jmp    17f7 <wordexp+0x5f7>
mov    -0x18(%rbp),%rcx
lea    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x30(%rbp),%r8
call   10c0 <parse_backslash@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     1594 <wordexp+0x394>
jmp    1917 <wordexp+0x717>
jmp    18d5 <wordexp+0x6d5>
mov    -0x18(%rbp),%rcx
mov    -0x24(%rbp),%r9d
mov    -0x20(%rbp),%r11
mov    -0x58(%rbp),%r10
lea    -0x5c(%rbp),%rax
lea    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x30(%rbp),%r8
xor    %ebx,%ebx
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   10b0 <parse_dollars@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     15ec <wordexp+0x3ec>
jmp    1917 <wordexp+0x717>
jmp    18d5 <wordexp+0x6d5>
mov    -0x24(%rbp),%eax
mov    0x29dd(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1617 <wordexp+0x417>
mov    0x29b3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
jmp    1917 <wordexp+0x717>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x24(%rbp),%r9d
mov    -0x20(%rbp),%r11
mov    -0x58(%rbp),%r10
lea    -0x5c(%rbp),%rax
lea    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x30(%rbp),%r8
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1050 <parse_backtick@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     166c <wordexp+0x46c>
jmp    1917 <wordexp+0x717>
jmp    18d5 <wordexp+0x6d5>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x24(%rbp),%r9d
mov    -0x20(%rbp),%r11
mov    -0x58(%rbp),%r10
lea    -0x5c(%rbp),%rax
lea    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x30(%rbp),%r8
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1090 <parse_dquote@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     16c6 <wordexp+0x4c6>
jmp    1917 <wordexp+0x717>
cmpq   $0x0,-0x38(%rbp)
jne    16fb <wordexp+0x4fb>
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1110 <w_addword@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     16f6 <wordexp+0x4f6>
mov    -0x4c(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    198d <wordexp+0x78d>
jmp    16fb <wordexp+0x4fb>
jmp    18d5 <wordexp+0x6d5>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rcx
lea    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x30(%rbp),%r8
call   1120 <parse_squote@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     1737 <wordexp+0x537>
jmp    1917 <wordexp+0x717>
cmpq   $0x0,-0x38(%rbp)
jne    176c <wordexp+0x56c>
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1110 <w_addword@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     1767 <wordexp+0x567>
mov    -0x4c(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    198d <wordexp+0x78d>
jmp    176c <wordexp+0x56c>
jmp    18d5 <wordexp+0x6d5>
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%r9
lea    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x30(%rbp),%r8
call   10f0 <parse_tilde@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     17a4 <wordexp+0x5a4>
jmp    1917 <wordexp+0x717>
jmp    18d5 <wordexp+0x6d5>
mov    -0x18(%rbp),%rcx
mov    -0x24(%rbp),%r9d
mov    -0x20(%rbp),%r11
mov    -0x58(%rbp),%r10
lea    -0x5c(%rbp),%rax
lea    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x30(%rbp),%r8
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <parse_glob@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     17f2 <wordexp+0x5f2>
jmp    1917 <wordexp+0x717>
jmp    18d5 <wordexp+0x6d5>
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
lea    0x802(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   10a0 <strchr@plt>
cmp    $0x0,%rax
jne    1895 <wordexp+0x695>
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x91(%rbp)
lea    0x7da(%rip),%rdi
movsbl -0x91(%rbp),%esi
call   10a0 <strchr@plt>
cmp    $0x0,%rax
je     1858 <wordexp+0x658>
mov    0x277a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
jmp    1917 <wordexp+0x717>
mov    -0x48(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
movsbl -0x91(%rbp),%ecx
call   1080 <w_addchar@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1890 <wordexp+0x690>
mov    0x274a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
jmp    1917 <wordexp+0x717>
jmp    18d5 <wordexp+0x6d5>
cmpq   $0x0,-0x48(%rbp)
je     18c4 <wordexp+0x6c4>
mov    -0x20(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1110 <w_addword@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     18bf <wordexp+0x6bf>
jmp    1917 <wordexp+0x717>
jmp    18c4 <wordexp+0x6c4>
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10e0 <w_newword@plt>
mov    %rax,-0x48(%rbp)
jmp    18da <wordexp+0x6da>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1497 <wordexp+0x297>
cmpq   $0x0,-0x48(%rbp)
jne    1902 <wordexp+0x702>
movl   $0x0,-0xc(%rbp)
jmp    198d <wordexp+0x78d>
mov    -0x20(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1110 <w_addword@plt>
mov    %eax,-0xc(%rbp)
jmp    198d <wordexp+0x78d>
cmpq   $0x0,-0x48(%rbp)
je     192b <wordexp+0x72b>
mov    -0x48(%rbp),%rdi
call   1040 <free@plt>
mov    -0x4c(%rbp),%eax
mov    0x269b(%rip),%rcx
cmp    (%rcx),%eax
jne    194e <wordexp+0x74e>
mov    0x268c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    198d <wordexp+0x78d>
mov    -0x24(%rbp),%eax
mov    0x2688(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    196c <wordexp+0x76c>
mov    -0x20(%rbp),%rdi
call   1100 <wordfree@plt>
mov    -0x20(%rbp),%rax
mov    -0x78(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x70(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x68(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    -0x4c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xb8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordexp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %edx,%ebx
mov    %rsi,%r12
mov    %rdi,%r15
lea    0x38(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   10d0 <w_newword@plt>
mov    %rax,0x28(%rsp)
movups (%r12),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0x2dc5(%rip),%rax
test   %ebx,(%rax)
je     123c <wordexp+0x4c>
mov    %r12,%rdi
call   10f0 <wordfree@plt>
xor    %r14d,%r14d
jmp    1241 <wordexp+0x51>
mov    0x10(%r12),%r14
mov    0x2d98(%rip),%rax
test   %ebx,(%rax)
mov    %ebx,0x8(%rsp)
je     12ec <wordexp+0xfc>
lea    0xea1(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1328 <wordexp+0x138>
lea    0xc(%rsp),%rcx
movb   $0x0,0xc(%rsp)
mov    %rcx,%r8
neg    %r8
mov    %rax,0x30(%rsp)
mov    %rax,%rsi
mov    %rcx,%rdx
jmp    1299 <wordexp+0xa9>
cs nopw 0x0(%rax,%rax,1)
test   %dil,%dil
je     12e7 <wordexp+0xf7>
add    $0x1,%rsi
mov    (%rsi),%dil
lea    -0x9(%rdi),%eax
cmp    $0x2,%al
jb     12a9 <wordexp+0xb9>
cmp    $0x20,%dil
jne    1290 <wordexp+0xa0>
mov    %rcx,%rax
cmp    %rcx,%rdx
jbe    12d9 <wordexp+0xe9>
lea    (%r8,%rdx,1),%rbp
mov    %rcx,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ebx
test   %bl,%bl
je     12d9 <wordexp+0xe9>
cmp    %dil,%bl
je     12d9 <wordexp+0xe9>
add    $0x1,%rax
add    $0xffffffffffffffff,%rbp
jne    12c0 <wordexp+0xd0>
mov    %rdx,%rax
cmp    %rdx,%rax
jne    1295 <wordexp+0xa5>
mov    %dil,(%rdx)
add    $0x1,%rdx
jmp    1295 <wordexp+0xa5>
movb   $0x0,(%rdx)
jmp    133a <wordexp+0x14a>
movq   $0x0,0x8(%r12)
mov    0x2cb4(%rip),%rax
test   %ebx,(%rax)
je     15f8 <wordexp+0x408>
mov    (%r12),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   10c0 <calloc@plt>
mov    %rax,0x10(%r12)
test   %rax,%rax
jne    1254 <wordexp+0x64>
jmp    161e <wordexp+0x42e>
lea    0xc(%rsp),%rax
mov    %rax,0x30(%rsp)
movl   $0xa0920,0xc(%rsp)
mov    %r14,0x18(%rsp)
movq   $0x0,0x10(%rsp)
mov    (%r15),%cl
test   %cl,%cl
je     15cf <wordexp+0x3df>
xor    %eax,%eax
lea    0x28(%rsp),%rbx
lea    0x38(%rsp),%rbp
lea    0xc9a(%rip),%r14
jmp    13c5 <wordexp+0x1d5>
nopl   0x0(%rax,%rax,1)
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
mov    %r15,%rcx
lea    0x18(%rsp),%r8
mov    0x10(%rsp),%r9d
lea    0x14(%rsp),%rax
push   %rax
push   0x40(%rsp)
push   %r12
call   1060 <parse_glob@plt>
add    $0x20,%rsp
test   %eax,%eax
jne    15e9 <wordexp+0x3f9>
mov    0x10(%rsp),%rcx
lea    0x1(%rcx),%rax
mov    %rax,0x10(%rsp)
movzbl 0x1(%r15,%rcx,1),%ecx
test   %cl,%cl
je     15cf <wordexp+0x3df>
movsbl %cl,%esi
lea    -0x22(%rsi),%ecx
cmp    $0x3e,%ecx
ja     1420 <wordexp+0x230>
movslq (%r14,%rcx,4),%rcx
add    %r14,%rcx
jmp    *%rcx
add    $0x1,%rax
mov    %rax,0x10(%rsp)
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
mov    %r15,%rcx
lea    0x18(%rsp),%r8
mov    0x10(%rsp),%r9d
lea    0x14(%rsp),%rax
push   %rax
push   0x40(%rsp)
push   %r12
call   1080 <parse_dquote@plt>
add    $0x20,%rsp
test   %eax,%eax
je     14e6 <wordexp+0x2f6>
jmp    15e9 <wordexp+0x3f9>
cmp    $0x7e,%esi
jne    1447 <wordexp+0x257>
mov    0x8(%r12),%r9
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x20(%rsp),%rdx
mov    %r15,%rcx
lea    0x10(%rsp),%r8
call   10e0 <parse_tilde@plt>
jmp    13a1 <wordexp+0x1b1>
lea    0xcb2(%rip),%rdi
call   1090 <strchr@plt>
test   %rax,%rax
je     1571 <wordexp+0x381>
mov    0x28(%rsp),%rsi
test   %rsi,%rsi
je     1476 <wordexp+0x286>
mov    %r12,%rdi
call   1100 <w_addword@plt>
test   %eax,%eax
jne    15e9 <wordexp+0x3f9>
mov    %rbp,%rdi
lea    0x20(%rsp),%rsi
call   10d0 <w_newword@plt>
mov    %rax,0x28(%rsp)
jmp    13a9 <wordexp+0x1b9>
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x20(%rsp),%rdx
mov    %r15,%rcx
lea    0x10(%rsp),%r8
mov    0x8(%rsp),%r9d
push   $0x0
lea    0x14(%rsp),%rax
push   %rax
push   0x40(%rsp)
push   %r12
call   10a0 <parse_dollars@plt>
jmp    139d <wordexp+0x1ad>
add    $0x1,%rax
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x20(%rsp),%rdx
mov    %r15,%rcx
lea    0x10(%rsp),%r8
call   1110 <parse_squote@plt>
test   %eax,%eax
jne    15e9 <wordexp+0x3f9>
cmpq   $0x0,0x38(%rsp)
jne    13a9 <wordexp+0x1b9>
mov    %r12,%rdi
xor    %esi,%esi
call   1100 <w_addword@plt>
test   %eax,%eax
je     13a9 <wordexp+0x1b9>
jmp    1684 <wordexp+0x494>
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x20(%rsp),%rdx
mov    %r15,%rcx
lea    0x10(%rsp),%r8
call   10b0 <parse_backslash@plt>
jmp    13a1 <wordexp+0x1b1>
mov    0x8(%rsp),%r9d
mov    0x2aa6(%rip),%rcx
test   %r9d,(%rcx)
jne    167b <wordexp+0x48b>
add    $0x1,%rax
mov    %rax,0x10(%rsp)
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
mov    %r15,%rcx
lea    0x18(%rsp),%r8
lea    0x14(%rsp),%rax
push   %rax
push   0x40(%rsp)
push   %r12
call   1050 <parse_backtick@plt>
jmp    139d <wordexp+0x1ad>
mov    %rbx,%r13
mov    0x10(%rsp),%rax
movsbl (%r15,%rax,1),%ebx
lea    0xb7e(%rip),%rdi
mov    %ebx,%esi
call   1090 <strchr@plt>
test   %rax,%rax
jne    1689 <wordexp+0x499>
mov    0x28(%rsp),%rdi
mov    %rbp,%rsi
lea    0x20(%rsp),%rdx
mov    %ebx,%ecx
call   1070 <w_addchar@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
mov    %r13,%rbx
jne    13a9 <wordexp+0x1b9>
mov    0x2a0f(%rip),%rax
mov    (%rax),%r13d
mov    0x8(%rsp),%ecx
mov    0x18(%rsp),%r14
jmp    163b <wordexp+0x44b>
mov    0x28(%rsp),%rsi
test   %rsi,%rsi
je     15f3 <wordexp+0x403>
mov    %r12,%rdi
call   1100 <w_addword@plt>
mov    %eax,%r13d
jmp    1669 <wordexp+0x479>
mov    %eax,%r13d
mov    0x18(%rsp),%r14
jmp    1628 <wordexp+0x438>
xor    %r13d,%r13d
jmp    1669 <wordexp+0x479>
mov    $0x1,%edi
mov    $0x8,%esi
call   10c0 <calloc@plt>
mov    %rax,0x10(%r12)
test   %rax,%rax
je     161e <wordexp+0x42e>
movl   $0x0,(%r12)
jmp    1254 <wordexp+0x64>
mov    0x29ab(%rip),%rax
mov    (%rax),%r13d
mov    0x28(%rsp),%rdi
test   %rdi,%rdi
je     1637 <wordexp+0x447>
call   1040 <free@plt>
mov    0x8(%rsp),%ecx
mov    0x298e(%rip),%rax
cmp    (%rax),%r13d
je     1669 <wordexp+0x479>
mov    0x2992(%rip),%rax
test   %ecx,(%rax)
jne    165a <wordexp+0x46a>
mov    %r12,%rdi
call   10f0 <wordfree@plt>
movaps 0x40(%rsp),%xmm0
movups %xmm0,(%r12)
mov    %r14,0x10(%r12)
mov    %r13d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x293e(%rip),%rax
jmp    1690 <wordexp+0x4a0>
mov    %eax,%r13d
jmp    1669 <wordexp+0x479>
mov    0x2938(%rip),%rax
mov    (%rax),%r13d
jmp    15ec <wordexp+0x3fc>

LLVM IR (-O0):
%struct.TYPE_9__ = type { i32, i64, i32* }
@WRDE_REUSE = global i32 0
@WRDE_APPEND = global i32 0
@WRDE_DOOFFS = global i32 0
@WRDE_NOSPACE = global i32 0
@.str = [4 x i8] c"IFS\00"
@.str.1 = [4 x i8] c" \09\0A\00"
@WRDE_NOCMD = global i32 0
@WRDE_CMDSUB = global i32 0
@.str.2 = [3 x i8] c" \09\00"
@.str.3 = [11 x i8] c"\0A|&;<>(){}\00"
@WRDE_BADCHAR = global i32 0
define i32 @wordexp(i8* %0, %struct.TYPE_9__* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.TYPE_9__*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca [4 x i8]
%15 = alloca %struct.TYPE_9__
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8
store i8* %0, i8** %5
store %struct.TYPE_9__* %1, %struct.TYPE_9__** %6
store i32 %2, i32* %7
%20 = call i8* @w_newword(i64* %9, i64* %10)
store i8* %20, i8** %11
%21 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%22 = bitcast %struct.TYPE_9__* %15 to i8*
%23 = bitcast %struct.TYPE_9__* %21 to i8*
%24 = load i32, i32* %7
%25 = load i32, i32* @WRDE_REUSE
%26 = and i32 %24, %25
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %3
%29 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%30 = call i32 @wordfree(%struct.TYPE_9__* %29)
%31 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %15, i32 0, i32 2
store i32* null, i32** %31
br label %32
32: ; preds = %28, %3
%33 = load i32, i32* %7
%34 = load i32, i32* @WRDE_APPEND
%35 = and i32 %33, %34
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %75
37: ; preds = %32
%38 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%39 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %38, i32 0, i32 1
store i64 0, i64* %39
%40 = load i32, i32* %7
%41 = load i32, i32* @WRDE_DOOFFS
%42 = and i32 %40, %41
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %60
44: ; preds = %37
%45 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%46 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %45, i32 0, i32 0
%47 = load i32, i32* %46
%48 = add nsw i32 1, %47
%49 = call i8* @calloc(i32 %48, i32 8)
%50 = bitcast i8* %49 to i32*
%51 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%52 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %51, i32 0, i32 2
store i32* %50, i32** %52
%53 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%54 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %53, i32 0, i32 2
%55 = load i32*, i32** %54
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %59
57: ; preds = %44
%58 = load i32, i32* @WRDE_NOSPACE
store i32 %58, i32* %12
br label %312
59: ; preds = %44
br label %74
60: ; preds = %37
%61 = call i8* @calloc(i32 1, i32 8)
%62 = bitcast i8* %61 to i32*
%63 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%64 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %63, i32 0, i32 2
store i32* %62, i32** %64
%65 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%66 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %65, i32 0, i32 2
%67 = load i32*, i32** %66
%68 = icmp eq i32* %67, null
br i1 %68, label %69, label %71
69: ; preds = %60
%70 = load i32, i32* @WRDE_NOSPACE
store i32 %70, i32* %12
br label %312
71: ; preds = %60
%72 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%73 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %72, i32 0, i32 0
store i32 0, i32* %73
br label %74
74: ; preds = %71, %59
br label %75
75: ; preds = %74, %32
%76 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %76, i8** %13
%77 = load i8*, i8** %13
%78 = icmp ne i8* %77, null
br i1 %78, label %82, label %79
79: ; preds = %75
%80 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%81 = call i8* @strcpy(i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %81, i8** %13
br label %145
82: ; preds = %75
%83 = load i8*, i8** %13
store i8* %83, i8** %16
%84 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
store i8* %84, i8** %17
%85 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
store i8 0, i8* %85
br label %86
86: ; preds = %140, %82
%87 = load i8*, i8** %16
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %143
91: ; preds = %86
%92 = load i8*, i8** %16
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 32
br i1 %95, label %106, label %96
96: ; preds = %91
%97 = load i8*, i8** %16
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 9
br i1 %100, label %106, label %101
101: ; preds = %96
%102 = load i8*, i8** %16
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = icmp eq i32 %104, 10
br i1 %105, label %106, label %140
106: ; preds = %101, %96, %91
%107 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
store i8* %107, i8** %18
br label %108
108: ; preds = %127, %106
%109 = load i8*, i8** %18
%110 = load i8*, i8** %17
%111 = icmp ult i8* %109, %110
br i1 %111, label %112, label %125
112: ; preds = %108
%113 = load i8*, i8** %18
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %125
117: ; preds = %112
%118 = load i8*, i8** %18
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = load i8*, i8** %16
%122 = load i8, i8* %121
%123 = sext i8 %122 to i32
%124 = icmp ne i32 %120, %123
br label %125
125: ; preds = %117, %112, %108
%126 = phi i1 [ false, %112 ], [ false, %108 ], [ %124, %117 ]
br i1 %126, label %127, label %130
127: ; preds = %125
%128 = load i8*, i8** %18
%129 = getelementptr inbounds i8, i8* %128, i32 1
store i8* %129, i8** %18
br label %108
130: ; preds = %125
%131 = load i8*, i8** %18
%132 = load i8*, i8** %17
%133 = icmp eq i8* %131, %132
br i1 %133, label %134, label %139
134: ; preds = %130
%135 = load i8*, i8** %16
%136 = load i8, i8* %135
%137 = load i8*, i8** %17
%138 = getelementptr inbounds i8, i8* %137, i32 1
store i8* %138, i8** %17
store i8 %136, i8* %137
br label %139
139: ; preds = %134, %130
br label %140
140: ; preds = %139, %101
%141 = load i8*, i8** %16
%142 = getelementptr inbounds i8, i8* %141, i32 1
store i8* %142, i8** %16
br label %86
143: ; preds = %86
%144 = load i8*, i8** %17
store i8 0, i8* %144
br label %145
145: ; preds = %143, %79
store i64 0, i64* %8
br label %146
146: ; preds = %301, %145
%147 = load i8*, i8** %5
%148 = load i64, i64* %8
%149 = getelementptr inbounds i8, i8* %147, i64 %148
%150 = load i8, i8* %149
%151 = icmp ne i8 %150, 0
br i1 %151, label %152, label %304
152: ; preds = %146
%153 = load i8*, i8** %5
%154 = load i64, i64* %8
%155 = getelementptr inbounds i8, i8* %153, i64 %154
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
switch i32 %157, label %261 [
i32 92, label %158
i32 36, label %165
i32 96, label %176
i32 34, label %196
i32 39, label %220
i32 126, label %240
i32 42, label %250
i32 91, label %250
i32 63, label %250
]
158: ; preds = %152
%159 = load i8*, i8** %5
%160 = call i32 @parse_backslash(i8** %11, i64* %9, i64* %10, i8* %159, i64* %8)
store i32 %160, i32* %12
%161 = load i32, i32* %12
%162 = icmp ne i32 %161, 0
br i1 %162, label %163, label %164
163: ; preds = %158
br label %312
164: ; preds = %158
br label %300
165: ; preds = %152
%166 = load i8*, i8** %5
%167 = load i32, i32* %7
%168 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%169 = load i8*, i8** %13
%170 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%171 = call i32 @parse_dollars(i8** %11, i64* %9, i64* %10, i8* %166, i64* %8, i32 %167, %struct.TYPE_9__* %168, i8* %169, i8* %170, i32 0)
store i32 %171, i32* %12
%172 = load i32, i32* %12
%173 = icmp ne i32 %172, 0
br i1 %173, label %174, label %175
174: ; preds = %165
br label %312
175: ; preds = %165
br label %300
176: ; preds = %152
%177 = load i32, i32* %7
%178 = load i32, i32* @WRDE_NOCMD
%179 = and i32 %177, %178
%180 = icmp ne i32 %179, 0
br i1 %180, label %181, label %183
181: ; preds = %176
%182 = load i32, i32* @WRDE_CMDSUB
store i32 %182, i32* %12
br label %312
183: ; preds = %176
%184 = load i64, i64* %8
%185 = add i64 %184, 1
store i64 %185, i64* %8
%186 = load i8*, i8** %5
%187 = load i32, i32* %7
%188 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%189 = load i8*, i8** %13
%190 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%191 = call i32 @parse_backtick(i8** %11, i64* %9, i64* %10, i8* %186, i64* %8, i32 %187, %struct.TYPE_9__* %188, i8* %189, i8* %190)
store i32 %191, i32* %12
%192 = load i32, i32* %12
%193 = icmp ne i32 %192, 0
br i1 %193, label %194, label %195
194: ; preds = %183
br label %312
195: ; preds = %183
br label %300
196: ; preds = %152
%197 = load i64, i64* %8
%198 = add i64 %197, 1
store i64 %198, i64* %8
%199 = load i8*, i8** %5
%200 = load i32, i32* %7
%201 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%202 = load i8*, i8** %13
%203 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%204 = call i32 @parse_dquote(i8** %11, i64* %9, i64* %10, i8* %199, i64* %8, i32 %200, %struct.TYPE_9__* %201, i8* %202, i8* %203)
store i32 %204, i32* %12
%205 = load i32, i32* %12
%206 = icmp ne i32 %205, 0
br i1 %206, label %207, label %208
207: ; preds = %196
br label %312
208: ; preds = %196
%209 = load i64, i64* %9
%210 = icmp ne i64 %209, 0
br i1 %210, label %219, label %211
211: ; preds = %208
%212 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%213 = call i32 @w_addword(%struct.TYPE_9__* %212, i8* null)
store i32 %213, i32* %12
%214 = load i32, i32* %12
%215 = icmp ne i32 %214, 0
br i1 %215, label %216, label %218
216: ; preds = %211
%217 = load i32, i32* %12
store i32 %217, i32* %4
br label %337
218: ; preds = %211
br label %219
219: ; preds = %218, %208
br label %300
220: ; preds = %152
%221 = load i64, i64* %8
%222 = add i64 %221, 1
store i64 %222, i64* %8
%223 = load i8*, i8** %5
%224 = call i32 @parse_squote(i8** %11, i64* %9, i64* %10, i8* %223, i64* %8)
store i32 %224, i32* %12
%225 = load i32, i32* %12
%226 = icmp ne i32 %225, 0
br i1 %226, label %227, label %228
227: ; preds = %220
br label %312
228: ; preds = %220
%229 = load i64, i64* %9
%230 = icmp ne i64 %229, 0
br i1 %230, label %239, label %231
231: ; preds = %228
%232 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%233 = call i32 @w_addword(%struct.TYPE_9__* %232, i8* null)
store i32 %233, i32* %12
%234 = load i32, i32* %12
%235 = icmp ne i32 %234, 0
br i1 %235, label %236, label %238
236: ; preds = %231
%237 = load i32, i32* %12
store i32 %237, i32* %4
br label %337
238: ; preds = %231
br label %239
239: ; preds = %238, %228
br label %300
240: ; preds = %152
%241 = load i8*, i8** %5
%242 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%243 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %242, i32 0, i32 1
%244 = load i64, i64* %243
%245 = call i32 @parse_tilde(i8** %11, i64* %9, i64* %10, i8* %241, i64* %8, i64 %244)
store i32 %245, i32* %12
%246 = load i32, i32* %12
%247 = icmp ne i32 %246, 0
br i1 %247, label %248, label %249
248: ; preds = %240
br label %312
249: ; preds = %240
br label %300
250: ; preds = %152, %152, %152
%251 = load i8*, i8** %5
%252 = load i32, i32* %7
%253 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%254 = load i8*, i8** %13
%255 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%256 = call i32 @parse_glob(i8** %11, i64* %9, i64* %10, i8* %251, i64* %8, i32 %252, %struct.TYPE_9__* %253, i8* %254, i8* %255)
store i32 %256, i32* %12
%257 = load i32, i32* %12
%258 = icmp ne i32 %257, 0
br i1 %258, label %259, label %260
259: ; preds = %250
br label %312
260: ; preds = %250
br label %300
261: ; preds = %152
%262 = load i8*, i8** %5
%263 = load i64, i64* %8
%264 = getelementptr inbounds i8, i8* %262, i64 %263
%265 = load i8, i8* %264
%266 = call i32* @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %265)
%267 = icmp eq i32* %266, null
br i1 %267, label %268, label %287
268: ; preds = %261
%269 = load i8*, i8** %5
%270 = load i64, i64* %8
%271 = getelementptr inbounds i8, i8* %269, i64 %270
%272 = load i8, i8* %271
store i8 %272, i8* %19
%273 = load i8, i8* %19
%274 = call i32* @strchr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8 signext %273)
%275 = icmp ne i32* %274, null
br i1 %275, label %276, label %278
276: ; preds = %268
%277 = load i32, i32* @WRDE_BADCHAR
store i32 %277, i32* %12
br label %312
278: ; preds = %268
%279 = load i8*, i8** %11
%280 = load i8, i8* %19
%281 = call i8* @w_addchar(i8* %279, i64* %9, i64* %10, i8 signext %280)
store i8* %281, i8** %11
%282 = load i8*, i8** %11
%283 = icmp eq i8* %282, null
br i1 %283, label %284, label %286
284: ; preds = %278
%285 = load i32, i32* @WRDE_NOSPACE
store i32 %285, i32* %12
br label %312
286: ; preds = %278
br label %300
287: ; preds = %261
%288 = load i8*, i8** %11
%289 = icmp ne i8* %288, null
br i1 %289, label %290, label %298
290: ; preds = %287
%291 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%292 = load i8*, i8** %11
%293 = call i32 @w_addword(%struct.TYPE_9__* %291, i8* %292)
store i32 %293, i32* %12
%294 = load i32, i32* %12
%295 = icmp ne i32 %294, 0
br i1 %295, label %296, label %297
296: ; preds = %290
br label %312
297: ; preds = %290
br label %298
298: ; preds = %297, %287
%299 = call i8* @w_newword(i64* %9, i64* %10)
store i8* %299, i8** %11
br label %300
300: ; preds = %298, %286, %260, %249, %239, %219, %195, %175, %164
br label %301
301: ; preds = %300
%302 = load i64, i64* %8
%303 = add i64 %302, 1
store i64 %303, i64* %8
br label %146
304: ; preds = %146
%305 = load i8*, i8** %11
%306 = icmp eq i8* %305, null
br i1 %306, label %307, label %308
307: ; preds = %304
store i32 0, i32* %4
br label %337
308: ; preds = %304
%309 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%310 = load i8*, i8** %11
%311 = call i32 @w_addword(%struct.TYPE_9__* %309, i8* %310)
store i32 %311, i32* %4
br label %337
312: ; preds = %296, %284, %276, %259, %248, %227, %207, %194, %181, %174, %163, %69, %57
%313 = load i8*, i8** %11
%314 = icmp ne i8* %313, null
br i1 %314, label %315, label %318
315: ; preds = %312
%316 = load i8*, i8** %11
%317 = call i32 @free(i8* %316)
br label %318
318: ; preds = %315, %312
%319 = load i32, i32* %12
%320 = load i32, i32* @WRDE_NOSPACE
%321 = icmp eq i32 %319, %320
br i1 %321, label %322, label %324
322: ; preds = %318
%323 = load i32, i32* @WRDE_NOSPACE
store i32 %323, i32* %4
br label %337
324: ; preds = %318
%325 = load i32, i32* %7
%326 = load i32, i32* @WRDE_APPEND
%327 = and i32 %325, %326
%328 = icmp eq i32 %327, 0
br i1 %328, label %329, label %332
329: ; preds = %324
%330 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%331 = call i32 @wordfree(%struct.TYPE_9__* %330)
br label %332
332: ; preds = %329, %324
%333 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%334 = bitcast %struct.TYPE_9__* %333 to i8*
%335 = bitcast %struct.TYPE_9__* %15 to i8*
%336 = load i32, i32* %12
store i32 %336, i32* %4
br label %337
337: ; preds = %332, %322, %308, %307, %236, %216
%338 = load i32, i32* %4
ret i32 %338
}

LLVM IR (-O2):
%struct.TYPE_9__ = type { i32, i64, i32* }
@WRDE_REUSE = global i32 0
@WRDE_APPEND = global i32 0
@WRDE_DOOFFS = global i32 0
@WRDE_NOSPACE = global i32 0
@.str = [4 x i8] c"IFS\00"
@WRDE_NOCMD = global i32 0
@WRDE_CMDSUB = global i32 0
@.str.2 = [3 x i8] c" \09\00"
@.str.3 = [11 x i8] c"\0A|&;<>(){}\00"
@WRDE_BADCHAR = global i32 0
define i32 @wordexp(i8* %0, %struct.TYPE_9__* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = bitcast i32* %8 to i8*
%10 = ptrtoint i32* %8 to i64
%11 = alloca { i32, i64 }
%12 = bitcast i64* %4 to i8*
%13 = bitcast i64* %5 to i8*
%14 = bitcast i64* %6 to i8*
%15 = bitcast i8** %7 to i8*
%16 = call i8* @w_newword(i64* %5, i64* %6)
store i8* %16, i8** %7
%17 = bitcast { i32, i64 }* %11 to i8*
%18 = bitcast %struct.TYPE_9__* %1 to i8*
%19 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 2
%20 = load i32*, i32** %19
%21 = load i32, i32* @WRDE_REUSE
%22 = and i32 %21, %2
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %3
%25 = call i32 @wordfree(%struct.TYPE_9__* %1)
br label %26
26: ; preds = %24, %3
%27 = phi i32* [ null, %24 ], [ %20, %3 ]
%28 = load i32, i32* @WRDE_APPEND
%29 = and i32 %28, %2
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %53
31: ; preds = %26
%32 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 1
store i64 0, i64* %32
%33 = load i32, i32* @WRDE_DOOFFS
%34 = and i32 %33, %2
%35 = icmp eq i32 %34, 0
br i1 %35, label %45, label %36
36: ; preds = %31
%37 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 0
%38 = load i32, i32* %37
%39 = add nsw i32 %38, 1
%40 = call i8* @calloc(i32 %39, i32 8)
%41 = bitcast i32** %19 to i8**
store i8* %40, i8** %41
%42 = icmp eq i8* %40, null
br i1 %42, label %43, label %53
43: ; preds = %36
%44 = load i32, i32* @WRDE_NOSPACE
br label %174
45: ; preds = %31
%46 = call dereferenceable_or_null(8) i8* @calloc(i32 1, i32 8)
%47 = bitcast i32** %19 to i8**
store i8* %46, i8** %47
%48 = icmp eq i8* %46, null
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = load i32, i32* @WRDE_NOSPACE
br label %174
51: ; preds = %45
%52 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 0
store i32 0, i32* %52
br label %53
53: ; preds = %51, %36, %26
%54 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %57
56: ; preds = %53
store i32 657696, i32* %8
br label %87
57: ; preds = %53
store i8 0, i8* %9
%58 = sub i64 0, %10
%59 = getelementptr i8, i8* %9, i64 %58
br label %60
60: ; preds = %83, %57
%61 = phi i8* [ %54, %57 ], [ %85, %83 ]
%62 = phi i8* [ %9, %57 ], [ %84, %83 ]
%63 = ptrtoint i8* %62 to i64
%64 = load i8, i8* %61
switch i8 %64, label %83 [
i8 0, label %86
i8 32, label %65
i8 9, label %65
i8 10, label %65
]
65: ; preds = %60, %60, %60
%66 = icmp ugt i8* %62, %9
br i1 %66, label %67, label %78
67: ; preds = %65
%68 = getelementptr i8, i8* %59, i64 %63
br label %69
69: ; preds = %67, %75
%70 = phi i8* [ %76, %75 ], [ %9, %67 ]
%71 = load i8, i8* %70
%72 = icmp eq i8 %71, 0
%73 = icmp eq i8 %71, %64
%74 = select i1 %72, i1 true, i1 %73
br i1 %74, label %78, label %75
75: ; preds = %69
%76 = getelementptr inbounds i8, i8* %70, i64 1
%77 = icmp eq i8* %76, %68
br i1 %77, label %78, label %69
78: ; preds = %69, %75, %65
%79 = phi i8* [ %9, %65 ], [ %68, %75 ], [ %70, %69 ]
%80 = icmp eq i8* %79, %62
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = getelementptr inbounds i8, i8* %62, i64 1
store i8 %64, i8* %62
br label %83
83: ; preds = %78, %81, %60
%84 = phi i8* [ %62, %60 ], [ %82, %81 ], [ %62, %78 ]
%85 = getelementptr inbounds i8, i8* %61, i64 1
br label %60
86: ; preds = %60
store i8 0, i8* %62
br label %87
87: ; preds = %86, %56
%88 = phi i8* [ %54, %86 ], [ %9, %56 ]
store i64 0, i64* %4
%89 = load i8, i8* %0
%90 = icmp eq i8 %89, 0
br i1 %90, label %169, label %91
91: ; preds = %87
%92 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 1
br label %93
93: ; preds = %91, %163
%94 = phi i8 [ %89, %91 ], [ %167, %163 ]
%95 = phi i64 [ 0, %91 ], [ %165, %163 ]
%96 = sext i8 %94 to i32
switch i32 %96, label %140 [
i32 92, label %97
i32 36, label %100
i32 96, label %103
i32 34, label %113
i32 39, label %123
i32 126, label %133
i32 42, label %137
i32 91, label %137
i32 63, label %137
]
97: ; preds = %93
%98 = call i32 @parse_backslash(i8** %7, i64* %5, i64* %6, i8* %0, i64* %4)
%99 = icmp eq i32 %98, 0
br i1 %99, label %163, label %174
100: ; preds = %93
%101 = call i32 @parse_dollars(i8** %7, i64* %5, i64* %6, i8* %0, i64* %4, i32 %2, %struct.TYPE_9__* %1, i8* %88, i8* %9, i32 0)
%102 = icmp eq i32 %101, 0
br i1 %102, label %163, label %174
103: ; preds = %93
%104 = load i32, i32* @WRDE_NOCMD
%105 = and i32 %104, %2
%106 = icmp eq i32 %105, 0
br i1 %106, label %109, label %107
107: ; preds = %103
%108 = load i32, i32* @WRDE_CMDSUB
br label %174
109: ; preds = %103
%110 = add i64 %95, 1
store i64 %110, i64* %4
%111 = call i32 @parse_backtick(i8** %7, i64* %5, i64* %6, i8* %0, i64* %4, i32 %2, %struct.TYPE_9__* %1, i8* %88, i8* %9)
%112 = icmp eq i32 %111, 0
br i1 %112, label %163, label %174
113: ; preds = %93
%114 = add i64 %95, 1
store i64 %114, i64* %4
%115 = call i32 @parse_dquote(i8** %7, i64* %5, i64* %6, i8* %0, i64* %4, i32 %2, %struct.TYPE_9__* %1, i8* %88, i8* %9)
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %174
117: ; preds = %113
%118 = load i64, i64* %5
%119 = icmp eq i64 %118, 0
br i1 %119, label %120, label %163
120: ; preds = %117
%121 = call i32 @w_addword(%struct.TYPE_9__* %1, i8* null)
%122 = icmp eq i32 %121, 0
br i1 %122, label %163, label %193
123: ; preds = %93
%124 = add i64 %95, 1
store i64 %124, i64* %4
%125 = call i32 @parse_squote(i8** %7, i64* %5, i64* %6, i8* %0, i64* %4)
%126 = icmp eq i32 %125, 0
br i1 %126, label %127, label %174
127: ; preds = %123
%128 = load i64, i64* %5
%129 = icmp eq i64 %128, 0
br i1 %129, label %130, label %163
130: ; preds = %127
%131 = call i32 @w_addword(%struct.TYPE_9__* %1, i8* null)
%132 = icmp eq i32 %131, 0
br i1 %132, label %163, label %193
133: ; preds = %93
%134 = load i64, i64* %92
%135 = call i32 @parse_tilde(i8** %7, i64* %5, i64* %6, i8* %0, i64* %4, i64 %134)
%136 = icmp eq i32 %135, 0
br i1 %136, label %163, label %174
137: ; preds = %93, %93, %93
%138 = call i32 @parse_glob(i8** %7, i64* %5, i64* %6, i8* %0, i64* %4, i32 %2, %struct.TYPE_9__* %1, i8* %88, i8* %9)
%139 = icmp eq i32 %138, 0
br i1 %139, label %163, label %174
140: ; preds = %93
%141 = call i32* @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %94)
%142 = icmp eq i32* %141, null
br i1 %142, label %143, label %155
143: ; preds = %140
%144 = load i64, i64* %4
%145 = getelementptr inbounds i8, i8* %0, i64 %144
%146 = load i8, i8* %145
%147 = call i32* @strchr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8 signext %146)
%148 = icmp eq i32* %147, null
br i1 %148, label %151, label %149
149: ; preds = %143
%150 = load i32, i32* @WRDE_BADCHAR
br label %174
151: ; preds = %143
%152 = load i8*, i8** %7
%153 = call i8* @w_addchar(i8* %152, i64* %5, i64* %6, i8 signext %146)
store i8* %153, i8** %7
%154 = icmp eq i8* %153, null
br i1 %154, label %180, label %163
155: ; preds = %140
%156 = load i8*, i8** %7
%157 = icmp eq i8* %156, null
br i1 %157, label %161, label %158
158: ; preds = %155
%159 = call i32 @w_addword(%struct.TYPE_9__* %1, i8* %156)
%160 = icmp eq i32 %159, 0
br i1 %160, label %161, label %174
161: ; preds = %158, %155
%162 = call i8* @w_newword(i64* %5, i64* %6)
store i8* %162, i8** %7
br label %163
163: ; preds = %151, %161, %97, %100, %109, %120, %117, %130, %127, %133, %137
%164 = load i64, i64* %4
%165 = add i64 %164, 1
store i64 %165, i64* %4
%166 = getelementptr inbounds i8, i8* %0, i64 %165
%167 = load i8, i8* %166
%168 = icmp eq i8 %167, 0
br i1 %168, label %169, label %93
169: ; preds = %163, %87
%170 = load i8*, i8** %7
%171 = icmp eq i8* %170, null
br i1 %171, label %193, label %172
172: ; preds = %169
%173 = call i32 @w_addword(%struct.TYPE_9__* %1, i8* %170)
br label %193
174: ; preds = %158, %137, %133, %123, %113, %109, %100, %97, %149, %107, %49, %43
%175 = phi i32 [ %150, %149 ], [ %50, %49 ], [ %108, %107 ], [ %44, %43 ], [ %159, %158 ], [ %138, %137 ], [ %135, %133 ], [ %125, %123 ], [ %115, %113 ], [ %111, %109 ], [ %101, %100 ], [ %98, %97 ]
%176 = load i8*, i8** %7
%177 = icmp eq i8* %176, null
br i1 %177, label %182, label %178
178: ; preds = %174
%179 = call i32 @free(i8* %176)
br label %182
180: ; preds = %151
%181 = load i32, i32* @WRDE_NOSPACE
br label %182
182: ; preds = %180, %178, %174
%183 = phi i32 [ %175, %178 ], [ %175, %174 ], [ %181, %180 ]
%184 = load i32, i32* @WRDE_NOSPACE
%185 = icmp eq i32 %183, %184
br i1 %185, label %193, label %186
186: ; preds = %182
%187 = load i32, i32* @WRDE_APPEND
%188 = and i32 %187, %2
%189 = icmp eq i32 %188, 0
br i1 %189, label %190, label %192
190: ; preds = %186
%191 = call i32 @wordfree(%struct.TYPE_9__* %1)
br label %192
192: ; preds = %190, %186
store i32* %27, i32** %19
br label %193
193: ; preds = %130, %120, %182, %169, %192, %172
%194 = phi i32 [ %183, %192 ], [ %173, %172 ], [ 0, %169 ], [ %183, %182 ], [ %131, %130 ], [ %121, %120 ]
ret i32 %194
}