// File: estwings57[P]CasHMC/sources/CasHMCWrapper.cpp
// Function: CasHMC::CasHMCWrapper::DataScaling[abi:cxx11](double)
string CasHMCWrapper::DataScaling(double dataScale)
{
	string outStr;
	char unitChar[5] = {' ','K','M','G','T'};
	
	int unitScale = 0;
	while(dataScale > 1024) {
		unitScale++;
		dataScale /= 1024;
		if(unitScale > 4)	break;
	}
	
	stringstream scaledData;
	scaledData<<ALI(7)<<dataScale;
	outStr = scaledData.str() + " " + unitChar[unitScale] + "B";
	return outStr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x258(%rbp)
movq %rdi, %rax
movq %rax, -0x250(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x44f0
movl 0x3b3fc(%rip), %eax     # 0x510f4
movl %eax, -0x1e(%rbp)
movb 0x3b3f7(%rip), %al      # 0x510f8
movb %al, -0x1a(%rbp)
movl $0x0, -0x24(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x3b3c0(%rip), %xmm1    # 0x510d8
ucomisd %xmm1, %xmm0
jbe 0x15d47
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x3b3a4(%rip), %xmm1    # 0x510d8
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
cmpl $0x4, -0x24(%rbp)
jle 0x15d45
jmp 0x15d47
jmp 0x15d0b
leaq -0x1b0(%rbp), %rdi
callq 0x4270
jmp 0x15d55
leaq -0x1a0(%rbp), %rax
movq %rax, -0x268(%rbp)
movl $0x7, %edi
callq 0x177b0
movl %eax, -0x25c(%rbp)
jmp 0x15d75
movq -0x268(%rbp), %rdi
movl -0x25c(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movl -0x1c0(%rbp), %esi
callq 0x4440
movq %rax, -0x270(%rbp)
jmp 0x15d9c
movl $0x20, %edi
callq 0x177d0
movb %al, -0x271(%rbp)
jmp 0x15dae
movq -0x270(%rbp), %rdi
movb -0x271(%rbp), %al
movb %al, -0x1c1(%rbp)
movzbl -0x1c1(%rbp), %esi
callq 0x4550
movq %rax, -0x280(%rbp)
jmp 0x15dd6
movq -0x280(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
callq 0x4690
jmp 0x15de9
leaq -0x248(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x4370
jmp 0x15dfe
leaq 0x3cc0f(%rip), %rdx     # 0x52a14
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x18020
jmp 0x15e1a
movslq -0x24(%rbp), %rax
movsbl -0x1e(%rbp,%rax), %edx
leaq -0x208(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x17970
jmp 0x15e38
leaq 0x3cf3b(%rip), %rdx     # 0x52d7a
leaq -0x1e8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x18020
jmp 0x15e54
movq -0x258(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x4470
leaq -0x1e8(%rbp), %rdi
callq 0x46e8
leaq -0x208(%rbp), %rdi
callq 0x46e8
leaq -0x228(%rbp), %rdi
callq 0x46e8
leaq -0x248(%rbp), %rdi
callq 0x46e8
movb $0x1, -0x19(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x42a0
testb $0x1, -0x19(%rbp)
jne 0x15f59
jmp 0x15f4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x15f69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x15f3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x15f33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x15f27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x46e8
leaq -0x228(%rbp), %rdi
callq 0x46e8
leaq -0x248(%rbp), %rdi
callq 0x46e8
leaq -0x1b0(%rbp), %rdi
callq 0x42a0
jmp 0x15f69
movq -0x258(%rbp), %rdi
callq 0x46e8
movq -0x250(%rbp), %rax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq -0x258(%rbp), %rdi
callq 0x46e8
movq -0x1b8(%rbp), %rdi
callq 0x4630
nopw %cs:(%rax,%rax)