	.file	"extr_mcu.c_mt7601u_write_reg_pairs.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mt7601u_write_reg_pairs
	.type	mt7601u_write_reg_pairs, @function
mt7601u_write_reg_pairs:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	eax, DWORD PTR INBAND_PACKET_MAX_LEN[rip]
	mov	QWORD PTR 8[rsp], rdi
	test	eax, eax
	lea	edi, 7[rax]
	mov	QWORD PTR [rsp], rdx
	cmovns	edi, eax
	sar	edi, 3
	test	ecx, ecx
	je	.L2
	mov	r12, rsi
	mov	r13d, ecx
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, r13d
	call	min@PLT
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	lea	edi, 0[0+rax*8]
	mov	ebx, eax
	movsx	rdi, edi
	add	rdi, QWORD PTR MT_DMA_HDR_LEN[rip]
	add	rdi, 4
	call	alloc_skb@PLT
	mov	r15, rax
	test	rax, rax
	je	.L15
	mov	rsi, QWORD PTR MT_DMA_HDR_LEN[rip]
	mov	rdi, rax
	call	skb_reserve@PLT
	test	ebx, ebx
	jle	.L5
	mov	rcx, QWORD PTR [rsp]
	lea	eax, -1[rbx]
	sal	rax, 4
	mov	r14, rcx
	lea	rbp, 16[rcx+rax]
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rsi, QWORD PTR 8[r14]
	mov	rdi, r15
	add	r14, 16
	add	rsi, r12
	call	skb_put_le32@PLT
	mov	rsi, QWORD PTR -16[r14]
	mov	rdi, r15
	call	skb_put_le32@PLT
	cmp	r14, rbp
	jne	.L6
.L5:
	xor	ecx, ecx
	mov	edx, DWORD PTR CMD_RANDOM_WRITE[rip]
	cmp	ebx, r13d
	mov	rdi, QWORD PTR 8[rsp]
	sete	cl
	mov	rsi, r15
	call	mt7601u_mcu_msg_send@PLT
	test	eax, eax
	jne	.L1
	movsx	rax, ebx
	sal	rax, 4
	add	QWORD PTR [rsp], rax
	mov	eax, DWORD PTR INBAND_PACKET_MAX_LEN[rip]
	test	eax, eax
	lea	edi, 7[rax]
	cmovns	edi, eax
	sar	edi, 3
	sub	r13d, ebx
	jne	.L7
.L2:
	xor	eax, eax
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 24
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	mt7601u_write_reg_pairs, .-mt7601u_write_reg_pairs
	.comm	MT_DMA_HDR_LEN,8,8
	.comm	INBAND_PACKET_MAX_LEN,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	CMD_RANDOM_WRITE,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_mcu.c_mt7601u_write_reg_pairs.c"
	.text
	.align	2
	.global	mt7601u_write_reg_pairs
	.syntax unified
	.arm
	.fpu softvfp
	.type	mt7601u_write_reg_pairs, %function
mt7601u_write_reg_pairs:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L17
	sub	sp, sp, #12
	ldr	ip, [ip]
	str	r0, [sp, #4]
	cmp	ip, #0
	add	lr, ip, #7
	movlt	ip, lr
	subs	r8, r3, #0
	beq	.L2
	mov	r7, r1
	mov	r9, r2
	ldr	fp, .L17+4
	asr	r0, ip, #3
.L7:
	mov	r1, r8
	bl	min
	mov	r5, r0
	ldr	r0, [fp]
	ldr	r3, .L17+8
	add	r0, r0, r5, lsl #3
	ldr	r1, [r3]
	add	r0, r0, #4
	bl	alloc_skb
	lsl	r3, r5, #3
	subs	r4, r0, #0
	str	r3, [sp]
	beq	.L16
	ldr	r1, [fp]
	bl	skb_reserve
	cmp	r5, #0
	ble	.L5
	mov	r10, r9
	ldr	r3, [sp]
	add	r6, r9, r3
.L6:
	ldr	r1, [r10, #4]
	mov	r0, r4
	add	r1, r7, r1
	bl	skb_put_le32
	ldr	r1, [r10], #8
	mov	r0, r4
	bl	skb_put_le32
	cmp	r10, r6
	bne	.L6
.L5:
	sub	r3, r5, r8
	clz	r3, r3
	ldr	r2, .L17+12
	mov	r1, r4
	ldr	r2, [r2]
	ldr	r0, [sp, #4]
	lsr	r3, r3, #5
	bl	mt7601u_mcu_msg_send
	cmp	r0, #0
	bne	.L1
	ldr	r3, .L17
	ldr	r0, [r3]
	ldr	r3, [sp]
	cmp	r0, #0
	add	r9, r9, r3
	add	r3, r0, #7
	movlt	r0, r3
	subs	r8, r8, r5
	asr	r0, r0, #3
	bne	.L7
.L2:
	mov	r0, #0
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r3, .L17+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	.align	2
.L17:
	.word	INBAND_PACKET_MAX_LEN
	.word	MT_DMA_HDR_LEN
	.word	GFP_KERNEL
	.word	CMD_RANDOM_WRITE
	.word	ENOMEM
	.size	mt7601u_write_reg_pairs, .-mt7601u_write_reg_pairs
	.comm	MT_DMA_HDR_LEN,4,4
	.comm	INBAND_PACKET_MAX_LEN,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	CMD_RANDOM_WRITE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
