	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_dp_get_one_sb_msg
_drm_dp_get_one_sb_msg:                 ## @drm_dp_get_one_sb_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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	16(%rdi), %r15
	leaq	8(%rdi), %rax
	testl	%esi, %esi
	movq	_DP_SIDEBAND_MSG_UP_REQ_BASE@GOTPCREL(%rip), %rcx
	cmoveq	_DP_SIDEBAND_MSG_DOWN_REP_BASE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	cmoveq	%rax, %r15
	movl	4(%rdi), %edi
	movl	$16, %esi
	callq	_min
	movl	%eax, %ebx
	movl	(%r13), %edi
	leaq	-176(%rbp), %rdx
	movq	%r14, -192(%rbp)                ## 8-byte Spill
	movl	%r14d, %esi
	movl	%eax, %ecx
	callq	_drm_dp_dpcd_read
	cmpl	%ebx, %eax
	jne	LBB0_1
## %bb.3:
	leaq	-176(%rbp), %rsi
	movl	$1, %r12d
	movq	%r15, %rdi
	movl	%ebx, %edx
	movl	$1, %ecx
	callq	_drm_dp_sideband_msg_build
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	(%r15), %r14d
	subl	%ebx, %r14d
	addl	4(%r15), %r14d
	testl	%r14d, %r14d
	jle	LBB0_13
## %bb.6:
	movq	%r15, -184(%rbp)                ## 8-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r13), %esi
	movl	%r14d, %edi
	movl	$16, %edx
	callq	_min3
	movl	%eax, %r12d
	movl	(%r13), %edi
	movq	-192(%rbp), %rax                ## 8-byte Reload
	leal	(%rbx,%rax), %esi
	leaq	-176(%rbp), %r15
	movq	%r15, %rdx
	movl	%r12d, %ecx
	callq	_drm_dp_dpcd_read
	cmpl	%r12d, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	-184(%rbp), %rdi                ## 8-byte Reload
	movq	%r15, %rsi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	callq	_drm_dp_sideband_msg_build
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	addl	%r12d, %ebx
	subl	%r12d, %r14d
	jg	LBB0_7
## %bb.12:
	movl	$1, %r12d
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%ebx, %esi
LBB0_2:
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_13
LBB0_4:
	movl	-176(%rbp), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_13
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	xorl	%r12d, %r12d
	jmp	LBB0_2
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r12d, %eax
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_SIDEBAND_MSG_UP_REQ_BASE,4,2 ## @DP_SIDEBAND_MSG_UP_REQ_BASE
	.comm	_DP_SIDEBAND_MSG_DOWN_REP_BASE,4,2 ## @DP_SIDEBAND_MSG_DOWN_REP_BASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read DPCD down rep %d %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"sideband msg build failed %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to read a chunk (len %d, ret %d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to build sideband msg\n"

	.no_dead_strip	_drm_dp_get_one_sb_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_get_one_sb_msg
_drm_dp_get_one_sb_msg:                 ; @drm_dp_get_one_sb_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _DP_SIDEBAND_MSG_UP_REQ_BASE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DP_SIDEBAND_MSG_UP_REQ_BASE@GOTPAGEOFF]
Lloh5:
	adrp	x9, _DP_SIDEBAND_MSG_DOWN_REP_BASE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DP_SIDEBAND_MSG_DOWN_REP_BASE@GOTPAGEOFF]
	cmp	w1, #0
	csel	x8, x9, x8, eq
	ldr	w20, [x8]
	add	x8, x0, #16
	add	x9, x0, #8
	csel	x21, x9, x8, eq
	ldr	w0, [x0, #4]
	mov	w1, #16
	bl	_min
	mov	x22, x0
	ldr	w0, [x19]
	add	x2, sp, #24
	mov	x1, x20
	mov	x3, x22
	bl	_drm_dp_dpcd_read
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, w22
	b.ne	LBB0_7
; %bb.1:
	add	x1, sp, #24
	mov	x0, x21
	mov	x2, x22
	mov	w3, #1
	bl	_drm_dp_sideband_msg_build
	cbz	w0, LBB0_8
; %bb.2:
	ldp	w8, w9, [x21]
	sub	w8, w8, w22
	add	w23, w8, w9
	cmp	w23, #1
	b.lt	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19, #4]
	mov	x0, x23
	mov	w2, #16
	bl	_min3
	mov	x24, x0
	ldr	w0, [x19]
	add	w1, w22, w20
	add	x2, sp, #24
	mov	x3, x24
	bl	_drm_dp_dpcd_read
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, w24
	b.ne	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #24
	mov	x0, x21
	mov	x2, x24
	mov	w3, #0
	bl	_drm_dp_sideband_msg_build
	cbz	w0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w22, w24, w22
	sub	w23, w23, w24
	cmp	w23, #0
	b.gt	LBB0_3
LBB0_6:
	mov	w0, #1
	b	LBB0_12
LBB0_7:
	stp	x22, x0, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_8:
	ldr	w8, [sp, #24]
	str	x8, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_9:
	stp	x24, x0, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_11:
	bl	_DRM_DEBUG_KMS
	mov	w0, #0
LBB0_12:
	ldur	x8, [x29, #-56]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_SIDEBAND_MSG_UP_REQ_BASE,4,2 ; @DP_SIDEBAND_MSG_UP_REQ_BASE
	.comm	_DP_SIDEBAND_MSG_DOWN_REP_BASE,4,2 ; @DP_SIDEBAND_MSG_DOWN_REP_BASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read DPCD down rep %d %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"sideband msg build failed %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to read a chunk (len %d, ret %d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to build sideband msg\n"

	.no_dead_strip	_drm_dp_get_one_sb_msg
.subsections_via_symbols
