// File: /workspace/github_c_makefile_star2_O1/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, 0x8df42(%rip)     # 0x92c30
leaq 0x662b(%rip), %rsi      # 0xb320
cmpl $0x0, 0xc(%rsi)
je 0x4d89
movl 0x48(%rsi), %eax
testl %eax, %eax
je 0x4d19
movq 0x40(%rsi), %rcx
movl $0x1, 0x8df1c(%rip)     # 0x92c30
movzbl (%rcx), %ecx
jmp 0x4d1e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $-0x1, %ecx
je 0x53b8
cmpl $0x48, %ecx
jne 0x53c1
movl 0x8defa(%rip), %ecx     # 0x92c30
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl %eax, %ecx
jae 0x4d50
movq 0x40(%rsi), %rdx
leal 0x1(%rcx), %esi
movl %esi, 0x8dee4(%rip)     # 0x92c30
movzbl (%rdx,%rcx), %edx
cmpl $-0x1, %edx
je 0x53b8
cmpl $0x52, %edx
jne 0x53c1
movl 0x8dec8(%rip), %ecx     # 0x92c30
xorl %edx, %edx
subl %ecx, %eax
cmovbl %edx, %eax
incl %ecx
cmpl %edx, %eax
je 0x53b8
leal (%rcx,%rdx), %esi
movl %esi, 0x8deae(%rip)     # 0x92c30
incl %edx
cmpl $0xa, %edx
jne 0x4d71
callq 0x56fd
movl %eax, 0x8dea0(%rip)     # 0x92c34
cmpl $-0x1, %eax
je 0x53ca
xorl %eax, %eax
leaq 0x657a(%rip), %rdx      # 0xb320
cmpl $0x0, 0x10(%rdx)
setne %al
leal 0x8(,%rax,8), %eax
movl %eax, 0x8de7e(%rip)     # 0x92c38
movl 0x8de70(%rip), %ecx     # 0x92c30
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x48(%rdx), %ecx
jae 0x4ddb
movq 0x40(%rdx), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x8de59(%rip)     # 0x92c30
movzbl (%rax,%rcx), %eax
cmpl $-0x1, %eax
je 0x53b8
movzbl %al, %edi
movl $0x2, %esi
callq 0x5489
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
je 0x53e9
movl $0x2, 0x14(%rsp)
xorl %eax, %eax
movl %eax, 0x10(%rsp)
movl $0x1, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
movl %eax, %r12d
testb $0x1, %r12b
jne 0x4e96
movl $0x2, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
movl %eax, %r15d
andl $0x3, %r15d
movb $0x1, %dl
xorl %ebp, %ebp
leaq 0x2579(%rip), %rcx      # 0x73d0
movslq (%rcx,%r15,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x3, %edi
movl $0x2, %esi
callq 0x5552
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x53ca
orl $-0x8, 0xc(%rsp)
xorl %r15d, %r15d
movl $0x1, %r14d
movl $0x1, %ebp
xorl %r13d, %r13d
movb $0x1, %dl
jmp 0x4ec0
xorl %ebp, %ebp
movl $0x1, %r14d
xorl %edx, %edx
xorl %r15d, %r15d
movl $0x1, %r13d
jmp 0x4ec0
movl $0x3, %r14d
jmp 0x4ebd
movl $0x2, %r15d
xorl %ebp, %ebp
xorl %edx, %edx
xorl %r13d, %r13d
orb %dl, %r12b
testb $0x1, %r12b
jne 0x502c
movl $0x2, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
andl $0x3, %eax
movl $0x0, 0x10(%rsp)
leaq 0x24f9(%rip), %rcx      # 0x73f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
testb $0x1, %al
jne 0x4ffd
movl $0x1, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
testb $0x1, %al
jne 0x523d
movl $0x7, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
andl $0x7f, %eax
cmpl $0xf, %eax
jne 0x534c
xorl %r13d, %r13d
movl $0x1, 0x10(%rsp)
jmp 0x502c
movl $0x2, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
movl %eax, %r15d
andl $0x3, %r15d
movl $0x2, %r14d
leaq 0x2440(%rip), %rcx      # 0x73e0
movslq (%rcx,%r15,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xfffffd00, 0xc(%rsp)  # imm = 0xFFFFFD00
movl %r15d, %ebp
movl %r15d, %r13d
jmp 0x4e92
movl $0x5, %r14d
jmp 0x5029
movl $0x6, %r14d
movl $0x2, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
andl $0x3, %eax
addl %eax, %r14d
cmpl $0x3, %eax
jne 0x5029
cmpl $0xf, %r14d
jl 0x4fca
jmp 0x5029
movl $0x4, %r14d
jmp 0x5029
movl $0x4, %edi
movl $0x2, %esi
callq 0x5552
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x53ca
orl $-0x10, 0xc(%rsp)
movl $0x1, %ebp
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
xorl %r13d, %r13d
orl %r13d, %ebp
orl 0x10(%rsp), %ebp
je 0x5157
leaq 0x62e0(%rip), %rdi      # 0xb320
movl 0x10(%rsp), %edx
movl %edx, %eax
orl %r13d, %eax
jne 0x505a
movl 0xc(%rsp), %esi
negl %esi
cmpl %esi, 0x1c(%rdi)
jb 0x5468
testl %edx, %edx
setne %cl
testl %r13d, %r13d
sete %dl
orb %cl, %dl
je 0x50e5
testl %eax, %eax
jne 0x513e
testl %r14d, %r14d
je 0x513e
movl %r14d, %esi
cmpl $-0x3, %r14d
jne 0x50d8
movl 0x8dba7(%rip), %eax     # 0x92c30
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl 0x48(%rdi), %eax
jae 0x50a4
movq 0x40(%rdi), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8db90(%rip)     # 0x92c30
movzbl (%rcx,%rax), %ebp
cmpl $-0x1, %ebp
je 0x53b8
movl 0xc(%rsp), %edi
movl $0x1, %esi
callq 0x5672
xorl %ebx, %ebx
testl %eax, %eax
je 0x513e
movzbl %bpl, %edi
movl $0x2, %esi
callq 0x5489
movl $0x1, %esi
testl %eax, %eax
je 0x513e
movl 0xc(%rsp), %edi
callq 0x5672
movl %eax, %ebx
jmp 0x513e
testl %r14d, %r14d
jle 0x513e
movl %r14d, %ebp
movl 0x8db3d(%rip), %ecx     # 0x92c30
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x48(%rdi), %ecx
jae 0x510e
movq 0x40(%rdi), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x8db26(%rip)     # 0x92c30
movzbl (%rax,%rcx), %eax
cmpl $-0x1, %eax
je 0x53b8
testl %ebx, %ebx
je 0x5138
movzbl %al, %edi
movl $0x2, %esi
callq 0x5489
leaq 0x61f1(%rip), %rdi      # 0xb320
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x513a
xorl %ebx, %ebx
decl %ebp
jne 0x50ed
movl 0x10(%rsp), %eax
testl %eax, %eax
jne 0x53e9
testl %ebx, %ebx
jne 0x4e08
jmp 0x53e9
testl %r15d, %r15d
leaq 0x61bf(%rip), %rdi      # 0xb320
je 0x518f
cmpl $0x1, %r15d
jne 0x5196
movl $0x5, %edi
movl $0x2, %esi
callq 0x5552
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x53ca
orl $-0x20, 0xc(%rsp)
jmp 0x5039
xorl %eax, %eax
jmp 0x52b2
movl $0x2, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
andl $0x3, %eax
leaq 0x2248(%rip), %rcx      # 0x7400
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xfffffe00, 0xc(%rsp)  # imm = 0xFFFFFE00
jmp 0x52a9
movl 0x8da5c(%rip), %ecx     # 0x92c30
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x6140(%rip), %rdx      # 0xb320
cmpl 0x48(%rdx), %ecx
jae 0x51f6
movq 0x40(%rdx), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x8da3e(%rip)     # 0x92c30
movzbl (%rax,%rcx), %eax
cmpl $-0x1, %eax
je 0x53b8
cmpl $0xdf, %eax
ja 0x5320
orl $0xffffff00, %eax       # imm = 0xFFFFFF00
xorl %r15d, %r15d
movl $0x1, %ebp
movl %eax, 0xc(%rsp)
jmp 0x4e8f
movl $0x1, %r15d
jmp 0x4e8f
xorl %ebp, %ebp
movl $0xfffffe00, 0xc(%rsp)  # imm = 0xFFFFFE00
xorl %r15d, %r15d
jmp 0x4e8f
movl $0x4, %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
andl $0xf, %eax
leal 0xc(,%rax,2), %r14d
movl $0x1, %ebp
movl $0x1, %r13d
jmp 0x502c
movb $0x1, %al
movl $0xffffff00, 0xc(%rsp)  # imm = 0xFFFFFF00
jmp 0x52ab
movl 0x14(%rsp), %edi
movl $0x2, %esi
callq 0x5552
cmpl $-0x1, %eax
je 0x53ca
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl 0x14(%rsp), %ecx
shll %cl, %eax
orl %eax, %edx
shll $0x8, %edx
movl %edx, 0xc(%rsp)
xorl %eax, %eax
leaq 0x606e(%rip), %rdi      # 0xb320
movl 0x8d978(%rip), %edx     # 0x92c30
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl 0x48(%rdi), %edx
jae 0x52d3
movq 0x40(%rdi), %rcx
leal 0x1(%rdx), %esi
movl %esi, 0x8d961(%rip)     # 0x92c30
movzbl (%rcx,%rdx), %ecx
cmpl $-0x1, %ecx
je 0x53b8
testb %al, %al
je 0x52f4
cmpl $0xdf, %ecx
movl 0x10(%rsp), %edx
ja 0x5300
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
jmp 0x5317
movzbl %cl, %eax
addl %eax, 0xc(%rsp)
jmp 0x5040
addl %ecx, %ecx
xorl $0x2, %ecx
addl $0xf1, %ecx
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
movl %ecx, 0xc(%rsp)
jmp 0x5044
cmpl $0xfe, %eax
movb $0x1, %dl
jne 0x5356
movl 0x14(%rsp), %eax
incl %eax
movl %eax, 0x14(%rsp)
cmpl $0x9, %eax
jae 0x547d
movl $0x1, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x4ebd
jbe 0x537c
movl %eax, %r14d
jmp 0x5029
addl %eax, %eax
xorl $0x3, %eax
addl $0xf1, %eax
orl $0xffffff00, %eax       # imm = 0xFFFFFF00
xorl %r15d, %r15d
movl $0x1, %ebp
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
movl %eax, 0xc(%rsp)
jmp 0x4ebd
movl 0x8d8ae(%rip), %edx     # 0x92c30
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x5f92(%rip), %rsi      # 0xb320
cmpl 0x48(%rsi), %edx
jae 0x53a4
movq 0x40(%rsi), %rcx
leal 0x1(%rdx), %esi
movl %esi, 0x8d890(%rip)     # 0x92c30
movzbl (%rcx,%rdx), %ecx
cmpl $-0x1, %ecx
je 0x53b8
shll $0x8, %eax
movzbl %cl, %r14d
orl %eax, %r14d
jmp 0x5029
leaq 0x23a9(%rip), %rdi      # 0x7768
jmp 0x53d1
leaq 0x2378(%rip), %rdi      # 0x7740
jmp 0x53d1
leaq 0x2334(%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
leaq 0x5f30(%rip), %rsi      # 0xb320
cmpl $0x0, 0xc(%rsi)
je 0x53d8
movl $0x0, 0x8d830(%rip)     # 0x92c30
movl 0x48(%rsi), %eax
xorl %ecx, %ecx
movl $0x6, %edx
cmpl %eax, %ecx
jae 0x5416
incl %ecx
movl %ecx, 0x8d81a(%rip)     # 0x92c30
decl %edx
jne 0x540a
movl $0x6, %ebp
movl 0x8d80b(%rip), %eax     # 0x92c30
movb $-0x1, %cl
cmpl 0x48(%rsi), %eax
jae 0x543c
movq 0x40(%rsi), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8d7f7(%rip)     # 0x92c30
movb (%rcx,%rax), %cl
testl %ebx, %ebx
je 0x545d
movzbl %cl, %edi
movl $0x2, %esi
callq 0x5489
leaq 0x5ecc(%rip), %rsi      # 0xb320
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x545f
xorl %ebx, %ebx
decl %ebp
jne 0x541f
jmp 0x53d8
leaq 0x2043(%rip), %rdi      # 0x74b2
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
jmp 0x53d8
leaq 0x222a(%rip), %rdi      # 0x76ae
jmp 0x53d1