	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lock_sem_sw_reset
_lock_sem_sw_reset:                     ## @lock_sem_sw_reset
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_mlx5_core_is_pf
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	%r14, %rdi
	callq	_mlx5_vsc_gw_lock
	movl	%eax, %ebx
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_5:
	testl	%ebx, %ebx
	jne	LBB0_12
## %bb.6:
	testl	%r15d, %r15d
	jne	LBB0_7
## %bb.8:
	movq	_MLX5_VSC_UNLOCK@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_MLX5_VSC_LOCK@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %edx
	movq	_MLX5_SEMAPHORE_SW_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mlx5_vsc_sem_set_space
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_mlx5_core_warn
LBB0_11:
	movq	%r14, %rdi
	callq	_mlx5_vsc_gw_unlock
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX5_VSC_LOCK,4,2              ## @MLX5_VSC_LOCK
	.comm	_MLX5_VSC_UNLOCK,4,2            ## @MLX5_VSC_UNLOCK
	.comm	_MLX5_SEMAPHORE_SW_RESET,4,2    ## @MLX5_SEMAPHORE_SW_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to lock SW reset semaphore\n"

	.no_dead_strip	_lock_sem_sw_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lock_sem_sw_reset
_lock_sem_sw_reset:                     ; @lock_sem_sw_reset
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_mlx5_core_is_pf
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_mlx5_vsc_gw_lock
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_5:
	mov	x20, x0
	cbnz	w0, LBB0_9
; %bb.6:
Lloh7:
	adrp	x8, _MLX5_VSC_LOCK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MLX5_VSC_LOCK@GOTPAGEOFF]
Lloh9:
	adrp	x9, _MLX5_VSC_UNLOCK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MLX5_VSC_UNLOCK@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x9, x8, eq
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _MLX5_SEMAPHORE_SW_RESET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MLX5_SEMAPHORE_SW_RESET@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mlx5_vsc_sem_set_space
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mlx5_core_warn
LBB0_8:
	mov	x0, x19
	bl	_mlx5_vsc_gw_unlock
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX5_VSC_LOCK,4,2              ; @MLX5_VSC_LOCK
	.comm	_MLX5_VSC_UNLOCK,4,2            ; @MLX5_VSC_UNLOCK
	.comm	_MLX5_SEMAPHORE_SW_RESET,4,2    ; @MLX5_SEMAPHORE_SW_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to lock SW reset semaphore\n"

	.no_dead_strip	_lock_sem_sw_reset
.subsections_via_symbols
