	.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_d3d8_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_d3d8_draw:                ## @menu_display_d3d8_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	$56, %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_21
## %bb.1:
	movq	%rsi, %r14
	movq	16(%rsi), %rbx
	testq	%rbx, %rbx
	je	LBB0_21
## %bb.2:
	movq	%rdi, %r13
	cmpq	$0, 64(%rdi)
	jne	LBB0_21
## %bb.3:
	movq	40(%r13), %rax
	movl	(%rax), %eax
	addl	(%rbx), %eax
	cmpl	8(%rbx), %eax
	ja	LBB0_21
## %bb.4:
	movl	4(%rbx), %edi
	callq	_d3d8_vertex_buffer_lock
	testq	%rax, %rax
	je	LBB0_21
## %bb.5:
	movq	%rax, %r12
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r15d
	movq	40(%r13), %rax
	movq	8(%rax), %rcx
	movq	16(%rax), %rbx
	movq	24(%rax), %r14
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_menu_display_d3d8_get_default_vertices
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
LBB0_7:
	testq	%rbx, %rbx
	jne	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_menu_display_d3d8_get_default_tex_coords
	movq	%rax, %rbx
LBB0_9:
	movq	40(%r13), %rax
	cmpl	$0, (%rax)
	je	LBB0_16
## %bb.10:
	leaq	(%r15,%r15,2), %rax
	leaq	(%r12,%rax,8), %r15
	addq	$12, %r15
	xorl	%r12d, %r12d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	movss	-64(%rbp), %xmm2                ## 4-byte Reload
                                        ## xmm2 = mem[0],zero,zero,zero
	movss	-60(%rbp), %xmm3                ## 4-byte Reload
                                        ## xmm3 = mem[0],zero,zero,zero
	movss	-56(%rbp), %xmm4                ## 4-byte Reload
                                        ## xmm4 = mem[0],zero,zero,zero
	movss	-52(%rbp), %xmm5                ## 4-byte Reload
                                        ## xmm5 = mem[0],zero,zero,zero
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	cvttss2si	%xmm2, %esi
	cvttss2si	%xmm3, %edx
	cvttss2si	%xmm4, %ecx
	cvttss2si	%xmm5, %edi
	callq	_D3DCOLOR_ARGB
	movl	%eax, -8(%r15)
	incq	%r12
	movq	40(%r13), %rax
	movl	(%rax), %eax
	addq	$24, %r15
	addq	$16, %r14
	cmpq	%rax, %r12
	jae	LBB0_16
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movss	(%r14), %xmm2                   ## xmm2 = mem[0],zero,zero,zero
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm2
	movss	4(%r14), %xmm3                  ## xmm3 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm3
	movss	8(%r14), %xmm4                  ## xmm4 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm4
	movss	12(%r14), %xmm5                 ## xmm5 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm5
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movsd	(%rax,%r12,8), %xmm0            ## xmm0 = mem[0],zero
	movl	$1056964608, -12(%r15)          ## imm = 0x3F000000
	movsd	(%rbx,%r12,8), %xmm1            ## xmm1 = mem[0],zero
	shufps	$17, %xmm0, %xmm1               ## xmm1 = xmm1[1,0],xmm0[1,0]
	cvttps2dq	%xmm1, %xmm0
	movups	%xmm0, -4(%r15)
	movq	48(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movss	%xmm5, -52(%rbp)                ## 4-byte Spill
	movss	%xmm4, -56(%rbp)                ## 4-byte Spill
	movss	%xmm3, -60(%rbp)                ## 4-byte Spill
	movss	%xmm2, -64(%rbp)                ## 4-byte Spill
	xorl	%esi, %esi
	leaq	-48(%rbp), %rdx
	callq	_d3d8_texture_get_level_desc
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	-4(%r15), %eax
	movl	(%r15), %ecx
	imull	-44(%rbp), %ecx
	movl	%ecx, (%r15)
	imull	-48(%rbp), %eax
	movl	%eax, -4(%r15)
	jmp	LBB0_14
LBB0_16:
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	movl	4(%r14), %edi
	callq	_d3d8_vertex_buffer_unlock
	cmpq	$0, 56(%r13)
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	callq	_menu_display_d3d8_get_default_mvp
	movq	%rax, 56(%r13)
LBB0_18:
	movl	-48(%rbp), %r12d
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	movl	%r12d, %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	-68(%rbp), %ebx
	movl	%ebx, %edi
	movl	%r12d, %edx
	callq	_matrix_4x4_multiply
	movq	56(%r13), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	movl	%ebx, %edx
	callq	_matrix_4x4_multiply
	movsd	LCPI0_3(%rip), %xmm2            ## xmm2 = mem[0],zero
	movsd	(%r13), %xmm0                   ## xmm0 = mem[0],zero
	mulsd	%xmm2, %xmm0
	divsd	(%r15), %xmm0
	movsd	8(%r13), %xmm1                  ## xmm1 = mem[0],zero
	mulsd	%xmm2, %xmm1
	divsd	8(%r15), %xmm1
	xorl	%esi, %esi
	callq	_matrix_4x4_scale
	movl	%ebx, %edi
	movl	%r12d, %edx
	callq	_matrix_4x4_multiply
	movsd	(%r13), %xmm0                   ## xmm0 = mem[0],zero
	movsd	LCPI0_3(%rip), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	addsd	16(%r13), %xmm0
	divsd	(%r15), %xmm0
	mulsd	8(%r13), %xmm1
	addsd	24(%r13), %xmm1
	divsd	8(%r15), %xmm1
	xorl	%esi, %esi
	callq	_matrix_4x4_translate
	movl	%r12d, %edi
	movl	%ebx, %edx
	callq	_matrix_4x4_multiply
	movl	20(%r14), %esi
	movl	%ebx, %edi
	movl	%r12d, %edx
	callq	_matrix_4x4_multiply
	leaq	-48(%rbp), %r15
	leaq	-68(%rbp), %rsi
	movq	%r15, %rdi
	callq	_d3d_matrix_transpose
	movl	16(%r14), %edi
	movq	%r15, %rsi
	callq	_d3d8_set_mvp
	cmpq	$0, 48(%r13)
	je	LBB0_20
## %bb.19:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_menu_display_d3d8_bind_texture
LBB0_20:
	movl	16(%r14), %r15d
	movq	32(%r13), %rdi
	callq	_menu_display_prim_to_d3d8_enum
	movl	(%r14), %edx
	movq	32(%r13), %rcx
	movq	40(%r13), %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	%r15d, %edi
	movl	%eax, %esi
	callq	_d3d8_draw_primitive
	movq	40(%r13), %rax
	movl	(%rax), %eax
	addl	%eax, (%r14)
LBB0_21:
	addq	$56, %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_d3d8_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_d3d8_draw
_menu_display_d3d8_draw:                ; @menu_display_d3d8_draw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d11, d10, [sp, #16]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset b10, -120
	.cfi_offset b11, -128
	cbz	x0, LBB0_20
; %bb.1:
	mov	x21, x1
	ldr	x19, [x1, #16]
	cbz	x19, LBB0_20
; %bb.2:
	mov	x20, x0
	ldr	x8, [x0, #64]
	cbnz	x8, LBB0_20
; %bb.3:
	ldr	w8, [x19]
	ldr	x9, [x20, #40]
	ldr	w9, [x9]
	ldr	w10, [x19, #8]
	add	w8, w9, w8
	cmp	w8, w10
	b.hi	LBB0_20
; %bb.4:
	ldr	w0, [x19, #4]
	bl	_d3d8_vertex_buffer_lock
	cbz	x0, LBB0_20
; %bb.5:
	mov	x24, x0
	ldr	w27, [x19]
	ldr	x8, [x20, #40]
	ldp	x22, x23, [x8, #8]
	ldr	x25, [x8, #24]
	cbnz	x22, LBB0_7
; %bb.6:
	bl	_menu_display_d3d8_get_default_vertices
	mov	x22, x0
LBB0_7:
	cbnz	x23, LBB0_9
; %bb.8:
	bl	_menu_display_d3d8_get_default_tex_coords
	mov	x23, x0
LBB0_9:
	ldr	x8, [x20, #40]
	ldr	w8, [x8]
	cbz	w8, LBB0_15
; %bb.10:
	mov	x26, #0
	mov	w8, #24
	madd	x8, x27, x8, x24
	add	x24, x8, #8
	mov	w27, #1132396544
	mov	w28, #1056964608
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	fmov	s0, w27
	fmul	s1, s11, s0
	fcvtzs	w1, s1
	fmul	s1, s10, s0
	fcvtzs	w2, s1
	fmul	s1, s9, s0
	fcvtzs	w3, s1
	fmul	s0, s8, s0
	fcvtzs	w0, s0
	bl	_D3DCOLOR_ARGB
	stur	w0, [x24, #-4]
	add	x26, x26, #1
	ldr	x8, [x20, #40]
	ldr	w8, [x8]
	add	x24, x24, #24
	add	x25, x25, #16
	add	x22, x22, #8
	cmp	x26, x8
	b.hs	LBB0_15
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldp	s11, s10, [x25]
	ldp	s9, s8, [x25, #8]
	ldp	s0, s1, [x22]
	stur	w28, [x24, #-8]
	ldr	d2, [x23, x26, lsl #3]
	rev64.2s	v2, v2
	mov.s	v2[2], v1[0]
	mov.s	v2[3], v0[0]
	fcvtzs.4s	v0, v2
	str	q0, [x24]
	ldr	x0, [x20, #48]
	cbz	x0, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x2, sp
	mov	w1, #0
	bl	_d3d8_texture_get_level_desc
	cbz	x0, LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	d0, [sp]
	ldr	d1, [x24]
	mul.2s	v0, v1, v0
	str	d0, [x24]
	b	LBB0_11
LBB0_15:
	ldr	w0, [x19, #4]
	bl	_d3d8_vertex_buffer_unlock
	ldr	x8, [x20, #56]
	cbnz	x8, LBB0_17
; %bb.16:
	mov	x0, x21
	bl	_menu_display_d3d8_get_default_mvp
	str	x0, [x20, #56]
LBB0_17:
	ldr	w22, [sp]
	fmov	d0, #2.00000000
	fmov	d1, #2.00000000
	mov	x0, x22
	mov	w1, #0
	bl	_matrix_4x4_scale
	fmov	d0, #-1.00000000
	fmov	d1, #-1.00000000
	mov	w1, #0
	bl	_matrix_4x4_translate
	ldr	w23, [sp, #12]
	mov	x0, x23
	mov	x2, x22
	bl	_matrix_4x4_multiply
	ldr	x8, [x20, #56]
	ldr	w1, [x8]
	mov	x0, x22
	mov	x2, x23
	bl	_matrix_4x4_multiply
	fmov	d8, #0.50000000
	ldp	d0, d1, [x20]
	fmul	d0, d0, d8
	ldp	d2, d3, [x21]
	fdiv	d0, d0, d2
	fmul	d1, d1, d8
	fdiv	d1, d1, d3
	mov	w1, #0
	bl	_matrix_4x4_scale
	mov	x0, x23
	mov	x2, x22
	bl	_matrix_4x4_multiply
	ldp	d0, d1, [x20]
	fmul	d0, d0, d8
	ldp	d2, d3, [x20, #16]
	fadd	d0, d2, d0
	ldp	d2, d4, [x21]
	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, x22
	mov	x2, x23
	bl	_matrix_4x4_multiply
	ldr	w1, [x19, #20]
	mov	x0, x23
	mov	x2, x22
	bl	_matrix_4x4_multiply
	mov	x0, sp
	add	x1, sp, #12
	bl	_d3d_matrix_transpose
	ldr	w0, [x19, #16]
	mov	x1, sp
	bl	_d3d8_set_mvp
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_19
; %bb.18:
	mov	x0, x20
	mov	x1, x19
	bl	_menu_display_d3d8_bind_texture
LBB0_19:
	ldr	w21, [x19, #16]
	ldr	x0, [x20, #32]
	bl	_menu_display_prim_to_d3d8_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
	bl	_d3d8_draw_primitive
	ldr	x8, [x20, #40]
	ldr	w8, [x8]
	ldr	w9, [x19]
	add	w8, w9, w8
	str	w8, [x19]
LBB0_20:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #144
	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_d3d8_draw
.subsections_via_symbols
