#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 */
typedef int /*<<< orphan*/ st;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int sscanf(char *, char *, double *);
int /*<<< orphan*/ stdin;
double double_input_no_check(const char *input_text, const char *error_text) {
  char st[200];
  int result;
  double number;
  printf("%s", input_text);
  do {
    fgets(st, sizeof(st), stdin);
    result = sscanf(st, "%lf", &number);
    if (result < 1) {
      printf("%s", error_text);
    }
  } while (result < 1);
  return number;
}


x86 assembly (clang, -O0):
<double_input_no_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
mov    $0xc8,%esi
call   1040 <fgets@plt>
lea    -0xe0(%rbp),%rdi
lea    0xe88(%rip),%rsi
lea    -0xf0(%rbp),%rdx
call   1050 <sscanf@plt>
mov    %eax,-0xe4(%rbp)
cmpl   $0x1,-0xe4(%rbp)
jge    11aa <double_input_no_check+0x7a>
mov    -0x10(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <double_input_no_check+0x7f>
cmpl   $0x1,-0xe4(%rbp)
jl     1153 <double_input_no_check+0x23>
movsd  -0xf0(%rbp),%xmm0
ff
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_input_no_check>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%r15
mov    %rdi,%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <fgets@plt>
lea    0xe8d(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
test   %eax,%eax
jg     11cd <double_input_no_check+0x9d>
lea    0xe72(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe69(%rip),%r12
lea    0x8(%rsp),%r13
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    0x0(%rbp),%edx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <sscanf@plt>
test   %eax,%eax
jle    11a0 <double_input_no_check+0x70>
movsd  0x8(%rsp),%xmm0
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
@.str.1 = [4 x i8] c"%lf\00"
define double @double_input_no_check(i8* %0, i8* %1) {
%3 = alloca [200 x i8]
%4 = alloca double
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = bitcast double* %4 to i8*
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %5, i32 200, i32 %8)
%10 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%11 = icmp slt i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %2, %12
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %5, i32 200, i32 %14)
%16 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%17 = icmp slt i32 %16, 1
br i1 %17, label %12, label %18
18: ; preds = %12, %2
%19 = load double, double* %4
ret double %19
}