	.file	"913149.c"
	.intel_syntax noprefix
	.text
	.globl	channels
	.bss
	.align 32
	.type	channels, @object
	.size	channels, 1560
channels:
	.zero	1560
	.globl	channels_writable_bitmask
	.type	channels_writable_bitmask, @object
	.size	channels_writable_bitmask, 1
channels_writable_bitmask:
	.zero	1
	.globl	channels_opened_bitmask
	.type	channels_opened_bitmask, @object
	.size	channels_opened_bitmask, 1
channels_opened_bitmask:
	.zero	1
	.globl	channels_enabled_bitmask
	.type	channels_enabled_bitmask, @object
	.size	channels_enabled_bitmask, 1
channels_enabled_bitmask:
	.zero	1
	.section	.rodata
.LC0:
	.string	"/sys/class/gpio/gpio%s"
.LC1:
	.string	"/sys/class/gpio/export"
	.align 8
.LC2:
	.string	"Error opening /sys/class/gpio/export: %s\n"
.LC3:
	.string	"GPIO export write: %s"
	.text
	.globl	gpio_export
	.type	gpio_export, @function
gpio_export:
.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, 560
	mov	QWORD PTR -552[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -552[rbp]
	lea	rax, -528[rbp]
	mov	rcx, rdx
	lea	rdx, .LC0[rip]
	mov	esi, 512
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -528[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	access@PLT
	test	eax, eax
	je	.L7
	mov	esi, 1
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -532[rbp], eax
	cmp	DWORD PTR -532[rbp], 0
	jns	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC2[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	rax, QWORD PTR -552[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rcx, QWORD PTR -552[rbp]
	mov	eax, DWORD PTR -532[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L5
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC3[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -532[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L1
.L7:
	nop
.L1:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gpio_export, .-gpio_export
	.section	.rodata
.LC4:
	.string	"/sys/class/gpio/gpio%s/%s"
.LC5:
	.string	"Error opening %s: %s\n"
	.text
	.globl	gpio_open
	.type	gpio_open, @function
gpio_open:
.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, 560
	mov	QWORD PTR -552[rbp], rdi
	mov	QWORD PTR -560[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rcx, QWORD PTR -560[rbp]
	mov	rdx, QWORD PTR -552[rbp]
	lea	rax, -528[rbp]
	mov	r8, rcx
	mov	rcx, rdx
	lea	rdx, .LC4[rip]
	mov	esi, 512
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -528[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -532[rbp], eax
	cmp	DWORD PTR -532[rbp], 0
	jns	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rax, -528[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC5[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -532[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gpio_open, .-gpio_open
	.section	.rodata
.LC6:
	.string	"direction"
.LC7:
	.string	"GPIO direction write: %s"
	.text
	.globl	gpio_direction
	.type	gpio_direction, @function
gpio_direction:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	gpio_open
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L13
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC7[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gpio_direction, .-gpio_direction
	.section	.rodata
.LC8:
	.string	"edge"
.LC9:
	.string	"GPIO edge write: %s"
	.text
	.globl	gpio_edge
	.type	gpio_edge, @function
gpio_edge:
.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	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	gpio_open
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L15
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC9[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	gpio_edge, .-gpio_edge
	.globl	fds
	.bss
	.align 32
	.type	fds, @object
	.size	fds, 56
fds:
	.zero	56
	.globl	usbd_sock_fd
	.align 4
	.type	usbd_sock_fd, @object
	.size	usbd_sock_fd, 4
usbd_sock_fd:
	.zero	4
	.globl	usbd_sock_addr
	.align 32
	.type	usbd_sock_addr, @object
	.size	usbd_sock_addr, 110
usbd_sock_addr:
	.zero	110
	.text
	.globl	delay
	.type	delay, @function
delay:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edi, 10
	call	usleep@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	delay, .-delay
	.globl	get_channel_bitmask_state
	.type	get_channel_bitmask_state, @function
get_channel_bitmask_state:
.LFB11:
	.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 -8[rbp], rdi
	mov	eax, esi
	mov	BYTE PTR -12[rbp], al
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	edx, al
	movzx	eax, BYTE PTR -12[rbp]
	mov	ecx, eax
	sar	edx, cl
	mov	eax, edx
	and	eax, 1
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	get_channel_bitmask_state, .-get_channel_bitmask_state
	.globl	set_channel_bitmask_state
	.type	set_channel_bitmask_state, @function
set_channel_bitmask_state:
.LFB12:
	.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 -8[rbp], rdi
	mov	ecx, esi
	mov	eax, edx
	mov	edx, ecx
	mov	BYTE PTR -12[rbp], dl
	mov	BYTE PTR -16[rbp], al
	cmp	BYTE PTR -16[rbp], 0
	je	.L20
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	esi, eax
	movzx	eax, BYTE PTR -12[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	or	eax, esi
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], dl
	jmp	.L22
.L20:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	esi, eax
	movzx	eax, BYTE PTR -12[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	not	eax
	and	eax, esi
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], dl
.L22:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	set_channel_bitmask_state, .-set_channel_bitmask_state
	.globl	extract_enabled_state
	.type	extract_enabled_state, @function
extract_enabled_state:
.LFB13:
	.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 -8[rbp], rdi
	mov	eax, esi
	mov	BYTE PTR -12[rbp], al
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movzx	edx, al
	movzx	eax, BYTE PTR -12[rbp]
	mov	esi, 16
	mov	ecx, eax
	sal	esi, cl
	mov	eax, esi
	and	eax, edx
	test	eax, eax
	setne	al
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	extract_enabled_state, .-extract_enabled_state
	.section	.rodata
.LC10:
	.string	"Closing connection %d\n"
	.text
	.globl	close_channel_connection
	.type	close_channel_connection, @function
close_channel_connection:
.LFB14:
	.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	eax, edi
	mov	BYTE PTR -4[rbp], al
	movzx	eax, BYTE PTR -4[rbp]
	mov	edx, eax
	lea	rsi, .LC10[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	movzx	eax, BYTE PTR -4[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edi, eax
	call	close@PLT
	movzx	eax, BYTE PTR -4[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip]
	mov	DWORD PTR [rdx+rax], -1
	movzx	eax, BYTE PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, channels[rip+260]
	mov	DWORD PTR [rdx+rax], 0
	movzx	eax, BYTE PTR -4[rbp]
	mov	esi, eax
	lea	rdi, channels_enabled_bitmask[rip]
	call	get_channel_bitmask_state
	test	al, al
	je	.L26
	cmp	BYTE PTR -4[rbp], 0
	je	.L26
	movzx	eax, BYTE PTR -4[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 1
.L26:
	movzx	eax, BYTE PTR -4[rbp]
	mov	edx, 0
	mov	esi, eax
	lea	rdi, channels_opened_bitmask[rip]
	call	set_channel_bitmask_state
	movzx	eax, BYTE PTR -4[rbp]
	mov	edx, 0
	mov	esi, eax
	lea	rdi, channels_writable_bitmask[rip]
	call	set_channel_bitmask_state
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	close_channel_connection, .-close_channel_connection
	.globl	disable_listening_socket
	.type	disable_listening_socket, @function
disable_listening_socket:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	BYTE PTR -4[rbp], al
	movzx	eax, BYTE PTR -4[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 0
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	disable_listening_socket, .-disable_listening_socket
	.globl	enable_listening_socket
	.type	enable_listening_socket, @function
enable_listening_socket:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	BYTE PTR -4[rbp], al
	movzx	eax, BYTE PTR -4[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	enable_listening_socket, .-enable_listening_socket
	.section	.rodata
.LC11:
	.string	"Error creating socket %s: %s\n"
	.align 8
.LC12:
	.string	"Error connecting to USB Daemon socket %s: %s\n"
	.text
	.globl	enable_usb_daemon_socket
	.type	enable_usb_daemon_socket, @function
enable_usb_daemon_socket:
.LFB17:
	.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
	movzx	eax, WORD PTR usbd_sock_addr[rip]
	movzx	eax, ax
	mov	edx, 0
	mov	esi, 1
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L30
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	lea	rdx, usbd_sock_addr[rip+2]
	lea	rsi, .LC11[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L30:
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR fds[rip+8], eax
	lea	rcx, usbd_sock_addr[rip]
	mov	eax, DWORD PTR fds[rip+8]
	mov	edx, 110
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	cmp	eax, -1
	jne	.L31
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	lea	rdx, usbd_sock_addr[rip+2]
	lea	rsi, .LC12[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L31:
	mov	WORD PTR fds[rip+12], 13
	mov	edx, 1
	mov	esi, 0
	lea	rdi, channels_opened_bitmask[rip]
	call	set_channel_bitmask_state
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	enable_usb_daemon_socket, .-enable_usb_daemon_socket
	.globl	manage_channel_active_status
	.type	manage_channel_active_status, @function
manage_channel_active_status:
.LFB18:
	.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 -4[rbp], 0
	jmp	.L33
.L41:
	mov	eax, DWORD PTR -4[rbp]
	movzx	edx, al
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	extract_enabled_state
	mov	BYTE PTR -6[rbp], al
	mov	eax, DWORD PTR -4[rbp]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, channels_enabled_bitmask[rip]
	call	get_channel_bitmask_state
	mov	BYTE PTR -5[rbp], al
	movzx	eax, BYTE PTR -6[rbp]
	cmp	al, BYTE PTR -5[rbp]
	je	.L42
	cmp	BYTE PTR -6[rbp], 1
	jne	.L36
	cmp	DWORD PTR -4[rbp], 0
	jne	.L37
	mov	eax, 0
	call	enable_usb_daemon_socket
	jmp	.L38
.L37:
	mov	eax, DWORD PTR -4[rbp]
	movzx	eax, al
	mov	edi, eax
	call	enable_listening_socket
.L38:
	mov	eax, DWORD PTR -4[rbp]
	movzx	eax, al
	mov	edx, 1
	mov	esi, eax
	lea	rdi, channels_enabled_bitmask[rip]
	call	set_channel_bitmask_state
	jmp	.L35
.L36:
	mov	eax, DWORD PTR -4[rbp]
	movzx	eax, al
	mov	edi, eax
	call	close_channel_connection
	cmp	DWORD PTR -4[rbp], 0
	je	.L39
	mov	eax, DWORD PTR -4[rbp]
	movzx	eax, al
	mov	edi, eax
	call	disable_listening_socket
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 0
	jmp	.L40
.L39:
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 0
.L40:
	mov	eax, DWORD PTR -4[rbp]
	movzx	eax, al
	mov	edx, 0
	mov	esi, eax
	lea	rdi, channels_enabled_bitmask[rip]
	call	set_channel_bitmask_state
	jmp	.L35
.L42:
	nop
.L35:
	add	DWORD PTR -4[rbp], 1
.L33:
	cmp	DWORD PTR -4[rbp], 2
	jle	.L41
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.size	manage_channel_active_status, .-manage_channel_active_status
	.section	.rodata
.LC13:
	.string	"spid"
.LC14:
	.string	"Starting"
	.align 8
.LC15:
	.string	"usage: spid /dev/spidev0.1 irq_gpio sync_gpio /var/run/tessel\n"
	.align 8
.LC16:
	.string	"Error opening SPI device %s: %s\n"
.LC17:
	.string	"in"
.LC18:
	.string	"rising"
.LC19:
	.string	"value"
.LC20:
	.string	"none"
.LC21:
	.string	"high"
.LC22:
	.string	"%s/%d"
.LC23:
	.string	"Error binding socket %s: %s\n"
	.align 8
.LC24:
	.string	"Error listening on socket %s: %s\n"
.LC25:
	.string	"usb"
.LC26:
	.string	"%s/%s"
.LC27:
	.string	"Error in poll: %s"
.LC28:
	.string	"GPIO read: %s"
.LC29:
	.string	"0"
.LC30:
	.string	"GPIO write: %s"
.LC31:
	.string	"Error in accept: %s"
.LC32:
	.string	"Accepted connection on %i\n"
.LC33:
	.string	"Error in read %i: %s\n"
.LC34:
	.string	"SPI_IOC_MESSAGE: header: %s"
.LC35:
	.string	"1"
	.align 8
.LC36:
	.string	"Invalid command reply: %2x %2x %2x %2x %2x\n"
.LC37:
	.string	"Too many retries, exiting"
.LC38:
	.string	"SPI_IOC_MESSAGE: data: %s"
.LC39:
	.string	"Error in write %i: %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB19:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 400
	mov	DWORD PTR -388[rbp], edi
	mov	QWORD PTR -400[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 136
	mov	esi, 41
	lea	rdi, .LC13[rip]
	call	openlog@PLT
	lea	rsi, .LC14[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	cmp	DWORD PTR -388[rbp], 5
	je	.L44
	lea	rsi, .LC15[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L44:
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -336[rbp], eax
	cmp	DWORD PTR -336[rbp], 0
	jns	.L45
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC16[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L45:
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	gpio_export
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC17[rip]
	mov	rdi, rax
	call	gpio_direction
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC18[rip]
	mov	rdi, rax
	call	gpio_edge
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	call	gpio_open
	mov	DWORD PTR -332[rbp], eax
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	gpio_export
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC20[rip]
	mov	rdi, rax
	call	gpio_edge
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC21[rip]
	mov	rdi, rax
	call	gpio_direction
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	call	gpio_open
	mov	DWORD PTR -328[rbp], eax
	mov	edx, 1560
	mov	esi, 0
	lea	rdi, channels[rip]
	call	memset@PLT
	mov	edx, 56
	mov	esi, 0
	lea	rdi, fds[rip]
	call	memset@PLT
	mov	eax, DWORD PTR -332[rbp]
	mov	DWORD PTR fds[rip], eax
	mov	WORD PTR fds[rip+4], 2
	mov	DWORD PTR -380[rbp], 0
	jmp	.L46
.L52:
	cmp	DWORD PTR -380[rbp], 0
	je	.L47
	mov	WORD PTR -224[rbp], 1
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	mov	ecx, DWORD PTR -380[rbp]
	lea	rdx, -224[rbp]
	lea	rdi, 2[rdx]
	mov	r8d, ecx
	mov	rcx, rax
	lea	rdx, .LC22[rip]
	mov	esi, 108
	mov	eax, 0
	call	snprintf@PLT
	movzx	eax, WORD PTR -224[rbp]
	movzx	eax, ax
	mov	edx, 0
	mov	esi, 1
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -292[rbp], eax
	cmp	DWORD PTR -292[rbp], 0
	jns	.L48
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rax, -224[rbp]
	add	rax, 2
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC11[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L48:
	lea	rax, -224[rbp]
	add	rax, 2
	mov	rdi, rax
	call	unlink@PLT
	lea	rax, -224[rbp]
	mov	rcx, rax
	mov	eax, DWORD PTR -292[rbp]
	mov	edx, 110
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L49
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rax, -224[rbp]
	add	rax, 2
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC23[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L49:
	mov	eax, DWORD PTR -292[rbp]
	mov	esi, 1
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L50
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rax, -224[rbp]
	add	rax, 2
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC24[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L50:
	mov	eax, DWORD PTR -380[rbp]
	add	eax, 4
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rdx, fds[rip]
	mov	eax, DWORD PTR -292[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -380[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 0
	jmp	.L51
.L47:
	mov	WORD PTR usbd_sock_addr[rip], 1
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	lea	r8, .LC25[rip]
	mov	rcx, rax
	lea	rdx, .LC26[rip]
	mov	esi, 108
	lea	rdi, usbd_sock_addr[rip+2]
	mov	eax, 0
	call	snprintf@PLT
	mov	eax, DWORD PTR -380[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip]
	mov	DWORD PTR [rdx+rax], -1
	mov	eax, DWORD PTR -380[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 0
.L51:
	add	DWORD PTR -380[rbp], 1
.L46:
	cmp	DWORD PTR -380[rbp], 2
	jle	.L52
	mov	BYTE PTR channels_writable_bitmask[rip], 0
	mov	BYTE PTR channels_opened_bitmask[rip], 0
	mov	BYTE PTR channels_enabled_bitmask[rip], 0
	mov	DWORD PTR -376[rbp], 0
.L95:
	mov	DWORD PTR -372[rbp], 0
	jmp	.L53
.L54:
	mov	eax, DWORD PTR -372[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+6]
	mov	WORD PTR [rdx+rax], 0
	add	DWORD PTR -372[rbp], 1
.L53:
	cmp	DWORD PTR -372[rbp], 6
	jle	.L54
	mov	edx, 5000
	mov	esi, 7
	lea	rdi, fds[rip]
	call	poll@PLT
	mov	DWORD PTR -324[rbp], eax
	cmp	DWORD PTR -324[rbp], 0
	jns	.L55
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC27[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L55:
	mov	DWORD PTR -368[rbp], 0
	jmp	.L56
.L57:
	add	DWORD PTR -368[rbp], 1
.L56:
	cmp	DWORD PTR -368[rbp], 6
	jle	.L57
	mov	DWORD PTR -364[rbp], 0
	jmp	.L58
.L59:
	add	DWORD PTR -364[rbp], 1
.L58:
	cmp	DWORD PTR -364[rbp], 6
	jle	.L59
	movzx	eax, WORD PTR fds[rip+6]
	cwde
	and	eax, 2
	test	eax, eax
	je	.L60
	mov	eax, DWORD PTR -332[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -13[rbp]
	mov	eax, DWORD PTR -332[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jns	.L60
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC28[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L60:
	mov	eax, DWORD PTR -328[rbp]
	mov	edx, 1
	lea	rsi, .LC29[rip]
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L62
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC30[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L62:
	mov	eax, 0
	call	delay
	mov	DWORD PTR -360[rbp], 0
	jmp	.L63
.L67:
	cmp	DWORD PTR -360[rbp], 0
	je	.L97
	mov	eax, DWORD PTR -360[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+6]
	movzx	eax, WORD PTR [rdx+rax]
	cwde
	and	eax, 1
	test	eax, eax
	je	.L65
	mov	ecx, 0
	mov	eax, DWORD PTR -360[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -296[rbp], eax
	cmp	DWORD PTR -296[rbp], -1
	jne	.L66
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC31[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L66:
	mov	eax, DWORD PTR -360[rbp]
	mov	edx, eax
	lea	rsi, .LC32[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	mov	eax, DWORD PTR -360[rbp]
	add	eax, 1
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rdx, fds[rip]
	mov	eax, DWORD PTR -296[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -360[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 5
	mov	eax, DWORD PTR -360[rbp]
	add	eax, 4
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], 0
	mov	eax, DWORD PTR -360[rbp]
	movzx	eax, al
	mov	edx, 1
	mov	esi, eax
	lea	rdi, channels_opened_bitmask[rip]
	call	set_channel_bitmask_state
	jmp	.L65
.L97:
	nop
.L65:
	add	DWORD PTR -360[rbp], 1
.L63:
	cmp	DWORD PTR -360[rbp], 2
	jle	.L67
	mov	DWORD PTR -356[rbp], 0
	jmp	.L68
.L75:
	mov	BYTE PTR -381[rbp], 0
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+6]
	movzx	eax, WORD PTR [rdx+rax]
	cwde
	and	eax, 1
	test	eax, eax
	je	.L69
	mov	eax, DWORD PTR -356[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	lea	rdx, channels[rip]
	add	rax, rdx
	lea	rcx, 4[rax]
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, 255
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -300[rbp], eax
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	movzx	eax, WORD PTR [rdx+rax]
	mov	edx, DWORD PTR -356[rbp]
	add	edx, 1
	and	eax, -2
	mov	ecx, eax
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], cx
	cmp	DWORD PTR -300[rbp], 0
	jle	.L70
	mov	eax, DWORD PTR -356[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	mov	rcx, rax
	lea	rdx, channels[rip+260]
	mov	eax, DWORD PTR -300[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	jmp	.L69
.L70:
	cmp	DWORD PTR -300[rbp], 0
	jns	.L71
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -356[rbp]
	mov	rcx, rdx
	mov	edx, eax
	lea	rsi, .LC33[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
.L71:
	mov	BYTE PTR -381[rbp], 1
.L69:
	cmp	BYTE PTR -381[rbp], 0
	jne	.L72
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+6]
	movzx	eax, WORD PTR [rdx+rax]
	cwde
	and	eax, 16
	test	eax, eax
	jne	.L72
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+6]
	movzx	eax, WORD PTR [rdx+rax]
	cwde
	and	eax, 8
	test	eax, eax
	jne	.L72
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+6]
	movzx	eax, WORD PTR [rdx+rax]
	cwde
	and	eax, 8192
	test	eax, eax
	je	.L73
.L72:
	mov	eax, DWORD PTR -356[rbp]
	movzx	eax, al
	mov	edi, eax
	call	close_channel_connection
	jmp	.L74
.L73:
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+6]
	movzx	eax, WORD PTR [rdx+rax]
	cwde
	and	eax, 4
	test	eax, eax
	je	.L74
	mov	eax, DWORD PTR -356[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	movzx	eax, WORD PTR [rdx+rax]
	mov	edx, DWORD PTR -356[rbp]
	add	edx, 1
	and	eax, -5
	mov	ecx, eax
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], cx
	mov	eax, DWORD PTR -356[rbp]
	movzx	eax, al
	mov	edx, 1
	mov	esi, eax
	lea	rdi, channels_writable_bitmask[rip]
	call	set_channel_bitmask_state
.L74:
	add	DWORD PTR -356[rbp], 1
.L68:
	cmp	DWORD PTR -356[rbp], 2
	jle	.L75
	lea	rax, -288[rbp]
	mov	edx, 64
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	BYTE PTR -18[rbp], 83
	movzx	eax, BYTE PTR channels_opened_bitmask[rip]
	movzx	eax, al
	sal	eax, 4
	mov	edx, eax
	movzx	eax, BYTE PTR channels_writable_bitmask[rip]
	or	eax, edx
	mov	BYTE PTR -17[rbp], al
	mov	DWORD PTR -352[rbp], 0
	jmp	.L76
.L77:
	mov	eax, DWORD PTR -352[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, channels[rip+260]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -352[rbp]
	add	eax, 2
	cdqe
	mov	BYTE PTR -18[rbp+rax], dl
	add	DWORD PTR -352[rbp], 1
.L76:
	cmp	DWORD PTR -352[rbp], 2
	jle	.L77
	mov	DWORD PTR -272[rbp], 5
	lea	rax, -18[rbp]
	mov	QWORD PTR -288[rbp], rax
	mov	DWORD PTR -240[rbp], 5
	lea	rax, -13[rbp]
	mov	QWORD PTR -248[rbp], rax
	lea	rdx, -288[rbp]
	mov	eax, DWORD PTR -336[rbp]
	mov	esi, 1077963520
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -320[rbp], eax
	cmp	DWORD PTR -320[rbp], 0
	jns	.L78
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC34[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L78:
	mov	eax, DWORD PTR -328[rbp]
	mov	edx, 1
	lea	rsi, .LC35[rip]
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L79
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC30[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L79:
	movzx	eax, BYTE PTR -13[rbp]
	cmp	al, -54
	je	.L80
	movzx	eax, BYTE PTR -9[rbp]
	movzx	ecx, al
	movzx	eax, BYTE PTR -10[rbp]
	movzx	edi, al
	movzx	eax, BYTE PTR -11[rbp]
	movzx	esi, al
	movzx	eax, BYTE PTR -12[rbp]
	movzx	edx, al
	movzx	eax, BYTE PTR -13[rbp]
	movzx	eax, al
	sub	rsp, 8
	push	rcx
	mov	r9d, edi
	mov	r8d, esi
	mov	ecx, edx
	mov	edx, eax
	lea	rsi, .LC36[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	add	rsp, 16
	add	DWORD PTR -376[rbp], 1
	cmp	DWORD PTR -376[rbp], 15
	jle	.L98
	lea	rsi, .LC37[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L80:
	lea	rax, -13[rbp]
	mov	rdi, rax
	call	manage_channel_active_status
	mov	DWORD PTR -376[rbp], 0
	mov	eax, 0
	call	delay
	lea	rax, -224[rbp]
	mov	edx, 192
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -348[rbp], 0
	mov	DWORD PTR -344[rbp], 0
	jmp	.L83
.L86:
	mov	eax, DWORD PTR -344[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, channels[rip+260]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -304[rbp], eax
	movzx	eax, BYTE PTR -12[rbp]
	movzx	edx, al
	mov	eax, DWORD PTR -344[rbp]
	mov	ecx, eax
	sar	edx, cl
	mov	eax, edx
	and	eax, 1
	test	eax, eax
	je	.L84
	cmp	DWORD PTR -304[rbp], 0
	jle	.L84
	mov	eax, DWORD PTR -344[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	movzx	eax, WORD PTR [rdx+rax]
	mov	edx, DWORD PTR -344[rbp]
	add	edx, 1
	or	eax, 1
	mov	ecx, eax
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], cx
	mov	eax, DWORD PTR -304[rbp]
	mov	edx, DWORD PTR -348[rbp]
	movsx	rdx, edx
	sal	rdx, 5
	add	rdx, rbp
	sub	rdx, 208
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -344[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	lea	rdx, channels[rip]
	add	rax, rdx
	add	rax, 4
	mov	rdx, rax
	mov	eax, DWORD PTR -348[rbp]
	cdqe
	sal	rax, 5
	add	rax, rbp
	sub	rax, 224
	mov	QWORD PTR [rax], rdx
	mov	eax, DWORD PTR -344[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, channels[rip+260]
	mov	DWORD PTR [rdx+rax], 0
	add	DWORD PTR -348[rbp], 1
.L84:
	mov	eax, DWORD PTR -344[rbp]
	add	eax, 2
	cdqe
	movzx	eax, BYTE PTR -13[rbp+rax]
	movzx	eax, al
	mov	DWORD PTR -304[rbp], eax
	mov	eax, DWORD PTR -344[rbp]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, channels_writable_bitmask[rip]
	call	get_channel_bitmask_state
	test	al, al
	je	.L85
	cmp	DWORD PTR -304[rbp], 0
	jle	.L85
	mov	eax, DWORD PTR -304[rbp]
	mov	edx, DWORD PTR -348[rbp]
	movsx	rdx, edx
	sal	rdx, 5
	add	rdx, rbp
	sub	rdx, 208
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -344[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 6
	add	rax, rdx
	sal	rax, 3
	lea	rdx, 256[rax]
	lea	rax, channels[rip]
	add	rax, rdx
	add	rax, 8
	mov	rdx, rax
	mov	eax, DWORD PTR -348[rbp]
	cdqe
	sal	rax, 5
	add	rax, rbp
	sub	rax, 216
	mov	QWORD PTR [rax], rdx
	add	DWORD PTR -348[rbp], 1
.L85:
	add	DWORD PTR -344[rbp], 1
.L83:
	cmp	DWORD PTR -344[rbp], 2
	jle	.L86
	cmp	DWORD PTR -348[rbp], 0
	je	.L95
	mov	eax, DWORD PTR -348[rbp]
	cdqe
	sal	rax, 5
	cmp	rax, 16383
	ja	.L88
	mov	eax, DWORD PTR -348[rbp]
	cdqe
	sal	rax, 5
	jmp	.L89
.L88:
	mov	eax, 0
.L89:
	sal	rax, 16
	or	rax, 1073769216
	mov	rcx, rax
	lea	rdx, -224[rbp]
	mov	eax, DWORD PTR -336[rbp]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -316[rbp], eax
	cmp	DWORD PTR -316[rbp], 0
	jns	.L90
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC38[rip]
	mov	edi, 2
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L90:
	mov	DWORD PTR -340[rbp], 0
	jmp	.L91
.L94:
	mov	eax, DWORD PTR -340[rbp]
	add	eax, 2
	cdqe
	movzx	eax, BYTE PTR -13[rbp+rax]
	movzx	eax, al
	mov	DWORD PTR -312[rbp], eax
	mov	eax, DWORD PTR -340[rbp]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, channels_writable_bitmask[rip]
	call	get_channel_bitmask_state
	test	al, al
	je	.L92
	cmp	DWORD PTR -312[rbp], 0
	jle	.L92
	mov	eax, DWORD PTR -312[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -340[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 6
	add	rax, rcx
	sal	rax, 3
	lea	rcx, 256[rax]
	lea	rax, channels[rip]
	add	rax, rcx
	lea	rcx, 8[rax]
	mov	eax, DWORD PTR -340[rbp]
	add	eax, 1
	cdqe
	lea	rsi, 0[0+rax*8]
	lea	rax, fds[rip]
	mov	eax, DWORD PTR [rsi+rax]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -308[rbp], eax
	cmp	DWORD PTR -308[rbp], 0
	jns	.L93
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -340[rbp]
	mov	rcx, rdx
	mov	edx, eax
	lea	rsi, .LC39[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
.L93:
	mov	eax, DWORD PTR -340[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	movzx	eax, WORD PTR [rdx+rax]
	mov	edx, DWORD PTR -340[rbp]
	add	edx, 1
	or	eax, 4
	mov	ecx, eax
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, fds[rip+4]
	mov	WORD PTR [rdx+rax], cx
	mov	eax, DWORD PTR -340[rbp]
	movzx	eax, al
	mov	edx, 0
	mov	esi, eax
	lea	rdi, channels_writable_bitmask[rip]
	call	set_channel_bitmask_state
.L92:
	add	DWORD PTR -340[rbp], 1
.L91:
	cmp	DWORD PTR -340[rbp], 2
	jle	.L94
	jmp	.L95
.L98:
	nop
	jmp	.L95
	.cfi_endproc
.LFE19:
	.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	"913149.c"
	.text
	.comm	channels,1560,4
	.comm	channels_writable_bitmask,1,1
	.comm	channels_opened_bitmask,1,1
	.comm	channels_enabled_bitmask,1,1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/sys/class/gpio/gpio%s\000"
	.align	2
.LC1:
	.ascii	"/sys/class/gpio/export\000"
	.align	2
.LC2:
	.ascii	"Error opening /sys/class/gpio/export: %s\012\000"
	.align	2
.LC3:
	.ascii	"GPIO export write: %s\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	gpio_export
	.syntax unified
	.arm
	.fpu softvfp
	.type	gpio_export, %function
gpio_export:
	@ args = 0, pretend = 0, frame = 528
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #528
	str	r0, [fp, #-528]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #520
	ldr	r3, [fp, #-528]
	ldr	r2, .L8+4
	mov	r1, #512
	bl	snprintf
	sub	r3, fp, #520
	mov	r1, #0
	mov	r0, r3
	bl	access
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	mov	r1, #1
	ldr	r0, .L8+8
	bl	open
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bge	.L4
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L8+12
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L4:
	ldr	r0, [fp, #-528]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-528]
	ldr	r0, [fp, #-524]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L8+16
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L5:
	ldr	r0, [fp, #-524]
	bl	close
	b	.L1
.L7:
	nop
.L1:
	ldr	r3, .L8
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	gpio_export, .-gpio_export
	.section	.rodata
	.align	2
.LC5:
	.ascii	"/sys/class/gpio/gpio%s/%s\000"
	.align	2
.LC6:
	.ascii	"Error opening %s: %s\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	gpio_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	gpio_open, %function
gpio_open:
	@ args = 0, pretend = 0, frame = 528
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r0, [fp, #-528]
	str	r1, [fp, #-532]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #520
	ldr	r3, [fp, #-532]
	str	r3, [sp]
	ldr	r3, [fp, #-528]
	ldr	r2, .L14+4
	mov	r1, #512
	bl	snprintf
	sub	r3, fp, #520
	mov	r1, #2
	mov	r0, r3
	bl	open
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bge	.L11
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	sub	r2, fp, #520
	ldr	r1, .L14+8
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-524]
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC7
	.word	.LC5
	.word	.LC6
	.size	gpio_open, .-gpio_open
	.section	.rodata
	.align	2
.LC8:
	.ascii	"direction\000"
	.align	2
.LC9:
	.ascii	"GPIO direction write: %s\000"
	.text
	.align	2
	.global	gpio_direction
	.syntax unified
	.arm
	.fpu softvfp
	.type	gpio_direction, %function
gpio_direction:
	@ 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	r1, .L18
	ldr	r0, [fp, #-16]
	bl	gpio_open
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-20]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-8]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L17
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L18+4
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L17:
	ldr	r0, [fp, #-8]
	bl	close
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC8
	.word	.LC9
	.size	gpio_direction, .-gpio_direction
	.section	.rodata
	.align	2
.LC10:
	.ascii	"edge\000"
	.align	2
.LC11:
	.ascii	"GPIO edge write: %s\000"
	.text
	.align	2
	.global	gpio_edge
	.syntax unified
	.arm
	.fpu softvfp
	.type	gpio_edge, %function
gpio_edge:
	@ 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	r1, .L22
	ldr	r0, [fp, #-16]
	bl	gpio_open
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-20]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-8]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L21
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L22+4
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L21:
	ldr	r0, [fp, #-8]
	bl	close
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC10
	.word	.LC11
	.size	gpio_edge, .-gpio_edge
	.comm	fds,56,4
	.comm	usbd_sock_fd,4,4
	.comm	usbd_sock_addr,110,4
	.align	2
	.global	delay
	.syntax unified
	.arm
	.fpu softvfp
	.type	delay, %function
delay:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r0, #10
	bl	usleep
	nop
	pop	{fp, pc}
	.size	delay, .-delay
	.align	2
	.global	get_channel_bitmask_state
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_channel_bitmask_state, %function
get_channel_bitmask_state:
	@ 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]
	mov	r3, r1
	strb	r3, [fp, #-9]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	asr	r3, r2, r3
	and	r3, r3, #255
	and	r3, r3, #1
	and	r3, r3, #255
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	get_channel_bitmask_state, .-get_channel_bitmask_state
	.align	2
	.global	set_channel_bitmask_state
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_channel_bitmask_state, %function
set_channel_bitmask_state:
	@ 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]
	mov	r3, r1
	strb	r3, [fp, #-9]
	mov	r3, r2
	strb	r3, [fp, #-10]
	ldrb	r3, [fp, #-10]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L28
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	mov	r1, #1
	lsl	r3, r1, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r2, r3, #255
	ldr	r3, [fp, #-8]
	strb	r2, [r3]
	b	.L30
.L28:
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	mov	r1, #1
	lsl	r3, r1, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	mvn	r3, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r3, r3, r2
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r2, r3, #255
	ldr	r3, [fp, #-8]
	strb	r2, [r3]
.L30:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	set_channel_bitmask_state, .-set_channel_bitmask_state
	.align	2
	.global	extract_enabled_state
	.syntax unified
	.arm
	.fpu softvfp
	.type	extract_enabled_state, %function
extract_enabled_state:
	@ 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]
	mov	r3, r1
	strb	r3, [fp, #-9]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	mov	r2, #16
	lsl	r3, r2, r3
	and	r3, r3, r1
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	extract_enabled_state, .-extract_enabled_state
	.section	.rodata
	.align	2
.LC12:
	.ascii	"Closing connection %d\012\000"
	.text
	.align	2
	.global	close_channel_connection
	.syntax unified
	.arm
	.fpu softvfp
	.type	close_channel_connection, %function
close_channel_connection:
	@ 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, r0
	strb	r3, [fp, #-5]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r1, .L35
	mov	r0, #6
	bl	syslog
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #1
	ldr	r2, .L35+4
	ldr	r3, [r2, r3, lsl #3]
	mov	r0, r3
	bl	close
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #1
	ldr	r2, .L35+4
	mvn	r1, #0
	str	r1, [r2, r3, lsl #3]
	ldrb	r2, [fp, #-5]	@ zero_extendqisi2
	ldr	r1, .L35+8
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #260
	mov	r2, #0
	str	r2, [r3]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L35+12
	bl	get_channel_bitmask_state
	mov	r3, r0
	cmp	r3, #0
	beq	.L34
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L34
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #4
	ldr	r2, .L35+4
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #1
	strh	r2, [r3]	@ movhi
.L34:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, .L35+16
	bl	set_channel_bitmask_state
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, .L35+20
	bl	set_channel_bitmask_state
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L36:
	.align	2
.L35:
	.word	.LC12
	.word	fds
	.word	channels
	.word	channels_enabled_bitmask
	.word	channels_opened_bitmask
	.word	channels_writable_bitmask
	.size	close_channel_connection, .-close_channel_connection
	.align	2
	.global	disable_listening_socket
	.syntax unified
	.arm
	.fpu softvfp
	.type	disable_listening_socket, %function
disable_listening_socket:
	@ 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
	mov	r3, r0
	strb	r3, [fp, #-5]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #4
	ldr	r2, .L38
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #0
	strh	r2, [r3]	@ movhi
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L39:
	.align	2
.L38:
	.word	fds
	.size	disable_listening_socket, .-disable_listening_socket
	.align	2
	.global	enable_listening_socket
	.syntax unified
	.arm
	.fpu softvfp
	.type	enable_listening_socket, %function
enable_listening_socket:
	@ 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
	mov	r3, r0
	strb	r3, [fp, #-5]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #4
	ldr	r2, .L41
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #1
	strh	r2, [r3]	@ movhi
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L42:
	.align	2
.L41:
	.word	fds
	.size	enable_listening_socket, .-enable_listening_socket
	.section	.rodata
	.align	2
.LC13:
	.ascii	"Error creating socket %s: %s\012\000"
	.align	2
.LC14:
	.ascii	"Error connecting to USB Daemon socket %s: %s\012\000"
	.text
	.align	2
	.global	enable_usb_daemon_socket
	.syntax unified
	.arm
	.fpu softvfp
	.type	enable_usb_daemon_socket, %function
enable_usb_daemon_socket:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L46
	ldrh	r3, [r3]
	mov	r2, #0
	mov	r1, #1
	mov	r0, r3
	bl	socket
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L44
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, .L46+4
	ldr	r1, .L46+8
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L44:
	ldr	r2, .L46+12
	ldr	r3, [fp, #-8]
	str	r3, [r2, #8]
	ldr	r3, .L46+12
	ldr	r3, [r3, #8]
	ldr	r1, .L46
	mov	r2, #110
	mov	r0, r3
	bl	connect
	mov	r3, r0
	cmn	r3, #1
	bne	.L45
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, .L46+4
	ldr	r1, .L46+16
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L45:
	ldr	r3, .L46+12
	mov	r2, #13
	strh	r2, [r3, #12]	@ movhi
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L46+20
	bl	set_channel_bitmask_state
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L47:
	.align	2
.L46:
	.word	usbd_sock_addr
	.word	usbd_sock_addr+2
	.word	.LC13
	.word	fds
	.word	.LC14
	.word	channels_opened_bitmask
	.size	enable_usb_daemon_socket, .-enable_usb_daemon_socket
	.align	2
	.global	manage_channel_active_status
	.syntax unified
	.arm
	.fpu softvfp
	.type	manage_channel_active_status, %function
manage_channel_active_status:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L49
.L57:
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	extract_enabled_state
	mov	r3, r0
	strb	r3, [fp, #-10]
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r1, r3
	ldr	r0, .L59
	bl	get_channel_bitmask_state
	mov	r3, r0
	strb	r3, [fp, #-9]
	ldrb	r2, [fp, #-10]	@ zero_extendqisi2
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	cmp	r2, r3
	beq	.L58
	ldrb	r3, [fp, #-10]	@ zero_extendqisi2
	cmp	r3, #1
	bne	.L52
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L53
	bl	enable_usb_daemon_socket
	b	.L54
.L53:
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r0, r3
	bl	enable_listening_socket
.L54:
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r2, #1
	mov	r1, r3
	ldr	r0, .L59
	bl	set_channel_bitmask_state
	b	.L51
.L52:
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r0, r3
	bl	close_channel_connection
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L55
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r0, r3
	bl	disable_listening_socket
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	ldr	r2, .L59+4
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #0
	strh	r2, [r3]	@ movhi
	b	.L56
.L55:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, .L59+4
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #0
	strh	r2, [r3]	@ movhi
.L56:
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r2, #0
	mov	r1, r3
	ldr	r0, .L59
	bl	set_channel_bitmask_state
	b	.L51
.L58:
	nop
.L51:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L49:
	ldr	r3, [fp, #-8]
	cmp	r3, #2
	ble	.L57
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L60:
	.align	2
.L59:
	.word	channels_enabled_bitmask
	.word	fds
	.size	manage_channel_active_status, .-manage_channel_active_status
	.section	.rodata
	.align	2
.LC15:
	.ascii	"spid\000"
	.align	2
.LC16:
	.ascii	"Starting\000"
	.align	2
.LC17:
	.ascii	"usage: spid /dev/spidev0.1 irq_gpio sync_gpio /var/"
	.ascii	"run/tessel\012\000"
	.align	2
.LC18:
	.ascii	"Error opening SPI device %s: %s\012\000"
	.align	2
.LC19:
	.ascii	"in\000"
	.align	2
.LC20:
	.ascii	"rising\000"
	.align	2
.LC21:
	.ascii	"value\000"
	.align	2
.LC22:
	.ascii	"none\000"
	.align	2
.LC23:
	.ascii	"high\000"
	.align	2
.LC24:
	.ascii	"%s/%d\000"
	.align	2
.LC25:
	.ascii	"Error binding socket %s: %s\012\000"
	.align	2
.LC26:
	.ascii	"Error listening on socket %s: %s\012\000"
	.align	2
.LC27:
	.ascii	"%s/%s\000"
	.align	2
.LC28:
	.ascii	"usb\000"
	.align	2
.LC29:
	.ascii	"Error in poll: %s\000"
	.align	2
.LC30:
	.ascii	"GPIO read: %s\000"
	.align	2
.LC31:
	.ascii	"0\000"
	.align	2
.LC32:
	.ascii	"GPIO write: %s\000"
	.align	2
.LC33:
	.ascii	"Error in accept: %s\000"
	.align	2
.LC34:
	.ascii	"Accepted connection on %i\012\000"
	.align	2
.LC35:
	.ascii	"Error in read %i: %s\012\000"
	.align	2
.LC36:
	.ascii	"SPI_IOC_MESSAGE: header: %s\000"
	.align	2
.LC37:
	.ascii	"1\000"
	.align	2
.LC38:
	.ascii	"Invalid command reply: %2x %2x %2x %2x %2x\012\000"
	.align	2
.LC39:
	.ascii	"Too many retries, exiting\000"
	.align	2
.LC40:
	.ascii	"SPI_IOC_MESSAGE: data: %s\000"
	.align	2
.LC41:
	.ascii	"Error in write %i: %s\012\000"
	.align	2
.LC42:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 384
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #404
	str	r0, [fp, #-392]
	str	r1, [fp, #-396]
	ldr	r3, .L117
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r2, #136
	mov	r1, #41
	ldr	r0, .L117+4
	bl	openlog
	ldr	r1, .L117+8
	mov	r0, #6
	bl	syslog
	ldr	r3, [fp, #-392]
	cmp	r3, #5
	beq	.L62
	ldr	r1, .L117+12
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L62:
	ldr	r3, [fp, #-396]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	open
	str	r0, [fp, #-340]
	ldr	r3, [fp, #-340]
	cmp	r3, #0
	bge	.L63
	ldr	r3, [fp, #-396]
	add	r3, r3, #4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r4
	ldr	r1, .L117+16
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L63:
	ldr	r3, [fp, #-396]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	gpio_export
	ldr	r3, [fp, #-396]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L117+20
	mov	r0, r3
	bl	gpio_direction
	ldr	r3, [fp, #-396]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L117+24
	mov	r0, r3
	bl	gpio_edge
	ldr	r3, [fp, #-396]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L117+28
	mov	r0, r3
	bl	gpio_open
	str	r0, [fp, #-336]
	ldr	r3, [fp, #-396]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	gpio_export
	ldr	r3, [fp, #-396]
	add	r3, r3, #12
	ldr	r3, [r3]
	ldr	r1, .L117+32
	mov	r0, r3
	bl	gpio_edge
	ldr	r3, [fp, #-396]
	add	r3, r3, #12
	ldr	r3, [r3]
	ldr	r1, .L117+36
	mov	r0, r3
	bl	gpio_direction
	ldr	r3, [fp, #-396]
	add	r3, r3, #12
	ldr	r3, [r3]
	ldr	r1, .L117+28
	mov	r0, r3
	bl	gpio_open
	str	r0, [fp, #-332]
	ldr	r2, .L117+40
	mov	r1, #0
	ldr	r0, .L117+44
	bl	memset
	mov	r2, #56
	mov	r1, #0
	ldr	r0, .L117+48
	bl	memset
	ldr	r2, .L117+48
	ldr	r3, [fp, #-336]
	str	r3, [r2]
	ldr	r3, .L117+48
	mov	r2, #2
	strh	r2, [r3, #4]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-384]
	b	.L64
.L70:
	ldr	r3, [fp, #-384]
	cmp	r3, #0
	beq	.L65
	mov	r3, #1
	strh	r3, [fp, #-228]	@ movhi
	ldr	r3, [fp, #-396]
	add	r3, r3, #16
	ldr	r2, [r3]
	sub	r3, fp, #228
	add	r0, r3, #2
	ldr	r3, [fp, #-384]
	str	r3, [sp]
	mov	r3, r2
	ldr	r2, .L117+52
	mov	r1, #108
	bl	snprintf
	ldrh	r3, [fp, #-228]
	mov	r2, #0
	mov	r1, #1
	mov	r0, r3
	bl	socket
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmp	r3, #0
	bge	.L66
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r1, r0
	sub	r3, fp, #228
	add	r2, r3, #2
	mov	r3, r1
	ldr	r1, .L117+56
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L66:
	sub	r3, fp, #228
	add	r3, r3, #2
	mov	r0, r3
	bl	unlink
	sub	r3, fp, #228
	mov	r2, #110
	mov	r1, r3
	ldr	r0, [fp, #-296]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L67
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r1, r0
	sub	r3, fp, #228
	add	r2, r3, #2
	mov	r3, r1
	ldr	r1, .L117+60
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L67:
	mov	r1, #1
	ldr	r0, [fp, #-296]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L68
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r1, r0
	sub	r3, fp, #228
	add	r2, r3, #2
	mov	r3, r1
	ldr	r1, .L117+64
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L68:
	ldr	r3, [fp, #-384]
	add	r3, r3, #4
	ldr	r1, .L117+48
	ldr	r2, [fp, #-296]
	str	r2, [r1, r3, lsl #3]
	ldr	r3, [fp, #-384]
	add	r3, r3, #4
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #0
	strh	r2, [r3]	@ movhi
	b	.L69
.L65:
	ldr	r3, .L117+68
	mov	r2, #1
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-396]
	add	r3, r3, #16
	ldr	r3, [r3]
	ldr	r2, .L117+72
	str	r2, [sp]
	ldr	r2, .L117+76
	mov	r1, #108
	ldr	r0, .L117+80
	bl	snprintf
	ldr	r3, [fp, #-384]
	add	r3, r3, #1
	ldr	r2, .L117+48
	mvn	r1, #0
	str	r1, [r2, r3, lsl #3]
	ldr	r3, [fp, #-384]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #0
	strh	r2, [r3]	@ movhi
.L69:
	ldr	r3, [fp, #-384]
	add	r3, r3, #1
	str	r3, [fp, #-384]
.L64:
	ldr	r3, [fp, #-384]
	cmp	r3, #2
	ble	.L70
	ldr	r3, .L117+84
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, .L117+88
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, .L117+92
	mov	r2, #0
	strb	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-380]
.L113:
	mov	r3, #0
	str	r3, [fp, #-376]
	b	.L71
.L72:
	ldr	r2, .L117+48
	ldr	r3, [fp, #-376]
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #6
	mov	r2, #0
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-376]
	add	r3, r3, #1
	str	r3, [fp, #-376]
.L71:
	ldr	r3, [fp, #-376]
	cmp	r3, #6
	ble	.L72
	ldr	r2, .L117+96
	mov	r1, #7
	ldr	r0, .L117+48
	bl	poll
	str	r0, [fp, #-328]
	ldr	r3, [fp, #-328]
	cmp	r3, #0
	bge	.L73
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L117+100
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L73:
	mov	r3, #0
	str	r3, [fp, #-372]
	b	.L74
.L75:
	ldr	r3, [fp, #-372]
	add	r3, r3, #1
	str	r3, [fp, #-372]
.L74:
	ldr	r3, [fp, #-372]
	cmp	r3, #6
	ble	.L75
	mov	r3, #0
	str	r3, [fp, #-368]
	b	.L76
.L77:
	ldr	r3, [fp, #-368]
	add	r3, r3, #1
	str	r3, [fp, #-368]
.L76:
	ldr	r3, [fp, #-368]
	cmp	r3, #6
	ble	.L77
	ldr	r3, .L117+48
	ldrsh	r3, [r3, #6]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #2
	cmp	r3, #0
	beq	.L78
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-336]
	bl	lseek
	sub	r3, fp, #24
	mov	r2, #2
	mov	r1, r3
	ldr	r0, [fp, #-336]
	bl	read
	mov	r3, r0
	cmp	r3, #0
	bge	.L78
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L117+104
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L78:
	mov	r2, #1
	ldr	r1, .L117+108
	ldr	r0, [fp, #-332]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L80
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L117+112
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L80:
	bl	delay
	mov	r3, #0
	str	r3, [fp, #-364]
	b	.L81
.L85:
	ldr	r3, [fp, #-364]
	cmp	r3, #0
	beq	.L115
	ldr	r3, [fp, #-364]
	add	r3, r3, #4
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #6
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L83
	ldr	r3, [fp, #-364]
	add	r3, r3, #4
	ldr	r2, .L117+48
	ldr	r3, [r2, r3, lsl #3]
	mov	r1, #0
	mov	r2, #0
	mov	r0, r3
	bl	accept
	str	r0, [fp, #-300]
	ldr	r3, [fp, #-300]
	cmn	r3, #1
	bne	.L84
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L117+116
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L84:
	ldr	r2, [fp, #-364]
	ldr	r1, .L117+120
	mov	r0, #6
	bl	syslog
	ldr	r3, [fp, #-364]
	add	r3, r3, #1
	ldr	r1, .L117+48
	ldr	r2, [fp, #-300]
	str	r2, [r1, r3, lsl #3]
	ldr	r3, [fp, #-364]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #5
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-364]
	add	r3, r3, #4
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	mov	r2, #0
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-364]
	and	r3, r3, #255
	mov	r2, #1
	mov	r1, r3
	ldr	r0, .L117+88
	bl	set_channel_bitmask_state
	b	.L83
.L115:
	nop
.L83:
	ldr	r3, [fp, #-364]
	add	r3, r3, #1
	str	r3, [fp, #-364]
.L81:
	ldr	r3, [fp, #-364]
	cmp	r3, #2
	ble	.L85
	mov	r3, #0
	str	r3, [fp, #-360]
	b	.L86
.L93:
	mov	r3, #0
	strb	r3, [fp, #-385]
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #6
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L87
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	ldr	r0, [r2, r3, lsl #3]
	ldr	r2, [fp, #-360]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L117+44
	add	r3, r3, r2
	add	r3, r3, #4
	mov	r2, #255
	mov	r1, r3
	bl	read
	str	r0, [fp, #-304]
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	ldrsh	r2, [r3]
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	bic	r2, r2, #1
	lsl	r2, r2, #16
	asr	r2, r2, #16
	ldr	r1, .L117+48
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #4
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-304]
	cmp	r3, #0
	ble	.L88
	ldr	r1, .L117+44
	ldr	r2, [fp, #-360]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #260
	ldr	r2, [fp, #-304]
	str	r2, [r3]
	b	.L87
.L88:
	ldr	r3, [fp, #-304]
	cmp	r3, #0
	bge	.L89
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-360]
	ldr	r1, .L117+124
	mov	r0, #3
	bl	syslog
.L89:
	mov	r3, #1
	strb	r3, [fp, #-385]
.L87:
	ldrb	r3, [fp, #-385]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L90
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #6
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #16
	cmp	r3, #0
	bne	.L90
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #6
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #8
	cmp	r3, #0
	bne	.L90
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #6
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #8192
	cmp	r3, #0
	beq	.L91
.L90:
	ldr	r3, [fp, #-360]
	and	r3, r3, #255
	mov	r0, r3
	bl	close_channel_connection
	b	.L92
.L91:
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #6
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #4
	cmp	r3, #0
	beq	.L92
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	ldrsh	r2, [r3]
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	bic	r2, r2, #4
	lsl	r2, r2, #16
	asr	r2, r2, #16
	ldr	r1, .L117+48
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #4
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-360]
	and	r3, r3, #255
	mov	r2, #1
	mov	r1, r3
	ldr	r0, .L117+84
	bl	set_channel_bitmask_state
.L92:
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	str	r3, [fp, #-360]
.L86:
	ldr	r3, [fp, #-360]
	cmp	r3, #2
	ble	.L93
	sub	r3, fp, #292
	mov	r2, #64
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #83
	strb	r3, [fp, #-32]
	ldr	r3, .L117+88
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #4
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, .L117+84
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r3, r3, #255
	strb	r3, [fp, #-31]
	mov	r3, #0
	str	r3, [fp, #-356]
	b	.L94
.L95:
	ldr	r1, .L117+44
	ldr	r2, [fp, #-356]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #260
	ldr	r2, [r3]
	ldr	r3, [fp, #-356]
	add	r3, r3, #2
	and	r2, r2, #255
	sub	r1, fp, #12
	add	r3, r1, r3
	strb	r2, [r3, #-20]
	ldr	r3, [fp, #-356]
	add	r3, r3, #1
	str	r3, [fp, #-356]
.L94:
	ldr	r3, [fp, #-356]
	cmp	r3, #2
	ble	.L95
	mov	r3, #5
	str	r3, [fp, #-276]
	sub	r3, fp, #32
	mov	r2, r3
	mov	r3, #0
	str	r2, [fp, #-292]
	str	r3, [fp, #-288]
	mov	r3, #5
	str	r3, [fp, #-244]
	sub	r3, fp, #24
	mov	r2, r3
	mov	r3, #0
	str	r2, [fp, #-252]
	str	r3, [fp, #-248]
	sub	r3, fp, #292
	mov	r2, r3
	ldr	r1, .L117+128
	ldr	r0, [fp, #-340]
	bl	ioctl
	str	r0, [fp, #-324]
	ldr	r3, [fp, #-324]
	cmp	r3, #0
	bge	.L96
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L117+132
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L96:
	mov	r2, #1
	ldr	r1, .L117+136
	ldr	r0, [fp, #-332]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L97
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L117+112
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L97:
	ldrb	r3, [fp, #-24]	@ zero_extendqisi2
	cmp	r3, #202
	beq	.L98
	ldrb	r3, [fp, #-24]	@ zero_extendqisi2
	mov	r0, r3
	ldrb	r3, [fp, #-23]	@ zero_extendqisi2
	mov	ip, r3
	ldrb	r3, [fp, #-22]	@ zero_extendqisi2
	ldrb	r2, [fp, #-21]	@ zero_extendqisi2
	ldrb	r1, [fp, #-20]	@ zero_extendqisi2
	str	r1, [sp, #8]
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r3, ip
	mov	r2, r0
	ldr	r1, .L117+140
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-380]
	add	r3, r3, #1
	str	r3, [fp, #-380]
	ldr	r3, [fp, #-380]
	cmp	r3, #15
	ble	.L116
	ldr	r1, .L117+144
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L98:
	sub	r3, fp, #24
	mov	r0, r3
	bl	manage_channel_active_status
	mov	r3, #0
	str	r3, [fp, #-380]
	bl	delay
	sub	r3, fp, #228
	mov	r2, #192
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-352]
	mov	r3, #0
	str	r3, [fp, #-348]
	b	.L101
.L104:
	ldr	r1, .L117+44
	ldr	r2, [fp, #-348]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #260
	ldr	r3, [r3]
	str	r3, [fp, #-308]
	ldrb	r3, [fp, #-23]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-348]
	asr	r3, r2, r3
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L102
	ldr	r3, [fp, #-308]
	cmp	r3, #0
	ble	.L102
	ldr	r3, [fp, #-348]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	ldrsh	r2, [r3]
	ldr	r3, [fp, #-348]
	add	r3, r3, #1
	orr	r2, r2, #1
	lsl	r2, r2, #16
	asr	r2, r2, #16
	ldr	r1, .L117+48
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #4
	strh	r2, [r3]	@ movhi
	ldr	r2, [fp, #-308]
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #5
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-200]
	ldr	r2, [fp, #-348]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L117+44
	add	r3, r3, r2
	add	r3, r3, #4
	mov	r2, r3
	mov	r3, #0
	ldr	r1, [fp, #-352]
	lsl	r1, r1, #5
	sub	r0, fp, #12
	add	r1, r0, r1
	sub	r1, r1, #216
	stm	r1, {r2-r3}
	ldr	r1, .L117+44
	ldr	r2, [fp, #-348]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #260
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-352]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L102:
	ldr	r3, [fp, #-348]
	add	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldrb	r3, [r3, #-12]	@ zero_extendqisi2
	str	r3, [fp, #-308]
	ldr	r3, [fp, #-348]
	and	r3, r3, #255
	mov	r1, r3
	ldr	r0, .L117+84
	bl	get_channel_bitmask_state
	mov	r3, r0
	cmp	r3, #0
	beq	.L103
	ldr	r3, [fp, #-308]
	cmp	r3, #0
	ble	.L103
	ldr	r2, [fp, #-308]
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #5
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-200]
	ldr	r2, [fp, #-348]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, #264
	ldr	r2, .L117+44
	add	r3, r3, r2
	mov	r2, r3
	mov	r3, #0
	ldr	r1, [fp, #-352]
	lsl	r1, r1, #5
	sub	r0, fp, #12
	add	r1, r0, r1
	sub	r1, r1, #208
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-352]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L103:
	ldr	r3, [fp, #-348]
	add	r3, r3, #1
	str	r3, [fp, #-348]
.L101:
	ldr	r3, [fp, #-348]
	cmp	r3, #2
	ble	.L104
	ldr	r3, [fp, #-352]
	cmp	r3, #0
	beq	.L113
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #5
	cmp	r3, #16384
	bcs	.L106
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #5
	b	.L107
.L106:
	mov	r3, #0
.L107:
	lsl	r3, r3, #16
	orr	r3, r3, #1073741824
	orr	r3, r3, #27392
	sub	r2, fp, #228
	mov	r1, r3
	ldr	r0, [fp, #-340]
	bl	ioctl
	str	r0, [fp, #-320]
	ldr	r3, [fp, #-320]
	cmp	r3, #0
	bge	.L108
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L117+148
	mov	r0, #2
	bl	syslog
	mov	r0, #1
	bl	exit
.L108:
	mov	r3, #0
	str	r3, [fp, #-344]
	b	.L109
.L112:
	ldr	r3, [fp, #-344]
	add	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldrb	r3, [r3, #-12]	@ zero_extendqisi2
	str	r3, [fp, #-316]
	ldr	r3, [fp, #-344]
	and	r3, r3, #255
	mov	r1, r3
	ldr	r0, .L117+84
	bl	get_channel_bitmask_state
	mov	r3, r0
	cmp	r3, #0
	beq	.L110
	ldr	r3, [fp, #-316]
	cmp	r3, #0
	ble	.L110
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	ldr	r2, .L117+48
	ldr	r0, [r2, r3, lsl #3]
	ldr	r2, [fp, #-344]
	mov	r3, r2
	lsl	r3, r3, #6
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, #264
	ldr	r2, .L117+44
	add	r3, r3, r2
	ldr	r2, [fp, #-316]
	mov	r1, r3
	bl	write
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L111
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-344]
	ldr	r1, .L117+152
	mov	r0, #3
	bl	syslog
.L111:
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	ldr	r2, .L117+48
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r3, r3, #4
	ldrsh	r2, [r3]
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	orr	r2, r2, #4
	lsl	r2, r2, #16
	asr	r2, r2, #16
	ldr	r1, .L117+48
	lsl	r3, r3, #3
	add	r3, r1, r3
	add	r3, r3, #4
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-344]
	and	r3, r3, #255
	mov	r2, #0
	mov	r1, r3
	ldr	r0, .L117+84
	bl	set_channel_bitmask_state
.L110:
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	str	r3, [fp, #-344]
.L109:
	ldr	r3, [fp, #-344]
	cmp	r3, #2
	ble	.L112
	b	.L113
.L116:
	nop
	b	.L113
.L118:
	.align	2
.L117:
	.word	.LC42
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	1560
	.word	channels
	.word	fds
	.word	.LC24
	.word	.LC13
	.word	.LC25
	.word	.LC26
	.word	usbd_sock_addr
	.word	.LC28
	.word	.LC27
	.word	usbd_sock_addr+2
	.word	channels_writable_bitmask
	.word	channels_opened_bitmask
	.word	channels_enabled_bitmask
	.word	5000
	.word	.LC29
	.word	.LC30
	.word	.LC31
	.word	.LC32
	.word	.LC33
	.word	.LC34
	.word	.LC35
	.word	1077963520
	.word	.LC36
	.word	.LC37
	.word	.LC38
	.word	.LC39
	.word	.LC40
	.word	.LC41
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
