	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tuntap_open
_tuntap_open:                           ## @tuntap_open
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 12(%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	movq	(%rdi), %r15
	leaq	L_.str(%rip), %rdi
	movl	$2, %esi
	xorl	%edx, %edx
	callq	_simc_open
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	leaq	-40(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_IFF_TAP@GOTPCREL(%rip), %rax
	movq	_IFF_NO_PI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -40(%rbp)
	movl	-36(%rbp), %edi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	_TUNSETIFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movq	%r12, %rdx
	callq	_simc_ioctl
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	%ebx, 8(%r14)
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_printk
	jmp	LBB0_8
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	callq	_printk
	movl	%ebx, %edi
	callq	_simc_close
LBB0_7:
	movl	%r15d, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/net/tun"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to open /dev/net/tun, returned %d (errno = %d)\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_IFF_TAP,4,2                    ## @IFF_TAP
	.comm	_IFF_NO_PI,4,2                  ## @IFF_NO_PI
	.comm	_TUNSETIFF,4,2                  ## @TUNSETIFF
L_.str.2:                               ## @.str.2
	.asciz	"Failed to set interface, returned %d (errno = %d)\n"

	.no_dead_strip	_tuntap_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tuntap_open
_tuntap_open:                           ; @tuntap_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0, #12]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #2
	mov	w2, #0
	bl	_simc_open
	mov	x19, x0
	tbnz	w0, #31, LBB0_5
; %bb.2:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh2:
	adrp	x8, _IFF_TAP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IFF_TAP@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _IFF_NO_PI@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IFF_NO_PI@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #8]
	ldr	w0, [sp, #12]
	mov	x1, x21
	mov	w2, #4
	bl	_strlcpy
Lloh8:
	adrp	x8, _TUNSETIFF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TUNSETIFF@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_simc_ioctl
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.3:
	str	w19, [x20, #8]
	b	LBB0_7
LBB0_4:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_8
LBB0_5:
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_printk
	b	LBB0_8
LBB0_6:
Lloh19:
	adrp	x8, _errno@GOTPAGE
Lloh20:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_printk
	mov	x0, x19
	bl	_simc_close
LBB0_7:
	mov	x19, x21
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/net/tun"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to open /dev/net/tun, returned %d (errno = %d)\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_IFF_TAP,4,2                    ; @IFF_TAP
	.comm	_IFF_NO_PI,4,2                  ; @IFF_NO_PI
	.comm	_TUNSETIFF,4,2                  ; @TUNSETIFF
l_.str.2:                               ; @.str.2
	.asciz	"Failed to set interface, returned %d (errno = %d)\n"

	.no_dead_strip	_tuntap_open
.subsections_via_symbols
