	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tuncreate
_tuncreate:                             ## @tuncreate
	.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
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r15
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	16(%r15), %r13
	movq	_TUN_L2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	movq	_IFF_BROADCAST@GOTPCREL(%rip), %rcx
	movq	_IFF_SIMPLEX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r14d
	orl	(%rcx), %r14d
	testl	%eax, %eax
	movq	_IFF_POINTOPOINT@GOTPCREL(%rip), %rax
	cmovel	(%rax), %r14d
	movq	_IFT_ETHER@GOTPCREL(%rip), %rax
	cmoveq	_IFT_PPP@GOTPCREL(%rip), %rax
	movq	_IFF_MULTICAST@GOTPCREL(%rip), %rcx
	movl	(%rax), %edi
	orl	(%rcx), %r14d
	callq	_if_alloc
	movq	%rax, %r12
	movq	%rax, %rbx
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	(%r13), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev2unit
	leaq	L_.str.1(%rip), %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_panic
LBB0_2:
	movq	%r15, 48(%rbx)
	movl	(%r13), %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev2unit
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_if_initname
	movq	_tunifioctl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movl	%r14d, (%rbx)
	addq	$8, %r12
	movq	_ifqmaxlen@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_IFQ_SET_MAXLEN
	movq	_IFCAP_LINKSTATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 36(%rbx)
	orl	%eax, 32(%rbx)
	movq	_TUN_L2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_4
## %bb.3:
	movq	_ETHERMTU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_tunifinit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_tunstart_l2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ether_gen_addr
	movl	-56(%rbp), %esi
	movq	%rbx, %rdi
	callq	_ether_ifattach
	jmp	LBB0_5
LBB0_4:
	movq	_TUNMTU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_tunstart@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_tunoutput@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	$0, 8(%rbx)
	movq	%r12, %rdi
	callq	_IFQ_SET_READY
	movq	%rbx, %rdi
	callq	_if_attach
	movq	_DLT_NULL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_bpfattach
LBB0_5:
	movq	%r15, %rdi
	callq	_TUN_LOCK
	movq	_TUN_INITED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	movq	%r15, %rdi
	callq	_TUN_UNLOCK
	movl	4(%rbx), %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev2unit
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_TUNDEBUG
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"si_drv1 should have been initialized at creation"

	.comm	_IFF_MULTICAST,4,2              ## @IFF_MULTICAST
	.comm	_TUN_L2,4,2                     ## @TUN_L2
	.comm	_IFT_ETHER,4,2                  ## @IFT_ETHER
	.comm	_IFF_BROADCAST,4,2              ## @IFF_BROADCAST
	.comm	_IFF_SIMPLEX,4,2                ## @IFF_SIMPLEX
	.comm	_IFT_PPP,4,2                    ## @IFT_PPP
	.comm	_IFF_POINTOPOINT,4,2            ## @IFF_POINTOPOINT
L_.str.1:                               ## @.str.1
	.asciz	"%s%d: failed to if_alloc() interface.\n"

	.comm	_tunifioctl,4,2                 ## @tunifioctl
	.comm	_ifqmaxlen,4,2                  ## @ifqmaxlen
	.comm	_IFCAP_LINKSTATE,4,2            ## @IFCAP_LINKSTATE
	.comm	_ETHERMTU,4,2                   ## @ETHERMTU
	.comm	_tunifinit,4,2                  ## @tunifinit
	.comm	_tunstart_l2,4,2                ## @tunstart_l2
	.comm	_TUNMTU,4,2                     ## @TUNMTU
	.comm	_tunstart,4,2                   ## @tunstart
	.comm	_tunoutput,4,2                  ## @tunoutput
	.comm	_DLT_NULL,4,2                   ## @DLT_NULL
	.comm	_TUN_INITED,4,2                 ## @TUN_INITED
L_.str.2:                               ## @.str.2
	.asciz	"interface %s is created, minor = %#x\n"

	.no_dead_strip	_tuncreate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tuncreate
_tuncreate:                             ; @tuncreate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	x20, [x0]
	cmp	x20, #0
	cset	w0, ne
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x24, [x20, #16]
Lloh2:
	adrp	x8, _IFF_MULTICAST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IFF_MULTICAST@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20]
Lloh5:
	adrp	x23, _TUN_L2@GOTPAGE
Lloh6:
	ldr	x23, [x23, _TUN_L2@GOTPAGEOFF]
Lloh7:
	adrp	x10, _IFF_BROADCAST@GOTPAGE
Lloh8:
	ldr	x10, [x10, _IFF_BROADCAST@GOTPAGEOFF]
	ldr	w11, [x23]
Lloh9:
	ldr	w10, [x10]
Lloh10:
	adrp	x12, _IFF_SIMPLEX@GOTPAGE
Lloh11:
	ldr	x12, [x12, _IFF_SIMPLEX@GOTPAGEOFF]
Lloh12:
	ldr	w12, [x12]
	orr	w10, w12, w10
Lloh13:
	adrp	x12, _IFF_POINTOPOINT@GOTPAGE
Lloh14:
	ldr	x12, [x12, _IFF_POINTOPOINT@GOTPAGEOFF]
Lloh15:
	ldr	w12, [x12]
	tst	w11, w9
Lloh16:
	adrp	x9, _IFT_PPP@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IFT_PPP@GOTPAGEOFF]
	csel	w10, w12, w10, eq
Lloh18:
	adrp	x11, _IFT_ETHER@GOTPAGE
Lloh19:
	ldr	x11, [x11, _IFT_ETHER@GOTPAGEOFF]
	csel	x9, x9, x11, eq
	ldr	w0, [x9]
	orr	w25, w10, w8
	bl	_if_alloc
	mov	x21, x0
	str	x0, [x20, #8]
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w22, [x24]
	mov	x0, x19
	bl	_dev2unit
	mov	x2, x0
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_panic
LBB0_2:
	str	x20, [x21, #48]
	ldr	w22, [x24]
	mov	x0, x19
	bl	_dev2unit
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_if_initname
Lloh22:
	adrp	x8, _tunifioctl@GOTPAGE
Lloh23:
	ldr	x8, [x8, _tunifioctl@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x21, #40]
	str	w25, [x21]
	add	x22, x21, #8
Lloh25:
	adrp	x8, _ifqmaxlen@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ifqmaxlen@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_IFQ_SET_MAXLEN
Lloh28:
	adrp	x8, _IFCAP_LINKSTATE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _IFCAP_LINKSTATE@GOTPAGEOFF]
	ld1r.2s	{ v0 }, [x8]
	ldr	d1, [x21, #32]
	orr.8b	v0, v1, v0
	str	d0, [x21, #32]
	ldr	w8, [x20]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh30:
	adrp	x8, _ETHERMTU@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ETHERMTU@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _tunifinit@GOTPAGE
Lloh34:
	ldr	x9, [x9, _tunifinit@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	str	w9, [x21, #28]
Lloh36:
	adrp	x9, _tunstart_l2@GOTPAGE
Lloh37:
	ldr	x9, [x9, _tunstart_l2@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #20]
	add	x1, sp, #8
	mov	x0, x21
	bl	_ether_gen_addr
	ldr	w1, [sp, #8]
	mov	x0, x21
	bl	_ether_ifattach
	b	LBB0_5
LBB0_4:
Lloh39:
	adrp	x8, _TUNMTU@GOTPAGE
Lloh40:
	ldr	x8, [x8, _TUNMTU@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	str	w8, [x21, #24]
Lloh42:
	adrp	x8, _tunstart@GOTPAGE
Lloh43:
	ldr	x8, [x8, _tunstart@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
Lloh45:
	adrp	x9, _tunoutput@GOTPAGE
Lloh46:
	ldr	x9, [x9, _tunoutput@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #16]
	str	xzr, [x21, #8]
	mov	x0, x22
	bl	_IFQ_SET_READY
	mov	x0, x21
	bl	_if_attach
Lloh48:
	adrp	x8, _DLT_NULL@GOTPAGE
Lloh49:
	ldr	x8, [x8, _DLT_NULL@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #4
	bl	_bpfattach
LBB0_5:
	mov	x0, x20
	bl	_TUN_LOCK
Lloh51:
	adrp	x8, _TUN_INITED@GOTPAGE
Lloh52:
	ldr	x8, [x8, _TUN_INITED@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	x0, x20
	bl	_TUN_UNLOCK
	ldr	w20, [x21, #4]
	mov	x0, x19
	bl	_dev2unit
	mov	x3, x0
Lloh54:
	adrp	x1, l_.str.2@PAGE
Lloh55:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_TUNDEBUG
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"si_drv1 should have been initialized at creation"

	.comm	_IFF_MULTICAST,4,2              ; @IFF_MULTICAST
	.comm	_TUN_L2,4,2                     ; @TUN_L2
	.comm	_IFT_ETHER,4,2                  ; @IFT_ETHER
	.comm	_IFF_BROADCAST,4,2              ; @IFF_BROADCAST
	.comm	_IFF_SIMPLEX,4,2                ; @IFF_SIMPLEX
	.comm	_IFT_PPP,4,2                    ; @IFT_PPP
	.comm	_IFF_POINTOPOINT,4,2            ; @IFF_POINTOPOINT
l_.str.1:                               ; @.str.1
	.asciz	"%s%d: failed to if_alloc() interface.\n"

	.comm	_tunifioctl,4,2                 ; @tunifioctl
	.comm	_ifqmaxlen,4,2                  ; @ifqmaxlen
	.comm	_IFCAP_LINKSTATE,4,2            ; @IFCAP_LINKSTATE
	.comm	_ETHERMTU,4,2                   ; @ETHERMTU
	.comm	_tunifinit,4,2                  ; @tunifinit
	.comm	_tunstart_l2,4,2                ; @tunstart_l2
	.comm	_TUNMTU,4,2                     ; @TUNMTU
	.comm	_tunstart,4,2                   ; @tunstart
	.comm	_tunoutput,4,2                  ; @tunoutput
	.comm	_DLT_NULL,4,2                   ; @DLT_NULL
	.comm	_TUN_INITED,4,2                 ; @TUN_INITED
l_.str.2:                               ; @.str.2
	.asciz	"interface %s is created, minor = %#x\n"

	.no_dead_strip	_tuncreate
.subsections_via_symbols
