	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_en_alloc_resources
_mlx4_en_alloc_resources:               ## @mlx4_en_alloc_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	80(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_MLX4_EN_NUM_TX_TYPES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jle	LBB0_9
## %bb.1:
	movq	(%r13), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	movslq	%ecx, %rdx
	cmpq	%rdx, %r14
	jge	LBB0_9
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	cmpl	$0, (%rax,%r14,4)
	jle	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%eax, %eax
	callq	_num_online_cpus
	movl	%eax, %ecx
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	movl	%edx, %edi
	callq	_cpu_to_node
	movl	%eax, %r12d
	movq	16(%r13), %rax
	movq	(%rax,%r14,8), %rsi
	addq	%rbx, %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edx
	movq	%r13, %rdi
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	movl	%r12d, %r9d
	callq	_mlx4_en_create_cq
	testq	%rax, %rax
	jne	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	24(%r13), %rax
	movq	(%rax,%r14,8), %rsi
	addq	%rbx, %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edx
	movq	_TXBB_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movl	%r12d, %r8d
	movl	%r15d, %r9d
	callq	_mlx4_en_create_tx_ring
	testq	%rax, %rax
	jne	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	incq	%r15
	movq	(%r13), %rax
	movslq	(%rax,%r14,4), %rcx
	addq	$8, %rbx
	cmpq	%rcx, %r15
	jl	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_MLX4_EN_NUM_TX_TYPES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	jmp	LBB0_2
LBB0_9:
	cmpl	$0, 8(%r13)
	jle	LBB0_35
## %bb.10:
	movq	_RX@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_num_online_cpus
	movl	%eax, %ecx
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	movl	%edx, %edi
	callq	_cpu_to_node
	movl	%eax, %r15d
	movq	32(%r13), %rsi
	addq	%rbx, %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	(%r14), %r8d
	movq	%r13, %rdi
	movl	%r12d, %ecx
	movl	%r15d, %r9d
	callq	_mlx4_en_create_cq
	testq	%rax, %rax
	jne	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	48(%r13), %rsi
	addq	%rbx, %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	40(%r13), %ecx
	movq	%r13, %rdi
	movl	%r15d, %r8d
	movl	%r12d, %r9d
	callq	_mlx4_en_create_rx_ring
	testq	%rax, %rax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%r12
	movslq	8(%r13), %rax
	addq	$8, %rbx
	cmpq	%rax, %r12
	jl	LBB0_11
LBB0_35:
	xorl	%eax, %eax
	jmp	LBB0_34
LBB0_15:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_en_err
	cmpl	$0, 8(%r13)
	movq	_MLX4_EN_NUM_TX_TYPES@GOTPCREL(%rip), %r12
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jle	LBB0_22
## %bb.16:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_18 Depth=1
	incq	%r14
	movslq	8(%r13), %rax
	addq	$8, %rbx
	cmpq	%rax, %r14
	jge	LBB0_22
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%r13), %rsi
	cmpq	$0, (%rsi,%rbx)
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	addq	%rbx, %rsi
	movl	(%r15), %edx
	movl	40(%r13), %ecx
	movq	%r13, %rdi
	callq	_mlx4_en_destroy_rx_ring
LBB0_20:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	32(%r13), %rsi
	cmpq	$0, (%rsi,%rbx)
	je	LBB0_17
## %bb.21:                              ##   in Loop: Header=BB0_18 Depth=1
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	_mlx4_en_destroy_cq
	jmp	LBB0_17
LBB0_22:
	movl	(%r12), %ecx
	testl	%ecx, %ecx
	jle	LBB0_33
## %bb.23:
	movq	(%r13), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_26 Depth=1
	movl	(%r12), %ecx
LBB0_25:                                ##   in Loop: Header=BB0_26 Depth=1
	incq	%r14
	movslq	%ecx, %rdx
	cmpq	%rdx, %r14
	jge	LBB0_33
LBB0_26:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_29 Depth 2
	cmpl	$0, (%rax,%r14,4)
	jle	LBB0_25
## %bb.27:                              ##   in Loop: Header=BB0_26 Depth=1
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_29 Depth=2
	incq	%r15
	movq	(%r13), %rax
	movslq	(%rax,%r14,4), %rcx
	addq	$8, %rbx
	cmpq	%rcx, %r15
	jge	LBB0_24
LBB0_29:                                ##   Parent Loop BB0_26 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	24(%r13), %rax
	movq	(%rax,%r14,8), %rsi
	cmpq	$0, (%rsi,%rbx)
	je	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=2
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	_mlx4_en_destroy_tx_ring
LBB0_31:                                ##   in Loop: Header=BB0_29 Depth=2
	movq	16(%r13), %rax
	movq	(%rax,%r14,8), %rsi
	cmpq	$0, (%rsi,%rbx)
	je	LBB0_28
## %bb.32:                              ##   in Loop: Header=BB0_29 Depth=2
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	_mlx4_en_destroy_cq
	jmp	LBB0_28
LBB0_33:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_34:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_EN_NUM_TX_TYPES,4,2       ## @MLX4_EN_NUM_TX_TYPES
	.comm	_TXBB_SIZE,4,2                  ## @TXBB_SIZE
	.comm	_RX,4,2                         ## @RX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate NIC resources\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mlx4_en_alloc_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_en_alloc_resources
_mlx4_en_alloc_resources:               ; @mlx4_en_alloc_resources
	.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
	mov	x19, x0
	ldr	x24, [x0, #80]
Lloh0:
	adrp	x23, _MLX4_EN_NUM_TX_TYPES@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MLX4_EN_NUM_TX_TYPES@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x20, #0
	ldr	x8, [x19]
Lloh2:
	adrp	x25, _TXBB_SIZE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _TXBB_SIZE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, #1
	cmp	x20, w9, sxtw
	b.ge	LBB0_9
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	w10, [x8, x20, lsl #2]
	cmp	w10, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x26, #0
	mov	x21, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	bl	_num_online_cpus
	sdiv	w8, w21, w0
	msub	w0, w8, w0, w21
	bl	_cpu_to_node
	mov	x22, x0
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x20, lsl #3]
	add	x1, x8, x26
	ldr	w2, [x24, #4]
	mov	x0, x19
	mov	x3, x21
	mov	x4, x20
	mov	x5, x22
	bl	_mlx4_en_create_cq
	cbnz	x0, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x20, lsl #3]
	add	x1, x8, x26
	ldr	w2, [x24, #4]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x4, x22
	mov	x5, x21
	bl	_mlx4_en_create_tx_ring
	cbnz	x0, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x21, x21, #1
	ldr	x8, [x19]
	ldrsw	x9, [x8, x20, lsl #2]
	add	x26, x26, #8
	cmp	x21, x9
	b.lt	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x23]
	b	LBB0_2
LBB0_9:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.10:
	mov	x22, #0
	mov	x20, #0
Lloh4:
	adrp	x25, _RX@GOTPAGE
Lloh5:
	ldr	x25, [x25, _RX@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	bl	_num_online_cpus
	sdiv	w8, w20, w0
	msub	w0, w8, w0, w20
	bl	_cpu_to_node
	mov	x21, x0
	ldr	x8, [x19, #32]
	add	x1, x8, x22
	ldr	w2, [x24]
	ldr	w4, [x25]
	mov	x0, x19
	mov	x3, x20
	mov	x5, x21
	bl	_mlx4_en_create_cq
	cbnz	x0, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x19, #48]
	add	x1, x8, x22
	ldr	w2, [x24]
	ldr	w3, [x19, #40]
	mov	x0, x19
	mov	x4, x21
	mov	x5, x20
	bl	_mlx4_en_create_rx_ring
	cbnz	x0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19, #8]
	add	x22, x22, #8
	cmp	x20, x8
	b.lt	LBB0_11
LBB0_14:
	mov	w0, #0
	b	LBB0_34
LBB0_15:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_en_err
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.16:
	mov	x20, #0
	mov	x21, #0
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19, #8]
	add	x20, x20, #8
	cmp	x21, x8
	b.ge	LBB0_22
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #48]
	add	x1, x8, x20
	ldr	x8, [x1]
	cbz	x8, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w2, [x24]
	ldr	w3, [x19, #40]
	mov	x0, x19
	bl	_mlx4_en_destroy_rx_ring
LBB0_20:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	x8, [x19, #32]
	add	x1, x8, x20
	ldr	x8, [x1]
	cbz	x8, LBB0_17
; %bb.21:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x0, x19
	bl	_mlx4_en_destroy_cq
	b	LBB0_17
LBB0_22:
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_33
; %bb.23:
	mov	x20, #0
	ldr	x8, [x19]
	b	LBB0_26
LBB0_24:                                ;   in Loop: Header=BB0_26 Depth=1
	ldr	w9, [x23]
LBB0_25:                                ;   in Loop: Header=BB0_26 Depth=1
	add	x20, x20, #1
	cmp	x20, w9, sxtw
	b.ge	LBB0_33
LBB0_26:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_29 Depth 2
	ldr	w10, [x8, x20, lsl #2]
	cmp	w10, #1
	b.lt	LBB0_25
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=1
	mov	x21, #0
	mov	x22, #0
	b	LBB0_29
LBB0_28:                                ;   in Loop: Header=BB0_29 Depth=2
	add	x22, x22, #1
	ldr	x8, [x19]
	ldrsw	x9, [x8, x20, lsl #2]
	add	x21, x21, #8
	cmp	x22, x9
	b.ge	LBB0_24
LBB0_29:                                ;   Parent Loop BB0_26 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x20, lsl #3]
	add	x1, x8, x21
	ldr	x8, [x1]
	cbz	x8, LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=2
	mov	x0, x19
	bl	_mlx4_en_destroy_tx_ring
LBB0_31:                                ;   in Loop: Header=BB0_29 Depth=2
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x20, lsl #3]
	add	x1, x8, x21
	ldr	x8, [x1]
	cbz	x8, LBB0_28
; %bb.32:                               ;   in Loop: Header=BB0_29 Depth=2
	mov	x0, x19
	bl	_mlx4_en_destroy_cq
	b	LBB0_28
LBB0_33:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_34:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_EN_NUM_TX_TYPES,4,2       ; @MLX4_EN_NUM_TX_TYPES
	.comm	_TXBB_SIZE,4,2                  ; @TXBB_SIZE
	.comm	_RX,4,2                         ; @RX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate NIC resources\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mlx4_en_alloc_resources
.subsections_via_symbols
