#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 compte_jusque_lastcharacter(char *, char *);
float strtof(char *, char **);
scalar_t__ verif_last_character_exist(char *);
scalar_t__ verif_reel(char *);
float renvoi_nombre_reel(char *character, int *erreur, int *position_reel) {
  if (verif_reel(character)) {
    char *lastcharacter;
    float reel;
    reel = strtof(character, &lastcharacter);
    if (verif_last_character_exist(lastcharacter)) {
      *position_reel = compte_jusque_lastcharacter(character, lastcharacter);
      return reel;
    } else {
      *erreur = 1;
      return reel;
    }
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<renvoi_nombre_reel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <verif_reel@plt>
cmp    $0x0,%rax
je     11c9 <renvoi_nombre_reel+0x89>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <strtof@plt>
movss  %xmm0,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <verif_last_character_exist@plt>
cmp    $0x0,%rax
je     11b0 <renvoi_nombre_reel+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <compte_jusque_lastcharacter@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11d6 <renvoi_nombre_reel+0x96>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11d6 <renvoi_nombre_reel+0x96>
movss  0xe2f(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renvoi_nombre_reel>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <verif_reel@plt>
test   %rax,%rax
je     1193 <renvoi_nombre_reel+0x53>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strtof@plt>
movss  %xmm0,0xc(%rsp)
mov    0x10(%rsp),%r12
mov    %r12,%rdi
call   1040 <verif_last_character_exist@plt>
test   %rax,%rax
je     119d <renvoi_nombre_reel+0x5d>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <compte_jusque_lastcharacter@plt>
mov    %eax,(%r14)
jmp    11a4 <renvoi_nombre_reel+0x64>
movss  0xe65(%rip),%xmm0
jmp    11aa <renvoi_nombre_reel+0x6a>
movl   $0x1,(%r15)
movss  0xc(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @renvoi_nombre_reel(i8* %0, i32* %1, i32* %2) {
%4 = alloca float
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca float
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%10 = load i8*, i8** %5
%11 = call i64 @verif_reel(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %28
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call float @strtof(i8* %14, i8** %8)
store float %15, float* %9
%16 = load i8*, i8** %8
%17 = call i64 @verif_last_character_exist(i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %13
%20 = load i8*, i8** %5
%21 = load i8*, i8** %8
%22 = call i32 @compte_jusque_lastcharacter(i8* %20, i8* %21)
%23 = load i32*, i32** %7
store i32 %22, i32* %23
%24 = load float, float* %9
store float %24, float* %4
br label %29
25: ; preds = %13
%26 = load i32*, i32** %6
store i32 1, i32* %26
%27 = load float, float* %9
store float %27, float* %4
br label %29
28: ; preds = %3
store float -1.000000e+00, float* %4
br label %29
29: ; preds = %28, %25, %19
%30 = load float, float* %4
ret float %30
}

LLVM IR (-O2):
define float @renvoi_nombre_reel(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca i8*
%5 = tail call i64 @verif_reel(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %3
%8 = bitcast i8** %4 to i8*
%9 = call float @strtof(i8* %0, i8** %4)
%10 = load i8*, i8** %4
%11 = tail call i64 @verif_last_character_exist(i8* %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %7
%14 = tail call i32 @compte_jusque_lastcharacter(i8* %0, i8* %10)
store i32 %14, i32* %2
br label %16
15: ; preds = %7
store i32 1, i32* %1
br label %16
16: ; preds = %15, %13
br label %17
17: ; preds = %3, %16
%18 = phi float [ %9, %16 ], [ -1.000000e+00, %3 ]
ret float %18
}