	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function menu_display_d3d9_draw
LCPI0_0:
	.long	0x437f0000                      ## float 255
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x4000000000000000              ## double 2
LCPI0_2:
	.quad	0xbff0000000000000              ## double -1
LCPI0_3:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_menu_display_d3d9_draw:                ## @menu_display_d3d9_draw
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.1:
	movq	%rsi, %r12
	movq	16(%rsi), %rbx
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.2:
	movq	%rdi, %r15
	cmpq	$0, 64(%rdi)
	jne	LBB0_17
## %bb.3:
	movq	40(%r15), %rax
	movl	(%rax), %eax
	addl	(%rbx), %eax
	cmpl	16(%rbx), %eax
	ja	LBB0_17
## %bb.4:
	movl	24(%rbx), %r14d
	movl	8(%rbx), %edi
	callq	_d3d9_vertex_buffer_lock
	testq	%rax, %rax
	je	LBB0_17
## %bb.5:
	movq	%rax, %r13
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r12d
	movq	40(%r15), %rax
	movq	8(%rax), %rbx
	movq	16(%rax), %r8
	movq	24(%rax), %r14
	testq	%rbx, %rbx
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	movq	%r8, %rbx
	callq	_menu_display_d3d9_get_default_vertices
	movq	%rbx, %r8
	movq	%rax, %rbx
LBB0_7:
	testq	%r8, %r8
	jne	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_menu_display_d3d9_get_default_tex_coords
	movq	%rax, %r8
LBB0_9:
	movq	40(%r15), %rax
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.10:
	leaq	(%r12,%r12,2), %rax
	leaq	8(,%rax,8), %r12
	addq	%r13, %r12
	xorl	%r13d, %r13d
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movss	(%r14), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %esi
	movss	4(%r14), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %edx
	movss	8(%r14), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %ecx
	movss	12(%r14), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %edi
	movsd	(%rbx,%r13,8), %xmm0            ## xmm0 = mem[0],zero
	movl	$1056964608, -8(%r12)           ## imm = 0x3F000000
	movsd	(%r8,%r13,8), %xmm1             ## xmm1 = mem[0],zero
	shufps	$17, %xmm0, %xmm1               ## xmm1 = xmm1[1,0],xmm0[1,0]
	cvttps2dq	%xmm1, %xmm0
	movups	%xmm0, (%r12)
	movq	%r8, %r15
	callq	_D3DCOLOR_ARGB
	movq	%r15, %r8
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, -4(%r12)
	incq	%r13
	movq	40(%r15), %rax
	movl	(%rax), %eax
	addq	$24, %r12
	addq	$16, %r14
	cmpq	%rax, %r13
	jb	LBB0_11
LBB0_12:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	8(%r14), %edi
	callq	_d3d9_vertex_buffer_unlock
	cmpq	$0, 56(%r15)
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_14
## %bb.13:
	movq	%r12, %rdi
	callq	_menu_display_d3d9_get_default_mvp
	movq	%rax, 56(%r15)
LBB0_14:
	movl	-52(%rbp), %ebx
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	movl	%ebx, %edi
	movaps	%xmm0, %xmm1
	xorl	%esi, %esi
	callq	_matrix_4x4_scale
	movsd	LCPI0_2(%rip), %xmm0            ## xmm0 = mem[0],zero
	movaps	%xmm0, %xmm1
	xorl	%esi, %esi
	callq	_matrix_4x4_translate
	movl	-48(%rbp), %r13d
	movl	%r13d, %edi
	movl	%ebx, %edx
	callq	_matrix_4x4_multiply
	movq	56(%r15), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movl	%r13d, %edx
	callq	_matrix_4x4_multiply
	movsd	LCPI0_3(%rip), %xmm2            ## xmm2 = mem[0],zero
	movsd	(%r15), %xmm0                   ## xmm0 = mem[0],zero
	mulsd	%xmm2, %xmm0
	divsd	(%r12), %xmm0
	movsd	8(%r15), %xmm1                  ## xmm1 = mem[0],zero
	mulsd	%xmm2, %xmm1
	divsd	8(%r12), %xmm1
	xorl	%esi, %esi
	callq	_matrix_4x4_scale
	movl	%r13d, %edi
	movl	%ebx, %edx
	callq	_matrix_4x4_multiply
	movsd	(%r15), %xmm0                   ## xmm0 = mem[0],zero
	movsd	LCPI0_3(%rip), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	addsd	16(%r15), %xmm0
	divsd	(%r12), %xmm0
	mulsd	8(%r15), %xmm1
	addsd	24(%r15), %xmm1
	divsd	8(%r12), %xmm1
	xorl	%esi, %esi
	callq	_matrix_4x4_translate
	movl	%ebx, %edi
	movl	%r13d, %edx
	callq	_matrix_4x4_multiply
	movl	28(%r14), %esi
	movl	%r13d, %edi
	movl	%ebx, %edx
	callq	_matrix_4x4_multiply
	leaq	-52(%rbp), %rbx
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_d3d_matrix_transpose
	movl	24(%r14), %edi
	movq	%rbx, %rsi
	callq	_d3d9_set_mvp
	cmpq	$0, 48(%r15)
	je	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_menu_display_d3d9_bind_texture
LBB0_16:
	movq	32(%r15), %rdi
	callq	_menu_display_prim_to_d3d9_enum
	movl	(%r14), %edx
	movq	32(%r15), %rcx
	movq	40(%r15), %rsi
	movl	(%rsi), %esi
	movq	_MENU_DISPLAY_PRIM_TRIANGLESTRIP@GOTPCREL(%rip), %r8
	xorl	%edi, %edi
	cmpq	(%r8), %rcx
	setne	%dil
	leal	(%rsi,%rdi,2), %ecx
	addl	$-2, %ecx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_d3d9_draw_primitive
	movq	40(%r15), %rax
	movl	(%rax), %eax
	addl	%eax, (%r14)
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MENU_DISPLAY_PRIM_TRIANGLESTRIP,8,3 ## @MENU_DISPLAY_PRIM_TRIANGLESTRIP
	.no_dead_strip	_menu_display_d3d9_draw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function menu_display_d3d9_draw
_menu_display_d3d9_draw:                ; @menu_display_d3d9_draw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	cbz	x0, LBB0_17
; %bb.1:
	mov	x22, x1
	ldr	x19, [x1, #16]
	cbz	x19, LBB0_17
; %bb.2:
	mov	x20, x0
	ldr	x8, [x0, #64]
	cbnz	x8, LBB0_17
; %bb.3:
	ldr	w8, [x19]
	ldr	x9, [x20, #40]
	ldr	w9, [x9]
	ldr	w10, [x19, #16]
	add	w8, w9, w8
	cmp	w8, w10
	b.hi	LBB0_17
; %bb.4:
	ldr	w21, [x19, #24]
	ldr	w0, [x19, #8]
	bl	_d3d9_vertex_buffer_lock
	cbz	x0, LBB0_17
; %bb.5:
	mov	x25, x0
	str	w21, [sp, #4]                   ; 4-byte Folded Spill
	ldr	w21, [x19]
	ldr	x8, [x20, #40]
	ldp	x23, x24, [x8, #8]
	ldr	x26, [x8, #24]
	cbnz	x23, LBB0_7
; %bb.6:
	bl	_menu_display_d3d9_get_default_vertices
	mov	x23, x0
LBB0_7:
	cbnz	x24, LBB0_9
; %bb.8:
	bl	_menu_display_d3d9_get_default_tex_coords
	mov	x24, x0
LBB0_9:
	ldr	x8, [x20, #40]
	ldr	w8, [x8]
	cbz	w8, LBB0_12
; %bb.10:
	mov	x27, #0
	mov	w8, #24
	madd	x8, x21, x8, x25
	add	x25, x8, #4
	mov	w28, #1132396544
	mov	w21, #1056964608
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	fmov	s0, w28
	ldp	s1, s2, [x26]
	fmul	s1, s1, s0
	fcvtzs	w1, s1
	fmul	s1, s2, s0
	fcvtzs	w2, s1
	ldp	s1, s2, [x26, #8]
	fmul	s1, s1, s0
	fcvtzs	w3, s1
	fmul	s0, s2, s0
	fcvtzs	w0, s0
	ldp	s0, s1, [x23], #8
	stur	w21, [x25, #-4]
	ldr	d2, [x24, x27, lsl #3]
	rev64.2s	v2, v2
	mov.s	v2[2], v1[0]
	mov.s	v2[3], v0[0]
	fcvtzs.4s	v0, v2
	stur	q0, [x25, #4]
	bl	_D3DCOLOR_ARGB
	str	w0, [x25], #24
	add	x27, x27, #1
	ldr	x8, [x20, #40]
	ldr	w8, [x8]
	add	x26, x26, #16
	cmp	x27, x8
	b.lo	LBB0_11
LBB0_12:
	ldr	w0, [x19, #8]
	bl	_d3d9_vertex_buffer_unlock
	ldr	x8, [x20, #56]
	cbnz	x8, LBB0_14
; %bb.13:
	mov	x0, x22
	bl	_menu_display_d3d9_get_default_mvp
	str	x0, [x20, #56]
LBB0_14:
	ldr	w23, [sp, #12]
	fmov	d0, #2.00000000
	fmov	d1, #2.00000000
	mov	x0, x23
	mov	w1, #0
	bl	_matrix_4x4_scale
	fmov	d0, #-1.00000000
	fmov	d1, #-1.00000000
	mov	w1, #0
	bl	_matrix_4x4_translate
	ldr	w24, [sp, #8]
	mov	x0, x24
	mov	x2, x23
	bl	_matrix_4x4_multiply
	ldr	x8, [x20, #56]
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x24
	bl	_matrix_4x4_multiply
	fmov	d8, #0.50000000
	ldp	d0, d1, [x20]
	fmul	d0, d0, d8
	ldp	d2, d3, [x22]
	fdiv	d0, d0, d2
	fmul	d1, d1, d8
	fdiv	d1, d1, d3
	mov	w1, #0
	bl	_matrix_4x4_scale
	mov	x0, x24
	mov	x2, x23
	bl	_matrix_4x4_multiply
	ldp	d0, d1, [x20]
	fmul	d0, d0, d8
	ldp	d2, d3, [x20, #16]
	fadd	d0, d2, d0
	ldp	d2, d4, [x22]
	fdiv	d0, d0, d2
	fmul	d1, d1, d8
	fadd	d1, d3, d1
	fdiv	d1, d1, d4
	mov	w1, #0
	bl	_matrix_4x4_translate
	mov	x0, x23
	mov	x2, x24
	bl	_matrix_4x4_multiply
	ldr	w1, [x19, #28]
	mov	x0, x24
	mov	x2, x23
	bl	_matrix_4x4_multiply
	add	x0, sp, #12
	add	x1, sp, #8
	bl	_d3d_matrix_transpose
	ldr	w0, [x19, #24]
	add	x1, sp, #12
	bl	_d3d9_set_mvp
	ldr	x8, [x20, #48]
	ldr	w21, [sp, #4]                   ; 4-byte Folded Reload
	cbz	x8, LBB0_16
; %bb.15:
	mov	x0, x20
	mov	x1, x19
	bl	_menu_display_d3d9_bind_texture
LBB0_16:
	ldr	x0, [x20, #32]
	bl	_menu_display_prim_to_d3d9_enum
	mov	x1, x0
	ldr	w2, [x19]
	ldp	x9, x8, [x20, #32]
Lloh0:
	adrp	x10, _MENU_DISPLAY_PRIM_TRIANGLESTRIP@GOTPAGE
Lloh1:
	ldr	x10, [x10, _MENU_DISPLAY_PRIM_TRIANGLESTRIP@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	mov	w9, #-2
	csel	w9, w9, wzr, eq
	add	w3, w9, w8
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_d3d9_draw_primitive
	ldr	x8, [x20, #40]
	ldr	w8, [x8]
	ldr	w9, [x19]
	add	w8, w9, w8
	str	w8, [x19]
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MENU_DISPLAY_PRIM_TRIANGLESTRIP,8,3 ; @MENU_DISPLAY_PRIM_TRIANGLESTRIP
	.no_dead_strip	_menu_display_d3d9_draw
.subsections_via_symbols
