#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 scanf(char *, unsigned int *);
int main(void) {
  unsigned x;
  printf("駐車時間: ");
  if (scanf("%u", &x) != 1) {
    return 1;
  }
  printf("駐車料金: %u円\n", (x < 17)   ? 60 * x
                             : (x < 24) ? 1000
                                        : (x / 24 + (x % 24 != 0)) * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1162 <main+0x42>
movl   $0x1,-0x4(%rbp)
jmp    11e2 <main+0xc2>
cmpl   $0x11,-0x8(%rbp)
jae    1178 <main+0x58>
imul   $0x3c,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11ca <main+0xaa>
cmpl   $0x18,-0x8(%rbp)
jae    118f <main+0x6f>
mov    $0x3e8,%eax
mov    %eax,-0x10(%rbp)
jmp    11c4 <main+0xa4>
mov    -0x8(%rbp),%eax
mov    $0x18,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x18,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x14(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe3e(%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    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%ebx
cmp    $0x1,%eax
jne    119c <main+0x7c>
mov    0xc(%rsp),%eax
cmp    $0x10,%eax
ja     115c <main+0x3c>
imul   $0x3c,%eax,%esi
jmp    118c <main+0x6c>
mov    $0x3e8,%esi
cmp    $0x18,%eax
jb     118c <main+0x6c>
mov    %eax,%ecx
mov    $0xaaaaaaab,%edx
imul   %rcx,%rdx
shr    $0x24,%rdx
imul   $0xaaaaaaab,%eax,%eax
ror    $0x3,%eax
cmp    $0xaaaaaab,%eax
sbb    $0xffffffff,%edx
imul   $0x3e8,%edx,%esi
lea    0xe7f(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\E9\A7\90\E8\BB\8A\E6\99\82\E9\96\93: \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [21 x i8] c"\E9\A7\90\E8\BB\8A\E6\96\99\E9\87\91: %u\E5\86\86\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %31
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp ult i32 %8, 17
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = mul i32 60, %11
br label %28
13: ; preds = %7
%14 = load i32, i32* %2
%15 = icmp ult i32 %14, 24
br i1 %15, label %16, label %17
16: ; preds = %13
br label %26
17: ; preds = %13
%18 = load i32, i32* %2
%19 = udiv i32 %18, 24
%20 = load i32, i32* %2
%21 = urem i32 %20, 24
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
%24 = add i32 %19, %23
%25 = mul i32 %24, 1000
br label %26
26: ; preds = %17, %16
%27 = phi i32 [ 1000, %16 ], [ %25, %17 ]
br label %28
28: ; preds = %26, %10
%29 = phi i32 [ %12, %10 ], [ %27, %26 ]
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %29)
store i32 0, i32* %1
br label %31
31: ; preds = %28, %6
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [15 x i8] c"\E9\A7\90\E8\BB\8A\E6\99\82\E9\96\93: \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [21 x i8] c"\E9\A7\90\E8\BB\8A\E6\96\99\E9\87\91: %u\E5\86\86\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %23
6: ; preds = %0
%7 = load i32, i32* %1
%8 = icmp ult i32 %7, 17
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = mul nuw nsw i32 %7, 60
br label %20
11: ; preds = %6
%12 = icmp ult i32 %7, 24
br i1 %12, label %20, label %13
13: ; preds = %11
%14 = udiv i32 %7, 24
%15 = urem i32 %7, 24
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %14, %17
%19 = mul i32 %18, 1000
br label %20
20: ; preds = %13, %11, %9
%21 = phi i32 [ %10, %9 ], [ %19, %13 ], [ 1000, %11 ]
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %0, %20
%24 = phi i32 [ 0, %20 ], [ 1, %0 ]
ret i32 %24
}