	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hlsl_d3d9_renderchain_init
_hlsl_d3d9_renderchain_init:            ## @hlsl_d3d9_renderchain_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movl	%edx, %r14d
	movq	(%rdi), %rbx
	testl	%r9d, %r9d
	jne	LBB0_1
## %bb.2:
	movq	_RETRO_PIXEL_FORMAT_RGB565@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_RETRO_PIXEL_FORMAT_XRGB8888@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r15d, %r15d
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.4:
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	(%rax), %r12d
	movq	%rbx, %rsi
	callq	_hlsl_d3d9_renderchain_init_shader
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%r14d, 12(%rbx)
	movq	%r13, 24(%rbx)
	movq	$0, 16(%rbx)
	movq	_RETRO_PIXEL_FORMAT_RGB565@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	(%rax), %r12d
	leaq	8(%rbx), %rsi
	setne	%cl
	leal	(%rcx,%rcx), %eax
	addl	$2, %eax
	movl	%eax, 8(%rbx)
	movl	%r14d, %edi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%r12d, %ecx
	callq	_hlsl_d3d9_renderchain_create_first_pass
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	12(%rbx), %edi
	movq	_stock_hlsl_program@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_d3d9_hlsl_load_program
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_d3d9_hlsl_bind_program
	movl	$1, %r15d
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_ERR
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRO_PIXEL_FORMAT_XRGB8888,4,2 ## @RETRO_PIXEL_FORMAT_XRGB8888
	.comm	_RETRO_PIXEL_FORMAT_RGB565,4,2  ## @RETRO_PIXEL_FORMAT_RGB565
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[D3D9 HLSL]: Failed to initialize shader subsystem.\n"

	.comm	_stock_hlsl_program,4,2         ## @stock_hlsl_program
	.no_dead_strip	_hlsl_d3d9_renderchain_init
.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_init
_hlsl_d3d9_renderchain_init:            ; @hlsl_d3d9_renderchain_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _RETRO_PIXEL_FORMAT_XRGB8888@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RETRO_PIXEL_FORMAT_XRGB8888@GOTPAGEOFF]
Lloh2:
	adrp	x24, _RETRO_PIXEL_FORMAT_RGB565@GOTPAGE
Lloh3:
	ldr	x24, [x24, _RETRO_PIXEL_FORMAT_RGB565@GOTPAGEOFF]
	cmp	w5, #0
	csel	x8, x24, x8, eq
	cbz	x20, LBB0_6
; %bb.1:
	mov	x21, x4
	mov	x22, x3
	mov	x19, x2
	ldr	w23, [x8]
	mov	x1, x20
	bl	_hlsl_d3d9_renderchain_init_shader
	cbz	w0, LBB0_5
; %bb.2:
	ldr	w8, [x24]
	mov	w9, #4
	mov	w10, #2
	cmp	w23, w8
	csel	w8, w10, w9, eq
	mov	x1, x20
	stp	w8, w19, [x1, #8]!
	stp	xzr, x22, [x1, #8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x23
	bl	_hlsl_d3d9_renderchain_create_first_pass
	cbz	w0, LBB0_7
; %bb.3:
	ldr	w0, [x20, #12]
Lloh4:
	adrp	x8, _stock_hlsl_program@GOTPAGE
Lloh5:
	ldr	x8, [x8, _stock_hlsl_program@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_d3d9_hlsl_load_program
	cbz	w0, LBB0_7
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	bl	_d3d9_hlsl_bind_program
	mov	w0, #1
	b	LBB0_7
LBB0_5:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRO_PIXEL_FORMAT_XRGB8888,4,2 ; @RETRO_PIXEL_FORMAT_XRGB8888
	.comm	_RETRO_PIXEL_FORMAT_RGB565,4,2  ; @RETRO_PIXEL_FORMAT_RGB565
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[D3D9 HLSL]: Failed to initialize shader subsystem.\n"

	.comm	_stock_hlsl_program,4,2         ; @stock_hlsl_program
	.no_dead_strip	_hlsl_d3d9_renderchain_init
.subsections_via_symbols
