	.file	"843631.c"
	.intel_syntax noprefix
	.text
	.globl	error
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.section	.rodata
.LC0:
	.string	"use: %s <port>\n"
.LC1:
	.string	":: START ::"
.LC2:
	.string	"ERROR opening socket"
.LC3:
	.string	"ERROR on binding"
.LC4:
	.string	"ERROR on listen"
.LC5:
	.string	"ERROR on accept"
.LC6:
	.string	"ERROR on inet_ntoa\n"
	.align 8
.LC7:
	.string	"server established connection with %s\n"
.LC8:
	.string	"ERROR reading from socket"
.LC9:
	.string	"server received %d bytes: %s"
.LC10:
	.string	"ERROR writing to socket"
.LC11:
	.string	"stop"
.LC12:
	.string	":: END ::"
	.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, 1136
	mov	DWORD PTR -1124[rbp], edi
	mov	QWORD PTR -1136[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -1124[rbp], 2
	je	.L3
	mov	rax, QWORD PTR -1136[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -1136[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -1104[rbp], eax
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -1100[rbp], eax
	cmp	DWORD PTR -1100[rbp], 0
	jns	.L4
	lea	rdi, .LC2[rip]
	call	error
.L4:
	mov	DWORD PTR -1112[rbp], 1
	lea	rdx, -1112[rbp]
	mov	eax, DWORD PTR -1100[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rax, -1088[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -1088[rbp], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -1084[rbp], eax
	mov	eax, DWORD PTR -1104[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -1086[rbp], ax
	lea	rcx, -1088[rbp]
	mov	eax, DWORD PTR -1100[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC3[rip]
	call	error
.L5:
	mov	eax, DWORD PTR -1100[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L13
	lea	rdi, .LC4[rip]
	call	error
.L13:
	mov	DWORD PTR -1108[rbp], 16
	lea	rdx, -1108[rbp]
	lea	rcx, -1072[rbp]
	mov	eax, DWORD PTR -1100[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -1096[rbp], eax
	cmp	DWORD PTR -1096[rbp], 0
	jns	.L7
	lea	rdi, .LC5[rip]
	call	error
.L7:
	lea	rax, -1056[rbp]
	lea	rdx, -1072[rbp]
	lea	rsi, 4[rdx]
	mov	ecx, 16
	mov	rdx, rax
	mov	edi, 2
	call	inet_ntop@PLT
	test	rax, rax
	jne	.L8
	lea	rdi, .LC6[rip]
	call	error
.L8:
	lea	rax, -1056[rbp]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1096[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1092[rbp], eax
	cmp	DWORD PTR -1092[rbp], 0
	jns	.L9
	lea	rdi, .LC8[rip]
	call	error
.L9:
	mov	eax, DWORD PTR -1092[rbp]
	cdqe
	mov	BYTE PTR -1040[rbp+rax], 0
	lea	rdx, -1040[rbp]
	mov	eax, DWORD PTR -1092[rbp]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -1092[rbp]
	movsx	rdx, eax
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1096[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -1092[rbp], eax
	cmp	DWORD PTR -1092[rbp], 0
	jns	.L10
	lea	rdi, .LC10[rip]
	call	error
.L10:
	mov	eax, DWORD PTR -1096[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rax, -1040[rbp]
	mov	edx, 4
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L13
	movzx	eax, BYTE PTR -1036[rbp]
	cmp	al, 31
	jg	.L13
	mov	eax, DWORD PTR -1100[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"843631.c"
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	error, .-error
	.section	.rodata
	.align	2
.LC0:
	.ascii	"use: %s <port>\012\000"
	.align	2
.LC1:
	.ascii	":: START ::\000"
	.align	2
.LC2:
	.ascii	"ERROR opening socket\000"
	.align	2
.LC3:
	.ascii	"ERROR on binding\000"
	.align	2
.LC4:
	.ascii	"ERROR on listen\000"
	.align	2
.LC5:
	.ascii	"ERROR on accept\000"
	.align	2
.LC6:
	.ascii	"ERROR on inet_ntoa\012\000"
	.align	2
.LC7:
	.ascii	"server established connection with %s\012\000"
	.align	2
.LC8:
	.ascii	"ERROR reading from socket\000"
	.align	2
.LC9:
	.ascii	"server received %d bytes: %s\000"
	.align	2
.LC10:
	.ascii	"ERROR writing to socket\000"
	.align	2
.LC11:
	.ascii	"stop\000"
	.align	2
.LC12:
	.ascii	":: END ::\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1120
	str	r0, [fp, #-1112]
	str	r1, [fp, #-1116]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1112]
	cmp	r3, #2
	beq	.L3
	ldr	r3, .L16+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-1116]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L16+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-1116]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-1096]
	ldr	r0, .L16+12
	bl	puts
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-1092]
	ldr	r3, [fp, #-1092]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L16+16
	bl	error
.L4:
	mov	r3, #1
	str	r3, [fp, #-1104]
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-1092]
	bl	setsockopt
	sub	r3, fp, #1072
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4
	sub	r3, r3, #1072
	sub	r3, r3, #4
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-1076]
	ldr	r3, [fp, #-1096]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #1072
	sub	r3, r3, #4
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #1072
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-1092]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L16+20
	bl	error
.L5:
	mov	r1, #5
	ldr	r0, [fp, #-1092]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L13
	ldr	r0, .L16+24
	bl	error
.L13:
	mov	r3, #16
	str	r3, [fp, #-1100]
	sub	r2, fp, #1088
	sub	r2, r2, #4
	sub	r2, r2, #8
	sub	r3, fp, #1056
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1092]
	bl	accept
	str	r0, [fp, #-1088]
	ldr	r3, [fp, #-1088]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L16+28
	bl	error
.L7:
	sub	r2, fp, #1040
	sub	r2, r2, #4
	sub	r2, r2, #4
	sub	r3, fp, #1056
	sub	r3, r3, #4
	sub	r3, r3, #4
	add	r1, r3, #4
	mov	r3, #16
	mov	r0, #2
	bl	inet_ntop
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	ldr	r0, .L16+32
	bl	error
.L8:
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L16+36
	bl	printf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1088]
	bl	read
	str	r0, [fp, #-1084]
	ldr	r3, [fp, #-1084]
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L16+40
	bl	error
.L9:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, [fp, #-1084]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, r3
	ldr	r1, [fp, #-1084]
	ldr	r0, .L16+44
	bl	printf
	ldr	r2, [fp, #-1084]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1088]
	bl	write
	str	r0, [fp, #-1084]
	ldr	r3, [fp, #-1084]
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L16+48
	bl	error
.L10:
	ldr	r0, [fp, #-1088]
	bl	close
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #4
	ldr	r1, .L16+52
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L13
	ldrb	r3, [fp, #-1028]	@ zero_extendqisi2
	cmp	r3, #31
	bhi	.L13
	ldr	r0, [fp, #-1092]
	bl	close
	ldr	r0, .L16+56
	bl	puts
	mov	r3, #0
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC13
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
