	.file	"extr_ipw2200.c_ipw_set_tx_power.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ipw_set_tx_power, @function
ipw_set_tx_power:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xor	ebx, ebx
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rdi, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	r12, rsp
	call	libipw_get_geo@PLT
	mov	edx, 24
	xor	esi, esi
	mov	rdi, r12
	mov	r13, rax
	call	memset@PLT
	mov	eax, DWORD PTR IPW_G_MODE[rip]
	mov	rcx, QWORD PTR 8[rsp]
	mov	DWORD PTR 16[rsp], eax
	mov	eax, DWORD PTR 0[r13]
	mov	DWORD PTR [rsp], eax
	test	eax, eax
	jg	.L6
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	mov	QWORD PTR [rdx], rsi
	add	rbx, 1
	cmp	DWORD PTR 0[r13], ebx
	jle	.L7
.L6:
	mov	rax, QWORD PTR 16[r13]
	mov	rbp, rbx
	mov	rsi, QWORD PTR [r14]
	sal	rbp, 4
	add	rax, rbp
	lea	rdx, [rcx+rbp]
	mov	rdi, QWORD PTR 8[rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR 8[rdx], eax
	test	rdi, rdi
	je	.L5
	call	min@PLT
	mov	rcx, QWORD PTR 8[rsp]
	add	rbx, 1
	mov	rsi, rax
	lea	rdx, [rcx+rbp]
	mov	QWORD PTR [rdx], rsi
	cmp	DWORD PTR 0[r13], ebx
	jg	.L6
.L7:
	mov	rsi, r12
	mov	rdi, r14
	call	ipw_send_tx_power@PLT
	test	rax, rax
	je	.L32
.L12:
	mov	eax, DWORD PTR EIO[rip]
	neg	eax
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L33
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	mov	eax, DWORD PTR IPW_B_MODE[rip]
	mov	rsi, r12
	mov	rdi, r14
	mov	DWORD PTR 16[rsp], eax
	call	ipw_send_tx_power@PLT
	test	rax, rax
	jne	.L12
	mov	rax, QWORD PTR 8[r14]
	cmp	QWORD PTR [rax], 0
	je	.L13
	mov	eax, DWORD PTR IPW_A_MODE[rip]
	mov	rcx, QWORD PTR 8[rsp]
	xor	ebx, ebx
	mov	DWORD PTR 16[rsp], eax
	mov	eax, DWORD PTR 4[r13]
	mov	DWORD PTR [rsp], eax
	test	eax, eax
	jg	.L15
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L14:
	mov	QWORD PTR [rdx], rsi
	add	rbx, 1
	cmp	DWORD PTR [rsp], ebx
	jle	.L16
.L15:
	mov	rax, QWORD PTR 8[r13]
	mov	rbp, rbx
	mov	rsi, QWORD PTR [r14]
	sal	rbp, 4
	add	rax, rbp
	lea	rdx, [rcx+rbp]
	mov	rdi, QWORD PTR 8[rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR 8[rdx], eax
	test	rdi, rdi
	je	.L14
	call	min@PLT
	mov	rcx, QWORD PTR 8[rsp]
	add	rbx, 1
	mov	rsi, rax
	lea	rdx, [rcx+rbp]
	mov	QWORD PTR [rdx], rsi
	cmp	DWORD PTR [rsp], ebx
	jg	.L15
.L16:
	mov	rsi, r12
	mov	rdi, r14
	call	ipw_send_tx_power@PLT
	test	rax, rax
	jne	.L12
.L13:
	xor	eax, eax
	jmp	.L1
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ipw_set_tx_power, .-ipw_set_tx_power
	.comm	IPW_G_MODE,4,4
	.comm	IPW_B_MODE,4,4
	.comm	IPW_A_MODE,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ipw2200.c_ipw_set_tx_power.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ipw_set_tx_power, %function
ipw_set_tx_power:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L31
	sub	sp, sp, #16
	mov	r6, r0
	ldr	r0, [r0, #4]
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	libipw_get_geo
	mov	ip, #0
	ldr	r3, .L31+4
	str	ip, [sp, #4]
	ldr	lr, [r0]
	ldr	r3, [r3]
	cmp	lr, ip
	mov	r5, r0
	movgt	r4, ip
	str	lr, [sp]
	str	r3, [sp, #8]
	bgt	.L2
	b	.L6
.L5:
	add	r4, r4, #1
	cmp	lr, r4
	str	r1, [r3]
	ble	.L6
.L2:
	ldr	r2, [r5, #12]
	add	r3, ip, r4, lsl #3
	add	r1, r2, r4, lsl #3
	ldr	r0, [r1, #4]
	ldr	r2, [r2, r4, lsl #3]
	cmp	r0, #0
	ldr	r1, [r6]
	str	r2, [r3, #4]
	lsl	r7, r4, #3
	beq	.L5
	bl	min
	mov	r1, r0
	ldr	ip, [sp, #4]
	ldr	lr, [r5]
	add	r4, r4, #1
	add	r3, ip, r7
	cmp	lr, r4
	str	r1, [r3]
	bgt	.L2
.L6:
	mov	r1, sp
	mov	r0, r6
	bl	ipw_send_tx_power
	cmp	r0, #0
	beq	.L29
.L11:
	ldr	r3, .L31+8
	ldr	r7, [r3]
	rsb	r7, r7, #0
.L1:
	ldr	r3, .L31
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L30
	mov	r0, r7
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L29:
	ldr	r3, .L31+12
	mov	r1, sp
	ldr	r3, [r3]
	mov	r0, r6
	str	r3, [sp, #8]
	bl	ipw_send_tx_power
	subs	r7, r0, #0
	bne	.L11
	ldr	r3, [r6, #4]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L1
	ldr	r2, .L31+16
	ldr	r3, [r5, #4]
	ldr	r2, [r2]
	cmp	r3, #0
	movgt	r4, r7
	ldrgt	ip, [sp, #4]
	str	r2, [sp, #8]
	str	r3, [sp]
	bgt	.L14
	b	.L15
.L13:
	ldr	r2, [sp]
	add	r4, r4, #1
	cmp	r2, r4
	str	r1, [r3]
	ble	.L15
.L14:
	ldr	r2, [r5, #8]
	add	r3, ip, r4, lsl #3
	add	r1, r2, r4, lsl #3
	ldr	r0, [r1, #4]
	ldr	r2, [r2, r4, lsl #3]
	cmp	r0, #0
	ldr	r1, [r6]
	str	r2, [r3, #4]
	lsl	r8, r4, #3
	beq	.L13
	bl	min
	ldr	ip, [sp, #4]
	mov	r1, r0
	add	r3, ip, r8
	b	.L13
.L15:
	mov	r1, sp
	mov	r0, r6
	bl	ipw_send_tx_power
	cmp	r0, #0
	beq	.L1
	b	.L11
.L30:
	bl	__stack_chk_fail
.L32:
	.align	2
.L31:
	.word	.LC0
	.word	IPW_G_MODE
	.word	EIO
	.word	IPW_B_MODE
	.word	IPW_A_MODE
	.size	ipw_set_tx_power, .-ipw_set_tx_power
	.comm	IPW_G_MODE,4,4
	.comm	IPW_B_MODE,4,4
	.comm	IPW_A_MODE,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
