	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_hsp_doorbell_startup
_tegra_hsp_doorbell_startup:            ## @tegra_hsp_doorbell_startup
	.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), %rax
	movq	8(%rdi), %rbx
	movq	(%rbx), %rdx
	cmpq	(%rax), %rdx
	jge	LBB0_1
## %bb.2:
	movq	8(%rbx), %r14
	movq	_TEGRA_HSP_DB_MASTER_CCPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_tegra_hsp_doorbell_get
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_tegra_hsp_doorbell_can_ring
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	addq	$8, %r15
	movq	_HSP_DB_ENABLE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_tegra_hsp_channel_readl
	movl	%eax, %r12d
	movq	(%rbx), %rdi
	callq	_BIT
	orl	%eax, %r12d
	movl	(%r13), %edx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_tegra_hsp_channel_writel
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_1:
	movl	8(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %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	"invalid master ID %u for HSP channel\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TEGRA_HSP_DB_MASTER_CCPLEX,4,2 ## @TEGRA_HSP_DB_MASTER_CCPLEX
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_HSP_DB_ENABLE,4,2              ## @HSP_DB_ENABLE
	.no_dead_strip	_tegra_hsp_doorbell_startup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_hsp_doorbell_startup
_tegra_hsp_doorbell_startup:            ; @tegra_hsp_doorbell_startup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldp	x8, x20, [x0]
	ldr	x2, [x20]
	ldr	x9, [x8]
	cmp	x2, x9
	b.ge	LBB0_4
; %bb.1:
	ldr	x19, [x20, #8]
Lloh0:
	adrp	x8, _TEGRA_HSP_DB_MASTER_CCPLEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TEGRA_HSP_DB_MASTER_CCPLEX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tegra_hsp_doorbell_get
	cbz	x0, LBB0_5
; %bb.2:
	mov	x21, x0
	mov	x0, x20
	bl	_tegra_hsp_doorbell_can_ring
	cbz	w0, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_spin_lock_irqsave
	add	x21, x21, #8
Lloh3:
	adrp	x23, _HSP_DB_ENABLE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _HSP_DB_ENABLE@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x21
	bl	_tegra_hsp_channel_readl
	mov	x22, x0
	ldr	x0, [x20]
	bl	_BIT
	orr	w1, w0, w22
	ldr	w2, [x23]
	mov	x0, x21
	bl	_tegra_hsp_channel_writel
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_7
LBB0_4:
	ldr	w0, [x8, #8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x8, _ENODEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid master ID %u for HSP channel\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TEGRA_HSP_DB_MASTER_CCPLEX,4,2 ; @TEGRA_HSP_DB_MASTER_CCPLEX
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_HSP_DB_ENABLE,4,2              ; @HSP_DB_ENABLE
	.no_dead_strip	_tegra_hsp_doorbell_startup
.subsections_via_symbols
