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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe75(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe56(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <round@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec5(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm2
unpcklps %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm2
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
mulpd  %xmm2,%xmm0
divpd  0xe69(%rip),%xmm0
addsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1050 <round@plt>
lea    0xe68(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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