	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_hci_unit_clean              ## -- Begin function ng_hci_unit_clean
	.p2align	4, 0x90
_ng_hci_unit_clean:                     ## @ng_hci_unit_clean
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_NG_HCI_UNIT_COMMAND_PENDING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_ng_hci_command_untimeout
LBB0_2:
	leaq	12(%r14), %rdi
	callq	_NG_BT_MBUFQ_DRAIN
	movl	4(%r14), %edi
	movl	$1, %esi
	callq	_NG_HCI_BUFF_CMD_SET
	leaq	8(%r14), %r12
	movq	%r12, %rdi
	callq	_LIST_EMPTY
	testl	%eax, %eax
	je	LBB0_3
LBB0_7:
	movl	4(%r14), %edi
	callq	_NG_HCI_BUFF_ACL_TOTAL
	movl	4(%r14), %edi
	callq	_NG_HCI_BUFF_ACL_FREE
	movl	4(%r14), %edi
	callq	_NG_HCI_BUFF_SCO_TOTAL
	movl	4(%r14), %edi
	callq	_NG_HCI_BUFF_SCO_FREE
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ng_hci_flush_neighbor_cache    ## TAILCALL
LBB0_3:
	movq	_NG_HCI_CON_TIMEOUT_PENDING@GOTPCREL(%rip), %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_ng_hci_lp_discon_ind
	movq	%rbx, %rdi
	callq	_ng_hci_free_con
	movq	%r12, %rdi
	callq	_LIST_EMPTY
	testl	%eax, %eax
	jne	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_LIST_FIRST
	movq	%rax, %rbx
	movl	(%r13), %eax
	testl	%eax, (%rbx)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_ng_hci_con_untimeout
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_NG_HCI_UNIT_COMMAND_PENDING,4,2 ## @NG_HCI_UNIT_COMMAND_PENDING
	.comm	_NG_HCI_CON_TIMEOUT_PENDING,4,2 ## @NG_HCI_CON_TIMEOUT_PENDING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_hci_unit_clean              ; -- Begin function ng_hci_unit_clean
	.p2align	2
_ng_hci_unit_clean:                     ; @ng_hci_unit_clean
	.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, x1
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _NG_HCI_UNIT_COMMAND_PENDING@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NG_HCI_UNIT_COMMAND_PENDING@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_ng_hci_command_untimeout
LBB0_2:
	add	x0, x19, #12
	bl	_NG_BT_MBUFQ_DRAIN
	ldr	w0, [x19, #4]
	mov	w1, #1
	bl	_NG_HCI_BUFF_CMD_SET
	add	x21, x19, #8
	mov	x0, x21
	bl	_LIST_EMPTY
	cbz	w0, LBB0_4
LBB0_3:
	ldr	w0, [x19, #4]
	bl	_NG_HCI_BUFF_ACL_TOTAL
	ldr	w0, [x19, #4]
	bl	_NG_HCI_BUFF_ACL_FREE
	ldr	w0, [x19, #4]
	bl	_NG_HCI_BUFF_SCO_TOTAL
	ldr	w0, [x19, #4]
	bl	_NG_HCI_BUFF_SCO_FREE
	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
	b	_ng_hci_flush_neighbor_cache
LBB0_4:
Lloh3:
	adrp	x23, _NG_HCI_CON_TIMEOUT_PENDING@GOTPAGE
Lloh4:
	ldr	x23, [x23, _NG_HCI_CON_TIMEOUT_PENDING@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x22
	mov	x1, x20
	bl	_ng_hci_lp_discon_ind
	mov	x0, x22
	bl	_ng_hci_free_con
	mov	x0, x21
	bl	_LIST_EMPTY
	cbnz	w0, LBB0_3
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_LIST_FIRST
	mov	x22, x0
	ldr	w8, [x0]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x22
	bl	_ng_hci_con_untimeout
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_NG_HCI_UNIT_COMMAND_PENDING,4,2 ; @NG_HCI_UNIT_COMMAND_PENDING
	.comm	_NG_HCI_CON_TIMEOUT_PENDING,4,2 ; @NG_HCI_CON_TIMEOUT_PENDING
.subsections_via_symbols
