	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_mmap
_init_mmap:                             ## @init_mmap
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -64(%rbp)
	movq	$0, -48(%rbp)
	movl	$4, -80(%rbp)
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	%rax, -56(%rbp)
	movq	_V4L2_MEMORY_MMAP@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, -64(%rbp)
	movl	16(%rdi), %edi
	movq	_VIDIOC_REQBUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	callq	_xioctl
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.6:
	movl	-80(%rbp), %edi
	cmpl	$1, %edi
	jg	LBB0_8
## %bb.7:
	movl	20(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movl	20(%rbx), %esi
	leaq	L_.str(%rip), %rdi
LBB0_3:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_17
LBB0_8:
	movl	$8, %esi
	callq	_calloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movl	$0, (%rbx)
	movl	$1, %r14d
	cmpl	$0, -80(%rbp)
	jle	LBB0_17
## %bb.11:
	xorl	%ecx, %ecx
	movq	_MAP_FAILED@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	movq	$0, -96(%rbp)
	movq	(%r12), %rax
	movq	%rax, -104(%rbp)
	movq	(%r13), %rax
	movq	%rax, -112(%rbp)
	movl	%ecx, -124(%rbp)
	movl	16(%rbx), %edi
	movq	_VIDIOC_QUERYBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-128(%rbp), %rdx
	callq	_xioctl
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-116(%rbp), %esi
	movq	8(%rbx), %rax
	movslq	(%rbx), %rcx
	movl	%esi, 4(%rax,%rcx,8)
	movq	_PROT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	16(%rbx), %r8d
	movl	-120(%rbp), %r9d
	xorl	%edi, %edi
	callq	_mmap
	movq	8(%rbx), %rdx
	movslq	(%rbx), %rcx
	movl	%eax, (%rdx,%rcx,8)
	cmpl	(%r15), %eax
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	incl	%ecx
	movl	%ecx, (%rbx)
	cmpl	-80(%rbp), %ecx
	jl	LBB0_12
	jmp	LBB0_17
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_5
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_5
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_5
LBB0_15:
	leaq	L_.str.5(%rip), %rdi
LBB0_5:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_17:
	movl	%r14d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_MEMORY_MMAP,8,3           ## @V4L2_MEMORY_MMAP
	.comm	_VIDIOC_REQBUFS,4,2             ## @VIDIOC_REQBUFS
	.comm	_errno,8,3                      ## @errno
	.comm	_EINVAL,8,3                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[V4L2]: %s does not support memory mapping.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[V4L2]: xioctl of VIDIOC_REQBUFS failed.\n"

L_.str.2:                               ## @.str.2
	.asciz	"[V4L2]: Insufficient buffer memory on %s.\n"

L_.str.3:                               ## @.str.3
	.asciz	"[V4L2]: Out of memory allocating V4L2 buffers.\n"

	.comm	_VIDIOC_QUERYBUF,4,2            ## @VIDIOC_QUERYBUF
L_.str.4:                               ## @.str.4
	.asciz	"[V4L2]: Error - xioctl VIDIOC_QUERYBUF.\n"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,4,2                 ## @MAP_FAILED
L_.str.5:                               ## @.str.5
	.asciz	"[V4L2]: Error - mmap.\n"

	.no_dead_strip	_init_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_mmap
_init_mmap:                             ; @init_mmap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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	x19, x0
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #64]
	str	xzr, [sp, #96]
	mov	w8, #4
	str	w8, [sp, #64]
Lloh0:
	adrp	x20, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh2:
	adrp	x21, _V4L2_MEMORY_MMAP@GOTPAGE
Lloh3:
	ldr	x21, [x21, _V4L2_MEMORY_MMAP@GOTPAGEOFF]
	ldr	x9, [x21]
	stp	x9, x8, [sp, #80]
	ldr	w0, [x0, #16]
Lloh4:
	adrp	x8, _VIDIOC_REQBUFS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VIDIOC_REQBUFS@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, sp, #64
	bl	_xioctl
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.1:
	ldr	w0, [sp, #64]
	cmp	w0, #1
	b.gt	LBB0_5
; %bb.2:
	ldr	w8, [x19, #20]
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_3:
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
Lloh12:
	adrp	x9, _EINVAL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.4:
	ldr	w8, [x19, #20]
	str	x8, [sp]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_16
LBB0_5:
	mov	w1, #8
	bl	_calloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_13
; %bb.6:
	str	wzr, [x19]
	ldr	w8, [sp, #64]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.7:
	mov	w8, #0
Lloh17:
	adrp	x22, _VIDIOC_QUERYBUF@GOTPAGE
Lloh18:
	ldr	x22, [x22, _VIDIOC_QUERYBUF@GOTPAGEOFF]
Lloh19:
	adrp	x23, _PROT_READ@GOTPAGE
Lloh20:
	ldr	x23, [x23, _PROT_READ@GOTPAGEOFF]
Lloh21:
	adrp	x24, _PROT_WRITE@GOTPAGE
Lloh22:
	ldr	x24, [x24, _PROT_WRITE@GOTPAGEOFF]
Lloh23:
	adrp	x25, _MAP_SHARED@GOTPAGE
Lloh24:
	ldr	x25, [x25, _MAP_SHARED@GOTPAGEOFF]
Lloh25:
	adrp	x26, _MAP_FAILED@GOTPAGE
Lloh26:
	ldr	x26, [x26, _MAP_FAILED@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #16]
	ldr	x9, [x20]
	ldr	x10, [x21]
	stp	x9, xzr, [sp, #40]
	str	x10, [sp, #32]
	str	w8, [sp, #20]
	ldr	w0, [x19, #16]
	ldr	w1, [x22]
	add	x2, sp, #16
	bl	_xioctl
	cmn	w0, #1
	b.eq	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w1, [sp, #28]
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19]
	add	x8, x8, x9, lsl #3
	str	w1, [x8, #4]
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w2, w9, w8
	ldr	w3, [x25]
	ldr	w4, [x19, #16]
	ldr	w5, [sp, #24]
	mov	x0, #0
	bl	_mmap
	ldr	x9, [x19, #8]
	ldrsw	x8, [x19]
	lsl	x10, x8, #3
	str	w0, [x9, x10]
	ldr	w9, [x26]
	cmp	w0, w9
	b.eq	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	w8, w8, #1
	str	w8, [x19]
	ldr	w9, [sp, #64]
	cmp	w8, w9
	b.lt	LBB0_8
LBB0_11:
	mov	w0, #1
	b	LBB0_17
LBB0_12:
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_13:
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_14:
Lloh31:
	adrp	x0, l_.str.4@PAGE
Lloh32:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh33:
	adrp	x0, l_.str.5@PAGE
Lloh34:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_16:
	bl	_RARCH_ERR
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_MEMORY_MMAP,8,3           ; @V4L2_MEMORY_MMAP
	.comm	_VIDIOC_REQBUFS,4,2             ; @VIDIOC_REQBUFS
	.comm	_errno,8,3                      ; @errno
	.comm	_EINVAL,8,3                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[V4L2]: %s does not support memory mapping.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[V4L2]: xioctl of VIDIOC_REQBUFS failed.\n"

l_.str.2:                               ; @.str.2
	.asciz	"[V4L2]: Insufficient buffer memory on %s.\n"

l_.str.3:                               ; @.str.3
	.asciz	"[V4L2]: Out of memory allocating V4L2 buffers.\n"

	.comm	_VIDIOC_QUERYBUF,4,2            ; @VIDIOC_QUERYBUF
l_.str.4:                               ; @.str.4
	.asciz	"[V4L2]: Error - xioctl VIDIOC_QUERYBUF.\n"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,4,2                 ; @MAP_FAILED
l_.str.5:                               ; @.str.5
	.asciz	"[V4L2]: Error - mmap.\n"

	.no_dead_strip	_init_mmap
.subsections_via_symbols
