// File: /workspace/github_c_makefile_star2_O0/bobrippling[P]tim/list.c
// Function: list_fname_at
char *list_fname_at(list_t *l, point_t const *pt)
{
	l = list_seek(l, pt->y, false);
	if(!l)
		return NULL;

	if((unsigned)pt->x >= l->len_line)
		return NULL;

	int start = pt->x;
	if(isfnamechar(l->line[start])){
		/* look backwards for the start */
		for(; start >= 0 && isfnamechar(l->line[start]); start--)
			;

		if(start < 0)
			start = 0;
		else /* !isfnamechar(line[start]) */
			start++;

	}else{
		/* look forwards for the beginning */
		for(; !isfnamechar(l->line[start]) && (unsigned)start < l->len_line; start++)
			;

		if((unsigned)start == l->len_line)
			return NULL;
	}


	int end = start;
	for(; (unsigned)end < l->len_line && isfnamechar(l->line[end]); end++)
		;

	/* end is either at the end of the line or not a fnamechar,
	 * either way: */
	end--;

	/* avoid '.' at the end */
	if(end > 0 && l->line[end] == '.')
		end--;

	if(end < start)
		return NULL;

	return ustrdup_len(&l->line[start], end - start + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %esi
xorl %edx, %edx
callq 0xcd50
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xe6ea
movq $0x0, -0x8(%rbp)
jmp 0xe88b
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jb 0xe707
movq $0x0, -0x8(%rbp)
jmp 0xe88b
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xe8a0
testb $0x1, %al
jne 0xe72a
jmp 0xe77e
jmp 0xe72c
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x21(%rbp)
jl 0xe74e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xe8a0
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xe757
jmp 0xe764
jmp 0xe759
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe72c
cmpl $0x0, -0x1c(%rbp)
jge 0xe773
movl $0x0, -0x1c(%rbp)
jmp 0xe77c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe7e3
jmp 0xe780
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xe8a0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x22(%rbp)
jne 0xe7b1
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
setb %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0xe7ba
jmp 0xe7c7
jmp 0xe7bc
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe780
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe7e1
movq $0x0, -0x8(%rbp)
jmp 0xe88b
jmp 0xe7e3
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x8(%rdx), %rcx
movb %al, -0x23(%rbp)
jae 0xe814
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xe8a0
movb %al, -0x23(%rbp)
movb -0x23(%rbp), %al
testb $0x1, %al
jne 0xe81d
jmp 0xe82a
jmp 0xe81f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xe7e9
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jle 0xe856
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jne 0xe856
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xe868
movq $0x0, -0x8(%rbp)
jmp 0xe88b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movslq -0x1c(%rbp), %rax
addq %rax, %rdi
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x5fe0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)