	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_warp_init                  ## -- Begin function mga_warp_init
	.p2align	4, 0x90
_mga_warp_init:                         ## @mga_warp_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %eax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_1
## %bb.3:
	movq	_MGA_WIADDR2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MGA_WMODE_SUSPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MGA_WRITE
	movl	$402653184, %r14d               ## imm = 0x18000000
	movq	_MGA_WACCEPTSEQ@GOTPCREL(%rip), %r15
	movl	$6151, %r12d                    ## imm = 0x1807
	movq	_MGA_WVRTXSZ@GOTPCREL(%rip), %rbx
	movq	_MGA_WGETMSB@GOTPCREL(%rip), %rax
	movl	$3584, %esi                     ## imm = 0xE00
	jmp	LBB0_4
LBB0_1:
	cmpl	$130, %eax
	jne	LBB0_6
## %bb.2:
	movq	_MGA_WMODE_SUSPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$7, %r14d
	movq	_MGA_WVRTXSZ@GOTPCREL(%rip), %r15
	movl	$5638, %r12d                    ## imm = 0x1606
	movq	_MGA_WGETMSB@GOTPCREL(%rip), %rbx
	movq	_MGA_WIADDR@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edi
	callq	_MGA_WRITE
	movl	(%rbx), %edi
	movl	%r12d, %esi
	callq	_MGA_WRITE
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_MGA_WRITE
	movq	_MGA_WMISC@GOTPCREL(%rip), %rbx
	movq	_MGA_WUCODECACHE_ENABLE@GOTPCREL(%rip), %rax
	movq	_MGA_WMASTER_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	(%rbx), %edi
	movq	_MGA_WCACHEFLUSH_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_MGA_WRITE
	movl	(%rbx), %edi
	callq	_MGA_READ
	movq	%rax, %rsi
	movq	_WMISC_EXPECTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%eax, %eax
	cmpq	%rdx, %rsi
	je	LBB0_7
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MGA_WIADDR2,4,2                ## @MGA_WIADDR2
	.comm	_MGA_WMODE_SUSPEND,4,2          ## @MGA_WMODE_SUSPEND
	.comm	_MGA_WGETMSB,4,2                ## @MGA_WGETMSB
	.comm	_MGA_WVRTXSZ,4,2                ## @MGA_WVRTXSZ
	.comm	_MGA_WACCEPTSEQ,4,2             ## @MGA_WACCEPTSEQ
	.comm	_MGA_WIADDR,4,2                 ## @MGA_WIADDR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MGA_WMISC,4,2                  ## @MGA_WMISC
	.comm	_MGA_WUCODECACHE_ENABLE,4,2     ## @MGA_WUCODECACHE_ENABLE
	.comm	_MGA_WMASTER_ENABLE,4,2         ## @MGA_WMASTER_ENABLE
	.comm	_MGA_WCACHEFLUSH_ENABLE,4,2     ## @MGA_WCACHEFLUSH_ENABLE
	.comm	_WMISC_EXPECTED,8,3             ## @WMISC_EXPECTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WARP engine config failed! 0x%x != 0x%x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_warp_init                  ; -- Begin function mga_warp_init
	.p2align	2
_mga_warp_init:                         ; @mga_warp_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
	ldr	w8, [x0]
	sub	w9, w8, #128
	cmp	w9, #2
	b.hs	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _MGA_WIADDR2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MGA_WIADDR2@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _MGA_WMODE_SUSPEND@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MGA_WMODE_SUSPEND@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_MGA_WRITE
	mov	w19, #402653184
Lloh6:
	adrp	x21, _MGA_WACCEPTSEQ@GOTPAGE
Lloh7:
	ldr	x21, [x21, _MGA_WACCEPTSEQ@GOTPAGEOFF]
	mov	w20, #6151
Lloh8:
	adrp	x22, _MGA_WVRTXSZ@GOTPAGE
Lloh9:
	ldr	x22, [x22, _MGA_WVRTXSZ@GOTPAGEOFF]
Lloh10:
	adrp	x8, _MGA_WGETMSB@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MGA_WGETMSB@GOTPAGEOFF]
	mov	w1, #3584
	b	LBB0_4
LBB0_2:
	cmp	w8, #130
	b.ne	LBB0_7
; %bb.3:
Lloh12:
	adrp	x8, _MGA_WMODE_SUSPEND@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MGA_WMODE_SUSPEND@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x21, _MGA_WVRTXSZ@GOTPAGE
Lloh16:
	ldr	x21, [x21, _MGA_WVRTXSZ@GOTPAGEOFF]
	mov	w19, #7
	mov	w20, #5638
Lloh17:
	adrp	x22, _MGA_WGETMSB@GOTPAGE
Lloh18:
	ldr	x22, [x22, _MGA_WGETMSB@GOTPAGEOFF]
Lloh19:
	adrp	x8, _MGA_WIADDR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MGA_WIADDR@GOTPAGEOFF]
LBB0_4:
	ldr	w0, [x8]
	bl	_MGA_WRITE
	ldr	w0, [x22]
	mov	x1, x20
	bl	_MGA_WRITE
	ldr	w0, [x21]
	mov	x1, x19
	bl	_MGA_WRITE
Lloh21:
	adrp	x19, _MGA_WMISC@GOTPAGE
Lloh22:
	ldr	x19, [x19, _MGA_WMISC@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh23:
	adrp	x8, _MGA_WUCODECACHE_ENABLE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MGA_WUCODECACHE_ENABLE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _MGA_WMASTER_ENABLE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MGA_WMASTER_ENABLE@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh29:
	adrp	x9, _MGA_WCACHEFLUSH_ENABLE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _MGA_WCACHEFLUSH_ENABLE@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	_MGA_WRITE
	ldr	w0, [x19]
	bl	_MGA_READ
Lloh32:
	adrp	x8, _WMISC_EXPECTED@GOTPAGE
Lloh33:
	ldr	x8, [x8, _WMISC_EXPECTED@GOTPAGEOFF]
Lloh34:
	ldr	x2, [x8]
	cmp	x0, x2
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #0
	b	LBB0_8
LBB0_6:
	mov	x1, x0
Lloh35:
	adrp	x0, l_.str@PAGE
Lloh36:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_7:
Lloh37:
	adrp	x8, _EINVAL@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh39:
	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 AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_MGA_WIADDR2,4,2                ; @MGA_WIADDR2
	.comm	_MGA_WMODE_SUSPEND,4,2          ; @MGA_WMODE_SUSPEND
	.comm	_MGA_WGETMSB,4,2                ; @MGA_WGETMSB
	.comm	_MGA_WVRTXSZ,4,2                ; @MGA_WVRTXSZ
	.comm	_MGA_WACCEPTSEQ,4,2             ; @MGA_WACCEPTSEQ
	.comm	_MGA_WIADDR,4,2                 ; @MGA_WIADDR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MGA_WMISC,4,2                  ; @MGA_WMISC
	.comm	_MGA_WUCODECACHE_ENABLE,4,2     ; @MGA_WUCODECACHE_ENABLE
	.comm	_MGA_WMASTER_ENABLE,4,2         ; @MGA_WMASTER_ENABLE
	.comm	_MGA_WCACHEFLUSH_ENABLE,4,2     ; @MGA_WCACHEFLUSH_ENABLE
	.comm	_WMISC_EXPECTED,8,3             ; @WMISC_EXPECTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WARP engine config failed! 0x%x != 0x%x\n"

.subsections_via_symbols
