// File: ksherlock[P]wdc-utils/disassembler.cpp
// Function: disassembler::format_data(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::pair<std::string, std::string> 
disassembler::format_data(unsigned size, const std::string &data) {

	switch(size) {
		case 1: return std::make_pair("db", data);
		case 2: return std::make_pair("dw", data);
		case 3: return std::make_pair("da", data);
		case 4: return std::make_pair("dl", data);

		default: { 
			std::string tmp;
			tmp = std::to_string(size) + " bytes";
			return std::make_pair(tmp, data);

		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x148(%rbp)
movq %rdi, %rax
movq %rax, -0x140(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x138(%rbp)
subl $0x3, %eax
ja 0xd39b
movq -0x138(%rbp), %rax
leaq 0xe2e0(%rip), %rcx      # 0x1b500
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rdx
leaq 0xea00(%rip), %rsi      # 0x1bc34
leaq -0x48(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0xf1f0
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0xf140
jmp 0xd259
leaq -0x48(%rbp), %rdi
callq 0xf1d0
jmp 0xd468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xf1d0
jmp 0xd478
movq -0x20(%rbp), %rdx
leaq 0xe9ab(%rip), %rsi      # 0x1bc37
leaq -0x80(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0xf1f0
movq -0x148(%rbp), %rdi
movq -0x158(%rbp), %rsi
callq 0xf140
jmp 0xd2b1
leaq -0x80(%rbp), %rdi
callq 0xf1d0
jmp 0xd468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xf1d0
jmp 0xd478
movq -0x20(%rbp), %rdx
leaq 0xe956(%rip), %rsi      # 0x1bc3a
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0xf1f0
movq -0x148(%rbp), %rdi
movq -0x160(%rbp), %rsi
callq 0xf140
jmp 0xd30c
leaq -0xa8(%rbp), %rdi
callq 0xf1d0
jmp 0xd468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xf1d0
jmp 0xd478
movq -0x20(%rbp), %rdx
leaq 0xe8f8(%rip), %rsi      # 0x1bc3d
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0xf1f0
movq -0x148(%rbp), %rdi
movq -0x168(%rbp), %rsi
callq 0xf140
jmp 0xd36d
leaq -0xd0(%rbp), %rdi
callq 0xf1d0
jmp 0xd468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0xf1d0
jmp 0xd478
leaq -0xf0(%rbp), %rdi
callq 0x3380
movl -0x14(%rbp), %esi
leaq -0x130(%rbp), %rdi
callq 0x8980
jmp 0xd3b8
leaq 0xe881(%rip), %rdx      # 0x1bc40
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x8410
jmp 0xd3d4
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x170(%rbp)
leaq -0x110(%rbp), %rsi
movq %rsi, -0x178(%rbp)
callq 0x3310
movq -0x178(%rbp), %rdi
callq 0x3160
leaq -0x130(%rbp), %rdi
callq 0x3160
movq -0x148(%rbp), %rdi
movq -0x170(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xf230
jmp 0xd426
leaq -0xf0(%rbp), %rdi
callq 0x3160
jmp 0xd468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xd45a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3160
leaq -0xf0(%rbp), %rdi
callq 0x3160
jmp 0xd478
movq -0x140(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)