LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/osc.h
// Function: parse_color1
int32_t parse_color1(char *seq)
{
	/*
	format
		rgb:r/g/b
		rgb:rr/gg/bb
		rgb:rrr/ggg/bbb
		rgb:rrrr/gggg/bbbb
	*/
	int i, length, value;
	int32_t color;
	uint32_t rgb[3];
	struct parm_t parm;

	reset_parm(&parm);
	parse_arg(seq, &parm, '/', isalnum);

	for (i = 0; i < parm.argc; i++)
		logging(DEBUG, "parm.argv[%d]: %s\n", i, parm.argv[i]);

	if (parm.argc != 3)
		return -1;

	length = strlen(parm.argv[0]);

	for (i = 0; i < 3; i++) {
		value = hex2num(parm.argv[i]);
		logging(DEBUG, "value:%d\n", value);

		if (length == 1)      /* r/g/b/ */
			rgb[i] = bit_mask[8] & (value * 0xFF / 0x0F);
		else if (length == 2) /* rr/gg/bb */
			rgb[i] = bit_mask[8] & value;
		else if (length == 3) /* rrr/ggg/bbb */
			rgb[i] = bit_mask[8] & (value * 0xFF / 0xFFF);
		else if (length == 4) /* rrrr/gggg/bbbb */
			rgb[i] = bit_mask[8] & (value * 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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x2cf9
movq 0x5018a(%rip), %rcx     # 0x54fd8
pushq $0x2f
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d23
pushq $-0x1
popq %rbx
cmpl $0x3, (%r14)
jne 0x4ede
movq 0x18(%rsp), %rdi
callq 0x20d0
movq %rax, %r14
xorl %r15d, %r15d
decl %r14d
leaq 0x21d1(%rip), %r12      # 0x7050
movl $0xfff, %ebp            # imm = 0xFFF
movl $0x101, %r13d           # imm = 0x101
cmpq $0x3, %r15
je 0x4eca
movq 0x18(%rsp,%r15,8), %rdi
callq 0x2def
cmpl $0x3, %r14d
ja 0x4ede
movslq (%r12,%r14,4), %rcx
addq %r12, %rcx
jmpq *%rcx
imull $0x11, %eax, %eax
jmp 0x4ebd
imull $0xff, %eax, %eax
cltd
idivl %ebp
jmp 0x4ebd
cltd
idivl %r13d
movzbl %al, %eax
movl %eax, 0x4(%rsp,%r15,4)
incq %r15
jmp 0x4e8a
movl 0x4(%rsp), %eax
movl 0x8(%rsp), %ebx
shll $0x10, %eax
shll $0x8, %ebx
addl %eax, %ebx
addl 0xc(%rsp), %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdi, %rbx
callq 0x20d0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2120
pushq $-0x1
popq %rax
addl $-0x3, %r14d
cmpl $0x9, %r14d
ja 0x504d
leaq 0x2129(%rip), %rcx      # 0x7060
movslq (%rcx,%r14,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
cmpq $0x3, %r15
je 0x5039
movb (%rbx,%r15), %al
movb %al, 0x10(%rsp)
movq %r14, %rdi
callq 0x2def
imull $0x11, %eax, %eax
movzbl %al, %eax
movl %eax, 0x4(%rsp,%r15,4)
incq %r15
jmp 0x4f48
xorl %r12d, %r12d
leaq 0x10(%rsp), %r14
pushq $0x3
popq %r15
movl $0xfff, %ebp            # imm = 0xFFF
movl $0xff, %r13d
cmpq $0x3, %r12
je 0x5039
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2070
movq %r14, %rdi
callq 0x2def
imull $0xff, %eax, %eax
cltd
idivl %ebp
andl %r13d, %eax
movl %eax, 0x4(%rsp,%r12,4)
incq %r12
addq $0x3, %rbx
jmp 0x4f89
xorl %r12d, %r12d
leaq 0x10(%rsp), %r14
pushq $0x2
popq %r15
cmpq $0x6, %r12
je 0x5039
leaq (%rbx,%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x2070
movq %r14, %rdi
callq 0x2def
movzbl %al, %eax
movl %eax, 0x4(%rsp,%r12,2)
addq $0x2, %r12
jmp 0x4fcf
xorl %r12d, %r12d
leaq 0x10(%rsp), %r14
pushq $0x4
popq %r15
movl $0x101, %ebp            # imm = 0x101
cmpq $0xc, %r12
je 0x5039
leaq (%rbx,%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x2070
movq %r14, %rdi
callq 0x2def
cltd
idivl %ebp
movzbl %al, %eax
movl %eax, 0x4(%rsp,%r12)
addq $0x4, %r12
jmp 0x500b
movl 0x4(%rsp), %ecx
movl 0x8(%rsp), %eax
shll $0x10, %ecx
shll $0x8, %eax
addl %ecx, %eax
addl 0xc(%rsp), %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5167
pushq %rbp
pushq %r14
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rdi
callq 0x2dd7
cmpl $0xff, %eax
ja 0x515c
movl %eax, %ebp
movq 0x18(%r14), %r14
leaq 0x4cb85(%rip), %rsi     # 0x51c1f
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
je 0x50e4
movzbl (%r14), %eax
cmpl $0x23, %eax
je 0x513c
cmpl $0x3f, %eax
jne 0x515c
movl %ebp, %eax
movl 0x80(%rbx,%rax,4), %eax
pushq $0x10
popq %rcx
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x50f2
movl %eax, %esi
shrl %cl, %esi
movb %sil, 0xd(%rsp,%rdx)
incq %rdx
addl $-0x8, %ecx
jmp 0x50cd
addq $0x4, %r14
movq %r14, %rdi
callq 0x4e26
jmp 0x5147
movzbl 0xd(%rsp), %r8d
movzbl 0xe(%rsp), %r9d
movzbl 0xf(%rsp), %eax
movl %eax, (%rsp)
leaq 0x4cb17(%rip), %rdx     # 0x51c24
leaq 0x10(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2110
movl (%rbx), %ebx
movq %r14, %rdi
callq 0x20d0
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x283d
jmp 0x515c
incq %r14
movq %r14, %rdi
callq 0x4ef2
cmpl $-0x1, %eax
je 0x515c
movl %ebp, %ecx
movl %eax, 0x80(%rbx,%rcx,4)
movb $0x1, 0x480(%rbx)
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: sixel_bitmap
static inline int sixel_bitmap(struct terminal_t *term, struct sixel_canvas_t *sc, uint8_t bitmap)
{
	int i, offset;
	//uint8_t r, g, b;

	logging(DEBUG, "sixel_bitmap()\nbitmap:%.2X point(%d, %d)\n",
		bitmap, sc->point.x, sc->point.y);

	if (sc->point.x >= term->width || sc->point.y >= term->height)
		return 1;

	offset = sc->point.x * BYTES_PER_PIXEL + sc->point.y * sc->line_length;

	for (i = 0; i < BITS_PER_SIXEL; i++) {
		if (offset >= BYTES_PER_PIXEL * term->width * term->height)
			break;

		if (bitmap & (0x01 << i)) {
			memcpy(sc->pixmap + offset, &sc->color_table[sc->color_index], BYTES_PER_PIXEL);
			/*
			split_rgb(sc->color_table[sc->color_index], &r, &g, &b);
			*(sc->pixmap + offset + 0) = b;
			*(sc->pixmap + offset + 1) = g;
			*(sc->pixmap + offset + 2) = r;
			*/
		}

		offset += sc->line_length;
	}
	sc->point.x++;

	if (sc->point.x > sc->width)
		sc->width = sc->point.x;

	return 1;
}

// Assembly:
movzwl 0x8(%rsi), %eax
cmpl %eax, 0x4(%rdi)
jle 0x58cd
movzwl 0xa(%rsi), %ecx
cmpl %ecx, 0x8(%rdi)
jle 0x58cd
movl 0x14(%rsi), %r8d
imull %r8d, %ecx
leal (%rcx,%rax,4), %eax
xorl %ecx, %ecx
cmpl $0x6, %ecx
je 0x58b7
movl 0x4(%rdi), %r9d
imull 0x8(%rdi), %r9d
shll $0x2, %r9d
cmpl %r9d, %eax
jge 0x58b7
btl %ecx, %edx
jae 0x58b0
movq (%rsi), %r8
movslq %eax, %r9
movzbl 0x18(%rsi), %r10d
movl 0x1c(%rsi,%r10,4), %r10d
movl %r10d, (%r8,%r9)
movl 0x14(%rsi), %r8d
addl %r8d, %eax
incl %ecx
jmp 0x587c
movl 0x8(%rsi), %eax
movl 0xc(%rsi), %ecx
incl %eax
movw %ax, 0x8(%rsi)
movzwl %ax, %eax
cmpl %eax, %ecx
jge 0x58cd
movl %eax, 0xc(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: reset_sixel
void reset_sixel(struct sixel_canvas_t *sc, struct color_pair_t color_pair, int width, int height)
{
	extern const uint32_t color_list[]; /* global */
	int i;

	memset(sc->pixmap, 0, BYTES_PER_PIXEL * width * height);

	sc->width   = 1;
	sc->height  = 6;
	sc->point.x	= 0;
	sc->point.y = 0;
	sc->line_length = BYTES_PER_PIXEL * width;
	sc->color_index = 0;

	/* 0 - 15: use vt340 or ansi color map */
	/* VT340 VT340 Default Color Map
		ref: http://www.vt100.net/docs/vt3xx-gp/chapter2.html#T2-3
	*/
	sc->color_table[0] = 0x000000; sc->color_table[8]  = 0x424242;
	sc->color_table[1] = 0x3333CC; sc->color_table[9]  = 0x545499;
	sc->color_table[2] = 0xCC2121; sc->color_table[10] = 0x994242;
	sc->color_table[3] = 0x33CC33; sc->color_table[11] = 0x549954;
	sc->color_table[4] = 0xCC33CC; sc->color_table[12] = 0x995499;
	sc->color_table[5] = 0x33CCCC; sc->color_table[13] = 0x549999;
	sc->color_table[6] = 0xCCCC33; sc->color_table[14] = 0x999954;
	sc->color_table[7] = 0x878787; sc->color_table[15] = 0xCCCCCC;

	/* ANSI 16color table (but unusual order corresponding vt340 color map)
	sc->color_table[0] = color_list[0]; sc->color_table[8]  = color_list[8];
	sc->color_table[1] = color_list[4]; sc->color_table[9]  = color_list[12];
	sc->color_table[2] = color_list[1]; sc->color_table[10] = color_list[9];
	sc->color_table[3] = color_list[2]; sc->color_table[11] = color_list[10];
	sc->color_table[4] = color_list[5]; sc->color_table[12] = color_list[13];
	sc->color_table[5] = color_list[6]; sc->color_table[13] = color_list[14];
	sc->color_table[6] = color_list[3]; sc->color_table[14] = color_list[11];
	sc->color_table[7] = color_list[7]; sc->color_table[15] = color_list[15];
	*/
	/* change palette 0, because its often the same color as terminal background */
	sc->color_table[0] = color_list[color_pair.fg];

	/* 16 - 255: use xterm 256 color palette */
	/* copy 256 color map */
	for (i = 16; i < COLORS; i++)
		sc->color_table[i] = color_list[i];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rdi
shll $0x2, %ebp
imull %ebp, %ecx
movslq %ecx, %rdx
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x2120
movl $0x6, 0x10(%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rbx)
movl %ebp, 0x14(%rbx)
movb $0x0, 0x18(%rbx)
movaps 0x170a(%rip), %xmm0     # 0x7020
movups %xmm0, 0x20(%rbx)
movaps 0x170f(%rip), %xmm0     # 0x7030
movups %xmm0, 0x40(%rbx)
movabsq $0x99995400549999, %rax # imm = 0x99995400549999
movq %rax, 0x50(%rbx)
movaps 0x1706(%rip), %xmm0     # 0x7040
movups %xmm0, 0x30(%rbx)
movl $0xcccccc, 0x58(%rbx)   # imm = 0xCCCCCC
movzbl %r14b, %ecx
leaq 0x1790(%rip), %rax      # 0x70e0
movl (%rax,%rcx,4), %ecx
movl %ecx, 0x1c(%rbx)
cmpq $0xf0, %r15
je 0x596e
movl 0x40(%rax,%r15,4), %ecx
movl %ecx, 0x5c(%rbx,%r15,4)
incq %r15
jmp 0x5956
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: sixel_copy2cell
void sixel_copy2cell(struct terminal_t *term, struct sixel_canvas_t *sc)
{
	int y, x, h, cols, lines;
	int src_offset, dst_offset;
	struct cell_t *cellp;

	if (sc->height > term->height)
		sc->height = term->height;

	cols  = my_ceil(sc->width, CELL_WIDTH);
	lines = my_ceil(sc->height, CELL_HEIGHT);

	if (cols + term->cursor.x > term->cols)
		cols -= (cols + term->cursor.x - term->cols);

	for (y = 0; y < lines; y++) {
		for (x = 0; x < cols; x++) {
			erase_cell(term, term->cursor.y, term->cursor.x + x);
			cellp = &term->cells[term->cursor.y][term->cursor.x + x];
			cellp->has_pixmap = true;
			for (h = 0; h < CELL_HEIGHT; h++) {
				src_offset = (y * CELL_HEIGHT + h) * sc->line_length + (CELL_WIDTH * x) * BYTES_PER_PIXEL;
				dst_offset = h * CELL_WIDTH * BYTES_PER_PIXEL;
				if (src_offset >= BYTES_PER_PIXEL * term->width * term->height)
					break;
				memcpy(cellp->pixmap + dst_offset, sc->pixmap + src_offset, CELL_WIDTH * BYTES_PER_PIXEL);
			}
		}
		move_cursor(term, 1, 0);
		//set_cursor(term, term->cursor.y + 1, term->cursor.x);
	}
	cr(term);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rsi), %ecx
movl 0x8(%rdi), %eax
cmpl %eax, %ecx
jle 0x599d
movl %eax, 0x10(%r14)
movl %eax, %ecx
movl 0xc(%r14), %eax
addl $0x7, %eax
pushq $0x8
popq %rsi
cltd
idivl %esi
movl %eax, %esi
addl $0xf, %ecx
pushq $0x10
popq %rdi
movl %ecx, %eax
cltd
idivl %edi
movzwl 0x24(%rbx), %ecx
addl %esi, %ecx
movl 0xc(%rbx), %r12d
xorl %r13d, %r13d
subl %ecx, %r12d
cmovgel %r13d, %r12d
addl %esi, %r12d
testl %r12d, %r12d
cmovlel %r13d, %r12d
testl %eax, %eax
cmovlel %r13d, %eax
movq %rax, 0x8(%rsp)
xorl %eax, %eax
cmpq 0x8(%rsp), %rax
je 0x5abf
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
pushq $0x15
popq %rbp
cmpl %r12d, %r15d
je 0x5aa1
movzwl 0x26(%rbx), %esi
movzwl 0x24(%rbx), %edx
addl %r15d, %edx
movq %rbx, %rdi
callq 0x3a0e
movq 0x18(%rbx), %rax
movzwl 0x26(%rbx), %ecx
movq (%rax,%rcx,8), %rdx
movzwl 0x24(%rbx), %ecx
leal (%rcx,%r15), %eax
imulq $0x218, %rax, %rax      # imm = 0x218
movb $0x1, 0x14(%rdx,%rax)
movl %r15d, %eax
shll $0x5, %eax
imulq $0x218, %rcx, %rcx      # imm = 0x218
addq %rbp, %rcx
addq %rdx, %rcx
movl %r13d, %edx
xorl %esi, %esi
cmpq $0x200, %rsi            # imm = 0x200
je 0x5a92
movl 0x14(%r14), %edi
imull %edx, %edi
addl %eax, %edi
movl 0x4(%rbx), %r8d
imull 0x8(%rbx), %r8d
shll $0x2, %r8d
cmpl %r8d, %edi
jge 0x5a92
movq (%r14), %r8
movslq %edi, %rdi
movups (%r8,%rdi), %xmm0
movups 0x10(%r8,%rdi), %xmm1
movups %xmm1, 0x10(%rcx,%rsi)
movups %xmm0, (%rcx,%rsi)
addq $0x20, %rsi
incl %edx
jmp 0x5a4c
incl %r15d
addq $0x218, %rbp            # imm = 0x218
jmp 0x59f8
movq %rbx, %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x3d17
movq 0x10(%rsp), %rax
incq %rax
addl $0x10, %r13d
jmp 0x59e2
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x433c
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: sixel_parse_header
void sixel_parse_header(struct terminal_t *term, char *start_buf)
{
	/*
	sixel format
		DSC P1; P2; P3; q; s...s; ST
	parameters
		DCS: ESC(0x1B) P (0x50) (8bit C1 character not recognized)
		P1 : pixel aspect ratio (force 0, 2:1) (ignored)
		P2 : background mode (ignored)
			0 or 2: 0 stdands for current background color (default)
			1     : 0 stands for remaining current color
		P3 : horizontal grid parameter (ignored)
		q  : final character of sixel sequence
		s  : see parse_sixel_data()
		ST : ESC (0x1B) '\' (0x5C) or BEL (0x07)
	*/
	char *cp;
	struct parm_t parm;

	/* replace final char of sixel header by NUL '\0' */
	cp = strchr(start_buf, 'q');
	*cp = '\0';

	logging(DEBUG, "sixel_parse_header()\nbuf:%s\n", start_buf);

	/* split header by semicolon ';' */
	reset_parm(&parm);
	parse_arg(start_buf, &parm, ';', isdigit);

	/* set canvas parameters */
	reset_sixel(&term->sixel, term->color_pair, term->width, term->height);
	sixel_parse_data(term, &term->sixel, cp + 1); /* skip 'q' */
	sixel_copy2cell(term, &term->sixel);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x71
popq %rsi
movq %r15, %rdi
callq 0x2100
movq %rax, %r14
movb $0x0, (%rax)
movq %rsp, %r12
movq %r12, %rdi
callq 0x2cf9
movq 0x4f4b4(%rip), %rcx     # 0x54fc0
pushq $0x3b
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2d23
leaq 0xbb588(%rbx), %r15
movl 0x4(%rbx), %edx
movl 0x8(%rbx), %ecx
movl 0x4c(%rbx), %esi
movq %r15, %rdi
callq 0x58ce
incq %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x53fd
movq %rbx, %rdi
movq %r15, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5979
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: decdld_parse_data
void decdld_parse_data(char *start_buf, int start_char, struct glyph_t *chars)
{
	/*
	DECDLD sixel data
		';': glyph separator
		'/': line feed
		sixel bitmap:
			range of ? (hex 3F) to ~ (hex 7E)
			? (hex 3F) represents the binary value 00 0000.
			t (hex 74) represents the binary value 11 0101.
			~ (hex 7E) represents the binary value 11 1111.
	*/
	char *cp, *end_buf;
	uint8_t char_num = start_char; /* start_char == 0 means SPACE(0x20) */
	uint8_t bitmap, row = 0, column = 0;

	init_glyph(&chars[char_num]);
	cp      = start_buf;
	end_buf = cp + strlen(cp);

	while (cp < end_buf) {
		if ('?' <= *cp && *cp <= '~') { /* sixel bitmap */
			logging(DEBUG, "char_num(ten):0x%.2X\n", char_num);
			/* remove offset '?' and use only 6bit */
			bitmap = bit_mask[BITS_PER_SIXEL] & (*cp - '?');
			decdld_bitmap(&chars[char_num], bitmap, row, column);
			column++;
		} else if (*cp == ';') {  /* next char */
			row = column = 0;
			char_num++;
			init_glyph(&chars[char_num]);
		} else if (*cp == '/') {  /* sixel nl+cr */
			row++;
			column = 0;
		} else if (*cp == '\0') { /* end of DECDLD sequence */
			break;
		}
		cp++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movzbl %bpl, %eax
imulq $0x28, %rax, %rdi
addq %rdx, %rdi
callq 0x5c45
movq %r14, %rdi
callq 0x20d0
movq %rax, %r15
addq %r14, %r15
leaq 0x6(%rbx), %r12
xorl %eax, %eax
pushq $0x1
popq %r13
xorl %edx, %edx
cmpq %r15, %r14
jae 0x5c36
movzbl (%r14), %esi
leal -0x7f(%rsi), %ecx
cmpb $-0x40, %cl
jae 0x5bbe
cmpl $0x2f, %esi
je 0x5c2a
cmpl $0x3b, %esi
je 0x5c13
testl %esi, %esi
jne 0x5c2e
jmp 0x5c36
cmpb $0x7, %dl
jbe 0x5bc7
incb %dl
jmp 0x5c2e
incl %esi
andl $0x3f, %esi
movzbl %bpl, %r9d
movb $0x7, %cl
subb %dl, %cl
movzbl %al, %r10d
imulq $0x6, %r10, %rdi
movl %r13d, %r8d
shll %cl, %r8d
imulq $0x28, %r9, %r9
imulq $0xc, %r10, %rcx
addq %r9, %rcx
addq %r12, %rcx
xorl %r9d, %r9d
cmpq $0x6, %r9
je 0x5bc3
btl %r9d, %esi
jae 0x5c0e
leaq (%rdi,%r9), %r10
cmpq $0xf, %r10
ja 0x5c0e
orw %r8w, (%rcx,%r9,2)
incq %r9
jmp 0x5bf3
incb %bpl
movzbl %bpl, %eax
imulq $0x28, %rax, %rdi
addq %rbx, %rdi
callq 0x5c45
xorl %eax, %eax
jmp 0x5c2c
incb %al
xorl %edx, %edx
incq %r14
jmp 0x5b99
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: init_glyph
static inline void init_glyph(struct glyph_t *glyph)
{
	int i;

	glyph->width = 1; /* drcs glyph must be HALF */
	glyph->code = 0;  /* this value not used: drcs call by DRCSMMv1 */

	for (i = 0; i < CELL_HEIGHT; i++)
		glyph->bitmap[i] = 0;
}

// Assembly:
movb $0x1, 0x4(%rdi)
andl $0x0, (%rdi)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x5c5f
andw $0x0, 0x6(%rdi,%rax,2)
incq %rax
jmp 0x5c4e
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./parse.h
// Function: esc_sequence
void esc_sequence(struct terminal_t *term, uint8_t ch)
{
	*term->esc.bp = '\0';

	logging(DEBUG, "esc: ESC %s\n", term->esc.buf);

	if (strlen(term->esc.buf) == 1 && esc_func[ch])
		esc_func[ch](term);

	/* not reset if csi/osc/dcs seqence */
	if (ch == '[' || ch == ']' || ch == 'P')
		return;

	reset_esc(term);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x70(%rdi), %rax
movb $0x0, (%rax)
movq 0x68(%rdi), %rdi
callq 0x20d0
movzbl %bpl, %r14d
cmpq $0x1, %rax
jne 0x5db4
leaq 0x4f53a(%rip), %rax     # 0x552e0
movq (%rax,%r14,8), %rax
testq %rax, %rax
je 0x5db4
movq %rbx, %rdi
callq *%rax
addl $-0x50, %r14d
cmpl $0xd, %r14d
ja 0x5dc9
movl $0x2801, %eax           # imm = 0x2801
btl %r14d, %eax
jb 0x5dd5
movq 0x68(%rbx), %rax
movq %rax, 0x70(%rbx)
andl $0x0, 0x7c(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./parse.h
// Function: csi_sequence
void csi_sequence(struct terminal_t *term, uint8_t ch)
{
	struct parm_t parm;

	*(term->esc.bp - 1) = '\0'; /* omit final character */

	logging(DEBUG, "csi: CSI %s\n", term->esc.buf + 1);

	reset_parm(&parm);
	parse_arg(term->esc.buf + 1, &parm, ';', isdigit); /* skip '[' */

	if (csi_func[ch])
		csi_func[ch](term, &parm);

	reset_esc(term);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq 0x70(%rdi), %rax
movb $0x0, -0x1(%rax)
movq 0x68(%rdi), %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x2cf9
incq %r14
movq 0x4f1b3(%rip), %rcx     # 0x54fc0
pushq $0x3b
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d23
movl %ebp, %eax
leaq 0x4f8bc(%rip), %rcx     # 0x556e0
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x5e35
movq %rsp, %rsi
movq %rbx, %rdi
callq *%rax
movq 0x68(%rbx), %rax
movq %rax, 0x70(%rbx)
andl $0x0, 0x7c(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./parse.h
// Function: osc_sequence
void osc_sequence(struct terminal_t *term, uint8_t ch)
{
	int osc_mode;
	struct parm_t parm;

	omit_string_terminator(term->esc.bp, ch);

	logging(DEBUG, "osc: OSC %s\n", term->esc.buf);

	reset_parm(&parm);
	parse_arg(term->esc.buf + 1, &parm, ';', is_osc_parm); /* skip ']' */

	if (parm.argc > 0) {
		osc_mode = dec2num(parm.argv[0]);
		logging(DEBUG, "osc_mode:%d\n", osc_mode);

		/* XXX: disable because this functions only work 24/32bpp
			-> support other bpp (including pseudo color) */
		if (osc_mode == 4)
			set_palette(term, &parm);
		else if (osc_mode == 104)
			reset_palette(term, &parm);
		if (osc_mode == 8900)
			glyph_width_report(term, &parm);
	}
	reset_esc(term);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0x70(%rdi), %rax
xorl %ecx, %ecx
cmpl $0x5c, %esi
sete %cl
notq %rcx
movb $0x0, (%rax,%rcx)
movq %rsp, %r14
movq %r14, %rdi
callq 0x2cf9
movq 0x68(%rbx), %rdi
incq %rdi
leaq -0x82(%rip), %rcx       # 0x5e4f
pushq $0x3b
popq %rdx
movq %r14, %rsi
callq 0x2d23
cmpl $0x0, (%r14)
jle 0x5f22
movq 0x8(%rsp), %rdi
callq 0x2dd7
cmpl $0x22c4, %eax           # imm = 0x22C4
je 0x5f17
cmpl $0x68, %eax
je 0x5f0a
cmpl $0x4, %eax
jne 0x5f22
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x505f
jmp 0x5f22
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5168
jmp 0x5f22
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x51e9
movq 0x68(%rbx), %rax
movq %rax, 0x70(%rbx)
andl $0x0, 0x7c(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./parse.h
// Function: dcs_sequence
void dcs_sequence(struct terminal_t *term, uint8_t ch)
{
	char *cp;

	omit_string_terminator(term->esc.bp, ch);

	logging(DEBUG, "dcs: DCS %s\n", term->esc.buf);

	/* check DCS header */
	cp = term->esc.buf + 1; /* skip P */
	while (cp < term->esc.bp) {
		if (*cp == '{' || *cp == 'q')                      /* DECDLD or sixel */
			break;
		else if (*cp == ';' || ('0' <= *cp && *cp <= '9')) /* valid DCS header */
			;
		else                                               /* invalid sequence */
			cp = term->esc.bp;
		cp++;
	}

	if (cp != term->esc.bp) { /* header only or couldn't find final char */
		/* parse DCS header */
		if (*cp == 'q')
			sixel_parse_header(term, term->esc.buf + 1);
		else if (*cp == '{')
			decdld_parse_header(term, term->esc.buf + 1);
	}

	reset_esc(term);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x70(%rdi), %rax
xorl %ecx, %ecx
cmpl $0x5c, %esi
sete %cl
notq %rcx
movb $0x0, (%rax,%rcx)
movq 0x68(%rdi), %rsi
movq 0x70(%rdi), %rcx
movq %rsi, %rax
incq %rax
cmpq %rcx, %rax
jae 0x5f82
movzbl (%rax), %edx
cmpl $0x3b, %edx
je 0x5f5b
cmpl $0x71, %edx
je 0x5f82
cmpl $0x7b, %edx
je 0x5f82
addb $-0x30, %dl
cmpb $0xa, %dl
jb 0x5f5b
movq %rcx, %rax
jmp 0x5f5b
cmpq %rcx, %rax
je 0x5fac
movzbl (%rax), %eax
cmpl $0x7b, %eax
je 0x5fa1
cmpl $0x71, %eax
jne 0x5fac
incq %rsi
movq %rbx, %rdi
callq 0x5ad5
jmp 0x5fac
incq %rsi
movq %rbx, %rdi
callq 0x5c60
movq 0x68(%rbx), %rax
movq %rax, 0x70(%rbx)
andl $0x0, 0x7c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./parse.h
// Function: parse
void parse(struct terminal_t *term, uint8_t *buf, int size)
{
	/*
		CTRL CHARS      : 0x00 ~ 0x1F
		ASCII(printable): 0x20 ~ 0x7E
		CTRL CHARS(DEL) : 0x7F
		UTF-8           : 0x80 ~ 0xFF
	*/
	uint8_t ch;

	for (int i = 0; i < size; i++) {
		ch = buf[i];
		if (term->esc.state == STATE_RESET) {
			/* interrupted by illegal byte */
			if (term->charset.following_byte > 0 && (ch < 0x80 || ch > 0xBF)) {
				addch(term, REPLACEMENT_CHAR);
				reset_charset(term);
			}

			if (ch <= 0x1F)
				control_character(term, ch);
			else if (ch <= 0x7F)
				addch(term, ch);
			else
				utf8_charset(term, ch);
		} else if (term->esc.state == STATE_ESC) {
			if (push_esc(term, ch))
				esc_sequence(term, ch);
		} else if (term->esc.state == STATE_CSI) {
			if (push_esc(term, ch))
				csi_sequence(term, ch);
		} else if (term->esc.state == STATE_OSC) {
			if (push_esc(term, ch))
				osc_sequence(term, ch);
		} else if (term->esc.state == STATE_DCS) {
			if (push_esc(term, ch))
				dcs_sequence(term, ch);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
testl %edx, %edx
cmovlel %r13d, %ebx
leaq 0xf51(%rip), %rbp       # 0x70b0
cmpq %r13, %rbx
je 0x624e
movl 0x7c(%r15), %eax
cmpq $0x8, %rax
ja 0x6246
movzbl (%r14,%r13), %r12d
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
cmpl $0x0, 0x58(%r15)
jle 0x61ac
cmpb $-0x40, %r12b
jl 0x61ac
movq %r15, %rdi
pushq $0x3f
popq %rsi
callq 0x3e3b
andl $0x0, 0x5c(%r15)
andq $0x0, 0x54(%r15)
movb $0x1, 0x60(%r15)
movq %r15, %rdi
cmpb $0x1f, %r12b
ja 0x6232
movl %r12d, %esi
callq 0x5d60
jmp 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x3f2a
testb %al, %al
je 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x5dda
jmp 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x3f2a
testb %al, %al
je 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x5d7c
jmp 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x3f2a
testb %al, %al
je 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x5e98
jmp 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x3f2a
testb %al, %al
je 0x6246
movq %r15, %rdi
movl %r12d, %esi
callq 0x5f39
jmp 0x6246
movl %r12d, %esi
testb %r12b, %r12b
js 0x6241
callq 0x3e3b
jmp 0x6246
callq 0x5fba
incq %r13
jmp 0x615f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/yaft.c
// Function: sig_handler
void sig_handler(int signo)
{
	sigset_t sigset;
	/* global */
	extern volatile sig_atomic_t vt_active;
	extern volatile sig_atomic_t child_alive;
	extern volatile sig_atomic_t need_redraw;

	logging(DEBUG, "caught signal! no:%d\n", signo);

	if (signo == SIGCHLD) {
		child_alive = false;
		wait(NULL);
	} else if (signo == SIGUSR1) { /* vt activate */
		vt_active   = true;
		need_redraw = true;
		ioctl(STDIN_FILENO, VT_RELDISP, VT_ACKACQ);
	} else if (signo == SIGUSR2) { /* vt deactivate */
		vt_active = false;
		ioctl(STDIN_FILENO, VT_RELDISP, 1);

		if (BACKGROUND_DRAW) { /* update passive cursor */
			need_redraw = true;
		} else {               /* sleep until next vt switching */
			sigfillset(&sigset);
			sigdelset(&sigset, SIGUSR1);
			sigsuspend(&sigset);
		}
	}
}

// Assembly:
cmpl $0xa, %edi
je 0x62c7
cmpl $0xc, %edi
je 0x627d
cmpl $0x11, %edi
jne 0x62c6
movl $0x0, 0x4f872(%rip)     # 0x55ae8
xorl %edi, %edi
jmp 0x2300
pushq %rbx
subq $0x80, %rsp
movl $0x0, 0x4ef31(%rip)     # 0x551c0
pushq $0x1
popq %rdx
movl $0x5605, %esi           # imm = 0x5605
xorl %edi, %edi
xorl %eax, %eax
callq 0x2130
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x21b0
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0x2280
movq %rbx, %rdi
callq 0x2200
addq $0x80, %rsp
popq %rbx
retq
pushq $0x1
popq %rax
movl %eax, 0x4eef0(%rip)     # 0x551c0
movl %eax, 0x4f80e(%rip)     # 0x55ae4
pushq $0x2
popq %rdx
movl $0x5605, %esi           # imm = 0x5605
xorl %edi, %edi
xorl %eax, %eax
jmp 0x2130
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/yaft.c
// Function: set_rawmode
void set_rawmode(int fd, struct termios *save_tm)
{
	struct termios tm;

	tm = *save_tm;
	tm.c_iflag     = tm.c_oflag = 0;
	tm.c_cflag    &= ~CSIZE;
	tm.c_cflag    |= CS8;
	tm.c_lflag    &= ~(ECHO | ISIG | ICANON);
	tm.c_cc[VMIN]  = 1; /* min data size (byte) */
	tm.c_cc[VTIME] = 0; /* time out */
	etcsetattr(fd, TCSAFLUSH, &tm);
}

// Assembly:
subq $0x48, %rsp
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups 0x20(%rsi), %xmm2
movups 0x2c(%rsi), %xmm3
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm1, 0x10(%rdx)
movups %xmm3, 0x2c(%rdx)
andq $0x0, (%rdx)
movaps %xmm2, 0x20(%rdx)
orb $0x30, 0x8(%rdx)
andb $-0xc, 0xc(%rdx)
movw $0x100, 0x16(%rdx)      # imm = 0x100
pushq $0x2
popq %rsi
callq 0x29a8
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/yaft.c
// Function: tty_init
bool tty_init(struct termios *termios_orig)
{
	struct sigaction sigact;

	memset(&sigact, 0, sizeof(struct sigaction));
	sigact.sa_handler = sig_handler;
	sigact.sa_flags   = SA_RESTART;
	esigaction(SIGCHLD, &sigact, NULL);

	if (VT_CONTROL) {
		esigaction(SIGUSR1, &sigact, NULL);
		esigaction(SIGUSR2, &sigact, NULL);

		struct vt_mode vtm;
		vtm.mode   = VT_PROCESS;
		vtm.waitv  = 0;
		vtm.acqsig = SIGUSR1;
		vtm.relsig = SIGUSR2;
		vtm.frsig  = 0;

		if (ioctl(STDIN_FILENO, VT_SETMODE, &vtm))
			logging(WARN, "ioctl: VT_SETMODE failed (maybe here is not console)\n");

		if (FORCE_TEXT_MODE == false) {
			if (ioctl(STDIN_FILENO, KDSETMODE, KD_GRAPHICS))
				logging(WARN, "ioctl: KDSETMODE failed (maybe here is not console)\n");
		}
	}

	etcgetattr(STDIN_FILENO, termios_orig);
	set_rawmode(STDIN_FILENO, termios_orig);
	ewrite(STDIN_FILENO, "\033[?25l", 6); /* make cusor invisible */

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2120
leaq -0xf6(%rip), %rax       # 0x625d
movq %rax, -0x8(%r14)
movl $0x10000000, 0x80(%r14) # imm = 0x10000000
pushq $0x11
popq %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %edx, %edx
callq 0x290b
pushq $0xa
popq %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x290b
pushq $0xc
popq %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x290b
leaq 0x8(%rsp), %rdx
movw $0x1, (%rdx)
movl $0xa000c, 0x2(%rdx)     # imm = 0xA000C
andw $0x0, 0x6(%rdx)
movl $0x5602, %esi           # imm = 0x5602
xorl %edi, %edi
xorl %eax, %eax
callq 0x2130
testl %eax, %eax
je 0x63c7
leaq 0x4b899(%rip), %rsi     # 0x51c56
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x244c
pushq $0x1
popq %rdx
movl $0x4b3a, %esi           # imm = 0x4B3A
xorl %edi, %edi
xorl %eax, %eax
callq 0x2130
testl %eax, %eax
je 0x63ed
leaq 0x4b8a9(%rip), %rsi     # 0x51c8c
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x244c
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2961
xorl %edi, %edi
movq %rbx, %rsi
callq 0x62e7
leaq 0x4b8b9(%rip), %rsi     # 0x51cc1
pushq $0x6
popq %rdx
xorl %edi, %edi
callq 0x283d
movb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/yaft.c
// Function: tty_die
void tty_die(struct termios *termios_orig)
{
 	/* no error handling */
	struct sigaction sigact;
	struct vt_mode vtm;

	memset(&sigact, 0, sizeof(struct sigaction));
	sigact.sa_handler = SIG_DFL;
	sigaction(SIGCHLD, &sigact, NULL);

	if (VT_CONTROL) {
		sigaction(SIGUSR1, &sigact, NULL);
		sigaction(SIGUSR2, &sigact, NULL);

		vtm.mode   = VT_AUTO;
		vtm.waitv  = 0;
		vtm.relsig = vtm.acqsig = vtm.frsig = 0;

		ioctl(STDIN_FILENO, VT_SETMODE, &vtm);

		if (FORCE_TEXT_MODE == false)
			ioctl(STDIN_FILENO, KDSETMODE, KD_TEXT);
	}

	tcsetattr(STDIN_FILENO, TCSAFLUSH, termios_orig);
	fflush(stdout);
	ewrite(STDIN_FILENO, "\033[?25h", 6); /* make cursor visible */
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movl $0x98, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2120
pushq $0x11
popq %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2090
pushq $0xa
popq %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2090
pushq $0xc
popq %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2090
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
movl $0x5602, %esi           # imm = 0x5602
xorl %edi, %edi
xorl %eax, %eax
callq 0x2130
movl $0x4b3a, %esi           # imm = 0x4B3A
xorl %edi, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2130
pushq $0x2
popq %rsi
xorl %edi, %edi
movq %rbx, %rdx
callq 0x2250
movq 0x4eb2e(%rip), %rax     # 0x54fd0
movq (%rax), %rdi
callq 0x21f0
leaq 0x4b817(%rip), %rsi     # 0x51cc8
pushq $0x6
popq %rdx
xorl %edi, %edi
callq 0x283d
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/yaft.c
// Function: fork_and_exec
bool fork_and_exec(int *master, const char *cmd, char *const argv[], int lines, int cols)
{
	pid_t pid;
	struct winsize ws = {.ws_row = lines, .ws_col = cols,
		/* XXX: this variables are UNUSED (man tty_ioctl),
			but useful for calculating terminal cell size */
		.ws_ypixel = CELL_HEIGHT * lines, .ws_xpixel = CELL_WIDTH * cols};

	pid = eforkpty(master, NULL, NULL, &ws);
	if (pid < 0)
		return false;
	else if (pid == 0) { /* child */
		esetenv("TERM", term_name, 1);
		eexecvp(cmd, argv);
		/* never reach here */
		exit(EXIT_FAILURE);
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x8(%rsp), %rax
movw %cx, (%rax)
movw %r8w, 0x2(%rax)
shll $0x3, %r8d
movw %r8w, 0x4(%rax)
shll $0x4, %ecx
movw %cx, 0x6(%rax)
xorl %edx, %edx
movq %rax, %rcx
callq 0x2ac8
testl %eax, %eax
je 0x650b
setns %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x4ecb6(%rip), %rsi     # 0x551c8
leaq 0x4b7b6(%rip), %rdi     # 0x51ccf
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0x2b9e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2bf6
movl %ebp, %edi
callq 0x22c0
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/yaft.c
// Function: check_fds
int check_fds(fd_set *fds, struct timeval *tv, int input, int master)
{
	FD_ZERO(fds);
	FD_SET(input, fds);
	FD_SET(master, fds);
	tv->tv_sec  = 0;
	tv->tv_usec = SELECT_TIMEOUT;
	return eselect(master + 1, fds, NULL, NULL, tv);
}

// Assembly:
movl %ecx, %r9d
movl %edx, %ecx
movq %rsi, %r8
movq %rdi, %rsi
xorl %eax, %eax
cmpq $0x10, %rax
je 0x6552
andq $0x0, (%rsi,%rax,8)
incq %rax
jmp 0x6542
pushq $0x40
popq %rdi
movl %ecx, %eax
cltd
idivl %edi
movslq %eax, %rdx
shll $0x6, %eax
subl %eax, %ecx
pushq $0x1
popq %r10
movq %r10, %rax
shlq %cl, %rax
orq %rax, (%rsi,%rdx,8)
movl %r9d, %eax
cltd
idivl %edi
movslq %eax, %rdx
shll $0x6, %eax
movl %r9d, %ecx
subl %eax, %ecx
shlq %cl, %r10
orq %r10, (%rsi,%rdx,8)
andq $0x0, (%r8)
movq $0x3a98, 0x8(%r8)       # imm = 0x3A98
incl %r9d
movl %r9d, %edi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x27cb
// File: /workspace/github_c_makefile_star2_O2/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: hue2rgb
static inline uint32_t hue2rgb(int n1, int n2, int hue)
{
	if (hue < 0)
		hue += HUEMAX;

	if (hue > HUEMAX)
		hue -= HUEMAX;

	if (hue < (HUEMAX / 6))
		return (n1 + (((n2 - n1) * hue + (HUEMAX / 12)) / (HUEMAX / 6)));
	if (hue < (HUEMAX / 2))
		return n2;
	if (hue < ((HUEMAX * 2) / 3))
		return (n1 + (((n2 - n1) * (((HUEMAX * 2) / 3) - hue) + (HUEMAX / 12)) / (HUEMAX / 6)));
	else
		return n1;
}

// Assembly:
movl %esi, %eax
leal 0x168(%rdx), %esi
testl %edx, %edx
cmovnsl %edx, %esi
leal -0x168(%rsi), %ecx
cmpl $0x169, %esi            # imm = 0x169
cmovll %esi, %ecx
cmpl $0x3b, %ecx
jg 0x6834
subl %edi, %eax
imull %eax, %ecx
addl $0x1e, %ecx
pushq $0x3c
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
addl %edi, %eax
retq
cmpl $0xb4, %ecx
jae 0x683d
retq
cmpl $0xef, %ecx
ja 0x685e
subl %edi, %eax
movl $0xf0, %edx
subl %ecx, %edx
imull %eax, %edx
addl $0x1e, %edx
pushq $0x3c
popq %rcx
movl %edx, %eax
cltd
idivl %ecx
jmp 0x6831
movl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/buffer.c
// Function: buffer
static int _buffer(String const * progname, size_t size, char const * data)
{
	int ret = 0;
	Buffer * buffer;

	printf("%s: Testing buffer_new()\n", progname);
	fflush(stdout);
	if((buffer = buffer_new(size, data)) == NULL)
	{
		error_print(progname);
		return 2;
	}
	if(buffer_get_size(buffer) != size)
		ret = 3;
	if(buffer_get_data(buffer) == NULL && size != 0)
		ret = 4;
	if(buffer_set(buffer, size, data) != 0
			|| buffer_set(buffer, size, NULL) != 0)
		ret = 5;
	if(buffer_set_size(buffer, size) != 0
			|| buffer_set_size(buffer, 0) != 0)
		ret = 6;
	buffer_delete(buffer);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq 0xdb7(%rip), %rdi       # 0x2004
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
movq 0x2d82(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x1090
movq %r14, %rdi
movq %r15, %rsi
callq 0x1030
testq %rax, %rax
je 0x12fd
movq %rax, %rbx
movq %rax, %rdi
callq 0x1050
movq %rax, %r12
movq %rbx, %rdi
callq 0x10a0
movq %rax, %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1080
testl %eax, %eax
jne 0x12d0
xorl %eax, %eax
cmpq %r14, %r12
setne %al
testq %r13, %r13
leal (%rax,%rax,2), %eax
pushq $0x4
popq %rbp
cmovnel %eax, %ebp
testq %r14, %r14
cmovel %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1080
testl %eax, %eax
je 0x12d3
pushq $0x5
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1040
testl %eax, %eax
jne 0x12f0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1040
testl %eax, %eax
je 0x12f3
pushq $0x6
popq %rbp
movq %rbx, %rdi
callq 0x10c0
jmp 0x1308
movq %r12, %rdi
callq 0x10b0
pushq $0x2
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kevinp89[P]Operating-System-EXT2-file-system-with-commands/ext2_ln.c
// Function: get_last_file_name
char *get_last_file_name(char *path){

    //take out the last / and get the file name (could be a dir)
    if (path[strlen(path) -1] == '/') path[strlen(path)-1] = '\0';

    // get the file name that is to be linked (first file)
    int i;
    int file_len1 = 0;
    for (i = strlen(path); path[i] != '/'; i--) {
        file_len1++;
        if (file_len1 > 255) {
            fprintf(stderr, "File name too large.\n");
            exit(1);
        }
    }

    //copy the new file name
    char *file_name = malloc(sizeof(char) * file_len1);
    strcpy(file_name, path + i + 1);

    return file_name;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1060
cmpb $0x2f, -0x1(%rbx,%rax)
jne 0x1515
movb $0x0, -0x1(%rbx,%rax)
movq %rbx, %rdi
callq 0x1060
cltq
addq %rax, %rbx
incq %rbx
xorl %edi, %edi
cmpb $0x2f, -0x1(%rbx)
je 0x153d
cmpl $0xff, %edi
je 0x154e
decq %rbx
incq %rdi
jmp 0x1527
callq 0x10c0
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x1050
movq 0x2aa3(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xabb(%rip), %rdi       # 0x201a
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x1120
pushq $0x1
popq %rdi
callq 0x1110
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]dhara/tests/journal.c
// Function: dump_info
static void dump_info(struct dhara_journal *j)
{
	printf("    log2_ppc   = %d\n", j->log2_ppc);
	printf("    size       = %d\n", dhara_journal_size(j));
	printf("    capacity   = %d\n", dhara_journal_capacity(j));
	printf("    bb_current = %d\n", j->bb_current);
	printf("    bb_last    = %d\n", j->bb_last);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzbl 0x10(%rdi), %esi
leaq 0xe5f(%rip), %rdi       # 0x305e
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x1681
leaq 0xe5e(%rip), %rdi       # 0x3073
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x165a
leaq 0xe5b(%rip), %rdi       # 0x3088
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movl 0x14(%rbx), %esi
leaq 0xe5d(%rip), %rdi       # 0x309d
xorl %eax, %eax
callq 0x1070
movl 0x18(%rbx), %esi
leaq 0xe61(%rip), %rdi       # 0x30b2
xorl %eax, %eax
popq %rbx
jmp 0x1070
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]dhara/tests/jtutil.c
// Function: jt_check
void jt_check(struct dhara_journal *j)
{
	/* Head and tail pointers always point to a valid user-page
	 * index (never a meta-page, and never out-of-bounds).
	 */
	check_upage(j, j->head);
	check_upage(j, j->tail);
	check_upage(j, j->tail_sync);

	/* The head never advances forward onto the same block as the
	 * tail.
	 */
	if (!((j->head ^ j->tail_sync) >> j->nand->log2_ppb)) {
		assert(j->head >= j->tail_sync);
	}

	/* The current tail is always between the head and the
	 * synchronized tail.
	 */
	assert((j->head - j->tail_sync) >= (j->tail - j->tail_sync));

	/* The root always points to a valid user page in a non-empty
	 * journal.
	 */
	if (j->root != DHARA_PAGE_NONE) {
		const dhara_page_t raw_size = j->head - j->tail;
		const dhara_page_t root_offset = j->root - j->tail;

		check_upage(j, j->root);
		assert(root_offset < raw_size);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %esi
callq 0x2ae5
movl 0x20(%rbx), %esi
movq %rbx, %rdi
callq 0x2ae5
movl 0x1c(%rbx), %esi
movq %rbx, %rdi
callq 0x2ae5
movl 0x24(%rbx), %ebp
movl 0x1c(%rbx), %eax
movl %eax, %edx
xorl %ebp, %edx
movq (%rbx), %rcx
movb 0x1(%rcx), %cl
shrl %cl, %edx
movl %ebp, %esi
subl %eax, %esi
jae 0x2a69
testl %edx, %edx
je 0x2a96
movl 0x20(%rbx), %ecx
movl %ecx, %edx
subl %eax, %edx
cmpl %edx, %esi
jb 0x2aaf
movl 0x28(%rbx), %esi
cmpl $-0x1, %esi
je 0x2a91
subl %ecx, %ebp
movl %esi, %r14d
subl %ecx, %r14d
movq %rbx, %rdi
callq 0x2ae5
cmpl %ebp, %r14d
jae 0x2ac8
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xb9d(%rip), %rdi       # 0x363a
leaq 0xbae(%rip), %rsi       # 0x3652
leaq 0xbb6(%rip), %rcx       # 0x3661
pushq $0x2d
jmp 0x2adf
leaq 0xbd1(%rip), %rdi       # 0x3687
leaq 0xb95(%rip), %rsi       # 0x3652
leaq 0xb9d(%rip), %rcx       # 0x3661
pushq $0x33
jmp 0x2adf
leaq 0xbed(%rip), %rdi       # 0x36bc
leaq 0xb7c(%rip), %rsi       # 0x3652
leaq 0xb84(%rip), %rcx       # 0x3661
pushq $0x3d
popq %rdx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]dhara/tests/jtutil.c
// Function: jt_enqueue_sequence
int jt_enqueue_sequence(struct dhara_journal *j, int start, int count)
{
	int i;

	if (count < 0)
		count = j->nand->num_blocks << j->nand->log2_ppb;

	for (i = 0; i < count; i++) {
		uint8_t meta[DHARA_META_SIZE];
		dhara_page_t root;
		dhara_error_t err;

		if (enqueue(j, start + i, &err) < 0) {
			if (err == DHARA_E_JOURNAL_FULL)
				return i;

			dabort("enqueue", err);
		}

		assert(dhara_journal_size(j) >= i);
		root = dhara_journal_root(j);

		if (dhara_journal_read_meta(j, root, meta, &err) < 0)
			dabort("read_meta", err);
		assert(dhara_r32(meta) == start + i);
	}

	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, %r14d
movq %rdi, %r15
testl %edx, %edx
jns 0x2b62
movq (%r15), %rax
movl 0x4(%rax), %edx
movb 0x1(%rax), %cl
shll %cl, %edx
xorl %r12d, %r12d
testl %edx, %edx
movl $0x0, %ebp
movl %edx, 0xc(%rsp)
cmovgl %edx, %ebp
leaq 0x8(%rsp), %r13
cmpl %r12d, %ebp
je 0x2be7
leal (%r14,%r12), %ebx
movq %r15, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x2c41
testl %eax, %eax
jns 0x2ba7
movl 0x8(%rsp), %esi
cmpl $0x5, %esi
je 0x2bee
leaq 0xb31(%rip), %rdi       # 0x36d3
callq 0x29cb
movq %r15, %rdi
callq 0x1681
cmpl %r12d, %eax
jb 0x2c03
movl 0x28(%r15), %esi
movq %r15, %rdi
leaq 0x10(%rsp), %rdx
movq %r13, %rcx
callq 0x16bd
testl %eax, %eax
jns 0x2bdc
movl 0x8(%rsp), %esi
leaq 0xb59(%rip), %rdi       # 0x3730
callq 0x29cb
cmpl 0x10(%rsp), %ebx
jne 0x2c22
incl %r12d
jmp 0x2b78
movl 0xc(%rsp), %eax
movl %eax, %r12d
movl %r12d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xad1(%rip), %rdi       # 0x36db
leaq 0xa41(%rip), %rsi       # 0x3652
leaq 0xade(%rip), %rcx       # 0x36f6
movl $0x9a, %edx
callq 0x1080
leaq 0xb11(%rip), %rdi       # 0x373a
leaq 0xa22(%rip), %rsi       # 0x3652
leaq 0xabf(%rip), %rcx       # 0x36f6
movl $0x9f, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]dhara/tests/jtutil.c
// Function: enqueue
static int enqueue(struct dhara_journal *j, uint32_t id, dhara_error_t *err)
{
	const int page_size = 1 << j->nand->log2_page_size;
	uint8_t r[page_size];
	uint8_t meta[DHARA_META_SIZE];
	dhara_error_t my_err;
	int i;

	seq_gen(id, r, page_size);
	dhara_w32(meta, id);

	for (i = 0; i < DHARA_MAX_RETRIES; i++) {
		jt_check(j);
		if (!dhara_journal_enqueue(j, r, meta, &my_err))
			return 0;

		if (my_err != DHARA_E_RECOVER) {
			dhara_set_error(err, my_err);
			return -1;
		}

		recover(j);
	}

	dhara_set_error(err, DHARA_E_TOO_BAD);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %r14
movq (%rdi), %rax
movb (%rax), %cl
pushq $0x1
popq %rax
shlq %cl, %rax
movq %rdx, -0x38(%rbp)
movl %esi, %ebx
leaq 0xf(%rax), %rcx
andq $-0x10, %rcx
movq %rsp, %rsi
subq %rcx, %rsi
movq %rsi, %rsp
movslq %eax, %rdx
movl %ebx, %edi
movq %rsi, -0x40(%rbp)
callq 0x293c
leaq -0xd0(%rbp), %rax
movl %ebx, (%rax)
xorl %r12d, %r12d
leaq -0x2c(%rbp), %rbx
leaq -0x160(%rbp), %r13
pushq $-0x1
popq %r15
cmpl $0x8, %r12d
je 0x2dd1
movq %r14, %rdi
callq 0x2a28
movq %r14, %rdi
movq -0x40(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x187b
testl %eax, %eax
je 0x2de1
movl -0x30(%rbp), %eax
cmpl $0x4, %eax
jne 0x2dd4
movq %r12, -0x48(%rbp)
leaq 0xb90(%rip), %rdi       # 0x387b
callq 0x1060
xorl %r12d, %r12d
testb $0x4, 0x12(%r14)
je 0x2db1
movq %r14, %rdi
callq 0x1dba
movl %eax, %r15d
movq %r14, %rdi
callq 0x2a28
movq %r14, %rdi
cmpl $-0x1, %r15d
je 0x2d4e
movl %r15d, %esi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x16bd
testl %eax, %eax
jns 0x2d3b
movl -0x2c(%rbp), %esi
leaq 0x9fa(%rip), %rdi       # 0x3730
callq 0x29cb
movq %r14, %rdi
movl %r15d, %esi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1d22
jmp 0x2d5a
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x187b
movl %eax, %r15d
movq %r14, %rdi
callq 0x2a28
testl %r15d, %r15d
jns 0x2da6
movl -0x2c(%rbp), %esi
cmpl $0x4, %esi
jne 0x2d9a
leaq 0xb2b(%rip), %rdi       # 0x38a4
callq 0x1060
leal 0x1(%r12), %r15d
cmpl $0x7, %r12d
jl 0x2da9
leaq 0xade(%rip), %rdi       # 0x386e
pushq $0x3
popq %rsi
callq 0x29cb
jmp 0x2da9
leaq 0xad5(%rip), %rdi       # 0x3876
callq 0x29cb
movl %r12d, %r15d
movl %r15d, %r12d
jmp 0x2cf3
movq %r14, %rdi
callq 0x2a28
leaq 0xace(%rip), %rdi       # 0x388e
callq 0x1060
movq -0x48(%rbp), %r12
incl %r12d
jmp 0x2c9f
pushq $0x3
popq %rax
movq -0x38(%rbp), %rcx
testq %rcx, %rcx
je 0x2de4
movl %eax, (%rcx)
jmp 0x2de4
xorl %r15d, %r15d
movl %r15d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq