// File: /workspace/github_cpp_makefile_star2_O3/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 0x153a
leaq 0x1d96(%rip), %rax      # 0x3060
leaq 0xc0(%rsp), %r12
movq %rax, -0xa0(%r12)
movl $0x102, -0x98(%r12) # imm = 0x102
leaq 0x3fe33(%rip), %rcx     # 0x41120
movq %rcx, -0x90(%r12)
movq %rax, -0x88(%r12)
movl $0x103, -0x80(%r12)     # imm = 0x103
movq %rcx, -0x78(%r12)
movq %rax, -0x70(%r12)
movl $0x101, -0x68(%r12)     # imm = 0x101
movq %rcx, -0x60(%r12)
movq %rax, -0x58(%r12)
movl $0x105, -0x50(%r12)     # imm = 0x105
xorl %ecx, %ecx
movq %rcx, -0x48(%r12)
movq %rax, -0x40(%r12)
movl $0x106, -0x38(%r12)     # imm = 0x106
movq %rcx, -0x30(%r12)
movq %rax, -0x28(%r12)
movl $0x104, -0x20(%r12)     # imm = 0x104
movq %rcx, -0x18(%r12)
movq %r12, -0x10(%r12)
movq %rcx, -0x8(%r12)
movb %cl, (%r12)
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
movq %rcx, 0x20(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq 0x8(%rsi), %rax
movzbl (%rax), %ecx
movb $0x1, %bl
cmpl $0x43, %ecx
je 0x13e7
cmpl $0x4b, %ecx
je 0x13c0
cmpl $0x44, %ecx
jne 0x14ee
cmpb $0x0, 0x1(%rax)
jne 0x14ee
xorl %ebx, %ebx
jmp 0x13fd
cmpb $0x44, 0x1(%rax)
jne 0x13cc
cmpb $0x0, 0x2(%rax)
je 0x13f8
cmpb $0x43, 0x1(%rax)
jne 0x14ee
cmpb $0x0, 0x2(%rax)
jne 0x14ee
movl $0x3, %ebx
jmp 0x13fd
cmpb $0x0, 0x1(%rax)
jne 0x14ee
movl $0x1, %ebx
jmp 0x13fd
movl $0x2, %ebx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x64bc0(%rip), %r14     # 0x65fd8
movq %rsp, %r15
movq 0x64ba6(%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 0x14c8
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x15c4
movq %rax, %rbp
testq %rax, %rax
je 0x1482
movq %rbp, %rdi
callq 0x1080
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x1110
jmp 0x149b
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 0x1422
leaq 0x10(%rsp), %rax
cmpq %rax, %rsi
je 0x14da
movq %rsi, %rdi
callq 0x10d0
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x14ec
callq 0x10d0
xorl %ebx, %ebx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x1508
callq 0x10d0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x1522
callq 0x10d0
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x1534
callq 0x10d0
xorl %eax, %eax
testb %bl, %bl
je 0x1581
movq 0x64aaf(%rip), %rbx     # 0x65ff0
leaq 0x1acc(%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 0x15a9
callq 0x10d0
leaq 0x20(%rsp), %rdi
callq 0x1614
movq %rbx, %rdi
callq 0x1150
movq %rax, %rdi
callq 0x1609
nop