	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elevator_switch
_elevator_switch:                       ## @elevator_switch
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_elevator_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_elevator_init_queue
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_elv_quiesce_start
	movq	(%r12), %r15
	movl	8(%r12), %edi
	callq	_spin_lock_irq
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_elevator_attach
	movl	8(%r12), %edi
	callq	_spin_unlock_irq
	cmpq	$0, 8(%r15)
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	___elv_unregister_queue
	movq	%r12, %rdi
	callq	_elv_register_queue
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_elevator_exit
	movq	%r15, (%r12)
	movq	%r12, %rdi
	callq	_elv_register_queue
	movq	%r12, %rdi
	callq	_elv_quiesce_end
	jmp	LBB0_8
LBB0_3:
	addq	$16, %r14
	movq	%r14, %rdi
	callq	_kobject_put
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_6:
	movq	%r15, %rdi
	callq	_elevator_exit
	movq	%r12, %rdi
	callq	_elv_quiesce_end
	movq	(%r14), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_blk_add_trace_msg
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"elv switch: %s"

	.no_dead_strip	_elevator_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elevator_switch
_elevator_switch:                       ; @elevator_switch
	.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, x0
	bl	_elevator_alloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_elevator_init_queue
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x0
	mov	x0, x19
	bl	_elv_quiesce_start
	ldr	x21, [x19]
	ldr	w0, [x19, #8]
	bl	_spin_lock_irq
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_elevator_attach
	ldr	w0, [x19, #8]
	bl	_spin_unlock_irq
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_7
; %bb.3:
	mov	x0, x21
	bl	___elv_unregister_queue
	mov	x0, x19
	bl	_elv_register_queue
	cbz	w0, LBB0_7
; %bb.4:
	mov	x22, x0
	mov	x0, x20
	bl	_elevator_exit
	str	x21, [x19]
	mov	x0, x19
	bl	_elv_register_queue
	mov	x0, x19
	bl	_elv_quiesce_end
	b	LBB0_8
LBB0_5:
	add	x0, x20, #16
	bl	_kobject_put
LBB0_6:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_8
LBB0_7:
	mov	x0, x21
	bl	_elevator_exit
	mov	x0, x19
	bl	_elv_quiesce_end
	ldr	x8, [x20]
	ldr	w2, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_blk_add_trace_msg
	mov	w22, #0
LBB0_8:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"elv switch: %s"

	.no_dead_strip	_elevator_switch
.subsections_via_symbols
