	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_dds_file_size
_calculate_dds_file_size:               ## @calculate_dds_file_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	testq	%r8, %r8
	jle	LBB0_1
## %bb.2:
	movq	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r12
	xorl	%r13d, %r13d
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, -48(%rbp)
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rsi
	movq	%r14, %rdx
	leaq	-72(%rbp), %rcx
	leaq	-48(%rbp), %r8
	callq	_calculate_dds_surface_size
	movq	-48(%rbp), %rax
	imulq	%rbx, %rax
	movq	%rax, -48(%rbp)
	addq	%rax, %r13
	movq	%r12, %rsi
	shrq	$63, %rsi
	addq	%r12, %rsi
	sarq	%rsi
	movl	$1, %edi
	callq	_max
	movq	%rax, %r12
	movq	%r14, %rsi
	shrq	$63, %rsi
	addq	%r14, %rsi
	sarq	%rsi
	movl	$1, %edi
	callq	_max
	movq	%rax, %r14
	movq	%rbx, %rsi
	shrq	$63, %rsi
	addq	%rbx, %rsi
	sarq	%rsi
	movl	$1, %edi
	callq	_max
	movq	%rax, %rbx
	decq	%r15
	jne	LBB0_3
	jmp	LBB0_4
LBB0_1:
	xorl	%r13d, %r13d
LBB0_4:
	imulq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	addq	$4, %r13
	movq	%r13, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calculate_dds_file_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_file_size
_calculate_dds_file_size:               ; @calculate_dds_file_size
	.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	x19, x5
	cmp	x4, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x20, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x21, x0
	mov	x25, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [sp]
	add	x3, sp, #8
	mov	x4, sp
	mov	x0, x21
	mov	x1, x24
	mov	x2, x23
	bl	_calculate_dds_surface_size
	ldr	x8, [sp]
	mul	x8, x8, x22
	str	x8, [sp]
	add	x25, x8, x25
	cmp	x24, #0
	cinc	x8, x24, lt
	asr	x1, x8, #1
	mov	w0, #1
	bl	_max
	mov	x24, x0
	cmp	x23, #0
	cinc	x8, x23, lt
	asr	x1, x8, #1
	mov	w0, #1
	bl	_max
	mov	x23, x0
	cmp	x22, #0
	cinc	x8, x22, lt
	asr	x1, x8, #1
	mov	w0, #1
	bl	_max
	mov	x22, x0
	subs	x20, x20, #1
	b.ne	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	x25, #0
LBB0_4:
	orr	x8, xzr, #0x4
	madd	x0, x25, x19, x8
	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	_calculate_dds_file_size
.subsections_via_symbols
