#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 */
int /*<<< orphan*/ frexpl(long double, int *);
int incr_hex(char *, int);
long double ldexpl(long double, int);
int ltoa(long, char *);
int val_hex(char *, int);
char *acvt(char *out, long double value, int fdigit, int *decpt, int conv) {
  char *pos = out + 1;
  int ip_len, exp;
  int full_prec = fdigit == -1;
  const char *bnum = "0123456789abcdef";
  if (conv == 'A')
    bnum = "0123456789ABCDEF";
  out[0] = '0';
  if (value < 0)
    value = -value;
  if (value) {
    frexpl(value, &exp);
    value = ldexpl(value, -(exp - 1));
  }
  pos += ip_len = ltoa((long)value, pos);
  value -= (long)value;
  *decpt = ip_len;
  if (full_prec) {
    while (value) {
      int ival = (int)(value *= 16);
      *pos++ = bnum[ival];
      value -= ival;
    }
  } else {
    fdigit++;
    while (fdigit--) {
      int ival = (int)(value *= 16);
      *pos++ = bnum[ival];
      value -= ival;
    }
    if (val_hex(--pos, conv == 'A') >= 0x8) {
      char *ptr = pos;
      while (incr_hex(--ptr, conv == 'A') > 0xf)
        *ptr = 0;
    }
  }
  *pos = 0;
  return out + 1;
}


x86 assembly (clang, -O0):
<acvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %ecx,-0x34(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4c(%rbp)
lea    0xe73(%rip),%rax
mov    %rax,-0x58(%rbp)
cmpl   $0x41,-0x34(%rbp)
jne    11aa <acvt+0x5a>
lea    0xe6f(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    11cd <acvt+0x7d>
jmp    11c5 <acvt+0x75>
fldt   -0x20(%rbp)
fchs
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    11e9 <acvt+0x99>
jp     11e9 <acvt+0x99>
jmp    1214 <acvt+0xc4>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    -0x48(%rbp),%rdi
call   1060 <frexpl@plt>
fldt   -0x20(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x1,%edi
sub    %eax,%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1070 <ldexpl@plt>
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fnstcw -0x92(%rbp)
movzwl -0x92(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x94(%rbp)
fldcw  -0x94(%rbp)
fistpll -0x80(%rbp)
fldcw  -0x92(%rbp)
mov    -0x80(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <ltoa@plt>
mov    %eax,%ecx
mov    %ecx,-0x44(%rbp)
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
fldt   -0x20(%rbp)
fnstcw -0x96(%rbp)
movzwl -0x96(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x98(%rbp)
fldcw  -0x98(%rbp)
fld    %st(0)
fistpll -0x78(%rbp)
fldcw  -0x96(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x70(%rbp)
fildll -0x70(%rbp)
fsubrp %st,%st(1)
fstpt  -0x20(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x4c(%rbp)
je     1351 <acvt+0x201>
jmp    12b4 <acvt+0x164>
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    12d0 <acvt+0x180>
jp     12d0 <acvt+0x180>
jmp    134c <acvt+0x1fc>
fldt   -0x20(%rbp)
flds   0xd27(%rip)
fmulp  %st,%st(1)
fld    %st(0)
fstpt  -0x20(%rbp)
fnstcw -0x9a(%rbp)
movzwl -0x9a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x9c(%rbp)
fldcw  -0x9c(%rbp)
fistpl -0x90(%rbp)
fldcw  -0x9a(%rbp)
mov    -0x90(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x40(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x40(%rbp)
mov    %cl,(%rax)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
fildl  -0x8c(%rbp)
fldt   -0x20(%rbp)
fsubp  %st,%st(1)
fstpt  -0x20(%rbp)
jmp    12b4 <acvt+0x164>
jmp    1454 <acvt+0x304>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x0,%eax
je     13ea <acvt+0x29a>
fldt   -0x20(%rbp)
flds   0xc89(%rip)
fmulp  %st,%st(1)
fld    %st(0)
fstpt  -0x20(%rbp)
fnstcw -0x9e(%rbp)
movzwl -0x9e(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0xa0(%rbp)
fldcw  -0xa0(%rbp)
fistpl -0x88(%rbp)
fldcw  -0x9e(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x40(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x40(%rbp)
mov    %cl,(%rax)
mov    -0x60(%rbp),%eax
mov    %eax,-0x84(%rbp)
fildl  -0x84(%rbp)
fldt   -0x20(%rbp)
fsubp  %st,%st(1)
fstpt  -0x20(%rbp)
jmp    135a <acvt+0x20a>
mov    -0x40(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
mov    %rdi,-0x40(%rbp)
cmpl   $0x41,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
call   1050 <val_hex@plt>
cmp    $0x8,%eax
jl     144f <acvt+0x2ff>
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
mov    %rdi,-0x68(%rbp)
cmpl   $0x41,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <incr_hex@plt>
cmp    $0xf,%eax
jle    144a <acvt+0x2fa>
mov    -0x68(%rbp),%rax
movb   $0x0,(%rax)
jmp    1418 <acvt+0x2c8>
jmp    144f <acvt+0x2ff>
jmp    1454 <acvt+0x304>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acvt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r12
mov    %esi,%r13d
fldt   0xa0(%rsp)
lea    0x1(%rdi),%r15
mov    %ecx,0x24(%rsp)
cmp    $0x41,%ecx
lea    0xe98(%rip),%rax
lea    0xe80(%rip),%r14
cmove  %rax,%r14
movb   $0x30,(%rdi)
fldz
fucomi %st(1),%st
fld    %st(1)
fchs
fxch   %st(2)
fcmovnbe %st(2),%st
fstp   %st(2)
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jne    11a3 <acvt+0x53>
jnp    11cb <acvt+0x7b>
fld    %st(0)
fstpt  (%rsp)
lea    0x48(%rsp),%rdi
fstpt  0x4c(%rsp)
call   1060 <frexpl@plt>
mov    $0x1,%edi
sub    0x48(%rsp),%edi
fldt   0x4c(%rsp)
fstpt  (%rsp)
call   1070 <ldexpl@plt>
fld    %st(0)
fstpt  0x4c(%rsp)
fnstcw 0x18(%rsp)
movzwl 0x18(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x22(%rsp)
fldcw  0x22(%rsp)
fistpll 0x58(%rsp)
fldcw  0x18(%rsp)
mov    0x58(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <ltoa@plt>
cltq
lea    (%r15,%rax,1),%rbp
mov    %rbx,0x60(%rsp)
fildll 0x60(%rsp)
fldt   0x4c(%rsp)
fsubp  %st,%st(1)
mov    %eax,(%r12)
cmp    $0xffffffff,%r13d
je     122f <acvt+0xdf>
lea    0x1(%r13),%eax
test   $0x1,%al
jne    128f <acvt+0x13f>
mov    %rbp,%rcx
jmp    12cf <acvt+0x17f>
fldz
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jne    1240 <acvt+0xf0>
jnp    13ba <acvt+0x26a>
nop
fmuls  0xdba(%rip)
fnstcw 0x16(%rsp)
movzwl 0x16(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x20(%rsp)
fldcw  0x20(%rsp)
fistl  0x28(%rsp)
fldcw  0x16(%rsp)
movslq 0x28(%rsp),%rax
movzbl (%r14,%rax,1),%ecx
mov    %cl,0x0(%rbp)
add    $0x1,%rbp
mov    %eax,0x2c(%rsp)
fisubl 0x2c(%rsp)
fldz
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jne    1240 <acvt+0xf0>
jp     1240 <acvt+0xf0>
jmp    13be <acvt+0x26e>
fmuls  0xd6b(%rip)
fnstcw 0x14(%rsp)
movzwl 0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x1e(%rsp)
fldcw  0x1e(%rsp)
fistl  0x40(%rsp)
fldcw  0x14(%rsp)
movslq 0x40(%rsp),%rax
mov    (%r14,%rax,1),%dl
lea    0x1(%rbp),%rcx
mov    %dl,0x0(%rbp)
mov    %eax,0x44(%rsp)
fisubl 0x44(%rsp)
mov    %r13d,%eax
mov    0x24(%rsp),%esi
test   %r13d,%r13d
je     1366 <acvt+0x216>
add    $0xffffffffffffffff,%rcx
flds   0xd1a(%rip)
fmul   %st,%st(1)
fnstcw 0x12(%rsp)
movzwl 0x12(%rsp),%edx
or     $0xc00,%edx
mov    %dx,0x1c(%rsp)
fldcw  0x1c(%rsp)
fxch   %st(1)
fistl  0x30(%rsp)
fldcw  0x12(%rsp)
movslq 0x30(%rsp),%rdx
movzbl (%r14,%rdx,1),%ebx
mov    %bl,0x1(%rcx)
mov    %edx,0x34(%rsp)
fisubl 0x34(%rsp)
fmulp  %st,%st(1)
fnstcw 0x10(%rsp)
movzwl 0x10(%rsp),%edx
or     $0xc00,%edx
mov    %dx,0x1a(%rsp)
fldcw  0x1a(%rsp)
fistl  0x38(%rsp)
fldcw  0x10(%rsp)
lea    0x2(%rcx),%rbp
movslq 0x38(%rsp),%rdx
movzbl (%r14,%rdx,1),%ebx
mov    %bl,0x2(%rcx)
mov    %edx,0x3c(%rsp)
fisubl 0x3c(%rsp)
mov    %rbp,%rcx
add    $0xfffffffe,%eax
jne    12e0 <acvt+0x190>
fstp   %st(0)
xor    %r12d,%r12d
cmp    $0x41,%esi
sete   %r12b
mov    %rbp,%rdi
mov    %r12d,%esi
call   1050 <val_hex@plt>
cmp    $0x8,%eax
jl     13bc <acvt+0x26c>
lea    -0x1(%rbp),%rdi
mov    %r12d,%esi
call   1040 <incr_hex@plt>
cmp    $0x10,%eax
jl     13bc <acvt+0x26c>
lea    -0x2(%rbp),%rbx
nopw   0x0(%rax,%rax,1)
movb   $0x0,0x1(%rbx)
mov    %rbx,%rdi
mov    %r12d,%esi
call   1040 <incr_hex@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0xf,%eax
jg     13a0 <acvt+0x250>
jmp    13bc <acvt+0x26c>
fstp   %st(0)
fldz
fstp   %st(0)
movb   $0x0,0x0(%rbp)
mov    %r15,%rax
add    $0x68,%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 i8* @acvt(i8* %0, x86_fp80 %1, i32 %2, i32* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca x86_fp80
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
store i8* %0, i8** %6
store x86_fp80 %1, x86_fp80* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8* %20, i8** %11
%21 = load i32, i32* %8
%22 = icmp eq i32 %21, -1
%23 = zext i1 %22 to i32
store i32 %23, i32* %14
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %15
%24 = load i32, i32* %10
%25 = icmp eq i32 %24, 65
br i1 %25, label %26, label %27
26: ; preds = %5
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %15
br label %27
27: ; preds = %26, %5
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i64 0
store i8 48, i8* %29
%30 = load x86_fp80, x86_fp80* %7
%31 = fcmp olt x86_fp80 %30, 0xK00000000000000000000
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = load x86_fp80, x86_fp80* %7
%34 = fneg x86_fp80 %33
store x86_fp80 %34, x86_fp80* %7
br label %35
35: ; preds = %32, %27
%36 = load x86_fp80, x86_fp80* %7
%37 = fcmp une x86_fp80 %36, 0xK00000000000000000000
br i1 %37, label %38, label %46
38: ; preds = %35
%39 = load x86_fp80, x86_fp80* %7
%40 = call i32 @frexpl(x86_fp80 %39, i32* %13)
%41 = load x86_fp80, x86_fp80* %7
%42 = load i32, i32* %13
%43 = sub nsw i32 %42, 1
%44 = sub nsw i32 0, %43
%45 = call x86_fp80 @ldexpl(x86_fp80 %41, i32 %44)
store x86_fp80 %45, x86_fp80* %7
br label %46
46: ; preds = %38, %35
%47 = load x86_fp80, x86_fp80* %7
%48 = fptosi x86_fp80 %47 to i64
%49 = load i8*, i8** %11
%50 = call i32 @ltoa(i64 %48, i8* %49)
store i32 %50, i32* %12
%51 = load i8*, i8** %11
%52 = sext i32 %50 to i64
%53 = getelementptr inbounds i8, i8* %51, i64 %52
store i8* %53, i8** %11
%54 = load x86_fp80, x86_fp80* %7
%55 = fptosi x86_fp80 %54 to i64
%56 = sitofp i64 %55 to x86_fp80
%57 = load x86_fp80, x86_fp80* %7
%58 = fsub x86_fp80 %57, %56
store x86_fp80 %58, x86_fp80* %7
%59 = load i32, i32* %12
%60 = load i32*, i32** %9
store i32 %59, i32* %60
%61 = load i32, i32* %14
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %83
63: ; preds = %46
br label %64
64: ; preds = %67, %63
%65 = load x86_fp80, x86_fp80* %7
%66 = fcmp une x86_fp80 %65, 0xK00000000000000000000
br i1 %66, label %67, label %82
67: ; preds = %64
%68 = load x86_fp80, x86_fp80* %7
%69 = fmul x86_fp80 %68, 0xK40038000000000000000
store x86_fp80 %69, x86_fp80* %7
%70 = fptosi x86_fp80 %69 to i32
store i32 %70, i32* %16
%71 = load i8*, i8** %15
%72 = load i32, i32* %16
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
%75 = load i8, i8* %74
%76 = load i8*, i8** %11
%77 = getelementptr inbounds i8, i8* %76, i32 1
store i8* %77, i8** %11
store i8 %75, i8* %76
%78 = load i32, i32* %16
%79 = sitofp i32 %78 to x86_fp80
%80 = load x86_fp80, x86_fp80* %7
%81 = fsub x86_fp80 %80, %79
store x86_fp80 %81, x86_fp80* %7
br label %64
82: ; preds = %64
br label %127
83: ; preds = %46
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 1
store i32 %85, i32* %8
br label %86
86: ; preds = %90, %83
%87 = load i32, i32* %8
%88 = add nsw i32 %87, -1
store i32 %88, i32* %8
%89 = icmp ne i32 %87, 0
br i1 %89, label %90, label %105
90: ; preds = %86
%91 = load x86_fp80, x86_fp80* %7
%92 = fmul x86_fp80 %91, 0xK40038000000000000000
store x86_fp80 %92, x86_fp80* %7
%93 = fptosi x86_fp80 %92 to i32
store i32 %93, i32* %17
%94 = load i8*, i8** %15
%95 = load i32, i32* %17
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %94, i64 %96
%98 = load i8, i8* %97
%99 = load i8*, i8** %11
%100 = getelementptr inbounds i8, i8* %99, i32 1
store i8* %100, i8** %11
store i8 %98, i8* %99
%101 = load i32, i32* %17
%102 = sitofp i32 %101 to x86_fp80
%103 = load x86_fp80, x86_fp80* %7
%104 = fsub x86_fp80 %103, %102
store x86_fp80 %104, x86_fp80* %7
br label %86
105: ; preds = %86
%106 = load i8*, i8** %11
%107 = getelementptr inbounds i8, i8* %106, i32 -1
store i8* %107, i8** %11
%108 = load i32, i32* %10
%109 = icmp eq i32 %108, 65
%110 = zext i1 %109 to i32
%111 = call i32 @val_hex(i8* %107, i32 %110)
%112 = icmp sge i32 %111, 8
br i1 %112, label %113, label %126
113: ; preds = %105
%114 = load i8*, i8** %11
store i8* %114, i8** %18
br label %115
115: ; preds = %123, %113
%116 = load i8*, i8** %18
%117 = getelementptr inbounds i8, i8* %116, i32 -1
store i8* %117, i8** %18
%118 = load i32, i32* %10
%119 = icmp eq i32 %118, 65
%120 = zext i1 %119 to i32
%121 = call i32 @incr_hex(i8* %117, i32 %120)
%122 = icmp sgt i32 %121, 15
br i1 %122, label %123, label %125
123: ; preds = %115
%124 = load i8*, i8** %18
store i8 0, i8* %124
br label %115
125: ; preds = %115
br label %126
126: ; preds = %125, %105
br label %127
127: ; preds = %126, %82
%128 = load i8*, i8** %11
store i8 0, i8* %128
%129 = load i8*, i8** %6
%130 = getelementptr inbounds i8, i8* %129, i64 1
ret i8* %130
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
@.str.1 = [17 x i8] c"0123456789ABCDEF\00"
define i8* @acvt(i8* %0, x86_fp80 %1, i32 %2, i32* nocapture writeonly %3, i32 %4) {
%6 = alloca i32
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = bitcast i32* %6 to i8*
%9 = icmp eq i32 %2, -1
%10 = icmp eq i32 %4, 65
%11 = select i1 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
store i8 48, i8* %0
%12 = fcmp olt x86_fp80 %1, 0xK00000000000000000000
%13 = fneg x86_fp80 %1
%14 = select i1 %12, x86_fp80 %13, x86_fp80 %1
%15 = fcmp une x86_fp80 %14, 0xK00000000000000000000
br i1 %15, label %16, label %21
16: ; preds = %5
%17 = call i32 @frexpl(x86_fp80 %14, i32* %6)
%18 = load i32, i32* %6
%19 = sub i32 1, %18
%20 = tail call x86_fp80 @ldexpl(x86_fp80 %14, i32 %19)
br label %21
21: ; preds = %16, %5
%22 = phi x86_fp80 [ %20, %16 ], [ %14, %5 ]
%23 = fptosi x86_fp80 %22 to i64
%24 = tail call i32 @ltoa(i64 %23, i8* %7)
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %7, i64 %25
%27 = sitofp i64 %23 to x86_fp80
%28 = fsub x86_fp80 %22, %27
store i32 %24, i32* %3
br i1 %9, label %29, label %43
29: ; preds = %21
%30 = fcmp une x86_fp80 %28, 0xK00000000000000000000
br i1 %30, label %31, label %99
31: ; preds = %29, %31
%32 = phi x86_fp80 [ %41, %31 ], [ %28, %29 ]
%33 = phi i8* [ %39, %31 ], [ %26, %29 ]
%34 = fmul x86_fp80 %32, 0xK40038000000000000000
%35 = fptosi x86_fp80 %34 to i32
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %11, i64 %36
%38 = load i8, i8* %37
%39 = getelementptr inbounds i8, i8* %33, i64 1
store i8 %38, i8* %33
%40 = sitofp i32 %35 to x86_fp80
%41 = fsub x86_fp80 %34, %40
%42 = fcmp une x86_fp80 %41, 0xK00000000000000000000
br i1 %42, label %31, label %99
43: ; preds = %21
%44 = add i32 %2, 1
%45 = and i32 %44, 1
%46 = icmp eq i32 %45, 0
br i1 %46, label %56, label %47
47: ; preds = %43
%48 = fmul x86_fp80 %28, 0xK40038000000000000000
%49 = fptosi x86_fp80 %48 to i32
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %11, i64 %50
%52 = load i8, i8* %51
%53 = getelementptr inbounds i8, i8* %26, i64 1
store i8 %52, i8* %26
%54 = sitofp i32 %49 to x86_fp80
%55 = fsub x86_fp80 %48, %54
br label %56
56: ; preds = %47, %43
%57 = phi x86_fp80 [ %28, %43 ], [ %55, %47 ]
%58 = phi i32 [ %44, %43 ], [ %2, %47 ]
%59 = phi i8* [ %26, %43 ], [ %53, %47 ]
%60 = icmp eq i32 %2, 0
br i1 %60, label %85, label %61
61: ; preds = %56, %61
%62 = phi x86_fp80 [ %81, %61 ], [ %57, %56 ]
%63 = phi i32 [ %73, %61 ], [ %58, %56 ]
%64 = phi i8* [ %79, %61 ], [ %59, %56 ]
%65 = fmul x86_fp80 %62, 0xK40038000000000000000
%66 = fptosi x86_fp80 %65 to i32
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %11, i64 %67
%69 = load i8, i8* %68
%70 = getelementptr inbounds i8, i8* %64, i64 1
store i8 %69, i8* %64
%71 = sitofp i32 %66 to x86_fp80
%72 = fsub x86_fp80 %65, %71
%73 = add nsw i32 %63, -2
%74 = fmul x86_fp80 %72, 0xK40038000000000000000
%75 = fptosi x86_fp80 %74 to i32
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %11, i64 %76
%78 = load i8, i8* %77
%79 = getelementptr inbounds i8, i8* %64, i64 2
store i8 %78, i8* %70
%80 = sitofp i32 %75 to x86_fp80
%81 = fsub x86_fp80 %74, %80
%82 = icmp eq i32 %73, 0
br i1 %82, label %83, label %61
83: ; preds = %61
%84 = getelementptr inbounds i8, i8* %64, i64 1
br label %85
85: ; preds = %56, %83
%86 = phi i8* [ %26, %56 ], [ %84, %83 ]
%87 = zext i1 %10 to i32
%88 = tail call i32 @val_hex(i8* %86, i32 %87)
%89 = icmp sgt i32 %88, 7
br i1 %89, label %90, label %99
90: ; preds = %85
%91 = getelementptr inbounds i8, i8* %86, i64 -1
%92 = tail call i32 @incr_hex(i8* %91, i32 %87)
%93 = icmp sgt i32 %92, 15
br i1 %93, label %94, label %99
94: ; preds = %90, %94
%95 = phi i8* [ %96, %94 ], [ %91, %90 ]
store i8 0, i8* %95
%96 = getelementptr inbounds i8, i8* %95, i64 -1
%97 = tail call i32 @incr_hex(i8* %96, i32 %87)
%98 = icmp sgt i32 %97, 15
br i1 %98, label %94, label %99
99: ; preds = %94, %31, %90, %29, %85
%100 = phi i8* [ %86, %85 ], [ %26, %29 ], [ %86, %90 ], [ %39, %31 ], [ %86, %94 ]
store i8 0, i8* %100
ret i8* %7
}