	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_lock_bo_reservations
_vc4_lock_bo_reservations:              ## @vc4_lock_bo_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
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_reservation_ww_class@GOTPCREL(%rip), %rsi
	movq	%rdx, %rdi
	callq	_ww_acquire_init
	movl	$-1, %r15d
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
	cmpl	$-1, %r15d
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r12), %rax
	movslq	%r15d, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rdi
	movq	%rbx, %rsi
	callq	_ww_mutex_lock_slow_interruptible
	testl	%eax, %eax
	jne	LBB0_24
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_16
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	xorl	%r15d, %r15d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_7 Depth=2
	movl	(%r12), %eax
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=2
	incq	%r15
	movslq	%eax, %rcx
	cmpq	%rcx, %r15
	jge	LBB0_16
LBB0_7:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r15, %r13
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	8(%r12), %rax
	movq	(%rax,%r15,8), %rax
	movq	(%rax), %rdi
	movq	%rbx, %rsi
	callq	_ww_mutex_lock_interruptible
	testl	%eax, %eax
	je	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %r14d
	movq	%rbx, %r13
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %rdi
	callq	_ww_mutex_unlock
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_11
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	$-1, %ecx
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r15d, %ecx
	jl	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r12), %rax
	movslq	%ecx, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rdi
	callq	_ww_mutex_unlock
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
                                        ## kill: def $r15d killed $r15d killed $r15
	addl	%r14d, %eax
	movq	%r13, %rbx
	je	LBB0_1
	jmp	LBB0_25
LBB0_16:
	movq	%rbx, %rdi
	callq	_ww_acquire_done
	cmpl	$0, (%r12)
	jle	LBB0_21
## %bb.17:
	movq	%rbx, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %rdi
	movl	$1, %esi
	callq	_dma_resv_reserve_shared
	testl	%eax, %eax
	jne	LBB0_22
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_18
LBB0_21:
	xorl	%r14d, %r14d
	jmp	LBB0_23
LBB0_22:
	movl	%eax, %r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_vc4_unlock_bo_reservations
LBB0_23:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movl	%eax, %r14d
LBB0_25:
	movq	%rbx, %rdi
	callq	_ww_acquire_done
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_reservation_ww_class,4,2       ## @reservation_ww_class
	.comm	_EDEADLK,4,2                    ## @EDEADLK
	.no_dead_strip	_vc4_lock_bo_reservations
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_lock_bo_reservations
_vc4_lock_bo_reservations:              ; @vc4_lock_bo_reservations
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	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	w24, #-1
Lloh2:
	adrp	x23, _EDEADLK@GOTPAGE
Lloh3:
	ldr	x23, [x23, _EDEADLK@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
	cmn	w24, #1
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8, w24, sxtw #3]
	ldr	x0, [x8]
	mov	x1, x19
	bl	_ww_mutex_lock_slow_interruptible
	cbnz	w0, LBB0_23
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x25, #0
	mov	w26, w24
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [x20]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x25, x25, #1
	cmp	x25, w8, sxtw
	b.ge	LBB0_16
LBB0_7:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x26, x25
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x25, lsl #3]
	ldr	x0, [x8]
	mov	x1, x19
	bl	_ww_mutex_lock_interruptible
	cbz	w0, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x22, x0
	cbz	w25, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_1 Depth=1
	mov	x26, #0
LBB0_11:                                ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x26, lsl #3]
	ldr	x0, [x8]
	bl	_ww_mutex_unlock
	add	x26, x26, #1
	cmp	x25, x26
	b.ne	LBB0_11
LBB0_12:                                ;   in Loop: Header=BB0_1 Depth=1
	cmn	w24, #1
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_1 Depth=1
	cmp	w24, w25
	b.lt	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8, w24, sxtw #3]
	ldr	x0, [x8]
	bl	_ww_mutex_unlock
LBB0_15:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x23]
	mov	x24, x25
	cmn	w22, w8
	b.eq	LBB0_1
	b	LBB0_24
LBB0_16:
	mov	x0, x19
	bl	_ww_acquire_done
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.17:
	mov	x23, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x23, lsl #3]
	ldr	x0, [x8]
	mov	w1, #1
	bl	_dma_resv_reserve_shared
	cbnz	w0, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x20]
	cmp	x23, x8
	b.lt	LBB0_18
LBB0_20:
	mov	w22, #0
	b	LBB0_22
LBB0_21:
	mov	x22, x0
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_vc4_unlock_bo_reservations
LBB0_22:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_23:
	mov	x22, x0
LBB0_24:
	mov	x0, x19
	bl	_ww_acquire_done
	b	LBB0_22
	.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
	.no_dead_strip	_vc4_lock_bo_reservations
.subsections_via_symbols
