// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]ufat/main.c
// Function: parse_attribute
static int parse_attribute(const char *spec, struct ufat_dirent *ent)
{
	char key[64];
	char *value;

	if (*spec == '+' || *spec == '~' || *spec == '=') {
		ufat_attr_t a;

		if (parse_dosattr(spec + 1, &a) < 0)
			return -1;

		if (*spec == '+')
			ent->attributes |= a;
		else if (*spec == '=')
			ent->attributes = a;
		else
			ent->attributes &= ~a;

		return 0;
	}

	/* Try to identify a key=value pair */
	strncpy(key, spec, sizeof(key));
	key[sizeof(key) - 1] = 0;

	value = strchr(key, '=');
	if (!value) {
		fprintf(stderr, "Unknown attribute specification: %s\n",
			spec);
		return -1;
	}

	*(value++) = 0;

	/* Deal with it */
	if (!strcasecmp(key, "create_date"))
		return parse_date(value, &ent->create_date);
	if (!strcasecmp(key, "create_time"))
		return parse_time(value, &ent->create_time);
	if (!strcasecmp(key, "modify_date"))
		return parse_date(value, &ent->modify_date);
	if (!strcasecmp(key, "modify_time"))
		return parse_time(value, &ent->modify_time);
	if (!strcasecmp(key, "access_date"))
		return parse_date(value, &ent->access_date);

	fprintf(stderr, "Unknown attribute: %s\n", key);
	return -1;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0xb1f5
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x7e, %eax
je 0xb1f5
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xb274
movq 0x58(%rsp), %rdi
addq $0x1, %rdi
leaq 0x4(%rsp), %rsi
callq 0xb410
cmpl $0x0, %eax
jge 0xb21a
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0xb400
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0xb238
movl 0x4(%rsp), %ecx
movq 0x50(%rsp), %rax
orl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
jmp 0xb267
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xb253
movl 0x4(%rsp), %ecx
movq 0x50(%rsp), %rax
movl %ecx, 0x2c(%rax)
jmp 0xb265
movl 0x4(%rsp), %ecx
xorl $-0x1, %ecx
movq 0x50(%rsp), %rax
andl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
jmp 0xb267
movl $0x0, 0x64(%rsp)
jmp 0xb400
leaq 0x10(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl $0x40, %edx
callq 0x2070
movb $0x0, 0x4f(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x3d, %esi
callq 0x20e0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xb2d3
movq 0x4d48(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq 0x58(%rsp), %rdx
leaq 0x1b30(%rip), %rsi      # 0xcdef
movb $0x0, %al
callq 0x2120
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0xb400
movq 0x8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rsp)
movb $0x0, (%rax)
leaq 0x10(%rsp), %rdi
leaq 0x1b21(%rip), %rsi      # 0xce14
callq 0x2030
cmpl $0x0, %eax
jne 0xb319
movq 0x8(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x30, %rsi
callq 0xb4f0
movl %eax, 0x64(%rsp)
jmp 0xb400
leaq 0x10(%rsp), %rdi
leaq 0x1afb(%rip), %rsi      # 0xce20
callq 0x2030
cmpl $0x0, %eax
jne 0xb34b
movq 0x8(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x32, %rsi
callq 0xb690
movl %eax, 0x64(%rsp)
jmp 0xb400
leaq 0x10(%rsp), %rdi
leaq 0x1ad5(%rip), %rsi      # 0xce2c
callq 0x2030
cmpl $0x0, %eax
jne 0xb37d
movq 0x8(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x34, %rsi
callq 0xb4f0
movl %eax, 0x64(%rsp)
jmp 0xb400
leaq 0x10(%rsp), %rdi
leaq 0x1aaf(%rip), %rsi      # 0xce38
callq 0x2030
cmpl $0x0, %eax
jne 0xb3ac
movq 0x8(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x36, %rsi
callq 0xb690
movl %eax, 0x64(%rsp)
jmp 0xb400
leaq 0x10(%rsp), %rdi
leaq 0x1a8c(%rip), %rsi      # 0xce44
callq 0x2030
cmpl $0x0, %eax
jne 0xb3db
movq 0x8(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x38, %rsi
callq 0xb4f0
movl %eax, 0x64(%rsp)
jmp 0xb400
movq 0x4c16(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x1a5f(%rip), %rsi      # 0xce50
movb $0x0, %al
callq 0x2120
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)