	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ubd_remove
_ubd_remove:                            ## @ubd_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ubd_gendisk@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %r15
	movq	(%rax,%r15,8), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_ubd_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_ubd_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	leaq	(%r15,%r15,2), %r13
	cmpq	$0, 16(%r12,%r13,8)
	je	LBB0_8
## %bb.1:
	cmpq	$0, (%r12,%r13,8)
	jle	LBB0_3
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movl	%r14d, %ebx
	jmp	LBB0_8
LBB0_3:
	movq	_ubd_gendisk@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax,%r15,8)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_del_gendisk
	movq	%rbx, %rdi
	callq	_put_disk
LBB0_5:
	movq	_fake_gendisk@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_del_gendisk
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rdi
	callq	_put_disk
	movq	(%rbx), %rax
	movq	$0, (%rax,%r15,8)
LBB0_7:
	leaq	(%r12,%r13,8), %rdi
	addq	$8, %rdi
	callq	_platform_device_unregister
	xorl	%ebx, %ebx
LBB0_8:
	movq	_ubd_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ubd_gendisk,8,3                ## @ubd_gendisk
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ubd_lock,4,2                   ## @ubd_lock
	.comm	_ubd_devs,8,3                   ## @ubd_devs
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_fake_gendisk,8,3               ## @fake_gendisk
	.no_dead_strip	_ubd_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ubd_remove
_ubd_remove:                            ; @ubd_remove
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
Lloh0:
	adrp	x22, _ubd_gendisk@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ubd_gendisk@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x19, [x8, w0, sxtw #3]
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w23, [x8]
Lloh5:
	adrp	x0, _ubd_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _ubd_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh7:
	adrp	x8, _ubd_devs@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ubd_devs@GOTPAGEOFF]
Lloh9:
	ldr	x21, [x8]
	mov	w8, #24
	smaddl	x8, w20, w8, x21
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_3
; %bb.1:
	sxtw	x20, w20
	mov	w8, #24
	mul	x8, x20, x8
	ldr	x8, [x21, x8]
	cmp	x8, #0
	b.le	LBB0_4
; %bb.2:
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_9
LBB0_3:
	neg	w19, w23
	b	LBB0_9
LBB0_4:
	ldr	x8, [x22]
	str	xzr, [x8, x20, lsl #3]
	cbz	x19, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_del_gendisk
	mov	x0, x19
	bl	_put_disk
LBB0_6:
Lloh13:
	adrp	x19, _fake_gendisk@GOTPAGE
Lloh14:
	ldr	x19, [x19, _fake_gendisk@GOTPAGEOFF]
	ldr	x8, [x19]
	ldr	x0, [x8, x20, lsl #3]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_del_gendisk
	ldr	x8, [x19]
	lsl	x22, x20, #3
	ldr	x0, [x8, x22]
	bl	_put_disk
	ldr	x8, [x19]
	str	xzr, [x8, x22]
LBB0_8:
	mov	w8, #24
	madd	x8, x20, x8, x21
	add	x0, x8, #8
	bl	_platform_device_unregister
	mov	w19, #0
LBB0_9:
Lloh15:
	adrp	x0, _ubd_lock@GOTPAGE
Lloh16:
	ldr	x0, [x0, _ubd_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ubd_gendisk,8,3                ; @ubd_gendisk
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ubd_lock,4,2                   ; @ubd_lock
	.comm	_ubd_devs,8,3                   ; @ubd_devs
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_fake_gendisk,8,3               ; @fake_gendisk
	.no_dead_strip	_ubd_remove
.subsections_via_symbols
