	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl92c_dm_ctrl_initgain_by_rssi
_rtl92c_dm_ctrl_initgain_by_rssi:       ## @rtl92c_dm_ctrl_initgain_by_rssi
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_rtl_priv
	movq	%rax, %rbx
	movl	(%rax), %eax
	cmpl	$10001, %eax                    ## imm = 0x2711
	jl	LBB0_3
## %bb.1:
	movl	4(%rbx), %ecx
	movl	8(%rbx), %eax
	leal	1(%rcx), %edx
	movl	%edx, 4(%rbx)
	movl	12(%rbx), %edx
	cmpl	%edx, %eax
	jge	LBB0_10
## %bb.2:
	movl	%edx, 8(%rbx)
	movl	$1, 4(%rbx)
	jmp	LBB0_13
LBB0_3:
	movl	24(%rbx), %ecx
	testl	%ecx, %ecx
	je	LBB0_20
## %bb.4:
	decl	%ecx
	movl	%ecx, 24(%rbx)
LBB0_5:
	cmpl	$249, %eax
	jg	LBB0_12
## %bb.6:
	movq	%rbx, %rdi
	movl	$1277, %esi                     ## imm = 0x4FD
	callq	_rtl_read_byte
	testb	$1, %al
	jne	LBB0_24
## %bb.7:
	movl	28(%rbx), %eax
	cmpl	%eax, (%rbx)
	jle	LBB0_28
## %bb.8:
	movl	32(%rbx), %eax
	movl	36(%rbx), %ecx
	addl	$-2, %eax
	cmpl	%ecx, %eax
	jge	LBB0_35
LBB0_9:
	movl	%ecx, 32(%rbx)
	jmp	LBB0_15
LBB0_10:
	cmpl	$2, %ecx
	jl	LBB0_13
## %bb.11:
	movl	16(%rbx), %ecx
	leal	1(%rax), %edx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %edx
	movl	%edx, 20(%rbx)
	movl	$3600, 24(%rbx)                 ## imm = 0xE10
	jmp	LBB0_13
LBB0_12:
	cmpl	$1001, %eax                     ## imm = 0x3E9
	jb	LBB0_25
LBB0_13:
	movl	44(%rbx), %eax
	addl	$2, %eax
LBB0_14:
	movl	%eax, 12(%rbx)
LBB0_15:
	movl	12(%rbx), %eax
	movl	16(%rbx), %ecx
	cmpl	%ecx, %eax
	jle	LBB0_17
## %bb.16:
	movl	%ecx, 12(%rbx)
	movl	%ecx, %eax
LBB0_17:
	movl	20(%rbx), %ecx
	cmpl	%ecx, %eax
	jge	LBB0_19
## %bb.18:
	movl	%ecx, 12(%rbx)
LBB0_19:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_rtl92c_dm_write_dig            ## TAILCALL
LBB0_20:
	movl	4(%rbx), %ecx
	cmpl	$3, %ecx
	je	LBB0_27
## %bb.21:
	testl	%ecx, %ecx
	jne	LBB0_5
## %bb.22:
	movl	8(%rbx), %ecx
	movq	_DM_DIG_MIN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%edx, %ecx
	jle	LBB0_33
## %bb.23:
	leal	-1(%rcx), %edx
	movl	%edx, 8(%rbx)
	movl	%ecx, 20(%rbx)
	jmp	LBB0_5
LBB0_24:
	movq	_DM_DIG_BACKOFF_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	jmp	LBB0_15
LBB0_25:
	cmpl	$751, %eax                      ## imm = 0x2EF
	jb	LBB0_31
## %bb.26:
	movl	44(%rbx), %eax
	incl	%eax
	jmp	LBB0_14
LBB0_27:
	movl	$0, 4(%rbx)
	jmp	LBB0_5
LBB0_28:
	jge	LBB0_15
## %bb.29:
	movl	32(%rbx), %eax
	movl	40(%rbx), %ecx
	addl	$2, %eax
	cmpl	%ecx, %eax
	jg	LBB0_9
LBB0_35:
	movl	%eax, 32(%rbx)
	jmp	LBB0_15
LBB0_31:
	cmpl	$499, %eax                      ## imm = 0x1F3
	ja	LBB0_15
## %bb.32:
	movl	44(%rbx), %eax
	decl	%eax
	jmp	LBB0_14
LBB0_33:
	movl	%edx, 8(%rbx)
	movl	%edx, 20(%rbx)
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_DM_DIG_MIN,4,2                 ## @DM_DIG_MIN
	.comm	_DM_DIG_BACKOFF_DEFAULT,4,2     ## @DM_DIG_BACKOFF_DEFAULT
	.no_dead_strip	_rtl92c_dm_ctrl_initgain_by_rssi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl92c_dm_ctrl_initgain_by_rssi
_rtl92c_dm_ctrl_initgain_by_rssi:       ; @rtl92c_dm_ctrl_initgain_by_rssi
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_rtl_priv
	mov	x20, x0
	ldr	w8, [x0]
	mov	w9, #10001
	cmp	w8, w9
	b.lt	LBB0_3
; %bb.1:
	ldp	w9, w8, [x20, #4]
	add	w10, w9, #1
	str	w10, [x20, #4]
	ldr	w10, [x20, #12]
	cmp	w8, w10
	b.ge	LBB0_10
; %bb.2:
	mov	w8, #1
	stp	w8, w10, [x20, #4]
	b	LBB0_13
LBB0_3:
	ldr	w9, [x20, #24]
	cbz	w9, LBB0_20
; %bb.4:
	sub	w9, w9, #1
	str	w9, [x20, #24]
LBB0_5:
	cmp	w8, #249
	b.gt	LBB0_12
; %bb.6:
	mov	x0, x20
	mov	w1, #1277
	bl	_rtl_read_byte
	tbnz	w0, #0, LBB0_24
; %bb.7:
	ldr	w8, [x20]
	ldr	w9, [x20, #28]
	cmp	w8, w9
	b.le	LBB0_28
; %bb.8:
	ldp	w9, w8, [x20, #32]
	sub	w9, w9, #2
	cmp	w9, w8
	b.ge	LBB0_30
LBB0_9:
	str	w8, [x20, #32]
	b	LBB0_15
LBB0_10:
	cmp	w9, #2
	b.lt	LBB0_13
; %bb.11:
	ldr	w9, [x20, #16]
	cmp	w8, w9
	csinc	w8, w9, w8, ge
	mov	w9, #3600
	stp	w8, w9, [x20, #20]
	b	LBB0_13
LBB0_12:
	cmp	w8, #1001
	b.lo	LBB0_25
LBB0_13:
	ldr	w8, [x20, #44]
	add	w8, w8, #2
LBB0_14:
	str	w8, [x20, #12]
LBB0_15:
	ldp	w8, w9, [x20, #12]
	cmp	w8, w9
	b.le	LBB0_17
; %bb.16:
	str	w9, [x20, #12]
	mov	x8, x9
LBB0_17:
	ldr	w9, [x20, #20]
	cmp	w8, w9
	b.ge	LBB0_19
; %bb.18:
	str	w9, [x20, #12]
LBB0_19:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_rtl92c_dm_write_dig
LBB0_20:
	ldr	w9, [x20, #4]
	cmp	w9, #3
	b.eq	LBB0_27
; %bb.21:
	cbnz	w9, LBB0_5
; %bb.22:
	ldr	w9, [x20, #8]
Lloh0:
	adrp	x10, _DM_DIG_MIN@GOTPAGE
Lloh1:
	ldr	x10, [x10, _DM_DIG_MIN@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	cmp	w9, w10
	b.le	LBB0_33
; %bb.23:
	sub	w10, w9, #1
	str	w10, [x20, #8]
	str	w9, [x20, #20]
	b	LBB0_5
LBB0_24:
Lloh3:
	adrp	x8, _DM_DIG_BACKOFF_DEFAULT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DM_DIG_BACKOFF_DEFAULT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20, #32]
	b	LBB0_15
LBB0_25:
	cmp	w8, #751
	b.lo	LBB0_31
; %bb.26:
	ldr	w8, [x20, #44]
	add	w8, w8, #1
	b	LBB0_14
LBB0_27:
	str	wzr, [x20, #4]
	b	LBB0_5
LBB0_28:
	b.ge	LBB0_15
; %bb.29:
	ldr	w8, [x20, #32]
	add	w8, w8, #2
	ldr	w9, [x20, #40]
	cmp	w8, w9
	b.le	LBB0_9
LBB0_30:
	str	w9, [x20, #32]
	b	LBB0_15
LBB0_31:
	cmp	w8, #499
	b.hi	LBB0_15
; %bb.32:
	ldr	w8, [x20, #44]
	sub	w8, w8, #1
	b	LBB0_14
LBB0_33:
	str	w10, [x20, #8]
	str	w10, [x20, #20]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DM_DIG_MIN,4,2                 ; @DM_DIG_MIN
	.comm	_DM_DIG_BACKOFF_DEFAULT,4,2     ; @DM_DIG_BACKOFF_DEFAULT
	.no_dead_strip	_rtl92c_dm_ctrl_initgain_by_rssi
.subsections_via_symbols
