	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g2d_open
_g2d_open:                              ## @g2d_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_video_drvdata
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%r14, 40(%rax)
	movq	_def_frame@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%rbx)
	movq	%rax, 24(%rbx)
	movq	%r14, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_kfree
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	8(%r14), %edi
	movq	_queue_init@GOTPCREL(%rip), %rdx
	movq	%rbx, %rsi
	callq	_v4l2_m2m_ctx_init
	movl	%eax, 16(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	16(%rbx), %edi
	callq	_PTR_ERR
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r14d, %eax
	jmp	LBB0_8
LBB0_7:
	movq	%rbx, %r13
	addq	$8, %r13
	movq	%r15, %rdi
	callq	_video_devdata
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_v4l2_fh_init
	movq	%r13, (%r15)
	movq	%r13, %rdi
	callq	_v4l2_fh_add
	movq	%rbx, %rdi
	callq	_g2d_setup_ctrls
	movq	%rbx, %rdi
	callq	_v4l2_ctrl_handler_setup
	movq	%rbx, 8(%rbx)
	movq	%r12, %rdi
	callq	_mutex_unlock
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_v4l2_info
	xorl	%eax, %eax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_def_frame,8,3                  ## @def_frame
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_queue_init,4,2                 ## @queue_init
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"instance opened\n"

	.no_dead_strip	_g2d_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g2d_open
_g2d_open:                              ; @g2d_open
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x0
	bl	_video_drvdata
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x19, [x0, #40]
Lloh3:
	adrp	x8, _def_frame@GOTPAGE
Lloh4:
	ldr	x8, [x8, _def_frame@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	stp	x8, x8, [x0, #24]
	add	x22, x19, #4
	mov	x0, x22
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_kfree
Lloh6:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w0, [x19, #8]
Lloh10:
	adrp	x2, _queue_init@GOTPAGE
Lloh11:
	ldr	x2, [x2, _queue_init@GOTPAGEOFF]
	mov	x1, x20
	bl	_v4l2_m2m_ctx_init
	str	w0, [x20, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w0, [x20, #16]
	bl	_PTR_ERR
	mov	x19, x0
	mov	x0, x22
	bl	_mutex_unlock
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	b	LBB0_5
LBB0_8:
	add	x23, x20, #8
	mov	x0, x21
	bl	_video_devdata
	mov	x1, x0
	mov	x0, x23
	bl	_v4l2_fh_init
	str	x23, [x21]
	mov	x0, x23
	bl	_v4l2_fh_add
	mov	x0, x20
	bl	_g2d_setup_ctrls
	mov	x0, x20
	bl	_v4l2_ctrl_handler_setup
	str	x20, [x20, #8]
	mov	x0, x22
	bl	_mutex_unlock
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_v4l2_info
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_def_frame,8,3                  ; @def_frame
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_queue_init,4,2                 ; @queue_init
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"instance opened\n"

	.no_dead_strip	_g2d_open
.subsections_via_symbols
