// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: detect_pcshrink_internal
static int detect_pcshrink_internal(deark *c, u8 *pmultipart_flag)
{
	u8 b;
	UI n;
	i64 cmpr_len;

	*pmultipart_flag = 0;
	b = de_getbyte(13);
	if(b==0x74) { // maybe old format
		if(de_getbyte(0)!=0) return 0;
		if(de_getbyte(16)!=0x74) return 0;
		if(de_getbyte(56)==0) return 0; // 1st byte of filename
		cmpr_len = de_getu32le(76);
		if(cmpr_len!=0) {
			if(!dclimplode_header_at(c, 104)) return 0;
		}
		return 1;
	}
	else if(b==0) { // maybe new format
		if(de_getu16le(14)!=0x74) return 0;
		n = (UI)de_getu16le(18);
		if(n==0x75) {
			*pmultipart_flag = 1;
		}
		else if(n!=0x74) {
			return 0;
		}
		if(n==0x74) {
			if(de_getbyte(58)==0) return 0; // 1st byte of filename
			cmpr_len = de_getu32le(194);
			if(cmpr_len!=0) {
				if(!dclimplode_header_at(c, 226)) return 0;
			}
		}
		if(de_getbyte(0)!=0) {
			*pmultipart_flag = 1;
		}
		return 2;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xd, %esi
callq 0x165060
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x74, %eax
jne 0xa3184
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0x0, %eax
je 0xa30ee
movl $0x0, -0x4(%rbp)
jmp 0xa3285
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x10, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0x74, %eax
je 0xa3114
movl $0x0, -0x4(%rbp)
jmp 0xa3285
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x38, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xa313a
movl $0x0, -0x4(%rbp)
jmp 0xa3285
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4c, %esi
callq 0x165540
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa3178
movq -0x10(%rbp), %rdi
movl $0x68, %esi
callq 0xa3010
cmpl $0x0, %eax
jne 0xa3176
movl $0x0, -0x4(%rbp)
jmp 0xa3285
jmp 0xa3178
movl $0x1, -0x4(%rbp)
jmp 0xa3285
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0xa327c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xe, %esi
callq 0x165280
cmpq $0x74, %rax
je 0xa31b5
movl $0x0, -0x4(%rbp)
jmp 0xa3285
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x12, %esi
callq 0x165280
movl %eax, -0x20(%rbp)
cmpl $0x75, -0x20(%rbp)
jne 0xa31d9
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
jmp 0xa31ed
cmpl $0x74, -0x20(%rbp)
je 0xa31eb
movl $0x0, -0x4(%rbp)
jmp 0xa3285
jmp 0xa31ed
cmpl $0x74, -0x20(%rbp)
jne 0xa3253
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x3a, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xa3216
movl $0x0, -0x4(%rbp)
jmp 0xa3285
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xc2, %esi
callq 0x165540
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa3251
movq -0x10(%rbp), %rdi
movl $0xe2, %esi
callq 0xa3010
cmpl $0x0, %eax
jne 0xa324f
movl $0x0, -0x4(%rbp)
jmp 0xa3285
jmp 0xa3251
jmp 0xa3253
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0x0, %eax
je 0xa3273
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movl $0x2, -0x4(%rbp)
jmp 0xa3285
jmp 0xa327e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop