#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float end, helium_mix, depth;
  printf(
      "How much helium is in the mix? For example enter 45 for trimix 17/45\n");
  scanf("%f", &helium_mix);
  helium_mix /= 100;
  printf("Enter the depth\n");
  scanf("%f", &depth);
  end = ((1 - helium_mix) * (depth + 10)) - 10;
  printf("The END is %.2f metres", end);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xe7f(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  0xe6e(%rip),%xmm1
addss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe59(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
divss  0xe9d(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xe7a(%rip),%xmm0
subss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
addss  0xe6a(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe62(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [70 x i8] c"How much helium is in the mix? For example enter 45 for trimix 17/45\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [17 x i8] c"Enter the depth\0A\00"
@.str.3 = [23 x i8] c"The END is %.2f metres\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%7 = load float, float* %3
%8 = fdiv float %7, 1.000000e+02
store float %8, float* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%11 = load float, float* %3
%12 = fsub float 1.000000e+00, %11
%13 = load float, float* %4
%14 = fadd float %13, 1.000000e+01
%15 = call float @llvm.fmuladd.f32(float %12, float %14, float -1.000000e+01)
store float %15, float* %2
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %17)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [23 x i8] c"The END is %.2f metres\00"
@str = [69 x i8] c"How much helium is in the mix? For example enter 45 for trimix 17/45\00"
@str.4 = [16 x i8] c"Enter the depth\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = load float, float* %1
%8 = fdiv float %7, 1.000000e+02
store float %8, float* %1
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = load float, float* %1
%12 = fsub float 1.000000e+00, %11
%13 = load float, float* %2
%14 = fadd float %13, 1.000000e+01
%15 = call float @llvm.fmuladd.f32(float %12, float %14, float -1.000000e+01)
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %16)
ret i32 0
}