	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cuda_send_inbound
_cuda_send_inbound:                     ## @cuda_send_inbound
	.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, %r14
	movl	24(%rdi), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leaq	4(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mtx_lock
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	leaq	20(%r14), %r12
	movq	%r12, %rdi
	callq	_STAILQ_FIRST
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	%rax, %r15
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	12(%rax), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%rax), %r13
	movq	_pkt_q@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_mtx_lock
	movl	(%r14), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_STAILQ_INSERT_TAIL
	movq	%r12, %rdi
	callq	_STAILQ_FIRST
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_15
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_STAILQ_REMOVE_HEAD
	movq	%rbx, %rdi
	callq	_mtx_unlock
	movl	(%r15), %edx
	cmpl	$128, %edx
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$129, %edx
	je	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$130, %edx
	jne	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r15), %ecx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	16(%rax), %edi
	movq	8(%r15), %r8
	movl	(%r8), %esi
	movl	4(%r8), %edx
	cmpl	$3, %ecx
	jl	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	$-2, %ecx
	addq	$8, %r8
	callq	_adb_receive_raw_packet
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_mtx_lock
	movq	8(%r15), %rsi
	movl	4(%rsi), %eax
	cmpl	$132, %eax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$133, %eax
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_12
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_adb_receive_raw_packet
	jmp	LBB0_14
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	addq	$8, %rsi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	$4, %edx
	callq	_memcpy
	movq	%r14, %rdi
	movq	_pkt_q@GOTPCREL(%rip), %r14
	callq	_wakeup
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_mtx_unlock
	jmp	LBB0_14
LBB0_15:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_pkt_q,4,2                      ## @pkt_q
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown CUDA command %d\n"

	.no_dead_strip	_cuda_send_inbound
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cuda_send_inbound
_cuda_send_inbound:                     ; @cuda_send_inbound
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	w21, [x0, #24]
	add	x20, x0, #4
	mov	x0, x20
	bl	_mtx_lock
	add	x22, x19, #20
	mov	x0, x22
	bl	_STAILQ_FIRST
	cbz	x0, LBB0_15
; %bb.1:
	mov	x24, x0
	add	x23, x19, #12
	add	x25, x19, #8
Lloh0:
	adrp	x27, _pkt_q@GOTPAGE
Lloh1:
	ldr	x27, [x27, _pkt_q@GOTPAGEOFF]
	mov	w28, #1
Lloh2:
	adrp	x26, l_.str@PAGE
Lloh3:
	add	x26, x26, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	mov	x1, x26
	bl	_device_printf
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_mtx_lock
	ldr	w2, [x27]
	mov	x0, x25
	mov	x1, x24
	bl	_STAILQ_INSERT_TAIL
	mov	x0, x22
	bl	_STAILQ_FIRST
	mov	x24, x0
	cbz	x0, LBB0_15
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	x0, x22
	bl	_STAILQ_REMOVE_HEAD
	mov	x0, x20
	bl	_mtx_unlock
	ldr	w2, [x24]
	cmp	w2, #128
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w2, #129
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w2, #130
	b.ne	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x24, #4]
	ldr	w0, [x19, #16]
	ldr	x9, [x24, #8]
	ldp	w1, w2, [x9]
	cmp	w8, #3
	b.lt	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w3, w8, #2
	add	x4, x9, #8
	bl	_adb_receive_raw_packet
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_mtx_lock
	ldr	x8, [x24, #8]
	ldr	w9, [x8, #4]
	cmp	w9, #132
	b.eq	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w9, #133
	b.ne	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	str	w28, [x19]
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w3, #0
	mov	x4, #0
	bl	_adb_receive_raw_packet
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x1, x8, #8
	mov	x0, x23
	mov	w2, #4
	bl	_memcpy
	mov	x0, x23
	bl	_wakeup
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_mtx_unlock
	b	LBB0_3
LBB0_15:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mtx_unlock
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_pkt_q,4,2                      ; @pkt_q
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown CUDA command %d\n"

	.no_dead_strip	_cuda_send_inbound
.subsections_via_symbols
