int ft_parsefilename(filename, name, extn, nmaxlen, indx, tail, tmaxlen)
char *filename;
char *name;
char *extn;
int nmaxlen;
int *indx;
char *tail;
int tmaxlen;
{
  char *f, *t;
  char *tbuf, *tbuf2;
  int i, len;
  int got;
  int cflag;
  *extn = '\0';
  *indx = -1;
  *tail = '\0';
  cflag = 0;
  if ((filename == 0) || (*filename == '\0'))
    return 0;
  if (!strncasecmp(filename, "pipe:", 5)) {
    strncpy(name, filename, nmaxlen);
    return 0;
  }
  tbuf = (char *)malloc(strlen(filename) + 1);
  tbuf2 = (char *)malloc(strlen(filename) + 1);
  f = filename;
  nmaxlen--;
  tmaxlen--;
  for (*tbuf = '\0', t = tbuf; (*f != '\0') && (*f != '[') && (*f != ',');)
    *t++ = *f++;
  *t = '\0';
  strncpy(name, tbuf, nmaxlen);
  name[nmaxlen] = '\0';
  if (*f == '\0')
    goto cleanup;
  else
    f++;
  switch (GetWordType(&f, tbuf, &cflag)) {
  case 0:
    break;
  case 1:
    strcpy(extn, tbuf);
    *tbuf = '\0';
    if (*f == ',') {
      f++;
      switch (GetWordType(&f, tbuf, &cflag)) {
      case 2:
        *indx = strtol(tbuf, 0, 10);
        *tbuf = '\0';
        if (*f == ',')
          f++;
        break;
      default:
        break;
      }
    }
    break;
  case 2:
    *indx = strtol(tbuf, 0, 10);
    *tbuf = '\0';
    if (*f == ',')
      f++;
    break;
  case 3:
    break;
  }
  strcpy(tbuf2, "[");
  if (*tbuf != '\0')
    strcat(tbuf2, tbuf);
  if (*f != '\0')
    strcat(tbuf2, f);
  strncpy(tail, tbuf2, tmaxlen);
  tail[tmaxlen] = '\0';
  len = strlen(tail);
  for (i = 0; i < len; i++) {
    if ((tail[i] == '[') && (i + 2 < len) && (tail[i + 1] == ']')) {
      strcpy(tbuf, &(tail[i + 2]));
      strcpy(&(tail[i]), tbuf);
    }
  }
  len = strlen(tail);
  for (got = 0, i = 0; i < len; i++) {
    if ((tail[i] != '[') && (tail[i] != ']') && (tail[i] != ' ')) {
      got = 1;
      break;
    }
  }
  if (!got)
    *tail = '\0';
cleanup:
  if (tbuf != 0)
    free(tbuf);
  if (tbuf2 != 0)
    free(tbuf2);
  return cflag;
}


x86 assembly (clang, -O0):
<ft_parsefilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x68(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11ef <ft_parsefilename+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11fb <ft_parsefilename+0x6b>
movl   $0x0,-0x4(%rbp)
jmp    1636 <ft_parsefilename+0x4a6>
mov    -0x10(%rbp),%rdi
lea    0xe0a(%rip),%rsi
mov    $0x5,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1236 <ft_parsefilename+0xa6>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rdx
call   1040 <strncpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    1636 <ft_parsefilename+0x4a6>
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
mov    0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,0x10(%rbp)
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x50(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x69(%rbp)
je     12cb <ft_parsefilename+0x13b>
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5b,%ecx
mov    %al,-0x69(%rbp)
je     12cb <ft_parsefilename+0x13b>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
setne  %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    12db <ft_parsefilename+0x14b>
jmp    1302 <ft_parsefilename+0x172>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40(%rbp)
mov    (%rax),%cl
mov    -0x48(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x48(%rbp)
mov    %cl,(%rax)
jmp    1291 <ft_parsefilename+0x101>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%rsi
movslq -0x24(%rbp),%rdx
call   1040 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    133b <ft_parsefilename+0x1ab>
jmp    1608 <ft_parsefilename+0x478>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x50(%rbp),%rsi
xor    %eax,%eax
lea    -0x40(%rbp),%rdi
lea    -0x68(%rbp),%rdx
call   10a0 <GetWordType@plt>
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x3,%eax
ja     146b <ft_parsefilename+0x2db>
mov    -0x78(%rbp),%rax
lea    0xc8c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    146b <ft_parsefilename+0x2db>
mov    -0x20(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    141f <ft_parsefilename+0x28f>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x50(%rbp),%rsi
xor    %eax,%eax
lea    -0x40(%rbp),%rdi
lea    -0x68(%rbp),%rdx
call   10a0 <GetWordType@plt>
sub    $0x2,%eax
jne    1415 <ft_parsefilename+0x285>
jmp    13d3 <ft_parsefilename+0x243>
mov    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1410 <ft_parsefilename+0x280>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    141a <ft_parsefilename+0x28a>
jmp    141a <ft_parsefilename+0x28a>
jmp    141f <ft_parsefilename+0x28f>
jmp    146b <ft_parsefilename+0x2db>
mov    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1461 <ft_parsefilename+0x2d1>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    146b <ft_parsefilename+0x2db>
jmp    146b <ft_parsefilename+0x2db>
mov    -0x58(%rbp),%rdi
lea    0xba0(%rip),%rsi
call   1050 <strcpy@plt>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1498 <ft_parsefilename+0x308>
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   10b0 <strcat@plt>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     14b5 <ft_parsefilename+0x325>
mov    -0x58(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   10b0 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
movslq 0x10(%rbp),%rdx
call   1040 <strncpy@plt>
mov    -0x38(%rbp),%rax
movslq 0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x60(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    156e <ft_parsefilename+0x3de>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5b,%eax
jne    155b <ft_parsefilename+0x3cb>
mov    -0x5c(%rbp),%eax
add    $0x2,%eax
cmp    -0x60(%rbp),%eax
jge    155b <ft_parsefilename+0x3cb>
mov    -0x38(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
jne    155b <ft_parsefilename+0x3cb>
mov    -0x50(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x5c(%rbp),%eax
add    $0x2,%eax
cltq
add    %rax,%rsi
call   1050 <strcpy@plt>
mov    -0x38(%rbp),%rdi
movslq -0x5c(%rbp),%rax
add    %rax,%rdi
mov    -0x50(%rbp),%rsi
call   1050 <strcpy@plt>
jmp    1560 <ft_parsefilename+0x3d0>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    14e5 <ft_parsefilename+0x355>
mov    -0x38(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    15f2 <ft_parsefilename+0x462>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5b,%eax
je     15df <ft_parsefilename+0x44f>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
je     15df <ft_parsefilename+0x44f>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     15df <ft_parsefilename+0x44f>
movl   $0x1,-0x64(%rbp)
jmp    15f2 <ft_parsefilename+0x462>
jmp    15e4 <ft_parsefilename+0x454>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1588 <ft_parsefilename+0x3f8>
cmpl   $0x0,-0x64(%rbp)
jne    1603 <ft_parsefilename+0x473>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
jmp    1608 <ft_parsefilename+0x478>
cmpq   $0x0,-0x50(%rbp)
je     161c <ft_parsefilename+0x48c>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x58(%rbp)
je     1630 <ft_parsefilename+0x4a0>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_parsefilename>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movb   $0x0,(%rdx)
movl   $0xffffffff,(%r8)
movb   $0x0,(%r9)
movl   $0x0,0x14(%rsp)
xor    %ebx,%ebx
test   %rdi,%rdi
je     14b0 <ft_parsefilename+0x320>
mov    %rdi,%r14
mov    (%rdi),%r15b
test   %r15b,%r15b
je     14b0 <ft_parsefilename+0x320>
mov    %r8,%rbp
mov    %ecx,%r12d
mov    %rsi,0x30(%rsp)
mov    %rdx,0x38(%rsp)
mov    %r9,0x40(%rsp)
lea    0xe16(%rip),%rsi
mov    $0x5,%edx
mov    %r14,%rdi
call   1090 <strncasecmp@plt>
movslq %r12d,%r13
test   %eax,%eax
je     1360 <ft_parsefilename+0x1d0>
mov    %rbp,0x20(%rsp)
mov    0x80(%rsp),%ebp
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%rbx
mov    %rbx,%rdi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1080 <malloc@plt>
mov    %rax,0x18(%rsp)
add    $0xffffffffffffffff,%r13
movslq %ebp,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,0x28(%rsp)
movb   $0x0,(%r12)
xor    %ebx,%ebx
mov    0x8(%rsp),%rcx
mov    %r14,%rax
test   %r15b,%r15b
je     1286 <ft_parsefilename+0xf6>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x2c,%r15b
je     1286 <ft_parsefilename+0xf6>
cmp    $0x5b,%r15b
je     1286 <ft_parsefilename+0xf6>
add    $0x1,%rax
mov    %r15b,(%r12,%rbx,1)
movzbl 0x1(%r14,%rbx,1),%r15d
add    $0x1,%rbx
mov    %rax,%rcx
test   %r15b,%r15b
jne    1260 <ft_parsefilename+0xd0>
mov    %rcx,0x8(%rsp)
movb   $0x0,(%r12,%rbx,1)
mov    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <strncpy@plt>
movb   $0x0,0x0(%rbp,%r13,1)
cmpb   $0x0,(%r14,%rbx,1)
mov    0x40(%rsp),%r13
je     1495 <ft_parsefilename+0x305>
lea    (%r14,%rbx,1),%rax
add    $0x1,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rdx
mov    %r12,%rsi
xor    %eax,%eax
call   10a0 <GetWordType@plt>
cmp    $0x2,%eax
je     1375 <ft_parsefilename+0x1e5>
cmp    $0x1,%eax
mov    0x18(%rsp),%rbx
mov    0x28(%rsp),%rbp
jne    13ad <ft_parsefilename+0x21d>
mov    0x38(%rsp),%rdi
mov    %r12,%rsi
call   1050 <strcpy@plt>
movb   $0x0,(%r12)
mov    0x8(%rsp),%rax
cmpb   $0x2c,(%rax)
jne    1359 <ft_parsefilename+0x1c9>
add    $0x1,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rdx
mov    %r12,%rsi
xor    %eax,%eax
call   10a0 <GetWordType@plt>
cmp    $0x2,%eax
jne    13ad <ft_parsefilename+0x21d>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    0x20(%rsp),%rcx
mov    %eax,(%rcx)
movb   $0x0,(%r12)
mov    0x8(%rsp),%rax
cmpb   $0x2c,(%rax)
je     13a4 <ft_parsefilename+0x214>
movw   $0x5b,(%rbx)
jmp    13c4 <ft_parsefilename+0x234>
mov    0x30(%rsp),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1040 <strncpy@plt>
jmp    14b0 <ft_parsefilename+0x320>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    0x20(%rsp),%rcx
mov    %eax,(%rcx)
movb   $0x0,(%r12)
mov    0x8(%rsp),%rax
cmpb   $0x2c,(%rax)
mov    0x18(%rsp),%rbx
mov    0x28(%rsp),%rbp
jne    1359 <ft_parsefilename+0x1c9>
add    $0x1,%rax
mov    %rax,0x8(%rsp)
cmpb   $0x0,(%r12)
movw   $0x5b,(%rbx)
je     13c4 <ft_parsefilename+0x234>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10b0 <strcat@plt>
mov    0x8(%rsp),%rsi
cmpb   $0x0,(%rsi)
je     13d6 <ft_parsefilename+0x246>
mov    %rbx,%rdi
call   10b0 <strcat@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1040 <strncpy@plt>
movb   $0x0,0x0(%r13,%rbp,1)
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %rax,%r14
test   %r14d,%r14d
jle    144f <ft_parsefilename+0x2bf>
mov    %r14d,%r15d
neg    %r15
mov    $0x2,%ebp
mov    %r13,%rbx
jmp    1426 <ft_parsefilename+0x296>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
lea    (%r15,%rbp,1),%rax
add    $0x1,%rax
add    $0x1,%rbp
cmp    $0x2,%rax
je     144f <ft_parsefilename+0x2bf>
cmpb   $0x5b,(%rbx)
jne    1410 <ft_parsefilename+0x280>
cmp    %r14d,%ebp
jge    1410 <ft_parsefilename+0x280>
cmpb   $0x5d,0x1(%rbx)
jne    1410 <ft_parsefilename+0x280>
lea    0x2(%rbx),%rsi
mov    %r12,%rdi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strcpy@plt>
jmp    1410 <ft_parsefilename+0x280>
mov    %r13,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    1490 <ft_parsefilename+0x300>
mov    %eax,%eax
xor    %ecx,%ecx
movabs $0x2800000000000001,%rdx
nopl   0x0(%rax)
movzbl 0x0(%r13,%rcx,1),%ebx
add    $0xe0,%bl
cmp    $0x3d,%bl
ja     1495 <ft_parsefilename+0x305>
movzbl %bl,%esi
bt     %rsi,%rdx
jae    1495 <ft_parsefilename+0x305>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1470 <ft_parsefilename+0x2e0>
movb   $0x0,0x0(%r13)
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     14ac <ft_parsefilename+0x31c>
call   1030 <free@plt>
mov    0x14(%rsp),%ebx
mov    %ebx,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pipe:\00"
@.str.1 = [2 x i8] c"[\00"
define i32 @ft_parsefilename(i8* %0, i8* %1, i8* %2, i32 %3, i32* %4, i8* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32 %3, i32* %12
store i32* %4, i32** %13
store i8* %5, i8** %14
store i32 %6, i32* %15
%24 = load i8*, i8** %11
store i8 0, i8* %24
%25 = load i32*, i32** %13
store i32 -1, i32* %25
%26 = load i8*, i8** %14
store i8 0, i8* %26
store i32 0, i32* %23
%27 = load i8*, i8** %9
%28 = icmp eq i8* %27, null
br i1 %28, label %34, label %29
29: ; preds = %7
%30 = load i8*, i8** %9
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %29, %7
store i32 0, i32* %8
br label %285
35: ; preds = %29
%36 = load i8*, i8** %9
%37 = call i32 @strncasecmp(i8* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5)
%38 = icmp ne i32 %37, 0
br i1 %38, label %45, label %39
39: ; preds = %35
%40 = load i8*, i8** %10
%41 = load i8*, i8** %9
%42 = load i32, i32* %12
%43 = sext i32 %42 to i64
%44 = call i8* @strncpy(i8* %40, i8* %41, i64 %43)
store i32 0, i32* %8
br label %285
45: ; preds = %35
%46 = load i8*, i8** %9
%47 = call i64 @strlen(i8* %46)
%48 = add i64 %47, 1
%49 = call i8* @malloc(i64 %48)
store i8* %49, i8** %18
%50 = load i8*, i8** %9
%51 = call i64 @strlen(i8* %50)
%52 = add i64 %51, 1
%53 = call i8* @malloc(i64 %52)
store i8* %53, i8** %19
%54 = load i8*, i8** %9
store i8* %54, i8** %16
%55 = load i32, i32* %12
%56 = add nsw i32 %55, -1
store i32 %56, i32* %12
%57 = load i32, i32* %15
%58 = add nsw i32 %57, -1
store i32 %58, i32* %15
%59 = load i8*, i8** %18
store i8 0, i8* %59
%60 = load i8*, i8** %18
store i8* %60, i8** %17
br label %61
61: ; preds = %78, %45
%62 = load i8*, i8** %16
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %76
66: ; preds = %61
%67 = load i8*, i8** %16
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp ne i32 %69, 91
br i1 %70, label %71, label %76
71: ; preds = %66
%72 = load i8*, i8** %16
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 44
br label %76
76: ; preds = %71, %66, %61
%77 = phi i1 [ false, %66 ], [ false, %61 ], [ %75, %71 ]
br i1 %77, label %78, label %84
78: ; preds = %76
%79 = load i8*, i8** %16
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %16
%81 = load i8, i8* %79
%82 = load i8*, i8** %17
%83 = getelementptr inbounds i8, i8* %82, i32 1
store i8* %83, i8** %17
store i8 %81, i8* %82
br label %61
84: ; preds = %76
%85 = load i8*, i8** %17
store i8 0, i8* %85
%86 = load i8*, i8** %10
%87 = load i8*, i8** %18
%88 = load i32, i32* %12
%89 = sext i32 %88 to i64
%90 = call i8* @strncpy(i8* %86, i8* %87, i64 %89)
%91 = load i8*, i8** %10
%92 = load i32, i32* %12
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %91, i64 %93
store i8 0, i8* %94
%95 = load i8*, i8** %16
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %100
99: ; preds = %84
br label %273
100: ; preds = %84
%101 = load i8*, i8** %16
%102 = getelementptr inbounds i8, i8* %101, i32 1
store i8* %102, i8** %16
br label %103
103: ; preds = %100
%104 = load i8*, i8** %18
%105 = call i32 (i8**, i8*, i32*, ...) bitcast (i32 (...)* @GetWordType to i32 (i8**, i8*, i32*, ...)*)(i8** %16, i8* %104, i32* %23)
switch i32 %105, label %153 [
i32 0, label %106
i32 1, label %107
i32 2, label %138
i32 3, label %152
]
106: ; preds = %103
br label %153
107: ; preds = %103
%108 = load i8*, i8** %11
%109 = load i8*, i8** %18
%110 = call i8* @strcpy(i8* %108, i8* %109)
%111 = load i8*, i8** %18
store i8 0, i8* %111
%112 = load i8*, i8** %16
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 44
br i1 %115, label %116, label %137
116: ; preds = %107
%117 = load i8*, i8** %16
%118 = getelementptr inbounds i8, i8* %117, i32 1
store i8* %118, i8** %16
%119 = load i8*, i8** %18
%120 = call i32 (i8**, i8*, i32*, ...) bitcast (i32 (...)* @GetWordType to i32 (i8**, i8*, i32*, ...)*)(i8** %16, i8* %119, i32* %23)
switch i32 %120, label %135 [
i32 2, label %121
]
121: ; preds = %116
%122 = load i8*, i8** %18
%123 = call i64 @strtol(i8* %122, i8** null, i32 10)
%124 = trunc i64 %123 to i32
%125 = load i32*, i32** %13
store i32 %124, i32* %125
%126 = load i8*, i8** %18
store i8 0, i8* %126
%127 = load i8*, i8** %16
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = icmp eq i32 %129, 44
br i1 %130, label %131, label %134
131: ; preds = %121
%132 = load i8*, i8** %16
%133 = getelementptr inbounds i8, i8* %132, i32 1
store i8* %133, i8** %16
br label %134
134: ; preds = %131, %121
br label %136
135: ; preds = %116
br label %136
136: ; preds = %135, %134
br label %137
137: ; preds = %136, %107
br label %153
138: ; preds = %103
%139 = load i8*, i8** %18
%140 = call i64 @strtol(i8* %139, i8** null, i32 10)
%141 = trunc i64 %140 to i32
%142 = load i32*, i32** %13
store i32 %141, i32* %142
%143 = load i8*, i8** %18
store i8 0, i8* %143
%144 = load i8*, i8** %16
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp eq i32 %146, 44
br i1 %147, label %148, label %151
148: ; preds = %138
%149 = load i8*, i8** %16
%150 = getelementptr inbounds i8, i8* %149, i32 1
store i8* %150, i8** %16
br label %151
151: ; preds = %148, %138
br label %153
152: ; preds = %103
br label %153
153: ; preds = %103, %152, %151, %137, %106
%154 = load i8*, i8** %19
%155 = call i8* @strcpy(i8* %154, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%156 = load i8*, i8** %18
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %164
160: ; preds = %153
%161 = load i8*, i8** %19
%162 = load i8*, i8** %18
%163 = call i8* @strcat(i8* %161, i8* %162)
br label %164
164: ; preds = %160, %153
%165 = load i8*, i8** %16
%166 = load i8, i8* %165
%167 = sext i8 %166 to i32
%168 = icmp ne i32 %167, 0
br i1 %168, label %169, label %173
169: ; preds = %164
%170 = load i8*, i8** %19
%171 = load i8*, i8** %16
%172 = call i8* @strcat(i8* %170, i8* %171)
br label %173
173: ; preds = %169, %164
%174 = load i8*, i8** %14
%175 = load i8*, i8** %19
%176 = load i32, i32* %15
%177 = sext i32 %176 to i64
%178 = call i8* @strncpy(i8* %174, i8* %175, i64 %177)
%179 = load i8*, i8** %14
%180 = load i32, i32* %15
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8, i8* %179, i64 %181
store i8 0, i8* %182
%183 = load i8*, i8** %14
%184 = call i64 @strlen(i8* %183)
%185 = trunc i64 %184 to i32
store i32 %185, i32* %21
store i32 0, i32* %20
br label %186
186: ; preds = %227, %173
%187 = load i32, i32* %20
%188 = load i32, i32* %21
%189 = icmp slt i32 %187, %188
br i1 %189, label %190, label %230
190: ; preds = %186
%191 = load i8*, i8** %14
%192 = load i32, i32* %20
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds i8, i8* %191, i64 %193
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
%197 = icmp eq i32 %196, 91
br i1 %197, label %198, label %226
198: ; preds = %190
%199 = load i32, i32* %20
%200 = add nsw i32 %199, 2
%201 = load i32, i32* %21
%202 = icmp slt i32 %200, %201
br i1 %202, label %203, label %226
203: ; preds = %198
%204 = load i8*, i8** %14
%205 = load i32, i32* %20
%206 = add nsw i32 %205, 1
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i8, i8* %204, i64 %207
%209 = load i8, i8* %208
%210 = sext i8 %209 to i32
%211 = icmp eq i32 %210, 93
br i1 %211, label %212, label %226
212: ; preds = %203
%213 = load i8*, i8** %18
%214 = load i8*, i8** %14
%215 = load i32, i32* %20
%216 = add nsw i32 %215, 2
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds i8, i8* %214, i64 %217
%219 = call i8* @strcpy(i8* %213, i8* %218)
%220 = load i8*, i8** %14
%221 = load i32, i32* %20
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i8, i8* %220, i64 %222
%224 = load i8*, i8** %18
%225 = call i8* @strcpy(i8* %223, i8* %224)
br label %226
226: ; preds = %212, %203, %198, %190
br label %227
227: ; preds = %226
%228 = load i32, i32* %20
%229 = add nsw i32 %228, 1
store i32 %229, i32* %20
br label %186
230: ; preds = %186
%231 = load i8*, i8** %14
%232 = call i64 @strlen(i8* %231)
%233 = trunc i64 %232 to i32
store i32 %233, i32* %21
store i32 0, i32* %22
store i32 0, i32* %20
br label %234
234: ; preds = %264, %230
%235 = load i32, i32* %20
%236 = load i32, i32* %21
%237 = icmp slt i32 %235, %236
br i1 %237, label %238, label %267
238: ; preds = %234
%239 = load i8*, i8** %14
%240 = load i32, i32* %20
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds i8, i8* %239, i64 %241
%243 = load i8, i8* %242
%244 = sext i8 %243 to i32
%245 = icmp ne i32 %244, 91
br i1 %245, label %246, label %263
246: ; preds = %238
%247 = load i8*, i8** %14
%248 = load i32, i32* %20
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds i8, i8* %247, i64 %249
%251 = load i8, i8* %250
%252 = sext i8 %251 to i32
%253 = icmp ne i32 %252, 93
br i1 %253, label %254, label %263
254: ; preds = %246
%255 = load i8*, i8** %14
%256 = load i32, i32* %20
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds i8, i8* %255, i64 %257
%259 = load i8, i8* %258
%260 = sext i8 %259 to i32
%261 = icmp ne i32 %260, 32
br i1 %261, label %262, label %263
262: ; preds = %254
store i32 1, i32* %22
br label %267
263: ; preds = %254, %246, %238
br label %264
264: ; preds = %263
%265 = load i32, i32* %20
%266 = add nsw i32 %265, 1
store i32 %266, i32* %20
br label %234
267: ; preds = %262, %234
%268 = load i32, i32* %22
%269 = icmp ne i32 %268, 0
br i1 %269, label %272, label %270
270: ; preds = %267
%271 = load i8*, i8** %14
store i8 0, i8* %271
br label %272
272: ; preds = %270, %267
br label %273
273: ; preds = %272, %99
%274 = load i8*, i8** %18
%275 = icmp ne i8* %274, null
br i1 %275, label %276, label %278
276: ; preds = %273
%277 = load i8*, i8** %18
br label %278
278: ; preds = %276, %273
%279 = load i8*, i8** %19
%280 = icmp ne i8* %279, null
br i1 %280, label %281, label %283
281: ; preds = %278
%282 = load i8*, i8** %19
br label %283
283: ; preds = %281, %278
%284 = load i32, i32* %23
store i32 %284, i32* %8
br label %285
285: ; preds = %283, %39, %34
%286 = load i32, i32* %8
ret i32 %286
}

LLVM IR (-O2):
@.str = [6 x i8] c"pipe:\00"
define i32 @ft_parsefilename(i8* %0, i8* %1, i8* %2, i32 %3, i32* nocapture writeonly %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = bitcast i8** %8 to i8*
%11 = bitcast i32* %9 to i8*
store i8 0, i8* %2
store i32 -1, i32* %4
store i8 0, i8* %5
store i32 0, i32* %9
%12 = icmp eq i8* %0, null
br i1 %12, label %136, label %13
13: ; preds = %7
%14 = load i8, i8* %0
%15 = icmp eq i8 %14, 0
br i1 %15, label %136, label %16
16: ; preds = %13
%17 = tail call i32 @strncasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = sext i32 %3 to i64
%21 = tail call i8* @strncpy(i8* dereferenceable(1) %1, i8* %0, i64 %20)
br label %136
22: ; preds = %16
%23 = tail call i64 @strlen(i8* %0)
%24 = add i64 %23, 1
%25 = tail call i8* @malloc(i64 %24)
%26 = tail call i8* @malloc(i64 %24)
%27 = add nsw i32 %3, -1
%28 = add nsw i32 %6, -1
store i8 0, i8* %25
%29 = load i8*, i8** %8
br label %30
30: ; preds = %35, %22
%31 = phi i8* [ %29, %22 ], [ %36, %35 ]
%32 = phi i8 [ %14, %22 ], [ %38, %35 ]
%33 = phi i8* [ %0, %22 ], [ %36, %35 ]
%34 = phi i8* [ %25, %22 ], [ %37, %35 ]
switch i8 %32, label %35 [
i8 0, label %39
i8 91, label %39
i8 44, label %39
]
35: ; preds = %30
%36 = getelementptr inbounds i8, i8* %33, i64 1
%37 = getelementptr inbounds i8, i8* %34, i64 1
store i8 %32, i8* %34
%38 = load i8, i8* %36
br label %30
39: ; preds = %30, %30, %30
store i8* %31, i8** %8
store i8 0, i8* %34
%40 = sext i32 %27 to i64
%41 = tail call i8* @strncpy(i8* dereferenceable(1) %1, i8* %25, i64 %40)
%42 = getelementptr inbounds i8, i8* %1, i64 %40
store i8 0, i8* %42
%43 = load i8, i8* %33
%44 = icmp eq i8 %43, 0
br i1 %44, label %131, label %45
45: ; preds = %39
%46 = getelementptr inbounds i8, i8* %33, i64 1
store i8* %46, i8** %8
%47 = call i32 (i8**, i8*, i32*, ...) bitcast (i32 (...)* @GetWordType to i32 (i8**, i8*, i32*, ...)*)(i8** %8, i8* %25, i32* %9)
switch i32 %47, label %75 [
i32 2, label %65
i32 1, label %48
]
48: ; preds = %45
%49 = call i8* @strcpy(i8* %2, i8* %25)
store i8 0, i8* %25
%50 = load i8*, i8** %8
%51 = load i8, i8* %50
%52 = icmp eq i8 %51, 44
br i1 %52, label %53, label %73
53: ; preds = %48
%54 = getelementptr inbounds i8, i8* %50, i64 1
store i8* %54, i8** %8
%55 = call i32 (i8**, i8*, i32*, ...) bitcast (i32 (...)* @GetWordType to i32 (i8**, i8*, i32*, ...)*)(i8** %8, i8* %25, i32* %9)
%56 = icmp eq i32 %55, 2
br i1 %56, label %57, label %75
57: ; preds = %53
%58 = call i64 @strtol(i8* nocapture %25, i8** null, i32 10)
%59 = trunc i64 %58 to i32
store i32 %59, i32* %4
store i8 0, i8* %25
%60 = load i8*, i8** %8
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 44
br i1 %62, label %63, label %73
63: ; preds = %57
%64 = getelementptr inbounds i8, i8* %60, i64 1
store i8* %64, i8** %8
br label %75
65: ; preds = %45
%66 = call i64 @strtol(i8* nocapture %25, i8** null, i32 10)
%67 = trunc i64 %66 to i32
store i32 %67, i32* %4
store i8 0, i8* %25
%68 = load i8*, i8** %8
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 44
br i1 %70, label %71, label %73
71: ; preds = %65
%72 = getelementptr inbounds i8, i8* %68, i64 1
store i8* %72, i8** %8
br label %75
73: ; preds = %65, %48, %57
%74 = bitcast i8* %26 to i16*
store i16 91, i16* %74
br label %81
75: ; preds = %71, %53, %63, %45
%76 = load i8, i8* %25
%77 = bitcast i8* %26 to i16*
store i16 91, i16* %77
%78 = icmp eq i8 %76, 0
br i1 %78, label %81, label %79
79: ; preds = %75
%80 = call i8* @strcat(i8* dereferenceable(1) %26, i8* %25)
br label %81
81: ; preds = %73, %79, %75
%82 = load i8*, i8** %8
%83 = load i8, i8* %82
%84 = icmp eq i8 %83, 0
br i1 %84, label %87, label %85
85: ; preds = %81
%86 = call i8* @strcat(i8* dereferenceable(1) %26, i8* %82)
br label %87
87: ; preds = %85, %81
%88 = sext i32 %28 to i64
%89 = call i8* @strncpy(i8* %5, i8* %26, i64 %88)
%90 = getelementptr inbounds i8, i8* %5, i64 %88
store i8 0, i8* %90
%91 = call i64 @strlen(i8* %5)
%92 = trunc i64 %91 to i32
%93 = icmp sgt i32 %92, 0
br i1 %93, label %94, label %117
94: ; preds = %87
%95 = and i64 %91, 4294967295
br label %96
96: ; preds = %94, %114
%97 = phi i64 [ 0, %94 ], [ %115, %114 ]
%98 = getelementptr inbounds i8, i8* %5, i64 %97
%99 = load i8, i8* %98
%100 = icmp eq i8 %99, 91
br i1 %100, label %101, label %114
101: ; preds = %96
%102 = add nuw nsw i64 %97, 2
%103 = trunc i64 %102 to i32
%104 = icmp slt i32 %103, %92
br i1 %104, label %105, label %114
105: ; preds = %101
%106 = add nuw nsw i64 %97, 1
%107 = getelementptr inbounds i8, i8* %5, i64 %106
%108 = load i8, i8* %107
%109 = icmp eq i8 %108, 93
br i1 %109, label %110, label %114
110: ; preds = %105
%111 = getelementptr inbounds i8, i8* %5, i64 %102
%112 = call i8* @strcpy(i8* %25, i8* %111)
%113 = call i8* @strcpy(i8* %98, i8* %25)
br label %114
114: ; preds = %96, %101, %105, %110
%115 = add nuw nsw i64 %97, 1
%116 = icmp eq i64 %115, %95
br i1 %116, label %117, label %96
117: ; preds = %114, %87
%118 = call i64 @strlen(i8* %5)
%119 = trunc i64 %118 to i32
%120 = icmp sgt i32 %119, 0
br i1 %120, label %121, label %130
121: ; preds = %117
%122 = and i64 %118, 4294967295
br label %123
123: ; preds = %121, %127
%124 = phi i64 [ 0, %121 ], [ %128, %127 ]
%125 = getelementptr inbounds i8, i8* %5, i64 %124
%126 = load i8, i8* %125
switch i8 %126, label %131 [
i8 91, label %127
i8 93, label %127
i8 32, label %127
]
127: ; preds = %123, %123, %123
%128 = add nuw nsw i64 %124, 1
%129 = icmp eq i64 %128, %122
br i1 %129, label %130, label %123
130: ; preds = %127, %117
store i8 0, i8* %5
br label %131
131: ; preds = %123, %39, %130
%132 = icmp eq i8* %26, null
br i1 %132, label %134, label %133
133: ; preds = %131
br label %134
134: ; preds = %133, %131
%135 = load i32, i32* %9
br label %136
136: ; preds = %7, %13, %134, %19
%137 = phi i32 [ %135, %134 ], [ 0, %19 ], [ 0, %13 ], [ 0, %7 ]
ret i32 %137
}