	.file	"165767084.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage : %s <port>\n"
.LC1:
	.string	"socket() error"
.LC2:
	.string	"bind() error"
.LC3:
	.string	"listen() error"
.LC4:
	.string	"accept() error"
.LC5:
	.string	"Client connected"
	.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, 144
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -132[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -144[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	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -108[rbp], eax
	cmp	DWORD PTR -108[rbp], -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	error_handling
.L3:
	lea	rax, -96[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -96[rbp], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -92[rbp], eax
	mov	rax, QWORD PTR -144[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 -94[rbp], ax
	lea	rcx, -96[rbp]
	mov	eax, DWORD PTR -108[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L4
	lea	rdi, .LC2[rip]
	call	error_handling
.L4:
	mov	eax, DWORD PTR -108[rbp]
	mov	esi, 1
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC3[rip]
	call	error_handling
.L5:
	mov	DWORD PTR -128[rbp], 16
	lea	rdx, -128[rbp]
	lea	rcx, -80[rbp]
	mov	eax, DWORD PTR -108[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -104[rbp], eax
	cmp	DWORD PTR -104[rbp], -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	error_handling
	jmp	.L8
.L6:
	lea	rdi, .LC5[rip]
	call	puts@PLT
	jmp	.L8
.L19:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 2
	je	.L9
	cmp	eax, 2
	ja	.L10
	test	eax, eax
	je	.L11
	cmp	eax, 1
	je	.L12
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -124[rbp], eax
	mov	DWORD PTR -120[rbp], 1
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	mov	edx, DWORD PTR -60[rbp+rax*4]
	mov	eax, DWORD PTR -124[rbp]
	add	eax, edx
	mov	DWORD PTR -124[rbp], eax
	add	DWORD PTR -120[rbp], 1
.L13:
	mov	eax, DWORD PTR -64[rbp]
	cmp	DWORD PTR -120[rbp], eax
	jl	.L14
	jmp	.L10
.L12:
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -124[rbp], eax
	mov	DWORD PTR -116[rbp], 1
	jmp	.L15
.L16:
	mov	edx, DWORD PTR -124[rbp]
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	mov	ecx, DWORD PTR -60[rbp+rax*4]
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -124[rbp], eax
	add	DWORD PTR -116[rbp], 1
.L15:
	mov	eax, DWORD PTR -64[rbp]
	cmp	DWORD PTR -116[rbp], eax
	jl	.L16
	jmp	.L10
.L9:
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -124[rbp], eax
	mov	DWORD PTR -112[rbp], 1
	jmp	.L17
.L18:
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	mov	edx, DWORD PTR -60[rbp+rax*4]
	mov	eax, DWORD PTR -124[rbp]
	imul	eax, edx
	mov	DWORD PTR -124[rbp], eax
	add	DWORD PTR -112[rbp], 1
.L17:
	mov	eax, DWORD PTR -64[rbp]
	cmp	DWORD PTR -112[rbp], eax
	jl	.L18
	nop
.L10:
	lea	rcx, -124[rbp]
	mov	eax, DWORD PTR -104[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L8:
	lea	rcx, -64[rbp]
	mov	eax, DWORD PTR -104[rbp]
	mov	edx, 48
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	setne	al
	movzx	eax, al
	mov	DWORD PTR -100[rbp], eax
	cmp	DWORD PTR -100[rbp], 0
	jne	.L19
	mov	eax, DWORD PTR -104[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -108[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"%s\n"
	.text
	.globl	error_handling
	.type	error_handling, @function
error_handling:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	error_handling, .-error_handling
	.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	"165767084.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage : %s <port>\012\000"
	.align	2
.LC1:
	.ascii	"socket() error\000"
	.align	2
.LC2:
	.ascii	"bind() error\000"
	.align	2
.LC3:
	.ascii	"listen() error\000"
	.align	2
.LC4:
	.ascii	"accept() error\000"
	.align	2
.LC5:
	.ascii	"Client connected\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-132]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-128]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-132]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L22+4
	bl	printf
	mov	r0, #1
	bl	exit
.L2:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-100]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L22+8
	bl	error_handling
.L3:
	sub	r3, fp, #88
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-88]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-84]
	ldr	r3, [fp, #-132]
	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, #-86]	@ movhi
	sub	r3, fp, #88
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-100]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L22+12
	bl	error_handling
.L4:
	mov	r1, #1
	ldr	r0, [fp, #-100]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L22+16
	bl	error_handling
.L5:
	mov	r3, #16
	str	r3, [fp, #-120]
	sub	r2, fp, #120
	sub	r3, fp, #72
	mov	r1, r3
	ldr	r0, [fp, #-100]
	bl	accept
	str	r0, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L22+20
	bl	error_handling
	b	.L8
.L6:
	ldr	r0, .L22+24
	bl	puts
	b	.L8
.L19:
	ldr	r3, [fp, #-12]
	cmp	r3, #2
	beq	.L9
	cmp	r3, #2
	bhi	.L10
	cmp	r3, #0
	beq	.L11
	cmp	r3, #1
	beq	.L12
	b	.L10
.L11:
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-116]
	mov	r3, #1
	str	r3, [fp, #-112]
	b	.L13
.L14:
	ldr	r3, [fp, #-112]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-48]
	ldr	r3, [fp, #-116]
	add	r3, r2, r3
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-112]
	add	r3, r3, #1
	str	r3, [fp, #-112]
.L13:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-112]
	cmp	r2, r3
	blt	.L14
	b	.L10
.L12:
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-116]
	mov	r3, #1
	str	r3, [fp, #-108]
	b	.L15
.L16:
	ldr	r2, [fp, #-116]
	ldr	r3, [fp, #-108]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-48]
	sub	r3, r2, r3
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-108]
	add	r3, r3, #1
	str	r3, [fp, #-108]
.L15:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-108]
	cmp	r2, r3
	blt	.L16
	b	.L10
.L9:
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-116]
	mov	r3, #1
	str	r3, [fp, #-104]
	b	.L17
.L18:
	ldr	r3, [fp, #-104]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-48]
	ldr	r2, [fp, #-116]
	mul	r3, r2, r3
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-104]
	add	r3, r3, #1
	str	r3, [fp, #-104]
.L17:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-104]
	cmp	r2, r3
	blt	.L18
	nop
.L10:
	sub	r3, fp, #116
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-96]
	bl	write
.L8:
	sub	r3, fp, #56
	mov	r2, #48
	mov	r1, r3
	ldr	r0, [fp, #-96]
	bl	read
	mov	r3, r0
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bne	.L19
	ldr	r0, [fp, #-96]
	bl	close
	ldr	r0, [fp, #-100]
	bl	close
	mov	r3, #0
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC7:
	.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, .L25
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L25+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L26:
	.align	2
.L25:
	.word	stderr
	.word	.LC7
	.size	error_handling, .-error_handling
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
