	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_decode_ext_id             ## -- Begin function nand_decode_ext_id
	.p2align	4, 0x90
_nand_decode_ext_id:                    ## @nand_decode_ext_id
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_nand_to_mtd
	movq	%rax, %r15
	movq	8(%r14), %rbx
	leaq	4(%r14), %rdi
	callq	_nanddev_get_memorg
	movq	%rax, %r12
	movl	8(%rbx), %edi
	callq	_nand_get_bits_per_cell
	movl	%eax, 12(%r12)
	movl	12(%rbx), %edx
	movl	%edx, %eax
	andb	$3, %al
	movl	$1024, %esi                     ## imm = 0x400
	movl	%eax, %ecx
	shll	%cl, %esi
	movl	%esi, (%r12)
	movl	%esi, (%r15)
	movl	%edx, %ecx
	shrb	$2, %cl
	andb	$1, %cl
	movl	$8, %edi
	shll	%cl, %edi
	shrl	$9, %esi
	imull	%edi, %esi
	movl	%esi, 4(%r12)
	movl	%edx, %ecx
	shrb	$4, %cl
	andb	$3, %cl
	movl	$65536, %ebx                    ## imm = 0x10000
	shll	%cl, %ebx
	addb	$10, %al
	movl	%ebx, %edi
	movl	%eax, %ecx
	shrl	%cl, %edi
	movl	%esi, 4(%r15)
	movl	%edi, 8(%r12)
	movl	%ebx, 8(%r15)
	testb	$64, %dl
	je	LBB0_2
## %bb.1:
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_decode_ext_id             ; -- Begin function nand_decode_ext_id
	.p2align	2
_nand_decode_ext_id:                    ; @nand_decode_ext_id
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	bl	_nand_to_mtd
	mov	x20, x0
	ldr	x22, [x19, #8]
	add	x0, x19, #4
	bl	_nanddev_get_memorg
	mov	x21, x0
	ldr	w0, [x22, #8]
	bl	_nand_get_bits_per_cell
	str	w0, [x21, #12]
	ldr	w8, [x22, #12]
	and	x9, x8, #0x3
	mov	w10, #1024
	lsl	w10, w10, w9
	ubfx	w11, w8, #2, #1
	mov	w12, #8
	lsl	w11, w12, w11
	lsr	w12, w10, #9
	mul	w11, w11, w12
	stp	w10, w11, [x21]
	stp	w10, w11, [x20]
	ubfx	w10, w8, #4, #2
	mov	w11, #65536
	lsl	w10, w11, w10
	add	w9, w9, #10
	lsr	w9, w10, w9
	str	w9, [x21, #8]
	str	w10, [x20, #8]
	tbz	w8, #6, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _NAND_BUSWIDTH_16@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
.subsections_via_symbols
