	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_dds_surface_size
_calculate_dds_surface_size:            ## @calculate_dds_surface_size
	.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, %r14
	movq	%rcx, %r12
	movl	%edx, %r15d
	movl	%esi, %r13d
	callq	_get_format_info
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	_FORMAT_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_E_NOTIMPL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_2:
	movl	8(%rbx), %ecx
	cmpl	$1, %ecx
	jne	LBB0_4
## %bb.3:
	cmpl	$1, 12(%rbx)
	jne	LBB0_4
## %bb.5:
	imull	20(%rbx), %r13d
	movl	%r13d, (%r12)
	imull	%r15d, %r13d
	jmp	LBB0_6
LBB0_4:
	movl	16(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leal	(%rcx,%r13), %eax
	decl	%eax
	cltd
	idivl	%ecx
	movl	$1, %edi
	movl	%eax, %esi
	callq	_max
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %r14d
	imull	-44(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%r14d, (%r12)
	movl	12(%rbx), %ecx
	leal	(%r15,%rcx), %eax
	decl	%eax
	cltd
	idivl	%ecx
	movl	$1, %edi
	movl	%eax, %esi
	callq	_max
	movl	%eax, %r13d
	imull	%r14d, %r13d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_6:
	movl	%r13d, (%r14)
	movq	_D3D_OK@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FORMAT_UNKNOWN,8,3             ## @FORMAT_UNKNOWN
	.comm	_E_NOTIMPL,4,2                  ## @E_NOTIMPL
	.comm	_D3D_OK,4,2                     ## @D3D_OK
	.no_dead_strip	_calculate_dds_surface_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_dds_surface_size
_calculate_dds_surface_size:            ; @calculate_dds_surface_size
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x4
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	bl	_get_format_info
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _FORMAT_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FORMAT_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _E_NOTIMPL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _E_NOTIMPL@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	mov	x22, x0
	ldr	w8, [x0, #8]
	cmp	w8, #1
	b.ne	LBB0_5
; %bb.3:
	ldr	w9, [x22, #12]
	cmp	w9, #1
	b.ne	LBB0_5
; %bb.4:
	ldr	w8, [x22, #20]
	mul	w8, w8, w23
	str	w8, [x21]
	mul	w8, w8, w20
	b	LBB0_6
LBB0_5:
	ldr	w24, [x22, #16]
	add	w9, w23, w8
	sub	w9, w9, #1
	sdiv	w1, w9, w8
	mov	w0, #1
	bl	_max
	mul	w23, w0, w24
	str	w23, [x21]
	ldr	w8, [x22, #12]
	add	w9, w20, w8
	sub	w9, w9, #1
	sdiv	w1, w9, w8
	mov	w0, #1
	bl	_max
	mul	w8, w0, w23
LBB0_6:
	str	w8, [x19]
Lloh5:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_FORMAT_UNKNOWN,8,3             ; @FORMAT_UNKNOWN
	.comm	_E_NOTIMPL,4,2                  ; @E_NOTIMPL
	.comm	_D3D_OK,4,2                     ; @D3D_OK
	.no_dead_strip	_calculate_dds_surface_size
.subsections_via_symbols
