#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 *, double *);
int /*<<< orphan*/ stdin;
void readDouble2(double *variableAddress, char headerMessage[]) {
  bool ret;
  printf("%s", headerMessage);
  ret = scanf("\n%lf", variableAddress);
  __fpurge(stdin);
  if (ret != true) {
    readDouble2(variableAddress, headerMessage);
  }
}


x86 assembly (clang, -O0):
<readDouble2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1060 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0x14(%rbp)
je     1198 <readDouble2+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <readDouble2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDouble2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb8(%rip),%r15
lea    0xeb4(%rip),%r12
mov    0x2e92(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %eax,%ebp
mov    0x0(%r13),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1160 <readDouble2+0x30>
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 = [5 x i8] c"\0A%lf\00"
@stdin = global i32 0
define void @readDouble2(double* %0, i8* %1) {
%3 = alloca double*
%4 = alloca i8*
%5 = alloca i32
store double* %0, double** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load double*, double** %3
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* @stdin
%11 = call i32 @__fpurge(i32 %10)
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load double*, double** %3
%16 = load i8*, i8** %4
br label %17
17: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\0A%lf\00"
@stdin = global i32 0
define void @readDouble2(double* %0, i8* %1) {
br label %3
3: ; preds = %3, %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 ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %0)
%6 = load i32, i32* @stdin
%7 = tail call i32 @__fpurge(i32 %6)
%8 = icmp eq i32 %5, 1
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}