	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_arb_pshader
_find_arb_pshader:                      ## @find_arb_pshader
	.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
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	movq	8(%rax), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%rdi)
	jne	LBB0_6
## %bb.1:
	movq	(%rax), %r15
	movl	$40, %edi
	callq	_heap_alloc_zero
	movq	%rax, %r12
	movq	%rax, (%r14)
	movl	8(%r14), %eax
	xorl	%ecx, %ecx
	cmpl	$1, %eax
	sete	%cl
	movl	%ecx, (%r12)
	movl	$-1, %ebx
	movl	$-1, %esi
	cmpl	$3, %eax
	jl	LBB0_3
## %bb.2:
	leaq	12(%r14), %rsi
	movq	%r15, %rdi
	callq	_find_input_signature
	movl	%eax, %esi
LBB0_3:
	movl	%esi, 4(%r12)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 8(%rax)
	jne	LBB0_5
## %bb.4:
	leaq	8(%r14), %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	decq	%rsi
	callq	_shader_find_free_input_register
	movl	%eax, %ebx
LBB0_5:
	movl	%ebx, 8(%r12)
LBB0_6:
	movq	(%r14), %r15
	cmpq	$0, 16(%r15)
	je	LBB0_11
## %bb.7:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r15), %rax
	leaq	(%rax,%r12), %rdi
	addq	$4, %rdi
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_memcmp
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	addq	$8, %r12
	cmpq	16(%r15), %rbx
	jb	LBB0_8
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	16(%r15), %rcx
	movq	24(%r15), %rbx
	cmpq	%rcx, %rbx
	jne	LBB0_12
## %bb.13:
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.14:
	movq	%rbx, %rsi
	shrq	%rsi
	movl	$1, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_max
	movl	%eax, %r12d
	addq	%rbx, %r12
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	32(%r15), %rdx
	leal	(,%r12,8), %ecx
	movl	%eax, %edi
	callq	_HeapReAlloc
	movslq	%r12d, %rcx
	testq	%rax, %rax
	je	LBB0_17
LBB0_19:
	movq	%rax, 32(%r15)
	movq	%rcx, 24(%r15)
	movq	16(%r15), %rcx
	jmp	LBB0_20
LBB0_12:
	movq	32(%r15), %rax
LBB0_20:
	movl	(%r13), %edx
	movl	%edx, 4(%rax,%rcx,8)
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_pixelshader_update_resource_types
	leaq	-56(%rbp), %rdi
	callq	_string_buffer_init
	testl	%eax, %eax
	je	LBB0_21
## %bb.22:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	addq	$16, %rsi
	movq	16(%r15), %r8
	shlq	$3, %r8
	addq	32(%r15), %r8
	leaq	-56(%rbp), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movq	%r13, %rcx
	callq	_shader_arb_generate_pshader
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_string_buffer_free
	movq	16(%r15), %rax
	movq	32(%r15), %rcx
	leaq	(%rcx,%rax,8), %r12
	movl	%r14d, (%rcx,%rax,8)
	incq	%rax
	movq	%rax, 16(%r15)
	jmp	LBB0_23
LBB0_9:
	addq	32(%r15), %r12
	jmp	LBB0_23
LBB0_21:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_18
LBB0_15:
	movl	$8, %edi
	callq	_heap_alloc_zero
	movl	$1, %ecx
	testq	%rax, %rax
	jne	LBB0_19
LBB0_17:
	leaq	L_.str.2(%rip), %rdi
LBB0_18:
	callq	_ERR
	xorl	%r12d, %r12d
LBB0_23:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Shader got assigned input signature index %u\n"

L_.str.1:                               ## @.str.1
	.asciz	"No matching GL shader found, compiling a new shader\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
L_.str.2:                               ## @.str.2
	.asciz	"Out of memory\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to initialize shader buffer.\n"

	.no_dead_strip	_find_arb_pshader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_arb_pshader
_find_arb_pshader:                      ; @find_arb_pshader
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x24, [x8, #8]
	ldr	x9, [x0]
	cbnz	x9, LBB0_8
; %bb.1:
	ldr	x23, [x8]
	mov	w0, #40
	bl	_heap_alloc_zero
	mov	x21, x0
	str	x0, [x20]
	mov	x22, x20
	ldr	w8, [x22, #8]!
	cmp	w8, #1
	cset	w9, eq
	str	w9, [x0]
	cmp	w8, #3
	b.ge	LBB0_3
; %bb.2:
	mov	w0, #-1
	b	LBB0_4
LBB0_3:
	add	x1, x20, #12
	mov	x0, x23
	bl	_find_input_signature
                                        ; kill: def $w0 killed $w0 def $x0
LBB0_4:
	str	w0, [x21, #4]
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	w8, [x24, #8]
	cbz	w8, LBB0_6
; %bb.5:
	mov	w0, #-1
	b	LBB0_7
LBB0_6:
	ldr	x8, [x24]
	sub	x1, x8, #1
	mov	x0, x22
	bl	_shader_find_free_input_register
LBB0_7:
	str	w0, [x21, #8]
LBB0_8:
	ldr	x21, [x20]
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_12
; %bb.9:
	mov	x22, #0
	mov	x23, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #32]
	add	x8, x8, x22
	add	x0, x8, #4
	mov	x1, x19
	mov	w2, #4
	bl	_memcmp
	cbz	w0, LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x23, x23, #1
	ldr	x8, [x21, #16]
	add	x22, x22, #8
	cmp	x23, x8
	b.lo	LBB0_10
LBB0_12:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldp	x8, x22, [x21, #16]
	cmp	x22, x8
	b.ne	LBB0_16
; %bb.13:
	cbz	x22, LBB0_21
; %bb.14:
	lsr	x1, x22, #1
	mov	w0, #1
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_max
	add	x22, x22, w0, uxtw
	bl	_GetProcessHeap
Lloh4:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	x2, [x21, #32]
	lsl	w3, w22, #3
	bl	_HeapReAlloc
	sxtw	x8, w22
	cbz	x0, LBB0_22
LBB0_15:
	stp	x8, x0, [x21, #24]
	ldr	x8, [x21, #16]
	b	LBB0_17
LBB0_16:
	ldr	x0, [x21, #32]
LBB0_17:
	add	x8, x0, x8, lsl #3
	ldr	w9, [x19]
	str	w9, [x8, #4]
	ldr	w1, [x19]
	mov	x0, x20
	bl	_pixelshader_update_resource_types
	add	x0, sp, #8
	bl	_string_buffer_init
	cbz	w0, LBB0_20
; %bb.18:
	add	x1, x24, #16
	ldr	x8, [x21, #32]
	ldr	x9, [x21, #16]
	add	x4, x8, x9, lsl #3
	add	x2, sp, #8
	mov	x0, x20
	mov	x3, x19
	bl	_shader_arb_generate_pshader
	mov	x19, x0
	add	x0, sp, #8
	bl	_string_buffer_free
	ldr	x8, [x21, #32]
	ldr	x9, [x21, #16]
	add	x0, x8, x9, lsl #3
	str	w19, [x0]
	add	x8, x9, #1
	str	x8, [x21, #16]
	b	LBB0_24
LBB0_19:
	ldr	x8, [x21, #32]
	add	x0, x8, x22
	b	LBB0_24
LBB0_20:
Lloh7:
	adrp	x0, l_.str.3@PAGE
Lloh8:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_23
LBB0_21:
	mov	w0, #8
	bl	_heap_alloc_zero
	mov	w8, #1
	cbnz	x0, LBB0_15
LBB0_22:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_23:
	bl	_ERR
	mov	x0, #0
LBB0_24:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Shader got assigned input signature index %u\n"

l_.str.1:                               ; @.str.1
	.asciz	"No matching GL shader found, compiling a new shader\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
l_.str.2:                               ; @.str.2
	.asciz	"Out of memory\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to initialize shader buffer.\n"

	.no_dead_strip	_find_arb_pshader
.subsections_via_symbols
