	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vbox_hw_init                   ## -- Begin function vbox_hw_init
	.p2align	4, 0x90
_vbox_hw_init:                          ## @vbox_hw_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_ENOMEM@GOTPCREL(%rip), %r12
	movl	(%r12), %r13d
	movq	_VBE_DISPI_IOPORT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_inl
	movl	%eax, 32(%r15)
	movq	_VBE_DISPI_ID_ANYX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_vbox_check_supported
	movl	%eax, 36(%r15)
	movl	32(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_INFO
	movl	8(%r15), %ebx
	movq	%r15, %rdi
	callq	_GUEST_HEAP_OFFSET
	movq	_GUEST_HEAP_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%r14d, %r14d
	movl	%ebx, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_pci_iomap_range
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	$4, %edi
	movl	$-1, %esi
	callq	_gen_pool_create
	movl	%eax, 16(%r15)
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %ebx
	movq	(%r15), %r14
	movq	%r15, %rdi
	callq	_GUEST_HEAP_OFFSET
	movq	_GUEST_HEAP_USABLE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	movl	$-1, %r8d
	callq	_gen_pool_add_virt
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movl	16(%r15), %edi
	callq	_hgsmi_test_query_conf
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
LBB0_7:
	movl	16(%r15), %edi
	callq	_gen_pool_destroy
	jmp	LBB0_8
LBB0_1:
	subl	(%r12), %r14d
	jmp	LBB0_15
LBB0_3:
	negl	%r13d
	movl	%r13d, %r14d
LBB0_8:
	movl	8(%r15), %edi
	movq	(%r15), %rsi
	callq	_pci_iounmap
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	callq	_GUEST_HEAP_OFFSET
	movl	%eax, 28(%r15)
	movl	16(%r15), %edi
	movq	_VBOX_VBVA_CONF32_MONITOR_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	24(%r15), %rdx
	callq	_hgsmi_query_conf
	movq	_u32@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r15), %esi
	movq	_VBOX_MAX_SCREENS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %edx
	callq	_clamp_t
	movl	%eax, 24(%r15)
	movq	%r15, %rdi
	callq	_have_hgsmi_mode_hints
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	12(%r15), %edi
	movl	24(%r15), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$4, %edx
	callq	_devm_kcalloc
	movl	%eax, 20(%r15)
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movq	%r15, %rdi
	callq	_vbox_accel_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.14:
	xorl	%r14d, %r14d
	jmp	LBB0_15
LBB0_10:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_7
LBB0_12:
	xorl	%r14d, %r14d
	subl	(%r12), %r14d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VBE_DISPI_IOPORT_DATA,4,2      ## @VBE_DISPI_IOPORT_DATA
	.comm	_VBE_DISPI_ID_ANYX,4,2          ## @VBE_DISPI_ID_ANYX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VRAM %08x\n"

	.comm	_GUEST_HEAP_SIZE,4,2            ## @GUEST_HEAP_SIZE
	.comm	_GUEST_HEAP_USABLE_SIZE,4,2     ## @GUEST_HEAP_USABLE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"vboxvideo: hgsmi_test_query_conf failed\n"

	.comm	_VBOX_VBVA_CONF32_MONITOR_COUNT,4,2 ## @VBOX_VBVA_CONF32_MONITOR_COUNT
	.comm	_u32,4,2                        ## @u32
	.comm	_VBOX_MAX_SCREENS,4,2           ## @VBOX_MAX_SCREENS
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vbox_hw_init                   ; -- Begin function vbox_hw_init
	.p2align	2
_vbox_hw_init:                          ; @vbox_hw_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x22, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ENOMEM@GOTPAGEOFF]
	ldr	w21, [x22]
Lloh2:
	adrp	x8, _VBE_DISPI_IOPORT_DATA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VBE_DISPI_IOPORT_DATA@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_inl
	str	w0, [x19, #32]
Lloh5:
	adrp	x8, _VBE_DISPI_ID_ANYX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VBE_DISPI_ID_ANYX@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_vbox_check_supported
	str	w0, [x19, #36]
	ldr	w1, [x19, #32]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_INFO
	ldr	w20, [x19, #8]
	mov	x0, x19
	bl	_GUEST_HEAP_OFFSET
	mov	x2, x0
Lloh10:
	adrp	x8, _GUEST_HEAP_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GUEST_HEAP_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_pci_iomap_range
	str	x0, [x19]
	cbz	x0, LBB0_6
; %bb.1:
	mov	w0, #4
	mov	w1, #-1
	bl	_gen_pool_create
	str	w0, [x19, #16]
	cbz	w0, LBB0_7
; %bb.2:
	mov	x20, x0
	ldr	x21, [x19]
	mov	x0, x19
	bl	_GUEST_HEAP_OFFSET
	mov	x2, x0
Lloh13:
	adrp	x8, _GUEST_HEAP_USABLE_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GUEST_HEAP_USABLE_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	w4, #-1
	bl	_gen_pool_add_virt
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.3:
	ldr	w0, [x19, #16]
	bl	_hgsmi_test_query_conf
	cbz	w0, LBB0_10
; %bb.4:
	mov	x20, x0
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_5:
	ldr	w0, [x19, #16]
	bl	_gen_pool_destroy
	b	LBB0_8
LBB0_6:
	ldr	w8, [x22]
	neg	w20, w8
	b	LBB0_9
LBB0_7:
	neg	w20, w21
LBB0_8:
	ldr	w0, [x19, #8]
	ldr	x1, [x19]
	bl	_pci_iounmap
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x19
	bl	_GUEST_HEAP_OFFSET
	str	w0, [x19, #28]
	ldr	w0, [x19, #16]
Lloh18:
	adrp	x8, _VBOX_VBVA_CONF32_MONITOR_COUNT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VBOX_VBVA_CONF32_MONITOR_COUNT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x2, x19, #24
	bl	_hgsmi_query_conf
Lloh21:
	adrp	x8, _u32@GOTPAGE
Lloh22:
	ldr	x8, [x8, _u32@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w1, [x19, #24]
Lloh24:
	adrp	x8, _VBOX_MAX_SCREENS@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VBOX_MAX_SCREENS@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
	mov	w2, #1
	bl	_clamp_t
	str	w0, [x19, #24]
	mov	x0, x19
	bl	_have_hgsmi_mode_hints
	cbz	w0, LBB0_13
; %bb.11:
	ldr	w0, [x19, #12]
	ldr	w1, [x19, #24]
Lloh27:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
	mov	w2, #4
	bl	_devm_kcalloc
	str	w0, [x19, #20]
	cbz	w0, LBB0_14
; %bb.12:
	mov	x0, x19
	bl	_vbox_accel_init
	mov	x20, x0
	cbnz	w0, LBB0_5
	b	LBB0_9
LBB0_13:
Lloh30:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_14:
	ldr	w8, [x22]
	neg	w20, w8
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VBE_DISPI_IOPORT_DATA,4,2      ; @VBE_DISPI_IOPORT_DATA
	.comm	_VBE_DISPI_ID_ANYX,4,2          ; @VBE_DISPI_ID_ANYX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VRAM %08x\n"

	.comm	_GUEST_HEAP_SIZE,4,2            ; @GUEST_HEAP_SIZE
	.comm	_GUEST_HEAP_USABLE_SIZE,4,2     ; @GUEST_HEAP_USABLE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"vboxvideo: hgsmi_test_query_conf failed\n"

	.comm	_VBOX_VBVA_CONF32_MONITOR_COUNT,4,2 ; @VBOX_VBVA_CONF32_MONITOR_COUNT
	.comm	_u32,4,2                        ; @u32
	.comm	_VBOX_MAX_SCREENS,4,2           ; @VBOX_MAX_SCREENS
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
