	.file	"461202.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage : %s <port>\n"
.LC1:
	.string	"bind() error"
	.align 8
.LC2:
	.string	"Initiates a file(%s) transfer.\n"
.LC3:
	.string	"wb"
.LC4:
	.string	"Fail to create file."
.LC6:
	.string	"Shut down the file transfer."
.LC7:
	.string	"Total time : %f sec\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 160
	mov	DWORD PTR -148[rbp], edi
	mov	QWORD PTR -160[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 51200
	call	malloc@PLT
	mov	QWORD PTR -104[rbp], rax
	cmp	DWORD PTR -148[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -160[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	edx, 0
	mov	esi, 2
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -124[rbp], eax
	lea	rax, -48[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -48[rbp], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -44[rbp], eax
	mov	rax, QWORD PTR -160[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -46[rbp], ax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -124[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	DWORD PTR -140[rbp], 0
	mov	DWORD PTR -136[rbp], 1
	mov	DWORD PTR -120[rbp], 1
	mov	DWORD PTR -132[rbp], 0
	mov	DWORD PTR -116[rbp], 0
	mov	DWORD PTR -128[rbp], 0
	jmp	.L4
.L14:
	mov	DWORD PTR -144[rbp], 16
	lea	rcx, -144[rbp]
	lea	rdx, -32[rbp]
	mov	rsi, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR -124[rbp]
	mov	r9, rcx
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 51200
	mov	edi, eax
	call	recvfrom@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1003
	je	.L5
	cmp	eax, 1003
	jg	.L4
	cmp	eax, 1001
	je	.L7
	cmp	eax, 1002
	je	.L8
	jmp	.L4
.L7:
	mov	DWORD PTR -88[rbp], 2001
	mov	DWORD PTR -84[rbp], 0
	lea	rdx, -32[rbp]
	lea	rsi, -88[rbp]
	mov	eax, DWORD PTR -124[rbp]
	mov	r9d, 16
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 8
	mov	edi, eax
	call	sendto@PLT
	cmp	DWORD PTR -140[rbp], 0
	jne	.L17
	mov	rax, QWORD PTR -104[rbp]
	add	rax, 12
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -80[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -104[rbp]
	add	rax, 12
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -112[rbp], rax
	cmp	QWORD PTR -112[rbp], 0
	jne	.L10
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	DWORD PTR -140[rbp], 1
	mov	DWORD PTR -136[rbp], 0
	jmp	.L17
.L8:
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -132[rbp], eax
	jne	.L11
	cmp	DWORD PTR -136[rbp], 0
	jne	.L11
	add	DWORD PTR -128[rbp], 1
	mov	eax, DWORD PTR -132[rbp]
	add	eax, 1
	cdq
	shr	edx, 28
	add	eax, edx
	and	eax, 15
	sub	eax, edx
	mov	DWORD PTR -132[rbp], eax
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 8[rax]
	cdqe
	mov	rdx, QWORD PTR -104[rbp]
	lea	rdi, 12[rdx]
	mov	rdx, QWORD PTR -112[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rsi, rax
	call	fwrite@PLT
	mov	DWORD PTR -88[rbp], 2002
	mov	eax, DWORD PTR -132[rbp]
	mov	DWORD PTR -84[rbp], eax
.L11:
	lea	rdx, -32[rbp]
	lea	rsi, -88[rbp]
	mov	eax, DWORD PTR -124[rbp]
	mov	r9d, 16
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 8
	mov	edi, eax
	call	sendto@PLT
	jmp	.L4
.L5:
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -132[rbp], eax
	jne	.L18
	mov	DWORD PTR -88[rbp], 1003
	mov	DWORD PTR -84[rbp], 0
	lea	rdx, -32[rbp]
	lea	rsi, -88[rbp]
	mov	eax, DWORD PTR -124[rbp]
	mov	r9d, 16
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 8
	mov	edi, eax
	call	sendto@PLT
	cmp	DWORD PTR -136[rbp], 0
	jne	.L19
	mov	DWORD PTR -140[rbp], 0
	mov	DWORD PTR -136[rbp], 1
	mov	DWORD PTR -132[rbp], 0
	mov	rax, QWORD PTR -112[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rax, -64[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -64[rbp]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rax
	mov	rax, QWORD PTR -56[rbp]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	movsd	xmm2, QWORD PTR .LC5[rip]
	divsd	xmm0, xmm2
	addsd	xmm0, xmm1
	mov	rax, QWORD PTR -80[rbp]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rax
	subsd	xmm0, xmm1
	mov	rax, QWORD PTR -72[rbp]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rax
	movsd	xmm2, QWORD PTR .LC5[rip]
	divsd	xmm1, xmm2
	subsd	xmm0, xmm1
	movsd	QWORD PTR -96[rbp], xmm0
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -96[rbp]
	movq	xmm0, rax
	lea	rdi, .LC7[rip]
	mov	eax, 1
	call	printf@PLT
	jmp	.L19
.L17:
	nop
	jmp	.L4
.L18:
	nop
	jmp	.L4
.L19:
	nop
.L4:
	cmp	DWORD PTR -120[rbp], 0
	jne	.L14
	mov	eax, DWORD PTR -124[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC5:
	.long	0
	.long	1093567616
	.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	"461202.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage : %s <port>\012\000"
	.align	2
.LC1:
	.ascii	"bind() error\000"
	.align	2
.LC2:
	.ascii	"Initiates a file(%s) transfer.\012\000"
	.align	2
.LC3:
	.ascii	"wb\000"
	.align	2
.LC4:
	.ascii	"Fail to create file.\000"
	.global	__aeabi_i2d
	.global	__aeabi_ddiv
	.global	__aeabi_dadd
	.global	__aeabi_dsub
	.align	2
.LC5:
	.ascii	"Shut down the file transfer.\000"
	.align	2
.LC6:
	.ascii	"Total time : %f sec\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #128
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r0, #51200
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-100]
	ldr	r3, [fp, #-128]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-132]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L20+4
	bl	printf
	mov	r0, #1
	bl	exit
.L2:
	mov	r2, #0
	mov	r1, #2
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-96]
	sub	r3, fp, #48
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-48]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-46]	@ movhi
	sub	r3, fp, #48
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-96]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L20+8
	bl	puts
	mov	r0, #1
	bl	exit
.L3:
	mov	r3, #0
	str	r3, [fp, #-120]
	mov	r3, #1
	str	r3, [fp, #-116]
	mov	r3, #1
	str	r3, [fp, #-92]
	mov	r3, #0
	str	r3, [fp, #-112]
	mov	r3, #0
	str	r3, [fp, #-88]
	mov	r3, #0
	str	r3, [fp, #-108]
	b	.L4
.L14:
	mov	r3, #16
	str	r3, [fp, #-124]
	sub	r3, fp, #124
	str	r3, [sp, #4]
	sub	r3, fp, #32
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #51200
	ldr	r1, [fp, #-100]
	ldr	r0, [fp, #-96]
	bl	recvfrom
	ldr	r3, [fp, #-100]
	ldr	r3, [r3]
	ldr	r2, .L20+12
	cmp	r3, r2
	beq	.L5
	cmp	r3, #1004
	bge	.L4
	ldr	r2, .L20+16
	cmp	r3, r2
	beq	.L7
	ldr	r2, .L20+20
	cmp	r3, r2
	beq	.L8
	b	.L4
.L7:
	ldr	r3, .L20+24
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-52]
	sub	r1, fp, #56
	mov	r3, #16
	str	r3, [sp, #4]
	sub	r3, fp, #32
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #8
	ldr	r0, [fp, #-96]
	bl	sendto
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	bne	.L17
	ldr	r3, [fp, #-100]
	add	r3, r3, #12
	mov	r1, r3
	ldr	r0, .L20+28
	bl	printf
	sub	r3, fp, #72
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r3, [fp, #-100]
	add	r3, r3, #12
	ldr	r1, .L20+32
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bne	.L10
	ldr	r0, .L20+36
	bl	puts
	mov	r0, #1
	bl	exit
.L10:
	mov	r3, #1
	str	r3, [fp, #-120]
	mov	r3, #0
	str	r3, [fp, #-116]
	b	.L17
.L8:
	ldr	r3, [fp, #-100]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-112]
	cmp	r2, r3
	bne	.L11
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-108]
	add	r3, r3, #1
	str	r3, [fp, #-108]
	ldr	r3, [fp, #-112]
	add	r3, r3, #1
	rsbs	r2, r3, #0
	and	r3, r3, #15
	and	r2, r2, #15
	rsbpl	r3, r2, #0
	str	r3, [fp, #-112]
	ldr	r3, [fp, #-100]
	add	r0, r3, #12
	ldr	r3, [fp, #-100]
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r3, [fp, #-104]
	mov	r2, #1
	bl	fwrite
	ldr	r3, .L20+40
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-112]
	str	r3, [fp, #-52]
.L11:
	sub	r1, fp, #56
	mov	r3, #16
	str	r3, [sp, #4]
	sub	r3, fp, #32
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #8
	ldr	r0, [fp, #-96]
	bl	sendto
	b	.L4
.L5:
	ldr	r3, [fp, #-100]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-112]
	cmp	r2, r3
	bne	.L18
	ldr	r3, .L20+12
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-52]
	sub	r1, fp, #56
	mov	r3, #16
	str	r3, [sp, #4]
	sub	r3, fp, #32
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #8
	ldr	r0, [fp, #-96]
	bl	sendto
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bne	.L19
	mov	r3, #0
	str	r3, [fp, #-120]
	mov	r3, #1
	str	r3, [fp, #-116]
	mov	r3, #0
	str	r3, [fp, #-112]
	ldr	r0, [fp, #-104]
	bl	fclose
	sub	r3, fp, #64
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r3, [fp, #-64]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	ldr	r3, [fp, #-60]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, #0
	ldr	r3, .L20+44
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	mov	r5, r3
	ldr	r3, [fp, #-72]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	mov	r5, r3
	ldr	r3, [fp, #-68]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, #0
	ldr	r3, .L20+44
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-84]
	str	r3, [fp, #-80]
	ldr	r0, .L20+48
	bl	puts
	sub	r3, fp, #84
	ldmia	r3, {r2-r3}
	ldr	r0, .L20+52
	bl	printf
	b	.L19
.L17:
	nop
	b	.L4
.L18:
	nop
	b	.L4
.L19:
	nop
.L4:
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bne	.L14
	ldr	r0, [fp, #-96]
	bl	close
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	1003
	.word	1001
	.word	1002
	.word	2001
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	2002
	.word	1093567616
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
