	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function context_map_vsamplers
_context_map_vsamplers:                 ## @context_map_vsamplers
	.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
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	(%rdx), %rax
	movq	_WINED3D_SHADER_TYPE_VERTEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	_MAX_COMBINED_SAMPLERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %esi
	callq	_min
	movl	%eax, %ebx
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	movq	(%r15), %rax
	movq	_WINED3D_SHADER_TYPE_PIXEL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %r15
	jmp	LBB0_3
LBB0_1:
	xorl	%r15d, %r15d
LBB0_3:
	movq	_MAX_VERTEX_SAMPLERS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_16
## %bb.4:
	decl	%ebx
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r12
	movq	_MAX_VERTEX_SAMPLERS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jge	LBB0_16
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax,%r12,8)
	je	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_MAX_FRAGMENT_SAMPLERS@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	addq	%r12, %r13
	testl	%ebx, %ebx
	js	LBB0_13
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_context_unit_free_for_vs
	testq	%rax, %rax
	jne	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=2
	leal	-1(%rbx), %eax
	testl	%ebx, %ebx
	movl	%eax, %ebx
	jg	LBB0_7
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	$-1, %ebx
	jmp	LBB0_13
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r14), %rax
	cmpl	%ebx, (%rax,%r13,4)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_context_map_stage
	movq	%r13, %rdi
	callq	_STATE_SAMPLER
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_context_invalidate_state
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	decl	%ebx
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r14), %rax
	movl	(%rax,%r13,4), %eax
	movq	_WINED3D_UNMAPPED_STAGE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	callq	_WARN
	jmp	LBB0_15
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_SHADER_TYPE_VERTEX,8,3 ## @WINED3D_SHADER_TYPE_VERTEX
	.comm	_MAX_COMBINED_SAMPLERS,4,2      ## @MAX_COMBINED_SAMPLERS
	.comm	_WINED3D_SHADER_TYPE_PIXEL,8,3  ## @WINED3D_SHADER_TYPE_PIXEL
	.comm	_MAX_VERTEX_SAMPLERS,4,2        ## @MAX_VERTEX_SAMPLERS
	.comm	_MAX_FRAGMENT_SAMPLERS,8,3      ## @MAX_FRAGMENT_SAMPLERS
	.comm	_WINED3D_UNMAPPED_STAGE,4,2     ## @WINED3D_UNMAPPED_STAGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't find a free texture unit for vertex sampler %u.\n"

	.no_dead_strip	_context_map_vsamplers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function context_map_vsamplers
_context_map_vsamplers:                 ; @context_map_vsamplers
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x2]
Lloh0:
	adrp	x9, _WINED3D_SHADER_TYPE_VERTEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WINED3D_SHADER_TYPE_VERTEX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x25, [x8]
	ldr	x8, [x0, #8]
Lloh3:
	adrp	x9, _MAX_COMBINED_SAMPLERS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAX_COMBINED_SAMPLERS@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x9]
	ldr	w1, [x8]
	bl	_min
	cbz	x21, LBB0_2
; %bb.1:
	ldr	x8, [x20]
Lloh6:
	adrp	x9, _WINED3D_SHADER_TYPE_PIXEL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WINED3D_SHADER_TYPE_PIXEL@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x20, [x8]
	b	LBB0_3
LBB0_2:
	mov	x20, #0
LBB0_3:
Lloh9:
	adrp	x26, _MAX_VERTEX_SAMPLERS@GOTPAGE
Lloh10:
	ldr	x26, [x26, _MAX_VERTEX_SAMPLERS@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.4:
	mov	x21, #0
	sub	w22, w0, #1
Lloh11:
	adrp	x27, _MAX_FRAGMENT_SAMPLERS@GOTPAGE
Lloh12:
	ldr	x27, [x27, _MAX_FRAGMENT_SAMPLERS@GOTPAGEOFF]
Lloh13:
	adrp	x28, _WINED3D_UNMAPPED_STAGE@GOTPAGE
Lloh14:
	ldr	x28, [x28, _WINED3D_UNMAPPED_STAGE@GOTPAGEOFF]
Lloh15:
	adrp	x23, l_.str@PAGE
Lloh16:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x26]
	cmp	x21, x8
	b.ge	LBB0_16
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [x25, x21, lsl #3]
	cbz	x8, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x27]
	add	x24, x8, x21
	tbnz	w22, #31, LBB0_14
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_context_unit_free_for_vs
	cbnz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	sub	w8, w22, #1
	cmp	w22, #0
	mov	x22, x8
	b.gt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #-1
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19]
	ldr	w8, [x8, x24, lsl #2]
	cmp	w8, w22
	b.eq	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	mov	x1, x24
	mov	x2, x22
	bl	_context_map_stage
	mov	x0, x24
	bl	_STATE_SAMPLER
	mov	x1, x0
	mov	x0, x19
	bl	_context_invalidate_state
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w22, w22, #1
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19]
	ldr	w8, [x8, x24, lsl #2]
	ldr	w9, [x28]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_WARN
	b	LBB0_5
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_SHADER_TYPE_VERTEX,8,3 ; @WINED3D_SHADER_TYPE_VERTEX
	.comm	_MAX_COMBINED_SAMPLERS,4,2      ; @MAX_COMBINED_SAMPLERS
	.comm	_WINED3D_SHADER_TYPE_PIXEL,8,3  ; @WINED3D_SHADER_TYPE_PIXEL
	.comm	_MAX_VERTEX_SAMPLERS,4,2        ; @MAX_VERTEX_SAMPLERS
	.comm	_MAX_FRAGMENT_SAMPLERS,8,3      ; @MAX_FRAGMENT_SAMPLERS
	.comm	_WINED3D_UNMAPPED_STAGE,4,2     ; @WINED3D_UNMAPPED_STAGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't find a free texture unit for vertex sampler %u.\n"

	.no_dead_strip	_context_map_vsamplers
.subsections_via_symbols
