	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_en_create_rx_ring         ## -- Begin function mlx4_en_create_rx_ring
	.p2align	4, 0x90
_mlx4_en_create_rx_ring:                ## @mlx4_en_create_rx_ring
	.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
	movl	%edx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%rsi)
	movl	%edx, (%rsi)
	leal	-1(%r15), %eax
	movl	%eax, 4(%rsi)
	movl	%ecx, 8(%rsi)
	movl	%ecx, %edi
	callq	_ffs
	decq	%rax
	movq	%rax, 48(%r13)
	movslq	(%r13), %rax
	movslq	8(%r13), %rcx
	imulq	%rax, %rcx
	movq	_TXBB_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rcx
	movq	%rcx, 24(%r13)
	movq	_MLX4_EN_MAX_RX_FRAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$2, %edi
	callq	_roundup_pow_of_two
	movl	%eax, %ebx
	imull	%r15d, %ebx
	movl	%ebx, %edi
	callq	_vmalloc
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_DRV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rsi
	movq	%rax, %rcx
	movl	%ebx, %r8d
	callq	_en_dbg
	movl	(%r12), %edi
	movq	%r12, %rbx
	leaq	32(%r13), %r12
	movq	24(%r13), %rdx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	%ecx, %ecx
	movq	%r12, %rsi
	callq	_mlx4_alloc_hwq_res
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	%r12, %rdi
	callq	_mlx4_en_map_buffer
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_en_err
	movl	(%rbx), %edi
	movq	24(%r13), %rdx
	movq	%r12, %rsi
	callq	_mlx4_free_hwq_res
LBB0_5:
	movq	16(%r13), %rdi
	callq	_vfree
	movq	$0, 16(%r13)
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_en_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_7:
	movl	32(%r13), %eax
	movl	%eax, 40(%r13)
	movl	(%r14), %eax
	movl	%eax, 36(%r13)
	xorl	%r15d, %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TXBB_SIZE,8,3                  ## @TXBB_SIZE
	.comm	_MLX4_EN_MAX_RX_FRAGS,4,2       ## @MLX4_EN_MAX_RX_FRAGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed allocating rx_info ring\n"

	.comm	_DRV,4,2                        ## @DRV
L_.str.1:                               ## @.str.1
	.asciz	"Allocated rx_info ring at addr:%p size:%d\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Failed to map RX buffer\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_en_create_rx_ring         ; -- Begin function mlx4_en_create_rx_ring
	.p2align	2
_mlx4_en_create_rx_ring:                ; @mlx4_en_create_rx_ring
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #8]
	stp	xzr, xzr, [x1, #56]
	sub	w8, w2, #1
	stp	w2, w8, [x1]
	str	w3, [x1, #8]
	mov	x0, x3
	bl	_ffs
	sub	x8, x0, #1
	str	x8, [x19, #48]
	ldrsw	x8, [x19]
	ldrsw	x9, [x19, #8]
Lloh0:
	adrp	x10, _TXBB_SIZE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _TXBB_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	madd	x8, x9, x8, x10
	str	x8, [x19, #24]
Lloh3:
	adrp	x8, _MLX4_EN_MAX_RX_FRAGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLX4_EN_MAX_RX_FRAGS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	w0, w8, #2
	bl	_roundup_pow_of_two
	mul	w21, w0, w21
	mov	x0, x21
	bl	_vmalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.1:
	mov	x3, x0
Lloh6:
	adrp	x8, _DRV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DRV@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x2, l_.str.1@PAGE
Lloh10:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x1, x20
	mov	x4, x21
	bl	_en_dbg
	ldr	w0, [x23]
	add	x22, x19, #32
	ldr	x2, [x19, #24]
Lloh11:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	lsl	w3, w8, #1
	mov	x1, x22
	bl	_mlx4_alloc_hwq_res
	mov	x21, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x22
	bl	_mlx4_en_map_buffer
	mov	x21, x0
	cbz	w0, LBB0_6
; %bb.3:
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_en_err
	ldr	w0, [x23]
	ldr	x2, [x19, #24]
	mov	x1, x22
	bl	_mlx4_free_hwq_res
LBB0_4:
	ldr	x0, [x19, #16]
	bl	_vfree
	str	xzr, [x19, #16]
	b	LBB0_7
LBB0_5:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_en_err
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
LBB0_6:
	ldr	w8, [x19, #32]
	ldr	w9, [x20]
	stp	w9, w8, [x19, #36]
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TXBB_SIZE,8,3                  ; @TXBB_SIZE
	.comm	_MLX4_EN_MAX_RX_FRAGS,4,2       ; @MLX4_EN_MAX_RX_FRAGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed allocating rx_info ring\n"

	.comm	_DRV,4,2                        ; @DRV
l_.str.1:                               ; @.str.1
	.asciz	"Allocated rx_info ring at addr:%p size:%d\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Failed to map RX buffer\n"

.subsections_via_symbols
