	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3d8_video_texture_load_d3d
_d3d8_video_texture_load_d3d:           ## @d3d8_video_texture_load_d3d
	.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
	movq	%rsi, %r14
	movq	(%rdi), %r13
	movq	8(%rdi), %rax
	movl	(%rax), %ebx
	movl	(%r13), %r15d
	movl	4(%r13), %r12d
	xorl	%eax, %eax
	callq	_d3d8_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	%ebx, %edi
	xorl	%esi, %esi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_d3d8_texture_new
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movslq	%eax, %rbx
	movq	_D3DLOCK_NOSYSLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-72(%rbp), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_d3d8_lock_rectangle
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, 4(%r13)
	je	LBB0_5
## %bb.3:
	movl	-72(%rbp), %r14d
	sarl	$2, %r14d
	movq	8(%r13), %r12
	movq	-64(%rbp), %rbx
	movl	(%r13), %edx
	shlq	$2, %r14
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	shll	$2, %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	incl	%r15d
	movslq	(%r13), %rdx
	leaq	(%r12,%rdx,4), %r12
	addq	%r14, %rbx
	cmpl	4(%r13), %r15d
	jb	LBB0_4
LBB0_5:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_d3d8_unlock_rectangle
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_6:
	movq	%rbx, (%r14)
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str(%rip), %rdi
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RARCH_ERR                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DPOOL_MANAGED,4,2            ## @D3DPOOL_MANAGED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[D3D8]: Failed to create texture\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3d8_video_texture_load_d3d
_d3d8_video_texture_load_d3d:           ; @d3d8_video_texture_load_d3d
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x19, x1
	ldp	x23, x8, [x0]
	ldr	w20, [x8]
	ldp	w21, w22, [x23]
	bl	_d3d8_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, x20
	mov	x1, #0
	mov	x2, x21
	mov	x3, x22
	mov	w4, #0
	mov	w5, #0
	bl	_d3d8_texture_new
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_7
; %bb.1:
	sxtw	x20, w0
Lloh3:
	adrp	x8, _D3DLOCK_NOSYSLOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _D3DLOCK_NOSYSLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	add	x2, sp, #48
	mov	x0, x20
	mov	w1, #0
	mov	x3, #0
	mov	w4, #0
	bl	_d3d8_lock_rectangle
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w8, [x23, #4]
	cbz	w8, LBB0_5
; %bb.3:
	mov	w24, #0
	ldr	w8, [sp, #48]
	asr	w9, w8, #2
	ldr	x21, [x23, #8]
	ldr	x22, [sp, #56]
	ldr	w8, [x23]
	lsl	x25, x9, #2
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w2, w8, #2
	mov	x0, x22
	mov	x1, x21
	bl	_memcpy
	add	w24, w24, #1
	ldp	w8, w9, [x23]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x21, x21, x8, lsl #2
	add	x22, x22, x25
	cmp	w24, w9
	b.lo	LBB0_4
LBB0_5:
	mov	x0, x20
	bl	_d3d8_unlock_rectangle
LBB0_6:
	str	x20, [x19]
	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
	add	sp, sp, #144
	ret
LBB0_7:
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	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_RARCH_ERR
	.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	"[D3D8]: Failed to create texture\n"

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