	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv31_mpeg_init                 ## -- Begin function nv31_mpeg_init
	.p2align	4, 0x90
_nv31_mpeg_init:                        ## @nv31_mpeg_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
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_nv_engine
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_nouveau_fb
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_nouveau_mpeg_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	%r12, %rdi
	movl	$45280, %esi                    ## imm = 0xB0E0
	movl	$32, %edx
	callq	_nv_wr32
	movq	%r12, %rdi
	movl	$45288, %esi                    ## imm = 0xB0E8
	movl	$32, %edx
	callq	_nv_wr32
	cmpl	$0, (%r15)
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	*(%r12)
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_3
LBB0_4:
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	movl	$45868, %esi                    ## imm = 0xB32C
	xorl	%edx, %edx
	callq	_nv_wr32
	movq	%r12, %rdi
	movl	$45844, %esi                    ## imm = 0xB314
	movl	$256, %edx                      ## imm = 0x100
	callq	_nv_wr32
	movq	%r12, %rdi
	callq	_nv44_graph_class
	testq	%rax, %rax
	movl	$49, %eax
	movl	$68, %edx
	cmovel	%eax, %edx
	movq	%r12, %rdi
	movl	$45600, %esi                    ## imm = 0xB220
	callq	_nv_wr32
	movq	%r12, %rdi
	movl	$45824, %esi                    ## imm = 0xB300
	movl	$33562305, %edx                 ## imm = 0x2001EC1
	callq	_nv_wr32
	movq	%r12, %rdi
	movl	$45868, %esi                    ## imm = 0xB32C
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nv_mask
	movq	%r12, %rdi
	movl	$45312, %esi                    ## imm = 0xB100
	movl	$-1, %edx
	callq	_nv_wr32
	movq	%r12, %rdi
	movl	$45376, %esi                    ## imm = 0xB140
	movl	$-1, %edx
	callq	_nv_wr32
	movq	%r12, %rdi
	movl	$45568, %esi                    ## imm = 0xB200
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_nv_wait
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	movl	$45568, %esi                    ## imm = 0xB200
	callq	_nv_rd32
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_nv_error
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_6:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout 0x%08x\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv31_mpeg_init                 ; -- Begin function nv31_mpeg_init
	.p2align	2
_nv31_mpeg_init:                        ; @nv31_mpeg_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	x20, x0
	ldr	w0, [x0]
	bl	_nv_engine
	mov	x19, x0
	mov	x0, x20
	bl	_nouveau_fb
	mov	x20, x0
	mov	x0, x19
	bl	_nouveau_mpeg_init
	cbnz	w0, LBB0_6
; %bb.1:
	mov	x0, x19
	mov	w1, #45280
	mov	w2, #32
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45288
	mov	w2, #32
	bl	_nv_wr32
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	w21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	mov	x0, x19
	mov	x1, x21
	blr	x8
	add	w21, w21, #1
	ldr	w8, [x20]
	cmp	w21, w8
	b.lt	LBB0_3
LBB0_4:
	mov	x0, x19
	mov	w1, #45868
	mov	w2, #0
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45844
	mov	w2, #256
	bl	_nv_wr32
	mov	x0, x19
	bl	_nv44_graph_class
	cmp	x0, #0
	mov	w8, #68
	mov	w9, #49
	csel	w2, w9, w8, eq
	mov	x0, x19
	mov	w1, #45600
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45824
	mov	w2, #7873
	movk	w2, #512, lsl #16
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45868
	mov	w2, #1
	mov	w3, #1
	bl	_nv_mask
	mov	x0, x19
	mov	w1, #45312
	mov	w2, #-1
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45376
	mov	w2, #-1
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45568
	mov	w2, #1
	mov	w3, #0
	bl	_nv_wait
	mov	x8, x0
	mov	w0, #0
	cbnz	w8, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #45568
	bl	_nv_rd32
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_nv_error
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout 0x%08x\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
