#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 */
scalar_t__ isdigit(char const);
long double __scan_float_uint(const char **_str, int flags) {
  long double value;
  value = 0;
  while (isdigit(**_str)) {
    value *= 10;
    value += (**_str - '0');
    (*_str)++;
  }
  return value;
}


x86 assembly (clang, -O0):
<__scan_float_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
fldz
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1179 <__scan_float_uint+0x69>
fldt   -0x20(%rbp)
flds   0xeba(%rip)
fmulp  %st,%st(1)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
add    $0xffffffd0,%eax
mov    %eax,-0x24(%rbp)
fildl  -0x24(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1124 <__scan_float_uint+0x14>
fldt   -0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__scan_float_uint>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
fldz
test   %rax,%rax
je     1162 <__scan_float_uint+0x52>
fstp   %st(0)
fldz
xchg   %ax,%ax
fmuls  0xeca(%rip)
mov    (%rbx),%rax
movsbl (%rax),%ecx
add    $0xffffffd0,%ecx
mov    %ecx,(%rsp)
fiaddl (%rsp)
fstpt  0x4(%rsp)
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
fldt   0x4(%rsp)
test   %rax,%rax
jne    1130 <__scan_float_uint+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define x86_fp80 @__scan_float_uint(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca x86_fp80
store i8** %0, i8*** %3
store i32 %1, i32* %4
store x86_fp80 0xK00000000000000000000, x86_fp80* %5
br label %6
6: ; preds = %12, %2
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = call i64 @isdigit(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %6
%13 = load x86_fp80, x86_fp80* %5
%14 = fmul x86_fp80 %13, 0xK4002A000000000000000
store x86_fp80 %14, x86_fp80* %5
%15 = load i8**, i8*** %3
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 48
%20 = sitofp i32 %19 to x86_fp80
%21 = load x86_fp80, x86_fp80* %5
%22 = fadd x86_fp80 %21, %20
store x86_fp80 %22, x86_fp80* %5
%23 = load i8**, i8*** %3
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %23
br label %6
26: ; preds = %6
%27 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %27
}

LLVM IR (-O2):
define x86_fp80 @__scan_float_uint(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = tail call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %20, label %7
7: ; preds = %2, %7
%8 = phi x86_fp80 [ %15, %7 ], [ 0xK00000000000000000000, %2 ]
%9 = fmul x86_fp80 %8, 0xK4002A000000000000000
%10 = load i8*, i8** %0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, -48
%14 = sitofp i32 %13 to x86_fp80
%15 = fadd x86_fp80 %9, %14
%16 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %16, i8** %0
%17 = load i8, i8* %16
%18 = tail call i64 @isdigit(i8 signext %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %7
20: ; preds = %7, %2
%21 = phi x86_fp80 [ 0xK00000000000000000000, %2 ], [ %15, %7 ]
ret x86_fp80 %21
}