// File: /workspace/github_c_makefile_star2_O2/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), %r13
andq $0x0, 0x8(%r14)
movl (%r13), %ecx
movl 0x4(%r13), %eax
cmpl %eax, %ecx
jl 0x662c
testb $0x3, 0x8(%r13)
jne 0x6840
cmpl %eax, %ecx
jl 0x6678
movl 0x8(%r13), %edx
testb $0x3, %dl
jne 0x6749
andl $0x0, (%r13)
movq 0x10(%r13), %rdi
movq 0x18(%r13), %rsi
sarl $0x2, %edx
callq 0x1110
movl %eax, 0x4(%r13)
movl 0x8(%r13), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x666c
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r13)
testl %eax, %eax
je 0x6749
movl (%r13), %ecx
movslq %ecx, %rsi
cltq
cmpl %esi, %eax
movl %esi, %r12d
cmovgl %eax, %r12d
movq %rsi, %rdx
cmpq %rax, %rdx
jge 0x66a0
movq 0x18(%r13), %rdi
cmpb $0xa, (%rdi,%rdx)
je 0x669d
incq %rdx
jmp 0x6689
movl %edx, %r12d
movq 0x8(%r14), %rdi
movq 0x10(%r14), %r8
subq %rdi, %r8
movl %r12d, %edx
subl %ecx, %edx
leal 0x1(%rdx), %eax
movslq %eax, %rcx
movq 0x18(%r14), %rax
cmpq %rcx, %r8
jae 0x6716
movslq %edx, %rcx
addq %rcx, %rdi
movq %rdi, %rcx
shrq %rcx
orq %rdi, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rsi
shrq $0x10, %rsi
orq %rdx, %rsi
incq %rsi
movq %rsi, 0x10(%r14)
movq %rax, %rdi
callq 0x1180
movq %rax, 0x18(%r14)
movq 0x8(%r14), %rdi
movslq (%r13), %rsi
movl %r12d, %edx
subl %esi, %edx
addq %rax, %rdi
addq 0x18(%r13), %rsi
movslq %edx, %rdx
callq 0x1140
movslq (%r13), %rax
movslq %r12d, %rcx
subq %rax, %rcx
addq %rcx, 0x8(%r14)
leal 0x1(%r12), %ecx
movl %ecx, (%r13)
movl 0x4(%r13), %eax
cmpl %eax, %r12d
jge 0x662c
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x676c
movq 0x8(%r14), %rcx
cmpq $0x2, %rcx
jb 0x6787
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x6787
decq %rcx
movq %rcx, 0x8(%r14)
jmp 0x6787
movq $0x1, 0x10(%r14)
pushq $0x1
popq %rdi
movq %rdi, %rsi
callq 0x10f0
movq %rax, 0x18(%r14)
movq 0x8(%r14), %rcx
movb $0x0, (%rax,%rcx)
movq 0x8(%r14), %r13
testl %r13d, %r13d
js 0x6846
movq 0x18(%r14), %r12
movq 0x8(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x1(%r13), %rbp
xorl %r15d, %r15d
movq %r12, %rdi
xorl %ebx, %ebx
cmpq %r15, %rbp
je 0x6833
cmpq %r13, %r15
jae 0x67d0
cmpb $0x9, (%r12,%r15)
jne 0x682e
movb $0x0, (%r12,%r15)
cmpl $0x2, %ebx
je 0x6805
cmpl $0x1, %ebx
je 0x67ed
testl %ebx, %ebx
jne 0x681b
movq 0x8(%rsp), %rax
movq %rdi, (%rax)
jmp 0x681b
leaq 0x10(%rsp), %rsi
pushq $0xa
popq %rdx
callq 0x1130
movq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
jmp 0x681b
leaq 0x10(%rsp), %rsi
pushq $0xa
popq %rdx
callq 0x1130
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
incl %ebx
cmpq %r13, %r15
leaq 0x1(%r12,%r15), %rdi
movl $0x0, %eax
cmovaeq %rax, %rdi
incq %r15
jmp 0x67bf
testl %ebx, %ebx
jle 0x660d
xorl %r13d, %r13d
jmp 0x6846
pushq $-0x1
popq %rax
movl %eax, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq