#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*/ *fgets(char *, int, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ puts(char *);
scalar_t__ sscanf(char *, char *, double *);
int /*<<< orphan*/ stdin;
int main(void) {
  double d;
  char *s = malloc(500);
  while (fgets(s, 500, stdin) != NULL)
    if (!(sscanf(s, "%lf", &d) && d > 10.0))
      puts("Either not a double or a double greater than 10.0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
mov    $0x1f4,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     11c4 <main+0x84>
mov    -0x18(%rbp),%rdi
lea    0xe7f(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1060 <sscanf@plt>
cmp    $0x0,%rax
je     11b3 <main+0x73>
movsd  -0x10(%rbp),%xmm0
movsd  0xe57(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     11bf <main+0x7f>
lea    0xe52(%rip),%rdi
call   1030 <puts@plt>
jmp    115d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    $0x1f4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2e87(%rip),%r13
mov    0x0(%r13),%edx
mov    %rax,%rdi
mov    $0x1f4,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11d3 <main+0x93>
lea    0xe8a(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xe82(%rip),%r12
jmp    11ae <main+0x6e>
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <puts@plt>
mov    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11d3 <main+0x93>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <sscanf@plt>
test   %rax,%rax
je     1190 <main+0x50>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe31(%rip),%xmm0
ja     1198 <main+0x58>
jmp    1190 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%lf\00"
@.str.1 = [50 x i8] c"Either not a double or a double greater than 10.0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i32 500)
store i8* %4, i8** %3
br label %5
5: ; preds = %19, %0
%6 = load i8*, i8** %3
%7 = load i32, i32* @stdin
%8 = call i32* @fgets(i8* %6, i32 500, i32 %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = call i64 @sscanf(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load double, double* %2
%16 = fcmp ogt double %15, 1.000000e+01
br i1 %16, label %19, label %17
17: ; preds = %14, %10
%18 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
br label %5
20: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%lf\00"
@.str.1 = [50 x i8] c"Either not a double or a double greater than 10.0\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call dereferenceable_or_null(500) i8* @malloc(i32 500)
%4 = load i32, i32* @stdin
%5 = call i32* @fgets(i8* %3, i32 500, i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %19, label %7
7: ; preds = %0, %15
%8 = call i64 @sscanf(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%9 = icmp ne i64 %8, 0
%10 = load double, double* %1
%11 = fcmp ogt double %10, 1.000000e+01
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %15, label %13
13: ; preds = %7
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %7, %13
%16 = load i32, i32* @stdin
%17 = call i32* @fgets(i8* %3, i32 500, i32 %16)
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %7
19: ; preds = %15, %0
ret i32 0
}