// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./fb/common.h
// Function: refresh
void refresh(struct framebuffer_t *fb, struct terminal_t *term)
{
	if (term->palette_modified) {
		term->palette_modified = false;
		for (int i = 0; i < COLORS; i++)
			fb->real_palette[i] = color2pixel(&fb->info, term->virtual_palette[i]);
	}

	if (term->mode & MODE_CURSOR)
		term->line_dirty[term->cursor.y] = true;

	for (int line = 0; line < term->lines; line++) {
		if (term->line_dirty[line]) {
			draw_line(fb, term, line);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r12
movq %rdi, %r14
cmpb $0x1, 0x480(%rsi)
jne 0x36c9
movb $0x0, 0x480(%r12)
leaq 0x420(%r14), %r15
xorl %ebx, %ebx
cmpq $0x100, %rbx            # imm = 0x100
je 0x36c9
movl 0x80(%r12,%rbx,4), %esi
movq %r15, %rdi
callq 0x35d3
movl %eax, 0x20(%r14,%rbx,4)
incq %rbx
jmp 0x36a6
testb $0x2, 0x38(%r12)
je 0x36e0
movq 0x28(%r12), %rax
movzwl 0x26(%r12), %ecx
movb $0x1, (%rax,%rcx)
leaq 0x420(%r14), %rax
movq %rax, 0x58(%rsp)
xorl %ecx, %ecx
movq %r12, 0x48(%rsp)
movslq 0x10(%r12), %rax
cmpq %rax, %rcx
jge 0x39ff
movq 0x28(%r12), %rax
cmpb $0x1, (%rax,%rcx)
jne 0x39f7
movq %rcx, %rdx
movl 0xc(%r12), %ecx
movq %rdx, 0x18(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x28(%rsp)
leal -0x1(,%rcx,8), %eax
movl %eax, 0x10(%rsp)
leal -0x1(%rcx), %eax
movl %eax, 0xc(%rsp)
testl %ecx, %ecx
jle 0x39a6
leaq -0x1(%rcx), %r11
movq 0x18(%r12), %rax
movq 0x18(%rsp), %rdx
movq (%rax,%rdx,8), %rsi
movl %r11d, %eax
imulq $0x218, %rax, %rdx      # imm = 0x218
cmpb $0x1, 0x14(%rsi,%rdx)
movq %r11, 0x38(%rsp)
jne 0x380a
movl 0xc(%rsp), %eax
imulq $0x218, %rax, %rax      # imm = 0x218
leal (,%r11,8), %ecx
movl %ecx, 0x4(%rsp)
leaq (%rsi,%rax), %r15
addq $0x15, %r15
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x3990
movq 0x28(%rsp), %rax
movl %eax, %ebp
movq %rcx, 0x20(%rsp)
orl %ecx, %ebp
xorl %r13d, %r13d
cmpq $0x8, %r13
je 0x37f7
movl (%r15,%r13,4), %esi
movl 0x448(%r14), %eax
imull %ebp, %eax
movslq 0x44c(%r14), %r12
movl 0x4(%rsp), %ebx
orl %r13d, %ebx
imull %r12d, %ebx
addl %eax, %ebx
movq 0x58(%rsp), %rdi
callq 0x35d3
movl %eax, 0x34(%rsp)
movslq %ebx, %rdi
addq 0x10(%r14), %rdi
leaq 0x34(%rsp), %rsi
movq %r12, %rdx
callq 0x21c0
incq %r13
jmp 0x37a8
movq 0x20(%rsp), %rcx
incq %rcx
addq $0x20, %r15
movq 0x48(%rsp), %r12
jmp 0x378d
movl 0xc(%r12), %eax
addq %rdx, %rsi
movq %rsi, 0x20(%rsp)
movb 0x8(%rsi), %dl
movb 0x9(%rsi), %bl
movl 0x10(%rsi), %edi
cmpl $0x2, %edi
sete %sil
testb $0x2, 0x38(%r12)
je 0x3870
movzwl 0x26(%r12), %r8d
cmpq %r8, 0x18(%rsp)
jne 0x3870
cmpl $0x2, %edi
sete %r9b
movzwl 0x24(%r12), %r8d
cmpq %r8, %rcx
sete %r10b
cmpl %r8d, %r11d
je 0x3866
andb %r10b, %r9b
jne 0x3866
testl %edi, %edi
jne 0x3870
addl $-0x2, %ecx
cmpl %r8d, %ecx
jne 0x3870
movl 0x51954(%rip), %ecx     # 0x551c0
movb $0x2, %bl
xorl %edx, %edx
xorl %ecx, %ecx
movb %sil, %cl
shll $0x3, %ecx
movq %rcx, 0x60(%rsp)
movzbl %dl, %ecx
movq %rcx, 0x40(%rsp)
shll $0x3, %eax
movl 0x10(%rsp), %ecx
subl %eax, %ecx
movl %ecx, 0x30(%rsp)
xorl %esi, %esi
movq 0x20(%rsp), %rdx
cmpq $0xf, %rsi
je 0x38aa
cmpq $0x10, %rsi
jne 0x38b6
jmp 0x3995
testb $0x2, 0xc(%rdx)
movzbl %bl, %ebx
cmovnel 0x40(%rsp), %ebx
movl %ebx, 0x14(%rsp)
movzbl %bl, %eax
movq %rax, 0x50(%rsp)
movq 0x28(%rsp), %rax
orl %esi, %eax
movl %eax, 0x4(%rsp)
xorl %r13d, %r13d
movl 0x30(%rsp), %r15d
cmpl $0x8, %r13d
je 0x397f
movl 0x4(%r12), %eax
addl %r15d, %eax
movslq 0x44c(%r14), %rbp
movl %ebp, %ecx
imull %eax, %ecx
movl 0x448(%r14), %eax
imull 0x4(%rsp), %eax
addl %ecx, %eax
movq (%rdx), %rcx
movq %rsi, %rbx
movzwl 0x6(%rcx,%rsi,2), %ecx
movq 0x60(%rsp), %rdx
addl %r13d, %edx
btl %edx, %ecx
movslq %eax, %r12
jae 0x3923
movq 0x40(%rsp), %rax
jmp 0x394a
movq 0x18(%r14), %rsi
testq %rsi, %rsi
je 0x3945
cmpb $0x0, 0x14(%rsp)
jne 0x3945
addq %r12, %rsi
leaq 0x8(%rsp), %rdi
movq %rbp, %rdx
callq 0x21c0
jmp 0x3953
movq 0x50(%rsp), %rax
movl 0x20(%r14,%rax,4), %eax
movl %eax, 0x8(%rsp)
addq 0x10(%r14), %r12
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movq %rbp, %rdx
callq 0x21c0
incl %r13d
decl %r15d
movq 0x48(%rsp), %r12
movq 0x20(%rsp), %rdx
movq %rbx, %rsi
jmp 0x38d5
incq %rsi
movq 0x38(%rsp), %r11
movl 0x14(%rsp), %ebx
jmp 0x3899
movq 0x38(%rsp), %r11
addl $-0x8, 0x10(%rsp)
decl 0xc(%rsp)
movq %r11, %rcx
jmp 0x3738
movslq 0x448(%r14), %rdx
movq 0x28(%rsp), %rsi
imulq %rdx, %rsi
shlq $0x4, %rdx
movq 0x8(%r14), %rdi
addq %rsi, %rdi
addq 0x10(%r14), %rsi
callq 0x21c0
testb $0x2, 0x38(%r12)
jne 0x39db
xorl %eax, %eax
movq 0x18(%rsp), %rdx
jmp 0x39ec
movzwl 0x26(%r12), %eax
movq 0x18(%rsp), %rdx
cmpq %rax, %rdx
sete %al
movq 0x28(%r12), %rcx
movb %al, (%rcx,%rdx)
movq %rdx, %rcx
incq %rcx
jmp 0x36f3
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq