// File: /workspace/github_c_makefile_star2_O2/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
andl $0x0, 0x8db00(%rip)     # 0x91c30
leaq 0x61e9(%rip), %rax      # 0xa320
cmpl $0x0, 0xc(%rax)
je 0x418c
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
cmpl $0x48, %eax
jne 0x46d7
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
cmpl $0x52, %eax
jne 0x46d7
pushq $0xb
popq %rbp
pushq $0x1
popq %rbx
decl %ebp
je 0x418c
movl %ebx, %edi
callq 0x47e7
cmpl $-0x1, %eax
jne 0x4177
jmp 0x46ce
pushq $0x10
popq %rdi
pushq $0x1
popq %rsi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
movzbl %al, %edi
pushq $0x2
popq %r14
movl %r14d, %esi
callq 0x477e
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
xorl %r15d, %r15d
movl %r14d, 0xc(%rsp)
testl %r15d, %r15d
jne 0x46ff
testl %ebx, %ebx
je 0x46ff
pushq $0x1
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
movl %eax, %ecx
xorl %eax, %eax
testb $0x1, %cl
jne 0x4251
pushq $0x2
popq %rdi
movl %edi, %esi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
andl $0x3, %eax
movb $0x1, %dil
leaq 0x214f(%rip), %rdx      # 0x636c
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
pushq $0x3
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x46e0
orl $-0x8, 0x8(%rsp)
xorl %eax, %eax
pushq $0x1
popq %r13
movl %r13d, %ebp
jmp 0x43dc
pushq $0x1
popq %r14
movl %r14d, %ebp
xorl %r13d, %r13d
xorl %edi, %edi
jmp 0x4268
xorl %r13d, %r13d
pushq $0x3
popq %rbp
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x43e8
pushq $0x2
popq %rdi
movl %edi, %esi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
andl $0x3, %eax
xorl %r13d, %r13d
leaq 0x20e9(%rip), %rcx      # 0x637c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x1
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
testb $0x1, %al
jne 0x460d
pushq $0x1
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
testb $0x1, %al
jne 0x4671
pushq $0x7
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
movl %eax, %r14d
andl $0x7f, %r14d
movb $0x1, %dil
cmpl $0xf, %r14d
jne 0x469c
pushq $0x2
popq %rax
xorl %r14d, %r14d
movb $0x1, %r12b
pushq $0x1
popq %r15
jmp 0x43e8
pushq $0x2
popq %rdi
movl %edi, %esi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
andl $0x3, %eax
xorl %r13d, %r13d
leaq 0x205e(%rip), %rdx      # 0x638c
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0xfffffd00, 0x8(%rsp)  # imm = 0xFFFFFD00
xorl %r12d, %r12d
pushq $0x2
popq %rbp
movl %eax, %r13d
movl %eax, %r14d
movl %eax, %r15d
jmp 0x43e5
xorl %r13d, %r13d
pushq $0x2
popq %rax
pushq $0x5
jmp 0x43c9
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
movl %eax, %ecx
cmpl $0xdf, %eax
ja 0x45cd
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
xorl %eax, %eax
movl %ecx, 0x8(%rsp)
pushq $0x2
popq %rbp
pushq $0x1
popq %r13
jmp 0x43dc
pushq $0x6
popq %rbp
pushq $0x2
popq %rdi
movl %edi, %esi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
andl $0x3, %eax
addl %eax, %ebp
xorl %r13d, %r13d
cmpl $0x3, %eax
jne 0x43b8
cmpl $0xf, %ebp
jb 0x4393
pushq $0x2
popq %rax
jmp 0x43dc
pushq $0x2
popq %rax
pushq $0x4
jmp 0x43c9
pushq $0x1
popq %rax
pushq $0x2
popq %rbp
jmp 0x43dc
movl $0xfffffe00, 0x8(%rsp)  # imm = 0xFFFFFE00
xorl %eax, %eax
pushq $0x2
popq %rbp
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r15d, %r15d
movb $0x1, %dil
orl %r14d, %r13d
orl %r15d, %r13d
jne 0x44ca
testl %eax, %eax
je 0x4425
cmpl $0x1, %eax
jne 0x4455
movq %rdi, %r13
pushq $0x5
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x46e0
orl $-0x20, 0x8(%rsp)
movq %r13, %rdi
jmp 0x44ca
movq %rdi, 0x10(%rsp)
xorl %r13d, %r13d
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
testb %r13b, %r13b
je 0x448a
cmpl $0xdf, %eax
ja 0x4490
orl $0xffffff00, %eax       # imm = 0xFFFFFF00
movl %eax, 0x8(%rsp)
jmp 0x44c5
movq %rdi, 0x10(%rsp)
pushq $0x2
popq %rdi
movl %edi, %esi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
andl $0x3, %eax
leaq 0x1f25(%rip), %rcx      # 0x639c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xfffffe00, 0x8(%rsp)  # imm = 0xFFFFFE00
jmp 0x442a
addl %eax, 0x8(%rsp)
jmp 0x44c5
addl %eax, %eax
xorl $0x2, %eax
addl $0xf1, %eax
orl $0xffffff00, %eax       # imm = 0xFFFFFF00
movl %eax, 0x8(%rsp)
pushq $-0x3
popq %rbp
jmp 0x44c5
pushq $0x5
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x46e0
orl $-0x20, 0x8(%rsp)
movq 0x10(%rsp), %rdi
orl %r15d, %r14d
je 0x44da
orb %r12b, %dil
jne 0x41cf
jmp 0x454c
movl 0x8(%rsp), %esi
negl %esi
leaq 0x5e39(%rip), %rax      # 0xa320
cmpl %esi, 0x1c(%rax)
jb 0x475d
orb %r12b, %dil
je 0x454c
testl %ebp, %ebp
je 0x41cf
cmpl $-0x3, %ebp
jne 0x463c
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
movl %eax, %r14d
movl 0x8(%rsp), %edi
pushq $0x1
popq %rsi
callq 0x495a
xorl %ebx, %ebx
testl %eax, %eax
je 0x41cf
movzbl %r14b, %edi
pushq $0x2
popq %rsi
callq 0x477e
pushq $0x1
popq %rsi
testl %eax, %eax
jne 0x463e
jmp 0x41cf
testl %ebp, %ebp
movl $0x0, %r14d
cmovgl %ebp, %r14d
subl $0x1, %r14d
jb 0x41cf
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
testl %ebx, %ebx
je 0x458b
movzbl %al, %edi
pushq $0x2
popq %rsi
callq 0x477e
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x4558
xorl %ebx, %ebx
jmp 0x4558
movl 0xc(%rsp), %edi
pushq $0x2
popq %rsi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
movl %eax, %edx
pushq $-0x1
popq %rax
movl 0xc(%rsp), %ecx
shll %cl, %eax
orl %eax, %edx
shll $0x8, %edx
movl %edx, 0x8(%rsp)
jmp 0x442a
movb $0x1, %r13b
movl $0xffffff00, 0x8(%rsp)  # imm = 0xFFFFFF00
jmp 0x442d
cmpl $0xfe, %ecx
movb $0x1, %dil
jne 0x464e
movl 0xc(%rsp), %ecx
incl %ecx
xorl %eax, %eax
movl $0x0, %ebp
pushq $0x1
popq %r13
movl $0x0, %r14d
movl $0x0, %r12d
movl $0x0, %r15d
movl %ecx, 0xc(%rsp)
cmpl $0x9, %ecx
jb 0x43e8
jmp 0x4772
pushq $0x4
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x46e0
orl $-0x10, 0x8(%rsp)
xorl %r14d, %r14d
pushq $0x2
popq %rax
pushq $-0x3
popq %rbp
pushq $0x1
popq %r13
jmp 0x43df
movl %ebp, %esi
movl 0x8(%rsp), %edi
callq 0x495a
movl %eax, %ebx
jmp 0x41cf
addl %ecx, %ecx
xorl $0x3, %ecx
addl $0xf1, %ecx
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
xorl %eax, %eax
movl %ecx, 0x8(%rsp)
pushq $-0x3
popq %rbp
pushq $0x1
popq %r13
jmp 0x4265
pushq $0x4
popq %rdi
pushq $0x2
popq %rsi
callq 0x4837
cmpl $-0x1, %eax
je 0x46e0
andl $0xf, %eax
leal 0xc(,%rax,2), %ebp
xorl %edi, %edi
pushq $0x2
popq %rax
pushq $0x1
popq %r14
movl %r14d, %r13d
jmp 0x4268
xorl %r13d, %r13d
cmpl $0xf, %r14d
jbe 0x46b0
pushq $0x2
popq %rax
movl %r14d, %ebp
jmp 0x4265
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x46ce
movl %eax, %ebp
shll $0x8, %r14d
addl %r14d, %ebp
xorl %r13d, %r13d
jmp 0x43b8
leaq 0x202f(%rip), %rdi      # 0x6704
jmp 0x46e7
leaq 0x1ffe(%rip), %rdi      # 0x66dc
jmp 0x46e7
leaq 0x1fba(%rip), %rdi      # 0x66a1
callq 0x1110
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5c1a(%rip), %rax      # 0xa320
cmpl $0x0, 0xc(%rax)
je 0x46ee
andl $0x0, 0x8d51d(%rip)     # 0x91c30
pushq $0x6
popq %r14
pushq $0x1
popq %rbp
subl $0x1, %r14d
jb 0x4729
movl %ebp, %edi
callq 0x47e7
jmp 0x471a
pushq $0x6
popq %r15
pushq $0x1
popq %rbp
pushq $0x2
popq %r14
subl $0x1, %r15d
jb 0x46ee
movl %ebp, %edi
callq 0x47e7
testl %ebx, %ebx
je 0x4759
movzbl %al, %edi
movl %r14d, %esi
callq 0x477e
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x4734
xorl %ebx, %ebx
jmp 0x4734
leaq 0x1cea(%rip), %rdi      # 0x644e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
jmp 0x46ee
leaq 0x1ed1(%rip), %rdi      # 0x664a
jmp 0x46e7