	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_device
_init_device:                           ## @init_device
	.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	%rbx
	subq	$264, %rsp                      ## imm = 0x108
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm0, -144(%rbp)
	movaps	%xmm0, -160(%rbp)
	movl	12(%rdi), %edi
	movq	_VIDIOC_QUERYCAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-288(%rbp), %rdx
	callq	_xioctl
	testq	%rax, %rax
	js	LBB0_1
## %bb.6:
	movl	-288(%rbp), %eax
	movq	_V4L2_CAP_VIDEO_CAPTURE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.8:
	movq	_V4L2_CAP_STREAMING@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.10:
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -120(%rbp)
	movl	12(%rbx), %edi
	movq	_VIDIOC_CROPCAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-160(%rbp), %rdx
	callq	_xioctl
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	(%r14), %rax
	movq	%rax, -184(%rbp)
	movl	-112(%rbp), %eax
	movl	%eax, -172(%rbp)
	movl	12(%rbx), %edi
	movq	_VIDIOC_S_CROP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-224(%rbp), %rdx
	callq	_xioctl
LBB0_12:
	movq	(%r14), %rax
	movq	%rax, -56(%rbp)
	movl	(%rbx), %eax
	movl	%eax, -88(%rbp)
	movl	4(%rbx), %eax
	movl	%eax, -60(%rbp)
	movq	_V4L2_PIX_FMT_YUYV@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%rax, -80(%rbp)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -72(%rbp)
	movl	12(%rbx), %edi
	movq	_VIDIOC_S_FMT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-96(%rbp), %rdx
	callq	_xioctl
	testq	%rax, %rax
	js	LBB0_13
## %bb.14:
	movl	-88(%rbp), %esi
	movl	%esi, (%rbx)
	movl	-60(%rbp), %eax
	movl	%eax, 4(%rbx)
	movl	-64(%rbp), %edi
	addl	%esi, %esi
	callq	_MAX
	movl	%eax, 8(%rbx)
	movq	-80(%rbp), %rax
	cmpq	(%r15), %rax
	jne	LBB0_15
## %bb.16:
	movq	-72(%rbp), %rax
	cmpq	(%r14), %rax
	je	LBB0_19
## %bb.17:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_19
## %bb.18:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_5
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movl	16(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_3
LBB0_7:
	movl	16(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_5
LBB0_9:
	movl	16(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_20
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_5
LBB0_15:
	leaq	L_.str.5(%rip), %rdi
LBB0_5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_20:
	movl	%ebx, %eax
	addq	$264, %rsp                      ## imm = 0x108
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	leaq	L_.str.7(%rip), %rdi
	callq	_RARCH_LOG
	movq	%rbx, %rdi
	callq	_init_mmap
	movl	%eax, %ebx
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDIOC_QUERYCAP,4,2            ## @VIDIOC_QUERYCAP
	.comm	_errno,8,3                      ## @errno
	.comm	_EINVAL,8,3                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[V4L2]: %s is no V4L2 device.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[V4L2]: Error - VIDIOC_QUERYCAP.\n"

	.comm	_V4L2_CAP_VIDEO_CAPTURE,4,2     ## @V4L2_CAP_VIDEO_CAPTURE
L_.str.2:                               ## @.str.2
	.asciz	"[V4L2]: %s is no video capture device.\n"

	.comm	_V4L2_CAP_STREAMING,4,2         ## @V4L2_CAP_STREAMING
L_.str.3:                               ## @.str.3
	.asciz	"[V4L2]: %s does not support streaming I/O (V4L2_CAP_STREAMING).\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_VIDIOC_CROPCAP,4,2             ## @VIDIOC_CROPCAP
	.comm	_VIDIOC_S_CROP,4,2              ## @VIDIOC_S_CROP
	.comm	_V4L2_PIX_FMT_YUYV,8,3          ## @V4L2_PIX_FMT_YUYV
	.comm	_V4L2_FIELD_NONE,8,3            ## @V4L2_FIELD_NONE
	.comm	_VIDIOC_S_FMT,4,2               ## @VIDIOC_S_FMT
L_.str.4:                               ## @.str.4
	.asciz	"[V4L2]: Error - VIDIOC_S_FMT\n"

L_.str.5:                               ## @.str.5
	.asciz	"[V4L2]: The V4L2 device doesn't support YUYV.\n"

	.comm	_V4L2_FIELD_INTERLACED,8,3      ## @V4L2_FIELD_INTERLACED
L_.str.6:                               ## @.str.6
	.asciz	"[V4L2]: The V4L2 device doesn't support progressive nor interlaced video.\n"

L_.str.7:                               ## @.str.7
	.asciz	"[V4L2]: device: %u x %u.\n"

	.no_dead_strip	_init_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_device
_init_device:                           ; @init_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #320
	.cfi_def_cfa_offset 320
	stp	x22, x21, [sp, #272]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #288]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #304]            ; 16-byte Folded Spill
	add	x29, sp, #304
	.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
	mov	x19, x0
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #112]
	stp	q0, q0, [sp, #80]
	stp	q0, q0, [sp, #48]
	stp	q0, q0, [sp, #16]
	ldr	w0, [x0, #12]
Lloh0:
	adrp	x8, _VIDIOC_QUERYCAP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDIOC_QUERYCAP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #144
	bl	_xioctl
	tbnz	x0, #63, LBB0_10
; %bb.1:
	ldr	w8, [sp, #144]
Lloh3:
	adrp	x9, _V4L2_CAP_VIDEO_CAPTURE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_CAP_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.2:
Lloh6:
	adrp	x9, _V4L2_CAP_STREAMING@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_CAP_STREAMING@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.3:
Lloh9:
	adrp	x20, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh10:
	ldr	x20, [x20, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
	ldr	x8, [x20]
	str	x8, [sp, #56]
	ldr	w0, [x19, #12]
Lloh11:
	adrp	x8, _VIDIOC_CROPCAP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VIDIOC_CROPCAP@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #16
	bl	_xioctl
	cbnz	x0, LBB0_5
; %bb.4:
	ldr	x8, [x20]
	stur	x8, [x29, #-56]
	ldr	w8, [sp, #64]
	stur	w8, [x29, #-44]
	ldr	w0, [x19, #12]
Lloh14:
	adrp	x8, _VIDIOC_S_CROP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VIDIOC_S_CROP@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	sub	x2, x29, #96
	bl	_xioctl
LBB0_5:
	ldr	x8, [x20]
	str	x8, [sp, #120]
	ldp	w8, w9, [x19]
	str	w8, [sp, #88]
	str	w9, [sp, #116]
Lloh17:
	adrp	x21, _V4L2_PIX_FMT_YUYV@GOTPAGE
Lloh18:
	ldr	x21, [x21, _V4L2_PIX_FMT_YUYV@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh19:
	adrp	x20, _V4L2_FIELD_NONE@GOTPAGE
Lloh20:
	ldr	x20, [x20, _V4L2_FIELD_NONE@GOTPAGEOFF]
	ldr	x9, [x20]
	stp	x8, x9, [sp, #96]
	ldr	w0, [x19, #12]
Lloh21:
	adrp	x8, _VIDIOC_S_FMT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VIDIOC_S_FMT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	add	x2, sp, #80
	bl	_xioctl
	tbnz	x0, #63, LBB0_15
; %bb.6:
	ldp	w0, w8, [sp, #112]
	ldr	w9, [sp, #88]
	stp	w9, w8, [x19]
	lsl	w1, w9, #1
	bl	_MAX
	str	w0, [x19, #8]
	ldr	x8, [sp, #96]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.7:
	ldr	x8, [sp, #104]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.8:
Lloh24:
	adrp	x9, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh25:
	ldr	x9, [x9, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.9:
Lloh27:
	adrp	x0, l_.str.6@PAGE
Lloh28:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_17
LBB0_10:
Lloh29:
	adrp	x8, _errno@GOTPAGE
Lloh30:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
Lloh32:
	adrp	x9, _EINVAL@GOTPAGE
Lloh33:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:
	ldr	w8, [x19, #16]
	str	x8, [sp]
Lloh35:
	adrp	x0, l_.str@PAGE
Lloh36:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_17
LBB0_12:
	ldr	w8, [x19, #16]
	str	x8, [sp]
Lloh37:
	adrp	x0, l_.str.2@PAGE
Lloh38:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_13:
Lloh39:
	adrp	x0, l_.str.1@PAGE
Lloh40:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_14:
	ldr	w8, [x19, #16]
	str	x8, [sp]
Lloh41:
	adrp	x0, l_.str.3@PAGE
Lloh42:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_15:
Lloh43:
	adrp	x0, l_.str.4@PAGE
Lloh44:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh45:
	adrp	x0, l_.str.5@PAGE
Lloh46:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_17:
	bl	_RARCH_ERR
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #304]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #288]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #272]            ; 16-byte Folded Reload
	add	sp, sp, #320
	ret
LBB0_19:
	ldp	w1, w2, [x19]
Lloh47:
	adrp	x0, l_.str.7@PAGE
Lloh48:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_RARCH_LOG
	mov	x0, x19
	bl	_init_mmap
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDIOC_QUERYCAP,4,2            ; @VIDIOC_QUERYCAP
	.comm	_errno,8,3                      ; @errno
	.comm	_EINVAL,8,3                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[V4L2]: %s is no V4L2 device.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[V4L2]: Error - VIDIOC_QUERYCAP.\n"

	.comm	_V4L2_CAP_VIDEO_CAPTURE,4,2     ; @V4L2_CAP_VIDEO_CAPTURE
l_.str.2:                               ; @.str.2
	.asciz	"[V4L2]: %s is no video capture device.\n"

	.comm	_V4L2_CAP_STREAMING,4,2         ; @V4L2_CAP_STREAMING
l_.str.3:                               ; @.str.3
	.asciz	"[V4L2]: %s does not support streaming I/O (V4L2_CAP_STREAMING).\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_VIDIOC_CROPCAP,4,2             ; @VIDIOC_CROPCAP
	.comm	_VIDIOC_S_CROP,4,2              ; @VIDIOC_S_CROP
	.comm	_V4L2_PIX_FMT_YUYV,8,3          ; @V4L2_PIX_FMT_YUYV
	.comm	_V4L2_FIELD_NONE,8,3            ; @V4L2_FIELD_NONE
	.comm	_VIDIOC_S_FMT,4,2               ; @VIDIOC_S_FMT
l_.str.4:                               ; @.str.4
	.asciz	"[V4L2]: Error - VIDIOC_S_FMT\n"

l_.str.5:                               ; @.str.5
	.asciz	"[V4L2]: The V4L2 device doesn't support YUYV.\n"

	.comm	_V4L2_FIELD_INTERLACED,8,3      ; @V4L2_FIELD_INTERLACED
l_.str.6:                               ; @.str.6
	.asciz	"[V4L2]: The V4L2 device doesn't support progressive nor interlaced video.\n"

l_.str.7:                               ; @.str.7
	.asciz	"[V4L2]: device: %u x %u.\n"

	.no_dead_strip	_init_device
.subsections_via_symbols
