	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_lock_reservations      ## -- Begin function drm_gem_lock_reservations
	.p2align	4, 0x90
_drm_gem_lock_reservations:             ## @drm_gem_lock_reservations
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_reservation_ww_class@GOTPCREL(%rip), %rsi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rdi
	callq	_ww_acquire_init
	movl	%r14d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$-1, %r12d
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_10 Depth 2
	cmpl	$-1, %r12d
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movslq	%r12d, %rax
	movq	(%rbx,%rax,8), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_dma_resv_lock_slow_interruptible
	movl	%eax, %r13d
	testl	%r14d, %r14d
	jle	LBB0_17
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%r13d, %r13d
	je	LBB0_5
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%r14d, %r14d
	jle	LBB0_16
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r12d, -56(%rbp)                ## 4-byte Spill
	movl	%r12d, %r12d
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=2
	incq	%r14
	incl	%r15d
	cmpq	%r14, -64(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_16
LBB0_6:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r14, %r12
	je	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	(%rbx,%r14,8), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_dma_resv_lock_interruptible
	testl	%eax, %eax
	je	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %r13d
	testl	%r14d, %r14d
	movq	%rbx, %r12
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r12,%rbx,8), %rax
	movl	(%rax), %edi
	callq	_dma_resv_unlock
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_10
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	cmpl	$-1, %eax
	movq	%r12, %rbx
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r14d, %eax
	jl	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	cltq
	movq	(%rbx,%rax,8), %rax
	movl	(%rax), %edi
	callq	_dma_resv_unlock
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r14d, %r12d
	addl	%r13d, %eax
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_1
	jmp	LBB0_17
LBB0_16:
	xorl	%r13d, %r13d
LBB0_17:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ww_acquire_done
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_reservation_ww_class,4,2       ## @reservation_ww_class
	.comm	_EDEADLK,4,2                    ## @EDEADLK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_lock_reservations      ; -- Begin function drm_gem_lock_reservations
	.p2align	2
_drm_gem_lock_reservations:             ; @drm_gem_lock_reservations
	.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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x1, _reservation_ww_class@GOTPAGE
Lloh1:
	ldr	x1, [x1, _reservation_ww_class@GOTPAGEOFF]
	mov	x0, x2
	bl	_ww_acquire_init
	mov	w23, w20
	mov	w25, #-1
Lloh2:
	adrp	x24, _EDEADLK@GOTPAGE
Lloh3:
	ldr	x24, [x24, _EDEADLK@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
	cmn	w25, #1
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x21, w25, sxtw #3]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_dma_resv_lock_slow_interruptible
	mov	x22, x0
	cmp	w20, #1
	b.lt	LBB0_17
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	cbz	w22, LBB0_5
	b	LBB0_17
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	w20, #1
	b.lt	LBB0_16
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w27, #0
	mov	x26, #0
	mov	w28, w25
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x26, x26, #1
	add	w27, w27, #1
	cmp	x23, x26
	b.eq	LBB0_16
LBB0_7:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x28, x26
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x21, x26, lsl #3]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_dma_resv_lock_interruptible
	cbz	w0, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x22, x0
	cbz	w26, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_1 Depth=1
	mov	w27, w27
	mov	x28, x21
LBB0_11:                                ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x28], #8
	ldr	w0, [x8]
	bl	_dma_resv_unlock
	subs	x27, x27, #1
	b.ne	LBB0_11
LBB0_12:                                ;   in Loop: Header=BB0_1 Depth=1
	cmn	w25, #1
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_1 Depth=1
	cmp	w25, w26
	b.lt	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x21, w25, sxtw #3]
	ldr	w0, [x8]
	bl	_dma_resv_unlock
LBB0_15:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x24]
	mov	x25, x26
	cmn	w22, w8
	b.eq	LBB0_1
	b	LBB0_17
LBB0_16:
	mov	w22, #0
LBB0_17:
	mov	x0, x19
	bl	_ww_acquire_done
	mov	x0, x22
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_reservation_ww_class,4,2       ; @reservation_ww_class
	.comm	_EDEADLK,4,2                    ; @EDEADLK
.subsections_via_symbols
