	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lima_gem_lock_bos
_lima_gem_lock_bos:                     ## @lima_gem_lock_bos
	.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, %r15d
	movq	%rdi, %rbx
	movq	_reservation_ww_class@GOTPCREL(%rip), %rsi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rdi
	callq	_ww_acquire_init
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.1:
	movl	%r15d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$-1, %r14d
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r14d, %eax
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movl	%eax, %r14d
	cmpq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	je	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movl	%r14d, %r12d
	movl	$-1, %eax
	cmpq	%r12, %r13
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx,%r13,8), %rax
	movq	(%rax), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ww_mutex_lock_interruptible
	testl	%eax, %eax
	jns	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r15d
	movl	%r13d, %eax
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	testl	%r13d, %r13d
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-16(%rbx,%r13,8), %rax
	movq	(%rax), %rdi
	callq	_ww_mutex_unlock
	decq	%r13
	cmpq	$1, %r13
	jg	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	testl	%r14d, %r14d
	js	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx,%r12,8), %rax
	movq	(%rax), %rdi
	callq	_ww_mutex_unlock
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %eax
	movq	(%rbx,%rax,8), %rax
	movq	(%rax), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ww_mutex_lock_slow_interruptible
	movl	$0, %r13d
	testl	%eax, %eax
	je	LBB0_2
## %bb.14:
	movl	%eax, %r15d
LBB0_15:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ww_acquire_fini
	jmp	LBB0_16
LBB0_6:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ww_acquire_done
	xorl	%r15d, %r15d
LBB0_16:
	movl	%r15d, %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
	.no_dead_strip	_lima_gem_lock_bos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lima_gem_lock_bos
_lima_gem_lock_bos:                     ; @lima_gem_lock_bos
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x1, _reservation_ww_class@GOTPAGE
Lloh1:
	ldr	x1, [x1, _reservation_ww_class@GOTPAGEOFF]
	mov	x0, x2
	bl	_ww_acquire_init
	cmp	w21, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x23, #0
	sub	x22, x20, #8
	mov	w26, #-1
	mov	w24, w21
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w26, #-1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	cmp	x23, x24
	b.eq	LBB0_14
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	w28, w26
	cmp	x23, x28
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, x23, lsl #3]
	ldr	x0, [x8]
	mov	x1, x19
	bl	_ww_mutex_lock_interruptible
	tbz	w0, #31, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, x0
	mov	x27, x23
	mov	x25, x23
	cbz	w23, LBB0_8
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, x25, lsl #3]
	ldr	x0, [x8]
	bl	_ww_mutex_unlock
	subs	x25, x25, #1
	b.gt	LBB0_7
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	tbnz	w26, #31, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, x28, lsl #3]
	ldr	x0, [x8]
	bl	_ww_mutex_unlock
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh2:
	adrp	x8, _EDEADLK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EDEADLK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmn	w21, w8
	b.ne	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	and	x8, x23, #0xffffffff
	ldr	x8, [x20, x8, lsl #3]
	ldr	x0, [x8]
	mov	x1, x19
	bl	_ww_mutex_lock_slow_interruptible
	mov	x23, #0
	mov	x26, x27
	cbz	w0, LBB0_4
; %bb.12:
	mov	x21, x0
LBB0_13:
	mov	x0, x19
	bl	_ww_acquire_fini
	b	LBB0_15
LBB0_14:
	mov	x0, x19
	bl	_ww_acquire_done
	mov	w21, #0
LBB0_15:
	mov	x0, x21
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_reservation_ww_class,4,2       ; @reservation_ww_class
	.comm	_EDEADLK,4,2                    ; @EDEADLK
	.no_dead_strip	_lima_gem_lock_bos
.subsections_via_symbols
