	.file	"23576206.c"
	.intel_syntax noprefix
	.text
	.globl	sockfd
	.bss
	.align 4
	.type	sockfd, @object
	.size	sockfd, 4
sockfd:
	.zero	4
	.globl	newsockfd
	.align 4
	.type	newsockfd, @object
	.size	newsockfd, 4
newsockfd:
	.zero	4
	.globl	portno
	.align 4
	.type	portno, @object
	.size	portno, 4
portno:
	.zero	4
	.globl	buffer
	.align 32
	.type	buffer, @object
	.size	buffer, 240
buffer:
	.zero	240
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	PIN_CLOCK
	.data
	.align 4
	.type	PIN_CLOCK, @object
	.size	PIN_CLOCK, 4
PIN_CLOCK:
	.long	3
	.globl	PIN_DATA
	.align 4
	.type	PIN_DATA, @object
	.size	PIN_DATA, 4
PIN_DATA:
	.long	4
	.globl	LED_COUNT
	.align 4
	.type	LED_COUNT, @object
	.size	LED_COUNT, 4
LED_COUNT:
	.long	10
	.text
	.globl	error
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.globl	led_write_bit
	.type	led_write_bit, @function
led_write_bit:
.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 -4[rbp], edi
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	led_write_bit, .-led_write_bit
	.globl	led_write_buffer
	.type	led_write_buffer, @function
led_write_buffer:
.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	DWORD PTR -4[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, buffer[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movsx	eax, al
	mov	edi, eax
	call	led_write_bit
	add	DWORD PTR -4[rbp], 1
.L4:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, buffer[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L5
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	led_write_buffer, .-led_write_buffer
	.section	.rodata
.LC0:
	.string	"OK"
	.text
	.globl	led_respond
	.type	led_respond, @function
led_respond:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR newsockfd[rip]
	mov	edx, 2
	lea	rsi, .LC0[rip]
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR m[rip], eax
	mov	eax, DWORD PTR m[rip]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	led_respond, .-led_respond
	.globl	led_listen
	.type	led_listen, @function
led_listen:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdx, buffer[rip]
	mov	eax, 0
	mov	ecx, 30
	mov	rdi, rdx
	rep stosq
	mov	eax, DWORD PTR newsockfd[rip]
	mov	edx, 240
	lea	rsi, buffer[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR n[rip], eax
	lea	rdi, buffer[rip]
	call	strlen@PLT
	cmp	rax, 239
	jbe	.L9
	mov	eax, 0
	call	led_write_buffer
	mov	eax, 0
	call	led_respond
.L9:
	mov	eax, DWORD PTR n[rip]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	led_listen, .-led_listen
	.section	.rodata
.LC1:
	.string	"Listening on port %d\n"
.LC2:
	.string	"ERROR opening socket"
.LC3:
	.string	"ERROR on binding"
.LC4:
	.string	"HELLO"
	.text
	.globl	main
	.type	main, @function
main:
.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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -68[rbp], 1
	jg	.L12
	mov	DWORD PTR portno[rip], 4561
	mov	edx, DWORD PTR portno[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L13
.L12:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR portno[rip], eax
.L13:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR sockfd[rip], eax
	mov	eax, DWORD PTR sockfd[rip]
	test	eax, eax
	jns	.L14
	lea	rdi, .LC2[rip]
	call	error
.L14:
	lea	rax, -48[rbp]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	mov	WORD PTR -48[rbp], 2
	mov	DWORD PTR -44[rbp], 0
	mov	eax, DWORD PTR portno[rip]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -46[rbp], ax
	mov	eax, DWORD PTR sockfd[rip]
	lea	rcx, -48[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L15
	lea	rdi, .LC3[rip]
	call	error
.L15:
	mov	eax, DWORD PTR sockfd[rip]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	mov	DWORD PTR -52[rbp], 16
	mov	DWORD PTR newsockfd[rip], 1
	jmp	.L16
.L18:
	mov	eax, DWORD PTR sockfd[rip]
	lea	rdx, -52[rbp]
	lea	rcx, -32[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR newsockfd[rip], eax
	mov	eax, DWORD PTR newsockfd[rip]
	mov	edx, 5
	lea	rsi, .LC4[rip]
	mov	edi, eax
	call	write@PLT
	nop
.L17:
	mov	eax, 0
	call	led_listen
	test	eax, eax
	jg	.L17
.L16:
	mov	eax, DWORD PTR newsockfd[rip]
	test	eax, eax
	jg	.L18
	mov	eax, DWORD PTR newsockfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR sockfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"23576206.c"
	.text
	.comm	sockfd,4,4
	.comm	newsockfd,4,4
	.comm	portno,4,4
	.comm	buffer,240,4
	.comm	n,4,4
	.comm	m,4,4
	.global	PIN_CLOCK
	.data
	.align	2
	.type	PIN_CLOCK, %object
	.size	PIN_CLOCK, 4
PIN_CLOCK:
	.word	3
	.global	PIN_DATA
	.align	2
	.type	PIN_DATA, %object
	.size	PIN_DATA, 4
PIN_DATA:
	.word	4
	.global	LED_COUNT
	.align	2
	.type	LED_COUNT, %object
	.size	LED_COUNT, 4
LED_COUNT:
	.word	10
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ 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	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	error, .-error
	.align	2
	.global	led_write_bit
	.syntax unified
	.arm
	.fpu softvfp
	.type	led_write_bit, %function
led_write_bit:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	led_write_bit, .-led_write_bit
	.align	2
	.global	led_write_buffer
	.syntax unified
	.arm
	.fpu softvfp
	.type	led_write_buffer, %function
led_write_buffer:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L4
.L5:
	ldr	r2, .L6
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	led_write_bit
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L4:
	ldr	r2, .L6
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L5
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	buffer
	.size	led_write_buffer, .-led_write_buffer
	.section	.rodata
	.align	2
.LC0:
	.ascii	"OK\000"
	.text
	.align	2
	.global	led_respond
	.syntax unified
	.arm
	.fpu softvfp
	.type	led_respond, %function
led_respond:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L10
	ldr	r3, [r3]
	mov	r2, #2
	ldr	r1, .L10+4
	mov	r0, r3
	bl	write
	mov	r3, r0
	ldr	r2, .L10+8
	str	r3, [r2]
	ldr	r3, .L10+8
	ldr	r3, [r3]
	mov	r0, r3
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	newsockfd
	.word	.LC0
	.word	m
	.size	led_respond, .-led_respond
	.align	2
	.global	led_listen
	.syntax unified
	.arm
	.fpu softvfp
	.type	led_listen, %function
led_listen:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L15
	mov	r0, r3
	mov	r3, #240
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r3, .L15+4
	ldr	r3, [r3]
	mov	r2, #240
	ldr	r1, .L15
	mov	r0, r3
	bl	read
	mov	r3, r0
	ldr	r2, .L15+8
	str	r3, [r2]
	ldr	r0, .L15
	bl	strlen
	mov	r3, r0
	cmp	r3, #239
	bls	.L13
	bl	led_write_buffer
	bl	led_respond
.L13:
	ldr	r3, .L15+8
	ldr	r3, [r3]
	mov	r0, r3
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	buffer
	.word	newsockfd
	.word	n
	.size	led_listen, .-led_listen
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Listening on port %d\012\000"
	.align	2
.LC2:
	.ascii	"ERROR opening socket\000"
	.align	2
.LC3:
	.ascii	"ERROR on binding\000"
	.align	2
.LC4:
	.ascii	"HELLO\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	bgt	.L18
	ldr	r3, .L27+4
	ldr	r2, .L27+8
	str	r2, [r3]
	ldr	r3, .L27+12
	ldr	r3, [r3]
	ldr	r2, .L27+4
	ldr	r2, [r2]
	ldr	r1, .L27+16
	mov	r0, r3
	bl	fprintf
	b	.L19
.L18:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L27+4
	str	r3, [r2]
.L19:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	mov	r3, r0
	ldr	r2, .L27+20
	str	r3, [r2]
	ldr	r3, .L27+20
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L20
	ldr	r0, .L27+24
	bl	error
.L20:
	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	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, .L27+4
	ldr	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-38]	@ movhi
	ldr	r3, .L27+20
	ldr	r3, [r3]
	sub	r1, fp, #40
	mov	r2, #16
	mov	r0, r3
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L21
	ldr	r0, .L27+28
	bl	error
.L21:
	ldr	r3, .L27+20
	ldr	r3, [r3]
	mov	r1, #5
	mov	r0, r3
	bl	listen
	mov	r3, #16
	str	r3, [fp, #-44]
	ldr	r3, .L27+32
	mov	r2, #1
	str	r2, [r3]
	b	.L22
.L24:
	ldr	r3, .L27+20
	ldr	r3, [r3]
	sub	r2, fp, #44
	sub	r1, fp, #24
	mov	r0, r3
	bl	accept
	mov	r3, r0
	ldr	r2, .L27+32
	str	r3, [r2]
	ldr	r3, .L27+32
	ldr	r3, [r3]
	mov	r2, #5
	ldr	r1, .L27+36
	mov	r0, r3
	bl	write
	nop
.L23:
	bl	led_listen
	mov	r3, r0
	cmp	r3, #0
	bgt	.L23
.L22:
	ldr	r3, .L27+32
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L24
	ldr	r3, .L27+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L27+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	mov	r3, #0
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L26
	bl	__stack_chk_fail
.L26:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC5
	.word	portno
	.word	4561
	.word	stderr
	.word	.LC1
	.word	sockfd
	.word	.LC2
	.word	.LC3
	.word	newsockfd
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
