// File: /workspace/github_cpp_makefile_star2_O3/ksherlock[P]wdc-utils/disassembler.cpp
// Function: disassembler::space(unsigned int)
void disassembler::space(unsigned size) {
	flush();

	std::string line;

	indent_to(line, kOpcodeTab);
	line += ds();
	indent_to(line, kOperandTab);


	while (size) {
		uint32_t chunk;
		if (_next_label == -1) chunk = size;
		else {
			chunk = _next_label - _pc;
			chunk = std::min(chunk, size);
		}

		line.resize(kOperandTab);
		line += std::to_string(chunk);
		indent_to(line, kCommentTab);
		line += "; ";

		line += to_x(_pc, 4);
		line.push_back(':');
		line.push_back('\n');
		fputs(line.c_str(), stdout);	


		_pc += chunk;
		size -= chunk;
		if (_next_label == _pc) _next_label = next_label(_pc);
	}


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
movq %rdi, %r14
callq 0x81ae
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x28(%rsp), %rdi
movl $0x14, %esi
movl $0x20, %edx
callq 0x2080
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq *0x30(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x2090
leaq 0x18(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x827d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
cmpq $0x1d, 0x30(%rsp)
ja 0x8299
leaq 0x28(%rsp), %rdi
movl $0x1e, %esi
movl $0x20, %edx
callq 0x2080
testl %ebx, %ebx
je 0x8421
movl 0x30(%r14), %eax
leaq 0x28(%rsp), %r15
movl $0xd1b71759, %r12d      # imm = 0xD1B71759
movl %eax, %ebp
subl 0x20(%r14), %ebp
cmpl %ebp, %ebx
cmovbl %ebx, %ebp
cmpl $-0x1, %eax
cmovel %ebx, %ebp
movl $0x1e, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x2080
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0x8319
movl $0x4, %eax
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x8312
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x8317
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x8319
movl %ecx, %edx
imulq %r12, %rdx
shrq $0x2d, %rdx
addl $0x4, %eax
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x82e1
addl $-0x3, %eax
jmp 0x8319
addl $-0x2, %eax
jmp 0x8319
decl %eax
movl %eax, %esi
movq %r13, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x2200
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %esi
movl %ebp, %edx
callq 0x6961
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x2090
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x8365
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
cmpq $0x4f, 0x30(%rsp)
ja 0x837f
movl $0x50, %esi
movq %r15, %rdi
movl $0x20, %edx
callq 0x2080
movq %r15, %rdi
leaq 0x7900(%rip), %rsi      # 0xfc89
callq 0x2320
movl 0x20(%r14), %esi
leaq 0x8(%rsp), %rdi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x73f8
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x2090
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x83cc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %r15, %rdi
movl $0x3a, %esi
callq 0x2180
movq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movq 0x28(%rsp), %rdi
movq 0xbbd6(%rip), %rax      # 0x13fc8
movq (%rax), %rsi
callq 0x21e0
movl 0x20(%r14), %esi
addl %ebp, %esi
movl %esi, 0x20(%r14)
movl 0x30(%r14), %eax
cmpl %esi, %eax
jne 0x8419
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
movl %eax, 0x30(%r14)
subl %ebp, %ebx
jne 0x82b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x843d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x8476
jmp 0x8488
jmp 0x8485
jmp 0x8485
jmp 0x8485
jmp 0x8469
jmp 0x8485
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x8488
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x8488
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x84a4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x22c0