	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dpu_hw_set_mem_type
_dpu_hw_set_mem_type:                   ## @dpu_hw_set_mem_type
	.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
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movl	%esi, %ebx
	cmpl	$15, %esi
	jg	LBB0_7
## %bb.2:
	movq	_MAX_XIN_COUNT@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jle	LBB0_7
## %bb.3:
	movl	%edx, %r15d
	movq	%rdi, %r14
	cmpl	$8, %ebx
	jl	LBB0_4
## %bb.5:
	movq	_VBIF_OUT_AXI_AMEMTYPE_CONF1@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_VBIF_OUT_AXI_AMEMTYPE_CONF0@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %r12d
	shll	$2, %ebx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_DPU_REG_READ
	movl	$7, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	notl	%edx
	andl	%eax, %edx
	andl	$7, %r15d
	shll	%cl, %r15d
	orl	%edx, %r15d
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DPU_REG_WRITE                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_XIN_COUNT,4,2              ## @MAX_XIN_COUNT
	.comm	_VBIF_OUT_AXI_AMEMTYPE_CONF1,4,2 ## @VBIF_OUT_AXI_AMEMTYPE_CONF1
	.comm	_VBIF_OUT_AXI_AMEMTYPE_CONF0,4,2 ## @VBIF_OUT_AXI_AMEMTYPE_CONF0
	.no_dead_strip	_dpu_hw_set_mem_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dpu_hw_set_mem_type
_dpu_hw_set_mem_type:                   ; @dpu_hw_set_mem_type
	.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
	cbz	x0, LBB0_4
; %bb.1:
	cmp	w1, #15
	b.gt	LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _MAX_XIN_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_XIN_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_4
; %bb.3:
	mov	x20, x2
	mov	x19, x0
Lloh3:
	adrp	x8, _VBIF_OUT_AXI_AMEMTYPE_CONF1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VBIF_OUT_AXI_AMEMTYPE_CONF1@GOTPAGEOFF]
Lloh5:
	adrp	x9, _VBIF_OUT_AXI_AMEMTYPE_CONF0@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VBIF_OUT_AXI_AMEMTYPE_CONF0@GOTPAGEOFF]
	cmp	w1, #7
	csel	x8, x8, x9, gt
	ldr	w21, [x8]
	ubfiz	w22, w1, #2, #3
	mov	x1, x21
	bl	_DPU_REG_READ
	mov	w8, #7
	lsl	w8, w8, w22
	bic	w8, w0, w8
	and	w9, w20, #0x7
	lsl	w9, w9, w22
	orr	w2, w8, w9
	mov	x0, x19
	mov	x1, x21
	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
	b	_DPU_REG_WRITE
LBB0_4:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_XIN_COUNT,4,2              ; @MAX_XIN_COUNT
	.comm	_VBIF_OUT_AXI_AMEMTYPE_CONF1,4,2 ; @VBIF_OUT_AXI_AMEMTYPE_CONF1
	.comm	_VBIF_OUT_AXI_AMEMTYPE_CONF0,4,2 ; @VBIF_OUT_AXI_AMEMTYPE_CONF0
	.no_dead_strip	_dpu_hw_set_mem_type
.subsections_via_symbols
