	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_flow_offload               ## -- Begin function mtk_flow_offload
	.p2align	4, 0x90
_mtk_flow_offload:                      ## @mtk_flow_offload
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, %rbx
	movl	%esi, %r12d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %r14
	movq	_FLOW_OFFLOAD_DIR_ORIGINAL@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	shlq	$4, %r15
	movq	_FLOW_OFFLOAD_DIR_REPLY@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	$16, %esi
	callq	_mtk_r32
	andl	$32767, %eax                    ## imm = 0x7FFF
	movl	%eax, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	%eax, -56(%rbp)
	movl	$0, -52(%rbp)
	movq	(%r14,%r15), %rax
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.1:
	movq	_IPPROTO_UDP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_3:
	movq	_FLOW_OFFLOAD_DEL@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_5
## %bb.4:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_synchronize_rcu
LBB0_14:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	8(%r14,%r15), %eax
	cmpl	$128, %eax
	je	LBB0_2
## %bb.6:
	cmpl	$129, %eax
	jne	LBB0_2
## %bb.7:
	addq	%r14, %r15
	shlq	$4, %r13
	addq	%r14, %r13
	leaq	-48(%rbp), %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	movq	%rbx, %r14
	movq	%rbx, %rcx
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_mtk_foe_prepare_v4
	testl	%eax, %eax
	jne	LBB0_2
## %bb.8:
	leaq	-56(%rbp), %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	movq	%r14, %r8
	callq	_mtk_foe_prepare_v4
	testl	%eax, %eax
	jne	LBB0_2
## %bb.9:
	movq	%r15, %rdi
	callq	_mtk_flow_hash_v4
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_mtk_flow_hash_v4
	movl	%eax, %r15d
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_mtk_check_entry_available
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	incl	%r12d
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_mtk_check_entry_available
	testl	%eax, %eax
	je	LBB0_2
LBB0_11:
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_mtk_check_entry_available
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	incl	%r15d
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_mtk_check_entry_available
	testl	%eax, %eax
	je	LBB0_2
LBB0_13:
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	leaq	-48(%rbp), %rdi
	callq	_mtk_foe_set_mac
	movl	(%r14), %edx
	movl	4(%r14), %esi
	movl	%r12d, %ebx
	leaq	-56(%rbp), %r12
	movq	%r12, %rdi
	callq	_mtk_foe_set_mac
	movq	%r13, %rdi
	movl	%ebx, %esi
	leaq	-48(%rbp), %rdx
	callq	_mtk_foe_write
	movq	%r13, %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	callq	_mtk_foe_write
	movq	(%r13), %rax
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_rcu_assign_pointer
	movq	(%r13), %rax
	movslq	%r15d, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	%r14, %rsi
	callq	_rcu_assign_pointer
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_FLOW_OFFLOAD_DIR_ORIGINAL,8,3  ## @FLOW_OFFLOAD_DIR_ORIGINAL
	.comm	_FLOW_OFFLOAD_DIR_REPLY,8,3     ## @FLOW_OFFLOAD_DIR_REPLY
	.comm	_IPPROTO_TCP,8,3                ## @IPPROTO_TCP
	.comm	_IPPROTO_UDP,8,3                ## @IPPROTO_UDP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FLOW_OFFLOAD_DEL,4,2           ## @FLOW_OFFLOAD_DEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_flow_offload               ; -- Begin function mtk_flow_offload
	.p2align	2
_mtk_flow_offload:                      ; @mtk_flow_offload
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x4
	mov	x21, x3
	mov	x19, x2
	mov	x24, x1
	mov	x20, x0
	ldr	x25, [x2]
Lloh0:
	adrp	x8, _FLOW_OFFLOAD_DIR_ORIGINAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FLOW_OFFLOAD_DIR_ORIGINAL@GOTPAGEOFF]
Lloh2:
	ldr	x27, [x8]
	add	x23, x25, x27, lsl #4
Lloh3:
	adrp	x8, _FLOW_OFFLOAD_DIR_REPLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FLOW_OFFLOAD_DIR_REPLY@GOTPAGEOFF]
Lloh5:
	ldr	x26, [x8]
	mov	w1, #16
	bl	_mtk_r32
	and	w8, w0, #0x7fff
	stp	w8, wzr, [sp, #8]
	stp	w8, wzr, [sp]
	ldr	x8, [x23]
Lloh6:
	adrp	x9, _IPPROTO_TCP@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IPPROTO_TCP@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _IPPROTO_UDP@GOTPAGE
Lloh10:
	ldr	x10, [x10, _IPPROTO_UDP@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_8
; %bb.1:
Lloh12:
	adrp	x8, _FLOW_OFFLOAD_DEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FLOW_OFFLOAD_DEL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w24
	b.ne	LBB0_4
; %bb.2:
	bl	_synchronize_rcu
LBB0_3:
	mov	w0, #0
	b	LBB0_9
LBB0_4:
	add	x8, x25, x27, lsl #4
	ldr	w8, [x8, #8]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.5:
	cmp	w8, #129
	b.ne	LBB0_8
; %bb.6:
	add	x25, x25, x26, lsl #4
	add	x0, sp, #8
	mov	x1, x23
	mov	x2, x25
	mov	x3, x21
	mov	x4, x22
	bl	_mtk_foe_prepare_v4
	cbnz	w0, LBB0_8
; %bb.7:
	mov	x0, sp
	mov	x1, x25
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	bl	_mtk_foe_prepare_v4
	cbz	w0, LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	mov	x0, x23
	bl	_mtk_flow_hash_v4
	mov	x24, x0
	mov	x0, x25
	bl	_mtk_flow_hash_v4
	mov	x23, x0
	mov	x0, x20
	mov	x1, x24
	bl	_mtk_check_entry_available
	cbnz	w0, LBB0_12
; %bb.11:
	add	w24, w24, #1
	mov	x0, x20
	mov	x1, x24
	bl	_mtk_check_entry_available
	cbz	w0, LBB0_8
LBB0_12:
	mov	x0, x20
	mov	x1, x23
	bl	_mtk_check_entry_available
	cbnz	w0, LBB0_14
; %bb.13:
	add	w23, w23, #1
	mov	x0, x20
	mov	x1, x23
	bl	_mtk_check_entry_available
	cbz	w0, LBB0_8
LBB0_14:
	ldp	w2, w1, [x22]
	add	x0, sp, #8
	bl	_mtk_foe_set_mac
	ldp	w2, w1, [x21]
	mov	x0, sp
	bl	_mtk_foe_set_mac
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x24
	bl	_mtk_foe_write
	mov	x2, sp
	mov	x0, x20
	mov	x1, x23
	bl	_mtk_foe_write
	ldr	x8, [x20]
	ldr	w0, [x8, w24, sxtw #2]
	mov	x1, x19
	bl	_rcu_assign_pointer
	ldr	x8, [x20]
	ldr	w0, [x8, w23, sxtw #2]
	mov	x1, x19
	bl	_rcu_assign_pointer
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_FLOW_OFFLOAD_DIR_ORIGINAL,8,3  ; @FLOW_OFFLOAD_DIR_ORIGINAL
	.comm	_FLOW_OFFLOAD_DIR_REPLY,8,3     ; @FLOW_OFFLOAD_DIR_REPLY
	.comm	_IPPROTO_TCP,8,3                ; @IPPROTO_TCP
	.comm	_IPPROTO_UDP,8,3                ; @IPPROTO_UDP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FLOW_OFFLOAD_DEL,4,2           ; @FLOW_OFFLOAD_DEL
.subsections_via_symbols
