	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tunstart
_tunstart:                              ## @tunstart
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	callq	_TUNDEBUG
	movq	%rbx, %rdi
	callq	_ALTQ_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_IFQ_LOCK
	movq	%rbx, %rdi
	callq	_IFQ_POLL_NOLOCK
	movq	%rbx, %rdi
	callq	_IFQ_UNLOCK
LBB0_2:
	movq	%r14, %rdi
	callq	_TUN_LOCK
	movl	(%r14), %eax
	movq	_TUN_RWAIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_4
## %bb.3:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_wakeup
LBB0_4:
	leaq	16(%r14), %rbx
	movq	_PZERO@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	incq	%rsi
	movq	%rbx, %rdi
	callq	_selwakeuppri
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_KNOTE_LOCKED
	movq	_TUN_ASYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_7
## %bb.5:
	cmpq	$0, 8(%r14)
	je	LBB0_7
## %bb.6:
	leaq	8(%r14), %rbx
	movq	%r14, %rdi
	callq	_TUN_UNLOCK
	movq	_SIGIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_pgsigio                        ## TAILCALL
LBB0_7:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_TUN_UNLOCK                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"starting\n"

	.comm	_TUN_RWAIT,4,2                  ## @TUN_RWAIT
	.comm	_PZERO,8,3                      ## @PZERO
	.comm	_TUN_ASYNC,4,2                  ## @TUN_ASYNC
	.comm	_SIGIO,4,2                      ## @SIGIO
	.no_dead_strip	_tunstart
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tunstart
_tunstart:                              ; @tunstart
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_TUNDEBUG
	mov	x0, x20
	bl	_ALTQ_IS_ENABLED
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_IFQ_LOCK
	mov	x0, x20
	bl	_IFQ_POLL_NOLOCK
	mov	x0, x20
	bl	_IFQ_UNLOCK
LBB0_2:
	mov	x0, x19
	bl	_TUN_LOCK
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _TUN_RWAIT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TUN_RWAIT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	bic	w8, w8, w9
	str	w8, [x19]
	mov	x0, x19
	bl	_wakeup
LBB0_4:
	add	x20, x19, #16
Lloh5:
	adrp	x8, _PZERO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PZERO@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	add	x1, x8, #1
	mov	x0, x20
	bl	_selwakeuppri
	mov	x0, x20
	mov	w1, #0
	bl	_KNOTE_LOCKED
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _TUN_ASYNC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TUN_ASYNC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	mov	x20, x19
	ldr	x8, [x20, #8]!
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_TUN_UNLOCK
Lloh11:
	adrp	x8, _SIGIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SIGIO@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pgsigio
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_TUN_UNLOCK
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"starting\n"

	.comm	_TUN_RWAIT,4,2                  ; @TUN_RWAIT
	.comm	_PZERO,8,3                      ; @PZERO
	.comm	_TUN_ASYNC,4,2                  ; @TUN_ASYNC
	.comm	_SIGIO,4,2                      ; @SIGIO
	.no_dead_strip	_tunstart
.subsections_via_symbols
