	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intbufs_set_buffer
_intbufs_set_buffer:                    ## @intbufs_set_buffer
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	(%rax), %rbx
	leaq	-72(%rbp), %rdx
	callq	_venus_helper_get_bufreq
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_1
LBB0_12:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	cmpq	$0, -64(%rbp)
	je	LBB0_12
## %bb.2:
	cmpl	$0, -72(%rbp)
	je	LBB0_12
## %bb.3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movl	$32, %edi
	callq	_kzalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-56(%rbp), %eax
	movl	%eax, 28(%rbx)
	movq	-64(%rbp), %rsi
	movq	%rsi, 16(%rbx)
	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, (%rbx)
	leaq	4(%rbx), %rdx
	movl	(%r13), %ecx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_alloc_attrs
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	-96(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	16(%rbx), %rax
	movq	%rax, -80(%rbp)
	movl	28(%rbx), %eax
	movl	%eax, -88(%rbp)
	movl	$1, -96(%rbp)
	movl	4(%rbx), %eax
	movl	%eax, -92(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_hfi_session_set_buffers
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	addq	$24, %rbx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_list_add_tail
	incl	%r12d
	cmpl	-72(%rbp), %r12d
	jb	LBB0_4
## %bb.11:
	xorl	%r14d, %r14d
	jmp	LBB0_12
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_dev_err
	movq	16(%rbx), %rsi
	movl	8(%rbx), %edx
	movl	(%rbx), %r8d
	movl	4(%rbx), %ecx
	movq	%r15, %rdi
	callq	_dma_free_attrs
LBB0_9:
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set session buffers failed\n"

	.no_dead_strip	_intbufs_set_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intbufs_set_buffer
_intbufs_set_buffer:                    ; @intbufs_set_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x0
	ldr	x8, [x0, #8]
	ldr	x19, [x8]
	add	x2, sp, #24
	bl	_venus_helper_get_bufreq
	cbz	w0, LBB0_3
LBB0_1:
	mov	w22, #0
LBB0_2:
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_3:
	ldr	x8, [sp, #32]
	cbz	x8, LBB0_1
; %bb.4:
	ldr	w8, [sp, #24]
	cbz	w8, LBB0_1
; %bb.5:
	mov	w23, #0
Lloh0:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	adrp	x25, _DMA_ATTR_WRITE_COMBINE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _DMA_ATTR_WRITE_COMBINE@GOTPAGEOFF]
	mov	w26, #1
Lloh4:
	adrp	x27, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGE
Lloh5:
	ldr	x27, [x27, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	w0, #32
	bl	_kzalloc
	mov	x21, x0
	cbz	x0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #40]
	str	w8, [x21, #28]
	ldr	x1, [sp, #32]
	str	x1, [x21, #16]
	ldr	w8, [x25]
	ldr	w9, [x27]
	orr	w4, w9, w8
	str	w4, [x21]
	add	x2, x21, #4
	ldr	w3, [x24]
	mov	x0, x19
	bl	_dma_alloc_attrs
	str	w0, [x21, #8]
	cbz	w0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, sp
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	x8, [x21, #16]
	str	x8, [sp, #16]
	ldr	w8, [x21, #28]
	str	w8, [sp, #8]
	ldr	w8, [x21, #4]
	stp	w26, w8, [sp]
	mov	x1, sp
	mov	x0, x20
	bl	_hfi_session_set_buffers
	cbnz	w0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x0, x21, #24
	mov	x1, x20
	bl	_list_add_tail
	add	w23, w23, #1
	ldr	w8, [sp, #24]
	cmp	w23, w8
	b.lo	LBB0_6
	b	LBB0_1
LBB0_10:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_12
LBB0_11:
	mov	x22, x0
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	ldr	x1, [x21, #16]
	ldp	w3, w2, [x21, #4]
	ldr	w4, [x21]
	mov	x0, x19
	bl	_dma_free_attrs
LBB0_12:
	mov	x0, x21
	bl	_kfree
	b	LBB0_2
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set session buffers failed\n"

	.no_dead_strip	_intbufs_set_buffer
.subsections_via_symbols
