	.file	"extr_ppp_generic.c_ppp_connect_channel.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ppp_connect_channel, @function
ppp_connect_channel:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edi, DWORD PTR 32[rdi]
	mov	ebx, DWORD PTR ENXIO[rip]
	call	ppp_pernet@PLT
	neg	ebx
	mov	r12, rax
	mov	rdi, rax
	call	mutex_lock@PLT
	mov	esi, r13d
	mov	rdi, r12
	mov	r13d, ebx
	call	ppp_find_unit@PLT
	test	rax, rax
	je	.L3
	mov	rdi, rbp
	mov	r13, rax
	call	write_lock_bh@PLT
	cmp	QWORD PTR 8[rbp], 0
	je	.L4
	mov	r13d, DWORD PTR EINVAL[rip]
	neg	r13d
.L5:
	mov	rdi, rbp
	call	write_unlock_bh@PLT
.L3:
	mov	rdi, r12
	call	mutex_unlock@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rdi, r13
	call	ppp_lock@PLT
	mov	rax, QWORD PTR 24[rbp]
	cmp	rax, QWORD PTR 0[r13]
	jle	.L6
	mov	QWORD PTR 0[r13], rax
.L6:
	mov	rdx, QWORD PTR 24[r13]
	add	eax, 2
	cmp	DWORD PTR [rdx], eax
	jge	.L7
	mov	DWORD PTR [rdx], eax
.L7:
	lea	rsi, 20[r13]
	lea	rdi, 16[rbp]
	call	list_add_tail@PLT
	add	DWORD PTR 16[r13], 1
	lea	rdi, 8[r13]
	mov	QWORD PTR 8[rbp], r13
	call	atomic_inc@PLT
	mov	rdi, r13
	xor	r13d, r13d
	call	ppp_unlock@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	ppp_connect_channel, .-ppp_connect_channel
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ppp_generic.c_ppp_connect_channel.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ppp_connect_channel, %function
ppp_connect_channel:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L10
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r0, [r0, #16]
	mov	r6, r1
	ldr	r5, [r3]
	bl	ppp_pernet
	mov	r7, r0
	bl	mutex_lock
	mov	r1, r6
	mov	r0, r7
	bl	ppp_find_unit
	subs	r6, r0, #0
	rsbeq	r5, r5, #0
	beq	.L3
	mov	r0, r4
	bl	write_lock_bh
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L10+4
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L5:
	mov	r0, r4
	bl	write_unlock_bh
.L3:
	mov	r0, r7
	bl	mutex_unlock
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	mov	r0, r6
	bl	ppp_lock
	ldr	r3, [r4, #12]
	ldr	r2, [r6]
	add	r0, r4, #8
	cmp	r3, r2
	ldr	r2, [r6, #16]
	strgt	r3, [r6]
	ldr	r1, [r2]
	add	r3, r3, #2
	cmp	r1, r3
	strlt	r3, [r2]
	add	r1, r6, #12
	bl	list_add_tail
	ldr	r3, [r6, #8]
	add	r0, r6, #4
	add	r3, r3, #1
	str	r3, [r6, #8]
	str	r6, [r4, #4]
	bl	atomic_inc
	mov	r0, r6
	bl	ppp_unlock
	mov	r5, #0
	b	.L5
.L11:
	.align	2
.L10:
	.word	ENXIO
	.word	EINVAL
	.size	ppp_connect_channel, .-ppp_connect_channel
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
