// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x20d0
testq %rax, %rax
jle 0x6702
movq %rax, %r12
addq %rbx, %r12
movq %r12, (%rsp)
movzbl (%rbx), %eax
leal -0x21(%rax), %ecx
cmpl $0x3, %ecx
ja 0x5ffd
leaq 0x215c(%rip), %rdx      # 0x8058
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x1(%rbx), %r13
callq 0x2340
movq (%rax), %rax
movq $-0x1, %rbp
movsbq 0x1(%r13,%rbp), %rcx
incq %rbp
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x5f18
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2070
movb $0x0, 0xa0(%rsp,%rbp)
movq %r12, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movzbl (%r13,%rbp), %ecx
leal -0x3f(%rcx), %edx
cmpb $0x40, %dl
setb %dl
testl %eax, %eax
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
movq (%rsp), %r12
jne 0x5ff4
incl %ecx
andl $0x3f, %ecx
xorl %edx, %edx
movzwl 0x8(%r14), %esi
cmpl %esi, 0x4(%r15)
jle 0x5fee
movzwl 0xa(%r14), %edi
cmpl %edi, 0x8(%r15)
jle 0x5fee
imull 0x14(%r14), %edi
leal (%rdi,%rsi,4), %esi
xorl %edi, %edi
movl 0x4(%r15), %r8d
imull 0x8(%r15), %r8d
shll $0x2, %r8d
cmpl %r8d, %esi
jge 0x5fd4
btl %edi, %ecx
jae 0x5fc9
movq (%r14), %r8
movslq %esi, %r9
movzbl 0x18(%r14), %r10d
movl 0x1c(%r14,%r10,4), %r10d
movl %r10d, (%r8,%r9)
addl 0x14(%r14), %esi
incl %edi
cmpl $0x6, %edi
jne 0x5f9e
movl 0x8(%r14), %esi
movl 0xc(%r14), %edi
incl %esi
movw %si, 0x8(%r14)
movzwl %si, %esi
cmpl %esi, %edi
jge 0x5fee
movl %esi, 0xc(%r14)
incl %edx
cmpl %eax, %edx
jne 0x5f7e
addq $0x2, %rbp
jmp 0x66f3
cmpl $0x2d, %eax
jne 0x6031
movzwl 0xa(%r14), %eax
addl $0x6, %eax
movw %ax, 0xa(%r14)
movw $0x0, 0x8(%r14)
movzwl %ax, %eax
movl $0x1, %ebp
cmpl %eax, 0x10(%r14)
jge 0x66f3
movl %eax, 0x10(%r14)
jmp 0x66f3
leal -0x7f(%rax), %ecx
cmpb $-0x40, %cl
jae 0x62e8
movl $0x1, %ebp
testl %eax, %eax
jne 0x66f3
jmp 0x6702
leaq 0x1(%rbx), %r13
callq 0x2340
movq (%rax), %rax
xorl %ebp, %ebp
movsbq (%r13,%rbp), %rcx
incq %rbp
cmpq $0x3b, %rcx
je 0x605d
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
jne 0x605d
leaq -0x1(%rbp), %rdx
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2070
movb $0x0, 0x9f(%rsp,%rbp)
movl $0x0, 0x18(%rsp)
leaq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r12, %rdi
callq 0x20d0
testq %rax, %rax
je 0x6265
xorl %ecx, %ecx
leaq 0xa0(%rsp), %rdx
xorl %esi, %esi
testq %rsi, %rsi
jne 0x60fa
movsbl (%rdx), %esi
addl $-0x3a, %esi
cmpl $-0xa, %esi
movl $0x0, %esi
cmovaeq %rdx, %rsi
cmpb $0x3b, (%rdx)
jne 0x6113
movb $0x0, (%rdx)
cmpl $0xf, %ecx
jg 0x6111
movslq %ecx, %rdi
movq %rsi, 0x20(%rsp,%rdi,8)
incl %ecx
xorl %esi, %esi
cmpq $0x1, %rax
jne 0x612d
testq %rsi, %rsi
je 0x613a
cmpl $0xf, %ecx
jg 0x612d
movslq %ecx, %rdi
movq %rsi, 0x20(%rsp,%rdi,8)
incl %ecx
incq %rdx
decq %rax
jne 0x60e3
jmp 0x6261
cmpb $0x0, (%rdx)
setne %dil
cmpl $0x10, %ecx
setge %r8b
orb %dil, %r8b
je 0x6123
jmp 0x612d
movw $0x0, 0x8(%r14)
movl $0x1, %ebp
jmp 0x66f3
leaq 0x1(%rbx), %r13
callq 0x2340
movq (%rax), %rax
xorl %ebp, %ebp
movsbq (%r13,%rbp), %rcx
incq %rbp
cmpq $0x3b, %rcx
je 0x616e
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
jne 0x616e
leaq -0x1(%rbp), %rdx
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2070
movb $0x0, 0x9f(%rsp,%rbp)
movl $0x0, 0x18(%rsp)
leaq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r12, %rdi
callq 0x20d0
testq %rax, %rax
movq (%rsp), %r12
je 0x6299
xorl %ecx, %ecx
leaq 0xa0(%rsp), %rdx
xorl %esi, %esi
testq %rsi, %rsi
jne 0x620f
movsbl (%rdx), %esi
addl $-0x3a, %esi
cmpl $-0xa, %esi
movl $0x0, %esi
cmovaeq %rdx, %rsi
cmpb $0x3b, (%rdx)
jne 0x6228
movb $0x0, (%rdx)
cmpl $0xf, %ecx
jg 0x6226
movslq %ecx, %rdi
movq %rsi, 0x20(%rsp,%rdi,8)
incl %ecx
xorl %esi, %esi
cmpq $0x1, %rax
jne 0x6242
testq %rsi, %rsi
je 0x624c
cmpl $0xf, %ecx
jg 0x6242
movslq %ecx, %rdi
movq %rsi, 0x20(%rsp,%rdi,8)
incl %ecx
incq %rdx
decq %rax
jne 0x61f8
jmp 0x6295
cmpb $0x0, (%rdx)
setne %dil
cmpl $0x10, %ecx
setge %r8b
orb %dil, %r8b
je 0x6238
jmp 0x6242
movl %ecx, 0x18(%rsp)
movl 0x18(%rsp), %r12d
testl %r12d, %r12d
jle 0x66ef
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x6371
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq %rax, %r13
jmp 0x6374
movl %ecx, 0x18(%rsp)
cmpl $0x4, 0x18(%rsp)
jl 0x66f3
movq 0x30(%rsp), %rdi
xorl %r13d, %r13d
movl $0x0, %eax
testq %rdi, %rdi
je 0x62c2
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movl %eax, 0xc(%r14)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x62df
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movq %rax, %r13
movl %r13d, 0x10(%r14)
jmp 0x66f3
movzwl 0x8(%r14), %ecx
movl $0x1, %ebp
cmpl %ecx, 0x4(%r15)
jle 0x66f3
movzwl 0xa(%r14), %edx
cmpl %edx, 0x8(%r15)
jle 0x66f3
incl %eax
andl $0x3f, %eax
imull 0x14(%r14), %edx
leal (%rdx,%rcx,4), %ecx
xorl %edx, %edx
movl 0x4(%r15), %esi
imull 0x8(%r15), %esi
shll $0x2, %esi
cmpl %esi, %ecx
jge 0x634e
btl %edx, %eax
jae 0x6343
movq (%r14), %rsi
movslq %ecx, %rdi
movzbl 0x18(%r14), %r8d
movl 0x1c(%r14,%r8,4), %r8d
movl %r8d, (%rsi,%rdi)
addl 0x14(%r14), %ecx
incl %edx
cmpl $0x6, %edx
jne 0x631a
movl 0x8(%r14), %eax
movl 0xc(%r14), %ecx
incl %eax
movw %ax, 0x8(%r14)
movzwl %ax, %eax
cmpl %eax, %ecx
jge 0x66f3
movl %eax, 0xc(%r14)
jmp 0x66f3
xorl %r13d, %r13d
movl $0xff, %eax
cmpl %eax, %r13d
cmovgel %eax, %r13d
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
cmpl $0x5, %r12d
je 0x63a5
cmpl $0x1, %r12d
jne 0x66ef
movb %r13b, 0x18(%r14)
jmp 0x66ef
movq 0x28(%rsp), %rdi
xorl %r12d, %r12d
testq %rdi, %rdi
je 0x63cb
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
cmpl $0x1, %eax
sete %al
movq %rax, 0x10(%rsp)
jmp 0x63d4
movq $0x0, 0x10(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x63ee
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movzwl %ax, %r12d
movq %r12, 0x8(%rsp)
movq 0x38(%rsp), %rdi
xorl %r12d, %r12d
movl $0x0, %r8d
testq %rdi, %rdi
je 0x6416
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
movzwl %ax, %r8d
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6436
xorl %esi, %esi
movl $0xa, %edx
movq %r8, %r12
callq 0x2d03
movq %r12, %r8
movzwl %ax, %r12d
cmpb $0x0, 0x10(%rsp)
je 0x646c
testl %r12d, %r12d
je 0x64c6
cmpl $0x32, %r8d
ja 0x64e3
addl $0x64, %r12d
imull %r8d, %r12d
addl $0x32, %r12d
imulq $0x51eb851f, %r12, %rax # imm = 0x51EB851F
shrq $0x25, %rax
jmp 0x64fc
movq 0x8(%rsp), %rcx
movl %ecx, %eax
shll $0x8, %eax
subl %ecx, %eax
imulq $0x28f5c29, %rax, %rax  # imm = 0x28F5C29
shrq $0x20, %rax
movl %r8d, %ecx
shll $0x8, %ecx
subl %r8d, %ecx
imulq $0x28f5c29, %rcx, %rcx  # imm = 0x28F5C29
shrq $0x20, %rcx
movl %r12d, %edx
shll $0x8, %edx
subl %r12d, %edx
imulq $0x28f5c29, %rdx, %rdx  # imm = 0x28F5C29
shrq $0x20, %rdx
movl $0xff, %esi
andl %esi, %edx
andl %esi, %eax
shll $0x10, %eax
shll $0x8, %ecx
movzwl %cx, %ecx
orl %eax, %ecx
orl %edx, %ecx
jmp 0x66e7
movl %r8d, %eax
shll $0x8, %eax
subl %r8d, %eax
imulq $0x28f5c29, %rax, %rcx  # imm = 0x28F5C29
shrq $0x20, %rcx
movl %ecx, %eax
movl %ecx, %esi
jmp 0x66dd
leal (%r12,%r8), %eax
imull %r8d, %r12d
addl $0x32, %r12d
imulq $0x51eb851f, %r12, %rcx # imm = 0x51EB851F
shrq $0x25, %rcx
subl %ecx, %eax
addl %r8d, %r8d
subl %eax, %r8d
movq 0x8(%rsp), %r9
leal 0x78(%r9), %ecx
leal -0xf0(%r9), %edx
cmpl $0xf1, %r9d
cmovbl %ecx, %edx
cmpl $0x3b, %edx
jg 0x6550
movl %eax, %ecx
subl %r8d, %ecx
imull %edx, %ecx
movl %ecx, %edx
addl $0x1e, %edx
movslq %edx, %rdx
imulq $-0x77777777, %rdx, %rdx # imm = 0x88888889
shrq $0x20, %rdx
addl %edx, %ecx
addl $0x1e, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x5, %ecx
addl %edx, %ecx
addl %r8d, %ecx
jmp 0x658e
movl %eax, %ecx
cmpl $0xb4, %edx
jl 0x658e
movl %r8d, %ecx
cmpl $0xef, %edx
jg 0x658e
movl %eax, %ecx
subl %r8d, %ecx
movl $0xf0, %esi
subl %edx, %esi
imull %ecx, %esi
movl %esi, %ecx
addl $0x1e, %ecx
movslq %ecx, %rcx
imulq $-0x77777777, %rcx, %rcx # imm = 0x88888889
shrq $0x20, %rcx
addl %esi, %ecx
addl $0x1e, %ecx
jmp 0x6541
leal -0x168(%r9), %esi
cmpl $0x169, %r9d            # imm = 0x169
cmovbl %r9d, %esi
cmpl $0x3b, %esi
jg 0x65d4
movl %eax, %edx
subl %r8d, %edx
imull %esi, %edx
movl %edx, %esi
addl $0x1e, %esi
movslq %esi, %rsi
imulq $-0x77777777, %rsi, %rsi # imm = 0x88888889
shrq $0x20, %rsi
addl %esi, %edx
addl $0x1e, %edx
movl %edx, %esi
shrl $0x1f, %esi
sarl $0x5, %edx
addl %esi, %edx
addl %r8d, %edx
jmp 0x6612
movl %eax, %edx
cmpl $0xb4, %esi
jl 0x6612
movl %r8d, %edx
cmpl $0xef, %esi
jg 0x6612
movl %eax, %edx
subl %r8d, %edx
movl $0xf0, %edi
subl %esi, %edi
imull %edx, %edi
movl %edi, %edx
addl $0x1e, %edx
movslq %edx, %rdx
imulq $-0x77777777, %rdx, %rdx # imm = 0x88888889
shrq $0x20, %rdx
addl %edi, %edx
addl $0x1e, %edx
jmp 0x65c5
leal -0x78(%r9), %esi
leal 0xf0(%r9), %edi
cmpl $0x78, %r9d
cmovael %esi, %edi
leal -0x168(%rdi), %esi
cmpl $0x169, %edi            # imm = 0x169
cmovll %edi, %esi
cmpl $0x3b, %esi
jg 0x6665
subl %r8d, %eax
imull %esi, %eax
movl %eax, %esi
addl $0x1e, %esi
movslq %esi, %rsi
imulq $-0x77777777, %rsi, %rsi # imm = 0x88888889
shrq $0x20, %rsi
addl %esi, %eax
addl $0x1e, %eax
movl %eax, %esi
shrl $0x1f, %esi
sarl $0x5, %eax
addl %esi, %eax
addl %r8d, %eax
jmp 0x669e
cmpl $0xb4, %esi
jl 0x669e
cmpl $0xef, %esi
jg 0x669b
subl %r8d, %eax
movl $0xf0, %edi
subl %esi, %edi
imull %eax, %edi
movl %edi, %eax
addl $0x1e, %eax
cltq
imulq $-0x77777777, %rax, %rax # imm = 0x88888889
shrq $0x20, %rax
addl %edi, %eax
addl $0x1e, %eax
jmp 0x6656
movl %r8d, %eax
movl %ecx, %esi
shll $0x8, %esi
subl %ecx, %esi
addl $0x32, %esi
imulq $0x51eb851f, %rsi, %rsi # imm = 0x51EB851F
shrq $0x25, %rsi
movl %edx, %ecx
shll $0x8, %ecx
subl %edx, %ecx
addl $0x32, %ecx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
shrq $0x25, %rcx
movl %eax, %edx
shll $0x8, %edx
subl %eax, %edx
addl $0x32, %edx
imulq $0x51eb851f, %rdx, %rax # imm = 0x51EB851F
shrq $0x25, %rax
shll $0x10, %esi
shll $0x8, %ecx
addl %eax, %ecx
addl %esi, %ecx
movl %r13d, %eax
movl %ecx, 0x1c(%r14,%rax,4)
movq (%rsp), %r12
movslq %ebp, %rax
addq %rax, %rbx
cmpq %r12, %rbx
jb 0x5ee6
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq