#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 */
typedef double totalCookTime;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double ribWeight = 0.0;
  int hour = 60;
  double decimalTosecond = 60;
  double firstCookTime = 0.0;
  int continueCookTime = 120;
  double totalCookTime = 0.0;
  int totalhoursNum = 0;
  int totalminutes = 0;
  int totalseconds = 0;
  printf("How many pounds is your prime rib? ");
  scanf("%lf", &ribWeight);
  firstCookTime = ribWeight * 5;
  totalCookTime = firstCookTime + continueCookTime;
  totalhoursNum = totalCookTime / hour;
  totalminutes = totalCookTime - (totalhoursNum * hour);
  totalseconds = (((totalCookTime) - (totalhoursNum * hour + totalminutes)) *
                  decimalTosecond) +
                 0.5;
  printf(
      "Your rib will be in the oven for %d hours, %d minutes, and %d seconds.",
      totalhoursNum, totalminutes, totalseconds);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x3c,-0x14(%rbp)
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x78,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xe6b(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x3c(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x3c(%rbp),%eax
imul   -0x14(%rbp),%eax
add    -0x40(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdee(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  0xead(%rip),%xmm0
movsd  0xead(%rip),%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%esi
imul   $0x3c,%esi,%eax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
cvttsd2si %xmm3,%edx
add    %edx,%eax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe7a(%rip),%xmm0
cvttsd2si %xmm0,%ecx
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"How many pounds is your prime rib? \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [71 x i8] c"Your rib will be in the oven for %d hours, %d minutes, and %d seconds.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i32 60, i32* %3
store double 6.000000e+01, double* %4
store double 0.000000e+00, double* %5
store i32 120, i32* %6
store double 0.000000e+00, double* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%13 = load double, double* %2
%14 = fmul double %13, 5.000000e+00
store double %14, double* %5
%15 = load double, double* %5
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to double
%18 = fadd double %15, %17
store double %18, double* %7
%19 = load double, double* %7
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to double
%22 = fdiv double %19, %21
%23 = fptosi double %22 to i32
store i32 %23, i32* %8
%24 = load double, double* %7
%25 = load i32, i32* %8
%26 = load i32, i32* %3
%27 = mul nsw i32 %25, %26
%28 = sitofp i32 %27 to double
%29 = fsub double %24, %28
%30 = fptosi double %29 to i32
store i32 %30, i32* %9
%31 = load double, double* %7
%32 = load i32, i32* %8
%33 = load i32, i32* %3
%34 = mul nsw i32 %32, %33
%35 = load i32, i32* %9
%36 = add nsw i32 %34, %35
%37 = sitofp i32 %36 to double
%38 = fsub double %31, %37
%39 = load double, double* %4
%40 = call double @llvm.fmuladd.f64(double %38, double %39, double 5.000000e-01)
%41 = fptosi double %40 to i32
store i32 %41, i32* %10
%42 = load i32, i32* %8
%43 = load i32, i32* %9
%44 = load i32, i32* %10
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0), i32 %42, i32 %43, i32 %44)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"How many pounds is your prime rib? \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [71 x i8] c"Your rib will be in the oven for %d hours, %d minutes, and %d seconds.\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 5.000000e+00
%7 = fadd double %6, 1.200000e+02
%8 = fdiv double %7, 6.000000e+01
%9 = fptosi double %8 to i32
%10 = mul nsw i32 %9, 60
%11 = sitofp i32 %10 to double
%12 = fsub double %7, %11
%13 = fptosi double %12 to i32
%14 = add nsw i32 %10, %13
%15 = sitofp i32 %14 to double
%16 = fsub double %7, %15
%17 = call double @llvm.fmuladd.f64(double %16, double 6.000000e+01, double 5.000000e-01)
%18 = fptosi double %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %13, i32 %18)
ret i32 0
}