	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipw2100_wx_set_rate
_ipw2100_wx_set_rate:                   ## @ipw2100_wx_set_rate
	.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	%rdx, %r12
	callq	_libipw_priv
	movq	%rax, %r15
	movl	(%r12), %ebx
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_STATUS_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_1
## %bb.2:
	cmpl	$1000000, %ebx                  ## imm = 0xF4240
	je	LBB0_5
## %bb.3:
	xorl	%r13d, %r13d
	cmpl	$0, 4(%r12)
	jne	LBB0_6
## %bb.4:
	cmpl	$1000001, %ebx                  ## imm = 0xF4241
	jl	LBB0_6
LBB0_5:
	movq	_TX_RATE_1_MBIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_6:
	cmpl	$2000000, %ebx                  ## imm = 0x1E8480
	je	LBB0_9
## %bb.7:
	cmpl	$0, 4(%r12)
	jne	LBB0_10
## %bb.8:
	cmpl	$2000001, %ebx                  ## imm = 0x1E8481
	jl	LBB0_10
LBB0_9:
	movq	_TX_RATE_2_MBIT@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
LBB0_10:
	cmpl	$5500000, %ebx                  ## imm = 0x53EC60
	je	LBB0_13
## %bb.11:
	cmpl	$0, 4(%r12)
	jne	LBB0_14
## %bb.12:
	cmpl	$5500001, %ebx                  ## imm = 0x53EC61
	jl	LBB0_14
LBB0_13:
	movq	_TX_RATE_5_5_MBIT@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
LBB0_14:
	cmpl	$11000000, %ebx                 ## imm = 0xA7D8C0
	je	LBB0_17
## %bb.15:
	cmpl	$0, 4(%r12)
	jne	LBB0_18
## %bb.16:
	cmpl	$11000001, %ebx                 ## imm = 0xA7D8C1
	jl	LBB0_18
LBB0_17:
	movq	_TX_RATE_11_MBIT@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
LBB0_18:
	testl	%r13d, %r13d
	jne	LBB0_20
## %bb.19:
	movq	_DEFAULT_TX_RATES@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_20:
	movq	%r15, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_ipw2100_set_tx_rates
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_IPW_DEBUG_WX
	jmp	LBB0_21
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_21:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATUS_INITIALIZED,4,2         ## @STATUS_INITIALIZED
	.comm	_EIO,4,2                        ## @EIO
	.comm	_TX_RATE_1_MBIT,4,2             ## @TX_RATE_1_MBIT
	.comm	_TX_RATE_2_MBIT,4,2             ## @TX_RATE_2_MBIT
	.comm	_TX_RATE_5_5_MBIT,4,2           ## @TX_RATE_5_5_MBIT
	.comm	_TX_RATE_11_MBIT,4,2            ## @TX_RATE_11_MBIT
	.comm	_DEFAULT_TX_RATES,4,2           ## @DEFAULT_TX_RATES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SET Rate -> %04X\n"

	.no_dead_strip	_ipw2100_wx_set_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipw2100_wx_set_rate
_ipw2100_wx_set_rate:                   ; @ipw2100_wx_set_rate
	.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	x21, x2
	bl	_libipw_priv
	mov	x20, x0
	ldr	w22, [x21]
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _STATUS_INITIALIZED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STATUS_INITIALIZED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.1:
	mov	w9, #16960
	movk	w9, #15, lsl #16
	cmp	w22, w9
	b.eq	LBB0_4
; %bb.2:
	mov	w8, #0
	ldr	w10, [x21, #4]
	cbnz	w10, LBB0_5
; %bb.3:
	cmp	w22, w9
	b.le	LBB0_5
LBB0_4:
Lloh3:
	adrp	x8, _TX_RATE_1_MBIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TX_RATE_1_MBIT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
LBB0_5:
	mov	w9, #33920
	movk	w9, #30, lsl #16
	cmp	w22, w9
	b.eq	LBB0_8
; %bb.6:
	ldr	w10, [x21, #4]
	cbnz	w10, LBB0_9
; %bb.7:
	cmp	w22, w9
	b.le	LBB0_9
LBB0_8:
Lloh6:
	adrp	x9, _TX_RATE_2_MBIT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TX_RATE_2_MBIT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_9:
	mov	w9, #60512
	movk	w9, #83, lsl #16
	cmp	w22, w9
	b.eq	LBB0_12
; %bb.10:
	ldr	w10, [x21, #4]
	cbnz	w10, LBB0_13
; %bb.11:
	cmp	w22, w9
	b.le	LBB0_13
LBB0_12:
Lloh9:
	adrp	x9, _TX_RATE_5_5_MBIT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TX_RATE_5_5_MBIT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_13:
	mov	w9, #55488
	movk	w9, #167, lsl #16
	cmp	w22, w9
	b.eq	LBB0_16
; %bb.14:
	ldr	w10, [x21, #4]
	cbnz	w10, LBB0_17
; %bb.15:
	cmp	w22, w9
	b.le	LBB0_17
LBB0_16:
Lloh12:
	adrp	x9, _TX_RATE_11_MBIT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _TX_RATE_11_MBIT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_17:
Lloh15:
	adrp	x9, _DEFAULT_TX_RATES@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DEFAULT_TX_RATES@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w21, w9, w8, eq
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_ipw2100_set_tx_rates
	mov	x20, x0
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_IPW_DEBUG_WX
	b	LBB0_19
LBB0_18:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_19:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_STATUS_INITIALIZED,4,2         ; @STATUS_INITIALIZED
	.comm	_EIO,4,2                        ; @EIO
	.comm	_TX_RATE_1_MBIT,4,2             ; @TX_RATE_1_MBIT
	.comm	_TX_RATE_2_MBIT,4,2             ; @TX_RATE_2_MBIT
	.comm	_TX_RATE_5_5_MBIT,4,2           ; @TX_RATE_5_5_MBIT
	.comm	_TX_RATE_11_MBIT,4,2            ; @TX_RATE_11_MBIT
	.comm	_DEFAULT_TX_RATES,4,2           ; @DEFAULT_TX_RATES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SET Rate -> %04X\n"

	.no_dead_strip	_ipw2100_wx_set_rate
.subsections_via_symbols
