#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int MAXPATHLEN;
char *_HE(char const *);
char *get_home_etc(int);
char *get_home_etc_static_n(int);
int /*<<< orphan*/ getc(int /*<<< orphan*/);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ home_etc_expand_tilde(int);
char *home_etc_path(char const *, int);
char *path_canonize(char const *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char b[MAXPATHLEN * 2];
  int x;
  const char *a[] = {"aaaa/.muttrc",
                     ".muttrc",
                     "aaa/bbb/ccc/",
                     "aaa/bbb/",
                     "/home/users/siefca/.muttrc",
                     "/home/users/siefca/.muttrc/xxx",
                     "/home/users/siefca/.a",
                     "/home/../home/users/siefca/hmm",
                     "/home/../home/users/siefca/hmm/",
                     "/home/users/siefca/.muttrc/",
                     "tmp/.muttrc",
                     "tmp/.muttrc/",
                     "~/.muttrc",
                     "~/muttrc/",
                     "//.muttrc",
                     "~noexpand",
                     "~",
                     "~/",
                     "/////",
                     "/x"};
  home_etc_expand_tilde(1);
  getcwd(b, sizeof(b) - 1);
  b[MAXPATHLEN - 1] = '\0';
  printf("\nHOME_ETC:\t%s\n", get_home_etc(1));
  printf("current directory: %s\n\n", b);
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x < sizeof(a) / sizeof(char *); x++) {
    printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", a[x],
           home_etc_path(a[x], 1));
  }
  printf("\n----------------------------\n"
         "hard-core tests\n"
         "----------------------------\n");
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN + 8; x++)
    b[x] = '/';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         home_etc_path(b, 1));
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN + 8; x++)
    b[x] = 'a';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         home_etc_path(b, 1));
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN - 128; x++)
    b[x] = 'b';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         home_etc_path(b, 1));
  printf("\n----------------------------\n"
         "wrapper tests\n"
         "----------------------------\n");
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x < sizeof(a) / sizeof(char *); x++) {
    printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", a[x],
           _HE(a[x]));
  }
  printf("\n----------------------------\n"
         "wrapper hard-core tests\n"
         "----------------------------\n");
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN + 8; x++)
    b[x] = '/';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         _HE(b));
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN + 8; x++)
    b[x] = 'a';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         _HE(b));
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN - 128; x++)
    b[x] = 'b';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         _HE(b));
  printf("press any key...\n");
  (void)getc(stdin);
  printf("_HEdir: %s\n", get_home_etc_static_n(1));
  printf("_HEndir: %s\n\n", get_home_etc_static_n(0));
  printf("\n----------------------------\n"
         "path_canonize tests\n"
         "----------------------------\n");
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x < sizeof(a) / sizeof(char *); x++) {
    printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", a[x],
           path_canonize(a[x], 1));
  }
  printf("press any key...\n");
  (void)getc(stdin);
  printf("\n----------------------------\n"
         "path_canonize hard-core tests\n"
         "------------------------------\n");
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN + 8; x++)
    b[x] = '/';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         path_canonize(b, 1));
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN + 8; x++)
    b[x] = 'a';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         path_canonize(b, 1));
  printf("press any key...\n");
  (void)getc(stdin);
  for (x = 0; x <= MAXPATHLEN - 128; x++)
    b[x] = 'b';
  b[x] = '\0';
  printf(" path:\t\t%s\n result:\t%s\n----------------------------\n", b,
         path_canonize(b, 1));
  printf("press any key...\n");
  (void)getc(stdin);
  getcwd(b, sizeof(b) - 1);
  b[MAXPATHLEN - 1] = '\0';
  printf("\nHOME_ETC:\t%s\n", get_home_etc(1));
  printf("current directory: %s\n\n", b);
  printf("press any key...\n");
  (void)getc(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e20(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
mov    %rax,-0xe0(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xd8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0x2b71(%rip),%rsi
mov    $0xa0,%edx
call   10a0 <memcpy@plt>
mov    $0x1,%edi
call   1050 <home_etc_expand_tilde@plt>
mov    -0xd8(%rbp),%rdi
mov    -0xe0(%rbp),%rax
sub    $0x1,%rax
mov    %eax,%esi
call   1080 <getcwd@plt>
mov    -0xd8(%rbp),%rax
mov    0x2da6(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    $0x1,%edi
call   1030 <get_home_etc@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xd8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x14,%rax
jae    12f6 <main+0x156>
movslq -0x24(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rax
ff
mov    %rax,-0xe8(%rbp)
movslq -0x24(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rdi
ff
mov    $0x1,%esi
call   1070 <home_etc_path@plt>
mov    -0xe8(%rbp),%rsi
mov    %rax,%rdx
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1299 <main+0xf9>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2ccf(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2caf(%rip),%rcx
mov    (%rcx),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jg     135b <main+0x1bb>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1327 <main+0x187>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0x1,%esi
call   1070 <home_etc_path@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2c47(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2c27(%rip),%rcx
mov    (%rcx),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jg     13e3 <main+0x243>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13af <main+0x20f>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0x1,%esi
call   1070 <home_etc_path@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2bbf(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2b9f(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x80,%ecx
cmp    %ecx,%eax
jg     146e <main+0x2ce>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1437 <main+0x297>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0x1,%esi
call   1070 <home_etc_path@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0xcbe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc90(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2b26(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x14,%rax
jae    1528 <main+0x388>
movslq -0x24(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rax
ff
mov    %rax,-0xf0(%rbp)
movslq -0x24(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rdi
ff
call   10b0 <_HE@plt>
mov    -0xf0(%rbp),%rsi
mov    %rax,%rdx
lea    0xc43(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    14d0 <main+0x330>
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc07(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2a9d(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2a7d(%rip),%rcx
mov    (%rcx),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jg     158d <main+0x3ed>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1559 <main+0x3b9>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
call   10b0 <_HE@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0xba4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb84(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2a1a(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x29fa(%rip),%rcx
mov    (%rcx),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jg     1610 <main+0x470>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15dc <main+0x43c>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
call   10b0 <_HE@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0xb21(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb01(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2997(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2977(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x80,%ecx
cmp    %ecx,%eax
jg     1696 <main+0x4f6>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    165f <main+0x4bf>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
call   10b0 <_HE@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0xa9b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xa7b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2911(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
mov    $0x1,%edi
call   1040 <get_home_etc_static_n@plt>
mov    %rax,%rsi
lea    0xb83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1040 <get_home_etc_static_n@plt>
mov    %rax,%rsi
lea    0xb77(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb77(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xa1e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x28b4(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x14,%rax
jae    179f <main+0x5ff>
movslq -0x24(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rax
ff
mov    %rax,-0xf8(%rbp)
movslq -0x24(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rdi
ff
mov    $0x1,%esi
call   1090 <path_canonize@plt>
mov    -0xf8(%rbp),%rsi
mov    %rax,%rdx
lea    0x9cc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1742 <main+0x5a2>
lea    0x99e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2834(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
lea    0xb1d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x974(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x280a(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x27ea(%rip),%rcx
mov    (%rcx),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jg     1820 <main+0x680>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    17ec <main+0x64c>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0x1,%esi
call   1090 <path_canonize@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0x90c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x8ec(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2782(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2762(%rip),%rcx
mov    (%rcx),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jg     18a8 <main+0x708>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1874 <main+0x6d4>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0x1,%esi
call   1090 <path_canonize@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0x884(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x864(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x26fa(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x26da(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x80,%ecx
cmp    %ecx,%eax
jg     1933 <main+0x793>
mov    -0xd8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    18fc <main+0x75c>
mov    -0xd8(%rbp),%rdi
movslq -0x24(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0x1,%esi
call   1090 <path_canonize@plt>
mov    -0xd8(%rbp),%rsi
mov    %rax,%rdx
lea    0x7f9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x7d9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x266f(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
mov    -0xd8(%rbp),%rdi
mov    -0xe0(%rbp),%rax
sub    $0x1,%rax
mov    %eax,%esi
call   1080 <getcwd@plt>
mov    -0xd8(%rbp),%rax
mov    0x2639(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    $0x1,%edi
call   1030 <get_home_etc@plt>
mov    %rax,%rsi
lea    0x756(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xd8(%rbp),%rsi
lea    0x750(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x75a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x25f0(%rip),%rax
mov    (%rax),%edi
call   10c0 <getc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e1b(%rip),%r15
mov    (%r15),%ebx
lea    (%rbx,%rbx,1),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    $0x1,%edi
call   1060 <home_etc_expand_tilde@plt>
lea    (%rbx,%rbx,1),%esi
add    $0xffffffff,%esi
mov    %r14,%rdi
mov    %esi,-0x2c(%rbp)
call   10a0 <getcwd@plt>
movslq (%r15),%rax
movb   $0x0,-0x1(%rax,%r14,1)
mov    $0x1,%edi
call   1040 <get_home_etc@plt>
lea    0xf0c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x10f1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
lea    0x2b23(%rip),%r13
lea    0xef0(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%r13,1),%r12
mov    %r12,%rdi
mov    $0x1,%esi
call   1090 <home_etc_path@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x8,%rbx
cmp    $0xa0,%rbx
jne    1260 <main+0xb0>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0x1083(%rip),%rdi
call   1030 <puts@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    0x2d25(%rip),%r12
mov    (%r12),%eax
xor    %ebx,%ebx
cmp    $0xfffffff8,%eax
jl     12e1 <main+0x131>
add    $0x8,%eax
test   %eax,%eax
cmovg  %eax,%ebx
add    $0x1,%ebx
mov    %r14,%rdi
mov    $0x2f,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   1090 <home_etc_path@plt>
lea    0xe4a(%rip),%rdi
xor    %ebx,%ebx
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x1014(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    (%r12),%eax
cmp    $0xfffffff8,%eax
jl     1347 <main+0x197>
add    $0x8,%eax
test   %eax,%eax
cmovg  %eax,%ebx
add    $0x1,%ebx
mov    %r14,%rdi
mov    $0x61,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   1090 <home_etc_path@plt>
lea    0xde4(%rip),%rdi
xor    %r15d,%r15d
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xfad(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    (%r12),%ebx
cmp    $0x80,%ebx
jl     13ac <main+0x1fc>
add    $0xffffff81,%ebx
mov    %r14,%rdi
mov    $0x62,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
mov    %rbx,%r15
movb   $0x0,(%r14,%r15,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   1090 <home_etc_path@plt>
lea    0xd7f(%rip),%r12
xor    %r15d,%r15d
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
lea    0xbfb(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcd9(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xbca(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xbb8(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xba2(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb9e(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb9e(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb95(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb95(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb96(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb93(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb80(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb6e(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb59(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb44(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb2f(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb1a(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xafd(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xae1(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xac8(%rip),%rbx
mov    %rbx,%rdi
call   10c0 <_HE@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xbb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xca7(%rip),%rdi
call   1030 <puts@plt>
mov    0x295f(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    0x2949(%rip),%r12
mov    (%r12),%eax
cmp    $0xfffffff8,%eax
jl     16bd <main+0x50d>
add    $0x8,%eax
test   %eax,%eax
cmovg  %eax,%r15d
add    $0x1,%r15d
mov    %r14,%rdi
mov    $0x2f,%esi
mov    %r15,%rdx
call   1080 <memset@plt>
movb   $0x0,(%r14,%r15,1)
mov    %r14,%rdi
call   10c0 <_HE@plt>
lea    0xa73(%rip),%rdi
xor    %ebx,%ebx
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc3d(%rip),%rdi
call   1030 <puts@plt>
mov    0x28f5(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    (%r12),%eax
cmp    $0xfffffff8,%eax
jl     171e <main+0x56e>
add    $0x8,%eax
test   %eax,%eax
cmovg  %eax,%ebx
add    $0x1,%ebx
mov    %r14,%rdi
mov    $0x61,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rdi
call   10c0 <_HE@plt>
lea    0xa12(%rip),%rdi
xor    %r15d,%r15d
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xbdb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2893(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    (%r12),%ebx
cmp    $0x80,%ebx
jl     177e <main+0x5ce>
add    $0xffffff81,%ebx
mov    %r14,%rdi
mov    $0x62,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
mov    %rbx,%r15
movb   $0x0,(%r14,%r15,1)
mov    %r14,%rdi
call   10c0 <_HE@plt>
lea    0x9b2(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb7b(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x2830(%rip),%rbx
mov    (%rbx),%edi
call   10d0 <getc@plt>
mov    $0x1,%edi
call   1050 <get_home_etc_static_n@plt>
lea    0x9a9(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   1050 <get_home_etc_static_n@plt>
lea    0x99d(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa81(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   10d0 <getc@plt>
xor    %ebx,%ebx
nop
mov    (%rbx,%r13,1),%r15
mov    %r15,%rdi
mov    $0x1,%esi
call   10b0 <path_canonize@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x8,%rbx
cmp    $0xa0,%rbx
jne    1810 <main+0x660>
lea    0xadf(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x2794(%rip),%rbx
mov    (%rbx),%edi
call   10d0 <getc@plt>
lea    0xa67(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   10d0 <getc@plt>
mov    0x2763(%rip),%r12
mov    (%r12),%eax
xor    %ebx,%ebx
cmp    $0xfffffff8,%eax
jl     18a3 <main+0x6f3>
add    $0x8,%eax
test   %eax,%eax
cmovg  %eax,%ebx
add    $0x1,%ebx
mov    %r14,%rdi
mov    $0x2f,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   10b0 <path_canonize@plt>
lea    0x888(%rip),%rdi
xor    %ebx,%ebx
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa52(%rip),%rdi
call   1030 <puts@plt>
mov    0x270a(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    (%r12),%eax
cmp    $0xfffffff8,%eax
jl     1909 <main+0x759>
add    $0x8,%eax
test   %eax,%eax
cmovg  %eax,%ebx
add    $0x1,%ebx
mov    %r14,%rdi
mov    $0x61,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   10b0 <path_canonize@plt>
lea    0x822(%rip),%rdi
xor    %r15d,%r15d
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x9eb(%rip),%rdi
call   1030 <puts@plt>
mov    0x26a3(%rip),%rax
mov    (%rax),%edi
call   10d0 <getc@plt>
mov    (%r12),%ebx
cmp    $0x80,%ebx
jl     196e <main+0x7be>
add    $0xffffff81,%ebx
mov    %r14,%rdi
mov    $0x62,%esi
mov    %rbx,%rdx
call   1080 <memset@plt>
mov    %rbx,%r15
movb   $0x0,(%r14,%r15,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   10b0 <path_canonize@plt>
lea    0x7bd(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x989(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x263e(%rip),%rbx
mov    (%rbx),%edi
call   10d0 <getc@plt>
mov    %r14,%rdi
mov    -0x2c(%rbp),%esi
call   10a0 <getcwd@plt>
movslq (%r12),%rax
movb   $0x0,-0x1(%rax,%r14,1)
mov    $0x1,%edi
call   1040 <get_home_etc@plt>
lea    0x746(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x744(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   10d0 <getc@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@MAXPATHLEN = global i32 0
@.str = [13 x i8] c"aaaa/.muttrc\00"
@.str.1 = [8 x i8] c".muttrc\00"
@.str.2 = [13 x i8] c"aaa/bbb/ccc/\00"
@.str.3 = [9 x i8] c"aaa/bbb/\00"
@.str.4 = [27 x i8] c"/home/users/siefca/.muttrc\00"
@.str.5 = [31 x i8] c"/home/users/siefca/.muttrc/xxx\00"
@.str.6 = [22 x i8] c"/home/users/siefca/.a\00"
@.str.7 = [31 x i8] c"/home/../home/users/siefca/hmm\00"
@.str.8 = [32 x i8] c"/home/../home/users/siefca/hmm/\00"
@.str.9 = [28 x i8] c"/home/users/siefca/.muttrc/\00"
@.str.10 = [12 x i8] c"tmp/.muttrc\00"
@.str.11 = [13 x i8] c"tmp/.muttrc/\00"
@.str.12 = [10 x i8] c"~/.muttrc\00"
@.str.13 = [10 x i8] c"~/muttrc/\00"
@.str.14 = [10 x i8] c"//.muttrc\00"
@.str.15 = [10 x i8] c"~noexpand\00"
@.str.16 = [2 x i8] c"~\00"
@.str.17 = [3 x i8] c"~/\00"
@.str.18 = [6 x i8] c"/////\00"
@.str.19 = [3 x i8] c"/x\00"
@__const.main.a = [20 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i32 0, i32 0)]
@.str.20 = [15 x i8] c"\0AHOME_ETC:\09%s\0A\00"
@.str.21 = [24 x i8] c"current directory: %s\0A\0A\00"
@.str.22 = [18 x i8] c"press any key...\0A\00"
@stdin = global i32 0
@.str.23 = [53 x i8] c" path:\09\09%s\0A result:\09%s\0A----------------------------\0A\00"
@.str.24 = [76 x i8] c"\0A----------------------------\0Ahard-core tests\0A----------------------------\0A\00"
@.str.25 = [74 x i8] c"\0A----------------------------\0Awrapper tests\0A----------------------------\0A\00"
@.str.26 = [84 x i8] c"\0A----------------------------\0Awrapper hard-core tests\0A----------------------------\0A\00"
@.str.27 = [12 x i8] c"_HEdir: %s\0A\00"
@.str.28 = [14 x i8] c"_HEndir: %s\0A\0A\00"
@.str.29 = [80 x i8] c"\0A----------------------------\0Apath_canonize tests\0A----------------------------\0A\00"
@.str.30 = [92 x i8] c"\0A----------------------------\0Apath_canonize hard-core tests\0A------------------------------\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca [20 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* @MAXPATHLEN
%11 = mul nsw i32 %10, 2
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %6
%14 = alloca i8, i64 %12
store i64 %12, i64* %7
%15 = bitcast [20 x i8*]* %9 to i8*
%16 = call i32 @home_etc_expand_tilde(i32 1)
%17 = sub i64 %12, 1
%18 = trunc i64 %17 to i32
%19 = call i32 @getcwd(i8* %14, i32 %18)
%20 = load i32, i32* @MAXPATHLEN
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %14, i64 %22
store i8 0, i8* %23
%24 = call i8* @get_home_etc(i32 1)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0), i8* %14)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%28 = load i32, i32* @stdin
%29 = call i32 @getc(i32 %28)
store i32 0, i32* %8
br label %30
30: ; preds = %45, %2
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = icmp ult i64 %32, 20
br i1 %33, label %34, label %48
34: ; preds = %30
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [20 x i8*], [20 x i8*]* %9, i64 0, i64 %36
%38 = load i8*, i8** %37
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [20 x i8*], [20 x i8*]* %9, i64 0, i64 %40
%42 = load i8*, i8** %41
%43 = call i8* @home_etc_path(i8* %42, i32 1)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %38, i8* %43)
br label %45
45: ; preds = %34
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %30
48: ; preds = %30
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.24, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%51 = load i32, i32* @stdin
%52 = call i32 @getc(i32 %51)
store i32 0, i32* %8
br label %53
53: ; preds = %62, %48
%54 = load i32, i32* %8
%55 = load i32, i32* @MAXPATHLEN
%56 = add nsw i32 %55, 8
%57 = icmp sle i32 %54, %56
br i1 %57, label %58, label %65
58: ; preds = %53
%59 = load i32, i32* %8
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %14, i64 %60
store i8 47, i8* %61
br label %62
62: ; preds = %58
%63 = load i32, i32* %8
%64 = add nsw i32 %63, 1
store i32 %64, i32* %8
br label %53
65: ; preds = %53
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %14, i64 %67
store i8 0, i8* %68
%69 = call i8* @home_etc_path(i8* %14, i32 1)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %69)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%72 = load i32, i32* @stdin
%73 = call i32 @getc(i32 %72)
store i32 0, i32* %8
br label %74
74: ; preds = %83, %65
%75 = load i32, i32* %8
%76 = load i32, i32* @MAXPATHLEN
%77 = add nsw i32 %76, 8
%78 = icmp sle i32 %75, %77
br i1 %78, label %79, label %86
79: ; preds = %74
%80 = load i32, i32* %8
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %14, i64 %81
store i8 97, i8* %82
br label %83
83: ; preds = %79
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 1
store i32 %85, i32* %8
br label %74
86: ; preds = %74
%87 = load i32, i32* %8
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %14, i64 %88
store i8 0, i8* %89
%90 = call i8* @home_etc_path(i8* %14, i32 1)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %90)
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%93 = load i32, i32* @stdin
%94 = call i32 @getc(i32 %93)
store i32 0, i32* %8
br label %95
95: ; preds = %104, %86
%96 = load i32, i32* %8
%97 = load i32, i32* @MAXPATHLEN
%98 = sub nsw i32 %97, 128
%99 = icmp sle i32 %96, %98
br i1 %99, label %100, label %107
100: ; preds = %95
%101 = load i32, i32* %8
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %14, i64 %102
store i8 98, i8* %103
br label %104
104: ; preds = %100
%105 = load i32, i32* %8
%106 = add nsw i32 %105, 1
store i32 %106, i32* %8
br label %95
107: ; preds = %95
%108 = load i32, i32* %8
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %14, i64 %109
store i8 0, i8* %110
%111 = call i8* @home_etc_path(i8* %14, i32 1)
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %111)
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.25, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%115 = load i32, i32* @stdin
%116 = call i32 @getc(i32 %115)
store i32 0, i32* %8
br label %117
117: ; preds = %132, %107
%118 = load i32, i32* %8
%119 = sext i32 %118 to i64
%120 = icmp ult i64 %119, 20
br i1 %120, label %121, label %135
121: ; preds = %117
%122 = load i32, i32* %8
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [20 x i8*], [20 x i8*]* %9, i64 0, i64 %123
%125 = load i8*, i8** %124
%126 = load i32, i32* %8
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [20 x i8*], [20 x i8*]* %9, i64 0, i64 %127
%129 = load i8*, i8** %128
%130 = call i8* @_HE(i8* %129)
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %125, i8* %130)
br label %132
132: ; preds = %121
%133 = load i32, i32* %8
%134 = add nsw i32 %133, 1
store i32 %134, i32* %8
br label %117
135: ; preds = %117
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.26, i64 0, i64 0))
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%138 = load i32, i32* @stdin
%139 = call i32 @getc(i32 %138)
store i32 0, i32* %8
br label %140
140: ; preds = %149, %135
%141 = load i32, i32* %8
%142 = load i32, i32* @MAXPATHLEN
%143 = add nsw i32 %142, 8
%144 = icmp sle i32 %141, %143
br i1 %144, label %145, label %152
145: ; preds = %140
%146 = load i32, i32* %8
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %14, i64 %147
store i8 47, i8* %148
br label %149
149: ; preds = %145
%150 = load i32, i32* %8
%151 = add nsw i32 %150, 1
store i32 %151, i32* %8
br label %140
152: ; preds = %140
%153 = load i32, i32* %8
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i8, i8* %14, i64 %154
store i8 0, i8* %155
%156 = call i8* @_HE(i8* %14)
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %156)
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%159 = load i32, i32* @stdin
%160 = call i32 @getc(i32 %159)
store i32 0, i32* %8
br label %161
161: ; preds = %170, %152
%162 = load i32, i32* %8
%163 = load i32, i32* @MAXPATHLEN
%164 = add nsw i32 %163, 8
%165 = icmp sle i32 %162, %164
br i1 %165, label %166, label %173
166: ; preds = %161
%167 = load i32, i32* %8
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i8, i8* %14, i64 %168
store i8 97, i8* %169
br label %170
170: ; preds = %166
%171 = load i32, i32* %8
%172 = add nsw i32 %171, 1
store i32 %172, i32* %8
br label %161
173: ; preds = %161
%174 = load i32, i32* %8
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8, i8* %14, i64 %175
store i8 0, i8* %176
%177 = call i8* @_HE(i8* %14)
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %177)
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%180 = load i32, i32* @stdin
%181 = call i32 @getc(i32 %180)
store i32 0, i32* %8
br label %182
182: ; preds = %191, %173
%183 = load i32, i32* %8
%184 = load i32, i32* @MAXPATHLEN
%185 = sub nsw i32 %184, 128
%186 = icmp sle i32 %183, %185
br i1 %186, label %187, label %194
187: ; preds = %182
%188 = load i32, i32* %8
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i8, i8* %14, i64 %189
store i8 98, i8* %190
br label %191
191: ; preds = %187
%192 = load i32, i32* %8
%193 = add nsw i32 %192, 1
store i32 %193, i32* %8
br label %182
194: ; preds = %182
%195 = load i32, i32* %8
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i8, i8* %14, i64 %196
store i8 0, i8* %197
%198 = call i8* @_HE(i8* %14)
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %198)
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%201 = load i32, i32* @stdin
%202 = call i32 @getc(i32 %201)
%203 = call i8* @get_home_etc_static_n(i32 1)
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), i8* %203)
%205 = call i8* @get_home_etc_static_n(i32 0)
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), i8* %205)
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.29, i64 0, i64 0))
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%209 = load i32, i32* @stdin
%210 = call i32 @getc(i32 %209)
store i32 0, i32* %8
br label %211
211: ; preds = %226, %194
%212 = load i32, i32* %8
%213 = sext i32 %212 to i64
%214 = icmp ult i64 %213, 20
br i1 %214, label %215, label %229
215: ; preds = %211
%216 = load i32, i32* %8
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [20 x i8*], [20 x i8*]* %9, i64 0, i64 %217
%219 = load i8*, i8** %218
%220 = load i32, i32* %8
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds [20 x i8*], [20 x i8*]* %9, i64 0, i64 %221
%223 = load i8*, i8** %222
%224 = call i8* @path_canonize(i8* %223, i32 1)
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %219, i8* %224)
br label %226
226: ; preds = %215
%227 = load i32, i32* %8
%228 = add nsw i32 %227, 1
store i32 %228, i32* %8
br label %211
229: ; preds = %211
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%231 = load i32, i32* @stdin
%232 = call i32 @getc(i32 %231)
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.30, i64 0, i64 0))
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%235 = load i32, i32* @stdin
%236 = call i32 @getc(i32 %235)
store i32 0, i32* %8
br label %237
237: ; preds = %246, %229
%238 = load i32, i32* %8
%239 = load i32, i32* @MAXPATHLEN
%240 = add nsw i32 %239, 8
%241 = icmp sle i32 %238, %240
br i1 %241, label %242, label %249
242: ; preds = %237
%243 = load i32, i32* %8
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds i8, i8* %14, i64 %244
store i8 47, i8* %245
br label %246
246: ; preds = %242
%247 = load i32, i32* %8
%248 = add nsw i32 %247, 1
store i32 %248, i32* %8
br label %237
249: ; preds = %237
%250 = load i32, i32* %8
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds i8, i8* %14, i64 %251
store i8 0, i8* %252
%253 = call i8* @path_canonize(i8* %14, i32 1)
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %253)
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%256 = load i32, i32* @stdin
%257 = call i32 @getc(i32 %256)
store i32 0, i32* %8
br label %258
258: ; preds = %267, %249
%259 = load i32, i32* %8
%260 = load i32, i32* @MAXPATHLEN
%261 = add nsw i32 %260, 8
%262 = icmp sle i32 %259, %261
br i1 %262, label %263, label %270
263: ; preds = %258
%264 = load i32, i32* %8
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds i8, i8* %14, i64 %265
store i8 97, i8* %266
br label %267
267: ; preds = %263
%268 = load i32, i32* %8
%269 = add nsw i32 %268, 1
store i32 %269, i32* %8
br label %258
270: ; preds = %258
%271 = load i32, i32* %8
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds i8, i8* %14, i64 %272
store i8 0, i8* %273
%274 = call i8* @path_canonize(i8* %14, i32 1)
%275 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %274)
%276 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%277 = load i32, i32* @stdin
%278 = call i32 @getc(i32 %277)
store i32 0, i32* %8
br label %279
279: ; preds = %288, %270
%280 = load i32, i32* %8
%281 = load i32, i32* @MAXPATHLEN
%282 = sub nsw i32 %281, 128
%283 = icmp sle i32 %280, %282
br i1 %283, label %284, label %291
284: ; preds = %279
%285 = load i32, i32* %8
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds i8, i8* %14, i64 %286
store i8 98, i8* %287
br label %288
288: ; preds = %284
%289 = load i32, i32* %8
%290 = add nsw i32 %289, 1
store i32 %290, i32* %8
br label %279
291: ; preds = %279
%292 = load i32, i32* %8
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds i8, i8* %14, i64 %293
store i8 0, i8* %294
%295 = call i8* @path_canonize(i8* %14, i32 1)
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %14, i8* %295)
%297 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%298 = load i32, i32* @stdin
%299 = call i32 @getc(i32 %298)
%300 = sub i64 %12, 1
%301 = trunc i64 %300 to i32
%302 = call i32 @getcwd(i8* %14, i32 %301)
%303 = load i32, i32* @MAXPATHLEN
%304 = sub nsw i32 %303, 1
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds i8, i8* %14, i64 %305
store i8 0, i8* %306
%307 = call i8* @get_home_etc(i32 1)
%308 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), i8* %307)
%309 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0), i8* %14)
%310 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%311 = load i32, i32* @stdin
%312 = call i32 @getc(i32 %311)
store i32 0, i32* %3
%313 = load i8*, i8** %6
%314 = load i32, i32* %3
ret i32 %314
}

LLVM IR (-O2):
@MAXPATHLEN = global i32 0
@.str = [13 x i8] c"aaaa/.muttrc\00"
@.str.1 = [8 x i8] c".muttrc\00"
@.str.2 = [13 x i8] c"aaa/bbb/ccc/\00"
@.str.3 = [9 x i8] c"aaa/bbb/\00"
@.str.4 = [27 x i8] c"/home/users/siefca/.muttrc\00"
@.str.5 = [31 x i8] c"/home/users/siefca/.muttrc/xxx\00"
@.str.6 = [22 x i8] c"/home/users/siefca/.a\00"
@.str.7 = [31 x i8] c"/home/../home/users/siefca/hmm\00"
@.str.8 = [32 x i8] c"/home/../home/users/siefca/hmm/\00"
@.str.9 = [28 x i8] c"/home/users/siefca/.muttrc/\00"
@.str.10 = [12 x i8] c"tmp/.muttrc\00"
@.str.11 = [13 x i8] c"tmp/.muttrc/\00"
@.str.12 = [10 x i8] c"~/.muttrc\00"
@.str.13 = [10 x i8] c"~/muttrc/\00"
@.str.14 = [10 x i8] c"//.muttrc\00"
@.str.15 = [10 x i8] c"~noexpand\00"
@.str.16 = [2 x i8] c"~\00"
@.str.17 = [3 x i8] c"~/\00"
@.str.18 = [6 x i8] c"/////\00"
@.str.19 = [3 x i8] c"/x\00"
@__const.main.a = [20 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i32 0, i32 0)]
@.str.20 = [15 x i8] c"\0AHOME_ETC:\09%s\0A\00"
@.str.21 = [24 x i8] c"current directory: %s\0A\0A\00"
@stdin = global i32 0
@.str.23 = [53 x i8] c" path:\09\09%s\0A result:\09%s\0A----------------------------\0A\00"
@.str.27 = [12 x i8] c"_HEdir: %s\0A\00"
@.str.28 = [14 x i8] c"_HEndir: %s\0A\0A\00"
@str.31 = [75 x i8] c"\0A----------------------------\0Ahard-core tests\0A----------------------------\00"
@str.35 = [73 x i8] c"\0A----------------------------\0Awrapper tests\0A----------------------------\00"
@str.37 = [83 x i8] c"\0A----------------------------\0Awrapper hard-core tests\0A----------------------------\00"
@str.42 = [79 x i8] c"\0A----------------------------\0Apath_canonize tests\0A----------------------------\00"
@str.45 = [91 x i8] c"\0A----------------------------\0Apath_canonize hard-core tests\0A------------------------------\00"
@str.50 = [17 x i8] c"press any key...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @MAXPATHLEN
%4 = shl nsw i32 %3, 1
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = tail call i32 @home_etc_expand_tilde(i32 1)
%8 = add i32 %4, -1
%9 = call i32 @getcwd(i8* %6, i32 %8)
%10 = load i32, i32* @MAXPATHLEN
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %6, i64 %12
store i8 0, i8* %13
%14 = call i8* @get_home_etc(i32 1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0), i8* %6)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%18 = load i32, i32* @stdin
%19 = call i32 @getc(i32 %18)
br label %20
20: ; preds = %2, %20
%21 = phi i64 [ 0, %2 ], [ %26, %20 ]
%22 = getelementptr inbounds [20 x i8*], [20 x i8*]* @__const.main.a, i64 0, i64 %21
%23 = load i8*, i8** %22
%24 = call i8* @home_etc_path(i8* %23, i32 1)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %23, i8* %24)
%26 = add nuw nsw i64 %21, 1
%27 = icmp eq i64 %26, 20
br i1 %27, label %28, label %20
28: ; preds = %20
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.31, i64 0, i64 0))
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%31 = load i32, i32* @stdin
%32 = call i32 @getc(i32 %31)
%33 = load i32, i32* @MAXPATHLEN
%34 = icmp slt i32 %33, -8
br i1 %34, label %41, label %35
35: ; preds = %28
%36 = add i32 %33, 8
%37 = call i32 @llvm.smax.i32(i32 %36, i32 0)
%38 = add nuw i32 %37, 1
%39 = zext i32 %38 to i64
%40 = zext i32 %38 to i64
br label %41
41: ; preds = %35, %28
%42 = phi i64 [ 0, %28 ], [ %40, %35 ]
%43 = getelementptr inbounds i8, i8* %6, i64 %42
store i8 0, i8* %43
%44 = call i8* @home_etc_path(i8* %6, i32 1)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %44)
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%47 = load i32, i32* @stdin
%48 = call i32 @getc(i32 %47)
%49 = load i32, i32* @MAXPATHLEN
%50 = icmp slt i32 %49, -8
br i1 %50, label %57, label %51
51: ; preds = %41
%52 = add i32 %49, 8
%53 = call i32 @llvm.smax.i32(i32 %52, i32 0)
%54 = add nuw i32 %53, 1
%55 = zext i32 %54 to i64
%56 = zext i32 %54 to i64
br label %57
57: ; preds = %51, %41
%58 = phi i64 [ 0, %41 ], [ %56, %51 ]
%59 = getelementptr inbounds i8, i8* %6, i64 %58
store i8 0, i8* %59
%60 = call i8* @home_etc_path(i8* %6, i32 1)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %60)
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%63 = load i32, i32* @stdin
%64 = call i32 @getc(i32 %63)
%65 = load i32, i32* @MAXPATHLEN
%66 = icmp slt i32 %65, 128
br i1 %66, label %72, label %67
67: ; preds = %57
%68 = add nsw i32 %65, -127
%69 = zext i32 %68 to i64
%70 = add nsw i32 %65, -127
%71 = zext i32 %70 to i64
br label %72
72: ; preds = %67, %57
%73 = phi i64 [ 0, %57 ], [ %71, %67 ]
%74 = getelementptr inbounds i8, i8* %6, i64 %73
store i8 0, i8* %74
%75 = call i8* @home_etc_path(i8* %6, i32 1)
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %75)
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.35, i64 0, i64 0))
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%79 = load i32, i32* @stdin
%80 = call i32 @getc(i32 %79)
%81 = call i8* @_HE(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %81)
%83 = call i8* @_HE(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %83)
%85 = call i8* @_HE(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %85)
%87 = call i8* @_HE(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %87)
%89 = call i8* @_HE(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %89)
%91 = call i8* @_HE(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %91)
%93 = call i8* @_HE(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %93)
%95 = call i8* @_HE(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %95)
%97 = call i8* @_HE(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %97)
%99 = call i8* @_HE(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* %99)
%101 = call i8* @_HE(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %101)
%103 = call i8* @_HE(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %103)
%105 = call i8* @_HE(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* %105)
%107 = call i8* @_HE(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* %107)
%109 = call i8* @_HE(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* %109)
%111 = call i8* @_HE(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* %111)
%113 = call i8* @_HE(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i8* %113)
%115 = call i8* @_HE(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i8* %115)
%117 = call i8* @_HE(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i8* %117)
%119 = call i8* @_HE(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* %119)
%121 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.37, i64 0, i64 0))
%122 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%123 = load i32, i32* @stdin
%124 = call i32 @getc(i32 %123)
%125 = load i32, i32* @MAXPATHLEN
%126 = icmp slt i32 %125, -8
br i1 %126, label %133, label %127
127: ; preds = %72
%128 = add i32 %125, 8
%129 = call i32 @llvm.smax.i32(i32 %128, i32 0)
%130 = add nuw i32 %129, 1
%131 = zext i32 %130 to i64
%132 = zext i32 %130 to i64
br label %133
133: ; preds = %127, %72
%134 = phi i64 [ 0, %72 ], [ %132, %127 ]
%135 = getelementptr inbounds i8, i8* %6, i64 %134
store i8 0, i8* %135
%136 = call i8* @_HE(i8* %6)
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %136)
%138 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%139 = load i32, i32* @stdin
%140 = call i32 @getc(i32 %139)
%141 = load i32, i32* @MAXPATHLEN
%142 = icmp slt i32 %141, -8
br i1 %142, label %149, label %143
143: ; preds = %133
%144 = add i32 %141, 8
%145 = call i32 @llvm.smax.i32(i32 %144, i32 0)
%146 = add nuw i32 %145, 1
%147 = zext i32 %146 to i64
%148 = zext i32 %146 to i64
br label %149
149: ; preds = %143, %133
%150 = phi i64 [ 0, %133 ], [ %148, %143 ]
%151 = getelementptr inbounds i8, i8* %6, i64 %150
store i8 0, i8* %151
%152 = call i8* @_HE(i8* %6)
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %152)
%154 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%155 = load i32, i32* @stdin
%156 = call i32 @getc(i32 %155)
%157 = load i32, i32* @MAXPATHLEN
%158 = icmp slt i32 %157, 128
br i1 %158, label %164, label %159
159: ; preds = %149
%160 = add nsw i32 %157, -127
%161 = zext i32 %160 to i64
%162 = add nsw i32 %157, -127
%163 = zext i32 %162 to i64
br label %164
164: ; preds = %159, %149
%165 = phi i64 [ 0, %149 ], [ %163, %159 ]
%166 = getelementptr inbounds i8, i8* %6, i64 %165
store i8 0, i8* %166
%167 = call i8* @_HE(i8* %6)
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %167)
%169 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%170 = load i32, i32* @stdin
%171 = call i32 @getc(i32 %170)
%172 = call i8* @get_home_etc_static_n(i32 1)
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), i8* %172)
%174 = call i8* @get_home_etc_static_n(i32 0)
%175 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), i8* %174)
%176 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.42, i64 0, i64 0))
%177 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%178 = load i32, i32* @stdin
%179 = call i32 @getc(i32 %178)
br label %180
180: ; preds = %164, %180
%181 = phi i64 [ 0, %164 ], [ %186, %180 ]
%182 = getelementptr inbounds [20 x i8*], [20 x i8*]* @__const.main.a, i64 0, i64 %181
%183 = load i8*, i8** %182
%184 = call i8* @path_canonize(i8* %183, i32 1)
%185 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %183, i8* %184)
%186 = add nuw nsw i64 %181, 1
%187 = icmp eq i64 %186, 20
br i1 %187, label %188, label %180
188: ; preds = %180
%189 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%190 = load i32, i32* @stdin
%191 = call i32 @getc(i32 %190)
%192 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str.45, i64 0, i64 0))
%193 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%194 = load i32, i32* @stdin
%195 = call i32 @getc(i32 %194)
%196 = load i32, i32* @MAXPATHLEN
%197 = icmp slt i32 %196, -8
br i1 %197, label %204, label %198
198: ; preds = %188
%199 = add i32 %196, 8
%200 = call i32 @llvm.smax.i32(i32 %199, i32 0)
%201 = add nuw i32 %200, 1
%202 = zext i32 %201 to i64
%203 = zext i32 %201 to i64
br label %204
204: ; preds = %198, %188
%205 = phi i64 [ 0, %188 ], [ %203, %198 ]
%206 = getelementptr inbounds i8, i8* %6, i64 %205
store i8 0, i8* %206
%207 = call i8* @path_canonize(i8* %6, i32 1)
%208 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %207)
%209 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%210 = load i32, i32* @stdin
%211 = call i32 @getc(i32 %210)
%212 = load i32, i32* @MAXPATHLEN
%213 = icmp slt i32 %212, -8
br i1 %213, label %220, label %214
214: ; preds = %204
%215 = add i32 %212, 8
%216 = call i32 @llvm.smax.i32(i32 %215, i32 0)
%217 = add nuw i32 %216, 1
%218 = zext i32 %217 to i64
%219 = zext i32 %217 to i64
br label %220
220: ; preds = %214, %204
%221 = phi i64 [ 0, %204 ], [ %219, %214 ]
%222 = getelementptr inbounds i8, i8* %6, i64 %221
store i8 0, i8* %222
%223 = call i8* @path_canonize(i8* %6, i32 1)
%224 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %223)
%225 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%226 = load i32, i32* @stdin
%227 = call i32 @getc(i32 %226)
%228 = load i32, i32* @MAXPATHLEN
%229 = icmp slt i32 %228, 128
br i1 %229, label %235, label %230
230: ; preds = %220
%231 = add nsw i32 %228, -127
%232 = zext i32 %231 to i64
%233 = add nsw i32 %228, -127
%234 = zext i32 %233 to i64
br label %235
235: ; preds = %230, %220
%236 = phi i64 [ 0, %220 ], [ %234, %230 ]
%237 = getelementptr inbounds i8, i8* %6, i64 %236
store i8 0, i8* %237
%238 = call i8* @path_canonize(i8* %6, i32 1)
%239 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %238)
%240 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%241 = load i32, i32* @stdin
%242 = call i32 @getc(i32 %241)
%243 = call i32 @getcwd(i8* %6, i32 %8)
%244 = load i32, i32* @MAXPATHLEN
%245 = add nsw i32 %244, -1
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds i8, i8* %6, i64 %246
store i8 0, i8* %247
%248 = call i8* @get_home_etc(i32 1)
%249 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), i8* %248)
%250 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0), i8* %6)
%251 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.50, i64 0, i64 0))
%252 = load i32, i32* @stdin
%253 = call i32 @getc(i32 %252)
ret i32 0
}