#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 lookahead_state {
  int dummy;
};

/* Variables and functions */
int _lookahead_getc(struct lookahead_state *);
int /*<<< orphan*/ _lookahead_revert(struct lookahead_state *, unsigned int);
unsigned int _lookahead_tell(struct lookahead_state *);
unsigned int _parse_float_digits(struct lookahead_state *);
unsigned int _parse_float_exp(struct lookahead_state *);
unsigned int _parse_float_frac(struct lookahead_state *);
unsigned int _parse_float(struct lookahead_state *lookahead) {
  unsigned int eaten;
  eaten = _parse_float_frac(lookahead);
  if (eaten) {
    unsigned int pos;
    int c;
    eaten += _parse_float_exp(lookahead);
    pos = _lookahead_tell(lookahead);
    c = _lookahead_getc(lookahead);
    if (c == 'f' || c == 'F') {
      eaten++;
    } else {
      _lookahead_revert(lookahead, pos);
    }
    return eaten;
  }
  eaten = _parse_float_digits(lookahead);
  if (eaten) {
    unsigned int exponent;
    exponent = _parse_float_exp(lookahead);
    if (exponent) {
      unsigned int pos;
      int c;
      eaten += exponent;
      pos = _lookahead_tell(lookahead);
      c = _lookahead_getc(lookahead);
      if (c == 'f' || c == 'F') {
        eaten++;
      } else {
        _lookahead_revert(lookahead, pos);
      }
      return eaten;
    }
  }
  _lookahead_revert(lookahead, 0);
  return 0;
}


x86 assembly (clang, -O0):
<_parse_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_parse_float_frac@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11e2 <_parse_float+0x82>
mov    -0x10(%rbp),%rdi
call   1060 <_parse_float_exp@plt>
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <_lookahead_tell@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <_lookahead_getc@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x66,-0x1c(%rbp)
je     11bd <_parse_float+0x5d>
cmpl   $0x46,-0x1c(%rbp)
jne    11cb <_parse_float+0x6b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d7 <_parse_float+0x77>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1070 <_lookahead_revert@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    127f <_parse_float+0x11f>
mov    -0x10(%rbp),%rdi
call   1040 <_parse_float_digits@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     126d <_parse_float+0x10d>
mov    -0x10(%rbp),%rdi
call   1060 <_parse_float_exp@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1268 <_parse_float+0x108>
mov    -0x20(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <_lookahead_tell@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <_lookahead_getc@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x66,-0x28(%rbp)
je     1243 <_parse_float+0xe3>
cmpl   $0x46,-0x28(%rbp)
jne    1251 <_parse_float+0xf1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    125d <_parse_float+0xfd>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1070 <_lookahead_revert@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    127f <_parse_float+0x11f>
jmp    126d <_parse_float+0x10d>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1070 <_lookahead_revert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_parse_float>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <_parse_float_frac@plt>
test   %eax,%eax
je     11ac <_parse_float+0x4c>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <_parse_float_exp@plt>
mov    %eax,%r15d
add    %ebp,%r15d
mov    %rbx,%rdi
call   1080 <_lookahead_tell@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1050 <_lookahead_getc@plt>
and    $0xffffffdf,%eax
cmp    $0x46,%eax
jne    11a4 <_parse_float+0x44>
add    $0x1,%r15d
jmp    11dc <_parse_float+0x7c>
mov    %rbx,%rdi
mov    %r14d,%esi
jmp    11d7 <_parse_float+0x77>
mov    %rbx,%rdi
call   1040 <_parse_float_digits@plt>
test   %eax,%eax
je     11cf <_parse_float+0x6f>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1060 <_parse_float_exp@plt>
test   %eax,%eax
je     11cf <_parse_float+0x6f>
mov    %eax,%r15d
add    %r14d,%r15d
jmp    1183 <_parse_float+0x23>
xor    %r15d,%r15d
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <_lookahead_revert@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.lookahead_state = type { i32 }
define i32 @_parse_float(%struct.lookahead_state* %0) {
%2 = alloca i32
%3 = alloca %struct.lookahead_state*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.lookahead_state* %0, %struct.lookahead_state** %3
%10 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%11 = call i32 @_parse_float_frac(%struct.lookahead_state* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %37
14: ; preds = %1
%15 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%16 = call i32 @_parse_float_exp(%struct.lookahead_state* %15)
%17 = load i32, i32* %4
%18 = add i32 %17, %16
store i32 %18, i32* %4
%19 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%20 = call i32 @_lookahead_tell(%struct.lookahead_state* %19)
store i32 %20, i32* %5
%21 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%22 = call i32 @_lookahead_getc(%struct.lookahead_state* %21)
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = icmp eq i32 %23, 102
br i1 %24, label %28, label %25
25: ; preds = %14
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 70
br i1 %27, label %28, label %31
28: ; preds = %25, %14
%29 = load i32, i32* %4
%30 = add i32 %29, 1
store i32 %30, i32* %4
br label %35
31: ; preds = %25
%32 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%33 = load i32, i32* %5
%34 = call i32 @_lookahead_revert(%struct.lookahead_state* %32, i32 %33)
br label %35
35: ; preds = %31, %28
%36 = load i32, i32* %4
store i32 %36, i32* %2
br label %73
37: ; preds = %1
%38 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%39 = call i32 @_parse_float_digits(%struct.lookahead_state* %38)
store i32 %39, i32* %4
%40 = load i32, i32* %4
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %70
42: ; preds = %37
%43 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%44 = call i32 @_parse_float_exp(%struct.lookahead_state* %43)
store i32 %44, i32* %7
%45 = load i32, i32* %7
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %69
47: ; preds = %42
%48 = load i32, i32* %7
%49 = load i32, i32* %4
%50 = add i32 %49, %48
store i32 %50, i32* %4
%51 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%52 = call i32 @_lookahead_tell(%struct.lookahead_state* %51)
store i32 %52, i32* %8
%53 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%54 = call i32 @_lookahead_getc(%struct.lookahead_state* %53)
store i32 %54, i32* %9
%55 = load i32, i32* %9
%56 = icmp eq i32 %55, 102
br i1 %56, label %60, label %57
57: ; preds = %47
%58 = load i32, i32* %9
%59 = icmp eq i32 %58, 70
br i1 %59, label %60, label %63
60: ; preds = %57, %47
%61 = load i32, i32* %4
%62 = add i32 %61, 1
store i32 %62, i32* %4
br label %67
63: ; preds = %57
%64 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%65 = load i32, i32* %8
%66 = call i32 @_lookahead_revert(%struct.lookahead_state* %64, i32 %65)
br label %67
67: ; preds = %63, %60
%68 = load i32, i32* %4
store i32 %68, i32* %2
br label %73
69: ; preds = %42
br label %70
70: ; preds = %69, %37
%71 = load %struct.lookahead_state*, %struct.lookahead_state** %3
%72 = call i32 @_lookahead_revert(%struct.lookahead_state* %71, i32 0)
store i32 0, i32* %2
br label %73
73: ; preds = %70, %67, %35
%74 = load i32, i32* %2
ret i32 %74
}

LLVM IR (-O2):
%struct.lookahead_state = type { i32 }
define i32 @_parse_float(%struct.lookahead_state* %0) {
%2 = tail call i32 @_parse_float_frac(%struct.lookahead_state* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = tail call i32 @_parse_float_exp(%struct.lookahead_state* %0)
%6 = add i32 %5, %2
%7 = tail call i32 @_lookahead_tell(%struct.lookahead_state* %0)
%8 = tail call i32 @_lookahead_getc(%struct.lookahead_state* %0)
%9 = and i32 %8, -33
%10 = icmp eq i32 %9, 70
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = add i32 %6, 1
br label %33
13: ; preds = %4
%14 = tail call i32 @_lookahead_revert(%struct.lookahead_state* %0, i32 %7)
br label %33
15: ; preds = %1
%16 = tail call i32 @_parse_float_digits(%struct.lookahead_state* %0)
%17 = icmp eq i32 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %15
%19 = tail call i32 @_parse_float_exp(%struct.lookahead_state* %0)
%20 = icmp eq i32 %19, 0
br i1 %20, label %31, label %21
21: ; preds = %18
%22 = add i32 %19, %16
%23 = tail call i32 @_lookahead_tell(%struct.lookahead_state* %0)
%24 = tail call i32 @_lookahead_getc(%struct.lookahead_state* %0)
%25 = and i32 %24, -33
%26 = icmp eq i32 %25, 70
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = add i32 %22, 1
br label %33
29: ; preds = %21
%30 = tail call i32 @_lookahead_revert(%struct.lookahead_state* %0, i32 %23)
br label %33
31: ; preds = %18, %15
%32 = tail call i32 @_lookahead_revert(%struct.lookahead_state* %0, i32 0)
br label %33
33: ; preds = %29, %27, %11, %13, %31
%34 = phi i32 [ 0, %31 ], [ %12, %11 ], [ %6, %13 ], [ %22, %29 ], [ %28, %27 ]
ret i32 %34
}