#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 *, double, double, double);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
void fig09_19() {
  double a;
  double b;
  double c;
  puts("Enter three floating-point numbers:");
  scanf("%le%lf%lg", &a, &b, &c);
  puts("\nHere are the number entered in plain:");
  puts("floating-point notation:\n");
  printf("%f\n%f\n%f\n", a, b, c);
}


x86 assembly (clang, -O0):
<fig09_19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <scanf@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xee5(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig09_19>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <scanf@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
lea    0xee6(%rip),%rdi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Enter three floating-point numbers:\00"
@.str.1 = [10 x i8] c"%le%lf%lg\00"
@.str.2 = [39 x i8] c"\0AHere are the number entered in plain:\00"
@.str.3 = [26 x i8] c"floating-point notation:\0A\00"
@.str.4 = [10 x i8] c"%f\0A%f\0A%f\0A\00"
define void @fig09_19() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%6 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%8 = load double, double* %1
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %8, double %9, double %10)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Enter three floating-point numbers:\00"
@.str.1 = [10 x i8] c"%le%lf%lg\00"
@.str.2 = [39 x i8] c"\0AHere are the number entered in plain:\00"
@.str.3 = [26 x i8] c"floating-point notation:\0A\00"
@.str.4 = [10 x i8] c"%f\0A%f\0A%f\0A\00"
define void @fig09_19() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%11 = load double, double* %1
%12 = load double, double* %2
%13 = load double, double* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %11, double %12, double %13)
ret void
}