	.file	"67639.c"
	.intel_syntax noprefix
	.text
	.globl	g_connections
	.bss
	.align 32
	.type	g_connections, @object
	.size	g_connections, 256
g_connections:
	.zero	256
	.globl	g_num_connections
	.align 2
	.type	g_num_connections, @object
	.size	g_num_connections, 2
g_num_connections:
	.zero	2
	.section	.rodata
.LC0:
	.string	"BT%d"
	.align 8
.LC1:
	.string	"Got new connection:\n\tfd: %d\n\thandle: %d\n\taddr: %s\n"
	.text
	.globl	create_connection
	.type	create_connection, @function
create_connection:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 100
	mov	DWORD PTR -4[rbp], eax
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, edx
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	mov	WORD PTR [rdx+rax], cx
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rdx, g_connections[rip+4]
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	add	rax, rdx
	lea	rdi, 8[rax]
	mov	eax, DWORD PTR -20[rbp]
	mov	ecx, eax
	lea	rdx, .LC0[rip]
	mov	esi, 6
	mov	eax, 0
	call	snprintf@PLT
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip+14]
	mov	BYTE PTR [rdx+rax], 0
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	add	rax, rdx
	lea	rcx, 8[rax]
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movsx	edx, ax
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	cdqe
	sal	rax, 4
	mov	rsi, rax
	lea	rax, g_connections[rip+4]
	mov	eax, DWORD PTR [rsi+rax]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	create_connection, .-create_connection
	.globl	disconnect
	.type	disconnect, @function
disconnect:
.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, 32
	mov	eax, edi
	mov	WORD PTR -20[rbp], ax
	mov	DWORD PTR -4[rbp], 0
	jmp	.L4
.L6:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	movzx	eax, WORD PTR [rdx+rax]
	cmp	WORD PTR -20[rbp], ax
	jne	.L5
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	mov	WORD PTR [rdx+rax], 0
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip+4]
	mov	DWORD PTR [rdx+rax], 0
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	add	rax, rdx
	add	rax, 8
	mov	edx, 7
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
.L5:
	add	DWORD PTR -4[rbp], 1
.L4:
	cmp	DWORD PTR -4[rbp], 15
	jle	.L6
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	disconnect, .-disconnect
	.section	.rodata
	.align 8
.LC2:
	.string	"Received data for unknown handle"
.LC3:
	.string	"Received non-U input :O"
	.align 8
.LC4:
	.string	"Random condition that leads to a disconnect!"
.LC5:
	.string	"[%s]: %s"
	.text
	.globl	protocol_handler
	.type	protocol_handler, @function
protocol_handler:
.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, 48
	mov	eax, edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	WORD PTR -20[rbp], ax
	mov	QWORD PTR -8[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	jmp	.L8
.L11:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	movzx	eax, WORD PTR [rdx+rax]
	cmp	WORD PTR -20[rbp], ax
	jne	.L9
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	jmp	.L10
.L9:
	add	DWORD PTR -12[rbp], 1
.L8:
	cmp	DWORD PTR -12[rbp], 15
	jle	.L11
.L10:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L12
	lea	rdi, .LC2[rip]
	call	puts@PLT
	jmp	.L7
.L12:
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 85
	je	.L14
	lea	rdi, .LC3[rip]
	call	puts@PLT
	movsx	eax, WORD PTR -20[rbp]
	mov	edi, eax
	call	disconnect
	jmp	.L7
.L14:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 4
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 50
	sub	eax, ecx
	mov	edx, eax
	cmp	edx, 35
	jle	.L15
	lea	rdi, .LC4[rip]
	call	puts@PLT
	movsx	eax, WORD PTR -20[rbp]
	mov	edi, eax
	call	disconnect
	jmp	.L7
.L15:
	mov	rax, QWORD PTR -8[rbp]
	lea	rcx, 8[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, rax
	mov	rsi, rcx
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	protocol_handler, .-protocol_handler
	.globl	connection_handler
	.type	connection_handler, @function
connection_handler:
.LFB9:
	.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	QWORD PTR -296[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -296[rbp]
	mov	QWORD PTR -280[rbp], rax
	jmp	.L17
.L18:
	lea	rax, -272[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR -280[rbp]
	movzx	eax, WORD PTR [rax]
	cwde
	lea	rdx, -272[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	protocol_handler
	lea	rax, -272[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 32
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
.L17:
	mov	rax, QWORD PTR -280[rbp]
	mov	eax, DWORD PTR 4[rax]
	lea	rcx, -272[rbp]
	mov	edx, 256
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jne	.L18
	mov	rax, QWORD PTR -280[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	connection_handler, .-connection_handler
	.section	.rodata
.LC6:
	.string	"Socket bind failed"
.LC7:
	.string	"Listen failed"
.LC8:
	.string	"Accept failed"
	.align 8
.LC9:
	.string	"Max number of connections reached!"
	.align 8
.LC10:
	.string	"Cannot create thread for protocol_handler"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -68[rbp], eax
	lea	rax, -48[rbp]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	mov	WORD PTR -48[rbp], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -44[rbp], eax
	mov	rax, QWORD PTR -96[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 -68[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	je	.L22
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L22:
	mov	eax, DWORD PTR -68[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	je	.L23
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	DWORD PTR -72[rbp], 16
	lea	rdx, -72[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -64[rbp], eax
	cmp	DWORD PTR -64[rbp], 0
	jns	.L24
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L24:
	movzx	eax, WORD PTR g_num_connections[rip]
	cmp	ax, 15
	jne	.L25
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -64[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L23
.L25:
	mov	eax, DWORD PTR -64[rbp]
	mov	edi, eax
	call	create_connection
	mov	DWORD PTR -60[rbp], eax
	movzx	eax, WORD PTR g_num_connections[rip]
	cwde
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, g_connections[rip]
	add	rdx, rax
	lea	rax, -56[rbp]
	mov	rcx, rdx
	lea	rdx, connection_handler[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	jns	.L23
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.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	"67639.c"
	.text
	.comm	g_connections,256,4
	.global	g_num_connections
	.bss
	.align	1
	.type	g_num_connections, %object
	.size	g_num_connections, 2
g_num_connections:
	.space	2
	.section	.rodata
	.align	2
.LC0:
	.ascii	"BT%d\000"
	.align	2
.LC1:
	.ascii	"Got new connection:\012\011fd: %d\012\011handle: %d"
	.ascii	"\012\011addr: %s\012\000"
	.text
	.align	2
	.global	create_connection
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_connection, %function
create_connection:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	add	r3, r3, #100
	str	r3, [fp, #-8]
	ldr	r3, .L3
	ldrsh	r3, [r3]
	mov	r0, r3
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r1, .L3+4
	lsl	r3, r0, #4
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldr	r3, .L3
	ldrsh	r3, [r3]
	ldr	r2, .L3+4
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r3, .L3
	ldrsh	r3, [r3]
	lsl	r3, r3, #4
	add	r3, r3, #8
	ldr	r2, .L3+4
	add	r0, r3, r2
	ldr	r3, [fp, #-16]
	ldr	r2, .L3+8
	mov	r1, #6
	bl	snprintf
	ldr	r3, .L3
	ldrsh	r3, [r3]
	ldr	r2, .L3+4
	lsl	r3, r3, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #14]
	ldr	r3, .L3
	ldrsh	r3, [r3]
	ldr	r2, .L3+4
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r1, [r3, #4]
	ldr	r3, .L3
	ldrsh	r3, [r3]
	ldr	r2, .L3+4
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldrsh	r3, [r3]
	mov	r0, r3
	ldr	r3, .L3
	ldrsh	r3, [r3]
	lsl	r3, r3, #4
	add	r3, r3, #8
	ldr	r2, .L3+4
	add	r3, r3, r2
	mov	r2, r0
	ldr	r0, .L3+12
	bl	printf
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	g_num_connections
	.word	g_connections
	.word	.LC0
	.word	.LC1
	.size	create_connection, .-create_connection
	.align	2
	.global	disconnect
	.syntax unified
	.arm
	.fpu softvfp
	.type	disconnect, %function
disconnect:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	mov	r3, r0
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L6
.L8:
	ldr	r2, .L9
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldrsh	r3, [r3]
	ldrsh	r2, [fp, #-14]
	cmp	r2, r3
	bne	.L7
	ldr	r2, .L9
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	add	r3, r2, r3
	mov	r2, #0
	strh	r2, [r3]	@ movhi
	ldr	r2, .L9
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	add	r3, r3, #8
	ldr	r2, .L9
	add	r3, r3, r2
	mov	r2, #7
	mov	r1, #0
	mov	r0, r3
	bl	memset
.L7:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L6:
	ldr	r3, [fp, #-8]
	cmp	r3, #15
	ble	.L8
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	g_connections
	.size	disconnect, .-disconnect
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Received data for unknown handle\000"
	.align	2
.LC3:
	.ascii	"Received non-U input :O\000"
	.align	2
.LC4:
	.ascii	"Random condition that leads to a disconnect!\000"
	.align	2
.LC5:
	.ascii	"[%s]: %s\000"
	.text
	.align	2
	.global	protocol_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	protocol_handler, %function
protocol_handler:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	mov	r3, r0
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L12
.L15:
	ldr	r2, .L20
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldrsh	r3, [r3]
	ldrsh	r2, [fp, #-14]
	cmp	r2, r3
	bne	.L13
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	ldr	r2, .L20
	add	r3, r3, r2
	str	r3, [fp, #-12]
	b	.L14
.L13:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L12:
	ldr	r3, [fp, #-8]
	cmp	r3, #15
	ble	.L15
.L14:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L16
	ldr	r0, .L20+4
	bl	puts
	b	.L11
.L16:
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #85
	beq	.L18
	ldr	r0, .L20+8
	bl	puts
	ldrsh	r3, [fp, #-14]
	mov	r0, r3
	bl	disconnect
	b	.L11
.L18:
	bl	rand
	mov	r1, r0
	ldr	r3, .L20+12
	smull	r2, r3, r1, r3
	asr	r2, r3, #4
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	cmp	r2, #35
	ble	.L19
	ldr	r0, .L20+16
	bl	puts
	ldrsh	r3, [fp, #-14]
	mov	r0, r3
	bl	disconnect
	b	.L11
.L19:
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r2, [fp, #-24]
	mov	r1, r3
	ldr	r0, .L20+20
	bl	printf
.L11:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	g_connections
	.word	.LC2
	.word	.LC3
	.word	1374389535
	.word	.LC4
	.word	.LC5
	.size	protocol_handler, .-protocol_handler
	.section	.rodata
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	connection_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	connection_handler, %function
connection_handler:
	@ args = 0, pretend = 0, frame = 272
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #276
	str	r0, [fp, #-280]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-280]
	str	r3, [fp, #-276]
	b	.L23
.L24:
	ldr	r3, [fp, #-276]
	ldrsh	r4, [r3]
	sub	r3, fp, #272
	mov	r0, r3
	bl	strlen
	mov	r1, r0
	sub	r3, fp, #272
	mov	r2, r3
	mov	r0, r4
	bl	protocol_handler
	sub	r3, fp, #272
	mov	r0, r3
	mov	r3, #256
	mov	r2, r3
	mov	r1, #0
	bl	memset
.L23:
	ldr	r3, [fp, #-276]
	ldr	r3, [r3, #4]
	sub	r1, fp, #272
	mov	r2, #256
	mov	r0, r3
	bl	read
	mov	r3, r0
	cmp	r3, #0
	bne	.L24
	ldr	r3, [fp, #-276]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	close
	mov	r3, #0
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L26
	bl	__stack_chk_fail
.L26:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC6
	.size	connection_handler, .-connection_handler
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Socket bind failed\000"
	.align	2
.LC8:
	.ascii	"Listen failed\000"
	.align	2
.LC9:
	.ascii	"Accept failed\000"
	.align	2
.LC10:
	.ascii	"Max number of connections reached!\000"
	.align	2
.LC11:
	.ascii	"Cannot create thread for protocol_handler\000"
	.align	2
.LC12:
	.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, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-52]
	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]
	mov	r3, #2
	strh	r3, [fp, #-40]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-68]
	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, #-38]	@ movhi
	sub	r3, fp, #40
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	beq	.L30
	ldr	r0, .L37+4
	bl	puts
	mov	r0, #1
	bl	exit
.L30:
	mov	r1, #5
	ldr	r0, [fp, #-52]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	beq	.L31
	ldr	r0, .L37+8
	bl	puts
	mov	r0, #1
	bl	exit
.L31:
	mov	r3, #16
	str	r3, [fp, #-60]
	sub	r2, fp, #60
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	accept
	str	r0, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	bge	.L32
	ldr	r0, .L37+12
	bl	puts
	mov	r0, #1
	bl	exit
.L32:
	ldr	r3, .L37+16
	ldrsh	r3, [r3]
	cmp	r3, #15
	bne	.L33
	ldr	r0, .L37+20
	bl	puts
	ldr	r0, [fp, #-48]
	bl	close
	b	.L31
.L33:
	ldr	r0, [fp, #-48]
	bl	create_connection
	str	r0, [fp, #-44]
	ldr	r3, .L37+16
	ldrsh	r3, [r3]
	lsl	r3, r3, #4
	ldr	r2, .L37+24
	add	r3, r3, r2
	sub	r0, fp, #56
	ldr	r2, .L37+28
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	bge	.L31
	ldr	r0, .L37+32
	bl	puts
	mov	r0, #1
	bl	exit
.L38:
	.align	2
.L37:
	.word	.LC12
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	g_num_connections
	.word	.LC10
	.word	g_connections
	.word	connection_handler
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
