	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fastrpc_device_open
_fastrpc_device_open:                   ## @fastrpc_device_open
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rsi), %rdi
	callq	_miscdev_to_cctx
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_fastrpc_channel_ctx_get
	movq	%rbx, (%r15)
	leaq	36(%rbx), %rdi
	callq	_spin_lock_init
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_init
	leaq	32(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	addq	$28, %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	callq	_INIT_LIST_HEAD
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	%r14, 16(%rbx)
	movq	%r14, %rdi
	callq	_fastrpc_session_alloc
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rsi
	addq	$4, %rsi
	movq	%rbx, %rdi
	callq	_list_add_tail
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_mutex_destroy
	movq	%rbx, %rdi
	callq	_kfree
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_current,8,3                    ## @current
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No session available\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_fastrpc_device_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fastrpc_device_open
_fastrpc_device_open:                   ; @fastrpc_device_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	ldr	x0, [x1]
	bl	_miscdev_to_cctx
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	bl	_fastrpc_channel_ctx_get
	str	x20, [x21]
	add	x0, x20, #36
	bl	_spin_lock_init
	add	x21, x20, #4
	mov	x0, x21
	bl	_mutex_init
	add	x0, x20, #32
	bl	_INIT_LIST_HEAD
	add	x0, x20, #28
	bl	_INIT_LIST_HEAD
	mov	x0, x20
	bl	_INIT_LIST_HEAD
Lloh3:
	adrp	x8, _current@GOTPAGE
Lloh4:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w8, [x8]
	str	w8, [x20, #24]
	str	x19, [x20, #16]
	mov	x0, x19
	bl	_fastrpc_session_alloc
	str	w0, [x20, #8]
	cbz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_spin_lock_irqsave
	add	x1, x19, #4
	mov	x0, x20
	bl	_list_add_tail
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_6
LBB0_3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	ldr	x0, [x19, #8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x21
	bl	_mutex_destroy
	mov	x0, x20
	bl	_kfree
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_current,8,3                    ; @current
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No session available\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_fastrpc_device_open
.subsections_via_symbols
