	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gru_send_message_gpa           ## -- Begin function gru_send_message_gpa
	.p2align	4, 0x90
_gru_send_message_gpa:                  ## @gru_send_message_gpa
	.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	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	_mesq_send@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STAT
	cmpl	$4, %ebx
	setb	%al
	movq	_GRU_CACHE_LINE_BYTES@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	addl	%ecx, %ecx
	cmpl	%ebx, %ecx
	setb	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_BUG_ON
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, %r12d
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movl	%ebx, %edi
	callq	_gru_get_cpu_resources
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_MQE_BUG_NO_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_10
LBB0_2:
	movq	%r15, %rsi
	movq	%r13, %r15
	movq	-48(%rbp), %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movq	-48(%rbp), %rcx
	movq	_MQS_FULL@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movl	%eax, 8(%rcx)
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, (%rcx)
	cmpl	$2, %r12d
	jne	LBB0_4
## %bb.3:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_get_present2
	movl	%eax, 4(%rbx)
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_restore_present2
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_MQIE_AGAIN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MQE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	-56(%rbp), %rbx
	movl	(%r15), %r14d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_gru_get_tri
	movq	_IMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%r15, %rbx
	movl	%eax, %edx
	movl	%r12d, %ecx
	callq	_gru_mesq
	movq	-56(%rbp), %rdi
	callq	_gru_wait
	movq	_CBS_IDLE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rdi
	movq	-48(%rbp), %rdx
	movq	%rbx, %rsi
	movl	%r12d, %ecx
	callq	_send_message_failure
	movl	%eax, %r13d
	jmp	LBB0_6
LBB0_7:
	movq	-56(%rbp), %rdi
	movq	-48(%rbp), %rsi
	callq	_gru_free_cpu_resources
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.9:
	movq	_mesq_send_failed@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STAT
	jmp	LBB0_10
LBB0_8:
	xorl	%r13d, %r13d
LBB0_10:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mesq_send,4,2                  ## @mesq_send
	.comm	_GRU_CACHE_LINE_BYTES,4,2       ## @GRU_CACHE_LINE_BYTES
	.comm	_MQE_BUG_NO_RESOURCES,4,2       ## @MQE_BUG_NO_RESOURCES
	.comm	_MQS_FULL,4,2                   ## @MQS_FULL
	.comm	_MQE_OK,4,2                     ## @MQE_OK
	.comm	_IMA,4,2                        ## @IMA
	.comm	_CBS_IDLE,4,2                   ## @CBS_IDLE
	.comm	_MQIE_AGAIN,4,2                 ## @MQIE_AGAIN
	.comm	_mesq_send_failed,4,2           ## @mesq_send_failed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gru_send_message_gpa           ; -- Begin function gru_send_message_gpa
	.p2align	2
_gru_send_message_gpa:                  ; @gru_send_message_gpa
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _mesq_send@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mesq_send@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_STAT
	cmp	w21, #4
Lloh3:
	adrp	x20, _GRU_CACHE_LINE_BYTES@GOTPAGE
Lloh4:
	ldr	x20, [x20, _GRU_CACHE_LINE_BYTES@GOTPAGEOFF]
	ldr	w8, [x20]
	lsl	w8, w8, #1
	ccmp	w21, w8, #2, hs
	cset	w0, hi
	bl	_BUG_ON
	ldr	w1, [x20]
	mov	x0, x21
	bl	_DIV_ROUND_UP
	mov	x20, x0
	add	x1, sp, #8
	mov	x2, sp
	mov	x0, x21
	bl	_gru_get_cpu_resources
	cbz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _MQE_BUG_NO_RESOURCES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MQE_BUG_NO_RESOURCES@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
	b	LBB0_10
LBB0_2:
	ldr	x0, [sp]
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	ldr	x21, [sp]
Lloh8:
	adrp	x22, _MQS_FULL@GOTPAGE
Lloh9:
	ldr	x22, [x22, _MQS_FULL@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [x21, #8]
	str	w20, [x21]
	cmp	w20, #2
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_get_present2
	str	w0, [x21, #4]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_restore_present2
LBB0_4:
Lloh10:
	adrp	x25, _MQE_OK@GOTPAGE
Lloh11:
	ldr	x25, [x25, _MQE_OK@GOTPAGEOFF]
Lloh12:
	adrp	x26, _IMA@GOTPAGE
Lloh13:
	ldr	x26, [x26, _IMA@GOTPAGEOFF]
Lloh14:
	adrp	x27, _CBS_IDLE@GOTPAGE
Lloh15:
	ldr	x27, [x27, _CBS_IDLE@GOTPAGEOFF]
Lloh16:
	adrp	x28, _MQIE_AGAIN@GOTPAGE
Lloh17:
	ldr	x28, [x28, _MQIE_AGAIN@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x28]
	cmp	w22, w8
	b.ne	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x25]
	ldr	x23, [sp, #8]
	ldr	w24, [x19]
	mov	x0, x21
	bl	_gru_get_tri
	mov	x2, x0
	ldr	w4, [x26]
	mov	x0, x23
	mov	x1, x24
	mov	x3, x20
	bl	_gru_mesq
	ldr	x0, [sp, #8]
	bl	_gru_wait
	ldr	w8, [x27]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldp	x2, x0, [sp]
	mov	x1, x19
	mov	x3, x20
	bl	_send_message_failure
	mov	x22, x0
	b	LBB0_5
LBB0_8:
	ldp	x1, x0, [sp]
	bl	_gru_free_cpu_resources
	cbz	w22, LBB0_10
; %bb.9:
Lloh18:
	adrp	x8, _mesq_send_failed@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mesq_send_failed@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_STAT
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_mesq_send,4,2                  ; @mesq_send
	.comm	_GRU_CACHE_LINE_BYTES,4,2       ; @GRU_CACHE_LINE_BYTES
	.comm	_MQE_BUG_NO_RESOURCES,4,2       ; @MQE_BUG_NO_RESOURCES
	.comm	_MQS_FULL,4,2                   ; @MQS_FULL
	.comm	_MQE_OK,4,2                     ; @MQE_OK
	.comm	_IMA,4,2                        ; @IMA
	.comm	_CBS_IDLE,4,2                   ; @CBS_IDLE
	.comm	_MQIE_AGAIN,4,2                 ; @MQIE_AGAIN
	.comm	_mesq_send_failed,4,2           ; @mesq_send_failed
.subsections_via_symbols
