	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gsc_m2m_open
_gsc_m2m_open:                          ## @gsc_m2m_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_video_drvdata
	movq	%rax, %r14
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_task_pid_nr
	movslq	%eax, %rsi
	movl	4(%r14), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$80, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movl	16(%r14), %esi
	movq	%rax, %rdi
	callq	_v4l2_fh_init
	movq	%r15, %rdi
	callq	_gsc_ctrls_create
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	%r15, %rax
	addq	$72, %rax
	movq	%rax, (%r15)
	movq	%r15, (%r12)
	movq	%r15, %rdi
	callq	_v4l2_fh_add
	movq	%r14, 64(%r15)
	xorl	%edi, %edi
	callq	_get_format
	movq	%rax, 56(%r15)
	xorl	%edi, %edi
	callq	_get_format
	movq	%rax, 48(%r15)
	movq	_GSC_CTX_M2M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r15)
	movq	$0, 32(%r15)
	movq	_GSC_DMA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%r15)
	movq	%rax, 16(%r15)
	movl	12(%r14), %edi
	movq	_queue_init@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rsi
	callq	_v4l2_m2m_ctx_init
	movl	%eax, 8(%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	movl	8(%r15), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_gsc_ctrls_delete
	movq	%r15, %rdi
	callq	_v4l2_fh_del
LBB0_7:
	movq	%r15, %rdi
	callq	_v4l2_fh_exit
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_11
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	8(%r14), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%r14)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	%r14, %rsi
	addq	$4, %rsi
	movq	_ST_M2M_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_bit
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pid: %d, state: 0x%lx"

	.comm	_current,4,2                    ## @current
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GSC_CTX_M2M,4,2                ## @GSC_CTX_M2M
	.comm	_GSC_DMA,8,3                    ## @GSC_DMA
	.comm	_queue_init,4,2                 ## @queue_init
L_.str.1:                               ## @.str.1
	.asciz	"Failed to initialize m2m context"

	.comm	_ST_M2M_OPEN,4,2                ## @ST_M2M_OPEN
L_.str.2:                               ## @.str.2
	.asciz	"gsc m2m driver is opened, ctx(0x%p)"

	.no_dead_strip	_gsc_m2m_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gsc_m2m_open
_gsc_m2m_open:                          ; @gsc_m2m_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x22, x0
	bl	_video_drvdata
	mov	x19, x0
Lloh0:
	adrp	x8, _current@GOTPAGE
Lloh1:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_task_pid_nr
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x1, w0
	mov	x21, x19
	ldr	w8, [x21, #4]!
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_9
LBB0_2:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #80
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x20, x0
	ldr	w1, [x19, #16]
	bl	_v4l2_fh_init
	mov	x0, x20
	bl	_gsc_ctrls_create
	mov	x23, x0
	cbnz	w0, LBB0_6
; %bb.4:
	add	x8, x20, #72
	str	x8, [x20]
	str	x20, [x22]
	mov	x0, x20
	bl	_v4l2_fh_add
	str	x19, [x20, #64]
	mov	w0, #0
	bl	_get_format
	str	x0, [x20, #56]
	mov	w0, #0
	bl	_get_format
	str	x0, [x20, #48]
Lloh11:
	adrp	x8, _GSC_CTX_M2M@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GSC_CTX_M2M@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x20, #40]
	str	xzr, [x20, #32]
Lloh14:
	adrp	x8, _GSC_DMA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GSC_DMA@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	stp	x8, x8, [x20, #16]
	ldr	w0, [x19, #12]
Lloh17:
	adrp	x8, _queue_init@GOTPAGE
Lloh18:
	ldr	x8, [x8, _queue_init@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_v4l2_m2m_ctx_init
	str	w0, [x20, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.5:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	ldr	w0, [x20, #8]
	bl	_PTR_ERR
	mov	x23, x0
	mov	x0, x20
	bl	_gsc_ctrls_delete
	mov	x0, x20
	bl	_v4l2_fh_del
LBB0_6:
	mov	x0, x20
	bl	_v4l2_fh_exit
	mov	x0, x20
	bl	_kfree
	b	LBB0_8
LBB0_7:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x23
	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
	add	sp, sp, #80
	ret
LBB0_10:
	ldr	w8, [x19, #8]
	add	w9, w8, #1
	str	w9, [x19, #8]
	cbnz	w8, LBB0_12
; %bb.11:
Lloh25:
	adrp	x8, _ST_M2M_OPEN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ST_M2M_OPEN@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_set_bit
LBB0_12:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_pr_debug
	mov	x0, x19
	bl	_mutex_unlock
	mov	w23, #0
	b	LBB0_9
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pid: %d, state: 0x%lx"

	.comm	_current,4,2                    ; @current
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GSC_CTX_M2M,4,2                ; @GSC_CTX_M2M
	.comm	_GSC_DMA,8,3                    ; @GSC_DMA
	.comm	_queue_init,4,2                 ; @queue_init
l_.str.1:                               ; @.str.1
	.asciz	"Failed to initialize m2m context"

	.comm	_ST_M2M_OPEN,4,2                ; @ST_M2M_OPEN
l_.str.2:                               ; @.str.2
	.asciz	"gsc m2m driver is opened, ctx(0x%p)"

	.no_dead_strip	_gsc_m2m_open
.subsections_via_symbols
