	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_prio_write                 ## -- Begin function bch_prio_write
	.p2align	4, 0x90
_bch_prio_write:                        ## @bch_prio_write
	.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
	movq	%rdi, %r13
	leaq	-48(%rbp), %rdi
	callq	_closure_init_stack
	movq	24(%r13), %rdi
	callq	_lockdep_assert_held
	movq	40(%r13), %rax
	incl	24(%rax)
	movl	32(%r13), %r14d
	movq	%r13, %rdi
	callq	_prio_buckets
	imull	%eax, %r14d
	leaq	48(%r13), %rsi
	movl	%r14d, %edi
	callq	_atomic_long_add
	movq	%r13, %rdi
	callq	_prio_buckets
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	leaq	32(%r13), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%eax, %ebx
	leaq	(%rbx,%rbx,2), %rax
	leaq	-12(,%rax,4), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	(%rax,%r12,8), %rax
	movq	%rax, (%r14)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_pset_magic
	leaq	8(%r14), %r15
	movl	%eax, 8(%r14)
	movq	%r13, %rdi
	callq	_bucket_bytes
	leaq	-8(%rax), %rsi
	movq	%r15, %rdi
	callq	_bch_crc64
	movl	%eax, 12(%r14)
	movq	_RESERVE_PRIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_bch_bucket_alloc
	movq	%rax, %r15
	xorl	%edi, %edi
	cmpq	$-1, %rax
	sete	%dil
	callq	_BUG_ON
	movq	24(%r13), %rdi
	callq	_mutex_unlock
	movq	_REQ_OP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_prio_io
	movq	24(%r13), %rdi
	callq	_mutex_lock
	movq	(%r13), %rax
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%r15, (%rax,%rbx,8)
	leaq	(%r15,%r15,2), %rdi
	shlq	$2, %rdi
	addq	16(%r13), %rdi
	callq	_atomic_dec_bug
	addq	$-12, -64(%rbp)                 ## 8-byte Folded Spill
	cmpq	$1, %r12
	jle	LBB0_8
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leaq	-1(%rbx), %r15
	movq	40(%r13), %r14
	movq	16(%r14), %r12
	movq	%r13, %rdi
	callq	_prios_per_bucket
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	16(%r13), %rbx
	movq	%r13, %rdi
	callq	_prios_per_bucket
	movq	%rbx, %rsi
	cltq
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	imulq	%rax, %r15
	leaq	(%r15,%r15,2), %rcx
	leaq	(%rbx,%rcx,4), %rcx
	movslq	36(%r13), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	shlq	$2, %rdx
	addq	16(%r13), %rdx
	cmpq	%rdx, %rcx
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	jae	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%ebx, %rcx
	leaq	(%r12,%rcx,8), %r15
	addq	$8, %r12
	imulq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	leaq	(%rsi,%rax), %rbx
	addq	$12, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-4(%rbx), %edi
	callq	_cpu_to_le16
	movl	%eax, -4(%r12)
	movl	-8(%rbx), %eax
	movl	%eax, -8(%r12)
	movslq	36(%r13), %rax
	leaq	(%rax,%rax,2), %rax
	shlq	$2, %rax
	addq	16(%r13), %rax
	cmpq	%rax, %rbx
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	leaq	8(%r12), %rax
	addq	$12, %rbx
	cmpq	%r15, %r12
	movq	%rax, %r12
	jb	LBB0_5
	jmp	LBB0_7
LBB0_8:
	movq	24(%r13), %rdi
	callq	_mutex_unlock
	movq	24(%r13), %rdi
	leaq	-48(%rbp), %r14
	movq	%r14, %rsi
	callq	_bch_journal_meta
	movq	%r14, %rdi
	callq	_closure_sync
	movq	24(%r13), %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_prio_buckets
	testl	%eax, %eax
	jle	LBB0_13
## %bb.9:
	xorl	%r14d, %r14d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r13), %rcx
	movl	(%rcx,%r14,8), %ecx
	movl	%ecx, (%rax,%r14,4)
	incq	%r14
	movq	%r13, %rdi
	callq	_prio_buckets
	cltq
	cmpq	%rax, %r14
	jge	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movslq	(%rax,%r14,4), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	leaq	(%rcx,%rcx,2), %rsi
	shlq	$2, %rsi
	addq	16(%r13), %rsi
	movq	%r13, %rdi
	callq	___bch_bucket_free
	movq	8(%r13), %rax
	jmp	LBB0_12
LBB0_13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RESERVE_PRIO,4,2               ## @RESERVE_PRIO
	.comm	_REQ_OP_WRITE,4,2               ## @REQ_OP_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_prio_write                 ; -- Begin function bch_prio_write
	.p2align	2
_bch_prio_write:                        ; @bch_prio_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
	add	x0, sp, #8
	bl	_closure_init_stack
	ldr	x0, [x19, #24]
	bl	_lockdep_assert_held
	ldr	x8, [x19, #40]
	ldr	w9, [x8, #24]
	add	w9, w9, #1
	str	w9, [x8, #24]
	mov	x20, x19
	ldr	w21, [x20, #32]!
	mov	x0, x19
	bl	_prio_buckets
	mul	w0, w0, w21
	add	x1, x19, #48
	bl	_atomic_long_add
	mov	x0, x19
	bl	_prio_buckets
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w24, w0
	mov	w23, #12
	mov	x8, #-12
	umaddl	x25, w0, w23, x8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8, x24, lsl #3]
	str	x8, [x21]
	mov	x0, x20
	bl	_pset_magic
	str	w0, [x21, #8]!
	mov	x0, x19
	bl	_bucket_bytes
	sub	x1, x0, #8
	mov	x0, x21
	bl	_bch_crc64
	str	w0, [x21, #4]
Lloh0:
	adrp	x8, _RESERVE_PRIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RESERVE_PRIO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_bch_bucket_alloc
	mov	x21, x0
	cmn	x0, #1
	cset	w0, eq
	bl	_BUG_ON
	ldr	x0, [x19, #24]
	bl	_mutex_unlock
Lloh3:
	adrp	x8, _REQ_OP_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REQ_OP_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	bl	_prio_io
	ldr	x0, [x19, #24]
	bl	_mutex_lock
	ldr	x8, [x19]
	str	x21, [x8, x28, lsl #3]
	ldr	x8, [x19, #16]
	madd	x0, x21, x23, x8
	bl	_atomic_dec_bug
	sub	x25, x25, #12
	cmp	x24, #1
	mov	x24, x28
	b.le	LBB0_6
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	sub	x28, x24, #1
	ldr	x21, [x19, #40]
	ldr	x26, [x21, #16]
	mov	x0, x19
	bl	_prios_per_bucket
	mov	x22, x0
	ldr	x27, [x19, #16]
	mov	x0, x19
	bl	_prios_per_bucket
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	mul	x9, x28, x8
	madd	x9, x9, x23, x27
	ldr	x10, [x19, #16]
	ldrsw	x11, [x19, #36]
	madd	x10, x11, x23, x10
	cmp	x9, x10
	ccmp	w22, #1, #8, lo
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x26, w22, sxtw #3
	add	x26, x26, #8
	madd	x8, x25, x8, x27
	add	x27, x8, #12
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldur	w0, [x27, #-4]
	bl	_cpu_to_le16
	ldur	w8, [x27, #-8]
	stp	w8, w0, [x26, #-8]
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #36]
	madd	x8, x9, x23, x8
	cmp	x27, x8
	ccmp	x26, x22, #2, lo
	add	x26, x26, #8
	add	x27, x27, #12
	b.lo	LBB0_5
	b	LBB0_2
LBB0_6:
	ldr	x0, [x19, #24]
	bl	_mutex_unlock
	ldr	x0, [x19, #24]
	add	x1, sp, #8
	bl	_bch_journal_meta
	add	x0, sp, #8
	bl	_closure_sync
	ldr	x0, [x19, #24]
	bl	_mutex_lock
	mov	x0, x19
	bl	_prio_buckets
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.7:
	mov	x20, #0
	mov	w21, #12
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x9, [x19]
	ldr	x9, [x9, x20, lsl #3]
	str	w9, [x8, x20, lsl #2]
	add	x20, x20, #1
	mov	x0, x19
	bl	_prio_buckets
	cmp	x20, w0, sxtw
	b.ge	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldrsw	x9, [x8, x20, lsl #2]
	cbz	w9, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19, #16]
	madd	x1, x9, x21, x8
	mov	x0, x19
	bl	___bch_bucket_free
	ldr	x8, [x19, #8]
	b	LBB0_8
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RESERVE_PRIO,4,2               ; @RESERVE_PRIO
	.comm	_REQ_OP_WRITE,4,2               ; @REQ_OP_WRITE
.subsections_via_symbols
