	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function transform_tile_index
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.space	4
	.space	4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_transform_tile_index:                  ## @transform_tile_index
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movl	%esi, %eax
	movq	%rdi, %rbx
	movl	(%rdi), %ecx
	movq	_IPU_ROTATE_NONE@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	jne	LBB0_2
## %bb.1:
	imull	12(%rbx), %eax
	addl	%edx, %eax
	jmp	LBB0_3
LBB0_2:
	movq	24(%rbx), %rsi
	movq	8(%rsi), %rdi
	movd	%edx, %xmm1
	pinsrd	$1, %eax, %xmm1
	paddd	%xmm1, %xmm1
	movq	_IPU_ROT_BIT_90@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	movl	(%rdx), %edx
	andl	%ecx, %edx
	sete	%al
	movq	(%rdi), %rdx
	movl	(%rdx), %edi
	movl	(%rsi), %edx
	movq	12(%rbx), %xmm0                 ## xmm0 = mem[0],zero
	por	LCPI0_0(%rip), %xmm1
	psubd	%xmm0, %xmm1
	pextrd	$1, %xmm1, %r9d
	movl	%r9d, %esi
	negl	%esi
	movd	%eax, %xmm0
	pshufd	$80, %xmm0, %xmm0               ## xmm0 = xmm0[0,0,1,1]
	pslld	$31, %xmm0
	movd	%esi, %xmm2
	punpckldq	%xmm1, %xmm2            ## xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
	blendvps	%xmm0, %xmm1, %xmm2
	movq	_IPU_ROT_BIT_HFLIP@GOTPCREL(%rip), %rax
	movq	_IPU_ROT_BIT_VFLIP@GOTPCREL(%rip), %rsi
	movd	(%rax), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pinsrd	$1, (%rsi), %xmm0
	movd	%xmm1, %r8d
	movd	%ecx, %xmm1
	pshufd	$80, %xmm1, %xmm1               ## xmm1 = xmm1[0,0,1,1]
	pand	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	pcmpeqd	%xmm1, %xmm0
	xorps	%xmm0, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, -32(%rbp)                ## 16-byte Spill
	pextrd	$1, %xmm0, 8(%rsp)
	movd	%xmm0, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rcx
	callq	_dev_dbg
	movq	4(%rbx), %rcx
	movq	%rcx, %xmm0
	pcmpeqd	%xmm1, %xmm1
	paddd	%xmm0, %xmm1
	paddd	-32(%rbp), %xmm1                ## 16-byte Folded Reload
	movdqa	%xmm1, %xmm0
	psrld	$31, %xmm0
	paddd	%xmm1, %xmm0
	psrad	$1, %xmm0
	pextrd	$1, %xmm0, %eax
	imull	%eax, %ecx
	movd	%xmm0, %eax
	addl	%ecx, %eax
LBB0_3:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IPU_ROTATE_NONE,4,2            ## @IPU_ROTATE_NONE
	.comm	_IPU_ROT_BIT_90,4,2             ## @IPU_ROT_BIT_90
	.comm	_IPU_ROT_BIT_HFLIP,4,2          ## @IPU_ROT_BIT_HFLIP
	.comm	_IPU_ROT_BIT_VFLIP,4,2          ## @IPU_ROT_BIT_VFLIP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"task %u: ctx %p: [%d,%d] --> [%d,%d]\n"

	.no_dead_strip	_transform_tile_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function transform_tile_index
_transform_tile_index:                  ; @transform_tile_index
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _IPU_ROTATE_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IPU_ROTATE_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #12]
	madd	w0, w8, w1, w2
	b	LBB0_3
LBB0_2:
	ldr	x9, [x19, #24]
	ldr	x10, [x9, #8]
	mov	w11, #1
	mov	w12, #1
	bfi	w12, w1, #1, #31
	ldp	w14, w13, [x19, #12]
	sub	w5, w12, w13
	bfi	w11, w2, #1, #31
Lloh3:
	adrp	x12, _IPU_ROT_BIT_90@GOTPAGE
Lloh4:
	ldr	x12, [x12, _IPU_ROT_BIT_90@GOTPAGEOFF]
	sub	w4, w11, w14
Lloh5:
	ldr	w11, [x12]
	tst	w11, w8
	csel	w11, w5, w4, eq
Lloh6:
	adrp	x12, _IPU_ROT_BIT_HFLIP@GOTPAGE
Lloh7:
	ldr	x12, [x12, _IPU_ROT_BIT_HFLIP@GOTPAGEOFF]
	csneg	w13, w4, w5, eq
Lloh8:
	ldr	w12, [x12]
	tst	w12, w8
	cneg	w20, w13, ne
Lloh9:
	adrp	x12, _IPU_ROT_BIT_VFLIP@GOTPAGE
Lloh10:
	ldr	x12, [x12, _IPU_ROT_BIT_VFLIP@GOTPAGEOFF]
Lloh11:
	ldr	w12, [x12]
	tst	w12, w8
	cneg	w21, w11, ne
	ldr	x8, [x10]
	ldr	w0, [x8]
	ldr	w2, [x9]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x19
	mov	x6, x20
	mov	x7, x21
	bl	_dev_dbg
	ldp	w9, w8, [x19, #4]
	add	w8, w21, w8
	sub	w10, w8, #1
	add	w11, w20, w9
	sub	w12, w11, #1
	cmp	w10, #0
	csel	w8, w8, w10, lt
	asr	w8, w8, #1
	cmp	w12, #0
	csel	w10, w11, w12, lt
	mul	w8, w8, w9
	add	w0, w8, w10, asr #1
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_IPU_ROTATE_NONE,4,2            ; @IPU_ROTATE_NONE
	.comm	_IPU_ROT_BIT_90,4,2             ; @IPU_ROT_BIT_90
	.comm	_IPU_ROT_BIT_HFLIP,4,2          ; @IPU_ROT_BIT_HFLIP
	.comm	_IPU_ROT_BIT_VFLIP,4,2          ; @IPU_ROT_BIT_VFLIP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"task %u: ctx %p: [%d,%d] --> [%d,%d]\n"

	.no_dead_strip	_transform_tile_index
.subsections_via_symbols
