	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_rm_reserve                 ## -- Begin function dpu_rm_reserve
	.p2align	4, 0x90
_dpu_rm_reserve:                        ## @dpu_rm_reserve
	.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
	movl	%r8d, %r12d
	movl	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	%rdx, %rdi
	callq	_drm_atomic_crtc_needs_modeset
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%r15), %esi
	movq	(%rbx), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %ecx
	callq	_DRM_DEBUG_KMS
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movl	%r13d, %r8d
	callq	__dpu_rm_populate_requirements
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DPU_ERROR
	jmp	LBB0_9
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_10
LBB0_4:
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	__dpu_rm_make_reservation
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DPU_ERROR
	jmp	LBB0_8
LBB0_6:
	xorl	%r13d, %r13d
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.7:
	movl	(%r15), %esi
	leaq	L_.str.3(%rip), %rdi
	callq	_DPU_DEBUG
LBB0_8:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	__dpu_rm_release_reservation
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reserving hw for enc %d crtc %d test_only %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to populate hw requirements\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to reserve hw resources: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"test_only: discard test [enc: %d]\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_rm_reserve                 ; -- Begin function dpu_rm_reserve
	.p2align	2
_dpu_rm_reserve:                        ; @dpu_rm_reserve
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	mov	x0, x2
	bl	_drm_atomic_crtc_needs_modeset
	cbz	w0, LBB0_3
; %bb.1:
	ldr	w1, [x20]
	ldr	x8, [x23]
	ldr	w2, [x8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x21
	bl	_DRM_DEBUG_KMS
	mov	x0, x19
	bl	_mutex_lock
	and	x4, x22, #0xffffffff
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	__dpu_rm_populate_requirements
	cbz	w0, LBB0_4
; %bb.2:
	mov	x22, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPU_ERROR
	b	LBB0_9
LBB0_3:
	mov	w22, #0
	b	LBB0_10
LBB0_4:
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	__dpu_rm_make_reservation
	cbz	w0, LBB0_6
; %bb.5:
	mov	x22, x0
	str	x22, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DPU_ERROR
	ldr	w1, [x20]
	mov	x0, x19
	bl	__dpu_rm_release_reservation
	b	LBB0_9
LBB0_6:
	cbz	w21, LBB0_8
; %bb.7:
	ldr	w1, [x20]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DPU_DEBUG
	ldr	w1, [x20]
	mov	x0, x19
	bl	__dpu_rm_release_reservation
LBB0_8:
	mov	w22, #0
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reserving hw for enc %d crtc %d test_only %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to populate hw requirements\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to reserve hw resources: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"test_only: discard test [enc: %d]\n"

.subsections_via_symbols
