	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dsi_vc_send_bta_sync
_dsi_vc_send_bta_sync:                  ## @dsi_vc_send_bta_sync
	.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
	movl	%esi, %r14d
	callq	_to_dsi_data
	movq	%rax, %r15
	movq	_completion@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_DECLARE_COMPLETION_ONSTACK
	movq	_dsi_completion_handler@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_DSI_VC_IRQ_BTA@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	%rbx, %rcx
	callq	_dsi_register_isr_vc
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movl	(%r12), %esi
	movq	_DSI_IRQ_ERROR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_completion@GOTPCREL(%rip), %rdx
	movq	%r15, %rdi
	callq	_dsi_register_isr
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.2:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_dsi_vc_send_bta
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msecs_to_jiffies
	movq	_completion@GOTPCREL(%rip), %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r15, %rdi
	callq	_dsi_get_errors
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DSSERR
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DSSERR
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	xorl	%ebx, %ebx
LBB0_9:
	movl	(%r12), %esi
	movq	_DSI_IRQ_ERROR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_completion@GOTPCREL(%rip), %rdx
	movq	%r15, %rdi
	callq	_dsi_unregister_isr
LBB0_10:
	movl	(%r12), %edx
	movl	(%r13), %r8d
	movq	_completion@GOTPCREL(%rip), %rcx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_dsi_unregister_isr_vc
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_completion,4,2                 ## @completion
	.comm	_dsi_completion_handler,4,2     ## @dsi_completion_handler
	.comm	_DSI_VC_IRQ_BTA,4,2             ## @DSI_VC_IRQ_BTA
	.comm	_DSI_IRQ_ERROR_MASK,4,2         ## @DSI_IRQ_ERROR_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to receive BTA\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Error while sending BTA: %x\n"

	.no_dead_strip	_dsi_vc_send_bta_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dsi_vc_send_bta_sync
_dsi_vc_send_bta_sync:                  ; @dsi_vc_send_bta_sync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	bl	_to_dsi_data
	mov	x20, x0
Lloh0:
	adrp	x21, _completion@GOTPAGE
Lloh1:
	ldr	x21, [x21, _completion@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_DECLARE_COMPLETION_ONSTACK
Lloh2:
	adrp	x22, _dsi_completion_handler@GOTPAGE
Lloh3:
	ldr	x22, [x22, _dsi_completion_handler@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh4:
	adrp	x23, _DSI_VC_IRQ_BTA@GOTPAGE
Lloh5:
	ldr	x23, [x23, _DSI_VC_IRQ_BTA@GOTPAGEOFF]
	ldr	w4, [x23]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x21
	bl	_dsi_register_isr_vc
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.1:
	ldr	w1, [x22]
Lloh6:
	adrp	x24, _DSI_IRQ_ERROR_MASK@GOTPAGE
Lloh7:
	ldr	x24, [x24, _DSI_IRQ_ERROR_MASK@GOTPAGEOFF]
	ldr	w3, [x24]
Lloh8:
	adrp	x2, _completion@GOTPAGE
Lloh9:
	ldr	x2, [x2, _completion@GOTPAGEOFF]
	mov	x0, x20
	bl	_dsi_register_isr
	mov	x21, x0
	cbnz	w0, LBB0_10
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	bl	_dsi_vc_send_bta
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.3:
	mov	w0, #500
	bl	_msecs_to_jiffies
	mov	x1, x0
Lloh10:
	adrp	x0, _completion@GOTPAGE
Lloh11:
	ldr	x0, [x0, _completion@GOTPAGEOFF]
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_dsi_get_errors
	cbz	x0, LBB0_8
; %bb.5:
	str	x0, [sp]
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
LBB0_7:
	bl	_DSSERR
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
	ldr	w1, [x22]
	ldr	w3, [x24]
Lloh19:
	adrp	x2, _completion@GOTPAGE
Lloh20:
	ldr	x2, [x2, _completion@GOTPAGEOFF]
	mov	x0, x20
	bl	_dsi_unregister_isr
LBB0_10:
	ldr	w2, [x22]
	ldr	w4, [x23]
Lloh21:
	adrp	x3, _completion@GOTPAGE
Lloh22:
	ldr	x3, [x3, _completion@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x19
	bl	_dsi_unregister_isr_vc
LBB0_11:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_completion,4,2                 ; @completion
	.comm	_dsi_completion_handler,4,2     ; @dsi_completion_handler
	.comm	_DSI_VC_IRQ_BTA,4,2             ; @DSI_VC_IRQ_BTA
	.comm	_DSI_IRQ_ERROR_MASK,4,2         ; @DSI_IRQ_ERROR_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to receive BTA\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Error while sending BTA: %x\n"

	.no_dead_strip	_dsi_vc_send_bta_sync
.subsections_via_symbols
