// File: besm6[P]pascal-re/pascompl.cc
// Function: genFullExpr::genDeref()
void genDeref() {
        Word l5var1z, l5var2z;
        bool doPtrCheck;

        doPtrCheck = checkBounds and not (optSflags.m.has(NoPtrCheck))
            and (curOP == DEREF);
        if (not doPtrCheck and (
                (insnList->st == st0) or
                (insnList->st == st1 and
                 insnList->shift == 0))) {
            l5var1z.i = insnList->ilf7;
            l5var2z.i = insnList->ilf6;
            if (l5var1z.i == 18 or l5var1z.i == 16) {
L5220:          addInsnAndOffset((insnList->ilf5.i + InsnTemp[WTC]), l5var2z.i);
            } else {
                if (l5var1z.i == 17) {
                    if (l5var2z.i == 0) {
                        insnList->next->code = insnList->next->code +
                            InsnTemp[XTA];
                    } else
                        goto L5220;
                } else if (l5var1z.i == 15) {
                    addToInsnList(macro + mcACC2ADDR);
                    goto L5220;
                } else {
                    addInsnAndOffset((indexreg[l5var1z.i] + InsnTemp[WTC]),
                                     l5var2z.i);
                }
            }
        } else {
            P5155();
            if (doPtrCheck) {
                addToInsnList(KVTM+I14 + lineCnt);
                addToInsnList(getHelperProc(7)); /* "P/CA"*/
                insnList->next->mode = 1;
            }
            addToInsnList(macro + mcACC2ADDR);
        }
        insnList->ilf6 = 0;
        insnList->ilf5.i = 0;
        insnList->ilf7 = 16;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
testb $0x1, 0x5ebcd(%rip)     # 0x8003a
movb %al, -0x1a(%rbp)
je 0x2149d
leaq 0x5ecb7(%rip), %rdi     # 0x80130
movl $0x4, %esi
callq 0x1e5f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x1a(%rbp)
jne 0x2149d
movq -0x28(%rbp), %rax
cmpl $0x22, 0x28(%rax)
sete %al
movb %al, -0x1a(%rbp)
movb -0x1a(%rbp), %al
andb $0x1, %al
movb %al, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x215fe
movq 0x5ecb2(%rip), %rax     # 0x80168
cmpl $0x0, 0x40(%rax)
je 0x214df
movq 0x5eca5(%rip), %rax     # 0x80168
cmpl $0x1, 0x40(%rax)
jne 0x215fe
movq 0x5ec94(%rip), %rax     # 0x80168
cmpq $0x0, 0x50(%rax)
jne 0x215fe
movq 0x5ec82(%rip), %rax     # 0x80168
movq 0x38(%rax), %rsi
leaq -0x10(%rbp), %rdi
callq 0x4ad0
movq 0x5ec6e(%rip), %rax     # 0x80168
movq 0x30(%rax), %rsi
leaq -0x18(%rbp), %rdi
callq 0x4ad0
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
cmpq $0x12, %rax
je 0x21525
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
cmpq $0x10, %rax
jne 0x2155c
jmp 0x21527
movq 0x5ec3a(%rip), %rdi     # 0x80168
addq $0x28, %rdi
callq 0x1dfb0
addq 0x63632(%rip), %rax     # 0x84b70
movq %rax, -0x30(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x1dfb0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0xbc40
jmp 0x215fc
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
cmpq $0x11, %rax
jne 0x215a3
leaq -0x18(%rbp), %rdi
callq 0x1dfb0
cmpq $0x0, %rax
jne 0x2159f
movq 0x5ebe7(%rip), %rax     # 0x80168
movq (%rax), %rax
movq 0x10(%rax), %rcx
addq 0x634e1(%rip), %rcx     # 0x84a70
movq 0x5ebd2(%rip), %rax     # 0x80168
movq (%rax), %rax
movq %rcx, 0x10(%rax)
jmp 0x215a1
jmp 0x21527
jmp 0x215fa
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
cmpq $0xf, %rax
jne 0x215c1
movl $0x1000006, %edi        # imm = 0x1000006
callq 0xbbb0
jmp 0x21527
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
movq %rax, %rcx
leaq 0x62f5c(%rip), %rax     # 0x84530
movq (%rax,%rcx,8), %rax
addq 0x63591(%rip), %rax     # 0x84b70
movq %rax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x1dfb0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0xbc40
jmp 0x215fa
jmp 0x215fc
jmp 0x2164e
movq -0x28(%rbp), %rdi
callq 0x21730
testb $0x1, -0x19(%rbp)
je 0x21644
movq 0x5e95c(%rip), %rdi     # 0x7ff70
addq $0xea0000, %rdi         # imm = 0xEA0000
callq 0xbbb0
movl $0x7, %edi
callq 0x80d0
movq %rax, %rdi
callq 0xbbb0
movq 0x5eb2f(%rip), %rax     # 0x80168
movq (%rax), %rax
movq $0x1, 0x8(%rax)
movl $0x1000006, %edi        # imm = 0x1000006
callq 0xbbb0
movq 0x5eb13(%rip), %rax     # 0x80168
movq $0x0, 0x30(%rax)
movq 0x5eb04(%rip), %rdi     # 0x80168
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4ad0
movq 0x5eaf0(%rip), %rax     # 0x80168
movq $0x10, 0x38(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)