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

/* Variables and functions */
void *intToSym(double);
double modf(double, double *);
double pow(unsigned int, int);
int powl(unsigned int, int);
double symToInt(int /*<<< orphan*/);
char *ns_convert(char *number, char *result, unsigned int sourceBase,
                 unsigned int destBase) {
  char *current;
  char *res = result;
  if (*number == '-') {
    res[0] = '-';
    res++;
    number++;
  }
  if (*number == '\0' || sourceBase < 2 || sourceBase > 36 || destBase < 2 ||
      destBase > 36)
    return "\0";
  int ipN = 0;
  int fpN = 0;
  int *c = &ipN;
  char maxSource = intToSym(sourceBase - 1);
  for (current = number; *current != '\0'; current++) {
    if (*current > maxSource)
      return "\0";
    if (*current == '.') {
      c = &fpN;
      continue;
    }
    (*c)++;
  }
  current = number;
  int numI = 0;
  double numD = 0;
  int Pow = powl(sourceBase, ipN - 1);
  for (int i = ipN - 1; i >= 0; i--) {
    numI += symToInt(*current++) * Pow;
    Pow /= sourceBase;
  }
  current++;
  double dPow = pow(sourceBase, -1);
  for (int i = 1; i <= fpN; i++) {
    numD += symToInt(*current++) * dPow;
    dPow /= sourceBase;
  }
  current = res;
  while (numI != 0) {
    *(current++) = intToSym(numI % destBase);
    numI /= destBase;
  }
  char *b, *e;
  for (b = res, e = current - 1; b < e; b++, e--) {
    char t = *b;
    *b = *e;
    *e = t;
  }
  *current = '\0';
  if (fpN > 0)
    *current = '.';
  else
    return result;
  current++;
  double integral;
  for (int i = 0; i < 12; i++) {
    numD = modf(numD * destBase, &integral);
    *(current++) = intToSym(integral);
    if (numD == 0)
      break;
  }
  *current = '\0';
  return result;
}


x86 assembly (clang, -O0):
<ns_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11a0 <ns_convert+0x50>
mov    -0x30(%rbp),%rax
movb   $0x2d,(%rax)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11d8 <ns_convert+0x88>
cmpl   $0x2,-0x1c(%rbp)
jb     11d8 <ns_convert+0x88>
cmpl   $0x24,-0x1c(%rbp)
ja     11d8 <ns_convert+0x88>
cmpl   $0x2,-0x20(%rbp)
jb     11d8 <ns_convert+0x88>
cmpl   $0x24,-0x20(%rbp)
jbe    11e8 <ns_convert+0x98>
lea    0xe21(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    150c <ns_convert+0x3bc>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
lea    -0x34(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
cvtsi2sd %rax,%xmm0
call   1040 <intToSym@plt>
mov    %al,-0x41(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1285 <ns_convert+0x135>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x41(%rbp),%ecx
cmp    %ecx,%eax
jle    124c <ns_convert+0xfc>
lea    0xdbd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    150c <ns_convert+0x3bc>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1269 <ns_convert+0x119>
lea    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1274 <ns_convert+0x124>
mov    -0x40(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1219 <ns_convert+0xc9>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x34(%rbp),%esi
sub    $0x1,%esi
call   1030 <powl@plt>
mov    %eax,-0x54(%rbp)
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x58(%rbp)
jl     130b <ns_convert+0x1bb>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%edi
call   1060 <symToInt@plt>
cvtsi2sdl -0x54(%rbp),%xmm2
cvtsi2sdl -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x48(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x54(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x58(%rbp)
jmp    12b6 <ns_convert+0x166>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0xffffffff,%esi
call   1070 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     138e <ns_convert+0x23e>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%edi
call   1060 <symToInt@plt>
movsd  -0x60(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x1c(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  -0x60(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1330 <ns_convert+0x1e0>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     13db <ns_convert+0x28b>
mov    -0x48(%rbp),%eax
mov    -0x20(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
cvtsi2sd %rax,%xmm0
call   1040 <intToSym@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x48(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x48(%rbp)
jmp    1396 <ns_convert+0x246>
mov    -0x30(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
cmp    -0x78(%rbp),%rax
jae    1438 <ns_convert+0x2e8>
mov    -0x70(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x79(%rbp)
mov    -0x78(%rbp),%rax
mov    (%rax),%cl
mov    -0x70(%rbp),%rax
mov    %cl,(%rax)
mov    -0x79(%rbp),%cl
mov    -0x78(%rbp),%rax
mov    %cl,(%rax)
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
mov    -0x78(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x78(%rbp)
jmp    13ef <ns_convert+0x29f>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x38(%rbp)
jle    1455 <ns_convert+0x305>
mov    -0x28(%rbp),%rax
movb   $0x2e,(%rax)
jmp    1462 <ns_convert+0x312>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    150c <ns_convert+0x3bc>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x8c(%rbp)
cmpl   $0xc,-0x8c(%rbp)
jge    14fd <ns_convert+0x3ad>
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
lea    -0x88(%rbp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
call   1040 <intToSym@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14e4 <ns_convert+0x394>
jp     14e4 <ns_convert+0x394>
jmp    14fd <ns_convert+0x3ad>
jmp    14e9 <ns_convert+0x399>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1478 <ns_convert+0x328>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_convert>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r13
mov    (%rdi),%cl
cmp    $0x2d,%cl
jne    1182 <ns_convert+0x32>
movb   $0x2d,(%r14)
lea    0x1(%r14),%r12
mov    0x1(%r13),%cl
add    $0x1,%r13
jmp    1185 <ns_convert+0x35>
mov    %r14,%r12
lea    -0x25(%r15),%edx
lea    0xe78(%rip),%rax
cmp    $0xffffffdd,%edx
jb     16ce <ns_convert+0x57e>
lea    -0x25(%rbx),%edx
cmp    $0xffffffdd,%edx
jb     16ce <ns_convert+0x57e>
test   %cl,%cl
je     16ce <ns_convert+0x57e>
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
lea    -0x1(%rbx),%eax
cvtsi2sd %rax,%xmm0
call   1040 <intToSym@plt>
mov    0x0(%r13),%cl
test   %cl,%cl
je     1216 <ns_convert+0xc6>
mov    %rbx,(%rsp)
movsbl %al,%eax
lea    0x1(%r13),%rdx
lea    0x1c(%rsp),%rbp
lea    0xe1f(%rip),%rsi
lea    0x18(%rsp),%rbx
jmp    11fe <ns_convert+0xae>
movzbl (%rdx),%ecx
add    $0x1,%rdx
mov    %rdi,%rbp
test   %cl,%cl
je     123e <ns_convert+0xee>
movsbl %cl,%edi
cmp    %edi,%eax
jl     1236 <ns_convert+0xe6>
mov    %rbx,%rdi
cmp    $0x2e,%cl
je     11f0 <ns_convert+0xa0>
addl   $0x1,0x0(%rbp)
mov    %rbp,%rdi
jmp    11f0 <ns_convert+0xa0>
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %ebx,%edi
mov    $0xffffffff,%esi
call   1030 <powl@plt>
xor    %ebp,%ebp
mov    %rbx,%r15
jmp    12b4 <ns_convert+0x164>
mov    %rsi,%rbx
jmp    16cb <ns_convert+0x57b>
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    0x1c(%rsp),%ebx
lea    -0x1(%rbx),%esi
mov    (%rsp),%rdi
call   1030 <powl@plt>
test   %ebx,%ebx
jle    12ae <ns_convert+0x15e>
mov    %eax,%r14d
add    $0x1,%ebx
xor    %ebp,%ebp
mov    (%rsp),%r15
nopl   0x0(%rax,%rax,1)
movsbl 0x0(%r13),%edi
add    $0x1,%r13
call   1060 <symToInt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
cvttsd2si %xmm1,%ebp
mov    %r14d,%eax
xor    %edx,%edx
div    %r15d
add    $0xffffffff,%ebx
mov    %eax,%r14d
cmp    $0x1,%ebx
ja     1270 <ns_convert+0x120>
jmp    12b4 <ns_convert+0x164>
xor    %ebp,%ebp
mov    (%rsp),%r15
mov    %r15d,%edi
mov    $0xffffffff,%esi
call   1070 <pow@plt>
mov    0x18(%rsp),%r14d
test   %r14d,%r14d
jle    1334 <ns_convert+0x1e4>
movapd %xmm0,%xmm1
mov    %r15d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x30(%rsp)
xorpd  %xmm0,%xmm0
xor    %ebx,%ebx
mov    0x20(%rsp),%r15
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x10(%rsp)
movsbl 0x1(%r13,%rbx,1),%edi
call   1060 <symToInt@plt>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  (%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movsd  (%rsp),%xmm0
divsd  0x30(%rsp),%xmm1
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    12f0 <ns_convert+0x1a0>
jmp    133d <ns_convert+0x1ed>
xorpd  %xmm0,%xmm0
mov    0x20(%rsp),%r15
movsd  %xmm0,(%rsp)
mov    %r12,%r13
test   %ebp,%ebp
je     1375 <ns_convert+0x225>
mov    %r12,%r13
nopl   0x0(%rax)
mov    %ebp,%eax
xor    %edx,%edx
div    %r15d
mov    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %rdx,%xmm0
call   1040 <intToSym@plt>
mov    %al,0x0(%r13)
add    $0x1,%r13
cmp    %r15d,%ebp
mov    %ebx,%ebp
jae    1350 <ns_convert+0x200>
lea    -0x1(%r13),%rax
cmp    %rax,%r12
jae    13b1 <ns_convert+0x261>
add    $0x1,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl -0x1(%r12),%ecx
movzbl (%rax),%edx
mov    %dl,-0x1(%r12)
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
lea    0x1(%r12),%rcx
cmp    %rax,%r12
mov    %rcx,%r12
jb     1390 <ns_convert+0x240>
movb   $0x0,0x0(%r13)
test   %r14d,%r14d
movsd  (%rsp),%xmm0
jle    1417 <ns_convert+0x2c7>
movb   $0x2e,0x0(%r13)
mov    %r15d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm1,%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0x1(%r13)
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
mov    0x28(%rsp),%rbx
jne    1421 <ns_convert+0x2d1>
jp     1421 <ns_convert+0x2d1>
add    $0x2,%r13
jmp    16c6 <ns_convert+0x576>
mov    0x28(%rsp),%rbx
jmp    16cb <ns_convert+0x57b>
movapd %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
movsd  (%rsp),%xmm0
mov    %al,0x2(%r13)
ucomisd 0xbaa(%rip),%xmm0
jne    1463 <ns_convert+0x313>
jp     1463 <ns_convert+0x313>
add    $0x3,%r13
jmp    16c6 <ns_convert+0x576>
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0x3(%r13)
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    14a1 <ns_convert+0x351>
jp     14a1 <ns_convert+0x351>
add    $0x4,%r13
jmp    16c6 <ns_convert+0x576>
movapd %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
movsd  (%rsp),%xmm0
mov    %al,0x4(%r13)
ucomisd 0xb2a(%rip),%xmm0
jne    14e3 <ns_convert+0x393>
jp     14e3 <ns_convert+0x393>
add    $0x5,%r13
jmp    16c6 <ns_convert+0x576>
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0x5(%r13)
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    1521 <ns_convert+0x3d1>
jp     1521 <ns_convert+0x3d1>
add    $0x6,%r13
jmp    16c6 <ns_convert+0x576>
movapd %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
movsd  (%rsp),%xmm0
mov    %al,0x6(%r13)
ucomisd 0xaaa(%rip),%xmm0
jne    1563 <ns_convert+0x413>
jp     1563 <ns_convert+0x413>
add    $0x7,%r13
jmp    16c6 <ns_convert+0x576>
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0x7(%r13)
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    15a1 <ns_convert+0x451>
jp     15a1 <ns_convert+0x451>
add    $0x8,%r13
jmp    16c6 <ns_convert+0x576>
movapd %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
movsd  (%rsp),%xmm0
mov    %al,0x8(%r13)
ucomisd 0xa2a(%rip),%xmm0
jne    15e3 <ns_convert+0x493>
jp     15e3 <ns_convert+0x493>
add    $0x9,%r13
jmp    16c6 <ns_convert+0x576>
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0x9(%r13)
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm2
ucomisd %xmm0,%xmm2
jne    1621 <ns_convert+0x4d1>
jp     1621 <ns_convert+0x4d1>
add    $0xa,%r13
jmp    16c6 <ns_convert+0x576>
movapd %xmm2,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0xa(%r13)
movsd  (%rsp),%xmm1
ucomisd 0x9aa(%rip),%xmm1
jne    1660 <ns_convert+0x510>
jp     1660 <ns_convert+0x510>
add    $0xb,%r13
jmp    16c6 <ns_convert+0x576>
movapd %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0xb(%r13)
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm2
ucomisd %xmm0,%xmm2
jne    169f <ns_convert+0x54f>
jp     169f <ns_convert+0x54f>
add    $0xc,%r13
jmp    16c6 <ns_convert+0x576>
movapd %xmm2,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <intToSym@plt>
mov    %al,0xc(%r13)
add    $0xd,%r13
movb   $0x0,0x0(%r13)
mov    %rbx,%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] zeroinitializer
define i8* @ns_convert(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i8
%16 = alloca i32
%17 = alloca double
%18 = alloca i32
%19 = alloca i32
%20 = alloca double
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8
%25 = alloca double
%26 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%27 = load i8*, i8** %7
store i8* %27, i8** %11
%28 = load i8*, i8** %6
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 45
br i1 %31, label %32, label %39
32: ; preds = %4
%33 = load i8*, i8** %11
%34 = getelementptr inbounds i8, i8* %33, i64 0
store i8 45, i8* %34
%35 = load i8*, i8** %11
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %11
%37 = load i8*, i8** %6
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %6
br label %39
39: ; preds = %32, %4
%40 = load i8*, i8** %6
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 0
br i1 %43, label %56, label %44
44: ; preds = %39
%45 = load i32, i32* %8
%46 = icmp ult i32 %45, 2
br i1 %46, label %56, label %47
47: ; preds = %44
%48 = load i32, i32* %8
%49 = icmp ugt i32 %48, 36
br i1 %49, label %56, label %50
50: ; preds = %47
%51 = load i32, i32* %9
%52 = icmp ult i32 %51, 2
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load i32, i32* %9
%55 = icmp ugt i32 %54, 36
br i1 %55, label %56, label %57
56: ; preds = %53, %50, %47, %44, %39
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5
br label %217
57: ; preds = %53
store i32 0, i32* %12
store i32 0, i32* %13
store i32* %12, i32** %14
%58 = load i32, i32* %8
%59 = sub i32 %58, 1
%60 = uitofp i32 %59 to double
%61 = call i8* @intToSym(double %60)
%62 = ptrtoint i8* %61 to i8
store i8 %62, i8* %15
%63 = load i8*, i8** %6
store i8* %63, i8** %10
br label %64
64: ; preds = %87, %57
%65 = load i8*, i8** %10
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %90
69: ; preds = %64
%70 = load i8*, i8** %10
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = load i8, i8* %15
%74 = sext i8 %73 to i32
%75 = icmp sgt i32 %72, %74
br i1 %75, label %76, label %77
76: ; preds = %69
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5
br label %217
77: ; preds = %69
%78 = load i8*, i8** %10
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 46
br i1 %81, label %82, label %83
82: ; preds = %77
store i32* %13, i32** %14
br label %87
83: ; preds = %77
%84 = load i32*, i32** %14
%85 = load i32, i32* %84
%86 = add nsw i32 %85, 1
store i32 %86, i32* %84
br label %87
87: ; preds = %83, %82
%88 = load i8*, i8** %10
%89 = getelementptr inbounds i8, i8* %88, i32 1
store i8* %89, i8** %10
br label %64
90: ; preds = %64
%91 = load i8*, i8** %6
store i8* %91, i8** %10
store i32 0, i32* %16
store double 0.000000e+00, double* %17
%92 = load i32, i32* %8
%93 = load i32, i32* %12
%94 = sub nsw i32 %93, 1
%95 = call i32 @powl(i32 %92, i32 %94)
store i32 %95, i32* %18
%96 = load i32, i32* %12
%97 = sub nsw i32 %96, 1
store i32 %97, i32* %19
br label %98
98: ; preds = %116, %90
%99 = load i32, i32* %19
%100 = icmp sge i32 %99, 0
br i1 %100, label %101, label %119
101: ; preds = %98
%102 = load i8*, i8** %10
%103 = getelementptr inbounds i8, i8* %102, i32 1
store i8* %103, i8** %10
%104 = load i8, i8* %102
%105 = sext i8 %104 to i32
%106 = call double @symToInt(i32 %105)
%107 = load i32, i32* %18
%108 = sitofp i32 %107 to double
%109 = load i32, i32* %16
%110 = sitofp i32 %109 to double
%111 = call double @llvm.fmuladd.f64(double %106, double %108, double %110)
%112 = fptosi double %111 to i32
store i32 %112, i32* %16
%113 = load i32, i32* %8
%114 = load i32, i32* %18
%115 = udiv i32 %114, %113
store i32 %115, i32* %18
br label %116
116: ; preds = %101
%117 = load i32, i32* %19
%118 = add nsw i32 %117, -1
store i32 %118, i32* %19
br label %98
119: ; preds = %98
%120 = load i8*, i8** %10
%121 = getelementptr inbounds i8, i8* %120, i32 1
store i8* %121, i8** %10
%122 = load i32, i32* %8
%123 = call double @pow(i32 %122, i32 -1)
store double %123, double* %20
store i32 1, i32* %21
br label %124
124: ; preds = %141, %119
%125 = load i32, i32* %21
%126 = load i32, i32* %13
%127 = icmp sle i32 %125, %126
br i1 %127, label %128, label %144
128: ; preds = %124
%129 = load i8*, i8** %10
%130 = getelementptr inbounds i8, i8* %129, i32 1
store i8* %130, i8** %10
%131 = load i8, i8* %129
%132 = sext i8 %131 to i32
%133 = call double @symToInt(i32 %132)
%134 = load double, double* %20
%135 = load double, double* %17
%136 = call double @llvm.fmuladd.f64(double %133, double %134, double %135)
store double %136, double* %17
%137 = load i32, i32* %8
%138 = uitofp i32 %137 to double
%139 = load double, double* %20
%140 = fdiv double %139, %138
store double %140, double* %20
br label %141
141: ; preds = %128
%142 = load i32, i32* %21
%143 = add nsw i32 %142, 1
store i32 %143, i32* %21
br label %124
144: ; preds = %124
%145 = load i8*, i8** %11
store i8* %145, i8** %10
br label %146
146: ; preds = %149, %144
%147 = load i32, i32* %16
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %161
149: ; preds = %146
%150 = load i32, i32* %16
%151 = load i32, i32* %9
%152 = urem i32 %150, %151
%153 = uitofp i32 %152 to double
%154 = call i8* @intToSym(double %153)
%155 = ptrtoint i8* %154 to i8
%156 = load i8*, i8** %10
%157 = getelementptr inbounds i8, i8* %156, i32 1
store i8* %157, i8** %10
store i8 %155, i8* %156
%158 = load i32, i32* %9
%159 = load i32, i32* %16
%160 = udiv i32 %159, %158
store i32 %160, i32* %16
br label %146
161: ; preds = %146
%162 = load i8*, i8** %11
store i8* %162, i8** %22
%163 = load i8*, i8** %10
%164 = getelementptr inbounds i8, i8* %163, i64 -1
store i8* %164, i8** %23
br label %165
165: ; preds = %177, %161
%166 = load i8*, i8** %22
%167 = load i8*, i8** %23
%168 = icmp ult i8* %166, %167
br i1 %168, label %169, label %182
169: ; preds = %165
%170 = load i8*, i8** %22
%171 = load i8, i8* %170
store i8 %171, i8* %24
%172 = load i8*, i8** %23
%173 = load i8, i8* %172
%174 = load i8*, i8** %22
store i8 %173, i8* %174
%175 = load i8, i8* %24
%176 = load i8*, i8** %23
store i8 %175, i8* %176
br label %177
177: ; preds = %169
%178 = load i8*, i8** %22
%179 = getelementptr inbounds i8, i8* %178, i32 1
store i8* %179, i8** %22
%180 = load i8*, i8** %23
%181 = getelementptr inbounds i8, i8* %180, i32 -1
store i8* %181, i8** %23
br label %165
182: ; preds = %165
%183 = load i8*, i8** %10
store i8 0, i8* %183
%184 = load i32, i32* %13
%185 = icmp sgt i32 %184, 0
br i1 %185, label %186, label %188
186: ; preds = %182
%187 = load i8*, i8** %10
store i8 46, i8* %187
br label %190
188: ; preds = %182
%189 = load i8*, i8** %7
store i8* %189, i8** %5
br label %217
190: ; preds = %186
%191 = load i8*, i8** %10
%192 = getelementptr inbounds i8, i8* %191, i32 1
store i8* %192, i8** %10
store i32 0, i32* %26
br label %193
193: ; preds = %211, %190
%194 = load i32, i32* %26
%195 = icmp slt i32 %194, 12
br i1 %195, label %196, label %214
196: ; preds = %193
%197 = load double, double* %17
%198 = load i32, i32* %9
%199 = uitofp i32 %198 to double
%200 = fmul double %197, %199
%201 = call double @modf(double %200, double* %25)
store double %201, double* %17
%202 = load double, double* %25
%203 = call i8* @intToSym(double %202)
%204 = ptrtoint i8* %203 to i8
%205 = load i8*, i8** %10
%206 = getelementptr inbounds i8, i8* %205, i32 1
store i8* %206, i8** %10
store i8 %204, i8* %205
%207 = load double, double* %17
%208 = fcmp oeq double %207, 0.000000e+00
br i1 %208, label %209, label %210
209: ; preds = %196
br label %214
210: ; preds = %196
br label %211
211: ; preds = %210
%212 = load i32, i32* %26
%213 = add nsw i32 %212, 1
store i32 %213, i32* %26
br label %193
214: ; preds = %209, %193
%215 = load i8*, i8** %10
store i8 0, i8* %215
%216 = load i8*, i8** %7
store i8* %216, i8** %5
br label %217
217: ; preds = %214, %188, %76, %56
%218 = load i8*, i8** %5
ret i8* %218
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
define i8* @ns_convert(i8* nocapture %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 45
br i1 %9, label %10, label %14
10: ; preds = %4
store i8 45, i8* %1
%11 = getelementptr inbounds i8, i8* %1, i64 1
%12 = getelementptr inbounds i8, i8* %0, i64 1
%13 = load i8, i8* %12
br label %14
14: ; preds = %10, %4
%15 = phi i8 [ %13, %10 ], [ %8, %4 ]
%16 = phi i8* [ %11, %10 ], [ %1, %4 ]
%17 = phi i8* [ %12, %10 ], [ %0, %4 ]
%18 = icmp eq i8 %15, 0
%19 = add i32 %2, -37
%20 = icmp ult i32 %19, -35
%21 = or i1 %20, %18
%22 = add i32 %3, -37
%23 = icmp ult i32 %22, -35
%24 = or i1 %23, %21
br i1 %24, label %240, label %25
25: ; preds = %14
%26 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%27 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%28 = add nsw i32 %2, -1
%29 = uitofp i32 %28 to double
%30 = tail call i8* @intToSym(double %29)
%31 = load i8, i8* %17
%32 = icmp eq i8 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %25
%34 = tail call i32 @powl(i32 %2, i32 -1)
br label %61
35: ; preds = %25
%36 = ptrtoint i8* %30 to i64
%37 = trunc i64 %36 to i32
%38 = shl i32 %37, 24
%39 = ashr exact i32 %38, 24
br label %40
40: ; preds = %35, %51
%41 = phi i8 [ %31, %35 ], [ %54, %51 ]
%42 = phi i32* [ %5, %35 ], [ %52, %51 ]
%43 = phi i8* [ %17, %35 ], [ %53, %51 ]
%44 = sext i8 %41 to i32
%45 = icmp slt i32 %39, %44
br i1 %45, label %238, label %46
46: ; preds = %40
%47 = icmp eq i8 %41, 46
br i1 %47, label %51, label %48
48: ; preds = %46
%49 = load i32, i32* %42
%50 = add nsw i32 %49, 1
store i32 %50, i32* %42
br label %51
51: ; preds = %46, %48
%52 = phi i32* [ %42, %48 ], [ %6, %46 ]
%53 = getelementptr inbounds i8, i8* %43, i64 1
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, 0
br i1 %55, label %56, label %40
56: ; preds = %51
%57 = load i32, i32* %5
%58 = add nsw i32 %57, -1
%59 = tail call i32 @powl(i32 %2, i32 %58)
%60 = icmp sgt i32 %57, 0
br i1 %60, label %69, label %61
61: ; preds = %69, %33, %56
%62 = phi i8* [ %17, %56 ], [ %17, %33 ], [ %75, %69 ]
%63 = phi i32 [ 0, %56 ], [ 0, %33 ], [ %82, %69 ]
%64 = tail call double @pow(i32 %2, i32 -1)
%65 = load i32, i32* %6
%66 = icmp slt i32 %65, 1
br i1 %66, label %85, label %67
67: ; preds = %61
%68 = uitofp i32 %2 to double
br label %88
69: ; preds = %56, %69
%70 = phi i32 [ %74, %69 ], [ %57, %56 ]
%71 = phi i32 [ %83, %69 ], [ %59, %56 ]
%72 = phi i32 [ %82, %69 ], [ 0, %56 ]
%73 = phi i8* [ %75, %69 ], [ %17, %56 ]
%74 = add nsw i32 %70, -1
%75 = getelementptr inbounds i8, i8* %73, i64 1
%76 = load i8, i8* %73
%77 = sext i8 %76 to i32
%78 = tail call double @symToInt(i32 %77)
%79 = sitofp i32 %71 to double
%80 = sitofp i32 %72 to double
%81 = tail call double @llvm.fmuladd.f64(double %78, double %79, double %80)
%82 = fptosi double %81 to i32
%83 = udiv i32 %71, %2
%84 = icmp ugt i32 %70, 1
br i1 %84, label %69, label %61
85: ; preds = %88, %61
%86 = phi double [ 0.000000e+00, %61 ], [ %97, %88 ]
%87 = icmp eq i32 %63, 0
br i1 %87, label %101, label %105
88: ; preds = %67, %88
%89 = phi i8* [ %62, %67 ], [ %93, %88 ]
%90 = phi i32 [ 1, %67 ], [ %99, %88 ]
%91 = phi double [ %64, %67 ], [ %98, %88 ]
%92 = phi double [ 0.000000e+00, %67 ], [ %97, %88 ]
%93 = getelementptr inbounds i8, i8* %89, i64 1
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = tail call double @symToInt(i32 %95)
%97 = tail call double @llvm.fmuladd.f64(double %96, double %91, double %92)
%98 = fdiv double %91, %68
%99 = add nuw i32 %90, 1
%100 = icmp eq i32 %90, %65
br i1 %100, label %85, label %88
101: ; preds = %105, %85
%102 = phi i8* [ %16, %85 ], [ %113, %105 ]
%103 = getelementptr inbounds i8, i8* %102, i64 -1
%104 = icmp ult i8* %16, %103
br i1 %104, label %116, label %124
105: ; preds = %85, %105
%106 = phi i32 [ %114, %105 ], [ %63, %85 ]
%107 = phi i8* [ %113, %105 ], [ %16, %85 ]
%108 = urem i32 %106, %3
%109 = uitofp i32 %108 to double
%110 = tail call i8* @intToSym(double %109)
%111 = ptrtoint i8* %110 to i64
%112 = trunc i64 %111 to i8
%113 = getelementptr inbounds i8, i8* %107, i64 1
store i8 %112, i8* %107
%114 = udiv i32 %106, %3
%115 = icmp ult i32 %106, %3
br i1 %115, label %101, label %105
116: ; preds = %101, %116
%117 = phi i8* [ %122, %116 ], [ %103, %101 ]
%118 = phi i8* [ %121, %116 ], [ %16, %101 ]
%119 = load i8, i8* %118
%120 = load i8, i8* %117
store i8 %120, i8* %118
store i8 %119, i8* %117
%121 = getelementptr inbounds i8, i8* %118, i64 1
%122 = getelementptr inbounds i8, i8* %117, i64 -1
%123 = icmp ult i8* %121, %122
br i1 %123, label %116, label %124
124: ; preds = %116, %101
store i8 0, i8* %102
%125 = icmp sgt i32 %65, 0
br i1 %125, label %126, label %238
126: ; preds = %124
store i8 46, i8* %102
%127 = getelementptr inbounds i8, i8* %102, i64 1
%128 = bitcast double* %7 to i8*
%129 = uitofp i32 %3 to double
%130 = fmul double %86, %129
%131 = call double @modf(double %130, double* %7)
%132 = load double, double* %7
%133 = tail call i8* @intToSym(double %132)
%134 = ptrtoint i8* %133 to i64
%135 = trunc i64 %134 to i8
%136 = getelementptr inbounds i8, i8* %102, i64 2
store i8 %135, i8* %127
%137 = fcmp oeq double %131, 0.000000e+00
br i1 %137, label %236, label %138
138: ; preds = %126
%139 = fmul double %131, %129
%140 = call double @modf(double %139, double* %7)
%141 = load double, double* %7
%142 = tail call i8* @intToSym(double %141)
%143 = ptrtoint i8* %142 to i64
%144 = trunc i64 %143 to i8
%145 = getelementptr inbounds i8, i8* %102, i64 3
store i8 %144, i8* %136
%146 = fcmp oeq double %140, 0.000000e+00
br i1 %146, label %236, label %147
147: ; preds = %138
%148 = fmul double %140, %129
%149 = call double @modf(double %148, double* %7)
%150 = load double, double* %7
%151 = tail call i8* @intToSym(double %150)
%152 = ptrtoint i8* %151 to i64
%153 = trunc i64 %152 to i8
%154 = getelementptr inbounds i8, i8* %102, i64 4
store i8 %153, i8* %145
%155 = fcmp oeq double %149, 0.000000e+00
br i1 %155, label %236, label %156
156: ; preds = %147
%157 = fmul double %149, %129
%158 = call double @modf(double %157, double* %7)
%159 = load double, double* %7
%160 = tail call i8* @intToSym(double %159)
%161 = ptrtoint i8* %160 to i64
%162 = trunc i64 %161 to i8
%163 = getelementptr inbounds i8, i8* %102, i64 5
store i8 %162, i8* %154
%164 = fcmp oeq double %158, 0.000000e+00
br i1 %164, label %236, label %165
165: ; preds = %156
%166 = fmul double %158, %129
%167 = call double @modf(double %166, double* %7)
%168 = load double, double* %7
%169 = tail call i8* @intToSym(double %168)
%170 = ptrtoint i8* %169 to i64
%171 = trunc i64 %170 to i8
%172 = getelementptr inbounds i8, i8* %102, i64 6
store i8 %171, i8* %163
%173 = fcmp oeq double %167, 0.000000e+00
br i1 %173, label %236, label %174
174: ; preds = %165
%175 = fmul double %167, %129
%176 = call double @modf(double %175, double* %7)
%177 = load double, double* %7
%178 = tail call i8* @intToSym(double %177)
%179 = ptrtoint i8* %178 to i64
%180 = trunc i64 %179 to i8
%181 = getelementptr inbounds i8, i8* %102, i64 7
store i8 %180, i8* %172
%182 = fcmp oeq double %176, 0.000000e+00
br i1 %182, label %236, label %183
183: ; preds = %174
%184 = fmul double %176, %129
%185 = call double @modf(double %184, double* %7)
%186 = load double, double* %7
%187 = tail call i8* @intToSym(double %186)
%188 = ptrtoint i8* %187 to i64
%189 = trunc i64 %188 to i8
%190 = getelementptr inbounds i8, i8* %102, i64 8
store i8 %189, i8* %181
%191 = fcmp oeq double %185, 0.000000e+00
br i1 %191, label %236, label %192
192: ; preds = %183
%193 = fmul double %185, %129
%194 = call double @modf(double %193, double* %7)
%195 = load double, double* %7
%196 = tail call i8* @intToSym(double %195)
%197 = ptrtoint i8* %196 to i64
%198 = trunc i64 %197 to i8
%199 = getelementptr inbounds i8, i8* %102, i64 9
store i8 %198, i8* %190
%200 = fcmp oeq double %194, 0.000000e+00
br i1 %200, label %236, label %201
201: ; preds = %192
%202 = fmul double %194, %129
%203 = call double @modf(double %202, double* %7)
%204 = load double, double* %7
%205 = tail call i8* @intToSym(double %204)
%206 = ptrtoint i8* %205 to i64
%207 = trunc i64 %206 to i8
%208 = getelementptr inbounds i8, i8* %102, i64 10
store i8 %207, i8* %199
%209 = fcmp oeq double %203, 0.000000e+00
br i1 %209, label %236, label %210
210: ; preds = %201
%211 = fmul double %203, %129
%212 = call double @modf(double %211, double* %7)
%213 = load double, double* %7
%214 = tail call i8* @intToSym(double %213)
%215 = ptrtoint i8* %214 to i64
%216 = trunc i64 %215 to i8
%217 = getelementptr inbounds i8, i8* %102, i64 11
store i8 %216, i8* %208
%218 = fcmp oeq double %212, 0.000000e+00
br i1 %218, label %236, label %219
219: ; preds = %210
%220 = fmul double %212, %129
%221 = call double @modf(double %220, double* %7)
%222 = load double, double* %7
%223 = tail call i8* @intToSym(double %222)
%224 = ptrtoint i8* %223 to i64
%225 = trunc i64 %224 to i8
%226 = getelementptr inbounds i8, i8* %102, i64 12
store i8 %225, i8* %217
%227 = fcmp oeq double %221, 0.000000e+00
br i1 %227, label %236, label %228
228: ; preds = %219
%229 = fmul double %221, %129
%230 = call double @modf(double %229, double* %7)
%231 = load double, double* %7
%232 = tail call i8* @intToSym(double %231)
%233 = ptrtoint i8* %232 to i64
%234 = trunc i64 %233 to i8
%235 = getelementptr inbounds i8, i8* %102, i64 13
store i8 %234, i8* %226
br label %236
236: ; preds = %228, %219, %210, %201, %192, %183, %174, %165, %156, %147, %138, %126
%237 = phi i8* [ %136, %126 ], [ %145, %138 ], [ %154, %147 ], [ %163, %156 ], [ %172, %165 ], [ %181, %174 ], [ %190, %183 ], [ %199, %192 ], [ %208, %201 ], [ %217, %210 ], [ %226, %219 ], [ %235, %228 ]
store i8 0, i8* %237
br label %238
238: ; preds = %40, %236, %124
%239 = phi i8* [ %1, %124 ], [ %1, %236 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %40 ]
br label %240
240: ; preds = %14, %238
%241 = phi i8* [ %239, %238 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %14 ]
ret i8* %241
}