// File: /workspace/github_cpp_makefile_star2_O3/CastellanZhang[P]lambdaFM/lambdafm_train.cpp
// Function: main
int main(int argc, char* argv[])
{
    cin.sync_with_stdio(false);
    cout.sync_with_stdio(false);
    srand(time(NULL));
    trainer_option opt;
    try
    {
        opt.parse_option(argv_to_args(argc, argv));
    }
    catch(const invalid_argument& e)
    {
        cout << "invalid_argument:" << e.what() << endl;
        cout << train_help() << endl;
        return EXIT_FAILURE;
    }

    ftrl_trainer trainer(opt);

    if(opt.b_init) 
    {
        ifstream f_temp(opt.init_m_path.c_str());
        if(!trainer.loadModel(f_temp)) 
        {
            cout << "wrong model" << endl;
            return EXIT_FAILURE;
        }
        f_temp.close();
    }

    pc_frame frame;
    frame.init(trainer, opt.threads_num);
    frame.run();

    ofstream f_model(opt.model_path.c_str(), ofstream::out);
    trainer.outputModel(f_model);
    f_model.close();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rsi, %rbx
movl %edi, %ebp
xorl %edi, %edi
callq 0x3110
xorl %edi, %edi
callq 0x3110
xorl %edi, %edi
callq 0x3290
movl %eax, %edi
callq 0x32b0
leaq 0x8(%rsp), %rdi
callq 0x6e10
leaq 0x168(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x5e98
leaq 0x8(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x6eea
leaq 0x168(%rsp), %rdi
callq 0x6956
leaq 0xd0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3e80
cmpb $0x1, 0xa1(%rsp)
jne 0x6018
movq 0x28(%rsp), %rsi
leaq 0x168(%rsp), %rdi
movl $0x8, %edx
callq 0x34b0
movq 0xd8(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x3d08
testb %al, %al
je 0x6127
leaq 0x168(%rsp), %rdi
callq 0x3080
leaq 0x168(%rsp), %rdi
callq 0x3090
xorps %xmm0, %xmm0
leaq 0x3e8(%rsp), %r14
movups %xmm0, -0x58(%r14)
movups %xmm0, -0x68(%r14)
movq $0x0, -0x48(%r14)
movups %xmm0, (%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x40(%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x7fbc
leaq 0x438(%rsp), %r15
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movl 0x98(%rsp), %edx
leaq 0x370(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movl $0x1388, %ecx           # imm = 0x1388
movl $0x30d40, %r8d          # imm = 0x30D40
callq 0x975c
leaq 0x370(%rsp), %rdi
callq 0x9cfa
movq 0x8(%rsp), %rsi
leaq 0x168(%rsp), %rdi
movl $0x10, %edx
callq 0x3320
movq 0xd8(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x3bec
leaq 0x168(%rsp), %rdi
callq 0x3370
movq 0xaed6(%rip), %rax      # 0x10fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x170(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x168(%rsp,%rcx)
callq 0x3250
leaq 0x260(%rsp), %rdi
callq 0x30d0
movq %r15, %rdi
callq 0x815c
movq %r14, %rdi
callq 0x8190
xorl %ebx, %ebx
jmp 0x617f
movq 0xae92(%rip), %rbx      # 0x10fc0
leaq 0x642a(%rip), %rsi      # 0xc55f
movl $0xb, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x32c0
movsbl %al, %esi
movq 0xae60(%rip), %rdi      # 0x10fc0
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq 0x168(%rsp), %rdi
callq 0x3090
movl $0x1, %ebx
leaq 0xab92(%rip), %rax      # 0x10d18
movq %rax, 0xd0(%rsp)
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0x61a0
callq 0x32a0
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61b6
callq 0x32a0
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61cc
callq 0x32a0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61df
callq 0x32a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61f2
callq 0x32a0
movl %ebx, %eax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6209
jmp 0x632f
movq %rax, %rbx
jmp 0x6354
movq %rax, %rbx
jmp 0x6361
movq %rdx, %r14
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x6956
jmp 0x6234
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x6361
movq %rbx, %rdi
callq 0x3100
movq %rax, %rbx
movq 0xad70(%rip), %rdi      # 0x10fc0
leaq 0x62f6(%rip), %rsi      # 0xc54d
movl $0x11, %edx
callq 0x3330
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0xad4f(%rip), %rdi      # 0x10fc0
movq %rax, %rsi
callq 0x32d0
movq %rax, %rdi
callq 0x3130
leaq 0x178(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5e03(%rip), %rsi      # 0xc097
leaq 0x62b1(%rip), %rdx      # 0xc54c
leaq 0x168(%rsp), %rdi
callq 0x845a
movq 0x168(%rsp), %rsi
movq 0x170(%rsp), %rdx
movq 0xad01(%rip), %rdi      # 0x10fc0
callq 0x3330
movq %rax, %rdi
callq 0x3130
movq 0x168(%rsp), %rdi
cmpq %r14, %rdi
je 0x62de
callq 0x32a0
movl $0x1, %ebx
callq 0x3410
jmp 0x61b6
jmp 0x6211
jmp 0x630b
movq %rax, %rbx
movq 0x168(%rsp), %rdi
cmpq %r14, %rdi
je 0x630e
callq 0x32a0
jmp 0x630e
movq %rax, %rbx
callq 0x3410
jmp 0x6361
movq %rax, %rdi
callq 0x7d0e
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x33b0
jmp 0x6332
movq %rax, %rbx
movq %r15, %rdi
callq 0x815c
movq %r14, %rdi
callq 0x8190
jmp 0x6354
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x3090
leaq 0xd0(%rsp), %rdi
callq 0x7d1a
leaq 0x8(%rsp), %rdi
callq 0x7d4e
movq %rbx, %rdi
callq 0x3470
nop