	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function hlsl_d3d9_renderchain_create_first_pass
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_hlsl_d3d9_renderchain_create_first_pass: ## @hlsl_d3d9_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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r13
	movl	%edi, %r15d
	movq	_RETRO_PIXEL_FORMAT_RGB565@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_d3d9_get_rgb565_format
	jmp	LBB0_3
LBB0_2:
	xorl	%eax, %eax
	callq	_d3d9_get_xrgb8888_format
LBB0_3:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movups	(%r14), %xmm0
	movups	%xmm0, -64(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -80(%rbp)
	xorl	%eax, %eax
	callq	_unsigned_vector_list_new
	movq	%rax, -88(%rbp)
	movq	$0, 40(%r13)
	movq	_TEXTURES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_9
## %bb.4:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %rax
	movq	$0, (%rax,%r12,8)
	movq	24(%r13), %rax
	movq	$0, (%rax,%r12,8)
	movl	4(%r13), %edi
	movq	_D3DUSAGE_WRITEONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_D3DPOOL_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$16, %esi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_d3d9_vertex_buffer_new
	movq	16(%r13), %rcx
	movq	%rax, (%rcx,%r12,8)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r13), %edi
	movl	8(%r14), %ecx
	movl	12(%r14), %edx
	movq	_D3DPOOL_MANAGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rsp)
	movl	%eax, 8(%rsp)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movl	$0, 56(%rsp)
	movl	$0, 32(%rsp)
	movl	$0, 24(%rsp)
	movl	$0, 16(%rsp)
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_d3d9_texture_new
	movq	8(%r13), %rcx
	movq	%rax, (%rcx,%r12,8)
	movq	8(%r13), %rax
	movq	(%rax,%r12,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r13), %edi
	xorl	%esi, %esi
	callq	_d3d9_set_texture
	movq	(%r14), %rax
	movl	4(%rax), %edi
	callq	_d3d_translate_filter
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_d3d9_set_sampler_minfilter
	movq	(%r14), %rax
	movl	4(%rax), %edi
	callq	_d3d_translate_filter
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_d3d9_set_sampler_magfilter
	movq	_D3DTADDRESS_BORDER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	%r15d, %edi
	xorl	%esi, %esi
	callq	_d3d9_set_sampler_address_u
	movl	(%rbx), %edx
	movl	%r15d, %edi
	xorl	%esi, %esi
	callq	_d3d9_set_sampler_address_v
	movl	4(%r13), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_d3d9_set_texture
	incq	%r12
	movq	_TEXTURES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %r12
	jb	LBB0_5
LBB0_9:
	movl	4(%r13), %edi
	movq	(%r14), %rax
	movl	(%rax), %edx
	leaq	-88(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_d3d9_hlsl_load_program_from_file
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_hlsl_d3d9_renderchain_init_shader_fvf
	movl	$0, %ebx
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	(%r13), %edi
	movq	-56(%rbp), %rax
	movq	%rax, 32(%rsp)
	movups	-88(%rbp), %xmm0
	movups	-72(%rbp), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_shader_pass_vector_list_append
	movl	$1, %ebx
	jmp	LBB0_11
LBB0_6:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRO_PIXEL_FORMAT_RGB565,4,2  ## @RETRO_PIXEL_FORMAT_RGB565
	.comm	_TEXTURES,4,2                   ## @TEXTURES
	.comm	_D3DUSAGE_WRITEONLY,4,2         ## @D3DUSAGE_WRITEONLY
	.comm	_D3DPOOL_DEFAULT,4,2            ## @D3DPOOL_DEFAULT
	.comm	_D3DPOOL_MANAGED,4,2            ## @D3DPOOL_MANAGED
	.comm	_D3DTADDRESS_BORDER,4,2         ## @D3DTADDRESS_BORDER
	.no_dead_strip	_hlsl_d3d9_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 hlsl_d3d9_renderchain_create_first_pass
_hlsl_d3d9_renderchain_create_first_pass: ; @hlsl_d3d9_renderchain_create_first_pass
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x28, x27, [sp, #128]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _RETRO_PIXEL_FORMAT_RGB565@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RETRO_PIXEL_FORMAT_RGB565@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w3
	b.ne	LBB0_2
; %bb.1:
	bl	_d3d9_get_rgb565_format
	b	LBB0_3
LBB0_2:
	bl	_d3d9_get_xrgb8888_format
LBB0_3:
	mov	x22, x0
	ldr	q0, [x20]
	stur	q0, [sp, #112]
	stp	xzr, xzr, [sp, #96]
	bl	_unsigned_vector_list_new
	str	x0, [sp, #88]
	str	xzr, [x19, #40]
Lloh3:
	adrp	x23, _TEXTURES@GOTPAGE
Lloh4:
	ldr	x23, [x23, _TEXTURES@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_8
; %bb.4:
	mov	x24, #0
Lloh5:
	adrp	x25, _D3DUSAGE_WRITEONLY@GOTPAGE
Lloh6:
	ldr	x25, [x25, _D3DUSAGE_WRITEONLY@GOTPAGEOFF]
Lloh7:
	adrp	x26, _D3DPOOL_DEFAULT@GOTPAGE
Lloh8:
	ldr	x26, [x26, _D3DPOOL_DEFAULT@GOTPAGEOFF]
Lloh9:
	adrp	x28, _D3DTADDRESS_BORDER@GOTPAGE
Lloh10:
	ldr	x28, [x28, _D3DTADDRESS_BORDER@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	lsl	x27, x24, #3
	str	xzr, [x8, x27]
	ldr	x8, [x19, #24]
	str	xzr, [x8, x27]
	ldr	w0, [x19, #4]
	ldr	w2, [x25]
	ldr	w4, [x26]
	mov	w1, #16
	mov	w3, #0
	mov	x5, #0
	bl	_d3d9_vertex_buffer_new
	ldr	x8, [x19, #16]
	str	x0, [x8, x27]
	cbz	x0, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #4]
	ldp	w3, w2, [x20, #8]
Lloh11:
	adrp	x8, _D3DPOOL_MANAGED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _D3DPOOL_MANAGED@GOTPAGEOFF]
Lloh13:
	ldr	w7, [x8]
	stp	xzr, xzr, [sp, #16]
	str	wzr, [sp, #32]
	str	wzr, [sp, #8]
	str	xzr, [sp]
	mov	x1, #0
	mov	w4, #1
	mov	w5, #0
	mov	x6, x22
	bl	_d3d9_texture_new
	ldr	x8, [x19, #8]
	str	x0, [x8, x27]
	ldr	x8, [x19, #8]
	ldr	x2, [x8, x27]
	cbz	x2, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #4]
	mov	w1, #0
	bl	_d3d9_set_texture
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	_d3d_translate_filter
	mov	x2, x0
	mov	x0, x21
	mov	w1, #0
	bl	_d3d9_set_sampler_minfilter
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	_d3d_translate_filter
	mov	x2, x0
	mov	x0, x21
	mov	w1, #0
	bl	_d3d9_set_sampler_magfilter
	ldr	w2, [x28]
	mov	x0, x21
	mov	w1, #0
	bl	_d3d9_set_sampler_address_u
	ldr	w2, [x28]
	mov	x0, x21
	mov	w1, #0
	bl	_d3d9_set_sampler_address_v
	ldr	w0, [x19, #4]
	mov	w1, #0
	mov	x2, #0
	bl	_d3d9_set_texture
	add	x24, x24, #1
	ldr	w8, [x23]
	cmp	x24, x8
	b.lo	LBB0_5
LBB0_8:
	ldr	w0, [x19, #4]
	ldr	x8, [x20]
	ldr	w2, [x8]
	add	x1, sp, #88
	bl	_d3d9_hlsl_load_program_from_file
	add	x1, sp, #88
	mov	x0, x19
	bl	_hlsl_d3d9_renderchain_init_shader_fvf
	cbz	w0, LBB0_11
; %bb.9:
	ldr	w0, [x19]
	ldur	q0, [sp, #88]
	ldur	q1, [sp, #104]
	stp	q0, q1, [sp, #48]
	ldr	x8, [sp, #120]
	str	x8, [sp, #80]
	add	x1, sp, #48
	bl	_shader_pass_vector_list_append
	mov	w0, #1
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRO_PIXEL_FORMAT_RGB565,4,2  ; @RETRO_PIXEL_FORMAT_RGB565
	.comm	_TEXTURES,4,2                   ; @TEXTURES
	.comm	_D3DUSAGE_WRITEONLY,4,2         ; @D3DUSAGE_WRITEONLY
	.comm	_D3DPOOL_DEFAULT,4,2            ; @D3DPOOL_DEFAULT
	.comm	_D3DPOOL_MANAGED,4,2            ; @D3DPOOL_MANAGED
	.comm	_D3DTADDRESS_BORDER,4,2         ; @D3DTADDRESS_BORDER
	.no_dead_strip	_hlsl_d3d9_renderchain_create_first_pass
.subsections_via_symbols
