	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sc_hw_alloc
_sc_hw_alloc:                           ## @sc_hw_alloc
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %edx
	movq	%rdi, %r12
	movq	(%rdi), %rax
	testq	%rax, %rax
	jle	LBB0_6
## %bb.1:
	movq	%rcx, %r14
	movq	16(%r12), %rcx
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	je	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%edx, (%rcx,%rbx,8)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, 4(%rcx,%rbx,8)
	jne	LBB0_5
## %bb.4:
	movl	$1, 4(%rcx,%rbx,8)
	movq	%r12, %rdi
	callq	_chip_send_contexts
	movq	%rbx, %rcx
	notq	%rcx
	addq	%rax, %rcx
	movq	8(%r12), %rax
	movq	%rbx, (%rax,%rcx,8)
	movq	%rbx, (%r15)
	movq	%rcx, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dd_dev_err
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to locate a free type %d send context\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_sc_hw_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sc_hw_alloc
_sc_hw_alloc:                           ; @sc_hw_alloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x2, x1
	mov	x21, x0
	ldr	x8, [x0]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x19, x3
	mov	x22, #0
	ldr	x9, [x21, #16]
	add	x9, x9, #4
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	add	x9, x9, #8
	cmp	x8, x22
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w10, [x9, #-4]
	cmp	w10, w2
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w10, [x9]
	cbnz	w10, LBB0_2
; %bb.5:
	mov	w8, #1
	str	w8, [x9]
	mov	x0, x21
	bl	_chip_send_contexts
	mov	x8, x0
	mov	w0, #0
	mvn	x9, x22
	ldr	x10, [x21, #8]
	add	x8, x9, x8
	str	x22, [x10, x8, lsl #3]
	str	x22, [x20]
	str	x8, [x19]
	b	LBB0_7
LBB0_6:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dd_dev_err
Lloh2:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to locate a free type %d send context\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_sc_hw_alloc
.subsections_via_symbols
