// File: /workspace/github_cpp_makefile_star2_O2/besm6[P]pascal-re/dtran.cc
// Function: Dtran::fill_lengths()
void fill_lengths() {
        head_len = memory[0] & 07777;
        sym_len = (memory[0] >> 12) & 07777;
        debug_len = (memory[0] >> 36);
        set_len = memory[1] & 077777;
        data_len = (memory[1] >> 15) & 077777;
        long_len = (memory[1] >> 30) & 077777;
        cmd_len = memory[2] & 077777;
        bss_len = (memory[2] >> 15) & 077777;
        if (bss_len != 0) {
            fprintf(stderr, "BSS section not supported yet\n");
            exit(1);
        }
        const_len = (memory[2] >> 30) & 077777;
        table_off = 3 + cmd_len + const_len + data_len + set_len;
        long_off = table_off + head_len + sym_len;
        debug_off = long_off + long_len;
        comment_off = debug_off + debug_len;
        printf(" %s:,NAME, NEW DTRAN\n",
               get_text_word(memory[table_off-0]).c_str());
        printf("C Commands: %o\n", cmd_len);
        printf("C Constants: %o\n", const_len);
        printf("C BSS: %o\n", bss_len);
        printf("C Memory size: %o\n", cmd_len+const_len+bss_len);
        printf("C Header: %o\n", head_len);
        printf("C Symbols: %o\n", sym_len);
        printf("C Long symbols: %o\n", long_len);
        printf("C Debug: %o\n", debug_len);
        printf("C Data: %o + set: %o\n", data_len, set_len);
        printf("C Actual length of the object file is %o\n",
               comment_off);
        if (nolabels) {
            printf(" /:,BSS,\n");
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movq 0x50(%rdi), %rcx
movl $0xfff, %edi            # imm = 0xFFF
movl %eax, %esi
andl %edi, %esi
movl %esi, (%rbx)
movl %eax, %edx
shrl $0xc, %edx
andl %edi, %edx
movl %edx, 0x4(%rbx)
shrq $0x24, %rax
movl %eax, 0x8(%rbx)
movl $0x7fff, %r11d          # imm = 0x7FFF
movl %ecx, %edi
andl %r11d, %edi
movl %edi, 0x10(%rbx)
movl %ecx, %r8d
shrl $0xf, %r8d
andl %r11d, %r8d
movl %r8d, 0xc(%rbx)
shrq $0x1e, %rcx
andl %r11d, %ecx
movl %ecx, 0x14(%rbx)
movq 0x58(%rbx), %r9
movl %r9d, %r10d
andl %r11d, %r10d
movl %r10d, 0x18(%rbx)
movl %r9d, %ebp
shrl $0xf, %ebp
andl %r11d, %ebp
movl %ebp, 0x1c(%rbx)
jne 0x322f
shrq $0x1e, %r9
andl $0x7fff, %r9d           # imm = 0x7FFF
movl %r9d, 0x20(%rbx)
addl %r8d, %edi
addl %r10d, %edi
movl %edi, %r8d
addl %r9d, %r8d
addl %r9d, %edi
addl $0x3, %edi
movl %edi, 0x24(%rbx)
addl %esi, %edx
addl %edi, %edx
movl %edx, 0x2c(%rbx)
addl %ecx, %edx
movl %edx, 0x28(%rbx)
addl %eax, %edx
movl %edx, 0x30(%rbx)
movq 0x60(%rbx,%r8,8), %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x32a6
movq (%r14), %rsi
leaq 0x21e0(%rip), %rdi      # 0x5333
xorl %eax, %eax
callq 0x2030
movq %r14, %rdi
callq 0x20b0
movl 0x18(%rbx), %esi
leaq 0x21dd(%rip), %rdi      # 0x5349
xorl %eax, %eax
callq 0x2030
movl 0x20(%rbx), %esi
leaq 0x21dc(%rip), %rdi      # 0x5359
xorl %eax, %eax
callq 0x2030
movl 0x1c(%rbx), %esi
leaq 0x21dc(%rip), %rdi      # 0x536a
xorl %eax, %eax
callq 0x2030
movl 0x20(%rbx), %esi
addl 0x18(%rbx), %esi
addl 0x1c(%rbx), %esi
leaq 0x21d0(%rip), %rdi      # 0x5375
xorl %eax, %eax
callq 0x2030
movl (%rbx), %esi
leaq 0x21d3(%rip), %rdi      # 0x5388
xorl %eax, %eax
callq 0x2030
movl 0x4(%rbx), %esi
leaq 0x21d0(%rip), %rdi      # 0x5396
xorl %eax, %eax
callq 0x2030
movl 0x14(%rbx), %esi
leaq 0x21ce(%rip), %rdi      # 0x53a5
xorl %eax, %eax
callq 0x2030
movl 0x8(%rbx), %esi
leaq 0x21d1(%rip), %rdi      # 0x53b9
xorl %eax, %eax
callq 0x2030
movl 0xc(%rbx), %esi
movl 0x10(%rbx), %edx
leaq 0x21ca(%rip), %rdi      # 0x53c6
xorl %eax, %eax
callq 0x2030
movl 0x30(%rbx), %esi
leaq 0x21cf(%rip), %rdi      # 0x53dc
xorl %eax, %eax
callq 0x2030
cmpb $0x1, 0x40(%rbx)
jne 0x3226
leaq 0x2543(%rip), %rdi      # 0x5764
callq 0x2220
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x4da2(%rip), %rax      # 0x7fd8
movq (%rax), %rcx
leaq 0x20d4(%rip), %rdi      # 0x5314
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
pushq $0x1
popq %rdi
callq 0x2190
nop