#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() {
  double meal_cost = 0.0f;
  int tip_percent = 0;
  int tax_percent = 0;
  scanf("%lf", &meal_cost);
  scanf("%d", &tip_percent);
  scanf("%d", &tax_percent);
  double tip = meal_cost * (double)tip_percent / 100;
  double tax = meal_cost * (double)tax_percent / 100;
  double total_cost = meal_cost + tax + tip;
  printf("The total meal cost is %d dollars.", (int)round(total_cost));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8c(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe40(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <round@plt>
mov    %eax,%esi
lea    0xe1f(%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
movq   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xebc(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xead(%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,%xmm0
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
mulpd  %xmm0,%xmm2
divpd  0xe51(%rip),%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
call   1050 <round@plt>
lea    0xe4c(%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 double
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i32 0, i32* %3
store i32 0, i32* %4
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load double, double* %2
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fmul double %11, %13
%15 = fdiv double %14, 1.000000e+02
store double %15, double* %5
%16 = load double, double* %2
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = fdiv double %19, 1.000000e+02
store double %20, double* %6
%21 = load double, double* %2
%22 = load double, double* %6
%23 = fadd double %21, %22
%24 = load double, double* %5
%25 = fadd double %23, %24
store double %25, double* %7
%26 = load double, double* %7
%27 = call i64 @round(double %26)
%28 = trunc i64 %27 to i32
%29 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %28)
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 double
%2 = alloca i32
%3 = alloca i32
%4 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load double, double* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%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 1
%21 = fadd double %10, %20
%22 = extractelement <2 x double> %19, i64 0
%23 = fadd double %22, %21
%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
}