// File: /workspace/github_c_makefile_star2_O0/uobikiemukot[P]yaft/./ctrlseq/dcs.h
// Function: sixel_parse_data
void sixel_parse_data(struct terminal_t *term, struct sixel_canvas_t *sc, char *start_buf)
{
	/*
	DECDLD sixel data
		'$': carriage return
		'-': new line
		'#': color
			# Pc: select color
			# Pc; Pu; Px; Py; Pz
				Pc : color index (0 to 255)
				Pu : color coordinate system
					1: HLS (0 to 360 for Hue, 0 to 100 for others)
					2: RGB (0 to 100 percent) (default)
				Px : Hue        / Red
				Py : Lightness  / Green
				Pz : Saturation / Blue
		'"': attr
			" Pan; Pad; Ph; Pv
				Pan, Pad: defines aspect ratio (Pan / Pad) (ignored)
				Ph, Pv  : defines vertical/horizontal size of the image
		'!': repeat
			! Pn ch
				Pn : repeat count ([0-9]+)
				ch : character to repeat ('?' to '~')
		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.
	*/
	int size = 0;
	char *cp, *end_buf;
	uint8_t bitmap;

	cp = start_buf;
	end_buf = cp + strlen(start_buf);

	while (cp < end_buf) {
		if (*cp == '!') {
			size = sixel_repeat(term, sc, cp);
		} else if (*cp == '"') {
			size = sixel_attr(sc, cp);
		} else if (*cp == '#') {
			size = sixel_color(sc, cp);
		} else if (*cp == '$') {
			size = sixel_cr(sc);
		} else if (*cp == '-') {
			size = sixel_nl(sc);
		} else if ('?' <= *cp && *cp <= '~')  {
			bitmap =  bit_mask[BITS_PER_SIXEL] & (*cp - '?');
			size = sixel_bitmap(term, sc, bitmap);
		} else if (*cp == '\0') { /* end of sixel data */
			break;
		} else {
			size = 1;
		}
		cp += size;
	}

	logging(DEBUG, "sixel_parse_data()\nwidth:%d height:%d\n", sc->width, sc->height);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20d0
movq %rax, %rcx
movq -0x40(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x7c59
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x7b65
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x7c80
movl %eax, -0x1c(%rbp)
jmp 0x7c43
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x7b86
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7dc0
movl %eax, -0x1c(%rbp)
jmp 0x7c41
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x7ba7
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7f10
movl %eax, -0x1c(%rbp)
jmp 0x7c3f
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x24, %eax
jne 0x7bc1
movq -0x10(%rbp), %rdi
callq 0x8250
movl %eax, -0x1c(%rbp)
jmp 0x7c3d
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x7bdb
movq -0x10(%rbp), %rdi
callq 0x8290
movl %eax, -0x1c(%rbp)
jmp 0x7c3b
movq -0x28(%rbp), %rax
movsbl (%rax), %ecx
movl $0x3f, %eax
cmpl %ecx, %eax
jg 0x7c22
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7e, %eax
jg 0x7c22
movl 0x383b(%rip), %eax      # 0xb438
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
subl $0x3f, %ecx
andl %ecx, %eax
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzbl -0x31(%rbp), %edx
callq 0x82f0
movl %eax, -0x1c(%rbp)
jmp 0x7c39
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7c30
jmp 0x7c59
movl $0x1, -0x1c(%rbp)
jmp 0x7c39
jmp 0x7c3b
jmp 0x7c3d
jmp 0x7c3f
jmp 0x7c41
jmp 0x7c43
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
jmp 0x7b32
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
xorl %edi, %edi
leaq 0x4e1ac(%rip), %rsi     # 0x55e1c
movb $0x0, %al
callq 0x2450
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)