	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	40(%rdi), %rdi
	movq	(%rdi), %rdx
	movq	_NORMAL_MTU_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_5
## %bb.1:
	movq	_NUM_LBUFQ_ENTRIES@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	_JUMBO_MTU_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	cmpq	%r8, %rdx
	jne	LBB0_7
## %bb.6:
	movq	_JUMBO_NUM_LBUFQ_ENTRIES@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	_QL_ADDR_ELE_PER_BUFQ_ENTRY@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movl	%eax, 4(%rbx)
	movq	_VLAN_ETH_HLEN@GOTPCREL(%rip), %rax
	movq	_VLAN_ID_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	(%rax), %rcx
	movq	_QL_HEADER_SPACE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	movq	%rax, 88(%rbx)
	addq	%rdx, %rcx
	movq	_ETHERNET_CRC_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rcx
	movq	%rcx, 96(%rbx)
	movl	24(%rbx), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	8(%rbx), %rdx
	callq	_pci_alloc_consistent
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	%rax, 72(%rbx)
	movl	8(%rbx), %edi
	callq	_MS_64BITS
	movl	%eax, 64(%rbx)
	movl	8(%rbx), %edi
	callq	_LS_64BITS
	movq	%rax, 48(%rbx)
	movq	72(%rbx), %rcx
	addq	$32, %rcx
	movq	%rcx, 80(%rbx)
	movl	64(%rbx), %ecx
	movl	%ecx, 68(%rbx)
	addq	$8, %rax
	movq	%rax, 56(%rbx)
	movq	%rbx, %rdi
	callq	_ql_alloc_net_req_rsp_queues
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	40(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_22
LBB0_9:
	movq	40(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_netdev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_7:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_netdev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_10:
	movq	%rbx, %rdi
	callq	_ql_alloc_buffer_queues
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	40(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_21
LBB0_12:
	movq	%rbx, %rdi
	callq	_ql_alloc_small_buffers
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	40(%rbx), %rdi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_14
LBB0_15:
	movq	%rbx, %rdi
	callq	_ql_alloc_large_buffers
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	40(%rbx), %rdi
	leaq	L_.str.5(%rip), %rsi
LBB0_14:
	xorl	%eax, %eax
	callq	_netdev_err
LBB0_20:
	movq	%rbx, %rdi
	callq	_ql_free_buffer_queues
LBB0_21:
	movq	%rbx, %rdi
	callq	_ql_free_net_req_rsp_queues
LBB0_22:
	movl	24(%rbx), %edi
	movl	(%r14), %esi
	movq	16(%rbx), %rdx
	movl	8(%rbx), %ecx
	callq	_pci_free_consistent
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_23:
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_17:
	movq	%rbx, %rdi
	callq	_ql_init_large_buffers
	movq	%rbx, %rdi
	callq	_ql_create_send_free_list
	testq	%rax, %rax
	je	LBB0_18
## %bb.19:
	movq	%rbx, %rdi
	callq	_ql_free_send_free_list
	jmp	LBB0_20
LBB0_18:
	movl	28(%rbx), %eax
	movl	%eax, 32(%rbx)
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_NORMAL_MTU_SIZE,8,3            ## @NORMAL_MTU_SIZE
	.comm	_NUM_LBUFQ_ENTRIES,4,2          ## @NUM_LBUFQ_ENTRIES
	.comm	_JUMBO_MTU_SIZE,8,3             ## @JUMBO_MTU_SIZE
	.comm	_JUMBO_NUM_LBUFQ_ENTRIES,4,2    ## @JUMBO_NUM_LBUFQ_ENTRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid mtu size: %d.  Only %d and %d are accepted.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_QL_ADDR_ELE_PER_BUFQ_ENTRY,4,2 ## @QL_ADDR_ELE_PER_BUFQ_ENTRY
	.comm	_VLAN_ETH_HLEN,8,3              ## @VLAN_ETH_HLEN
	.comm	_VLAN_ID_LEN,8,3                ## @VLAN_ID_LEN
	.comm	_QL_HEADER_SPACE,8,3            ## @QL_HEADER_SPACE
	.comm	_ETHERNET_CRC_SIZE,8,3          ## @ETHERNET_CRC_SIZE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"shadowReg Alloc failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"ql_alloc_net_req_rsp_queues failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"ql_alloc_buffer_queues failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"ql_alloc_small_buffers failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"ql_alloc_large_buffers 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:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x0, [x0, #40]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NORMAL_MTU_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NORMAL_MTU_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _NUM_LBUFQ_ENTRIES@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NUM_LBUFQ_ENTRIES@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh5:
	adrp	x10, _JUMBO_MTU_SIZE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _JUMBO_MTU_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_8
; %bb.3:
Lloh8:
	adrp	x9, _JUMBO_NUM_LBUFQ_ENTRIES@GOTPAGE
Lloh9:
	ldr	x9, [x9, _JUMBO_NUM_LBUFQ_ENTRIES@GOTPAGEOFF]
LBB0_4:
	ldr	w9, [x9]
	str	w9, [x19]
Lloh10:
	adrp	x10, _QL_ADDR_ELE_PER_BUFQ_ENTRY@GOTPAGE
Lloh11:
	ldr	x10, [x10, _QL_ADDR_ELE_PER_BUFQ_ENTRY@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	mul	w9, w10, w9
	str	w9, [x19, #4]
Lloh13:
	adrp	x9, _VLAN_ETH_HLEN@GOTPAGE
Lloh14:
	ldr	x9, [x9, _VLAN_ETH_HLEN@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
Lloh16:
	adrp	x10, _VLAN_ID_LEN@GOTPAGE
Lloh17:
	ldr	x10, [x10, _VLAN_ID_LEN@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
Lloh19:
	adrp	x11, _QL_HEADER_SPACE@GOTPAGE
Lloh20:
	ldr	x11, [x11, _QL_HEADER_SPACE@GOTPAGEOFF]
Lloh21:
	ldr	x11, [x11]
	add	x9, x10, x9
	add	x10, x9, x11
	add	x10, x10, x8
Lloh22:
	adrp	x11, _ETHERNET_CRC_SIZE@GOTPAGE
Lloh23:
	ldr	x11, [x11, _ETHERNET_CRC_SIZE@GOTPAGEOFF]
Lloh24:
	ldr	x11, [x11]
	add	x8, x9, x8
	add	x8, x8, x11
	stp	x10, x8, [x19, #88]
	ldr	w0, [x19, #24]
Lloh25:
	adrp	x20, _PAGE_SIZE@GOTPAGE
Lloh26:
	ldr	x20, [x20, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, x19, #8
	bl	_pci_alloc_consistent
	str	x0, [x19, #16]
	cbz	x0, LBB0_7
; %bb.5:
	str	x0, [x19, #72]
	ldr	w0, [x19, #8]
	bl	_MS_64BITS
	str	w0, [x19, #64]
	ldr	w0, [x19, #8]
	bl	_LS_64BITS
	ldr	x8, [x19, #72]
	add	x8, x8, #32
	str	x8, [x19, #80]
	ldr	w8, [x19, #64]
	str	w8, [x19, #68]
	add	x8, x0, #8
	stp	x0, x8, [x19, #48]
	mov	x0, x19
	bl	_ql_alloc_net_req_rsp_queues
	cbz	x0, LBB0_9
; %bb.6:
	ldr	x0, [x19, #40]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_netdev_err
	b	LBB0_19
LBB0_7:
	ldr	x0, [x19, #40]
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_err
	b	LBB0_20
LBB0_8:
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
	b	LBB0_20
LBB0_9:
	mov	x0, x19
	bl	_ql_alloc_buffer_queues
	cbz	x0, LBB0_11
; %bb.10:
	ldr	x0, [x19, #40]
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_netdev_err
	b	LBB0_18
LBB0_11:
	mov	x0, x19
	bl	_ql_alloc_small_buffers
	cbz	x0, LBB0_13
; %bb.12:
	ldr	x0, [x19, #40]
Lloh35:
	adrp	x1, l_.str.4@PAGE
Lloh36:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_netdev_err
	b	LBB0_17
LBB0_13:
	mov	x0, x19
	bl	_ql_alloc_large_buffers
	cbz	x0, LBB0_15
; %bb.14:
	ldr	x0, [x19, #40]
Lloh37:
	adrp	x1, l_.str.5@PAGE
Lloh38:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_netdev_err
	b	LBB0_17
LBB0_15:
	mov	x0, x19
	bl	_ql_init_large_buffers
	mov	x0, x19
	bl	_ql_create_send_free_list
	cbz	x0, LBB0_22
; %bb.16:
	mov	x0, x19
	bl	_ql_free_send_free_list
LBB0_17:
	mov	x0, x19
	bl	_ql_free_buffer_queues
LBB0_18:
	mov	x0, x19
	bl	_ql_free_net_req_rsp_queues
LBB0_19:
	ldr	w0, [x19, #24]
	ldr	w1, [x20]
	ldr	x2, [x19, #16]
	ldr	w3, [x19, #8]
	bl	_pci_free_consistent
LBB0_20:
Lloh39:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_21:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_22:
	ldr	w8, [x19, #28]
	str	w8, [x19, #32]
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_NORMAL_MTU_SIZE,8,3            ; @NORMAL_MTU_SIZE
	.comm	_NUM_LBUFQ_ENTRIES,4,2          ; @NUM_LBUFQ_ENTRIES
	.comm	_JUMBO_MTU_SIZE,8,3             ; @JUMBO_MTU_SIZE
	.comm	_JUMBO_NUM_LBUFQ_ENTRIES,4,2    ; @JUMBO_NUM_LBUFQ_ENTRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid mtu size: %d.  Only %d and %d are accepted.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_QL_ADDR_ELE_PER_BUFQ_ENTRY,4,2 ; @QL_ADDR_ELE_PER_BUFQ_ENTRY
	.comm	_VLAN_ETH_HLEN,8,3              ; @VLAN_ETH_HLEN
	.comm	_VLAN_ID_LEN,8,3                ; @VLAN_ID_LEN
	.comm	_QL_HEADER_SPACE,8,3            ; @QL_HEADER_SPACE
	.comm	_ETHERNET_CRC_SIZE,8,3          ; @ETHERNET_CRC_SIZE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"shadowReg Alloc failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"ql_alloc_net_req_rsp_queues failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"ql_alloc_buffer_queues failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"ql_alloc_small_buffers failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"ql_alloc_large_buffers failed\n"

	.no_dead_strip	_ql_alloc_mem_resources
.subsections_via_symbols
