	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ppp_connect_channel
_ppp_connect_channel:                   ## @ppp_connect_channel
	.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
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movl	40(%rdi), %edi
	callq	_ppp_pernet
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_ppp_find_unit
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_write_lock_bh
	cmpq	$0, 8(%r15)
	je	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movl	%r13d, %ebx
	jmp	LBB0_10
LBB0_3:
	movq	%r12, %rdi
	callq	_ppp_lock
	leaq	32(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_bh
	movl	36(%r15), %r13d
	movq	%rbx, %rdi
	callq	_spin_unlock_bh
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.5:
	movq	24(%r15), %rax
	cmpq	(%r12), %rax
	jle	LBB0_7
## %bb.6:
	movq	%rax, (%r12)
LBB0_7:
	addl	$2, %eax
	movq	24(%r12), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_9
## %bb.8:
	movl	%eax, (%rcx)
LBB0_9:
	leaq	16(%r15), %rdi
	leaq	20(%r12), %rsi
	callq	_list_add_tail
	incl	16(%r12)
	movq	%r12, 8(%r15)
	movq	%r12, %rdi
	addq	$8, %rdi
	callq	_refcount_inc
	movq	%r12, %rdi
	callq	_ppp_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_4:
	movq	%r12, %rdi
	callq	_ppp_unlock
	movq	_ENOTCONN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movq	%r15, %rdi
	callq	_write_unlock_bh
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOTCONN,4,2                   ## @ENOTCONN
	.no_dead_strip	_ppp_connect_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ppp_connect_channel
_ppp_connect_channel:                   ; @ppp_connect_channel
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	ldr	w0, [x0, #40]
	bl	_ppp_pernet
	mov	x19, x0
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x21
	bl	_ppp_find_unit
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	mov	x0, x20
	bl	_write_lock_bh
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_4:
	neg	w21, w22
	b	LBB0_12
LBB0_5:
	mov	x0, x21
	bl	_ppp_lock
	add	x22, x20, #32
	mov	x0, x22
	bl	_spin_lock_bh
	ldr	w23, [x20, #36]
	mov	x0, x22
	bl	_spin_unlock_bh
	cbz	w23, LBB0_13
; %bb.6:
	ldr	x8, [x20, #24]
	ldr	x9, [x21]
	cmp	x8, x9
	b.le	LBB0_8
; %bb.7:
	str	x8, [x21]
LBB0_8:
	add	w8, w8, #2
	ldr	x9, [x21, #24]
	ldr	w10, [x9]
	cmp	w8, w10
	b.le	LBB0_10
; %bb.9:
	str	w8, [x9]
LBB0_10:
	add	x0, x20, #16
	add	x1, x21, #20
	bl	_list_add_tail
	ldr	w8, [x21, #16]
	add	w8, w8, #1
	str	w8, [x21, #16]
	str	x21, [x20, #8]
	add	x0, x21, #8
	bl	_refcount_inc
	mov	x0, x21
	bl	_ppp_unlock
	mov	w21, #0
LBB0_11:
	mov	x0, x20
	bl	_write_unlock_bh
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	x0, x21
	bl	_ppp_unlock
Lloh5:
	adrp	x8, _ENOTCONN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOTCONN@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOTCONN,4,2                   ; @ENOTCONN
	.no_dead_strip	_ppp_connect_channel
.subsections_via_symbols
