	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gl_cg_deinit_progs
_gl_cg_deinit_progs:                    ## @gl_cg_deinit_progs
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.1:
	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
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
	movl	12(%r15), %edi
	callq	_cgGLUnbindProgram
	movl	8(%r15), %edi
	callq	_cgGLUnbindProgram
	movq	_GFX_MAX_SHADERS@GOTPCREL(%rip), %r14
	cmpl	$2, (%r14)
	jb	LBB0_10
## %bb.2:
	movl	$1, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	movl	(%r14), %eax
	addq	$16, %rbx
	cmpq	%rax, %r12
	jae	LBB0_10
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	16(%rax,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	(%rax), %rdi
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	callq	_cgDestroyProgram
	movq	(%r15), %rax
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%rax,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	8(%rax), %rdi
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	callq	_cgDestroyProgram
	jmp	LBB0_9
LBB0_10:
	movq	(%r15), %rdi
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%rax, %rdi
	callq	_cgDestroyProgram
	movq	(%r15), %rdi
LBB0_12:
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%rax, %rdi
	callq	_cgDestroyProgram
	movq	(%r15), %rdi
LBB0_14:
	xorl	%esi, %esi
	movl	$8, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_15:
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[CG]: Destroying programs.\n"

	.comm	_GFX_MAX_SHADERS,4,2            ## @GFX_MAX_SHADERS
	.no_dead_strip	_gl_cg_deinit_progs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gl_cg_deinit_progs
_gl_cg_deinit_progs:                    ; @gl_cg_deinit_progs
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_15
; %bb.1:
	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
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
	ldr	w0, [x19, #12]
	bl	_cgGLUnbindProgram
	ldr	w0, [x19, #8]
	bl	_cgGLUnbindProgram
Lloh2:
	adrp	x20, _GFX_MAX_SHADERS@GOTPAGE
Lloh3:
	ldr	x20, [x20, _GFX_MAX_SHADERS@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #2
	b.lo	LBB0_10
; %bb.2:
	mov	x21, #0
	mov	w22, #1
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	ldr	w8, [x20]
	add	x21, x21, #16
	cmp	x22, x8
	b.hs	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	add	x9, x8, x21
	ldr	x0, [x9, #16]
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x8]
	cmp	x0, x9
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_cgDestroyProgram
	ldr	x8, [x19]
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x8, x21
	ldr	x0, [x9, #24]
	cbz	x0, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x8, #8]
	cmp	x0, x8
	b.eq	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_cgDestroyProgram
	b	LBB0_3
LBB0_10:
	ldr	x0, [x19]
	ldr	x8, [x0]
	cbz	x8, LBB0_12
; %bb.11:
	mov	x0, x8
	bl	_cgDestroyProgram
	ldr	x0, [x19]
LBB0_12:
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_14
; %bb.13:
	mov	x0, x8
	bl	_cgDestroyProgram
	ldr	x0, [x19]
LBB0_14:
	mov	w1, #0
	mov	w2, #8
	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	_memset
LBB0_15:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[CG]: Destroying programs.\n"

	.comm	_GFX_MAX_SHADERS,4,2            ; @GFX_MAX_SHADERS
	.no_dead_strip	_gl_cg_deinit_progs
.subsections_via_symbols
