	.file	"extr_ng_frame_relay.c_ngfrm_newhook.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ngfrm_newhook, @function
ngfrm_newhook:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	NG_NODE_PRIVATE@PLT
	mov	esi, DWORD PTR NG_FRAMERELAY_HOOK_DEBUG[rip]
	mov	rdi, rbp
	mov	rbx, rax
	call	strcmp@PLT
	test	rax, rax
	je	.L20
	mov	edi, DWORD PTR NG_FRAMERELAY_HOOK_DLCI[rip]
	call	strlen@PLT
	mov	esi, DWORD PTR NG_FRAMERELAY_HOOK_DLCI[rip]
	mov	rdi, rbp
	mov	edx, eax
	call	strncmp@PLT
	test	rax, rax
	je	.L4
	mov	esi, DWORD PTR NG_FRAMERELAY_HOOK_DOWNSTREAM[rip]
	mov	rdi, rbp
	call	strcmp@PLT
	test	rax, rax
	jne	.L9
	cmp	QWORD PTR 24[rbx], 0
	je	.L6
.L18:
	mov	eax, DWORD PTR EADDRINUSE[rip]
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L21
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	edi, DWORD PTR NG_FRAMERELAY_HOOK_DLCI[rip]
	call	strlen@PLT
	cdqe
	add	rbp, rax
	movsx	edi, BYTE PTR 0[rbp]
	call	isdigit@PLT
	test	eax, eax
	je	.L9
	cmp	BYTE PTR 0[rbp], 48
	jne	.L8
	cmp	BYTE PTR 1[rbp], 0
	jne	.L9
.L8:
	mov	edx, 10
	mov	rsi, rsp
	mov	rdi, rbp
	call	strtoul@PLT
	mov	rdx, QWORD PTR [rsp]
	cmp	BYTE PTR [rdx], 0
	jne	.L9
	cmp	eax, 1023
	ja	.L9
	mov	esi, eax
	mov	rdi, rbx
	call	ngfrm_allocate_CTX@PLT
	cmp	eax, -1
	je	.L22
	cdqe
	mov	rsi, QWORD PTR 8[rbx]
	lea	rbp, [rax+rax*2]
	sal	rbp, 3
	add	rsi, rbp
	cmp	QWORD PTR 8[rsi], 0
	jne	.L18
	mov	eax, DWORD PTR CHAN_ACTIVE[rip]
	or	DWORD PTR 16[rsi], eax
	mov	rdi, r12
	call	NG_HOOK_SET_PRIVATE@PLT
	mov	rax, QWORD PTR 8[rbx]
	mov	QWORD PTR 8[rax+rbp], r12
	xor	eax, eax
	add	DWORD PTR [rbx], 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR EINVAL[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	xor	esi, esi
	mov	rdi, r12
	call	NG_HOOK_SET_PRIVATE@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	lea	rsi, 16[rbx]
	mov	rdi, r12
	call	NG_HOOK_SET_PRIVATE@PLT
	mov	eax, DWORD PTR CHAN_ACTIVE[rip]
	mov	QWORD PTR 24[rbx], r12
	or	DWORD PTR 32[rbx], eax
	xor	eax, eax
	add	DWORD PTR [rbx], 1
	mov	DWORD PTR 16[rbx], -1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	eax, DWORD PTR ENOBUFS[rip]
	jmp	.L1
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ngfrm_newhook, .-ngfrm_newhook
	.comm	NG_FRAMERELAY_HOOK_DOWNSTREAM,4,4
	.comm	NG_FRAMERELAY_HOOK_DLCI,4,4
	.comm	NG_FRAMERELAY_HOOK_DEBUG,4,4
	.comm	ENOBUFS,4,4
	.comm	EINVAL,4,4
	.comm	EADDRINUSE,4,4
	.comm	CHAN_ACTIVE,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_ng_frame_relay.c_ngfrm_newhook.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ngfrm_newhook, %function
ngfrm_newhook:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L26
	sub	sp, sp, #8
	mov	r5, r2
	mov	r7, r1
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	NG_NODE_PRIVATE
	ldr	ip, .L26+4
	mov	r6, r0
	ldr	r1, [ip]
	mov	r0, r5
	bl	strcmp
	subs	r4, r0, #0
	beq	.L23
	ldr	r8, .L26+8
	ldr	r4, [r8]
	mov	r0, r4
	bl	strlen
	mov	r1, r4
	mov	r2, r0
	mov	r0, r5
	bl	strncmp
	subs	r4, r0, #0
	beq	.L4
	ldr	r3, .L26+12
	mov	r0, r5
	ldr	r1, [r3]
	bl	strcmp
	subs	r4, r0, #0
	bne	.L9
	ldr	r3, [r6, #12]
	cmp	r3, #0
	beq	.L6
.L21:
	ldr	r3, .L26+16
	ldr	r4, [r3]
.L1:
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	ldr	r0, [r8]
	bl	strlen
	mov	r8, r0
	ldrb	r0, [r5, r0]	@ zero_extendqisi2
	bl	isdigit
	cmp	r0, #0
	add	r0, r5, r8
	beq	.L9
	ldrb	r3, [r5, r8]	@ zero_extendqisi2
	cmp	r3, #48
	bne	.L8
	ldrb	r3, [r0, #1]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L9
.L8:
	mov	r2, #10
	mov	r1, sp
	bl	strtoul
	ldr	r3, [sp]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L9
	cmp	r0, #1024
	bcs	.L9
	mov	r1, r0
	mov	r0, r6
	bl	ngfrm_allocate_CTX
	cmn	r0, #1
	beq	.L25
	ldr	r1, [r6, #4]
	add	r0, r0, r0, lsl #1
	add	r1, r1, r0, lsl #2
	ldr	r3, [r1, #4]
	lsl	r5, r0, #2
	cmp	r3, #0
	bne	.L21
	ldr	r2, .L26+20
	ldr	r3, [r1, #8]
	ldr	r2, [r2]
	mov	r0, r7
	orr	r3, r3, r2
	str	r3, [r1, #8]
	bl	NG_HOOK_SET_PRIVATE
	ldr	r3, [r6]
	ldr	r0, [r6, #4]
	add	r3, r3, #1
	add	r0, r0, r5
	str	r7, [r0, #4]
	str	r3, [r6]
	b	.L1
.L9:
	ldr	r3, .L26+24
	ldr	r4, [r3]
	b	.L1
.L23:
	mov	r0, r7
	mov	r1, r4
	bl	NG_HOOK_SET_PRIVATE
	b	.L1
.L6:
	add	r1, r6, #8
	mov	r0, r7
	bl	NG_HOOK_SET_PRIVATE
	mvn	r1, #0
	ldr	r3, .L26+20
	ldr	r2, [r6, #16]
	ldr	r0, [r3]
	ldr	r3, [r6]
	orr	r2, r2, r0
	add	r3, r3, #1
	str	r7, [r6, #12]
	str	r2, [r6, #16]
	str	r3, [r6]
	str	r1, [r6, #8]
	b	.L1
.L25:
	ldr	r3, .L26+28
	ldr	r4, [r3]
	b	.L1
.L24:
	bl	__stack_chk_fail
.L27:
	.align	2
.L26:
	.word	.LC0
	.word	NG_FRAMERELAY_HOOK_DEBUG
	.word	NG_FRAMERELAY_HOOK_DLCI
	.word	NG_FRAMERELAY_HOOK_DOWNSTREAM
	.word	EADDRINUSE
	.word	CHAN_ACTIVE
	.word	EINVAL
	.word	ENOBUFS
	.size	ngfrm_newhook, .-ngfrm_newhook
	.comm	NG_FRAMERELAY_HOOK_DOWNSTREAM,4,4
	.comm	NG_FRAMERELAY_HOOK_DLCI,4,4
	.comm	NG_FRAMERELAY_HOOK_DEBUG,4,4
	.comm	ENOBUFS,4,4
	.comm	EINVAL,4,4
	.comm	EADDRINUSE,4,4
	.comm	CHAN_ACTIVE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
