	.file	"311783.c"
	.intel_syntax noprefix
	.text
	.globl	clnt_cnt
	.bss
	.align 4
	.type	clnt_cnt, @object
	.size	clnt_cnt, 4
clnt_cnt:
	.zero	4
	.globl	clnt_socks
	.align 32
	.type	clnt_socks, @object
	.size	clnt_socks, 1024
clnt_socks:
	.zero	1024
	.globl	mutx
	.align 32
	.type	mutx, @object
	.size	mutx, 40
mutx:
	.zero	40
	.section	.rodata
.LC0:
	.string	"Usage : %s <port>\n"
.LC1:
	.string	"bind() error"
.LC2:
	.string	"listen() error"
.LC3:
	.string	"connected client IP: %s \n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 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], 2
	je	.L2
	mov	rax, QWORD PTR -96[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	esi, 0
	lea	rdi, mutx[rip]
	call	pthread_mutex_init@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -60[rbp], eax
	lea	rax, -48[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	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 -60[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	error_handling
.L3:
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC2[rip]
	call	error_handling
.L5:
	mov	DWORD PTR -64[rbp], 16
	lea	rdx, -64[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -68[rbp], eax
	lea	rdi, mutx[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR clnt_cnt[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR clnt_cnt[rip], edx
	mov	edx, DWORD PTR -68[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, clnt_socks[rip]
	mov	DWORD PTR [rcx+rax], edx
	lea	rdi, mutx[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdx, -68[rbp]
	lea	rax, -56[rbp]
	mov	rcx, rdx
	lea	rdx, handle_cnt[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	pthread_detach@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L5
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	handle_cnt
	.type	handle_cnt, @function
handle_cnt:
.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, 144
	mov	QWORD PTR -136[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -136[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -120[rbp], eax
	mov	DWORD PTR -116[rbp], 0
	jmp	.L8
.L9:
	mov	edx, DWORD PTR -116[rbp]
	lea	rax, -112[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	send_msg
.L8:
	lea	rcx, -112[rbp]
	mov	eax, DWORD PTR -120[rbp]
	mov	edx, 100
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 0
	jne	.L9
	lea	rdi, mutx[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -124[rbp], 0
	jmp	.L10
.L15:
	mov	eax, DWORD PTR -124[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, clnt_socks[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	DWORD PTR -120[rbp], eax
	jne	.L11
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -124[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, clnt_socks[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -124[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, clnt_socks[rip]
	mov	DWORD PTR [rcx+rdx], eax
.L12:
	mov	eax, DWORD PTR -124[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -124[rbp], edx
	mov	edx, DWORD PTR clnt_cnt[rip]
	sub	edx, 1
	cmp	eax, edx
	jl	.L13
	jmp	.L14
.L11:
	add	DWORD PTR -124[rbp], 1
.L10:
	mov	eax, DWORD PTR clnt_cnt[rip]
	cmp	DWORD PTR -124[rbp], eax
	jl	.L15
.L14:
	mov	eax, DWORD PTR clnt_cnt[rip]
	sub	eax, 1
	mov	DWORD PTR clnt_cnt[rip], eax
	lea	rdi, mutx[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -120[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	handle_cnt, .-handle_cnt
	.section	.rodata
.LC4:
	.string	"%s\n"
	.text
	.globl	error_handling
	.type	error_handling, @function
error_handling:
.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	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE8:
	.size	error_handling, .-error_handling
	.globl	send_msg
	.type	send_msg, @function
send_msg:
.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
	mov	DWORD PTR -28[rbp], esi
	lea	rdi, mutx[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L20
.L21:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, clnt_socks[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	rcx, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	DWORD PTR -4[rbp], 1
.L20:
	mov	eax, DWORD PTR clnt_cnt[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L21
	lea	rdi, mutx[rip]
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	send_msg, .-send_msg
	.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	"311783.c"
	.text
	.global	clnt_cnt
	.bss
	.align	2
	.type	clnt_cnt, %object
	.size	clnt_cnt, 4
clnt_cnt:
	.space	4
	.comm	clnt_socks,1024,4
	.comm	mutx,24,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage : %s <port>\012\000"
	.align	2
.LC1:
	.ascii	"bind() error\000"
	.align	2
.LC2:
	.ascii	"listen() error\000"
	.align	2
.LC3:
	.ascii	"connected client IP: %s \012\000"
	.align	2
.LC4:
	.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, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-64]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-68]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L7+4
	bl	printf
	mov	r0, #1
	bl	exit
.L2:
	mov	r1, #0
	ldr	r0, .L7+8
	bl	pthread_mutex_init
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-44]
	sub	r3, fp, #40
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	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, #-44]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L7+12
	bl	error_handling
.L3:
	mov	r1, #5
	ldr	r0, [fp, #-44]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L7+16
	bl	error_handling
.L5:
	mov	r3, #16
	str	r3, [fp, #-52]
	sub	r2, fp, #52
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-44]
	bl	accept
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r0, .L7+8
	bl	pthread_mutex_lock
	ldr	r3, .L7+20
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L7+20
	str	r2, [r1]
	ldr	r2, [fp, #-56]
	ldr	r1, .L7+24
	str	r2, [r1, r3, lsl #2]
	ldr	r0, .L7+8
	bl	pthread_mutex_unlock
	sub	r3, fp, #56
	sub	r0, fp, #48
	ldr	r2, .L7+28
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-48]
	mov	r0, r3
	bl	pthread_detach
	ldr	r0, [fp, #-20]
	bl	inet_ntoa
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L7+32
	bl	printf
	b	.L5
.L8:
	.align	2
.L7:
	.word	.LC4
	.word	.LC0
	.word	mutx
	.word	.LC1
	.word	.LC2
	.word	clnt_cnt
	.word	clnt_socks
	.word	handle_cnt
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	handle_cnt
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_cnt, %function
handle_cnt:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #128
	str	r0, [fp, #-128]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-128]
	ldr	r3, [r3]
	str	r3, [fp, #-116]
	mov	r3, #0
	str	r3, [fp, #-112]
	b	.L10
.L11:
	sub	r3, fp, #108
	ldr	r1, [fp, #-112]
	mov	r0, r3
	bl	send_msg
.L10:
	sub	r3, fp, #108
	mov	r2, #100
	mov	r1, r3
	ldr	r0, [fp, #-116]
	bl	read
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bne	.L11
	ldr	r0, .L20+4
	bl	pthread_mutex_lock
	mov	r3, #0
	str	r3, [fp, #-120]
	b	.L12
.L17:
	ldr	r2, .L20+8
	ldr	r3, [fp, #-120]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [fp, #-116]
	cmp	r2, r3
	bne	.L13
	b	.L14
.L15:
	ldr	r3, [fp, #-120]
	add	r3, r3, #1
	ldr	r2, .L20+8
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L20+8
	ldr	r3, [fp, #-120]
	str	r2, [r1, r3, lsl #2]
.L14:
	ldr	r3, [fp, #-120]
	add	r2, r3, #1
	str	r2, [fp, #-120]
	ldr	r2, .L20+12
	ldr	r2, [r2]
	sub	r2, r2, #1
	cmp	r3, r2
	blt	.L15
	b	.L16
.L13:
	ldr	r3, [fp, #-120]
	add	r3, r3, #1
	str	r3, [fp, #-120]
.L12:
	ldr	r3, .L20+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-120]
	cmp	r2, r3
	blt	.L17
.L16:
	ldr	r3, .L20+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L20+12
	str	r3, [r2]
	ldr	r0, .L20+4
	bl	pthread_mutex_unlock
	ldr	r0, [fp, #-116]
	bl	close
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC5
	.word	mutx
	.word	clnt_socks
	.word	clnt_cnt
	.size	handle_cnt, .-handle_cnt
	.section	.rodata
	.align	2
.LC6:
	.ascii	"%s\012\000"
	.text
	.align	2
	.global	error_handling
	.syntax unified
	.arm
	.fpu softvfp
	.type	error_handling, %function
error_handling:
	@ 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	r3, .L23
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L23+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L24:
	.align	2
.L23:
	.word	stderr
	.word	.LC6
	.size	error_handling, .-error_handling
	.align	2
	.global	send_msg
	.syntax unified
	.arm
	.fpu softvfp
	.type	send_msg, %function
send_msg:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r0, .L28
	bl	pthread_mutex_lock
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L26
.L27:
	ldr	r2, .L28+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [fp, #-20]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	write
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L26:
	ldr	r3, .L28+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L27
	ldr	r0, .L28
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	mutx
	.word	clnt_socks
	.word	clnt_cnt
	.size	send_msg, .-send_msg
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
