// File: /workspace/github_c_makefile_star2_O2/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 $0x20, %rsp
movq %rdx, %r15
movq %rdi, %rbx
pushq $0x24
popq %rsi
callq 0xdecaf
movq %rax, %r14
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq 0x20(%r15), %rdx
movq 0x30(%r15), %rax
cmpq $0x20, %rax
pushq $0x20
popq %rcx
cmovlq %rax, %rcx
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3cb7
leaq 0x6c302(%rip), %rsi     # 0x1329f9
pushq $0x7
popq %rdx
movq %r12, %rdi
callq 0x18230
testl %eax, %eax
je 0xc6737
leaq 0x68e84(%rip), %rsi     # 0x12f591
movq %rsp, %rdi
pushq $0xe
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc675a
movabsq $0x4d4c4946494a5546, %rax # imm = 0x4D4C4946494A5546
cmpq %rax, (%rsp)
jne 0xc6773
leaq 0x6ba06(%rip), %rsi     # 0x132139
pushq $0x3
jmp 0xc6763
pushq $0x1
popq %rax
leaq 0x6b9e1(%rip), %rsi     # 0x132122
cmpl $0x2a004d4d, 0xa(%rsp)  # imm = 0x2A004D4D
je 0xc6764
leaq 0xa(%rsp), %rcx
cmpl $0x2a4949, (%rcx)       # imm = 0x2A4949
jne 0xc6706
jmp 0xc6764
leaq 0x6b9ce(%rip), %rsi     # 0x13212f
pushq $0x2
popq %rax
movl %eax, (%r14)
leaq 0x4(%r14), %rdi
pushq $0x20
popq %rdx
callq 0xde492
cmpl $0x0, (%r14)
je 0xc682c
movq %r14, %rdx
addq $0x4, %rdx
leaq 0x6b97b(%rip), %rsi     # 0x132106
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl (%r14), %eax
cmpl $0x3, %eax
je 0xc68bc
cmpl $0x2, %eax
je 0xc683c
cmpl $0x1, %eax
jne 0xc682c
movq 0x30(%r15), %r12
cmpq $0xa, %r12
jl 0xc6917
movq 0x20(%r15), %r15
movq 0x18(%rbx), %rdi
leaq 0x6(%r15), %rsi
callq 0xe3f46
leaq 0x61944(%rip), %rsi     # 0x128119
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpq $0x12, %r12
jb 0xc6917
addq $-0xa, %r12
addq $0xa, %r15
leaq 0x6b948(%rip), %rsi     # 0x132142
movq %rbx, %rdi
movl %r15d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rcx
leaq 0x767a0(%rip), %rsi     # 0x13cfc0
leaq 0x40640(%rip), %rdx     # 0x106e67
jmp 0xc68fe
movq %rbx, %rdi
movq %r15, %rdx
callq 0xc6502
jmp 0xc6917
movq 0x30(%r15), %r12
cmpq $0xc, %r12
jl 0xc6917
movq 0x20(%r15), %r15
movq 0x18(%rbx), %rdi
leaq 0xa(%r15), %rsi
callq 0xe3f46
movq %rax, %r13
leaq 0x618b4(%rip), %rsi     # 0x128119
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
cmpq $0x14, %r12
jb 0xc6917
cmpl $0x1, %r13d
jne 0xc6917
leaq 0x6b8dc(%rip), %rsi     # 0x132169
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rcx
leaq 0x7670d(%rip), %rsi     # 0x13cfc0
leaq 0x6b6ff(%rip), %rdx     # 0x131fb9
jmp 0xc68fe
movq 0x30(%r15), %r12
cmpq $0xe, %r12
jl 0xc6917
movq 0x20(%r15), %r15
leaq 0x6b8c1(%rip), %rsi     # 0x132192
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rcx
leaq 0x766c9(%rip), %rsi     # 0x13cfc0
leaq 0x57ebe(%rip), %rdx     # 0x11e7bc
movq %rbx, %rdi
movq %r15, %r8
movq %r12, %r9
callq 0xdfa28
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq