	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zc0301_open
_zc0301_open:                           ## @zc0301_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, %r12
	movq	_zc0301_dev_lock@GOTPCREL(%rip), %rdi
	callq	_down_read_trylock
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	%r12, %rdi
	callq	_video_drvdata
	movq	%rax, %r13
	leaq	60(%rax), %rdi
	callq	_wait_for_completion_interruptible
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:
	leaq	4(%r13), %r15
	movq	%r15, %rdi
	callq	_kref_get
	leaq	8(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_zc0301_release_resources@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_kref_put
LBB0_4:
	movq	_zc0301_dev_lock@GOTPCREL(%rip), %rdi
	callq	_up_read
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_29:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%r13), %eax
	movq	_DEV_DISCONNECTED@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DBG
LBB0_9:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_27
## %bb.11:
	negl	%ebx
	jmp	LBB0_23
LBB0_12:
	cmpq	$0, 48(%r13)
	je	LBB0_19
## %bb.13:
	movq	16(%r13), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_DBG
	leaq	L_.str.2(%rip), %rsi
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_DBG
	movl	(%r12), %ecx
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rdx
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rax
	testl	%ecx, (%rdx)
	jne	LBB0_10
## %bb.14:
	movq	_O_NDELAY@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_10
## %bb.15:
	leaq	L_.str.3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_DBG
	movq	_zc0301_dev_lock@GOTPCREL(%rip), %rdi
	callq	_up_read
	movl	56(%r13), %edi
	movl	(%rbx), %eax
	movl	$1, %esi
	testl	%eax, (%r13)
	jne	LBB0_17
## %bb.16:
	xorl	%esi, %esi
	cmpq	$0, 48(%r13)
	sete	%sil
LBB0_17:
	callq	_wait_event_interruptible_exclusive
	movl	%eax, %ebx
	movq	_zc0301_dev_lock@GOTPCREL(%rip), %rdi
	callq	_down_read
	testl	%ebx, %ebx
	jne	LBB0_22
## %bb.18:
	movl	(%r13), %eax
	movq	_DEV_DISCONNECTED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_9
LBB0_19:
	movq	_DEV_MISCONFIGURED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_25
## %bb.20:
	movq	%r13, %rdi
	callq	_zc0301_init
	testl	%eax, %eax
	je	LBB0_24
## %bb.21:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DBG
	jmp	LBB0_22
LBB0_27:
	xorl	%ebx, %ebx
	jmp	LBB0_28
LBB0_24:
	movq	_DEV_MISCONFIGURED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r13)
LBB0_25:
	movq	%r13, %rdi
	callq	_zc0301_start_transfer
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_26
LBB0_22:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_23:
	movq	_zc0301_release_resources@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_kref_put
LBB0_28:
	movq	_zc0301_dev_lock@GOTPCREL(%rip), %rdi
	callq	_up_read
	jmp	LBB0_29
LBB0_26:
	movq	%r13, 8(%r12)
	incq	48(%r13)
	movq	_IO_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r13)
	movq	_STREAM_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r13)
	movq	%r13, %rdi
	callq	_zc0301_empty_framequeues
	movq	16(%r13), %rax
	movl	(%rax), %edx
	leaq	L_.str.5(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_DBG
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_zc0301_dev_lock,4,2            ## @zc0301_dev_lock
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_zc0301_release_resources,4,2   ## @zc0301_release_resources
	.comm	_DEV_DISCONNECTED,4,2           ## @DEV_DISCONNECTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Device not present"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"Device /dev/video%d is busy..."

L_.str.2:                               ## @.str.2
	.asciz	"Simultaneous opens are not supported"

	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_O_NDELAY,4,2                   ## @O_NDELAY
	.comm	_EWOULDBLOCK,4,2                ## @EWOULDBLOCK
L_.str.3:                               ## @.str.3
	.asciz	"A blocking open() has been requested. Wait for the device to be released..."

	.comm	_DEV_MISCONFIGURED,4,2          ## @DEV_MISCONFIGURED
L_.str.4:                               ## @.str.4
	.asciz	"Initialization failed again. I will retry on next open()."

	.comm	_IO_NONE,4,2                    ## @IO_NONE
	.comm	_STREAM_OFF,4,2                 ## @STREAM_OFF
L_.str.5:                               ## @.str.5
	.asciz	"Video device /dev/video%d is open"

	.no_dead_strip	_zc0301_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zc0301_open
_zc0301_open:                           ; @zc0301_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
Lloh0:
	adrp	x0, _zc0301_dev_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _zc0301_dev_lock@GOTPAGEOFF]
	bl	_down_read_trylock
	cbz	w0, LBB0_5
; %bb.1:
	mov	x0, x22
	bl	_video_drvdata
	mov	x21, x0
	add	x0, x0, #60
	bl	_wait_for_completion_interruptible
	cbnz	x0, LBB0_4
; %bb.2:
	add	x20, x21, #4
	mov	x0, x20
	bl	_kref_get
	add	x19, x21, #8
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_8
; %bb.3:
Lloh2:
	adrp	x8, _zc0301_release_resources@GOTPAGE
Lloh3:
	ldr	x8, [x8, _zc0301_release_resources@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kref_put
LBB0_4:
Lloh5:
	adrp	x0, _zc0301_dev_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _zc0301_dev_lock@GOTPAGEOFF]
	bl	_up_read
Lloh7:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_7:
	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_8:
	ldr	w8, [x21]
Lloh11:
	adrp	x24, _DEV_DISCONNECTED@GOTPAGE
Lloh12:
	ldr	x24, [x24, _DEV_DISCONNECTED@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.9:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_DBG
LBB0_10:
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_15
LBB0_11:
	ldr	x9, [x21, #48]
	cbz	x9, LBB0_23
; %bb.12:
	ldr	x8, [x21, #16]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_DBG
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #3
	bl	_DBG
	ldr	w8, [x22]
Lloh21:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_14
; %bb.13:
Lloh24:
	adrp	x9, _O_NDELAY@GOTPAGE
Lloh25:
	ldr	x9, [x9, _O_NDELAY@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
LBB0_14:
Lloh27:
	adrp	x8, _EWOULDBLOCK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EWOULDBLOCK@GOTPAGEOFF]
LBB0_15:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_mutex_unlock
	cbz	w21, LBB0_17
; %bb.16:
	neg	w23, w21
	b	LBB0_29
LBB0_17:
	mov	w23, #0
	b	LBB0_30
LBB0_18:
Lloh29:
	adrp	x1, l_.str.3@PAGE
Lloh30:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #2
	bl	_DBG
Lloh31:
	adrp	x0, _zc0301_dev_lock@GOTPAGE
Lloh32:
	ldr	x0, [x0, _zc0301_dev_lock@GOTPAGEOFF]
	bl	_up_read
	ldr	w0, [x21, #56]
	ldr	w8, [x21]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	mov	w1, #1
	b	LBB0_21
LBB0_20:
	ldr	x8, [x21, #48]
	cmp	x8, #0
	cset	w1, eq
LBB0_21:
	bl	_wait_event_interruptible_exclusive
	mov	x23, x0
Lloh33:
	adrp	x0, _zc0301_dev_lock@GOTPAGE
Lloh34:
	ldr	x0, [x0, _zc0301_dev_lock@GOTPAGEOFF]
	bl	_down_read
	cbnz	w23, LBB0_28
; %bb.22:
	ldr	w8, [x21]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_10
LBB0_23:
Lloh35:
	adrp	x24, _DEV_MISCONFIGURED@GOTPAGE
Lloh36:
	ldr	x24, [x24, _DEV_MISCONFIGURED@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_27
; %bb.24:
	mov	x0, x21
	bl	_zc0301_init
	cbz	w0, LBB0_26
; %bb.25:
	mov	x23, x0
Lloh37:
	adrp	x1, l_.str.4@PAGE
Lloh38:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_DBG
	b	LBB0_28
LBB0_26:
	ldr	w8, [x24]
	ldr	w9, [x21]
	bic	w8, w9, w8
	str	w8, [x21]
LBB0_27:
	mov	x0, x21
	bl	_zc0301_start_transfer
	mov	x23, x0
	cbz	w0, LBB0_31
LBB0_28:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_29:
Lloh39:
	adrp	x8, _zc0301_release_resources@GOTPAGE
Lloh40:
	ldr	x8, [x8, _zc0301_release_resources@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kref_put
LBB0_30:
Lloh42:
	adrp	x0, _zc0301_dev_lock@GOTPAGE
Lloh43:
	ldr	x0, [x0, _zc0301_dev_lock@GOTPAGEOFF]
	bl	_up_read
	b	LBB0_7
LBB0_31:
	str	x21, [x22, #8]
	ldr	x8, [x21, #48]
	add	x8, x8, #1
	str	x8, [x21, #48]
Lloh44:
	adrp	x8, _IO_NONE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _IO_NONE@GOTPAGEOFF]
Lloh46:
	adrp	x9, _STREAM_OFF@GOTPAGE
Lloh47:
	ldr	x9, [x9, _STREAM_OFF@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
Lloh49:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #40]
	stp	xzr, xzr, [x21, #24]
	mov	x0, x21
	bl	_zc0301_empty_framequeues
	ldr	x8, [x21, #16]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh50:
	adrp	x1, l_.str.5@PAGE
Lloh51:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #3
	bl	_DBG
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_30
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_zc0301_dev_lock,4,2            ; @zc0301_dev_lock
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_zc0301_release_resources,4,2   ; @zc0301_release_resources
	.comm	_DEV_DISCONNECTED,4,2           ; @DEV_DISCONNECTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Device not present"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"Device /dev/video%d is busy..."

l_.str.2:                               ; @.str.2
	.asciz	"Simultaneous opens are not supported"

	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_O_NDELAY,4,2                   ; @O_NDELAY
	.comm	_EWOULDBLOCK,4,2                ; @EWOULDBLOCK
l_.str.3:                               ; @.str.3
	.asciz	"A blocking open() has been requested. Wait for the device to be released..."

	.comm	_DEV_MISCONFIGURED,4,2          ; @DEV_MISCONFIGURED
l_.str.4:                               ; @.str.4
	.asciz	"Initialization failed again. I will retry on next open()."

	.comm	_IO_NONE,4,2                    ; @IO_NONE
	.comm	_STREAM_OFF,4,2                 ; @STREAM_OFF
l_.str.5:                               ; @.str.5
	.asciz	"Video device /dev/video%d is open"

	.no_dead_strip	_zc0301_open
.subsections_via_symbols
