#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 tip, tax;
  int pay1, pay2, totalCost;
  double mealCost;
  scanf("%lf", &mealCost);
  scanf("%d", &pay1);
  scanf("%d", &pay2);
  tip = mealCost * pay1 / 100;
  tax = mealCost * pay2 / 100;
  totalCost = round(mealCost + tip + tax);
  printf("The total meal cost is %d dollars.", totalCost);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec9(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea9(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1050 <round@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe42(%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 double
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%10 = load double, double* %6
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = fmul double %10, %12
%14 = fdiv double %13, 1.000000e+02
store double %14, double* %1
%15 = load double, double* %6
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to double
%18 = fmul double %15, %17
%19 = fdiv double %18, 1.000000e+02
store double %19, double* %2
%20 = load double, double* %6
%21 = load double, double* %1
%22 = fadd double %20, %21
%23 = load double, double* %2
%24 = fadd double %22, %23
%25 = call i32 @round(double %24)
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %26)
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 i32 @round(double %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %24)
ret i32 0
}