	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_scm_call
_qcom_scm_call:                         ## @qcom_scm_call
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movq	%r8, %r14
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	16(%rbp), %rax
	leaq	(%r8,%rax), %r12
	addq	$40, %r12
	movq	%r12, %rdi
	callq	_PAGE_ALIGN
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movl	%r12d, %edi
	callq	_cpu_to_le32
	movq	%rax, 24(%r13)
	movl	$32, %edi
	callq	_cpu_to_le32
	movq	%rax, 16(%r13)
	leal	32(%r14), %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r13)
	shll	$10, %ebx
	orl	%r15d, %ebx
	movl	%ebx, %edi
	callq	_cpu_to_le32
	movq	%rax, (%r13)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	movq	%r14, %r15
	je	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	callq	_qcom_scm_get_command_buffer
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_memcpy
LBB0_4:
	movq	%r13, %rdi
	callq	_qcom_scm_command_to_response
	movq	%rax, %rbx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_dma_map_single
	movq	%r14, %rdi
	movq	%rax, %r14
	movq	%rax, %rsi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	callq	_kfree
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_6:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	_qcom_scm_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_smc
	movl	%eax, %r15d
	testl	%eax, %eax
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	jns	LBB0_8
## %bb.7:
	movl	%r15d, %edi
	callq	_qcom_scm_remap_error
	movl	%eax, %r15d
LBB0_8:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %r12
	movq	_qcom_scm_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%r15d, %r15d
	jne	LBB0_13
## %bb.9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax), %r13
	addq	$32, %r13
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %r14
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %ecx
	movl	$8, %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_dma_sync_single_for_cpu
	cmpl	$0, 4(%rbx)
	je	LBB0_10
## %bb.11:
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %r12
	je	LBB0_13
## %bb.12:
	movl	(%rbx), %edi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	callq	_le32_to_cpu
	addq	%rax, %r13
	movl	(%r14), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	16(%rbp), %rbx
	movq	%rbx, %rdx
	callq	_dma_sync_single_for_cpu
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_qcom_scm_get_response_buffer
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
LBB0_13:
	movl	(%r12), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	_dma_unmap_single
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_14:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_qcom_scm_lock,4,2              ## @qcom_scm_lock
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_qcom_scm_call
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcom_scm_call
_qcom_scm_call:                         ; @qcom_scm_call
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x6
	mov	x22, x5
	mov	x24, x4
	mov	x25, x3
	mov	x26, x2
	mov	x27, x1
	mov	x20, x0
	add	x8, x4, x6
	add	x19, x8, #40
	mov	x0, x19
	bl	_PAGE_ALIGN
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x23, x0
	mov	x0, x19
	bl	_cpu_to_le32
	str	x0, [x23, #24]
	mov	w0, #32
	bl	_cpu_to_le32
	str	x0, [x23, #16]
	add	w0, w24, #32
	bl	_cpu_to_le32
	str	x0, [x23, #8]
	orr	w0, w26, w27, lsl #10
	bl	_cpu_to_le32
	str	x0, [x23]
	cbz	x25, LBB0_3
; %bb.2:
	mov	x0, x23
	bl	_qcom_scm_get_command_buffer
	mov	x1, x25
	mov	x2, x24
	bl	_memcpy
LBB0_3:
	mov	x0, x23
	bl	_qcom_scm_command_to_response
	mov	x27, x0
Lloh3:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x19
	bl	_dma_map_single
	mov	x25, x0
	mov	x0, x20
	mov	x1, x25
	bl	_dma_mapping_error
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x23
	bl	_kfree
LBB0_5:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_14
LBB0_6:
Lloh9:
	adrp	x0, _qcom_scm_lock@GOTPAGE
Lloh10:
	ldr	x0, [x0, _qcom_scm_lock@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x25
	bl	_smc
	mov	x26, x0
	tbz	w0, #31, LBB0_8
; %bb.7:
	mov	x0, x26
	bl	_qcom_scm_remap_error
	mov	x26, x0
LBB0_8:
Lloh11:
	adrp	x0, _qcom_scm_lock@GOTPAGE
Lloh12:
	ldr	x0, [x0, _qcom_scm_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	cbnz	w26, LBB0_13
; %bb.9:
	add	x8, x24, x25
	add	x24, x8, #32
Lloh13:
	adrp	x28, _DMA_FROM_DEVICE@GOTPAGE
Lloh14:
	ldr	x28, [x28, _DMA_FROM_DEVICE@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w3, [x28]
	mov	x0, x20
	mov	x1, x24
	mov	w2, #8
	bl	_dma_sync_single_for_cpu
	ldr	w8, [x27, #4]
	cbz	w8, LBB0_10
; %bb.11:
	cbz	x22, LBB0_13
; %bb.12:
	ldr	w0, [x27]
	bl	_le32_to_cpu
	add	x1, x0, x24
	ldr	w3, [x28]
	mov	x0, x20
	mov	x2, x21
	bl	_dma_sync_single_for_cpu
	mov	x0, x27
	bl	_qcom_scm_get_response_buffer
	mov	x1, x0
	mov	x0, x22
	mov	x2, x21
	bl	_memcpy
LBB0_13:
Lloh15:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x25
	mov	x2, x19
	bl	_dma_unmap_single
	mov	x0, x23
	bl	_kfree
LBB0_14:
	mov	x0, x26
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_qcom_scm_lock,4,2              ; @qcom_scm_lock
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_qcom_scm_call
.subsections_via_symbols
