	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gen_p8_shader
_gen_p8_shader:                         ## @gen_p8_shader
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	8(%rsi), %edi
	callq	_arbfp_texture_target
	movq	%rax, %r15
	cmpq	$0, (%rbx)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_FIXME
LBB0_2:
	leaq	-40(%rbp), %rdi
	callq	_string_buffer_init
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	leaq	-44(%rbp), %rsi
	movl	$1, %edi
	callq	_glGenProgramsARB
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movq	_GL_FRAGMENT_PROGRAM_ARB@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	callq	_glBindProgramARB
	movl	%eax, %edi
	callq	_GL_EXTCALL
	cmpl	$0, -44(%rbp)
	je	LBB0_6
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_shader_addline
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_shader_addline
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_shader_addline
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_shader_addline
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_shader_addline
	leaq	L_.str.7(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_shader_addline
	leaq	L_.str.8(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_shader_addline
	movl	(%r12), %esi
	movl	-40(%rbp), %edx
	movq	%r14, %rdi
	callq	_shader_arb_compile
	movq	%rbx, %rdi
	callq	_string_buffer_free
	movl	-44(%rbp), %eax
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	jmp	LBB0_7
LBB0_6:
	leaq	-40(%rbp), %rdi
	callq	_string_buffer_free
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Implement P8 color keying.\n"

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

	.comm	_GL_FRAGMENT_PROGRAM_ARB,4,2    ## @GL_FRAGMENT_PROGRAM_ARB
L_.str.2:                               ## @.str.2
	.asciz	"!!ARBfp1.0\n"

L_.str.3:                               ## @.str.3
	.asciz	"TEMP index;\n"

L_.str.4:                               ## @.str.4
	.asciz	"PARAM constants = { 0.996, 0.00195, 0, 0 };\n"

L_.str.5:                               ## @.str.5
	.asciz	"TEX index, fragment.texcoord[0], texture[0], %s;\n"

L_.str.6:                               ## @.str.6
	.asciz	"MAD index.a, index.a, constants.x, constants.y;\n"

L_.str.7:                               ## @.str.7
	.asciz	"TEX result.color, index.a, texture[1], 1D;\n"

L_.str.8:                               ## @.str.8
	.asciz	"END\n"

	.no_dead_strip	_gen_p8_shader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gen_p8_shader
_gen_p8_shader:                         ; @gen_p8_shader
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x1, #8]
	bl	_arbfp_texture_target
	mov	x20, x0
	ldr	x8, [x21]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FIXME
LBB0_2:
	add	x0, sp, #8
	bl	_string_buffer_init
	cbz	w0, LBB0_5
; %bb.3:
	add	x1, sp, #12
	mov	w0, #1
	bl	_glGenProgramsARB
	bl	_GL_EXTCALL
Lloh2:
	adrp	x21, _GL_FRAGMENT_PROGRAM_ARB@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GL_FRAGMENT_PROGRAM_ARB@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	w1, [sp, #12]
	bl	_glBindProgramARB
	bl	_GL_EXTCALL
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_6
; %bb.4:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x0, sp, #8
	bl	_shader_addline
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x0, sp, #8
	bl	_shader_addline
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	add	x0, sp, #8
	bl	_shader_addline
	str	x20, [sp]
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	add	x0, sp, #8
	bl	_shader_addline
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	add	x0, sp, #8
	bl	_shader_addline
Lloh14:
	adrp	x1, l_.str.7@PAGE
Lloh15:
	add	x1, x1, l_.str.7@PAGEOFF
	add	x0, sp, #8
	bl	_shader_addline
Lloh16:
	adrp	x1, l_.str.8@PAGE
Lloh17:
	add	x1, x1, l_.str.8@PAGEOFF
	add	x0, sp, #8
	bl	_shader_addline
	ldr	w1, [x21]
	ldr	w2, [sp, #8]
	mov	x0, x19
	bl	_shader_arb_compile
	add	x0, sp, #8
	bl	_string_buffer_free
	ldr	w0, [sp, #12]
	b	LBB0_8
LBB0_5:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
	b	LBB0_7
LBB0_6:
	add	x0, sp, #8
	bl	_string_buffer_free
LBB0_7:
	mov	w0, #0
LBB0_8:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Implement P8 color keying.\n"

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

	.comm	_GL_FRAGMENT_PROGRAM_ARB,4,2    ; @GL_FRAGMENT_PROGRAM_ARB
l_.str.2:                               ; @.str.2
	.asciz	"!!ARBfp1.0\n"

l_.str.3:                               ; @.str.3
	.asciz	"TEMP index;\n"

l_.str.4:                               ; @.str.4
	.asciz	"PARAM constants = { 0.996, 0.00195, 0, 0 };\n"

l_.str.5:                               ; @.str.5
	.asciz	"TEX index, fragment.texcoord[0], texture[0], %s;\n"

l_.str.6:                               ; @.str.6
	.asciz	"MAD index.a, index.a, constants.x, constants.y;\n"

l_.str.7:                               ; @.str.7
	.asciz	"TEX result.color, index.a, texture[1], 1D;\n"

l_.str.8:                               ; @.str.8
	.asciz	"END\n"

	.no_dead_strip	_gen_p8_shader
.subsections_via_symbols
