	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpif_open
_vpif_open:                             ## @vpif_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
	movq	_vpif_dev@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	callq	_video_devdata
	movq	%rax, %rbx
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	$2, %edi
	callq	_vpif_dbg
	movq	%rbx, %rdi
	callq	_video_get_drvdata
	movq	%rax, %r14
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rbx
	movq	(%rbx), %r13
	shlq	$2, %r13
	addq	24(%rax), %r13
	movq	%r13, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_2:
	cmpq	$0, 16(%r14)
	je	LBB0_3
LBB0_11:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rax, %r12
	movq	%rax, (%r15)
	movq	%r14, 16(%rax)
	movl	$0, (%rax)
	cmpl	$0, (%r14)
	jne	LBB0_15
## %bb.14:
	movl	$1, (%r12)
	movl	$1, (%r14)
	leaq	12(%r14), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
LBB0_15:
	incl	8(%r14)
	movq	8(%r12), %rax
	movq	(%rbx), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	_V4L2_PRIORITY_UNSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, %rsi
	addq	$4, %rsi
	movl	%eax, 4(%r12)
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_v4l2_prio_open
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_3:
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.5:
	movq	_vpif_obj@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	leaq	(,%rax,4), %rsi
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rdx,%rdi,2)
	jne	LBB0_7
## %bb.18:                              ##   in Loop: Header=BB0_6 Depth=1
	addq	$4, %rdi
	incl	%ecx
	cmpq	%rdi, %rsi
	jne	LBB0_6
	jmp	LBB0_9
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
	callq	_vpif_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_4:
	xorl	%ecx, %ecx
	cmpl	%eax, %ecx
	jne	LBB0_11
	jmp	LBB0_9
LBB0_7:
	addq	8(%r12), %rdi
	movq	%rdi, 16(%r14)
	movq	$0, 32(%r14)
	cmpl	%eax, %ecx
	jne	LBB0_11
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	callq	_vpif_err
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vpif_dev,8,3                   ## @vpif_dev
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vpif_open\n"

	.comm	_VPIF_VIDEO_INDEX,8,3           ## @VPIF_VIDEO_INDEX
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_vpif_obj,8,3                   ## @vpif_obj
L_.str.1:                               ## @.str.1
	.asciz	"No sub device registered\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"unable to allocate memory for file handle object\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_V4L2_PRIORITY_UNSET,4,2        ## @V4L2_PRIORITY_UNSET
	.no_dead_strip	_vpif_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpif_open
_vpif_open:                             ; @vpif_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
Lloh0:
	adrp	x8, _vpif_dev@GOTPAGE
Lloh1:
	ldr	x8, [x8, _vpif_dev@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x22, [x8]
	bl	_video_devdata
	mov	x19, x0
Lloh3:
	adrp	x8, _debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	bl	_vpif_dbg
	mov	x0, x19
	bl	_video_get_drvdata
	mov	x20, x0
	ldr	x8, [x0, #24]
Lloh8:
	adrp	x23, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh9:
	ldr	x23, [x23, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x19, x8, x9, lsl #2
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_2
; %bb.1:
Lloh10:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_17
LBB0_2:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_7
LBB0_3:
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_11
; %bb.4:
	mov	x22, x0
	str	x0, [x21]
	str	x20, [x0, #16]
	str	wzr, [x0]
	ldr	w8, [x20]
	cbnz	w8, LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x22]
	mov	x0, x20
	str	w8, [x0], #12
	mov	w1, #0
	mov	w2, #4
	bl	_memset
LBB0_6:
	ldr	w8, [x20, #8]
	add	w8, w8, #1
Lloh16:
	adrp	x9, _V4L2_PRIORITY_UNSET@GOTPAGE
Lloh17:
	ldr	x9, [x9, _V4L2_PRIORITY_UNSET@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	str	w9, [x22, #4]!
	str	w8, [x20, #8]
	ldur	x8, [x22, #4]
	ldr	x9, [x23]
	str	xzr, [x8, x9, lsl #3]
	add	x0, x20, #4
	mov	x1, x22
	bl	_v4l2_prio_open
	mov	w20, #0
	b	LBB0_16
LBB0_7:
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.8:
	mov	w9, #0
	mov	x10, #0
Lloh19:
	adrp	x11, _vpif_obj@GOTPAGE
Lloh20:
	ldr	x11, [x11, _vpif_obj@GOTPAGEOFF]
Lloh21:
	ldr	x11, [x11]
	lsl	x12, x8, #2
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x11]
	cbnz	x13, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x10, x10, #4
	add	w9, w9, #1
	add	x11, x11, #8
	cmp	x12, x10
	b.ne	LBB0_9
	b	LBB0_14
LBB0_11:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_vpif_err
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_15
LBB0_12:
	mov	w9, #0
	cmp	w9, w8
	b.ne	LBB0_3
	b	LBB0_14
LBB0_13:
	ldr	x11, [x22, #8]
	add	x10, x11, x10
	str	x10, [x20, #16]
	str	xzr, [x20, #32]
	cmp	w9, w8
	b.ne	LBB0_3
LBB0_14:
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vpif_err
Lloh28:
	adrp	x8, _ENOENT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_16:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_17:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_vpif_dev,8,3                   ; @vpif_dev
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vpif_open\n"

	.comm	_VPIF_VIDEO_INDEX,8,3           ; @VPIF_VIDEO_INDEX
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_vpif_obj,8,3                   ; @vpif_obj
l_.str.1:                               ; @.str.1
	.asciz	"No sub device registered\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"unable to allocate memory for file handle object\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_V4L2_PRIORITY_UNSET,4,2        ; @V4L2_PRIORITY_UNSET
	.no_dead_strip	_vpif_open
.subsections_via_symbols
