	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmnand_hamming_ooblayout_free
_brcmnand_hamming_ooblayout_free:       ## @brcmnand_hamming_ooblayout_free
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	callq	_mtd_to_nand
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %rdi
	movl	4(%rax), %ecx
	movl	8(%rax), %r8d
	movl	$512, %esi                      ## imm = 0x200
	shll	%cl, %esi
	movl	%r8d, %eax
	cltd
	idivl	%esi
	addl	%eax, %eax
	cmpl	%ebx, %eax
	jle	LBB0_1
## %bb.2:
	movl	(%rdi), %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	%ebx, %ecx
	shrl	$31, %ecx
	addl	%ebx, %ecx
	sarl	%ecx
	imull	%eax, %ecx
	movl	%ecx, (%r14)
	testb	$1, %bl
	jne	LBB0_3
## %bb.4:
	movl	$6, 4(%r14)
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jne	LBB0_8
## %bb.5:
	cmpl	$513, %r8d                      ## imm = 0x201
	jl	LBB0_7
## %bb.6:
	incl	%ecx
	movl	%ecx, (%r14)
LBB0_7:
	movl	$5, 4(%r14)
	jmp	LBB0_8
LBB0_1:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_3:
	addl	$9, %ecx
	movl	%ecx, (%r14)
	movl	$7, 4(%r14)
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERANGE,4,2                     ## @ERANGE
	.no_dead_strip	_brcmnand_hamming_ooblayout_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmnand_hamming_ooblayout_free
_brcmnand_hamming_ooblayout_free:       ; @brcmnand_hamming_ooblayout_free
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	mov	x20, x1
	bl	_mtd_to_nand
	bl	_nand_get_controller_data
	ldp	w9, w8, [x0, #4]
	mov	w10, #512
	lsl	w10, w10, w9
	sdiv	w10, w8, w10
	cmp	w20, w10, lsl #1
	b.ge	LBB0_4
; %bb.1:
	ldr	w10, [x0]
	lsl	w9, w10, w9
	cmp	w20, #0
	cinc	w10, w20, lt
	asr	w10, w10, #1
	mul	w9, w9, w10
	str	w9, [x19]
	tbnz	w20, #0, LBB0_5
; %bb.2:
	mov	w10, #6
	str	w10, [x19, #4]
	cbz	w20, LBB0_6
; %bb.3:
	mov	w0, #0
	b	LBB0_9
LBB0_4:
Lloh0:
	adrp	x8, _ERANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_5:
	mov	w0, #0
	add	w8, w9, #9
	mov	w9, #7
	stp	w8, w9, [x19]
	b	LBB0_9
LBB0_6:
	cmp	w8, #513
	b.lt	LBB0_8
; %bb.7:
	add	w8, w9, #1
	str	w8, [x19]
LBB0_8:
	mov	w0, #0
	mov	w8, #5
	str	w8, [x19, #4]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ERANGE,4,2                     ; @ERANGE
	.no_dead_strip	_brcmnand_hamming_ooblayout_free
.subsections_via_symbols
