#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*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, float *);
int /*<<< orphan*/ stdin;
void readFloat3(float *variableAddress, char headerMessage[],
                char errorMessage[]) {
  bool ret;
  do {
    printf("%s", headerMessage);
    ret = scanf("%f", variableAddress);
    __fpurge(stdin);
    if (ret != true) {
      printf("%s", errorMessage);
    }
  } while (ret != true);
}


x86 assembly (clang, -O0):
<readFloat3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1050 <scanf@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0x1c(%rbp)
je     118f <readFloat3+0x5f>
mov    -0x18(%rbp),%rsi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
jmp    1194 <readFloat3+0x64>
cmpl   $0x1,-0x1c(%rbp)
jne    1144 <readFloat3+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFloat3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    %eax,%ebx
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebx
je     11c6 <readFloat3+0x96>
lea    0xe85(%rip),%rbx
lea    0xe81(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    %eax,%ebp
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1190 <readFloat3+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
@stdin = global i32 0
define void @readFloat3(float* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %0)
%6 = load i32, i32* @stdin
%7 = tail call i32 @__fpurge(i32 %6)
%8 = icmp eq i32 %5, 1
br i1 %8, label %16, label %9
9: ; preds = %3, %9
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%12 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %0)
%13 = load i32, i32* @stdin
%14 = tail call i32 @__fpurge(i32 %13)
%15 = icmp eq i32 %12, 1
br i1 %15, label %16, label %9
16: ; preds = %9, %3
ret void
}