#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 main() {
  int phoneNum, min;
  scanf("%d %d", &phoneNum, &min);
  if (phoneNum == 101 || phoneNum == 102 || phoneNum == 103 ||
      phoneNum == 104 || phoneNum == 112) {
    printf("0$\n");
  } else if (phoneNum > 99 && phoneNum < 1000) {
    printf("%d$\n", 40 * min);
  } else if (phoneNum > 999999 && phoneNum < 10000000) {
    printf("%d$\n", min);
  } else {
    printf("-1\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x65,-0x8(%rbp)
je     1175 <main+0x55>
cmpl   $0x66,-0x8(%rbp)
je     1175 <main+0x55>
cmpl   $0x67,-0x8(%rbp)
je     1175 <main+0x55>
cmpl   $0x68,-0x8(%rbp)
je     1175 <main+0x55>
cmpl   $0x70,-0x8(%rbp)
jne    1188 <main+0x68>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fe <main+0xde>
cmpl   $0x63,-0x8(%rbp)
jle    11b6 <main+0x96>
cmpl   $0x3e8,-0x8(%rbp)
jge    11b6 <main+0x96>
imul   $0x28,-0xc(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f9 <main+0xd9>
cmpl   $0xf423f,-0x8(%rbp)
jle    11e6 <main+0xc6>
cmpl   $0x989680,-0x8(%rbp)
jge    11e6 <main+0xc6>
mov    -0xc(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f4 <main+0xd4>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f9 <main+0xd9>
jmp    11fe <main+0xde>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x65(%rax),%ecx
cmp    $0x4,%ecx
jb     1156 <main+0x26>
cmp    $0x70,%eax
jne    1166 <main+0x36>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    -0x64(%rax),%ecx
cmp    $0x383,%ecx
ja     117c <main+0x4c>
mov    (%rsp),%eax
shl    $0x3,%eax
lea    (%rax,%rax,4),%esi
jmp    118b <main+0x5b>
add    $0xfff0bdc0,%eax
cmp    $0x89543f,%eax
ja     119b <main+0x6b>
mov    (%rsp),%esi
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1162 <main+0x32>
lea    0xe69(%rip),%rdi
jmp    115d <main+0x2d>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"0$\0A\00"
@.str.2 = [5 x i8] c"%d$\0A\00"
@.str.3 = [4 x i8] c"-1\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 101
br i1 %6, label %19, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 102
br i1 %9, label %19, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 103
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 104
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 112
br i1 %18, label %19, label %21
19: ; preds = %16, %13, %10, %7, %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %44
21: ; preds = %16
%22 = load i32, i32* %2
%23 = icmp sgt i32 %22, 99
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 1000
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %3
%29 = mul nsw i32 40, %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %43
31: ; preds = %24, %21
%32 = load i32, i32* %2
%33 = icmp sgt i32 %32, 999999
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 10000000
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %3
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %38)
br label %42
40: ; preds = %34, %31
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
br label %43
43: ; preds = %42, %27
br label %44
44: ; preds = %43, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.2 = [5 x i8] c"%d$\0A\00"
@str = [3 x i8] c"-1\00"
@str.4 = [3 x i8] c"0$\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
switch i32 %6, label %9 [
i32 112, label %7
i32 104, label %7
i32 103, label %7
i32 102, label %7
i32 101, label %7
]
7: ; preds = %0, %0, %0, %0, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0))
br label %24
9: ; preds = %0
%10 = add i32 %6, -100
%11 = icmp ult i32 %10, 900
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %2
%14 = mul nsw i32 %13, 40
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %24
16: ; preds = %9
%17 = add i32 %6, -1000000
%18 = icmp ult i32 %17, 9000000
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %24
22: ; preds = %16
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %24
24: ; preds = %12, %22, %19, %7
ret i32 0
}