	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fastrpc_map_create
_fastrpc_map_create:                    ## @fastrpc_map_create
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rdx
	callq	_fastrpc_map_find
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_11
## %bb.1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r12
	leaq	32(%rax), %rbx
	movq	%rbx, %rdi
	callq	_INIT_LIST_HEAD
	movq	%r15, 56(%r12)
	movl	%r13d, (%r12)
	movl	%r13d, %edi
	callq	_dma_buf_get
	movq	%rax, 16(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	16(%r12), %rdi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	callq	_PTR_ERR
	movl	%eax, %r14d
	jmp	LBB0_10
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_11
LBB0_5:
	movq	%rbx, %r13
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%rbx), %esi
	callq	_dma_buf_attach
	movq	%rax, 24(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	24(%r12), %rdi
	callq	_PTR_ERR
	movl	%eax, %r14d
	jmp	LBB0_9
LBB0_7:
	movq	24(%r12), %rdi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dma_buf_map_attachment
	movq	%rax, 40(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	40(%r12), %rdi
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	callq	_PTR_ERR
	movl	%eax, %r14d
	movq	16(%r12), %rdi
	movq	24(%r12), %rsi
	callq	_dma_buf_detach
LBB0_9:
	movq	16(%r12), %rdi
	callq	_dma_buf_put
LBB0_10:
	movq	%r12, %rdi
	callq	_kfree
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	(%rdi), %edi
	callq	_sg_dma_address
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, 8(%r12)
	movq	40(%r12), %rax
	movl	(%rax), %edi
	callq	_sg_virt
	movl	%eax, 48(%r12)
	movl	%ebx, 12(%r12)
	movq	%r12, %rdi
	addq	$36, %rdi
	callq	_kref_init
	movq	%r15, %rdi
	callq	_spin_lock
	leaq	4(%r15), %rsi
	movq	%r13, %rdi
	callq	_list_add_tail
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r12, (%rax)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to attach dmabuf\n"

	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.no_dead_strip	_fastrpc_map_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fastrpc_map_create
_fastrpc_map_create:                    ; @fastrpc_map_create
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x22, x2
	mov	x24, x1
	mov	x21, x0
	ldr	x25, [x0, #8]
	mov	x2, x3
	bl	_fastrpc_map_find
	cbz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x19, x0
	add	x23, x0, #32
	mov	x0, x23
	bl	_INIT_LIST_HEAD
	str	x21, [x19, #56]
	str	w24, [x19]
	mov	x0, x24
	bl	_dma_buf_get
	str	x0, [x19, #16]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x19, #16]
	cbz	x8, LBB0_6
; %bb.3:
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_11
LBB0_4:
	mov	w21, #0
	b	LBB0_12
LBB0_5:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
LBB0_6:
	ldr	w1, [x25, #8]
	bl	_dma_buf_attach
	str	x0, [x19, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w0, [x25, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19, #24]
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_10
LBB0_8:
	ldr	x0, [x19, #24]
Lloh8:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_dma_buf_map_attachment
	str	x0, [x19, #40]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x19, #40]
	cbz	x8, LBB0_13
; %bb.9:
	bl	_PTR_ERR
	mov	x21, x0
	ldp	x0, x1, [x19, #16]
	bl	_dma_buf_detach
LBB0_10:
	ldr	x0, [x19, #16]
	bl	_dma_buf_put
LBB0_11:
	mov	x0, x19
	bl	_kfree
LBB0_12:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	w0, [x0]
	bl	_sg_dma_address
	str	w22, [x19, #8]
	ldr	x8, [x19, #40]
	ldr	w0, [x8]
	bl	_sg_virt
	str	w0, [x19, #48]
	str	w22, [x19, #12]
	add	x0, x19, #36
	bl	_kref_init
	mov	x0, x21
	bl	_spin_lock
	add	x1, x21, #4
	mov	x0, x23
	bl	_list_add_tail
	mov	x0, x21
	bl	_spin_unlock
	mov	w21, #0
	str	x19, [x20]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to attach dmabuf\n"

	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.no_dead_strip	_fastrpc_map_create
.subsections_via_symbols
