// File: /workspace/github_c_makefile_star2_O1/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 0x3852
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 0x37db
testb $0x2, 0x38(%r13)
je 0x3866
movq 0x28(%r13), %rax
movzwl 0x26(%r13), %ecx
movb $0x1, (%rax,%rcx)
cmpl $0x0, 0x10(%r13)
jle 0x3be4
xorl %esi, %esi
movl $0xff, %ebx
movq %r13, 0x68(%rsp)
movq 0x28(%r13), %rax
cmpb $0x1, (%rax,%rsi)
jne 0x3bd4
movslq 0xc(%r13), %rax
testq %rax, %rax
jle 0x3b89
movl %esi, %ecx
shll $0x4, %ecx
movq %rcx, 0x48(%rsp)
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 %rsi, 0x30(%rsp)
movq %rcx, 0x40(%rsp)
movq %rax, 0x18(%rsp)
leaq -0x1(%rax), %rcx
movq 0x18(%r13), %rax
movq (%rax,%rsi,8), %r10
movq %rcx, 0x38(%rsp)
imulq $0x218, %rcx, %rcx      # imm = 0x218
cmpb $0x1, 0x14(%r10,%rcx)
movq %rdx, 0x58(%rsp)
jne 0x39da
addq %rdx, %r10
xorl %ecx, %ecx
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rsp)
addl %ecx, %eax
movl %eax, 0x8(%rsp)
xorl %r12d, %r12d
movq 0x40(%rsp), %rbp
movl (%r10,%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
movq %r10, %r15
leal (%r12,%rbp), %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, 0x2c(%rsp)
movslq %r10d, %rdi
addq 0x10(%r14), %rdi
leaq 0x2c(%rsp), %rsi
callq 0x21d0
movq %r15, %r10
incq %r12
cmpq $0x8, %r12
jne 0x3917
movq 0x20(%rsp), %rcx
incq %rcx
addq $0x20, %r10
cmpq $0x10, %rcx
jne 0x38ff
jmp 0x3b59
movl 0xc(%r13), %eax
addq %rcx, %r10
movb 0x8(%r10), %cl
movb 0x9(%r10), %r11b
movl 0x10(%r10), %esi
cmpl $0x2, %esi
sete %dl
testb $0x2, 0x38(%r13)
je 0x3a42
movzwl 0x26(%r13), %edi
cmpq %rdi, 0x30(%rsp)
jne 0x3a42
cmpl $0x2, %esi
sete %r8b
movzwl 0x24(%r13), %edi
cmpq %rdi, 0x18(%rsp)
sete %r9b
cmpq %rdi, 0x38(%rsp)
je 0x3a37
andb %r9b, %r8b
jne 0x3a37
testl %esi, %esi
jne 0x3a42
movq 0x18(%rsp), %rsi
addl $-0x2, %esi
cmpl %edi, %esi
jne 0x3a42
movl 0x52783(%rip), %ecx     # 0x561c0
movb $0x2, %r11b
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, 0x28(%rsp)
xorl %edx, %edx
movq %r10, 0x20(%rsp)
cmpq $0xf, %rdx
jne 0x3a80
testb $0x2, 0xc(%r10)
movzbl %r11b, %r11d
cmovnel 0x50(%rsp), %r11d
movl %r11d, 0x14(%rsp)
movzbl %r11b, %eax
movq %rax, 0x60(%rsp)
movq 0x48(%rsp), %rax
addl %edx, %eax
movl %eax, 0x8(%rsp)
xorl %ebx, %ebx
movl 0x28(%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 (%r10), %rcx
movq %rdx, %r12
movzwl 0x6(%rcx,%rdx,2), %ecx
movq 0x70(%rsp), %rdx
addl %ebx, %edx
btl %edx, %ecx
movslq %eax, %rbp
jae 0x3ae3
movq 0x50(%rsp), %rax
jmp 0x3b0a
movq 0x18(%r14), %rsi
testq %rsi, %rsi
je 0x3b05
cmpb $0x0, 0x14(%rsp)
jne 0x3b05
addq %rbp, %rsi
leaq 0xc(%rsp), %rdi
movq %r13, %rdx
callq 0x21d0
jmp 0x3b13
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 0x20(%rsp), %r10
movq %r12, %rdx
jne 0x3aa0
incq %rdx
cmpq $0x10, %rdx
movl $0xff, %ebx
movl 0x14(%rsp), %r11d
jne 0x3a6b
addl $-0x8, 0x10(%rsp)
movq 0x40(%rsp), %rcx
addq $-0x8, %rcx
movq 0x58(%rsp), %rdx
addq $-0x218, %rdx           # imm = 0xFDE8
cmpq $0x1, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rsi
jg 0x38c7
movslq 0x448(%r14), %rdx
movq %rsi, %rbx
imulq %rdx, %rsi
shlq $0x4, %rsi
shlq $0x4, %rdx
movq 0x8(%r14), %rdi
addq %rsi, %rdi
addq 0x10(%r14), %rsi
callq 0x21d0
testb $0x2, 0x38(%r13)
jne 0x3bba
xorl %eax, %eax
jmp 0x3bc5
movzwl 0x26(%r13), %eax
cmpq %rax, %rbx
sete %al
movq %rbx, %rsi
movq 0x28(%r13), %rcx
movb %al, (%rcx,%rbx)
movl $0xff, %ebx
incq %rsi
movslq 0x10(%r13), %rax
cmpq %rax, %rsi
jl 0x387d
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq