#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 pow(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  int mark = 0;
  int num_read;
  if (num < 0) {
    printf("fu ");
    num = -num;
  }
  int num_ori = num;
  while (num > 9) {
    num /= 10;
    mark++;
  }
  for (int i = mark; i >= 0; i--) {
    num_read = num_ori / pow(10, i);
    switch (num_read) {
    case 0:
      printf("ling");
      break;
    case 1:
      printf("yi");
      break;
    case 2:
      printf("er");
      break;
    case 3:
      printf("san");
      break;
    case 4:
      printf("si");
      break;
    case 5:
      printf("wu");
      break;
    case 6:
      printf("liu");
      break;
    case 7:
      printf("qi");
      break;
    case 8:
      printf("ba");
      break;
    case 9:
      printf("jiu");
      break;
    }
    if (i > 0) {
      printf(" ");
    }
    num_ori = num_ori % (int)pow(10, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1174 <main+0x44>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    11a0 <main+0x70>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117a <main+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     12da <main+0x1aa>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    $0xa,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x9,%rax
ja     1298 <main+0x168>
mov    -0x20(%rbp),%rax
lea    0xe16(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xdf2(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xde4(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xdd7(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xdc9(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    0xdbb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jle    12ae <main+0x17e>
lea    0xd84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%esi
mov    $0xa,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    11a6 <main+0x76>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xeb2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%r15d
test   %r15d,%r15d
jns    117b <main+0x3b>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %r15d,%r15d
sub    0x4(%rsp),%r15d
mov    %r15d,0x4(%rsp)
xor    %ebp,%ebp
cmp    $0xa,%r15d
jl     11a8 <main+0x68>
xor    %ebp,%ebp
mov    $0xcccccccd,%eax
mov    %r15d,%ecx
nopl   (%rax)
mov    %ecx,%edx
mov    %ecx,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    $0x1,%ebp
cmp    $0x63,%edx
ja     1190 <main+0x50>
mov    %ecx,0x4(%rsp)
lea    0xe7d(%rip),%r14
jmp    11e0 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %ebp,%esi
call   1060 <pow@plt>
mov    %eax,%ecx
mov    %r15d,%eax
cltd
idiv   %ecx
lea    0x1(%rbx),%eax
mov    %ebx,%ebp
mov    %edx,%r15d
test   %eax,%eax
jle    121a <main+0xda>
mov    $0xa,%edi
mov    %ebp,%esi
call   1060 <pow@plt>
mov    %eax,%ecx
mov    %r15d,%eax
cltd
idiv   %ecx
cmp    $0x9,%eax
ja     1207 <main+0xc7>
cltq
movslq (%r14,%rax,4),%rdi
add    %r14,%rdi
call   1040 <printf@plt>
mov    %ebp,%ebx
sub    $0x1,%ebx
jb     11c0 <main+0x80>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11c0 <main+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"fu \00"
@.str.2 = [5 x i8] c"ling\00"
@.str.3 = [3 x i8] c"yi\00"
@.str.4 = [3 x i8] c"er\00"
@.str.5 = [4 x i8] c"san\00"
@.str.6 = [3 x i8] c"si\00"
@.str.7 = [3 x i8] c"wu\00"
@.str.8 = [4 x i8] c"liu\00"
@.str.9 = [3 x i8] c"qi\00"
@.str.10 = [3 x i8] c"ba\00"
@.str.11 = [4 x i8] c"jiu\00"
@.str.12 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = sub nsw i32 0, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %0
%15 = load i32, i32* %2
store i32 %15, i32* %5
br label %16
16: ; preds = %19, %14
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 9
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 10
store i32 %21, i32* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %16
24: ; preds = %16
%25 = load i32, i32* %3
store i32 %25, i32* %6
br label %26
26: ; preds = %65, %24
%27 = load i32, i32* %6
%28 = icmp sge i32 %27, 0
br i1 %28, label %29, label %68
29: ; preds = %26
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = call i32 @pow(i32 10, i32 %31)
%33 = sdiv i32 %30, %32
store i32 %33, i32* %4
%34 = load i32, i32* %4
switch i32 %34, label %55 [
i32 0, label %35
i32 1, label %37
i32 2, label %39
i32 3, label %41
i32 4, label %43
i32 5, label %45
i32 6, label %47
i32 7, label %49
i32 8, label %51
i32 9, label %53
]
35: ; preds = %29
%36 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %55
37: ; preds = %29
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %55
39: ; preds = %29
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %55
41: ; preds = %29
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %55
43: ; preds = %29
%44 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %55
45: ; preds = %29
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %55
47: ; preds = %29
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %55
49: ; preds = %29
%50 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %55
51: ; preds = %29
%52 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %55
53: ; preds = %29
%54 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %55
55: ; preds = %29, %53, %51, %49, %47, %45, %43, %41, %39, %37, %35
%56 = load i32, i32* %6
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %60
60: ; preds = %58, %55
%61 = load i32, i32* %5
%62 = load i32, i32* %6
%63 = call i32 @pow(i32 10, i32 %62)
%64 = srem i32 %61, %63
store i32 %64, i32* %5
br label %65
65: ; preds = %60
%66 = load i32, i32* %6
%67 = add nsw i32 %66, -1
store i32 %67, i32* %6
br label %26
68: ; preds = %26
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"fu \00"
@.str.2 = [5 x i8] c"ling\00"
@.str.3 = [3 x i8] c"yi\00"
@.str.4 = [3 x i8] c"er\00"
@.str.5 = [4 x i8] c"san\00"
@.str.6 = [3 x i8] c"si\00"
@.str.7 = [3 x i8] c"wu\00"
@.str.8 = [4 x i8] c"liu\00"
@.str.9 = [3 x i8] c"qi\00"
@.str.10 = [3 x i8] c"ba\00"
@.str.11 = [4 x i8] c"jiu\00"
@reltable.main = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.6 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.7 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.9 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.10 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.11 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = sub nsw i32 0, %8
store i32 %9, i32* %1
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ %9, %6 ], [ %4, %0 ]
%12 = icmp sgt i32 %11, 9
br i1 %12, label %16, label %13
13: ; preds = %15, %10
%14 = phi i32 [ 0, %10 ], [ %20, %15 ]
br label %23
15: ; preds = %16
store i32 %19, i32* %1
br label %13
16: ; preds = %10, %16
%17 = phi i32 [ %20, %16 ], [ 0, %10 ]
%18 = phi i32 [ %19, %16 ], [ %11, %10 ]
%19 = udiv i32 %18, 10
%20 = add nuw nsw i32 %17, 1
%21 = icmp ugt i32 %18, 99
br i1 %21, label %16, label %15
22: ; preds = %38
ret i32 0
23: ; preds = %13, %38
%24 = phi i32 [ %41, %38 ], [ %14, %13 ]
%25 = phi i32 [ %40, %38 ], [ %11, %13 ]
%26 = call i32 @pow(i32 10, i32 %24)
%27 = sdiv i32 %25, %26
%28 = icmp ult i32 %27, 10
br i1 %28, label %29, label %34
29: ; preds = %23
%30 = sext i32 %27 to i64
%31 = shl i64 %30, 2
%32 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.main to i8*), i64 %31)
%33 = call i32 @printf(i8* dereferenceable(1) %32)
br label %34
34: ; preds = %23, %29
%35 = icmp eq i32 %24, 0
br i1 %35, label %38, label %36
36: ; preds = %34
%37 = call i32 @putchar(i32 32)
br label %38
38: ; preds = %36, %34
%39 = call i32 @pow(i32 10, i32 %24)
%40 = srem i32 %25, %39
%41 = add nsw i32 %24, -1
%42 = icmp sgt i32 %24, 0
br i1 %42, label %23, label %22
}