	.file	"extr_file_subs.c_file_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"File seek on %s"
.LC1:
	.string	"Failed write to file %s"
	.text
	.p2align 4
	.globl	file_write
	.type	file_write, @function
file_write:
.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, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 24[rsp], rsi
	mov	DWORD PTR 12[rsp], r9d
	test	edx, edx
	je	.L14
	mov	r12d, edi
	mov	r13d, edx
	mov	rbx, rcx
	mov	rbp, r8
	mov	r14, rsi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edx, r15d
	mov	rsi, r14
	mov	edi, r12d
	call	write@PLT
	cmp	eax, r15d
	jne	.L21
	add	r14, r15
	test	r13d, r13d
	je	.L22
.L13:
	mov	esi, DWORD PTR [rbx]
	test	esi, esi
	jne	.L3
	mov	eax, DWORD PTR 12[rsp]
	mov	DWORD PTR 0[rbp], 1
	mov	DWORD PTR [rbx], eax
	mov	esi, eax
.L3:
	mov	edi, r13d
	call	MIN@PLT
	movsx	r15, eax
	sub	DWORD PTR [rbx], r15d
	mov	eax, DWORD PTR 0[rbp]
	sub	r13d, r15d
	test	eax, eax
	je	.L4
	movsx	rcx, r15d
	mov	rax, r14
	add	rcx, r14
	cmp	rcx, r14
	ja	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	add	rax, 1
	cmp	rcx, rax
	je	.L7
.L5:
	cmp	BYTE PTR [rax], 0
	je	.L8
.L6:
	cmp	rcx, rax
	je	.L7
	mov	DWORD PTR 0[rbp], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edx, DWORD PTR SEEK_CUR[rip]
	mov	esi, r15d
	mov	edi, r12d
	mov	QWORD PTR 16[rsp], rcx
	call	lseek@PLT
	mov	rcx, QWORD PTR 16[rsp]
	test	rax, rax
	js	.L23
	mov	r14, rcx
	test	r13d, r13d
	jne	.L13
.L22:
	mov	eax, r14d
	sub	eax, DWORD PTR 24[rsp]
.L1:
	add	rsp, 40
	.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
.L21:
	.cfi_restore_state
	mov	rcx, QWORD PTR 96[rsp]
	mov	esi, DWORD PTR errno[rip]
	mov	edi, 1
	lea	rdx, .LC1[rip]
	call	syswarn@PLT
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, -1
	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
.L14:
	.cfi_restore_state
	xor	eax, eax
	jmp	.L1
.L23:
	mov	rcx, QWORD PTR 96[rsp]
	mov	esi, DWORD PTR errno[rip]
	mov	edi, 1
	lea	rdx, .LC0[rip]
	call	syswarn@PLT
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	file_write, .-file_write
	.comm	errno,4,4
	.comm	SEEK_CUR,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_file_subs.c_file_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"File seek on %s\000"
	.align	2
.LC1:
	.ascii	"Failed write to file %s\000"
	.text
	.align	2
	.global	file_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	file_write, %function
file_write:
	@ args = 12, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r5, r2, #0
	sub	sp, sp, #12
	ldr	r7, [sp, #48]
	ldr	r9, [sp, #52]
	str	r1, [sp, #4]
	beq	.L13
	mov	r8, r0
	mov	fp, r3
	mov	r6, r1
	b	.L12
.L4:
	mov	r2, r10
	mov	r1, r6
	mov	r0, r8
	bl	write
	cmp	r0, r10
	bne	.L24
	cmp	r5, #0
	add	r6, r6, r10
	beq	.L25
.L12:
	ldr	r1, [fp]
	mov	r0, r5
	cmp	r1, #0
	moveq	r3, #1
	moveq	r1, r9
	streq	r3, [r7]
	streq	r9, [fp]
	bl	MIN
	ldr	r3, [fp]
	mov	r10, r0
	sub	r3, r3, r0
	str	r3, [fp]
	ldr	r3, [r7]
	sub	r5, r5, r0
	cmp	r3, #0
	beq	.L4
	add	r4, r6, r0
	cmp	r4, r6
	bls	.L14
	mov	r3, r6
	b	.L6
.L7:
	cmp	r3, r4
	mov	r1, r3
	beq	.L5
.L6:
	ldrb	r2, [r3]	@ zero_extendqisi2
	mov	r1, r3
	cmp	r2, #0
	add	r3, r3, #1
	beq	.L7
.L5:
	cmp	r4, r1
	movne	r3, #0
	strne	r3, [r7]
	bne	.L4
.L27:
	ldr	r3, .L28
	mov	r1, r10
	mov	r0, r8
	ldr	r2, [r3]
	bl	lseek
	cmp	r0, #0
	blt	.L26
	cmp	r5, #0
	mov	r6, r4
	bne	.L12
.L25:
	ldr	r3, [sp, #4]
	sub	r0, r6, r3
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L24:
	ldr	r2, .L28+4
	ldr	r3, [sp, #56]
	ldr	r1, [r2]
	mov	r0, #1
	ldr	r2, .L28+8
	bl	syswarn
	mvn	r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	mov	r1, r6
	cmp	r4, r1
	movne	r3, #0
	strne	r3, [r7]
	bne	.L4
	b	.L27
.L13:
	mov	r0, r5
	b	.L1
.L26:
	ldr	r2, .L28+4
	mov	r0, #1
	ldr	r1, [r2]
	ldr	r3, [sp, #56]
	ldr	r2, .L28+12
	bl	syswarn
	mvn	r0, #0
	b	.L1
.L29:
	.align	2
.L28:
	.word	SEEK_CUR
	.word	errno
	.word	.LC1
	.word	.LC0
	.size	file_write, .-file_write
	.comm	errno,4,4
	.comm	SEEK_CUR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
