// File: besm6[P]pascal-re/pascompl.cc
// Function: packFields()
void packFields()
{
    int64_t l5var1z, pairIdx, l5var3z, l5var4z, l5var5z;
    parseTypeRef::pair * l5var6z;

    bool &cond = parseTypeRef::super.back()->cond;
    TypesPtr &curType = parseTypeRef::super.back()->curType;
    IdentRecPtr &curField = parseTypeRef::super.back()->curField;
    IdentRecPtr &l3idr31z = parseTypeRef::super.back()->l3idr31z;
    TypesPtr &selType = parseRecordDecl::super.back()->selType;
    Bitset &skipTarget = parseTypeRef::super.back()->skipTarget;
    parseTypeRef::caserec &cases = parseTypeRef::super.back()->cases;
    bool &isOuterDecl = parseRecordDecl::super.back()->isOuterDecl;
    IdentRecPtr &curEnum = parseTypeRef::super.back()->curEnum;
    bool &isPacked = parseTypeRef::super.back()->isPacked;

    parseTypeRef(selType, skipTarget + Bits(CASESY));
    if (curType->cast<RecordT>().fields == NULL) {
        curType->cast<RecordT>().fields = curField;
    } else {
        l3idr31z->list() = curField;
    }
    cond = isFileType(selType);
    if (not isOuterDecl and cond)
        error(errTypeMustNotBeFile);
    curType->cast<RecordT>().hasFiles |= cond;
    l3idr31z = curEnum;
    do {
        curField->typ = selType;
        if (isPacked) {
            l5var1z = selType->bits;
            curField->width() = l5var1z;
            if (l5var1z != 48) {
                for (pairIdx = 1; pairIdx <= cases.count; ++pairIdx) {
L11523:             l5var6z = &cases.pairs[pairIdx];
                    if (l5var6z->first >= l5var1z) {
                        curField->shift() = 48 - l5var6z->first;
                        curField->offset = l5var6z->second;
                        if (not optSflags.m.has(S6))
                            curField->shift() = 48 - curField->width() - curField->shift();
                        l5var6z->first = l5var6z->first - l5var1z;
                        if (l5var6z->first == 0) {
                            cases.pairs[pairIdx] = cases.pairs[cases.count];
                            cases.count = cases.count - 1;
                        } /* 11562 */
                        goto L11622;
                    }
                } /* 11564 */
                if (cases.count != 7) {
                    cases.count = cases.count + 1;
                    pairIdx = cases.count;
                } else {
                    l5var3z = 48;
                    for (l5var4z = 1; l5var4z <= 7; ++l5var4z) {
                        l5var5z = cases.pairs[l5var4z].first;
                        if (l5var5z < l5var3z) {
                            l5var3z = l5var5z;
                            pairIdx = l5var4z;
                        }
                    } /* for */
                } /* 11606 */
                cases.pairs[pairIdx] = std::make_pair(48, cases.size);
                cases.size = cases.size + 1;
                goto L11523;
            }
        } /* 11615 */
        curField->pckfield() = false;
        curField->offset = cases.size;
        cases.size = cases.size + selType->size;
L11622:
        if (PASINFOR.listMode == 3) {
            printf("%16c", ' ');
            if (curField->pckfield())
                printf("PACKED");
            printf(" FIELD ");
            printTextWord(curField->id);
            printf(".OFFSET=%05loB", curField->offset);
            if (curField->pckfield()) {
                printf(".<<=SHIFT=%2ld. WIDTH=%2ld BITS", curField->shift(),
                       curField->width());
            } else {
                printf(".WORDS=%ld", selType->size);
            }
            putchar('\n');
        }
        cond = (curField == curEnum);
        curField = curField->list();
    } while (!cond);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
leaq 0xc6c5e(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
addq $0x9, %rax
movq %rax, -0x38(%rbp)
leaq 0xc6c47(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
addq $0xf0, %rax
movq %rax, -0x40(%rbp)
leaq 0xc6c2e(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
addq $0xd0, %rax
movq %rax, -0x48(%rbp)
leaq 0xc6c15(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x50(%rbp)
leaq 0xc6c14(%rip), %rdi     # 0xd8ac8
callq 0x219b0
movq (%rax), %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
leaq 0xc6be5(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
movq %rax, -0x60(%rbp)
leaq 0xc6bd2(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
addq $0x10, %rax
movq %rax, -0x68(%rbp)
leaq 0xc6bd3(%rip), %rdi     # 0xd8ac8
callq 0x219b0
movq (%rax), %rax
movq %rax, -0x70(%rbp)
leaq 0xc6ba8(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
addq $0xc8, %rax
movq %rax, -0x78(%rbp)
leaq 0xc6b8f(%rip), %rdi     # 0xd8ab0
callq 0x21970
movq (%rax), %rax
addq $0x8, %rax
movq %rax, -0x80(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movl $0x21, %edi
callq 0x48e0
movq -0x1c0(%rbp), %rdi
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rsi
callq 0x1db20
movq -0x1b8(%rbp), %rsi
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rdx
leaq -0x188(%rbp), %rdi
callq 0x12e40
leaq -0x188(%rbp), %rdi
callq 0x219f0
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x1e840
cmpq $0x0, 0x20(%rax)
jne 0x11fd2
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1c8(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x1e840
movq -0x1c8(%rbp), %rcx
movq %rcx, 0x20(%rax)
jmp 0x11ff6
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1d0(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rdi
callq 0x1e970
movq -0x1d0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq (%rax), %rdi
callq 0xb030
movb %al, %cl
movq -0x38(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x70(%rbp), %rax
testb $0x1, (%rax)
jne 0x12029
movq -0x38(%rbp), %rax
testb $0x1, (%rax)
je 0x12029
movl $0x9, %edi
callq 0x7b40
movq -0x38(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x1d4(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x1e840
movl -0x1d4(%rbp), %edx
movb 0x28(%rax), %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %edx, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x28(%rax)
movq -0x78(%rbp), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x80(%rbp), %rax
testb $0x1, (%rax)
je 0x12314
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x217a0
movq -0x1e0(%rbp), %rcx
movq %rcx, (%rax)
cmpq $0x30, -0x8(%rbp)
je 0x12312
movq $0x1, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x68(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jg 0x1222b
jmp 0x120e7
movq -0x68(%rbp), %rax
addq $0x10, %rax
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
cmpq -0x8(%rbp), %rax
jl 0x12218
movq -0x30(%rbp), %rcx
movl $0x30, %eax
subq (%rcx), %rax
movq %rax, -0x1e8(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x216e0
movq -0x1e8(%rbp), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
leaq 0x6dfde(%rip), %rdi     # 0x80130
movl $0x3, %esi
callq 0x1e5f0
testb $0x1, %al
jne 0x121b4
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x217a0
movq %rax, %rcx
movl $0x30, %eax
subq (%rcx), %rax
movq %rax, -0x1f8(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x216e0
movq %rax, %rcx
movq -0x1f8(%rbp), %rax
subq (%rcx), %rax
movq %rax, -0x1f0(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x216e0
movq -0x1f0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rcx
subq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x12213
movq -0x68(%rbp), %rsi
addq $0x10, %rsi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq -0x68(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x21a10
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rcx
subq $0x1, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1234d
jmp 0x1221a
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x120d3
movq -0x68(%rbp), %rax
cmpq $0x7, 0x8(%rax)
je 0x12258
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x122b5
movq $0x30, -0x18(%rbp)
movq $0x1, -0x20(%rbp)
cmpq $0x7, -0x20(%rbp)
jg 0x122b3
movq -0x68(%rbp), %rax
addq $0x10, %rax
movq -0x20(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x122a3
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x122a5
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12268
jmp 0x122b5
movl $0x30, -0x1ac(%rbp)
movq -0x68(%rbp), %rsi
leaq -0x1ac(%rbp), %rdi
callq 0x21a40
movl %eax, -0x1a8(%rbp)
movq %rdx, -0x1a0(%rbp)
movq -0x68(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x21a70
movq -0x68(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
jmp 0x120e7
jmp 0x12314
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x21690
movb $0x0, (%rax)
movq -0x68(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rax
movq (%rax), %rcx
movq -0x58(%rbp), %rax
movq (%rax), %rax
addq (%rax), %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x3, 0xc66cb(%rip)     # 0xd8a20
jne 0x12432
leaq 0x1ffd5(%rip), %rdi     # 0x32337
movl $0x20, %esi
movb $0x0, %al
callq 0x4030
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x21690
testb $0x1, (%rax)
je 0x1238d
leaq 0x1ffb6(%rip), %rdi     # 0x3233c
movb $0x0, %al
callq 0x4030
leaq 0x1ffaf(%rip), %rdi     # 0x32343
movb $0x0, %al
callq 0x4030
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0x77d0
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x1ff8f(%rip), %rdi     # 0x3234b
movb $0x0, %al
callq 0x4030
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x21690
testb $0x1, (%rax)
je 0x12410
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x216e0
movq (%rax), %rax
movq %rax, -0x200(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x217a0
movq -0x200(%rbp), %rsi
movq (%rax), %rdx
leaq 0x1ff53(%rip), %rdi     # 0x3235a
movb $0x0, %al
callq 0x4030
jmp 0x12428
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rsi
leaq 0x1ff59(%rip), %rdi     # 0x3237a
movb $0x0, %al
callq 0x4030
movl $0xa, %edi
callq 0x4410
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rcx
cmpq (%rcx), %rax
sete %cl
movq -0x38(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x1e970
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movb (%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x12071
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
nopl (%rax,%rax)