	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pd_video_open
_pd_video_open:                         ## @pd_video_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
	callq	_video_devdata
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_video_get_drvdata
	movq	%rax, %r13
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	4(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	8(%r13), %edi
	callq	_usb_autopm_get_interface
	movq	(%r15), %rax
	movq	_VFL_TYPE_GRABBER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.1:
	movq	_POSEIDON_STATE_ANALOG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r13)
	je	LBB0_2
LBB0_6:
	movq	_VFL_TYPE_VBI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.7:
	movq	_POSEIDON_STATE_VBI@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, (%r13)
	je	LBB0_8
LBB0_11:
	leaq	L_.str(%rip), %rdi
	callq	_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	8(%r13), %edi
	callq	_usb_autopm_put_interface
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.3:
	movq	%rax, %r12
	movq	_usb_transfer_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
	leaq	36(%r13), %rdi
	callq	_init_video_context
	movq	%r13, %rdi
	callq	_pd_video_checkmode
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_POSEIDON_STATE_ANALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r13)
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	%rax, 32(%r12)
	incl	32(%r13)
	movq	_debug_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_set_debug_mode
	movq	%r12, %rdi
	addq	$24, %rdi
	movq	(%rbx), %r8
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	%rax, %r12
	movl	(%r15), %eax
	orl	%eax, (%r13)
	movq	_V4L2_BUF_TYPE_VBI_CAPTURE@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	%r8, 32(%r12)
	movq	%r12, 24(%r13)
	incl	16(%r13)
	movq	%r12, %rdi
	addq	$24, %rdi
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %r9d
	subq	$8, %rsp
	movq	_pd_video_qops@GOTPCREL(%rip), %rsi
	xorl	%edx, %edx
	movq	%r12, %rcx
	pushq	$0
	pushq	%r12
	pushq	$4
	callq	_videobuf_queue_vmalloc_init
	addq	$32, %rsp
	movq	%r13, 16(%r12)
	movq	$0, 8(%r12)
	leaq	4(%r12), %rdi
	callq	_INIT_LIST_HEAD
	movq	%r12, %rdi
	callq	_spin_lock_init
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r12, (%rax)
	addq	$12, %r13
	movq	%r13, %rdi
	callq	_kref_get
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_4:
	movq	%r12, %rdi
	callq	_kfree
	movl	$-1, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VFL_TYPE_GRABBER,8,3           ## @VFL_TYPE_GRABBER
	.comm	_POSEIDON_STATE_ANALOG,4,2      ## @POSEIDON_STATE_ANALOG
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_usb_transfer_mode,4,2          ## @usb_transfer_mode
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_debug_mode,4,2                 ## @debug_mode
	.comm	_pd_video_qops,4,2              ## @pd_video_qops
	.comm	_V4L2_FIELD_INTERLACED,4,2      ## @V4L2_FIELD_INTERLACED
	.comm	_VFL_TYPE_VBI,8,3               ## @VFL_TYPE_VBI
	.comm	_POSEIDON_STATE_VBI,4,2         ## @POSEIDON_STATE_VBI
	.comm	_V4L2_BUF_TYPE_VBI_CAPTURE,8,3  ## @V4L2_BUF_TYPE_VBI_CAPTURE
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"other "

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_pd_video_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pd_video_open
_pd_video_open:                         ; @pd_video_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x0
	bl	_video_devdata
	mov	x24, x0
	bl	_video_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [x20, #8]
	bl	_usb_autopm_get_interface
	ldr	x8, [x24]
Lloh3:
	adrp	x9, _VFL_TYPE_GRABBER@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VFL_TYPE_GRABBER@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w9, [x20]
Lloh6:
	adrp	x25, _POSEIDON_STATE_ANALOG@GOTPAGE
Lloh7:
	ldr	x25, [x25, _POSEIDON_STATE_ANALOG@GOTPAGEOFF]
	ldr	w10, [x25]
	tst	w10, w9
	b.eq	LBB0_7
LBB0_2:
Lloh8:
	adrp	x9, _VFL_TYPE_VBI@GOTPAGE
Lloh9:
	ldr	x9, [x9, _VFL_TYPE_VBI@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	w8, [x20]
Lloh11:
	adrp	x24, _POSEIDON_STATE_VBI@GOTPAGE
Lloh12:
	ldr	x24, [x24, _POSEIDON_STATE_VBI@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_10
LBB0_4:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_5:
	ldr	w0, [x20, #8]
	bl	_usb_autopm_put_interface
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
Lloh18:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.8:
	mov	x22, x0
Lloh21:
	adrp	x8, _usb_transfer_mode@GOTPAGE
Lloh22:
	ldr	x8, [x8, _usb_transfer_mode@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x20, #40]
	add	x0, x20, #36
	bl	_init_video_context
	mov	x0, x20
	bl	_pd_video_checkmode
	tbnz	w0, #31, LBB0_13
; %bb.9:
	ldr	w8, [x25]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
Lloh24:
	adrp	x23, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh25:
	ldr	x23, [x23, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
	ldr	x8, [x23]
	str	x8, [x22, #32]
	ldr	w8, [x20, #32]
	add	w8, w8, #1
	str	w8, [x20, #32]
Lloh26:
	adrp	x8, _debug_mode@GOTPAGE
Lloh27:
	ldr	x8, [x8, _debug_mode@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_set_debug_mode
	add	x0, x22, #24
	ldr	x4, [x23]
Lloh29:
	adrp	x8, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh30:
	ldr	x8, [x8, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh31:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.11:
	mov	x22, x0
	ldr	w8, [x24]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
Lloh34:
	adrp	x8, _V4L2_BUF_TYPE_VBI_CAPTURE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VBI_CAPTURE@GOTPAGEOFF]
Lloh36:
	ldr	x4, [x8]
	str	x4, [x0, #32]
	str	x0, [x20, #24]
	ldr	w8, [x20, #16]
	add	w8, w8, #1
	str	w8, [x20, #16]
	add	x0, x0, #24
Lloh37:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
LBB0_12:
	ldr	w5, [x8]
	str	xzr, [sp]
Lloh39:
	adrp	x1, _pd_video_qops@GOTPAGE
Lloh40:
	ldr	x1, [x1, _pd_video_qops@GOTPAGEOFF]
	mov	x2, #0
	mov	x3, x22
	mov	w6, #4
	mov	x7, x22
	bl	_videobuf_queue_vmalloc_init
	stp	xzr, x20, [x22, #8]
	add	x0, x22, #4
	bl	_INIT_LIST_HEAD
	mov	x0, x22
	bl	_spin_lock_init
	str	x22, [x21]
	add	x0, x20, #12
	bl	_kref_get
	mov	w23, #0
	b	LBB0_6
LBB0_13:
	mov	x0, x22
	bl	_kfree
	mov	w23, #-1
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VFL_TYPE_GRABBER,8,3           ; @VFL_TYPE_GRABBER
	.comm	_POSEIDON_STATE_ANALOG,4,2      ; @POSEIDON_STATE_ANALOG
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_usb_transfer_mode,4,2          ; @usb_transfer_mode
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_debug_mode,4,2                 ; @debug_mode
	.comm	_pd_video_qops,4,2              ; @pd_video_qops
	.comm	_V4L2_FIELD_INTERLACED,4,2      ; @V4L2_FIELD_INTERLACED
	.comm	_VFL_TYPE_VBI,8,3               ; @VFL_TYPE_VBI
	.comm	_POSEIDON_STATE_VBI,4,2         ; @POSEIDON_STATE_VBI
	.comm	_V4L2_BUF_TYPE_VBI_CAPTURE,8,3  ; @V4L2_BUF_TYPE_VBI_CAPTURE
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"other "

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_pd_video_open
.subsections_via_symbols
