// File: /workspace/github_c_makefile_star2_O3/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 $0x78, %rsp
movq %rsi, %r13
movq %rdi, %r14
cmpb $0x1, 0x480(%rsi)
jne 0x387b
movb $0x0, 0x480(%r13)
xorl %edx, %edx
movl $0xff, %esi
movl 0x80(%r13,%rdx,4), %edi
movl %edi, %r9d
shrl $0x10, %r9d
andl %esi, %r9d
movl %edi, %r8d
shrl $0x8, %r8d
movb $0x8, %cl
subb 0x420(%r14), %cl
shrl %cl, %r9d
andl %esi, %r8d
movb $0x8, %cl
subb 0x428(%r14), %cl
shrl %cl, %r8d
andl %esi, %edi
movb $0x8, %cl
subb 0x430(%r14), %cl
shrl %cl, %edi
movb 0x424(%r14), %cl
movb 0x42c(%r14), %al
shll %cl, %r9d
movl %eax, %ecx
shll %cl, %r8d
addl %r9d, %r8d
movb 0x434(%r14), %cl
shll %cl, %edi
addl %r8d, %edi
movl %edi, 0x20(%r14,%rdx,4)
incq %rdx
cmpq $0x100, %rdx            # imm = 0x100
jne 0x3804
testb $0x2, 0x38(%r13)
je 0x388f
movq 0x28(%r13), %rax
movzwl 0x26(%r13), %ecx
movb $0x1, (%rax,%rcx)
movl 0x10(%r13), %eax
testl %eax, %eax
jle 0x3c1a
movq 0x28(%r13), %rcx
xorl %esi, %esi
movl $0xff, %ebx
movq %r13, 0x68(%rsp)
cmpb $0x1, (%rcx,%rsi)
jne 0x3c0b
movslq 0xc(%r13), %rax
testq %rax, %rax
movq %rsi, 0x18(%rsp)
jle 0x3bb7
movq %rsi, %r10
shlq $0x4, %r10
leal -0x1(,%rax,8), %ecx
movl %ecx, 0x10(%rsp)
leal -0x8(,%rax,8), %ecx
imulq $0x218, %rax, %rdx      # imm = 0x218
addq $-0x203, %rdx           # imm = 0xFDFD
movq %r10, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %rax, 0x20(%rsp)
leaq -0x1(%rax), %rcx
movq 0x18(%r13), %rax
movq (%rax,%rsi,8), %r11
movq %rcx, 0x38(%rsp)
imulq $0x218, %rcx, %rcx      # imm = 0x218
cmpb $0x1, 0x14(%r11,%rcx)
movq %rdx, 0x58(%rsp)
jne 0x3a07
addq %rdx, %r11
xorl %eax, %eax
movq %rax, 0x28(%rsp)
addl %r10d, %eax
movl %eax, 0x8(%rsp)
xorl %r12d, %r12d
movq 0x40(%rsp), %r15
movl (%r11,%r12,4), %esi
movl 0x448(%r14), %edi
imull 0x8(%rsp), %edi
movslq 0x44c(%r14), %rdx
movl %esi, %r9d
shrl $0x10, %r9d
andl %ebx, %r9d
movl %esi, %r8d
shrl $0x8, %r8d
movb $0x8, %cl
subb 0x420(%r14), %cl
shrl %cl, %r9d
andl %ebx, %r8d
movb $0x8, %cl
subb 0x428(%r14), %cl
shrl %cl, %r8d
andl %ebx, %esi
movb $0x8, %cl
subb 0x430(%r14), %cl
shrl %cl, %esi
leal (%r15,%r12), %r10d
imull %edx, %r10d
movb 0x424(%r14), %cl
movb 0x42c(%r14), %al
shll %cl, %r9d
movl %eax, %ecx
shll %cl, %r8d
addl %edi, %r10d
addl %r9d, %r8d
movb 0x434(%r14), %cl
shll %cl, %esi
addl %r8d, %esi
movl %esi, 0x34(%rsp)
movslq %r10d, %rdi
addq 0x10(%r14), %rdi
leaq 0x34(%rsp), %rsi
movq %r11, %rbp
callq 0x21d0
movq %rbp, %r11
incq %r12
cmpq $0x8, %r12
jne 0x393f
movq 0x28(%rsp), %rax
incq %rax
addq $0x20, %r11
cmpq $0x10, %rax
movq 0x48(%rsp), %r10
jne 0x392b
jmp 0x3b85
movl 0xc(%r13), %eax
addq %rcx, %r11
movb 0x8(%r11), %cl
movb 0x9(%r11), %bpl
movl 0x10(%r11), %esi
cmpl $0x2, %esi
sete %dl
testb $0x2, 0x38(%r13)
je 0x3a6f
movzwl 0x26(%r13), %edi
cmpq %rdi, 0x18(%rsp)
jne 0x3a6f
cmpl $0x2, %esi
sete %r8b
movzwl 0x24(%r13), %edi
cmpq %rdi, 0x20(%rsp)
sete %r9b
cmpq %rdi, 0x38(%rsp)
je 0x3a64
andb %r9b, %r8b
jne 0x3a64
testl %esi, %esi
jne 0x3a6f
movq 0x20(%rsp), %rsi
addl $-0x2, %esi
cmpl %edi, %esi
jne 0x3a6f
movl 0x52756(%rip), %ecx     # 0x561c0
movb $0x2, %bpl
xorl %ecx, %ecx
xorl %esi, %esi
movb %dl, %sil
shll $0x3, %esi
movq %rsi, 0x70(%rsp)
movzbl %cl, %ecx
movq %rcx, 0x50(%rsp)
shll $0x3, %eax
movl 0x10(%rsp), %ecx
subl %eax, %ecx
movl %ecx, 0x30(%rsp)
xorl %edx, %edx
movq %r11, 0x28(%rsp)
cmpq $0xf, %rdx
jne 0x3aac
testb $0x2, 0xc(%r11)
movzbl %bpl, %ebp
cmovnel 0x50(%rsp), %ebp
movl %ebp, 0x14(%rsp)
movzbl %bpl, %eax
movq %rax, 0x60(%rsp)
leal (%r10,%rdx), %eax
movl %eax, 0x8(%rsp)
xorl %ebx, %ebx
movl 0x30(%rsp), %r15d
movl 0x4(%r13), %eax
addl %r15d, %eax
movslq 0x44c(%r14), %r13
movl %r13d, %ecx
imull %eax, %ecx
movl 0x448(%r14), %eax
imull 0x8(%rsp), %eax
addl %ecx, %eax
movq (%r11), %rcx
movq %rdx, %r12
movzwl 0x6(%rcx,%rdx,2), %ecx
movq 0x70(%rsp), %rdx
addl %ebx, %edx
btl %edx, %ecx
movslq %eax, %rbp
jae 0x3b0b
movq 0x50(%rsp), %rax
jmp 0x3b32
movq 0x18(%r14), %rsi
testq %rsi, %rsi
je 0x3b2d
cmpb $0x0, 0x14(%rsp)
jne 0x3b2d
addq %rbp, %rsi
leaq 0xc(%rsp), %rdi
movq %r13, %rdx
callq 0x21d0
jmp 0x3b3b
movq 0x60(%rsp), %rax
movl 0x20(%r14,%rax,4), %eax
movl %eax, 0xc(%rsp)
addq 0x10(%r14), %rbp
movq %rbp, %rdi
leaq 0xc(%rsp), %rsi
movq %r13, %rdx
callq 0x21d0
incl %ebx
decl %r15d
cmpl $0x8, %ebx
movq 0x68(%rsp), %r13
movq 0x28(%rsp), %r11
movq %r12, %rdx
jne 0x3ac8
incq %rdx
cmpq $0x10, %rdx
movl $0xff, %ebx
movq 0x48(%rsp), %r10
movl 0x14(%rsp), %ebp
jne 0x3a98
addl $-0x8, 0x10(%rsp)
movq 0x40(%rsp), %rcx
addq $-0x8, %rcx
movq 0x58(%rsp), %rdx
addq $-0x218, %rdx           # imm = 0xFDE8
cmpq $0x1, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rsp), %rsi
jg 0x38f3
jmp 0x3bbe
movl %esi, %r10d
shll $0x4, %r10d
movslq 0x448(%r14), %rdx
movslq %r10d, %rsi
imulq %rdx, %rsi
shlq $0x4, %rdx
movq 0x8(%r14), %rdi
addq %rsi, %rdi
addq 0x10(%r14), %rsi
callq 0x21d0
testb $0x2, 0x38(%r13)
jne 0x3bf0
xorl %eax, %eax
movq 0x18(%rsp), %rsi
jmp 0x3c00
movzwl 0x26(%r13), %eax
movq 0x18(%rsp), %rsi
cmpq %rax, %rsi
sete %al
movq 0x28(%r13), %rcx
movb %al, (%rcx,%rsi)
movl 0x10(%r13), %eax
incq %rsi
movslq %eax, %rdx
cmpq %rdx, %rsi
jl 0x38ab
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq