	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_do_init_map
_via_do_init_map:                       ## @via_do_init_map
	.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
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	%rbx, %rdi
	callq	_drm_getsarea
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movl	12(%r15), %esi
	movq	%rbx, %rdi
	callq	_drm_core_findmap
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movl	8(%r15), %esi
	movq	%rbx, %rdi
	callq	_drm_core_findmap
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	8(%r14), %rax
	movslq	(%r15), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, 16(%r14)
	movl	4(%r15), %eax
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_via_init_futex
	movq	%rbx, %rdi
	callq	_via_init_dmablit
	movq	%r14, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
LBB0_2:
	callq	_DRM_ERROR
	movq	%r14, (%rbx)
	movq	%rbx, %rdi
	callq	_via_do_cleanup_map
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

L_.str.1:                               ## @.str.1
	.asciz	"could not find sarea!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"could not find framebuffer!\n"

L_.str.3:                               ## @.str.3
	.asciz	"could not find mmio region!\n"

	.no_dead_strip	_via_do_init_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_do_init_map
_via_do_init_map:                       ; @via_do_init_map
	.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	x21, x1
	mov	x19, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	mov	x0, x19
	bl	_drm_getsarea
	str	x0, [x20, #8]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w1, [x21, #12]
	mov	x0, x19
	bl	_drm_core_findmap
	str	x0, [x20, #32]
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w1, [x21, #8]
	mov	x0, x19
	bl	_drm_core_findmap
	str	x0, [x20, #24]
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldp	w9, w10, [x21]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	add	x8, x8, x9, lsl #2
	str	x8, [x20, #16]
	str	w10, [x20]
	mov	x0, x20
	bl	_via_init_futex
	mov	x0, x19
	bl	_via_init_dmablit
	mov	w0, #0
	str	x20, [x19]
	b	LBB0_8
LBB0_4:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_7:
	bl	_DRM_ERROR
	str	x20, [x19]
	mov	x0, x19
	bl	_via_do_cleanup_map
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

l_.str.1:                               ; @.str.1
	.asciz	"could not find sarea!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"could not find framebuffer!\n"

l_.str.3:                               ; @.str.3
	.asciz	"could not find mmio region!\n"

	.no_dead_strip	_via_do_init_map
.subsections_via_symbols
