// File: ksherlock[P]wdc-utils/zrdz_disassembler.cpp
// Function: zrdz_disassembler::print_globals(int)
void zrdz_disassembler::print_globals(int section) {

	std::vector<std::string> tmp;

	for (auto &s : _symbols) {
		if (s.section == section && s.flags & SF_GBL) tmp.push_back(s.name);
	}

	if (tmp.empty()) return;
	std::sort(tmp.begin(), tmp.end());
	for (const auto &s : tmp) emit("", "public", s);
	putchar('\n');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8280
movq -0xe0(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa6a0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa490
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x15c30
testb $0x1, %al
jne 0x12f32
jmp 0x12f8b
leaq -0x38(%rbp), %rdi
callq 0xab10
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzbl 0x22(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x12f7e
movq -0x48(%rbp), %rax
movzbl 0x21(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x12f7e
movq -0x48(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x15ec0
jmp 0x12f6b
jmp 0x12f7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x13158
jmp 0x12f80
leaq -0x38(%rbp), %rdi
callq 0x15cf0
jmp 0x12f1f
leaq -0x28(%rbp), %rdi
callq 0x8570
testb $0x1, %al
jne 0x12f9a
jmp 0x12fa6
movl $0x1, -0x58(%rbp)
jmp 0x13146
leaq -0x28(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0xc5e0
movq -0xe8(%rbp), %rdi
movq %rax, -0x60(%rbp)
callq 0xc460
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x15f30
jmp 0x12fd9
leaq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xc5e0
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0xc460
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x15f70
testb $0x1, %al
jne 0x13011
jmp 0x13133
leaq -0x78(%rbp), %rdi
callq 0xcaf0
movq %rax, -0x88(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x3460
movq -0xf0(%rbp), %rdx
leaq 0x8332(%rip), %rsi      # 0x1b374
leaq -0xa8(%rbp), %rdi
callq 0x8060
jmp 0x13050
leaq -0xd1(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x3460
movq -0xf8(%rbp), %rdx
leaq 0x8cbd(%rip), %rsi      # 0x1bd2e
leaq -0xd0(%rbp), %rdi
callq 0x8060
jmp 0x1307f
movq -0x88(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xce40
jmp 0x1309b
leaq -0xd0(%rbp), %rdi
callq 0x3160
leaq -0xd1(%rbp), %rdi
callq 0x32b0
leaq -0xa8(%rbp), %rdi
callq 0x3160
leaq -0xa9(%rbp), %rdi
callq 0x32b0
leaq -0x78(%rbp), %rdi
callq 0x15fb0
jmp 0x12ffb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x13125
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1310d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x3160
leaq -0xd1(%rbp), %rdi
callq 0x32b0
leaq -0xa8(%rbp), %rdi
callq 0x3160
leaq -0xa9(%rbp), %rdi
callq 0x32b0
jmp 0x13158
movl $0xa, %edi
callq 0x3390
jmp 0x1313f
movl $0x0, -0x58(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8740
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x8740
movq -0x50(%rbp), %rdi
callq 0x3440
nopw (%rax,%rax)