	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _dpu_rm_reserve_lms
__dpu_rm_reserve_lms:                   ## @_dpu_rm_reserve_lms
	.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	%rdx, %rbx
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_BLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,8), %r15
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rbx)
	je	LBB0_21
## %bb.1:
	movq	_DPU_HW_BLK_LM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_dpu_rm_init_hw_iter
	cmpl	$0, (%rbx)
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_17
## %bb.2:
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	__dpu_rm_get_hw_locked
	testq	%rax, %rax
	je	LBB0_16
## %bb.3:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	shll	$3, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##       Child Loop BB0_9 Depth 3
	movq	%r13, %rdi
	xorl	%esi, %esi
	movq	%rbx, %r15
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_memset
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	movq	%r15, %rbx
	callq	_memset
	movq	-56(%rbp), %rcx
	movq	%rcx, (%r13)
	movq	%r12, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	movq	%r14, %r8
	xorl	%r9d, %r9d
	callq	__dpu_rm_check_lm_and_get_connected_blks
	movl	$0, %r14d
	testl	%eax, %eax
	je	LBB0_14
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_DPU_HW_BLK_LM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	callq	_dpu_rm_init_hw_iter
	movl	$1, %r14d
	cmpl	$1, (%rbx)
	je	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %r14d
LBB0_7:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_9 Depth 3
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,8), %r15
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=3
	movl	(%rbx), %eax
	cmpq	%rax, %r14
	je	LBB0_13
LBB0_9:                                 ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_7 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r12, %rdi
	leaq	-96(%rbp), %rsi
	callq	__dpu_rm_get_hw_locked
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=3
	movq	-56(%rbp), %r9
	movq	-96(%rbp), %rcx
	cmpq	%rcx, %r9
	je	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=3
	movq	%r12, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r15, %r8
	callq	__dpu_rm_check_lm_and_get_connected_blks
	testl	%eax, %eax
	je	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	-96(%rbp), %rax
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%rax, (%r13,%r14,8)
	incq	%r14
	movl	(%rbx), %eax
	cmpq	%rax, %r14
	jne	LBB0_7
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %r13                 ## 8-byte Reload
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	(%rbx), %r14d
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	leaq	-56(%rbp), %rsi
	callq	__dpu_rm_get_hw_locked
	testq	%rax, %rax
	jne	LBB0_4
LBB0_16:
	cmpl	(%rbx), %r14d
	jne	LBB0_22
LBB0_17:
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jle	LBB0_24
## %bb.18:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%rbx,8), %rax
	testq	%rax, %rax
	je	LBB0_24
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	%rsi, 8(%rax)
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%rbx,8), %rax
	movq	%rsi, 8(%rax)
	movq	(%r13,%rbx,8), %rax
	movl	(%rax), %edi
	movq	(%rcx,%rbx,8), %rax
	movl	(%rax), %edx
	callq	_trace_dpu_rm_reserve_lms
	incq	%rbx
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_19
	jmp	LBB0_24
LBB0_21:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_DPU_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_22:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPU_DEBUG
	movq	_ENAVAIL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_23:
	subl	(%rax), %r14d
LBB0_24:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_26
## %bb.25:
	movl	%r14d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_BLOCKS,4,2                 ## @MAX_BLOCKS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid number of lm: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DPU_HW_BLK_LM,4,2              ## @DPU_HW_BLK_LM
L_.str.1:                               ## @.str.1
	.asciz	"unable to find appropriate mixers\n"

	.comm	_ENAVAIL,4,2                    ## @ENAVAIL
	.no_dead_strip	__dpu_rm_reserve_lms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _dpu_rm_reserve_lms
__dpu_rm_reserve_lms:                   ; @_dpu_rm_reserve_lms
	.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
	sub	sp, sp, #32
	mov	x22, x2
	mov	x19, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _MAX_BLOCKS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_BLOCKS@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
	lsl	x8, x24, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0xffffffff0
	sub	x20, x9, x12
	mov	sp, x20
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x21, x8, x12
	mov	sp, x21
	ldr	w8, [x2]
	cbz	w8, LBB0_15
; %bb.1:
Lloh10:
	adrp	x26, _DPU_HW_BLK_LM@GOTPAGE
Lloh11:
	ldr	x26, [x26, _DPU_HW_BLK_LM@GOTPAGEOFF]
	ldr	w2, [x26]
	sub	x0, x29, #96
	mov	w1, #0
	bl	_dpu_rm_init_hw_iter
	ldr	w8, [x22]
	cbz	w8, LBB0_18
; %bb.2:
	sub	x1, x29, #96
	mov	x0, x23
	bl	__dpu_rm_get_hw_locked
	cbz	x0, LBB0_16
; %bb.3:
	lsl	w24, w24, #3
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;       Child Loop BB0_8 Depth 3
	mov	x0, x20
	mov	w1, #0
	mov	x2, x24
	bl	_memset
	mov	x0, x21
	mov	w1, #0
	mov	x2, x24
	bl	_memset
	ldur	x3, [x29, #-96]
	str	x3, [x20]
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	mov	x4, x21
	mov	x5, #0
	bl	__dpu_rm_check_lm_and_get_connected_blks
	cbz	w0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x26]
	sub	x0, x29, #104
	mov	w1, #0
	bl	_dpu_rm_init_hw_iter
	ldr	w8, [x22]
	mov	w27, #1
	cmp	w8, #1
	b.eq	LBB0_13
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_8 Depth 3
	add	x25, x21, x27, lsl #3
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=3
	ldr	w8, [x22]
	cmp	x27, x8
	b.eq	LBB0_13
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	sub	x1, x29, #104
	mov	x0, x23
	bl	__dpu_rm_get_hw_locked
	cbz	x0, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=3
	ldp	x3, x5, [x29, #-104]
	cmp	x5, x3
	b.eq	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=3
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	mov	x4, x25
	bl	__dpu_rm_check_lm_and_get_connected_blks
	cbz	w0, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=2
	ldur	x8, [x29, #-104]
	str	x8, [x20, x27, lsl #3]
	add	x27, x27, #1
	ldr	w8, [x22]
	cmp	x27, x8
	b.ne	LBB0_6
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #0
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	cmp	w27, w8
	b.eq	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	sub	x1, x29, #96
	mov	x0, x23
	bl	__dpu_rm_get_hw_locked
	cbnz	x0, LBB0_4
	b	LBB0_17
LBB0_15:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	bl	_DPU_ERROR
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_24
LBB0_16:
	mov	w27, #0
LBB0_17:
	ldr	w8, [x22]
	cmp	w27, w8
	b.ne	LBB0_23
LBB0_18:
	mov	x0, x20
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_22
; %bb.19:
	mov	x22, #0
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, x22, lsl #3]
	cbz	x8, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	str	x19, [x8, #8]
	lsl	x8, x22, #3
	ldr	x9, [x21, x8]
	str	x19, [x9, #8]
	ldr	x9, [x20, x8]
	ldr	w0, [x9]
	ldr	x8, [x21, x8]
	ldr	w2, [x8]
	mov	x1, x19
	bl	_trace_dpu_rm_reserve_lms
	add	x22, x22, #1
	mov	x0, x20
	bl	_ARRAY_SIZE
	cmp	x22, w0, sxtw
	b.lt	LBB0_20
LBB0_22:
	mov	w0, #0
	b	LBB0_25
LBB0_23:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPU_DEBUG
Lloh18:
	adrp	x8, _ENAVAIL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENAVAIL@GOTPAGEOFF]
LBB0_24:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_25:
	ldur	x8, [x29, #-88]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.26:
	sub	sp, x29, #80
	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
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_BLOCKS,4,2                 ; @MAX_BLOCKS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid number of lm: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DPU_HW_BLK_LM,4,2              ; @DPU_HW_BLK_LM
l_.str.1:                               ; @.str.1
	.asciz	"unable to find appropriate mixers\n"

	.comm	_ENAVAIL,4,2                    ; @ENAVAIL
	.no_dead_strip	__dpu_rm_reserve_lms
.subsections_via_symbols
