	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_h2c
_init_h2c:                              ## @init_h2c
	.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, %r14
	movl	(%rdi), %ebx
	movq	_TX_PAGE_SIZE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_RSVD_PG_H2CQ_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	shll	%cl, %r15d
	movq	_REG_H2C_HEAD@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_rtw_read32
	andl	$-262144, %eax                  ## imm = 0xFFFC0000
	orl	%ebx, %eax
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_rtw_write32
	movq	_REG_H2C_READ_ADDR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_rtw_read32
	andl	$-262144, %eax                  ## imm = 0xFFFC0000
	orl	%ebx, %eax
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_rtw_write32
	movq	_REG_H2C_TAIL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_rtw_read32
	andl	$-262144, %eax                  ## imm = 0xFFFC0000
	addl	%r15d, %ebx
	orl	%eax, %ebx
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_rtw_write32
	movq	_REG_H2C_INFO@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_rtw_read8
                                        ## kill: def $eax killed $eax def $rax
	andl	$252, %eax
	leal	1(%rax), %edx
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_rtw_write8
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_rtw_read8
	orl	$4, %eax
	movzbl	%al, %edx
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_rtw_write8
	movq	_REG_TXDMA_OFFSET_CHK@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	incq	%rsi
	movq	%r14, %rdi
	callq	_rtw_read8
	orl	$128, %eax
	movzbl	%al, %edx
	movq	(%rbx), %rsi
	incq	%rsi
	movq	%r14, %rdi
	callq	_rtw_write8
	movq	_REG_H2C_PKT_WRITEADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rtw_read32
	movl	%eax, %ebx
	andl	$262143, %ebx                   ## imm = 0x3FFFF
	movq	_REG_H2C_PKT_READADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rtw_read32
	movl	%eax, %ecx
	andl	$262143, %ecx                   ## imm = 0x3FFFF
	xorl	%eax, %eax
	subl	%ebx, %ecx
	movl	%r15d, %edx
	cmoval	%eax, %edx
	addl	%edx, %ecx
	cmpl	%ecx, %r15d
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_rtw_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TX_PAGE_SIZE_SHIFT,4,2         ## @TX_PAGE_SIZE_SHIFT
	.comm	_RSVD_PG_H2CQ_NUM,4,2           ## @RSVD_PG_H2CQ_NUM
	.comm	_REG_H2C_HEAD,4,2               ## @REG_H2C_HEAD
	.comm	_REG_H2C_READ_ADDR,4,2          ## @REG_H2C_READ_ADDR
	.comm	_REG_H2C_TAIL,4,2               ## @REG_H2C_TAIL
	.comm	_REG_H2C_INFO,8,3               ## @REG_H2C_INFO
	.comm	_REG_TXDMA_OFFSET_CHK,8,3       ## @REG_TXDMA_OFFSET_CHK
	.comm	_REG_H2C_PKT_WRITEADDR,4,2      ## @REG_H2C_PKT_WRITEADDR
	.comm	_REG_H2C_PKT_READADDR,4,2       ## @REG_H2C_PKT_READADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"H2C queue mismatch\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_init_h2c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_h2c
_init_h2c:                              ; @init_h2c
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _TX_PAGE_SIZE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TX_PAGE_SIZE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _RSVD_PG_H2CQ_NUM@GOTPAGE
Lloh4:
	ldr	x10, [x10, _RSVD_PG_H2CQ_NUM@GOTPAGEOFF]
	lsl	w21, w8, w9
Lloh5:
	ldr	w8, [x10]
	lsl	w20, w8, w9
Lloh6:
	adrp	x22, _REG_H2C_HEAD@GOTPAGE
Lloh7:
	ldr	x22, [x22, _REG_H2C_HEAD@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_rtw_read32
	and	w8, w0, #0xfffc0000
	orr	w2, w8, w21
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtw_write32
Lloh8:
	adrp	x22, _REG_H2C_READ_ADDR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _REG_H2C_READ_ADDR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtw_read32
	and	w8, w0, #0xfffc0000
	orr	w2, w8, w21
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtw_write32
Lloh10:
	adrp	x22, _REG_H2C_TAIL@GOTPAGE
Lloh11:
	ldr	x22, [x22, _REG_H2C_TAIL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtw_read32
	and	w8, w0, #0xfffc0000
	add	w9, w20, w21
	orr	w2, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtw_write32
Lloh12:
	adrp	x21, _REG_H2C_INFO@GOTPAGE
Lloh13:
	ldr	x21, [x21, _REG_H2C_INFO@GOTPAGEOFF]
	ldr	x1, [x21]
	mov	x0, x19
	bl	_rtw_read8
	and	w8, w0, #0xfc
	orr	w2, w8, #0x1
	ldr	x1, [x21]
	mov	x0, x19
	bl	_rtw_write8
	ldr	x1, [x21]
	mov	x0, x19
	bl	_rtw_read8
	and	w8, w0, #0xff
	orr	w2, w8, #0x4
	ldr	x1, [x21]
	mov	x0, x19
	bl	_rtw_write8
Lloh14:
	adrp	x21, _REG_TXDMA_OFFSET_CHK@GOTPAGE
Lloh15:
	ldr	x21, [x21, _REG_TXDMA_OFFSET_CHK@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x1, x8, #1
	mov	x0, x19
	bl	_rtw_read8
	mov	w2, #128
	bfxil	w2, w0, #0, #7
	ldr	x8, [x21]
	add	x1, x8, #1
	mov	x0, x19
	bl	_rtw_write8
Lloh16:
	adrp	x8, _REG_H2C_PKT_WRITEADDR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REG_H2C_PKT_WRITEADDR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtw_read32
	and	w21, w0, #0x3ffff
Lloh19:
	adrp	x8, _REG_H2C_PKT_READADDR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _REG_H2C_PKT_READADDR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtw_read32
	mov	x8, x0
	mov	w0, #0
	and	w8, w8, #0x3ffff
	subs	w8, w8, w21
	csel	w9, wzr, w20, hi
	add	w8, w8, w9
	cmp	w20, w8
	b.eq	LBB0_2
; %bb.1:
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_rtw_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	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 AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_TX_PAGE_SIZE_SHIFT,4,2         ; @TX_PAGE_SIZE_SHIFT
	.comm	_RSVD_PG_H2CQ_NUM,4,2           ; @RSVD_PG_H2CQ_NUM
	.comm	_REG_H2C_HEAD,4,2               ; @REG_H2C_HEAD
	.comm	_REG_H2C_READ_ADDR,4,2          ; @REG_H2C_READ_ADDR
	.comm	_REG_H2C_TAIL,4,2               ; @REG_H2C_TAIL
	.comm	_REG_H2C_INFO,8,3               ; @REG_H2C_INFO
	.comm	_REG_TXDMA_OFFSET_CHK,8,3       ; @REG_TXDMA_OFFSET_CHK
	.comm	_REG_H2C_PKT_WRITEADDR,4,2      ; @REG_H2C_PKT_WRITEADDR
	.comm	_REG_H2C_PKT_READADDR,4,2       ; @REG_H2C_PKT_READADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"H2C queue mismatch\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_init_h2c
.subsections_via_symbols
