// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tar.c
// Function: read_exthdr
static void read_exthdr(deark *c, lctx *d, struct phys_member_data *pmd,
	struct extattr_data *ea)
{
	int saved_indent_level;
	i64 pos = pmd->file_data_pos;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "POSIX extended header data at %"I64_FMT, pmd->file_data_pos);
	de_dbg_indent(c, 1);

	if(c->debug_level>=2) {
		de_ucstring *tmps;
		tmps = ucstring_create(c);
		dbuf_read_to_ucstring_n(c->infile, pmd->file_data_pos, pmd->filesize,
			32768, tmps, 0, DE_ENCODING_UTF8);
		de_dbg(c, "data: \"%s\"", ucstring_getpsz_d(tmps));
		ucstring_destroy(tmps);
	}

	while(pos < pmd->file_data_pos + pmd->filesize) {
		i64 bytes_consumed = 0;

		if(!read_exthdr_item(c, d, pmd, ea, pos,
			pmd->file_data_pos+pmd->filesize-pos, &bytes_consumed))
		{
			break;
		}
		if(bytes_consumed<1) break;
		pos += bytes_consumed;
	}

	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r12
leaq 0x18(%rsp), %rsi
callq 0xdebae
movq %r14, 0x20(%rsp)
movq 0x10(%r14), %rdx
leaq 0x6de08(%rip), %rsi     # 0x12ea6d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
cmpl $0x2, (%rbx)
jl 0xc0cd6
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
movl $0x2, (%rsp)
movl $0x8000, %ecx           # imm = 0x8000
movq %r14, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r14, %rdi
callq 0xeb877
leaq 0x5218f(%rip), %rsi     # 0x112e50
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
callq 0xeaf3c
movq 0x20(%rsp), %rax
movq 0x18(%rax), %r14
addq 0x10(%rax), %r14
cmpq %r12, %r14
jle 0xc116f
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
callq 0xdebae
movq %rbx, %rdi
leaq 0x6dd8c(%rip), %rsi     # 0x12ea8f
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbx, %rdi
pushq $0x50
popq %rsi
callq 0xdecaf
movq %rax, %r13
movq %r12, (%rax)
subq %r12, %r14
jle 0xc1050
leaq 0x8(%r13), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%r13), %rax
movq %rax, 0x40(%rsp)
movq %r13, %rax
addq $0x10, %rax
movq %rax, 0x38(%rsp)
xorl %ebp, %ebp
xorl %r15d, %r15d
movq %r12, 0x30(%rsp)
cmpl $0x4, %r15d
je 0xc0e8c
cmpq %r14, %rbp
je 0xc1050
cmpl $0x2, %r15d
jb 0xc0d81
movq 0x10(%rsp), %rax
cmpq (%rax), %rbp
jge 0xc1050
movq 0x18(%rbx), %rdi
leaq (%r12,%rbp), %rsi
callq 0xe3eb4
movzbl %al, %ecx
cmpl $0x2, %r15d
je 0xc0e2d
cmpl $0x1, %r15d
je 0xc0dbe
testl %r15d, %r15d
jne 0xc0e4a
xorl %r15d, %r15d
cmpb $0x9, %al
je 0xc0e84
movq 0x38(%rsp), %rax
pushq $0x1
jmp 0xc0e3c
cmpb $0x20, %al
je 0xc0dcf
pushq $0x1
popq %r15
cmpl $0x9, %ecx
jne 0xc0e84
movq 0x10(%r13), %rsi
movq %rbp, %rdx
subq %rsi, %rdx
movq %rdx, 0x18(%r13)
movq 0x18(%rbx), %rdi
addq %r12, %rsi
pushq $0xa
popq %rcx
movq 0x10(%rsp), %r8
callq 0xe4553
testl %eax, %eax
je 0xc1050
movq %r13, %r12
movq 0x10(%rsp), %r13
movl (%r13), %edx
movq %rbx, %rdi
leaq 0x5d406(%rip), %rsi     # 0x11e215
xorl %eax, %eax
callq 0xde896
pushq $0x2
popq %r15
cmpq %r14, (%r13)
movq %r12, %r13
movq 0x30(%rsp), %r12
jle 0xc0e84
jmp 0xc1050
pushq $0x2
popq %r15
cmpb $0x9, %al
je 0xc0e84
movq 0x40(%rsp), %rax
pushq $0x3
popq %rdx
cmpl $0x20, %ecx
je 0xc0e84
movq %rbp, (%rax)
movl %edx, %r15d
jmp 0xc0e84
cmpl $0x3, %r15d
jne 0xc0e84
cmpb $0x3d, %al
jne 0xc0e84
movq %rbp, %rax
subq 0x20(%r13), %rax
movq %rax, 0x28(%r13)
leaq 0x1(%rbp), %rax
movq %rax, 0x30(%r13)
movq 0x8(%r13), %rax
subq %rbp, %rax
leaq -0x2(%rax), %rcx
movq %rcx, 0x38(%r13)
pushq $0x4
popq %r15
cmpq $0x2, %rax
jl 0xc1050
incq %rbp
jmp 0xc0d5a
movq 0x18(%rbx), %rdi
movq 0x10(%rsp), %rax
movq (%rax), %rax
leaq (%r12,%rax), %rsi
decq %rsi
callq 0xe3eb4
cmpb $0xa, %al
jne 0xc1050
movq 0x28(%r13), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xdfb45
movq 0x18(%rbx), %rdi
movq 0x20(%r13), %rsi
addq %r12, %rsi
movq %rax, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
pushq $0x2
popq %rbp
movl %ebp, %r9d
callq 0xe495c
movq %rax, 0x40(%r13)
movq 0x18(%rax), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0x6dbbc(%rip), %rsi     # 0x12eaac
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x38(%r13), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0xdfb45
movq 0x18(%rbx), %rdi
movq 0x30(%r13), %rsi
addq %r12, %rsi
movq %rax, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0xe495c
movq %rax, 0x48(%r13)
movq 0x18(%rax), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0x44810(%rip), %rsi     # 0x10574b
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x40(%r13), %rax
movq 0x8(%rax), %r14
movq %r14, %rdi
leaq 0x6db63(%rip), %rsi     # 0x12eaba
pushq $0xb
popq %rdx
callq 0x18050
testl %eax, %eax
movq 0x28(%rsp), %r15
jne 0xc0f6d
movb $0x1, 0x10(%r15)
movq %r14, %rdi
leaq 0x65010(%rip), %rsi     # 0x125f87
callq 0x181a0
testl %eax, %eax
je 0xc10b3
movq %r14, %rdi
leaq 0x6db38(%rip), %rsi     # 0x12eac6
callq 0x181a0
testl %eax, %eax
je 0xc10b3
movq %r14, %rdi
leaq 0x6db31(%rip), %rsi     # 0x12ead6
callq 0x181a0
testl %eax, %eax
je 0xc10e0
movq %r14, %rdi
leaq 0x6d97a(%rip), %rsi     # 0x12e936
callq 0x181a0
testl %eax, %eax
je 0xc1103
movq %r14, %rdi
leaq 0x6db0c(%rip), %rsi     # 0x12eadf
callq 0x181a0
testl %eax, %eax
je 0xc1117
movq %r14, %rdi
leaq 0x6dafb(%rip), %rsi     # 0x12eae5
callq 0x181a0
testl %eax, %eax
je 0xc112c
movq %r14, %rdi
leaq 0x6dafd(%rip), %rsi     # 0x12eafe
callq 0x181a0
testl %eax, %eax
je 0xc1141
movq %r14, %rdi
leaq 0x49267(%rip), %rsi     # 0x10a27f
callq 0x181a0
testl %eax, %eax
jne 0xc1159
cmpq $0x0, 0x38(%r13)
je 0xc1168
movb $0x1, 0x11(%r15)
movq 0x48(%r13), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0xfc8f5
movq %rax, 0x18(%r15)
jmp 0xc1159
movq %rbx, %rdi
leaq 0x6dabc(%rip), %rsi     # 0x12eb16
movq %r12, %rdx
xorl %eax, %eax
callq 0xdf05a
movb $0x1, %bpl
xorl %r14d, %r14d
movq 0x40(%r13), %rsi
movq %rbx, %rdi
callq 0xe4b94
movq 0x48(%r13), %rsi
movq %rbx, %rdi
callq 0xe4b94
movq %rbx, %rdi
movq %r13, %rsi
callq 0xded32
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
testb %bpl, %bpl
jne 0xc116f
addq %r14, %r12
testq %r14, %r14
jg 0xc0cd6
jmp 0xc116f
movq (%r15), %rdi
testq %rdi, %rdi
jne 0xc10c9
movq %rbx, %rdi
callq 0xeac74
movq %rax, %rdi
movq %rax, (%r15)
callq 0xeac85
movq (%r15), %rdi
movq 0x48(%r13), %rax
movq 0x18(%rax), %rsi
callq 0xead71
jmp 0xc1159
movq 0x8(%r15), %rdi
testq %rdi, %rdi
jne 0xc10f8
movq %rbx, %rdi
callq 0xeac74
movq %rax, %rdi
movq %rax, 0x8(%r15)
callq 0xeac85
movq 0x8(%r15), %rdi
jmp 0xc10d1
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
leaq 0x5fccf(%rip), %r8      # 0x120de4
jmp 0xc1154
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
pushq $0x2
popq %rcx
leaq 0x5dffe(%rip), %r8      # 0x11f128
jmp 0xc1154
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
pushq $0x3
popq %rcx
leaq 0x6d9ac(%rip), %r8      # 0x12eaeb
jmp 0xc1154
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
pushq $0x1
popq %rcx
leaq 0x61044(%rip), %r8      # 0x122198
callq 0xc1224
movq 0x10(%rsp), %rax
movq (%rax), %r14
xorl %ebp, %ebp
jmp 0xc106a
movb $0x0, 0x11(%r15)
jmp 0xc1159
movl 0x18(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq