	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ql_alloc_mem_resources
_ql_alloc_mem_resources:                ## @ql_alloc_mem_resources
	.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	%rdi, %r15
	callq	_ql_alloc_shadow_space
	testq	%rax, %rax
	jne	LBB0_11
## %bb.1:
	cmpl	$0, (%r15)
	jle	LBB0_5
## %bb.2:
	xorl	%r12d, %r12d
	leaq	L_.str(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rsi
	addq	%r12, %rsi
	movq	%r15, %rdi
	callq	_ql_alloc_rx_resources
	testq	%rax, %rax
	jne	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_5:
	cmpl	$0, 4(%r15)
	jle	LBB0_13
## %bb.6:
	xorl	%r12d, %r12d
	leaq	L_.str.1(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rsi
	addq	%r12, %rsi
	movq	%r15, %rdi
	callq	_ql_alloc_tx_resources
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movslq	4(%r15), %rax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jl	LBB0_7
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_10:
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movq	%r15, %rdi
	movq	%r14, %rcx
	callq	_netif_err
	movq	%r15, %rdi
	callq	_ql_free_mem_resources
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ifup,4,2                       ## @ifup
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RX resource allocation failed.\n"

L_.str.1:                               ## @.str.1
	.asciz	"TX resource allocation failed.\n"

	.no_dead_strip	_ql_alloc_mem_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ql_alloc_mem_resources
_ql_alloc_mem_resources:                ; @ql_alloc_mem_resources
	.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	x19, x0
	bl	_ql_alloc_shadow_space
	cbnz	x0, LBB0_11
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x21, #0
	mov	x22, #0
Lloh0:
	adrp	x20, l_.str@PAGE
Lloh1:
	add	x20, x20, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	add	x1, x8, x21
	mov	x0, x19
	bl	_ql_alloc_rx_resources
	cbnz	x0, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19]
	add	x21, x21, #4
	cmp	x22, x8
	b.lt	LBB0_3
LBB0_5:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	x21, #0
	mov	x22, #0
Lloh2:
	adrp	x20, l_.str.1@PAGE
Lloh3:
	add	x20, x20, l_.str.1@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x1, x8, x21
	mov	x0, x19
	bl	_ql_alloc_tx_resources
	cbnz	x0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19, #4]
	add	x21, x21, #4
	cmp	x22, x8
	b.lt	LBB0_7
LBB0_9:
	mov	w0, #0
	b	LBB0_12
LBB0_10:
Lloh4:
	adrp	x8, _ifup@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x19
	mov	x3, x20
	bl	_netif_err
	mov	x0, x19
	bl	_ql_free_mem_resources
LBB0_11:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ifup,4,2                       ; @ifup
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RX resource allocation failed.\n"

l_.str.1:                               ; @.str.1
	.asciz	"TX resource allocation failed.\n"

	.no_dead_strip	_ql_alloc_mem_resources
.subsections_via_symbols
