// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
cmpl $0x2, %edi
jne 0x1447
leaq 0x1dc7(%rip), %rax      # 0x3070
leaq 0xc8(%rsp), %rcx
movq %rax, -0xa0(%rcx)
movl $0x102, -0x98(%rcx)     # imm = 0x102
leaq 0x3fe67(%rip), %rdx     # 0x41130
movq %rdx, -0x90(%rcx)
movq %rax, -0x88(%rcx)
movl $0x103, -0x80(%rcx)     # imm = 0x103
movq %rdx, -0x78(%rcx)
movq %rax, -0x70(%rcx)
movl $0x101, -0x68(%rcx)     # imm = 0x101
movq %rdx, -0x60(%rcx)
movq %rax, -0x58(%rcx)
movl $0x105, -0x50(%rcx)     # imm = 0x105
andq $0x0, -0x48(%rcx)
movq %rax, -0x40(%rcx)
movl $0x106, -0x38(%rcx)     # imm = 0x106
andq $0x0, -0x30(%rcx)
movq %rax, -0x28(%rcx)
movl $0x104, -0x20(%rcx)     # imm = 0x104
andq $0x0, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %ebx, %ebx
movb %bl, (%rcx)
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %bl, (%rax)
leaq 0x108(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %bl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
andq $0x0, 0x20(%rax)
movq 0x8(%rsi), %r14
leaq 0x1cc1(%rip), %rsi      # 0x302c
movq %r14, %rdi
callq 0x127c
testb %al, %al
jne 0x13bf
leaq 0x1cb1(%rip), %rsi      # 0x302f
movq %r14, %rdi
callq 0x127c
testb %al, %al
je 0x138e
pushq $0x1
jmp 0x13be
leaq 0x1c96(%rip), %rsi      # 0x302b
movq %r14, %rdi
callq 0x127c
testb %al, %al
je 0x13a5
pushq $0x2
jmp 0x13be
leaq 0x1c82(%rip), %rsi      # 0x302e
movq %r14, %rdi
callq 0x127c
testb %al, %al
je 0x143d
pushq $0x3
popq %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x65c01(%rip), %r14     # 0x66fd8
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %r12
movq 0x65be0(%rip), %r13     # 0x66fc8
movq %r14, %rdi
movq %r15, %rsi
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1425
movq 0x8(%rsp), %rsi
movq %r12, %rdi
movl %ebx, %edx
callq 0x14a4
movq %r13, %rdi
movq %rax, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1080
jmp 0x13e8
leaq 0x8(%rsp), %rdi
callq 0x1100
leaq 0x28(%rsp), %rdi
callq 0x14de
xorl %ebx, %ebx
jmp 0x1465
leaq 0x28(%rsp), %rdi
callq 0x14de
pushq $0x1
popq %rbx
movq 0x65b9f(%rip), %rdi     # 0x66ff0
leaq 0x1bbc(%rip), %rsi      # 0x3014
callq 0x10e0
movq %rax, %rdi
callq 0x1080
movl %ebx, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x148a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1100
leaq 0x28(%rsp), %rdi
callq 0x14de
movq %rbx, %rdi
callq 0x1140
movq %rax, %rdi
callq 0x14d3