	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_d3d10_update_texture           ## -- Begin function d3d10_update_texture
	.p2align	4, 0x90
_d3d10_update_texture:                  ## @d3d10_update_texture
	.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
	movq	16(%rbp), %r15
	movq	$0, -88(%rbp)
	movl	$0, -80(%rbp)
	movl	%esi, -76(%rbp)
	movl	%edx, -72(%rbp)
	movl	$1, -68(%rbp)
	testq	%r15, %r15
	je	LBB0_4
## %bb.1:
	movl	%edi, %eax
	movl	12(%r15), %edi
	testl	%edi, %edi
	je	LBB0_4
## %bb.2:
	movl	%r8d, %r12d
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movl	%esi, %r14d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_D3D10_MAP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %r8
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	callq	_D3D10MapTexture2D
	movl	8(%r15), %r9d
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %r10d
	movl	%r14d, %edi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	pushq	%rax
	pushq	%r10
	callq	_dxgi_copy
	addq	$16, %rsp
	movl	12(%r15), %edi
	xorl	%esi, %esi
	callq	_D3D10UnmapTexture2D
	movl	12(%r15), %eax
	movl	16(%r15), %esi
	subq	$8, %rsp
	leaq	-88(%rbp), %rbx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	$0
	pushq	%rax
	callq	_D3D10CopyTexture2DSubresourceRegion
	addq	$32, %rsp
	movq	_D3D10_RESOURCE_MISC_GENERATE_MIPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r15)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_4
## %bb.3:
	movl	(%r15), %esi
	callq	_D3D10GenerateMips
LBB0_4:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3D10_MAP_WRITE,4,2            ## @D3D10_MAP_WRITE
	.comm	_D3D10_RESOURCE_MISC_GENERATE_MIPS,4,2 ## @D3D10_RESOURCE_MISC_GENERATE_MIPS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_d3d10_update_texture           ; -- Begin function d3d10_update_texture
	.p2align	2
_d3d10_update_texture:                  ; @d3d10_update_texture
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	str	xzr, [sp, #16]
	stp	wzr, w1, [sp, #24]
	mov	w8, #1
	stp	w2, w8, [sp, #32]
	cbz	x6, LBB0_4
; %bb.1:
	mov	x19, x6
	mov	x20, x0
	ldr	w0, [x6, #12]
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x5
	mov	x23, x4
	mov	x22, x3
	mov	x24, x2
	mov	x25, x1
Lloh0:
	adrp	x8, _D3D10_MAP_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3D10_MAP_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x4, sp, #40
	mov	w1, #0
	mov	w3, #0
	bl	_D3D10MapTexture2D
	ldr	w5, [x19, #8]
	ldp	w7, w6, [sp, #40]
	mov	x0, x25
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	bl	_dxgi_copy
	ldr	w0, [x19, #12]
	mov	w1, #0
	bl	_D3D10UnmapTexture2D
	ldp	w6, w1, [x19, #12]
	add	x8, sp, #16
	str	x8, [sp]
	mov	x0, x20
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	mov	w7, #0
	bl	_D3D10CopyTexture2DSubresourceRegion
	ldr	w8, [x19, #4]
Lloh3:
	adrp	x9, _D3D10_RESOURCE_MISC_GENERATE_MIPS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _D3D10_RESOURCE_MISC_GENERATE_MIPS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w1, [x19]
	mov	x0, x20
	bl	_D3D10GenerateMips
LBB0_4:
	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
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_D3D10_MAP_WRITE,4,2            ; @D3D10_MAP_WRITE
	.comm	_D3D10_RESOURCE_MISC_GENERATE_MIPS,4,2 ; @D3D10_RESOURCE_MISC_GENERATE_MIPS
.subsections_via_symbols
