#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  float weight;
  float value;
  printf("Are you worth your weight in platinum?\n");
  printf("Let's check it out.\n");
  printf("Please enter your weight in pounds: ");
  scanf("%f", &weight);
  int a;
  scanf("%d", &a);
  value = 1700.0 * weight * 14.5833;
  printf("Your weight in platinum is worth $%.2f.\n", value);
  printf("You are easily worth that! If platinum prices drop,\n");
  printf("eat more to maintain your value.\n");
  char ch1 = getchar();
  char ch2 = getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xef3(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe6a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe56(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x12(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xeb9(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe64(%rip),%xmm0
mulsd  0xe64(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Are you worth your weight in platinum?\0A\00"
@.str.1 = [21 x i8] c"Let's check it out.\0A\00"
@.str.2 = [37 x i8] c"Please enter your weight in pounds: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [41 x i8] c"Your weight in platinum is worth $%.2f.\0A\00"
@.str.6 = [53 x i8] c"You are easily worth that! If platinum prices drop,\0A\00"
@.str.7 = [34 x i8] c"eat more to maintain your value.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fmul double 1.700000e+03, %13
%15 = fmul double %14, 1.458330e+01
%16 = fptrunc double %15 to float
store float %16, float* %3
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%22 = call signext i8 (...) @getchar()
store i8 %22, i8* %5
%23 = call signext i8 (...) @getchar()
store i8 %23, i8* %6
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [37 x i8] c"Please enter your weight in pounds: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [41 x i8] c"Your weight in platinum is worth $%.2f.\0A\00"
@str = [39 x i8] c"Are you worth your weight in platinum?\00"
@str.8 = [20 x i8] c"Let's check it out.\00"
@str.9 = [52 x i8] c"You are easily worth that! If platinum prices drop,\00"
@str.10 = [33 x i8] c"eat more to maintain your value.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%8 = bitcast i32* %2 to i8*
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = fmul double %11, 1.700000e+03
%13 = fmul double %12, 1.458330e+01
%14 = fptrunc double %13 to float
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.9, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.10, i64 0, i64 0))
%19 = call signext i8 (...) @getchar()
%20 = call signext i8 (...) @getchar()
ret i32 0
}