// File: mororo18[P]simplex-method/src/model.cpp
// Function: Model::obj_func::output_generate[abi:cxx11]()
std::string Model::obj_func::output_generate(){
    std::string output;

    std::string func = "Z = ";
    std::string opt1;
    std::string opt2;
    std::string opt3;
    
    //std::cout << func;
    //output.append(func);
    output = func;

    for(int i = 0; i < coef.size(); i++){
        std::stringstream coef_stream;
        coef_stream << std::setprecision(OUT_PRECISION) << coef[i];

        std::string coef_str = coef_stream.str();

        opt1 = " " + coef_str + " " + var_name[i];
        opt2 = " + " + coef_str + " " + var_name[i];
        opt3 = coef_str + " " + var_name[i];

        if(coef[i] < 0){
            //std::cout << opt1;
            output.append(opt1);
        }else if(i != 0){
            //std::cout << " + " << coef[i] << " " << var_name[i];
            //std::cout << opt2;
            output.append(opt2);
        }else{
            //std::cout << coef[i] << " " << var_name[i];
            //std::cout << opt3;
            output.append(opt3);
        }
    }
    //std::cout << std::endl;
    output.append("\n");

    //std::cout << output;

    return output;
}

// Assembly:
subq $0x3b8, %rsp            # imm = 0x3B8
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0x3b0(%rsp)
movq %rsi, 0x3a8(%rsp)
movq 0x3a8(%rsp), %rax
movq %rax, 0x40(%rsp)
movb $0x0, 0x3a7(%rsp)
callq 0x2290
leaq 0x37f(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x2360
movq 0x48(%rsp), %rdx
leaq 0xbe08(%rip), %rsi      # 0x1b594
leaq 0x380(%rsp), %rdi
callq 0x2280
jmp 0xf79b
leaq 0x37f(%rsp), %rdi
callq 0x2220
leaq 0x348(%rsp), %rdi
callq 0x2290
leaq 0x328(%rsp), %rdi
callq 0x2290
leaq 0x308(%rsp), %rdi
callq 0x2290
movq 0x30(%rsp), %rdi
leaq 0x380(%rsp), %rsi
callq 0x2040
jmp 0xf7e3
movl $0x0, 0x304(%rsp)
movq 0x40(%rsp), %rdi
movslq 0x304(%rsp), %rax
movq %rax, 0x28(%rsp)
addq $0x20, %rdi
callq 0x6420
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0xfc46
leaq 0x178(%rsp), %rdi
callq 0x2170
jmp 0xf829
leaq 0x188(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0x5, %edi
callq 0x11640
movl %eax, 0x24(%rsp)
jmp 0xf846
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0x174(%rsp)
movl 0x174(%rsp), %esi
callq 0x22f0
movq %rax, 0x10(%rsp)
jmp 0xf869
movq 0x40(%rsp), %rdi
addq $0x20, %rdi
movslq 0x304(%rsp), %rsi
callq 0x109f0
movq 0x10(%rsp), %rdi
movsd (%rax), %xmm0
callq 0x2370
jmp 0xf88f
leaq 0x150(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x21e0
jmp 0xf8a6
leaq 0xbb4d(%rip), %rsi      # 0x1b3fa
leaq 0xf0(%rsp), %rdi
leaq 0x150(%rsp), %rdx
callq 0x117a0
jmp 0xf8c4
leaq 0xbb2f(%rip), %rdx      # 0x1b3fa
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x11750
jmp 0xf8e2
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movslq 0x304(%rsp), %rsi
callq 0x11ff0
movq %rax, %rdx
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x11b30
jmp 0xf912
leaq 0x348(%rsp), %rdi
leaq 0x130(%rsp), %rsi
movq %rsi, 0x8(%rsp)
callq 0x2250
movq 0x8(%rsp), %rdi
callq 0x2140
leaq 0x110(%rsp), %rdi
callq 0x2140
leaq 0xf0(%rsp), %rdi
callq 0x2140
leaq 0xbaa5(%rip), %rsi      # 0x1b3fc
leaq 0x90(%rsp), %rdi
leaq 0x150(%rsp), %rdx
callq 0x117a0
jmp 0xf96e
leaq 0xba85(%rip), %rdx      # 0x1b3fa
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x11750
jmp 0xf98c
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movslq 0x304(%rsp), %rsi
callq 0x11ff0
movq %rax, %rdx
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x11b30
jmp 0xf9bc
leaq 0x328(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %rsi, (%rsp)
callq 0x2250
movq (%rsp), %rdi
callq 0x2140
leaq 0xb0(%rsp), %rdi
callq 0x2140
leaq 0x90(%rsp), %rdi
callq 0x2140
leaq 0xb9fb(%rip), %rdx      # 0x1b3fa
leaq 0x50(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x118d0
jmp 0xfa13
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movslq 0x304(%rsp), %rsi
callq 0x11ff0
movq %rax, %rdx
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x11b30
jmp 0xfa3d
leaq 0x308(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x2250
leaq 0x70(%rsp), %rdi
callq 0x2140
leaq 0x50(%rsp), %rdi
callq 0x2140
movq 0x40(%rsp), %rdi
addq $0x20, %rdi
movslq 0x304(%rsp), %rsi
callq 0x109f0
xorps %xmm0, %xmm0
ucomisd (%rax), %xmm0
jbe 0xfbc2
movq 0x30(%rsp), %rdi
leaq 0x348(%rsp), %rsi
callq 0x2390
jmp 0xfa9a
jmp 0xfbfa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
leaq 0x37f(%rsp), %rdi
callq 0x2220
jmp 0xfcee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
jmp 0xfca1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
jmp 0xfc37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
jmp 0xfc2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
jmp 0xfb47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x2140
leaq 0xf0(%rsp), %rdi
callq 0x2140
jmp 0xfc2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
jmp 0xfb90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x2140
leaq 0x90(%rsp), %rdi
callq 0x2140
jmp 0xfc2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x370(%rsp)
movl %eax, 0x36c(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x2140
jmp 0xfc2a
cmpl $0x0, 0x304(%rsp)
je 0xfbe2
movq 0x30(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x2390
jmp 0xfbe0
jmp 0xfbf8
movq 0x30(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x2390
jmp 0xfbf6
jmp 0xfbf8
jmp 0xfbfa
leaq 0x150(%rsp), %rdi
callq 0x2140
leaq 0x178(%rsp), %rdi
callq 0x2180
movl 0x304(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x304(%rsp)
jmp 0xf7ee
leaq 0x150(%rsp), %rdi
callq 0x2140
leaq 0x178(%rsp), %rdi
callq 0x2180
jmp 0xfca1
movq 0x30(%rsp), %rdi
leaq 0xb85e(%rip), %rsi      # 0x1b4b0
callq 0x2380
jmp 0xfc59
movb $0x1, 0x3a7(%rsp)
leaq 0x308(%rsp), %rdi
callq 0x2140
leaq 0x328(%rsp), %rdi
callq 0x2140
leaq 0x348(%rsp), %rdi
callq 0x2140
leaq 0x380(%rsp), %rdi
callq 0x2140
testb $0x1, 0x3a7(%rsp)
jne 0xfce1
jmp 0xfcd7
leaq 0x308(%rsp), %rdi
callq 0x2140
leaq 0x328(%rsp), %rdi
callq 0x2140
leaq 0x348(%rsp), %rdi
callq 0x2140
leaq 0x380(%rsp), %rdi
callq 0x2140
jmp 0xfcee
movq 0x30(%rsp), %rdi
callq 0x2140
movq 0x38(%rsp), %rax
addq $0x3b8, %rsp            # imm = 0x3B8
retq
movq 0x30(%rsp), %rdi
callq 0x2140
movq 0x370(%rsp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)