	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function AllocCommonBuffers
LCPI0_0:
	.quad	512                             ## 0x200
	.quad	256                             ## 0x100
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_AllocCommonBuffers:                    ## @AllocCommonBuffers
	.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, %rbx
	movl	12(%rdi), %edi
	leaq	64(%rbx), %rdx
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_pci_alloc_consistent
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, 56(%rbx)
	movq	%rax, %xmm0
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	paddq	LCPI0_0(%rip), %xmm0
	movdqu	%xmm0, 40(%rbx)
	movl	12(%rbx), %edi
	movq	_OVERFLOW_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%rbx), %rdx
	callq	_pci_zalloc_consistent
	movl	%eax, 24(%rbx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_STREAM_VIDEOIN1@GOTPCREL(%rip), %rax
	movslq	(%rax), %r14
	movq	_MAX_STREAM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	(%rcx), %r14d
	jge	LBB0_21
## %bb.4:
	movq	%r14, %r12
	shlq	$4, %r12
	xorl	%eax, %eax
	movq	_NGENE_IO_AIN@GOTPCREL(%rip), %r15
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rbx), %rsi
	leaq	(%rsi,%r12), %rdi
	addq	$4, %rdi
	addq	%r12, %rsi
	callq	_FillTSIdleBuffer
	xorl	%eax, %eax
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r14
	movq	_MAX_STREAM@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	addq	$16, %r12
	cmpq	%rcx, %r14
	jge	LBB0_21
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rcx
	movq	16(%rbx), %rdx
	movq	(%rdx), %rdx
	movl	(%rdx,%r14,4), %r13d
	movq	_KSSTATE_STOP@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 12(%rcx,%r12)
	movq	_NGENE_IO_HDTV@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	_NGENE_IO_TV@GOTPCREL(%rip), %rsi
	orl	(%rsi), %edx
	orl	(%r15), %edx
	testl	%r13d, %edx
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%rbx), %edi
	leaq	(%rcx,%r12), %rsi
	addq	$8, %rsi
	movq	_RingBufferSizes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %edx
	callq	_create_ring_buffer
	testl	%eax, %eax
	js	LBB0_21
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r15), %ecx
	movq	_NGENE_IO_TV@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	testl	%r13d, %ecx
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%rbx), %edi
	movl	8(%rbx), %esi
	movq	(%rbx), %rax
	leaq	(%rax,%r12), %rdx
	addq	$8, %rdx
	movq	_Buffer1Sizes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %ecx
	movq	_Buffer2Sizes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %r8d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_NGENE_IO_HDTV@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%rbx), %edi
	movl	8(%rbx), %esi
	movq	(%rbx), %rax
	leaq	(%rax,%r12), %rdx
	addq	$8, %rdx
	movq	_MAX_HDTV_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r8d, %r8d
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	callq	_AllocateRingBuffers
	testl	%eax, %eax
	js	LBB0_21
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_NGENE_IO_TSOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_NGENE_IO_TSIN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%ecx, %edx
	testl	%r13d, %edx
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%rbx), %edi
	movq	(%rbx), %rsi
	addq	%r12, %rsi
	movq	_RING_SIZE_TS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_create_ring_buffer
	testl	%eax, %eax
	js	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	movq	(%rbx), %rdx
	addq	%r12, %rdx
	movq	_MAX_TS_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r8d, %r8d
	callq	_AllocateRingBuffers
	testl	%eax, %eax
	jne	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_NGENE_IO_TSOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%eax, %eax
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	testl	%r13d, %ecx
	je	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%rbx), %edi
	movq	(%rbx), %rax
	leaq	(%rax,%r12), %rsi
	addq	$4, %rsi
	movl	$1, %edx
	callq	_create_ring_buffer
	testl	%eax, %eax
	js	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%rbx), %edi
	movl	8(%rbx), %esi
	movq	(%rbx), %rax
	leaq	(%rax,%r12), %rdx
	addq	$4, %rdx
	movq	_MAX_TS_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r8d, %r8d
	callq	_AllocateRingBuffers
	testl	%eax, %eax
	je	LBB0_19
	jmp	LBB0_21
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_OVERFLOW_BUFFER_SIZE,4,2       ## @OVERFLOW_BUFFER_SIZE
	.comm	_STREAM_VIDEOIN1,4,2            ## @STREAM_VIDEOIN1
	.comm	_MAX_STREAM,4,2                 ## @MAX_STREAM
	.comm	_KSSTATE_STOP,4,2               ## @KSSTATE_STOP
	.comm	_NGENE_IO_TV,4,2                ## @NGENE_IO_TV
	.comm	_NGENE_IO_HDTV,4,2              ## @NGENE_IO_HDTV
	.comm	_NGENE_IO_AIN,4,2               ## @NGENE_IO_AIN
	.comm	_RingBufferSizes,8,3            ## @RingBufferSizes
	.comm	_Buffer1Sizes,8,3               ## @Buffer1Sizes
	.comm	_Buffer2Sizes,8,3               ## @Buffer2Sizes
	.comm	_MAX_HDTV_BUFFER_SIZE,4,2       ## @MAX_HDTV_BUFFER_SIZE
	.comm	_NGENE_IO_TSIN,4,2              ## @NGENE_IO_TSIN
	.comm	_NGENE_IO_TSOUT,4,2             ## @NGENE_IO_TSOUT
	.comm	_RING_SIZE_TS,4,2               ## @RING_SIZE_TS
	.comm	_MAX_TS_BUFFER_SIZE,4,2         ## @MAX_TS_BUFFER_SIZE
	.no_dead_strip	_AllocCommonBuffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function AllocCommonBuffers
lCPI0_0:
	.quad	512                             ; 0x200
	.quad	256                             ; 0x100
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_AllocCommonBuffers:                    ; @AllocCommonBuffers
	.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
	mov	x19, x0
	ldr	w0, [x0, #12]
	add	x2, x19, #64
	mov	w1, #4096
	bl	_pci_alloc_consistent
	str	x0, [x19, #32]
	cbz	x0, LBB0_19
; %bb.1:
	str	x0, [x19, #56]
	dup.2d	v0, x0
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	q1, [x8, lCPI0_0@PAGEOFF]
	add.2d	v0, v0, v1
	stur	q0, [x19, #40]
	ldr	w0, [x19, #12]
Lloh2:
	adrp	x8, _OVERFLOW_BUFFER_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OVERFLOW_BUFFER_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, x19, #8
	bl	_pci_zalloc_consistent
	str	w0, [x19, #24]
	cbz	w0, LBB0_19
; %bb.2:
Lloh5:
	adrp	x8, _STREAM_VIDEOIN1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _STREAM_VIDEOIN1@GOTPAGEOFF]
Lloh7:
	ldrsw	x20, [x8]
Lloh8:
	adrp	x21, _MAX_STREAM@GOTPAGE
Lloh9:
	ldr	x21, [x21, _MAX_STREAM@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w20, w8
	b.ge	LBB0_20
; %bb.3:
	mov	w0, #0
Lloh10:
	adrp	x23, _NGENE_IO_TV@GOTPAGE
Lloh11:
	ldr	x23, [x23, _NGENE_IO_TV@GOTPAGEOFF]
	mov	w24, #12
	bfi	x24, x20, #4, #60
Lloh12:
	adrp	x25, _NGENE_IO_HDTV@GOTPAGE
Lloh13:
	ldr	x25, [x25, _NGENE_IO_HDTV@GOTPAGEOFF]
Lloh14:
	adrp	x26, _NGENE_IO_AIN@GOTPAGE
Lloh15:
	ldr	x26, [x26, _NGENE_IO_AIN@GOTPAGEOFF]
Lloh16:
	adrp	x28, _NGENE_IO_TSOUT@GOTPAGE
Lloh17:
	ldr	x28, [x28, _NGENE_IO_TSOUT@GOTPAGEOFF]
Lloh18:
	adrp	x27, _MAX_TS_BUFFER_SIZE@GOTPAGE
Lloh19:
	ldr	x27, [x27, _MAX_TS_BUFFER_SIZE@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19]
	add	x8, x8, x24
	sub	x0, x8, #8
	sub	x1, x8, #12
	bl	_FillTSIdleBuffer
	mov	w0, #0
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x21]
	add	x24, x24, #16
	cmp	x20, x8
	b.ge	LBB0_21
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	ldr	w22, [x8, x20, lsl #2]
Lloh20:
	adrp	x8, _KSSTATE_STOP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _KSSTATE_STOP@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x8]
	ldr	x8, [x19]
	str	w9, [x8, x24]
	ldr	w9, [x23]
	ldr	w10, [x25]
	orr	w9, w10, w9
	ldr	w10, [x26]
	orr	w9, w9, w10
	tst	w9, w22
	b.eq	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #12]
	add	x8, x8, x24
	sub	x1, x8, #4
Lloh23:
	adrp	x8, _RingBufferSizes@GOTPAGE
Lloh24:
	ldr	x8, [x8, _RingBufferSizes@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	ldr	w2, [x8, x20, lsl #2]
	bl	_create_ring_buffer
	tbnz	w0, #31, LBB0_21
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x23]
	ldr	w9, [x26]
	orr	w8, w9, w8
	tst	w8, w22
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldp	w1, w0, [x19, #8]
	ldr	x8, [x19]
	add	x8, x8, x24
	sub	x2, x8, #4
Lloh26:
	adrp	x8, _Buffer1Sizes@GOTPAGE
Lloh27:
	ldr	x8, [x8, _Buffer1Sizes@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	lsl	x9, x20, #2
	ldr	w3, [x8, x9]
Lloh29:
	adrp	x8, _Buffer2Sizes@GOTPAGE
Lloh30:
	ldr	x8, [x8, _Buffer2Sizes@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	ldr	w4, [x8, x9]
	bl	_AllocateRingBuffers
	tbz	w0, #31, LBB0_12
	b	LBB0_21
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x25]
	tst	w8, w22
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	ldp	w1, w0, [x19, #8]
	ldr	x8, [x19]
	add	x8, x8, x24
	sub	x2, x8, #4
Lloh32:
	adrp	x8, _MAX_HDTV_BUFFER_SIZE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MAX_HDTV_BUFFER_SIZE@GOTPAGEOFF]
Lloh34:
	ldr	w3, [x8]
	mov	w4, #0
	bl	_AllocateRingBuffers
	tbnz	w0, #31, LBB0_21
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh35:
	adrp	x8, _NGENE_IO_TSIN@GOTPAGE
Lloh36:
	ldr	x8, [x8, _NGENE_IO_TSIN@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x8]
	ldr	w8, [x28]
	orr	w9, w8, w9
	tst	w9, w22
	b.eq	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #12]
	ldr	x8, [x19]
	add	x8, x8, x24
	sub	x1, x8, #12
Lloh38:
	adrp	x8, _RING_SIZE_TS@GOTPAGE
Lloh39:
	ldr	x8, [x8, _RING_SIZE_TS@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x8]
	bl	_create_ring_buffer
	tbnz	w0, #31, LBB0_21
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	ldp	w1, w0, [x19, #8]
	ldr	x8, [x19]
	add	x8, x8, x24
	sub	x2, x8, #12
	ldr	w3, [x27]
	mov	w4, #0
	bl	_AllocateRingBuffers
	cbnz	w0, LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x28]
LBB0_16:                                ;   in Loop: Header=BB0_6 Depth=1
	tst	w8, w22
	b.eq	LBB0_5
; %bb.17:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #12]
	ldr	x8, [x19]
	add	x8, x8, x24
	sub	x1, x8, #8
	mov	w2, #1
	bl	_create_ring_buffer
	tbnz	w0, #31, LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_6 Depth=1
	ldp	w1, w0, [x19, #8]
	ldr	x8, [x19]
	add	x8, x8, x24
	sub	x2, x8, #8
	ldr	w3, [x27]
	mov	w4, #0
	bl	_AllocateRingBuffers
	cbz	w0, LBB0_4
	b	LBB0_21
LBB0_19:
Lloh41:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_20:
	mov	w0, #0
LBB0_21:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpAdrp	Lloh0, Lloh2
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_OVERFLOW_BUFFER_SIZE,4,2       ; @OVERFLOW_BUFFER_SIZE
	.comm	_STREAM_VIDEOIN1,4,2            ; @STREAM_VIDEOIN1
	.comm	_MAX_STREAM,4,2                 ; @MAX_STREAM
	.comm	_KSSTATE_STOP,4,2               ; @KSSTATE_STOP
	.comm	_NGENE_IO_TV,4,2                ; @NGENE_IO_TV
	.comm	_NGENE_IO_HDTV,4,2              ; @NGENE_IO_HDTV
	.comm	_NGENE_IO_AIN,4,2               ; @NGENE_IO_AIN
	.comm	_RingBufferSizes,8,3            ; @RingBufferSizes
	.comm	_Buffer1Sizes,8,3               ; @Buffer1Sizes
	.comm	_Buffer2Sizes,8,3               ; @Buffer2Sizes
	.comm	_MAX_HDTV_BUFFER_SIZE,4,2       ; @MAX_HDTV_BUFFER_SIZE
	.comm	_NGENE_IO_TSIN,4,2              ; @NGENE_IO_TSIN
	.comm	_NGENE_IO_TSOUT,4,2             ; @NGENE_IO_TSOUT
	.comm	_RING_SIZE_TS,4,2               ; @RING_SIZE_TS
	.comm	_MAX_TS_BUFFER_SIZE,4,2         ; @MAX_TS_BUFFER_SIZE
	.no_dead_strip	_AllocCommonBuffers
.subsections_via_symbols
