	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_open
_do_open:                               ## @do_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_lpc_bootrom
	movq	%rax, %rbx
	testq	%rax, %rax
	sete	%r15b
	movq	%r14, %rdi
	callq	_vm_create
	testl	%eax, %eax
	je	LBB0_5
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.2:
	callq	_do_open.cold.3
	jmp	LBB0_3
LBB0_5:
	movb	$1, %r15b
	testq	%rbx, %rbx
	je	LBB0_20
LBB0_6:
	movq	%r14, %rdi
	callq	_vm_open
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r14
	movq	_CAP_IOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CAP_MMAP_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-36(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_cap_rights_init
	movq	%r14, %rdi
	callq	_vm_get_device_fd
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_caph_rights_limit
	cmpl	$-1, %eax
	jne	LBB0_10
## %bb.9:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_errx
LBB0_10:
	leaq	-32(%rbp), %rdi
	callq	_vm_get_ioctls
	xorl	%edi, %edi
	callq	_vm_get_ioctls
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_errx
LBB0_12:
	movq	%r14, %rdi
	callq	_vm_get_device_fd
	movq	-32(%rbp), %rdx
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_caph_ioctls_limit
	cmpl	$-1, %eax
	jne	LBB0_14
## %bb.13:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_errx
LBB0_14:
	movq	%rbx, %rdi
	callq	_free
	testb	%r15b, %r15b
	jne	LBB0_17
## %bb.15:
	movq	%r14, %rdi
	callq	_vm_reinit
	testl	%eax, %eax
	jne	LBB0_16
LBB0_17:
	movq	_sockets@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_cores@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_threads@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_maxcpus@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	callq	_vm_set_topology
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	callq	_errx
LBB0_19:
	movq	%r14, %rax
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	_do_open.cold.1
	jmp	LBB0_3
LBB0_16:
	callq	_do_open.cold.2
LBB0_3:
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_20:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_fprintf
	movl	$4, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function do_open.cold.1
_do_open.cold.1:                        ## @do_open.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.2(%rip), %rdi
	callq	_perror
	pushq	$4
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function do_open.cold.2
_do_open.cold.2:                        ## @do_open.cold.2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.5(%rip), %rdi
	callq	_perror
	pushq	$4
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function do_open.cold.3
_do_open.cold.3:                        ## @do_open.cold.3
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str(%rip), %rdi
	callq	_perror
	pushq	$4
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EEXIST,8,3                     ## @EEXIST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vm_create"

	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"virtual machine cannot be booted\n"

L_.str.2:                               ## @.str.2
	.asciz	"vm_open"

	.comm	_CAP_IOCTL,4,2                  ## @CAP_IOCTL
	.comm	_CAP_MMAP_RW,4,2                ## @CAP_MMAP_RW
	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
L_.str.3:                               ## @.str.3
	.asciz	"Unable to apply rights for sandbox"

L_.str.4:                               ## @.str.4
	.asciz	"out of memory"

L_.str.5:                               ## @.str.5
	.asciz	"vm_reinit"

	.comm	_sockets,4,2                    ## @sockets
	.comm	_cores,4,2                      ## @cores
	.comm	_threads,4,2                    ## @threads
	.comm	_maxcpus,4,2                    ## @maxcpus
L_.str.6:                               ## @.str.6
	.asciz	"vm_set_topology"

	.no_dead_strip	_do_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_open
_do_open:                               ; @do_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
	mov	x19, x0
	bl	_lpc_bootrom
	mov	x20, x0
	cmp	x0, #0
	cset	w21, eq
	mov	x0, x19
	bl	_vm_create
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EEXIST@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EEXIST@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.2:
	bl	_do_open.cold.3
LBB0_3:
	cbz	x20, LBB0_19
; %bb.4:
	mov	w21, #1
LBB0_5:
	mov	x0, x19
	bl	_vm_open
	cbz	x0, LBB0_17
; %bb.6:
	mov	x19, x0
Lloh6:
	adrp	x8, _CAP_IOCTL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CAP_IOCTL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _CAP_MMAP_RW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CAP_MMAP_RW@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x0, sp, #12
	bl	_cap_rights_init
	mov	x0, x19
	bl	_vm_get_device_fd
	add	x1, sp, #12
	bl	_caph_rights_limit
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh12:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_errx
LBB0_8:
	mov	x0, sp
	bl	_vm_get_ioctls
	mov	x0, #0
	bl	_vm_get_ioctls
	mov	x20, x0
	cbnz	x0, LBB0_10
; %bb.9:
Lloh17:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_errx
LBB0_10:
	mov	x0, x19
	bl	_vm_get_device_fd
	ldr	x2, [sp]
	mov	x1, x20
	bl	_caph_ioctls_limit
	cmn	w0, #1
	b.ne	LBB0_12
; %bb.11:
Lloh22:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_errx
LBB0_12:
	mov	x0, x20
	bl	_free
	tbnz	w21, #0, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_vm_reinit
	cbnz	w0, LBB0_18
LBB0_14:
Lloh27:
	adrp	x8, _sockets@GOTPAGE
Lloh28:
	ldr	x8, [x8, _sockets@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _cores@GOTPAGE
Lloh31:
	ldr	x8, [x8, _cores@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
Lloh33:
	adrp	x8, _threads@GOTPAGE
Lloh34:
	ldr	x8, [x8, _threads@GOTPAGEOFF]
Lloh35:
	ldr	w3, [x8]
Lloh36:
	adrp	x8, _maxcpus@GOTPAGE
Lloh37:
	ldr	x8, [x8, _maxcpus@GOTPAGEOFF]
Lloh38:
	ldr	w4, [x8]
	mov	x0, x19
	bl	_vm_set_topology
	cbz	w0, LBB0_16
; %bb.15:
Lloh39:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
Lloh42:
	adrp	x1, l_.str.6@PAGE
Lloh43:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_errx
LBB0_16:
	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
LBB0_17:
	bl	_do_open.cold.1
LBB0_18:
	bl	_do_open.cold.2
LBB0_19:
Lloh44:
	adrp	x8, _stderr@GOTPAGE
Lloh45:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x8]
Lloh47:
	adrp	x1, l_.str.1@PAGE
Lloh48:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	mov	w0, #4
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function do_open.cold.1
_do_open.cold.1:                        ; @do_open.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh49:
	adrp	x0, l_.str.2@PAGE
Lloh50:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_perror
	bl	_OUTLINED_FUNCTION_0
	.loh AdrpAdd	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function do_open.cold.2
_do_open.cold.2:                        ; @do_open.cold.2
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh51:
	adrp	x0, l_.str.5@PAGE
Lloh52:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_perror
	bl	_OUTLINED_FUNCTION_0
	.loh AdrpAdd	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function do_open.cold.3
_do_open.cold.3:                        ; @do_open.cold.3
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh53:
	adrp	x0, l_.str@PAGE
Lloh54:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	bl	_OUTLINED_FUNCTION_0
	.loh AdrpAdd	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function OUTLINED_FUNCTION_0
_OUTLINED_FUNCTION_0:                   ; @OUTLINED_FUNCTION_0 Thunk
	.cfi_startproc
; %bb.0:
	mov	w0, #4
	b	_exit
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EEXIST,8,3                     ; @EEXIST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vm_create"

	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"virtual machine cannot be booted\n"

l_.str.2:                               ; @.str.2
	.asciz	"vm_open"

	.comm	_CAP_IOCTL,4,2                  ; @CAP_IOCTL
	.comm	_CAP_MMAP_RW,4,2                ; @CAP_MMAP_RW
	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
l_.str.3:                               ; @.str.3
	.asciz	"Unable to apply rights for sandbox"

l_.str.4:                               ; @.str.4
	.asciz	"out of memory"

l_.str.5:                               ; @.str.5
	.asciz	"vm_reinit"

	.comm	_sockets,4,2                    ; @sockets
	.comm	_cores,4,2                      ; @cores
	.comm	_threads,4,2                    ; @threads
	.comm	_maxcpus,4,2                    ; @maxcpus
l_.str.6:                               ; @.str.6
	.asciz	"vm_set_topology"

	.no_dead_strip	_do_open
.subsections_via_symbols
