	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _rtl92s_dm_initial_gain_sta_beforeconnect
__rtl92s_dm_initial_gain_sta_beforeconnect: ## @_rtl92s_dm_initial_gain_sta_beforeconnect
	.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, %r14
	callq	_rtl_priv
	movq	%rax, %rbx
	movq	32(%rax), %rax
	movq	_DIG_STA_BEFORE_CONNECT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rax, 24(%rbx)
	je	LBB0_2
## %bb.1:
	cmpq	%rcx, %rax
	je	LBB0_2
## %bb.22:
	movq	_DIG_EXT_PORT_STAGE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 84(%rbx)
	movq	_FW_CMD_DIG_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rtl92s_phy_set_fw_cmd
	movq	_DM_DIG_BACKOFF_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
	movq	(%rbx), %rax
	movslq	(%rax), %rax
	movq	%rax, 64(%rbx)
	movl	$0, 80(%rbx)
	jmp	LBB0_21
LBB0_2:
	cmpq	%rcx, %rax
	jne	LBB0_21
## %bb.3:
	movq	8(%rbx), %rax
	movq	_ERFON@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.4:
	cmpq	$0, 88(%rbx)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_rtl92s_backoff_enable_flag
	movq	40(%rbx), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_DM_DIG_BACKOFF_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
LBB0_7:
	movq	48(%rbx), %rdx
	subq	%rax, %rdx
	movq	56(%rbx), %rax
	addq	$10, %rdx
	cmpq	%rax, %rdx
	jle	LBB0_9
## %bb.8:
	movq	%rax, 64(%rbx)
	movq	%rax, %rcx
	jmp	LBB0_12
LBB0_9:
	movq	72(%rbx), %rcx
	cmpq	%rcx, %rdx
	jge	LBB0_11
## %bb.10:
	movq	%rcx, 64(%rbx)
	jmp	LBB0_12
LBB0_11:
	movq	%rdx, 64(%rbx)
	movq	%rdx, %rcx
LBB0_12:
	movl	16(%rbx), %edx
	cmpl	$10001, %edx                    ## imm = 0x2711
	jl	LBB0_14
## %bb.13:
	cmpq	$52, %rcx
	movl	$51, %esi
	cmovgeq	%rcx, %rsi
	cmpl	$16001, %edx                    ## imm = 0x3E81
	cmovaeq	%rax, %rsi
	movq	%rsi, 64(%rbx)
LBB0_14:
	movl	80(%rbx), %r15d
	movq	_ROFDM0_XAAGCCORE1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_MASKBYTE0@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r14, %rdi
	callq	_rtl_get_bbreg
	cmpl	%eax, %r15d
	jne	LBB0_16
## %bb.15:
	movb	__rtl92s_dm_initial_gain_sta_beforeconnect.force_write(%rip), %al
	jmp	LBB0_17
LBB0_16:
	movb	$1, __rtl92s_dm_initial_gain_sta_beforeconnect.force_write(%rip)
	movb	$1, %al
LBB0_17:
	movslq	80(%rbx), %rcx
	cmpq	%rcx, 64(%rbx)
	jne	LBB0_20
## %bb.18:
	testb	$1, __rtl92s_dm_initial_gain_sta_beforeconnect.initialized(%rip)
	je	LBB0_20
## %bb.19:
	testb	$1, %al
	je	LBB0_21
LBB0_20:
	movq	_FW_CMD_DIG_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rtl92s_phy_set_fw_cmd
	movl	64(%rbx), %r15d
	movl	(%r13), %esi
	movl	(%r12), %edx
	movq	%r14, %rdi
	movl	%r15d, %ecx
	callq	_rtl_set_bbreg
	movq	_ROFDM0_XBAGCCORE1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%r14, %rdi
	movl	%r15d, %ecx
	callq	_rtl_set_bbreg
	movl	64(%rbx), %eax
	movl	%eax, 80(%rbx)
	movb	$1, __rtl92s_dm_initial_gain_sta_beforeconnect.initialized(%rip)
	movb	$0, __rtl92s_dm_initial_gain_sta_beforeconnect.force_write(%rip)
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,__rtl92s_dm_initial_gain_sta_beforeconnect.initialized,1,2 ## @_rtl92s_dm_initial_gain_sta_beforeconnect.initialized
.zerofill __DATA,__bss,__rtl92s_dm_initial_gain_sta_beforeconnect.force_write,1,2 ## @_rtl92s_dm_initial_gain_sta_beforeconnect.force_write
	.comm	_DIG_STA_BEFORE_CONNECT,8,3     ## @DIG_STA_BEFORE_CONNECT
	.comm	_ERFON,8,3                      ## @ERFON
	.comm	_DM_DIG_BACKOFF_MAX,8,3         ## @DM_DIG_BACKOFF_MAX
	.comm	_DIG_EXT_PORT_STAGE_MAX,4,2     ## @DIG_EXT_PORT_STAGE_MAX
	.comm	_FW_CMD_DIG_ENABLE,4,2          ## @FW_CMD_DIG_ENABLE
	.comm	_ROFDM0_XAAGCCORE1,4,2          ## @ROFDM0_XAAGCCORE1
	.comm	_MASKBYTE0,4,2                  ## @MASKBYTE0
	.comm	_FW_CMD_DIG_DISABLE,4,2         ## @FW_CMD_DIG_DISABLE
	.comm	_ROFDM0_XBAGCCORE1,4,2          ## @ROFDM0_XBAGCCORE1
	.no_dead_strip	__rtl92s_dm_initial_gain_sta_beforeconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _rtl92s_dm_initial_gain_sta_beforeconnect
__rtl92s_dm_initial_gain_sta_beforeconnect: ; @_rtl92s_dm_initial_gain_sta_beforeconnect
	.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	x20, x0
	bl	_rtl_priv
	mov	x19, x0
	ldp	x10, x8, [x0, #24]
Lloh0:
	adrp	x9, _DIG_STA_BEFORE_CONNECT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DIG_STA_BEFORE_CONNECT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x10, x8
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_5
; %bb.1:
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _ERFON@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ERFON@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	x8, [x19, #88]
	cbz	x8, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_rtl92s_backoff_enable_flag
	ldr	x9, [x19, #40]
	b	LBB0_8
LBB0_5:
Lloh6:
	adrp	x8, _DIG_EXT_PORT_STAGE_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DIG_EXT_PORT_STAGE_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #84]
Lloh9:
	adrp	x8, _FW_CMD_DIG_ENABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FW_CMD_DIG_ENABLE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rtl92s_phy_set_fw_cmd
Lloh12:
	adrp	x8, _DM_DIG_BACKOFF_MAX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DM_DIG_BACKOFF_MAX@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [x19, #40]
	ldr	x8, [x19]
	ldrsw	x8, [x8]
	str	x8, [x19, #64]
	str	wzr, [x19, #80]
LBB0_6:
	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
LBB0_7:
Lloh15:
	adrp	x8, _DM_DIG_BACKOFF_MAX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DM_DIG_BACKOFF_MAX@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x8]
	str	x9, [x19, #40]
LBB0_8:
	ldp	x10, x8, [x19, #48]
	sub	x9, x10, x9
	add	x10, x9, #10
	cmp	x10, x8
	b.le	LBB0_10
; %bb.9:
	str	x8, [x19, #64]
	mov	x9, x8
	b	LBB0_13
LBB0_10:
	ldr	x9, [x19, #72]
	cmp	x10, x9
	b.ge	LBB0_12
; %bb.11:
	str	x9, [x19, #64]
	b	LBB0_13
LBB0_12:
	str	x10, [x19, #64]
	mov	x9, x10
LBB0_13:
	ldr	w10, [x19, #16]
	mov	w11, #10001
	cmp	w10, w11
	b.lt	LBB0_15
; %bb.14:
	mov	w11, #51
	cmp	x9, #51
	csel	x9, x9, x11, gt
	mov	w11, #16000
	cmp	w10, w11
	csel	x8, x8, x9, hi
	str	x8, [x19, #64]
LBB0_15:
	ldr	w21, [x19, #80]
Lloh18:
	adrp	x24, _ROFDM0_XAAGCCORE1@GOTPAGE
Lloh19:
	ldr	x24, [x24, _ROFDM0_XAAGCCORE1@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh20:
	adrp	x23, _MASKBYTE0@GOTPAGE
Lloh21:
	ldr	x23, [x23, _MASKBYTE0@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	bl	_rtl_get_bbreg
	adrp	x22, __rtl92s_dm_initial_gain_sta_beforeconnect.force_write@PAGE
	cmp	w21, w0
	b.ne	LBB0_17
; %bb.16:
	ldrb	w8, [x22, __rtl92s_dm_initial_gain_sta_beforeconnect.force_write@PAGEOFF]
	b	LBB0_18
LBB0_17:
	mov	w8, #1
	strb	w8, [x22, __rtl92s_dm_initial_gain_sta_beforeconnect.force_write@PAGEOFF]
LBB0_18:
	ldrsw	x9, [x19, #80]
	ldr	x10, [x19, #64]
	adrp	x25, __rtl92s_dm_initial_gain_sta_beforeconnect.initialized@PAGE
	cmp	x10, x9
	b.ne	LBB0_21
; %bb.19:
	ldrb	w9, [x25, __rtl92s_dm_initial_gain_sta_beforeconnect.initialized@PAGEOFF]
	cbz	w9, LBB0_21
; %bb.20:
	cbz	w8, LBB0_6
LBB0_21:
Lloh22:
	adrp	x8, _FW_CMD_DIG_DISABLE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FW_CMD_DIG_DISABLE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rtl92s_phy_set_fw_cmd
	ldr	w21, [x19, #64]
	ldr	w1, [x24]
	ldr	w2, [x23]
	mov	x0, x20
	mov	x3, x21
	bl	_rtl_set_bbreg
Lloh25:
	adrp	x8, _ROFDM0_XBAGCCORE1@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ROFDM0_XBAGCCORE1@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	ldr	w2, [x23]
	mov	x0, x20
	mov	x3, x21
	bl	_rtl_set_bbreg
	ldr	x8, [x19, #64]
	str	w8, [x19, #80]
	mov	w8, #1
	strb	w8, [x25, __rtl92s_dm_initial_gain_sta_beforeconnect.initialized@PAGEOFF]
	strb	wzr, [x22, __rtl92s_dm_initial_gain_sta_beforeconnect.force_write@PAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,__rtl92s_dm_initial_gain_sta_beforeconnect.initialized,1,2 ; @_rtl92s_dm_initial_gain_sta_beforeconnect.initialized
.zerofill __DATA,__bss,__rtl92s_dm_initial_gain_sta_beforeconnect.force_write,1,2 ; @_rtl92s_dm_initial_gain_sta_beforeconnect.force_write
	.comm	_DIG_STA_BEFORE_CONNECT,8,3     ; @DIG_STA_BEFORE_CONNECT
	.comm	_ERFON,8,3                      ; @ERFON
	.comm	_DM_DIG_BACKOFF_MAX,8,3         ; @DM_DIG_BACKOFF_MAX
	.comm	_DIG_EXT_PORT_STAGE_MAX,4,2     ; @DIG_EXT_PORT_STAGE_MAX
	.comm	_FW_CMD_DIG_ENABLE,4,2          ; @FW_CMD_DIG_ENABLE
	.comm	_ROFDM0_XAAGCCORE1,4,2          ; @ROFDM0_XAAGCCORE1
	.comm	_MASKBYTE0,4,2                  ; @MASKBYTE0
	.comm	_FW_CMD_DIG_DISABLE,4,2         ; @FW_CMD_DIG_DISABLE
	.comm	_ROFDM0_XBAGCCORE1,4,2          ; @ROFDM0_XBAGCCORE1
	.no_dead_strip	__rtl92s_dm_initial_gain_sta_beforeconnect
.subsections_via_symbols
