// File: /workspace/github_cpp_makefile_star2_O1/xjrueda[P]fixprime/src/Message.cpp
// Function: fprime::Message::toFix[abi:cxx11]()
string Message::toFix() {
        string strHeader, strBody, strTrailer, strDummy;

        unsigned int bodyLength = 0;
        unsigned int dummy = 0;
        bool isBody = false;

        header->stringify(strDummy, isBody, bodyLength);
        body->stringify(strBody, isBody, bodyLength);
        header->getChild(9)->setValue(boost::lexical_cast<string>(bodyLength));
        header->stringify(strHeader, isBody, dummy);
        trailer->stringify(strTrailer, isBody, dummy);

        //calculate checksum
        fprime::FixParser fparser;
        unsigned int checkSum = fparser.checkSum(strHeader + strBody + strTrailer);
        
        stringstream ssCheckSum;
        ssCheckSum << std::setw (3) << std::setfill('0')<< checkSum;
        trailer->getChild(10)->setValue(ssCheckSum.str());
        isBody = false;
        strTrailer.clear();
        trailer->stringify(strTrailer, isBody, dummy);
        return strHeader + strBody + strTrailer;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x60(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x40(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x120(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
movl %eax, 0x8(%rsp)
leaq 0x7(%rsp), %rdx
movb %al, (%rdx)
movq 0x8(%rsi), %rdi
leaq 0x110(%rsp), %rsi
callq 0x2e120
movq 0x18(%r14), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x2e120
movq 0x8(%r14), %rsi
leaq 0x10(%rsp), %rdi
movl $0x9, %edx
callq 0x2f9d0
movq 0x10(%rsp), %r15
leaq 0xc0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
leaq 0x132(%rsp), %rax
movq %rax, 0x16(%rax)
leaq 0x146(%rsp), %r12
movq %r12, 0xa(%r12)
movl 0xc(%rsp), %eax
leaq 0xd0(%rsp), %rdi
movl %eax, (%rdi)
movq %r12, 0x8(%rdi)
movb $0x30, 0x10(%rdi)
movl $0x30, 0x14(%rdi)
callq 0x30050
movq %rax, 0x148(%rsp)
movq %r12, 0x150(%rsp)
leaq 0xb0(%rsp), %rdi
movq 0x8(%rdi), %rdx
subq %rax, %r12
xorl %esi, %esi
movq %rax, %rcx
movq %r12, %r8
callq 0x2fae0
leaq 0xb0(%rsp), %rsi
movq %r15, %rdi
callq 0x2ecf0
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3de53
callq 0x2f6c0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3de62
callq 0x2f370
movq 0x8(%r14), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x2e120
movq 0x28(%r14), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x2e120
leaq 0xd0(%rsp), %rdi
callq 0x2ea90
leaq 0x130(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x30f00
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x130(%rsp), %rdi
callq 0x2e660
leaq 0xa0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3defd
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0x3df04
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x90(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd0(%rsp), %rdi
callq 0x2fd70
movl %eax, %ebp
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0x3df44
callq 0x2f6c0
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3df5a
callq 0x2f6c0
leaq 0x130(%rsp), %rdi
callq 0x2f130
movq 0x140(%rsp), %rax
movq -0x18(%rax), %rcx
movq $0x3, 0x150(%rsp,%rcx)
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %r15
addq $0x140, %r15            # imm = 0x140
cmpb $0x0, 0xe1(%r15)
jne 0x3dfb4
movq %r15, %rdi
movl $0x20, %esi
callq 0x2f710
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
leaq 0x140(%rsp), %rdi
movb $0x30, 0xe0(%r15)
movzbl %bpl, %esi
callq 0x2f090
movq 0x28(%r14), %rsi
leaq 0x10(%rsp), %rdi
movl $0xa, %edx
callq 0x2f9d0
movq 0x10(%rsp), %r15
leaq 0x148(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x305d0
leaq 0xf0(%rsp), %rsi
movq %r15, %rdi
callq 0x2ecf0
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3e020
callq 0x2f6c0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3e02f
callq 0x2f370
xorl %eax, %eax
leaq 0x7(%rsp), %rdx
movb %al, (%rdx)
leaq 0x30(%rsp), %rsi
movq $0x0, 0x8(%rsi)
movq (%rsi), %rcx
movb %al, (%rcx)
movq 0x28(%r14), %rdi
leaq 0x8(%rsp), %rcx
callq 0x2e120
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x30f00
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x2e660
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x3e0a2
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x3e0a8
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3e0d2
callq 0x2f6c0
movq 0x33ba7(%rip), %rsi     # 0x71c80
leaq 0x130(%rsp), %rdi
callq 0x2f190
leaq 0x1b0(%rsp), %rdi
callq 0x2e700
leaq 0xd0(%rsp), %rdi
callq 0x2fa00
movq 0x110(%rsp), %rdi
cmpq %r13, %rdi
je 0x3e112
callq 0x2f6c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3e126
callq 0x2f6c0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3e13a
callq 0x2f6c0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x3e151
callq 0x2f6c0
movq %rbx, %rax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3e223
callq 0x2f6c0
jmp 0x3e223
jmp 0x3e220
movq %rax, %rbx
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3e1a8
callq 0x2f6c0
jmp 0x3e1a8
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3e223
callq 0x2f370
jmp 0x3e223
jmp 0x3e220
jmp 0x3e1ef
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0x3e1d7
callq 0x2f6c0
jmp 0x3e1d7
movq %rax, %rbx
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3e244
callq 0x2f6c0
jmp 0x3e244
movq %rax, %rbx
jmp 0x3e244
jmp 0x3e253
jmp 0x3e1fa
jmp 0x3e253
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3e20f
callq 0x2f6c0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3e256
callq 0x2f370
jmp 0x3e256
movq %rax, %rbx
movq 0x33a56(%rip), %rsi     # 0x71c80
leaq 0x130(%rsp), %rdi
callq 0x2f190
leaq 0x1b0(%rsp), %rdi
callq 0x2e700
leaq 0xd0(%rsp), %rdi
callq 0x2fa00
jmp 0x3e256
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r13, %rdi
je 0x3e268
callq 0x2f6c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3e27c
callq 0x2f6c0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3e290
callq 0x2f6c0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x3e2a7
callq 0x2f6c0
movq %rbx, %rdi
callq 0x30a20
nop