	.file	"extr_ng_ubt.c_ubt_detach.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ubt_detach
	.type	ubt_detach, @function
ubt_detach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	device_get_softc@PLT
	mov	r12, QWORD PTR 32[rax]
	mov	rbp, rax
	test	r12, r12
	je	.L2
	mov	QWORD PTR 32[rax], 0
	mov	rdi, r12
	call	NG_NODE_REALLY_DIE@PLT
	mov	rdi, r12
	call	ng_rmnode_self@PLT
.L2:
	mov	edi, DWORD PTR taskqueue_swi[rip]
	lea	rsi, 24[rbp]
	call	taskqueue_drain@PLT
	mov	esi, DWORD PTR UBT_N_TRANSFER[rip]
	mov	edi, DWORD PTR 20[rbp]
	call	usbd_transfer_unsetup@PLT
	mov	rdi, rbp
	call	UBT_NG_LOCK@PLT
	lea	rdi, 16[rbp]
	call	NG_BT_MBUFQ_DESTROY@PLT
	lea	rdi, 12[rbp]
	call	NG_BT_MBUFQ_DESTROY@PLT
	lea	rdi, 8[rbp]
	call	NG_BT_MBUFQ_DESTROY@PLT
	mov	rdi, rbp
	call	UBT_NG_UNLOCK@PLT
	lea	rdi, 4[rbp]
	call	mtx_destroy@PLT
	mov	rdi, rbp
	call	mtx_destroy@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ubt_detach, .-ubt_detach
	.comm	taskqueue_swi,4,4
	.comm	UBT_N_TRANSFER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ng_ubt.c_ubt_detach.c"
	.text
	.align	2
	.global	ubt_detach
	.syntax unified
	.arm
	.fpu softvfp
	.type	ubt_detach, %function
ubt_detach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	bl	device_get_softc
	ldr	r5, [r0, #28]
	mov	r4, r0
	cmp	r5, #0
	beq	.L2
	mov	r3, #0
	mov	r0, r5
	str	r3, [r4, #28]
	bl	NG_NODE_REALLY_DIE
	mov	r0, r5
	bl	ng_rmnode_self
.L2:
	ldr	r3, .L8
	add	r1, r4, #24
	ldr	r0, [r3]
	bl	taskqueue_drain
	ldr	r3, .L8+4
	ldr	r0, [r4, #20]
	ldr	r1, [r3]
	bl	usbd_transfer_unsetup
	mov	r0, r4
	bl	UBT_NG_LOCK
	add	r0, r4, #16
	bl	NG_BT_MBUFQ_DESTROY
	add	r0, r4, #12
	bl	NG_BT_MBUFQ_DESTROY
	add	r0, r4, #8
	bl	NG_BT_MBUFQ_DESTROY
	mov	r0, r4
	bl	UBT_NG_UNLOCK
	add	r0, r4, #4
	bl	mtx_destroy
	mov	r0, r4
	bl	mtx_destroy
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L9:
	.align	2
.L8:
	.word	taskqueue_swi
	.word	UBT_N_TRANSFER
	.size	ubt_detach, .-ubt_detach
	.comm	taskqueue_swi,4,4
	.comm	UBT_N_TRANSFER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
