// File: bluesky466[P]ResourcesParser/ResourcesParser.cpp
// Function: stringOfComplex[abi:cxx11](unsigned int, bool)
static string stringOfComplex(uint32_t complex, bool isFraction) {
	stringstream ss;
    const float MANTISSA_MULT =
        1.0f / (1<<Res_value::COMPLEX_MANTISSA_SHIFT);
    const float RADIX_MULTS[] = {
        1.0f*MANTISSA_MULT, 1.0f/(1<<7)*MANTISSA_MULT,
        1.0f/(1<<15)*MANTISSA_MULT, 1.0f/(1<<23)*MANTISSA_MULT
    };

    float value = (complex&(Res_value::COMPLEX_MANTISSA_MASK
                   <<Res_value::COMPLEX_MANTISSA_SHIFT))
            * RADIX_MULTS[(complex>>Res_value::COMPLEX_RADIX_SHIFT)
                            & Res_value::COMPLEX_RADIX_MASK];
	ss<<value;

    if (!isFraction) {
        switch ((complex>>Res_value::COMPLEX_UNIT_SHIFT)&Res_value::COMPLEX_UNIT_MASK) {
            case Res_value::COMPLEX_UNIT_PX: ss<<"px"; break;
            case Res_value::COMPLEX_UNIT_DIP: ss<<"dp"; break;
            case Res_value::COMPLEX_UNIT_SP: ss<<"sp"; break;
            case Res_value::COMPLEX_UNIT_PT: ss<<"pt"; break;
            case Res_value::COMPLEX_UNIT_IN: ss<<"in"; break;
            case Res_value::COMPLEX_UNIT_MM: ss<<"mm"; break;
            default: ss<<" (unknown unit)"; break;
        }
    } else {
        switch ((complex>>Res_value::COMPLEX_UNIT_SHIFT)&Res_value::COMPLEX_UNIT_MASK) {
            case Res_value::COMPLEX_UNIT_FRACTION: ss<<"%"; break;
            case Res_value::COMPLEX_UNIT_FRACTION_PARENT: ss<<"%p"; break;
            default: ss<<" (unknown unit)"; break;
        }
    }
	return ss.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x1d8(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x1d0(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3190
movl $0x3b800000, -0x19c(%rbp) # imm = 0x3B800000
movaps 0x10a09(%rip), %xmm0    # 0x1a400
movaps %xmm0, -0x1b0(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cvtsi2ss %rcx, %xmm0
shrl $0x2, %eax
andl $0xc, %eax
movss -0x1b0(%rbp,%rax), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x1b4(%rbp)
leaq -0x188(%rbp), %rdi
movss -0x1b4(%rbp), %xmm0
callq 0x31c0
jmp 0x9a3f
testb $0x1, -0xd(%rbp)
jne 0x9b41
movl -0xc(%rbp), %eax
andl $0xf, %eax
movl %eax, %ecx
movq %rcx, -0x1e0(%rbp)
subl $0x5, %eax
ja 0x9b28
movq -0x1e0(%rbp), %rax
leaq 0x106e9(%rip), %rcx     # 0x1a158
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x31d0
jmp 0x9bd6
leaq -0x188(%rbp), %rdi
leaq 0x108b0(%rip), %rsi     # 0x1a359
callq 0x3260
jmp 0x9ab0
jmp 0x9b3f
leaq -0x188(%rbp), %rdi
leaq 0x10899(%rip), %rsi     # 0x1a35c
callq 0x3260
jmp 0x9aca
jmp 0x9b3f
leaq -0x188(%rbp), %rdi
leaq 0x10885(%rip), %rsi     # 0x1a35f
callq 0x3260
jmp 0x9ae1
jmp 0x9b3f
leaq -0x188(%rbp), %rdi
leaq 0x10871(%rip), %rsi     # 0x1a362
callq 0x3260
jmp 0x9af8
jmp 0x9b3f
leaq -0x188(%rbp), %rdi
leaq 0x1085d(%rip), %rsi     # 0x1a365
callq 0x3260
jmp 0x9b0f
jmp 0x9b3f
leaq -0x188(%rbp), %rdi
leaq 0x10849(%rip), %rsi     # 0x1a368
callq 0x3260
jmp 0x9b26
jmp 0x9b3f
leaq -0x188(%rbp), %rdi
leaq 0x10835(%rip), %rsi     # 0x1a36b
callq 0x3260
jmp 0x9b3d
jmp 0x9b3f
jmp 0x9ba5
movl -0xc(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x1e4(%rbp)
je 0x9b5e
jmp 0x9b51
movl -0x1e4(%rbp), %eax
subl $0x1, %eax
je 0x9b75
jmp 0x9b8c
leaq -0x188(%rbp), %rdi
leaq 0x1080f(%rip), %rsi     # 0x1a37b
callq 0x3260
jmp 0x9b73
jmp 0x9ba3
leaq -0x188(%rbp), %rdi
leaq 0x107fa(%rip), %rsi     # 0x1a37d
callq 0x3260
jmp 0x9b8a
jmp 0x9ba3
leaq -0x188(%rbp), %rdi
leaq 0x107d1(%rip), %rsi     # 0x1a36b
callq 0x3260
jmp 0x9ba1
jmp 0x9ba3
jmp 0x9ba5
movq -0x1d8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x3250
jmp 0x9bba
leaq -0x198(%rbp), %rdi
callq 0x31d0
movq -0x1d0(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x1c0(%rbp), %rdi
callq 0x3450
nopw %cs:(%rax,%rax)