#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);
int round(double);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  double meal_cost;
  int tip_percent;
  int tax_percent;
  scanf("%lf", &meal_cost);
  scanf("%d", &tip_percent);
  scanf("%d", &tax_percent);
  double tip_total = meal_cost * (tip_percent / 100.0);
  double tax_total = meal_cost * (tax_percent / 100.0);
  int total_cost = round(meal_cost + tip_total + tax_total);
  printf("The total meal cost is %d dollars.\n", total_cost);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea2(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xe79(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xe5a(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1050 <round@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xe3b(%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>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
unpcklps %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
movsd  0x8(%rsp),%xmm2
divpd  0xe75(%rip),%xmm1
movapd %xmm2,%xmm0
unpcklpd %xmm2,%xmm0
mulpd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
unpckhpd %xmm0,%xmm0
addsd  %xmm2,%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 = [36 x i8] c"The total meal cost is %d dollars.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store i32 0, i32* %1
%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 = fdiv double %13, 1.000000e+02
%15 = fmul double %11, %14
store double %15, double* %5
%16 = load double, double* %2
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 1.000000e+02
%20 = fmul double %16, %19
store double %20, double* %6
%21 = load double, double* %2
%22 = load double, double* %5
%23 = fadd double %21, %22
%24 = load double, double* %6
%25 = fadd double %23, %24
%26 = call i32 @round(double %25)
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"The total meal cost is %d dollars.\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i32
%3 = alloca i32
%4 = bitcast double* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%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 = fdiv <2 x double> %15, <double 1.000000e+02, double 1.000000e+02>
%17 = insertelement <2 x double> poison, double %10, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = fmul <2 x double> %18, %16
%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 i32 @round(double %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %24)
ret i32 0
}