	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdvi_init_event
_amdvi_init_event:                      ## @amdvi_init_event
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movl	$8, 16(%r14)
	movl	$256, (%rdi)                    ## imm = 0x100
	movq	_M_AMDVI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$1024, %edi                     ## imm = 0x400
	callq	_malloc
	movq	%rax, 8(%rbx)
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_2
## %bb.1:
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_3
LBB0_2:
	movq	%rax, %rdi
	callq	_vtophys
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, 20(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
LBB0_3:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_M_AMDVI,4,2                    ## @M_AMDVI
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Event buffer not aligned on page."

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_amdvi_init_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdvi_init_event
_amdvi_init_event:                      ; @amdvi_init_event
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #24]
	mov	w8, #8
	str	w8, [x20, #16]
	mov	w8, #256
	str	w8, [x0]
Lloh0:
	adrp	x8, _M_AMDVI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _M_AMDVI@GOTPAGEOFF]
Lloh2:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #1024
	bl	_malloc
	str	x0, [x19, #8]
Lloh9:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	tst	x8, x0
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x19, #16]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
	b	LBB0_3
LBB0_2:
	bl	_vtophys
Lloh14:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	sdiv	w8, w0, w8
	str	w8, [x20, #20]
	stp	xzr, xzr, [x20]
LBB0_3:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_M_AMDVI,4,2                    ; @M_AMDVI
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Event buffer not aligned on page."

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_amdvi_init_event
.subsections_via_symbols
