	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_tile_offsets_planar
_calc_tile_offsets_planar:              ## @calc_tile_offsets_planar
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	40(%rsi), %r14
	movl	(%rsi), %r12d
	movl	4(%rsi), %r13d
	movl	(%r14), %r8d
	movl	4(%r14), %ebx
	movl	%r12d, %eax
	cltd
	idivl	%r8d
	movq	16(%r14), %rcx
	movq	%rcx, -128(%rbp)                ## 8-byte Spill
	testq	%rcx, %rcx
	setne	%cl
	shll	%cl, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	32(%rsi), %eax
	imull	%r12d, %eax
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%r8d, -68(%rbp)                 ## 4-byte Spill
	imull	%r8d, %ebx
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	cltd
	idivl	%ebx
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.1:
	movq	%rdi, -104(%rbp)                ## 8-byte Spill
	movq	(%rdi), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	24(%rsi), %r11
	movq	%rsi, -112(%rbp)                ## 8-byte Spill
	movl	8(%rsi), %r10d
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movl	$0, %edi
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%esi
	cmpl	%r13d, %esi
	je	LBB0_11
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%r8d, %eax
	leaq	(%rax,%rax,4), %rax
	movl	(%r11,%rax,4), %r9d
	movl	%r9d, %eax
	imull	-56(%rbp), %eax                 ## 4-byte Folded Reload
	cltd
	idivl	-60(%rbp)                       ## 4-byte Folded Reload
	testl	%r10d, %r10d
	je	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r15d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	imull	%r12d, %r9d
	movq	8(%r14), %rsi
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%r8,%r13), %eax
	leaq	(%rax,%rax,4), %r14
	movl	4(%r11,%r14,4), %ebx
	movl	%ebx, %eax
	cltd
	idivl	-68(%rbp)                       ## 4-byte Folded Reload
	shll	%cl, %eax
	addl	%r9d, %ebx
	addl	%r15d, %eax
	movl	-64(%rbp), %edx                 ## 4-byte Reload
                                        ## kill: def $edx killed $edx def $rdx
	subl	%ebx, %edx
	addl	%eax, %edx
	movq	-120(%rbp), %rax                ## 8-byte Reload
	addl	%edx, %eax
	cmpq	$0, -128(%rbp)                  ## 8-byte Folded Reload
	cmovnel	%edi, %eax
	testq	%rsi, %rsi
	movl	%eax, %r12d
	cmovel	%edx, %r12d
	cmovnel	%edx, %eax
	movl	%ebx, 8(%r11,%r14,4)
	movl	%r12d, 12(%r11,%r14,4)
	movl	%eax, 16(%r11,%r14,4)
	testb	$7, %bl
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r12d, %edx
	andl	$7, %edx
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%eax, %edx
	andl	$7, %edx
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	incl	%r13d
	cmpl	%r13d, %r10d
	jne	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%r13d, %r8d
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_10
LBB0_7:
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	(%rcx), %edi
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edx
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movq	16(%rcx), %rcx
	movq	_IMAGE_CONVERT_IN@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	leaq	L_.str.1(%rip), %rcx
	leaq	L_.str.2(%rip), %r8
	cmoveq	%rcx, %r8
	leaq	L_.str(%rip), %rsi
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	pushq	%rax
	pushq	%r12
	pushq	%rbx
	pushq	%r13
	callq	_dev_err
	addq	$32, %rsp
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"task %u: ctx %p: %s@[%d,%d]: y_off %08x, u_off %08x, v_off %08x\n"

	.comm	_IMAGE_CONVERT_IN,8,3           ## @IMAGE_CONVERT_IN
L_.str.1:                               ## @.str.1
	.asciz	"Input"

L_.str.2:                               ## @.str.2
	.asciz	"Output"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_calc_tile_offsets_planar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_tile_offsets_planar
_calc_tile_offsets_planar:              ; @calc_tile_offsets_planar
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x1, #40]
	ldr	x10, [x8, #16]
	cmp	x10, #0
	cset	w11, ne
	ldr	w12, [x1, #4]
	cbz	w12, LBB0_10
; %bb.1:
	mov	x3, x0
	mov	w5, #0
	mov	w14, #0
	ldr	x9, [x0]
	ldr	x13, [x9, #8]
	ldr	w2, [x1, #32]
	ldr	w15, [x1]
	ldp	w16, w17, [x8]
	sdiv	w0, w15, w16
	lsl	w0, w0, w11
	mul	w2, w15, w2
	mul	w6, w17, w16
	ldr	x4, [x1, #24]
	ldr	w19, [x1, #8]
	mov	w20, #20
	sdiv	w21, w2, w6
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w5, w5, #1
	cmp	w5, w12
	b.eq	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cbz	w19, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w6, #0
	umull	x7, w14, w20
	ldr	w7, [x4, x7]
	mul	w22, w7, w15
	mul	w7, w7, w0
	sdiv	w23, w7, w17
	ldr	x24, [x8, #8]
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w7, w14, w6
	umaddl	x27, w7, w20, x4
	ldr	w7, [x27, #4]
	sdiv	w25, w7, w16
	lsl	w25, w25, w11
	add	w7, w7, w22
	sub	w26, w2, w7
	add	w25, w25, w23
	add	w26, w25, w26
	add	w25, w26, w21
	cmp	x10, #0
	csel	w28, w25, wzr, eq
	cmp	x24, #0
	csel	w25, w26, w28, eq
	csel	w26, w28, w26, eq
	stp	w7, w25, [x27, #8]
	str	w26, [x27, #16]
	tst	w7, #0x7
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	and	w27, w25, #0x7
	and	w28, w26, #0x7
	cmp	w27, #0
	ccmp	w28, #0, #0, eq
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	add	w6, w6, #1
	cmp	w19, w6
	b.ne	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w14, w14, w6
	b	LBB0_2
LBB0_9:
	ldr	x8, [x13]
	ldr	w0, [x8]
	ldr	w2, [x9]
	ldr	x8, [x1, #16]
Lloh0:
	adrp	x9, _IMAGE_CONVERT_IN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IMAGE_CONVERT_IN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, l_.str.2@PAGE
Lloh4:
	add	x10, x10, l_.str.2@PAGEOFF
Lloh5:
	adrp	x11, l_.str.1@PAGE
Lloh6:
	add	x11, x11, l_.str.1@PAGEOFF
	cmp	x8, x9
	csel	x4, x11, x10, eq
	stp	w25, w26, [sp]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"task %u: ctx %p: %s@[%d,%d]: y_off %08x, u_off %08x, v_off %08x\n"

	.comm	_IMAGE_CONVERT_IN,8,3           ; @IMAGE_CONVERT_IN
l_.str.1:                               ; @.str.1
	.asciz	"Input"

l_.str.2:                               ; @.str.2
	.asciz	"Output"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_calc_tile_offsets_planar
.subsections_via_symbols
