	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function enter_cap_mode
_enter_cap_mode:                        ## @enter_cap_mode
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	_CAP_FSTAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CAP_MMAP_R@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-20(%rbp), %rdi
	callq	_cap_rights_init
	testl	%ebx, %ebx
	jne	LBB0_3
## %bb.1:
	movq	_nm_info@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strdup
	movq	%rax, -32(%rbp)
	movl	$1, %ebx
	leaq	-32(%rbp), %r14
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_err
LBB0_3:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FA_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-20(%rbp), %r8
	movl	%ebx, %edi
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	callq	_fileargs_init
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_err
LBB0_5:
	xorl	%eax, %eax
	callq	_caph_cache_catpages
	xorl	%eax, %eax
	callq	_caph_limit_stdio
	testq	%rax, %rax
	jns	LBB0_7
## %bb.6:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_err
LBB0_7:
	xorl	%eax, %eax
	callq	_caph_enter_casper
	testq	%rax, %rax
	jns	LBB0_9
## %bb.8:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_err
LBB0_9:
	movq	_nm_opts@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAP_FSTAT,4,2                  ## @CAP_FSTAT
	.comm	_CAP_MMAP_R,4,2                 ## @CAP_MMAP_R
	.comm	_nm_info,4,2                    ## @nm_info
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"strdup"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_FA_OPEN,4,2                    ## @FA_OPEN
L_.str.1:                               ## @.str.1
	.asciz	"failed to initialize fileargs"

L_.str.2:                               ## @.str.2
	.asciz	"failed to limit stdio rights"

L_.str.3:                               ## @.str.3
	.asciz	"failed to enter capability mode"

	.comm	_nm_opts,8,3                    ## @nm_opts
	.no_dead_strip	_enter_cap_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function enter_cap_mode
_enter_cap_mode:                        ; @enter_cap_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _CAP_FSTAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAP_FSTAT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CAP_MMAP_R@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CAP_MMAP_R@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x0, sp, #12
	bl	_cap_rights_init
	cbnz	w19, LBB0_4
; %bb.1:
Lloh6:
	adrp	x8, _nm_info@GOTPAGE
Lloh7:
	ldr	x8, [x8, _nm_info@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_strdup
	str	x0, [sp]
	cbnz	x0, LBB0_3
; %bb.2:
Lloh9:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_err
LBB0_3:
	mov	w19, #1
	mov	x20, sp
LBB0_4:
Lloh14:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x8, _FA_OPEN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FA_OPEN@GOTPAGEOFF]
Lloh19:
	ldr	w5, [x8]
	add	x4, sp, #12
	mov	x0, x19
	mov	x1, x20
	mov	w3, #0
	bl	_fileargs_init
	mov	x19, x0
	cbnz	x0, LBB0_6
; %bb.5:
Lloh20:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_err
LBB0_6:
	bl	_caph_cache_catpages
	bl	_caph_limit_stdio
	tbnz	x0, #63, LBB0_10
; %bb.7:
	bl	_caph_enter_casper
	tbz	x0, #63, LBB0_9
LBB0_8:
Lloh25:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_err
LBB0_9:
Lloh30:
	adrp	x8, _nm_opts@GOTPAGE
Lloh31:
	ldr	x8, [x8, _nm_opts@GOTPAGEOFF]
Lloh32:
	str	x19, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_10:
Lloh33:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_err
	bl	_caph_enter_casper
	tbz	x0, #63, LBB0_9
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotStr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_CAP_FSTAT,4,2                  ; @CAP_FSTAT
	.comm	_CAP_MMAP_R,4,2                 ; @CAP_MMAP_R
	.comm	_nm_info,4,2                    ; @nm_info
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"strdup"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_FA_OPEN,4,2                    ; @FA_OPEN
l_.str.1:                               ; @.str.1
	.asciz	"failed to initialize fileargs"

l_.str.2:                               ; @.str.2
	.asciz	"failed to limit stdio rights"

l_.str.3:                               ; @.str.3
	.asciz	"failed to enter capability mode"

	.comm	_nm_opts,8,3                    ; @nm_opts
	.no_dead_strip	_enter_cap_mode
.subsections_via_symbols
