	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_prep_dev
_ivtv_prep_dev:                         ## @ivtv_prep_dev
	.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, %r15
	movq	32(%rdi), %rax
	movslq	%esi, %rcx
	movq	_ivtv_stream_info@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdx
	movq	%rcx, %rbx
	shlq	$5, %rbx
	movl	(%r15), %r13d
	addl	(%rdx,%rbx), %r13d
	movq	_ivtv_first_minor@GOTPCREL(%rip), %rdx
	addl	(%rdx), %r13d
	movq	$0, 16(%rax,%rbx)
	movq	%r15, 24(%rax,%rbx)
	movl	%ecx, (%rax,%rbx)
	movq	(%rdi), %rdx
	movq	8(%rdx,%rbx), %rdx
	movq	%rdx, 8(%rax,%rbx)
	movq	_IVTV_ENC_STREAM_TYPE_RAD@GOTPCREL(%rip), %rdx
	cmpl	%ecx, (%rdx)
	jne	LBB0_2
## %bb.1:
	movq	_V4L2_CAP_RADIO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 4(%r15)
	je	LBB0_12
LBB0_2:
	movq	_IVTV_DEC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rdx
	cmpl	%esi, (%rdx)
	jg	LBB0_4
## %bb.3:
	movq	_V4L2_CAP_VIDEO_OUTPUT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 4(%r15)
	je	LBB0_12
LBB0_4:
	movq	(%rdi), %r8
	movq	16(%r8,%rbx), %rdi
	movq	_PCI_DMA_NONE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rdi
	je	LBB0_7
## %bb.5:
	movq	24(%r15), %rdx
	cmpq	$0, (%rdx,%rcx,8)
	je	LBB0_6
LBB0_7:
	leaq	(%rax,%rbx), %r12
	addq	$16, %r12
	movq	%r15, %rdi
	callq	_ivtv_stream_init
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_video_device_alloc
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %rdi
	callq	_video_device_shadow_get
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, %r14
	movq	(%r12), %rax
	movl	32(%rax), %edi
	leaq	8(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %rcx
	movq	-8(%r12), %r8
	leaq	L_.str.3(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	(%r12), %rdi
	movl	%r13d, (%rdi)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%rdi)
	movl	16(%r15), %eax
	movl	%eax, (%r14)
	movq	_ivtv_stream_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	24(%rax,%rbx), %eax
	movl	%eax, 16(%rdi)
	movq	_video_device_release@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rdi)
	movq	_V4L2_STD_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rdi)
	callq	_ivtv_set_funcs
	jmp	LBB0_12
LBB0_8:
	movq	-8(%r12), %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_IVTV_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_13
LBB0_10:
	movq	-8(%r12), %rsi
	leaq	L_.str.2(%rip), %rdi
	callq	_IVTV_ERR
	movq	(%r12), %rdi
	callq	_video_device_release
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_13
LBB0_6:
	movq	8(%r8,%rbx), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_INFO
LBB0_12:
	xorl	%r14d, %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ivtv_stream_info,8,3           ## @ivtv_stream_info
	.comm	_ivtv_first_minor,4,2           ## @ivtv_first_minor
	.comm	_IVTV_ENC_STREAM_TYPE_RAD,4,2   ## @IVTV_ENC_STREAM_TYPE_RAD
	.comm	_V4L2_CAP_RADIO,4,2             ## @V4L2_CAP_RADIO
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,4,2   ## @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_V4L2_CAP_VIDEO_OUTPUT,4,2      ## @V4L2_CAP_VIDEO_OUTPUT
	.comm	_PCI_DMA_NONE,8,3               ## @PCI_DMA_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Disabled %s device\n"

L_.str.1:                               ## @.str.1
	.asciz	"Couldn't allocate v4l2 video_device for %s\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Couldn't allocate v4l2 video_device_shadow for %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s %s"

	.comm	_V4L2_STD_ALL,4,2               ## @V4L2_STD_ALL
	.no_dead_strip	_ivtv_prep_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_prep_dev
_ivtv_prep_dev:                         ; @ivtv_prep_dev
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
Lloh0:
	adrp	x21, _ivtv_stream_info@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ivtv_stream_info@GOTPAGEOFF]
	ldr	x8, [x0, #32]
	ldr	x9, [x21]
	sbfiz	x10, x1, #5, #32
	ldr	w24, [x9, x10]
	ldr	w25, [x0]
Lloh2:
	adrp	x9, _ivtv_first_minor@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ivtv_first_minor@GOTPAGEOFF]
	add	x23, x8, x10
	mov	x22, x23
	str	xzr, [x22, #16]!
Lloh4:
	ldr	w26, [x9]
	str	x0, [x23, #24]
	str	w1, [x23]
	ldr	x8, [x21]
	add	x8, x8, x10
	ldr	x8, [x8, #8]
	str	x8, [x23, #8]!
Lloh5:
	adrp	x8, _IVTV_ENC_STREAM_TYPE_RAD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IVTV_ENC_STREAM_TYPE_RAD@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #4]
Lloh8:
	adrp	x9, _V4L2_CAP_RADIO@GOTPAGE
Lloh9:
	ldr	x9, [x9, _V4L2_CAP_RADIO@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
LBB0_2:
Lloh11:
	adrp	x8, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, w1
	b.gt	LBB0_4
; %bb.3:
	ldr	w8, [x19, #4]
Lloh14:
	adrp	x9, _V4L2_CAP_VIDEO_OUTPUT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _V4L2_CAP_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
LBB0_4:
	sxtw	x27, w1
	ldr	x8, [x21]
	add	x9, x8, x27, lsl #5
	ldr	x9, [x9, #16]
Lloh17:
	adrp	x10, _PCI_DMA_NONE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _PCI_DMA_NONE@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_6
; %bb.5:
	ldr	x9, [x19, #24]
	ldr	x9, [x9, x27, lsl #3]
	cbz	x9, LBB0_12
LBB0_6:
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_ivtv_stream_init
	bl	_video_device_alloc
	str	x0, [x22]
	cbz	x0, LBB0_9
; %bb.7:
	bl	_video_device_shadow_get
	cbz	x0, LBB0_10
; %bb.8:
	mov	x20, x0
	add	w8, w25, w24
	add	w24, w8, w26
	ldr	x8, [x22]
	ldr	w0, [x8, #32]
	ldr	x3, [x19, #8]!
	ldr	x4, [x23]
Lloh20:
	adrp	x2, l_.str.3@PAGE
Lloh21:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	ldr	x0, [x22]
	str	w24, [x0]
	str	x19, [x0, #24]
	ldr	w8, [x19, #8]
	str	w8, [x20]
	ldr	x8, [x21]
	add	x8, x8, x27, lsl #5
	ldr	w8, [x8, #24]
Lloh22:
	adrp	x9, _video_device_release@GOTPAGE
Lloh23:
	ldr	x9, [x9, _video_device_release@GOTPAGEOFF]
	str	w8, [x0, #16]
	str	x9, [x0, #8]
Lloh24:
	adrp	x8, _V4L2_STD_ALL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _V4L2_STD_ALL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x0, #4]
	bl	_ivtv_set_funcs
	b	LBB0_13
LBB0_9:
	ldr	x1, [x23]
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_ERR
	b	LBB0_11
LBB0_10:
	ldr	x1, [x23]
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTV_ERR
	ldr	x0, [x22]
	bl	_video_device_release
LBB0_11:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_12:
	add	x8, x8, x27, lsl #5
	ldr	x1, [x8, #8]
Lloh34:
	adrp	x0, l_.str@PAGE
Lloh35:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_INFO
LBB0_13:
	mov	w0, #0
LBB0_14:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_ivtv_stream_info,8,3           ; @ivtv_stream_info
	.comm	_ivtv_first_minor,4,2           ; @ivtv_first_minor
	.comm	_IVTV_ENC_STREAM_TYPE_RAD,4,2   ; @IVTV_ENC_STREAM_TYPE_RAD
	.comm	_V4L2_CAP_RADIO,4,2             ; @V4L2_CAP_RADIO
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,4,2   ; @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_V4L2_CAP_VIDEO_OUTPUT,4,2      ; @V4L2_CAP_VIDEO_OUTPUT
	.comm	_PCI_DMA_NONE,8,3               ; @PCI_DMA_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Disabled %s device\n"

l_.str.1:                               ; @.str.1
	.asciz	"Couldn't allocate v4l2 video_device for %s\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Couldn't allocate v4l2 video_device_shadow for %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s %s"

	.comm	_V4L2_STD_ALL,4,2               ; @V4L2_STD_ALL
	.no_dead_strip	_ivtv_prep_dev
.subsections_via_symbols
