#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*/ EINVAL;
float INFINITY;
long double NAN;
long double decfloat(char *, int *, int, int, int, int, int);
int /*<<< orphan*/ errno;
long double hexfloat(char *, int *, int, int, int, int);
scalar_t__ isspace(int);
char shgetc(char *, int *);
int /*<<< orphan*/ shunget(int *);
long double __floatscan(char *input, int prec, int pok) {
  int index = 0;
  int sign = 1;
  int i;
  int bits;
  int emin;
  int c;
  switch (prec) {
  case 0:
    bits = 24;
    emin = (-125) - bits;
    break;
  case 1:
    bits = 53;
    emin = (-1021) - bits;
    break;
  case 2:
    bits = 64;
    emin = (-16381) - bits;
    break;
  default:
    return 0;
  }
  while (isspace((c = shgetc(input, &index))))
    ;
  if (c == '+' || c == '-') {
    sign -= 2 * (c == '-');
    c = shgetc(input, &index);
  }
  for (i = 0; i < 8 && (c | 32) == "infinity"[i]; i++)
    if (i < 7)
      c = shgetc(input, &index);
  if (i == 3 || i == 8 || (i > 3 && pok)) {
    if (i != 8) {
      shunget(&index);
      if (pok)
        for (; i > 3; i--)
          shunget(&index);
    }
    return ((float)sign * INFINITY);
  }
  if (!i)
    for (i = 0; i < 3 && (c | 32) == "nan"[i]; i++)
      if (i < 2)
        c = shgetc(input, &index);
  if (i == 3) {
    if (shgetc(input, &index) != '(') {
      shunget(&index);
      return NAN;
    }
    for (i = 1;; i++) {
      c = shgetc(input, &index);
      if ((unsigned)(c - '0') < 10U || (unsigned)(c - 'A') < 26U ||
          (unsigned)(c - 'a') < 26U || c == '_')
        continue;
      if (c == ')')
        return NAN;
      shunget(&index);
      if (!pok) {
        errno = EINVAL;
        return 0;
      }
      while (i--)
        shunget(&index);
      return NAN;
    }
    return NAN;
  }
  if (i) {
    shunget(&index);
    errno = EINVAL;
    return 0;
  }
  if (c == '0') {
    c = shgetc(input, &index);
    if ((c | 32) == 'x')
      return hexfloat(input, &index, bits, emin, sign, pok);
    shunget(&index);
    c = '0';
  }
  return decfloat(input, &index, c, bits, emin, sign, pok);
}


x86 assembly (clang, -O0):
<__floatscan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x40(%rbp)
test   %eax,%eax
je     11a5 <__floatscan+0x55>
jmp    1183 <__floatscan+0x33>
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
je     11bc <__floatscan+0x6c>
jmp    1194 <__floatscan+0x44>
mov    -0x40(%rbp),%eax
sub    $0x2,%eax
je     11d3 <__floatscan+0x83>
jmp    11ea <__floatscan+0x9a>
movl   $0x18,-0x30(%rbp)
mov    $0xffffff83,%eax
sub    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    11f4 <__floatscan+0xa4>
movl   $0x35,-0x30(%rbp)
mov    $0xfffffc03,%eax
sub    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    11f4 <__floatscan+0xa4>
movl   $0x40,-0x30(%rbp)
mov    $0xffffc003,%eax
sub    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    11f4 <__floatscan+0xa4>
fldz
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
jmp    11f9 <__floatscan+0xa9>
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <shgetc@plt>
movsbl %al,%edi
mov    %edi,-0x38(%rbp)
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1220 <__floatscan+0xd0>
jmp    11f9 <__floatscan+0xa9>
cmpl   $0x2b,-0x38(%rbp)
je     1234 <__floatscan+0xe4>
cmpl   $0x2d,-0x38(%rbp)
jne    125e <__floatscan+0x10e>
cmpl   $0x2d,-0x38(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%ecx
shl    $0x1,%ecx
mov    -0x28(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0x2c(%rbp)
mov    %al,-0x41(%rbp)
jge    1291 <__floatscan+0x141>
mov    -0x38(%rbp),%eax
or     $0x20,%eax
movslq -0x2c(%rbp),%rdx
lea    0xd7b(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    12a1 <__floatscan+0x151>
jmp    12d1 <__floatscan+0x181>
cmpl   $0x7,-0x2c(%rbp)
jge    12be <__floatscan+0x16e>
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x38(%rbp)
jmp    12c3 <__floatscan+0x173>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1265 <__floatscan+0x115>
cmpl   $0x3,-0x2c(%rbp)
je     12f9 <__floatscan+0x1a9>
cmpl   $0x8,-0x2c(%rbp)
je     12f9 <__floatscan+0x1a9>
cmpl   $0x3,-0x2c(%rbp)
jle    136a <__floatscan+0x21a>
cmpl   $0x0,-0x20(%rbp)
je     136a <__floatscan+0x21a>
cmpl   $0x8,-0x2c(%rbp)
je     1346 <__floatscan+0x1f6>
lea    -0x24(%rbp),%rdi
call   1040 <shunget@plt>
cmpl   $0x0,-0x20(%rbp)
je     1341 <__floatscan+0x1f1>
jmp    131b <__floatscan+0x1cb>
cmpl   $0x3,-0x2c(%rbp)
jle    133c <__floatscan+0x1ec>
lea    -0x24(%rbp),%rdi
call   1040 <shunget@plt>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    131b <__floatscan+0x1cb>
jmp    1341 <__floatscan+0x1f1>
jmp    1346 <__floatscan+0x1f6>
cvtsi2ssl -0x28(%rbp),%xmm0
mov    0x2c8e(%rip),%rax
movss  (%rax),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
flds   -0x3c(%rbp)
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
cmpl   $0x0,-0x2c(%rbp)
jne    13ec <__floatscan+0x29c>
movl   $0x0,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x2c(%rbp)
mov    %al,-0x42(%rbp)
jge    13a7 <__floatscan+0x257>
mov    -0x38(%rbp),%eax
or     $0x20,%eax
movslq -0x2c(%rbp),%rdx
lea    0xc6e(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x42(%rbp)
mov    -0x42(%rbp),%al
test   $0x1,%al
jne    13b7 <__floatscan+0x267>
jmp    13e7 <__floatscan+0x297>
cmpl   $0x2,-0x2c(%rbp)
jge    13d4 <__floatscan+0x284>
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x38(%rbp)
jmp    13d9 <__floatscan+0x289>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    137b <__floatscan+0x22b>
jmp    13ec <__floatscan+0x29c>
cmpl   $0x3,-0x2c(%rbp)
jne    150f <__floatscan+0x3bf>
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <shgetc@plt>
movsbl %al,%eax
cmp    $0x28,%eax
je     1429 <__floatscan+0x2d9>
lea    -0x24(%rbp),%rdi
call   1040 <shunget@plt>
mov    0x2bd9(%rip),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
movl   $0x1,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
jb     147a <__floatscan+0x32a>
mov    -0x38(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
jb     147a <__floatscan+0x32a>
mov    -0x38(%rbp),%eax
sub    $0x61,%eax
cmp    $0x1a,%eax
jb     147a <__floatscan+0x32a>
cmpl   $0x5f,-0x38(%rbp)
jne    147f <__floatscan+0x32f>
jmp    1501 <__floatscan+0x3b1>
cmpl   $0x29,-0x38(%rbp)
jne    149a <__floatscan+0x34a>
mov    0x2b68(%rip),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
lea    -0x24(%rbp),%rdi
call   1040 <shunget@plt>
cmpl   $0x0,-0x20(%rbp)
jne    14c9 <__floatscan+0x379>
mov    0x2b14(%rip),%rax
mov    (%rax),%ecx
mov    0x2b13(%rip),%rax
mov    %ecx,(%rax)
fldz
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
jmp    14ce <__floatscan+0x37e>
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x2c(%rbp)
cmp    $0x0,%eax
je     14f0 <__floatscan+0x3a0>
lea    -0x24(%rbp),%rdi
call   1040 <shunget@plt>
jmp    14ce <__floatscan+0x37e>
mov    0x2b01(%rip),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1430 <__floatscan+0x2e0>
cmpl   $0x0,-0x2c(%rbp)
je     153e <__floatscan+0x3ee>
lea    -0x24(%rbp),%rdi
call   1040 <shunget@plt>
mov    0x2a9f(%rip),%rax
mov    (%rax),%ecx
mov    0x2a9e(%rip),%rax
mov    %ecx,(%rax)
fldz
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
cmpl   $0x30,-0x38(%rbp)
jne    159d <__floatscan+0x44d>
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
or     $0x20,%eax
cmp    $0x78,%eax
jne    158d <__floatscan+0x43d>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    -0x24(%rbp),%rsi
call   1050 <hexfloat@plt>
fstpt  -0x10(%rbp)
jmp    15c3 <__floatscan+0x473>
lea    -0x24(%rbp),%rdi
call   1040 <shunget@plt>
movl   $0x30,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x20(%rbp),%esi
mov    %rsp,%rax
mov    %esi,(%rax)
lea    -0x24(%rbp),%rsi
call   1060 <decfloat@plt>
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__floatscan>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x0,0x10(%rsp)
fldz
cmp    $0x2,%esi
ja     145a <__floatscan+0x30a>
mov    %rdi,%r15
mov    %edx,0x14(%rsp)
fstpt  0x1c(%rsp)
movslq %esi,%rax
lea    0xe7a(%rip),%rcx
mov    (%rcx,%rax,4),%r13d
lea    0xe7b(%rip),%rcx
mov    (%rcx,%rax,4),%r12d
lea    0x10(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <shgetc@plt>
mov    %eax,%r14d
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    11a0 <__floatscan+0x50>
cmp    $0x2d,%r14b
je     11ce <__floatscan+0x7e>
mov    $0x1,%ebx
cmp    $0x2b,%r14b
jne    11ed <__floatscan+0x9d>
xor    %eax,%eax
cmp    $0x2d,%r14b
setne  %al
lea    (%rax,%rax,1),%ebx
add    $0xffffffff,%ebx
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
movsbl %al,%ebp
mov    %ebp,%eax
and    $0xffffffdf,%eax
cmp    $0x49,%eax
jne    12e5 <__floatscan+0x195>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
cmp    $0x4e,%al
jne    139c <__floatscan+0x24c>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
cmp    $0x46,%al
jne    139c <__floatscan+0x24c>
mov    %ebx,%r14d
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
cmp    $0x49,%al
jne    13f6 <__floatscan+0x2a6>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
mov    $0x4,%ebp
cmp    $0x4e,%al
jne    12a7 <__floatscan+0x157>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
mov    $0x5,%ebp
cmp    $0x49,%al
jne    12a7 <__floatscan+0x157>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
mov    $0x6,%ebp
cmp    $0x54,%al
jne    12a7 <__floatscan+0x157>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
mov    $0x7,%ebp
cmp    $0x59,%al
je     1400 <__floatscan+0x2b0>
cmpl   $0x0,0x14(%rsp)
je     139c <__floatscan+0x24c>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <shunget@plt>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <shunget@plt>
add    $0xffffffff,%ebp
cmp    $0x4,%ebp
ja     12d0 <__floatscan+0x180>
jmp    1400 <__floatscan+0x2b0>
cmp    $0x4e,%eax
jne    13c1 <__floatscan+0x271>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
cmp    $0x41,%al
jne    139c <__floatscan+0x24c>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
cmp    $0x4e,%al
jne    139c <__floatscan+0x24c>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
cmp    $0x28,%al
jne    1447 <__floatscan+0x2f7>
mov    $0xffffffff,%ebx
lea    0x10(%rsp),%rbp
jmp    1343 <__floatscan+0x1f3>
nopl   (%rax)
add    $0xffffffff,%ebx
mov    %r15,%rdi
mov    %rbp,%rsi
call   1070 <shgetc@plt>
movsbl %al,%ecx
lea    -0x30(%rcx),%esi
lea    -0x41(%rcx),%edx
cmp    $0xa,%esi
jb     1340 <__floatscan+0x1f0>
cmp    $0x1a,%edx
jb     1340 <__floatscan+0x1f0>
add    $0xffffff9f,%ecx
cmp    $0x1a,%ecx
jb     1340 <__floatscan+0x1f0>
cmp    $0x5f,%al
je     1340 <__floatscan+0x1f0>
cmp    $0x29,%al
je     1451 <__floatscan+0x301>
lea    0x10(%rsp),%rdi
call   1040 <shunget@plt>
cmpl   $0x0,0x14(%rsp)
je     13a6 <__floatscan+0x256>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <shunget@plt>
inc    %ebx
jne    138b <__floatscan+0x23b>
jmp    1451 <__floatscan+0x301>
lea    0x10(%rsp),%rdi
call   1040 <shunget@plt>
mov    0x2c1b(%rip),%rax
mov    (%rax),%eax
mov    0x2c1a(%rip),%rcx
mov    %eax,(%rcx)
fldt   0x1c(%rsp)
jmp    145a <__floatscan+0x30a>
cmp    $0x30,%ebp
jne    1426 <__floatscan+0x2d6>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <shgetc@plt>
and    $0xdf,%al
cmp    $0x58,%al
jne    141c <__floatscan+0x2cc>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %ebx,%r8d
mov    0x14(%rsp),%r9d
call   1050 <hexfloat@plt>
jmp    145a <__floatscan+0x30a>
lea    0x10(%rsp),%rdi
call   1040 <shunget@plt>
cvtsi2ss %r14d,%xmm0
mov    0x2bd4(%rip),%rax
mulss  (%rax),%xmm0
movss  %xmm0,0x18(%rsp)
flds   0x18(%rsp)
jmp    145a <__floatscan+0x30a>
lea    0x10(%rsp),%rdi
call   1040 <shunget@plt>
mov    0x14(%rsp),%eax
mov    %eax,(%rsp)
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %ebx,%r9d
call   1060 <decfloat@plt>
jmp    145a <__floatscan+0x30a>
lea    0x10(%rsp),%rdi
call   1040 <shunget@plt>
mov    0x2ba0(%rip),%rax
fldt   (%rax)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@INFINITY = global float 0.000000e+00
@NAN = global x86_fp80 0xK00000000000000000000
@EINVAL = global i32 0
@errno = global i32 0
@switch.table.__floatscan = [3 x i32] [i32 24, i32 53, i32 64]
@switch.table.__floatscan.2 = [3 x i32] [i32 -149, i32 -1074, i32 -16445]
define x86_fp80 @__floatscan(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = icmp ult i32 %1, 3
br i1 %6, label %7, label %139
7: ; preds = %3
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.__floatscan, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.__floatscan.2, i64 0, i64 %11
%13 = load i32, i32* %12
br label %14
14: ; preds = %14, %7
%15 = call signext i8 @shgetc(i8* %0, i32* %4)
%16 = sext i8 %15 to i32
%17 = call i64 @isspace(i32 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %14
19: ; preds = %14
switch i8 %15, label %25 [
i8 45, label %20
i8 43, label %20
]
20: ; preds = %19, %19
%21 = icmp eq i8 %15, 45
%22 = select i1 %21, i32 -1, i32 1
%23 = call signext i8 @shgetc(i8* %0, i32* %4)
%24 = sext i8 %23 to i32
br label %25
25: ; preds = %19, %20
%26 = phi i32 [ %22, %20 ], [ 1, %19 ]
%27 = phi i32 [ %24, %20 ], [ %16, %19 ]
%28 = and i32 %27, -33
%29 = icmp eq i32 %28, 73
br i1 %29, label %30, label %75
30: ; preds = %25
%31 = call signext i8 @shgetc(i8* %0, i32* %4)
%32 = and i8 %31, -33
%33 = icmp eq i8 %32, 78
br i1 %33, label %34, label %124
34: ; preds = %30
%35 = call signext i8 @shgetc(i8* %0, i32* %4)
%36 = and i8 %35, -33
%37 = icmp eq i8 %36, 70
br i1 %37, label %38, label %124
38: ; preds = %34
%39 = call signext i8 @shgetc(i8* %0, i32* %4)
%40 = and i8 %39, -33
%41 = icmp eq i8 %40, 73
br i1 %41, label %44, label %42
42: ; preds = %38
%43 = call i32 @shunget(i32* %4)
br label %70
44: ; preds = %38
%45 = call signext i8 @shgetc(i8* %0, i32* %4)
%46 = and i8 %45, -33
%47 = icmp eq i8 %46, 78
br i1 %47, label %48, label %60
48: ; preds = %44
%49 = call signext i8 @shgetc(i8* %0, i32* %4)
%50 = and i8 %49, -33
%51 = icmp eq i8 %50, 73
br i1 %51, label %52, label %60
52: ; preds = %48
%53 = call signext i8 @shgetc(i8* %0, i32* %4)
%54 = and i8 %53, -33
%55 = icmp eq i8 %54, 84
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = call signext i8 @shgetc(i8* %0, i32* %4)
%58 = and i8 %57, -33
%59 = icmp eq i8 %58, 89
br i1 %59, label %70, label %60
60: ; preds = %56, %52, %48, %44
%61 = phi i32 [ 4, %44 ], [ 5, %48 ], [ 6, %52 ], [ 7, %56 ]
%62 = icmp eq i32 %2, 0
br i1 %62, label %124, label %63
63: ; preds = %60
%64 = call i32 @shunget(i32* %4)
br label %65
65: ; preds = %63, %65
%66 = phi i32 [ %68, %65 ], [ %61, %63 ]
%67 = call i32 @shunget(i32* %4)
%68 = add nsw i32 %66, -1
%69 = icmp ugt i32 %66, 4
br i1 %69, label %65, label %70
70: ; preds = %65, %56, %42
%71 = sitofp i32 %26 to float
%72 = load float, float* @INFINITY
%73 = fmul float %72, %71
%74 = fpext float %73 to x86_fp80
br label %139
75: ; preds = %25
%76 = icmp eq i32 %2, 0
%77 = and i32 %27, -33
%78 = icmp eq i32 %77, 78
br i1 %78, label %79, label %127
79: ; preds = %75
%80 = call signext i8 @shgetc(i8* %0, i32* %4)
%81 = and i8 %80, -33
%82 = icmp eq i8 %81, 65
br i1 %82, label %83, label %124
83: ; preds = %79
%84 = call signext i8 @shgetc(i8* %0, i32* %4)
%85 = and i8 %84, -33
%86 = icmp eq i8 %85, 78
br i1 %86, label %87, label %124
87: ; preds = %83
%88 = call signext i8 @shgetc(i8* %0, i32* %4)
%89 = icmp eq i8 %88, 40
br i1 %89, label %93, label %90
90: ; preds = %87
%91 = call i32 @shunget(i32* %4)
%92 = load x86_fp80, x86_fp80* @NAN
br label %139
93: ; preds = %87, %122
%94 = phi i32 [ %123, %122 ], [ 1, %87 ]
%95 = call signext i8 @shgetc(i8* %0, i32* %4)
%96 = sext i8 %95 to i32
%97 = add nsw i32 %96, -48
%98 = icmp ult i32 %97, 10
%99 = add nsw i32 %96, -65
%100 = icmp ult i32 %99, 26
%101 = select i1 %98, i1 true, i1 %100
br i1 %101, label %122, label %102
102: ; preds = %93
%103 = add nsw i32 %96, -97
%104 = icmp ult i32 %103, 26
%105 = icmp eq i8 %95, 95
%106 = select i1 %104, i1 true, i1 %105
br i1 %106, label %122, label %107
107: ; preds = %102
%108 = icmp eq i8 %95, 41
br i1 %108, label %109, label %111
109: ; preds = %107
%110 = load x86_fp80, x86_fp80* @NAN
br label %139
111: ; preds = %107
%112 = call i32 @shunget(i32* %4)
br i1 %76, label %113, label %115
113: ; preds = %111
%114 = load i32, i32* @EINVAL
store i32 %114, i32* @errno
br label %139
115: ; preds = %111, %115
%116 = phi i32 [ %117, %115 ], [ %94, %111 ]
%117 = add nsw i32 %116, -1
%118 = call i32 @shunget(i32* %4)
%119 = icmp eq i32 %117, 0
br i1 %119, label %120, label %115
120: ; preds = %115
%121 = load x86_fp80, x86_fp80* @NAN
br label %139
122: ; preds = %93, %102
%123 = add nuw nsw i32 %94, 1
br label %93
124: ; preds = %60, %34, %30, %83, %79
%125 = call i32 @shunget(i32* %4)
%126 = load i32, i32* @EINVAL
store i32 %126, i32* @errno
br label %139
127: ; preds = %75
%128 = icmp eq i32 %27, 48
br i1 %128, label %129, label %137
129: ; preds = %127
%130 = call signext i8 @shgetc(i8* %0, i32* %4)
%131 = and i8 %130, -33
%132 = icmp eq i8 %131, 88
br i1 %132, label %133, label %135
133: ; preds = %129
%134 = call x86_fp80 @hexfloat(i8* %0, i32* %4, i32 %10, i32 %13, i32 %26, i32 %2)
br label %139
135: ; preds = %129
%136 = call i32 @shunget(i32* %4)
br label %137
137: ; preds = %135, %127
%138 = call x86_fp80 @decfloat(i8* %0, i32* %4, i32 %27, i32 %10, i32 %13, i32 %26, i32 %2)
br label %139
139: ; preds = %3, %137, %133, %124, %120, %113, %109, %90, %70
%140 = phi x86_fp80 [ %74, %70 ], [ %92, %90 ], [ %110, %109 ], [ %121, %120 ], [ 0xK00000000000000000000, %113 ], [ 0xK00000000000000000000, %124 ], [ %134, %133 ], [ %138, %137 ], [ 0xK00000000000000000000, %3 ]
ret x86_fp80 %140
}