	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scmi_mbox_chan_setup
_scmi_mbox_chan_setup:                  ## @scmi_mbox_chan_setup
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	movq	%rdi, %rbx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %r14
	leaq	12(%rdi), %r13
	leaq	8(%rdi), %rax
	xorl	%r15d, %r15d
	movl	%ecx, -76(%rbp)                 ## 4-byte Spill
	testl	%ecx, %ecx
	sete	%r15b
	leaq	L_.str.1(%rip), %rcx
	leaq	L_.str(%rip), %r12
	cmoveq	%rcx, %r12
	cmoveq	%rax, %r13
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_scmi_mailbox_check
	testq	%rax, %rax
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.1:
	movq	_SCMI_PROTOCOL_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_idr_find
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_19
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_3:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movl	-76(%rbp), %r14d                ## 4-byte Reload
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movl	4(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$56, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r15
	xorl	%eax, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 48(%r15)
	movq	%rcx, 40(%r15)
	movq	_scmi_rx_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%r15)
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.5:
	movq	_scmi_tx_prepare@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_6:
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, 24(%r15)
	movl	$0, 16(%r15)
	movl	%r14d, 20(%r15)
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, %edx
	callq	_of_parse_phandle
	movq	%rax, %rbx
	leaq	-56(%rbp), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_of_address_to_resource
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_of_node_put
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
LBB0_8:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%r13d, %r13d
LBB0_11:
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	leaq	-56(%rbp), %rdi
	callq	_resource_size
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %edi
	movl	-56(%rbp), %esi
	movl	%eax, %edx
	callq	_devm_ioremap
	movl	%eax, 12(%r15)
	testl	%eax, %eax
	je	LBB0_17
## %bb.14:
	movq	%r15, %rdi
	addq	$16, %rdi
	movl	%r12d, %esi
	callq	_mbox_request_channel
	movl	%eax, 8(%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_18
## %bb.15:
	movl	8(%r15), %edi
	callq	_PTR_ERR
	movl	%eax, %r13d
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	movl	%r13d, %ecx
	addl	(%rax), %ecx
	je	LBB0_12
## %bb.16:
	leaq	L_.str.5(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	jmp	LBB0_8
LBB0_17:
	leaq	L_.str.4(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EADDRNOTAVAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_18:
	movq	-104(%rbp), %r13                ## 8-byte Reload
LBB0_19:
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	leal	1(%rbx), %ecx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_idr_alloc
	cmpl	%ebx, %eax
	jne	LBB0_21
## %bb.20:
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r15)
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_21:
	movl	%eax, %r13d
	leaq	L_.str.6(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Tx"

L_.str.1:                               ## @.str.1
	.asciz	"Rx"

	.comm	_SCMI_PROTOCOL_BASE,4,2         ## @SCMI_PROTOCOL_BASE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_scmi_rx_callback,4,2           ## @scmi_rx_callback
	.comm	_scmi_tx_prepare,8,3            ## @scmi_tx_prepare
L_.str.2:                               ## @.str.2
	.asciz	"shmem"

L_.str.3:                               ## @.str.3
	.asciz	"failed to get SCMI %s payload memory\n"

L_.str.4:                               ## @.str.4
	.asciz	"failed to ioremap SCMI %s payload\n"

	.comm	_EADDRNOTAVAIL,4,2              ## @EADDRNOTAVAIL
	.comm	_EPROBE_DEFER,4,2               ## @EPROBE_DEFER
L_.str.5:                               ## @.str.5
	.asciz	"failed to request SCMI %s mailbox\n"

L_.str.6:                               ## @.str.6
	.asciz	"unable to allocate SCMI idr slot err %d\n"

	.no_dead_strip	_scmi_mbox_chan_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scmi_mbox_chan_setup
_scmi_mbox_chan_setup:                  ; @scmi_mbox_chan_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x25, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x27, [x1]
	cmp	w3, #0
	cset	w24, eq
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
Lloh2:
	adrp	x9, l_.str.1@PAGE
Lloh3:
	add	x9, x9, l_.str.1@PAGEOFF
	csel	x28, x9, x8, eq
	add	x8, x0, #12
	add	x9, x0, #8
	csel	x22, x9, x8, eq
	mov	x0, x27
	mov	x1, x24
	bl	_scmi_mailbox_check
	cbz	x0, LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _SCMI_PROTOCOL_BASE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SCMI_PROTOCOL_BASE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_idr_find
	mov	x23, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_12
; %bb.2:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_3:
	ldr	w0, [x20, #4]
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	w1, #56
	bl	_devm_kzalloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x23, x0
	mov	x26, x0
	str	wzr, [x26, #16]!
	stp	x19, x19, [x26, #24]
Lloh12:
	adrp	x8, _scmi_rx_callback@GOTPAGE
Lloh13:
	ldr	x8, [x8, _scmi_rx_callback@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _scmi_tx_prepare@GOTPAGE
Lloh16:
	ldr	x9, [x9, _scmi_tx_prepare@GOTPAGEOFF]
	str	w8, [x26, #16]
Lloh17:
	ldr	x8, [x9]
	cmp	w25, #0
	csel	x8, xzr, x8, eq
	str	x8, [x26, #8]
	str	w25, [x26, #4]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x27
	mov	x2, x24
	bl	_of_parse_phandle
	mov	x27, x0
	add	x2, sp, #8
	mov	w1, #0
	bl	_of_address_to_resource
	mov	x25, x0
	mov	x0, x27
	bl	_of_node_put
	cbz	w25, LBB0_8
; %bb.5:
	str	x28, [sp]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_6:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_16
LBB0_8:
	add	x0, sp, #8
	bl	_resource_size
	mov	x2, x0
	ldr	w0, [x20, #4]
	ldr	w1, [sp, #8]
	bl	_devm_ioremap
	str	w0, [x23, #12]
	cbz	w0, LBB0_17
; %bb.9:
	mov	x0, x26
	mov	x1, x24
	bl	_mbox_request_channel
	str	w0, [x23, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.10:
	ldr	w0, [x23, #8]
	bl	_PTR_ERR
	mov	x25, x0
Lloh24:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_16
; %bb.11:
	str	x28, [sp]
Lloh27:
	adrp	x1, l_.str.5@PAGE
Lloh28:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_12:
	add	w3, w21, #1
Lloh29:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh31:
	ldr	w4, [x8]
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	bl	_idr_alloc
	cmp	w0, w21
	b.ne	LBB0_14
; %bb.13:
	mov	w25, #0
	str	x20, [x23]
	b	LBB0_16
LBB0_14:
	mov	x25, x0
	str	x25, [sp]
Lloh32:
	adrp	x1, l_.str.6@PAGE
Lloh33:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_15:
	mov	x0, x19
	bl	_dev_err
LBB0_16:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_17:
	str	x28, [sp]
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh36:
	adrp	x8, _EADDRNOTAVAIL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EADDRNOTAVAIL@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Tx"

l_.str.1:                               ; @.str.1
	.asciz	"Rx"

	.comm	_SCMI_PROTOCOL_BASE,4,2         ; @SCMI_PROTOCOL_BASE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_scmi_rx_callback,4,2           ; @scmi_rx_callback
	.comm	_scmi_tx_prepare,8,3            ; @scmi_tx_prepare
l_.str.2:                               ; @.str.2
	.asciz	"shmem"

l_.str.3:                               ; @.str.3
	.asciz	"failed to get SCMI %s payload memory\n"

l_.str.4:                               ; @.str.4
	.asciz	"failed to ioremap SCMI %s payload\n"

	.comm	_EADDRNOTAVAIL,4,2              ; @EADDRNOTAVAIL
	.comm	_EPROBE_DEFER,4,2               ; @EPROBE_DEFER
l_.str.5:                               ; @.str.5
	.asciz	"failed to request SCMI %s mailbox\n"

l_.str.6:                               ; @.str.6
	.asciz	"unable to allocate SCMI idr slot err %d\n"

	.no_dead_strip	_scmi_mbox_chan_setup
.subsections_via_symbols
