	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function initialize_vpif
_initialize_vpif:                       ## @initialize_vpif
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ch2_numbuffers@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	testq	%rax, %rax
	jle	LBB0_3
## %bb.1:
	movq	_config_params@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	%rdx, %rax
	jge	LBB0_3
## %bb.2:
	movq	%rdx, (%rcx)
	movq	%rdx, %rax
LBB0_3:
	movq	_ch3_numbuffers@GOTPCREL(%rip), %r8
	movq	(%r8), %rcx
	testq	%rcx, %rcx
	jle	LBB0_6
## %bb.4:
	movq	_config_params@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	%rdx, %rcx
	jge	LBB0_6
## %bb.5:
	movq	%rdx, (%r8)
	movq	%rdx, %rcx
LBB0_6:
	movq	_ch2_bufsize@GOTPCREL(%rip), %rdi
	movq	(%rdi), %r14
	movq	_config_params@GOTPCREL(%rip), %r11
	movq	8(%r11), %rsi
	movq	_VPIF_CHANNEL2_VIDEO@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rsi,%rdx,8), %rbx
	cmpq	%rbx, %r14
	jge	LBB0_8
## %bb.7:
	movq	%rbx, (%rdi)
	movq	%rbx, %r14
LBB0_8:
	movq	_ch3_bufsize@GOTPCREL(%rip), %r9
	movq	_VPIF_CHANNEL3_VIDEO@GOTPCREL(%rip), %r10
	movq	(%r10), %rdi
	movq	(%rsi,%rdi,8), %rsi
	cmpq	%rsi, (%r9)
	jge	LBB0_10
## %bb.9:
	movq	%rsi, (%r9)
LBB0_10:
	movq	16(%r11), %rsi
	movl	%eax, (%rsi,%rdx,4)
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	24(%r11), %rax
	movq	%r14, (%rax,%rdx,8)
	movq	(%r8), %rcx
	movq	(%r10), %rdi
LBB0_12:
	movl	%ecx, (%rsi,%rdi,4)
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.13:
	movq	(%r9), %rax
	movq	24(%r11), %rcx
	movq	%rax, (%rcx,%rdi,8)
LBB0_14:
	movq	_VPIF_DISPLAY_MAX_DEVICES@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_22
## %bb.15:
	xorl	%ebx, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movq	_vpif_obj@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movl	$4, %edi
	callq	_kmalloc
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	testl	%eax, %eax
	je	LBB0_17
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_16
LBB0_22:
	xorl	%r14d, %r14d
LBB0_23:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.18:
	movl	(%rcx), %edi
	callq	_kfree
	cmpq	$1, %rbx
	je	LBB0_23
## %bb.19:
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movl	(%rax,%r12,4), %edi
	callq	_kfree
	incq	%r12
	cmpq	%r12, %rbx
	jne	LBB0_20
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_ch2_numbuffers,8,3             ## @ch2_numbuffers
	.comm	_config_params,32,3             ## @config_params
	.comm	_ch3_numbuffers,8,3             ## @ch3_numbuffers
	.comm	_ch2_bufsize,8,3                ## @ch2_bufsize
	.comm	_VPIF_CHANNEL2_VIDEO,8,3        ## @VPIF_CHANNEL2_VIDEO
	.comm	_ch3_bufsize,8,3                ## @ch3_bufsize
	.comm	_VPIF_CHANNEL3_VIDEO,8,3        ## @VPIF_CHANNEL3_VIDEO
	.comm	_VPIF_DISPLAY_MAX_DEVICES,4,2   ## @VPIF_DISPLAY_MAX_DEVICES
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_vpif_obj,8,3                   ## @vpif_obj
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VPIF_DISPLAY_NUM_CHANNELS,4,2  ## @VPIF_DISPLAY_NUM_CHANNELS
	.no_dead_strip	_initialize_vpif
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function initialize_vpif
_initialize_vpif:                       ; @initialize_vpif
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x10, _ch2_numbuffers@GOTPAGE
Lloh1:
	ldr	x10, [x10, _ch2_numbuffers@GOTPAGEOFF]
	ldr	x9, [x10]
Lloh2:
	adrp	x8, _config_params@GOTPAGE
Lloh3:
	ldr	x8, [x8, _config_params@GOTPAGEOFF]
	cmp	x9, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x11, [x8]
	cmp	x9, x11
	b.ge	LBB0_3
; %bb.2:
	str	x11, [x10]
	mov	x9, x11
LBB0_3:
Lloh4:
	adrp	x11, _ch3_numbuffers@GOTPAGE
Lloh5:
	ldr	x11, [x11, _ch3_numbuffers@GOTPAGEOFF]
	ldr	x10, [x11]
	cmp	x10, #1
	b.lt	LBB0_6
; %bb.4:
	ldr	x12, [x8]
	cmp	x10, x12
	b.ge	LBB0_6
; %bb.5:
	str	x12, [x11]
	mov	x10, x12
LBB0_6:
Lloh6:
	adrp	x12, _ch2_bufsize@GOTPAGE
Lloh7:
	ldr	x12, [x12, _ch2_bufsize@GOTPAGEOFF]
	ldr	x13, [x12]
	ldr	x16, [x8, #8]
Lloh8:
	adrp	x14, _VPIF_CHANNEL2_VIDEO@GOTPAGE
Lloh9:
	ldr	x14, [x14, _VPIF_CHANNEL2_VIDEO@GOTPAGEOFF]
Lloh10:
	ldr	x15, [x14]
	ldr	x14, [x16, x15, lsl #3]
	cmp	x13, x14
	b.ge	LBB0_8
; %bb.7:
	str	x14, [x12]
	mov	x13, x14
LBB0_8:
Lloh11:
	adrp	x12, _ch3_bufsize@GOTPAGE
Lloh12:
	ldr	x12, [x12, _ch3_bufsize@GOTPAGEOFF]
	ldr	x0, [x12]
Lloh13:
	adrp	x17, _VPIF_CHANNEL3_VIDEO@GOTPAGE
Lloh14:
	ldr	x17, [x17, _VPIF_CHANNEL3_VIDEO@GOTPAGEOFF]
	ldr	x14, [x17]
	ldr	x16, [x16, x14, lsl #3]
	cmp	x0, x16
	b.ge	LBB0_10
; %bb.9:
	str	x16, [x12]
LBB0_10:
	ldr	x16, [x8, #16]
	str	w9, [x16, x15, lsl #2]
	cbz	x9, LBB0_12
; %bb.11:
	ldr	x9, [x8, #24]
	str	x13, [x9, x15, lsl #3]
	ldr	x10, [x11]
	ldr	x14, [x17]
LBB0_12:
	str	w10, [x16, x14, lsl #2]
	cbz	x10, LBB0_14
; %bb.13:
	ldr	x9, [x12]
	ldr	x8, [x8, #24]
	str	x9, [x8, x14, lsl #3]
LBB0_14:
Lloh15:
	adrp	x19, _VPIF_DISPLAY_MAX_DEVICES@GOTPAGE
Lloh16:
	ldr	x19, [x19, _VPIF_DISPLAY_MAX_DEVICES@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.15:
	mov	x20, #0
Lloh17:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh18:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
Lloh19:
	adrp	x21, _vpif_obj@GOTPAGE
Lloh20:
	ldr	x21, [x21, _vpif_obj@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	w0, #4
	bl	_kmalloc
	ldr	x8, [x21]
	str	w0, [x8, x20, lsl #2]
	cbz	w0, LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.lt	LBB0_16
LBB0_18:
	mov	w19, #0
LBB0_19:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_20:
Lloh21:
	adrp	x9, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	neg	w19, w9
	cbz	w20, LBB0_19
; %bb.21:
	ldr	w0, [x8]
	bl	_kfree
	cmp	x20, #1
	b.eq	LBB0_19
; %bb.22:
	mov	w22, #1
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	w0, [x8, x22, lsl #2]
	bl	_kfree
	add	x22, x22, #1
	cmp	x20, x22
	b.ne	LBB0_23
	b	LBB0_19
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ch2_numbuffers,8,3             ; @ch2_numbuffers
	.comm	_config_params,32,3             ; @config_params
	.comm	_ch3_numbuffers,8,3             ; @ch3_numbuffers
	.comm	_ch2_bufsize,8,3                ; @ch2_bufsize
	.comm	_VPIF_CHANNEL2_VIDEO,8,3        ; @VPIF_CHANNEL2_VIDEO
	.comm	_ch3_bufsize,8,3                ; @ch3_bufsize
	.comm	_VPIF_CHANNEL3_VIDEO,8,3        ; @VPIF_CHANNEL3_VIDEO
	.comm	_VPIF_DISPLAY_MAX_DEVICES,4,2   ; @VPIF_DISPLAY_MAX_DEVICES
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_vpif_obj,8,3                   ; @vpif_obj
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VPIF_DISPLAY_NUM_CHANNELS,4,2  ; @VPIF_DISPLAY_NUM_CHANNELS
	.no_dead_strip	_initialize_vpif
.subsections_via_symbols
