// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: dump_symbols
void
dump_symbols(void) {
    int ix;
    WORD32 addr;

    objectfile = fopen( sympathname, "wb" );
    if (!objectfile) {
	perror(sympathname);
	return;
    }

    punchLeader(0);
    punchLoader();
    punchLeader(5);

    /* XXX fudge addr -- get count, and subtract 2N from 07750? */
    addr = 05000;

    for( ix = 0; ix < symbol_top; ix++ ) {
	int i, type;
	WORD32 name;

	type = symtab[ix].type;
	if (M_FIXED(type) || M_PSEUDO(type) || M_MACRO(type))
	    continue;

	name = 0;
	for (i = 0; i < 3; i++) {
	    char c;

	    c = symtab[ix].name[i];
	    /* XXX leave on NUL? */

	    c = ascii_to_fiodec[tolower(c) & 0177];
	    /* XXX check for BAD entries? */

	    /* XXX OR in val<<(3-i)*6?? */
	    name <<= 6;
	    name |= c & CHARBITS;
	}
	punchLocObject(addr++, permute(name));
	punchLocObject(addr++, symtab[ix].val);
    }
    flushLoader();
    punchTriplet( JMP );		/* ??? */
    punchLeader(0);
    fclose(objectfile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x8991(%rip), %rdi      # 0xbf50
leaq 0x5061(%rip), %rsi      # 0x8627
callq 0x2150
movq %rax, 0x883e(%rip)      # 0xbe10
cmpq $0x0, 0x8836(%rip)      # 0xbe10
jne 0x35ed
leaq 0x896d(%rip), %rdi      # 0xbf50
callq 0x2160
jmp 0x3742
xorl %edi, %edi
callq 0x2f80
callq 0x2ff0
movl $0x5, %edi
callq 0x2f80
movl $0xa00, -0x8(%rbp)      # imm = 0xA00
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x8736(%rip), %eax      # 0xbd50
jge 0x3720
movq 0x8721(%rip), %rax      # 0xbd48
movslq -0x4(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
andl $0x2, %eax
cmpl $0x2, %eax
je 0x365c
movl -0x10(%rbp), %eax
andl $0x43, %eax
cmpl $0x43, %eax
je 0x365c
movl -0x10(%rbp), %eax
andl $0x101, %eax            # imm = 0x101
cmpl $0x101, %eax            # imm = 0x101
jne 0x3661
jmp 0x3712
movl $0x0, -0x14(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x3, -0xc(%rbp)
jge 0x36cf
movq 0x86cc(%rip), %rax      # 0xbd48
movslq -0x4(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movb 0x4(%rax,%rcx), %al
movb %al, -0x15(%rbp)
movsbl -0x15(%rbp), %edi
callq 0x2120
andl $0x7f, %eax
movslq %eax, %rcx
leaq 0x85b8(%rip), %rax      # 0xbc60
movb (%rax,%rcx), %al
movb %al, -0x15(%rbp)
movl -0x14(%rbp), %eax
shll $0x6, %eax
movl %eax, -0x14(%rbp)
movsbl -0x15(%rbp), %eax
andl $0x3f, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x366f
movl -0x8(%rbp), %eax
movl %eax, -0x1c(%rbp)
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x14(%rbp), %edi
callq 0x37d0
movl -0x1c(%rbp), %edi
movl %eax, %esi
callq 0x66b0
movl -0x8(%rbp), %edi
movl %edi, %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movq 0x8649(%rip), %rax      # 0xbd48
movslq -0x4(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %esi
callq 0x66b0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3611
callq 0x6770
movl $0x30000, %edi          # imm = 0x30000
callq 0x6660
xorl %edi, %edi
callq 0x2f80
movq 0x86d3(%rip), %rdi      # 0xbe10
callq 0x2080
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)