	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_tty
_add_tty:                               ## @add_tty
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r15d
	movq	%rcx, %r12
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movq	_ttys@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movslq	%ebx, %rbx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r13), %rax
	movq	(%rax,%rbx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_1
## %bb.2:
	movl	16(%rbp), %edx
	movl	%ebx, (%rcx)
	movq	%r14, 32(%rcx)
	movq	(%rax,%rbx,8), %rcx
	movl	%r15d, 4(%rcx)
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, 8(%rcx)
	movq	%r12, 24(%rcx)
	movq	(%rax,%rbx,8), %rdi
	movl	%edx, 12(%rdi)
	addq	$16, %rdi
	callq	_mutex_init
	movq	_ipw_tty_driver@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_tty_register_device
	movq	(%r13), %rax
	movq	(%rax,%rbx,8), %rdx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_ipwireless_associate_network_tty
	cmpl	$-1, %r14d
	je	LBB0_4
## %bb.3:
	movq	(%r13), %rax
	movq	(%rax,%rbx,8), %rdx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ipwireless_associate_network_tty
LBB0_4:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	je	LBB0_5
## %bb.6:
	movl	12(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_sprintf
	movq	_ipw_tty_driver@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	8(%rax), %ecx
	movl	%ecx, 8(%r15)
	movq	(%rax), %rdi
	addq	%rbx, %rdi
	movq	%rdi, (%r15)
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_9
LBB0_5:
	movq	_ipw_tty_driver@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdi
	addq	%rbx, %rdi
LBB0_7:
	callq	_get_tty
	movq	(%r13), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx,%rbx,8), %rax
	jne	LBB0_9
## %bb.8:
	movq	%rax, %rdi
	callq	_report_registering
LBB0_9:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ttys,8,3                       ## @ttys
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ipw_tty_driver,8,3             ## @ipw_tty_driver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ttyIPWp%d"

	.no_dead_strip	_add_tty
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_tty
_add_tty:                               ; @add_tty
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x6
	mov	x21, x5
	mov	x23, x4
	mov	x22, x3
	mov	x25, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
Lloh3:
	adrp	x26, _ttys@GOTPAGE
Lloh4:
	ldr	x26, [x26, _ttys@GOTPAGEOFF]
	ldr	x8, [x26]
	sbfiz	x9, x20, #3, #32
	str	x0, [x8, x9]
	ldr	x8, [x26]
	ldr	x9, [x8, x9]
	cbz	x9, LBB0_5
; %bb.1:
	sxtw	x27, w20
	str	w20, [x9]
	str	x25, [x9, #32]
	lsl	x25, x27, #3
	ldr	x9, [x8, x25]
	stp	w23, w21, [x9, #4]
	str	x22, [x9, #24]
	ldr	x8, [x8, x25]
	str	w24, [x8, #12]
	add	x0, x8, #16
	bl	_mutex_init
Lloh5:
	adrp	x24, _ipw_tty_driver@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ipw_tty_driver@GOTPAGEOFF]
	ldr	x0, [x24]
	mov	x1, x20
	mov	x2, #0
	bl	_tty_register_device
	ldr	x8, [x26]
	ldr	x2, [x8, x25]
	mov	x0, x22
	mov	x1, x23
	bl	_ipwireless_associate_network_tty
	cmn	w21, #1
	b.eq	LBB0_3
; %bb.2:
	ldr	x8, [x26]
	ldr	x2, [x8, x27, lsl #3]
	mov	x0, x22
	mov	x1, x21
	bl	_ipwireless_associate_network_tty
LBB0_3:
	cbz	x19, LBB0_6
; %bb.4:
	ldr	w0, [x19, #12]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_sprintf
	ldr	x8, [x24]
	ldr	w9, [x8, #8]
	str	w9, [x19, #8]
	ldr	x8, [x8]
	add	x0, x8, x27
	str	x0, [x19]
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_6:
	ldr	x8, [x24]
	ldr	x8, [x8]
	add	x0, x8, x27
LBB0_7:
	bl	_get_tty
	ldr	x8, [x26]
	ldr	x8, [x8, x27, lsl #3]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:
	bl	_report_registering
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ttys,8,3                       ; @ttys
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ipw_tty_driver,8,3             ; @ipw_tty_driver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ttyIPWp%d"

	.no_dead_strip	_add_tty
.subsections_via_symbols
