	.file	"73576531.c"
	.intel_syntax noprefix
	.text
	.local	fd
	.comm	fd,4,4
	.local	ServerAddr
	.comm	ServerAddr,16,16
	.local	ServerAddrLen
	.comm	ServerAddrLen,4,4
	.local	clientAddr
	.comm	clientAddr,16,16
	.local	clientAddrLen
	.comm	clientAddrLen,4,4
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 65536
buf:
	.zero	65536
	.text
	.type	inet_sum, @function
inet_sum:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	.cfi_offset 3, -24
	mov	QWORD PTR -16[rbp], rdi
	mov	DWORD PTR -20[rbp], esi
	mov	QWORD PTR -32[rbp], rdx
	mov	DWORD PTR -24[rbp], ecx
	mov	rbx, QWORD PTR -32[rbp]
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 2
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 4
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 6
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 10
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 12
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 14
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	add	QWORD PTR -16[rbp], 16
	sub	DWORD PTR -20[rbp], 16
.L2:
	cmp	DWORD PTR -20[rbp], 15
	jg	.L3
	jmp	.L4
.L5:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 2[rax]
	mov	QWORD PTR -16[rbp], rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	rbx, rax
	sub	DWORD PTR -20[rbp], 2
.L4:
	cmp	DWORD PTR -20[rbp], 1
	jg	.L5
	cmp	DWORD PTR -20[rbp], 0
	jle	.L6
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	rbx, rax
.L6:
	cmp	DWORD PTR -24[rbp], 0
	je	.L7
	jmp	.L8
.L9:
	movzx	eax, bx
	mov	rdx, rbx
	sar	rdx, 16
	lea	rbx, [rax+rdx]
.L8:
	mov	rax, rbx
	sar	rax, 16
	test	rax, rax
	jne	.L9
	mov	rax, rbx
	not	rax
	movzx	eax, ax
	jmp	.L10
.L7:
	mov	rax, rbx
.L10:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	inet_sum, .-inet_sum
	.section	.rodata
.LC0:
	.string	"Couldn't create a TCP socket\n"
	.align 8
.LC1:
	.string	"Couldn't bind to socket descriptor: portno %d\n"
.LC2:
	.string	"serving file from port %d\n"
	.align 8
.LC3:
	.string	"Failed to accept new connection"
	.align 8
.LC4:
	.string	"Non-matched amount of data written: %d != %d\n"
.LC5:
	.string	"bytes: %7d,\t(sum %x)\n"
.LC6:
	.string	"file read failed"
.LC7:
	.string	"Done: %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	call	getpid@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	or	ah, 16
	mov	DWORD PTR -16[rbp], eax
	mov	DWORD PTR -32[rbp], 0
	mov	DWORD PTR -28[rbp], 0
	mov	DWORD PTR -24[rbp], 0
	mov	edx, 6
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR fd[rip], eax
	mov	eax, DWORD PTR fd[rip]
	cmp	eax, -1
	jne	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 29
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 0
	call	exit@PLT
.L12:
	mov	QWORD PTR ServerAddr[rip], 0
	mov	QWORD PTR ServerAddr[rip+8], 0
	mov	WORD PTR ServerAddr[rip], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR ServerAddr[rip+4], eax
	mov	eax, DWORD PTR -16[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR ServerAddr[rip+2], ax
	mov	DWORD PTR ServerAddrLen[rip], 16
	mov	eax, DWORD PTR ServerAddrLen[rip]
	mov	edx, eax
	mov	eax, DWORD PTR fd[rip]
	lea	rsi, ServerAddr[rip]
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -16[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 0
	call	exit@PLT
.L13:
	mov	eax, DWORD PTR fd[rip]
	mov	esi, 1
	mov	edi, eax
	call	listen@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -16[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR clientAddrLen[rip], 16
	mov	eax, DWORD PTR fd[rip]
	lea	rdx, clientAddrLen[rip]
	lea	rsi, clientAddr[rip]
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L15
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
.L17:
	mov	eax, DWORD PTR -8[rbp]
	add	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	add	DWORD PTR -28[rbp], eax
	mov	edx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -8[rbp]
	mov	ecx, 0
	mov	esi, eax
	lea	rdi, buf[rip]
	mov	eax, 0
	call	inet_sum
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	mov	rdx, rax
	lea	rsi, buf[rip]
	mov	edi, 1
	call	write@PLT
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	je	.L16
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -8[rbp]
	mov	edx, DWORD PTR -4[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 0
	call	exit@PLT
.L16:
	cmp	DWORD PTR -28[rbp], 4194303
	jle	.L15
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -24[rbp]
	mov	edx, DWORD PTR -28[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -28[rbp], 0
.L15:
	mov	eax, DWORD PTR -12[rbp]
	mov	edx, 4096
	lea	rsi, buf[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], 0
	jg	.L17
	cmp	DWORD PTR -8[rbp], 0
	jns	.L18
	lea	rdi, .LC6[rip]
	call	perror@PLT
.L18:
	mov	eax, DWORD PTR fd[rip]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -32[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"73576531.c"
	.text
	.local	fd
	.comm	fd,4,4
	.local	ServerAddr
	.comm	ServerAddr,16,4
	.local	ServerAddrLen
	.comm	ServerAddrLen,4,4
	.local	clientAddr
	.comm	clientAddr,16,4
	.local	clientAddrLen
	.comm	clientAddrLen,4,4
	.comm	buf,65536,4
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	inet_sum, %function
inet_sum:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	push	{r4, fp}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	ldr	r4, [fp, #-16]
	b	.L2
.L3:
	ldr	r3, [fp, #-8]
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #2
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #6
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #8
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #10
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #12
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #14
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #16
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #16
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #15
	bgt	.L3
	b	.L4
.L5:
	ldr	r3, [fp, #-8]
	add	r2, r3, #2
	str	r2, [fp, #-8]
	ldrh	r3, [r3]
	add	r4, r4, r3
	ldr	r3, [fp, #-12]
	sub	r3, r3, #2
	str	r3, [fp, #-12]
.L4:
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	bgt	.L5
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	ble	.L6
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r4, r4, r3
.L6:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L7
	b	.L8
.L9:
	lsl	r3, r4, #16
	lsr	r3, r3, #16
	asr	r2, r4, #16
	add	r4, r3, r2
.L8:
	asr	r3, r4, #16
	cmp	r3, #0
	bne	.L9
	mvn	r3, r4
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	b	.L10
.L7:
	mov	r3, r4
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{r4, fp}
	bx	lr
	.size	inet_sum, .-inet_sum
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Couldn't create a TCP socket\012\000"
	.align	2
.LC1:
	.ascii	"Couldn't bind to socket descriptor: portno %d\012\000"
	.align	2
.LC2:
	.ascii	"serving file from port %d\012\000"
	.align	2
.LC3:
	.ascii	"Failed to accept new connection\000"
	.align	2
.LC4:
	.ascii	"Non-matched amount of data written: %d != %d\012\000"
	.align	2
.LC5:
	.ascii	"bytes: %7d,\011(sum %x)\012\000"
	.align	2
.LC6:
	.ascii	"file read failed\000"
	.align	2
.LC7:
	.ascii	"Done: %d\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	bl	getpid
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	orr	r3, r3, #4096
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r2, #6
	mov	r1, #1
	mov	r0, #2
	bl	socket
	mov	r3, r0
	ldr	r2, .L20
	str	r3, [r2]
	ldr	r3, .L20
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L12
	ldr	r3, .L20+4
	ldr	r3, [r3]
	mov	r2, #29
	mov	r1, #1
	ldr	r0, .L20+8
	bl	fwrite
	mov	r0, #0
	bl	exit
.L12:
	ldr	r3, .L20+12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	str	r3, [r2, #8]
	str	r3, [r2, #12]
	ldr	r3, .L20+12
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	ldr	r2, .L20+12
	str	r3, [r2, #4]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L20+12
	strh	r2, [r3, #2]	@ movhi
	ldr	r3, .L20+16
	mov	r2, #16
	str	r2, [r3]
	ldr	r3, .L20
	ldr	r3, [r3]
	ldr	r2, .L20+16
	ldr	r2, [r2]
	ldr	r1, .L20+12
	mov	r0, r3
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L13
	ldr	r3, .L20+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	ldr	r1, .L20+20
	mov	r0, r3
	bl	fprintf
	mov	r0, #0
	bl	exit
.L13:
	ldr	r3, .L20
	ldr	r3, [r3]
	mov	r1, #1
	mov	r0, r3
	bl	listen
	ldr	r3, .L20+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	ldr	r1, .L20+24
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L20+28
	mov	r2, #16
	str	r2, [r3]
	ldr	r3, .L20
	ldr	r3, [r3]
	ldr	r2, .L20+28
	ldr	r1, .L20+32
	mov	r0, r3
	bl	accept
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L15
	ldr	r0, .L20+36
	bl	perror
	mov	r0, #0
	bl	exit
.L17:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-36]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-32]
	mov	r3, #0
	ldr	r2, [fp, #-28]
	ldr	r1, [fp, #-12]
	ldr	r0, .L20+40
	bl	inet_sum
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-12]
	mov	r2, r3
	ldr	r1, .L20+40
	mov	r0, #1
	bl	write
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	beq	.L16
	ldr	r3, .L20+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	ldr	r1, .L20+44
	bl	fprintf
	mov	r0, #0
	bl	exit
.L16:
	ldr	r3, [fp, #-32]
	cmp	r3, #4194304
	blt	.L15
	ldr	r3, .L20+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-32]
	ldr	r1, .L20+48
	bl	fprintf
	mov	r3, #0
	str	r3, [fp, #-32]
.L15:
	mov	r2, #4096
	ldr	r1, .L20+40
	ldr	r0, [fp, #-16]
	bl	read
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bgt	.L17
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L18
	ldr	r0, .L20+52
	bl	perror
.L18:
	ldr	r3, .L20
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L20+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	ldr	r1, .L20+56
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	fd
	.word	stderr
	.word	.LC0
	.word	ServerAddr
	.word	ServerAddrLen
	.word	.LC1
	.word	.LC2
	.word	clientAddrLen
	.word	clientAddr
	.word	.LC3
	.word	buf
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
