	.file	"473155.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	"ERROR, no port provided\n"
.LC1:
	.string	"ERROR opening socket"
.LC2:
	.string	"ERROR on binding"
.LC3:
	.string	"ERROR on accept"
.LC4:
	.string	"ERROR on fork"
	.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, 96
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -84[rbp], 1
	jg	.L3
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -64[rbp], eax
	cmp	DWORD PTR -64[rbp], 0
	jns	.L4
	lea	rdi, .LC1[rip]
	call	error
.L4:
	lea	rax, -48[rbp]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -60[rbp], eax
	mov	WORD PTR -48[rbp], 2
	mov	DWORD PTR -44[rbp], 0
	mov	eax, DWORD PTR -60[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -46[rbp], ax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -64[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC2[rip]
	call	error
.L5:
	mov	eax, DWORD PTR -64[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	mov	DWORD PTR -68[rbp], 16
.L9:
	lea	rdx, -68[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -64[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], 0
	jns	.L6
	lea	rdi, .LC3[rip]
	call	error
.L6:
	call	fork@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jns	.L7
	lea	rdi, .LC4[rip]
	call	error
.L7:
	cmp	DWORD PTR -52[rbp], 0
	jne	.L8
	mov	eax, DWORD PTR -64[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -56[rbp]
	mov	edi, eax
	call	dostuff
	mov	edi, 0
	call	exit@PLT
.L8:
	mov	eax, DWORD PTR -56[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L9
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
.LC5:
	.string	"ERROR reading from socket"
.LC6:
	.string	"Here is the message: %s\n"
.LC7:
	.string	"I got your message"
.LC8:
	.string	"ERROR writing to socket"
	.text
	.globl	dostuff
	.type	dostuff, @function
dostuff:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 304
	mov	DWORD PTR -292[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -272[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 32
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	lea	rcx, -272[rbp]
	mov	eax, DWORD PTR -292[rbp]
	mov	edx, 255
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -276[rbp], eax
	cmp	DWORD PTR -276[rbp], 0
	jns	.L12
	lea	rdi, .LC5[rip]
	call	error
.L12:
	lea	rax, -272[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -292[rbp]
	mov	edx, 18
	lea	rsi, .LC7[rip]
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -276[rbp], eax
	cmp	DWORD PTR -276[rbp], 0
	jns	.L15
	lea	rdi, .LC8[rip]
	call	error
.L15:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	dostuff, .-dostuff
	.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	"473155.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	"ERROR, no port provided\012\000"
	.align	2
.LC1:
	.ascii	"ERROR opening socket\000"
	.align	2
.LC2:
	.ascii	"ERROR on binding\000"
	.align	2
.LC3:
	.ascii	"ERROR on accept\000"
	.align	2
.LC4:
	.ascii	"ERROR on fork\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-64]
	cmp	r3, #1
	bgt	.L3
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L11+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L3:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L11+12
	bl	error
.L4:
	sub	r3, fp, #40
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	str	r3, [r2, #8]
	str	r3, [r2, #12]
	ldr	r3, [fp, #-68]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-52]
	mov	r3, #2
	strh	r3, [fp, #-40]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-38]	@ movhi
	sub	r3, fp, #40
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-56]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L11+16
	bl	error
.L5:
	mov	r1, #5
	ldr	r0, [fp, #-56]
	bl	listen
	mov	r3, #16
	str	r3, [fp, #-60]
.L9:
	sub	r2, fp, #60
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-56]
	bl	accept
	str	r0, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L11+20
	bl	error
.L6:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L11+24
	bl	error
.L7:
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L8
	ldr	r0, [fp, #-56]
	bl	close
	ldr	r0, [fp, #-48]
	bl	dostuff
	mov	r0, #0
	bl	exit
.L8:
	ldr	r0, [fp, #-48]
	bl	close
	b	.L9
.L12:
	.align	2
.L11:
	.word	.LC5
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.section	.rodata
	.align	2
.LC6:
	.ascii	"ERROR reading from socket\000"
	.align	2
.LC7:
	.ascii	"Here is the message: %s\012\000"
	.align	2
.LC8:
	.ascii	"I got your message\000"
	.align	2
.LC9:
	.ascii	"ERROR writing to socket\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	dostuff
	.syntax unified
	.arm
	.fpu softvfp
	.type	dostuff, %function
dostuff:
	@ args = 0, pretend = 0, frame = 272
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #272
	str	r0, [fp, #-272]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #264
	mov	r0, r3
	mov	r3, #256
	mov	r2, r3
	mov	r1, #0
	bl	memset
	sub	r3, fp, #264
	mov	r2, #255
	mov	r1, r3
	ldr	r0, [fp, #-272]
	bl	read
	str	r0, [fp, #-268]
	ldr	r3, [fp, #-268]
	cmp	r3, #0
	bge	.L14
	ldr	r0, .L18+4
	bl	error
.L14:
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, .L18+8
	bl	printf
	mov	r2, #18
	ldr	r1, .L18+12
	ldr	r0, [fp, #-272]
	bl	write
	str	r0, [fp, #-268]
	ldr	r3, [fp, #-268]
	cmp	r3, #0
	bge	.L17
	ldr	r0, .L18+16
	bl	error
.L17:
	nop
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC10
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	dostuff, .-dostuff
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
