#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 */
double modf(double, double *);
char *ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag) {
  register int r2;
  double fi, fj;
  register char *p, *p1;
  static char buf[80];
  if (ndigits >= 80 - 1)
    ndigits = 80 - 2;
  r2 = 0;
  *sign = 0;
  p = &buf[0];
  if (arg < 0) {
    *sign = 1;
    arg = -arg;
  }
  arg = modf(arg, &fi);
  p1 = &buf[80];
  if (fi != 0) {
    p1 = &buf[80];
    while (fi != 0) {
      fj = modf(fi / 10, &fi);
      *--p1 = (int)((fj + .03) * 10) + '0';
      r2++;
    }
    while (p1 < &buf[80])
      *p++ = *p1++;
  } else if (arg > 0) {
    while ((fj = arg * 10) < 1) {
      arg = fj;
      r2--;
    }
  }
  p1 = &buf[ndigits];
  if (eflag == 0)
    p1 += r2;
  *decpt = r2;
  if (p1 < &buf[0]) {
    buf[0] = '\0';
    return (buf);
  }
  while (p <= p1 && p < &buf[80]) {
    arg *= 10;
    arg = modf(arg, &fj);
    *p++ = (int)fj + '0';
  }
  if (p1 >= &buf[80]) {
    buf[80 - 1] = '\0';
    return (buf);
  }
  p = p1;
  *p1 += 5;
  while (*p1 > '9') {
    *p1 = '0';
    if (p1 > buf)
      ++*--p1;
    else {
      *p1 = '1';
      (*decpt)++;
      if (eflag == 0) {
        if (p > buf)
          *p = '0';
        p++;
      }
    }
  }
  *p = '\0';
  return (buf);
}


x86 assembly (clang, -O0):
<ap_cvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
cmpl   $0x4f,-0x14(%rbp)
jl     113c <ap_cvt+0x2c>
movl   $0x4e,-0x14(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
lea    0x2eec(%rip),%rax
mov    %rax,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1191 <ap_cvt+0x81>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x38(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x10(%rbp)
lea    0x2e95(%rip),%rax
add    $0x50,%rax
mov    %rax,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11d0 <ap_cvt+0xc0>
jp     11d0 <ap_cvt+0xc0>
jmp    12a3 <ap_cvt+0x193>
lea    0x2e69(%rip),%rax
add    $0x50,%rax
mov    %rax,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11fc <ap_cvt+0xec>
jp     11fc <ap_cvt+0xec>
jmp    125d <ap_cvt+0x14d>
movsd  -0x38(%rbp),%xmm0
movsd  0xdff(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    -0x38(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xded(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  0xdd8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x50(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11df <ap_cvt+0xcf>
jmp    1262 <ap_cvt+0x152>
lea    0x2dd7(%rip),%rax
add    $0x50,%rax
cmp    %rax,-0x50(%rbp)
jae    129e <ap_cvt+0x18e>
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x50(%rbp)
mov    (%rax),%cl
mov    -0x48(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x48(%rbp)
mov    %cl,(%rax)
jmp    1262 <ap_cvt+0x152>
jmp    1300 <ap_cvt+0x1f0>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12fb <ap_cvt+0x1eb>
jmp    12ba <ap_cvt+0x1aa>
movsd  0xd46(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  %xmm1,-0x40(%rbp)
movsd  0xd2c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12f6 <ap_cvt+0x1e6>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    12ba <ap_cvt+0x1aa>
jmp    12fb <ap_cvt+0x1eb>
jmp    1300 <ap_cvt+0x1f0>
movslq -0x14(%rbp),%rcx
lea    0x2d35(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    132d <ap_cvt+0x21d>
mov    -0x30(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
lea    0x2d03(%rip),%rax
cmp    %rax,-0x50(%rbp)
jae    135e <ap_cvt+0x24e>
movb   $0x0,0x2cf2(%rip)
lea    0x2ceb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    14c1 <ap_cvt+0x3b1>
jmp    1363 <ap_cvt+0x253>
mov    -0x48(%rbp),%rcx
xor    %eax,%eax
cmp    -0x50(%rbp),%rcx
mov    %al,-0x51(%rbp)
ja     138b <ap_cvt+0x27b>
lea    0x2cc3(%rip),%rax
add    $0x50,%rax
cmp    %rax,-0x48(%rbp)
setb   %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
test   $0x1,%al
jne    139b <ap_cvt+0x28b>
jmp    13e0 <ap_cvt+0x2d0>
movsd  0xc65(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x40(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x40(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x48(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x48(%rbp)
mov    %cl,(%rax)
jmp    1363 <ap_cvt+0x253>
lea    0x2c59(%rip),%rax
add    $0x50,%rax
cmp    %rax,-0x50(%rbp)
jb     140c <ap_cvt+0x2fc>
movb   $0x0,0x2c93(%rip)
lea    0x2c3d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    14c1 <ap_cvt+0x3b1>
mov    -0x50(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rax
movsbl (%rax),%ecx
add    $0x5,%ecx
mov    %cl,(%rax)
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    14af <ap_cvt+0x39f>
mov    -0x50(%rbp),%rax
movb   $0x30,(%rax)
lea    0x2c02(%rip),%rax
cmp    %rax,-0x50(%rbp)
jbe    1465 <ap_cvt+0x355>
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x50(%rbp)
mov    -0x1(%rax),%cl
add    $0x1,%cl
mov    %cl,-0x1(%rax)
jmp    14aa <ap_cvt+0x39a>
mov    -0x50(%rbp),%rax
movb   $0x31,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
cmpl   $0x0,-0x2c(%rbp)
jne    14a5 <ap_cvt+0x395>
lea    0x2bb8(%rip),%rax
cmp    %rax,-0x48(%rbp)
jbe    1499 <ap_cvt+0x389>
mov    -0x48(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    14aa <ap_cvt+0x39a>
jmp    1420 <ap_cvt+0x310>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2b83(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_cvt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%r15d
mov    %rsi,0x8(%rsp)
cmp    $0x4e,%edi
mov    $0x4e,%r12d
cmovl  %edi,%r12d
movl   $0x0,(%rdx)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1151 <ap_cvt+0x41>
movl   $0x1,(%rdx)
xorpd  0xeaf(%rip),%xmm0
lea    0x20(%rsp),%rdi
call   1030 <modf@plt>
movapd %xmm0,%xmm3
movsd  0x20(%rsp),%xmm0
ucomisd 0xebb(%rip),%xmm0
jne    1175 <ap_cvt+0x65>
jnp    121e <ap_cvt+0x10e>
movsd  %xmm3,0x10(%rsp)
xor    %ebp,%ebp
lea    0x20(%rsp),%r13
lea    0x2eb7(%rip),%rbx
xor    %r14d,%r14d
nopl   0x0(%rax)
movsd  0xe78(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    %r13,%rdi
call   1030 <modf@plt>
movapd %xmm0,%xmm1
addsd  0xe70(%rip),%xmm0
mulsd  0xe58(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x30,%al
mov    %al,0x4f(%r14,%rbx,1)
movsd  0x20(%rsp),%xmm0
add    $0xffffffffffffffff,%r14
add    $0x1,%rbp
ucomisd 0xe4f(%rip),%xmm0
jne    1190 <ap_cvt+0x80>
jp     1190 <ap_cvt+0x80>
movsd  %xmm1,0x18(%rsp)
lea    (%r14,%rbx,1),%rsi
add    $0x50,%rsi
lea    0x2e9e(%rip),%rcx
mov    %r14,%rax
neg    %rax
cmp    %rcx,%rsi
jae    1270 <ap_cvt+0x160>
mov    %rsi,%r11
sub    %r14,%r11
lea    0x2e36(%rip),%r10
cmp    $0x20,%rax
jae    1280 <ap_cvt+0x170>
mov    %r10,%rbx
movsd  0x10(%rsp),%xmm3
jmp    13d0 <ap_cvt+0x2c0>
lea    0x2e1b(%rip),%rbx
xor    %eax,%eax
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
mov    0x8(%rsp),%rsi
jbe    1458 <ap_cvt+0x348>
mov    $0x1,%eax
movsd  0xdc9(%rip),%xmm0
movsd  0xdc9(%rip),%xmm1
nop
movapd %xmm3,%xmm2
mulsd  %xmm0,%xmm3
add    $0xffffffff,%eax
ucomisd %xmm3,%xmm1
ja     1250 <ap_cvt+0x140>
movsd  %xmm3,0x18(%rsp)
movapd %xmm2,%xmm3
jmp    1458 <ap_cvt+0x348>
mov    0x8(%rsp),%rsi
movsd  0x10(%rsp),%xmm3
jmp    1458 <ap_cvt+0x348>
lea    0x2db9(%rip),%rbx
cmp    %rbx,%r11
movsd  0x10(%rsp),%xmm3
jbe    12a1 <ap_cvt+0x191>
mov    %rbx,%rcx
sub    %r14,%rcx
cmp    %rcx,%rsi
jb     13d0 <ap_cvt+0x2c0>
mov    %rax,%r8
and    $0xffffffffffffffe0,%r8
lea    0x2d91(%rip),%rsi
lea    -0x20(%r8),%rcx
mov    %rcx,%r9
shr    $0x5,%r9
add    $0x1,%r9
cmp    $0x60,%rcx
jae    12cb <ap_cvt+0x1bb>
xor    %ebx,%ebx
jmp    1358 <ap_cvt+0x248>
mov    %r9,%rdi
and    $0xfffffffffffffffc,%rdi
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rsi,%rbx,1),%rcx
movups 0x50(%r14,%rcx,1),%xmm0
movups 0x60(%r14,%rcx,1),%xmm1
movaps %xmm0,(%rbx,%rsi,1)
movaps %xmm1,0x10(%rbx,%rsi,1)
movups 0x70(%r14,%rcx,1),%xmm0
movups 0x80(%r14,%rcx,1),%xmm1
movaps %xmm0,0x20(%rbx,%rsi,1)
movaps %xmm1,0x30(%rbx,%rsi,1)
movups 0x90(%r14,%rcx,1),%xmm0
movups 0xa0(%r14,%rcx,1),%xmm1
movaps %xmm0,0x40(%rbx,%rsi,1)
movaps %xmm1,0x50(%rbx,%rsi,1)
movupd 0xb0(%r14,%rcx,1),%xmm0
movupd 0xc0(%r14,%rcx,1),%xmm1
movapd %xmm0,0x60(%rbx,%rsi,1)
movapd %xmm1,0x70(%rbx,%rsi,1)
sub    $0xffffffffffffff80,%rbx
add    $0xfffffffffffffffc,%rdi
jne    12e0 <ap_cvt+0x1d0>
test   $0x3,%r9b
je     13b5 <ap_cvt+0x2a5>
lea    (%rbx,%rsi,1),%rdi
add    $0x10,%rdi
mov    %eax,%ecx
and    $0x60,%cl
add    $0xe0,%cl
shr    $0x5,%cl
add    $0x1,%cl
movzbl %cl,%r9d
and    $0x3,%r9d
shl    $0x5,%r9
add    %rsi,%rbx
add    $0x60,%rbx
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    (%rbx,%rcx,1),%rdx
movupd -0x10(%r14,%rdx,1),%xmm0
movupd (%r14,%rdx,1),%xmm1
movapd %xmm0,-0x10(%rdi,%rcx,1)
movapd %xmm1,(%rdi,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%r9
jne    1390 <ap_cvt+0x280>
lea    (%rsi,%r8,1),%rbx
cmp    %r8,%rax
je     1453 <ap_cvt+0x343>
and    $0xffffffffffffffe0,%rbp
add    %rbp,%rsi
add    %r14,%rsi
add    $0x50,%rsi
mov    %r10d,%edi
sub    %esi,%edi
add    $0x50,%edi
sub    %rsi,%r10
add    $0x4f,%r10
and    $0x7,%rdi
je     1403 <ap_cvt+0x2f3>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,(%rbx)
add    $0x1,%rbx
add    $0xffffffffffffffff,%rdi
jne    13f0 <ap_cvt+0x2e0>
cmp    $0x6,%r10
jbe    1453 <ap_cvt+0x343>
nopl   0x0(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rbx)
movzbl 0x1(%rsi),%ecx
mov    %cl,0x1(%rbx)
movzbl 0x2(%rsi),%ecx
mov    %cl,0x2(%rbx)
movzbl 0x3(%rsi),%ecx
mov    %cl,0x3(%rbx)
movzbl 0x4(%rsi),%ecx
mov    %cl,0x4(%rbx)
movzbl 0x5(%rsi),%ecx
mov    %cl,0x5(%rbx)
movzbl 0x6(%rsi),%ecx
mov    %cl,0x6(%rbx)
movzbl 0x7(%rsi),%ecx
mov    %cl,0x7(%rbx)
add    $0x8,%rbx
add    $0x8,%rsi
cmp    %r11,%rsi
jne    1410 <ap_cvt+0x300>
mov    0x8(%rsp),%rsi
movslq %r12d,%rcx
lea    0x2bde(%rip),%r14
add    %r14,%rcx
xor    %edx,%edx
test   %r15d,%r15d
cmove  %eax,%edx
movslq %edx,%rbp
add    %rcx,%rbp
mov    %eax,(%rsi)
cmp    %r14,%rbp
jae    1486 <ap_cvt+0x376>
movb   $0x0,0x2bbf(%rip)
jmp    154e <ap_cvt+0x43e>
cmp    %rbp,%rbx
ja     14d4 <ap_cvt+0x3c4>
lea    0x2bfe(%rip),%r13
cmp    %r13,%rbx
jae    14d4 <ap_cvt+0x3c4>
add    $0x1,%rbx
lea    0x18(%rsp),%r12
mulsd  0xb68(%rip),%xmm3
movapd %xmm3,%xmm0
mov    %r12,%rdi
call   1030 <modf@plt>
cvttsd2si 0x18(%rsp),%eax
add    $0x30,%al
mov    %al,-0x1(%rbx)
cmp    %rbp,%rbx
ja     14d4 <ap_cvt+0x3c4>
movapd %xmm0,%xmm3
lea    0x1(%rbx),%rax
cmp    %r13,%rbx
mov    %rax,%rbx
jb     14a0 <ap_cvt+0x390>
lea    0x2bb5(%rip),%rax
cmp    %rax,%rbp
jae    153f <ap_cvt+0x42f>
mov    0x0(%rbp),%al
add    $0x5,%al
mov    %al,0x0(%rbp)
cmp    $0x3a,%al
jl     1548 <ap_cvt+0x438>
mov    %rbp,%rax
mov    0x8(%rsp),%rdx
jmp    1513 <ap_cvt+0x403>
cs nopw 0x0(%rax,%rax,1)
movzbl -0x1(%rbp),%ecx
add    $0x1,%cl
mov    %cl,-0x1(%rbp)
add    $0xffffffffffffffff,%rbp
cmp    $0x39,%cl
jle    154b <ap_cvt+0x43b>
movb   $0x30,0x0(%rbp)
cmp    %r14,%rbp
ja     1500 <ap_cvt+0x3f0>
movb   $0x31,0x0(%rbp)
addl   $0x1,(%rdx)
test   %r15d,%r15d
jne    1534 <ap_cvt+0x424>
cmp    %r14,%rax
jbe    1530 <ap_cvt+0x420>
movb   $0x30,(%rax)
add    $0x1,%rax
movzbl 0x0(%rbp),%ecx
cmp    $0x39,%cl
jg     1513 <ap_cvt+0x403>
jmp    154b <ap_cvt+0x43b>
movb   $0x0,0x2b49(%rip)
jmp    154e <ap_cvt+0x43e>
mov    %rbp,%rax
movb   $0x0,(%rax)
lea    0x2aeb(%rip),%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@ap_cvt.buf = internal global [80 x i8] zeroinitializer
define i8* @ap_cvt(double %0, i32 %1, i32* %2, i32* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca i8*
%16 = alloca i8*
store double %0, double* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
%17 = load i32, i32* %8
%18 = icmp sge i32 %17, 79
br i1 %18, label %19, label %20
19: ; preds = %5
store i32 78, i32* %8
br label %20
20: ; preds = %19, %5
store i32 0, i32* %12
%21 = load i32*, i32** %10
store i32 0, i32* %21
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0), i8** %15
%22 = load double, double* %7
%23 = fcmp olt double %22, 0.000000e+00
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i32*, i32** %10
store i32 1, i32* %25
%26 = load double, double* %7
%27 = fneg double %26
store double %27, double* %7
br label %28
28: ; preds = %24, %20
%29 = load double, double* %7
%30 = call double @modf(double %29, double* %13)
store double %30, double* %7
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 1, i64 0), i8** %16
%31 = load double, double* %13
%32 = fcmp une double %31, 0.000000e+00
br i1 %32, label %33, label %62
33: ; preds = %28
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 1, i64 0), i8** %16
br label %34
34: ; preds = %37, %33
%35 = load double, double* %13
%36 = fcmp une double %35, 0.000000e+00
br i1 %36, label %37, label %51
37: ; preds = %34
%38 = load double, double* %13
%39 = fdiv double %38, 1.000000e+01
%40 = call double @modf(double %39, double* %13)
store double %40, double* %14
%41 = load double, double* %14
%42 = fadd double %41, 3.000000e-02
%43 = fmul double %42, 1.000000e+01
%44 = fptosi double %43 to i32
%45 = add nsw i32 %44, 48
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %16
%48 = getelementptr inbounds i8, i8* %47, i32 -1
store i8* %48, i8** %16
store i8 %46, i8* %48
%49 = load i32, i32* %12
%50 = add nsw i32 %49, 1
store i32 %50, i32* %12
br label %34
51: ; preds = %34
br label %52
52: ; preds = %55, %51
%53 = load i8*, i8** %16
%54 = icmp ult i8* %53, getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 1, i64 0)
br i1 %54, label %55, label %61
55: ; preds = %52
%56 = load i8*, i8** %16
%57 = getelementptr inbounds i8, i8* %56, i32 1
store i8* %57, i8** %16
%58 = load i8, i8* %56
%59 = load i8*, i8** %15
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %15
store i8 %58, i8* %59
br label %52
61: ; preds = %52
br label %76
62: ; preds = %28
%63 = load double, double* %7
%64 = fcmp ogt double %63, 0.000000e+00
br i1 %64, label %65, label %75
65: ; preds = %62
br label %66
66: ; preds = %70, %65
%67 = load double, double* %7
%68 = fmul double %67, 1.000000e+01
store double %68, double* %14
%69 = fcmp olt double %68, 1.000000e+00
br i1 %69, label %70, label %74
70: ; preds = %66
%71 = load double, double* %14
store double %71, double* %7
%72 = load i32, i32* %12
%73 = add nsw i32 %72, -1
store i32 %73, i32* %12
br label %66
74: ; preds = %66
br label %75
75: ; preds = %74, %62
br label %76
76: ; preds = %75, %61
%77 = load i32, i32* %8
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 %78
store i8* %79, i8** %16
%80 = load i32, i32* %11
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %87
82: ; preds = %76
%83 = load i32, i32* %12
%84 = load i8*, i8** %16
%85 = sext i32 %83 to i64
%86 = getelementptr inbounds i8, i8* %84, i64 %85
store i8* %86, i8** %16
br label %87
87: ; preds = %82, %76
%88 = load i32, i32* %12
%89 = load i32*, i32** %9
store i32 %88, i32* %89
%90 = load i8*, i8** %16
%91 = icmp ult i8* %90, getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0)
br i1 %91, label %92, label %93
92: ; preds = %87
store i8 0, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0)
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0), i8** %6
br label %158
93: ; preds = %87
br label %94
94: ; preds = %103, %93
%95 = load i8*, i8** %15
%96 = load i8*, i8** %16
%97 = icmp ule i8* %95, %96
br i1 %97, label %98, label %101
98: ; preds = %94
%99 = load i8*, i8** %15
%100 = icmp ult i8* %99, getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 1, i64 0)
br label %101
101: ; preds = %98, %94
%102 = phi i1 [ false, %94 ], [ %100, %98 ]
br i1 %102, label %103, label %114
103: ; preds = %101
%104 = load double, double* %7
%105 = fmul double %104, 1.000000e+01
store double %105, double* %7
%106 = load double, double* %7
%107 = call double @modf(double %106, double* %14)
store double %107, double* %7
%108 = load double, double* %14
%109 = fptosi double %108 to i32
%110 = add nsw i32 %109, 48
%111 = trunc i32 %110 to i8
%112 = load i8*, i8** %15
%113 = getelementptr inbounds i8, i8* %112, i32 1
store i8* %113, i8** %15
store i8 %111, i8* %112
br label %94
114: ; preds = %101
%115 = load i8*, i8** %16
%116 = icmp uge i8* %115, getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 1, i64 0)
br i1 %116, label %117, label %118
117: ; preds = %114
store i8 0, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 79)
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0), i8** %6
br label %158
118: ; preds = %114
%119 = load i8*, i8** %16
store i8* %119, i8** %15
%120 = load i8*, i8** %16
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = add nsw i32 %122, 5
%124 = trunc i32 %123 to i8
store i8 %124, i8* %120
br label %125
125: ; preds = %155, %118
%126 = load i8*, i8** %16
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp sgt i32 %128, 57
br i1 %129, label %130, label %156
130: ; preds = %125
%131 = load i8*, i8** %16
store i8 48, i8* %131
%132 = load i8*, i8** %16
%133 = icmp ugt i8* %132, getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0)
br i1 %133, label %134, label %139
134: ; preds = %130
%135 = load i8*, i8** %16
%136 = getelementptr inbounds i8, i8* %135, i32 -1
store i8* %136, i8** %16
%137 = load i8, i8* %136
%138 = add i8 %137, 1
store i8 %138, i8* %136
br label %155
139: ; preds = %130
%140 = load i8*, i8** %16
store i8 49, i8* %140
%141 = load i32*, i32** %9
%142 = load i32, i32* %141
%143 = add nsw i32 %142, 1
store i32 %143, i32* %141
%144 = load i32, i32* %11
%145 = icmp eq i32 %144, 0
br i1 %145, label %146, label %154
146: ; preds = %139
%147 = load i8*, i8** %15
%148 = icmp ugt i8* %147, getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0)
br i1 %148, label %149, label %151
149: ; preds = %146
%150 = load i8*, i8** %15
store i8 48, i8* %150
br label %151
151: ; preds = %149, %146
%152 = load i8*, i8** %15
%153 = getelementptr inbounds i8, i8* %152, i32 1
store i8* %153, i8** %15
br label %154
154: ; preds = %151, %139
br label %155
155: ; preds = %154, %134
br label %125
156: ; preds = %125
%157 = load i8*, i8** %15
store i8 0, i8* %157
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @ap_cvt.buf, i64 0, i64 0), i8** %6
br label %158
158: ; preds = %156, %117, %92
%159 = load i8*, i8** %6
ret i8* %159
}

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