#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 *, int *, int *, int *, int *);
int main(void) {
  int in_h, in_m, out_h, out_m, in_time, pay = 0;
  printf("[들어온 시간:분, 온 시간:분]을 입력해주세요.\n");
  printf("예시) 12:30, 12:48\n");
  scanf("%d: %d, %d: %d", &in_h, &in_m, &out_h, &out_m);
  in_time = ((out_h - in_h) * 60) + (out_m - in_m);
  if (in_time < 0) {
    printf("Input Error.여긴 하루만 주차 가능합니다.\n");
    return 0;
  }
  if (in_time > 30) {
    pay = (in_time - 30) / 30;
    pay += (((in_time - 30) % 30) ? 1 : 0);
    pay *= 1000;
  }
  printf("%d분(%d시간 %d분) 계셨고,", in_time, in_time / 60, in_time % 60);
  printf(pay ? " %d원 내셔야합니다.\n" : " 내실 금액은 없습니다.\n", pay);
  if ((in_h * 60 + in_m) < 570)
    printf("개장 시간 전인데 들어오실 수 있어요?\n");
  if (((in_h * 60 + in_m) < 570) && ((out_h * 60 + out_m) > 1410))
    printf("그리고 ");
  if ((out_h * 60 + out_m) > 1410)
    printf("폐장 시간 후인데 나가실 수 있어요?\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
imul   $0x3c,%eax,%eax
mov    -0x14(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    11a6 <main+0x86>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12b6 <main+0x196>
cmpl   $0x1e,-0x18(%rbp)
jle    11ec <main+0xcc>
mov    -0x18(%rbp),%eax
sub    $0x1e,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1e,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
imul   $0x3e8,-0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x20(%rbp),%edx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%ecx
lea    0xeb2(%rip),%rdi
lea    0xe8f(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x3c,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x23a,%eax
jge    125d <main+0x13d>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x3c,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x23a,%eax
jge    128f <main+0x16f>
imul   $0x3c,-0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    $0x582,%eax
jle    128f <main+0x16f>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x3c,-0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    $0x582,%eax
jle    12af <main+0x18f>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf3c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6e(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
sub    0xc(%rsp),%eax
imul   $0x3c,%eax,%eax
mov    (%rsp),%esi
sub    0x8(%rsp),%esi
add    %eax,%esi
js     1254 <main+0x124>
xor    %ebx,%ebx
cmp    $0x1f,%esi
jb     11b2 <main+0x82>
lea    -0x1e(%rsi),%eax
mov    $0x88888889,%ecx
imul   %rax,%rcx
shr    $0x24,%rcx
imul   $0xeeeeeeef,%eax,%eax
ror    %eax
cmp    $0x8888889,%eax
sbb    $0xffffffff,%ecx
imul   $0x3e8,%ecx,%ebx
mov    %esi,%eax
mov    $0x88888889,%edx
imul   %rax,%rdx
shr    $0x25,%rdx
imul   $0x3c,%edx,%eax
mov    %esi,%ecx
sub    %eax,%ecx
lea    0xe40(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
lea    0xe6d(%rip),%rax
lea    0xe4a(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x3c,0xc(%rsp),%eax
add    0x8(%rsp),%eax
cmp    $0x239,%eax
jg     123c <main+0x10c>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
imul   $0x3c,0xc(%rsp),%eax
add    0x8(%rsp),%eax
cmp    $0x239,%eax
jg     123c <main+0x10c>
imul   $0x3c,0x4(%rsp),%eax
add    (%rsp),%eax
cmp    $0x583,%eax
jl     123c <main+0x10c>
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x3c,0x4(%rsp),%eax
add    (%rsp),%eax
cmp    $0x583,%eax
jl     1260 <main+0x130>
lea    0xe79(%rip),%rdi
jmp    125b <main+0x12b>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"[\EB\93\A4\EC\96\B4\EC\98\A8 \EC\8B\9C\EA\B0\84:\EB\B6\84, \EC\98\A8 \EC\8B\9C\EA\B0\84:\EB\B6\84]\EC\9D\84 \EC\9E\85\EB\A0\A5\ED\95\B4\EC\A3\BC\EC\84\B8\EC\9A\94.\0A\00"
@.str.1 = [22 x i8] c"\EC\98\88\EC\8B\9C) 12:30, 12:48\0A\00"
@.str.2 = [15 x i8] c"%d: %d, %d: %d\00"
@.str.3 = [54 x i8] c"Input Error.\EC\97\AC\EA\B8\B4 \ED\95\98\EB\A3\A8\EB\A7\8C \EC\A3\BC\EC\B0\A8 \EA\B0\80\EB\8A\A5\ED\95\A9\EB\8B\88\EB\8B\A4.\0A\00"
@.str.4 = [33 x i8] c"%d\EB\B6\84(%d\EC\8B\9C\EA\B0\84 %d\EB\B6\84) \EA\B3\84\EC\85\A8\EA\B3\A0,\00"
@.str.5 = [28 x i8] c" %d\EC\9B\90 \EB\82\B4\EC\85\94\EC\95\BC\ED\95\A9\EB\8B\88\EB\8B\A4.\0A\00"
@.str.6 = [33 x i8] c" \EB\82\B4\EC\8B\A4 \EA\B8\88\EC\95\A1\EC\9D\80 \EC\97\86\EC\8A\B5\EB\8B\88\EB\8B\A4.\0A\00"
@.str.7 = [53 x i8] c"\EA\B0\9C\EC\9E\A5 \EC\8B\9C\EA\B0\84 \EC\A0\84\EC\9D\B8\EB\8D\B0 \EB\93\A4\EC\96\B4\EC\98\A4\EC\8B\A4 \EC\88\98 \EC\9E\88\EC\96\B4\EC\9A\94?\0A\00"
@.str.8 = [11 x i8] c"\EA\B7\B8\EB\A6\AC\EA\B3\A0 \00"
@.str.9 = [50 x i8] c"\ED\8F\90\EC\9E\A5 \EC\8B\9C\EA\B0\84 \ED\9B\84\EC\9D\B8\EB\8D\B0 \EB\82\98\EA\B0\80\EC\8B\A4 \EC\88\98 \EC\9E\88\EC\96\B4\EC\9A\94?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %4
%12 = load i32, i32* %2
%13 = sub nsw i32 %11, %12
%14 = mul nsw i32 %13, 60
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = add nsw i32 %14, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %83
23: ; preds = %0
%24 = load i32, i32* %6
%25 = icmp sgt i32 %24, 30
br i1 %25, label %26, label %40
26: ; preds = %23
%27 = load i32, i32* %6
%28 = sub nsw i32 %27, 30
%29 = sdiv i32 %28, 30
store i32 %29, i32* %7
%30 = load i32, i32* %6
%31 = sub nsw i32 %30, 30
%32 = srem i32 %31, 30
%33 = icmp ne i32 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 1, i32 0
%36 = load i32, i32* %7
%37 = add nsw i32 %36, %35
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = mul nsw i32 %38, 1000
store i32 %39, i32* %7
br label %40
40: ; preds = %26, %23
%41 = load i32, i32* %6
%42 = load i32, i32* %6
%43 = sdiv i32 %42, 60
%44 = load i32, i32* %6
%45 = srem i32 %44, 60
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %41, i32 %43, i32 %45)
%47 = load i32, i32* %7
%48 = icmp ne i32 %47, 0
%49 = zext i1 %48 to i64
%50 = select i1 %48, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0)
%51 = load i32, i32* %7
%52 = call i32 (i8*, ...) @printf(i8* %50, i32 %51)
%53 = load i32, i32* %2
%54 = mul nsw i32 %53, 60
%55 = load i32, i32* %3
%56 = add nsw i32 %54, %55
%57 = icmp slt i32 %56, 570
br i1 %57, label %58, label %60
58: ; preds = %40
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0))
br label %60
60: ; preds = %58, %40
%61 = load i32, i32* %2
%62 = mul nsw i32 %61, 60
%63 = load i32, i32* %3
%64 = add nsw i32 %62, %63
%65 = icmp slt i32 %64, 570
br i1 %65, label %66, label %74
66: ; preds = %60
%67 = load i32, i32* %4
%68 = mul nsw i32 %67, 60
%69 = load i32, i32* %5
%70 = add nsw i32 %68, %69
%71 = icmp sgt i32 %70, 1410
br i1 %71, label %72, label %74
72: ; preds = %66
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %74
74: ; preds = %72, %66, %60
%75 = load i32, i32* %4
%76 = mul nsw i32 %75, 60
%77 = load i32, i32* %5
%78 = add nsw i32 %76, %77
%79 = icmp sgt i32 %78, 1410
br i1 %79, label %80, label %82
80: ; preds = %74
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
br label %82
82: ; preds = %80, %74
store i32 0, i32* %1
br label %83
83: ; preds = %82, %21
%84 = load i32, i32* %1
ret i32 %84
}

LLVM IR (-O2):
@.str.2 = [15 x i8] c"%d: %d, %d: %d\00"
@.str.4 = [33 x i8] c"%d\EB\B6\84(%d\EC\8B\9C\EA\B0\84 %d\EB\B6\84) \EA\B3\84\EC\85\A8\EA\B3\A0,\00"
@.str.5 = [28 x i8] c" %d\EC\9B\90 \EB\82\B4\EC\85\94\EC\95\BC\ED\95\A9\EB\8B\88\EB\8B\A4.\0A\00"
@.str.6 = [33 x i8] c" \EB\82\B4\EC\8B\A4 \EA\B8\88\EC\95\A1\EC\9D\80 \EC\97\86\EC\8A\B5\EB\8B\88\EB\8B\A4.\0A\00"
@.str.8 = [11 x i8] c"\EA\B7\B8\EB\A6\AC\EA\B3\A0 \00"
@str = [62 x i8] c"[\EB\93\A4\EC\96\B4\EC\98\A8 \EC\8B\9C\EA\B0\84:\EB\B6\84, \EC\98\A8 \EC\8B\9C\EA\B0\84:\EB\B6\84]\EC\9D\84 \EC\9E\85\EB\A0\A5\ED\95\B4\EC\A3\BC\EC\84\B8\EC\9A\94.\00"
@str.10 = [21 x i8] c"\EC\98\88\EC\8B\9C) 12:30, 12:48\00"
@str.11 = [49 x i8] c"\ED\8F\90\EC\9E\A5 \EC\8B\9C\EA\B0\84 \ED\9B\84\EC\9D\B8\EB\8D\B0 \EB\82\98\EA\B0\80\EC\8B\A4 \EC\88\98 \EC\9E\88\EC\96\B4\EC\9A\94?\00"
@str.12 = [52 x i8] c"\EA\B0\9C\EC\9E\A5 \EC\8B\9C\EA\B0\84 \EC\A0\84\EC\9D\B8\EB\8D\B0 \EB\93\A4\EC\96\B4\EC\98\A4\EC\8B\A4 \EC\88\98 \EC\9E\88\EC\96\B4\EC\9A\94?\00"
@str.13 = [53 x i8] c"Input Error.\EC\97\AC\EA\B8\B4 \ED\95\98\EB\A3\A8\EB\A7\8C \EC\A3\BC\EC\B0\A8 \EA\B0\80\EB\8A\A5\ED\95\A9\EB\8B\88\EB\8B\A4.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%12 = load i32, i32* %3
%13 = load i32, i32* %1
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %14, 60
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = sub nsw i32 %16, %17
%19 = add nsw i32 %18, %15
%20 = icmp slt i32 %19, 0
br i1 %20, label %65, label %21
21: ; preds = %0
%22 = icmp ugt i32 %19, 30
br i1 %22, label %23, label %31
23: ; preds = %21
%24 = add nsw i32 %19, -30
%25 = udiv i32 %24, 30
%26 = urem i32 %24, 30
%27 = icmp ne i32 %26, 0
%28 = zext i1 %27 to i32
%29 = add nuw nsw i32 %25, %28
%30 = mul nsw i32 %29, 1000
br label %31
31: ; preds = %23, %21
%32 = phi i32 [ %30, %23 ], [ 0, %21 ]
%33 = udiv i32 %19, 60
%34 = urem i32 %19, 60
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %19, i32 %33, i32 %34)
%36 = icmp eq i32 %32, 0
%37 = select i1 %36, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %37, i32 %32)
%39 = load i32, i32* %1
%40 = mul nsw i32 %39, 60
%41 = load i32, i32* %2
%42 = add nsw i32 %40, %41
%43 = icmp slt i32 %42, 570
br i1 %43, label %44, label %59
44: ; preds = %31
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.12, i64 0, i64 0))
%46 = load i32, i32* %1
%47 = load i32, i32* %2
%48 = mul nsw i32 %46, 60
%49 = add nsw i32 %48, %47
%50 = icmp slt i32 %49, 570
br i1 %50, label %51, label %59
51: ; preds = %44
%52 = load i32, i32* %3
%53 = mul nsw i32 %52, 60
%54 = load i32, i32* %4
%55 = add nsw i32 %53, %54
%56 = icmp sgt i32 %55, 1410
br i1 %56, label %57, label %59
57: ; preds = %51
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %59
59: ; preds = %31, %57, %51, %44
%60 = load i32, i32* %3
%61 = mul nsw i32 %60, 60
%62 = load i32, i32* %4
%63 = add nsw i32 %61, %62
%64 = icmp sgt i32 %63, 1410
br i1 %64, label %65, label %68
65: ; preds = %59, %0
%66 = phi i8* [ getelementptr inbounds ([53 x i8], [53 x i8]* @str.13, i64 0, i64 0), %0 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @str.11, i64 0, i64 0), %59 ]
%67 = call i32 @puts(i8* dereferenceable(1) %66)
br label %68
68: ; preds = %65, %59
ret i32 0
}