	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btuart_open
_btuart_open:                           ## @btuart_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	%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	%rdi, %r15
	movq	16(%rdi), %rax
	movl	4(%rax), %r13d
	leaq	8(%rdi), %r12
	movq	%r12, %rdi
	callq	_spin_lock_init
	leaq	44(%r15), %rdi
	callq	_skb_queue_head_init
	movq	_RECV_WAIT_PACKET_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r15)
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_hci_alloc_dev
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, (%r15)
	movq	_HCI_PCCARD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	%r15, 32(%rbx)
	movq	16(%r15), %rsi
	movq	%rbx, %rdi
	callq	_SET_HCIDEV_DEV
	movq	_btuart_hci_open@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_btuart_hci_close@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_btuart_hci_flush@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_btuart_hci_send_frame@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_btuart_hci_destruct@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_btuart_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	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	_UART_MCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	xorl	%edi, %edi
	callq	_outb
	movq	_UART_IER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	xorl	%edi, %edi
	callq	_outb
	movq	_UART_LCR_WLEN8@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_UART_LCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	callq	_outb
	movq	_UART_MCR_DTR@GOTPCREL(%rip), %rax
	movq	_UART_MCR_RTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_UART_MCR_OUT2@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_UART_MCR@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	movq	%r13, %rsi
	callq	_outb
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	_DEFAULT_BAUD_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_btuart_change_speed
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep
	movq	%rbx, %rdi
	callq	_hci_register_dev
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_BT_ERR
	movq	$0, (%r15)
	movq	%rbx, %rdi
	callq	_hci_free_dev
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_BT_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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	_btuart_hci_open,4,2            ## @btuart_hci_open
	.comm	_btuart_hci_close,4,2           ## @btuart_hci_close
	.comm	_btuart_hci_flush,4,2           ## @btuart_hci_flush
	.comm	_btuart_hci_send_frame,4,2      ## @btuart_hci_send_frame
	.comm	_btuart_hci_destruct,4,2        ## @btuart_hci_destruct
	.comm	_btuart_hci_ioctl,4,2           ## @btuart_hci_ioctl
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_UART_MCR,8,3                   ## @UART_MCR
	.comm	_UART_IER,8,3                   ## @UART_IER
	.comm	_UART_LCR_WLEN8,4,2             ## @UART_LCR_WLEN8
	.comm	_UART_LCR,8,3                   ## @UART_LCR
	.comm	_UART_MCR_DTR,4,2               ## @UART_MCR_DTR
	.comm	_UART_MCR_RTS,4,2               ## @UART_MCR_RTS
	.comm	_UART_MCR_OUT2,4,2              ## @UART_MCR_OUT2
	.comm	_DEFAULT_BAUD_RATE,4,2          ## @DEFAULT_BAUD_RATE
L_.str.1:                               ## @.str.1
	.asciz	"Can't register HCI device"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_btuart_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btuart_open
_btuart_open:                           ; @btuart_open
	.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	x19, x0
	ldr	x8, [x0, #16]
	ldr	w22, [x8, #4]
	add	x21, x0, #8
	mov	x0, x21
	bl	_spin_lock_init
	add	x0, x19, #44
	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, #40]
	stp	xzr, xzr, [x19, #24]
	bl	_hci_alloc_dev
	cbz	x0, LBB0_3
; %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, #16]
	bl	_SET_HCIDEV_DEV
Lloh6:
	adrp	x8, _btuart_hci_open@GOTPAGE
Lloh7:
	ldr	x8, [x8, _btuart_hci_open@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x20, #24]
Lloh9:
	adrp	x8, _btuart_hci_close@GOTPAGE
Lloh10:
	ldr	x8, [x8, _btuart_hci_close@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _btuart_hci_flush@GOTPAGE
Lloh13:
	ldr	x9, [x9, _btuart_hci_flush@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #16]
Lloh15:
	adrp	x8, _btuart_hci_send_frame@GOTPAGE
Lloh16:
	ldr	x8, [x8, _btuart_hci_send_frame@GOTPAGEOFF]
Lloh17:
	adrp	x9, _btuart_hci_destruct@GOTPAGE
Lloh18:
	ldr	x9, [x9, _btuart_hci_destruct@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #8]
Lloh21:
	adrp	x8, _btuart_hci_ioctl@GOTPAGE
Lloh22:
	ldr	x8, [x8, _btuart_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]
	mov	x0, x21
	bl	_spin_lock_irqsave
Lloh27:
	adrp	x23, _UART_MCR@GOTPAGE
Lloh28:
	ldr	x23, [x23, _UART_MCR@GOTPAGEOFF]
	ldr	x8, [x23]
	add	x1, x8, x22
	mov	w0, #0
	bl	_outb
Lloh29:
	adrp	x8, _UART_IER@GOTPAGE
Lloh30:
	ldr	x8, [x8, _UART_IER@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	add	x1, x8, x22
	mov	w0, #0
	bl	_outb
Lloh32:
	adrp	x8, _UART_LCR_WLEN8@GOTPAGE
Lloh33:
	ldr	x8, [x8, _UART_LCR_WLEN8@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
Lloh35:
	adrp	x8, _UART_LCR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _UART_LCR@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	add	x1, x8, x22
	bl	_outb
Lloh38:
	adrp	x8, _UART_MCR_DTR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _UART_MCR_DTR@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
Lloh41:
	adrp	x9, _UART_MCR_RTS@GOTPAGE
Lloh42:
	ldr	x9, [x9, _UART_MCR_RTS@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh44:
	adrp	x9, _UART_MCR_OUT2@GOTPAGE
Lloh45:
	ldr	x9, [x9, _UART_MCR_OUT2@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x23]
	add	x1, x8, x22
	bl	_outb
	mov	x0, x21
	bl	_spin_unlock_irqrestore
Lloh47:
	adrp	x8, _DEFAULT_BAUD_RATE@GOTPAGE
Lloh48:
	ldr	x8, [x8, _DEFAULT_BAUD_RATE@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_btuart_change_speed
	mov	w0, #1000
	bl	_msleep
	mov	x0, x20
	bl	_hci_register_dev
	mov	x8, x0
	mov	w0, #0
	tbz	x8, #63, LBB0_5
; %bb.2:
Lloh50:
	adrp	x0, l_.str.1@PAGE
Lloh51:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_ERR
	str	xzr, [x19]
	mov	x0, x20
	bl	_hci_free_dev
Lloh52:
	adrp	x8, _ENODEV@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh54:
	adrp	x0, l_.str@PAGE
Lloh55:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_ERR
Lloh56:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh57:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh56, Lloh57
	.loh AdrpAdd	Lloh54, Lloh55
	.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	_btuart_hci_open,4,2            ; @btuart_hci_open
	.comm	_btuart_hci_close,4,2           ; @btuart_hci_close
	.comm	_btuart_hci_flush,4,2           ; @btuart_hci_flush
	.comm	_btuart_hci_send_frame,4,2      ; @btuart_hci_send_frame
	.comm	_btuart_hci_destruct,4,2        ; @btuart_hci_destruct
	.comm	_btuart_hci_ioctl,4,2           ; @btuart_hci_ioctl
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_UART_MCR,8,3                   ; @UART_MCR
	.comm	_UART_IER,8,3                   ; @UART_IER
	.comm	_UART_LCR_WLEN8,4,2             ; @UART_LCR_WLEN8
	.comm	_UART_LCR,8,3                   ; @UART_LCR
	.comm	_UART_MCR_DTR,4,2               ; @UART_MCR_DTR
	.comm	_UART_MCR_RTS,4,2               ; @UART_MCR_RTS
	.comm	_UART_MCR_OUT2,4,2              ; @UART_MCR_OUT2
	.comm	_DEFAULT_BAUD_RATE,4,2          ; @DEFAULT_BAUD_RATE
l_.str.1:                               ; @.str.1
	.asciz	"Can't register HCI device"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_btuart_open
.subsections_via_symbols
