	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmnand_bch_ooblayout_free_sp
_brcmnand_bch_ooblayout_free_sp:        ## @brcmnand_bch_ooblayout_free_sp
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	callq	_mtd_to_nand
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	cmpl	$1, %r15d
	jg	LBB0_4
## %bb.1:
	movl	(%rax), %edx
	movb	4(%rax), %cl
	shll	%cl, %edx
	subl	(%rbx), %edx
	cmpl	$6, %edx
	jl	LBB0_4
## %bb.2:
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.3:
	cmpl	$6, %edx
	jne	LBB0_5
LBB0_4:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:
	movl	$6, (%r14)
	addl	$-6, %edx
	movl	%edx, 4(%r14)
	jmp	LBB0_8
LBB0_6:
	movabsq	$21474836480, %rax              ## imm = 0x500000000
	movq	%rax, (%r14)
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ERANGE,4,2                     ## @ERANGE
	.no_dead_strip	_brcmnand_bch_ooblayout_free_sp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function brcmnand_bch_ooblayout_free_sp
lCPI0_0:
	.long	0                               ; 0x0
	.long	5                               ; 0x5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_brcmnand_bch_ooblayout_free_sp:        ; @brcmnand_bch_ooblayout_free_sp
	.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, x2
	mov	x20, x1
	bl	_mtd_to_nand
	mov	x21, x0
	bl	_nand_get_controller_data
	cmp	w20, #1
	b.gt	LBB0_4
; %bb.1:
	ldp	w8, w9, [x0]
	lsl	w8, w8, w9
	ldr	w9, [x21]
	sub	w9, w8, w9
	subs	w8, w9, #6
	b.lt	LBB0_4
; %bb.2:
	cbz	w20, LBB0_6
; %bb.3:
	cmp	w9, #6
	b.ne	LBB0_6
LBB0_4:
Lloh0:
	adrp	x8, _ERANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
	mov	w0, #0
	cbz	w20, LBB0_8
; %bb.7:
	mov	w9, #6
	stp	w9, w8, [x19]
	b	LBB0_5
LBB0_8:
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ERANGE,4,2                     ; @ERANGE
	.no_dead_strip	_brcmnand_bch_ooblayout_free_sp
.subsections_via_symbols
