	.file	"645521.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Could not create socket."
.LC1:
	.string	"Bind failed."
.LC2:
	.string	"Server bound."
.LC3:
	.string	"Waiting for connections."
	.align 8
.LC4:
	.string	"New client connected. IP address: %s.\n"
.LC5:
	.string	"OK"
.LC6:
	.string	"KO"
.LC7:
	.string	"Client disconnected."
.LC8:
	.string	"Could not accept conection.\n"
	.text
	.globl	startServer
	.type	startServer, @function
startServer:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 152
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -160[rbp], 0
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L18
.L2:
	mov	WORD PTR -96[rbp], 2
	mov	DWORD PTR -92[rbp], 0
	mov	eax, DWORD PTR -180[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -94[rbp], ax
	lea	rcx, -96[rbp]
	mov	eax, DWORD PTR -152[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 2
	jmp	.L18
.L4:
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -152[rbp]
	mov	esi, 3
	mov	edi, eax
	call	listen@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	DWORD PTR -168[rbp], 16
	jmp	.L5
.L16:
	mov	rax, rsp
	mov	rbx, rax
	mov	eax, DWORD PTR -76[rbp]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	QWORD PTR -136[rbp], rax
	mov	rax, QWORD PTR -136[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	DWORD PTR -148[rbp], 10
	mov	eax, DWORD PTR -148[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -128[rbp], rdx
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 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
.L6:
	cmp	rsp, rdx
	je	.L7
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L6
.L7:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L8
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L8:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -120[rbp], rax
	mov	DWORD PTR -164[rbp], 1
	lea	rax, .LC5[rip]
	mov	QWORD PTR -112[rbp], rax
	lea	rax, .LC6[rip]
	mov	QWORD PTR -104[rbp], rax
	jmp	.L9
.L14:
	mov	eax, DWORD PTR -148[rbp]
	movsx	rdx, eax
	mov	rsi, QWORD PTR -120[rbp]
	mov	eax, DWORD PTR -156[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 1
	jne	.L10
	mov	rax, QWORD PTR -120[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 113
	je	.L11
	mov	rax, QWORD PTR -120[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 81
	jne	.L10
.L11:
	mov	DWORD PTR -160[rbp], 1
	jmp	.L9
.L10:
	cmp	DWORD PTR -164[rbp], 2
	jne	.L12
	mov	BYTE PTR -57[rbp], 0
	mov	rax, QWORD PTR -120[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -57[rbp], al
	lea	rax, -57[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -144[rbp], eax
	mov	rax, QWORD PTR -120[rbp]
	movzx	eax, BYTE PTR 1[rax]
	mov	BYTE PTR -57[rbp], al
	lea	rax, -57[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -140[rbp], eax
	mov	edx, DWORD PTR -140[rbp]
	mov	eax, DWORD PTR -144[rbp]
	mov	rcx, QWORD PTR -192[rbp]
	mov	esi, edx
	mov	edi, eax
	call	rcx
	mov	rcx, QWORD PTR -112[rbp]
	mov	eax, DWORD PTR -156[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	jmp	.L9
.L12:
	mov	rcx, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR -156[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L9:
	cmp	DWORD PTR -164[rbp], 0
	jle	.L13
	cmp	DWORD PTR -160[rbp], 0
	je	.L14
.L13:
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	rsp, rbx
.L5:
	cmp	DWORD PTR -160[rbp], 0
	jne	.L15
	lea	rdx, -168[rbp]
	lea	rcx, -80[rbp]
	mov	eax, DWORD PTR -152[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -156[rbp], eax
	cmp	DWORD PTR -156[rbp], 0
	jne	.L16
.L15:
	cmp	DWORD PTR -156[rbp], 0
	jns	.L17
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, 3
	jmp	.L18
.L17:
	mov	eax, DWORD PTR -152[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L18:
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	startServer, .-startServer
	.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	"645521.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Could not create socket.\000"
	.align	2
.LC1:
	.ascii	"Bind failed.\000"
	.align	2
.LC2:
	.ascii	"Server bound.\000"
	.align	2
.LC3:
	.ascii	"Waiting for connections.\000"
	.align	2
.LC4:
	.ascii	"New client connected. IP address: %s.\012\000"
	.align	2
.LC5:
	.ascii	"OK\000"
	.align	2
.LC6:
	.ascii	"KO\000"
	.align	2
.LC7:
	.ascii	"Client disconnected.\000"
	.align	2
.LC8:
	.ascii	"Could not accept conection.\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	startServer
	.syntax unified
	.arm
	.fpu softvfp
	.type	startServer, %function
startServer:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #108
	str	r0, [fp, #-112]
	str	r1, [fp, #-116]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-96]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-88]
	ldr	r3, [fp, #-88]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L17+4
	bl	puts
	mov	r3, #1
	b	.L15
.L2:
	mov	r3, #2
	strh	r3, [fp, #-52]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-112]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-50]	@ movhi
	sub	r3, fp, #52
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-88]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L17+8
	bl	puts
	mov	r3, #2
	b	.L15
.L4:
	ldr	r0, .L17+12
	bl	puts
	mov	r1, #3
	ldr	r0, [fp, #-88]
	bl	listen
	ldr	r0, .L17+16
	bl	puts
	mov	r3, #16
	str	r3, [fp, #-104]
	b	.L5
.L13:
	mov	r3, sp
	mov	r4, r3
	ldr	r0, [fp, #-32]
	bl	inet_ntoa
	str	r0, [fp, #-84]
	ldr	r1, [fp, #-84]
	ldr	r0, .L17+20
	bl	printf
	ldr	r3, .L17+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r3, #10
	str	r3, [fp, #-80]
	ldr	ip, [fp, #-80]
	sub	r3, ip, #1
	str	r3, [fp, #-76]
	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
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-72]
	mov	r3, #1
	str	r3, [fp, #-100]
	ldr	r3, .L17+28
	str	r3, [fp, #-68]
	ldr	r3, .L17+32
	str	r3, [fp, #-64]
	b	.L6
.L11:
	ldr	r2, [fp, #-80]
	mov	r3, #0
	ldr	r1, [fp, #-72]
	ldr	r0, [fp, #-92]
	bl	recv
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-100]
	cmp	r3, #1
	bne	.L7
	ldr	r3, [fp, #-72]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #113
	beq	.L8
	ldr	r3, [fp, #-72]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #81
	bne	.L7
.L8:
	mov	r3, #1
	str	r3, [fp, #-96]
	b	.L6
.L7:
	ldr	r3, [fp, #-100]
	cmp	r3, #2
	bne	.L9
	mov	r3, #0
	strb	r3, [fp, #-20]
	ldr	r3, [fp, #-72]
	ldrb	r3, [r3]	@ zero_extendqisi2
	strb	r3, [fp, #-20]
	sub	r3, fp, #20
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-72]
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	strb	r3, [fp, #-20]
	sub	r3, fp, #20
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-116]
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	blx	r3
	mov	r2, #2
	ldr	r1, [fp, #-68]
	ldr	r0, [fp, #-92]
	bl	write
	b	.L6
.L9:
	mov	r2, #2
	ldr	r1, [fp, #-64]
	ldr	r0, [fp, #-92]
	bl	write
.L6:
	ldr	r3, [fp, #-100]
	cmp	r3, #0
	ble	.L10
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	beq	.L11
.L10:
	ldr	r0, .L17+36
	bl	puts
	mov	sp, r4
.L5:
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	bne	.L12
	sub	r2, fp, #104
	sub	r3, fp, #36
	mov	r1, r3
	ldr	r0, [fp, #-88]
	bl	accept
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bne	.L13
.L12:
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bge	.L14
	ldr	r0, .L17+40
	bl	puts
	mov	r3, #3
	b	.L15
.L14:
	ldr	r0, [fp, #-88]
	bl	close
	mov	r3, #0
.L15:
	ldr	r2, .L17
	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, #8
	@ sp needed
	pop	{r4, fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC9
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	stdout
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	startServer, .-startServer
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
