	.file	"extr_icom.c_icom_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"WRITE"
.LC1:
	.string	"WRITE_FULL"
.LC2:
	.string	"WRITE_START"
	.text
	.p2align 4
	.type	icom_write, @function
icom_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	edx, edx
	lea	rsi, .LC0[rip]
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rax, QWORD PTR [rdi]
	mov	rdi, QWORD PTR ICOM_PORT[rip]
	mov	ebx, DWORD PTR [rax]
	call	trace@PLT
	mov	rax, QWORD PTR ICOM_PORT[rip]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	mov	rdi, QWORD PTR [rax]
	call	cpu_to_le16@PLT
	and	eax, DWORD PTR SA_FLAGS_READY_TO_XMIT[rip]
	jne	.L2
	mov	rdx, QWORD PTR [r12]
	mov	r13d, eax
	cmp	ebx, DWORD PTR 4[rdx]
	je	.L1
	mov	rax, QWORD PTR ICOM_PORT[rip]
	mov	rsi, QWORD PTR 8[rdx]
	xor	r12d, r12d
	mov	rdi, QWORD PTR XMIT_BUFF_SZ[rip]
	mov	rcx, QWORD PTR 32[rax]
	.p2align 4,,10
	.p2align 3
.L7:
	movsx	rax, ebx
	add	r12, 1
	add	ebx, 1
	mov	eax, DWORD PTR [rsi+rax*4]
	mov	DWORD PTR -4[rcx+r12*4], eax
	mov	eax, DWORD PTR UART_XMIT_SIZE[rip]
	sub	eax, 1
	and	ebx, eax
	cmp	DWORD PTR 4[rdx], ebx
	je	.L6
	cmp	rdi, r12
	jnb	.L7
.L6:
	movsx	rdi, DWORD PTR SA_FLAGS_READY_TO_XMIT[rip]
	mov	r13d, r12d
	call	cpu_to_le16@PLT
	mov	rdx, QWORD PTR ICOM_PORT[rip]
	mov	rdi, r12
	cdqe
	mov	rdx, QWORD PTR 24[rdx]
	mov	rbx, QWORD PTR [rdx]
	mov	QWORD PTR [rbx], rax
	call	cpu_to_le16@PLT
	mov	DWORD PTR 8[rbx], eax
	mov	rax, QWORD PTR ICOM_PORT[rip]
	mov	rdx, QWORD PTR 24[rax]
	mov	rbx, QWORD PTR 16[rax]
	mov	rdi, QWORD PTR [rdx]
	sub	rdi, rdx
	add	rdi, QWORD PTR 8[rax]
	call	cpu_to_le32@PLT
	mov	DWORD PTR [rbx], eax
	mov	rax, QWORD PTR ICOM_PORT[rip]
	mov	rdi, QWORD PTR [rax]
	add	rdi, 4
	call	readb@PLT
	mov	rdx, QWORD PTR ICOM_PORT[rip]
	or	al, BYTE PTR CMD_XMIT_RCV_ENABLE[rip]
	movzx	edi, al
	mov	rsi, QWORD PTR [rdx]
	add	rsi, 4
	call	writeb@PLT
	mov	rax, QWORD PTR ICOM_PORT[rip]
	movzx	edi, BYTE PTR START_XMIT[rip]
	mov	rsi, QWORD PTR [rax]
	call	writeb@PLT
	mov	rdi, QWORD PTR ICOM_PORT[rip]
	mov	rdx, r12
	lea	rsi, .LC2[rip]
	call	trace@PLT
	mov	rax, QWORD PTR ICOM_PORT[rip]
	mov	rdi, QWORD PTR [rax]
	call	readb@PLT
.L1:
	mov	eax, r13d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, QWORD PTR ICOM_PORT[rip]
	xor	r13d, r13d
	xor	edx, edx
	lea	rsi, .LC1[rip]
	call	trace@PLT
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	icom_write, .-icom_write
	.comm	XMIT_BUFF_SZ,8,8
	.comm	UART_XMIT_SIZE,4,4
	.comm	START_XMIT,1,1
	.comm	SA_FLAGS_READY_TO_XMIT,4,4
	.comm	ICOM_PORT,8,8
	.comm	CMD_XMIT_RCV_ENABLE,1,1
	.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_icom.c_icom_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"WRITE\000"
	.align	2
.LC1:
	.ascii	"WRITE_FULL\000"
	.align	2
.LC2:
	.ascii	"WRITE_START\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	icom_write, %function
icom_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, .L11
	ldr	r3, [r0]
	mov	r2, #0
	ldr	r1, .L11+4
	mov	r7, r0
	ldr	r0, [r5]
	ldr	r4, [r3]
	bl	trace
	ldr	r3, [r5]
	ldr	r8, .L11+8
	ldr	r3, [r3, #12]
	ldr	r3, [r3]
	ldr	r0, [r3]
	bl	cpu_to_le16
	ldr	r2, [r8]
	ands	r6, r0, r2
	bne	.L2
	ldr	ip, [r7]
	ldr	r3, [ip, #4]
	cmp	r4, r3
	beq	.L1
	ldr	r1, [r5]
	ldr	r3, .L11+12
	ldr	r1, [r1, #16]
	mov	r2, r6
	ldr	r7, [r3]
	ldr	r6, [ip, #8]
	ldr	lr, .L11+16
	sub	r1, r1, #4
.L7:
	ldr	r3, [r6, r4, lsl #2]
	add	r4, r4, #1
	str	r3, [r1, #4]!
	ldr	r3, [lr]
	ldr	r0, [ip, #4]
	sub	r3, r3, #1
	and	r4, r4, r3
	cmp	r0, r4
	add	r2, r2, #1
	beq	.L6
	cmp	r7, r2
	bcs	.L7
.L6:
	ldr	r0, [r8]
	mov	r6, r2
	bl	cpu_to_le16
	mov	r3, r0
	ldr	r2, [r5]
	mov	r0, r6
	ldr	r2, [r2, #12]
	ldr	r4, [r2]
	str	r3, [r4]
	bl	cpu_to_le16
	ldr	r2, [r5]
	str	r0, [r4, #4]
	ldr	r1, [r2, #12]
	ldr	r0, [r2, #4]
	ldr	r3, [r1]
	ldr	r4, [r2, #8]
	sub	r3, r3, r1
	add	r0, r3, r0
	bl	cpu_to_le32
	ldr	r3, [r5]
	str	r0, [r4]
	ldr	r0, [r3]
	add	r0, r0, #4
	bl	readb
	ldr	r3, .L11+20
	ldr	r2, [r5]
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldr	r1, [r2]
	orr	r0, r0, r3
	add	r1, r1, #4
	and	r0, r0, #255
	bl	writeb
	ldr	r3, .L11+24
	ldr	r2, [r5]
	ldrb	r0, [r3]	@ zero_extendqisi2
	ldr	r1, [r2]
	bl	writeb
	mov	r2, r6
	ldr	r1, .L11+28
	ldr	r0, [r5]
	bl	trace
	ldr	r3, [r5]
	ldr	r0, [r3]
	bl	readb
.L1:
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r6, #0
	mov	r2, #0
	ldr	r0, [r5]
	ldr	r1, .L11+32
	bl	trace
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	.align	2
.L11:
	.word	ICOM_PORT
	.word	.LC0
	.word	SA_FLAGS_READY_TO_XMIT
	.word	XMIT_BUFF_SZ
	.word	UART_XMIT_SIZE
	.word	CMD_XMIT_RCV_ENABLE
	.word	START_XMIT
	.word	.LC2
	.word	.LC1
	.size	icom_write, .-icom_write
	.comm	XMIT_BUFF_SZ,4,4
	.comm	UART_XMIT_SIZE,4,4
	.comm	START_XMIT,1,1
	.comm	SA_FLAGS_READY_TO_XMIT,4,4
	.comm	ICOM_PORT,4,4
	.comm	CMD_XMIT_RCV_ENABLE,1,1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
