	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_tex_resource
_set_tex_resource:                      ## @set_tex_resource
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r14d
	movl	%edx, %r12d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	16(%rbp), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	shlq	$2, %rbx
	addq	(%rdi), %rbx
	cmpl	$2, %ecx
	movl	$1, %r13d
	cmovgel	%ecx, %r13d
	movq	_SQ_TEX_DIM_2D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TEX_DIM
	leal	-64(,%r14,8), %ecx
	andl	$-64, %ecx
	shll	$18, %r12d
	addl	$-262144, %r12d                 ## imm = 0xFFFC0000
	orl	%ecx, %r12d
	orl	%eax, %r12d
	decl	%r13d
	movq	_ARRAY_1D_TILED_THIN1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TEX_ARRAY_MODE
	orl	%eax, %r13d
	movq	_SQ_SEL_X@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TEX_DST_SEL_X
	movl	%eax, %r15d
	movq	_SQ_SEL_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TEX_DST_SEL_Y
	orl	%eax, %r15d
	movq	_SQ_SEL_Z@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TEX_DST_SEL_Z
	movl	%eax, %r14d
	movq	_SQ_SEL_W@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TEX_DST_SEL_W
	orl	%eax, %r14d
	orl	%r15d, %r14d
	movq	_SQ_TEX_VTX_VALID_TEXTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_S__SQ_CONSTANT_TYPE
	orl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	movq	_PACKET3_TC_ACTION_ENA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %ecx
	callq	_cp_set_surface_sync
	movq	_PACKET3_SET_RESOURCE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$8, %esi
	callq	_PACKET3
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_radeon_ring_write
	sarl	$8, %r15d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_radeon_ring_write              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
	.comm	_SQ_TEX_DIM_2D,4,2              ## @SQ_TEX_DIM_2D
	.comm	_ARRAY_1D_TILED_THIN1,4,2       ## @ARRAY_1D_TILED_THIN1
	.comm	_SQ_SEL_X,4,2                   ## @SQ_SEL_X
	.comm	_SQ_SEL_Y,4,2                   ## @SQ_SEL_Y
	.comm	_SQ_SEL_Z,4,2                   ## @SQ_SEL_Z
	.comm	_SQ_SEL_W,4,2                   ## @SQ_SEL_W
	.comm	_SQ_TEX_VTX_VALID_TEXTURE,4,2   ## @SQ_TEX_VTX_VALID_TEXTURE
	.comm	_PACKET3_TC_ACTION_ENA,4,2      ## @PACKET3_TC_ACTION_ENA
	.comm	_PACKET3_SET_RESOURCE,4,2       ## @PACKET3_SET_RESOURCE
	.no_dead_strip	_set_tex_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_tex_resource
_set_tex_resource:                      ; @set_tex_resource
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x6
	mov	x20, x5
	mov	x22, x4
	mov	x23, x2
	mov	x25, x1
	mov	x24, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x19, x8, x9, lsl #2
	cmp	w3, #1
	csinc	w26, w3, wzr, gt
Lloh3:
	adrp	x8, _SQ_TEX_DIM_2D@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SQ_TEX_DIM_2D@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_TEX_DIM
	lsl	w8, w22, #3
	sub	w8, w8, #64
	and	w8, w8, #0xffffffc0
	lsl	w9, w23, #18
	sub	w9, w9, #64, lsl #12            ; =262144
	orr	w8, w8, w9
	orr	w22, w8, w0
	sub	w23, w26, #1
Lloh6:
	adrp	x8, _ARRAY_1D_TILED_THIN1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ARRAY_1D_TILED_THIN1@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_TEX_ARRAY_MODE
	orr	w23, w0, w23
Lloh9:
	adrp	x8, _SQ_SEL_X@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SQ_SEL_X@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_TEX_DST_SEL_X
	mov	x26, x0
Lloh12:
	adrp	x8, _SQ_SEL_Y@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SQ_SEL_Y@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_TEX_DST_SEL_Y
	orr	w26, w0, w26
Lloh15:
	adrp	x8, _SQ_SEL_Z@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SQ_SEL_Z@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_TEX_DST_SEL_Z
	orr	w26, w26, w0
Lloh18:
	adrp	x8, _SQ_SEL_W@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SQ_SEL_W@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_TEX_DST_SEL_W
	orr	w26, w26, w0
Lloh21:
	adrp	x8, _SQ_TEX_VTX_VALID_TEXTURE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SQ_TEX_VTX_VALID_TEXTURE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_S__SQ_CONSTANT_TYPE
	orr	w25, w0, w25
Lloh24:
	adrp	x8, _PACKET3_TC_ACTION_ENA@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PACKET3_TC_ACTION_ENA@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x24
	mov	x2, x21
	mov	x3, x20
	bl	_cp_set_surface_sync
Lloh27:
	adrp	x8, _PACKET3_SET_RESOURCE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PACKET3_SET_RESOURCE@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	mov	w1, #8
	bl	_PACKET3
	mov	x1, x0
	mov	x0, x19
	bl	_radeon_ring_write
	mov	x0, x19
	mov	w1, #0
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x22
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x23
	bl	_radeon_ring_write
	asr	w20, w20, #8
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x26
	bl	_radeon_ring_write
	mov	x0, x19
	mov	w1, #0
	bl	_radeon_ring_write
	mov	x0, x19
	mov	w1, #0
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_radeon_ring_write
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
	.comm	_SQ_TEX_DIM_2D,4,2              ; @SQ_TEX_DIM_2D
	.comm	_ARRAY_1D_TILED_THIN1,4,2       ; @ARRAY_1D_TILED_THIN1
	.comm	_SQ_SEL_X,4,2                   ; @SQ_SEL_X
	.comm	_SQ_SEL_Y,4,2                   ; @SQ_SEL_Y
	.comm	_SQ_SEL_Z,4,2                   ; @SQ_SEL_Z
	.comm	_SQ_SEL_W,4,2                   ; @SQ_SEL_W
	.comm	_SQ_TEX_VTX_VALID_TEXTURE,4,2   ; @SQ_TEX_VTX_VALID_TEXTURE
	.comm	_PACKET3_TC_ACTION_ENA,4,2      ; @PACKET3_TC_ACTION_ENA
	.comm	_PACKET3_SET_RESOURCE,4,2       ; @PACKET3_SET_RESOURCE
	.no_dead_strip	_set_tex_resource
.subsections_via_symbols
