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

/* Variables and functions */
double abs_val(double);
int /*<<< orphan*/ doapr_outch(char **, char **, size_t *, size_t *, char);
double pow_10(int);
long roundv(double);
void fmtfp(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen,
           double fvalue, int min, int max, int flags) {
  int signvalue = 0;
  double ufvalue;
  char iconvert[20];
  char fconvert[20];
  int iplace = 0;
  int fplace = 0;
  int padlen = 0;
  int zpadlen = 0;
  int caps = 0;
  long intpart;
  long fracpart;
  long max10;
  if (max < 0)
    max = 6;
  ufvalue = abs_val(fvalue);
  if (fvalue < 0)
    signvalue = '-';
  else if (flags & (1 << 1))
    signvalue = '+';
  else if (flags & (1 << 2))
    signvalue = ' ';
  intpart = (long)ufvalue;
  if (max > 9)
    max = 9;
  max10 = roundv(pow_10(max));
  fracpart = roundv(pow_10(max) * (ufvalue - intpart));
  if (fracpart >= max10) {
    intpart++;
    fracpart -= max10;
  }
  do {
    iconvert[iplace++] =
        (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10];
    intpart = (intpart / 10);
  } while (intpart && (iplace < (int)sizeof(iconvert)));
  if (iplace == sizeof iconvert)
    iplace--;
  iconvert[iplace] = 0;
  do {
    fconvert[fplace++] =
        (caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10];
    fracpart = (fracpart / 10);
  } while (fplace < max);
  if (fplace == sizeof fconvert)
    fplace--;
  fconvert[fplace] = 0;
  padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
  zpadlen = max - fplace;
  if (zpadlen < 0)
    zpadlen = 0;
  if (padlen < 0)
    padlen = 0;
  if (flags & (1 << 0))
    padlen = -padlen;
  if ((flags & (1 << 4)) && (padlen > 0)) {
    if (signvalue) {
      doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
      --padlen;
      signvalue = 0;
    }
    while (padlen > 0) {
      doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
      --padlen;
    }
  }
  while (padlen > 0) {
    doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
    --padlen;
  }
  if (signvalue)
    doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
  while (iplace > 0)
    doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]);
  if (max > 0 || (flags & (1 << 3))) {
    doapr_outch(sbuffer, buffer, currlen, maxlen, '.');
    while (fplace > 0)
      doapr_outch(sbuffer, buffer, currlen, maxlen, fconvert[--fplace]);
  }
  while (zpadlen > 0) {
    doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
    --zpadlen;
  }
  while (padlen < 0) {
    doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
    ++padlen;
  }
}


x86 assembly (clang, -O0):
<fmtfp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x90(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    11b5 <fmtfp+0x75>
movl   $0x6,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <abs_val@plt>
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11de <fmtfp+0x9e>
movl   $0x2d,-0x34(%rbp)
jmp    1219 <fmtfp+0xd9>
mov    0x10(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11f9 <fmtfp+0xb9>
movl   $0x2b,-0x34(%rbp)
jmp    1214 <fmtfp+0xd4>
mov    0x10(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     120f <fmtfp+0xcf>
movl   $0x20,-0x34(%rbp)
jmp    1214 <fmtfp+0xd4>
jmp    1219 <fmtfp+0xd9>
cvttsd2si -0x40(%rbp),%rax
mov    %rax,-0xa0(%rbp)
cmpl   $0x9,-0x30(%rbp)
jle    1237 <fmtfp+0xf7>
movl   $0x9,-0x30(%rbp)
mov    -0x30(%rbp),%edi
call   1030 <pow_10@plt>
call   1060 <roundv@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x30(%rbp),%edi
call   1030 <pow_10@plt>
movsd  -0x40(%rbp),%xmm1
cvtsi2sdq -0xa0(%rbp),%xmm2
ff ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1060 <roundv@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
cmp    -0xb0(%rbp),%rax
jl     12b3 <fmtfp+0x173>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
mov    -0xb0(%rbp),%rcx
mov    -0xa8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0xa8(%rbp)
jmp    12b8 <fmtfp+0x178>
mov    -0x94(%rbp),%edx
lea    0xd4c(%rip),%rax
lea    0xd34(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0xa0(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0xb8(%rbp),%rax
mov    (%rax,%rdx,1),%cl
mov    -0x84(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x84(%rbp)
cltq
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0xa0(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0xa0(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0xa0(%rbp)
mov    %al,-0xb9(%rbp)
je     134a <fmtfp+0x20a>
cmpl   $0x14,-0x84(%rbp)
setl   %al
mov    %al,-0xb9(%rbp)
mov    -0xb9(%rbp),%al
test   $0x1,%al
jne    12b8 <fmtfp+0x178>
movslq -0x84(%rbp),%rax
cmp    $0x14,%rax
jne    1378 <fmtfp+0x238>
mov    -0x84(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x84(%rbp)
movslq -0x84(%rbp),%rax
movb   $0x0,-0x60(%rbp,%rax,1)
mov    -0x94(%rbp),%edx
lea    0xc80(%rip),%rax
lea    0xc68(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0xa8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0xc8(%rbp),%rax
mov    (%rax,%rdx,1),%cl
mov    -0x88(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x88(%rbp)
cltq
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0xa8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0xa8(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x30(%rbp),%eax
jl     1384 <fmtfp+0x244>
movslq -0x88(%rbp),%rax
cmp    $0x14,%rax
jne    141f <fmtfp+0x2df>
mov    -0x88(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x88(%rbp)
movslq -0x88(%rbp),%rax
movb   $0x0,-0x80(%rbp,%rax,1)
mov    -0x2c(%rbp),%eax
sub    -0x84(%rbp),%eax
sub    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    -0x34(%rbp),%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x30(%rbp),%eax
sub    -0x88(%rbp),%eax
mov    %eax,-0x90(%rbp)
cmpl   $0x0,-0x90(%rbp)
jge    1478 <fmtfp+0x338>
movl   $0x0,-0x90(%rbp)
cmpl   $0x0,-0x8c(%rbp)
jge    148f <fmtfp+0x34f>
movl   $0x0,-0x8c(%rbp)
mov    0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     14ac <fmtfp+0x36c>
xor    %eax,%eax
sub    -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    0x10(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     154a <fmtfp+0x40a>
cmpl   $0x0,-0x8c(%rbp)
jle    154a <fmtfp+0x40a>
cmpl   $0x0,-0x34(%rbp)
je     1504 <fmtfp+0x3c4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x34(%rbp),%eax
movsbl %al,%r8d
call   1040 <doapr_outch@plt>
mov    -0x8c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8c(%rbp)
movl   $0x0,-0x34(%rbp)
jmp    1509 <fmtfp+0x3c9>
cmpl   $0x0,-0x8c(%rbp)
jle    1545 <fmtfp+0x405>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x30,%r8d
call   1040 <doapr_outch@plt>
mov    -0x8c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8c(%rbp)
jmp    1509 <fmtfp+0x3c9>
jmp    154a <fmtfp+0x40a>
jmp    154f <fmtfp+0x40f>
cmpl   $0x0,-0x8c(%rbp)
jle    158b <fmtfp+0x44b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x20,%r8d
call   1040 <doapr_outch@plt>
mov    -0x8c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8c(%rbp)
jmp    154f <fmtfp+0x40f>
cmpl   $0x0,-0x34(%rbp)
je     15b1 <fmtfp+0x471>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x34(%rbp),%eax
movsbl %al,%r8d
call   1040 <doapr_outch@plt>
jmp    15b6 <fmtfp+0x476>
cmpl   $0x0,-0x84(%rbp)
jle    15f4 <fmtfp+0x4b4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x84(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x84(%rbp)
cltq
movsbl -0x60(%rbp,%rax,1),%r8d
call   1040 <doapr_outch@plt>
jmp    15b6 <fmtfp+0x476>
cmpl   $0x0,-0x30(%rbp)
jg     160d <fmtfp+0x4cd>
mov    0x10(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     166b <fmtfp+0x52b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2e,%r8d
call   1040 <doapr_outch@plt>
cmpl   $0x0,-0x88(%rbp)
jle    1666 <fmtfp+0x526>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x88(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x88(%rbp)
cltq
movsbl -0x80(%rbp,%rax,1),%r8d
call   1040 <doapr_outch@plt>
jmp    1628 <fmtfp+0x4e8>
jmp    166b <fmtfp+0x52b>
jmp    1670 <fmtfp+0x530>
cmpl   $0x0,-0x90(%rbp)
jle    16ac <fmtfp+0x56c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x30,%r8d
call   1040 <doapr_outch@plt>
mov    -0x90(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x90(%rbp)
jmp    1670 <fmtfp+0x530>
jmp    16b1 <fmtfp+0x571>
cmpl   $0x0,-0x8c(%rbp)
jge    16ed <fmtfp+0x5ad>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x20,%r8d
call   1040 <doapr_outch@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    16b1 <fmtfp+0x571>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmtfp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r8d,%ebp
movsd  %xmm0,0x18(%rsp)
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,0x38(%rsp)
mov    %rdi,0x30(%rsp)
mov    0xb0(%rsp),%r14d
test   %r9d,%r9d
mov    $0x6,%r12d
cmovns %r9d,%r12d
call   1050 <abs_val@plt>
xorpd  %xmm1,%xmm1
ucomisd 0x18(%rsp),%xmm1
mov    %r14d,0x28(%rsp)
mov    %rbx,0x58(%rsp)
mov    %ebp,0xc(%rsp)
jbe    11a5 <fmtfp+0x65>
movl   $0x2d,0x4(%rsp)
jmp    11c9 <fmtfp+0x89>
test   $0x2,%r14b
jne    11c1 <fmtfp+0x81>
mov    %r14d,%ebp
and    $0x4,%ebp
sete   %al
mov    %eax,0x8(%rsp)
shl    $0x3,%ebp
mov    %ebp,0x4(%rsp)
jmp    11d1 <fmtfp+0x91>
movl   $0x2b,0x4(%rsp)
movl   $0x0,0x8(%rsp)
cvttsd2si %xmm0,%r14
cmp    $0x9,%r12d
mov    $0x9,%ebx
cmovb  %r12d,%ebx
mov    %ebx,%edi
movsd  %xmm0,0x10(%rsp)
call   1030 <pow_10@plt>
call   1060 <roundv@plt>
mov    %rax,%rbp
mov    %rbx,0x18(%rsp)
mov    %ebx,%edi
call   1030 <pow_10@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %r14,%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
call   1060 <roundv@plt>
mov    %rax,%rcx
xor    %edi,%edi
xor    %edx,%edx
cmp    %rbp,%rax
cmovl  %rdi,%rbp
setge  %dl
add    %r14,%rdx
lea    0xdc6(%rip),%r8
movabs $0x6666666666666667,%r9
66 66 66
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdx,%rbx
mov    %rdx,%rax
imul   %r9
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rbx,%rsi
sub    %rax,%rsi
movzbl (%r8,%rsi,1),%esi
lea    0x1(%rdi),%rax
mov    %sil,0x60(%rsp,%rdi,1)
add    $0xfffffffffffffff6,%rbx
cmp    $0xffffffffffffffec,%rbx
ja     1296 <fmtfp+0x156>
cmp    $0x13,%rdi
mov    %rax,%rdi
jb     1250 <fmtfp+0x110>
sub    %rbp,%rcx
lea    -0x1(%rax),%r13d
cmp    $0x14,%eax
cmovne %eax,%r13d
movb   $0x0,0x60(%rsp,%r13,1)
mov    $0x1,%r10d
mov    0x18(%rsp),%rax
cmp    $0x2,%eax
cmovge %eax,%r10d
mov    %r15,0x20(%rsp)
mov    %r10,0x10(%rsp)
jge    12d7 <fmtfp+0x197>
xor    %ebx,%ebx
mov    0xb0(%rsp),%r14d
jmp    1386 <fmtfp+0x246>
and    $0xe,%r10d
xor    %ebx,%ebx
movabs $0xa3d70a3d70a3d70b,%r11
0a d7 a3
mov    %rcx,%rsi
mov    0xb0(%rsp),%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rsi,%rax
imul   %r9
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdi
add    %rax,%rdi
lea    (%rdi,%rdi,1),%rcx
mov    %rdi,%rax
imul   %r9
mov    %rdx,%rbp
lea    (%rcx,%rcx,4),%r15
mov    %rsi,%rax
imul   %r11
mov    %rdx,%rcx
add    %rsi,%rcx
sub    %r15,%rsi
movzbl (%r8,%rsi,1),%eax
mov    %al,0x40(%rsp,%rbx,1)
mov    %rbp,%rax
shr    $0x3f,%rax
sar    $0x2,%rbp
add    %rax,%rbp
add    %rbp,%rbp
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
sub    %rax,%rdi
movzbl (%rdi,%r8,1),%eax
mov    %al,0x41(%rsp,%rbx,1)
add    $0x2,%rbx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x6,%rcx
add    %rax,%rcx
mov    %rcx,%rsi
cmp    %rbx,%r10
jne    1300 <fmtfp+0x1c0>
mov    %r12d,0x2c(%rsp)
mov    0x10(%rsp),%rsi
test   $0x1,%sil
je     13bc <fmtfp+0x27c>
mov    %rcx,%rax
imul   %r9
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    %rdx,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rcx
mov    (%r8,%rcx,1),%al
mov    %al,0x40(%rsp,%rbx,1)
movb   $0x0,0x40(%rsp,%rsi,1)
mov    0x18(%rsp),%rax
add    %r13d,%eax
not    %eax
mov    0x8(%rsp),%esi
mov    %esi,%ecx
xor    $0x1,%cl
movzbl %cl,%ecx
mov    0xc(%rsp),%edx
sub    %ecx,%edx
xor    %ecx,%ecx
add    %eax,%edx
cmovs  %ecx,%edx
mov    %edx,%r12d
neg    %r12d
test   $0x1,%r14b
cmove  %edx,%r12d
test   $0x10,%r14b
mov    0x58(%rsp),%rbp
mov    0x20(%rsp),%r14
mov    0x38(%rsp),%r15
mov    0x30(%rsp),%rbx
je     1466 <fmtfp+0x326>
test   %r12d,%r12d
jle    1466 <fmtfp+0x326>
test   %sil,%sil
jne    1432 <fmtfp+0x2f2>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    0x4(%rsp),%r8d
call   1040 <doapr_outch@plt>
add    $0xffffffff,%r12d
je     1461 <fmtfp+0x321>
add    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    $0x30,%r8d
call   1040 <doapr_outch@plt>
add    $0xffffffff,%r12d
cmp    $0x1,%r12d
ja     1440 <fmtfp+0x300>
xor    %r12d,%r12d
jmp    14af <fmtfp+0x36f>
test   %r12d,%r12d
jle    1494 <fmtfp+0x354>
add    $0x1,%r12d
nop
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    $0x20,%r8d
call   1040 <doapr_outch@plt>
add    $0xffffffff,%r12d
cmp    $0x1,%r12d
ja     1470 <fmtfp+0x330>
xor    %r12d,%r12d
mov    0x4(%rsp),%r8d
test   %r8d,%r8d
je     14af <fmtfp+0x36f>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   1040 <doapr_outch@plt>
mov    %r13,%rax
test   %eax,%eax
mov    0x20(%rsp),%rdx
mov    0x38(%rsp),%rsi
mov    0x30(%rsp),%rcx
mov    %rcx,%r14
mov    %rsi,%r13
je     1509 <fmtfp+0x3c9>
lea    0x1(%rax),%ebx
add    $0xffffffff,%eax
lea    (%rsp,%rax,1),%r15
add    $0x60,%r15
nopl   0x0(%rax)
movsbl (%r15),%r8d
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbp,%rcx
call   1040 <doapr_outch@plt>
mov    0x20(%rsp),%rdx
mov    %r13,%rsi
mov    %r14,%rcx
add    $0xffffffff,%ebx
add    $0xffffffffffffffff,%r15
cmp    $0x1,%ebx
jg     14e0 <fmtfp+0x3a0>
mov    0x18(%rsp),%rax
sub    0x10(%rsp),%eax
mov    %eax,0xc(%rsp)
cmpl   $0x0,0x2c(%rsp)
mov    %rbp,%r15
jg     1527 <fmtfp+0x3e7>
andl   $0x8,0x28(%rsp)
je     158a <fmtfp+0x44a>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r15,%rcx
mov    $0x2e,%r8d
call   1040 <doapr_outch@plt>
mov    0x20(%rsp),%rdx
mov    0x10(%rsp),%rax
lea    0x1(%rax),%ebx
add    $0xffffffff,%eax
lea    (%rsp,%rax,1),%rbp
add    $0x40,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x0(%rbp),%r8d
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r15,%rcx
call   1040 <doapr_outch@plt>
mov    0x20(%rsp),%rdx
mov    %r13,%rsi
mov    %r14,%rcx
add    $0xffffffff,%ebx
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%ebx
jg     1560 <fmtfp+0x420>
cmpl   $0x0,0xc(%rsp)
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rcx,%rbp
mov    0x18(%rsp),%rbx
jle    15cf <fmtfp+0x48f>
sub    0x10(%rsp),%ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    $0x30,%r8d
call   1040 <doapr_outch@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jg     15b0 <fmtfp+0x470>
test   %r12d,%r12d
jns    15fc <fmtfp+0x4bc>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    $0x20,%r8d
call   1040 <doapr_outch@plt>
inc    %r12d
jne    15e0 <fmtfp+0x4a0>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [17 x i8] c"0123456789abcdef\00"
define void @fmtfp(i8** %0, i8** %1, i64* %2, i64* %3, double %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca [20 x i8]
%10 = alloca [20 x i8]
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%13 = icmp slt i32 %6, 0
%14 = select i1 %13, i32 6, i32 %6
%15 = tail call double @abs_val(double %4)
%16 = fcmp olt double %4, 0.000000e+00
br i1 %16, label %24, label %17
17: ; preds = %8
%18 = and i32 %7, 2
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = and i32 %7, 4
%22 = icmp eq i32 %21, 0
%23 = shl nuw nsw i32 %21, 3
br label %24
24: ; preds = %20, %17, %8
%25 = phi i1 [ false, %8 ], [ false, %17 ], [ %22, %20 ]
%26 = phi i32 [ 45, %8 ], [ 43, %17 ], [ %23, %20 ]
%27 = fptosi double %15 to i64
%28 = icmp ult i32 %14, 9
%29 = select i1 %28, i32 %14, i32 9
%30 = tail call double @pow_10(i32 %29)
%31 = tail call i64 @roundv(double %30)
%32 = tail call double @pow_10(i32 %29)
%33 = sitofp i64 %27 to double
%34 = fsub double %15, %33
%35 = fmul double %34, %32
%36 = tail call i64 @roundv(double %35)
%37 = icmp slt i64 %36, %31
%38 = xor i1 %37, true
%39 = zext i1 %38 to i64
%40 = add nsw i64 %39, %27
%41 = select i1 %37, i64 0, i64 %31
br label %42
42: ; preds = %42, %24
%43 = phi i64 [ %48, %42 ], [ 0, %24 ]
%44 = phi i64 [ %50, %42 ], [ %40, %24 ]
%45 = srem i64 %44, 10
%46 = getelementptr inbounds [17 x i8], [17 x i8]* @.str.1, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = add nuw nsw i64 %43, 1
%49 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 %43
store i8 %47, i8* %49
%50 = sdiv i64 %44, 10
%51 = add i64 %44, -10
%52 = icmp ult i64 %51, -19
%53 = icmp ult i64 %43, 19
%54 = select i1 %52, i1 %53, i1 false
br i1 %54, label %42, label %55
55: ; preds = %42
%56 = sub nsw i64 %36, %41
%57 = trunc i64 %43 to i32
%58 = trunc i64 %48 to i32
%59 = icmp eq i32 %58, 20
%60 = select i1 %59, i32 %57, i32 %58
%61 = zext i32 %60 to i64
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 %61
store i8 0, i8* %62
%63 = call i32 @llvm.smax.i32(i32 %29, i32 1)
%64 = zext i32 %63 to i64
%65 = and i64 %64, 1
%66 = icmp slt i32 %29, 2
br i1 %66, label %87, label %67
67: ; preds = %55
%68 = and i64 %64, 14
br label %69
69: ; preds = %69, %67
%70 = phi i64 [ 0, %67 ], [ %82, %69 ]
%71 = phi i64 [ %56, %67 ], [ %84, %69 ]
%72 = phi i64 [ 0, %67 ], [ %85, %69 ]
%73 = srem i64 %71, 10
%74 = getelementptr inbounds [17 x i8], [17 x i8]* @.str.1, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = or i64 %70, 1
%77 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %70
store i8 %75, i8* %77
%78 = sdiv i64 %71, 10
%79 = srem i64 %78, 10
%80 = getelementptr inbounds [17 x i8], [17 x i8]* @.str.1, i64 0, i64 %79
%81 = load i8, i8* %80
%82 = add nuw nsw i64 %70, 2
%83 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %76
store i8 %81, i8* %83
%84 = sdiv i64 %71, 100
%85 = add i64 %72, 2
%86 = icmp eq i64 %85, %68
br i1 %86, label %87, label %69
87: ; preds = %69, %55
%88 = phi i64 [ 0, %55 ], [ %82, %69 ]
%89 = phi i64 [ %56, %55 ], [ %84, %69 ]
%90 = icmp eq i64 %65, 0
br i1 %90, label %96, label %91
91: ; preds = %87
%92 = srem i64 %89, 10
%93 = getelementptr inbounds [17 x i8], [17 x i8]* @.str.1, i64 0, i64 %92
%94 = load i8, i8* %93
%95 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %88
store i8 %94, i8* %95
br label %96
96: ; preds = %87, %91
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %64
store i8 0, i8* %97
%98 = add nuw i32 %60, %29
%99 = xor i32 %98, -1
%100 = xor i1 %25, true
%101 = sext i1 %100 to i32
%102 = add i32 %101, %5
%103 = add i32 %102, %99
%104 = sub nsw i32 %29, %63
%105 = icmp sgt i32 %104, 0
%106 = icmp sgt i32 %103, 0
%107 = select i1 %106, i32 %103, i32 0
%108 = and i32 %7, 1
%109 = icmp eq i32 %108, 0
%110 = sub nsw i32 0, %107
%111 = select i1 %109, i32 %107, i32 %110
%112 = and i32 %7, 16
%113 = icmp ne i32 %112, 0
%114 = icmp sgt i32 %111, 0
%115 = select i1 %113, i1 %114, i1 false
br i1 %115, label %116, label %129
116: ; preds = %96
br i1 %25, label %122, label %117
117: ; preds = %116
%118 = trunc i32 %26 to i8
%119 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext %118)
%120 = add nsw i32 %111, -1
%121 = icmp eq i32 %120, 0
br i1 %121, label %142, label %122
122: ; preds = %116, %117
%123 = phi i32 [ %111, %116 ], [ %120, %117 ]
br label %124
124: ; preds = %122, %124
%125 = phi i32 [ %127, %124 ], [ %123, %122 ]
%126 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext 48)
%127 = add nsw i32 %125, -1
%128 = icmp ugt i32 %125, 1
br i1 %128, label %124, label %142
129: ; preds = %96
%130 = icmp sgt i32 %111, 0
br i1 %130, label %131, label %136
131: ; preds = %129, %131
%132 = phi i32 [ %134, %131 ], [ %111, %129 ]
%133 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext 32)
%134 = add nsw i32 %132, -1
%135 = icmp ugt i32 %132, 1
br i1 %135, label %131, label %136
136: ; preds = %131, %129
%137 = phi i32 [ %111, %129 ], [ 0, %131 ]
%138 = icmp eq i32 %26, 0
br i1 %138, label %142, label %139
139: ; preds = %136
%140 = trunc i32 %26 to i8
%141 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext %140)
br label %142
142: ; preds = %124, %117, %139, %136
%143 = phi i32 [ %137, %139 ], [ %137, %136 ], [ 0, %117 ], [ 0, %124 ]
%144 = icmp eq i32 %60, 0
br i1 %144, label %154, label %145
145: ; preds = %142, %145
%146 = phi i64 [ %147, %145 ], [ %61, %142 ]
%147 = add nsw i64 %146, -1
%148 = and i64 %147, 4294967295
%149 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 %148
%150 = load i8, i8* %149
%151 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext %150)
%152 = trunc i64 %146 to i32
%153 = icmp sgt i32 %152, 1
br i1 %153, label %145, label %154
154: ; preds = %145, %142
%155 = icmp slt i32 %14, 1
%156 = and i32 %7, 8
%157 = icmp eq i32 %156, 0
%158 = and i1 %155, %157
br i1 %158, label %170, label %159
159: ; preds = %154
%160 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext 46)
br label %161
161: ; preds = %159, %161
%162 = phi i64 [ %64, %159 ], [ %163, %161 ]
%163 = add nsw i64 %162, -1
%164 = and i64 %163, 4294967295
%165 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %164
%166 = load i8, i8* %165
%167 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext %166)
%168 = trunc i64 %162 to i32
%169 = icmp sgt i32 %168, 1
br i1 %169, label %161, label %170
170: ; preds = %161, %154
br i1 %105, label %173, label %171
171: ; preds = %173, %170
%172 = icmp slt i32 %143, 0
br i1 %172, label %178, label %183
173: ; preds = %170, %173
%174 = phi i32 [ %176, %173 ], [ %104, %170 ]
%175 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext 48)
%176 = add nsw i32 %174, -1
%177 = icmp sgt i32 %174, 1
br i1 %177, label %173, label %171
178: ; preds = %171, %178
%179 = phi i32 [ %181, %178 ], [ %143, %171 ]
%180 = tail call i32 @doapr_outch(i8** %0, i8** %1, i64* %2, i64* %3, i8 signext 32)
%181 = add i32 %179, 1
%182 = icmp eq i32 %181, 0
br i1 %182, label %183, label %178
183: ; preds = %178, %171
ret void
}