	.file	"501817.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"
	.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, 1120
	mov	DWORD PTR -1108[rbp], edi
	mov	QWORD PTR -1120[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -1108[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -1120[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 -1084[rbp], eax
	cmp	DWORD PTR -1084[rbp], -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	error_handling
.L3:
	lea	rax, -1072[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -1072[rbp], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -1068[rbp], eax
	mov	rax, QWORD PTR -1120[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 -1070[rbp], ax
	lea	rcx, -1072[rbp]
	mov	eax, DWORD PTR -1084[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 -1084[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC3[rip]
	call	error_handling
.L5:
	mov	DWORD PTR -1096[rbp], 16
	mov	DWORD PTR -1092[rbp], 0
	jmp	.L6
.L9:
	mov	DWORD PTR -1100[rbp], 0
	lea	rdx, -1096[rbp]
	lea	rcx, -1056[rbp]
	mov	eax, DWORD PTR -1084[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -1080[rbp], eax
	lea	rcx, -1100[rbp]
	mov	eax, DWORD PTR -1080[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1088[rbp], 0
	jmp	.L7
.L8:
	lea	rdx, -1040[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	cdqe
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -1080[rbp]
	mov	edx, 1023
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1076[rbp], eax
	mov	eax, DWORD PTR -1076[rbp]
	add	DWORD PTR -1088[rbp], eax
.L7:
	mov	eax, DWORD PTR -1100[rbp]
	sal	eax, 2
	cmp	DWORD PTR -1088[rbp], eax
	jle	.L8
	mov	eax, DWORD PTR -1088[rbp]
	sub	eax, 1
	cdqe
	movzx	eax, BYTE PTR -1040[rbp+rax]
	movsx	edx, al
	mov	eax, DWORD PTR -1100[rbp]
	lea	rcx, -1040[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	calculate
	mov	DWORD PTR -1104[rbp], eax
	lea	rcx, -1104[rbp]
	mov	eax, DWORD PTR -1080[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -1080[rbp]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -1092[rbp], 1
.L6:
	cmp	DWORD PTR -1092[rbp], 4
	jle	.L9
	mov	eax, DWORD PTR -1084[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	calculate
	.type	calculate, @function
calculate:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	eax, edx
	mov	BYTE PTR -24[rbp], al
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	movsx	eax, BYTE PTR -24[rbp]
	cmp	eax, 45
	je	.L13
	cmp	eax, 45
	jg	.L24
	cmp	eax, 42
	je	.L15
	cmp	eax, 43
	jne	.L24
	mov	DWORD PTR -4[rbp], 1
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	add	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
.L16:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L17
	jmp	.L18
.L13:
	mov	DWORD PTR -4[rbp], 1
	jmp	.L19
.L20:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	sub	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
.L19:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L20
	jmp	.L18
.L15:
	mov	DWORD PTR -4[rbp], 1
	jmp	.L21
.L22:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edx, DWORD PTR -8[rbp]
	imul	eax, edx
	mov	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
.L21:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L22
	jmp	.L18
.L24:
	nop
.L18:
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	calculate, .-calculate
	.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
	.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	"501817.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:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1104
	str	r0, [fp, #-1104]
	str	r1, [fp, #-1108]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1104]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-1108]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L12+4
	bl	printf
	mov	r0, #1
	bl	exit
.L2:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-1076]
	ldr	r3, [fp, #-1076]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L12+8
	bl	error_handling
.L3:
	sub	r3, fp, #1056
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4
	sub	r3, r3, #1056
	sub	r3, r3, #4
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-1060]
	ldr	r3, [fp, #-1108]
	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
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #1056
	sub	r3, r3, #4
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #1056
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-1076]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L12+12
	bl	error_handling
.L4:
	mov	r1, #5
	ldr	r0, [fp, #-1076]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L12+16
	bl	error_handling
.L5:
	mov	r3, #16
	str	r3, [fp, #-1088]
	mov	r3, #0
	str	r3, [fp, #-1084]
	b	.L6
.L9:
	mov	r3, #0
	str	r3, [fp, #-1092]
	sub	r2, fp, #1072
	sub	r2, r2, #4
	sub	r2, r2, #12
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1076]
	bl	accept
	str	r0, [fp, #-1072]
	sub	r3, fp, #1088
	sub	r3, r3, #4
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-1072]
	bl	read
	mov	r3, #0
	str	r3, [fp, #-1080]
	b	.L7
.L8:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, [fp, #-1080]
	add	r3, r3, r2
	ldr	r2, .L12+20
	mov	r1, r3
	ldr	r0, [fp, #-1072]
	bl	read
	str	r0, [fp, #-1068]
	ldr	r2, [fp, #-1080]
	ldr	r3, [fp, #-1068]
	add	r3, r2, r3
	str	r3, [fp, #-1080]
.L7:
	ldr	r3, [fp, #-1092]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-1080]
	cmp	r2, r3
	ble	.L8
	ldr	r0, [fp, #-1092]
	ldr	r3, [fp, #-1080]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r2, [r3, #-1028]	@ zero_extendqisi2
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	bl	calculate
	mov	r3, r0
	str	r3, [fp, #-1096]
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-1072]
	bl	write
	ldr	r0, [fp, #-1072]
	bl	close
	ldr	r3, [fp, #-1084]
	add	r3, r3, #1
	str	r3, [fp, #-1084]
.L6:
	ldr	r3, [fp, #-1084]
	cmp	r3, #4
	ble	.L9
	ldr	r0, [fp, #-1076]
	bl	close
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	1023
	.size	main, .-main
	.align	2
	.global	calculate
	.syntax unified
	.arm
	.fpu softvfp
	.type	calculate, %function
calculate:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, r2
	strb	r3, [fp, #-21]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #45
	beq	.L15
	cmp	r3, #45
	bgt	.L26
	cmp	r3, #42
	beq	.L17
	cmp	r3, #43
	bne	.L26
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L18
.L19:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L18:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L19
	b	.L20
.L15:
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L21
.L22:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	sub	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L21:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L22
	b	.L20
.L17:
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L23
.L24:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	mul	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L23:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L24
	b	.L20
.L26:
	nop
.L20:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	calculate, .-calculate
	.section	.rodata
	.align	2
.LC5:
	.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, .L28
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L28+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L29:
	.align	2
.L28:
	.word	stderr
	.word	.LC5
	.size	error_handling, .-error_handling
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
