// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::chrtoscreen(int, int, char)
void TED::chrtoscreen(int x,int y, char scrchr)
{
	int j, k;
	unsigned char *charset = (unsigned char *) kernal+0x1000;

	if (isalpha(scrchr)) {
		scrchr=toupper(scrchr)-64;
		charset+=(scrchr<<3);
		for (j=0;j<8;j++)
			for (k=0;k<8;k++)
				(*(charset+j) & (0x80>>k)) ? screen[(y+j)*456+x+k]=0x00 : screen[(y+j)*456+x+k]=0x71;
		return;
	}
	charset+=(scrchr<<3);
	for (j=0;j<8;j++)
		for (k=0;k<8;k++)
			(*(charset+j) & (0x80>>k)) ? screen[(y+j)*456+x+k]=0x00 : screen[(y+j)*456+x+k]=0x71;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x11cea(%rip), %rax     # 0x28280
addq $0x1000, %rax           # imm = 0x1000
movq %rax, -0x28(%rbp)
movsbl -0x11(%rbp), %edi
callq 0x33d0
cmpl $0x0, %eax
je 0x16698
movsbl -0x11(%rbp), %edi
callq 0x3450
subl $0x40, %eax
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %ecx
shll $0x3, %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x16693
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x16683
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x1c(%rbp), %ecx
movl $0x80, %edx
sarl %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x16647
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x824, %rdx            # imm = 0x824
movl -0x10(%rbp), %ecx
addl -0x18(%rbp), %ecx
imull $0x1c8, %ecx, %ecx      # imm = 0x1C8
addl -0xc(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rdx
movb $0x0, 0x824(%rax,%rcx)
jmp 0x16675
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x824, %rdx            # imm = 0x824
movl -0x10(%rbp), %ecx
addl -0x18(%rbp), %ecx
imull $0x1c8, %ecx, %ecx      # imm = 0x1C8
addl -0xc(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rdx
movb $0x71, 0x824(%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x165ee
jmp 0x16685
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x165dd
jmp 0x1676a
movsbl -0x11(%rbp), %ecx
shll $0x3, %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x1676a
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x1675a
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x1c(%rbp), %ecx
movl $0x80, %edx
sarl %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x1671e
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x824, %rdx            # imm = 0x824
movl -0x10(%rbp), %ecx
addl -0x18(%rbp), %ecx
imull $0x1c8, %ecx, %ecx      # imm = 0x1C8
addl -0xc(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rdx
movb $0x0, 0x824(%rax,%rcx)
jmp 0x1674c
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x824, %rdx            # imm = 0x824
movl -0x10(%rbp), %ecx
addl -0x18(%rbp), %ecx
imull $0x1c8, %ecx, %ecx      # imm = 0x1C8
addl -0xc(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rdx
movb $0x71, 0x824(%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x166c5
jmp 0x1675c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x166b4
addq $0x30, %rsp
popq %rbp
retq