// File: /workspace/github_c_makefile_star2_O3/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 0x6754
movq %rax, %r11
addq %rbx, %r11
movq %r11, (%rsp)
movzbl (%rbx), %eax
leal -0x21(%rax), %ecx
cmpl $0x3, %ecx
ja 0x602a
leaq 0x216e(%rip), %rdx      # 0x8088
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 0x5f36
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 0x2d12
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), %r11
jne 0x6021
incl %ecx
andl $0x3f, %ecx
movzwl 0x8(%r14), %esi
xorl %edx, %edx
movzwl %si, %edi
cmpl %edi, 0x4(%r15)
jle 0x601b
movzwl 0xa(%r14), %r9d
cmpl %r9d, 0x8(%r15)
jle 0x601b
movl 0x14(%r14), %r8d
imull %r8d, %r9d
leal (%r9,%rdi,4), %esi
xorl %edi, %edi
movl 0x4(%r15), %r9d
imull 0x8(%r15), %r9d
shll $0x2, %r9d
cmpl %r9d, %esi
jge 0x6000
btl %edi, %ecx
jae 0x5ff6
movq (%r14), %r8
movslq %esi, %r9
movzbl 0x18(%r14), %r10d
movl 0x1c(%r14,%r10,4), %r10d
movl %r10d, (%r8,%r9)
movl 0x14(%r14), %r8d
addl %r8d, %esi
incl %edi
cmpl $0x6, %edi
jne 0x5fc7
movl 0x8(%r14), %esi
movl 0xc(%r14), %r8d
incl %esi
movw %si, 0x8(%r14)
movzwl %si, %edi
cmpl %edi, %r8d
jge 0x601b
movl %edi, 0xc(%r14)
incl %edx
cmpl %eax, %edx
jne 0x5fa5
addq $0x2, %rbp
jmp 0x6745
cmpl $0x2d, %eax
jne 0x605e
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 0x6745
movl %eax, 0x10(%r14)
jmp 0x6745
leal -0x7f(%rax), %ecx
cmpb $-0x40, %cl
jae 0x634f
movl $0x1, %ebp
testl %eax, %eax
jne 0x6745
jmp 0x6754
leaq 0x1(%rbx), %r13
callq 0x2340
movq (%rax), %rax
xorl %ebp, %ebp
movsbq (%r13,%rbp), %rcx
incq %rbp
cmpq $0x3b, %rcx
je 0x608a
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
jne 0x608a
leaq -0x1(%rbp), %rdx
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2070
movb $0x0, 0x9f(%rsp,%rbp)
leaq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x70(%rax)
movq %r12, %rdi
callq 0x20d0
testq %rax, %rax
je 0x6741
xorl %r13d, %r13d
leaq 0xa0(%rsp), %rcx
xorl %esi, %esi
xorl %edi, %edi
xorl %edx, %edx
movsbl (%rcx), %r8d
leal -0x3a(%r8), %r9d
cmpl $-0xa, %r9d
jb 0x6120
movq %rcx, %r9
jmp 0x6123
xorl %r9d, %r9d
testq %rdx, %rdx
cmoveq %r9, %rdx
cmpl $0x3b, %r8d
jne 0x6151
movb $0x0, (%rcx)
cmpl $0xf, %edi
jle 0x613d
xorl %r8d, %r8d
jmp 0x614f
movslq %edi, %rsi
movq %rdx, 0x20(%rsp,%rsi,8)
incl %edi
xorl %r8d, %r8d
movl %edi, %r13d
movl %edi, %esi
xorl %edx, %edx
cmpq $0x1, %rax
jne 0x6187
testq %rdx, %rdx
je 0x6165
movl %esi, %edi
cmpl $0xf, %esi
jle 0x6176
jmp 0x6187
testb %r8b, %r8b
jne 0x6181
movl %r13d, %esi
movl %r13d, %edi
cmpl $0xf, %r13d
jg 0x6187
movslq %esi, %r13
movq %rdx, 0x20(%rsp,%r13,8)
incl %r13d
movl %r13d, %esi
movl %r13d, %edi
incq %rcx
decq %rax
jne 0x610d
testl %r13d, %r13d
jle 0x6741
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x63dc
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d12
movq %rax, %r12
movl $0xff, %eax
cmpl %eax, %r12d
cmovgel %eax, %r12d
testl %r12d, %r12d
movl $0x0, %eax
cmovlel %eax, %r12d
jmp 0x63df
movw $0x0, 0x8(%r14)
movl $0x1, %ebp
jmp 0x6745
leaq 0x1(%rbx), %r13
callq 0x2340
movq (%rax), %rax
xorl %ebp, %ebp
movsbq (%r13,%rbp), %rcx
incq %rbp
cmpq $0x3b, %rcx
je 0x61f5
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
jne 0x61f5
leaq -0x1(%rbp), %rdx
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2070
movb $0x0, 0x9f(%rsp,%rbp)
leaq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x70(%rax)
movq %r12, %rdi
callq 0x20d0
testq %rax, %rax
movq (%rsp), %r11
je 0x6745
xorl %edx, %edx
leaq 0xa0(%rsp), %rcx
xorl %edi, %edi
xorl %r8d, %r8d
xorl %esi, %esi
movsbl (%rcx), %r9d
leal -0x3a(%r9), %r10d
cmpl $-0xa, %r10d
jb 0x628f
movq %rcx, %r10
jmp 0x6292
xorl %r10d, %r10d
testq %rsi, %rsi
cmoveq %r10, %rsi
cmpl $0x3b, %r9d
jne 0x62c3
movb $0x0, (%rcx)
cmpl $0xf, %r8d
jle 0x62ad
xorl %r9d, %r9d
jmp 0x62c1
movslq %r8d, %rdx
movq %rsi, 0x20(%rsp,%rdx,8)
incl %r8d
xorl %r9d, %r9d
movl %r8d, %edx
movl %r8d, %edi
xorl %esi, %esi
cmpq $0x1, %rax
jne 0x62f6
testq %rsi, %rsi
je 0x62d8
movl %edi, %r8d
cmpl $0xf, %edi
jle 0x62e7
jmp 0x62f6
testb %r9b, %r9b
jne 0x62f1
movl %edx, %edi
movl %edx, %r8d
cmpl $0xf, %edx
jg 0x62f6
movslq %edi, %rdx
movq %rsi, 0x20(%rsp,%rdx,8)
incl %edx
movl %edx, %edi
movl %edx, %r8d
incq %rcx
decq %rax
jne 0x627c
cmpl $0x4, %edx
jl 0x6745
movq 0x30(%rsp), %rdi
xorl %r13d, %r13d
movl $0x0, %eax
testq %rdi, %rdi
je 0x6329
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d12
movl %eax, 0xc(%r14)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x6346
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d12
movq %rax, %r13
movl %r13d, 0x10(%r14)
jmp 0x6741
movzwl 0x8(%r14), %ecx
movl $0x1, %ebp
cmpl %ecx, 0x4(%r15)
jle 0x6745
movzwl 0xa(%r14), %edx
cmpl %edx, 0x8(%r15)
jle 0x6745
incl %eax
andl $0x3f, %eax
movl 0x14(%r14), %esi
imull %esi, %edx
leal (%rdx,%rcx,4), %ecx
xorl %edx, %edx
movl 0x4(%r15), %edi
imull 0x8(%r15), %edi
shll $0x2, %edi
cmpl %edi, %ecx
jge 0x63b9
btl %edx, %eax
jae 0x63b0
movq (%r14), %rsi
movslq %ecx, %rdi
movzbl 0x18(%r14), %r8d
movl 0x1c(%r14,%r8,4), %r8d
movl %r8d, (%rsi,%rdi)
movl 0x14(%r14), %esi
addl %esi, %ecx
incl %edx
cmpl $0x6, %edx
jne 0x6383
movl 0x8(%r14), %eax
movl 0xc(%r14), %ecx
incl %eax
movw %ax, 0x8(%r14)
movzwl %ax, %eax
cmpl %eax, %ecx
jge 0x6745
movl %eax, 0xc(%r14)
jmp 0x6745
xorl %r12d, %r12d
cmpl $0x5, %r13d
je 0x63f8
cmpl $0x1, %r13d
jne 0x6741
movb %r12b, 0x18(%r14)
jmp 0x6741
movq 0x28(%rsp), %rdi
xorl %r13d, %r13d
testq %rdi, %rdi
je 0x641e
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d12
cmpl $0x1, %eax
sete %al
movq %rax, 0x8(%rsp)
jmp 0x6427
movq $0x0, 0x8(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x6441
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d12
movzwl %ax, %r13d
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x645d
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d12
movzwl %ax, %r8d
jmp 0x6460
xorl %r8d, %r8d
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x64b8
movq %r13, 0x10(%rsp)
movq %r8, %r13
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d12
movzwl %ax, %ecx
cmpb $0x0, 0x8(%rsp)
je 0x64de
testl %ecx, %ecx
movq %r13, %r8
movq 0x10(%rsp), %r9
je 0x64c1
cmpl $0x32, %r8d
ja 0x653b
addl $0x64, %ecx
imull %r8d, %ecx
addl $0x32, %ecx
imulq $0x51eb851f, %rcx, %rax # imm = 0x51EB851F
shrq $0x25, %rax
jmp 0x6553
xorl %ecx, %ecx
cmpb $0x0, 0x8(%rsp)
je 0x64e6
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 0x672f
movq %r13, %r8
movq 0x10(%rsp), %r13
movl %r13d, %eax
shll $0x8, %eax
subl %r13d, %eax
imulq $0x28f5c29, %rax, %rax  # imm = 0x28F5C29
shrq $0x20, %rax
movl $0xff, %esi
andl %esi, %eax
shll $0x10, %eax
movl %r8d, %edx
shll $0x8, %edx
subl %r8d, %edx
imulq $0x28f5c29, %rdx, %rdx  # imm = 0x28F5C29
shrq $0x20, %rdx
shll $0x8, %edx
movzwl %dx, %edx
orl %eax, %edx
movl %ecx, %eax
shll $0x8, %eax
subl %ecx, %eax
imulq $0x28f5c29, %rax, %rcx  # imm = 0x28F5C29
shrq $0x20, %rcx
andl %esi, %ecx
orl %edx, %ecx
jmp 0x6739
leal (%rcx,%r8), %eax
imull %r8d, %ecx
addl $0x32, %ecx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
shrq $0x25, %rcx
subl %ecx, %eax
addl %r8d, %r8d
subl %eax, %r8d
leal 0x78(%r9), %ecx
leal -0xf0(%r9), %edx
cmpl $0xf1, %r9d
cmovbl %ecx, %edx
cmpl $0x3b, %edx
jg 0x65a2
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 0x65e0
movl %eax, %ecx
cmpl $0xb4, %edx
jb 0x65e0
movl %r8d, %ecx
cmpl $0xef, %edx
ja 0x65e0
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 0x6593
leal -0x168(%r9), %esi
cmpl $0x169, %r9d            # imm = 0x169
cmovbl %r9d, %esi
cmpl $0x3b, %esi
jg 0x6626
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 0x6664
movl %eax, %edx
cmpl $0xb4, %esi
jb 0x6664
movl %r8d, %edx
cmpl $0xef, %esi
ja 0x6664
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 0x6617
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 0x66b7
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 0x66f0
cmpl $0xb4, %esi
jb 0x66f0
cmpl $0xef, %esi
ja 0x66ed
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 0x66a8
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 %r12d, %eax
movl %ecx, 0x1c(%r14,%rax,4)
movq (%rsp), %r11
movslq %ebp, %rax
addq %rax, %rbx
cmpq %r11, %rbx
jb 0x5f04
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq