// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/tiff.c
// Function: handler_makernote
static void handler_makernote(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct makernote_id_info *mni = NULL;

	mni = de_malloc(c, sizeof(struct makernote_id_info));
	identify_makernote(c, d, tg, mni);

	if(mni->mntype != 0) {
		de_dbg(c, "MakerNote identified as: %s", mni->name);
	}

	if(mni->mntype==MAKERNOTE_NIKON) {
		do_makernote_nikon(c, d, tg->val_offset, tg->total_size);
	}
	else if(mni->mntype==MAKERNOTE_APPLE_IOS) {
		do_makernote_apple_ios(c, d, tg->val_offset, tg->total_size);
	}
	else if(mni->mntype==MAKERNOTE_FUJIFILM) {
		do_makernote_fujifilm(c, d, tg->val_offset, tg->total_size);
	}
	else {
		handler_hexdump(c, d, tg, tni);
	}

	de_free(c, mni);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r15
movq %rdi, %rbx
movl $0x24, %esi
callq 0xe969b
movq %rax, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq 0x20(%r15), %rdx
movq 0x30(%r15), %rax
cmpq $0x20, %rax
movl $0x20, %ecx
cmovlq %rax, %rcx
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeeee8
movl $0x6f6b694e, %eax       # imm = 0x6F6B694E
xorl (%r12), %eax
movl $0x2006e6f, %ecx        # imm = 0x2006E6F
xorl 0x3(%r12), %ecx
orl %eax, %ecx
je 0xcf4a3
movabsq $0x4f6920656c707041, %rax # imm = 0x4F6920656C707041
xorq 0x10(%rsp), %rax
movabsq $0x4d4d010000534f69, %rcx # imm = 0x4D4D010000534F69
xorq 0x16(%rsp), %rcx
orq %rax, %rcx
je 0xcf4c5
movabsq $0x4d4c4946494a5546, %rax # imm = 0x4D4C4946494A5546
cmpq %rax, 0x10(%rsp)
jne 0xcf4e2
leaq 0x6fbcd(%rip), %rsi     # 0x13f069
movl $0x3, %eax
jmp 0xcf4d1
leaq 0x6fba8(%rip), %rsi     # 0x13f052
movl $0x1, %eax
cmpl $0x2a004d4d, 0x1a(%rsp) # imm = 0x2A004D4D
je 0xcf4d1
cmpl $0x2a4949, 0x1a(%rsp)   # imm = 0x2A4949
jne 0xcf461
jmp 0xcf4d1
leaq 0x6fb93(%rip), %rsi     # 0x13f05f
movl $0x2, %eax
movl %eax, (%r14)
leaq 0x4(%r14), %rdi
movl $0x20, %edx
callq 0xe8ded
cmpl $0x0, (%r14)
je 0xcf500
movq %r14, %rdx
addq $0x4, %rdx
leaq 0x6fb40(%rip), %rsi     # 0x13f036
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl (%r14), %eax
cmpl $0x3, %eax
je 0xcf61f
cmpl $0x2, %eax
je 0xcf59d
cmpl $0x1, %eax
jne 0xcf680
movq 0x30(%r15), %r12
cmpq $0xa, %r12
jl 0xcf6a4
movq 0x20(%r15), %r15
movq 0x18(%rbx), %rdi
leaq 0x6(%r15), %rsi
callq 0xef169
leaq 0x65b29(%rip), %rsi     # 0x13506d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0x12, %r12
jl 0xcf6a4
addq $-0xa, %r12
addq $0xa, %r15
leaq 0x6fb09(%rip), %rsi     # 0x13f072
movq %rbx, %rdi
movl %r15d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rcx
leaq 0x7a94f(%rip), %rsi     # 0x149ee0
leaq 0x4487f(%rip), %rdx     # 0x113e17
jmp 0xcf663
movq 0x30(%r15), %r12
cmpq $0xc, %r12
jl 0xcf6a4
movq 0x20(%r15), %r15
movq 0x18(%rbx), %rdi
leaq 0xa(%r15), %rsi
callq 0xef169
movq %rax, %r13
leaq 0x65aa7(%rip), %rsi     # 0x13506d
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0x14, %r12
jl 0xcf6a4
cmpl $0x1, %r13d
jne 0xcf6a4
leaq 0x6faab(%rip), %rsi     # 0x13f099
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rcx
leaq 0x7a8ca(%rip), %rsi     # 0x149ee0
leaq 0x6f8cc(%rip), %rdx     # 0x13eee9
jmp 0xcf663
movq 0x30(%r15), %r12
cmpq $0xe, %r12
jl 0xcf6a4
movq 0x20(%r15), %r15
leaq 0x6fa8e(%rip), %rsi     # 0x13f0c2
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rcx
leaq 0x7a884(%rip), %rsi     # 0x149ee0
leaq 0x5c0f9(%rip), %rdx     # 0x12b75c
movq %rbx, %rdi
movq %r15, %r8
movq %r12, %r9
callq 0xea66a
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0xcf6a4
movq 0x18(%rbx), %rsi
movq 0x20(%r15), %rdx
movq 0x30(%r15), %rcx
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xe975a
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq