#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 /*<<< orphan*/ printf(char const *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int sscanf(char *, char *, float *);
float ui__getFloat(const char *message) {
  char s[100];
  float ret = 0;
  printf("%s", message);
  scanf("%s", s);
  while (sscanf(s, "%f", &ret) != 1) {
    printf(message);
    scanf("%s", s);
  }
  return ret;
}


x86 assembly (clang, -O0):
<ui__getFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe8f(%rip),%rsi
lea    -0x74(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11a6 <ui__getFloat+0x76>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe64(%rip),%rdi
call   1050 <scanf@plt>
jmp    1169 <ui__getFloat+0x39>
movss  -0x74(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui__getFloat>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%r15
movl   $0x0,0xc(%rsp)
lea    0xeae(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xe8d(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11c8 <ui__getFloat+0x98>
lea    0xe71(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe68(%rip),%r12
lea    0xc(%rsp),%r13
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    11a0 <ui__getFloat+0x70>
movss  0xc(%rsp),%xmm0
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
define float @ui__getFloat(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
%4 = alloca float
store i8* %0, i8** %2
store float 0.000000e+00, float* %4
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %13, %1
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32 (i8*, ...) @printf(i8* %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %9
18: ; preds = %9
%19 = load float, float* %4
ret float %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
define float @ui__getFloat(i8* %0) {
%2 = alloca [100 x i8]
%3 = alloca float
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%9 = icmp eq i32 %8, 1
br i1 %9, label %15, label %10
10: ; preds = %1, %10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%13 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %10
15: ; preds = %10, %1
%16 = load float, float* %3
ret float %16
}