// File: /workspace/github_c_makefile_star2_O3/salextpuru[P]speccy-toochain/src/mhmt/mhmt-depack.c
// Function: depacker_hrust
ULONG depack_getbyte(ULONG operation)
{
    static ULONG position;

    if( operation==DEPACK_GETBYTE_REWIND ) {
        position=0;
        return 0;

    } else if( operation==DEPACK_GETBYTE_NEXT ) {
        if( position < wrk.inlen ) {
//#ifdef DBG
//			printf("<%02x>", wrk.indata[position]);
//#endif
            return (ULONG)wrk.indata[position++];
        }

    } else // should never happen in a correct program
        printf("mhmt-depack.c:depack_get() - wrong operation code\n");

    return 0xFFFFFFFF;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x0, 0x8e0a9(%rip)     # 0x92c30
leaq 0x6792(%rip), %r12      # 0xb320
cmpl $0x0, 0xc(%r12)
je 0x4bfa
movl 0x48(%r12), %eax
testl %eax, %eax
je 0x5208
movq 0x40(%r12), %rcx
movl $0x1, 0x8e07e(%rip)     # 0x92c30
cmpb $0x48, (%rcx)
jne 0x5211
cmpl $0x1, %eax
je 0x5208
movl $0x2, 0x8e062(%rip)     # 0x92c30
cmpb $0x52, 0x1(%rcx)
jne 0x5211
addl $-0x2, %eax
movl $0x2, %ecx
xorl %edx, %edx
subl $0x1, %eax
jb 0x5208
incl %ecx
movl %ecx, 0x8e03d(%rip)     # 0x92c30
incl %edx
cmpl $0xa, %edx
jne 0x4be2
callq 0x554f
movl %eax, 0x8e02f(%rip)     # 0x92c34
cmpl $-0x1, %eax
je 0x521a
xorl %eax, %eax
cmpl $0x0, 0x10(%r12)
setne %al
leal 0x8(,%rax,8), %eax
movl %eax, 0x8e012(%rip)     # 0x92c38
movl 0x8e004(%rip), %eax     # 0x92c30
cmpl 0x48(%r12), %eax
jae 0x5208
movq 0x40(%r12), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8dfeb(%rip)     # 0x92c30
movzbl (%rcx,%rax), %edi
movl $0x2, %esi
callq 0x52d7
testl %eax, %eax
je 0x5239
movl $0x2, 0x10(%rsp)
movl $0x1, %ebx
movl $0x1, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
testb $0x1, %al
jne 0x4cf1
movl $0x2, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
movl %eax, %r15d
andl $0x3, %r15d
movb $0x1, %dil
leaq 0x2723(%rip), %rcx      # 0x73d0
movslq (%rcx,%r15,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x3, %edi
movl $0x2, %esi
callq 0x53a0
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x521a
orl $-0x8, 0x8(%rsp)
movl $0x1, %ecx
xorl %r15d, %r15d
movl $0x1, %r13d
xorl %ebp, %ebp
xorl %eax, %eax
xorl %r14d, %r14d
jmp 0x4ed7
movl $0x1, %ecx
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %edi, %edi
movl $0x1, %ebp
jmp 0x4d0f
xorl %r13d, %r13d
movl $0x3, %ecx
xorl %ebp, %ebp
xorl %eax, %eax
xorl %r14d, %r14d
jmp 0x4eda
movl $0x2, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
andl $0x3, %eax
xorl %r13d, %r13d
movl $0x2, %r15d
leaq 0x269c(%rip), %rcx      # 0x73e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
testb $0x1, %al
jne 0x514e
movl $0x1, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
testb $0x1, %al
jne 0x51a7
movl $0x7, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
andl $0x7f, %eax
movl $0x1, %r14d
movb $0x1, %dil
cmpl $0xf, %eax
jne 0x51d2
xorl %ebp, %ebp
movb $0x1, %al
movl 0x14(%rsp), %ecx
jmp 0x4eda
movl $0x2, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
movl %eax, %r15d
andl $0x3, %r15d
xorl %r13d, %r13d
leaq 0x2600(%rip), %rcx      # 0x73f0
movslq (%rcx,%r15,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xfffffd00, 0x8(%rsp)  # imm = 0xFFFFFD00
xorl %eax, %eax
movl %r15d, %r13d
movl %r15d, %ebp
movl %r15d, %r14d
jmp 0x4ed2
xorl %r13d, %r13d
movl $0x5, %ecx
jmp 0x4ce5
movl 0x8de0c(%rip), %eax     # 0x92c30
cmpl 0x48(%r12), %eax
movb $0x1, %dil
jae 0x5208
movq 0x40(%r12), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8ddf0(%rip)     # 0x92c30
movzbl (%rcx,%rax), %eax
cmpl $0xdf, %eax
ja 0x5124
orl $0xffffff00, %eax       # imm = 0xFFFFFF00
movl $0x1, %r13d
xorl %r15d, %r15d
movl %eax, 0x8(%rsp)
xorl %ebp, %ebp
xorl %eax, %eax
xorl %r14d, %r14d
movl $0x2, %ecx
jmp 0x4eda
movl $0x6, %ecx
movl %ecx, %ebp
movl $0x2, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
andl $0x3, %eax
movl %ebp, %ecx
addl %eax, %ecx
xorl %r13d, %r13d
cmpl $0x3, %eax
jne 0x4ce5
cmpl $0xf, %ecx
jb 0x4e74
jmp 0x4ce5
movl $0x4, %ecx
jmp 0x4ce5
movl $0x1, %r15d
jmp 0x4ecb
movl $0xfffffe00, 0x8(%rsp)  # imm = 0xFFFFFE00
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %eax, %eax
xorl %r14d, %r14d
movl $0x2, %ecx
movb $0x1, %dil
orl %ebp, %r13d
orl %r14d, %r13d
movl %eax, 0xc(%rsp)
jne 0x4ff2
testl %r15d, %r15d
je 0x4f27
movq %rdi, %r13
cmpl $0x1, %r15d
jne 0x4f2e
movl %ecx, %r15d
movl $0x5, %edi
movl $0x2, %esi
callq 0x53a0
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x521a
orl $-0x20, 0x8(%rsp)
movl %r15d, %ecx
movq %r13, %rdi
jmp 0x4fee
movl %ecx, %r15d
xorl %eax, %eax
jmp 0x4fa4
movl %ecx, %r15d
movl $0x2, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
andl $0x3, %eax
leaq 0x24ad(%rip), %rcx      # 0x7400
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xfffffe00, 0x8(%rsp)  # imm = 0xFFFFFE00
jmp 0x4f9f
movb $0x1, %al
movl $0xffffff00, 0x8(%rsp)  # imm = 0xFFFFFF00
jmp 0x4fa1
movl 0x10(%rsp), %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl 0x10(%rsp), %ecx
shll %cl, %eax
orl %eax, %edx
shll $0x8, %edx
movl %edx, 0x8(%rsp)
xorl %eax, %eax
movq %r13, %rdi
movl 0x8dc86(%rip), %ecx     # 0x92c30
cmpl 0x48(%r12), %ecx
jae 0x5208
movq 0x40(%r12), %rdx
leal 0x1(%rcx), %esi
movl %esi, 0x8dc6d(%rip)     # 0x92c30
movzbl (%rdx,%rcx), %ecx
testb %al, %al
je 0x4fe7
cmpb $-0x21, %cl
movl 0xc(%rsp), %eax
ja 0x5105
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl %ecx, 0x8(%rsp)
movl %r15d, %ecx
jmp 0x4ff2
addl %ecx, 0x8(%rsp)
movl %r15d, %ecx
movl 0xc(%rsp), %eax
orl %ebp, %r14d
movl %ecx, 0x14(%rsp)
je 0x5009
orb %al, %dil
je 0x5095
jmp 0x50ec
movl 0x8(%rsp), %esi
negl %esi
cmpl %esi, 0x1c(%r12)
jb 0x52b6
orb %al, %dil
je 0x5095
testl %ecx, %ecx
je 0x50ec
movl 0x14(%rsp), %eax
movl %eax, %esi
cmpl $-0x3, %eax
jne 0x5088
movl 0x8dbf8(%rip), %eax     # 0x92c30
cmpl 0x48(%r12), %eax
jae 0x5208
movq 0x40(%r12), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8dbdf(%rip)     # 0x92c30
movb (%rcx,%rax), %bpl
movl 0x8(%rsp), %edi
movl $0x1, %esi
callq 0x54c2
xorl %ebx, %ebx
testl %eax, %eax
je 0x523b
movzbl %bpl, %edi
movl $0x2, %esi
callq 0x52d7
movl $0x1, %esi
testl %eax, %eax
je 0x523b
movl 0x8(%rsp), %edi
callq 0x54c2
movl %eax, %ebx
jmp 0x50ec
testl %ecx, %ecx
movl %ecx, %ebp
jle 0x50ec
movl 0x8db8f(%rip), %ecx     # 0x92c30
movl 0x48(%r12), %eax
cmpl %eax, %ecx
jae 0x5208
movq 0x40(%r12), %rsi
leal 0x1(%rcx), %edx
movl %edx, 0x8db74(%rip)     # 0x92c30
testl %ebx, %ebx
je 0x50e4
movl %ecx, %eax
movzbl (%rsi,%rax), %edi
movl $0x2, %esi
callq 0x52d7
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movl 0x8db53(%rip), %edx     # 0x92c30
movl 0x48(%r12), %eax
jmp 0x50e6
xorl %ebx, %ebx
movl %edx, %ecx
decl %ebp
jne 0x50a6
testl %ebx, %ebx
sete %al
movl 0xc(%rsp), %ecx
orb %al, %cl
cmpb $0x1, %cl
jne 0x4c68
jmp 0x523b
addl %ecx, %ecx
xorl $0x2, %ecx
addl $0xf1, %ecx
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl %ecx, 0x8(%rsp)
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
jmp 0x4ff2
cmpl $0xfe, %eax
jne 0x5181
movl 0x10(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
cmpl $0x9, %eax
jae 0x52cb
movl $0x1, %r13d
xorl %r15d, %r15d
xorl %ecx, %ecx
jmp 0x4d0d
movl $0x4, %edi
movl $0x2, %esi
callq 0x53a0
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x521a
orl $-0x10, 0x8(%rsp)
xorl %ebp, %ebp
movl $0x1, %r13d
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
jmp 0x4ce7
addl %eax, %eax
xorl $0x3, %eax
addl $0xf1, %eax
orl $0xffffff00, %eax       # imm = 0xFFFFFF00
movl $0x1, %r13d
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
xorl %r15d, %r15d
movl %eax, 0x8(%rsp)
jmp 0x4d0d
movl $0x4, %edi
movl $0x2, %esi
callq 0x53a0
cmpl $-0x1, %eax
je 0x521a
andl $0xf, %eax
leal 0xc(,%rax,2), %ecx
xorl %edi, %edi
movl $0x1, %r13d
jmp 0x4cfe
xorl %r13d, %r13d
cmpl $0xf, %eax
ja 0x5201
movl 0x8da50(%rip), %ecx     # 0x92c30
cmpl 0x48(%r12), %ecx
jae 0x5208
movq 0x40(%r12), %rdx
leal 0x1(%rcx), %esi
movl %esi, 0x8da3b(%rip)     # 0x92c30
movzbl (%rdx,%rcx), %ecx
shll $0x8, %eax
orl %ecx, %eax
xorl %r13d, %r13d
movl %eax, %ecx
jmp 0x4d0d
leaq 0x2559(%rip), %rdi      # 0x7768
jmp 0x5221
leaq 0x2528(%rip), %rdi      # 0x7740
jmp 0x5221
leaq 0x24e4(%rip), %rdi      # 0x7705
callq 0x1120
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
cmpl $0x0, 0xc(%r12)
je 0x5228
movl $0x0, 0x8d9e3(%rip)     # 0x92c30
movl 0x48(%r12), %eax
xorl %ecx, %ecx
movl $0x6, %edx
cmpl %eax, %ecx
jae 0x5265
incl %ecx
movl %ecx, 0x8d9cb(%rip)     # 0x92c30
decl %edx
jne 0x5259
movl $0x6, %ebp
movb $-0x1, %dl
cmpl %eax, %ecx
jae 0x5286
movq 0x40(%r12), %rdx
movl %ecx, %esi
incl %ecx
movl %ecx, 0x8d9ad(%rip)     # 0x92c30
movb (%rdx,%rsi), %dl
testl %ebx, %ebx
je 0x52ab
movzbl %dl, %edi
movl $0x2, %esi
callq 0x52d7
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movl 0x8d98c(%rip), %ecx     # 0x92c30
movl 0x48(%r12), %eax
jmp 0x52ad
xorl %ebx, %ebx
decl %ebp
jne 0x526e
jmp 0x5228
leaq 0x21f5(%rip), %rdi      # 0x74b2
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
jmp 0x5228
leaq 0x23dc(%rip), %rdi      # 0x76ae
jmp 0x5221