	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_detect_parttype                ## -- Begin function detect_parttype
	.p2align	4, 0x90
_detect_parttype:                       ## @detect_parttype
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movl	$-1, %ebx
	cmpl	$4, %esi
	jl	LBB0_12
## %bb.1:
	shrq	$32, %rsi
	leaq	-24(%rbp), %rcx
	leaq	-12(%rbp), %r8
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$4, %edx
	callq	_mtd_read
	cmpq	$4, -24(%rbp)
	jne	LBB0_12
## %bb.2:
	movl	-12(%rbp), %eax
	leal	-128(%rax), %ecx
	cmpl	$6, %ecx
	ja	LBB0_7
## %bb.3:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_9:
	movq	_AC49X_PARTTYPE_ROOTFS@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	cmpb	$-127, %al
	je	LBB0_9
## %bb.8:
	andl	$-256, %eax
	cmpl	$33024, %eax                    ## imm = 0x8100
	je	LBB0_9
## %bb.10:
	movq	_AC49X_PARTTYPE_UNKNOWN@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	movq	_AC49X_PARTTYPE_BOOTENV@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_4:
	movq	_AC49X_PARTTYPE_LOADER@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_5:
	movq	_AC49X_PARTTYPE_LINUX@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_9
	.long	L0_0_set_7
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_4
	.long	L0_0_set_5
	.long	L0_0_set_6
	.end_data_region
                                        ## -- End function
	.comm	_AC49X_PARTTYPE_LOADER,4,2      ## @AC49X_PARTTYPE_LOADER
	.comm	_AC49X_PARTTYPE_LINUX,4,2       ## @AC49X_PARTTYPE_LINUX
	.comm	_AC49X_PARTTYPE_ROOTFS,4,2      ## @AC49X_PARTTYPE_ROOTFS
	.comm	_AC49X_PARTTYPE_BOOTENV,4,2     ## @AC49X_PARTTYPE_BOOTENV
	.comm	_AC49X_PARTTYPE_UNKNOWN,4,2     ## @AC49X_PARTTYPE_UNKNOWN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_detect_parttype                ; -- Begin function detect_parttype
	.p2align	2
_detect_parttype:                       ; @detect_parttype
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	cmp	w1, #4
	b.lt	LBB0_5
; %bb.1:
	lsr	x1, x1, #32
	mov	x3, sp
	sub	x4, x29, #4
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	w2, #4
	bl	_mtd_read
	ldr	x8, [sp]
	cmp	x8, #4
	b.ne	LBB0_5
; %bb.2:
	ldur	w8, [x29, #-4]
	sub	w9, w8, #128
	cmp	w9, #6
	b.hi	LBB0_6
; %bb.3:
Lloh0:
	adrp	x10, lJTI0_0@PAGE
Lloh1:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_4
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_4:
Lloh2:
	adrp	x8, _AC49X_PARTTYPE_ROOTFS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AC49X_PARTTYPE_ROOTFS@GOTPAGEOFF]
	b	LBB0_12
LBB0_5:
	mov	w0, #-1
	b	LBB0_13
LBB0_6:
	and	w9, w8, #0xff
	cmp	w9, #129
	b.eq	LBB0_4
; %bb.7:
	lsr	w8, w8, #8
	cmp	w8, #129
	b.eq	LBB0_4
; %bb.8:
Lloh4:
	adrp	x8, _AC49X_PARTTYPE_UNKNOWN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AC49X_PARTTYPE_UNKNOWN@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
Lloh6:
	adrp	x8, _AC49X_PARTTYPE_BOOTENV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AC49X_PARTTYPE_BOOTENV@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh8:
	adrp	x8, _AC49X_PARTTYPE_LOADER@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AC49X_PARTTYPE_LOADER@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh10:
	adrp	x8, _AC49X_PARTTYPE_LINUX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AC49X_PARTTYPE_LINUX@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_10-LBB0_4)>>2
	.byte	(LBB0_11-LBB0_4)>>2
	.byte	(LBB0_9-LBB0_4)>>2
                                        ; -- End function
	.comm	_AC49X_PARTTYPE_LOADER,4,2      ; @AC49X_PARTTYPE_LOADER
	.comm	_AC49X_PARTTYPE_LINUX,4,2       ; @AC49X_PARTTYPE_LINUX
	.comm	_AC49X_PARTTYPE_ROOTFS,4,2      ; @AC49X_PARTTYPE_ROOTFS
	.comm	_AC49X_PARTTYPE_BOOTENV,4,2     ; @AC49X_PARTTYPE_BOOTENV
	.comm	_AC49X_PARTTYPE_UNKNOWN,4,2     ; @AC49X_PARTTYPE_UNKNOWN
.subsections_via_symbols
