	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shader_reg_maps_add_tgsm
_shader_reg_maps_add_tgsm:              ## @shader_reg_maps_add_tgsm
	.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
	movl	%esi, %ebx
	movq	_MAX_TGSM_REGISTERS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jbe	LBB0_1
## %bb.2:
	movl	%ecx, %r14d
	movq	%rdi, %r12
	movq	16(%rdi), %rax
	movq	_WINED3D_SHADER_TYPE_COMPUTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	movl	%edx, %r15d
	leaq	12(%r12), %rsi
	leal	1(%rbx), %r13d
	movq	%r12, %rdi
	movl	%r13d, %edx
	movl	$8, %ecx
	callq	_wined3d_array_reserve
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	8(%r12), %esi
	movl	%r13d, %edi
	callq	_max
	movl	%eax, 8(%r12)
	movq	(%r12), %rax
	movl	%ebx, %ecx
	movl	%r15d, (%rax,%rcx,8)
	movl	%r14d, 4(%rax,%rcx,8)
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_ERR
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_FIXME
LBB0_7:
	movq	_S_OK@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_TGSM_REGISTERS,4,2         ## @MAX_TGSM_REGISTERS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid TGSM register index %u.\n"

	.comm	_S_OK,4,2                       ## @S_OK
	.comm	_WINED3D_SHADER_TYPE_COMPUTE,8,3 ## @WINED3D_SHADER_TYPE_COMPUTE
L_.str.1:                               ## @.str.1
	.asciz	"TGSM declarations are allowed only in compute shaders.\n"

	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.no_dead_strip	_shader_reg_maps_add_tgsm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shader_reg_maps_add_tgsm
_shader_reg_maps_add_tgsm:              ; @shader_reg_maps_add_tgsm
	.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	x19, x1
Lloh0:
	adrp	x8, _MAX_TGSM_REGISTERS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_TGSM_REGISTERS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ls	LBB0_4
; %bb.1:
	mov	x22, x0
	ldr	x8, [x0, #16]
Lloh3:
	adrp	x9, _WINED3D_SHADER_TYPE_COMPUTE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WINED3D_SHADER_TYPE_COMPUTE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	mov	x20, x3
	mov	x21, x2
	add	x1, x22, #12
	add	w23, w19, #1
	mov	x0, x22
	mov	x2, x23
	mov	w3, #8
	bl	_wined3d_array_reserve
	cbz	w0, LBB0_8
; %bb.3:
	ldr	w1, [x22, #8]
	mov	x0, x23
	bl	_max
	str	w0, [x22, #8]
	ldr	x8, [x22]
	add	x8, x8, w19, uxtw #3
	stp	w21, w20, [x8]
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_ERR
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_FIXME
LBB0_6:
Lloh10:
	adrp	x8, _S_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
	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
LBB0_8:
Lloh12:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_TGSM_REGISTERS,4,2         ; @MAX_TGSM_REGISTERS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid TGSM register index %u.\n"

	.comm	_S_OK,4,2                       ; @S_OK
	.comm	_WINED3D_SHADER_TYPE_COMPUTE,8,3 ; @WINED3D_SHADER_TYPE_COMPUTE
l_.str.1:                               ; @.str.1
	.asciz	"TGSM declarations are allowed only in compute shaders.\n"

	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.no_dead_strip	_shader_reg_maps_add_tgsm
.subsections_via_symbols
