#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m;
  printf("책의 가격은 %d원입니다.\n당신이 가진 용돈은 얼마인가요? ", 15000);
  scanf("%d", &m);
  if (m >= 15000)
    printf("책을 구입하였습니다. 이제 남은 용돈은 %d원입니다.", m - 15000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x3a98,%esi
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3a98,-0x8(%rbp)
jl     1172 <main+0x52>
mov    -0x8(%rbp),%esi
sub    $0x3a98,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3a98,%esi
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0x3a98,%esi
jl     1161 <main+0x41>
add    $0xffffc568,%esi
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [78 x i8] c"\EC\B1\85\EC\9D\98 \EA\B0\80\EA\B2\A9\EC\9D\80 %d\EC\9B\90\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\EB\8B\B9\EC\8B\A0\EC\9D\B4 \EA\B0\80\EC\A7\84 \EC\9A\A9\EB\8F\88\EC\9D\80 \EC\96\BC\EB\A7\88\EC\9D\B8\EA\B0\80\EC\9A\94? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [70 x i8] c"\EC\B1\85\EC\9D\84 \EA\B5\AC\EC\9E\85\ED\95\98\EC\98\80\EC\8A\B5\EB\8B\88\EB\8B\A4. \EC\9D\B4\EC\A0\9C \EB\82\A8\EC\9D\80 \EC\9A\A9\EB\8F\88\EC\9D\80 %d\EC\9B\90\EC\9E\85\EB\8B\88\EB\8B\A4.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 15000)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 15000
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 15000
%10 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [78 x i8] c"\EC\B1\85\EC\9D\98 \EA\B0\80\EA\B2\A9\EC\9D\80 %d\EC\9B\90\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\EB\8B\B9\EC\8B\A0\EC\9D\B4 \EA\B0\80\EC\A7\84 \EC\9A\A9\EB\8F\88\EC\9D\80 \EC\96\BC\EB\A7\88\EC\9D\B8\EA\B0\80\EC\9A\94? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [70 x i8] c"\EC\B1\85\EC\9D\84 \EA\B5\AC\EC\9E\85\ED\95\98\EC\98\80\EC\8A\B5\EB\8B\88\EB\8B\A4. \EC\9D\B4\EC\A0\9C \EB\82\A8\EC\9D\80 \EC\9A\A9\EB\8F\88\EC\9D\80 %d\EC\9B\90\EC\9E\85\EB\8B\88\EB\8B\A4.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 15000)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 14999
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = add nsw i32 %5, -15000
%9 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}