// File: /workspace/github_cpp_makefile_star2_O1/sile[P]unf/src/unf/unf.cc
// Function: main
int main(int argc, char** argv) {
  if(argc != 2) {
  usage:
    std::cerr << "Usage: unf <D|C|KD|KC>" << std::endl;
    return 1;
  }
  
  UNF::Normalizer norm;

  const char* fs = argv[1];
  UNF::Normalizer::Form form;
  if      (eq(fs,"D"))  form = UNF::Normalizer::FORM_NFD;
  else if (eq(fs,"C"))  form = UNF::Normalizer::FORM_NFC;
  else if (eq(fs,"KD")) form = UNF::Normalizer::FORM_NFKD;
  else if (eq(fs,"KC")) form = UNF::Normalizer::FORM_NFKC;
  else                  goto usage;
    
  std::string line;
  while(std::getline(std::cin,line)) 
    std::cout << norm.normalize(line.c_str(), form) << std::endl;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
cmpl $0x2, %edi
jne 0x152b
leaq 0x1da6(%rip), %rax      # 0x3070
leaq 0xc0(%rsp), %rdx
movq %rax, -0xa0(%rdx)
movl $0x102, -0x98(%rdx)     # imm = 0x102
leaq 0x3fe46(%rip), %rcx     # 0x41130
movq %rcx, -0x90(%rdx)
movq %rax, -0x88(%rdx)
movl $0x103, -0x80(%rdx)     # imm = 0x103
movq %rcx, -0x78(%rdx)
movq %rax, -0x70(%rdx)
movl $0x101, -0x68(%rdx)     # imm = 0x101
movq %rcx, -0x60(%rdx)
movq %rax, -0x58(%rdx)
movl $0x105, -0x50(%rdx)     # imm = 0x105
xorl %ebx, %ebx
movq %rbx, -0x48(%rdx)
movq %rax, -0x40(%rdx)
movl $0x106, -0x38(%rdx)     # imm = 0x106
movq %rbx, -0x30(%rdx)
movq %rax, -0x28(%rdx)
movl $0x104, -0x20(%rdx)     # imm = 0x104
movq %rbx, -0x18(%rdx)
movq %rdx, -0x10(%rdx)
movq %rbx, -0x8(%rdx)
movb %bl, (%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
movq %rbx, 0x20(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq 0x8(%rsi), %r14
leaq 0x1ca7(%rip), %rsi      # 0x302c
movq %r14, %rdi
callq 0x1120
testl %eax, %eax
je 0x13e3
leaq 0x1c97(%rip), %rsi      # 0x302f
movq %r14, %rdi
callq 0x1120
testl %eax, %eax
je 0x13d7
leaq 0x1c80(%rip), %rsi      # 0x302b
movq %r14, %rdi
callq 0x1120
testl %eax, %eax
je 0x13de
leaq 0x1c70(%rip), %rsi      # 0x302e
movq %r14, %rdi
callq 0x1120
movb $0x1, %bl
testl %eax, %eax
jne 0x14c5
movl $0x3, %ebx
jmp 0x13e3
movl $0x1, %ebx
jmp 0x13e3
movl $0x2, %ebx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x64bda(%rip), %r14     # 0x65fd8
movq %rsp, %r15
leaq 0x20(%rsp), %r12
movq 0x64bbb(%rip), %r13     # 0x65fc8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1160
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
movq (%rsp), %rsi
jne 0x14b1
movq %r12, %rdi
movl %ebx, %edx
callq 0x15b4
movq %rax, %rbp
testq %rax, %rax
je 0x146b
movq %rbp, %rdi
callq 0x1080
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x1110
jmp 0x1484
movq (%r13), %rax
movq -0x18(%rax), %rax
leaq (%rax,%r13), %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x1140
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
jmp 0x140d
leaq 0x10(%rsp), %rax
cmpq %rax, %rsi
je 0x14c3
movq %rsi, %rdi
callq 0x10d0
xorl %ebx, %ebx
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x14d7
callq 0x10d0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x14f1
callq 0x10d0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x150b
callq 0x10d0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x1525
callq 0x10d0
xorl %eax, %eax
testb %bl, %bl
je 0x1572
movq 0x64abe(%rip), %rbx     # 0x65ff0
leaq 0x1adb(%rip), %rsi      # 0x3014
movl $0x16, %edx
movq %rbx, %rdi
callq 0x1110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
movl $0x1, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x159a
callq 0x10d0
leaq 0x20(%rsp), %rdi
callq 0x1604
movq %rbx, %rdi
callq 0x1150
movq %rax, %rdi
callq 0x15f9