	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_vsc_gw_lock               ## -- Begin function mlx5_vsc_gw_lock
	.p2align	4, 0x90
_mlx5_vsc_gw_lock:                      ## @mlx5_vsc_gw_lock
	.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	%rdi, %r12
	movq	$0, -48(%rbp)
	movl	(%rdi), %edi
	callq	_pci_cfg_access_lock
	movl	$-1, %r13d
	movq	_VSC_SEMAPHORE_OFFSET@GOTPCREL(%rip), %r15
	leaq	-56(%rbp), %r14
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	-48(%rbp), %rax
	cmpq	-56(%rbp), %rax
	je	LBB0_7
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	incl	%r13d
	movq	_VSC_MAX_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jg	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_vsc_read
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, -56(%rbp)
	jne	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_VSC_COUNTER_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	-48(%rbp), %rdx
	callq	_vsc_read
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %esi
	movq	-48(%rbp), %rdx
	movq	%r12, %rdi
	callq	_vsc_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_vsc_read
	testl	%eax, %eax
	je	LBB0_6
LBB0_11:
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_2:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	(%r12), %edi
	callq	_pci_cfg_access_unlock
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VSC_MAX_RETRIES,4,2            ## @VSC_MAX_RETRIES
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_VSC_SEMAPHORE_OFFSET,4,2       ## @VSC_SEMAPHORE_OFFSET
	.comm	_VSC_COUNTER_OFFSET,4,2         ## @VSC_COUNTER_OFFSET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_vsc_gw_lock               ; -- Begin function mlx5_vsc_gw_lock
	.p2align	2
_mlx5_vsc_gw_lock:                      ; @mlx5_vsc_gw_lock
	.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	x19, x0
	str	xzr, [sp, #8]
	ldr	w0, [x0]
	bl	_pci_cfg_access_lock
	mov	w21, #-1
Lloh0:
	adrp	x22, _VSC_MAX_RETRIES@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VSC_MAX_RETRIES@GOTPAGEOFF]
Lloh2:
	adrp	x23, _VSC_SEMAPHORE_OFFSET@GOTPAGE
Lloh3:
	ldr	x23, [x23, _VSC_SEMAPHORE_OFFSET@GOTPAGEOFF]
Lloh4:
	adrp	x24, _VSC_COUNTER_OFFSET@GOTPAGE
Lloh5:
	ldr	x24, [x24, _VSC_COUNTER_OFFSET@GOTPAGEOFF]
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldp	x9, x8, [sp]
	cmp	x8, x9
	b.eq	LBB0_10
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	add	w21, w21, #1
	cmp	w21, w8
	b.gt	LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x23]
	mov	x2, sp
	mov	x0, x19
	bl	_vsc_read
	cbnz	w0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [sp]
	cbnz	x8, LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x24]
	add	x2, sp, #8
	mov	x0, x19
	bl	_vsc_read
	cbnz	w0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x23]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_vsc_write
	cbnz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x23]
	mov	x2, sp
	mov	x0, x19
	bl	_vsc_read
	cbz	w0, LBB0_2
LBB0_9:
	mov	x20, x0
	b	LBB0_12
LBB0_10:
	mov	w20, #0
	b	LBB0_13
LBB0_11:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	ldr	w0, [x19]
	bl	_pci_cfg_access_unlock
LBB0_13:
	mov	x0, x20
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_VSC_MAX_RETRIES,4,2            ; @VSC_MAX_RETRIES
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_VSC_SEMAPHORE_OFFSET,4,2       ; @VSC_SEMAPHORE_OFFSET
	.comm	_VSC_COUNTER_OFFSET,4,2         ; @VSC_COUNTER_OFFSET
.subsections_via_symbols
