#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 abs(double);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double mealCost, tipPercent, taxPercent, totalCost;
  scanf("%lf", &mealCost);
  scanf("%lf", &tipPercent);
  scanf("%lf", &taxPercent);
  totalCost =
      mealCost + (tipPercent * mealCost) / 100 + (taxPercent * mealCost) / 100;
  printf("The total meal cost is %d dollars.\n", abs(totalCost + 0.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe82(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe68(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe4b(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xedc(%rip),%rbx
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movhpd 0x8(%rsp),%xmm0
mulpd  %xmm2,%xmm0
divpd  0xe77(%rip),%xmm0
addsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  0xe73(%rip),%xmm0
call   1030 <abs@plt>
lea    0xe73(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [36 x i8] c"The total meal cost is %d dollars.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = load double, double* %2
%12 = fmul double %10, %11
%13 = fdiv double %12, 1.000000e+02
%14 = fadd double %9, %13
%15 = load double, double* %4
%16 = load double, double* %2
%17 = fmul double %15, %16
%18 = fdiv double %17, 1.000000e+02
%19 = fadd double %14, %18
store double %19, double* %5
%20 = load double, double* %5
%21 = fadd double %20, 5.000000e-01
%22 = call i32 @abs(double %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [36 x i8] c"The total meal cost is %d dollars.\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%10 = load double, double* %1
%11 = load double, double* %2
%12 = load double, double* %3
%13 = insertelement <2 x double> poison, double %10, i64 0
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
%15 = insertelement <2 x double> poison, double %11, i64 0
%16 = insertelement <2 x double> %15, double %12, i64 1
%17 = fmul <2 x double> %14, %16
%18 = fdiv <2 x double> %17, <double 1.000000e+02, double 1.000000e+02>
%19 = extractelement <2 x double> %18, i64 0
%20 = fadd double %10, %19
%21 = extractelement <2 x double> %18, i64 1
%22 = fadd double %20, %21
%23 = fadd double %22, 5.000000e-01
%24 = call i32 @abs(double %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %24)
ret i32 0
}