	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function svga3dsurface_get_image_offset
_svga3dsurface_get_image_offset:        ## @svga3dsurface_get_image_offset
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %rbx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movl	%esi, %r13d
	callq	_svga3dsurface_get_desc
	testq	%r14, %r14
	jle	LBB0_1
## %bb.2:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	xorl	%r15d, %r15d
	movq	%rax, %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r15, %rsi
	callq	_svga3dsurface_get_mip_size
	movl	%eax, -48(%rbp)
	movq	%r13, %rdi
	leaq	-48(%rbp), %rsi
	xorl	%edx, %edx
	callq	_svga3dsurface_get_image_buffer_size
	addq	%rax, %rbx
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	movl	$0, %ecx
	cmovgeq	%rcx, %rax
	addq	%rax, %r12
	incq	%r15
	cmpq	%r15, %r14
	jne	LBB0_3
	jmp	LBB0_4
LBB0_1:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
LBB0_4:
	imulq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	addq	%r12, %rbx
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_svga3dsurface_get_image_offset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function svga3dsurface_get_image_offset
_svga3dsurface_get_image_offset:        ; @svga3dsurface_get_image_offset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x4
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	bl	_svga3dsurface_get_desc
	cmp	x21, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x23, x0
	mov	x26, #0
	mov	x25, #0
	mov	x24, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x24
	bl	_svga3dsurface_get_mip_size
	str	w0, [sp, #12]
	add	x1, sp, #12
	mov	x0, x23
	mov	w2, #0
	bl	_svga3dsurface_get_image_buffer_size
	add	x26, x0, x26
	cmp	x24, x20
	csel	x8, x0, xzr, lt
	add	x25, x8, x25
	add	x24, x24, #1
	cmp	x21, x24
	b.ne	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	x25, #0
	mov	x26, #0
LBB0_4:
	madd	x0, x26, x19, x25
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_svga3dsurface_get_image_offset
.subsections_via_symbols
