// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: detect_app_seg_type
static void detect_app_seg_type(deark *c, lctx *d, const struct marker_info *mi,
	i64 seg_data_pos, i64 seg_data_size, struct app_id_info_struct *app_id_info)
{
	i64 sig_size = 0;
	i64 payload_size;
	u8 seg_type = mi->seg_type;
	struct app_id_decode_struct ad;

	de_zeromem(&ad, sizeof(struct app_id_decode_struct));

	// defaults:
	app_id_info->app_id_found = 0;
	app_id_info->appsegtype = APPSEGTYPE_UNKNOWN;
	app_id_info->app_type_name = "?";

	ad.nraw_bytes = (i64)sizeof(ad.raw_bytes);
	if(ad.nraw_bytes>seg_data_size)
		ad.nraw_bytes = seg_data_size;
	if(ad.nraw_bytes<2) goto done;
	de_read(ad.raw_bytes, seg_data_pos, ad.nraw_bytes-1);

	decode_app_id(&ad);

	if(ad.has_app_id) {
		app_id_info->app_id_str = ucstring_create(c);
		ucstring_append_bytes(app_id_info->app_id_str, (const u8*)ad.app_id_orig, ad.app_id_orig_strlen, 0,
			DE_ENCODING_ASCII);
	}

	if(seg_type==0xe1 && ad.nraw_bytes>20 && ad.has_app_id && !de_strcmp(ad.app_id_orig, "XMP")) {
		// Ugly hack. I've seen a fair number of files in which the first four
		// bytes of the "http://ns.adobe.com/xap/1.0/" signature seem to have
		// been corrupted, and replaced with "XMP\0".
		struct app_id_decode_struct ad2;

		de_zeromem(&ad2, sizeof(struct app_id_decode_struct));
		de_memcpy(ad2.raw_bytes, ad.raw_bytes, (size_t)ad.nraw_bytes);
		ad2.nraw_bytes = ad.nraw_bytes;
		// Try to patch the app ID, decode it, and see what happens.
		de_memcpy(ad2.raw_bytes, (const u8*)"http", 4);

		decode_app_id(&ad2);

		// If that seemed to work, replace the old "normalized" ID with the patched one.
		if(ad2.has_app_id) {
			de_strlcpy(ad.app_id_normalized, ad2.app_id_normalized, sizeof(ad.app_id_normalized));
			// Need to update orig_strlen, so we can find the payload data position.
			// (ad.app_id_orig can stay the same.)
			ad.app_id_orig_strlen = ad2.app_id_orig_strlen;
		}
	}

	if(ad.has_app_id) {
		app_id_info->app_id_found = 1;
		sig_size = ad.app_id_orig_strlen + 1;
	}

	payload_size = seg_data_size - sig_size;
	if(payload_size<0) goto done;

	if(seg_type==0xe0 && !de_strcmp(ad.app_id_normalized, "JFIF")) {
		app_id_info->appsegtype = APPSEGTYPE_JFIF;
		app_id_info->app_type_name = "JFIF";
	}
	else if(seg_type==0xe0 && !de_strcmp(ad.app_id_normalized, "JFXX")) {
		app_id_info->appsegtype = APPSEGTYPE_JFXX;
		app_id_info->app_type_name = "JFIF-JFXX";
	}
	else if(seg_type==0xee && ad.nraw_bytes>=5 && !de_strncmp((const char*)ad.raw_bytes, "Adobe", 5)) {
		app_id_info->appsegtype = APPSEGTYPE_ADOBEAPP14;
		app_id_info->app_type_name = "AdobeAPP14";
		sig_size = 5;
	}
	else if(seg_type==0xec && ad.nraw_bytes>=5 && !de_strncmp((const char*)ad.raw_bytes, "Ducky", 5)) {
		app_id_info->appsegtype = APPSEGTYPE_DUCKY;
		app_id_info->app_type_name = "Ducky";
		sig_size = 5;
	}
	else if(seg_type==0xe1 && seg_data_size>=6 && !de_strcmp(ad.app_id_normalized, "EXIF")) {
		app_id_info->appsegtype = APPSEGTYPE_EXIF;
		app_id_info->app_type_name = "Exif";
		// We arbitrarily consider the "padding byte" to be part of the signature.
		sig_size = 6;
	}
	else if((seg_type==0xe1 || seg_type==0xe3) && ad.nraw_bytes>=14 &&
		!de_memcmp(ad.raw_bytes, "Meta\0\0", 6) &&
		(ad.raw_bytes[6]=='I' || ad.raw_bytes[6]=='M'))
	{
		// This seems to be some Kodak imitation of an Exif segment.
		// ExifTool says APP3, but all I've seen is APP1.
		app_id_info->appsegtype = APPSEGTYPE_META;
		app_id_info->app_type_name = "Meta";
	}
	else if(seg_type==0xe2 && !de_strcmp(ad.app_id_normalized, "ICC_PROFILE")) {
		app_id_info->appsegtype = APPSEGTYPE_ICC_PROFILE;
		app_id_info->app_type_name = "ICC profile";
	}
	else if((seg_type==0xe2 || seg_type==0xe4) && !de_strcmp(ad.app_id_normalized, "FPXR")) {
		// Normally APP2. APP4 exists, but I don't know why.
		app_id_info->appsegtype = APPSEGTYPE_FPXR;
		app_id_info->app_type_name = "Exif Flashpix Ready";
	}
	else if(seg_type==0xe8 && !de_strcmp(ad.app_id_normalized, "SPIFF")) {
		app_id_info->appsegtype = APPSEGTYPE_SPIFF;
		app_id_info->app_type_name = "SPIFF";
	}
	else if(seg_type==0xed && !de_strcmp(ad.app_id_normalized, "PHOTOSHOP 3.0")) {
		app_id_info->appsegtype = APPSEGTYPE_PHOTOSHOP;
		app_id_info->app_type_name = "Photoshop resources";
	}
	else if(seg_type==0xe1 && !de_strcmp(ad.app_id_normalized, "HTTP://NS.ADOBE.COM/XAP/1.0/")) {
		app_id_info->appsegtype = APPSEGTYPE_XMP;
		app_id_info->app_type_name = "XMP";
	}
	else if(seg_type==0xe1 && ad.nraw_bytes>=32 && !de_memcmp(ad.raw_bytes, "<?xpacket begin=", 16)) {
		// I have a few files like this, that are missing the XMP signature.
		app_id_info->appsegtype = APPSEGTYPE_XMP;
		app_id_info->app_type_name = "XMP";
		sig_size = 0;
	}
	else if(seg_type==0xe1 && !de_strcmp(ad.app_id_normalized, "HTTP://NS.ADOBE.COM/XMP/EXTENSION/")) {
		app_id_info->appsegtype = APPSEGTYPE_XMP_EXTENSION;
		app_id_info->app_type_name = "XMP extension";
	}
	else if(seg_type==0xeb && ad.nraw_bytes>=10 && !de_strncmp((const char*)ad.raw_bytes, "HDR_RI ver", 10)) {
		app_id_info->appsegtype = APPSEGTYPE_HDR_RI_VER;
		app_id_info->app_type_name = "JPEG-HDR Ver";
	}
	else if(seg_type==0xeb && ad.nraw_bytes>=10 && !de_strncmp((const char*)ad.raw_bytes, "HDR_RI ext", 10)) {
		app_id_info->appsegtype = APPSEGTYPE_HDR_RI_EXT;
		app_id_info->app_type_name = "JPEG-HDR Ext";
	}
	else if(seg_type==0xeb && ad.nraw_bytes>=2 && !de_strncmp((const char*)ad.raw_bytes, "JP", 2)) {
		// Presumably the format defined in ISO/IEC 18477-3
		app_id_info->appsegtype = APPSEGTYPE_BOXFORMAT;
		app_id_info->app_type_name = "Box format container";
		sig_size = 2;
	}
	else if(seg_type==0xe2 && !de_strcmp(ad.app_id_normalized, "MPF")) {
		app_id_info->appsegtype = APPSEGTYPE_MPF;
		app_id_info->app_type_name = "Multi-Picture Format";
	}
	else if(seg_type==0xe3 && ad.nraw_bytes>=8 && !de_strncmp((const char*)ad.raw_bytes, "_JPSJPS_", 8)) {
		// This signature is not NUL terminated.
		app_id_info->appsegtype = APPSEGTYPE_JPS;
		app_id_info->app_type_name = "JPS";
		sig_size = 8;
	}
	else if(seg_type==0xea && seg_data_size>=6 && !de_strcmp(ad.app_id_normalized, "AROT")) {
		app_id_info->appsegtype = APPSEGTYPE_AROT;
		app_id_info->app_type_name = "Apple absolute rotational angle delta";
		// Guessing that there's a "padding byte" that's part of the signature.
		sig_size = 6;
	}
	else if(seg_type==0xe1 && !de_strcmp(ad.app_id_orig, "Deark_MSRGBA")) {
		app_id_info->appsegtype = APPSEGTYPE_MSRGBA;
		app_id_info->app_type_name = "RGBA JPEG headers from Thumbs.db";
	}
	else if(seg_type==0xe1 && !de_strcmp(ad.app_id_orig, "Deark_RB_swap")) {
		app_id_info->appsegtype = APPSEGTYPE_RBSWAP;
		app_id_info->app_type_name = "Flag for swapped red/blue";
	}
	else if(seg_type==0xe1 && d->is_pegasus_pic2 && !de_strcmp(ad.app_id_orig, "PIC")) {
		app_id_info->appsegtype = APPSEGTYPE_PEGASUSPIC;
		app_id_info->app_type_name = "Pegasus PIC params";
	}

done:
	app_id_info->payload_pos = seg_data_pos + sig_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movb (%rax), %al
movb %al, -0x41(%rbp)
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x19140
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf9b46(%rip), %rcx     # 0x1b7c2d
movq %rcx, 0x18(%rax)
movq $0x50, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpq -0x28(%rbp), %rax
jle 0xbe10e
movq -0x28(%rbp), %rax
movq %rax, -0x100(%rbp)
cmpq $0x2, -0x100(%rbp)
jge 0xbe11d
jmp 0xbe9c2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x150(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x100(%rbp), %rcx
subq $0x1, %rcx
callq 0x164d10
leaq -0x150(%rbp), %rdi
callq 0xc02a0
cmpl $0x0, -0x50(%rbp)
je 0xbe18a
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x150(%rbp), %rsi
addq $0x58, %rsi
movq -0x58(%rbp), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x171fa0
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe260
cmpq $0x14, -0x100(%rbp)
jle 0xbe260
cmpl $0x0, -0x50(%rbp)
je 0xbe260
leaq -0x150(%rbp), %rdi
addq $0x58, %rdi
leaq 0xf92a4(%rip), %rsi     # 0x1b7467
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe260
leaq -0x258(%rbp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x19140
leaq -0x258(%rbp), %rdi
leaq -0x150(%rbp), %rsi
movq -0x100(%rbp), %rdx
callq 0x191e0
movq -0x100(%rbp), %rax
movq %rax, -0x208(%rbp)
movl 0xf86b6(%rip), %eax     # 0x1b68c8
movl %eax, -0x258(%rbp)
leaq -0x258(%rbp), %rdi
callq 0xc02a0
cmpl $0x0, -0x158(%rbp)
je 0xbe25e
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x258(%rbp), %rsi
addq $0xa8, %rsi
movl $0x50, %edx
callq 0x15aa30
movq -0x160(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0xbe260
cmpl $0x0, -0x50(%rbp)
je 0xbe27c
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
subq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jge 0xbe294
jmp 0xbe9c2
movzbl -0x41(%rbp), %eax
cmpl $0xe0, %eax
jne 0xbe2dd
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf8fac(%rip), %rsi     # 0x1b7260
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe2dd
movq -0x30(%rbp), %rax
movl $0x2, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8f8c(%rip), %rcx     # 0x1b7260
movq %rcx, 0x18(%rax)
jmp 0xbe9c0
movzbl -0x41(%rbp), %eax
cmpl $0xe0, %eax
jne 0xbe326
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf913f(%rip), %rsi     # 0x1b743c
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe326
movq -0x30(%rbp), %rax
movl $0x3, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf85b0(%rip), %rcx     # 0x1b68cd
movq %rcx, 0x18(%rax)
jmp 0xbe9be
movzbl -0x41(%rbp), %eax
cmpl $0xee, %eax
jne 0xbe37f
cmpq $0x5, -0x100(%rbp)
jl 0xbe37f
leaq -0x150(%rbp), %rdi
leaq 0xf858e(%rip), %rsi     # 0x1b68d7
movl $0x5, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0xbe37f
movq -0x30(%rbp), %rax
movl $0x9, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf856f(%rip), %rcx     # 0x1b68dd
movq %rcx, 0x18(%rax)
movq $0x5, -0x38(%rbp)
jmp 0xbe9bc
movzbl -0x41(%rbp), %eax
cmpl $0xec, %eax
jne 0xbe3d8
cmpq $0x5, -0x100(%rbp)
jl 0xbe3d8
leaq -0x150(%rbp), %rdi
leaq 0xf8546(%rip), %rsi     # 0x1b68e8
movl $0x5, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0xbe3d8
movq -0x30(%rbp), %rax
movl $0xc, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8521(%rip), %rcx     # 0x1b68e8
movq %rcx, 0x18(%rax)
movq $0x5, -0x38(%rbp)
jmp 0xbe9ba
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe430
cmpq $0x6, -0x28(%rbp)
jl 0xbe430
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf84ef(%rip), %rsi     # 0x1b68ee
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe430
movq -0x30(%rbp), %rax
movl $0x6, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8fe9(%rip), %rcx     # 0x1b7408
movq %rcx, 0x18(%rax)
movq $0x6, -0x38(%rbp)
jmp 0xbe9b8
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
je 0xbe446
movzbl -0x41(%rbp), %eax
cmpl $0xe3, %eax
jne 0xbe4a4
cmpq $0xe, -0x100(%rbp)
jl 0xbe4a4
leaq -0x150(%rbp), %rdi
leaq 0xf7f92(%rip), %rsi     # 0x1b63f0
movl $0x6, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0xbe4a4
movzbl -0x14a(%rbp), %eax
cmpl $0x49, %eax
je 0xbe485
movzbl -0x14a(%rbp), %eax
cmpl $0x4d, %eax
jne 0xbe4a4
movq -0x30(%rbp), %rax
movl $0x1a, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8458(%rip), %rcx     # 0x1b68f3
movq %rcx, 0x18(%rax)
jmp 0xbe9b6
movzbl -0x41(%rbp), %eax
cmpl $0xe2, %eax
jne 0xbe4ed
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf8434(%rip), %rsi     # 0x1b68f8
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe4ed
movq -0x30(%rbp), %rax
movl $0xa, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xfac0a(%rip), %rcx     # 0x1b90ee
movq %rcx, 0x18(%rax)
jmp 0xbe9b4
movzbl -0x41(%rbp), %eax
cmpl $0xe2, %eax
je 0xbe503
movzbl -0x41(%rbp), %eax
cmpl $0xe4, %eax
jne 0xbe541
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf83ec(%rip), %rsi     # 0x1b6904
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe541
movq -0x30(%rbp), %rax
movl $0x7, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf83d1(%rip), %rcx     # 0x1b6909
movq %rcx, 0x18(%rax)
jmp 0xbe9b2
movzbl -0x41(%rbp), %eax
cmpl $0xe8, %eax
jne 0xbe58a
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf8ea0(%rip), %rsi     # 0x1b7401
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe58a
movq -0x30(%rbp), %rax
movl $0x5, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8e80(%rip), %rcx     # 0x1b7401
movq %rcx, 0x18(%rax)
jmp 0xbe9b0
movzbl -0x41(%rbp), %eax
cmpl $0xed, %eax
jne 0xbe5d3
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf8373(%rip), %rsi     # 0x1b691d
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe5d3
movq -0x30(%rbp), %rax
movl $0xb, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8361(%rip), %rcx     # 0x1b692b
movq %rcx, 0x18(%rax)
jmp 0xbe9ae
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe61c
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf834c(%rip), %rsi     # 0x1b693f
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe61c
movq -0x30(%rbp), %rax
movl $0xe, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8e54(%rip), %rcx     # 0x1b7467
movq %rcx, 0x18(%rax)
jmp 0xbe9ac
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe681
cmpq $0x20, -0x100(%rbp)
jl 0xbe681
leaq -0x150(%rbp), %rax
movups (%rax), %xmm0
movaps 0xf7dce(%rip), %xmm1    # 0x1b6410
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xbe681
movq -0x30(%rbp), %rax
movl $0xe, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8df7(%rip), %rcx     # 0x1b7467
movq %rcx, 0x18(%rax)
movq $0x0, -0x38(%rbp)
jmp 0xbe9aa
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe6ca
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf82cc(%rip), %rsi     # 0x1b696d
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe6ca
movq -0x30(%rbp), %rax
movl $0xf, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf82cf(%rip), %rcx     # 0x1b6990
movq %rcx, 0x18(%rax)
jmp 0xbe9a8
movzbl -0x41(%rbp), %eax
cmpl $0xeb, %eax
jne 0xbe71b
cmpq $0xa, -0x100(%rbp)
jl 0xbe71b
leaq -0x150(%rbp), %rdi
leaq 0xf82b1(%rip), %rsi     # 0x1b699e
movl $0xa, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0xbe71b
movq -0x30(%rbp), %rax
movl $0x18, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8297(%rip), %rcx     # 0x1b69a9
movq %rcx, 0x18(%rax)
jmp 0xbe9a6
movzbl -0x41(%rbp), %eax
cmpl $0xeb, %eax
jne 0xbe76c
cmpq $0xa, -0x100(%rbp)
jl 0xbe76c
leaq -0x150(%rbp), %rdi
leaq 0xf8278(%rip), %rsi     # 0x1b69b6
movl $0xa, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0xbe76c
movq -0x30(%rbp), %rax
movl $0x19, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf825e(%rip), %rcx     # 0x1b69c1
movq %rcx, 0x18(%rax)
jmp 0xbe9a4
movzbl -0x41(%rbp), %eax
cmpl $0xeb, %eax
jne 0xbe7c5
cmpq $0x2, -0x100(%rbp)
jl 0xbe7c5
leaq -0x150(%rbp), %rdi
leaq 0xf823f(%rip), %rsi     # 0x1b69ce
movl $0x2, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0xbe7c5
movq -0x30(%rbp), %rax
movl $0x14, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf821d(%rip), %rcx     # 0x1b69d1
movq %rcx, 0x18(%rax)
movq $0x2, -0x38(%rbp)
jmp 0xbe9a2
movzbl -0x41(%rbp), %eax
cmpl $0xe2, %eax
jne 0xbe80e
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf8201(%rip), %rsi     # 0x1b69e6
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe80e
movq -0x30(%rbp), %rax
movl $0x15, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf81e5(%rip), %rcx     # 0x1b69ea
movq %rcx, 0x18(%rax)
jmp 0xbe9a0
movzbl -0x41(%rbp), %eax
cmpl $0xe3, %eax
jne 0xbe867
cmpq $0x8, -0x100(%rbp)
jl 0xbe867
leaq -0x150(%rbp), %rdi
leaq 0xf81ce(%rip), %rsi     # 0x1b69ff
movl $0x8, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0xbe867
movq -0x30(%rbp), %rax
movl $0x16, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8c07(%rip), %rcx     # 0x1b745d
movq %rcx, 0x18(%rax)
movq $0x8, -0x38(%rbp)
jmp 0xbe99e
movzbl -0x41(%rbp), %eax
cmpl $0xea, %eax
jne 0xbe8bf
cmpq $0x6, -0x28(%rbp)
jl 0xbe8bf
leaq -0x150(%rbp), %rdi
addq $0xa8, %rdi
leaq 0xf817a(%rip), %rsi     # 0x1b6a08
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe8bf
movq -0x30(%rbp), %rax
movl $0x1b, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf815f(%rip), %rcx     # 0x1b6a0d
movq %rcx, 0x18(%rax)
movq $0x6, -0x38(%rbp)
jmp 0xbe99c
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe905
leaq -0x150(%rbp), %rdi
addq $0x58, %rdi
leaq 0xf8157(%rip), %rsi     # 0x1b6a33
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe905
movq -0x30(%rbp), %rax
movl $0x64, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf8144(%rip), %rcx     # 0x1b6a40
movq %rcx, 0x18(%rax)
jmp 0xbe99a
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe948
leaq -0x150(%rbp), %rdi
addq $0x58, %rdi
leaq 0xf813f(%rip), %rsi     # 0x1b6a61
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe948
movq -0x30(%rbp), %rax
movl $0x65, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf812d(%rip), %rcx     # 0x1b6a6f
movq %rcx, 0x18(%rax)
jmp 0xbe998
movzbl -0x41(%rbp), %eax
cmpl $0xe1, %eax
jne 0xbe996
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0xbe996
leaq -0x150(%rbp), %rdi
addq $0x58, %rdi
leaq 0x106840(%rip), %rsi    # 0x1c51b2
callq 0x191a0
cmpl $0x0, %eax
jne 0xbe996
movq -0x30(%rbp), %rax
movl $0x6e, 0x4(%rax)
movq -0x30(%rbp), %rax
leaq 0xf80f7(%rip), %rcx     # 0x1b6a89
movq %rcx, 0x18(%rax)
jmp 0xbe998
jmp 0xbe99a
jmp 0xbe99c
jmp 0xbe99e
jmp 0xbe9a0
jmp 0xbe9a2
jmp 0xbe9a4
jmp 0xbe9a6
jmp 0xbe9a8
jmp 0xbe9aa
jmp 0xbe9ac
jmp 0xbe9ae
jmp 0xbe9b0
jmp 0xbe9b2
jmp 0xbe9b4
jmp 0xbe9b6
jmp 0xbe9b8
jmp 0xbe9ba
jmp 0xbe9bc
jmp 0xbe9be
jmp 0xbe9c0
jmp 0xbe9c2
movq -0x20(%rbp), %rcx
addq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
nopl (%rax,%rax)