	.file	"685279.c"
	.intel_syntax noprefix
	.text
	.local	cli_count
	.comm	cli_count,4,4
	.data
	.align 4
	.type	uid, @object
	.size	uid, 4
uid:
	.long	10
	.globl	clients
	.bss
	.align 32
	.type	clients, @object
	.size	clients, 800
clients:
	.zero	800
	.globl	clients_mutex
	.align 32
	.type	clients_mutex, @object
	.size	clients_mutex, 40
clients_mutex:
	.zero	40
	.section	.rodata
.LC0:
	.string	"> "
.LC1:
	.string	"\r%s"
	.text
	.globl	str_overwrite_stdout
	.type	str_overwrite_stdout, @function
str_overwrite_stdout:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	str_overwrite_stdout, .-str_overwrite_stdout
	.globl	str_trim_lf
	.type	str_trim_lf, @function
str_trim_lf:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L3
.L6:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L4
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	jmp	.L5
.L4:
	add	DWORD PTR -4[rbp], 1
.L3:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L6
	nop
.L5:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	str_trim_lf, .-str_trim_lf
	.section	.rodata
.LC2:
	.string	"%d.%d.%d.%d"
	.text
	.globl	print_client_addr
	.type	print_client_addr, @function
print_client_addr:
.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, 16
	mov	rax, rdi
	mov	rcx, rsi
	mov	rdx, rcx
	mov	QWORD PTR -16[rbp], rax
	mov	QWORD PTR -8[rbp], rdx
	mov	eax, DWORD PTR -12[rbp]
	shr	eax, 24
	mov	esi, eax
	mov	eax, DWORD PTR -12[rbp]
	shr	eax, 16
	movzx	ecx, al
	mov	eax, DWORD PTR -12[rbp]
	shr	eax, 8
	movzx	edx, al
	mov	eax, DWORD PTR -12[rbp]
	movzx	eax, al
	mov	r8d, esi
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	print_client_addr, .-print_client_addr
	.globl	queue_add
	.type	queue_add, @function
queue_add:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	lea	rdi, clients_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L9
.L12:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, clients[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	jne	.L10
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rdx, clients[rip]
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rcx+rdx], rax
	jmp	.L11
.L10:
	add	DWORD PTR -4[rbp], 1
.L9:
	cmp	DWORD PTR -4[rbp], 99
	jle	.L12
.L11:
	lea	rdi, clients_mutex[rip]
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	queue_add, .-queue_add
	.globl	queue_remove
	.type	queue_remove, @function
queue_remove:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	lea	rdi, clients_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L14
.L17:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, clients[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	je	.L15
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, clients[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR 20[rax]
	cmp	DWORD PTR -20[rbp], eax
	jne	.L15
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, clients[rip]
	mov	QWORD PTR [rdx+rax], 0
	jmp	.L16
.L15:
	add	DWORD PTR -4[rbp], 1
.L14:
	cmp	DWORD PTR -4[rbp], 99
	jle	.L17
.L16:
	lea	rdi, clients_mutex[rip]
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	queue_remove, .-queue_remove
	.section	.rodata
	.align 8
.LC3:
	.string	"ERROR: write to descriptor failed"
	.text
	.globl	send_message
	.type	send_message, @function
send_message:
.LFB11:
	.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	lea	rdi, clients_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L19
.L22:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, clients[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	je	.L20
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, clients[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR 20[rax]
	cmp	DWORD PTR -28[rbp], eax
	je	.L20
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, clients[rip]
	mov	rax, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR 16[rax]
	mov	rcx, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L20
	lea	rdi, .LC3[rip]
	call	perror@PLT
	jmp	.L21
.L20:
	add	DWORD PTR -4[rbp], 1
.L19:
	cmp	DWORD PTR -4[rbp], 99
	jle	.L22
.L21:
	lea	rdi, clients_mutex[rip]
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	send_message, .-send_message
	.section	.rodata
.LC4:
	.string	"Didn't enter the name."
.LC5:
	.string	"%s has joined\n"
.LC6:
	.string	"%s"
.LC7:
	.string	"%s -> %s\n"
.LC8:
	.string	"exit"
.LC9:
	.string	"%s has left\n"
.LC10:
	.string	"ERROR: -1"
	.text
	.globl	handle_client
	.type	handle_client, @function
handle_client:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 2144
	mov	QWORD PTR -2136[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -2112[rbp], 0
	mov	DWORD PTR -2128[rbp], 1
	mov	eax, DWORD PTR -2128[rbp]
	lock xadd	DWORD PTR cli_count[rip], eax
	mov	DWORD PTR -2124[rbp], eax
	mov	rax, QWORD PTR -2136[rbp]
	mov	QWORD PTR -2104[rbp], rax
	mov	rax, QWORD PTR -2104[rbp]
	mov	eax, DWORD PTR 16[rax]
	lea	rsi, -2096[rbp]
	mov	ecx, 0
	mov	edx, 32
	mov	edi, eax
	call	recv@PLT
	test	rax, rax
	jle	.L24
	lea	rax, -2096[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 1
	jbe	.L24
	lea	rax, -2096[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 30
	jbe	.L25
.L24:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	DWORD PTR -2112[rbp], 1
	jmp	.L26
.L25:
	mov	rax, QWORD PTR -2104[rbp]
	lea	rdx, 24[rax]
	lea	rax, -2096[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	strcpy@PLT
	mov	rax, QWORD PTR -2104[rbp]
	lea	rdx, 24[rax]
	lea	rax, -2064[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -2064[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -2104[rbp]
	mov	edx, DWORD PTR 20[rax]
	lea	rax, -2064[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	send_message
.L26:
	lea	rax, -2064[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 256
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
.L33:
	cmp	DWORD PTR -2112[rbp], 0
	jne	.L37
	mov	rax, QWORD PTR -2104[rbp]
	mov	eax, DWORD PTR 16[rax]
	lea	rsi, -2064[rbp]
	mov	ecx, 0
	mov	edx, 2048
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -2108[rbp], eax
	cmp	DWORD PTR -2108[rbp], 0
	jle	.L29
	lea	rax, -2064[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L30
	mov	rax, QWORD PTR -2104[rbp]
	mov	edx, DWORD PTR 20[rax]
	lea	rax, -2064[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	send_message
	lea	rax, -2064[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	edx, eax
	lea	rax, -2064[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	str_trim_lf
	mov	rax, QWORD PTR -2104[rbp]
	lea	rdx, 24[rax]
	lea	rax, -2064[rbp]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L30
.L29:
	cmp	DWORD PTR -2108[rbp], 0
	je	.L31
	lea	rax, -2064[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L32
.L31:
	mov	rax, QWORD PTR -2104[rbp]
	lea	rdx, 24[rax]
	lea	rax, -2064[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -2064[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -2104[rbp]
	mov	edx, DWORD PTR 20[rax]
	lea	rax, -2064[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	send_message
	mov	DWORD PTR -2112[rbp], 1
	jmp	.L30
.L32:
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	DWORD PTR -2112[rbp], 1
.L30:
	lea	rax, -2064[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 256
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	jmp	.L33
.L37:
	nop
	mov	rax, QWORD PTR -2104[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -2104[rbp]
	mov	eax, DWORD PTR 20[rax]
	mov	edi, eax
	call	queue_remove
	mov	rax, QWORD PTR -2104[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	DWORD PTR -2120[rbp], 1
	mov	eax, DWORD PTR -2120[rbp]
	neg	eax
	lock xadd	DWORD PTR cli_count[rip], eax
	mov	DWORD PTR -2116[rbp], eax
	call	pthread_self@PLT
	mov	rdi, rax
	call	pthread_detach@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	handle_client, .-handle_client
	.section	.rodata
.LC11:
	.string	"Usage: %s <port>\n"
.LC12:
	.string	"127.0.0.1"
.LC13:
	.string	"ERROR: setsockopt failed"
.LC14:
	.string	"ERROR: Socket binding failed"
	.align 8
.LC15:
	.string	"ERROR: Socket listening failed"
	.align 8
.LC16:
	.string	"=== WELCOME TO THE CHATROOM ==="
	.align 8
.LC17:
	.string	"Max clients reached. Rejected: "
.LC18:
	.string	":%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -100[rbp], 2
	je	.L39
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L47
.L39:
	lea	rax, .LC12[rip]
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -84[rbp], eax
	mov	DWORD PTR -96[rbp], 1
	mov	DWORD PTR -80[rbp], 0
	mov	DWORD PTR -76[rbp], 0
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -80[rbp], eax
	mov	WORD PTR -48[rbp], 2
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	inet_addr@PLT
	mov	DWORD PTR -44[rbp], eax
	mov	eax, DWORD PTR -84[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -46[rbp], ax
	mov	esi, 1
	mov	edi, 13
	call	signal@PLT
	lea	rdx, -96[rbp]
	mov	eax, DWORD PTR -80[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 15
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	jns	.L41
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L47
.L41:
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -80[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L42
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L47
.L42:
	mov	eax, DWORD PTR -80[rbp]
	mov	esi, 10
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L43
	lea	rdi, .LC15[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L47
.L43:
	lea	rdi, .LC16[rip]
	call	puts@PLT
.L46:
	mov	DWORD PTR -92[rbp], 16
	lea	rdx, -92[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -80[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -76[rbp], eax
	mov	eax, DWORD PTR cli_count[rip]
	mov	DWORD PTR -88[rbp], eax
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, 99
	jne	.L44
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rdx
	mov	rsi, rax
	call	print_client_addr
	movzx	eax, WORD PTR -30[rbp]
	movzx	eax, ax
	mov	esi, eax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -76[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L46
.L44:
	mov	edi, 56
	call	malloc@PLT
	mov	QWORD PTR -56[rbp], rax
	mov	rcx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, DWORD PTR -76[rbp]
	mov	DWORD PTR 16[rax], edx
	mov	eax, DWORD PTR uid[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR uid[rip], edx
	mov	rdx, QWORD PTR -56[rbp]
	mov	DWORD PTR 20[rdx], eax
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	queue_add
	mov	rdx, QWORD PTR -56[rbp]
	lea	rax, -72[rbp]
	mov	rcx, rdx
	lea	rdx, handle_client[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	edi, 1
	call	sleep@PLT
	jmp	.L46
.L47:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L48
	call	__stack_chk_fail@PLT
.L48:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	"685279.c"
	.text
	.local	cli_count
	.comm	cli_count,4,4
	.data
	.align	2
	.type	uid, %object
	.size	uid, 4
uid:
	.word	10
	.comm	clients,400,4
	.global	clients_mutex
	.bss
	.align	2
	.type	clients_mutex, %object
	.size	clients_mutex, 24
clients_mutex:
	.space	24
	.section	.rodata
	.align	2
.LC0:
	.ascii	"> \000"
	.align	2
.LC1:
	.ascii	"\015%s\000"
	.text
	.align	2
	.global	str_overwrite_stdout
	.syntax unified
	.arm
	.fpu softvfp
	.type	str_overwrite_stdout, %function
str_overwrite_stdout:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r1, .L2
	ldr	r0, .L2+4
	bl	printf
	ldr	r3, .L2+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.word	.LC1
	.word	stdout
	.size	str_overwrite_stdout, .-str_overwrite_stdout
	.align	2
	.global	str_trim_lf
	.syntax unified
	.arm
	.fpu softvfp
	.type	str_trim_lf, %function
str_trim_lf:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L5
.L8:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L6
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	b	.L7
.L6:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L5:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	blt	.L8
	nop
.L7:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	str_trim_lf, .-str_trim_lf
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%d.%d.%d.%d\000"
	.text
	.align	2
	.global	print_client_addr
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_client_addr, %function
print_client_addr:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	sub	ip, fp, #20
	stm	ip, {r0, r1, r2, r3}
	ldr	r3, [fp, #-16]
	and	r1, r3, #255
	ldr	r3, [fp, #-16]
	lsr	r3, r3, #8
	and	r2, r3, #255
	ldr	r3, [fp, #-16]
	lsr	r3, r3, #16
	and	r0, r3, #255
	ldr	r3, [fp, #-16]
	lsr	r3, r3, #24
	str	r3, [sp]
	mov	r3, r0
	ldr	r0, .L10
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC2
	.size	print_client_addr, .-print_client_addr
	.align	2
	.global	queue_add
	.syntax unified
	.arm
	.fpu softvfp
	.type	queue_add, %function
queue_add:
	@ 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	r0, .L17
	bl	pthread_mutex_lock
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L13
.L16:
	ldr	r2, .L17+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	bne	.L14
	ldr	r1, .L17+4
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r1, r3, lsl #2]
	b	.L15
.L14:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L13:
	ldr	r3, [fp, #-8]
	cmp	r3, #99
	ble	.L16
.L15:
	ldr	r0, .L17
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	clients_mutex
	.word	clients
	.size	queue_add, .-queue_add
	.align	2
	.global	queue_remove
	.syntax unified
	.arm
	.fpu softvfp
	.type	queue_remove, %function
queue_remove:
	@ 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	r0, .L24
	bl	pthread_mutex_lock
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L20
.L23:
	ldr	r2, .L24+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	beq	.L21
	ldr	r2, .L24+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r3, [r3, #20]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bne	.L21
	ldr	r2, .L24+4
	ldr	r3, [fp, #-8]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	b	.L22
.L21:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L20:
	ldr	r3, [fp, #-8]
	cmp	r3, #99
	ble	.L23
.L22:
	ldr	r0, .L24
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	clients_mutex
	.word	clients
	.size	queue_remove, .-queue_remove
	.section	.rodata
	.align	2
.LC3:
	.ascii	"ERROR: write to descriptor failed\000"
	.text
	.align	2
	.global	send_message
	.syntax unified
	.arm
	.fpu softvfp
	.type	send_message, %function
send_message:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r0, .L31
	bl	pthread_mutex_lock
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L27
.L30:
	ldr	r2, .L31+4
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	beq	.L28
	ldr	r2, .L31+4
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r3, [r3, #20]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	beq	.L28
	ldr	r2, .L31+4
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r4, [r3, #16]
	ldr	r0, [fp, #-24]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-24]
	mov	r0, r4
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L28
	ldr	r0, .L31+8
	bl	perror
	b	.L29
.L28:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L27:
	ldr	r3, [fp, #-16]
	cmp	r3, #99
	ble	.L30
.L29:
	ldr	r0, .L31
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L32:
	.align	2
.L31:
	.word	clients_mutex
	.word	clients
	.word	.LC3
	.size	send_message, .-send_message
	.global	__sync_fetch_and_add_4
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Didn't enter the name.\000"
	.align	2
.LC5:
	.ascii	"%s has joined\012\000"
	.align	2
.LC6:
	.ascii	"%s\000"
	.align	2
.LC7:
	.ascii	"%s -> %s\012\000"
	.align	2
.LC8:
	.ascii	"exit\000"
	.align	2
.LC9:
	.ascii	"%s has left\012\000"
	.align	2
.LC10:
	.ascii	"ERROR: -1\000"
	.global	__sync_fetch_and_sub_4
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	handle_client
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_client, %function
handle_client:
	@ args = 0, pretend = 0, frame = 2120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #2112
	sub	sp, sp, #8
	str	r0, [fp, #-2120]
	ldr	r3, .L48
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-2100]
	mov	r3, #1
	str	r3, [fp, #-2116]
	ldr	r3, [fp, #-2116]
	mov	r2, r3
	ldr	r3, .L48+4
	mov	r1, r2
	mov	r0, r3
	bl	__sync_fetch_and_add_4
	mov	r3, r0
	str	r3, [fp, #-2112]
	ldr	r3, [fp, #-2120]
	str	r3, [fp, #-2096]
	ldr	r3, [fp, #-2096]
	ldr	r0, [r3, #16]
	sub	r1, fp, #2080
	sub	r1, r1, #4
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #32
	bl	recv
	mov	r3, r0
	cmp	r3, #0
	ble	.L34
	sub	r3, fp, #2080
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #1
	bls	.L34
	sub	r3, fp, #2080
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #30
	bls	.L35
.L34:
	ldr	r0, .L48+8
	bl	puts
	mov	r3, #1
	str	r3, [fp, #-2100]
	b	.L36
.L35:
	ldr	r3, [fp, #-2096]
	add	r2, r3, #24
	sub	r3, fp, #2080
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	strcpy
	ldr	r3, [fp, #-2096]
	add	r2, r3, #24
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L48+12
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L48+16
	bl	printf
	ldr	r3, [fp, #-2096]
	ldr	r2, [r3, #20]
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	send_message
.L36:
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	mov	r3, #2048
	mov	r2, r3
	mov	r1, #0
	bl	memset
.L43:
	ldr	r3, [fp, #-2100]
	cmp	r3, #0
	bne	.L47
	ldr	r3, [fp, #-2096]
	ldr	r0, [r3, #16]
	sub	r1, fp, #2048
	sub	r1, r1, #4
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #2048
	bl	recv
	str	r0, [fp, #-2092]
	ldr	r3, [fp, #-2092]
	cmp	r3, #0
	ble	.L39
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L40
	ldr	r3, [fp, #-2096]
	ldr	r2, [r3, #20]
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	send_message
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	str_trim_lf
	ldr	r3, [fp, #-2096]
	add	r2, r3, #24
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L48+20
	bl	printf
	b	.L40
.L39:
	ldr	r3, [fp, #-2092]
	cmp	r3, #0
	beq	.L41
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L48+24
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L42
.L41:
	ldr	r3, [fp, #-2096]
	add	r2, r3, #24
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L48+28
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L48+16
	bl	printf
	ldr	r3, [fp, #-2096]
	ldr	r2, [r3, #20]
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	send_message
	mov	r3, #1
	str	r3, [fp, #-2100]
	b	.L40
.L42:
	ldr	r0, .L48+32
	bl	puts
	mov	r3, #1
	str	r3, [fp, #-2100]
.L40:
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	mov	r3, #2048
	mov	r2, r3
	mov	r1, #0
	bl	memset
	b	.L43
.L47:
	nop
	ldr	r3, [fp, #-2096]
	ldr	r3, [r3, #16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-2096]
	ldr	r3, [r3, #20]
	mov	r0, r3
	bl	queue_remove
	ldr	r0, [fp, #-2096]
	bl	free
	mov	r3, #1
	str	r3, [fp, #-2108]
	ldr	r3, [fp, #-2108]
	mov	r2, r3
	ldr	r3, .L48+4
	mov	r1, r2
	mov	r0, r3
	bl	__sync_fetch_and_sub_4
	mov	r3, r0
	str	r3, [fp, #-2104]
	bl	pthread_self
	mov	r3, r0
	mov	r0, r3
	bl	pthread_detach
	mov	r3, #0
	ldr	r2, .L48
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L45
	bl	__stack_chk_fail
.L45:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L49:
	.align	2
.L48:
	.word	.LC11
	.word	cli_count
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	handle_client, .-handle_client
	.section	.rodata
	.align	2
.LC12:
	.ascii	"Usage: %s <port>\012\000"
	.align	2
.LC13:
	.ascii	"127.0.0.1\000"
	.align	2
.LC14:
	.ascii	"ERROR: setsockopt failed\000"
	.align	2
.LC15:
	.ascii	"ERROR: Socket binding failed\000"
	.align	2
.LC16:
	.ascii	"ERROR: Socket listening failed\000"
	.align	2
.LC17:
	.ascii	"=== WELCOME TO THE CHATROOM ===\000"
	.global	__sync_synchronize
	.align	2
.LC18:
	.ascii	"Max clients reached. Rejected: \000"
	.align	2
.LC19:
	.ascii	":%d\012\000"
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #92
	str	r0, [fp, #-88]
	str	r1, [fp, #-92]
	ldr	r3, .L61
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-88]
	cmp	r3, #2
	beq	.L51
	ldr	r3, [fp, #-92]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L61+4
	bl	printf
	mov	r3, #1
	b	.L59
.L51:
	ldr	r3, .L61+8
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-92]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-64]
	mov	r3, #1
	str	r3, [fp, #-84]
	mov	r3, #0
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-56]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-60]
	mov	r3, #2
	strh	r3, [fp, #-48]	@ movhi
	ldr	r0, [fp, #-68]
	bl	inet_addr
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-64]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-46]	@ movhi
	mov	r1, #1
	mov	r0, #13
	bl	signal
	sub	r3, fp, #84
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #15
	mov	r1, #1
	ldr	r0, [fp, #-60]
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	bge	.L53
	ldr	r0, .L61+12
	bl	perror
	mov	r3, #1
	b	.L59
.L53:
	sub	r3, fp, #48
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-60]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L54
	ldr	r0, .L61+16
	bl	perror
	mov	r3, #1
	b	.L59
.L54:
	mov	r1, #10
	ldr	r0, [fp, #-60]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L55
	ldr	r0, .L61+20
	bl	perror
	mov	r3, #1
	b	.L59
.L55:
	ldr	r0, .L61+24
	bl	puts
.L58:
	mov	r3, #16
	str	r3, [fp, #-76]
	sub	r2, fp, #76
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, [fp, #-60]
	bl	accept
	str	r0, [fp, #-56]
	ldr	r4, .L61+28
	bl	__sync_synchronize
	ldr	r4, [r4]
	bl	__sync_synchronize
	str	r4, [fp, #-72]
	ldr	r3, [fp, #-72]
	cmp	r3, #99
	bne	.L56
	ldr	r0, .L61+32
	bl	printf
	sub	r3, fp, #32
	ldm	r3, {r0, r1, r2, r3}
	bl	print_client_addr
	ldrh	r3, [fp, #-30]
	mov	r1, r3
	ldr	r0, .L61+36
	bl	printf
	ldr	r0, [fp, #-56]
	bl	close
	b	.L58
.L56:
	mov	r0, #56
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	mov	ip, r3
	sub	r3, fp, #32
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	ldr	r3, [fp, #-52]
	ldr	r2, [fp, #-56]
	str	r2, [r3, #16]
	ldr	r3, .L61+40
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L61+40
	str	r2, [r1]
	ldr	r2, [fp, #-52]
	str	r3, [r2, #20]
	ldr	r0, [fp, #-52]
	bl	queue_add
	sub	r0, fp, #80
	ldr	r3, [fp, #-52]
	ldr	r2, .L61+44
	mov	r1, #0
	bl	pthread_create
	mov	r0, #1
	bl	sleep
	b	.L58
.L59:
	ldr	r2, .L61
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L60
	bl	__stack_chk_fail
.L60:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L62:
	.align	2
.L61:
	.word	.LC20
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	cli_count
	.word	.LC18
	.word	.LC19
	.word	uid
	.word	handle_client
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
