	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ene_rx_setup_hw_buffer
_ene_rx_setup_hw_buffer:                ## @ene_rx_setup_hw_buffer
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_ene_rx_read_hw_pointer
	movl	4(%rbx), %eax
	movl	%eax, (%rbx)
	cmpl	$0, 8(%rbx)
	je	LBB0_6
## %bb.1:
	movq	_ENE_FW_SAMPLE_BUFFER@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_ene_read_reg
	movl	%eax, %r14d
	movq	(%r15), %rsi
	incq	%rsi
	movq	%rbx, %rdi
	callq	_ene_read_reg
	shll	$8, %eax
	orl	%r14d, %eax
	movl	%eax, 16(%rbx)
	movq	(%r15), %rsi
	addq	$2, %rsi
	movq	%rbx, %rdi
	callq	_ene_read_reg
	movl	%eax, 20(%rbx)
	movq	(%r15), %rsi
	addq	$3, %rsi
	movq	%rbx, %rdi
	callq	_ene_read_reg
	movl	%eax, %r14d
	movq	(%r15), %rsi
	addq	$4, %rsi
	movq	%rbx, %rdi
	callq	_ene_read_reg
	shll	$8, %eax
	orl	%r14d, %eax
	movl	%eax, 24(%rbx)
	movq	(%r15), %rsi
	addq	$5, %rsi
	movq	%rbx, %rdi
	callq	_ene_read_reg
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 28(%rbx)
	movl	20(%rbx), %ecx
	addl	%ecx, %eax
	addl	$8, %eax
	movl	%eax, 12(%rbx)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_notice
	movl	16(%rbx), %esi
	movl	20(%rbx), %edx
	leaq	L_.str.1(%rip), %r14
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_pr_notice
	movl	24(%rbx), %esi
	movl	28(%rbx), %edx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_pr_notice
	movl	12(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_notice
	movl	12(%rbx), %eax
	leal	-65(%rax), %ecx
	cmpl	$-49, %ecx
	jb	LBB0_5
## %bb.2:
	movl	$-64509, %ecx                   ## imm = 0xFFFF0403
	movl	16(%rbx), %edx
	addl	%ecx, %edx
	cmpl	$-4093, %edx                    ## imm = 0xF003
	jb	LBB0_5
## %bb.3:
	addl	24(%rbx), %ecx
	cmpl	$-4093, %ecx                    ## imm = 0xF003
	jb	LBB0_5
## %bb.4:
	cmpl	%eax, (%rbx)
	jle	LBB0_7
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_warn
	movl	$0, 8(%rbx)
	movq	_ENE_FW1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ENE_FW1_EXTRA_BUF_HND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ene_clear_reg_mask             ## TAILCALL
LBB0_6:
	movq	_ENE_FW_PACKET_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	movl	%eax, 12(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENE_FW1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ENE_FW1_EXTRA_BUF_HND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ene_set_reg_mask               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENE_FW_PACKET_SIZE,4,2         ## @ENE_FW_PACKET_SIZE
	.comm	_ENE_FW_SAMPLE_BUFFER,8,3       ## @ENE_FW_SAMPLE_BUFFER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Hardware uses 2 extended buffers:\n"

L_.str.1:                               ## @.str.1
	.asciz	"  0x%04x - len : %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Total buffer len = %d\n"

	.comm	_ENE_FW1,4,2                    ## @ENE_FW1
	.comm	_ENE_FW1_EXTRA_BUF_HND,4,2      ## @ENE_FW1_EXTRA_BUF_HND
L_.str.3:                               ## @.str.3
	.asciz	"Error validating extra buffers, device probably won't work\n"

	.no_dead_strip	_ene_rx_setup_hw_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ene_rx_setup_hw_buffer
_ene_rx_setup_hw_buffer:                ; @ene_rx_setup_hw_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_ene_rx_read_hw_pointer
	ldp	w8, w9, [x19, #4]
	str	w8, [x19]
	cbz	w9, LBB0_6
; %bb.1:
Lloh0:
	adrp	x21, _ENE_FW_SAMPLE_BUFFER@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ENE_FW_SAMPLE_BUFFER@GOTPAGEOFF]
	ldr	x1, [x21]
	mov	x0, x19
	bl	_ene_read_reg
	mov	x20, x0
	ldr	x8, [x21]
	add	x1, x8, #1
	mov	x0, x19
	bl	_ene_read_reg
	orr	w8, w20, w0, lsl #8
	str	w8, [x19, #16]
	ldr	x8, [x21]
	add	x1, x8, #2
	mov	x0, x19
	bl	_ene_read_reg
	str	w0, [x19, #20]
	ldr	x8, [x21]
	add	x1, x8, #3
	mov	x0, x19
	bl	_ene_read_reg
	mov	x20, x0
	ldr	x8, [x21]
	add	x1, x8, #4
	mov	x0, x19
	bl	_ene_read_reg
	orr	w8, w20, w0, lsl #8
	str	w8, [x19, #24]
	ldr	x8, [x21]
	add	x1, x8, #5
	mov	x0, x19
	bl	_ene_read_reg
	str	w0, [x19, #28]
	ldr	w8, [x19, #20]
	add	w8, w0, w8
	add	w8, w8, #8
	str	w8, [x19, #12]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_notice
	ldp	w8, w9, [x19, #16]
	stp	x8, x9, [sp]
Lloh4:
	adrp	x20, l_.str.1@PAGE
Lloh5:
	add	x20, x20, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_pr_notice
	ldp	w8, w9, [x19, #24]
	stp	x8, x9, [sp]
	mov	x0, x20
	bl	_pr_notice
	ldr	w8, [x19, #12]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_notice
	ldr	w8, [x19, #12]
	sub	w9, w8, #65
	cmn	w9, #49
	b.lo	LBB0_5
; %bb.2:
	ldr	w10, [x19, #16]
	mov	w9, #-64509
	add	w10, w10, w9
	cmn	w10, #4093
	b.lo	LBB0_5
; %bb.3:
	ldr	w10, [x19, #24]
	add	w9, w10, w9
	cmn	w9, #4093
	b.lo	LBB0_5
; %bb.4:
	ldr	w9, [x19]
	cmp	w9, w8
	b.le	LBB0_7
LBB0_5:
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_warn
	str	wzr, [x19, #8]
Lloh10:
	adrp	x8, _ENE_FW1@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENE_FW1@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _ENE_FW1_EXTRA_BUF_HND@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENE_FW1_EXTRA_BUF_HND@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	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
	add	sp, sp, #64
	b	_ene_clear_reg_mask
LBB0_6:
Lloh16:
	adrp	x8, _ENE_FW_PACKET_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENE_FW_PACKET_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	lsl	w8, w8, #1
	str	w8, [x19, #12]
	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
	add	sp, sp, #64
	ret
LBB0_7:
Lloh19:
	adrp	x8, _ENE_FW1@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENE_FW1@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x8, _ENE_FW1_EXTRA_BUF_HND@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENE_FW1_EXTRA_BUF_HND@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x19
	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
	add	sp, sp, #64
	b	_ene_set_reg_mask
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ENE_FW_PACKET_SIZE,4,2         ; @ENE_FW_PACKET_SIZE
	.comm	_ENE_FW_SAMPLE_BUFFER,8,3       ; @ENE_FW_SAMPLE_BUFFER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Hardware uses 2 extended buffers:\n"

l_.str.1:                               ; @.str.1
	.asciz	"  0x%04x - len : %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Total buffer len = %d\n"

	.comm	_ENE_FW1,4,2                    ; @ENE_FW1
	.comm	_ENE_FW1_EXTRA_BUF_HND,4,2      ; @ENE_FW1_EXTRA_BUF_HND
l_.str.3:                               ; @.str.3
	.asciz	"Error validating extra buffers, device probably won't work\n"

	.no_dead_strip	_ene_rx_setup_hw_buffer
.subsections_via_symbols
