	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tunclone
_tunclone:                              ## @tunclone
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r13
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SPECNAMELEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	incl	%ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rax
	cmpq	$0, (%r13)
	jne	LBB0_17
## %bb.1:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	movl	$0, -60(%rbp)
	movq	%r12, %rdi
	callq	_CRED_TO_VNET
	movl	%eax, %edi
	callq	_CURVNET_SET
	leaq	-52(%rbp), %rsi
	leaq	-60(%rbp), %rdx
	movq	%r15, %rdi
	callq	_tuntap_name2info
	testq	%rax, %rax
	jne	LBB0_16
## %bb.2:
	movl	-52(%rbp), %eax
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.3:
	movq	_IF_MAXUNIT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_16
LBB0_4:
	movq	_PRIV_NET_IFCREATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_priv_check_cred
	movl	-60(%rbp), %edi
	movq	_TUN_L2@GOTPCREL(%rip), %rcx
	testl	%edi, (%rcx)
	je	LBB0_7
## %bb.5:
	testq	%rax, %rax
	sete	%al
	movq	_tap_allow_uopen@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	setne	%cl
	orb	%al, %cl
	cmpb	$1, %cl
	jne	LBB0_16
## %bb.6:
	movq	_tapdclone@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	testq	%rax, %rax
	jne	LBB0_16
## %bb.8:
	movq	_tundclone@GOTPCREL(%rip), %rax
LBB0_9:
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.10:
	movl	-52(%rbp), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	callq	_tuntap_driver_from_flags
	testq	%rax, %rax
	je	LBB0_16
## %bb.11:
	movq	%rax, %r14
	movq	%rax, %rdi
	addq	$4, %rdi
	leaq	-52(%rbp), %rdx
	movq	%rax, %rsi
	movq	%r13, %rcx
	xorl	%r8d, %r8d
	callq	_clone_create
	testl	%eax, %eax
	je	LBB0_15
## %bb.12:
	cmpl	$-1, -72(%rbp)                  ## 4-byte Folded Reload
	jne	LBB0_14
## %bb.13:
	movl	-52(%rbp), %r8d
	leaq	L_.str(%rip), %rdx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r15, %rcx
	callq	_snprintf
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r14, %r15
	movq	-72(%rbp), %r14                 ## 8-byte Reload
LBB0_14:
	movl	-52(%rbp), %esi
	movq	%r14, %rdi
	movq	%r12, %rdx
	movq	%r13, %rcx
	movq	%r15, %r8
	callq	_tun_create_device
	testl	%eax, %eax
	jne	LBB0_16
LBB0_15:
	movq	%r15, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	callq	_if_clone_create
LBB0_16:
	xorl	%eax, %eax
	callq	_CURVNET_RESTORE
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SPECNAMELEN,4,2                ## @SPECNAMELEN
	.comm	_IF_MAXUNIT,4,2                 ## @IF_MAXUNIT
	.comm	_PRIV_NET_IFCREATE,4,2          ## @PRIV_NET_IFCREATE
	.comm	_TUN_L2,4,2                     ## @TUN_L2
	.comm	_tap_allow_uopen,8,3            ## @tap_allow_uopen
	.comm	_tapdclone,8,3                  ## @tapdclone
	.comm	_tundclone,8,3                  ## @tundclone
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s%d"

	.no_dead_strip	_tunclone
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tunclone
_tunclone:                              ; @tunclone
	.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
	sub	sp, sp, #16
	mov	x21, x4
	mov	x20, x3
	mov	x19, x2
	mov	x22, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _SPECNAMELEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SPECNAMELEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w24, w8, #1
	mov	x9, x24
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x24, #15
	and	x9, x9, #0x1fffffff0
	sub	x23, x8, x9
	mov	sp, x23
	ldr	x8, [x4]
	cbnz	x8, LBB0_14
; %bb.1:
	stur	wzr, [x29, #-80]
	mov	x0, x22
	bl	_CRED_TO_VNET
	bl	_CURVNET_SET
	sub	x1, x29, #76
	sub	x2, x29, #80
	mov	x0, x19
	bl	_tuntap_name2info
	cbnz	x0, LBB0_13
; %bb.2:
	ldur	w8, [x29, #-76]
	cmn	w8, #1
	b.eq	LBB0_4
; %bb.3:
Lloh8:
	adrp	x9, _IF_MAXUNIT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IF_MAXUNIT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_13
LBB0_4:
Lloh11:
	adrp	x8, _PRIV_NET_IFCREATE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PRIV_NET_IFCREATE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_priv_check_cred
	mov	x8, x0
	ldur	w0, [x29, #-80]
Lloh14:
	adrp	x9, _TUN_L2@GOTPAGE
Lloh15:
	ldr	x9, [x9, _TUN_L2@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w0
	b.eq	LBB0_6
; %bb.5:
Lloh17:
	adrp	x9, _tap_allow_uopen@GOTPAGE
Lloh18:
	ldr	x9, [x9, _tap_allow_uopen@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, #0
	ccmp	x8, #0, #4, eq
Lloh20:
	adrp	x8, _tapdclone@GOTPAGE
Lloh21:
	ldr	x8, [x8, _tapdclone@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ccmp	x8, #0, #4, eq
	b.ne	LBB0_7
	b	LBB0_13
LBB0_6:
Lloh23:
	adrp	x9, _tundclone@GOTPAGE
Lloh24:
	ldr	x9, [x9, _tundclone@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, #0
	ccmp	x9, #0, #4, eq
	b.eq	LBB0_13
LBB0_7:
	ldur	w26, [x29, #-76]
	bl	_tuntap_driver_from_flags
	cbz	x0, LBB0_13
; %bb.8:
	mov	x25, x0
	add	x0, x0, #4
	sub	x2, x29, #76
	mov	x1, x25
	mov	x3, x21
	mov	w4, #0
	bl	_clone_create
	cbz	w0, LBB0_12
; %bb.9:
	cmn	w26, #1
	b.ne	LBB0_11
; %bb.10:
	ldur	w4, [x29, #-76]
Lloh26:
	adrp	x2, l_.str@PAGE
Lloh27:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	mov	x1, x24
	mov	x3, x19
	bl	_snprintf
	mov	x20, x0
	mov	x19, x23
LBB0_11:
	ldur	w1, [x29, #-76]
	mov	x0, x25
	mov	x2, x22
	mov	x3, x21
	mov	x4, x19
	bl	_tun_create_device
	cbnz	w0, LBB0_13
LBB0_12:
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_if_clone_create
LBB0_13:
	bl	_CURVNET_RESTORE
LBB0_14:
	ldur	x8, [x29, #-72]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	sub	sp, x29, #64
	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_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_SPECNAMELEN,4,2                ; @SPECNAMELEN
	.comm	_IF_MAXUNIT,4,2                 ; @IF_MAXUNIT
	.comm	_PRIV_NET_IFCREATE,4,2          ; @PRIV_NET_IFCREATE
	.comm	_TUN_L2,4,2                     ; @TUN_L2
	.comm	_tap_allow_uopen,8,3            ; @tap_allow_uopen
	.comm	_tapdclone,8,3                  ; @tapdclone
	.comm	_tundclone,8,3                  ; @tundclone
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s%d"

	.no_dead_strip	_tunclone
.subsections_via_symbols
