// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: edi_is_filename_at
static int edi_is_filename_at(deark *c, de_arch_lctx *d, i64 pos)
{
	u8 buf[13];
	size_t i;
	int found_nul = 0;
	int found_dot = 0;
	int base_len = 0;
	int ext_len = 0;

	if(pos+13 > c->infile->len) return 0;
	de_read(buf, pos, 13);

	for(i=0; i<13; i++) {
		u8 b;

		b = buf[i];
		if(b==0) {
			found_nul = 1;
			break;
		}
		else if(b=='.') {
			if(found_dot) return 0;
			found_dot = 1;
		}
		else if(b<33 || b=='"' || b=='*' || b=='+' || b==',' || b=='/' ||
			b==':' || b==';' || b=='<' || b=='=' || b=='>' || b=='?' ||
			b=='[' || b=='\\' || b==']' || b=='|' || b==127)
		{
			return 0;
		}
		else {
			// TODO: Are capital letters allowed in this format? If not, that
			// would be a good thing to check for.
			if(found_dot) ext_len++;
			else base_len++;
		}
	}

	if(!found_nul || base_len<1 || base_len>8 || ext_len>3) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
addq $0xd, %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0xa1aa2
movl $0x0, -0x4(%rbp)
jmp 0xa1c1b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x2d(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0xd, %ecx
callq 0x164d10
movq $0x0, -0x38(%rbp)
cmpq $0xd, -0x38(%rbp)
jae 0xa1bf3
movq -0x38(%rbp), %rax
movb -0x2d(%rbp,%rax), %al
movb %al, -0x49(%rbp)
movzbl -0x49(%rbp), %eax
cmpl $0x0, %eax
jne 0xa1aef
movl $0x1, -0x3c(%rbp)
jmp 0xa1bf3
movzbl -0x49(%rbp), %eax
cmpl $0x2e, %eax
jne 0xa1b16
cmpl $0x0, -0x40(%rbp)
je 0xa1b0a
movl $0x0, -0x4(%rbp)
jmp 0xa1c1b
movl $0x1, -0x40(%rbp)
jmp 0xa1bde
movzbl -0x49(%rbp), %eax
cmpl $0x21, %eax
jl 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x22, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x2a, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x2b, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x2c, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x2f, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x3a, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x3b, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x3c, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x3d, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x3e, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x3f, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x5b, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x5c, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x5d, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x7c, %eax
je 0xa1bb7
movzbl -0x49(%rbp), %eax
cmpl $0x7f, %eax
jne 0xa1bc0
movl $0x0, -0x4(%rbp)
jmp 0xa1c1b
cmpl $0x0, -0x40(%rbp)
je 0xa1bd1
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xa1bda
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xa1bdc
jmp 0xa1bde
jmp 0xa1be0
jmp 0xa1be2
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xa1ac4
cmpl $0x0, -0x3c(%rbp)
je 0xa1c0b
cmpl $0x1, -0x44(%rbp)
jl 0xa1c0b
cmpl $0x8, -0x44(%rbp)
jg 0xa1c0b
cmpl $0x3, -0x48(%rbp)
jle 0xa1c14
movl $0x0, -0x4(%rbp)
jmp 0xa1c1b
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)