	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_offset
_calc_offset:                           ## @calc_offset
	.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	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r12d
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r14
	movl	%esi, %r13d
	movl	%edi, %ebx
	movq	%rdx, %rdi
	callq	_color_mode_to_bpp
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_DSSDBG
	movq	_OMAP_DSS_ROT_TILER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	56(%rbp), %eax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_4
## %bb.1:
	movq	_DRM_FORMAT_UYVY@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_DRM_FORMAT_YUYV@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_4
LBB0_3:
	movl	64(%rbp), %edi
	callq	_drm_rotation_90_or_270
	testq	%rax, %rax
	setne	%cl
	shll	%cl, %r13d
LBB0_4:
	movl	48(%rbp), %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	16(%rbp), %rsi
	leal	7(%r15), %r14d
	testl	%r15d, %r15d
	cmovnsl	%r15d, %r14d
	sarl	$3, %r14d
	imull	%ebx, %r12d
	imull	%r14d, %r12d
	movl	%r12d, (%rdx)
	movl	$0, (%rsi)
	imull	%ebx, %eax
	movl	40(%rbp), %r15d
	imull	%r15d, %r13d
	incl	%ebx
	testl	%ecx, %ecx
	movl	$1, %edi
	cmovnel	%ebx, %edi
	addl	%eax, %edi
	subl	%r13d, %edi
	movl	%r14d, %esi
	callq	_pixinc
	movq	24(%rbp), %rcx
	movl	%eax, (%rcx)
	movq	_DRM_FORMAT_YUYV@GOTPCREL(%rip), %rax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, (%rax)
	sete	%al
	movq	_DRM_FORMAT_UYVY@GOTPCREL(%rip), %rcx
	cmpq	%rdx, (%rcx)
	sete	%cl
	orb	%al, %cl
	shll	%cl, %r14d
	movl	%r15d, %edi
	movl	%r14d, %esi
	callq	_pixinc
	movq	32(%rbp), %rcx
	movl	%eax, (%rcx)
	addq	$24, %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	"scrw %d, width %d\n"

	.comm	_OMAP_DSS_ROT_TILER,4,2         ## @OMAP_DSS_ROT_TILER
	.comm	_DRM_FORMAT_UYVY,8,3            ## @DRM_FORMAT_UYVY
	.comm	_DRM_FORMAT_YUYV,8,3            ## @DRM_FORMAT_YUYV
	.no_dead_strip	_calc_offset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_offset
_calc_offset:                           ; @calc_offset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	str	x7, [sp, #8]                    ; 8-byte Folded Spill
	mov	x26, x6
	mov	x21, x5
	str	w4, [sp, #28]                   ; 4-byte Folded Spill
	mov	x27, x3
	mov	x20, x2
	mov	x23, x1
	mov	x24, x0
	ldr	w8, [x29, #28]
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	ldr	w8, [x29, #24]
	str	w8, [sp]                        ; 4-byte Folded Spill
	ldr	x25, [x29, #16]
	ldr	w22, [x29, #32]
	mov	x0, x2
	bl	_color_mode_to_bpp
	mov	x28, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	mov	x2, x23
	bl	_DSSDBG
Lloh2:
	adrp	x8, _OMAP_DSS_ROT_TILER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OMAP_DSS_ROT_TILER@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _DRM_FORMAT_UYVY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DRM_FORMAT_UYVY@GOTPAGEOFF]
Lloh7:
	adrp	x10, _DRM_FORMAT_YUYV@GOTPAGE
Lloh8:
	ldr	x10, [x10, _DRM_FORMAT_YUYV@GOTPAGEOFF]
	cmp	w8, w22
	str	x25, [sp, #16]                  ; 8-byte Folded Spill
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x9]
	ldr	x9, [x10]
	cmp	x8, x20
	ccmp	x9, x20, #4, ne
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	ldp	w25, w22, [sp]                  ; 8-byte Folded Reload
	b.ne	LBB0_4
; %bb.2:
	ldr	w0, [x29, #36]
	bl	_drm_rotation_90_or_270
	cmp	x0, #0
	cset	w8, ne
	lsl	w23, w23, w8
	b	LBB0_4
LBB0_3:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	ldp	w25, w22, [sp]                  ; 8-byte Folded Reload
LBB0_4:
	add	w8, w28, #7
	cmp	w28, #0
	csel	w8, w8, w28, lt
	asr	w28, w8, #3
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	mul	w8, w8, w24
	mul	w8, w8, w28
	str	w8, [x21]
	str	wzr, [x26]
	cmp	w27, #0
	mov	w8, #1
	csinc	w8, w8, w24, eq
	madd	w8, w22, w24, w8
	msub	w0, w23, w25, w8
	mov	x1, x28
	bl	_pixinc
	str	w0, [x19]
Lloh9:
	adrp	x8, _DRM_FORMAT_YUYV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DRM_FORMAT_YUYV@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x8, x20
Lloh12:
	adrp	x8, _DRM_FORMAT_UYVY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DRM_FORMAT_UYVY@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ccmp	x8, x20, #4, ne
	cset	w8, eq
	lsl	w1, w28, w8
	mov	x0, x25
	bl	_pixinc
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	str	w0, [x8]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"scrw %d, width %d\n"

	.comm	_OMAP_DSS_ROT_TILER,4,2         ; @OMAP_DSS_ROT_TILER
	.comm	_DRM_FORMAT_UYVY,8,3            ; @DRM_FORMAT_UYVY
	.comm	_DRM_FORMAT_YUYV,8,3            ; @DRM_FORMAT_YUYV
	.no_dead_strip	_calc_offset
.subsections_via_symbols
