	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __intel_get_crtc_scanline_from_timestamp
___intel_get_crtc_scanline_from_timestamp: ## @__intel_get_crtc_scanline_from_timestamp
	.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	%rdi, %r15
	leaq	8(%rdi), %r14
	movq	8(%rdi), %rdi
	callq	_to_i915
	movq	8(%r15), %rax
	movq	(%rax), %rbx
	movq	%r14, %rdi
	callq	_drm_crtc_index
	shlq	$5, %rax
	movq	(%rbx,%rax), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rbx,%rax), %r13
	movq	16(%rbx,%rax), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rbx,%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_IVB_TIMESTAMP_CTR@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_PIPE_FRMTMSTMP
	movl	%eax, %edi
	callq	_I915_READ_FW
	movq	%rax, %rbx
	movl	(%r14), %edi
	callq	_I915_READ_FW
	movq	%rax, %r12
	movl	(%r15), %edi
	callq	_PIPE_FRMTMSTMP
	movl	%eax, %edi
	callq	_I915_READ_FW
	cmpq	%rbx, %rax
	jne	LBB0_1
## %bb.2:
	subq	%rbx, %r12
	movq	%r12, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_mul_u32_u32
	imull	$1000, -56(%rbp), %esi          ## 4-byte Folded Reload
                                        ## imm = 0x3E8
	movl	%eax, %edi
	callq	_div_u64
	leaq	-1(%r13), %rsi
	movq	%rax, %rdi
	callq	_min
	addq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	movq	%rax, %rcx
	orq	%r13, %rcx
	shrq	$32, %rcx
	je	LBB0_3
## %bb.4:
	cqto
	idivq	%r13
	movq	%rdx, %rax
	jmp	LBB0_5
LBB0_3:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r13d
	movl	%edx, %eax
LBB0_5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IVB_TIMESTAMP_CTR,4,2          ## @IVB_TIMESTAMP_CTR
	.no_dead_strip	___intel_get_crtc_scanline_from_timestamp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __intel_get_crtc_scanline_from_timestamp
___intel_get_crtc_scanline_from_timestamp: ; @__intel_get_crtc_scanline_from_timestamp
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	mov	x20, x0
	ldr	x0, [x20, #8]!
	bl	_to_i915
	ldr	x8, [x20]
	ldr	x21, [x8]
	mov	x0, x20
	bl	_drm_crtc_index
	add	x8, x21, x0, lsl #5
	ldp	x24, x23, [x8]
	ldp	x25, x20, [x8, #16]
Lloh0:
	adrp	x26, _IVB_TIMESTAMP_CTR@GOTPAGE
Lloh1:
	ldr	x26, [x26, _IVB_TIMESTAMP_CTR@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	bl	_PIPE_FRMTMSTMP
	bl	_I915_READ_FW
	mov	x21, x0
	ldr	w0, [x26]
	bl	_I915_READ_FW
	mov	x22, x0
	ldr	w0, [x19]
	bl	_PIPE_FRMTMSTMP
	bl	_I915_READ_FW
	cmp	x0, x21
	b.ne	LBB0_1
; %bb.2:
	sub	x0, x22, x21
	mov	x1, x20
	bl	_mul_u32_u32
	mov	w8, #1000
	mul	w1, w25, w8
	bl	_div_u64
	sub	x1, x23, #1
	bl	_min
	add	x8, x0, x24
	sdiv	x9, x8, x23
	msub	x0, x9, x23, x8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_IVB_TIMESTAMP_CTR,4,2          ; @IVB_TIMESTAMP_CTR
	.no_dead_strip	___intel_get_crtc_scanline_from_timestamp
.subsections_via_symbols
