#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 */
struct fake_file_t {
  int dummy;
};

/* Variables and functions */
int DBL_MANT_DIG;
int /*<<< orphan*/ DBL_MIN_EXP;
int /*<<< orphan*/ EINVAL;
int FLT_MANT_DIG;
int /*<<< orphan*/ FLT_MIN_EXP;
int INFINITY;
int LDBL_MANT_DIG;
int /*<<< orphan*/ LDBL_MIN_EXP;
long double NAN;
long double decfloat(struct fake_file_t *, int, int, int, int, int);
int /*<<< orphan*/ errno;
long double hexfloat(struct fake_file_t *, int, int, int, int);
scalar_t__ isspace(int);
char shgetc(struct fake_file_t *);
int /*<<< orphan*/ shlim(struct fake_file_t *, int /*<<< orphan*/);
int /*<<< orphan*/ shunget(struct fake_file_t *);
long double __floatscan(struct fake_file_t *f, int prec, int pok) {
  int sign = 1;
  size_t i;
  int bits;
  int emin;
  int c;
  switch (prec) {
  case 0:
    bits = FLT_MANT_DIG;
    emin = FLT_MIN_EXP - bits;
    break;
  case 1:
    bits = DBL_MANT_DIG;
    emin = DBL_MIN_EXP - bits;
    break;
  case 2:
    bits = LDBL_MANT_DIG;
    emin = LDBL_MIN_EXP - bits;
    break;
  default:
    return 0;
  }
  while (isspace((c = shgetc(f))))
    ;
  if (c == '+' || c == '-') {
    sign -= 2 * (c == '-');
    c = shgetc(f);
  }
  for (i = 0; i < 8 && (c | 32) == "infinity"[i]; i++)
    if (i < 7)
      c = shgetc(f);
  if (i == 3 || i == 8 || (i > 3 && pok)) {
    if (i != 8) {
      shunget(f);
      if (pok)
        for (; i > 3; i--)
          shunget(f);
    }
    return sign * INFINITY;
  }
  if (!i)
    for (i = 0; i < 3 && (c | 32) == "nan"[i]; i++)
      if (i < 2)
        c = shgetc(f);
  if (i == 3) {
    if (shgetc(f) != '(') {
      shunget(f);
      return NAN;
    }
    for (i = 1;; i++) {
      c = shgetc(f);
      if (c - '0' < 10U || c - 'A' < 26U || c - 'a' < 26U || c == '_')
        continue;
      if (c == ')')
        return NAN;
      shunget(f);
      if (!pok) {
        errno = EINVAL;
        shlim(f, 0);
        return 0;
      }
      while (i--)
        shunget(f);
      return NAN;
    }
    return NAN;
  }
  if (i) {
    shunget(f);
    errno = EINVAL;
    shlim(f, 0);
    return 0;
  }
  if (c == '0') {
    c = shgetc(f);
    if ((c | 32) == 'x')
      return hexfloat(f, bits, emin, sign, pok);
    shunget(f);
    c = '0';
  }
  return decfloat(f, 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   $0x1,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
test   %eax,%eax
je     11ae <__floatscan+0x4e>
jmp    118c <__floatscan+0x2c>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
je     11ce <__floatscan+0x6e>
jmp    119d <__floatscan+0x3d>
mov    -0x44(%rbp),%eax
sub    $0x2,%eax
je     11ee <__floatscan+0x8e>
jmp    120e <__floatscan+0xae>
mov    0x2dfb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1218 <__floatscan+0xb8>
mov    0x2dfb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2df7(%rip),%rax
mov    (%rax),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1218 <__floatscan+0xb8>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1218 <__floatscan+0xb8>
fldz
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
jmp    121d <__floatscan+0xbd>
mov    -0x18(%rbp),%rdi
call   1080 <shgetc@plt>
movsbl %al,%edi
mov    %edi,-0x3c(%rbp)
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1240 <__floatscan+0xe0>
jmp    121d <__floatscan+0xbd>
cmpl   $0x2b,-0x3c(%rbp)
je     1254 <__floatscan+0xf4>
cmpl   $0x2d,-0x3c(%rbp)
jne    127a <__floatscan+0x11a>
cmpl   $0x2d,-0x3c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%ecx
shl    $0x1,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x3c(%rbp)
movq   $0x0,-0x30(%rbp)
xor    %eax,%eax
cmpq   $0x8,-0x30(%rbp)
mov    %al,-0x45(%rbp)
jae    12af <__floatscan+0x14f>
mov    -0x3c(%rbp),%eax
or     $0x20,%eax
mov    -0x30(%rbp),%rdx
lea    0xd5d(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x45(%rbp)
mov    -0x45(%rbp),%al
test   $0x1,%al
jne    12bf <__floatscan+0x15f>
jmp    12ef <__floatscan+0x18f>
cmpq   $0x7,-0x30(%rbp)
jae    12d9 <__floatscan+0x179>
mov    -0x18(%rbp),%rdi
call   1080 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x3c(%rbp)
jmp    12de <__floatscan+0x17e>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1282 <__floatscan+0x122>
cmpq   $0x3,-0x30(%rbp)
je     131a <__floatscan+0x1ba>
cmpq   $0x8,-0x30(%rbp)
je     131a <__floatscan+0x1ba>
cmpq   $0x3,-0x30(%rbp)
jbe    1389 <__floatscan+0x229>
cmpl   $0x0,-0x20(%rbp)
je     1389 <__floatscan+0x229>
cmpq   $0x8,-0x30(%rbp)
je     136c <__floatscan+0x20c>
mov    -0x18(%rbp),%rdi
call   1040 <shunget@plt>
cmpl   $0x0,-0x20(%rbp)
je     1367 <__floatscan+0x207>
jmp    133d <__floatscan+0x1dd>
cmpq   $0x3,-0x30(%rbp)
jbe    1362 <__floatscan+0x202>
mov    -0x18(%rbp),%rdi
call   1040 <shunget@plt>
mov    -0x30(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
jmp    133d <__floatscan+0x1dd>
jmp    1367 <__floatscan+0x207>
jmp    136c <__floatscan+0x20c>
mov    -0x24(%rbp),%eax
mov    0x2c6a(%rip),%rcx
mov    (%rcx),%ecx
imul   %ecx,%eax
mov    %eax,-0x40(%rbp)
fildl  -0x40(%rbp)
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
cmpq   $0x0,-0x30(%rbp)
jne    140e <__floatscan+0x2ae>
movq   $0x0,-0x30(%rbp)
xor    %eax,%eax
cmpq   $0x3,-0x30(%rbp)
mov    %al,-0x46(%rbp)
jae    13c9 <__floatscan+0x269>
mov    -0x3c(%rbp),%eax
or     $0x20,%eax
mov    -0x30(%rbp),%rdx
lea    0xc4c(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x46(%rbp)
mov    -0x46(%rbp),%al
test   $0x1,%al
jne    13d9 <__floatscan+0x279>
jmp    1409 <__floatscan+0x2a9>
cmpq   $0x2,-0x30(%rbp)
jae    13f3 <__floatscan+0x293>
mov    -0x18(%rbp),%rdi
call   1080 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x3c(%rbp)
jmp    13f8 <__floatscan+0x298>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    139c <__floatscan+0x23c>
jmp    140e <__floatscan+0x2ae>
cmpq   $0x3,-0x30(%rbp)
jne    153e <__floatscan+0x3de>
mov    -0x18(%rbp),%rdi
call   1080 <shgetc@plt>
movsbl %al,%eax
cmp    $0x28,%eax
je     1448 <__floatscan+0x2e8>
mov    -0x18(%rbp),%rdi
call   1040 <shunget@plt>
mov    0x2bba(%rip),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
movq   $0x1,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
jb     1496 <__floatscan+0x336>
mov    -0x3c(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
jb     1496 <__floatscan+0x336>
mov    -0x3c(%rbp),%eax
sub    $0x61,%eax
cmp    $0x1a,%eax
jb     1496 <__floatscan+0x336>
cmpl   $0x5f,-0x3c(%rbp)
jne    149b <__floatscan+0x33b>
jmp    152d <__floatscan+0x3cd>
cmpl   $0x29,-0x3c(%rbp)
jne    14b6 <__floatscan+0x356>
mov    0x2b4c(%rip),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
mov    -0x18(%rbp),%rdi
call   1040 <shunget@plt>
cmpl   $0x0,-0x20(%rbp)
jne    14f0 <__floatscan+0x390>
mov    0x2ad8(%rip),%rax
mov    (%rax),%ecx
mov    0x2adf(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <shlim@plt>
fldz
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
jmp    14f5 <__floatscan+0x395>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x30(%rbp)
cmp    $0x0,%rax
je     151c <__floatscan+0x3bc>
mov    -0x18(%rbp),%rdi
call   1040 <shunget@plt>
jmp    14f5 <__floatscan+0x395>
mov    0x2ad5(%rip),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1450 <__floatscan+0x2f0>
cmpq   $0x0,-0x30(%rbp)
je     1579 <__floatscan+0x419>
mov    -0x18(%rbp),%rdi
call   1040 <shunget@plt>
mov    0x2a4f(%rip),%rax
mov    (%rax),%ecx
mov    0x2a56(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <shlim@plt>
fldz
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
cmpl   $0x30,-0x3c(%rbp)
jne    15cf <__floatscan+0x46f>
mov    -0x18(%rbp),%rdi
call   1080 <shgetc@plt>
movsbl %al,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
or     $0x20,%eax
cmp    $0x78,%eax
jne    15bf <__floatscan+0x45f>
mov    -0x18(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1060 <hexfloat@plt>
fstpt  -0x10(%rbp)
jmp    15ec <__floatscan+0x48c>
mov    -0x18(%rbp),%rdi
call   1040 <shunget@plt>
movl   $0x30,-0x3c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1070 <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    $0x18,%rsp
fldz
cmp    $0x2,%esi
ja     1385 <__floatscan+0x225>
mov    %rdi,%rbx
mov    %edx,0x4(%rsp)
fstpt  0xc(%rsp)
movslq %esi,%rax
lea    0x2c42(%rip),%rcx
mov    (%rcx,%rax,8),%rcx
lea    0x2c4f(%rip),%rdx
mov    (%rdx,%rax,8),%rax
mov    (%rcx),%r12d
mov    (%rax),%r13d
sub    %r12d,%r13d
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1080 <shgetc@plt>
mov    %eax,%r14d
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    11b0 <__floatscan+0x50>
cmp    $0x2d,%r14b
je     11dc <__floatscan+0x7c>
mov    $0x1,%r15d
cmp    $0x2b,%r14b
jne    11f8 <__floatscan+0x98>
xor    %eax,%eax
cmp    $0x2d,%r14b
setne  %al
lea    (%rax,%rax,1),%r15d
add    $0xffffffff,%r15d
mov    %rbx,%rdi
call   1080 <shgetc@plt>
movsbl %al,%ebp
mov    %ebp,%eax
and    $0xffffffdf,%eax
cmp    $0x49,%eax
jne    12b7 <__floatscan+0x157>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
cmp    $0x4e,%al
jne    135d <__floatscan+0x1fd>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
cmp    $0x46,%al
jne    135d <__floatscan+0x1fd>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
cmp    $0x49,%al
jne    13cb <__floatscan+0x26b>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
mov    $0x4,%ebp
cmp    $0x4e,%al
jne    128c <__floatscan+0x12c>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
mov    $0x5,%ebp
cmp    $0x49,%al
jne    128c <__floatscan+0x12c>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
mov    $0x6,%ebp
cmp    $0x54,%al
jne    128c <__floatscan+0x12c>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
mov    $0x7,%ebp
cmp    $0x59,%al
je     13d3 <__floatscan+0x273>
cmpl   $0x0,0x4(%rsp)
je     135d <__floatscan+0x1fd>
mov    %rbx,%rdi
call   1040 <shunget@plt>
nop
mov    %rbx,%rdi
call   1040 <shunget@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x3,%rbp
ja     12a0 <__floatscan+0x140>
jmp    13d3 <__floatscan+0x273>
cmp    $0x4e,%eax
jne    1394 <__floatscan+0x234>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
cmp    $0x41,%al
jne    135d <__floatscan+0x1fd>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
cmp    $0x4e,%al
jne    135d <__floatscan+0x1fd>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
cmp    $0x28,%al
jne    1417 <__floatscan+0x2b7>
mov    $0xffffffffffffffff,%rbp
jmp    1304 <__floatscan+0x1a4>
nopl   (%rax)
add    $0xffffffffffffffff,%rbp
mov    %rbx,%rdi
call   1080 <shgetc@plt>
movsbl %al,%ecx
lea    -0x30(%rcx),%esi
lea    -0x41(%rcx),%edx
cmp    $0xa,%esi
jb     1300 <__floatscan+0x1a0>
cmp    $0x1a,%edx
jb     1300 <__floatscan+0x1a0>
add    $0xffffff9f,%ecx
cmp    $0x1a,%ecx
jb     1300 <__floatscan+0x1a0>
cmp    $0x5f,%al
je     1300 <__floatscan+0x1a0>
cmp    $0x29,%al
je     141f <__floatscan+0x2bf>
mov    %rbx,%rdi
call   1040 <shunget@plt>
cmpl   $0x0,0x4(%rsp)
je     1365 <__floatscan+0x205>
test   %rbp,%rbp
je     141f <__floatscan+0x2bf>
mov    %rbx,%rdi
call   1040 <shunget@plt>
inc    %rbp
jne    134b <__floatscan+0x1eb>
jmp    141f <__floatscan+0x2bf>
mov    %rbx,%rdi
call   1040 <shunget@plt>
mov    0x2c5c(%rip),%rax
mov    (%rax),%eax
mov    0x2c5b(%rip),%rcx
mov    %eax,(%rcx)
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <shlim@plt>
fldt   0xc(%rsp)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x30,%ebp
jne    13f1 <__floatscan+0x291>
mov    %rbx,%rdi
call   1080 <shgetc@plt>
and    $0xdf,%al
cmp    $0x58,%al
jne    13e9 <__floatscan+0x289>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    0x4(%rsp),%r8d
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <hexfloat@plt>
mov    %rbx,%rdi
call   1040 <shunget@plt>
mov    0x2c06(%rip),%rax
imul   (%rax),%r15d
mov    %r15d,0x8(%rsp)
fildl  0x8(%rsp)
jmp    1385 <__floatscan+0x225>
mov    %rbx,%rdi
call   1040 <shunget@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %r15d,%r8d
mov    0x4(%rsp),%r9d
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <decfloat@plt>
mov    %rbx,%rdi
call   1040 <shunget@plt>
mov    0x2bd2(%rip),%rax
fldt   (%rax)
jmp    1385 <__floatscan+0x225>

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

LLVM IR (-O2):
%struct.fake_file_t = type { i32 }
@FLT_MANT_DIG = global i32 0
@FLT_MIN_EXP = global i32 0
@DBL_MANT_DIG = global i32 0
@DBL_MIN_EXP = global i32 0
@LDBL_MANT_DIG = global i32 0
@LDBL_MIN_EXP = global i32 0
@INFINITY = global i32 0
@NAN = global x86_fp80 0xK00000000000000000000
@EINVAL = global i32 0
@errno = global i32 0
@switch.table.__floatscan = [3 x i32*] [i32* @FLT_MANT_DIG, i32* @DBL_MANT_DIG, i32* @LDBL_MANT_DIG]
@switch.table.__floatscan.2 = [3 x i32*] [i32* @FLT_MIN_EXP, i32* @DBL_MIN_EXP, i32* @LDBL_MIN_EXP]
define x86_fp80 @__floatscan(%struct.fake_file_t* %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %1, 3
br i1 %4, label %5, label %143
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds [3 x i32*], [3 x i32*]* @switch.table.__floatscan, i64 0, i64 %6
%8 = load i32*, i32** %7
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds [3 x i32*], [3 x i32*]* @switch.table.__floatscan.2, i64 0, i64 %9
%11 = load i32*, i32** %10
%12 = load i32, i32* %8
%13 = load i32, i32* %11
%14 = sub nsw i32 %13, %12
br label %15
15: ; preds = %15, %5
%16 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%17 = sext i8 %16 to i32
%18 = tail call i64 @isspace(i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %15
20: ; preds = %15
switch i8 %16, label %26 [
i8 45, label %21
i8 43, label %21
]
21: ; preds = %20, %20
%22 = icmp eq i8 %16, 45
%23 = select i1 %22, i32 -1, i32 1
%24 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%25 = sext i8 %24 to i32
br label %26
26: ; preds = %20, %21
%27 = phi i32 [ %23, %21 ], [ 1, %20 ]
%28 = phi i32 [ %25, %21 ], [ %17, %20 ]
%29 = and i32 %28, -33
%30 = icmp eq i32 %29, 73
br i1 %30, label %31, label %75
31: ; preds = %26
%32 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%33 = and i8 %32, -33
%34 = icmp eq i8 %33, 78
br i1 %34, label %35, label %127
35: ; preds = %31
%36 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%37 = and i8 %36, -33
%38 = icmp eq i8 %37, 70
br i1 %38, label %39, label %127
39: ; preds = %35
%40 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%41 = and i8 %40, -33
%42 = icmp eq i8 %41, 73
br i1 %42, label %45, label %43
43: ; preds = %39
%44 = tail call i32 @shunget(%struct.fake_file_t* %0)
br label %71
45: ; preds = %39
%46 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%47 = and i8 %46, -33
%48 = icmp eq i8 %47, 78
br i1 %48, label %49, label %61
49: ; preds = %45
%50 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%51 = and i8 %50, -33
%52 = icmp eq i8 %51, 73
br i1 %52, label %53, label %61
53: ; preds = %49
%54 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%55 = and i8 %54, -33
%56 = icmp eq i8 %55, 84
br i1 %56, label %57, label %61
57: ; preds = %53
%58 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%59 = and i8 %58, -33
%60 = icmp eq i8 %59, 89
br i1 %60, label %71, label %61
61: ; preds = %57, %53, %49, %45
%62 = phi i64 [ 4, %45 ], [ 5, %49 ], [ 6, %53 ], [ 7, %57 ]
%63 = icmp eq i32 %2, 0
br i1 %63, label %127, label %64
64: ; preds = %61
%65 = tail call i32 @shunget(%struct.fake_file_t* %0)
br label %66
66: ; preds = %64, %66
%67 = phi i64 [ %69, %66 ], [ %62, %64 ]
%68 = tail call i32 @shunget(%struct.fake_file_t* %0)
%69 = add i64 %67, -1
%70 = icmp ugt i64 %69, 3
br i1 %70, label %66, label %71
71: ; preds = %66, %57, %43
%72 = load i32, i32* @INFINITY
%73 = mul nsw i32 %72, %27
%74 = sitofp i32 %73 to x86_fp80
br label %143
75: ; preds = %26
%76 = icmp eq i32 %2, 0
%77 = and i32 %28, -33
%78 = icmp eq i32 %77, 78
br i1 %78, label %79, label %131
79: ; preds = %75
%80 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%81 = and i8 %80, -33
%82 = icmp eq i8 %81, 65
br i1 %82, label %83, label %127
83: ; preds = %79
%84 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%85 = and i8 %84, -33
%86 = icmp eq i8 %85, 78
br i1 %86, label %87, label %127
87: ; preds = %83
%88 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%89 = icmp eq i8 %88, 40
br i1 %89, label %93, label %90
90: ; preds = %87
%91 = tail call i32 @shunget(%struct.fake_file_t* %0)
%92 = load x86_fp80, x86_fp80* @NAN
br label %143
93: ; preds = %87, %125
%94 = phi i64 [ %126, %125 ], [ 1, %87 ]
%95 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%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 %125, 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 %125, 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 %143
111: ; preds = %107
%112 = tail call i32 @shunget(%struct.fake_file_t* %0)
br i1 %76, label %115, label %113
113: ; preds = %111
%114 = icmp eq i64 %94, 0
br i1 %114, label %123, label %118
115: ; preds = %111
%116 = load i32, i32* @EINVAL
store i32 %116, i32* @errno
%117 = tail call i32 @shlim(%struct.fake_file_t* %0, i32 0)
br label %143
118: ; preds = %113, %118
%119 = phi i64 [ %120, %118 ], [ %94, %113 ]
%120 = add i64 %119, -1
%121 = tail call i32 @shunget(%struct.fake_file_t* %0)
%122 = icmp eq i64 %120, 0
br i1 %122, label %123, label %118
123: ; preds = %118, %113
%124 = load x86_fp80, x86_fp80* @NAN
br label %143
125: ; preds = %93, %102
%126 = add i64 %94, 1
br label %93
127: ; preds = %61, %35, %31, %83, %79
%128 = tail call i32 @shunget(%struct.fake_file_t* %0)
%129 = load i32, i32* @EINVAL
store i32 %129, i32* @errno
%130 = tail call i32 @shlim(%struct.fake_file_t* %0, i32 0)
br label %143
131: ; preds = %75
%132 = icmp eq i32 %28, 48
br i1 %132, label %133, label %141
133: ; preds = %131
%134 = tail call signext i8 @shgetc(%struct.fake_file_t* %0)
%135 = and i8 %134, -33
%136 = icmp eq i8 %135, 88
br i1 %136, label %137, label %139
137: ; preds = %133
%138 = tail call x86_fp80 @hexfloat(%struct.fake_file_t* %0, i32 %12, i32 %14, i32 %27, i32 %2)
br label %143
139: ; preds = %133
%140 = tail call i32 @shunget(%struct.fake_file_t* %0)
br label %141
141: ; preds = %139, %131
%142 = tail call x86_fp80 @decfloat(%struct.fake_file_t* %0, i32 %28, i32 %12, i32 %14, i32 %27, i32 %2)
br label %143
143: ; preds = %3, %141, %137, %127, %123, %115, %109, %90, %71
%144 = phi x86_fp80 [ %74, %71 ], [ %92, %90 ], [ %110, %109 ], [ %124, %123 ], [ 0xK00000000000000000000, %115 ], [ 0xK00000000000000000000, %127 ], [ %138, %137 ], [ %142, %141 ], [ 0xK00000000000000000000, %3 ]
ret x86_fp80 %144
}