	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3d8_renderchain_create_first_pass
_d3d8_renderchain_create_first_pass:    ## @d3d8_renderchain_create_first_pass
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movl	(%rdi), %r14d
	movq	_D3DUSAGE_WRITEONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_D3DFVF_XYZ@GOTPCREL(%rip), %rax
	movq	_D3DFVF_TEX1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_D3DFVF_DIFFUSE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_D3DPOOL_MANAGED@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	xorl	%r15d, %r15d
	movl	%r14d, %edi
	movl	$16, %esi
	xorl	%r9d, %r9d
	callq	_d3d8_vertex_buffer_new
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%r12, %r15
	movl	8(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	12(%rbx), %r12d
	cmpq	$0, (%r13)
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_d3d8_get_xrgb8888_format
	jmp	LBB0_4
LBB0_3:
	xorl	%eax, %eax
	callq	_d3d8_get_rgb565_format
LBB0_4:
	movl	(%r15), %ecx
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rsp)
	movl	%ecx, 8(%rsp)
	movl	%eax, (%rsp)
	movl	$0, 56(%rsp)
	movl	$0, 32(%rsp)
	movl	$0, 24(%rsp)
	movl	$0, 16(%rsp)
	xorl	%r15d, %r15d
	movl	%r14d, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_d3d8_texture_new
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_D3DTADDRESS_BORDER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_d3d8_set_sampler_address_u
	movl	(%rbx), %edx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_d3d8_set_sampler_address_v
	movq	_D3DRS_LIGHTING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_d3d8_set_render_state
	movq	_D3DRS_CULLMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_D3DCULL_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	_d3d8_set_render_state
	movq	_D3DRS_ZENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	_d3d8_set_render_state
	movl	$1, %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DUSAGE_WRITEONLY,4,2         ## @D3DUSAGE_WRITEONLY
	.comm	_D3DFVF_XYZ,4,2                 ## @D3DFVF_XYZ
	.comm	_D3DFVF_TEX1,4,2                ## @D3DFVF_TEX1
	.comm	_D3DFVF_DIFFUSE,4,2             ## @D3DFVF_DIFFUSE
	.comm	_D3DPOOL_MANAGED,4,2            ## @D3DPOOL_MANAGED
	.comm	_D3DTADDRESS_BORDER,4,2         ## @D3DTADDRESS_BORDER
	.comm	_D3DRS_LIGHTING,4,2             ## @D3DRS_LIGHTING
	.comm	_D3DRS_CULLMODE,4,2             ## @D3DRS_CULLMODE
	.comm	_D3DCULL_NONE,4,2               ## @D3DCULL_NONE
	.comm	_D3DRS_ZENABLE,4,2              ## @D3DRS_ZENABLE
	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_d3d8_renderchain_create_first_pass
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3d8_renderchain_create_first_pass
_d3d8_renderchain_create_first_pass:    ; @d3d8_renderchain_create_first_pass
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x23, x2
	mov	x20, x1
	ldr	w19, [x0]
Lloh0:
	adrp	x8, _D3DUSAGE_WRITEONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3DUSAGE_WRITEONLY@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _D3DFVF_XYZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _D3DFVF_XYZ@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _D3DFVF_TEX1@GOTPAGE
Lloh7:
	ldr	x9, [x9, _D3DFVF_TEX1@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _D3DFVF_DIFFUSE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _D3DFVF_DIFFUSE@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh11:
	ldr	w9, [x10]
	orr	w3, w8, w9
Lloh12:
	adrp	x24, _D3DPOOL_MANAGED@GOTPAGE
Lloh13:
	ldr	x24, [x24, _D3DPOOL_MANAGED@GOTPAGEOFF]
	ldr	w4, [x24]
	mov	x0, x19
	mov	w1, #16
	mov	x5, #0
	bl	_d3d8_vertex_buffer_new
	str	x0, [x20, #16]
	cbz	x0, LBB0_6
; %bb.1:
	ldp	w22, w21, [x20, #8]
	ldr	x8, [x23]
	cbz	x8, LBB0_3
; %bb.2:
	bl	_d3d8_get_xrgb8888_format
	b	LBB0_4
LBB0_3:
	bl	_d3d8_get_rgb565_format
LBB0_4:
	mov	x6, x0
	ldr	w7, [x24]
	stp	xzr, xzr, [sp, #16]
	str	wzr, [sp, #32]
	str	wzr, [sp, #8]
	str	xzr, [sp]
	mov	x0, x19
	mov	x1, #0
	mov	x2, x21
	mov	x3, x22
	mov	w4, #1
	mov	w5, #0
	bl	_d3d8_texture_new
	str	x0, [x20]
	cbz	x0, LBB0_6
; %bb.5:
Lloh14:
	adrp	x20, _D3DTADDRESS_BORDER@GOTPAGE
Lloh15:
	ldr	x20, [x20, _D3DTADDRESS_BORDER@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	mov	w1, #0
	bl	_d3d8_set_sampler_address_u
	ldr	w2, [x20]
	mov	x0, x19
	mov	w1, #0
	bl	_d3d8_set_sampler_address_v
Lloh16:
	adrp	x8, _D3DRS_LIGHTING@GOTPAGE
Lloh17:
	ldr	x8, [x8, _D3DRS_LIGHTING@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_d3d8_set_render_state
Lloh19:
	adrp	x8, _D3DRS_CULLMODE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _D3DRS_CULLMODE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x8, _D3DCULL_NONE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _D3DCULL_NONE@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_d3d8_set_render_state
Lloh25:
	adrp	x8, _D3DRS_ZENABLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _D3DRS_ZENABLE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _FALSE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_d3d8_set_render_state
	mov	w0, #1
LBB0_6:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DUSAGE_WRITEONLY,4,2         ; @D3DUSAGE_WRITEONLY
	.comm	_D3DFVF_XYZ,4,2                 ; @D3DFVF_XYZ
	.comm	_D3DFVF_TEX1,4,2                ; @D3DFVF_TEX1
	.comm	_D3DFVF_DIFFUSE,4,2             ; @D3DFVF_DIFFUSE
	.comm	_D3DPOOL_MANAGED,4,2            ; @D3DPOOL_MANAGED
	.comm	_D3DTADDRESS_BORDER,4,2         ; @D3DTADDRESS_BORDER
	.comm	_D3DRS_LIGHTING,4,2             ; @D3DRS_LIGHTING
	.comm	_D3DRS_CULLMODE,4,2             ; @D3DRS_CULLMODE
	.comm	_D3DCULL_NONE,4,2               ; @D3DCULL_NONE
	.comm	_D3DRS_ZENABLE,4,2              ; @D3DRS_ZENABLE
	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_d3d8_renderchain_create_first_pass
.subsections_via_symbols
