	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv31_mpeg_mthd_dma
_nv31_mpeg_mthd_dma:                    ## @nv31_mpeg_mthd_dma
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r13d
	movq	%rdi, %rbx
	callq	_nouveau_instmem
	movq	%rax, %r12
	movq	(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%r15), %r14d
	shll	$4, %r14d
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_nv_ro32
	movl	%eax, %ebx
	leal	4(%r14), %esi
	movq	%r12, %rdi
	callq	_nv_ro32
	movl	%eax, %r15d
	orl	$8, %r14d
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_nv_ro32
	testl	$8192, %ebx                     ## imm = 0x2000
	jne	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	andl	$-4096, %eax                    ## imm = 0xF000
	movl	%ebx, %r12d
	sarl	$20, %r12d
	orl	%eax, %r12d
	incl	%r15d
	cmpl	$416, %r13d                     ## imm = 0x1A0
	je	LBB0_5
## %bb.3:
	cmpl	$400, %r13d                     ## imm = 0x190
	jne	LBB0_6
## %bb.4:
	andl	$196608, %ebx                   ## imm = 0x30000
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	$45824, %esi                    ## imm = 0xB300
	movl	$196608, %edx                   ## imm = 0x30000
	movl	%ebx, %ecx
	callq	_nv_mask
	movq	%r14, %rdi
	movl	$45876, %esi                    ## imm = 0xB334
	movl	%r12d, %edx
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$45860, %esi                    ## imm = 0xB324
	jmp	LBB0_8
LBB0_5:
	shll	$2, %ebx
	andl	$786432, %ebx                   ## imm = 0xC0000
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	$45824, %esi                    ## imm = 0xB300
	movl	$786432, %edx                   ## imm = 0xC0000
	movl	%ebx, %ecx
	callq	_nv_mask
	movq	%r14, %rdi
	movl	$45920, %esi                    ## imm = 0xB360
	movl	%r12d, %edx
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$45924, %esi                    ## imm = 0xB364
	jmp	LBB0_8
LBB0_6:
	testl	$786432, %ebx                   ## imm = 0xC0000
	jne	LBB0_1
## %bb.7:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$45936, %esi                    ## imm = 0xB370
	movl	%r12d, %edx
	callq	_nv_wr32
	movq	%rbx, %rdi
	movl	$45940, %esi                    ## imm = 0xB374
LBB0_8:
	movl	%r15d, %edx
	callq	_nv_wr32
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nv31_mpeg_mthd_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv31_mpeg_mthd_dma
_nv31_mpeg_mthd_dma:                    ; @nv31_mpeg_mthd_dma
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	bl	_nouveau_instmem
	mov	x21, x0
	ldr	x19, [x19]
	ldr	w24, [x20]
	lsl	w1, w24, #4
	bl	_nv_ro32
	mov	x23, x0
	mov	w1, #4
	bfi	w1, w24, #4, #28
	mov	x0, x21
	bl	_nv_ro32
	mov	x20, x0
	mov	w1, #8
	bfi	w1, w24, #4, #28
	mov	x0, x21
	bl	_nv_ro32
	tbnz	w23, #13, LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_2:
	and	w8, w0, #0xfffff000
	orr	w21, w8, w23, asr #20
	add	w20, w20, #1
	cmp	w22, #416
	b.eq	LBB0_5
; %bb.3:
	cmp	w22, #400
	b.ne	LBB0_6
; %bb.4:
	and	w3, w23, #0x30000
	mov	x0, x19
	mov	w1, #45824
	mov	w2, #196608
	bl	_nv_mask
	mov	x0, x19
	mov	w1, #45876
	mov	x2, x21
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45860
	b	LBB0_8
LBB0_5:
	lsl	w8, w23, #2
	and	w3, w8, #0xc0000
	mov	x0, x19
	mov	w1, #45824
	mov	w2, #786432
	bl	_nv_mask
	mov	x0, x19
	mov	w1, #45920
	mov	x2, x21
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45924
	b	LBB0_8
LBB0_6:
	tst	w23, #0xc0000
	b.ne	LBB0_1
; %bb.7:
	mov	x0, x19
	mov	w1, #45936
	mov	x2, x21
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #45940
LBB0_8:
	mov	x2, x20
	bl	_nv_wr32
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_nv31_mpeg_mthd_dma
.subsections_via_symbols
