	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_instruction_complete
_wait_instruction_complete:             ## @wait_instruction_complete
	.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
	pushq	%rax
	.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, %r12
	xorl	%eax, %eax
	callq	_get_cycles
	movq	%rax, %r15
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	%r12, %rdi
	callq	_GET_MSEG_HANDLE_STATUS
	movq	_CCHSTATUS_ACTIVE@GOTPCREL(%rip), %r13
	cmpl	(%r13), %eax
	jne	LBB0_1
## %bb.2:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	_GRU_OPERATION_TIMEOUT@GOTPCREL(%rip), %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	%r12, %rdi
	callq	_GET_MSEG_HANDLE_STATUS
	cmpl	(%r13), %eax
	jne	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rbx
	xorl	%eax, %eax
	callq	_get_cycles
	subq	%r15, %rax
	cmpq	%rax, %rbx
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	callq	_report_instruction_timeout
	xorl	%eax, %eax
	callq	_get_cycles
	movq	%rax, %r15
	jmp	LBB0_5
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_6:
	movl	%eax, %ebx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_7:
	movq	_gru_options@GOTPCREL(%rip), %rax
	movq	_OPT_STATS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_get_cycles
	subq	%r15, %rax
	movl	%r14d, %edi
	movq	%rax, %rsi
	callq	_update_mcs_stats
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CCHSTATUS_ACTIVE,4,2           ## @CCHSTATUS_ACTIVE
	.comm	_GRU_OPERATION_TIMEOUT,8,3      ## @GRU_OPERATION_TIMEOUT
	.comm	_gru_options,4,2                ## @gru_options
	.comm	_OPT_STATS,4,2                  ## @OPT_STATS
	.no_dead_strip	_wait_instruction_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_instruction_complete
_wait_instruction_complete:             ; @wait_instruction_complete
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
	mov	x21, x0
	bl	_get_cycles
	mov	x20, x0
	bl	_cpu_relax
	mov	x0, x21
	bl	_GET_MSEG_HANDLE_STATUS
Lloh0:
	adrp	x23, _CCHSTATUS_ACTIVE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CCHSTATUS_ACTIVE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.1:
Lloh2:
	adrp	x24, _GRU_OPERATION_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GRU_OPERATION_TIMEOUT@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_cpu_relax
	mov	x0, x21
	bl	_GET_MSEG_HANDLE_STATUS
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x24]
	bl	_get_cycles
	sub	x8, x0, x20
	cmp	x22, x8
	b.hs	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_report_instruction_timeout
	bl	_get_cycles
	mov	x20, x0
	b	LBB0_2
LBB0_5:
	mov	x22, x0
Lloh4:
	adrp	x8, _gru_options@GOTPAGE
Lloh5:
	ldr	x8, [x8, _gru_options@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _OPT_STATS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _OPT_STATS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	bl	_get_cycles
	sub	x1, x0, x20
	mov	x0, x19
	bl	_update_mcs_stats
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_CCHSTATUS_ACTIVE,4,2           ; @CCHSTATUS_ACTIVE
	.comm	_GRU_OPERATION_TIMEOUT,8,3      ; @GRU_OPERATION_TIMEOUT
	.comm	_gru_options,4,2                ; @gru_options
	.comm	_OPT_STATS,4,2                  ; @OPT_STATS
	.no_dead_strip	_wait_instruction_complete
.subsections_via_symbols
