// File: Neuromancer2701[P]OpenTool/src/Header.cpp
// Function: Header::Packup()
void Header::Packup()	{

	int Spare = HeaderTotalLength - (Length_Size + Number_Size + Revision_Size + StationID_Size + SpindleID_Size);
	OutputStream << ""; //clear string stream

	OutputStream << std::setw(Length_Size) << std::setfill('0') << Length;

	OutputStream << std::setw(Number_Size) << std::setfill('0') << Number;

	OutputStream << std::setw(Revision_Size) << std::setfill('0') << Revision;

	OutputStream << std::setw(NoAckFlag_Size) << std::setfill('0') << static_cast<int>(NoAckFlag);

	OutputStream << std::setw(StationID_Size) << std::setfill('0') << StationID;

	OutputStream << std::setw(SpindleID_Size) << std::setfill('0') << SpindleID;

	OutputStream << std::setw(Spare) << std::setfill('0') << 0 << std::endl; // Fill rest of header


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x60(%rbp)
movl $0x6, -0xc(%rbp)
addq $0x190, %rdi            # imm = 0x190
addq $0x10, %rdi
leaq 0x528d(%rip), %rsi      # 0x132ad
callq 0xa890
movq -0x60(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0xc0(%rbp)
movl $0x4, %edi
callq 0xb070
movq -0xc0(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0xa970
movq %rax, -0xb8(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0xb8(%rbp), %rdi
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x318(%rax), %esi
callq 0xae10
movq -0x60(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0xb0(%rbp)
movl $0x4, %edi
callq 0xb070
movq -0xb0(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0xa970
movq %rax, -0xa8(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0xa8(%rbp), %rdi
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x31c(%rax), %esi
callq 0xb020
movq -0x60(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0xa0(%rbp)
movl $0x3, %edi
callq 0xb070
movq -0xa0(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0xa970
movq %rax, -0x98(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x98(%rbp), %rdi
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x320(%rax), %esi
callq 0xa9a0
movq -0x60(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0x90(%rbp)
movl $0x1, %edi
callq 0xb070
movq -0x90(%rbp), %rdi
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %esi
callq 0xa970
movq %rax, -0x88(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x88(%rbp), %rdi
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x60(%rbp), %rax
movb 0x324(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0xae10
movq -0x60(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0x80(%rbp)
movl $0x1, %edi
callq 0xb070
movq -0x80(%rbp), %rdi
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %esi
callq 0xa970
movq %rax, -0x78(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x78(%rbp), %rdi
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x328(%rax), %esi
callq 0xae10
movq -0x60(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0x70(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x70(%rbp), %rdi
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %esi
callq 0xa970
movq %rax, -0x68(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x68(%rbp), %rdi
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x32c(%rax), %esi
callq 0xae10
movq -0x60(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0x58(%rbp)
movl -0xc(%rbp), %edi
callq 0xb070
movq -0x58(%rbp), %rdi
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %esi
callq 0xa970
movq %rax, -0x50(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x50(%rbp), %rdi
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %esi
callq 0xad00
movq %rax, %rdi
xorl %esi, %esi
callq 0xae10
movq %rax, %rdi
movq 0x9c69(%rip), %rsi      # 0x17f40
callq 0xa8e0
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)