#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long double __scan_float_uint(int /*<<< orphan*/ *, int);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
long double __scan_float_int(FILE *stream, int flags) {
  char c;
  c = getc(stream);
  if (c == '-') {
    return -__scan_float_uint(stream, flags);
  } else if (c == '+') {
    return __scan_float_uint(stream, flags);
  } else {
    ungetc(c, stream);
    return __scan_float_uint(stream, flags);
  }
}


x86 assembly (clang, -O0):
<__scan_float_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%eax
cmp    $0x2d,%eax
jne    116e <__scan_float_int+0x3e>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <__scan_float_uint@plt>
fchs
fstpt  -0x10(%rbp)
jmp    11ab <__scan_float_int+0x7b>
movsbl -0x1d(%rbp),%eax
cmp    $0x2b,%eax
jne    118f <__scan_float_int+0x5f>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <__scan_float_uint@plt>
fstpt  -0x10(%rbp)
jmp    11ab <__scan_float_int+0x7b>
movsbl -0x1d(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <ungetc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <__scan_float_uint@plt>
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__scan_float_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <getc@plt>
cmp    $0x2b,%al
je     1163 <__scan_float_int+0x33>
cmp    $0x2d,%al
jne    1158 <__scan_float_int+0x28>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <__scan_float_uint@plt>
fchs
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
movsbl %al,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__scan_float_uint@plt>

LLVM IR (-O0):
define x86_fp80 @__scan_float_int(i32* %0, i32 %1) {
%3 = alloca x86_fp80
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32*, i32** %4
%8 = call signext i8 @getc(i32* %7)
store i8 %8, i8* %6
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 45
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = call x86_fp80 @__scan_float_uint(i32* %13, i32 %14)
%16 = fneg x86_fp80 %15
store x86_fp80 %16, x86_fp80* %3
br label %32
17: ; preds = %2
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 43
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i32*, i32** %4
%23 = load i32, i32* %5
%24 = call x86_fp80 @__scan_float_uint(i32* %22, i32 %23)
store x86_fp80 %24, x86_fp80* %3
br label %32
25: ; preds = %17
%26 = load i8, i8* %6
%27 = load i32*, i32** %4
%28 = call i32 @ungetc(i8 signext %26, i32* %27)
%29 = load i32*, i32** %4
%30 = load i32, i32* %5
%31 = call x86_fp80 @__scan_float_uint(i32* %29, i32 %30)
store x86_fp80 %31, x86_fp80* %3
br label %32
32: ; preds = %25, %21, %12
%33 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %33
}

LLVM IR (-O2):
define x86_fp80 @__scan_float_int(i32* %0, i32 %1) {
%3 = tail call signext i8 @getc(i32* %0)
switch i8 %3, label %9 [
i8 45, label %4
i8 43, label %7
]
4: ; preds = %2
%5 = tail call x86_fp80 @__scan_float_uint(i32* %0, i32 %1)
%6 = fneg x86_fp80 %5
br label %12
7: ; preds = %2
%8 = tail call x86_fp80 @__scan_float_uint(i32* %0, i32 %1)
br label %12
9: ; preds = %2
%10 = tail call i32 @ungetc(i8 signext %3, i32* %0)
%11 = tail call x86_fp80 @__scan_float_uint(i32* %0, i32 %1)
br label %12
12: ; preds = %9, %7, %4
%13 = phi x86_fp80 [ %6, %4 ], [ %8, %7 ], [ %11, %9 ]
ret x86_fp80 %13
}