// File: tetsuok[P]kernel-pa/kernel_pa.cc
// Function: main
int main(int argc, char** argv) {
  float C = kernel::kC;
  int kernel_degree = kernel::kKernelDegree;
  int iter = kernel::kNumIter;
  string model = kernel::kModel;

  int opt;
  while ((opt = getopt(argc, argv, ":C:d:t:o:")) != -1) {
    switch (opt) {
      case 'C':
        C = atof(optarg);
        break;
      case 'd':
        kernel_degree = atoi(optarg);
        break;
      case 't':
        iter = atoi(optarg);
        break;
      case 'o':
        model = string(optarg);
        break;
      default:
        kernel::Usage(argv[0]);
    }
  }

  if (optind + 1 != argc) {
    kernel::Usage(argv[0]);
  }

  kernel::Learner learner;
  learner.SetC(C);
  learner.SetKernelDegree(kernel_degree);

  if (!learner.Train(argv[optind], iter)) {
    LOG(ERROR) << "cannot train " << argv[optind];
    return -1;
  }
  if (!learner.Save(model.c_str())) {
    LOG(ERROR) << "cannot save trained model " << model;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x3f800000, -0x14(%rbp) # imm = 0x3F800000
movl $0x2, -0x18(%rbp)
movl $0x3, -0x1c(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x2380
movq -0xf0(%rbp), %rdx
leaq 0x8a24(%rip), %rsi      # 0xb010
leaq -0x40(%rbp), %rdi
callq 0x2c10
jmp 0x25f7
leaq -0x41(%rbp), %rdi
callq 0x2200
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x8a08(%rip), %rdx      # 0xb016
callq 0x2080
movl %eax, -0x58(%rbp)
cmpl $-0x1, %eax
je 0x2757
movl -0x58(%rbp), %eax
movl %eax, -0xf4(%rbp)
subl $0x43, %eax
je 0x2673
jmp 0x262f
movl -0xf4(%rbp), %eax
subl $0x64, %eax
je 0x2690
jmp 0x263c
movl -0xf4(%rbp), %eax
subl $0x6f, %eax
je 0x26be
jmp 0x2649
movl -0xf4(%rbp), %eax
subl $0x74, %eax
je 0x26a7
jmp 0x2733
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x2200
jmp 0x2b38
movq 0xe93e(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2270
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x2752
movq 0xe921(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x18(%rbp)
jmp 0x2752
movq 0xe90a(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x1c(%rbp)
jmp 0x2752
movq 0xe8f3(%rip), %rax      # 0x10fb8
movq (%rax), %rax
movq %rax, -0x108(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x2380
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x2c10
jmp 0x26f8
leaq -0x40(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2250
leaq -0x78(%rbp), %rdi
callq 0x2130
leaq -0x79(%rbp), %rdi
callq 0x2200
jmp 0x2752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x2200
jmp 0x2b2f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2b50
jmp 0x2741
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2b2f
jmp 0x2600
movq 0xe872(%rip), %rax      # 0x10fd0
movl (%rax), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
je 0x2776
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2b50
jmp 0x2776
leaq -0xd8(%rbp), %rdi
callq 0x3030
jmp 0x2784
movss -0x14(%rbp), %xmm0
leaq -0xd8(%rbp), %rdi
callq 0x2cc0
jmp 0x2797
movl -0x18(%rbp), %esi
leaq -0xd8(%rbp), %rdi
callq 0x2ce0
jmp 0x27a8
movq -0x10(%rbp), %rax
movq 0xe81d(%rip), %rcx      # 0x10fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
leaq -0xd8(%rbp), %rdi
callq 0x36a0
movb %al, -0x109(%rbp)
jmp 0x27d1
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x296c
jmp 0x27e1
leaq -0xdc(%rbp), %rdi
movl $0x2, %esi
callq 0x2d00
jmp 0x27f4
callq 0x2d30
movq %rax, -0x118(%rbp)
jmp 0x2802
movq -0x118(%rbp), %rdi
leaq 0x8810(%rip), %rsi      # 0xb020
callq 0x21b0
movq %rax, -0x120(%rbp)
jmp 0x281e
movq -0x120(%rbp), %rdi
leaq 0x87f9(%rip), %rsi      # 0xb025
callq 0x21b0
movq %rax, -0x128(%rbp)
jmp 0x283a
movq -0x128(%rbp), %rdi
leaq 0x87e3(%rip), %rsi      # 0xb02b
callq 0x21b0
movq %rax, -0x130(%rbp)
jmp 0x2856
movq -0x130(%rbp), %rdi
leaq 0x87cb(%rip), %rsi      # 0xb02f
callq 0x21b0
movq %rax, -0x138(%rbp)
jmp 0x2872
movq -0x138(%rbp), %rdi
leaq 0x87a3(%rip), %rsi      # 0xb023
callq 0x21b0
movq %rax, -0x140(%rbp)
jmp 0x288e
movq -0x140(%rbp), %rdi
movl $0x45, %esi
callq 0x2360
movq %rax, -0x148(%rbp)
jmp 0x28a8
movq -0x148(%rbp), %rdi
leaq 0x8786(%rip), %rsi      # 0xb03c
callq 0x21b0
movq %rax, -0x150(%rbp)
jmp 0x28c4
movq -0x150(%rbp), %rdi
leaq 0x876d(%rip), %rsi      # 0xb03f
callq 0x21b0
movq %rax, -0x158(%rbp)
jmp 0x28e0
movq -0x158(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xe6de(%rip), %rcx      # 0x10fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x21b0
movq %rax, -0x160(%rbp)
jmp 0x2907
movq -0x160(%rbp), %rsi
leaq -0xdc(%rbp), %rdi
callq 0x2d20
jmp 0x291c
leaq -0xdc(%rbp), %rdi
callq 0x2d40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0xe0(%rbp)
jmp 0x2b02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2b23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xdc(%rbp), %rdi
callq 0x2d40
jmp 0x2b23
leaq -0x40(%rbp), %rdi
callq 0x20e0
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0x3f90
movb %al, -0x161(%rbp)
jmp 0x298c
movb -0x161(%rbp), %al
testb $0x1, %al
jne 0x2af1
jmp 0x299c
leaq -0xe4(%rbp), %rdi
movl $0x2, %esi
callq 0x2d00
jmp 0x29af
callq 0x2d30
movq %rax, -0x170(%rbp)
jmp 0x29bd
movq -0x170(%rbp), %rdi
leaq 0x8655(%rip), %rsi      # 0xb020
callq 0x21b0
movq %rax, -0x178(%rbp)
jmp 0x29d9
movq -0x178(%rbp), %rdi
leaq 0x863e(%rip), %rsi      # 0xb025
callq 0x21b0
movq %rax, -0x180(%rbp)
jmp 0x29f5
movq -0x180(%rbp), %rdi
leaq 0x8628(%rip), %rsi      # 0xb02b
callq 0x21b0
movq %rax, -0x188(%rbp)
jmp 0x2a11
movq -0x188(%rbp), %rdi
leaq 0x8610(%rip), %rsi      # 0xb02f
callq 0x21b0
movq %rax, -0x190(%rbp)
jmp 0x2a2d
movq -0x190(%rbp), %rdi
leaq 0x85e8(%rip), %rsi      # 0xb023
callq 0x21b0
movq %rax, -0x198(%rbp)
jmp 0x2a49
movq -0x198(%rbp), %rdi
movl $0x49, %esi
callq 0x2360
movq %rax, -0x1a0(%rbp)
jmp 0x2a63
movq -0x1a0(%rbp), %rdi
leaq 0x85cb(%rip), %rsi      # 0xb03c
callq 0x21b0
movq %rax, -0x1a8(%rbp)
jmp 0x2a7f
movq -0x1a8(%rbp), %rdi
leaq 0x85c0(%rip), %rsi      # 0xb04d
callq 0x21b0
movq %rax, -0x1b0(%rbp)
jmp 0x2a9b
movq -0x1b0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x21a0
movq %rax, -0x1b8(%rbp)
jmp 0x2ab4
movq -0x1b8(%rbp), %rsi
leaq -0xe4(%rbp), %rdi
callq 0x2d20
jmp 0x2ac9
leaq -0xe4(%rbp), %rdi
callq 0x2d40
jmp 0x2af1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe4(%rbp), %rdi
callq 0x2d40
jmp 0x2b23
movl $0x0, -0x4(%rbp)
movl $0x1, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3090
leaq -0x40(%rbp), %rdi
callq 0x2130
movl -0x4(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
leaq -0xd8(%rbp), %rdi
callq 0x3090
leaq -0x40(%rbp), %rdi
callq 0x2130
movq -0x50(%rbp), %rdi
callq 0x2370
nopw %cs:(%rax,%rax)