	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msm_hdmi_bridge_mode_set
_msm_hdmi_bridge_mode_set:              ## @msm_hdmi_bridge_mode_set
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	callq	_to_hdmi_bridge
	movq	(%rax), %r15
	imull	$1000, (%r13), %eax             ## imm = 0x3E8
	movl	%eax, (%r15)
	movl	4(%r13), %esi
	movl	%esi, %r12d
	subl	8(%r13), %r12d
	movl	16(%r13), %edx
	movl	12(%r13), %ecx
	movl	%edx, %eax
	subl	20(%r13), %eax
	addl	%r12d, %ecx
	movl	%ecx, %r8d
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	leal	-1(%rax), %r9d
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movl	24(%r13), %ecx
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	leal	-1(%rax,%rcx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_DBG
	movq	_REG_HDMI_TOTAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	4(%r13), %edi
	decl	%edi
	callq	_HDMI_TOTAL_H_TOTAL
	movl	%eax, %r14d
	movl	16(%r13), %edi
	decl	%edi
	callq	_HDMI_TOTAL_V_TOTAL
	orl	%eax, %r14d
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_hdmi_write
	movq	_REG_HDMI_ACTIVE_HSYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r12d, %edi
	callq	_HDMI_ACTIVE_HSYNC_START
	movl	%eax, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_HDMI_ACTIVE_HSYNC_END
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_hdmi_write
	movq	_REG_HDMI_ACTIVE_VSYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_HDMI_ACTIVE_VSYNC_START
	movl	%eax, %ebx
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_HDMI_ACTIVE_VSYNC_END
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_hdmi_write
	xorl	%edi, %edi
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_REG_HDMI_VSYNC_TOTAL_F2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	movl	$0, %ebx
	movl	$0, %r12d
	testl	%eax, 28(%r13)
	je	LBB0_2
## %bb.1:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, %ecx
	movl	16(%r13), %edi
	movl	%eax, %ebx
	movl	%ecx, %r12d
LBB0_2:
	callq	_HDMI_VSYNC_TOTAL_F2_V_TOTAL
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_hdmi_write
	movq	_REG_HDMI_VSYNC_ACTIVE_F2@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_HDMI_VSYNC_ACTIVE_F2_START
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_HDMI_VSYNC_ACTIVE_F2_END
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_hdmi_write
	movl	28(%r13), %eax
	movq	_DRM_MODE_FLAG_NHSYNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	je	LBB0_4
## %bb.3:
	movq	_HDMI_FRAME_CTRL_HSYNC_LOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_4:
	movq	_DRM_MODE_FLAG_NVSYNC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	andl	%eax, %ebx
	je	LBB0_6
## %bb.5:
	movq	_HDMI_FRAME_CTRL_VSYNC_LOW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
LBB0_6:
	orl	%ecx, %ebx
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	je	LBB0_8
## %bb.7:
	movq	_HDMI_FRAME_CTRL_INTERLACED_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	orl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DBG
	movq	_REG_HDMI_FRAME_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_hdmi_write
	cmpq	$0, 8(%r15)
	je	LBB0_9
## %bb.10:
	movq	%r15, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_msm_hdmi_audio_update          ## TAILCALL
LBB0_9:
	addq	$40, %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	"htotal=%d, vtotal=%d, hstart=%d, hend=%d, vstart=%d, vend=%d"

	.comm	_REG_HDMI_TOTAL,4,2             ## @REG_HDMI_TOTAL
	.comm	_REG_HDMI_ACTIVE_HSYNC,4,2      ## @REG_HDMI_ACTIVE_HSYNC
	.comm	_REG_HDMI_ACTIVE_VSYNC,4,2      ## @REG_HDMI_ACTIVE_VSYNC
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_REG_HDMI_VSYNC_TOTAL_F2,4,2    ## @REG_HDMI_VSYNC_TOTAL_F2
	.comm	_REG_HDMI_VSYNC_ACTIVE_F2,4,2   ## @REG_HDMI_VSYNC_ACTIVE_F2
	.comm	_DRM_MODE_FLAG_NHSYNC,4,2       ## @DRM_MODE_FLAG_NHSYNC
	.comm	_HDMI_FRAME_CTRL_HSYNC_LOW,4,2  ## @HDMI_FRAME_CTRL_HSYNC_LOW
	.comm	_DRM_MODE_FLAG_NVSYNC,4,2       ## @DRM_MODE_FLAG_NVSYNC
	.comm	_HDMI_FRAME_CTRL_VSYNC_LOW,4,2  ## @HDMI_FRAME_CTRL_VSYNC_LOW
	.comm	_HDMI_FRAME_CTRL_INTERLACED_EN,4,2 ## @HDMI_FRAME_CTRL_INTERLACED_EN
L_.str.1:                               ## @.str.1
	.asciz	"frame_ctrl=%08x"

	.comm	_REG_HDMI_FRAME_CTRL,4,2        ## @REG_HDMI_FRAME_CTRL
	.no_dead_strip	_msm_hdmi_bridge_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msm_hdmi_bridge_mode_set
_msm_hdmi_bridge_mode_set:              ; @msm_hdmi_bridge_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x20, x2
	bl	_to_hdmi_bridge
	ldr	x19, [x0]
	mov	w8, #1000
	ldp	w9, w1, [x20]
	mul	w8, w9, w8
	str	w8, [x19]
	ldp	w8, w9, [x20, #8]
	sub	w25, w1, w8
	add	w26, w25, w9
	ldp	w8, w9, [x20, #16]
	ldr	w10, [x20, #24]
	sub	w22, w8, w9
	add	w21, w22, w10
	sub	w24, w22, #1
	sub	w23, w21, #1
	stp	x8, x25, [sp]
	stp	x26, x24, [sp, #16]
	str	x23, [sp, #32]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
Lloh2:
	adrp	x8, _REG_HDMI_TOTAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _REG_HDMI_TOTAL@GOTPAGEOFF]
Lloh4:
	ldr	w27, [x8]
	ldr	w8, [x20, #4]
	sub	w0, w8, #1
	bl	_HDMI_TOTAL_H_TOTAL
	mov	x28, x0
	ldr	w8, [x20, #16]
	sub	w0, w8, #1
	bl	_HDMI_TOTAL_V_TOTAL
	orr	w2, w0, w28
	mov	x0, x19
	mov	x1, x27
	bl	_hdmi_write
Lloh5:
	adrp	x8, _REG_HDMI_ACTIVE_HSYNC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REG_HDMI_ACTIVE_HSYNC@GOTPAGEOFF]
Lloh7:
	ldr	w27, [x8]
	mov	x0, x25
	bl	_HDMI_ACTIVE_HSYNC_START
	mov	x25, x0
	mov	x0, x26
	bl	_HDMI_ACTIVE_HSYNC_END
	orr	w2, w0, w25
	mov	x0, x19
	mov	x1, x27
	bl	_hdmi_write
Lloh8:
	adrp	x8, _REG_HDMI_ACTIVE_VSYNC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _REG_HDMI_ACTIVE_VSYNC@GOTPAGEOFF]
Lloh10:
	ldr	w25, [x8]
	mov	x0, x24
	bl	_HDMI_ACTIVE_VSYNC_START
	mov	x24, x0
	mov	x0, x23
	bl	_HDMI_ACTIVE_VSYNC_END
	orr	w2, w0, w24
	mov	x0, x19
	mov	x1, x25
	bl	_hdmi_write
Lloh11:
	adrp	x24, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
	ldr	w8, [x20, #28]
	ldr	w9, [x24]
Lloh13:
	adrp	x10, _REG_HDMI_VSYNC_TOTAL_F2@GOTPAGE
Lloh14:
	ldr	x10, [x10, _REG_HDMI_VSYNC_TOTAL_F2@GOTPAGEOFF]
Lloh15:
	ldr	w23, [x10]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x20, #16]
	b	LBB0_3
LBB0_2:
	mov	w0, #0
	mov	w22, #0
	mov	w21, #0
LBB0_3:
	bl	_HDMI_VSYNC_TOTAL_F2_V_TOTAL
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	bl	_hdmi_write
Lloh16:
	adrp	x8, _REG_HDMI_VSYNC_ACTIVE_F2@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REG_HDMI_VSYNC_ACTIVE_F2@GOTPAGEOFF]
Lloh18:
	ldr	w23, [x8]
	mov	x0, x22
	bl	_HDMI_VSYNC_ACTIVE_F2_START
	mov	x22, x0
	mov	x0, x21
	bl	_HDMI_VSYNC_ACTIVE_F2_END
	orr	w2, w0, w22
	mov	x0, x19
	mov	x1, x23
	bl	_hdmi_write
	ldr	w8, [x20, #28]
Lloh19:
	adrp	x9, _DRM_MODE_FLAG_NHSYNC@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DRM_MODE_FLAG_NHSYNC@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
Lloh22:
	adrp	x10, _HDMI_FRAME_CTRL_HSYNC_LOW@GOTPAGE
Lloh23:
	ldr	x10, [x10, _HDMI_FRAME_CTRL_HSYNC_LOW@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w9, wzr, w10, eq
Lloh25:
	adrp	x10, _DRM_MODE_FLAG_NVSYNC@GOTPAGE
Lloh26:
	ldr	x10, [x10, _DRM_MODE_FLAG_NVSYNC@GOTPAGEOFF]
Lloh27:
	adrp	x11, _HDMI_FRAME_CTRL_VSYNC_LOW@GOTPAGE
Lloh28:
	ldr	x11, [x11, _HDMI_FRAME_CTRL_VSYNC_LOW@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
Lloh30:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w10, w9
	ldr	w10, [x24]
Lloh31:
	adrp	x11, _HDMI_FRAME_CTRL_INTERLACED_EN@GOTPAGE
Lloh32:
	ldr	x11, [x11, _HDMI_FRAME_CTRL_INTERLACED_EN@GOTPAGEOFF]
Lloh33:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w8, wzr, w11, eq
	orr	w20, w9, w8
Lloh34:
	adrp	x0, l_.str.1@PAGE
Lloh35:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_DBG
Lloh36:
	adrp	x8, _REG_HDMI_FRAME_CTRL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _REG_HDMI_FRAME_CTRL@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_hdmi_write
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_msm_hdmi_audio_update
LBB0_5:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh29
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"htotal=%d, vtotal=%d, hstart=%d, hend=%d, vstart=%d, vend=%d"

	.comm	_REG_HDMI_TOTAL,4,2             ; @REG_HDMI_TOTAL
	.comm	_REG_HDMI_ACTIVE_HSYNC,4,2      ; @REG_HDMI_ACTIVE_HSYNC
	.comm	_REG_HDMI_ACTIVE_VSYNC,4,2      ; @REG_HDMI_ACTIVE_VSYNC
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_REG_HDMI_VSYNC_TOTAL_F2,4,2    ; @REG_HDMI_VSYNC_TOTAL_F2
	.comm	_REG_HDMI_VSYNC_ACTIVE_F2,4,2   ; @REG_HDMI_VSYNC_ACTIVE_F2
	.comm	_DRM_MODE_FLAG_NHSYNC,4,2       ; @DRM_MODE_FLAG_NHSYNC
	.comm	_HDMI_FRAME_CTRL_HSYNC_LOW,4,2  ; @HDMI_FRAME_CTRL_HSYNC_LOW
	.comm	_DRM_MODE_FLAG_NVSYNC,4,2       ; @DRM_MODE_FLAG_NVSYNC
	.comm	_HDMI_FRAME_CTRL_VSYNC_LOW,4,2  ; @HDMI_FRAME_CTRL_VSYNC_LOW
	.comm	_HDMI_FRAME_CTRL_INTERLACED_EN,4,2 ; @HDMI_FRAME_CTRL_INTERLACED_EN
l_.str.1:                               ; @.str.1
	.asciz	"frame_ctrl=%08x"

	.comm	_REG_HDMI_FRAME_CTRL,4,2        ; @REG_HDMI_FRAME_CTRL
	.no_dead_strip	_msm_hdmi_bridge_mode_set
.subsections_via_symbols
