// File: /workspace/github_c_makefile_star2_O0/mist64[P]cbm6502asm/src/outline.c
// Function: outhex
void outhex(unsigned int addr, char data) {
	if (!binptr) {
		sprintf(binbuf, ";00%04X", binadr = addr);
		chksum = addr >> 8 & 255;
		chksum += addr & 255;
		binptr = 5;
	}
	if (addr == binadr && binptr < 37) {
		sprintf(&binbuf[binptr += 2], "%02X", data & 255);
		chksum += data & 255;
		binadr++;
	} else {
		int i = (binptr - 5) / 2;
		chksum += i;
		if (i > 15) {
			binbuf[1] = '1';
			i &= 15;
		}
		binbuf[2] = i + (i > 9 ? '7' : '0');
		sprintf(&binbuf[binptr += 2], "%04X\0", chksum);
		fprintf(file_obj, "%s\n", binbuf);
		binlin++;
		binptr = 0;
		outhex(addr, data);
	}
	binadr = addr + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movl %edi, -0x4(%rbp)
movb %al, -0x5(%rbp)
leaq 0x5d38(%rip), %rax      # 0x107f0
cmpl $0x0, (%rax)
jne 0xab1b
movl -0x4(%rbp), %edx
leaq 0x5d2d(%rip), %rax      # 0x107f4
movl %edx, (%rax)
leaq 0x61b0(%rip), %rdi      # 0x10c80
leaq 0x308a(%rip), %rsi      # 0xdb61
movb $0x0, %al
callq 0x11d0
movl -0x4(%rbp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
leaq 0x5cfb(%rip), %rax      # 0x107ec
movl %ecx, (%rax)
movl -0x4(%rbp), %ecx
andl $0xff, %ecx
leaq 0x5ce9(%rip), %rax      # 0x107ec
addl (%rax), %ecx
leaq 0x5ce0(%rip), %rax      # 0x107ec
movl %ecx, (%rax)
leaq 0x5cdb(%rip), %rax      # 0x107f0
movl $0x5, (%rax)
movl -0x4(%rbp), %eax
leaq 0x5ccf(%rip), %rcx      # 0x107f4
cmpl (%rcx), %eax
jne 0xaba4
leaq 0x5cc0(%rip), %rax      # 0x107f0
cmpl $0x25, (%rax)
jge 0xaba4
leaq 0x5cb4(%rip), %rax      # 0x107f0
movl (%rax), %eax
addl $0x2, %eax
leaq 0x5ca8(%rip), %rcx      # 0x107f0
movl %eax, (%rcx)
cltq
leaq 0x612d(%rip), %rdi      # 0x10c80
addq %rax, %rdi
movsbl -0x5(%rbp), %edx
andl $0xff, %edx
leaq 0x2f9a(%rip), %rsi      # 0xdb01
movb $0x0, %al
callq 0x11d0
movsbl -0x5(%rbp), %ecx
andl $0xff, %ecx
leaq 0x5c6d(%rip), %rax      # 0x107ec
addl (%rax), %ecx
leaq 0x5c64(%rip), %rax      # 0x107ec
movl %ecx, (%rax)
leaq 0x5c63(%rip), %rax      # 0x107f4
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x5c57(%rip), %rax      # 0x107f4
movl %ecx, (%rax)
jmp 0xac93
leaq 0x5c45(%rip), %rax      # 0x107f0
movl (%rax), %eax
subl $0x5, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %ecx
leaq 0x5c27(%rip), %rax      # 0x107ec
addl (%rax), %ecx
leaq 0x5c1e(%rip), %rax      # 0x107ec
movl %ecx, (%rax)
cmpl $0xf, -0xc(%rbp)
jle 0xabea
leaq 0x60a3(%rip), %rax      # 0x10c80
movb $0x31, 0x1(%rax)
movl -0xc(%rbp), %eax
andl $0xf, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl -0xc(%rbp), %esi
movl $0x30, %ecx
movl $0x37, %edx
cmpl $0x9, %esi
cmovgl %edx, %ecx
addl %ecx, %eax
movb %al, %cl
leaq 0x6075(%rip), %rax      # 0x10c80
movb %cl, 0x2(%rax)
leaq 0x5bdb(%rip), %rax      # 0x107f0
movl (%rax), %eax
addl $0x2, %eax
leaq 0x5bcf(%rip), %rcx      # 0x107f0
movl %eax, (%rcx)
cltq
leaq 0x6054(%rip), %rdi      # 0x10c80
addq %rax, %rdi
leaq 0x5bb6(%rip), %rax      # 0x107ec
movl (%rax), %edx
leaq 0x2f2a(%rip), %rsi      # 0xdb69
movb $0x0, %al
callq 0x11d0
leaq 0x5bcb(%rip), %rax      # 0x10818
movq (%rax), %rdi
leaq 0x2862(%rip), %rsi      # 0xd4b9
leaq 0x6022(%rip), %rdx      # 0x10c80
movb $0x0, %al
callq 0x1120
leaq 0x5b8c(%rip), %rax      # 0x107f8
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x5b80(%rip), %rax      # 0x107f8
movl %ecx, (%rax)
leaq 0x5b6f(%rip), %rax      # 0x107f0
movl $0x0, (%rax)
movl -0x4(%rbp), %edi
movsbl -0x5(%rbp), %esi
callq 0xaaa0
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
leaq 0x5b54(%rip), %rax      # 0x107f4
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)