#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*/ thepath;

/* Variables and functions */
scalar_t__ ERANGE;
size_t MAX(int, size_t);
scalar_t__ errno;
int /*<<< orphan*/ free(char *);
char *getcwd(char *, size_t);
char *malloc(size_t);
int /*<<< orphan*/ memset(char *, float, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char *);
size_t strlen(char *);
int do_test(void) {
  char thepath[4096];
  char *bufs[10];
  size_t lens[10];
  size_t sbs;
  size_t len, i;
  if (getcwd(thepath, sizeof thepath) == NULL) {
    if (errno == ERANGE)
      return 0;
    puts("getcwd (thepath, sizeof thepath) failed");
    return 1;
  }
  len = strlen(thepath);
  sbs = 1;
  while (sbs < len + 1)
    sbs <<= 1;
  for (i = 0; i < 4; ++i) {
    lens[i] = sbs;
    bufs[i] = (char *)malloc(sbs);
  }
  bufs[i] = getcwd(NULL, sbs);
  lens[i] = sbs;
  if (bufs[i] == NULL) {
    puts("getcwd (NULL, sbs) failed");
    return 1;
  }
  ++i;
  for (; i < 10; sbs >>= 1, ++i) {
    bufs[i] = (char *)malloc(MAX(1, sbs));
    lens[i] = sbs;
  }
  for (i = 0; i < 10; ++i)
    if (i != 4 && bufs[i] != NULL)
      memset(bufs[i], '\xff', lens[i]);
  if (strcmp(thepath, bufs[4]) != 0) {
    printf("getcwd (NULL, sbs) = \"%s\", getcwd (thepath, sizeof thepath) = "
           "\"%s\"\n",
           bufs[4], thepath);
    return 1;
  }
  for (i = 0; i < 10; ++i)
    memset(bufs[i], i, lens[i]);
  for (i = 0; i < 10; ++i)
    free(bufs[i]);
  if (getcwd(NULL, len) != NULL) {
    puts("getcwd (NULL, len) didn't failed");
    return 1;
  }
  bufs[0] = malloc(len);
  bufs[1] = malloc(len);
  bufs[2] = malloc(len);
  if (bufs[1] != NULL) {
    if (getcwd(bufs[1], len) != NULL) {
      puts("getcwd (bufs[1], len) didn't failed");
      return 1;
    }
    free(bufs[0]);
    free(bufs[1]);
    free(bufs[2]);
  }
  memset(thepath, '\xfe', sizeof(thepath));
  if (getcwd(thepath, len) != NULL) {
    puts("getcwd (thepath, len) didn't failed");
    return 1;
  }
  for (i = len; i < sizeof thepath; ++i)
    if (thepath[i] != '\xfe') {
      puts("thepath[i] != '\xfe'");
      return 1;
    }
  bufs[0] = getcwd(NULL, len + 1);
  if (bufs[0] == NULL) {
    puts("getcwd (NULL, len + 1) failed");
    return 1;
  }
  free(bufs[0]);
  memset(thepath, '\xff', sizeof thepath);
  if (getcwd(thepath, len + 1) == NULL) {
    puts("getcwd (thepath, len + 1) failed");
    return 1;
  }
  for (i = len + 1; i < sizeof thepath; ++i)
    if (thepath[i] != '\xff') {
      printf("thepath[%zd] != '\xff'\n", i);
      return 1;
    }
  puts("everything OK");
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10e0,%rsp
lea    -0x1010(%rbp),%rdi
mov    $0x1000,%esi
call   1090 <getcwd@plt>
cmp    $0x0,%rax
jne    11f4 <do_test+0x64>
mov    0x2e1b(%rip),%rax
mov    (%rax),%rax
mov    0x2e21(%rip),%rcx
cmp    (%rcx),%rax
jne    11dc <do_test+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    180c <do_test+0x67c>
lea    0xe25(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
lea    -0x1010(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x10c0(%rbp)
movq   $0x1,-0x10b8(%rbp)
mov    -0x10b8(%rbp),%rax
mov    -0x10c0(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jae    1244 <do_test+0xb4>
mov    -0x10b8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10b8(%rbp)
jmp    1212 <do_test+0x82>
movq   $0x0,-0x10c8(%rbp)
cmpq   $0x4,-0x10c8(%rbp)
04
jae    12a8 <do_test+0x118>
mov    -0x10b8(%rbp),%rcx
mov    -0x10c8(%rbp),%rax
mov    %rcx,-0x10b0(%rbp,%rax,8)
ff
mov    -0x10b8(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,%rcx
mov    -0x10c8(%rbp),%rax
mov    %rcx,-0x1060(%rbp,%rax,8)
ff
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
jmp    124f <do_test+0xbf>
mov    -0x10b8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1090 <getcwd@plt>
mov    %rax,%rcx
mov    -0x10c8(%rbp),%rax
mov    %rcx,-0x1060(%rbp,%rax,8)
ff
mov    -0x10b8(%rbp),%rcx
mov    -0x10c8(%rbp),%rax
mov    %rcx,-0x10b0(%rbp,%rax,8)
ff
mov    -0x10c8(%rbp),%rax
cmpq   $0x0,-0x1060(%rbp,%rax,8)
jne    130e <do_test+0x17e>
lea    0xd33(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
cmpq   $0xa,-0x10c8(%rbp)
0a
jae    1398 <do_test+0x208>
mov    -0x10b8(%rbp),%rsi
mov    $0x1,%edi
call   1050 <MAX@plt>
mov    %rax,%rdi
call   10b0 <malloc@plt>
mov    %rax,%rcx
mov    -0x10c8(%rbp),%rax
mov    %rcx,-0x1060(%rbp,%rax,8)
ff
mov    -0x10b8(%rbp),%rcx
mov    -0x10c8(%rbp),%rax
mov    %rcx,-0x10b0(%rbp,%rax,8)
ff
mov    -0x10b8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10b8(%rbp)
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
jmp    1320 <do_test+0x190>
movq   $0x0,-0x10c8(%rbp)
cmpq   $0xa,-0x10c8(%rbp)
0a
jae    141e <do_test+0x28e>
cmpq   $0x4,-0x10c8(%rbp)
04
je     1402 <do_test+0x272>
mov    -0x10c8(%rbp),%rax
cmpq   $0x0,-0x1060(%rbp,%rax,8)
je     1402 <do_test+0x272>
mov    -0x10c8(%rbp),%rax
mov    -0x1060(%rbp,%rax,8),%rdi
ff
mov    -0x10c8(%rbp),%rax
mov    -0x10b0(%rbp,%rax,8),%rax
ff
mov    %eax,%esi
movss  0xc07(%rip),%xmm0
call   1080 <memset@plt>
jmp    1407 <do_test+0x277>
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
jmp    13a3 <do_test+0x213>
lea    -0x1010(%rbp),%rdi
mov    -0x1040(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1463 <do_test+0x2d3>
mov    -0x1040(%rbp),%rsi
lea    -0x1010(%rbp),%rdx
lea    0xbfa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
movq   $0x0,-0x10c8(%rbp)
cmpq   $0xa,-0x10c8(%rbp)
0a
jae    1513 <do_test+0x383>
mov    -0x10c8(%rbp),%rax
mov    -0x1060(%rbp,%rax,8),%rcx
ff
mov    %rcx,-0x10d8(%rbp)
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x10d0(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0x10cc(%rbp)
ff
js     14d7 <do_test+0x347>
movss  -0x10d0(%rbp),%xmm0
ff
movss  %xmm0,-0x10cc(%rbp)
ff
mov    -0x10d8(%rbp),%rdi
movss  -0x10cc(%rbp),%xmm0
ff
mov    -0x10c8(%rbp),%rax
mov    -0x10b0(%rbp,%rax,8),%rax
ff
mov    %eax,%esi
call   1080 <memset@plt>
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
jmp    146e <do_test+0x2de>
movq   $0x0,-0x10c8(%rbp)
cmpq   $0xa,-0x10c8(%rbp)
0a
jae    1557 <do_test+0x3c7>
mov    -0x10c8(%rbp),%rax
mov    -0x1060(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
jmp    151e <do_test+0x38e>
mov    -0x10c0(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1090 <getcwd@plt>
cmp    $0x0,%rax
je     1589 <do_test+0x3f9>
lea    0xb16(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
mov    -0x10c0(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x1060(%rbp)
mov    -0x10c0(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x1058(%rbp)
mov    -0x10c0(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x1050(%rbp)
cmpq   $0x0,-0x1058(%rbp)
je     1629 <do_test+0x499>
mov    -0x1058(%rbp),%rdi
mov    -0x10c0(%rbp),%rsi
call   1090 <getcwd@plt>
cmp    $0x0,%rax
je     1605 <do_test+0x475>
lea    0xabb(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
mov    -0x1060(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1058(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1050(%rbp),%rdi
call   1030 <free@plt>
lea    -0x1010(%rbp),%rdi
movss  0x9c8(%rip),%xmm0
mov    $0x1000,%esi
call   1080 <memset@plt>
lea    -0x1010(%rbp),%rdi
mov    -0x10c0(%rbp),%rsi
call   1090 <getcwd@plt>
cmp    $0x0,%rax
je     1677 <do_test+0x4e7>
lea    0xa6d(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
mov    -0x10c0(%rbp),%rax
mov    %rax,-0x10c8(%rbp)
cmpq   $0x1000,-0x10c8(%rbp)
jae    16e2 <do_test+0x552>
mov    -0x10c8(%rbp),%rax
movsbl -0x1010(%rbp,%rax,1),%eax
ff
cmp    $0xfffffffe,%eax
je     16c6 <do_test+0x536>
lea    0xa42(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
jmp    16cb <do_test+0x53b>
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
jmp    1685 <do_test+0x4f5>
mov    -0x10c0(%rbp),%rsi
add    $0x1,%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1090 <getcwd@plt>
mov    %rax,-0x1060(%rbp)
cmpq   $0x0,-0x1060(%rbp)
jne    1723 <do_test+0x593>
lea    0x9f7(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
mov    -0x1060(%rbp),%rdi
call   1030 <free@plt>
lea    -0x1010(%rbp),%rdi
movss  0x8c6(%rip),%xmm0
mov    $0x1000,%esi
call   1080 <memset@plt>
lea    -0x1010(%rbp),%rdi
mov    -0x10c0(%rbp),%rsi
add    $0x1,%rsi
call   1090 <getcwd@plt>
cmp    $0x0,%rax
jne    1781 <do_test+0x5f1>
lea    0x9b7(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
mov    -0x10c0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
cmpq   $0x1000,-0x10c8(%rbp)
jae    17f9 <do_test+0x669>
mov    -0x10c8(%rbp),%rax
movsbl -0x1010(%rbp,%rax,1),%eax
ff
cmp    $0xffffffff,%eax
je     17dd <do_test+0x64d>
mov    -0x10c8(%rbp),%rsi
lea    0x97e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    180c <do_test+0x67c>
jmp    17e2 <do_test+0x652>
mov    -0x10c8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10c8(%rbp)
jmp    1793 <do_test+0x603>
lea    0x95d(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10a0,%rsp
lea    0xa0(%rsp),%rdi
mov    $0x1000,%esi
call   1090 <getcwd@plt>
test   %rax,%rax
je     1444 <do_test+0x2b4>
lea    0xa0(%rsp),%rdi
call   1060 <strlen@plt>
mov    %rax,%r14
lea    0x1(%rax),%r15
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rbx
add    %rax,%rax
cmp    %r15,%rbx
jb     11e0 <do_test+0x50>
mov    %rbx,0x50(%rsp)
mov    %rbx,%rdi
call   10b0 <malloc@plt>
mov    %rax,(%rsp)
mov    %rbx,0x58(%rsp)
mov    %rbx,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %rbx,0x60(%rsp)
mov    %rbx,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %rbx,0x68(%rsp)
mov    %rbx,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x18(%rsp)
xor    %edi,%edi
mov    %rbx,%rsi
call   1090 <getcwd@plt>
mov    %rax,0x20(%rsp)
mov    %rbx,0x70(%rsp)
test   %rax,%rax
je     146c <do_test+0x2dc>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1050 <MAX@plt>
mov    %rax,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    %rbx,0x78(%rsp)
mov    %rbx,%r12
shr    %r12
mov    $0x1,%edi
mov    %r12,%rsi
call   1050 <MAX@plt>
mov    %rax,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r12,0x80(%rsp)
mov    %rbx,%r12
shr    $0x2,%r12
mov    $0x1,%edi
mov    %r12,%rsi
call   1050 <MAX@plt>
mov    %rax,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    %r12,0x88(%rsp)
mov    %rbx,%r12
shr    $0x3,%r12
mov    $0x1,%edi
mov    %r12,%rsi
call   1050 <MAX@plt>
mov    %rax,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    %r12,0x90(%rsp)
shr    $0x4,%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1050 <MAX@plt>
mov    %rax,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x48(%rsp)
mov    %rbx,0x98(%rsp)
mov    (%rsp),%rdi
test   %rdi,%rdi
je     1328 <do_test+0x198>
mov    0x50(%rsp),%esi
movss  0xcdd(%rip),%xmm0
call   1080 <memset@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1343 <do_test+0x1b3>
mov    0x58(%rsp),%esi
movss  0xcc2(%rip),%xmm0
call   1080 <memset@plt>
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
je     135e <do_test+0x1ce>
mov    0x60(%rsp),%esi
movss  0xca7(%rip),%xmm0
call   1080 <memset@plt>
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     1379 <do_test+0x1e9>
mov    0x68(%rsp),%esi
movss  0xc8c(%rip),%xmm0
call   1080 <memset@plt>
mov    0x28(%rsp),%rdi
test   %rdi,%rdi
je     1394 <do_test+0x204>
mov    0x78(%rsp),%esi
movss  0xc71(%rip),%xmm0
call   1080 <memset@plt>
mov    0x30(%rsp),%rdi
test   %rdi,%rdi
je     13b2 <do_test+0x222>
mov    0x80(%rsp),%esi
movss  0xc53(%rip),%xmm0
call   1080 <memset@plt>
mov    0x38(%rsp),%rdi
test   %rdi,%rdi
je     13d0 <do_test+0x240>
mov    0x88(%rsp),%esi
movss  0xc35(%rip),%xmm0
call   1080 <memset@plt>
mov    0x40(%rsp),%rdi
test   %rdi,%rdi
je     13ee <do_test+0x25e>
mov    0x90(%rsp),%esi
movss  0xc17(%rip),%xmm0
call   1080 <memset@plt>
mov    0x48(%rsp),%rdi
test   %rdi,%rdi
je     140c <do_test+0x27c>
mov    0x98(%rsp),%esi
movss  0xbf9(%rip),%xmm0
call   1080 <memset@plt>
mov    0x20(%rsp),%rbx
lea    0xa0(%rsp),%rdi
mov    %rbx,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1478 <do_test+0x2e8>
lea    0xc41(%rip),%rdi
lea    0xa0(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    15d8 <do_test+0x448>
mov    0x2b8d(%rip),%rax
mov    (%rax),%rcx
mov    0x2b93(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
je     15dd <do_test+0x44d>
lea    0xbc5(%rip),%rdi
jmp    15d3 <do_test+0x443>
lea    0xbe1(%rip),%rdi
jmp    15d3 <do_test+0x443>
mov    (%rsp),%rdi
mov    0x50(%rsp),%esi
xorps  %xmm0,%xmm0
call   1080 <memset@plt>
mov    0x8(%rsp),%rdi
mov    0x58(%rsp),%esi
movss  0xb6b(%rip),%xmm0
call   1080 <memset@plt>
mov    0x10(%rsp),%rdi
mov    0x60(%rsp),%esi
movss  0xb59(%rip),%xmm0
call   1080 <memset@plt>
mov    0x18(%rsp),%rdi
mov    0x68(%rsp),%esi
movss  0xb47(%rip),%xmm0
call   1080 <memset@plt>
mov    0x20(%rsp),%rdi
mov    0x70(%rsp),%esi
movss  0xb35(%rip),%xmm0
call   1080 <memset@plt>
mov    0x28(%rsp),%rdi
mov    0x78(%rsp),%esi
movss  0xb23(%rip),%xmm0
call   1080 <memset@plt>
mov    0x30(%rsp),%rdi
mov    0x80(%rsp),%esi
movss  0xb0e(%rip),%xmm0
call   1080 <memset@plt>
mov    0x38(%rsp),%rdi
mov    0x88(%rsp),%esi
movss  0xaf9(%rip),%xmm0
call   1080 <memset@plt>
mov    0x40(%rsp),%rdi
mov    0x90(%rsp),%esi
movss  0xae4(%rip),%xmm0
call   1080 <memset@plt>
mov    0x48(%rsp),%rdi
mov    0x98(%rsp),%esi
movss  0xacf(%rip),%xmm0
call   1080 <memset@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1090 <getcwd@plt>
test   %rax,%rax
je     15ee <do_test+0x45e>
lea    0xadf(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
add    $0x10a0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    %rax,(%rsp)
mov    %r14,%rdi
call   10b0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
mov    %r14,%rdi
call   10b0 <malloc@plt>
mov    %rax,0x10(%rsp)
test   %rbx,%rbx
je     1653 <do_test+0x4c3>
mov    %rax,%r13
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <getcwd@plt>
test   %rax,%rax
je     163b <do_test+0x4ab>
lea    0xa9a(%rip),%rdi
jmp    15d3 <do_test+0x443>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
lea    0xa0(%rsp),%rbx
movss  0x9c5(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1080 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <getcwd@plt>
test   %rax,%rax
je     168c <do_test+0x4fc>
lea    0xa70(%rip),%rdi
jmp    15d3 <do_test+0x443>
cmp    $0xfff,%r14
ja     16b1 <do_test+0x521>
cmpb   $0xfe,0xa0(%rsp,%r14,1)
jne    1739 <do_test+0x5a9>
add    $0x1,%r14
cmp    $0x1000,%r14
jne    1695 <do_test+0x505>
xor    %edi,%edi
mov    %r15,%rsi
call   1090 <getcwd@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     172d <do_test+0x59d>
mov    %rax,%rdi
call   1030 <free@plt>
lea    0xa0(%rsp),%rbx
movss  0x924(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1080 <memset@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <getcwd@plt>
test   %rax,%rax
je     1745 <do_test+0x5b5>
cmp    $0xfff,%r15
ja     171a <do_test+0x58a>
cmpb   $0xff,0xa0(%rsp,%r15,1)
jne    1751 <do_test+0x5c1>
add    $0x1,%r15
cmp    $0x1000,%r15
jne    1702 <do_test+0x572>
lea    0xa60(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
jmp    15dd <do_test+0x44d>
lea    0x9f9(%rip),%rdi
jmp    15d3 <do_test+0x443>
lea    0x9db(%rip),%rdi
jmp    15d3 <do_test+0x443>
lea    0x9ff(%rip),%rdi
jmp    15d3 <do_test+0x443>
lea    0xa14(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    15d8 <do_test+0x448>

LLVM IR (-O0):
@errno = global i64 0
@ERANGE = global i64 0
@.str = [40 x i8] c"getcwd (thepath, sizeof thepath) failed\00"
@.str.1 = [26 x i8] c"getcwd (NULL, sbs) failed\00"
@.str.2 = [68 x i8] c"getcwd (NULL, sbs) = \22%s\22, getcwd (thepath, sizeof thepath) = \22%s\22\0A\00"
@.str.3 = [33 x i8] c"getcwd (NULL, len) didn't failed\00"
@.str.4 = [36 x i8] c"getcwd (bufs[1], len) didn't failed\00"
@.str.5 = [36 x i8] c"getcwd (thepath, len) didn't failed\00"
@.str.6 = [18 x i8] c"thepath[i] != '\FE'\00"
@.str.7 = [30 x i8] c"getcwd (NULL, len + 1) failed\00"
@.str.8 = [33 x i8] c"getcwd (thepath, len + 1) failed\00"
@.str.9 = [21 x i8] c"thepath[%zd] != '\FF'\0A\00"
@.str.10 = [14 x i8] c"everything OK\00"
define i32 @do_test() {
%1 = alloca i32
%2 = alloca [4096 x i8]
%3 = alloca [10 x i8*]
%4 = alloca [10 x i64]
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%9 = call i8* @getcwd(i8* %8, i64 4096)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %0
%12 = load i64, i64* @errno
%13 = load i64, i64* @ERANGE
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %1
br label %251
16: ; preds = %11
%17 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %251
18: ; preds = %0
%19 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%20 = call i64 @strlen(i8* %19)
store i64 %20, i64* %6
store i64 1, i64* %5
br label %21
21: ; preds = %26, %18
%22 = load i64, i64* %5
%23 = load i64, i64* %6
%24 = add i64 %23, 1
%25 = icmp ult i64 %22, %24
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = load i64, i64* %5
%28 = shl i64 %27, 1
store i64 %28, i64* %5
br label %21
29: ; preds = %21
store i64 0, i64* %7
br label %30
30: ; preds = %41, %29
%31 = load i64, i64* %7
%32 = icmp ult i64 %31, 4
br i1 %32, label %33, label %44
33: ; preds = %30
%34 = load i64, i64* %5
%35 = load i64, i64* %7
%36 = getelementptr inbounds [10 x i64], [10 x i64]* %4, i64 0, i64 %35
store i64 %34, i64* %36
%37 = load i64, i64* %5
%38 = call i8* @malloc(i64 %37)
%39 = load i64, i64* %7
%40 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %39
store i8* %38, i8** %40
br label %41
41: ; preds = %33
%42 = load i64, i64* %7
%43 = add i64 %42, 1
store i64 %43, i64* %7
br label %30
44: ; preds = %30
%45 = load i64, i64* %5
%46 = call i8* @getcwd(i8* null, i64 %45)
%47 = load i64, i64* %7
%48 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %47
store i8* %46, i8** %48
%49 = load i64, i64* %5
%50 = load i64, i64* %7
%51 = getelementptr inbounds [10 x i64], [10 x i64]* %4, i64 0, i64 %50
store i64 %49, i64* %51
%52 = load i64, i64* %7
%53 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %52
%54 = load i8*, i8** %53
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %58
56: ; preds = %44
%57 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %251
58: ; preds = %44
%59 = load i64, i64* %7
%60 = add i64 %59, 1
store i64 %60, i64* %7
br label %61
61: ; preds = %73, %58
%62 = load i64, i64* %7
%63 = icmp ult i64 %62, 10
br i1 %63, label %64, label %78
64: ; preds = %61
%65 = load i64, i64* %5
%66 = call i64 @MAX(i32 1, i64 %65)
%67 = call i8* @malloc(i64 %66)
%68 = load i64, i64* %7
%69 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %68
store i8* %67, i8** %69
%70 = load i64, i64* %5
%71 = load i64, i64* %7
%72 = getelementptr inbounds [10 x i64], [10 x i64]* %4, i64 0, i64 %71
store i64 %70, i64* %72
br label %73
73: ; preds = %64
%74 = load i64, i64* %5
%75 = lshr i64 %74, 1
store i64 %75, i64* %5
%76 = load i64, i64* %7
%77 = add i64 %76, 1
store i64 %77, i64* %7
br label %61
78: ; preds = %61
store i64 0, i64* %7
br label %79
79: ; preds = %100, %78
%80 = load i64, i64* %7
%81 = icmp ult i64 %80, 10
br i1 %81, label %82, label %103
82: ; preds = %79
%83 = load i64, i64* %7
%84 = icmp ne i64 %83, 4
br i1 %84, label %85, label %99
85: ; preds = %82
%86 = load i64, i64* %7
%87 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %86
%88 = load i8*, i8** %87
%89 = icmp ne i8* %88, null
br i1 %89, label %90, label %99
90: ; preds = %85
%91 = load i64, i64* %7
%92 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %91
%93 = load i8*, i8** %92
%94 = load i64, i64* %7
%95 = getelementptr inbounds [10 x i64], [10 x i64]* %4, i64 0, i64 %94
%96 = load i64, i64* %95
%97 = trunc i64 %96 to i32
%98 = call i32 @memset(i8* %93, float -1.000000e+00, i32 %97)
br label %99
99: ; preds = %90, %85, %82
br label %100
100: ; preds = %99
%101 = load i64, i64* %7
%102 = add i64 %101, 1
store i64 %102, i64* %7
br label %79
103: ; preds = %79
%104 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%105 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 4
%106 = load i8*, i8** %105
%107 = call i64 @strcmp(i8* %104, i8* %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %114
109: ; preds = %103
%110 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 4
%111 = load i8*, i8** %110
%112 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), i8* %111, i8* %112)
store i32 1, i32* %1
br label %251
114: ; preds = %103
store i64 0, i64* %7
br label %115
115: ; preds = %129, %114
%116 = load i64, i64* %7
%117 = icmp ult i64 %116, 10
br i1 %117, label %118, label %132
118: ; preds = %115
%119 = load i64, i64* %7
%120 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %119
%121 = load i8*, i8** %120
%122 = load i64, i64* %7
%123 = uitofp i64 %122 to float
%124 = load i64, i64* %7
%125 = getelementptr inbounds [10 x i64], [10 x i64]* %4, i64 0, i64 %124
%126 = load i64, i64* %125
%127 = trunc i64 %126 to i32
%128 = call i32 @memset(i8* %121, float %123, i32 %127)
br label %129
129: ; preds = %118
%130 = load i64, i64* %7
%131 = add i64 %130, 1
store i64 %131, i64* %7
br label %115
132: ; preds = %115
store i64 0, i64* %7
br label %133
133: ; preds = %141, %132
%134 = load i64, i64* %7
%135 = icmp ult i64 %134, 10
br i1 %135, label %136, label %144
136: ; preds = %133
%137 = load i64, i64* %7
%138 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %137
%139 = load i8*, i8** %138
%140 = call i32 @free(i8* %139)
br label %141
141: ; preds = %136
%142 = load i64, i64* %7
%143 = add i64 %142, 1
store i64 %143, i64* %7
br label %133
144: ; preds = %133
%145 = load i64, i64* %6
%146 = call i8* @getcwd(i8* null, i64 %145)
%147 = icmp ne i8* %146, null
br i1 %147, label %148, label %150
148: ; preds = %144
%149 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %251
150: ; preds = %144
%151 = load i64, i64* %6
%152 = call i8* @malloc(i64 %151)
%153 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
store i8* %152, i8** %153
%154 = load i64, i64* %6
%155 = call i8* @malloc(i64 %154)
%156 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 1
store i8* %155, i8** %156
%157 = load i64, i64* %6
%158 = call i8* @malloc(i64 %157)
%159 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 2
store i8* %158, i8** %159
%160 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 1
%161 = load i8*, i8** %160
%162 = icmp ne i8* %161, null
br i1 %162, label %163, label %181
163: ; preds = %150
%164 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 1
%165 = load i8*, i8** %164
%166 = load i64, i64* %6
%167 = call i8* @getcwd(i8* %165, i64 %166)
%168 = icmp ne i8* %167, null
br i1 %168, label %169, label %171
169: ; preds = %163
%170 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %251
171: ; preds = %163
%172 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%173 = load i8*, i8** %172
%174 = call i32 @free(i8* %173)
%175 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 1
%176 = load i8*, i8** %175
%177 = call i32 @free(i8* %176)
%178 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 2
%179 = load i8*, i8** %178
%180 = call i32 @free(i8* %179)
br label %181
181: ; preds = %171, %150
%182 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%183 = call i32 @memset(i8* %182, float -2.000000e+00, i32 4096)
%184 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%185 = load i64, i64* %6
%186 = call i8* @getcwd(i8* %184, i64 %185)
%187 = icmp ne i8* %186, null
br i1 %187, label %188, label %190
188: ; preds = %181
%189 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %1
br label %251
190: ; preds = %181
%191 = load i64, i64* %6
store i64 %191, i64* %7
br label %192
192: ; preds = %204, %190
%193 = load i64, i64* %7
%194 = icmp ult i64 %193, 4096
br i1 %194, label %195, label %207
195: ; preds = %192
%196 = load i64, i64* %7
%197 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %196
%198 = load i8, i8* %197
%199 = sext i8 %198 to i32
%200 = icmp ne i32 %199, -2
br i1 %200, label %201, label %203
201: ; preds = %195
%202 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %251
203: ; preds = %195
br label %204
204: ; preds = %203
%205 = load i64, i64* %7
%206 = add i64 %205, 1
store i64 %206, i64* %7
br label %192
207: ; preds = %192
%208 = load i64, i64* %6
%209 = add i64 %208, 1
%210 = call i8* @getcwd(i8* null, i64 %209)
%211 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
store i8* %210, i8** %211
%212 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%213 = load i8*, i8** %212
%214 = icmp eq i8* %213, null
br i1 %214, label %215, label %217
215: ; preds = %207
%216 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %1
br label %251
217: ; preds = %207
%218 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%219 = load i8*, i8** %218
%220 = call i32 @free(i8* %219)
%221 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%222 = call i32 @memset(i8* %221, float -1.000000e+00, i32 4096)
%223 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%224 = load i64, i64* %6
%225 = add i64 %224, 1
%226 = call i8* @getcwd(i8* %223, i64 %225)
%227 = icmp eq i8* %226, null
br i1 %227, label %228, label %230
228: ; preds = %217
%229 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %1
br label %251
230: ; preds = %217
%231 = load i64, i64* %6
%232 = add i64 %231, 1
store i64 %232, i64* %7
br label %233
233: ; preds = %246, %230
%234 = load i64, i64* %7
%235 = icmp ult i64 %234, 4096
br i1 %235, label %236, label %249
236: ; preds = %233
%237 = load i64, i64* %7
%238 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %237
%239 = load i8, i8* %238
%240 = sext i8 %239 to i32
%241 = icmp ne i32 %240, -1
br i1 %241, label %242, label %245
242: ; preds = %236
%243 = load i64, i64* %7
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i64 %243)
store i32 1, i32* %1
br label %251
245: ; preds = %236
br label %246
246: ; preds = %245
%247 = load i64, i64* %7
%248 = add i64 %247, 1
store i64 %248, i64* %7
br label %233
249: ; preds = %233
%250 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %1
br label %251
251: ; preds = %249, %242, %228, %215, %201, %188, %169, %148, %109, %56, %16, %15
%252 = load i32, i32* %1
ret i32 %252
}

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