	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_create_badblock_pattern
_nand_create_badblock_pattern:          ## @nand_create_badblock_pattern
	.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
	pushq	%rax
	.cfi_offset %rbx, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movq	%rdi, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	_BADBLOCK_SCAN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rbx), %ecx
	movl	%ecx, (%rax)
	movl	16(%rbx), %edx
	movl	%edx, 12(%rax)
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	4(%rbx), %edx
	cmpl	$1, %edx
	movl	$2, %edx
	sbbl	$0, %edx
	movl	%edx, 4(%rax)
	movq	_scan_ff_pattern@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 8(%rax)
	movq	_NAND_BBT_DYNAMICSTRUCT@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, (%rax)
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad block pattern already allocated; not replacing\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BADBLOCK_SCAN_MASK,4,2         ## @BADBLOCK_SCAN_MASK
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_scan_ff_pattern,4,2            ## @scan_ff_pattern
	.comm	_NAND_BBT_DYNAMICSTRUCT,4,2     ## @NAND_BBT_DYNAMICSTRUCT
	.no_dead_strip	_nand_create_badblock_pattern
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nand_create_badblock_pattern
_nand_create_badblock_pattern:          ; @nand_create_badblock_pattern
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_3:
	mov	x19, x0
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x8, x0
	mov	w0, #0
Lloh7:
	adrp	x9, _BADBLOCK_SCAN_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BADBLOCK_SCAN_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	ldp	w10, w11, [x19]
	and	w9, w9, w10
Lloh10:
	adrp	x10, _NAND_BUSWIDTH_16@GOTPAGE
Lloh11:
	ldr	x10, [x10, _NAND_BUSWIDTH_16@GOTPAGEOFF]
	str	w9, [x8]
Lloh12:
	ldr	w10, [x10]
	tst	w10, w11
	ldr	w10, [x19, #16]
Lloh13:
	adrp	x11, _scan_ff_pattern@GOTPAGE
Lloh14:
	ldr	x11, [x11, _scan_ff_pattern@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
	stp	w11, w10, [x8, #8]
Lloh16:
	adrp	x10, _NAND_BBT_DYNAMICSTRUCT@GOTPAGE
Lloh17:
	ldr	x10, [x10, _NAND_BBT_DYNAMICSTRUCT@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	orr	w9, w10, w9
	mov	w10, #1
	cinc	w10, w10, ne
	stp	w9, w10, [x8]
	str	x8, [x19, #8]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad block pattern already allocated; not replacing\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BADBLOCK_SCAN_MASK,4,2         ; @BADBLOCK_SCAN_MASK
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_scan_ff_pattern,4,2            ; @scan_ff_pattern
	.comm	_NAND_BBT_DYNAMICSTRUCT,4,2     ; @NAND_BBT_DYNAMICSTRUCT
	.no_dead_strip	_nand_create_badblock_pattern
.subsections_via_symbols
