	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubiblock_remove                ## -- Begin function ubiblock_remove
	.p2align	4, 0x90
_ubiblock_remove:                       ## @ubiblock_remove
	.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	%rdi, %rbx
	movq	_devices_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	(%rbx), %esi
	movl	4(%rbx), %edi
	callq	_find_dev_nolock
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpq	$0, (%rbx)
	jle	LBB0_6
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_4
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_4:
	negl	%ebx
	movq	_devices_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_5
LBB0_6:
	movq	%rbx, %rdi
	addq	$12, %rdi
	callq	_list_del
	movq	%rbx, %rdi
	callq	_ubiblock_cleanup
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_devices_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_devices_mutex,4,2              ## @devices_mutex
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubiblock_remove                ; -- Begin function ubiblock_remove
	.p2align	2
_ubiblock_remove:                       ; @ubiblock_remove
	.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, x0
Lloh0:
	adrp	x0, _devices_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _devices_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldp	w1, w0, [x19]
	bl	_find_dev_nolock
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x20, x0, #8
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.2:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w19, [x8]
	mov	x0, x20
	bl	_mutex_unlock
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh7:
	ldr	w19, [x8]
LBB0_4:
	neg	w19, w19
Lloh8:
	adrp	x0, _devices_mutex@GOTPAGE
Lloh9:
	ldr	x0, [x0, _devices_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_6
LBB0_5:
	add	x0, x19, #12
	bl	_list_del
	mov	x0, x19
	bl	_ubiblock_cleanup
	mov	x0, x20
	bl	_mutex_unlock
Lloh10:
	adrp	x0, _devices_mutex@GOTPAGE
Lloh11:
	ldr	x0, [x0, _devices_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	bl	_kfree
	mov	w19, #0
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_devices_mutex,4,2              ; @devices_mutex
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
