	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fr_add_pvc
_fr_add_pvc:                            ## @fr_add_pvc
	.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	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_dev_to_hdlc
	movq	%rax, %r14
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_add_pvc
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r13
	movq	%rax, %rdi
	movl	%r12d, %esi
	callq	_get_dev_p
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.2:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_netdev_warn
	movq	_ENOBUFS@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r14d, %r14d
LBB0_5:
	subl	(%rax), %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_pvc_is_used
	movq	_ARPHRD_ETHER@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_NET_NAME_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	movq	_pvc_setup@GOTPCREL(%rip), %rax
	cmoveq	_ether_setup@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r12d, %ebx
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_alloc_netdev
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rax, %r12
	movq	_ARPHRD_ETHER@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	movl	%ebx, %r14d
	jne	LBB0_11
## %bb.9:
	movq	_IFF_TX_SKB_SHARING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 16(%r12)
	movq	%r12, %rdi
	callq	_eth_hw_addr_random
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_netdev_warn
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_delete_unused_pvcs
	movq	_ENOBUFS@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_11:
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_htons
	movq	56(%r12), %rcx
	movl	%eax, (%rcx)
	movl	48(%r12), %edi
	movl	%ebx, %esi
	callq	_dlci_to_q922
LBB0_12:
	movq	_pvc_ops@GOTPCREL(%rip), %rax
	movq	%rax, 40(%r12)
	movq	_HDLC_MAX_MTU@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r12)
	movl	$68, (%r12)
	movq	%rax, 24(%r12)
	movq	_IFF_NO_QUEUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r12)
	movq	%r13, 8(%r12)
	movq	%r12, %rdi
	callq	_register_netdevice
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%r12, %rdi
	callq	_free_netdev
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_delete_unused_pvcs
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_14:
	movl	$1, 4(%r12)
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_get_dev_p
	movq	%r12, (%rax)
	xorl	%r14d, %r14d
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_6
## %bb.15:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_state
	movl	$1, (%rax)
	movq	%rbx, %rdi
	callq	_state
	incl	4(%rax)
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Memory squeeze on fr_add_pvc()\n"

	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_ARPHRD_ETHER,4,2               ## @ARPHRD_ETHER
L_.str.1:                               ## @.str.1
	.asciz	"pvceth%d"

	.comm	_NET_NAME_UNKNOWN,4,2           ## @NET_NAME_UNKNOWN
	.comm	_ether_setup,4,2                ## @ether_setup
L_.str.2:                               ## @.str.2
	.asciz	"pvc%d"

	.comm	_pvc_setup,4,2                  ## @pvc_setup
L_.str.3:                               ## @.str.3
	.asciz	"Memory squeeze on fr_pvc()\n"

	.comm	_IFF_TX_SKB_SHARING,4,2         ## @IFF_TX_SKB_SHARING
	.comm	_pvc_ops,4,2                    ## @pvc_ops
	.comm	_HDLC_MAX_MTU,8,3               ## @HDLC_MAX_MTU
	.comm	_IFF_NO_QUEUE,4,2               ## @IFF_NO_QUEUE
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_fr_add_pvc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fr_add_pvc
_fr_add_pvc:                            ; @fr_add_pvc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x23, x1
	mov	x25, x0
	bl	_dev_to_hdlc
	mov	x19, x0
	mov	x0, x25
	mov	x1, x23
	bl	_add_pvc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x1, x20
	bl	_get_dev_p
	ldr	x8, [x0]
	cbz	x8, LBB0_7
; %bb.2:
Lloh0:
	adrp	x8, _EEXIST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x25
	bl	_netdev_warn
LBB0_4:
Lloh4:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x21
	bl	_pvc_is_used
	mov	x22, x0
Lloh6:
	adrp	x26, _ARPHRD_ETHER@GOTPAGE
Lloh7:
	ldr	x26, [x26, _ARPHRD_ETHER@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh8:
	adrp	x9, _NET_NAME_UNKNOWN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NET_NAME_UNKNOWN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x9]
Lloh11:
	adrp	x9, l_.str.2@PAGE
Lloh12:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh13:
	adrp	x10, l_.str.1@PAGE
Lloh14:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	w8, w20
	csel	x1, x10, x9, eq
Lloh15:
	adrp	x8, _ether_setup@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ether_setup@GOTPAGEOFF]
Lloh17:
	adrp	x9, _pvc_setup@GOTPAGE
Lloh18:
	ldr	x9, [x9, _pvc_setup@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w3, [x8]
	mov	w0, #0
	bl	_alloc_netdev
	cbz	x0, LBB0_10
; %bb.8:
	mov	x24, x0
	ldr	w8, [x26]
	cmp	w8, w20
	b.ne	LBB0_11
; %bb.9:
Lloh19:
	adrp	x8, _IFF_TX_SKB_SHARING@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IFF_TX_SKB_SHARING@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x24, #16]
	bic	w8, w9, w8
	str	w8, [x24, #16]
	mov	x0, x24
	bl	_eth_hw_addr_random
	b	LBB0_12
LBB0_10:
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x25
	bl	_netdev_warn
	mov	x0, x19
	bl	_delete_unused_pvcs
	b	LBB0_4
LBB0_11:
	mov	x0, x23
	bl	_htons
	ldr	x8, [x24, #56]
	str	w0, [x8]
	ldr	w0, [x24, #48]
	mov	x1, x23
	bl	_dlci_to_q922
LBB0_12:
Lloh24:
	adrp	x8, _pvc_ops@GOTPAGE
Lloh25:
	ldr	x8, [x8, _pvc_ops@GOTPAGEOFF]
	str	x8, [x24, #40]
Lloh26:
	adrp	x8, _HDLC_MAX_MTU@GOTPAGE
Lloh27:
	ldr	x8, [x8, _HDLC_MAX_MTU@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	mov	w9, #68
	str	w9, [x24]
Lloh29:
	adrp	x9, _IFF_NO_QUEUE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _IFF_NO_QUEUE@GOTPAGEOFF]
	stp	x8, x8, [x24, #24]
Lloh31:
	ldr	w8, [x9]
	ldr	w9, [x24, #16]
	orr	w8, w9, w8
	str	w8, [x24, #16]
	str	x21, [x24, #8]
	mov	x0, x24
	bl	_register_netdevice
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x24
	bl	_free_netdev
	mov	x0, x19
	bl	_delete_unused_pvcs
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_5
LBB0_14:
	mov	w23, #1
	str	w23, [x24, #4]
	mov	x0, x21
	mov	x1, x20
	bl	_get_dev_p
	str	x24, [x0]
	cbz	w22, LBB0_16
; %bb.15:
	mov	w0, #0
	b	LBB0_6
LBB0_16:
	mov	x0, x19
	bl	_state
	str	w23, [x0]
	mov	x0, x19
	bl	_state
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x8, #4]
	add	w9, w9, #1
	str	w9, [x8, #4]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Memory squeeze on fr_add_pvc()\n"

	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_ARPHRD_ETHER,4,2               ; @ARPHRD_ETHER
l_.str.1:                               ; @.str.1
	.asciz	"pvceth%d"

	.comm	_NET_NAME_UNKNOWN,4,2           ; @NET_NAME_UNKNOWN
	.comm	_ether_setup,4,2                ; @ether_setup
l_.str.2:                               ; @.str.2
	.asciz	"pvc%d"

	.comm	_pvc_setup,4,2                  ; @pvc_setup
l_.str.3:                               ; @.str.3
	.asciz	"Memory squeeze on fr_pvc()\n"

	.comm	_IFF_TX_SKB_SHARING,4,2         ; @IFF_TX_SKB_SHARING
	.comm	_pvc_ops,4,2                    ; @pvc_ops
	.comm	_HDLC_MAX_MTU,8,3               ; @HDLC_MAX_MTU
	.comm	_IFF_NO_QUEUE,4,2               ; @IFF_NO_QUEUE
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_fr_add_pvc
.subsections_via_symbols
