#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
main() {
  float precio = 0;
  char car = 0;
  printf("Precio: ");
  scanf("%g", &precio);
  fflush(stdin);
  printf("Pulse <Entrar> para continuar ");
  scanf("%c", &car);
  printf("Precio = %g\n", precio);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movb   $0x0,0x3(%rsp)
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Precio: \00"
@.str.1 = [3 x i8] c"%g\00"
@stdin = global i32 0
@.str.2 = [31 x i8] c"Pulse <Entrar> para continuar \00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [13 x i8] c"Precio = %g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i8
store float 0.000000e+00, float* %1
store i8 0, i8* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%9 = load float, float* %1
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Precio: \00"
@.str.1 = [3 x i8] c"%g\00"
@stdin = global i32 0
@.str.2 = [31 x i8] c"Pulse <Entrar> para continuar \00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [13 x i8] c"Precio = %g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i8
%3 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
store i8 0, i8* %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%6 = load i32, i32* @stdin
%7 = call i32 @fflush(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %11)
ret i32 0
}