	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_uart_tty_open
_hci_uart_tty_open:                     ## @hci_uart_tty_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_BT_DBG
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	movq	_EEXIST@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	movq	24(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, 16(%r14)
	movq	%r14, 8(%rax)
	movl	$65536, (%r14)                  ## imm = 0x10000
	movq	%rax, %rdi
	callq	_spin_lock_init
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	callq	*%rax
LBB0_9:
	movq	%r14, %rdi
	callq	_tty_driver_flush_buffer
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_4:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	callq	_BT_ERR
	movq	_ENFILE@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tty %p"

	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Can't allocate control structure"

	.comm	_ENFILE,4,2                     ## @ENFILE
	.no_dead_strip	_hci_uart_tty_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hci_uart_tty_open
_hci_uart_tty_open:                     ; @hci_uart_tty_open
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BT_DBG
	cbz	x20, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _EEXIST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.5:
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.6:
	str	x0, [x19, #16]
	str	x19, [x0, #8]
	mov	w8, #65536
	str	w8, [x19]
	bl	_spin_lock_init
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x19
	blr	x8
LBB0_8:
	mov	x0, x19
	bl	_tty_driver_flush_buffer
	mov	w0, #0
	b	LBB0_3
LBB0_9:
Lloh7:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_2
LBB0_10:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_ERR
Lloh11:
	adrp	x8, _ENFILE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENFILE@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tty %p"

	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Can't allocate control structure"

	.comm	_ENFILE,4,2                     ; @ENFILE
	.no_dead_strip	_hci_uart_tty_open
.subsections_via_symbols
