	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dshow_read_header
_dshow_read_header:                     ## @dshow_read_header
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	$0, -64(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -80(%rbp)
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
	xorl	%edi, %edi
	callq	_CoInitialize
	cmpq	$0, 72(%r12)
	jne	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_parse_device_name
	testl	%eax, %eax
	je	LBB0_15
LBB0_2:
	movq	(%r15), %rax
	movq	_AV_CODEC_ID_RAWVIDEO@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	(%rcx), %rax
LBB0_4:
	movq	%rax, (%r12)
	movq	8(%r12), %rdx
	movq	_AV_PIX_FMT_NONE@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	je	LBB0_7
## %bb.5:
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	jmp	LBB0_20
LBB0_7:
	movq	88(%r12), %rsi
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.8:
	leaq	96(%r12), %rdi
	callq	_av_parse_video_rate
	testl	%eax, %eax
	js	LBB0_16
LBB0_9:
	movq	_CLSCTX_INPROC_SERVER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	_CLSID_FilterGraph@GOTPCREL(%rip), %rdi
	movq	_IID_IGraphBuilder@GOTPCREL(%rip), %rcx
	leaq	-64(%rbp), %r8
	xorl	%esi, %esi
	callq	_CoCreateInstance
	movq	_S_OK@GOTPCREL(%rip), %r13
	cmpl	(%r13), %eax
	jne	LBB0_14
## %bb.10:
	movq	-64(%rbp), %rax
	movq	%rax, 80(%r12)
	movl	(%rbx), %edx
	movq	_CLSID_SystemDeviceEnum@GOTPCREL(%rip), %rdi
	movq	_IID_ICreateDevEnum@GOTPCREL(%rip), %rcx
	leaq	-48(%rbp), %r8
	xorl	%esi, %esi
	callq	_CoCreateInstance
	cmpl	(%r13), %eax
	jne	LBB0_17
## %bb.11:
	cmpq	$0, 72(%r12)
	je	LBB0_25
## %bb.12:
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.5(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rsi
	movq	_VideoDevice@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_VideoSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_dshow_cycle_devices
	movl	(%rbx), %esi
	leaq	L_.str.6(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rsi
	movq	_AudioDevice@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_AudioSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_dshow_cycle_devices
LBB0_13:
	movq	_AVERROR_EXIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_20
LBB0_14:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_18
LBB0_15:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_18
LBB0_16:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	88(%r12), %rcx
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_19
LBB0_17:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
LBB0_18:
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_19:
	movl	%r14d, %ebx
LBB0_20:
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_22
## %bb.21:
	callq	_ICreateDevEnum_Release
LBB0_22:
	testl	%ebx, %ebx
	jns	LBB0_24
## %bb.23:
	movq	%r15, %rdi
	callq	_dshow_read_close
LBB0_24:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	cmpq	$0, 56(%r12)
	je	LBB0_32
## %bb.26:
	movq	64(%r12), %rax
	movq	_VideoDevice@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_29
## %bb.27:
	movq	-48(%rbp), %rsi
	movq	_VideoSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_dshow_list_device_options
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.28:
	movq	64(%r12), %rax
LBB0_29:
	movq	_AudioDevice@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_32
## %bb.30:
	movq	-48(%rbp), %rsi
	movq	_AudioSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_dshow_list_device_options
	testl	%eax, %eax
	je	LBB0_32
## %bb.31:
	movq	-48(%rbp), %rsi
	movq	(%rbx), %rdx
	movq	_VideoSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_dshow_list_device_options
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
LBB0_32:
	movq	64(%r12), %rax
	movq	_VideoDevice@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_36
## %bb.33:
	movq	-48(%rbp), %rsi
	movq	_VideoSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_dshow_open_device
	testl	%eax, %eax
	js	LBB0_52
## %bb.34:
	movq	_VideoDevice@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_dshow_add_device
	testl	%eax, %eax
	js	LBB0_52
## %bb.35:
	movq	64(%r12), %rax
LBB0_36:
	movq	_AudioDevice@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_41
## %bb.37:
	movq	-48(%rbp), %rsi
	movq	_AudioSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_dshow_open_device
	testl	%eax, %eax
	js	LBB0_39
## %bb.38:
	movq	(%rbx), %rsi
	movq	%r15, %rdi
	callq	_dshow_add_device
	testl	%eax, %eax
	jns	LBB0_41
LBB0_39:
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	64(%r12), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rcx
	leaq	L_.str.7(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rsi
	movq	(%rbx), %rdx
	movq	_VideoSourceDevice@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_dshow_open_device
	testl	%eax, %eax
	js	LBB0_52
## %bb.40:
	movq	(%rbx), %rsi
	movq	%r15, %rdi
	callq	_dshow_add_device
	testl	%eax, %eax
	js	LBB0_52
LBB0_41:
	cmpq	$0, 56(%r12)
	jne	LBB0_13
## %bb.42:
	movq	48(%r12), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_CreateMutex
	movl	%eax, 40(%r12)
	testl	%eax, %eax
	je	LBB0_55
## %bb.43:
	xorl	%edi, %edi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_CreateEvent
	movq	16(%r12), %rcx
	movl	%eax, 4(%rcx)
	testl	%eax, %eax
	je	LBB0_57
## %bb.44:
	movq	-64(%rbp), %rdi
	movq	_IID_IMediaControl@GOTPCREL(%rip), %rsi
	leaq	-56(%rbp), %rdx
	callq	_IGraphBuilder_QueryInterface
	cmpl	(%r13), %eax
	jne	LBB0_58
## %bb.45:
	movq	-56(%rbp), %rax
	movq	%rax, 32(%r12)
	movq	-64(%rbp), %rdi
	movq	_IID_IMediaEvent@GOTPCREL(%rip), %rsi
	leaq	-80(%rbp), %rdx
	callq	_IGraphBuilder_QueryInterface
	cmpl	(%r13), %eax
	jne	LBB0_59
## %bb.46:
	movq	-80(%rbp), %rdi
	movq	%rdi, 24(%r12)
	leaq	-68(%rbp), %rsi
	callq	_IMediaEvent_GetEventHandle
	cmpl	(%r13), %eax
	jne	LBB0_60
## %bb.47:
	xorl	%eax, %eax
	callq	_GetCurrentProcess
	movl	-68(%rbp), %esi
	movq	16(%r12), %rcx
	movq	_DUPLICATE_SAME_ACCESS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, (%rsp)
	movl	%eax, %edi
	movl	%eax, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_DuplicateHandle
	testl	%eax, %eax
	je	LBB0_61
## %bb.48:
	movq	-56(%rbp), %rdi
	callq	_IMediaControl_Run
	movq	_S_FALSE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_50
## %bb.49:
	movq	-56(%rbp), %rdi
	leaq	-84(%rbp), %rdx
	xorl	%esi, %esi
	callq	_IMediaControl_GetState
LBB0_50:
	xorl	%ebx, %ebx
	cmpl	(%r13), %eax
	je	LBB0_20
## %bb.51:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.14(%rip), %rdx
	jmp	LBB0_18
LBB0_52:
	movl	%eax, %ebx
	jmp	LBB0_20
LBB0_55:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.8(%rip), %rdx
	jmp	LBB0_18
LBB0_57:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.9(%rip), %rdx
	jmp	LBB0_18
LBB0_58:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.10(%rip), %rdx
	jmp	LBB0_18
LBB0_59:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.11(%rip), %rdx
	jmp	LBB0_18
LBB0_60:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.12(%rip), %rdx
	jmp	LBB0_18
LBB0_61:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.13(%rip), %rdx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Malformed dshow input string.\n"

	.comm	_AV_CODEC_ID_RAWVIDEO,8,3       ## @AV_CODEC_ID_RAWVIDEO
	.comm	_AV_PIX_FMT_NONE,8,3            ## @AV_PIX_FMT_NONE
L_.str.1:                               ## @.str.1
	.asciz	"Pixel format may only be set when video codec is not set or set to rawvideo\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Could not parse framerate '%s'.\n"

	.comm	_CLSID_FilterGraph,4,2          ## @CLSID_FilterGraph
	.comm	_CLSCTX_INPROC_SERVER,4,2       ## @CLSCTX_INPROC_SERVER
	.comm	_IID_IGraphBuilder,4,2          ## @IID_IGraphBuilder
	.comm	_S_OK,4,2                       ## @S_OK
L_.str.3:                               ## @.str.3
	.asciz	"Could not create capture graph.\n"

	.comm	_CLSID_SystemDeviceEnum,4,2     ## @CLSID_SystemDeviceEnum
	.comm	_IID_ICreateDevEnum,4,2         ## @IID_ICreateDevEnum
L_.str.4:                               ## @.str.4
	.asciz	"Could not enumerate system devices.\n"

	.comm	_AV_LOG_INFO,4,2                ## @AV_LOG_INFO
L_.str.5:                               ## @.str.5
	.asciz	"DirectShow video devices (some may be both video and audio devices)\n"

	.comm	_VideoDevice,8,3                ## @VideoDevice
	.comm	_VideoSourceDevice,4,2          ## @VideoSourceDevice
L_.str.6:                               ## @.str.6
	.asciz	"DirectShow audio devices\n"

	.comm	_AudioDevice,8,3                ## @AudioDevice
	.comm	_AudioSourceDevice,4,2          ## @AudioSourceDevice
	.comm	_AVERROR_EXIT,4,2               ## @AVERROR_EXIT
L_.str.7:                               ## @.str.7
	.asciz	"Searching for audio device within video devices for %s\n"

L_.str.8:                               ## @.str.8
	.asciz	"Could not create Mutex\n"

L_.str.9:                               ## @.str.9
	.asciz	"Could not create Event\n"

	.comm	_IID_IMediaControl,4,2          ## @IID_IMediaControl
L_.str.10:                              ## @.str.10
	.asciz	"Could not get media control.\n"

	.comm	_IID_IMediaEvent,4,2            ## @IID_IMediaEvent
L_.str.11:                              ## @.str.11
	.asciz	"Could not get media event.\n"

L_.str.12:                              ## @.str.12
	.asciz	"Could not get media event handle.\n"

	.comm	_DUPLICATE_SAME_ACCESS,4,2      ## @DUPLICATE_SAME_ACCESS
L_.str.13:                              ## @.str.13
	.asciz	"Could not duplicate media event handle.\n"

	.comm	_S_FALSE,4,2                    ## @S_FALSE
L_.str.14:                              ## @.str.14
	.asciz	"Could not run graph (sometimes caused by a device already in use by other application)\n"

	.no_dead_strip	_dshow_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dshow_read_header
_dshow_read_header:                     ; @dshow_read_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
	ldr	x22, [x0, #8]
	stp	xzr, xzr, [sp, #32]
	stp	xzr, xzr, [sp, #16]
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x20, x0
	mov	w0, #0
	bl	_CoInitialize
	ldr	x8, [x22, #72]
	cbnz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_parse_device_name
	cbz	w0, LBB0_12
LBB0_2:
Lloh3:
	adrp	x8, _AV_CODEC_ID_RAWVIDEO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_CODEC_ID_RAWVIDEO@GOTPAGEOFF]
	ldr	x9, [x19]
	ldr	x10, [x8]
	cmp	x9, #0
	csel	x9, x10, x9, eq
	str	x9, [x22]
	ldr	x10, [x22, #8]
Lloh5:
	adrp	x11, _AV_PIX_FMT_NONE@GOTPAGE
Lloh6:
	ldr	x11, [x11, _AV_PIX_FMT_NONE@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
	ldr	x8, [x8]
	cmp	x10, x11
	ccmp	x9, x8, #4, ne
	b.ne	LBB0_10
; %bb.3:
	ldr	x1, [x22, #88]
	cbz	x1, LBB0_5
; %bb.4:
	add	x0, x22, #96
	bl	_av_parse_video_rate
	tbnz	w0, #31, LBB0_13
LBB0_5:
Lloh8:
	adrp	x21, _CLSCTX_INPROC_SERVER@GOTPAGE
Lloh9:
	ldr	x21, [x21, _CLSCTX_INPROC_SERVER@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh10:
	adrp	x0, _CLSID_FilterGraph@GOTPAGE
Lloh11:
	ldr	x0, [x0, _CLSID_FilterGraph@GOTPAGEOFF]
Lloh12:
	adrp	x3, _IID_IGraphBuilder@GOTPAGE
Lloh13:
	ldr	x3, [x3, _IID_IGraphBuilder@GOTPAGEOFF]
	add	x4, sp, #40
	mov	x1, #0
	bl	_CoCreateInstance
Lloh14:
	adrp	x23, _S_OK@GOTPAGE
Lloh15:
	ldr	x23, [x23, _S_OK@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.6:
	ldr	x8, [sp, #40]
	str	x8, [x22, #80]
	ldr	w2, [x21]
Lloh16:
	adrp	x0, _CLSID_SystemDeviceEnum@GOTPAGE
Lloh17:
	ldr	x0, [x0, _CLSID_SystemDeviceEnum@GOTPAGEOFF]
Lloh18:
	adrp	x3, _IID_ICreateDevEnum@GOTPAGE
Lloh19:
	ldr	x3, [x3, _IID_ICreateDevEnum@GOTPAGEOFF]
	add	x4, sp, #32
	mov	x1, #0
	bl	_CoCreateInstance
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.7:
	ldr	x8, [x22, #72]
	cbz	x8, LBB0_21
; %bb.8:
Lloh20:
	adrp	x20, _AV_LOG_INFO@GOTPAGE
Lloh21:
	ldr	x20, [x20, _AV_LOG_INFO@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh22:
	adrp	x2, l_.str.5@PAGE
Lloh23:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	x1, [sp, #32]
Lloh24:
	adrp	x8, _VideoDevice@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VideoDevice@GOTPAGEOFF]
Lloh26:
	ldr	x2, [x8]
Lloh27:
	adrp	x8, _VideoSourceDevice@GOTPAGE
Lloh28:
	ldr	x8, [x8, _VideoSourceDevice@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x4, #0
	mov	x5, #0
	bl	_dshow_cycle_devices
	ldr	w1, [x20]
Lloh30:
	adrp	x2, l_.str.6@PAGE
Lloh31:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	x1, [sp, #32]
Lloh32:
	adrp	x8, _AudioDevice@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AudioDevice@GOTPAGEOFF]
Lloh34:
	ldr	x2, [x8]
Lloh35:
	adrp	x8, _AudioSourceDevice@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AudioSourceDevice@GOTPAGEOFF]
Lloh37:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x4, #0
	mov	x5, #0
	bl	_dshow_cycle_devices
LBB0_9:
Lloh38:
	adrp	x8, _AVERROR_EXIT@GOTPAGE
Lloh39:
	ldr	x8, [x8, _AVERROR_EXIT@GOTPAGEOFF]
Lloh40:
	ldr	w21, [x8]
	b	LBB0_16
LBB0_10:
Lloh41:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh42:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
Lloh44:
	adrp	x2, l_.str.1@PAGE
Lloh45:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh46:
	adrp	x8, _EINVAL@GOTPAGE
Lloh47:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
	b	LBB0_16
LBB0_11:
Lloh49:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh50:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
Lloh52:
	adrp	x2, l_.str.3@PAGE
Lloh53:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_12:
Lloh54:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh55:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh56:
	ldr	w1, [x8]
Lloh57:
	adrp	x2, l_.str@PAGE
Lloh58:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh59:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh60:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh61:
	ldr	w1, [x8]
	ldr	x8, [x22, #88]
	str	x8, [sp]
Lloh62:
	adrp	x2, l_.str.2@PAGE
Lloh63:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_14:
Lloh64:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh65:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh66:
	ldr	w1, [x8]
Lloh67:
	adrp	x2, l_.str.4@PAGE
Lloh68:
	add	x2, x2, l_.str.4@PAGEOFF
LBB0_15:
	mov	x0, x19
	bl	_av_log
	mov	x21, x20
LBB0_16:
	ldr	x0, [sp, #32]
	cbz	x0, LBB0_18
; %bb.17:
	bl	_ICreateDevEnum_Release
LBB0_18:
	tbz	w21, #31, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_dshow_read_close
LBB0_20:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
	ldr	x8, [x22, #56]
	cbz	x8, LBB0_28
; %bb.22:
	ldr	x8, [x22, #64]
Lloh69:
	adrp	x9, _VideoDevice@GOTPAGE
Lloh70:
	ldr	x9, [x9, _VideoDevice@GOTPAGEOFF]
Lloh71:
	ldr	x2, [x9]
	ldr	x9, [x8, x2, lsl #3]
	cbz	x9, LBB0_25
; %bb.23:
	ldr	x1, [sp, #32]
Lloh72:
	adrp	x8, _VideoSourceDevice@GOTPAGE
Lloh73:
	ldr	x8, [x8, _VideoSourceDevice@GOTPAGEOFF]
Lloh74:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dshow_list_device_options
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.24:
	ldr	x8, [x22, #64]
LBB0_25:
Lloh75:
	adrp	x21, _AudioDevice@GOTPAGE
Lloh76:
	ldr	x21, [x21, _AudioDevice@GOTPAGEOFF]
	ldr	x2, [x21]
	ldr	x8, [x8, x2, lsl #3]
	cbz	x8, LBB0_28
; %bb.26:
	ldr	x1, [sp, #32]
Lloh77:
	adrp	x8, _AudioSourceDevice@GOTPAGE
Lloh78:
	ldr	x8, [x8, _AudioSourceDevice@GOTPAGEOFF]
Lloh79:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dshow_list_device_options
	cbz	w0, LBB0_28
; %bb.27:
	ldr	x1, [sp, #32]
	ldr	x2, [x21]
Lloh80:
	adrp	x8, _VideoSourceDevice@GOTPAGE
Lloh81:
	ldr	x8, [x8, _VideoSourceDevice@GOTPAGEOFF]
Lloh82:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dshow_list_device_options
	mov	x21, x0
	cbnz	w0, LBB0_16
LBB0_28:
	ldr	x8, [x22, #64]
Lloh83:
	adrp	x24, _VideoDevice@GOTPAGE
Lloh84:
	ldr	x24, [x24, _VideoDevice@GOTPAGEOFF]
	ldr	x2, [x24]
	ldr	x9, [x8, x2, lsl #3]
	cbz	x9, LBB0_32
; %bb.29:
	ldr	x1, [sp, #32]
Lloh85:
	adrp	x8, _VideoSourceDevice@GOTPAGE
Lloh86:
	ldr	x8, [x8, _VideoSourceDevice@GOTPAGEOFF]
Lloh87:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dshow_open_device
	tbnz	w0, #31, LBB0_48
; %bb.30:
	ldr	x1, [x24]
	mov	x0, x19
	bl	_dshow_add_device
	tbnz	w0, #31, LBB0_48
; %bb.31:
	ldr	x8, [x22, #64]
LBB0_32:
Lloh88:
	adrp	x24, _AudioDevice@GOTPAGE
Lloh89:
	ldr	x24, [x24, _AudioDevice@GOTPAGEOFF]
	ldr	x2, [x24]
	ldr	x8, [x8, x2, lsl #3]
	cbz	x8, LBB0_37
; %bb.33:
	ldr	x1, [sp, #32]
Lloh90:
	adrp	x8, _AudioSourceDevice@GOTPAGE
Lloh91:
	ldr	x8, [x8, _AudioSourceDevice@GOTPAGEOFF]
Lloh92:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dshow_open_device
	tbnz	w0, #31, LBB0_35
; %bb.34:
	ldr	x1, [x24]
	mov	x0, x19
	bl	_dshow_add_device
	tbz	w0, #31, LBB0_37
LBB0_35:
Lloh93:
	adrp	x8, _AV_LOG_INFO@GOTPAGE
Lloh94:
	ldr	x8, [x8, _AV_LOG_INFO@GOTPAGEOFF]
Lloh95:
	ldr	w1, [x8]
	ldr	x8, [x22, #64]
	ldr	x9, [x24]
	ldr	x8, [x8, x9, lsl #3]
	str	x8, [sp]
Lloh96:
	adrp	x2, l_.str.7@PAGE
Lloh97:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	x1, [sp, #32]
	ldr	x2, [x24]
Lloh98:
	adrp	x8, _VideoSourceDevice@GOTPAGE
Lloh99:
	ldr	x8, [x8, _VideoSourceDevice@GOTPAGEOFF]
Lloh100:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dshow_open_device
	tbnz	w0, #31, LBB0_48
; %bb.36:
	ldr	x1, [x24]
	mov	x0, x19
	bl	_dshow_add_device
	tbnz	w0, #31, LBB0_48
LBB0_37:
	ldr	x8, [x22, #56]
	cbnz	x8, LBB0_9
; %bb.38:
	ldr	x8, [x22, #48]
	stp	xzr, xzr, [x8]
	mov	x0, #0
	mov	w1, #0
	mov	x2, #0
	bl	_CreateMutex
	str	w0, [x22, #40]
	cbz	w0, LBB0_49
; %bb.39:
	mov	x0, #0
	mov	w1, #1
	mov	w2, #0
	mov	x3, #0
	bl	_CreateEvent
	ldr	x8, [x22, #16]
	str	w0, [x8, #4]
	cbz	w0, LBB0_50
; %bb.40:
	ldr	x0, [sp, #40]
Lloh101:
	adrp	x1, _IID_IMediaControl@GOTPAGE
Lloh102:
	ldr	x1, [x1, _IID_IMediaControl@GOTPAGEOFF]
	add	x2, sp, #24
	bl	_IGraphBuilder_QueryInterface
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_51
; %bb.41:
	ldr	x8, [sp, #24]
	str	x8, [x22, #32]
	ldr	x0, [sp, #40]
Lloh103:
	adrp	x1, _IID_IMediaEvent@GOTPAGE
Lloh104:
	ldr	x1, [x1, _IID_IMediaEvent@GOTPAGEOFF]
	add	x2, sp, #16
	bl	_IGraphBuilder_QueryInterface
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_52
; %bb.42:
	ldr	x0, [sp, #16]
	str	x0, [x22, #24]
	add	x1, sp, #12
	bl	_IMediaEvent_GetEventHandle
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_53
; %bb.43:
	bl	_GetCurrentProcess
	ldr	w1, [sp, #12]
	ldr	x3, [x22, #16]
Lloh105:
	adrp	x8, _DUPLICATE_SAME_ACCESS@GOTPAGE
Lloh106:
	ldr	x8, [x8, _DUPLICATE_SAME_ACCESS@GOTPAGEOFF]
Lloh107:
	ldr	w6, [x8]
	mov	x2, x0
	mov	w4, #0
	mov	w5, #0
	bl	_DuplicateHandle
	cbz	w0, LBB0_54
; %bb.44:
	ldr	x0, [sp, #24]
	bl	_IMediaControl_Run
Lloh108:
	adrp	x8, _S_FALSE@GOTPAGE
Lloh109:
	ldr	x8, [x8, _S_FALSE@GOTPAGEOFF]
Lloh110:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_46
; %bb.45:
	ldr	x0, [sp, #24]
	add	x2, sp, #8
	mov	w1, #0
	bl	_IMediaControl_GetState
LBB0_46:
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_55
; %bb.47:
	mov	w21, #0
	b	LBB0_16
LBB0_48:
	mov	x21, x0
	b	LBB0_16
LBB0_49:
Lloh111:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh112:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh113:
	ldr	w1, [x8]
Lloh114:
	adrp	x2, l_.str.8@PAGE
Lloh115:
	add	x2, x2, l_.str.8@PAGEOFF
	b	LBB0_15
LBB0_50:
Lloh116:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh117:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh118:
	ldr	w1, [x8]
Lloh119:
	adrp	x2, l_.str.9@PAGE
Lloh120:
	add	x2, x2, l_.str.9@PAGEOFF
	b	LBB0_15
LBB0_51:
Lloh121:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh122:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh123:
	ldr	w1, [x8]
Lloh124:
	adrp	x2, l_.str.10@PAGE
Lloh125:
	add	x2, x2, l_.str.10@PAGEOFF
	b	LBB0_15
LBB0_52:
Lloh126:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh127:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh128:
	ldr	w1, [x8]
Lloh129:
	adrp	x2, l_.str.11@PAGE
Lloh130:
	add	x2, x2, l_.str.11@PAGEOFF
	b	LBB0_15
LBB0_53:
Lloh131:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh132:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh133:
	ldr	w1, [x8]
Lloh134:
	adrp	x2, l_.str.12@PAGE
Lloh135:
	add	x2, x2, l_.str.12@PAGEOFF
	b	LBB0_15
LBB0_54:
Lloh136:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh137:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh138:
	ldr	w1, [x8]
Lloh139:
	adrp	x2, l_.str.13@PAGE
Lloh140:
	add	x2, x2, l_.str.13@PAGEOFF
	b	LBB0_15
LBB0_55:
Lloh141:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh142:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh143:
	ldr	w1, [x8]
Lloh144:
	adrp	x2, l_.str.14@PAGE
Lloh145:
	add	x2, x2, l_.str.14@PAGEOFF
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpAdd	Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpAdd	Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGot	Lloh75, Lloh76
	.loh AdrpLdrGotLdr	Lloh77, Lloh78, Lloh79
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpLdrGot	Lloh83, Lloh84
	.loh AdrpLdrGotLdr	Lloh85, Lloh86, Lloh87
	.loh AdrpLdrGot	Lloh88, Lloh89
	.loh AdrpLdrGotLdr	Lloh90, Lloh91, Lloh92
	.loh AdrpLdrGotLdr	Lloh98, Lloh99, Lloh100
	.loh AdrpAdd	Lloh96, Lloh97
	.loh AdrpLdrGotLdr	Lloh93, Lloh94, Lloh95
	.loh AdrpLdrGot	Lloh101, Lloh102
	.loh AdrpLdrGot	Lloh103, Lloh104
	.loh AdrpLdrGotLdr	Lloh105, Lloh106, Lloh107
	.loh AdrpLdrGotLdr	Lloh108, Lloh109, Lloh110
	.loh AdrpAdd	Lloh114, Lloh115
	.loh AdrpLdrGotLdr	Lloh111, Lloh112, Lloh113
	.loh AdrpAdd	Lloh119, Lloh120
	.loh AdrpLdrGotLdr	Lloh116, Lloh117, Lloh118
	.loh AdrpAdd	Lloh124, Lloh125
	.loh AdrpLdrGotLdr	Lloh121, Lloh122, Lloh123
	.loh AdrpAdd	Lloh129, Lloh130
	.loh AdrpLdrGotLdr	Lloh126, Lloh127, Lloh128
	.loh AdrpAdd	Lloh134, Lloh135
	.loh AdrpLdrGotLdr	Lloh131, Lloh132, Lloh133
	.loh AdrpAdd	Lloh139, Lloh140
	.loh AdrpLdrGotLdr	Lloh136, Lloh137, Lloh138
	.loh AdrpAdd	Lloh144, Lloh145
	.loh AdrpLdrGotLdr	Lloh141, Lloh142, Lloh143
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Malformed dshow input string.\n"

	.comm	_AV_CODEC_ID_RAWVIDEO,8,3       ; @AV_CODEC_ID_RAWVIDEO
	.comm	_AV_PIX_FMT_NONE,8,3            ; @AV_PIX_FMT_NONE
l_.str.1:                               ; @.str.1
	.asciz	"Pixel format may only be set when video codec is not set or set to rawvideo\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Could not parse framerate '%s'.\n"

	.comm	_CLSID_FilterGraph,4,2          ; @CLSID_FilterGraph
	.comm	_CLSCTX_INPROC_SERVER,4,2       ; @CLSCTX_INPROC_SERVER
	.comm	_IID_IGraphBuilder,4,2          ; @IID_IGraphBuilder
	.comm	_S_OK,4,2                       ; @S_OK
l_.str.3:                               ; @.str.3
	.asciz	"Could not create capture graph.\n"

	.comm	_CLSID_SystemDeviceEnum,4,2     ; @CLSID_SystemDeviceEnum
	.comm	_IID_ICreateDevEnum,4,2         ; @IID_ICreateDevEnum
l_.str.4:                               ; @.str.4
	.asciz	"Could not enumerate system devices.\n"

	.comm	_AV_LOG_INFO,4,2                ; @AV_LOG_INFO
l_.str.5:                               ; @.str.5
	.asciz	"DirectShow video devices (some may be both video and audio devices)\n"

	.comm	_VideoDevice,8,3                ; @VideoDevice
	.comm	_VideoSourceDevice,4,2          ; @VideoSourceDevice
l_.str.6:                               ; @.str.6
	.asciz	"DirectShow audio devices\n"

	.comm	_AudioDevice,8,3                ; @AudioDevice
	.comm	_AudioSourceDevice,4,2          ; @AudioSourceDevice
	.comm	_AVERROR_EXIT,4,2               ; @AVERROR_EXIT
l_.str.7:                               ; @.str.7
	.asciz	"Searching for audio device within video devices for %s\n"

l_.str.8:                               ; @.str.8
	.asciz	"Could not create Mutex\n"

l_.str.9:                               ; @.str.9
	.asciz	"Could not create Event\n"

	.comm	_IID_IMediaControl,4,2          ; @IID_IMediaControl
l_.str.10:                              ; @.str.10
	.asciz	"Could not get media control.\n"

	.comm	_IID_IMediaEvent,4,2            ; @IID_IMediaEvent
l_.str.11:                              ; @.str.11
	.asciz	"Could not get media event.\n"

l_.str.12:                              ; @.str.12
	.asciz	"Could not get media event handle.\n"

	.comm	_DUPLICATE_SAME_ACCESS,4,2      ; @DUPLICATE_SAME_ACCESS
l_.str.13:                              ; @.str.13
	.asciz	"Could not duplicate media event handle.\n"

	.comm	_S_FALSE,4,2                    ; @S_FALSE
l_.str.14:                              ; @.str.14
	.asciz	"Could not run graph (sometimes caused by a device already in use by other application)\n"

	.no_dead_strip	_dshow_read_header
.subsections_via_symbols
