	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fastrpc_context_alloc
_fastrpc_context_alloc:                 ## @fastrpc_context_alloc
	.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, %r12
	movl	%edx, %r13d
	movq	%rdi, %r15
	movq	16(%rdi), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$96, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	leaq	24(%rax), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_INIT_LIST_HEAD
	movq	%r15, 88(%rbx)
	movl	%r13d, %edi
	callq	_REMOTE_SCALARS_LENGTH
	movq	%rax, 72(%rbx)
	movl	%r13d, %edi
	callq	_REMOTE_SCALARS_INBUFS
	movq	%rax, %r12
	movl	%r13d, %edi
	callq	_REMOTE_SCALARS_OUTBUFS
	addq	%r12, %rax
	movq	%rax, 80(%rbx)
	movq	72(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	$96, %esi
	callq	_kcalloc
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	72(%rbx), %rdi
	movl	(%r12), %edx
	movl	$96, %esi
	callq	_kcalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 64(%rbx)
	movq	%rbx, %rdi
	callq	_fastrpc_get_buff_overlaps
LBB0_9:
	movq	%r14, %rdi
	callq	_fastrpc_channel_ctx_get
	movl	%r13d, 56(%rbx)
	movl	$-1, (%rbx)
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movl	8(%r15), %eax
	movl	%eax, 48(%rbx)
	movq	%r14, 40(%rbx)
	leaq	36(%rbx), %rdi
	callq	_init_completion
	leaq	32(%rbx), %rdi
	movq	_fastrpc_context_put_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	%r15, %rdi
	callq	_spin_lock
	leaq	4(%r15), %rsi
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_list_add_tail
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	leaq	4(%r14), %rdi
	movq	_FASTRPC_CTX_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_idr_alloc_cyclic
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	shll	$4, %r12d
	movl	%r12d, 4(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	addq	$28, %rdi
	callq	_kref_init
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r15, %rdi
	callq	_spin_lock
	movq	%r13, %rdi
	callq	_list_del
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	%r14, %rdi
	callq	_fastrpc_channel_ctx_put
	movq	16(%rbx), %rdi
	callq	_kfree
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r12d, %edi
	jmp	LBB0_2
LBB0_7:
	movq	16(%rbx), %rdi
	callq	_kfree
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_current,8,3                    ## @current
	.comm	_fastrpc_context_put_wq,4,2     ## @fastrpc_context_put_wq
	.comm	_FASTRPC_CTX_MAX,4,2            ## @FASTRPC_CTX_MAX
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.no_dead_strip	_fastrpc_context_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fastrpc_context_alloc
_fastrpc_context_alloc:                 ; @fastrpc_context_alloc
	.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	x24, x3
	mov	x23, x2
	mov	x21, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	w0, #96
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	add	x22, x0, #24
	mov	x0, x22
	bl	_INIT_LIST_HEAD
	str	x21, [x19, #88]
	mov	x0, x23
	bl	_REMOTE_SCALARS_LENGTH
	str	x0, [x19, #72]
	mov	x0, x23
	bl	_REMOTE_SCALARS_INBUFS
	mov	x25, x0
	mov	x0, x23
	bl	_REMOTE_SCALARS_OUTBUFS
	add	x8, x0, x25
	str	x8, [x19, #80]
	ldr	x0, [x19, #72]
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w2, [x26]
	mov	w1, #96
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_9
; %bb.3:
	ldr	x0, [x19, #72]
	ldr	w2, [x26]
	mov	w1, #96
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_8
; %bb.4:
	str	x24, [x19, #64]
	mov	x0, x19
	bl	_fastrpc_get_buff_overlaps
LBB0_5:
	mov	x0, x20
	bl	_fastrpc_channel_ctx_get
	str	w23, [x19, #56]
	mov	w8, #-1
	str	w8, [x19]
Lloh2:
	adrp	x8, _current@GOTPAGE
Lloh3:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	w8, [x8]
	ldr	w9, [x21, #8]
	stp	w9, w8, [x19, #48]
	str	x20, [x19, #40]
	add	x0, x19, #36
	bl	_init_completion
	add	x0, x19, #32
Lloh5:
	adrp	x8, _fastrpc_context_put_wq@GOTPAGE
Lloh6:
	ldr	x8, [x8, _fastrpc_context_put_wq@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_INIT_WORK
	mov	x0, x21
	bl	_spin_lock
	add	x1, x21, #4
	mov	x0, x22
	bl	_list_add_tail
	mov	x0, x21
	bl	_spin_unlock
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x0, x20, #4
Lloh8:
	adrp	x8, _FASTRPC_CTX_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FASTRPC_CTX_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
Lloh11:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh13:
	ldr	w4, [x8]
	mov	x1, x19
	mov	w2, #1
	bl	_idr_alloc_cyclic
	mov	x23, x0
	tbnz	w0, #31, LBB0_7
; %bb.6:
	lsl	w8, w23, #4
	str	w8, [x19, #4]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	add	x0, x19, #28
	bl	_kref_init
	mov	x0, x19
	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_7:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x21
	bl	_spin_lock
	mov	x0, x22
	bl	_list_del
	mov	x0, x21
	bl	_spin_unlock
	mov	x0, x20
	bl	_fastrpc_channel_ctx_put
	ldr	x0, [x19, #16]
	bl	_kfree
	ldr	x0, [x19, #8]
	bl	_kfree
	mov	x0, x19
	bl	_kfree
	mov	x0, x23
	b	LBB0_11
LBB0_8:
	ldr	x0, [x19, #16]
	bl	_kfree
LBB0_9:
	mov	x0, x19
	bl	_kfree
LBB0_10:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	b	_ERR_PTR
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_current,8,3                    ; @current
	.comm	_fastrpc_context_put_wq,4,2     ; @fastrpc_context_put_wq
	.comm	_FASTRPC_CTX_MAX,4,2            ; @FASTRPC_CTX_MAX
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.no_dead_strip	_fastrpc_context_alloc
.subsections_via_symbols
