	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ci_program_display_gap
_ci_program_display_gap:                ## @ci_program_display_gap
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_CG_DISPLAY_GAP_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32_SMC
	movl	%eax, %ebx
	movslq	4(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_r600_dpm_get_vrefresh
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_r600_dpm_get_vblank_time
	movl	%eax, %r15d
	movq	_DISP_GAP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	cmpl	$0, (%r14)
	jle	LBB0_1
## %bb.2:
	movq	_R600_PM_DISPLAY_GAP_VBLANK_OR_WM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_R600_PM_DISPLAY_GAP_IGNORE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	callq	_DISP_GAP
	notl	%r13d
	andl	%r13d, %ebx
	orl	%eax, %ebx
	movq	_CG_DISPLAY_GAP_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_WREG32_SMC
	testl	%r12d, %r12d
	movl	$60, %ecx
	cmovnel	%r12d, %ecx
	movl	$1000000, %eax                  ## imm = 0xF4240
	xorl	%edx, %edx
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	movl	$-200, %ecx
	subl	%r15d, %ecx
	cmpl	$-1, %r15d
	movl	$-700, %ebx                     ## imm = 0xFD44
	cmovnel	%ecx, %ebx
	addl	%ebx, %eax
	imulq	$1374389535, -48(%rbp), %rsi    ## 8-byte Folded Reload
                                        ## imm = 0x51EB851F
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$37, %rsi
	addl	%ecx, %esi
	imull	%eax, %esi
	movq	_CG_DISPLAY_GAP_CNTL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_WREG32_SMC
	movq	_SMU7_SoftRegisters@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_PreVBlankGap@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_offsetof
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	$100, %edx
	callq	_ci_write_smc_soft_register
	movl	(%r15), %edi
	movq	_VBlankTimeout@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_offsetof
	negl	%ebx
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_ci_write_smc_soft_register
	xorl	%esi, %esi
	cmpl	$1, (%r14)
	sete	%sil
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ci_notify_smc_display_change   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CG_DISPLAY_GAP_CNTL,4,2        ## @CG_DISPLAY_GAP_CNTL
	.comm	_DISP_GAP_MASK,4,2              ## @DISP_GAP_MASK
	.comm	_R600_PM_DISPLAY_GAP_VBLANK_OR_WM,4,2 ## @R600_PM_DISPLAY_GAP_VBLANK_OR_WM
	.comm	_R600_PM_DISPLAY_GAP_IGNORE,4,2 ## @R600_PM_DISPLAY_GAP_IGNORE
	.comm	_CG_DISPLAY_GAP_CNTL2,4,2       ## @CG_DISPLAY_GAP_CNTL2
	.comm	_SMU7_SoftRegisters,4,2         ## @SMU7_SoftRegisters
	.comm	_PreVBlankGap,4,2               ## @PreVBlankGap
	.comm	_VBlankTimeout,4,2              ## @VBlankTimeout
	.no_dead_strip	_ci_program_display_gap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ci_program_display_gap
_ci_program_display_gap:                ; @ci_program_display_gap
	.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
Lloh0:
	adrp	x23, _CG_DISPLAY_GAP_CNTL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CG_DISPLAY_GAP_CNTL@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_RREG32_SMC
	mov	x20, x0
	ldrsw	x24, [x19, #4]
	mov	x0, x19
	bl	_r600_dpm_get_vrefresh
	mov	x21, x0
	mov	x0, x19
	bl	_r600_dpm_get_vblank_time
	mov	x22, x0
Lloh2:
	adrp	x8, _DISP_GAP_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DISP_GAP_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w25, [x8]
Lloh5:
	adrp	x8, _R600_PM_DISPLAY_GAP_VBLANK_OR_WM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _R600_PM_DISPLAY_GAP_VBLANK_OR_WM@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh7:
	adrp	x10, _R600_PM_DISPLAY_GAP_IGNORE@GOTPAGE
Lloh8:
	ldr	x10, [x10, _R600_PM_DISPLAY_GAP_IGNORE@GOTPAGEOFF]
	cmp	w9, #0
	csel	x8, x8, x10, gt
	ldr	w0, [x8]
	bl	_DISP_GAP
	bic	w8, w20, w25
	orr	w1, w0, w8
	ldr	w0, [x23]
	bl	_WREG32_SMC
	mov	w8, #60
	cmp	w21, #0
	csel	w8, w8, w21, eq
	mov	w9, #16960
	movk	w9, #15, lsl #16
	sdiv	w8, w9, w8
	mov	w9, #-200
	sub	w9, w9, w22
	cmn	w22, #1
	mov	w10, #-700
	csel	w20, w10, w9, eq
	add	w8, w20, w8
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x9, x24, x9
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	mul	w1, w8, w9
Lloh9:
	adrp	x8, _CG_DISPLAY_GAP_CNTL2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CG_DISPLAY_GAP_CNTL2@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_WREG32_SMC
Lloh12:
	adrp	x21, _SMU7_SoftRegisters@GOTPAGE
Lloh13:
	ldr	x21, [x21, _SMU7_SoftRegisters@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh14:
	adrp	x8, _PreVBlankGap@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PreVBlankGap@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_offsetof
	mov	x1, x0
	mov	x0, x19
	mov	w2, #100
	bl	_ci_write_smc_soft_register
	ldr	w0, [x21]
Lloh17:
	adrp	x8, _VBlankTimeout@GOTPAGE
Lloh18:
	ldr	x8, [x8, _VBlankTimeout@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_offsetof
	mov	x1, x0
	neg	w2, w20
	mov	x0, x19
	bl	_ci_write_smc_soft_register
	ldr	w8, [x19]
	cmp	w8, #1
	cset	w1, eq
	mov	x0, x19
	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
	b	_ci_notify_smc_display_change
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_CG_DISPLAY_GAP_CNTL,4,2        ; @CG_DISPLAY_GAP_CNTL
	.comm	_DISP_GAP_MASK,4,2              ; @DISP_GAP_MASK
	.comm	_R600_PM_DISPLAY_GAP_VBLANK_OR_WM,4,2 ; @R600_PM_DISPLAY_GAP_VBLANK_OR_WM
	.comm	_R600_PM_DISPLAY_GAP_IGNORE,4,2 ; @R600_PM_DISPLAY_GAP_IGNORE
	.comm	_CG_DISPLAY_GAP_CNTL2,4,2       ; @CG_DISPLAY_GAP_CNTL2
	.comm	_SMU7_SoftRegisters,4,2         ; @SMU7_SoftRegisters
	.comm	_PreVBlankGap,4,2               ; @PreVBlankGap
	.comm	_VBlankTimeout,4,2              ; @VBlankTimeout
	.no_dead_strip	_ci_program_display_gap
.subsections_via_symbols
