	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function d3d9_set_menu_texture_frame
LCPI0_0:
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	15                              ## 0xf
LCPI0_1:
	.long	1114112                         ## 0x110000
	.long	1114112                         ## 0x110000
	.long	1114112                         ## 0x110000
	.long	1114112                         ## 0x110000
LCPI0_2:
	.short	4352                            ## 0x1100
	.short	0                               ## 0x0
	.short	4352                            ## 0x1100
	.short	0                               ## 0x0
	.short	4352                            ## 0x1100
	.short	0                               ## 0x0
	.short	4352                            ## 0x1100
	.short	0                               ## 0x0
LCPI0_3:
	.short	17                              ## 0x11
	.short	0                               ## 0x0
	.short	17                              ## 0x11
	.short	0                               ## 0x0
	.short	17                              ## 0x11
	.short	0                               ## 0x0
	.short	17                              ## 0x11
	.short	0                               ## 0x0
LCPI0_4:
	.long	251658240                       ## 0xf000000
	.long	251658240                       ## 0xf000000
	.long	251658240                       ## 0xf000000
	.long	251658240                       ## 0xf000000
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_d3d9_set_menu_texture_frame:           ## @d3d9_set_menu_texture_frame
	.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	$104, %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_25
## %bb.1:
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_25
## %bb.2:
	movl	%r8d, %r15d
	movl	%ecx, %r12d
	movl	%edx, %r14d
	movq	%rsi, %r13
	movq	16(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.3:
	cmpl	%r12d, (%rax)
	jne	LBB0_5
## %bb.4:
	cmpl	%r15d, 4(%rax)
	je	LBB0_7
LBB0_5:
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_d3d9_texture_free
	movl	8(%rbx), %r14d
	xorl	%eax, %eax
	callq	_d3d9_get_argb8888_format
	movq	_D3DPOOL_MANAGED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %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)
	movl	%r14d, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_d3d9_texture_new
	movq	%rax, %rdi
	movq	(%rbx), %rax
	movq	%rdi, 16(%rax)
	testq	%rdi, %rdi
	je	LBB0_26
## %bb.6:
	movl	%r12d, (%rax)
	movl	%r15d, 4(%rax)
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movd	-44(%rbp), %xmm0                ## 4-byte Folded Reload
                                        ## xmm0 = mem[0],zero,zero,zero
LBB0_7:
	movd	%xmm0, 8(%rax)
	movq	_D3DLOCK_NOSYSLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-64(%rbp), %rdx
                                        ## kill: def $edi killed $edi killed $rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_d3d9_lock_rectangle
	testq	%rax, %rax
	je	LBB0_25
## %bb.8:
	testl	%r14d, %r14d
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.9:
	testl	%r15d, %r15d
	je	LBB0_23
## %bb.10:
	movq	-56(%rbp), %rbx
	movl	%r12d, %r12d
	shlq	$2, %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	leaq	(%rbx,%r12,4), %rdi
	movl	-64(%rbp), %edx
	subl	%r12d, %edx
	xorl	%esi, %esi
	callq	_memset
	movslq	-64(%rbp), %rax
	leaq	(%rbx,%rax,4), %rbx
	addq	%r12, %r13
	decl	%r15d
	jne	LBB0_11
	jmp	LBB0_23
LBB0_26:
	leaq	L_.str(%rip), %rdi
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RARCH_ERR                      ## TAILCALL
LBB0_12:
	testl	%r15d, %r15d
	je	LBB0_23
## %bb.13:
	movq	-56(%rbp), %rax
	movl	%r12d, %r11d
	leaq	(,%r11,4), %r8
	movl	%r11d, %r10d
	andl	$-4, %r10d
	xorl	%r9d, %r9d
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [15,15,15,15]
	movdqa	LCPI0_1(%rip), %xmm8            ## xmm8 = [1114112,1114112,1114112,1114112]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [4352,0,4352,0,4352,0,4352,0]
	movdqa	LCPI0_3(%rip), %xmm3            ## xmm3 = [17,0,17,0,17,0,17,0]
	movdqa	LCPI0_4(%rip), %xmm4            ## xmm4 = [251658240,251658240,251658240,251658240]
	movq	%r13, %rbx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r9
	movl	-64(%rbp), %ecx
	sarl	$2, %ecx
	movslq	%ecx, %rcx
	leaq	(%rax,%rcx,4), %rax
	addq	%r8, %rbx
	cmpl	%r15d, %r9d
	je	LBB0_23
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_19 Depth 2
                                        ##     Child Loop BB0_21 Depth 2
	testl	%r12d, %r12d
	je	LBB0_22
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	cmpl	$4, %r12d
	jb	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r8, %rsi
	imulq	%r9, %rsi
	addq	%r13, %rsi
	movq	%rax, %rdi
	subq	%rsi, %rdi
	movl	$0, %esi
	cmpq	$16, %rdi
	jb	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=1
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%rbx,%rsi,4), %xmm5
	movdqa	%xmm5, %xmm6
	psrld	$12, %xmm6
	pand	%xmm0, %xmm6
	pmulld	%xmm8, %xmm6
	movdqa	%xmm5, %xmm7
	psrld	$8, %xmm7
	pand	%xmm0, %xmm7
	pmaddwd	%xmm2, %xmm7
	por	%xmm6, %xmm7
	movdqa	%xmm5, %xmm6
	psrld	$4, %xmm6
	pand	%xmm0, %xmm6
	pmaddwd	%xmm3, %xmm6
	movdqa	%xmm5, %xmm1
	pslld	$28, %xmm1
	pslld	$24, %xmm5
	pand	%xmm4, %xmm5
	por	%xmm1, %xmm5
	por	%xmm6, %xmm5
	por	%xmm7, %xmm5
	movdqu	%xmm5, (%rax,%rsi,4)
	addq	$4, %rsi
	cmpq	%rsi, %r10
	jne	LBB0_19
## %bb.20:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r10, %rsi
	cmpq	%r11, %r10
	jne	LBB0_21
	jmp	LBB0_22
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_21:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%rsi,4), %edi
	movl	%edi, %edx
	shrl	$12, %edx
	andl	$15, %edx
	movl	%edi, %ecx
	shrl	$8, %ecx
	andl	$15, %ecx
	movl	%edi, %r14d
	shrl	$4, %r14d
	andl	$15, %r14d
	imull	$1114112, %edx, %edx            ## imm = 0x110000
	imull	$4352, %ecx, %ecx               ## imm = 0x1100
	orl	%edx, %ecx
	movl	%r14d, %edx
	shll	$4, %edx
	orl	%r14d, %edx
	orl	%ecx, %edx
	movl	%edi, %ecx
	shll	$28, %ecx
	andl	$15, %edi
	shll	$24, %edi
	orl	%ecx, %edi
	orl	%edx, %edi
	movl	%edi, (%rax,%rsi,4)
	incq	%rsi
	cmpq	%rsi, %r11
	jne	LBB0_21
	jmp	LBB0_22
LBB0_23:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_25
## %bb.24:
	movl	16(%rax), %edi
	callq	_d3d9_unlock_rectangle
LBB0_25:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DPOOL_MANAGED,4,2            ## @D3DPOOL_MANAGED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[D3D9]: Failed to create menu texture.\n"

	.comm	_D3DLOCK_NOSYSLOCK,4,2          ## @D3DLOCK_NOSYSLOCK
	.no_dead_strip	_d3d9_set_menu_texture_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3d9_set_menu_texture_frame
_d3d9_set_menu_texture_frame:           ; @d3d9_set_menu_texture_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d9, d8, [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 b8, -72
	.cfi_offset b9, -80
	cbz	x0, LBB0_25
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_25
; %bb.2:
	fmov	s8, s0
	mov	x19, x4
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	ldr	x0, [x8, #16]
	cbz	x0, LBB0_5
; %bb.3:
	ldr	w9, [x8]
	cmp	w9, w22
	b.ne	LBB0_5
; %bb.4:
	ldr	w9, [x8, #4]
	cmp	w9, w19
	b.eq	LBB0_7
LBB0_5:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_d3d9_texture_free
	ldr	w24, [x20, #8]
	bl	_d3d9_get_argb8888_format
	mov	x6, x0
Lloh0:
	adrp	x8, _D3DPOOL_MANAGED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3DPOOL_MANAGED@GOTPAGEOFF]
Lloh2:
	ldr	w7, [x8]
	stp	xzr, xzr, [sp, #16]
	str	wzr, [sp, #32]
	str	wzr, [sp, #8]
	str	xzr, [sp]
	mov	x0, x24
	mov	x1, #0
	mov	x2, x22
	mov	x3, x19
	mov	w4, #1
	mov	w5, #0
	bl	_d3d9_texture_new
	ldr	x8, [x20]
	str	x0, [x8, #16]
	cbz	x0, LBB0_12
; %bb.6:
	stp	w22, w19, [x8]
LBB0_7:
	str	s8, [x8, #8]
Lloh3:
	adrp	x8, _D3DLOCK_NOSYSLOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _D3DLOCK_NOSYSLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	add	x2, sp, #48
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #0
	mov	x3, #0
	mov	w4, #0
	bl	_d3d9_lock_rectangle
	cbz	x0, LBB0_25
; %bb.8:
	cbz	w23, LBB0_13
; %bb.9:
	cbz	w19, LBB0_23
; %bb.10:
	ldr	x23, [sp, #56]
	mov	w8, w22
	lsl	x22, x8, #2
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x21
	mov	x2, x22
	bl	_memcpy
	add	x0, x23, x22, lsl #2
	ldr	w8, [sp, #48]
	sub	w2, w8, w22
	mov	w1, #0
	bl	_memset
	ldrsw	x8, [sp, #48]
	add	x23, x23, x8, lsl #2
	add	x21, x21, x22
	subs	w19, w19, #1
	b.ne	LBB0_11
	b	LBB0_23
LBB0_12:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	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	d9, d8, [sp, #64]               ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_RARCH_ERR
LBB0_13:
	cbz	w19, LBB0_23
; %bb.14:
	mov	x8, #0
	ldr	x9, [sp, #56]
	mov	w10, w22
	lsl	x11, x10, #2
	and	x12, x10, #0xfffffffc
	and	x13, x11, #0x3fffffff0
	movi.4s	v0, #15
	movi.4s	v1, #17, lsl #16
	movi.4s	v2, #17, lsl #8
	movi.4s	v3, #17
	movi.4s	v4, #15, lsl #24
	mov	x14, x21
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x8, x8, #1
	ldr	w15, [sp, #48]
	asr	w15, w15, #2
	add	x9, x9, w15, sxtw #2
	add	x14, x14, x11
	cmp	w8, w19
	b.eq	LBB0_23
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_20 Depth 2
                                        ;     Child Loop BB0_22 Depth 2
	cbz	w22, LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x15, #0
	cmp	w22, #4
	b.lo	LBB0_22
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	madd	x16, x11, x8, x21
	sub	x16, x9, x16
	cmp	x16, #16
	b.lo	LBB0_22
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x15, #0
LBB0_20:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	q5, [x14, x15]
	ushr.4s	v6, v5, #12
	and.16b	v6, v6, v0
	ushr.4s	v7, v5, #8
	and.16b	v7, v7, v0
	ushr.4s	v16, v5, #4
	and.16b	v16, v16, v0
	mul.4s	v6, v6, v1
	mul.4s	v7, v7, v2
	mul.4s	v16, v16, v3
	shl.4s	v17, v5, #28
	shl.4s	v5, v5, #24
	and.16b	v5, v5, v4
	orr.16b	v5, v5, v17
	orr.16b	v6, v6, v7
	orr.16b	v6, v6, v16
	orr.16b	v5, v6, v5
	str	q5, [x9, x15]
	add	x15, x15, #16
	cmp	x13, x15
	b.ne	LBB0_20
; %bb.21:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x15, x12
	cmp	x12, x10
	b.eq	LBB0_15
LBB0_22:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x16, x15, #2
	ldr	w17, [x14, x16]
	lsr	w0, w17, #12
	ubfx	w1, w17, #12, #4
	ubfx	w2, w17, #8, #4
	ubfx	w3, w17, #4, #4
	bfi	w0, w1, #4, #4
	bfi	w2, w2, #4, #4
	lsl	w1, w2, #8
	bfi	w3, w3, #4, #4
	lsl	w2, w17, #28
	bfi	w2, w17, #24, #4
	bfi	w1, w0, #16, #8
	orr	w17, w1, w3
	orr	w17, w17, w2
	str	w17, [x9, x16]
	add	x15, x15, #1
	cmp	x10, x15
	b.ne	LBB0_22
	b	LBB0_15
LBB0_23:
	ldr	x8, [x20]
	cbz	x8, LBB0_25
; %bb.24:
	ldr	w0, [x8, #16]
	bl	_d3d9_unlock_rectangle
LBB0_25:
	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	d9, d8, [sp, #64]               ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DPOOL_MANAGED,4,2            ; @D3DPOOL_MANAGED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[D3D9]: Failed to create menu texture.\n"

	.comm	_D3DLOCK_NOSYSLOCK,4,2          ; @D3DLOCK_NOSYSLOCK
	.no_dead_strip	_d3d9_set_menu_texture_frame
.subsections_via_symbols
