	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_skl_scaler_calc_phase          ## -- Begin function skl_scaler_calc_phase
	.p2align	4, 0x90
_skl_scaler_calc_phase:                 ## @skl_scaler_calc_phase
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movl	%edi, %eax
	shll	$15, %eax
	addl	$-32768, %eax                   ## imm = 0x8000
	cltd
	idivl	%edi
	movl	%eax, %r14d
	addl	$-32768, %r14d                  ## imm = 0x8000
	jmp	LBB0_3
LBB0_1:
	movl	$-32768, %r14d                  ## imm = 0x8000
LBB0_3:
	addl	%edi, %edi
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, %r15d
	leal	(%r15,%r14), %ebx
	leal	(%r15,%r14), %eax
	addl	$-98305, %eax                   ## imm = 0xFFFE7FFF
	xorl	%edi, %edi
	cmpl	$-131073, %eax                  ## imm = 0xFFFDFFFF
	setb	%dil
	callq	_WARN_ON
	testl	%ebx, %ebx
	js	LBB0_4
## %bb.5:
	movq	_PS_PHASE_TRIP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	leal	(%r15,%r14), %ebx
	addl	$65536, %ebx                    ## imm = 0x10000
LBB0_6:
	sarl	$2, %ebx
	movq	_PS_PHASE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	orl	%eax, %ebx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PS_PHASE_TRIP,4,2              ## @PS_PHASE_TRIP
	.comm	_PS_PHASE_MASK,4,2              ## @PS_PHASE_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_skl_scaler_calc_phase          ; -- Begin function skl_scaler_calc_phase
	.p2align	2
_skl_scaler_calc_phase:                 ; @skl_scaler_calc_phase
	.cfi_startproc
; %bb.0:
	cbz	w2, LBB0_2
; %bb.1:
	lsl	w8, w0, #15
	sub	w8, w8, #8, lsl #12             ; =32768
	sdiv	w8, w8, w0
	sub	w8, w8, #8, lsl #12             ; =32768
	b	LBB0_3
LBB0_2:
	mov	w8, #-32768
LBB0_3:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	lsl	w9, w0, #1
	sdiv	w9, w1, w9
	add	w19, w9, w8
	sub	w8, w19, #24, lsl #12           ; =98304
	sub	w8, w8, #1
	mov	w9, #-131073
	cmp	w8, w9
	cset	w0, lo
	bl	_WARN_ON
	add	w8, w19, #16, lsl #12           ; =65536
Lloh0:
	adrp	x9, _PS_PHASE_TRIP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PS_PHASE_TRIP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w19, #0
	csel	w8, w8, w19, lt
	csel	w9, wzr, w9, lt
Lloh3:
	adrp	x10, _PS_PHASE_MASK@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PS_PHASE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	and	w8, w10, w8, asr #2
	orr	w0, w8, w9
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PS_PHASE_TRIP,4,2              ; @PS_PHASE_TRIP
	.comm	_PS_PHASE_MASK,4,2              ; @PS_PHASE_MASK
.subsections_via_symbols
