	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm_init_zone
_sm_init_zone:                          ## @sm_init_zone
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movslq	%esi, %r15
	movl	$0, -52(%rbp)
	leaq	L_.str(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_dbg
	movl	(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$2, %esi
	callq	_kmalloc_array
	shlq	$4, %r15
	movq	%rax, (%r14,%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	leaq	(%r14,%r15), %r13
	movl	(%rbx), %edx
	addl	%edx, %edx
	movq	%rax, %rdi
	movl	$-1, %esi
	callq	_memset
	leaq	(%r14,%r15), %rdi
	addq	$12, %rdi
	movl	4(%rbx), %esi
	addl	%esi, %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_kfifo_alloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	(%r13), %rdi
	callq	_kfree
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r13d, %r13d
	jmp	LBB0_5
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_5:
	subl	(%rax), %r13d
LBB0_6:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	$0, -48(%rbp)
	cmpl	$0, 4(%rbx)
	je	LBB0_25
## %bb.8:
	leaq	-96(%rbp), %r13
	leaq	L_.str.1(%rip), %r14
	xorl	%edx, %edx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_11 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-48(%rbp), %rsi
	movl	$2, %edx
	callq	_kfifo_in
LBB0_10:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	-48(%rbp), %rdx
	incq	%rdx
	movq	%rdx, -48(%rbp)
	movslq	4(%rbx), %rax
	cmpq	%rax, %rdx
	jae	LBB0_25
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	testl	%r12d, %r12d
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	8(%rbx), %rdx
	jbe	LBB0_10
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%rbx, %rdi
	movl	%r12d, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%r13, %r9
	callq	_sm_read_sector
	testq	%rax, %rax
	jne	LBB0_29
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_sm_block_erased
	testq	%rax, %rax
	jne	LBB0_9
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_sm_block_valid
	testl	%eax, %eax
	je	LBB0_22
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_sm_read_lba
	cmpl	$-2, %eax
	je	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpl	(%rbx), %eax
	jge	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=1
	movslq	%eax, %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	(%rcx,%rdx,8), %rdx
	movq	-48(%rbp), %rcx
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_sm_printk
	movq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_sm_check_block
	testq	%rax, %rax
	jne	LBB0_10
## %bb.19:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_sm_check_block
	testq	%rax, %rax
	je	LBB0_23
## %bb.20:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	-48(%rbp), %rax
	movq	(%r14), %rcx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rcx,%rdx,8)
	jmp	LBB0_24
LBB0_21:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	-48(%rbp), %rsi
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dbg
	jmp	LBB0_10
LBB0_22:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dbg
	jmp	LBB0_10
LBB0_23:                                ##   in Loop: Header=BB0_11 Depth=1
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_sm_printk
	movq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	$1, %ecx
	callq	_sm_erase_block
LBB0_24:                                ##   in Loop: Header=BB0_11 Depth=1
	leaq	L_.str.1(%rip), %r14
	jmp	LBB0_10
LBB0_25:
	leaq	L_.str.6(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dbg
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	$1, 8(%rax,%r15)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfifo_len
	testl	%eax, %eax
	je	LBB0_30
## %bb.26:
	leaq	-52(%rbp), %rdi
	movl	$2, %esi
	callq	_get_random_bytes
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfifo_len
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	-52(%rbp), %eax
	cltd
	idivl	%ecx
	subl	$1, %edx
	movl	%edx, -52(%rbp)
	jb	LBB0_6
## %bb.27:
	leaq	-48(%rbp), %r14
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_kfifo_out
	xorl	%edi, %edi
	cmpl	$2, %eax
	setne	%dil
	callq	_WARN_ON
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_kfifo_in
	subl	$1, -52(%rbp)
	jae	LBB0_28
	jmp	LBB0_6
LBB0_29:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfifo_free
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_kfree
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_30:
	leaq	L_.str.7(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_sm_printk
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"initializing zone %d"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"PH %04d <-> <marked bad>"

L_.str.2:                               ## @.str.2
	.asciz	"PH %04d <-> LBA %04d(bad)"

L_.str.4:                               ## @.str.4
	.asciz	"collision of LBA %d between blocks %d and %d in zone %d"

L_.str.5:                               ## @.str.5
	.asciz	"both blocks are valid, erasing the later"

L_.str.6:                               ## @.str.6
	.asciz	"zone initialized"

L_.str.7:                               ## @.str.7
	.asciz	"no free blocks in zone %d"

	.no_dead_strip	_sm_init_zone
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm_init_zone
_sm_init_zone:                          ; @sm_init_zone
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
	ldr	x27, [x0, #16]
	str	wzr, [sp, #44]
	str	x20, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg
	ldr	w0, [x21]
Lloh2:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	w1, #2
	bl	_kmalloc_array
	add	x28, x27, w20, sxtw #4
	str	x0, [x28]
	cbz	x0, LBB0_3
; %bb.1:
	sxtw	x25, w20
	ldr	w8, [x21]
	lsl	w2, w8, #1
	mov	w1, #-1
	bl	_memset
	add	x8, x27, x25, lsl #4
	add	x19, x8, #12
	ldr	w8, [x21, #4]
	lsl	w1, w8, #1
	ldr	w2, [x22]
	mov	x0, x19
	bl	_kfifo_alloc
	cbz	x0, LBB0_6
; %bb.2:
	ldr	x0, [x28]
	bl	_kfree
LBB0_3:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_6:
	str	xzr, [sp, #48]
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_23
; %bb.7:
	mov	x2, #0
Lloh6:
	adrp	x22, l_.str.1@PAGE
Lloh7:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh8:
	adrp	x23, l_.str.2@PAGE
Lloh9:
	add	x23, x23, l_.str.2@PAGEOFF
	mov	x24, x20
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x1, sp, #48
	mov	x0, x19
	mov	w2, #2
	bl	_kfifo_in
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [sp, #48]
	add	x2, x8, #1
	str	x2, [sp, #48]
	ldrsw	x8, [x21, #4]
	cmp	x2, x8
	b.hs	LBB0_23
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	cbnz	w20, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x21, #8]
	cmp	x2, x8
	b.ls	LBB0_9
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	add	x5, sp, #56
	mov	x0, x21
	mov	x1, x20
	mov	w3, #0
	mov	x4, #0
	bl	_sm_read_sector
	cbnz	x0, LBB0_27
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x0, sp, #56
	bl	_sm_block_erased
	cbnz	x0, LBB0_8
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x0, sp, #56
	bl	_sm_block_valid
	cbz	w0, LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x0, sp, #56
	bl	_sm_read_lba
	mov	x26, x0
	cmn	w0, #2
	b.eq	LBB0_20
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x21]
	cmp	w26, w8
	b.ge	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x28]
	ldr	x8, [x8, w26, sxtw #3]
	ldr	x9, [sp, #48]
	stp	x9, x24, [sp, #16]
	stp	x26, x8, [sp]
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_sm_printk
	ldr	x2, [sp, #48]
	mov	x0, x21
	mov	x1, x20
	bl	_sm_check_block
	cbnz	x0, LBB0_9
; %bb.18:                               ;   in Loop: Header=BB0_10 Depth=1
	sxtw	x26, w26
	ldr	x8, [x28]
	ldr	x2, [x8, x26, lsl #3]
	mov	x0, x21
	mov	x1, x20
	bl	_sm_check_block
	cbz	x0, LBB0_22
; %bb.19:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [sp, #48]
	ldr	x9, [x28]
	str	x8, [x9, x26, lsl #3]
	b	LBB0_9
LBB0_20:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [sp, #48]
                                        ; kill: def $w26 killed $w26 killed $x26 def $x26
	stp	x8, x26, [sp]
	mov	x0, x23
	bl	_dbg
	b	LBB0_9
LBB0_21:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [sp, #48]
	str	x8, [sp]
	mov	x0, x22
	bl	_dbg
	b	LBB0_9
LBB0_22:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_sm_printk
	ldr	x2, [sp, #48]
	mov	x0, x21
	mov	x1, x20
	mov	w3, #1
	bl	_sm_erase_block
	b	LBB0_9
LBB0_23:
Lloh14:
	adrp	x0, l_.str.6@PAGE
Lloh15:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_dbg
	add	x8, x27, x25, lsl #4
	mov	w9, #1
	str	w9, [x8, #8]
	mov	x0, x19
	bl	_kfifo_len
	cbz	w0, LBB0_28
; %bb.24:
	add	x0, sp, #44
	mov	w1, #2
	bl	_get_random_bytes
	mov	x0, x19
	bl	_kfifo_len
	cmp	w0, #0
	cinc	w8, w0, lt
	asr	w8, w8, #1
	ldr	w9, [sp, #44]
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	sub	w9, w8, #1
	str	w9, [sp, #44]
	cbz	w8, LBB0_29
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	add	x1, sp, #48
	mov	x0, x19
	mov	w2, #2
	bl	_kfifo_out
	cmp	w0, #2
	cset	w0, ne
	bl	_WARN_ON
	add	x1, sp, #48
	mov	x0, x19
	mov	w2, #2
	bl	_kfifo_in
	ldr	w8, [sp, #44]
	b	LBB0_25
LBB0_27:
	mov	x0, x19
	bl	_kfifo_free
	ldr	x0, [x28]
	bl	_kfree
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_28:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh18:
	adrp	x0, l_.str.7@PAGE
Lloh19:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_sm_printk
LBB0_29:
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"initializing zone %d"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"PH %04d <-> <marked bad>"

l_.str.2:                               ; @.str.2
	.asciz	"PH %04d <-> LBA %04d(bad)"

l_.str.4:                               ; @.str.4
	.asciz	"collision of LBA %d between blocks %d and %d in zone %d"

l_.str.5:                               ; @.str.5
	.asciz	"both blocks are valid, erasing the later"

l_.str.6:                               ; @.str.6
	.asciz	"zone initialized"

l_.str.7:                               ; @.str.7
	.asciz	"no free blocks in zone %d"

	.no_dead_strip	_sm_init_zone
.subsections_via_symbols
