	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_process_outgoing_tun           ## -- Begin function process_outgoing_tun
	.p2align	4, 0x90
_process_outgoing_tun:                  ## @process_outgoing_tun
	.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
	movq	%rdi, %r12
	xorl	%eax, %eax
	callq	_gc_new
	movl	%eax, -48(%rbp)
	cmpq	$0, 8(%r12)
	jle	LBB0_9
## %bb.1:
	leaq	8(%r12), %r14
	movq	_PERF_PROC_OUT_TUN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_perf_push
	movq	_PIP_MSSFIX@GOTPCREL(%rip), %rax
	movq	_PIPV4_EXTRACT_DHCP_ROUTER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_PIPV4_CLIENT_NAT@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_PIP_OUTGOING@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_process_ip_header
	movq	8(%r12), %r15
	leaq	16(%r12), %rbx
	movq	%rbx, %rdi
	callq	_MAX_RW_SIZE_TUN
	cmpq	%rax, %r15
	jle	LBB0_2
## %bb.7:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	(%r14), %r12
	movq	%rbx, %rdi
	callq	_MAX_RW_SIZE_TUN
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edi
	movq	%r12, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_msg
	jmp	LBB0_8
LBB0_2:
	movq	_D_TUN_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_BLEN
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_dmsg
	movq	32(%r12), %r15
	movq	%r14, %rdi
	callq	_BPTR
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_BLEN
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_write_tun
	movl	%eax, %r15d
	testl	%eax, %eax
	jle	LBB0_6
## %bb.3:
	addl	%r15d, (%r12)
	movq	32(%r12), %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_check_status
	movq	%r14, %rdi
	callq	_BLEN
	cmpl	%eax, %r15d
	je	LBB0_5
## %bb.4:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	32(%r12), %rax
	movslq	(%rax), %r13
	movq	%r14, %rdi
	callq	_BLEN
	movslq	%eax, %rcx
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	movq	%r13, %rdx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_msg
LBB0_5:
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_register_activity
	jmp	LBB0_8
LBB0_6:
	movq	32(%r12), %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_check_status
LBB0_8:
	movq	%r14, %rdi
	callq	_buf_reset
	xorl	%eax, %eax
	callq	_perf_pop
	leaq	-48(%rbp), %rdi
	callq	_gc_free
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PERF_PROC_OUT_TUN,4,2          ## @PERF_PROC_OUT_TUN
	.comm	_PIP_MSSFIX,4,2                 ## @PIP_MSSFIX
	.comm	_PIPV4_EXTRACT_DHCP_ROUTER,4,2  ## @PIPV4_EXTRACT_DHCP_ROUTER
	.comm	_PIPV4_CLIENT_NAT,4,2           ## @PIPV4_CLIENT_NAT
	.comm	_PIP_OUTGOING,4,2               ## @PIP_OUTGOING
	.comm	_D_TUN_RW,4,2                   ## @D_TUN_RW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TUN WRITE [%d]"

L_.str.1:                               ## @.str.1
	.asciz	"write to TUN/TAP"

	.comm	_D_LINK_ERRORS,4,2              ## @D_LINK_ERRORS
L_.str.2:                               ## @.str.2
	.asciz	"TUN/TAP packet was destructively fragmented on write to %s (tried=%d,actual=%d)"

L_.str.3:                               ## @.str.3
	.asciz	"tun packet too large on write (tried=%d,max=%d)"

	.comm	_stderr,4,2                     ## @stderr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_process_outgoing_tun           ; -- Begin function process_outgoing_tun
	.p2align	2
_process_outgoing_tun:                  ; @process_outgoing_tun
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
	bl	_gc_new
	str	w0, [sp, #8]
	mov	x19, x20
	ldr	x8, [x19, #8]!
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _PERF_PROC_OUT_TUN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PERF_PROC_OUT_TUN@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_perf_push
Lloh3:
	adrp	x8, _PIP_MSSFIX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PIP_MSSFIX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _PIPV4_EXTRACT_DHCP_ROUTER@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PIPV4_EXTRACT_DHCP_ROUTER@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _PIPV4_CLIENT_NAT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PIPV4_CLIENT_NAT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _PIP_OUTGOING@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PIP_OUTGOING@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x20
	mov	x2, x19
	bl	_process_ip_header
	ldr	x22, [x20, #8]
	add	x21, x20, #16
	mov	x0, x21
	bl	_MAX_RW_SIZE_TUN
	cmp	x22, x0
	b.le	LBB0_3
; %bb.2:
Lloh15:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh17:
	ldr	w20, [x8]
	ldr	x22, [x19]
	mov	x0, x21
	bl	_MAX_RW_SIZE_TUN
	mov	x3, x0
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_msg
	b	LBB0_8
LBB0_3:
Lloh20:
	adrp	x8, _D_TUN_RW@GOTPAGE
Lloh21:
	ldr	x8, [x8, _D_TUN_RW@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_BLEN
	mov	x2, x0
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dmsg
	ldr	x21, [x20, #32]
	mov	x0, x19
	bl	_BPTR
	mov	x22, x0
	mov	x0, x19
	bl	_BLEN
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_write_tun
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.4:
	ldr	w8, [x20]
	add	w8, w8, w21
	str	w8, [x20]
	ldr	x3, [x20, #32]
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, #0
	bl	_check_status
	mov	x0, x19
	bl	_BLEN
	cmp	w21, w0
	b.eq	LBB0_6
; %bb.5:
Lloh27:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh29:
	ldr	w22, [x8]
	ldr	x8, [x20, #32]
	ldrsw	x23, [x8]
	mov	x0, x19
	bl	_BLEN
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x3, w0
	str	x21, [sp]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_msg
LBB0_6:
	mov	x0, x20
	mov	x1, x21
	bl	_register_activity
	b	LBB0_8
LBB0_7:
	ldr	x3, [x20, #32]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, #0
	bl	_check_status
LBB0_8:
	mov	x0, x19
	bl	_buf_reset
	bl	_perf_pop
	add	x0, sp, #8
	bl	_gc_free
LBB0_9:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_PERF_PROC_OUT_TUN,4,2          ; @PERF_PROC_OUT_TUN
	.comm	_PIP_MSSFIX,4,2                 ; @PIP_MSSFIX
	.comm	_PIPV4_EXTRACT_DHCP_ROUTER,4,2  ; @PIPV4_EXTRACT_DHCP_ROUTER
	.comm	_PIPV4_CLIENT_NAT,4,2           ; @PIPV4_CLIENT_NAT
	.comm	_PIP_OUTGOING,4,2               ; @PIP_OUTGOING
	.comm	_D_TUN_RW,4,2                   ; @D_TUN_RW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TUN WRITE [%d]"

l_.str.1:                               ; @.str.1
	.asciz	"write to TUN/TAP"

	.comm	_D_LINK_ERRORS,4,2              ; @D_LINK_ERRORS
l_.str.2:                               ; @.str.2
	.asciz	"TUN/TAP packet was destructively fragmented on write to %s (tried=%d,actual=%d)"

l_.str.3:                               ; @.str.3
	.asciz	"tun packet too large on write (tried=%d,max=%d)"

	.comm	_stderr,4,2                     ; @stderr
.subsections_via_symbols
