// File: /workspace/github_c_makefile_star2_O3/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 0xe8b2b
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x20(%r15), %rdx
movq 0x30(%r15), %rax
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
cmpq $0x20, %rax
movl $0x20, %ecx
cmovlq %rax, %rcx
movq %r12, %rsi
callq 0xee8d4
movl $0x6f6b694e, %eax       # imm = 0x6F6B694E
xorl (%r12), %eax
movl $0x2006e6f, %ecx        # imm = 0x2006E6F
xorl 0x3(%r12), %ecx
orl %eax, %ecx
je 0xce8ab
movabsq $0x4f6920656c707041, %rax # imm = 0x4F6920656C707041
xorq 0x10(%rsp), %rax
movabsq $0x4d4d010000534f69, %rcx # imm = 0x4D4D010000534F69
xorq 0x16(%rsp), %rcx
orq %rax, %rcx
je 0xce8cd
movabsq $0x4d4c4946494a5546, %rax # imm = 0x4D4C4946494A5546
cmpq %rax, 0x10(%rsp)
jne 0xce8ea
leaq 0x70bc5(%rip), %rsi     # 0x13f469
movl $0x3, %eax
jmp 0xce8d9
leaq 0x70ba0(%rip), %rsi     # 0x13f452
movl $0x1, %eax
cmpl $0x2a004d4d, 0x1a(%rsp) # imm = 0x2A004D4D
je 0xce8d9
cmpl $0x2a4949, 0x1a(%rsp)   # imm = 0x2A4949
jne 0xce869
jmp 0xce8d9
leaq 0x70b8b(%rip), %rsi     # 0x13f45f
movl $0x2, %eax
movl %eax, (%r14)
leaq 0x4(%r14), %rdi
movl $0x20, %edx
callq 0xe8219
cmpl $0x0, (%r14)
je 0xce9a5
movq %r14, %rdx
addq $0x4, %rdx
leaq 0x70b34(%rip), %rsi     # 0x13f436
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movl (%r14), %eax
cmpl $0x3, %eax
je 0xcea50
cmpl $0x2, %eax
je 0xce9ce
cmpl $0x1, %eax
jne 0xce9a5
movq 0x30(%r15), %r12
cmpq $0xa, %r12
jl 0xceaaf
movq 0x20(%r15), %r15
movq 0x18(%rbx), %rdi
leaq 0x6(%r15), %rsi
callq 0xeeb67
leaq 0x66aad(%rip), %rsi     # 0x1353f9
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x12, %r12
jb 0xceaaf
addq $-0xa, %r12
addq $0xa, %r15
leaq 0x70b01(%rip), %rsi     # 0x13f472
movq %rbx, %rdi
movl %r15d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rcx
leaq 0x7baf7(%rip), %rsi     # 0x14a490
leaq 0x45527(%rip), %rdx     # 0x113ec7
jmp 0xcea94
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 0xe8bea
jmp 0xceaaf
movq 0x30(%r15), %r12
cmpq $0xc, %r12
jl 0xceaaf
movq 0x20(%r15), %r15
movq 0x18(%rbx), %rdi
leaq 0xa(%r15), %rsi
callq 0xeeb67
movq %rax, %r13
leaq 0x66a02(%rip), %rsi     # 0x1353f9
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x14, %r12
jb 0xceaaf
cmpl $0x1, %r13d
jne 0xceaaf
leaq 0x70a7a(%rip), %rsi     # 0x13f499
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rcx
leaq 0x7ba49(%rip), %rsi     # 0x14a490
leaq 0x7089b(%rip), %rdx     # 0x13f2e9
jmp 0xcea94
movq 0x30(%r15), %r12
cmpq $0xe, %r12
jl 0xceaaf
movq 0x20(%r15), %r15
leaq 0x70a5d(%rip), %rsi     # 0x13f4c2
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rcx
leaq 0x7ba03(%rip), %rsi     # 0x14a490
leaq 0x5cf98(%rip), %rdx     # 0x12ba2c
movq %rbx, %rdi
movq %r15, %r8
movq %r12, %r9
callq 0xe9b13
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq