LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: erase_cell
void erase_cell(struct terminal_t *term, int y, int x)
{
	struct cell_t *cellp;

	cellp             = &term->cells[y][x];
	cellp->glyphp     = term->glyph[DEFAULT_CHAR];
	cellp->color_pair = term->color_pair; /* bce */
	cellp->attribute  = ATTR_RESET;
	cellp->width      = HALF;
	cellp->has_pixmap = false;

	term->line_dirty[y] = true;
}

// Assembly:
movq 0x18(%rdi), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rax
movslq %edx, %rdx
imulq $0x218, %rdx, %rdx      # imm = 0x218
movq 0x588(%rdi), %rsi
movq %rsi, (%rax,%rdx)
movzwl 0x4c(%rdi), %esi
movw %si, 0x8(%rax,%rdx)
movabsq $0x100000000, %rsi      # imm = 0x100000000
movq %rsi, 0xc(%rax,%rdx)
movb $0x0, 0x14(%rax,%rdx)
movq 0x28(%rdi), %rax
movb $0x1, (%rax,%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: copy_cell
void copy_cell(struct terminal_t *term, int dst_y, int dst_x, int src_y, int src_x)
{
	struct cell_t *dst, *src;

	dst = &term->cells[dst_y][dst_x];
	src = &term->cells[src_y][src_x];

	if (src->width == NEXT_TO_WIDE) {
		return;
	} else if (src->width == WIDE && dst_x == (term->cols - 1)) {
		erase_cell(term, dst_y, dst_x);
	} else {
		*dst = *src;
		if (src->width == WIDE) {
			*(dst + 1) = *src;
			(dst + 1)->width = NEXT_TO_WIDE;
		}
		term->line_dirty[dst_y] = true;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movslq %ecx, %rax
movq (%rdi,%rax,8), %r15
movslq %r8d, %rax
imulq $0x218, %rax, %rax      # imm = 0x218
movl 0x10(%r15,%rax), %ecx
testl %ecx, %ecx
je 0x3cef
movslq %esi, %r12
movslq %edx, %rsi
imulq $0x218, %rsi, %r14      # imm = 0x218
addq (%rdi,%r12,8), %r14
cmpl $0x2, %ecx
jne 0x3cad
movl 0xc(%rbx), %ecx
decl %ecx
cmpl %edx, %ecx
jne 0x3cad
movq 0x588(%rbx), %rax
movq %rax, (%r14)
movzwl 0x4c(%rbx), %eax
movw %ax, 0x8(%r14)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0xc(%r14)
movb $0x0, 0x14(%r14)
jmp 0x3ce6
addq %rax, %r15
movl $0x218, %edx            # imm = 0x218
movq %r14, %rdi
movq %r15, %rsi
callq 0x21d0
cmpl $0x2, 0x10(%r15)
jne 0x3ce6
leaq 0x218(%r14), %rdi
movl $0x218, %edx            # imm = 0x218
movq %r15, %rsi
callq 0x21d0
movl $0x0, 0x228(%r14)
movq 0x28(%rbx), %rax
movb $0x1, (%rax,%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: set_cell
int set_cell(struct terminal_t *term, int y, int x, const struct glyph_t *glyphp)
{
	struct cell_t cell, *cellp;
	uint8_t color_tmp;

	cell.glyphp = glyphp;

	cell.color_pair.fg = (term->attribute & attr_mask[ATTR_BOLD] && term->color_pair.fg <= 7) ?
		term->color_pair.fg + BRIGHT_INC: term->color_pair.fg;
	cell.color_pair.bg = (term->attribute & attr_mask[ATTR_BLINK] && term->color_pair.bg <= 7) ?
		term->color_pair.bg + BRIGHT_INC: term->color_pair.bg;

	if (term->attribute & attr_mask[ATTR_REVERSE]) {
		color_tmp          = cell.color_pair.fg;
		cell.color_pair.fg = cell.color_pair.bg;
		cell.color_pair.bg = color_tmp;
	}

	cell.attribute  = term->attribute;
	cell.width      = glyphp->width;
	cell.has_pixmap = false;

	cellp    = &term->cells[y][x];
	*cellp   = cell;
	term->line_dirty[y] = true;

	if (cell.width == WIDE && x + 1 < term->cols) {
		cellp        = &term->cells[y][x + 1];
		*cellp       = cell;
		cellp->width = NEXT_TO_WIDE;
		return WIDE;
	}

	if (cell.width == HALF /* isolated NEXT_TO_WIDE cell */
		&& x + 1 < term->cols
		&& term->cells[y][x + 1].width == NEXT_TO_WIDE) {
		erase_cell(term, y, x + 1);
	}
	return HALF;
}

// Assembly:
movl 0x50(%rdi), %r8d
testb $0x1, %r8b
je 0x3d10
movb 0x4c(%rdi), %al
cmpb $0x7, %al
ja 0x3d10
orb $0x8, %al
jmp 0x3d13
movb 0x4c(%rdi), %al
testb $0x4, %r8b
je 0x3d29
movb 0x4d(%rdi), %r9b
cmpb $0x7, %r9b
ja 0x3d29
orb $0x8, %r9b
jmp 0x3d2d
movb 0x4d(%rdi), %r9b
pushq %rbx
testb $0x8, %r8b
movzbl %r9b, %r9d
movzbl %al, %eax
movl %eax, %r10d
cmovel %r9d, %r10d
cmovel %eax, %r9d
movzbl 0x4(%rcx), %r11d
movslq %edx, %rax
imulq $0x218, %rax, %rax      # imm = 0x218
movq 0x18(%rdi), %rbx
movslq %esi, %rsi
movq (%rbx,%rsi,8), %rbx
movq %rcx, (%rbx,%rax)
movb %r9b, 0x8(%rbx,%rax)
movb %r10b, 0x9(%rbx,%rax)
movl %r8d, 0xc(%rbx,%rax)
movl %r11d, 0x10(%rbx,%rax)
movb $0x0, 0x14(%rbx,%rax)
movq 0x28(%rdi), %rax
movb $0x1, (%rax,%rsi)
movl $0x1, %eax
cmpl $0x1, %r11d
je 0x3ddf
cmpl $0x2, %r11d
jne 0x3e31
leal 0x1(%rdx), %ebx
cmpl 0xc(%rdi), %ebx
jge 0x3dd9
movq 0x18(%rdi), %rax
movq (%rax,%rsi,8), %rax
movslq %ebx, %rdx
imulq $0x218, %rdx, %rdx      # imm = 0x218
movq %rcx, (%rax,%rdx)
movb %r9b, 0x8(%rax,%rdx)
movb %r10b, 0x9(%rax,%rdx)
movl %r8d, 0xc(%rax,%rdx)
movb $0x0, 0x14(%rax,%rdx)
movl $0x0, 0x10(%rax,%rdx)
movl $0x2, %eax
jmp 0x3e31
cmpb $0x1, %r11b
jne 0x3e31
incl %edx
cmpl 0xc(%rdi), %edx
jge 0x3e31
movq 0x18(%rdi), %rcx
movq (%rcx,%rsi,8), %rcx
movslq %edx, %rdx
imulq $0x218, %rdx, %rdx      # imm = 0x218
cmpl $0x0, 0x10(%rcx,%rdx)
jne 0x3e31
movq 0x588(%rdi), %r8
movq %r8, (%rcx,%rdx)
movzwl 0x4c(%rdi), %r8d
movw %r8w, 0x8(%rcx,%rdx)
movabsq $0x100000000, %r8       # imm = 0x100000000
movq %r8, 0xc(%rcx,%rdx)
movb $0x0, 0x14(%rcx,%rdx)
movq 0x28(%rdi), %rcx
movb $0x1, (%rcx,%rsi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: move_cursor
void move_cursor(struct terminal_t *term, int y_offset, int x_offset)
{
	int x, y, top, bottom;

	x = term->cursor.x + x_offset;
	y = term->cursor.y + y_offset;

	top    = term->scroll.top;
	bottom = term->scroll.bottom;

	if (x < 0) {
		x = 0;
	} else if (x >= term->cols) {
		if (term->mode & MODE_AMRIGHT)
			term->wrap_occurred = true;
		x = term->cols - 1;
	}
	term->cursor.x = x;

	y = (y < 0) ? 0:
		(y >= term->lines) ? term->lines - 1: y;

	if (term->cursor.y == top && y_offset < 0) {
		y = top;
		scroll(term, top, bottom, y_offset);
	} else if (term->cursor.y == bottom && y_offset > 0) {
		y = bottom;
		scroll(term, top, bottom, y_offset);
	}
	term->cursor.y = y;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movq %rdi, %rbx
movzwl 0x24(%rdi), %esi
movzwl 0x26(%rdi), %edi
leal (%rdi,%rcx), %r8d
xorl %eax, %eax
addl %edx, %esi
movl $0x0, %r9d
js 0x4027
movl 0xc(%rbx), %edx
movl %esi, %r9d
cmpl %edx, %esi
jl 0x4027
testb $0x4, 0x38(%rbx)
je 0x4022
movb $0x1, 0x3c(%rbx)
decl %edx
movl %edx, %r9d
movzwl 0x20(%rbx), %esi
movzwl 0x22(%rbx), %edx
movw %r9w, 0x24(%rbx)
testl %r8d, %r8d
js 0x4048
movl 0x10(%rbx), %r9d
leal -0x1(%r9), %eax
cmpl %r9d, %r8d
cmovll %r8d, %eax
cmpw %si, %di
sete %r8b
testl %ecx, %ecx
sets %r9b
movl %esi, %ebp
testb %r8b, %r9b
jne 0x4070
cmpw %dx, %di
setne %dil
testl %ecx, %ecx
setle %r8b
orb %dil, %r8b
movl %edx, %ebp
jne 0x407a
movq %rbx, %rdi
callq 0x3e33
movl %ebp, %eax
movw %ax, 0x26(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: set_cursor
void set_cursor(struct terminal_t *term, int y, int x)
{
	int top, bottom;

	if (term->mode & MODE_ORIGIN) {
		top    = term->scroll.top;
		bottom = term->scroll.bottom;
		y += term->scroll.top;
	} else {
		top = 0;
		bottom = term->lines - 1;
	}

	x = (x < 0) ? 0: (x >= term->cols) ? term->cols - 1: x;
	y = (y < top) ? top: (y > bottom) ? bottom: y;

	term->cursor.x = x;
	term->cursor.y = y;
	term->wrap_occurred = false;
}

// Assembly:
testb $0x1, 0x38(%rdi)
jne 0x4094
movl 0x10(%rdi), %eax
decl %eax
xorl %ecx, %ecx
jmp 0x409e
movzwl 0x20(%rdi), %ecx
movzwl 0x22(%rdi), %eax
addl %ecx, %esi
testl %edx, %edx
js 0x40b3
movl 0xc(%rdi), %r9d
leal -0x1(%r9), %r8d
cmpl %edx, %r9d
cmovgl %edx, %r8d
jmp 0x40b6
xorl %r8d, %r8d
cmpl %eax, %esi
cmovll %esi, %eax
cmpl %ecx, %esi
movw %r8w, 0x24(%rdi)
cmovll %ecx, %eax
movw %ax, 0x26(%rdi)
movb $0x0, 0x3c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: drcs_glyph
const struct glyph_t *drcs_glyph(struct terminal_t *term, uint32_t code)
{
	/* DRCSMMv1
		ESC ( SP <\xXX> <\xYY> ESC ( B
		<===> U+10XXYY ( 0x40 <= 0xXX <=0x7E, 0x20 <= 0xYY <= 0x7F )
	*/
	int row, cell; /* = ku, ten */

	row  = (0xFF00 & code) >> 8;
	cell = 0xFF & code;

	logging(DEBUG, "drcs row:0x%.2X cell:0x%.2X\n", row, cell);

	if ((0x40 <= row && row <= 0x7E) && (0x20 <= cell && cell <= 0x7F))
		return &term->drcs[(row - 0x40) * GLYPHS_PER_CHARSET + (cell - 0x20)];
	else
		return term->glyph[SUBSTITUTE_HALF];
}

// Assembly:
movl %esi, %eax
shrl $0x8, %eax
movl $0xff, %ecx
andl %ecx, %eax
andl %ecx, %esi
leal -0x40(%rax), %ecx
cmpl $0x3f, %ecx
setae %cl
leal -0x20(%rsi), %edx
cmpl $0x60, %edx
setae %dl
orb %cl, %dl
jne 0x410e
leal (%rax,%rax,2), %eax
shll $0x5, %eax
addl %esi, %eax
addl $0xffffe7e0, %eax       # imm = 0xFFFFE7E0
leaq (%rax,%rax,4), %rax
leaq (%rdi,%rax,8), %rax
addq $0x80488, %rax          # imm = 0x80488
retq
movq 0x588(%rdi), %rax
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: addch
void addch(struct terminal_t *term, uint32_t code)
{
	int width;
	const struct glyph_t *glyphp;

	logging(DEBUG, "addch: U+%.4X\n", code);

	width = wcwidth(code);

	if (width <= 0)                                /* zero width: not support combining characters */
		return;
	else if (0x100000 <= code && code <= 0x10FFFD) /* unicode private area: plane 16 (DRCSMMv1) */
		glyphp = drcs_glyph(term, code);
	else if (code >= UCS2_CHARS                    /* yaft support only UCS2 */
		|| term->glyph[code] == NULL           /* missing glyph */
		|| term->glyph[code]->width != width)  /* width unmatched */
		glyphp = (width == 1) ? term->glyph[SUBSTITUTE_HALF]: term->glyph[SUBSTITUTE_WIDE];
	else
		glyphp = term->glyph[code];

	if ((term->wrap_occurred && term->cursor.x == term->cols - 1) /* folding */
		|| (glyphp->width == WIDE && term->cursor.x == term->cols - 1)) {
		set_cursor(term, term->cursor.y, 0);
		move_cursor(term, 1, 0);
	}
	term->wrap_occurred = false;

	move_cursor(term, 0, set_cell(term, term->cursor.y, term->cursor.x, glyphp));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, %edi
callq 0x21f0
testl %eax, %eax
jle 0x4180
leal -0x100000(%r14), %ecx
cmpl $0xfffd, %ecx           # imm = 0xFFFD
ja 0x4188
movl %r14d, %eax
shrl $0x8, %eax
movl $0xff, %ecx
andl %ecx, %eax
andl %ecx, %r14d
leal -0x40(%rax), %ecx
cmpl $0x3f, %ecx
setae %cl
leal -0x20(%r14), %edx
cmpl $0x60, %edx
setae %dl
orb %cl, %dl
jne 0x41c4
leal (%rax,%rax,2), %eax
shll $0x5, %eax
addl %r14d, %eax
addl $0xffffe7e0, %eax       # imm = 0xFFFFE7E0
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %r14
addq $0x80488, %r14          # imm = 0x80488
jmp 0x41cb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0xffff, %r14d          # imm = 0xFFFF
ja 0x41aa
movl %r14d, %ecx
movq 0x488(%rbx,%rcx,8), %r14
testq %r14, %r14
je 0x41aa
movzbl 0x4(%r14), %ecx
cmpl %ecx, %eax
je 0x41cb
leaq 0x18488(%rbx), %rcx
leaq 0x588(%rbx), %rdx
cmpl $0x1, %eax
cmoveq %rdx, %rcx
movq (%rcx), %r14
jmp 0x41cb
movq 0x588(%rbx), %r14
cmpb $0x1, 0x3c(%rbx)
jne 0x41de
movzwl 0x24(%rbx), %eax
movl 0xc(%rbx), %ecx
decl %ecx
cmpl %eax, %ecx
je 0x41f2
cmpb $0x2, 0x4(%r14)
jne 0x420f
movzwl 0x24(%rbx), %eax
movl 0xc(%rbx), %ecx
decl %ecx
cmpl %eax, %ecx
jne 0x420f
movzwl 0x26(%rbx), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4085
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x3fee
movb $0x0, 0x3c(%rbx)
movzwl 0x26(%rbx), %esi
movzwl 0x24(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x3cfb
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3fee
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: push_esc
bool push_esc(struct terminal_t *term, uint8_t ch)
{
	long offset;

	if ((term->esc.bp - term->esc.buf) >= term->esc.size) { /* buffer limit */
		logging(DEBUG, "escape sequence length >= %d, term.esc.buf reallocated\n", term->esc.size);
		offset = term->esc.bp - term->esc.buf;
		term->esc.buf = erealloc(term->esc.buf, term->esc.size * 2);
		term->esc.bp  = term->esc.buf + offset;
		term->esc.size *= 2;
	}

	/* ref: http://www.vt100.net/docs/vt102-ug/appendixd.html */
	*term->esc.bp++ = ch;
	if (term->esc.state == STATE_ESC) {
		/* format:
			ESC  I.......I F
				 ' '  '/'  '0'  '~'
			0x1B 0x20-0x2F 0x30-0x7E
		*/
		if ('0' <= ch && ch <= '~')        /* final char */
			return true;
		else if (SPACE <= ch && ch <= '/') /* intermediate char */
			return false;
	} else if (term->esc.state == STATE_CSI) {
		/* format:
			CSI       P.......P I.......I F
			ESC  '['  '0'  '?'  ' '  '/'  '@'  '~'
			0x1B 0x5B 0x30-0x3F 0x20-0x2F 0x40-0x7E
		*/
		if ('@' <= ch && ch <= '~')
			return true;
		else if (SPACE <= ch && ch <= '?')
			return false;
	} else {
		/* format:
			OSC       I.....I F
			ESC  ']'          BEL  or ESC  '\'
			0x1B 0x5D unknown 0x07 or 0x1B 0x5C
			DCS       I....I  F
			ESC  'P'          BEL  or ESC  '\'
			0x1B 0x50 unknown 0x07 or 0x1B 0x5C
		*/
		if (ch == BEL || (ch == BACKSLASH
			&& (term->esc.bp - term->esc.buf) >= 2 && *(term->esc.bp - 2) == ESC))
			return true;
		else if ((ch == ESC || ch == CR || ch == LF || ch == BS || ch == HT)
			|| (SPACE <= ch && ch <= '~'))
			return false;
	}

	/* invalid sequence */
	reset_esc(term);
	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
movq 0x70(%rbx), %r15
subq %rdi, %r15
movslq 0x78(%rbx), %rsi
cmpq %rsi, %r15
jl 0x427e
addq %rsi, %rsi
callq 0x27a4
movq %rax, 0x68(%rbx)
addq %rax, %r15
movq %r15, 0x70(%rbx)
shll 0x78(%rbx)
movq 0x70(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x70(%rbx)
movb %r14b, (%rax)
movl 0x7c(%rbx), %eax
cmpl $0x2, %eax
je 0x42ab
cmpl $0x1, %eax
jne 0x42d1
leal -0x30(%r14), %ecx
movb $0x1, %al
cmpb $0x4f, %cl
jb 0x42e9
andb $-0x10, %r14b
jmp 0x42ba
leal -0x40(%r14), %ecx
movb $0x1, %al
cmpb $0x3f, %cl
jb 0x42e9
andb $-0x20, %r14b
cmpb $0x20, %r14b
je 0x42e7
movq 0x68(%rbx), %rax
movq %rax, 0x70(%rbx)
movl $0x0, 0x7c(%rbx)
jmp 0x42e7
movzbl %r14b, %ecx
movb $0x1, %al
cmpb $0x1b, %r14b
ja 0x42f4
movl $0x8002700, %edx        # imm = 0x8002700
btl %ecx, %edx
jae 0x42ef
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x7, %ecx
je 0x42e9
cmpl $0x5c, %ecx
jne 0x4327
movq 0x70(%rbx), %rcx
movq %rcx, %rdx
subq 0x68(%rbx), %rdx
cmpq $0x2, %rdx
jl 0x4310
cmpb $0x1b, -0x2(%rcx)
je 0x42e9
leal -0x8(%r14), %eax
cmpb $0x14, %al
jae 0x4327
movzbl %al, %eax
movl $0x80027, %ecx          # imm = 0x80027
btl %eax, %ecx
jae 0x42c0
jmp 0x42e7
addb $-0x20, %r14b
cmpb $0x5f, %r14b
jae 0x42c0
jmp 0x42e7
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: reset
void reset(struct terminal_t *term)
{
	term->mode  = MODE_RESET;
	term->mode |= (MODE_CURSOR | MODE_AMRIGHT);
	term->wrap_occurred = false;

	term->scroll.top    = 0;
	term->scroll.bottom = term->lines - 1;

	term->cursor.x = term->cursor.y = 0;

	term->state.mode      = term->mode;
	term->state.cursor    = term->cursor;
	term->state.attribute = ATTR_RESET;

	term->color_pair.fg = DEFAULT_FG;
	term->color_pair.bg = DEFAULT_BG;

	term->attribute = ATTR_RESET;

	for (int line = 0; line < term->lines; line++) {
		for (int col = 0; col < term->cols; col++) {
			erase_cell(term, line, col);
			if ((col % TABSTOP) == 0)
				term->tabstop[col] = true;
			else
				term->tabstop[col] = false;
		}
		term->line_dirty[line] = true;
	}

	reset_esc(term);
	reset_charset(term);
}

// Assembly:
movl $0x6, 0x38(%rdi)
movb $0x0, 0x3c(%rdi)
movw $0x0, 0x20(%rdi)
movl 0x10(%rdi), %eax
decl %eax
movw %ax, 0x22(%rdi)
xorl %eax, %eax
movl %eax, 0x24(%rdi)
movq $0x6, 0x44(%rdi)
movl %eax, 0x40(%rdi)
movw $0x7, 0x4c(%rdi)
movl %eax, 0x50(%rdi)
cmpl %eax, 0x10(%rdi)
jle 0x4403
xorl %ecx, %ecx
movabsq $0x100000000, %rdx      # imm = 0x100000000
cmpl $0x0, 0xc(%rdi)
jle 0x43ef
movl $0x14, %esi
xorl %r8d, %r8d
movq 0x18(%rdi), %r9
movq (%r9,%rcx,8), %r9
movq 0x588(%rdi), %r10
movq %r10, -0x14(%r9,%rsi)
movzwl 0x4c(%rdi), %r10d
movw %r10w, -0xc(%r9,%rsi)
movq %rdx, -0x8(%r9,%rsi)
movb $0x0, (%r9,%rsi)
movq 0x28(%rdi), %r9
movb $0x1, (%r9,%rcx)
testb $0x7, %r8b
movq 0x30(%rdi), %r9
sete (%r9,%r8)
incq %r8
movslq 0xc(%rdi), %r9
addq $0x218, %rsi            # imm = 0x218
cmpq %r9, %r8
jl 0x439d
movq 0x28(%rdi), %rsi
movb $0x1, (%rsi,%rcx)
incq %rcx
movslq 0x10(%rdi), %rsi
cmpq %rsi, %rcx
jl 0x438f
movq 0x68(%rdi), %rcx
movq %rcx, 0x70(%rdi)
movl %eax, 0x7c(%rdi)
movl %eax, 0x5c(%rdi)
movq $0x0, 0x54(%rdi)
movb $0x1, 0x60(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./terminal.h
// Function: term_die
void term_die(struct terminal_t *term)
{
	free(term->line_dirty);
	free(term->tabstop);
	free(term->esc.buf);
	free(term->sixel.pixmap);

	for (int i = 0; i < term->lines; i++)
		free(term->cells[i]);
	free(term->cells);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x2050
movq 0x30(%rbx), %rdi
callq 0x2050
movq 0x68(%rbx), %rdi
callq 0x2050
movq 0xbb588(%rbx), %rdi
callq 0x2050
cmpl $0x0, 0x10(%rbx)
jle 0x4486
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2050
incq %r14
movslq 0x10(%rbx), %rax
cmpq %rax, %r14
jl 0x446d
movq 0x18(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/esc.h
// Function: bs
void bs(struct terminal_t *term)
{
	if (term->mode & MODE_VWBS
		&& term->cursor.x - 1 >= 0
		&& term->cells[term->cursor.y][term->cursor.x - 1].width == NEXT_TO_WIDE)
		move_cursor(term, 0, -2);
	else
		move_cursor(term, 0, -1);
}

// Assembly:
testb $0x8, 0x38(%rdi)
je 0x468e
movzwl 0x24(%rdi), %eax
testq %rax, %rax
je 0x468e
decl %eax
movq 0x18(%rdi), %rcx
movzwl 0x26(%rdi), %edx
movq (%rcx,%rdx,8), %rcx
imulq $0x218, %rax, %rax      # imm = 0x218
cmpl $0x0, 0x10(%rcx,%rax)
je 0x469a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
jmp 0x3fee
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
jmp 0x4693
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/esc.h
// Function: tab
void tab(struct terminal_t *term)
{
	int i;

	for (i = term->cursor.x + 1; i < term->cols; i++) {
		if (term->tabstop[i]) {
			set_cursor(term, term->cursor.y, i);
			return;
		}
	}
	set_cursor(term, term->cursor.y, term->cols - 1);
}

// Assembly:
movzwl 0x24(%rdi), %ecx
movslq 0xc(%rdi), %rdx
incq %rcx
cmpq %rdx, %rcx
jge 0x46cf
movq 0x30(%rdi), %rsi
leaq 0x1(%rcx), %rax
cmpb $0x1, (%rsi,%rcx)
movq %rax, %rcx
jne 0x46ac
decl %eax
movzwl 0x26(%rdi), %esi
movl %eax, %edx
jmp 0x4085
movzwl 0x26(%rdi), %esi
decl %edx
jmp 0x4085
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/esc.h
// Function: restore_state
void restore_state(struct terminal_t *term)
{
	/* restore state */
	if (term->state.mode & MODE_ORIGIN)
		term->mode |= MODE_ORIGIN;
	else
		term->mode &= ~MODE_ORIGIN;
	term->cursor    = term->state.cursor;
	term->attribute = term->state.attribute;
}

// Assembly:
movl 0x44(%rdi), %eax
andl $0x1, %eax
movl 0x38(%rdi), %ecx
movl 0x40(%rdi), %edx
andl $-0x2, %ecx
orl %eax, %ecx
movl %ecx, 0x38(%rdi)
movl %edx, 0x24(%rdi)
movl 0x48(%rdi), %eax
movl %eax, 0x50(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: insert_blank
void insert_blank(struct terminal_t *term, struct parm_t *parm)
{
	int i, num = sum(parm);

	if (num <= 0)
		num = 1;

	for (i = term->cols - 1; term->cursor.x <= i; i--) {
		if (term->cursor.x <= (i - num))
			copy_cell(term, term->cursor.y, i, term->cursor.y, i - num);
		else
			erase_cell(term, term->cursor.y, i);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e8e
cmpl $0x2, %eax
movl $0x1, %r15d
cmovgel %eax, %r15d
movslq 0xc(%rbx), %r12
movzwl 0x24(%rbx), %eax
cmpl %eax, %r12d
jle 0x4859
movl %r15d, %r13d
negl %r15d
leal -0x1(%r12), %r14d
imulq $0x218, %r12, %rbp      # imm = 0x218
addq $-0x204, %rbp           # imm = 0xFDFC
notq %r13
leaq (%r12,%r13), %rcx
movl %eax, %eax
cmpq %rax, %rcx
jge 0x482e
movzwl 0x26(%rbx), %eax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rcx
movq 0x588(%rbx), %rdx
movq %rdx, -0x14(%rcx,%rbp)
movzwl 0x4c(%rbx), %edx
movw %dx, -0xc(%rcx,%rbp)
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %rdx, -0x8(%rcx,%rbp)
movb $0x0, (%rcx,%rbp)
movq 0x28(%rbx), %rcx
movb $0x1, (%rcx,%rax)
jmp 0x4843
leal (%r15,%r14), %r8d
movzwl 0x26(%rbx), %ecx
movq %rbx, %rdi
movl %ecx, %esi
movl %r14d, %edx
callq 0x3c39
decq %r12
movzwl 0x24(%rbx), %eax
decl %r14d
addq $-0x218, %rbp           # imm = 0xFDE8
cmpq %rax, %r12
jg 0x47e5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: curs_nl
void curs_nl(struct terminal_t *term, struct parm_t *parm)
{
	int num = sum(parm);

	if (num <= 0)
		num = 1;

	move_cursor(term, num, 0);
	cr(term);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e8e
cmpl $0x2, %eax
movl $0x1, %esi
cmovgel %eax, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3fee
movzwl 0x26(%rbx), %esi
movq %rbx, %rdi
xorl %edx, %edx
popq %rbx
jmp 0x4085
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: curs_pos
void curs_pos(struct terminal_t *term, struct parm_t *parm)
{
	int line, col;

	if (parm->argc <= 0) {
		line = col = 0;
	} else if (parm->argc == 2) {
		line = dec2num(parm->argv[0]) - 1;
		col  = dec2num(parm->argv[1]) - 1;
	} else {
		return;
	}

	if (line < 0)
		line = 0;
	if (col < 0)
		col = 0;

	set_cursor(term, line, col);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
xorl %ebp, %ebp
movl $0x0, %r14d
movl $0x0, %r15d
testl %eax, %eax
jle 0x49ff
cmpl $0x2, %eax
jne 0x4a22
movq %rsi, %r12
movq 0x8(%rsi), %rdi
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x49e3
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq %rax, %r14
decl %r14d
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x49ff
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq %rax, %r15
decl %r15d
testl %r14d, %r14d
cmovlel %ebp, %r14d
testl %r15d, %r15d
cmovgl %r15d, %ebp
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4085
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: erase_display
void erase_display(struct terminal_t *term, struct parm_t *parm)
{
	int i, j, mode;

	mode = (parm->argc <= 0) ? 0: dec2num(parm->argv[parm->argc - 1]);

	if (mode < 0 || 2 < mode)
		return;

	if (mode == 0) {
		for (i = term->cursor.y; i < term->lines; i++)
			for (j = 0; j < term->cols; j++)
				if (i > term->cursor.y || (i == term->cursor.y && j >= term->cursor.x))
					erase_cell(term, i, j);
	} else if (mode == 1) {
		for (i = 0; i <= term->cursor.y; i++)
			for (j = 0; j < term->cols; j++)
				if (i < term->cursor.y || (i == term->cursor.y && j <= term->cursor.x))
					erase_cell(term, i, j);
	} else if (mode == 2) {
		for (i = 0; i < term->lines; i++)
			for (j = 0; j < term->cols; j++)
				erase_cell(term, i, j);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %ecx
xorl %eax, %eax
testl %ecx, %ecx
jle 0x4a8e
decl %ecx
movq 0x8(%rsi,%rcx,8), %rdi
testq %rdi, %rdi
je 0x4a8e
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
cmpl $0x2, %eax
ja 0x4c28
testl %eax, %eax
je 0x4b2f
cmpl $0x1, %eax
jne 0x4bba
xorl %eax, %eax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpl $0x0, 0xc(%rbx)
jle 0x4b1a
movl $0x14, %edx
xorl %esi, %esi
movzwl 0x26(%rbx), %edi
cmpq %rdi, %rax
jae 0x4afc
movq 0x18(%rbx), %rdi
movq (%rdi,%rax,8), %rdi
movq 0x588(%rbx), %r8
movq %r8, -0x14(%rdi,%rdx)
movzwl 0x4c(%rbx), %r8d
movw %r8w, -0xc(%rdi,%rdx)
movq %rcx, -0x8(%rdi,%rdx)
movb $0x0, (%rdi,%rdx)
movq 0x28(%rbx), %rdi
movb $0x1, (%rdi,%rax)
jmp 0x4b07
jne 0x4b07
movzwl 0x24(%rbx), %edi
cmpq %rdi, %rsi
jbe 0x4aca
incq %rsi
movslq 0xc(%rbx), %rdi
addq $0x218, %rdx            # imm = 0x218
cmpq %rdi, %rsi
jl 0x4ac1
leaq 0x1(%rax), %rdx
movzwl 0x26(%rbx), %esi
cmpq %rsi, %rax
movq %rdx, %rax
jb 0x4ab4
jmp 0x4c28
movzwl 0x26(%rbx), %eax
cmpl %eax, 0x10(%rbx)
jle 0x4c28
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpl $0x0, 0xc(%rbx)
jle 0x4bac
movl $0x14, %edx
xorl %esi, %esi
movzwl 0x26(%rbx), %edi
cmpq %rdi, %rax
jbe 0x4b8e
movq 0x18(%rbx), %rdi
movq (%rdi,%rax,8), %rdi
movq 0x588(%rbx), %r8
movq %r8, -0x14(%rdi,%rdx)
movzwl 0x4c(%rbx), %r8d
movw %r8w, -0xc(%rdi,%rdx)
movq %rcx, -0x8(%rdi,%rdx)
movb $0x0, (%rdi,%rdx)
movq 0x28(%rbx), %rdi
movb $0x1, (%rdi,%rax)
jmp 0x4b99
jne 0x4b99
movzwl 0x24(%rbx), %edi
cmpq %rdi, %rsi
jae 0x4b5c
incq %rsi
movslq 0xc(%rbx), %rdi
addq $0x218, %rdx            # imm = 0x218
cmpq %rdi, %rsi
jl 0x4b53
incq %rax
movslq 0x10(%rbx), %rdx
cmpq %rdx, %rax
jl 0x4b46
jmp 0x4c28
cmpl $0x0, 0x10(%rbx)
jle 0x4c28
xorl %eax, %eax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpl $0x0, 0xc(%rbx)
jle 0x4c1c
movl $0x14, %edx
xorl %esi, %esi
movq 0x18(%rbx), %rdi
movq (%rdi,%rax,8), %rdi
movq 0x588(%rbx), %r8
movq %r8, -0x14(%rdi,%rdx)
movzwl 0x4c(%rbx), %r8d
movw %r8w, -0xc(%rdi,%rdx)
movq %rcx, -0x8(%rdi,%rdx)
movb $0x0, (%rdi,%rdx)
movq 0x28(%rbx), %rdi
movb $0x1, (%rdi,%rax)
incq %rsi
movslq 0xc(%rbx), %rdi
addq $0x218, %rdx            # imm = 0x218
cmpq %rdi, %rsi
jl 0x4bd9
incq %rax
movslq 0x10(%rbx), %rdx
cmpq %rdx, %rax
jl 0x4bcc
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: erase_line
void erase_line(struct terminal_t *term, struct parm_t *parm)
{
	int i, mode;

	mode = (parm->argc <= 0) ? 0: dec2num(parm->argv[parm->argc - 1]);

	if (mode < 0 || 2 < mode)
		return;

	if (mode == 0) {
		for (i = term->cursor.x; i < term->cols; i++)
			erase_cell(term, term->cursor.y, i);
	} else if (mode == 1) {
		for (i = 0; i <= term->cursor.x; i++)
			erase_cell(term, term->cursor.y, i);
	} else if (mode == 2) {
		for (i = 0; i < term->cols; i++)
			erase_cell(term, term->cursor.y, i);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %ecx
xorl %eax, %eax
testl %ecx, %ecx
jle 0x4c4e
decl %ecx
movq 0x8(%rsi,%rcx,8), %rdi
testq %rdi, %rdi
je 0x4c4e
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
cmpl $0x2, %eax
ja 0x4d8e
testl %eax, %eax
je 0x4cc6
cmpl $0x1, %eax
jne 0x4d31
movq $-0x1, %rax
movl $0x14, %ecx
movabsq $0x100000000, %rdx      # imm = 0x100000000
movzwl 0x26(%rbx), %esi
movq 0x18(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
movq 0x588(%rbx), %r8
movq %r8, -0x14(%rdi,%rcx)
movzwl 0x4c(%rbx), %r8d
movw %r8w, -0xc(%rdi,%rcx)
movq %rdx, -0x8(%rdi,%rcx)
movb $0x0, (%rdi,%rcx)
movq 0x28(%rbx), %rdi
movb $0x1, (%rdi,%rsi)
movzwl 0x24(%rbx), %esi
incq %rax
addq $0x218, %rcx            # imm = 0x218
cmpq %rsi, %rax
jb 0x4c7a
jmp 0x4d8e
movzwl 0x24(%rbx), %eax
cmpl %eax, 0xc(%rbx)
jle 0x4d8e
imulq $0x218, %rax, %rcx      # imm = 0x218
addq $0x14, %rcx
movabsq $0x100000000, %rdx      # imm = 0x100000000
movzwl 0x26(%rbx), %esi
movq 0x18(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
movq 0x588(%rbx), %r8
movq %r8, -0x14(%rdi,%rcx)
movzwl 0x4c(%rbx), %r8d
movw %r8w, -0xc(%rdi,%rcx)
movq %rdx, -0x8(%rdi,%rcx)
movb $0x0, (%rdi,%rcx)
movq 0x28(%rbx), %rdi
movb $0x1, (%rdi,%rsi)
incq %rax
movslq 0xc(%rbx), %rsi
addq $0x218, %rcx            # imm = 0x218
cmpq %rsi, %rax
jl 0x4ce8
jmp 0x4d8e
cmpl $0x0, 0xc(%rbx)
jle 0x4d8e
movl $0x14, %eax
xorl %ecx, %ecx
movabsq $0x100000000, %rdx      # imm = 0x100000000
movzwl 0x26(%rbx), %esi
movq 0x18(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
movq 0x588(%rbx), %r8
movq %r8, -0x14(%rdi,%rax)
movzwl 0x4c(%rbx), %r8d
movw %r8w, -0xc(%rdi,%rax)
movq %rdx, -0x8(%rdi,%rax)
movb $0x0, (%rdi,%rax)
movq 0x28(%rbx), %rdi
movb $0x1, (%rdi,%rsi)
incq %rcx
movslq 0xc(%rbx), %rsi
addq $0x218, %rax            # imm = 0x218
cmpq %rsi, %rcx
jl 0x4d48
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: insert_line
void insert_line(struct terminal_t *term, struct parm_t *parm)
{
	int num = sum(parm);

	if (term->mode & MODE_ORIGIN) {
		if (term->cursor.y < term->scroll.top
			|| term->cursor.y > term->scroll.bottom)
			return;
	}

	if (num <= 0)
		num = 1;

	scroll(term, term->cursor.y, term->scroll.bottom, -num);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e8e
testb $0x1, 0x38(%rbx)
jne 0x4dc0
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movzwl 0x26(%rbx), %esi
movzwl 0x22(%rbx), %edx
negl %ecx
movq %rbx, %rdi
popq %rbx
jmp 0x3e33
movzwl 0x26(%rbx), %ecx
cmpw 0x20(%rbx), %cx
jb 0x4dd0
cmpw 0x22(%rbx), %cx
jbe 0x4da2
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: delete_line
void delete_line(struct terminal_t *term, struct parm_t *parm)
{
	int num = sum(parm);

	if (term->mode & MODE_ORIGIN) {
		if (term->cursor.y < term->scroll.top
			|| term->cursor.y > term->scroll.bottom)
			return;
	}

	if (num <= 0)
		num = 1;

	scroll(term, term->cursor.y, term->scroll.bottom, num);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e8e
testb $0x1, 0x38(%rbx)
jne 0x4e00
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movzwl 0x26(%rbx), %esi
movzwl 0x22(%rbx), %edx
movq %rbx, %rdi
popq %rbx
jmp 0x3e33
movzwl 0x26(%rbx), %ecx
cmpw 0x20(%rbx), %cx
jb 0x4e10
cmpw 0x22(%rbx), %cx
jbe 0x4de4
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: delete_char
void delete_char(struct terminal_t *term, struct parm_t *parm)
{
	int i, num = sum(parm);

	if (num <= 0)
		num = 1;

	for (i = term->cursor.x; i < term->cols; i++) {
		if ((i + num) < term->cols)
			copy_cell(term, term->cursor.y, i, term->cursor.y, i + num);
		else
			erase_cell(term, term->cursor.y, i);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e8e
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movzwl 0x24(%rbx), %r14d
movl 0xc(%rbx), %eax
cmpl %r14d, %eax
jle 0x4ebc
movl %ecx, %r15d
imulq $0x218, %r14, %r12      # imm = 0x218
addq $0x14, %r12
movabsq $0x100000000, %r13      # imm = 0x100000000
leal (%r15,%r14), %ecx
cmpl %eax, %ecx
jge 0x4e75
leal (%r15,%r14), %r8d
movzwl 0x26(%rbx), %ecx
movq %rbx, %rdi
movl %ecx, %esi
movl %r14d, %edx
callq 0x3c39
jmp 0x4ea9
movzwl 0x26(%rbx), %eax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rcx
movq 0x588(%rbx), %rdx
movq %rdx, -0x14(%rcx,%r12)
movzwl 0x4c(%rbx), %edx
movw %dx, -0xc(%rcx,%r12)
movq %r13, -0x8(%rcx,%r12)
movb $0x0, (%rcx,%r12)
movq 0x28(%rbx), %rcx
movb $0x1, (%rcx,%rax)
incq %r14
movslq 0xc(%rbx), %rax
addq $0x218, %r12            # imm = 0x218
cmpq %rax, %r14
jl 0x4e56
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: erase_char
void erase_char(struct terminal_t *term, struct parm_t *parm)
{
	int i, num = sum(parm);

	if (num <= 0)
		num = 1;
	else if (num + term->cursor.x > term->cols)
		num = term->cols - term->cursor.x;

	for (i = term->cursor.x; i < term->cursor.x + num; i++)
		erase_cell(term, term->cursor.y, i);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e8e
testl %eax, %eax
jle 0x4eeb
movzwl 0x24(%rbx), %ecx
leal (%rax,%rcx), %edx
movl 0xc(%rbx), %edi
movl %edi, %esi
subl %ecx, %esi
cmpl %edi, %edx
cmovlel %eax, %esi
jmp 0x4ef0
movl $0x1, %esi
movzwl 0x24(%rbx), %eax
leal (%rsi,%rax), %ecx
cmpl %eax, %ecx
jle 0x4f5f
imulq $0x218, %rax, %rcx      # imm = 0x218
addq $0x14, %rcx
movabsq $0x100000000, %rdx      # imm = 0x100000000
movslq %esi, %rsi
movzwl 0x26(%rbx), %edi
movq 0x18(%rbx), %r8
movq (%r8,%rdi,8), %r8
movq 0x588(%rbx), %r9
movq %r9, -0x14(%r8,%rcx)
movzwl 0x4c(%rbx), %r9d
movw %r9w, -0xc(%r8,%rcx)
movq %rdx, -0x8(%r8,%rcx)
movb $0x0, (%r8,%rcx)
movq 0x28(%rbx), %r8
movb $0x1, (%r8,%rdi)
incq %rax
movzwl 0x24(%rbx), %edi
addq %rsi, %rdi
addq $0x218, %rcx            # imm = 0x218
cmpq %rdi, %rax
jl 0x4f13
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: status_report
void status_report(struct terminal_t *term, struct parm_t *parm)
{
	int i, num;
	char buf[BUFSIZE];

	for (i = 0; i < parm->argc; i++) {
		num = dec2num(parm->argv[i]);
		if (num == 5) {         /* terminal response: ready */
			ewrite(term->fd, "\033[0n", 4);
		} else if (num == 6) {  /* cursor position report */
			snprintf(buf, BUFSIZE, "\033[%d;%dR", term->cursor.y + 1, term->cursor.x + 1);
			ewrite(term->fd, buf, strlen(buf));
		} else if (num == 15) { /* terminal response: printer not connected */
			ewrite(term->fd, "\033[?13n", 6);
		}
	}
}

// Assembly:
cmpl $0x0, (%rsi)
jle 0x5428
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r13
leaq 0x4d86b(%rip), %rbp     # 0x52bea
xorl %r12d, %r12d
movq 0x8(%rbx,%r12,8), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x539d
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
cmpl $0xf, %eax
je 0x53f4
cmpl $0x6, %eax
je 0x53b9
cmpl $0x5, %eax
jne 0x5408
movl (%r14), %edi
movl $0x4, %edx
movq %rbp, %rsi
jmp 0x5403
movzwl 0x26(%r14), %ecx
incl %ecx
movzwl 0x24(%r14), %r8d
incl %r8d
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
leaq 0x4d818(%rip), %rdx     # 0x52bef
xorl %eax, %eax
callq 0x2120
movl (%r14), %r15d
movq %r13, %rdi
callq 0x20d0
movl %r15d, %edi
movq %r13, %rsi
movq %rax, %rdx
jmp 0x5403
movl (%r14), %edi
movl $0x6, %edx
leaq 0x4d7f5(%rip), %rsi     # 0x52bf8
callq 0x286e
incq %r12
movslq (%rbx), %rax
cmpq %rax, %r12
jl 0x5382
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: set_mode
void set_mode(struct terminal_t *term, struct parm_t *parm)
{
	int i, mode;

	for (i = 0; i < parm->argc; i++) {
		mode = dec2num(parm->argv[i]);
		if (*(term->esc.buf + 1) != '?')
			continue; /* not supported */

		if (mode == 6) { /* private mode */
			term->mode |= MODE_ORIGIN;
			set_cursor(term, 0, 0);
		} else if (mode == 7) {
			term->mode |= MODE_AMRIGHT;
		} else if (mode == 25) {
			term->mode |= MODE_CURSOR;
		} else if (mode == 8901) {
			term->mode |= MODE_VWBS;
		}
	}

}

// Assembly:
cmpl $0x0, (%rsi)
jle 0x54f8
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx,%r12,8), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x5474
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq 0x68(%r14), %rcx
cmpb $0x3f, 0x1(%rcx)
jne 0x54de
cmpl $0x18, %eax
jg 0x5494
cmpl $0x6, %eax
je 0x54a7
cmpl $0x7, %eax
jne 0x54de
orb $0x4, 0x38(%r14)
jmp 0x54de
cmpl $0x19, %eax
je 0x54d9
cmpl $0x22c5, %eax           # imm = 0x22C5
jne 0x54de
orb $0x8, 0x38(%r14)
jmp 0x54de
orb $0x1, 0x38(%r14)
movzwl 0x20(%r14), %eax
movl 0xc(%r14), %ecx
leal -0x1(%rcx), %edx
testl %ecx, %ecx
cmovgl %r15d, %edx
movzwl 0x22(%r14), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movw %dx, 0x24(%r14)
movw %cx, 0x26(%r14)
movb $0x0, 0x3c(%r14)
jmp 0x54de
orb $0x2, 0x38(%r14)
incq %r12
movslq (%rbx), %rax
cmpq %rax, %r12
jl 0x5459
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: reset_mode
void reset_mode(struct terminal_t *term, struct parm_t *parm)
{
	int i, mode;

	for (i = 0; i < parm->argc; i++) {
		mode = dec2num(parm->argv[i]);
		if (*(term->esc.buf + 1) != '?')
			continue; /* not supported */

		if (mode == 6) { /* private mode */
			term->mode &= ~MODE_ORIGIN;
			set_cursor(term, 0, 0);
		} else if (mode == 7) {
			term->mode &= ~MODE_AMRIGHT;
			term->wrap_occurred = false;
		} else if (mode == 25) {
			term->mode &= ~MODE_CURSOR;
		} else if (mode == 8901) {
			term->mode &= ~MODE_VWBS;
		}
	}

}

// Assembly:
cmpl $0x0, (%rsi)
jle 0x55b3
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movl $0x1, %ebp
xorl %r12d, %r12d
movq 0x8(%rbx,%r12,8), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x5536
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq 0x68(%r14), %rcx
cmpb $0x3f, 0x1(%rcx)
jne 0x559c
cmpl $0x18, %eax
jg 0x5556
cmpl $0x6, %eax
je 0x5569
cmpl $0x7, %eax
jne 0x559c
andb $-0x5, 0x38(%r14)
jmp 0x5590
cmpl $0x19, %eax
je 0x5597
cmpl $0x22c5, %eax           # imm = 0x22C5
jne 0x559c
andb $-0x9, 0x38(%r14)
jmp 0x559c
andb $-0x2, 0x38(%r14)
movl 0xc(%r14), %eax
leal -0x1(%rax), %ecx
testl %eax, %eax
cmovgl %r15d, %ecx
movl 0x10(%r14), %eax
testl %eax, %eax
cmovgl %ebp, %eax
movw %cx, 0x24(%r14)
decl %eax
movw %ax, 0x26(%r14)
movb $0x0, 0x3c(%r14)
jmp 0x559c
andb $-0x3, 0x38(%r14)
incq %r12
movslq (%rbx), %rax
cmpq %rax, %r12
jl 0x551b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: set_margin
void set_margin(struct terminal_t *term, struct parm_t *parm)
{
	int top, bottom;

	if (parm->argc <= 0) {        /* CSI r */
		top    = 0;
		bottom = term->lines - 1;
	} else if (parm->argc == 2) { /* CSI ; r -> use default value */
		top    = (parm->argv[0] == NULL) ? 0: dec2num(parm->argv[0]) - 1;
		bottom = (parm->argv[1] == NULL) ? term->lines - 1: dec2num(parm->argv[1]) - 1;
	} else {
		return;
	}

	if (top < 0 || top >= term->lines)
		top = 0;
	if (bottom < 0 || bottom >= term->lines)
		bottom = term->lines - 1;

	if (top >= bottom)
		return;

	term->scroll.top = top;
	term->scroll.bottom = bottom;

	set_cursor(term, 0, 0); /* move cursor to home */
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
testl %eax, %eax
jle 0x55eb
cmpl $0x2, %eax
jne 0x5674
movq %rsi, %r15
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0x55f3
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq %rax, %r14
decl %r14d
jmp 0x55f6
movl 0x10(%rbx), %eax
xorl %r14d, %r14d
jmp 0x5610
xorl %r14d, %r14d
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x560d
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
jmp 0x5610
movl 0x10(%rbx), %eax
testl %r14d, %r14d
js 0x561b
cmpl 0x10(%rbx), %r14d
jl 0x561e
xorl %r14d, %r14d
testl %eax, %eax
jle 0x5627
cmpl 0x10(%rbx), %eax
jle 0x562a
movl 0x10(%rbx), %eax
decl %eax
cmpl %eax, %r14d
jge 0x5674
movw %r14w, 0x20(%rbx)
movw %ax, 0x22(%rbx)
testb $0x1, 0x38(%rbx)
jne 0x564a
movl 0x10(%rbx), %eax
decl %eax
xorl %r14d, %r14d
jmp 0x5654
movl $0xffff, %ecx           # imm = 0xFFFF
andl %ecx, %r14d
andl %ecx, %eax
movl 0xc(%rbx), %ecx
leal -0x1(%rcx), %edx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %edx, %esi
cmpl %eax, %r14d
cmovll %r14d, %eax
movw %si, 0x24(%rbx)
movw %ax, 0x26(%rbx)
movb $0x0, 0x3c(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: clear_tabstop
void clear_tabstop(struct terminal_t *term, struct parm_t *parm)
{
	int i, j, num;

	if (parm->argc <= 0) {
		term->tabstop[term->cursor.x] = false;
	} else {
		for (i = 0; i < parm->argc; i++) {
			num = dec2num(parm->argv[i]);
			if (num == 0) {
				term->tabstop[term->cursor.x] = false;
			} else if (num == 3) {
				for (j = 0; j < term->cols; j++)
					term->tabstop[j] = false;
				return;
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, (%rsi)
jle 0x56d1
movq %rsi, %r14
cmpl $0x0, (%rsi)
jle 0x56dd
xorl %r15d, %r15d
movq 0x8(%r14,%r15,8), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x56ad
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
testl %eax, %eax
je 0x56b8
cmpl $0x3, %eax
jne 0x56c4
jmp 0x56e3
movq 0x30(%rbx), %rax
movzwl 0x24(%rbx), %ecx
movb $0x0, (%rax,%rcx)
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x5692
jmp 0x56dd
movq 0x30(%rbx), %rax
movzwl 0x24(%rbx), %ecx
movb $0x0, (%rax,%rcx)
popq %rbx
popq %r14
popq %r15
retq
movslq 0xc(%rbx), %rdx
testq %rdx, %rdx
jle 0x56dd
movq 0x30(%rbx), %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x2130
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/osc.h
// Function: parse_color2
int32_t parse_color2(char *seq)
{
	/*
	format
		#rgb
		#rrggbb
		#rrrgggbbb
		#rrrrggggbbbb
	*/
	int i, length;
	uint32_t rgb[3];
	int32_t color;
	char buf[BUFSIZE];

	length = strlen(seq);
	memset(buf, '\0', BUFSIZE);

	if (length == 3) {       /* rgb */
		for (i = 0; i < 3; i++) {
			strncpy(buf, seq + i, 1);
			rgb[i] = bit_mask[8] & hex2num(buf) * 0xFF / 0x0F;
		}
	} else if (length == 6) {  /* rrggbb */
		for (i = 0; i < 3; i++) { /* rrggbb */
			strncpy(buf, seq + i * 2, 2);
			rgb[i] = bit_mask[8] & hex2num(buf);
		}
	} else if (length == 9) {  /* rrrgggbbb */
		for (i = 0; i < 3; i++) {
			strncpy(buf, seq + i * 3, 3);
			rgb[i] = bit_mask[8] & hex2num(buf) * 0xFF / 0xFFF;
		}
	} else if (length == 12) { /* rrrrggggbbbb */
		for (i = 0; i < 3; i++) {
			strncpy(buf, seq + i * 4, 4);
			rgb[i] = bit_mask[8] & hex2num(buf) * 0xFF / 0xFFFF;
		}
	} else {
		return -1;
	}

	color = (rgb[0] << 16) + (rgb[1] << 8) + rgb[2];
	logging(DEBUG, "color:0x%.6X\n", color);

	return color;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movq %rdi, %rbx
callq 0x20d0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2130
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl $-0x3, %r14d
cmpl $0x9, %r14d
ja 0x5a26
leaq 0x2751(%rip), %rcx      # 0x8030
movslq (%rcx,%r14,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
movb (%rbx,%r15), %al
movb %al, 0x10(%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2d03
movl %eax, %ecx
shll $0x4, %ecx
addl %eax, %ecx
movzbl %cl, %eax
movl %eax, 0x4(%rsp,%r15,4)
incq %r15
cmpq $0x3, %r15
jne 0x58f0
jmp 0x5a12
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
movl $0x3, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2070
movq %r14, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2d03
movl %eax, %ecx
shll $0x8, %ecx
subl %eax, %ecx
movslq %ecx, %rax
imulq $-0x7ff7ff7f, %rax, %rcx # imm = 0x80080081
shrq $0x20, %rcx
addl %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
shrl $0xb, %eax
addl %ecx, %eax
movzbl %al, %eax
movl %eax, 0x4(%rsp,%r15,4)
incq %r15
addq $0x3, %rbx
cmpq $0x3, %r15
jne 0x592c
jmp 0x5a12
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
leaq (%rbx,%r15), %rsi
movl $0x2, %edx
movq %r14, %rdi
callq 0x2070
movq %r14, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2d03
movzbl %al, %eax
movl %eax, 0x4(%rsp,%r15,2)
addq $0x2, %r15
cmpq $0x6, %r15
jne 0x598e
jmp 0x5a12
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
leaq (%rbx,%r15), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x2070
movq %r14, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2d03
cltq
imulq $0x7f807f81, %rax, %rax # imm = 0x7F807F81
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x27, %rax
addl %ecx, %eax
movzbl %al, %eax
movl %eax, 0x4(%rsp,%r15)
addq $0x4, %r15
cmpq $0xc, %r15
jne 0x59ca
movl 0x4(%rsp), %ecx
movl 0x8(%rsp), %eax
shll $0x10, %ecx
shll $0x8, %eax
addl %ecx, %eax
addl 0xc(%rsp), %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/osc.h
// Function: set_palette
void set_palette(struct terminal_t *term, void *arg)
{
	/*
	OSC Ps ; Pt ST
	ref: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
	ref: http://ttssh2.sourceforge.jp/manual/ja/about/ctrlseq.html#OSC

	only recognize change color palette:
		Ps: 4
		Pt: c ; spec
			c: color index (from 0 to 255)
			spec:
				rgb:r/g/b
				rgb:rr/gg/bb
				rgb:rrr/ggg/bbb
				rgb:rrrr/gggg/bbbb
				#rgb
				#rrggbb
				#rrrgggbbb
				#rrrrggggbbbb
					this rgb format is "RGB Device String Specification"
					see http://xjman.dsl.gr.jp/X11R6/X11/CH06.html
		Pt: c ; ?
			response rgb color
				OSC 4 ; c ; rgb:rr/gg/bb ST

	TODO: this function only works in 32bpp mode
	*/
	struct parm_t *pt = (struct parm_t *) arg;
	int i, argc = pt->argc, index;
	int32_t color;
	uint8_t rgb[3];
	char **argv = pt->argv;
	char buf[BUFSIZE];

	if (argc != 3)
		return;

	index = dec2num(argv[1]);
	if (index < 0 || index >= COLORS)
		return;

	if (strncmp(argv[2], "rgb:", 4) == 0) {
		if ((color = parse_color1(argv[2] + 4)) != -1) { /* skip "rgb:" */
			term->virtual_palette[index] = (uint32_t) color;
			term->palette_modified = true;
		}
	} else if (strncmp(argv[2], "#", 1) == 0) {
		if ((color = parse_color2(argv[2] + 1)) != -1) { /* skip "#" */
			term->virtual_palette[index] = (uint32_t) color;
			term->palette_modified = true;
		}
	} else if (strncmp(argv[2], "?", 1) == 0) {
		for (i = 0; i < 3; i++)
			rgb[i] = bit_mask[8] & (term->virtual_palette[index] >> (8 * (2 - i)));

		snprintf(buf, BUFSIZE, "\033]4;%d;rgb:%.2X/%.2X/%.2X\033\\",
			index, rgb[0], rgb[1], rgb[2]);
		ewrite(term->fd, buf, strlen(buf));
	}
}

// Assembly:
cmpl $0x3, (%rsi)
jne 0x5b5a
pushq %r15
pushq %r14
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x5a68
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq %rax, %r14
jmp 0x5a6b
xorl %r14d, %r14d
cmpl $0xff, %r14d
ja 0x5b4e
movq 0x18(%r15), %r15
leaq 0x4d17c(%rip), %rsi     # 0x52bff
movl $0x4, %edx
movq %r15, %rdi
callq 0x2080
testl %eax, %eax
je 0x5b1f
movzbl (%r15), %eax
cmpl $0x23, %eax
je 0x5b2d
cmpl $0x3f, %eax
jne 0x5b4e
movl %r14d, %eax
movl 0x80(%rbx,%rax,4), %eax
movl $0x10, %ecx
xorl %edx, %edx
movl %eax, %esi
shrl %cl, %esi
movb %sil, 0xd(%rsp,%rdx)
incq %rdx
addl $-0x8, %ecx
cmpq $0x3, %rdx
jne 0x5abf
movzbl 0xd(%rsp), %r8d
movzbl 0xe(%rsp), %r9d
movzbl 0xf(%rsp), %eax
movl %eax, (%rsp)
leaq 0x4d115(%rip), %rdx     # 0x52c04
leaq 0x10(%rsp), %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2120
movl (%rbx), %ebx
movq %r15, %rdi
callq 0x20d0
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x286e
jmp 0x5b4e
addq $0x4, %r15
movq %r15, %rdi
callq 0x56fc
jmp 0x5b38
incq %r15
movq %r15, %rdi
callq 0x589d
cmpl $-0x1, %eax
je 0x5b4e
movl %r14d, %ecx
movl %eax, 0x80(%rbx,%rcx,4)
movb $0x1, 0x480(%rbx)
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./ctrlseq/osc.h
// Function: reset_palette
void reset_palette(struct terminal_t *term, void *arg)
{
	/*
	reset color c
		OSC 104 ; c ST
			c: index of color
			ST: BEL or ESC \
	reset all color
		OSC 104 ST
			ST: BEL or ESC \

	terminfo: oc=\E]104\E\\
	*/
	struct parm_t *pt = (struct parm_t *) arg;
	int i, argc = pt->argc, c;
	char **argv = pt->argv;

	if (argc < 2) { /* reset all color palette */
		for (i = 0; i < COLORS; i++)
			term->virtual_palette[i] = color_list[i];
		term->palette_modified = true;
	} else if (argc == 2) { /* reset color_palette[c] */
		c = dec2num(argv[1]);
		if (0 <= c && c < COLORS) {
			term->virtual_palette[c] = color_list[c];
			term->palette_modified = true;
		}
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
cmpl $0x1, %eax
jg 0x5b8e
xorl %eax, %eax
leaq 0x2551(%rip), %rcx      # 0x80c0
movl (%rax,%rcx), %edx
movl %edx, 0x80(%rbx,%rax)
addq $0x4, %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0x5b6f
movb $0x1, 0x480(%rbx)
jmp 0x5bc8
cmpl $0x2, %eax
jne 0x5bc8
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x5baa
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
jmp 0x5bac
xorl %eax, %eax
cmpl $0xff, %eax
ja 0x5bc8
movl %eax, %eax
leaq 0x2504(%rip), %rcx      # 0x80c0
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x80(%rbx,%rax,4)
jmp 0x5b85
popq %rbx
retq