	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_initialize
_via_initialize:                        ## @via_initialize
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %rbx
	cmpq	$0, 8(%rsi)
	je	LBB0_2
## %bb.5:
	cmpq	$0, 56(%rbx)
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
LBB0_3:
	callq	_DRM_ERROR
	movq	_EFAULT@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rdi, %r15
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rdx, %r14
	movq	(%rbx), %rcx
	movq	_VIA_DX9_0@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_12:
	addq	8(%r14), %rax
	leaq	64(%rbx), %rdi
	movq	%rax, 104(%rbx)
	movl	16(%r14), %eax
	movl	%eax, 96(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%rbx)
	movq	$0, 88(%rbx)
	movq	%r15, %rsi
	callq	_drm_core_ioremap
	movq	64(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	movq	%rax, 56(%rbx)
	movq	%rax, 112(%rbx)
	movq	$0, 48(%rbx)
	movl	16(%r14), %eax
	movl	%eax, 44(%rbx)
	movl	%eax, 40(%rbx)
	movq	8(%r14), %rax
	movq	%rax, 32(%rbx)
	movq	$0, 24(%rbx)
	movq	8(%rbx), %rax
	movslq	(%r14), %rcx
	addq	(%rax), %rcx
	movq	%rcx, 16(%rbx)
	movq	%rbx, %rdi
	callq	_via_cmdbuf_start
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_13:
	movq	%r15, %rdi
	callq	_via_dma_cleanup
	leaq	L_.str.4(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"via_dma_init called before via_map_init\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.1:                               ## @.str.1
	.asciz	"called again without calling cleanup\n"

L_.str.2:                               ## @.str.2
	.asciz	"called with no agp memory available\n"

	.comm	_VIA_DX9_0,8,3                  ## @VIA_DX9_0
L_.str.3:                               ## @.str.3
	.asciz	"AGP DMA is not supported on this chip\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.4:                               ## @.str.4
	.asciz	"can not ioremap virtual address for ring buffer\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_via_initialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_initialize
_via_initialize:                        ; @via_initialize
	.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
	cbz	x1, LBB0_4
; %bb.1:
	mov	x19, x1
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_8
; %bb.3:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_DRM_ERROR
Lloh4:
	adrp	x8, _EFAULT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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_8:
	mov	x21, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_12
; %bb.9:
	ldr	x8, [x8]
	cbz	x8, LBB0_12
; %bb.10:
	ldr	x9, [x19]
Lloh6:
	adrp	x10, _VIA_DX9_0@GOTPAGE
Lloh7:
	ldr	x10, [x10, _VIA_DX9_0@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_13
; %bb.11:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_12:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_13:
	mov	x20, x2
	ldr	x9, [x2, #8]
	add	x8, x9, x8
	add	x0, x19, #64
	str	x8, [x19, #104]
	ldr	w8, [x2, #16]
	str	w8, [x19, #96]
	stp	xzr, xzr, [x19, #80]
	str	xzr, [x19, #72]
	mov	x1, x21
	bl	_drm_core_ioremap
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_15
; %bb.14:
	str	x8, [x19, #112]
	stp	xzr, x8, [x19, #48]
	ldr	w8, [x20, #16]
	stp	w8, w8, [x19, #40]
	ldr	x8, [x20, #8]
	str	x8, [x19, #32]
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldrsw	x9, [x20]
	add	x8, x8, x9
	stp	x8, xzr, [x19, #16]
	mov	x0, x19
	bl	_via_cmdbuf_start
	mov	w0, #0
	b	LBB0_7
LBB0_15:
	mov	x0, x21
	bl	_via_dma_cleanup
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"via_dma_init called before via_map_init\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.1:                               ; @.str.1
	.asciz	"called again without calling cleanup\n"

l_.str.2:                               ; @.str.2
	.asciz	"called with no agp memory available\n"

	.comm	_VIA_DX9_0,8,3                  ; @VIA_DX9_0
l_.str.3:                               ; @.str.3
	.asciz	"AGP DMA is not supported on this chip\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.4:                               ; @.str.4
	.asciz	"can not ioremap virtual address for ring buffer\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_via_initialize
.subsections_via_symbols
