	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vivi_open
_vivi_open:                             ## @vivi_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, %rbx
	leaq	40(%rax), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	leal	1(%rax), %r9d
	movl	%r9d, (%rbx)
	testl	%eax, %eax
	jle	LBB0_2
## %bb.1:
	movl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_7
LBB0_2:
	movq	48(%rbx), %rax
	movl	(%rax), %ecx
	movq	_v4l2_type_names@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rax,%rdx,4), %r8d
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_dprintk
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_4:
	movq	%r14, (%r15)
	movq	%rbx, 32(%r14)
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	_formats@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%r14)
	movabsq	$2061584302720, %rax            ## imm = 0x1E000000280
	movq	%rax, 8(%r14)
	movq	$0, 32(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 4(%rbx)
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movl	24(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_sprintf
	movq	%r14, %rdi
	addq	$16, %rdi
	addq	$20, %rbx
	movq	(%r14), %r8
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_vivi_video_qops@GOTPCREL(%rip), %rsi
	xorl	%edx, %edx
	movq	%rbx, %rcx
	pushq	%r14
	pushq	$4
	callq	_videobuf_queue_vmalloc_init
	addq	$16, %rsp
	movq	%r14, %rdi
	callq	_vivi_start_thread
	jmp	LBB0_7
LBB0_5:
	decl	(%rbx)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.6:
	negl	%r13d
LBB0_7:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open /dev/video%d type=%s users=%d\n"

	.comm	_v4l2_type_names,8,3            ## @v4l2_type_names
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_formats,8,3                    ## @formats
	.comm	_jiffies,4,2                    ## @jiffies
L_.str.1:                               ## @.str.1
	.asciz	"%02d:%02d:%02d:%03d"

	.comm	_vivi_video_qops,4,2            ## @vivi_video_qops
	.comm	_V4L2_FIELD_INTERLACED,4,2      ## @V4L2_FIELD_INTERLACED
	.no_dead_strip	_vivi_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function vivi_open
lCPI0_0:
	.long	640                             ; 0x280
	.long	480                             ; 0x1e0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_vivi_open:                             ; @vivi_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
	add	x22, x0, #40
	mov	x0, x22
	bl	_mutex_lock
	ldr	w8, [x19]
	add	w5, w8, #1
	str	w5, [x19]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.1:
	str	w8, [x19]
	mov	x0, x22
	bl	_mutex_unlock
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_2:
	ldr	x8, [x19, #48]
	ldr	w3, [x8]
Lloh3:
	adrp	x8, _v4l2_type_names@GOTPAGE
Lloh4:
	ldr	x8, [x8, _v4l2_type_names@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x23, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh7:
	ldr	x23, [x23, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
	ldr	x9, [x23]
	ldr	w4, [x8, x9, lsl #2]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_dprintk
Lloh10:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	mov	x20, x0
	cbz	x0, LBB0_5
; %bb.3:
	mov	x0, x22
	bl	_mutex_unlock
LBB0_4:
	str	x20, [x21]
	ldr	x8, [x23]
	str	x8, [x20]
Lloh13:
	adrp	x8, _formats@GOTPAGE
Lloh14:
	ldr	x8, [x8, _formats@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	stp	x8, x19, [x20, #24]
Lloh16:
	adrp	x8, lCPI0_0@PAGE
Lloh17:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20, #8]
	str	xzr, [x19, #32]
	stur	xzr, [x19, #12]
	stur	xzr, [x19, #4]
Lloh18:
	adrp	x8, _jiffies@GOTPAGE
Lloh19:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x19, #28]
	ldr	w0, [x19, #24]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_sprintf
	add	x0, x20, #16
	add	x3, x19, #20
	ldr	x4, [x20]
Lloh23:
	adrp	x8, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh25:
	ldr	w5, [x8]
Lloh26:
	adrp	x1, _vivi_video_qops@GOTPAGE
Lloh27:
	ldr	x1, [x1, _vivi_video_qops@GOTPAGEOFF]
	mov	x2, #0
	mov	w6, #4
	mov	x7, x20
	bl	_videobuf_queue_vmalloc_init
	mov	x0, x20
	bl	_vivi_start_thread
	mov	w0, #0
	b	LBB0_7
LBB0_5:
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w24, [x8]
	mov	x0, x22
	bl	_mutex_unlock
	cbz	w24, LBB0_4
; %bb.6:
	neg	w0, w24
LBB0_7:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdrp	Lloh16, Lloh18
	.loh AdrpLdr	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open /dev/video%d type=%s users=%d\n"

	.comm	_v4l2_type_names,8,3            ; @v4l2_type_names
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_formats,8,3                    ; @formats
	.comm	_jiffies,4,2                    ; @jiffies
l_.str.1:                               ; @.str.1
	.asciz	"%02d:%02d:%02d:%03d"

	.comm	_vivi_video_qops,4,2            ; @vivi_video_qops
	.comm	_V4L2_FIELD_INTERLACED,4,2      ; @V4L2_FIELD_INTERLACED
	.no_dead_strip	_vivi_open
.subsections_via_symbols
