#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 *, float, float, float, float, float);
float sqrt(int);
int main() {
  float dr = 1.5, sc = 12000, hc = 14;
  float eoq, tbo;
  eoq = sqrt((dr * sc * 2) / hc);
  tbo = sqrt((2 * sc) / (dr * hc));
  printf("For Demand Rate: %.2f \n"
         "Setup Cost: %.2f \n"
         "Holding cost per item: %.2f \n"
         "EOQ = %.2f and TBO = %.2f \n",
         dr, sc, hc, eoq, tbo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeb3(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xe98(%rip),%xmm1
mulss  %xmm1,%xmm0
divss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  0xe79(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
movss  -0x18(%rbp),%xmm4
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa0b,%edi
call   1040 <sqrt@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x476,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm4
lea    0xec7(%rip),%rdi
movss  0xeb3(%rip),%xmm0
movss  0xeaf(%rip),%xmm1
movss  0xeab(%rip),%xmm2
movss  0x4(%rsp),%xmm3
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [98 x i8] c"For Demand Rate: %.2f \0ASetup Cost: %.2f \0AHolding cost per item: %.2f \0AEOQ = %.2f and TBO = %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store float 1.500000e+00, float* %2
store float 1.200000e+04, float* %3
store float 1.400000e+01, float* %4
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = fmul float %9, 2.000000e+00
%11 = load float, float* %4
%12 = fdiv float %10, %11
%13 = fptosi float %12 to i32
%14 = call float @sqrt(i32 %13)
store float %14, float* %5
%15 = load float, float* %3
%16 = fmul float 2.000000e+00, %15
%17 = load float, float* %2
%18 = load float, float* %4
%19 = fmul float %17, %18
%20 = fdiv float %16, %19
%21 = fptosi float %20 to i32
%22 = call float @sqrt(i32 %21)
store float %22, float* %6
%23 = load float, float* %2
%24 = load float, float* %3
%25 = load float, float* %4
%26 = load float, float* %5
%27 = load float, float* %6
%28 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), float %23, float %24, float %25, float %26, float %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [98 x i8] c"For Demand Rate: %.2f \0ASetup Cost: %.2f \0AHolding cost per item: %.2f \0AEOQ = %.2f and TBO = %.2f \0A\00"
define i32 @main() {
%1 = tail call float @sqrt(i32 2571)
%2 = tail call float @sqrt(i32 1142)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), float 1.500000e+00, float 1.200000e+04, float 1.400000e+01, float %1, float %2)
ret i32 0
}