	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function v4l2_get_device_list
_v4l2_get_device_list:                  ## @v4l2_get_device_list
	.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	$312, %rsp                      ## imm = 0x138
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -312(%rbp)                ## 8-byte Spill
	movq	(%rdi), %r14
	movq	$0, -320(%rbp)
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.3:
	movq	%rsi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_opendir
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%rax, -328(%rbp)                ## 8-byte Spill
	movq	%rax, %rdi
	callq	_readdir
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%rax, %r12
	movq	%rbx, -344(%rbp)                ## 8-byte Spill
	leaq	4(%rbx), %rax
	movq	%rax, -336(%rbp)                ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-328(%rbp), %rdi                ## 8-byte Reload
	callq	_readdir
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_24
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	callq	_v4l2_is_v4l_dev
	testl	%eax, %eax
	je	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	(%r12), %rcx
	leaq	-304(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$256, %esi                      ## imm = 0x100
	leaq	L_.str.2(%rip), %rdx
	callq	_snprintf
	movq	-312(%rbp), %rdi                ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_device_open
	movl	%eax, (%r14)
	testl	%eax, %eax
	js	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_VIDIOC_QUERYCAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	leaq	-352(%rbp), %rdx
	callq	_v4l2_ioctl
	testq	%rax, %rax
	js	LBB0_19
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$16, %edi
	callq	_av_mallocz
	movq	%rax, -320(%rbp)
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %rbx
	leaq	-304(%rbp), %rdi
	callq	_av_strdup
	movq	%rax, 8(%rbx)
	movq	-352(%rbp), %rdi
	callq	_av_strdup
	movq	%rax, (%rbx)
	movq	-320(%rbp), %r15
	cmpq	$0, 8(%r15)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpq	$0, (%r15)
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-336(%rbp), %rdi                ## 8-byte Reload
	movq	-344(%rbp), %rsi                ## 8-byte Reload
	movq	%r15, %rdx
	callq	_av_dynarray_add_nofree
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r14), %edi
	callq	_v4l2_close
	movl	$-1, (%r14)
	jmp	LBB0_18
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.2:
	addq	$312, %rsp                      ## imm = 0x138
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r13d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r13d, %edi
	callq	_av_err2str
	leaq	L_.str.1(%rip), %rdx
	movq	-312(%rbp), %rdi                ## 8-byte Reload
	movl	%ebx, %esi
	movl	%eax, %ecx
	callq	_av_log
	jmp	LBB0_25
LBB0_5:
	xorl	%r13d, %r13d
	jmp	LBB0_24
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r13d
	jmp	LBB0_20
LBB0_19:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r13d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r13d, %edi
	callq	_av_err2str
	leaq	L_.str.3(%rip), %rdx
	movq	-312(%rbp), %rdi                ## 8-byte Reload
	movl	%r12d, %esi
	movl	%eax, %ecx
	callq	_av_log
	testq	%r15, %r15
	je	LBB0_21
LBB0_20:
	leaq	8(%r15), %rdi
	callq	_av_freep
	movq	%r15, %rdi
	callq	_av_freep
	leaq	-320(%rbp), %rdi
	callq	_av_freep
	jmp	LBB0_21
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r13d
LBB0_21:
	movl	(%r14), %edi
	testl	%edi, %edi
	js	LBB0_23
## %bb.22:
	callq	_v4l2_close
LBB0_23:
	movl	$-1, (%r14)
LBB0_24:
	movq	-328(%rbp), %rdi                ## 8-byte Reload
	callq	_closedir
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.26:
	movl	%r13d, %eax
	addq	$312, %rsp                      ## imm = 0x138
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev"

	.comm	_errno,4,2                      ## @errno
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't open the directory: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"/dev/%s"

	.comm	_VIDIOC_QUERYCAP,4,2            ## @VIDIOC_QUERYCAP
L_.str.3:                               ## @.str.3
	.asciz	"ioctl(VIDIOC_QUERYCAP): %s\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_v4l2_get_device_list
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function v4l2_get_device_list
_v4l2_get_device_list:                  ; @v4l2_get_device_list
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #384
	.cfi_def_cfa_offset 384
	stp	x28, x27, [sp, #288]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #304]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #320]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #336]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #352]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #368]            ; 16-byte Folded Spill
	add	x29, sp, #368
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	ldr	x27, [x0]
	str	xzr, [sp, #8]
	cbz	x1, LBB0_13
; %bb.1:
	mov	x23, x1
	mov	x20, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_opendir
	cbz	x0, LBB0_15
; %bb.2:
	mov	x19, x0
	bl	_readdir
	cbz	x0, LBB0_16
; %bb.3:
	mov	x26, x0
	mov	x22, #0
	mov	w21, #0
	add	x24, x23, #4
Lloh5:
	adrp	x28, _VIDIOC_QUERYCAP@GOTPAGE
Lloh6:
	ldr	x28, [x28, _VIDIOC_QUERYCAP@GOTPAGEOFF]
Lloh7:
	adrp	x25, l_.str.2@PAGE
Lloh8:
	add	x25, x25, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_readdir
	mov	x26, x0
	cbz	x0, LBB0_23
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x26]
	bl	_v4l2_is_v4l_dev
	cbz	w0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x3, [x26]
	add	x0, sp, #16
	mov	w1, #256
	mov	x2, x25
	bl	_snprintf
	add	x1, sp, #16
	mov	x0, x20
	bl	_device_open
	str	w0, [x27]
	tbnz	w0, #31, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x28]
	mov	x2, sp
	bl	_v4l2_ioctl
	tbnz	x0, #63, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #16
	bl	_av_mallocz
	str	x0, [sp, #8]
	cbz	x0, LBB0_26
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
	add	x0, sp, #16
	bl	_av_strdup
	str	x0, [x21, #8]
	ldr	x0, [sp]
	bl	_av_strdup
	str	x0, [x21]
	ldr	x22, [sp, #8]
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22]
	cbz	x8, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	bl	_av_dynarray_add_nofree
	mov	x21, x0
	tbnz	w0, #31, LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x27]
	bl	_v4l2_close
	mov	w8, #-1
	str	w8, [x27]
	b	LBB0_4
LBB0_13:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldur	x8, [x29, #-96]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.14:
	ldp	x29, x30, [sp, #368]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #352]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #336]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #320]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #304]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #288]            ; 16-byte Folded Reload
	add	sp, sp, #384
	b	_AVERROR
LBB0_15:
Lloh15:
	adrp	x8, _errno@GOTPAGE
Lloh16:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
Lloh18:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w19, [x8]
	bl	_av_err2str
	mov	x3, x0
Lloh21:
	adrp	x2, l_.str.1@PAGE
Lloh22:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	_av_log
	b	LBB0_24
LBB0_16:
	mov	w21, #0
	b	LBB0_23
LBB0_17:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
	b	LBB0_19
LBB0_18:
Lloh26:
	adrp	x8, _errno@GOTPAGE
Lloh27:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
Lloh29:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w23, [x8]
	bl	_av_err2str
	mov	x3, x0
Lloh32:
	adrp	x2, l_.str.3@PAGE
Lloh33:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x1, x23
	bl	_av_log
	cbz	x22, LBB0_20
LBB0_19:
	add	x0, x22, #8
	bl	_av_freep
	mov	x0, x22
	bl	_av_freep
	add	x0, sp, #8
	bl	_av_freep
LBB0_20:
	ldr	w0, [x27]
	tbnz	w0, #31, LBB0_22
LBB0_21:
	bl	_v4l2_close
LBB0_22:
	mov	w8, #-1
	str	w8, [x27]
LBB0_23:
	mov	x0, x19
	bl	_closedir
LBB0_24:
	ldur	x8, [x29, #-96]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.25:
	mov	x0, x21
	ldp	x29, x30, [sp, #368]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #352]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #336]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #320]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #304]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #288]            ; 16-byte Folded Reload
	add	sp, sp, #384
	ret
LBB0_26:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
	ldr	w0, [x27]
	tbz	w0, #31, LBB0_21
	b	LBB0_22
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev"

	.comm	_errno,4,2                      ; @errno
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't open the directory: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"/dev/%s"

	.comm	_VIDIOC_QUERYCAP,4,2            ; @VIDIOC_QUERYCAP
l_.str.3:                               ; @.str.3
	.asciz	"ioctl(VIDIOC_QUERYCAP): %s\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_v4l2_get_device_list
.subsections_via_symbols
