	.file	"extr_tty.c_ipw_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ipw_write, @function
ipw_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, DWORD PTR ENODEV[rip]
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, QWORD PTR [rdi]
	neg	r12d
	test	rbx, rbx
	je	.L1
	lea	r14, 4[rbx]
	mov	r13, rsi
	mov	ebp, edx
	mov	rdi, r14
	call	mutex_lock@PLT
	mov	eax, DWORD PTR 12[rbx]
	test	eax, eax
	je	.L10
	mov	r12d, DWORD PTR IPWIRELESS_TX_QUEUE_SIZE[rip]
	mov	edx, 0
	sub	r12d, DWORD PTR [rbx]
	cmovs	r12d, edx
	cmp	r12d, ebp
	cmovg	r12d, ebp
	test	r12d, r12d
	je	.L8
	mov	edi, DWORD PTR 8[rbx]
	mov	r8d, DWORD PTR ipw_write_packet_sent_callback[rip]
	mov	r9, rbx
	mov	ecx, r12d
	mov	esi, DWORD PTR IPW_CHANNEL_RAS[rip]
	mov	rdx, r13
	call	ipwireless_send_packet@PLT
	cmp	eax, -1
	je	.L11
	add	DWORD PTR [rbx], r12d
.L8:
	mov	rdi, r14
	call	mutex_unlock@PLT
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L10:
	.cfi_restore_state
	mov	rdi, r14
	call	mutex_unlock@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	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
.L11:
	.cfi_restore_state
	mov	rdi, r14
	xor	r12d, r12d
	call	mutex_unlock@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	ipw_write, .-ipw_write
	.comm	ipw_write_packet_sent_callback,4,4
	.comm	IPW_CHANNEL_RAS,4,4
	.comm	IPWIRELESS_TX_QUEUE_SIZE,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,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_tty.c_ipw_write.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ipw_write, %function
ipw_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r5, [r0]
	sub	sp, sp, #12
	cmp	r5, #0
	beq	.L9
	add	r7, r5, #4
	mov	r0, r7
	mov	r6, r1
	mov	r4, r2
	bl	mutex_lock
	ldr	r3, [r5, #12]
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L13
	ldr	r2, [r5]
	ldr	r3, [r3]
	sub	r3, r3, r2
	bic	r3, r3, r3, asr #31
	cmp	r3, r4
	movlt	r4, r3
	cmp	r4, #0
	beq	.L11
	ldr	r3, .L13+4
	ldr	r0, [r5, #8]
	ldr	r1, [r3]
	ldr	r3, .L13+8
	stm	sp, {r1, r5}
	mov	r2, r6
	ldr	r1, [r3]
	mov	r3, r4
	bl	ipwireless_send_packet
	cmn	r0, #1
	beq	.L12
	ldr	r3, [r5]
	mov	r0, r7
	add	r3, r3, r4
	str	r3, [r5]
	bl	mutex_unlock
.L1:
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L9:
	ldr	r3, .L13+12
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L11:
	mov	r0, r7
	bl	mutex_unlock
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L10:
	mov	r0, r7
	bl	mutex_unlock
	ldr	r3, .L13+16
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L12:
	mov	r0, r7
	bl	mutex_unlock
	mov	r4, #0
	b	.L1
.L14:
	.align	2
.L13:
	.word	IPWIRELESS_TX_QUEUE_SIZE
	.word	ipw_write_packet_sent_callback
	.word	IPW_CHANNEL_RAS
	.word	ENODEV
	.word	EINVAL
	.size	ipw_write, .-ipw_write
	.comm	ipw_write_packet_sent_callback,4,4
	.comm	IPW_CHANNEL_RAS,4,4
	.comm	IPWIRELESS_TX_QUEUE_SIZE,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
