	.file	"505119.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"usage: udp_server port\n"
.LC1:
	.string	"error: invalid port\n"
.LC2:
	.string	"socket"
.LC3:
	.string	"bind"
.LC4:
	.string	"recvfrom"
	.align 8
.LC5:
	.string	"Received message. Size: %d, message: %s"
.LC6:
	.string	"sendto"
	.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
	push	rbx
	sub	rsp, 120
	.cfi_offset 3, -24
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	DWORD PTR -96[rbp], 1024
	mov	eax, DWORD PTR -96[rbp]
	add	eax, 1
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -80[rbp], rdx
	movsx	rdx, eax
	mov	r10, rdx
	mov	r11d, 0
	movsx	rdx, eax
	mov	r8, rdx
	mov	r9d, 0
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L2:
	cmp	rsp, rdx
	je	.L3
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L2
.L3:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L4
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L4:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -72[rbp], rax
	cmp	DWORD PTR -116[rbp], 2
	je	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], 0
	jg	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	edx, 0
	mov	esi, 2
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], -1
	jne	.L7
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	WORD PTR -64[rbp], 2
	mov	eax, DWORD PTR -92[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -62[rbp], ax
	mov	DWORD PTR -60[rbp], 0
	lea	rcx, -64[rbp]
	mov	eax, DWORD PTR -88[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	DWORD PTR -100[rbp], 16
	mov	eax, DWORD PTR -96[rbp]
	movsx	rdx, eax
	lea	rdi, -100[rbp]
	lea	rcx, -48[rbp]
	mov	rsi, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR -88[rbp]
	mov	r9, rdi
	mov	r8, rcx
	mov	ecx, 0
	mov	edi, eax
	call	recvfrom@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], 0
	jne	.L9
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	close@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L15
	lea	rdi, .LC4[rip]
	call	perror@PLT
	jmp	.L15
.L9:
	mov	rdx, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], 0
	mov	rdx, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR -84[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -84[rbp]
	movsx	rdx, eax
	lea	rcx, -48[rbp]
	mov	rsi, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR -88[rbp]
	mov	r9d, 16
	mov	r8, rcx
	mov	ecx, 0
	mov	edi, eax
	call	sendto@PLT
	cmp	rax, -1
	jne	.L8
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L11
.L15:
	nop
.L11:
	mov	rsp, rbx
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"505119.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: udp_server port\012\000"
	.align	2
.LC1:
	.ascii	"error: invalid port\012\000"
	.align	2
.LC2:
	.ascii	"socket\000"
	.align	2
.LC3:
	.ascii	"bind\000"
	.align	2
.LC4:
	.ascii	"recvfrom\000"
	.align	2
.LC5:
	.ascii	"Received message. Size: %d, message: %s\000"
	.align	2
.LC6:
	.ascii	"sendto\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 = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #84
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r3, #1024
	str	r3, [fp, #-72]
	ldr	r3, [fp, #-72]
	add	ip, r3, #1
	sub	r3, ip, #1
	str	r3, [fp, #-68]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	add	r3, sp, #8
	add	r3, r3, #0
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-80]
	cmp	r3, #2
	beq	.L2
	ldr	r3, .L13+4
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L13+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-84]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	bgt	.L3
	ldr	r3, .L13+4
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L13+12
	bl	fwrite
	mov	r0, #1
	bl	exit
.L3:
	mov	r2, #0
	mov	r1, #2
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L13+16
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	mov	r3, #2
	strh	r3, [fp, #-48]	@ movhi
	ldr	r3, [fp, #-60]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-46]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-44]
	sub	r3, fp, #48
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-56]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L13+20
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	mov	r3, #16
	str	r3, [fp, #-76]
	ldr	r2, [fp, #-72]
	sub	r3, fp, #76
	str	r3, [sp, #4]
	sub	r3, fp, #32
	str	r3, [sp]
	mov	r3, #0
	ldr	r1, [fp, #-64]
	ldr	r0, [fp, #-56]
	bl	recvfrom
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	bne	.L6
	ldr	r0, [fp, #-56]
	bl	close
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L12
	ldr	r0, .L13+24
	bl	perror
	b	.L12
.L6:
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-52]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r2, [fp, #-64]
	ldr	r1, [fp, #-52]
	ldr	r0, .L13+28
	bl	printf
	ldr	r2, [fp, #-52]
	mov	r3, #16
	str	r3, [sp, #4]
	sub	r3, fp, #32
	str	r3, [sp]
	mov	r3, #0
	ldr	r1, [fp, #-64]
	ldr	r0, [fp, #-56]
	bl	sendto
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L13+32
	bl	perror
	ldr	r0, [fp, #-56]
	bl	close
	b	.L8
.L12:
	nop
.L8:
	mov	sp, r4
	mov	r3, #0
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC7
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.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
