	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_role_change_evt
_hci_role_change_evt:                   ## @hci_role_change_evt
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %rbx
	movl	(%rdi), %esi
	movl	8(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movq	%r14, %rdi
	callq	_hci_dev_lock
	movq	_ACL_LINK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	12(%rbx), %rdx
	movq	%r14, %rdi
	callq	_hci_conn_hash_lookup_ba
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r15
	cmpl	$0, 8(%rbx)
	jne	LBB0_5
## %bb.2:
	cmpq	$0, (%rbx)
	movq	_HCI_LM_MASTER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	je	LBB0_4
## %bb.3:
	notl	%eax
	andl	%eax, 4(%r15)
	jmp	LBB0_5
LBB0_4:
	orl	%eax, 4(%r15)
LBB0_5:
	movq	_HCI_CONN_RSWITCH_PEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_clear_bit
	movl	8(%rbx), %esi
	movq	(%rbx), %rdx
	movq	%r15, %rdi
	callq	_hci_role_switch_cfm
LBB0_6:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hci_dev_unlock                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s status %d"

	.comm	_ACL_LINK,4,2                   ## @ACL_LINK
	.comm	_HCI_LM_MASTER,4,2              ## @HCI_LM_MASTER
	.comm	_HCI_CONN_RSWITCH_PEND,4,2      ## @HCI_CONN_RSWITCH_PEND
	.no_dead_strip	_hci_role_change_evt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hci_role_change_evt
_hci_role_change_evt:                   ; @hci_role_change_evt
	.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
	ldr	x21, [x1]
	ldr	w1, [x0]
	ldr	w2, [x21, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
	mov	x0, x19
	bl	_hci_dev_lock
Lloh2:
	adrp	x8, _ACL_LINK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ACL_LINK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, x21, #12
	mov	x0, x19
	bl	_hci_conn_hash_lookup_ba
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x0
	ldr	w8, [x21, #8]
	cbnz	w8, LBB0_6
; %bb.2:
	ldr	x9, [x21]
Lloh5:
	adrp	x8, _HCI_LM_MASTER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HCI_LM_MASTER@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cbz	x9, LBB0_4
; %bb.3:
	ldr	w9, [x20, #4]
	bic	w8, w9, w8
	b	LBB0_5
LBB0_4:
	ldr	w9, [x20, #4]
	orr	w8, w9, w8
LBB0_5:
	str	w8, [x20, #4]
LBB0_6:
Lloh8:
	adrp	x8, _HCI_CONN_RSWITCH_PEND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HCI_CONN_RSWITCH_PEND@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_clear_bit
	ldr	w1, [x21, #8]
	ldr	x2, [x21]
	mov	x0, x20
	bl	_hci_role_switch_cfm
LBB0_7:
	mov	x0, x19
	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
	b	_hci_dev_unlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s status %d"

	.comm	_ACL_LINK,4,2                   ; @ACL_LINK
	.comm	_HCI_LM_MASTER,4,2              ; @HCI_LM_MASTER
	.comm	_HCI_CONN_RSWITCH_PEND,4,2      ; @HCI_CONN_RSWITCH_PEND
	.no_dead_strip	_hci_role_change_evt
.subsections_via_symbols
