	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_dp_send_sideband_msg
_drm_dp_send_sideband_msg:              ## @drm_dp_send_sideband_msg
	.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
	movl	%ecx, %ebx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	testl	%esi, %esi
	jne	LBB0_1
## %bb.2:
	movq	_DP_SIDEBAND_MSG_DOWN_REQ_BASE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DP_SIDEBAND_MSG_UP_REP_BASE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r14d
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	4(%r12), %edi
	movl	$16, %esi
	movl	%ebx, %edx
	callq	_min3
	movl	%eax, %r13d
	movl	(%r12), %edi
	leal	(%r15,%r14), %esi
	movslq	%r15d, %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rdx
	movl	%r13d, %ecx
	callq	_drm_dp_dpcd_write
	cmpl	%r13d, %eax
	jne	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=2
	addl	%r13d, %r15d
	subl	%r13d, %ebx
	jg	LBB0_5
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_EIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leal	1(%rsi), %edx
	cmpl	$5, %esi
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	jb	LBB0_4
LBB0_8:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_DRM_DEBUG_KMS
	xorl	%eax, %eax
	movq	_EIO@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_SIDEBAND_MSG_UP_REP_BASE,4,2 ## @DP_SIDEBAND_MSG_UP_REP_BASE
	.comm	_DP_SIDEBAND_MSG_DOWN_REQ_BASE,4,2 ## @DP_SIDEBAND_MSG_DOWN_REQ_BASE
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to dpcd write %d %d\n"

	.no_dead_strip	_drm_dp_send_sideband_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_dp_send_sideband_msg
_drm_dp_send_sideband_msg:              ; @drm_dp_send_sideband_msg
	.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, x3
	mov	x20, x2
	mov	x21, x0
	mov	w24, #0
	cmp	w1, #0
Lloh0:
	adrp	x8, _DP_SIDEBAND_MSG_UP_REP_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DP_SIDEBAND_MSG_UP_REP_BASE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _DP_SIDEBAND_MSG_DOWN_REQ_BASE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DP_SIDEBAND_MSG_DOWN_REQ_BASE@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w25, [x8]
	mov	x23, x3
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	mov	w1, #16
	mov	x2, x23
	bl	_min3
	mov	x22, x0
	ldr	w0, [x21]
	add	w1, w24, w25
	add	x2, x20, w24, sxtw #2
	mov	x3, x22
	bl	_drm_dp_dpcd_write
	cmp	w0, w22
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w24, w22, w24
	sub	w23, w23, w22
	cmp	w23, #0
	b.gt	LBB0_1
	b	LBB0_11
LBB0_3:
	mov	x2, x0
Lloh4:
	adrp	x24, _EIO@GOTPAGE
Lloh5:
	ldr	x24, [x24, _EIO@GOTPAGEOFF]
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_25
; %bb.4:
	mov	w26, #0
	mov	x23, x19
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	mov	w1, #16
	mov	x2, x23
	bl	_min3
	mov	x22, x0
	ldr	w0, [x21]
	add	w1, w26, w25
	add	x2, x20, w26, sxtw #2
	mov	x3, x22
	bl	_drm_dp_dpcd_write
	cmp	w0, w22
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w26, w22, w26
	sub	w23, w23, w22
	cmp	w23, #0
	b.gt	LBB0_5
	b	LBB0_11
LBB0_7:
	mov	x2, x0
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_25
; %bb.8:
	mov	w26, #0
	mov	x23, x19
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	mov	w1, #16
	mov	x2, x23
	bl	_min3
	mov	x22, x0
	ldr	w0, [x21]
	add	w1, w26, w25
	add	x2, x20, w26, sxtw #2
	mov	x3, x22
	bl	_drm_dp_dpcd_write
	cmp	w0, w22
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w26, w22, w26
	sub	w23, w23, w22
	cmp	w23, #0
	b.gt	LBB0_9
LBB0_11:
	mov	w0, #0
	b	LBB0_26
LBB0_12:
	mov	x2, x0
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_25
; %bb.13:
	mov	w26, #0
	mov	x23, x19
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	mov	w1, #16
	mov	x2, x23
	bl	_min3
	mov	x22, x0
	ldr	w0, [x21]
	add	w1, w26, w25
	add	x2, x20, w26, sxtw #2
	mov	x3, x22
	bl	_drm_dp_dpcd_write
	cmp	w0, w22
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	w0, #0
	add	w26, w22, w26
	sub	w23, w23, w22
	cmp	w23, #0
	b.gt	LBB0_14
	b	LBB0_26
LBB0_16:
	mov	x2, x0
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_25
; %bb.17:
	mov	w26, #0
	mov	x23, x19
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	mov	w1, #16
	mov	x2, x23
	bl	_min3
	mov	x22, x0
	ldr	w0, [x21]
	add	w1, w26, w25
	add	x2, x20, w26, sxtw #2
	mov	x3, x22
	bl	_drm_dp_dpcd_write
	cmp	w0, w22
	b.ne	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	w0, #0
	add	w26, w22, w26
	sub	w23, w23, w22
	cmp	w23, #0
	b.gt	LBB0_18
	b	LBB0_26
LBB0_20:
	mov	x2, x0
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_25
; %bb.21:
	mov	w23, #0
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	mov	w1, #16
	mov	x2, x19
	bl	_min3
	mov	x22, x0
	ldr	w0, [x21]
	add	w1, w23, w25
	add	x2, x20, w23, sxtw #2
	mov	x3, x22
	bl	_drm_dp_dpcd_write
	cmp	w0, w22
	b.ne	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	mov	w0, #0
	add	w23, w22, w23
	sub	w19, w19, w22
	cmp	w19, #0
	b.gt	LBB0_22
	b	LBB0_26
LBB0_24:
	mov	x2, x0
LBB0_25:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_DRM_DEBUG_KMS
	ldr	w8, [x24]
	neg	w0, w8
LBB0_26:
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_SIDEBAND_MSG_UP_REP_BASE,4,2 ; @DP_SIDEBAND_MSG_UP_REP_BASE
	.comm	_DP_SIDEBAND_MSG_DOWN_REQ_BASE,4,2 ; @DP_SIDEBAND_MSG_DOWN_REQ_BASE
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to dpcd write %d %d\n"

	.no_dead_strip	_drm_dp_send_sideband_msg
.subsections_via_symbols
