	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wined3d_format_calculate_pitch ## -- Begin function wined3d_format_calculate_pitch
	.p2align	4, 0x90
_wined3d_format_calculate_pitch:        ## @wined3d_format_calculate_pitch
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
                                        ## kill: def $ecx killed $ecx def $rcx
                                        ## kill: def $edx killed $edx def $rdx
	movl	%esi, %r10d
	movq	(%rdi), %r11
	movq	_WINED3D_GL_RES_TYPE_TEX_2D@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_WINED3DFMT_FLAG_BLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r11,%r14,4)
	je	LBB0_2
## %bb.1:
	movl	8(%rdi), %esi
	movl	12(%rdi), %ebx
	leal	(%rdx,%rsi), %eax
	decl	%eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %esi
	leal	(%rcx,%rbx), %eax
	decl	%eax
	xorl	%edx, %edx
	divl	%ebx
	imull	16(%rdi), %esi
	leal	(%r10,%rsi), %ecx
	decl	%ecx
	negl	%r10d
	andl	%ecx, %r10d
	movl	%r10d, (%r8)
	imull	%eax, %r10d
	jmp	LBB0_3
LBB0_2:
	imull	20(%rdi), %edx
	leal	(%r10,%rdx), %eax
	decl	%eax
	negl	%r10d
	andl	%eax, %r10d
	movl	%r10d, (%r8)
	imull	%ecx, %r10d
LBB0_3:
	movl	%r10d, (%r9)
	movq	_WINED3DFMT_FLAG_HEIGHT_SCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r11,%r14,4)
	je	LBB0_5
## %bb.4:
	imull	24(%rdi), %r10d
	movl	%r10d, (%r9)
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	28(%rdi)
	movl	%eax, %r10d
	movl	%eax, (%r9)
LBB0_5:
	movl	(%r8), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r10d, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_TRACE                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_GL_RES_TYPE_TEX_2D,8,3 ## @WINED3D_GL_RES_TYPE_TEX_2D
	.comm	_WINED3DFMT_FLAG_BLOCKS,4,2     ## @WINED3DFMT_FLAG_BLOCKS
	.comm	_WINED3DFMT_FLAG_HEIGHT_SCALE,4,2 ## @WINED3DFMT_FLAG_HEIGHT_SCALE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Returning row pitch %u, slice pitch %u.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wined3d_format_calculate_pitch ; -- Begin function wined3d_format_calculate_pitch
	.p2align	2
_wined3d_format_calculate_pitch:        ; @wined3d_format_calculate_pitch
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _WINED3D_GL_RES_TYPE_TEX_2D@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WINED3D_GL_RES_TYPE_TEX_2D@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w10, [x8, x9, lsl #2]
Lloh3:
	adrp	x11, _WINED3DFMT_FLAG_BLOCKS@GOTPAGE
Lloh4:
	ldr	x11, [x11, _WINED3DFMT_FLAG_BLOCKS@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_2
; %bb.1:
	ldp	w10, w11, [x0, #8]
	add	w12, w2, w10
	sub	w12, w12, #1
	udiv	w10, w12, w10
	add	w12, w3, w11
	sub	w12, w12, #1
	udiv	w11, w12, w11
	ldr	w12, [x0, #16]
	madd	w10, w12, w10, w1
	sub	w10, w10, #1
	neg	w12, w1
	and	w10, w10, w12
	str	w10, [x4]
	mul	w2, w10, w11
	b	LBB0_3
LBB0_2:
	ldr	w10, [x0, #20]
	madd	w10, w10, w2, w1
	sub	w10, w10, #1
	neg	w11, w1
	and	w10, w10, w11
	str	w10, [x4]
	mul	w2, w10, w3
LBB0_3:
	str	w2, [x5]
	ldr	w8, [x8, x9, lsl #2]
Lloh6:
	adrp	x9, _WINED3DFMT_FLAG_HEIGHT_SCALE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WINED3DFMT_FLAG_HEIGHT_SCALE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	w8, [x0, #24]
	mul	w8, w8, w2
	str	w8, [x5]
	ldr	w9, [x0, #28]
	udiv	w2, w8, w9
	str	w2, [x5]
LBB0_5:
	ldr	w1, [x4]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	b	_TRACE
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_GL_RES_TYPE_TEX_2D,8,3 ; @WINED3D_GL_RES_TYPE_TEX_2D
	.comm	_WINED3DFMT_FLAG_BLOCKS,4,2     ; @WINED3DFMT_FLAG_BLOCKS
	.comm	_WINED3DFMT_FLAG_HEIGHT_SCALE,4,2 ; @WINED3DFMT_FLAG_HEIGHT_SCALE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Returning row pitch %u, slice pitch %u.\n"

.subsections_via_symbols
