	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tap_init
_tap_init:                              ## @tap_init
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r14
	movl	$1, -132(%rbp)
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	%rcx, -144(%rbp)                ## 8-byte Spill
	leaq	L_.str.1(%rip), %rsi
	leaq	-128(%rbp), %r13
	movq	%r13, %rdi
	callq	_strcpy
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$80, %edx
	callq	_strlcat
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_open
	movl	%eax, (%r12)
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.4:
	movq	_FIONBIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-132(%rbp), %rdx
	movl	%eax, %edi
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	movq	_CAP_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CAP_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CAP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-148(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_cap_rights_init
	movl	(%r12), %edi
	movq	%rbx, %rsi
	callq	_caph_rights_limit
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_errx
LBB0_8:
	movl	(%r12), %edi
	movq	_EVF_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	movq	-144(%rbp), %rcx                ## 8-byte Reload
	callq	_mevent_add_disabled
	movq	%rax, %rcx
	movq	%rax, (%r14)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_12
## %bb.9:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_WPRINTF
	jmp	LBB0_11
LBB0_3:
	leaq	-128(%rbp), %rdi
	jmp	LBB0_10
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
LBB0_10:
	callq	_WPRINTF
	movq	%r12, %rdi
	callq	_tap_cleanup
LBB0_11:
	movl	$-1, %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TAP backend requires non-NULL callback\n"

L_.str.1:                               ## @.str.1
	.asciz	"/dev/"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_FIONBIO,4,2                    ## @FIONBIO
L_.str.3:                               ## @.str.3
	.asciz	"tap device O_NONBLOCK failed\n"

	.comm	_CAP_EVENT,4,2                  ## @CAP_EVENT
	.comm	_CAP_READ,4,2                   ## @CAP_READ
	.comm	_CAP_WRITE,4,2                  ## @CAP_WRITE
	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
L_.str.4:                               ## @.str.4
	.asciz	"Unable to apply rights for sandbox"

	.comm	_EVF_READ,4,2                   ## @EVF_READ
L_.str.5:                               ## @.str.5
	.asciz	"Could not register event\n"

	.no_dead_strip	_tap_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tap_init
_tap_init:                              ; @tap_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x23, [x0, #8]
	mov	w8, #1
	str	w8, [sp, #4]
	cbz	x2, LBB0_7
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_strcpy
	add	x0, sp, #8
	mov	x1, x22
	mov	w2, #80
	bl	_strlcat
Lloh5:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_open
	str	w0, [x19]
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.2:
Lloh8:
	adrp	x8, _FIONBIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FIONBIO@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #4
	bl	_ioctl
	tbnz	x0, #63, LBB0_9
; %bb.3:
Lloh11:
	adrp	x8, _CAP_EVENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CAP_EVENT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _CAP_READ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CAP_READ@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x8, _CAP_WRITE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CAP_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x0, sp
	bl	_cap_rights_init
	ldr	w0, [x19]
	mov	x1, sp
	bl	_caph_rights_limit
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.4:
Lloh20:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_errx
LBB0_5:
	ldr	w0, [x19]
Lloh25:
	adrp	x8, _EVF_READ@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EVF_READ@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x2, x21
	mov	x3, x20
	bl	_mevent_add_disabled
	str	x0, [x23]
	cbz	x0, LBB0_10
; %bb.6:
	mov	w0, #0
	b	LBB0_13
LBB0_7:
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WPRINTF
	b	LBB0_12
LBB0_8:
	add	x0, sp, #8
	b	LBB0_11
LBB0_9:
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh32:
	adrp	x0, l_.str.5@PAGE
Lloh33:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_11:
	bl	_WPRINTF
	mov	x0, x19
	bl	_tap_cleanup
LBB0_12:
	mov	w0, #-1
LBB0_13:
	ldur	x8, [x29, #-56]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TAP backend requires non-NULL callback\n"

l_.str.1:                               ; @.str.1
	.asciz	"/dev/"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_FIONBIO,4,2                    ; @FIONBIO
l_.str.3:                               ; @.str.3
	.asciz	"tap device O_NONBLOCK failed\n"

	.comm	_CAP_EVENT,4,2                  ; @CAP_EVENT
	.comm	_CAP_READ,4,2                   ; @CAP_READ
	.comm	_CAP_WRITE,4,2                  ; @CAP_WRITE
	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
l_.str.4:                               ; @.str.4
	.asciz	"Unable to apply rights for sandbox"

	.comm	_EVF_READ,4,2                   ; @EVF_READ
l_.str.5:                               ; @.str.5
	.asciz	"Could not register event\n"

	.no_dead_strip	_tap_init
.subsections_via_symbols
