	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_helper_alloc_dpb_bufs    ## -- Begin function venus_helper_alloc_dpb_bufs
	.p2align	4, 0x90
_venus_helper_alloc_dpb_bufs:           ## @venus_helper_alloc_dpb_bufs
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 16(%rdi)
	je	LBB0_14
## %bb.1:
	movq	%rdi, %r13
	movq	24(%rdi), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%rcx), %r14d
	movl	(%rdi), %r15d
	movq	_HFI_BUFFER_OUTPUT@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_3
## %bb.2:
	leaq	4(%r13), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_HFI_BUFFER_OUTPUT2@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_14
## %bb.4:
	leaq	8(%r13), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_14
## %bb.6:
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_venus_helper_get_bufreq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.7:
	leaq	-48(%rbp), %rdi
	movl	%r14d, %esi
	callq	_HFI_BUFREQ_COUNT_MIN
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	movl	%eax, %ebx
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	leaq	12(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, %r14
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, (%r14)
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, 4(%r14)
	movq	_DMA_ATTR_NO_KERNEL_MAPPING@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_DMA_ATTR_WRITE_COMBINE@GOTPCREL(%rip), %rax
	orl	(%rax), %r8d
	movl	%r8d, 8(%r14)
	leaq	20(%r14), %rdx
	movq	%r15, %r12
	movl	(%r15), %ecx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_alloc_attrs
	movl	%eax, 16(%r14)
	testl	%eax, %eax
	je	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	addq	$12, %r14
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_list_add_tail
	decl	%ebx
	movq	%r12, %r15
	jne	LBB0_9
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r14, %rdi
	callq	_kfree
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_venus_helper_free_dpb_bufs
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_HFI_BUFFER_OUTPUT,8,3          ## @HFI_BUFFER_OUTPUT
	.comm	_HFI_BUFFER_OUTPUT2,8,3         ## @HFI_BUFFER_OUTPUT2
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_ATTR_WRITE_COMBINE,4,2     ## @DMA_ATTR_WRITE_COMBINE
	.comm	_DMA_ATTR_NO_KERNEL_MAPPING,4,2 ## @DMA_ATTR_NO_KERNEL_MAPPING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_helper_alloc_dpb_bufs    ; -- Begin function venus_helper_alloc_dpb_bufs
	.p2align	2
_venus_helper_alloc_dpb_bufs:           ; @venus_helper_alloc_dpb_bufs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_11
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #24]
	ldp	x8, x20, [x8]
	ldr	w23, [x8]
	ldr	w21, [x0]
Lloh0:
	adrp	x8, _HFI_BUFFER_OUTPUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HFI_BUFFER_OUTPUT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ne	LBB0_3
; %bb.2:
	add	x8, x19, #4
	ldr	w22, [x8]
	cbnz	w22, LBB0_5
	b	LBB0_11
LBB0_3:
Lloh3:
	adrp	x8, _HFI_BUFFER_OUTPUT2@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HFI_BUFFER_OUTPUT2@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ne	LBB0_11
; %bb.4:
	add	x8, x19, #8
	ldr	w22, [x8]
	cbz	w22, LBB0_11
LBB0_5:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_venus_helper_get_bufreq
	mov	x25, x0
	cbnz	w0, LBB0_12
; %bb.6:
	add	x0, sp, #8
	mov	x1, x23
	bl	_HFI_BUFREQ_COUNT_MIN
	cbz	w0, LBB0_11
; %bb.7:
	mov	x23, x0
	add	x24, x19, #12
Lloh6:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	adrp	x27, _DMA_ATTR_WRITE_COMBINE@GOTPAGE
Lloh9:
	ldr	x27, [x27, _DMA_ATTR_WRITE_COMBINE@GOTPAGEOFF]
Lloh10:
	adrp	x28, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGE
Lloh11:
	ldr	x28, [x28, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x25, x0
	stp	w21, w22, [x0]
	ldr	w8, [x27]
	ldr	w9, [x28]
	orr	w4, w9, w8
	str	w4, [x0, #8]
	add	x2, x0, #20
	ldr	w3, [x26]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_alloc_attrs
	str	w0, [x25, #16]
	cbz	w0, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x0, x25, #12
	mov	x1, x24
	bl	_list_add_tail
	mov	w25, #0
	subs	w23, w23, #1
	b.ne	LBB0_8
	b	LBB0_12
LBB0_11:
	mov	w25, #0
LBB0_12:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
	mov	x0, x25
	bl	_kfree
LBB0_14:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w25, w8
	mov	x0, x19
	bl	_venus_helper_free_dpb_bufs
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_HFI_BUFFER_OUTPUT,8,3          ; @HFI_BUFFER_OUTPUT
	.comm	_HFI_BUFFER_OUTPUT2,8,3         ; @HFI_BUFFER_OUTPUT2
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_ATTR_WRITE_COMBINE,4,2     ; @DMA_ATTR_WRITE_COMBINE
	.comm	_DMA_ATTR_NO_KERNEL_MAPPING,4,2 ; @DMA_ATTR_NO_KERNEL_MAPPING
.subsections_via_symbols
