// File: /workspace/github_c_makefile_star2_O1/rikuu[P]kermit/cf.c
// Function: color_read
int color_read(color_file_t *pf, color_rec_t *r)
{
	int ret, dret;
file_read_more:
	ret = ks_getuntil((kstream_t*)pf->fp, KS_SEP_LINE, &pf->buf, &dret);
	if (ret < 0) return ret;
	ret = color_parse(pf->buf.l, pf->buf.s, r);
	if (ret < 0) goto file_read_more;
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
movq (%r14), %r12
movq $0x0, 0x8(%r14)
movl (%r12), %eax
cmpl 0x4(%r12), %eax
jl 0x803c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x3, 0x8(%r12)
jne 0x81b5
movl (%r12), %eax
cmpl 0x4(%r12), %eax
jl 0x8094
movl 0x8(%r12), %edx
testb $0x3, %dl
jne 0x8167
movl $0x0, (%r12)
movq 0x10(%r12), %rdi
movq 0x18(%r12), %rsi
sarl $0x2, %edx
callq 0x1110
movl %eax, 0x4(%r12)
movl 0x8(%r12), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x808c
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r12)
testl %eax, %eax
je 0x8167
movl (%r12), %eax
movl 0x4(%r12), %ecx
movl %eax, %r13d
cmpl %ecx, %eax
jge 0x80c2
movslq %eax, %rdx
addq 0x18(%r12), %rdx
movl %eax, %r13d
cmpb $0xa, (%rdx)
je 0x80c2
incl %r13d
incq %rdx
cmpl %r13d, %ecx
jne 0x80af
movl %ecx, %r13d
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rsi
subq %rcx, %rsi
movl %r13d, %edx
subl %eax, %edx
leal 0x1(%rdx), %eax
cltq
cmpq %rax, %rsi
jae 0x8127
movslq %edx, %rax
addq %rax, %rcx
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x10(%r14)
movq 0x18(%r14), %rdi
callq 0x1180
movq %rax, 0x18(%r14)
movq 0x18(%r14), %rdi
addq 0x8(%r14), %rdi
movslq (%r12), %rax
movq 0x18(%r12), %rsi
addq %rax, %rsi
movslq %r13d, %rbx
movq %rbx, %rdx
subq %rax, %rdx
callq 0x1140
movslq (%r12), %rax
subq %rax, %rbx
addq %rbx, 0x8(%r14)
leal 0x1(%r13), %eax
movl %eax, (%r12)
cmpl 0x4(%r12), %r13d
jge 0x803c
movq 0x18(%r14), %rcx
testq %rcx, %rcx
je 0x818a
movq 0x8(%r14), %rax
cmpq $0x2, %rax
jb 0x81a5
cmpb $0xd, -0x1(%rcx,%rax)
jne 0x81a5
decq %rax
movq %rax, 0x8(%r14)
jmp 0x81a5
movq $0x1, 0x10(%r14)
movl $0x1, %edi
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x18(%r14)
movq 0x8(%r14), %rax
movq 0x18(%r14), %rcx
movb $0x0, (%rcx,%rax)
movl 0x8(%r14), %eax
testl %eax, %eax
js 0x827f
movq 0x8(%r14), %r12
movq 0x18(%r14), %rdi
movq 0x8(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r12d, %r12d
js 0x8277
movl %r12d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
incl %r12d
leaq 0x1(%rdi), %rbp
xorl %r15d, %r15d
xorl %ebx, %ebx
cmpq %r13, %r15
jae 0x8207
cmpb $0x9, -0x1(%rbp)
jne 0x8263
movb $0x0, -0x1(%rbp)
cmpl $0x2, %ebx
je 0x823d
cmpl $0x1, %ebx
je 0x8223
testl %ebx, %ebx
jne 0x8255
movq 0x8(%rsp), %rax
movq %rdi, (%rax)
jmp 0x8255
leaq 0x10(%rsp), %rsi
movl $0xa, %edx
callq 0x1130
movq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
jmp 0x8255
leaq 0x10(%rsp), %rsi
movl $0xa, %edx
callq 0x1130
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
incl %ebx
cmpq %r13, %r15
movl $0x0, %edi
cmovbq %rbp, %rdi
incq %r15
incq %rbp
cmpq %r15, %r12
jne 0x81fc
xorl %eax, %eax
testl %ebx, %ebx
setle %al
negl %eax
testl %eax, %eax
js 0x8015
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop