	.file	"extr_rcopy.c_server_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"transferring"
.LC1:
	.string	"...file not opened"
.LC2:
	.string	"...invalid message length %d\n"
.LC3:
	.string	"...error mapping file"
.LC4:
	.string	"...%lld bytes..."
.LC5:
	.string	"...error receiving data"
	.text
	.p2align 4
	.type	server_write, @function
server_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	eax, eax
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, edi
	lea	rdi, .LC0[rip]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	printf@PLT
	xor	edi, edi
	call	fflush@PLT
	cmp	QWORD PTR fd[rip], 0
	jle	.L8
	mov	esi, DWORD PTR 0[rbp]
	cmp	esi, 4
	jne	.L9
	mov	edx, 8
	lea	rsi, bytes[rip]
	mov	edi, r12d
	call	_recv@PLT
	mov	r13d, eax
	cmp	eax, 8
	je	.L10
.L3:
	mov	edx, r13d
	mov	rsi, rbp
	mov	edi, r12d
	call	msg_send_resp@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.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
.L9:
	.cfi_restore_state
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	printf@PLT
	mov	r13d, DWORD PTR EINVAL[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	r13d, DWORD PTR EINVAL[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rsi, QWORD PTR bytes[rip]
	mov	rdi, QWORD PTR fd[rip]
	call	ftruncate@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L3
	mov	r8, QWORD PTR fd[rip]
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	xor	r9d, r9d
	xor	edi, edi
	mov	edx, DWORD PTR PROT_WRITE[rip]
	mov	rsi, QWORD PTR bytes[rip]
	call	mmap@PLT
	mov	QWORD PTR file_addr[rip], rax
	cmp	rax, -1
	je	.L11
	mov	rsi, QWORD PTR bytes[rip]
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	printf@PLT
	xor	edi, edi
	call	fflush@PLT
	mov	rdx, QWORD PTR bytes[rip]
	mov	rsi, QWORD PTR file_addr[rip]
	mov	edi, r12d
	call	_recv@PLT
	cmp	QWORD PTR bytes[rip], rax
	mov	rbx, rax
	je	.L3
	lea	rdi, .LC5[rip]
	mov	r13d, ebx
	call	puts@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	r13d, DWORD PTR errno[rip]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	server_write, .-server_write
	.comm	file_addr,8,8
	.comm	fd,8,8
	.comm	errno,4,4
	.comm	bytes,8,8
	.comm	PROT_WRITE,4,4
	.comm	MAP_SHARED,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_rcopy.c_server_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"transferring\000"
	.align	2
.LC1:
	.ascii	"...file not opened\000"
	.align	2
.LC2:
	.ascii	"...invalid message length %d\012\000"
	.align	2
.LC3:
	.ascii	"...error mapping file\000"
	.align	2
.LC4:
	.ascii	"...%lld bytes...\000"
	.align	2
.LC5:
	.ascii	"...error receiving data\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	server_write, %function
server_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	sub	sp, sp, #8
	ldr	r0, .L13
	ldr	r7, .L13+4
	mov	r5, r1
	bl	printf
	mov	r0, #0
	bl	fflush
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L9
	ldr	r2, [r5]
	cmp	r2, #4
	bne	.L10
	ldr	r8, .L13+8
	mov	r0, r6
	mov	r1, r8
	bl	_recv
	cmp	r0, #4
	mov	r4, r0
	beq	.L11
.L3:
	mov	r1, r5
	mov	r0, r6
	mov	r2, r4
	bl	msg_send_resp
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	mov	r1, r2
	ldr	r0, .L13+12
	bl	printf
	ldr	r3, .L13+16
	ldr	r4, [r3]
	b	.L3
.L9:
	ldr	r0, .L13+20
	bl	puts
	ldr	r3, .L13+16
	ldr	r4, [r3]
	b	.L3
.L11:
	ldr	r1, [r8]
	ldr	r0, [r7]
	bl	ftruncate
	subs	r4, r0, #0
	bne	.L3
	ldr	r1, [r7]
	ldr	r3, .L13+24
	stm	sp, {r1, r4}
	ldr	r2, .L13+28
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r8]
	bl	mmap
	ldr	r7, .L13+32
	cmn	r0, #1
	str	r0, [r7]
	beq	.L12
	mov	r3, r4
	ldr	r2, [r8]
	ldr	r0, .L13+36
	bl	printf
	mov	r0, r4
	bl	fflush
	ldr	r2, [r8]
	mov	r0, r6
	ldr	r1, [r7]
	bl	_recv
	ldr	r2, [r8]
	mov	r3, r0
	cmp	r0, r2
	beq	.L3
	ldr	r0, .L13+40
	mov	r4, r3
	bl	puts
	b	.L3
.L12:
	ldr	r0, .L13+44
	bl	puts
	ldr	r3, .L13+48
	ldr	r4, [r3]
	b	.L3
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	fd
	.word	bytes
	.word	.LC2
	.word	EINVAL
	.word	.LC1
	.word	MAP_SHARED
	.word	PROT_WRITE
	.word	file_addr
	.word	.LC4
	.word	.LC5
	.word	.LC3
	.word	errno
	.size	server_write, .-server_write
	.comm	file_addr,4,4
	.comm	fd,4,4
	.comm	errno,4,4
	.comm	bytes,4,4
	.comm	PROT_WRITE,4,4
	.comm	MAP_SHARED,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
