	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cuda_send
_cuda_send:                             ## @cuda_send
	.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	%rcx, %r15
	movq	(%rdi), %rax
	movq	_CUDA_NOTREADY@GOTPCREL(%rip), %rcx
	movl	$-1, %r12d
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.1:
	movl	%edx, %r14d
	movq	%rdi, %rbx
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movl	40(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	16(%rdi), %r13
	movq	%r13, %rdi
	callq	_mtx_lock
	leaq	36(%rbx), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_STAILQ_FIRST
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r12
	decl	%r14d
	movl	%r14d, (%rax)
	movl	(%r15), %eax
	movl	%eax, 8(%r12)
	movl	4(%r12), %edi
	addq	$4, %r15
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movq	_pkt_q@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_STAILQ_REMOVE_HEAD
	leaq	32(%rbx), %rdi
	movl	(%r14), %edx
	movq	%r12, %rsi
	callq	_STAILQ_INSERT_TAIL
	cmpq	$0, 24(%rbx)
	je	LBB0_5
## %bb.4:
	movq	%r13, %rdi
	callq	_mtx_unlock
	xorl	%r12d, %r12d
	jmp	LBB0_9
LBB0_2:
	movq	%r13, %rdi
	callq	_mtx_unlock
	movl	$-1, %r12d
	jmp	LBB0_9
LBB0_5:
	movq	%rbx, %rdi
	callq	_cuda_send_outbound
	movq	%r13, %rdi
	callq	_mtx_unlock
	xorl	%r12d, %r12d
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_8
## %bb.6:
	cmpq	$0, 8(%rbx)
	jne	LBB0_8
## %bb.7:
	movq	_cold@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_9
LBB0_8:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cuda_poll
LBB0_9:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CUDA_NOTREADY,8,3              ## @CUDA_NOTREADY
	.comm	_pkt_q,4,2                      ## @pkt_q
	.comm	_cold,8,3                       ## @cold
	.no_dead_strip	_cuda_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cuda_send
_cuda_send:                             ; @cuda_send
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CUDA_NOTREADY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CUDA_NOTREADY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_11
LBB0_2:
	mov	x23, x3
	mov	x25, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w19, [x0, #40]
	add	x22, x0, #16
	mov	x0, x22
	bl	_mtx_lock
	add	x26, x20, #36
	mov	x0, x26
	bl	_STAILQ_FIRST
	cbz	x0, LBB0_5
; %bb.3:
	mov	x24, x0
	sub	w2, w25, #1
	str	w2, [x0]
	ldr	w8, [x23], #4
	str	w8, [x0, #8]
	ldr	w0, [x0, #4]
	mov	x1, x23
	bl	_memcpy
Lloh3:
	adrp	x23, _pkt_q@GOTPAGE
Lloh4:
	ldr	x23, [x23, _pkt_q@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x26
	bl	_STAILQ_REMOVE_HEAD
	add	x0, x20, #32
	ldr	w2, [x23]
	mov	x1, x24
	bl	_STAILQ_INSERT_TAIL
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_6
; %bb.4:
	mov	x0, x22
	bl	_mtx_unlock
	b	LBB0_10
LBB0_5:
	mov	x0, x22
	bl	_mtx_unlock
	mov	w0, #-1
	b	LBB0_11
LBB0_6:
	mov	x0, x20
	bl	_cuda_send_outbound
	mov	x0, x22
	bl	_mtx_unlock
	cbnz	w21, LBB0_9
; %bb.7:
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_9
; %bb.8:
Lloh5:
	adrp	x8, _cold@GOTPAGE
Lloh6:
	ldr	x8, [x8, _cold@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_cuda_poll
LBB0_10:
	mov	w0, #0
LBB0_11:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_CUDA_NOTREADY,8,3              ; @CUDA_NOTREADY
	.comm	_pkt_q,4,2                      ; @pkt_q
	.comm	_cold,8,3                       ; @cold
	.no_dead_strip	_cuda_send
.subsections_via_symbols
