#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 /*<<< orphan*/ scanf(char *, double *, double *);
int main(void) {
  double subtotal, tip, tipRate;
  printf("음식 금액과 팁 비율을 입력해주세요. 구분은 ,(콤마)로 합니다. ");
  scanf("%lf, %lf", &subtotal, &tipRate);
  tip = subtotal * (tipRate / 100);
  printf("팁 금액은 %lf달러이며, 총 금액은 %lf달러입니다.\n", tip,
         subtotal + tip);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe9d(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
lea    0xee1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  0xea4(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm1
lea    0xefc(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [86 x i8] c"\EC\9D\8C\EC\8B\9D \EA\B8\88\EC\95\A1\EA\B3\BC \ED\8C\81 \EB\B9\84\EC\9C\A8\EC\9D\84 \EC\9E\85\EB\A0\A5\ED\95\B4\EC\A3\BC\EC\84\B8\EC\9A\94. \EA\B5\AC\EB\B6\84\EC\9D\80 ,(\EC\BD\A4\EB\A7\88)\EB\A1\9C \ED\95\A9\EB\8B\88\EB\8B\A4. \00"
@.str.1 = [9 x i8] c"%lf, %lf\00"
@.str.2 = [66 x i8] c"\ED\8C\81 \EA\B8\88\EC\95\A1\EC\9D\80 %lf\EB\8B\AC\EB\9F\AC\EC\9D\B4\EB\A9\B0, \EC\B4\9D \EA\B8\88\EC\95\A1\EC\9D\80 %lf\EB\8B\AC\EB\9F\AC\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %4)
%7 = load double, double* %2
%8 = load double, double* %4
%9 = fdiv double %8, 1.000000e+02
%10 = fmul double %7, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = load double, double* %2
%13 = load double, double* %3
%14 = fadd double %12, %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), double %11, double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [86 x i8] c"\EC\9D\8C\EC\8B\9D \EA\B8\88\EC\95\A1\EA\B3\BC \ED\8C\81 \EB\B9\84\EC\9C\A8\EC\9D\84 \EC\9E\85\EB\A0\A5\ED\95\B4\EC\A3\BC\EC\84\B8\EC\9A\94. \EA\B5\AC\EB\B6\84\EC\9D\80 ,(\EC\BD\A4\EB\A7\88)\EB\A1\9C \ED\95\A9\EB\8B\88\EB\8B\A4. \00"
@.str.1 = [9 x i8] c"%lf, %lf\00"
@.str.2 = [66 x i8] c"\ED\8C\81 \EA\B8\88\EC\95\A1\EC\9D\80 %lf\EB\8B\AC\EB\9F\AC\EC\9D\B4\EB\A9\B0, \EC\B4\9D \EA\B8\88\EC\95\A1\EC\9D\80 %lf\EB\8B\AC\EB\9F\AC\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = fdiv double %8, 1.000000e+02
%10 = fmul double %7, %9
%11 = fadd double %7, %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), double %10, double %11)
ret i32 0
}