	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bt3c_open
_bt3c_open:                             ## @bt3c_open
	.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
	addq	$40, %rdi
	callq	_spin_lock_init
	leaq	36(%r14), %rdi
	callq	_skb_queue_head_init
	movq	_RECV_WAIT_PACKET_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r14)
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_hci_alloc_dev
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, (%r14)
	movq	_HCI_PCCARD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	%r14, 32(%rbx)
	movq	8(%r14), %rsi
	movq	%rbx, %rdi
	callq	_SET_HCIDEV_DEV
	movq	_bt3c_hci_open@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_bt3c_hci_close@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_bt3c_hci_flush@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_bt3c_hci_send_frame@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_bt3c_hci_destruct@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_bt3c_hci_ioctl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	8(%r14), %rdx
	leaq	L_.str.1(%rip), %rsi
	leaq	-32(%rbp), %rdi
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%r14, %rdi
	callq	_bt3c_load_firmware
	movl	%eax, %r15d
	movq	-32(%rbp), %rdi
	callq	_release_firmware
	testl	%r15d, %r15d
	js	LBB0_5
## %bb.6:
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep
	movq	%rbx, %rdi
	callq	_hci_register_dev
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jns	LBB0_9
## %bb.7:
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %r15d
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_BT_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_9
LBB0_3:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
LBB0_8:
	callq	_BT_ERR
	movq	$0, (%r14)
	movq	%rbx, %rdi
	callq	_hci_free_dev
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RECV_WAIT_PACKET_TYPE,4,2      ## @RECV_WAIT_PACKET_TYPE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't allocate HCI device"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_HCI_PCCARD,4,2                 ## @HCI_PCCARD
	.comm	_bt3c_hci_open,4,2              ## @bt3c_hci_open
	.comm	_bt3c_hci_close,4,2             ## @bt3c_hci_close
	.comm	_bt3c_hci_flush,4,2             ## @bt3c_hci_flush
	.comm	_bt3c_hci_send_frame,4,2        ## @bt3c_hci_send_frame
	.comm	_bt3c_hci_destruct,4,2          ## @bt3c_hci_destruct
	.comm	_bt3c_hci_ioctl,4,2             ## @bt3c_hci_ioctl
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
L_.str.1:                               ## @.str.1
	.asciz	"BT3CPCC.bin"

L_.str.2:                               ## @.str.2
	.asciz	"Firmware request failed"

L_.str.3:                               ## @.str.3
	.asciz	"Firmware loading failed"

L_.str.4:                               ## @.str.4
	.asciz	"Can't register HCI device"

	.no_dead_strip	_bt3c_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bt3c_open
_bt3c_open:                             ; @bt3c_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	add	x0, x0, #40
	bl	_spin_lock_init
	add	x0, x19, #36
	bl	_skb_queue_head_init
Lloh0:
	adrp	x8, _RECV_WAIT_PACKET_TYPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RECV_WAIT_PACKET_TYPE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	stp	xzr, xzr, [x19, #16]
	bl	_hci_alloc_dev
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	str	x0, [x19]
Lloh3:
	adrp	x8, _HCI_PCCARD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HCI_PCCARD@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #40]
	str	x19, [x0, #32]
	ldr	x1, [x19, #8]
	bl	_SET_HCIDEV_DEV
Lloh6:
	adrp	x8, _bt3c_hci_open@GOTPAGE
Lloh7:
	ldr	x8, [x8, _bt3c_hci_open@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _bt3c_hci_close@GOTPAGE
Lloh10:
	ldr	x9, [x9, _bt3c_hci_close@GOTPAGEOFF]
	str	w8, [x20, #24]
Lloh11:
	ldr	w8, [x9]
Lloh12:
	adrp	x9, _bt3c_hci_flush@GOTPAGE
Lloh13:
	ldr	x9, [x9, _bt3c_hci_flush@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #16]
Lloh15:
	adrp	x8, _bt3c_hci_send_frame@GOTPAGE
Lloh16:
	ldr	x8, [x8, _bt3c_hci_send_frame@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _bt3c_hci_destruct@GOTPAGE
Lloh19:
	ldr	x9, [x9, _bt3c_hci_destruct@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #8]
Lloh21:
	adrp	x8, _bt3c_hci_ioctl@GOTPAGE
Lloh22:
	ldr	x8, [x8, _bt3c_hci_ioctl@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _THIS_MODULE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _THIS_MODULE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	stp	w9, w8, [x20]
	ldr	x2, [x19, #8]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_request_firmware
	tbnz	w0, #31, LBB0_6
; %bb.2:
	ldr	x8, [sp, #8]
	ldp	w2, w1, [x8]
	mov	x0, x19
	bl	_bt3c_load_firmware
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_release_firmware
	tbnz	w21, #31, LBB0_7
; %bb.3:
	mov	w0, #1000
	bl	_msleep
	mov	x0, x20
	bl	_hci_register_dev
	tbnz	w0, #31, LBB0_8
; %bb.4:
	mov	w21, #0
	b	LBB0_10
LBB0_5:
Lloh29:
	adrp	x0, l_.str@PAGE
Lloh30:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_ERR
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_6:
	mov	x21, x0
Lloh34:
	adrp	x0, l_.str.2@PAGE
Lloh35:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh36:
	adrp	x0, l_.str.3@PAGE
Lloh37:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_8:
	mov	x21, x0
Lloh38:
	adrp	x0, l_.str.4@PAGE
Lloh39:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_9:
	bl	_BT_ERR
	str	xzr, [x19]
	mov	x0, x20
	bl	_hci_free_dev
LBB0_10:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_RECV_WAIT_PACKET_TYPE,4,2      ; @RECV_WAIT_PACKET_TYPE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't allocate HCI device"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_HCI_PCCARD,4,2                 ; @HCI_PCCARD
	.comm	_bt3c_hci_open,4,2              ; @bt3c_hci_open
	.comm	_bt3c_hci_close,4,2             ; @bt3c_hci_close
	.comm	_bt3c_hci_flush,4,2             ; @bt3c_hci_flush
	.comm	_bt3c_hci_send_frame,4,2        ; @bt3c_hci_send_frame
	.comm	_bt3c_hci_destruct,4,2          ; @bt3c_hci_destruct
	.comm	_bt3c_hci_ioctl,4,2             ; @bt3c_hci_ioctl
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
l_.str.1:                               ; @.str.1
	.asciz	"BT3CPCC.bin"

l_.str.2:                               ; @.str.2
	.asciz	"Firmware request failed"

l_.str.3:                               ; @.str.3
	.asciz	"Firmware loading failed"

l_.str.4:                               ; @.str.4
	.asciz	"Can't register HCI device"

	.no_dead_strip	_bt3c_open
.subsections_via_symbols
