	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia2_open
_cpia2_open:                            ## @cpia2_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, %r15
	callq	_video_drvdata
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_ERR
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_5:
	cmpl	$0, 32(%rbx)
	je	LBB0_6
## %bb.8:
	cmpq	$0, (%rbx)
	jle	LBB0_9
LBB0_14:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.15:
	movq	%rax, %r12
	movq	%rax, (%r15)
	movq	_V4L2_PRIORITY_UNSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, %rsi
	addq	$8, %rsi
	movl	%eax, 8(%r12)
	movq	%rbx, %rdi
	addq	$12, %rdi
	callq	_v4l2_prio_open
	movq	$0, (%r12)
	incq	(%rbx)
	movq	%rbx, %rdi
	callq	_cpia2_dbg_dump_registers
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movq	%rbx, %rdi
	callq	_cpia2_allocate_buffers
	testq	%rax, %rax
	je	LBB0_11
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_17:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%rbx, %rdi
	callq	_cpia2_reset_camera
	testq	%rax, %rax
	js	LBB0_12
## %bb.13:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rbx)
	jmp	LBB0_14
LBB0_12:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Internal error, camera_data not found!\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_V4L2_PRIORITY_UNSET,4,2        ## @V4L2_PRIORITY_UNSET
	.no_dead_strip	_cpia2_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia2_open
_cpia2_open:                            ; @cpia2_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, x0
	bl	_video_drvdata
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
Lloh4:
	adrp	x8, _ENODEV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_5:
	ldr	w8, [x20, #32]
	cbz	w8, LBB0_9
; %bb.6:
	ldr	x8, [x20]
	cmp	x8, #0
	b.le	LBB0_10
LBB0_7:
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_11
; %bb.8:
	mov	x22, x0
Lloh9:
	adrp	x8, _V4L2_PRIORITY_UNSET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V4L2_PRIORITY_UNSET@GOTPAGEOFF]
	str	x0, [x21]
Lloh11:
	ldr	w8, [x8]
	mov	x1, x0
	str	w8, [x1, #8]!
	add	x0, x20, #12
	bl	_v4l2_prio_open
	str	xzr, [x22]
	ldr	x8, [x20]
	add	x8, x8, #1
	str	x8, [x20]
	mov	x0, x20
	bl	_cpia2_dbg_dump_registers
	mov	w20, #0
	b	LBB0_13
LBB0_9:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	mov	x0, x20
	bl	_cpia2_allocate_buffers
	cbz	x0, LBB0_15
LBB0_11:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_14:
	mov	x0, x20
	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
LBB0_15:
	mov	x0, x20
	bl	_cpia2_reset_camera
	tbnz	x0, #63, LBB0_17
; %bb.16:
	stp	xzr, xzr, [x20, #16]
	b	LBB0_7
LBB0_17:
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Internal error, camera_data not found!\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_V4L2_PRIORITY_UNSET,4,2        ; @V4L2_PRIORITY_UNSET
	.no_dead_strip	_cpia2_open
.subsections_via_symbols
