	.file	"167329845.c"
	.intel_syntax noprefix
	.text
	.globl	pktNum
	.bss
	.align 4
	.type	pktNum, @object
	.size	pktNum, 4
pktNum:
	.zero	4
	.globl	pktNumMutex
	.align 32
	.type	pktNumMutex, @object
	.size	pktNumMutex, 40
pktNumMutex:
	.zero	40
	.globl	actionMutex
	.align 32
	.type	actionMutex, @object
	.size	actionMutex, 40
actionMutex:
	.zero	40
	.globl	rewardMusicMutex
	.align 32
	.type	rewardMusicMutex, @object
	.size	rewardMusicMutex, 40
rewardMusicMutex:
	.zero	40
	.globl	action
	.align 4
	.type	action, @object
	.size	action, 4
action:
	.zero	4
	.globl	lastPktTime
	.align 16
	.type	lastPktTime, @object
	.size	lastPktTime, 16
lastPktTime:
	.zero	16
	.globl	rewardMusic
	.align 4
	.type	rewardMusic, @object
	.size	rewardMusic, 4
rewardMusic:
	.zero	4
	.globl	fd
	.align 4
	.type	fd, @object
	.size	fd, 4
fd:
	.zero	4
	.globl	packet
	.align 16
	.type	packet, @object
	.size	packet, 20
packet:
	.zero	20
	.globl	sCliffL
	.align 32
	.type	sCliffL, @object
	.size	sCliffL, 2000
sCliffL:
	.zero	2000
	.globl	sCliffR
	.align 32
	.type	sCliffR, @object
	.size	sCliffR, 2000
sCliffR:
	.zero	2000
	.globl	sCliffFL
	.align 32
	.type	sCliffFL, @object
	.size	sCliffFL, 2000
sCliffFL:
	.zero	2000
	.globl	sCliffFR
	.align 32
	.type	sCliffFR, @object
	.size	sCliffFR, 2000
sCliffFR:
	.zero	2000
	.globl	sCliffLB
	.align 32
	.type	sCliffLB, @object
	.size	sCliffLB, 1000
sCliffLB:
	.zero	1000
	.globl	sCliffRB
	.align 32
	.type	sCliffRB, @object
	.size	sCliffRB, 1000
sCliffRB:
	.zero	1000
	.globl	sCliffFLB
	.align 32
	.type	sCliffFLB, @object
	.size	sCliffFLB, 1000
sCliffFLB:
	.zero	1000
	.globl	sCliffFRB
	.align 32
	.type	sCliffFRB, @object
	.size	sCliffFRB, 1000
sCliffFRB:
	.zero	1000
	.globl	sDistance
	.align 32
	.type	sDistance, @object
	.size	sDistance, 2000
sDistance:
	.zero	2000
	.globl	sDeltaT
	.align 32
	.type	sDeltaT, @object
	.size	sDeltaT, 8000
sDeltaT:
	.zero	8000
	.globl	sIRbyte
	.align 32
	.type	sIRbyte, @object
	.size	sIRbyte, 1000
sIRbyte:
	.zero	1000
	.globl	sDrive
	.align 32
	.type	sDrive, @object
	.size	sDrive, 1000
sDrive:
	.zero	1000
	.globl	cliffThresholds
	.align 16
	.type	cliffThresholds, @object
	.size	cliffThresholds, 16
cliffThresholds:
	.zero	16
	.globl	cliffHighValue
	.align 4
	.type	cliffHighValue, @object
	.size	cliffHighValue, 4
cliffHighValue:
	.zero	4
	.section	.rodata
	.align 8
.LC4:
	.string	"Portname argument required -- something like /dev/tty.usbserial\n"
.LC5:
	.string	"\ncan't create thread: [%s]"
	.align 8
.LC11:
	.string	"Time for iteration (in microseconds): %ld\n"
	.align 8
.LC12:
	.string	"This iteration took too long!\n"
.LC13:
	.string	"Buffer overflow!\n"
	.align 8
.LC14:
	.string	"deltaT: %f cliff sensors: %u(%u) %u(%u) %u(%u) %u(%u) distance: %hd\n"
.LC16:
	.string	"s a r s' a':%d %d %d %d %d\n"
	.align 8
.LC17:
	.string	"Action values for state %d: %f %f %f %f\n"
	.align 8
.LC18:
	.string	"Eligibility traces for state %d: %f %f %f %f\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 1536
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	DWORD PTR -1540[rbp], edi
	mov	QWORD PTR -1552[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	movsd	xmm0, QWORD PTR .LC0[rip]
	movsd	QWORD PTR -1472[rbp], xmm0
	movsd	xmm0, QWORD PTR .LC1[rip]
	movsd	QWORD PTR -1464[rbp], xmm0
	movsd	xmm0, QWORD PTR .LC2[rip]
	movsd	QWORD PTR -1456[rbp], xmm0
	movsd	xmm0, QWORD PTR .LC3[rip]
	movsd	QWORD PTR -1448[rbp], xmm0
	lea	rax, endProgram[rip]
	mov	QWORD PTR -1376[rbp], rax
	lea	rax, -1376[rbp]
	add	rax, 8
	mov	rdi, rax
	call	sigemptyset@PLT
	mov	DWORD PTR -1240[rbp], 0
	lea	rdx, -1216[rbp]
	lea	rax, -1376[rbp]
	mov	rsi, rax
	mov	edi, 2
	call	sigaction@PLT
	cmp	DWORD PTR -1540[rbp], 1
	jg	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 64
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L24
	jmp	.L25
.L2:
	mov	eax, 0
	call	loadCliffThresholds
	mov	edi, 0
	call	srand@PLT
	mov	esi, 0
	lea	rdi, pktNumMutex[rip]
	call	pthread_mutex_init@PLT
	mov	esi, 0
	lea	rdi, actionMutex[rip]
	call	pthread_mutex_init@PLT
	mov	esi, 0
	lea	rdi, rewardMusicMutex[rip]
	call	pthread_mutex_init@PLT
	mov	rax, QWORD PTR -1552[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	setupSerialPort
	mov	edi, 20000
	call	usleep@PLT
	lea	rax, -1480[rbp]
	mov	ecx, 0
	lea	rdx, csp3[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -1500[rbp], eax
	cmp	DWORD PTR -1500[rbp], 0
	je	.L4
	mov	eax, DWORD PTR -1500[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	DWORD PTR -1532[rbp], 0
	mov	DWORD PTR -1512[rbp], 0
	jmp	.L5
.L8:
	mov	DWORD PTR -1508[rbp], 0
	jmp	.L6
.L7:
	call	rand@PLT
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm1, QWORD PTR .LC6[rip]
	divsd	xmm0, xmm1
	movsd	xmm2, QWORD PTR .LC7[rip]
	movapd	xmm1, xmm0
	subsd	xmm1, xmm2
	movsd	xmm0, QWORD PTR .LC8[rip]
	mulsd	xmm1, xmm0
	movsd	xmm0, QWORD PTR .LC9[rip]
	addsd	xmm0, xmm1
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	QWORD PTR -1056[rbp+rax*8], xmm0
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	pxor	xmm0, xmm0
	movsd	QWORD PTR -544[rbp+rax*8], xmm0
	add	DWORD PTR -1508[rbp], 1
.L6:
	cmp	DWORD PTR -1508[rbp], 3
	jle	.L7
	add	DWORD PTR -1512[rbp], 1
.L5:
	cmp	DWORD PTR -1512[rbp], 15
	jle	.L8
	lea	rax, -1424[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	eax, 0
	call	getPktNum
	mov	DWORD PTR -1496[rbp], eax
	mov	eax, DWORD PTR -1496[rbp]
	lea	edx, 999[rax]
	mov	eax, edx
	imul	rax, rax, 274877907
	shr	rax, 32
	shr	eax, 6
	imul	ecx, eax, 1000
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -1492[rbp], eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	lea	ecx, 0[0+rax*8]
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffFLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	sal	eax, 2
	or	ecx, eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffFRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	add	eax, eax
	or	ecx, eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	or	eax, ecx
	mov	DWORD PTR -1520[rbp], eax
	mov	rcx, QWORD PTR -1448[rbp]
	mov	edx, DWORD PTR -1520[rbp]
	lea	rax, -1056[rbp]
	movq	xmm0, rcx
	mov	esi, edx
	mov	rdi, rax
	call	epsilonGreedy
	mov	DWORD PTR -1524[rbp], eax
	lea	rdi, actionMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -1524[rbp]
	mov	DWORD PTR action[rip], eax
	lea	rdi, actionMutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -1496[rbp]
	mov	DWORD PTR -1532[rbp], eax
	mov	DWORD PTR -1504[rbp], 0
.L23:
	lea	rax, -1408[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -1408[rbp]
	mov	rdx, QWORD PTR -1424[rbp]
	sub	rax, rdx
	imul	rdx, rax, 1000000
	mov	rax, QWORD PTR -1400[rbp]
	mov	rcx, QWORD PTR -1416[rbp]
	sub	rax, rcx
	add	rax, rdx
	mov	QWORD PTR -1440[rbp], rax
	mov	rax, QWORD PTR -1440[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 100000
	sub	rax, QWORD PTR -1440[rbp]
	test	rax, rax
	jle	.L9
	mov	rax, QWORD PTR -1440[rbp]
	mov	edx, eax
	mov	eax, 100000
	sub	eax, edx
	mov	edi, eax
	call	usleep@PLT
	jmp	.L10
.L9:
	lea	rdi, .LC12[rip]
	call	puts@PLT
.L10:
	mov	QWORD PTR -1392[rbp], 0
	mov	QWORD PTR -1384[rbp], 100000
	mov	rdx, QWORD PTR -1424[rbp]
	mov	rax, QWORD PTR -1392[rbp]
	add	rax, rdx
	mov	QWORD PTR -1424[rbp], rax
	mov	rdx, QWORD PTR -1416[rbp]
	mov	rax, QWORD PTR -1384[rbp]
	add	rax, rdx
	mov	QWORD PTR -1416[rbp], rax
	mov	rax, QWORD PTR -1416[rbp]
	cmp	rax, 999999
	jle	.L11
	mov	rax, QWORD PTR -1424[rbp]
	add	rax, 1
	mov	QWORD PTR -1424[rbp], rax
	mov	rax, QWORD PTR -1416[rbp]
	sub	rax, 1000000
	mov	QWORD PTR -1416[rbp], rax
.L11:
	mov	eax, 0
	call	getPktNum
	mov	DWORD PTR -1496[rbp], eax
	mov	eax, DWORD PTR -1496[rbp]
	sub	eax, DWORD PTR -1532[rbp]
	cmp	eax, 1000
	jbe	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC13[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	DWORD PTR -1516[rbp], 0
	mov	eax, DWORD PTR -1532[rbp]
	mov	DWORD PTR -1528[rbp], eax
	jmp	.L13
.L15:
	mov	eax, DWORD PTR -1528[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 274877907
	shr	rdx, 32
	sar	edx, 6
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	edx, edx, 1000
	sub	eax, edx
	mov	DWORD PTR -1492[rbp], eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sDistance[rip]
	movzx	eax, WORD PTR [rdx+rax]
	cwde
	add	DWORD PTR -1516[rbp], eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sDistance[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movsx	r10d, ax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	r9d, al
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffR[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	r8d, ax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffFRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	edi, al
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffFR[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	r12d, ax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffFLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	ebx, al
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffFL[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	ecx, ax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	edx, al
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rsi, [rax+rax]
	lea	rax, sCliffL[rip]
	movzx	eax, WORD PTR [rsi+rax]
	movzx	esi, ax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	r11, 0[0+rax*8]
	lea	rax, sDeltaT[rip]
	mov	rax, QWORD PTR [r11+rax]
	push	r10
	push	r9
	push	r8
	push	rdi
	mov	r9d, r12d
	mov	r8d, ebx
	movq	xmm0, rax
	lea	rdi, .LC14[rip]
	mov	eax, 1
	call	printf@PLT
	add	rsp, 32
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sIRbyte[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	cmp	al, -119
	jne	.L14
	mov	eax, 0
	call	endProgram
.L14:
	add	DWORD PTR -1528[rbp], 1
.L13:
	mov	eax, DWORD PTR -1528[rbp]
	cmp	DWORD PTR -1496[rbp], eax
	ja	.L15
	mov	eax, DWORD PTR -1516[rbp]
	add	DWORD PTR -1504[rbp], eax
	cmp	DWORD PTR -1504[rbp], 50
	jle	.L16
	lea	rdi, rewardMusicMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR rewardMusic[rip], 1
	lea	rdi, rewardMusicMutex[rip]
	call	pthread_mutex_unlock@PLT
	sub	DWORD PTR -1504[rbp], 50
.L16:
	mov	eax, DWORD PTR -1496[rbp]
	lea	edx, -1[rax]
	mov	eax, edx
	imul	rax, rax, 274877907
	shr	rax, 32
	shr	eax, 6
	imul	ecx, eax, 1000
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -1492[rbp], eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	lea	ecx, 0[0+rax*8]
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffFLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	sal	eax, 2
	or	ecx, eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffFRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	add	eax, eax
	or	ecx, eax
	mov	eax, DWORD PTR -1492[rbp]
	cdqe
	lea	rdx, sCliffRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	or	eax, ecx
	mov	DWORD PTR -1488[rbp], eax
	mov	rcx, QWORD PTR -1448[rbp]
	mov	edx, DWORD PTR -1488[rbp]
	lea	rax, -1056[rbp]
	movq	xmm0, rcx
	mov	esi, edx
	mov	rdi, rax
	call	epsilonGreedy
	mov	DWORD PTR -1484[rbp], eax
	lea	rdi, actionMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -1484[rbp]
	mov	DWORD PTR action[rip], eax
	lea	rdi, actionMutex[rip]
	call	pthread_mutex_unlock@PLT
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, DWORD PTR -1516[rbp]
	mov	eax, DWORD PTR -1484[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1488[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	xmm0, QWORD PTR -1056[rbp+rax*8]
	mulsd	xmm0, QWORD PTR -1456[rbp]
	addsd	xmm0, xmm1
	mov	eax, DWORD PTR -1524[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1520[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	xmm1, QWORD PTR -1056[rbp+rax*8]
	subsd	xmm0, xmm1
	movsd	QWORD PTR -1432[rbp], xmm0
	mov	DWORD PTR -1508[rbp], 0
	jmp	.L17
.L18:
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1520[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	pxor	xmm0, xmm0
	movsd	QWORD PTR -544[rbp+rax*8], xmm0
	add	DWORD PTR -1508[rbp], 1
.L17:
	cmp	DWORD PTR -1508[rbp], 3
	jle	.L18
	mov	eax, DWORD PTR -1524[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1520[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	xmm0, QWORD PTR .LC15[rip]
	movsd	QWORD PTR -544[rbp+rax*8], xmm0
	mov	edi, DWORD PTR -1484[rbp]
	mov	esi, DWORD PTR -1488[rbp]
	mov	ecx, DWORD PTR -1516[rbp]
	mov	edx, DWORD PTR -1524[rbp]
	mov	eax, DWORD PTR -1520[rbp]
	mov	r9d, edi
	mov	r8d, esi
	mov	esi, eax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -1512[rbp], 0
	jmp	.L19
.L22:
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 1016
	movsd	xmm2, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 1024
	movsd	xmm1, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 1032
	movsd	xmm0, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 1040
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	movapd	xmm3, xmm2
	movapd	xmm2, xmm1
	movapd	xmm1, xmm0
	movq	xmm0, rdx
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 4
	call	printf@PLT
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 504
	movsd	xmm2, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 512
	movsd	xmm1, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 520
	movsd	xmm0, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 5
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 528
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -1512[rbp]
	movapd	xmm3, xmm2
	movapd	xmm2, xmm1
	movapd	xmm1, xmm0
	movq	xmm0, rdx
	mov	esi, eax
	lea	rdi, .LC18[rip]
	mov	eax, 4
	call	printf@PLT
	mov	DWORD PTR -1508[rbp], 0
	jmp	.L20
.L21:
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	xmm1, QWORD PTR -1056[rbp+rax*8]
	movsd	xmm0, QWORD PTR -1472[rbp]
	movapd	xmm2, xmm0
	mulsd	xmm2, QWORD PTR -1432[rbp]
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	xmm0, QWORD PTR -544[rbp+rax*8]
	mulsd	xmm0, xmm2
	addsd	xmm0, xmm1
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	QWORD PTR -1056[rbp+rax*8], xmm0
	movsd	xmm0, QWORD PTR -1456[rbp]
	movapd	xmm1, xmm0
	mulsd	xmm1, QWORD PTR -1464[rbp]
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	xmm0, QWORD PTR -544[rbp+rax*8]
	mulsd	xmm0, xmm1
	mov	eax, DWORD PTR -1508[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1512[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	movsd	QWORD PTR -544[rbp+rax*8], xmm0
	add	DWORD PTR -1508[rbp], 1
.L20:
	cmp	DWORD PTR -1508[rbp], 3
	jle	.L21
	add	DWORD PTR -1512[rbp], 1
.L19:
	cmp	DWORD PTR -1512[rbp], 15
	jle	.L22
	mov	eax, DWORD PTR -1488[rbp]
	mov	DWORD PTR -1520[rbp], eax
	mov	eax, DWORD PTR -1484[rbp]
	mov	DWORD PTR -1524[rbp], eax
	mov	eax, DWORD PTR -1496[rbp]
	mov	DWORD PTR -1532[rbp], eax
	jmp	.L23
.L25:
	call	__stack_chk_fail@PLT
.L24:
	lea	rsp, -16[rbp]
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	getPktNum
	.type	getPktNum, @function
getPktNum:
.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
	lea	rdi, pktNumMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR pktNum[rip]
	mov	DWORD PTR -4[rbp], eax
	lea	rdi, pktNumMutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	getPktNum, .-getPktNum
	.section	.rodata
.LC19:
	.string	"r"
.LC20:
	.string	"cliffThresholds.dat"
	.align 8
.LC21:
	.string	"Error opening cliffThresholds.dat file: %s\n"
.LC22:
	.string	"%d%d%d%d%d"
	.text
	.globl	loadCliffThresholds
	.type	loadCliffThresholds, @function
loadCliffThresholds:
.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
	lea	rsi, .LC19[rip]
	lea	rdi, .LC20[rip]
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L29
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC21[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L29:
	mov	rax, QWORD PTR -8[rbp]
	sub	rsp, 8
	lea	rdx, cliffThresholds[rip+12]
	push	rdx
	lea	r9, cliffThresholds[rip+8]
	lea	r8, cliffThresholds[rip+4]
	lea	rcx, cliffThresholds[rip]
	lea	rdx, cliffHighValue[rip]
	lea	rsi, .LC22[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	add	rsp, 16
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	loadCliffThresholds, .-loadCliffThresholds
	.section	.rodata
.LC24:
	.string	"random action\n"
	.text
	.globl	epsilonGreedy
	.type	epsilonGreedy, @function
epsilonGreedy:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	movsd	QWORD PTR -56[rbp], xmm0
	mov	eax, 0
	call	getPktNum
	add	eax, 999
	movsx	rdx, eax
	imul	rdx, rdx, 274877907
	shr	rdx, 32
	sar	edx, 6
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	DWORD PTR -8[rbp], edx
	mov	edx, DWORD PTR -8[rbp]
	imul	edx, edx, 1000
	sub	eax, edx
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, sCliffFLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L31
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, sCliffFRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	je	.L32
.L31:
	mov	eax, 1
	jmp	.L33
.L32:
	mov	eax, 0
.L33:
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, sCliffLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L34
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, sCliffRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	je	.L35
.L34:
	mov	DWORD PTR -12[rbp], 2
	jmp	.L36
.L35:
	mov	DWORD PTR -12[rbp], 3
.L36:
	call	rand@PLT
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm2, QWORD PTR .LC23[rip]
	movapd	xmm1, xmm0
	divsd	xmm1, xmm2
	movsd	xmm0, QWORD PTR -56[rbp]
	comisd	xmm0, xmm1
	jbe	.L46
	lea	rdi, .LC24[rip]
	call	puts@PLT
	call	rand@PLT
	mov	edx, DWORD PTR -12[rbp]
	add	edx, 1
	mov	ecx, edx
	sub	ecx, DWORD PTR -4[rbp]
	cdq
	idiv	ecx
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	jmp	.L39
.L46:
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR -16[rbp], eax
	jmp	.L40
.L43:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	movsd	xmm0, QWORD PTR [rdx+rax*8]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	movsd	xmm1, QWORD PTR [rdx+rax*8]
	comisd	xmm0, xmm1
	jbe	.L41
	mov	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR -20[rbp], eax
.L41:
	add	DWORD PTR -16[rbp], 1
.L40:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -12[rbp]
	jl	.L43
	mov	eax, DWORD PTR -20[rbp]
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	epsilonGreedy, .-epsilonGreedy
	.section	.rodata
.LC25:
	.string	"Bad action"
	.text
	.globl	takeAction
	.type	takeAction, @function
takeAction:
.LFB10:
	.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], edi
	cmp	DWORD PTR -4[rbp], 4
	ja	.L48
	mov	eax, DWORD PTR -4[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, .L50[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L50[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L50:
	.long	.L54-.L50
	.long	.L53-.L50
	.long	.L52-.L50
	.long	.L51-.L50
	.long	.L49-.L50
	.text
.L54:
	mov	esi, 300
	mov	edi, 300
	call	driveWheels
	jmp	.L55
.L53:
	mov	esi, 300
	mov	edi, -300
	call	driveWheels
	jmp	.L55
.L52:
	mov	esi, -300
	mov	edi, 300
	call	driveWheels
	jmp	.L55
.L51:
	mov	esi, -300
	mov	edi, -300
	call	driveWheels
	jmp	.L55
.L49:
	mov	esi, 0
	mov	edi, 0
	call	driveWheels
	jmp	.L55
.L48:
	lea	rdi, .LC25[rip]
	call	puts@PLT
	nop
.L55:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	takeAction, .-takeAction
	.section	.rodata
.LC26:
	.string	"Ending Program"
	.text
	.globl	endProgram
	.type	endProgram, @function
endProgram:
.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC26[rip]
	call	puts@PLT
	mov	esi, 0
	mov	edi, 0
	call	driveWheels
	mov	BYTE PTR -10[rbp], -106
	mov	BYTE PTR -9[rbp], 0
	lea	rax, -10[rbp]
	mov	esi, 2
	mov	rdi, rax
	call	sendBytesToRobot
	mov	eax, DWORD PTR fd[rip]
	mov	edi, eax
	call	tcdrain@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE11:
	.size	endProgram, .-endProgram
	.section	.rodata
.LC27:
	.string	"Problem with write(): %s\n"
	.text
	.globl	sendBytesToRobot
	.type	sendBytesToRobot, @function
sendBytesToRobot:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR fd[rip]
	mov	rcx, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L60
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC27[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L60:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	sendBytesToRobot, .-sendBytesToRobot
	.section	.rodata
.LC28:
	.string	"Problem with tcdrain(): %s\n"
	.text
	.globl	ensureTransmitted
	.type	ensureTransmitted, @function
ensureTransmitted:
.LFB13:
	.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, DWORD PTR fd[rip]
	mov	edi, eax
	call	tcdrain@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L63
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC28[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L63:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	ensureTransmitted, .-ensureTransmitted
	.globl	driveWheels
	.type	driveWheels, @function
driveWheels:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, 500
	cmp	DWORD PTR -20[rbp], 500
	cmovle	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, -500
	cmp	DWORD PTR -20[rbp], -500
	cmovge	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, 500
	cmp	DWORD PTR -24[rbp], 500
	cmovle	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, -500
	cmp	DWORD PTR -24[rbp], -500
	cmovge	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -24[rbp], eax
	mov	BYTE PTR -13[rbp], -111
	mov	eax, DWORD PTR -24[rbp]
	sar	eax, 8
	mov	BYTE PTR -12[rbp], al
	mov	eax, DWORD PTR -24[rbp]
	mov	BYTE PTR -11[rbp], al
	mov	eax, DWORD PTR -20[rbp]
	sar	eax, 8
	mov	BYTE PTR -10[rbp], al
	mov	eax, DWORD PTR -20[rbp]
	mov	BYTE PTR -9[rbp], al
	lea	rax, -13[rbp]
	mov	esi, 5
	mov	rdi, rax
	call	sendBytesToRobot
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L65
	call	__stack_chk_fail@PLT
.L65:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	driveWheels, .-driveWheels
	.section	.rodata
	.align 8
.LC29:
	.string	"Serial port at %s could not be opened: %s\n"
	.text
	.globl	setupSerialPort
	.type	setupSerialPort, @function
setupSerialPort:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 112
	mov	QWORD PTR -104[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -104[rbp]
	mov	esi, 2306
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd[rip], eax
	mov	eax, DWORD PTR fd[rip]
	cmp	eax, -1
	jne	.L67
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -104[rbp]
	lea	rsi, .LC29[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L67:
	mov	eax, DWORD PTR fd[rip]
	mov	esi, 2
	mov	edi, eax
	call	tcflush@PLT
	mov	eax, DWORD PTR fd[rip]
	lea	rdx, -80[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	mov	DWORD PTR -80[rbp], 5
	mov	DWORD PTR -68[rbp], 0
	mov	DWORD PTR -76[rbp], 0
	mov	DWORD PTR -72[rbp], 2224
	lea	rax, -80[rbp]
	mov	esi, 4097
	mov	rdi, rax
	call	cfsetispeed@PLT
	lea	rax, -80[rbp]
	mov	esi, 4097
	mov	rdi, rax
	call	cfsetospeed@PLT
	mov	eax, DWORD PTR fd[rip]
	lea	rdx, -80[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	mov	BYTE PTR -81[rbp], -128
	lea	rax, -81[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	sendBytesToRobot
	mov	BYTE PTR -81[rbp], -124
	lea	rax, -81[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	sendBytesToRobot
	mov	BYTE PTR -16[rbp], -108
	mov	BYTE PTR -15[rbp], 6
	mov	BYTE PTR -14[rbp], 28
	mov	BYTE PTR -13[rbp], 29
	mov	BYTE PTR -12[rbp], 30
	mov	BYTE PTR -11[rbp], 31
	mov	BYTE PTR -10[rbp], 19
	mov	BYTE PTR -9[rbp], 17
	lea	rax, -16[rbp]
	mov	esi, 8
	mov	rdi, rax
	call	sendBytesToRobot
	mov	BYTE PTR -16[rbp], -116
	mov	BYTE PTR -15[rbp], 0
	mov	BYTE PTR -14[rbp], 1
	mov	BYTE PTR -13[rbp], 100
	mov	BYTE PTR -12[rbp], 6
	lea	rax, -16[rbp]
	mov	esi, 5
	mov	rdi, rax
	call	sendBytesToRobot
	mov	eax, 0
	call	ensureTransmitted
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	setupSerialPort, .-setupSerialPort
	.globl	checkPacket
	.type	checkPacket, @function
checkPacket:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	movzx	eax, BYTE PTR packet[rip]
	cmp	al, 19
	jne	.L70
	movzx	eax, BYTE PTR packet[rip+1]
	cmp	al, 17
	jne	.L70
	movzx	eax, BYTE PTR packet[rip+2]
	cmp	al, 28
	jne	.L70
	movzx	eax, BYTE PTR packet[rip+5]
	cmp	al, 29
	jne	.L70
	movzx	eax, BYTE PTR packet[rip+8]
	cmp	al, 30
	jne	.L70
	movzx	eax, BYTE PTR packet[rip+11]
	cmp	al, 31
	jne	.L70
	movzx	eax, BYTE PTR packet[rip+14]
	cmp	al, 19
	jne	.L70
	movzx	eax, BYTE PTR packet[rip+17]
	cmp	al, 17
	jne	.L70
	mov	DWORD PTR -4[rbp], 0
	mov	DWORD PTR -8[rbp], 0
	jmp	.L71
.L72:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, packet[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	add	DWORD PTR -4[rbp], eax
	add	DWORD PTR -8[rbp], 1
.L71:
	cmp	DWORD PTR -8[rbp], 19
	jle	.L72
	mov	eax, DWORD PTR -4[rbp]
	movzx	eax, al
	test	eax, eax
	jne	.L70
	mov	eax, 1
	jmp	.L73
.L70:
	mov	eax, 0
.L73:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	checkPacket, .-checkPacket
	.globl	extractPacket
	.type	extractPacket, @function
extractPacket:
.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, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, DWORD PTR pktNum[rip]
	mov	eax, edx
	imul	rax, rax, 274877907
	shr	rax, 32
	shr	eax, 6
	imul	ecx, eax, 1000
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -36[rbp], eax
	movzx	eax, BYTE PTR packet[rip+3]
	movzx	eax, al
	sal	eax, 8
	mov	edx, eax
	movzx	eax, BYTE PTR packet[rip+4]
	movzx	eax, al
	or	eax, edx
	mov	ecx, eax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffL[rip]
	mov	WORD PTR [rdx+rax], cx
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffL[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	edx, ax
	mov	eax, DWORD PTR cliffThresholds[rip]
	cmp	edx, eax
	jg	.L75
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	ecx, eax
	mov	eax, 1
	sub	eax, ecx
	mov	edx, eax
	jmp	.L76
.L75:
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	edx, eax
.L76:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rcx, sCliffLB[rip]
	mov	BYTE PTR [rax+rcx], dl
	movzx	eax, BYTE PTR packet[rip+6]
	movzx	eax, al
	sal	eax, 8
	mov	edx, eax
	movzx	eax, BYTE PTR packet[rip+7]
	movzx	eax, al
	or	eax, edx
	mov	ecx, eax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffFL[rip]
	mov	WORD PTR [rdx+rax], cx
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffFL[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	edx, ax
	mov	eax, DWORD PTR cliffThresholds[rip+4]
	cmp	edx, eax
	jg	.L77
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	ecx, eax
	mov	eax, 1
	sub	eax, ecx
	mov	edx, eax
	jmp	.L78
.L77:
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	edx, eax
.L78:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rcx, sCliffFLB[rip]
	mov	BYTE PTR [rax+rcx], dl
	movzx	eax, BYTE PTR packet[rip+9]
	movzx	eax, al
	sal	eax, 8
	mov	edx, eax
	movzx	eax, BYTE PTR packet[rip+10]
	movzx	eax, al
	or	eax, edx
	mov	ecx, eax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffFR[rip]
	mov	WORD PTR [rdx+rax], cx
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffFR[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	edx, ax
	mov	eax, DWORD PTR cliffThresholds[rip+8]
	cmp	edx, eax
	jg	.L79
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	ecx, eax
	mov	eax, 1
	sub	eax, ecx
	mov	edx, eax
	jmp	.L80
.L79:
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	edx, eax
.L80:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rcx, sCliffFRB[rip]
	mov	BYTE PTR [rax+rcx], dl
	movzx	eax, BYTE PTR packet[rip+12]
	movzx	eax, al
	sal	eax, 8
	mov	edx, eax
	movzx	eax, BYTE PTR packet[rip+13]
	movzx	eax, al
	or	eax, edx
	mov	ecx, eax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffR[rip]
	mov	WORD PTR [rdx+rax], cx
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sCliffR[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	edx, ax
	mov	eax, DWORD PTR cliffThresholds[rip+12]
	cmp	edx, eax
	jg	.L81
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	ecx, eax
	mov	eax, 1
	sub	eax, ecx
	mov	edx, eax
	jmp	.L82
.L81:
	mov	eax, DWORD PTR cliffHighValue[rip]
	mov	edx, eax
.L82:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rcx, sCliffRB[rip]
	mov	BYTE PTR [rax+rcx], dl
	movzx	eax, BYTE PTR packet[rip+15]
	movzx	eax, al
	sal	eax, 8
	mov	edx, eax
	movzx	eax, BYTE PTR packet[rip+16]
	movzx	eax, al
	mov	ecx, edx
	or	ecx, eax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, sDistance[rip]
	mov	WORD PTR [rdx+rax], cx
	movzx	edx, BYTE PTR packet[rip+18]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rcx, sIRbyte[rip]
	mov	BYTE PTR [rax+rcx], dl
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR lastPktTime[rip]
	sub	rax, rdx
	imul	rax, rax, 1000
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rax
	mov	rax, QWORD PTR -24[rbp]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	mov	rax, QWORD PTR lastPktTime[rip+8]
	pxor	xmm2, xmm2
	cvtsi2sd	xmm2, rax
	subsd	xmm0, xmm2
	movsd	xmm2, QWORD PTR .LC30[rip]
	divsd	xmm0, xmm2
	addsd	xmm0, xmm1
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, sDeltaT[rip]
	movsd	QWORD PTR [rdx+rax], xmm0
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR lastPktTime[rip], rax
	mov	QWORD PTR lastPktTime[rip+8], rdx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L83
	call	__stack_chk_fail@PLT
.L83:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	extractPacket, .-extractPacket
	.section	.rodata
.LC31:
	.string	"Timed out at select()"
.LC32:
	.string	"Problem with select(): %s\n"
.LC33:
	.string	"Problem with read(): %s\n"
.LC34:
	.string	"misaligned packet."
	.text
	.globl	csp3
	.type	csp3, @function
csp3:
.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, 208
	mov	QWORD PTR -200[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -188[rbp], 0
	mov	esi, 0
	lea	rdi, lastPktTime[rip]
	call	gettimeofday@PLT
	mov	eax, DWORD PTR fd[rip]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -160[rbp+rax*8]
	mov	eax, DWORD PTR fd[rip]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -160[rbp+rax*8], rdx
.L94:
	mov	QWORD PTR -176[rbp], 2
	mov	QWORD PTR -168[rbp], 0
	mov	eax, DWORD PTR fd[rip]
	lea	edi, 1[rax]
	lea	rdx, -176[rbp]
	lea	rax, -160[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	mov	DWORD PTR -184[rbp], eax
	cmp	DWORD PTR -184[rbp], 0
	jne	.L85
	lea	rdi, .LC31[rip]
	call	puts@PLT
	jmp	.L86
.L85:
	cmp	DWORD PTR -184[rbp], -1
	jne	.L86
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC32[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L86:
	mov	eax, 20
	sub	eax, DWORD PTR -188[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR fd[rip]
	lea	rcx, -32[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -180[rbp], eax
	cmp	DWORD PTR -180[rbp], -1
	jne	.L87
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC33[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L87:
	mov	DWORD PTR -192[rbp], 0
	jmp	.L88
.L89:
	mov	edx, DWORD PTR -188[rbp]
	mov	eax, DWORD PTR -192[rbp]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -192[rbp]
	cdqe
	movzx	edx, BYTE PTR -32[rbp+rax]
	movsx	rax, ecx
	lea	rcx, packet[rip]
	mov	BYTE PTR [rax+rcx], dl
	add	DWORD PTR -192[rbp], 1
.L88:
	mov	eax, DWORD PTR -192[rbp]
	cmp	eax, DWORD PTR -180[rbp]
	jl	.L89
	mov	eax, DWORD PTR -180[rbp]
	add	DWORD PTR -188[rbp], eax
	cmp	DWORD PTR -188[rbp], 20
	jne	.L94
	mov	eax, 0
	call	checkPacket
	test	eax, eax
	je	.L91
	mov	eax, 0
	call	extractPacket
	mov	eax, 0
	call	reflexes
	mov	eax, 0
	call	ensureTransmitted
	lea	rdi, pktNumMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR pktNum[rip]
	add	eax, 1
	mov	DWORD PTR pktNum[rip], eax
	lea	rdi, pktNumMutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -188[rbp], 0
	jmp	.L94
.L91:
	lea	rdi, .LC34[rip]
	call	puts@PLT
	mov	DWORD PTR -192[rbp], 1
	jmp	.L92
.L93:
	mov	eax, DWORD PTR -192[rbp]
	lea	ecx, -1[rax]
	mov	eax, DWORD PTR -192[rbp]
	cdqe
	lea	rdx, packet[rip]
	movzx	edx, BYTE PTR [rax+rdx]
	movsx	rax, ecx
	lea	rcx, packet[rip]
	mov	BYTE PTR [rax+rcx], dl
	add	DWORD PTR -192[rbp], 1
.L92:
	cmp	DWORD PTR -192[rbp], 19
	jle	.L93
	sub	DWORD PTR -188[rbp], 1
	jmp	.L94
	.cfi_endproc
.LFE18:
	.size	csp3, .-csp3
	.globl	reflexes
	.type	reflexes, @function
reflexes:
.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, DWORD PTR pktNum[rip]
	mov	eax, edx
	imul	rax, rax, 274877907
	shr	rax, 32
	shr	eax, 6
	imul	ecx, eax, 1000
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -20[rbp], eax
	lea	rdi, actionMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR action[rip]
	mov	ecx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sDrive[rip]
	mov	BYTE PTR [rax+rdx], cl
	lea	rdi, actionMutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sDrive[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L97
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffFLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L98
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffFRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L98
.L97:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sDrive[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	cmp	al, 3
	jne	.L99
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L98
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	je	.L99
.L98:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sDrive[rip]
	mov	BYTE PTR [rax+rdx], 4
.L99:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sDrive[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	mov	edi, eax
	call	takeAction
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffFLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	jne	.L100
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffFRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	test	al, al
	je	.L101
.L100:
	mov	eax, 1
	jmp	.L102
.L101:
	mov	eax, 0
.L102:
	mov	BYTE PTR -22[rbp], al
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffLB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	sal	eax, 2
	mov	edx, eax
	movzx	eax, BYTE PTR -22[rbp]
	add	eax, eax
	mov	ecx, edx
	or	ecx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, sCliffRB[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	or	eax, ecx
	mov	BYTE PTR -21[rbp], al
	mov	BYTE PTR -10[rbp], -109
	movzx	eax, BYTE PTR -21[rbp]
	mov	BYTE PTR -9[rbp], al
	lea	rax, -10[rbp]
	mov	esi, 2
	mov	rdi, rax
	call	sendBytesToRobot
	lea	rdi, rewardMusicMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR rewardMusic[rip]
	mov	DWORD PTR -16[rbp], eax
	lea	rdi, rewardMusicMutex[rip]
	call	pthread_mutex_unlock@PLT
	cmp	DWORD PTR -16[rbp], 1
	jne	.L105
	mov	BYTE PTR -10[rbp], -115
	mov	BYTE PTR -9[rbp], 0
	lea	rax, -10[rbp]
	mov	esi, 2
	mov	rdi, rax
	call	sendBytesToRobot
	lea	rdi, rewardMusicMutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR rewardMusic[rip], 0
	lea	rdi, rewardMusicMutex[rip]
	call	pthread_mutex_unlock@PLT
.L105:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L104
	call	__stack_chk_fail@PLT
.L104:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE19:
	.size	reflexes, .-reflexes
	.section	.rodata
	.align 8
.LC0:
	.long	-1717986918
	.long	1069128089
	.align 8
.LC1:
	.long	-858993459
	.long	1072483532
	.align 8
.LC2:
	.long	-171798692
	.long	1072651304
	.align 8
.LC3:
	.long	1202590843
	.long	1065646817
	.align 8
.LC6:
	.long	-4194304
	.long	1105199103
	.align 8
.LC7:
	.long	0
	.long	1071644672
	.align 8
.LC8:
	.long	-755914244
	.long	1062232653
	.align 8
.LC9:
	.long	0
	.long	1075052544
	.align 8
.LC15:
	.long	0
	.long	1072693248
	.align 8
.LC23:
	.long	0
	.long	1105199104
	.align 8
.LC30:
	.long	0
	.long	1083129856
	.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	"167329845.c"
	.text
	.global	pktNum
	.bss
	.align	2
	.type	pktNum, %object
	.size	pktNum, 4
pktNum:
	.space	4
	.comm	pktNumMutex,24,4
	.comm	actionMutex,24,4
	.comm	rewardMusicMutex,24,4
	.global	action
	.align	2
	.type	action, %object
	.size	action, 4
action:
	.space	4
	.comm	lastPktTime,8,4
	.global	rewardMusic
	.align	2
	.type	rewardMusic, %object
	.size	rewardMusic, 4
rewardMusic:
	.space	4
	.global	fd
	.align	2
	.type	fd, %object
	.size	fd, 4
fd:
	.space	4
	.comm	packet,20,4
	.comm	sCliffL,2000,4
	.comm	sCliffR,2000,4
	.comm	sCliffFL,2000,4
	.comm	sCliffFR,2000,4
	.comm	sCliffLB,1000,4
	.comm	sCliffRB,1000,4
	.comm	sCliffFLB,1000,4
	.comm	sCliffFRB,1000,4
	.comm	sDistance,2000,4
	.comm	sDeltaT,8000,8
	.comm	sIRbyte,1000,4
	.comm	sDrive,1000,4
	.comm	cliffThresholds,16,4
	.comm	cliffHighValue,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Portname argument required -- something like /dev/t"
	.ascii	"ty.usbserial\012\000"
	.align	2
.LC1:
	.ascii	"\012can't create thread: [%s]\000"
	.global	__aeabi_i2d
	.global	__aeabi_ddiv
	.global	__aeabi_dsub
	.global	__aeabi_dmul
	.global	__aeabi_dadd
	.align	2
.LC2:
	.ascii	"Time for iteration (in microseconds): %ld\012\000"
	.align	2
.LC3:
	.ascii	"This iteration took too long!\012\000"
	.align	2
.LC4:
	.ascii	"Buffer overflow!\012\000"
	.align	2
.LC5:
	.ascii	"deltaT: %f cliff sensors: %u(%u) %u(%u) %u(%u) %u(%"
	.ascii	"u) distance: %hd\012\000"
	.align	2
.LC6:
	.ascii	"s a r s' a':%d %d %d %d %d\012\000"
	.align	2
.LC7:
	.ascii	"Action values for state %d: %f %f %f %f\012\000"
	.align	2
.LC8:
	.ascii	"Eligibility traces for state %d: %f %f %f %f\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1448
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #1488
	str	r0, [fp, #-1472]
	str	r1, [fp, #-1476]
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	ldr	r2, .L26+4
	ldr	r3, .L26+8
	str	r2, [fp, #-1404]
	str	r3, [fp, #-1400]
	ldr	r2, .L26+12
	ldr	r3, .L26+16
	str	r2, [fp, #-1396]
	str	r3, [fp, #-1392]
	ldr	r2, .L26+20
	ldr	r3, .L26+24
	str	r2, [fp, #-1388]
	str	r3, [fp, #-1384]
	ldr	r2, .L26+28
	ldr	r3, .L26+32
	str	r2, [fp, #-1380]
	str	r3, [fp, #-1376]
	ldr	r3, .L26+36
	str	r3, [fp, #-1340]
	sub	r3, fp, #1328
	sub	r3, r3, #12
	add	r3, r3, #4
	mov	r0, r3
	bl	sigemptyset
	mov	r3, #0
	str	r3, [fp, #-1208]
	sub	r3, fp, #1184
	sub	r3, r3, #12
	sub	r3, r3, #4
	sub	r1, fp, #1328
	sub	r1, r1, #12
	mov	r2, r3
	mov	r0, #2
	bl	sigaction
	ldr	r3, [fp, #-1472]
	cmp	r3, #1
	bgt	.L2
	ldr	r3, .L26+40
	ldr	r3, [r3]
	mov	r2, #64
	mov	r1, #1
	ldr	r0, .L26+44
	bl	fwrite
	mov	r3, #0
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-32]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	b	.L25
.L2:
	bl	loadCliffThresholds
	mov	r0, #0
	bl	srand
	mov	r1, #0
	ldr	r0, .L26+48
	bl	pthread_mutex_init
	mov	r1, #0
	ldr	r0, .L26+52
	bl	pthread_mutex_init
	mov	r1, #0
	ldr	r0, .L26+56
	bl	pthread_mutex_init
	ldr	r3, [fp, #-1476]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	setupSerialPort
	ldr	r0, .L26+60
	bl	usleep
	sub	r0, fp, #1440
	sub	r0, r0, #12
	sub	r0, r0, #12
	mov	r3, #0
	ldr	r2, .L26+64
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-1428]
	ldr	r3, [fp, #-1428]
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L26+40
	ldr	r4, [r3]
	ldr	r0, [fp, #-1428]
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L26+68
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L4:
	mov	r3, #0
	str	r3, [fp, #-1460]
	mov	r3, #0
	str	r3, [fp, #-1440]
	b	.L5
.L8:
	mov	r3, #0
	str	r3, [fp, #-1436]
	b	.L6
.L7:
	bl	rand
	mov	r3, r0
	mov	r0, r3
	bl	__aeabi_i2d
	ldr	r2, .L26+72
	ldr	r3, .L26+76
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L26+80
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r2, .L26+84
	ldr	r3, .L26+88
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L26+92
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #-1440]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1436]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #1024
	sub	r3, r3, #8
	stm	r3, {r0-r1}
	ldr	r3, [fp, #-1440]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1436]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r1, r3, #520
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-1436]
	add	r3, r3, #1
	str	r3, [fp, #-1436]
.L6:
	ldr	r3, [fp, #-1436]
	cmp	r3, #3
	ble	.L7
	ldr	r3, [fp, #-1440]
	add	r3, r3, #1
	str	r3, [fp, #-1440]
.L5:
	ldr	r3, [fp, #-1440]
	cmp	r3, #15
	ble	.L8
	sub	r3, fp, #1344
	sub	r3, r3, #12
	sub	r3, r3, #8
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	bl	getPktNum
	mov	r3, r0
	str	r3, [fp, #-1424]
	ldr	r3, [fp, #-1424]
	add	r1, r3, #996
	add	r1, r1, #3
	ldr	r3, .L26+96
	umull	r2, r3, r1, r3
	lsr	r2, r3, #6
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	str	r2, [fp, #-1420]
	ldr	r2, .L26+100
	ldr	r3, [fp, #-1420]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r2, r3, #3
	ldr	r1, .L26+104
	ldr	r3, [fp, #-1420]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #2
	orr	r2, r2, r3
	ldr	r1, .L26+108
	ldr	r3, [fp, #-1420]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #1
	orr	r3, r2, r3
	ldr	r1, .L26+112
	ldr	r2, [fp, #-1420]
	add	r2, r1, r2
	ldrb	r2, [r2]	@ zero_extendqisi2
	orr	r3, r3, r2
	str	r3, [fp, #-1448]
	sub	r0, fp, #1040
	sub	r0, r0, #12
	sub	r0, r0, #8
	ldr	r2, [fp, #-1380]
	ldr	r3, [fp, #-1376]
	ldr	r1, [fp, #-1448]
	bl	epsilonGreedy
	str	r0, [fp, #-1452]
	ldr	r0, .L26+52
	bl	pthread_mutex_lock
	ldr	r2, .L26+116
	ldr	r3, [fp, #-1452]
	str	r3, [r2]
	ldr	r0, .L26+52
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-1424]
	str	r3, [fp, #-1460]
	mov	r3, #0
	str	r3, [fp, #-1432]
.L23:
	sub	r3, fp, #1344
	sub	r3, r3, #12
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r2, [fp, #-1356]
	ldr	r3, [fp, #-1364]
	sub	r1, r2, r3
	mov	r2, r1
	lsl	r2, r2, #5
	sub	r2, r2, r1
	lsl	r3, r2, #6
	sub	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #6
	mov	r1, r3
	ldr	r2, [fp, #-1352]
	ldr	r3, [fp, #-1360]
	sub	r3, r2, r3
	add	r3, r1, r3
	str	r3, [fp, #-1416]
	ldr	r1, [fp, #-1416]
	ldr	r0, .L26+120
	bl	printf
	ldr	r3, [fp, #-1416]
	rsb	r3, r3, #99328
	add	r3, r3, #672
	cmp	r3, #0
	ble	.L9
	ldr	r3, [fp, #-1416]
	rsb	r3, r3, #99328
	add	r3, r3, #672
	mov	r0, r3
	bl	usleep
	b	.L10
.L9:
	ldr	r0, .L26+124
	bl	puts
.L10:
	mov	r3, #0
	str	r3, [fp, #-1348]
	ldr	r3, .L26+128
	str	r3, [fp, #-1344]
	ldr	r2, [fp, #-1364]
	ldr	r3, [fp, #-1348]
	add	r3, r2, r3
	str	r3, [fp, #-1364]
	ldr	r2, [fp, #-1360]
	ldr	r3, [fp, #-1344]
	add	r3, r2, r3
	str	r3, [fp, #-1360]
	ldr	r3, [fp, #-1360]
	ldr	r2, .L26+132
	cmp	r3, r2
	blt	.L11
	ldr	r3, [fp, #-1364]
	add	r3, r3, #1
	str	r3, [fp, #-1364]
	ldr	r3, [fp, #-1360]
	sub	r3, r3, #999424
	sub	r3, r3, #576
	str	r3, [fp, #-1360]
.L11:
	bl	getPktNum
	mov	r3, r0
	str	r3, [fp, #-1424]
	ldr	r2, [fp, #-1424]
	ldr	r3, [fp, #-1460]
	sub	r3, r2, r3
	cmp	r3, #1000
	bls	.L12
	ldr	r3, .L26+40
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L26+136
	bl	fwrite
	mov	r0, #1
	bl	exit
.L12:
	mov	r3, #0
	str	r3, [fp, #-1444]
	ldr	r3, [fp, #-1460]
	str	r3, [fp, #-1456]
	b	.L13
.L15:
	ldr	r2, [fp, #-1456]
	ldr	r3, .L26+96
	smull	r1, r3, r2, r3
	asr	r1, r3, #6
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #5
	sub	r3, r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #3
	sub	r3, r2, r3
	str	r3, [fp, #-1420]
	ldr	r2, .L26+140
	ldr	r3, [fp, #-1420]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrsh	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-1444]
	add	r3, r3, r2
	str	r3, [fp, #-1444]
	ldr	r2, .L26+144
	ldr	r3, [fp, #-1420]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	ldr	r0, .L26+148
	ldr	r1, [fp, #-1420]
	lsl	r1, r1, #1
	add	r1, r0, r1
	ldrh	r1, [r1]
	mov	ip, r1
	ldr	r0, .L26+100
	ldr	r1, [fp, #-1420]
	add	r1, r0, r1
	ldrb	r1, [r1]	@ zero_extendqisi2
	mov	lr, r1
	ldr	r0, .L26+152
	ldr	r1, [fp, #-1420]
	lsl	r1, r1, #1
	add	r1, r0, r1
	ldrh	r1, [r1]
	mov	r4, r1
	ldr	r0, .L26+104
	ldr	r1, [fp, #-1420]
	add	r1, r0, r1
	ldrb	r1, [r1]	@ zero_extendqisi2
	mov	r5, r1
	ldr	r0, .L26+156
	ldr	r1, [fp, #-1420]
	lsl	r1, r1, #1
	add	r1, r0, r1
	ldrh	r1, [r1]
	mov	r6, r1
	ldr	r0, .L26+108
	ldr	r1, [fp, #-1420]
	add	r1, r0, r1
	ldrb	r1, [r1]	@ zero_extendqisi2
	mov	r7, r1
	ldr	r0, .L26+160
	ldr	r1, [fp, #-1420]
	lsl	r1, r1, #1
	add	r1, r0, r1
	ldrh	r1, [r1]
	mov	r8, r1
	ldr	r0, .L26+112
	ldr	r1, [fp, #-1420]
	add	r1, r0, r1
	ldrb	r1, [r1]	@ zero_extendqisi2
	mov	r9, r1
	ldr	r0, .L26+140
	ldr	r1, [fp, #-1420]
	lsl	r1, r1, #1
	add	r1, r0, r1
	ldrsh	r1, [r1]
	str	r1, [sp, #32]
	str	r9, [sp, #28]
	str	r8, [sp, #24]
	str	r7, [sp, #20]
	str	r6, [sp, #16]
	str	r5, [sp, #12]
	str	r4, [sp, #8]
	str	lr, [sp, #4]
	str	ip, [sp]
	ldr	r0, .L26+164
	bl	printf
	ldr	r2, .L26+168
	ldr	r3, [fp, #-1420]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #137
	bne	.L14
	bl	endProgram
.L14:
	ldr	r3, [fp, #-1456]
	add	r3, r3, #1
	str	r3, [fp, #-1456]
.L13:
	ldr	r3, [fp, #-1456]
	ldr	r2, [fp, #-1424]
	cmp	r2, r3
	bhi	.L15
	ldr	r2, [fp, #-1432]
	ldr	r3, [fp, #-1444]
	add	r3, r2, r3
	str	r3, [fp, #-1432]
	ldr	r3, [fp, #-1432]
	cmp	r3, #50
	ble	.L16
	ldr	r0, .L26+56
	bl	pthread_mutex_lock
	ldr	r3, .L26+172
	mov	r2, #1
	str	r2, [r3]
	ldr	r0, .L26+56
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-1432]
	sub	r3, r3, #50
	str	r3, [fp, #-1432]
.L16:
	ldr	r3, [fp, #-1424]
	sub	r1, r3, #1
	ldr	r3, .L26+96
	umull	r2, r3, r1, r3
	lsr	r2, r3, #6
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	str	r2, [fp, #-1420]
	ldr	r2, .L26+100
	ldr	r3, [fp, #-1420]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r2, r3, #3
	ldr	r1, .L26+104
	ldr	r3, [fp, #-1420]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #2
	orr	r2, r2, r3
	ldr	r1, .L26+108
	ldr	r3, [fp, #-1420]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #1
	orr	r3, r2, r3
	ldr	r1, .L26+112
	ldr	r2, [fp, #-1420]
	add	r2, r1, r2
	ldrb	r2, [r2]	@ zero_extendqisi2
	orr	r3, r3, r2
	str	r3, [fp, #-1412]
	sub	r0, fp, #1040
	sub	r0, r0, #12
	sub	r0, r0, #8
	ldr	r2, [fp, #-1380]
	ldr	r3, [fp, #-1376]
	ldr	r1, [fp, #-1412]
	bl	epsilonGreedy
	str	r0, [fp, #-1408]
	ldr	r0, .L26+52
	bl	pthread_mutex_lock
	ldr	r2, .L26+116
	ldr	r3, [fp, #-1408]
	str	r3, [r2]
	ldr	r0, .L26+52
	bl	pthread_mutex_unlock
	ldr	r0, [fp, #-1444]
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	ldr	r3, [fp, #-1412]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1408]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #1024
	sub	r3, r3, #8
	ldmia	r3, {r0-r1}
	ldr	r2, [fp, #-1388]
	ldr	r3, [fp, #-1384]
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #-1448]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1452]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #1024
	sub	r3, r3, #8
	ldmia	r3, {r2-r3}
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-1372]
	str	r3, [fp, #-1368]
	mov	r3, #0
	str	r3, [fp, #-1436]
	b	.L17
.L18:
	ldr	r3, [fp, #-1448]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1436]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r1, r3, #520
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-1436]
	add	r3, r3, #1
	str	r3, [fp, #-1436]
.L17:
	ldr	r3, [fp, #-1436]
	cmp	r3, #3
	ble	.L18
	ldr	r3, [fp, #-1448]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1452]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r1, r3, #520
	mov	r2, #0
	ldr	r3, .L26+176
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-1408]
	str	r3, [sp, #4]
	ldr	r3, [fp, #-1412]
	str	r3, [sp]
	ldr	r3, [fp, #-1444]
	ldr	r2, [fp, #-1452]
	ldr	r1, [fp, #-1448]
	ldr	r0, .L26+180
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-1440]
	b	.L19
.L22:
	ldr	r3, [fp, #-1440]
	lsl	r3, r3, #5
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #1024
	sub	r3, r3, #8
	ldmia	r3, {r6-r7}
	ldr	r3, [fp, #-1440]
	lsl	r3, r3, #5
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #1024
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-1440]
	lsl	r1, r1, #5
	sub	r0, fp, #28
	add	r1, r0, r1
	sub	r1, r1, #1016
	ldmia	r1, {r0-r1}
	ldr	ip, [fp, #-1440]
	lsl	ip, ip, #5
	sub	lr, fp, #28
	add	ip, lr, ip
	sub	ip, ip, #1008
	ldmia	ip, {r4-r5}
	str	r4, [sp, #16]
	str	r5, [sp, #20]
	str	r0, [sp, #8]
	str	r1, [sp, #12]
	stm	sp, {r2-r3}
	mov	r2, r6
	mov	r3, r7
	ldr	r1, [fp, #-1440]
	ldr	r0, .L26+184
	bl	printf
	ldr	r3, [fp, #-1440]
	lsl	r3, r3, #5
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #520
	ldmia	r3, {r6-r7}
	ldr	r3, [fp, #-1440]
	lsl	r3, r3, #5
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #512
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-1440]
	lsl	r1, r1, #5
	sub	r0, fp, #28
	add	r1, r0, r1
	sub	r1, r1, #504
	ldmia	r1, {r0-r1}
	ldr	ip, [fp, #-1440]
	lsl	ip, ip, #5
	sub	lr, fp, #28
	add	ip, lr, ip
	sub	ip, ip, #496
	ldmia	ip, {r4-r5}
	str	r4, [sp, #16]
	str	r5, [sp, #20]
	str	r0, [sp, #8]
	str	r1, [sp, #12]
	stm	sp, {r2-r3}
	mov	r2, r6
	mov	r3, r7
	ldr	r1, [fp, #-1440]
	ldr	r0, .L26+188
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-1436]
	b	.L20
.L21:
	ldr	r3, [fp, #-1440]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1436]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #1024
	sub	r3, r3, #8
	ldmia	r3, {r4-r5}
	ldr	r2, [fp, #-1372]
	ldr	r3, [fp, #-1368]
	ldr	r0, [fp, #-1404]
	ldr	r1, [fp, #-1400]
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #-1440]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1436]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #520
	ldmia	r3, {r2-r3}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #-1440]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1436]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #1024
	sub	r3, r3, #8
	stm	r3, {r0-r1}
	ldr	r2, [fp, #-1396]
	ldr	r3, [fp, #-1392]
	ldr	r0, [fp, #-1388]
	ldr	r1, [fp, #-1384]
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #-1440]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-1436]
	add	r3, r2, r3
	lsl	r3, r3, #3
	sub	r2, fp, #28
	add	r3, r2, r3
	sub	r3, r3, #520
	ldmia	r3, {r2-r3}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	ldr	r1, [fp, #-1440]
	lsl	r0, r1, #2
	ldr	r1, [fp, #-1436]
	add	r1, r0, r1
	lsl	r1, r1, #3
	sub	r0, fp, #28
	add	r1, r0, r1
	sub	r1, r1, #520
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-1436]
	add	r3, r3, #1
	str	r3, [fp, #-1436]
.L20:
	ldr	r3, [fp, #-1436]
	cmp	r3, #3
	ble	.L21
	ldr	r3, [fp, #-1440]
	add	r3, r3, #1
	str	r3, [fp, #-1440]
.L19:
	ldr	r3, [fp, #-1440]
	cmp	r3, #15
	ble	.L22
	ldr	r3, [fp, #-1412]
	str	r3, [fp, #-1448]
	ldr	r3, [fp, #-1408]
	str	r3, [fp, #-1452]
	ldr	r3, [fp, #-1424]
	str	r3, [fp, #-1460]
	b	.L23
.L25:
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC9
	.word	-1717986918
	.word	1069128089
	.word	-858993459
	.word	1072483532
	.word	-171798692
	.word	1072651304
	.word	1202590843
	.word	1065646817
	.word	endProgram
	.word	stderr
	.word	.LC0
	.word	pktNumMutex
	.word	actionMutex
	.word	rewardMusicMutex
	.word	20000
	.word	csp3
	.word	.LC1
	.word	-4194304
	.word	1105199103
	.word	1071644672
	.word	-755914244
	.word	1062232653
	.word	1075052544
	.word	274877907
	.word	sCliffLB
	.word	sCliffFLB
	.word	sCliffFRB
	.word	sCliffRB
	.word	action
	.word	.LC2
	.word	.LC3
	.word	100000
	.word	1000000
	.word	.LC4
	.word	sDistance
	.word	sDeltaT
	.word	sCliffL
	.word	sCliffFL
	.word	sCliffFR
	.word	sCliffR
	.word	.LC5
	.word	sIRbyte
	.word	rewardMusic
	.word	1072693248
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.align	2
	.global	getPktNum
	.syntax unified
	.arm
	.fpu softvfp
	.type	getPktNum, %function
getPktNum:
	@ 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	r0, .L30
	bl	pthread_mutex_lock
	ldr	r3, .L30+4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, .L30
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	pktNumMutex
	.word	pktNum
	.size	getPktNum, .-getPktNum
	.section	.rodata
	.align	2
.LC10:
	.ascii	"r\000"
	.align	2
.LC11:
	.ascii	"cliffThresholds.dat\000"
	.align	2
.LC12:
	.ascii	"Error opening cliffThresholds.dat file: %s\012\000"
	.align	2
.LC13:
	.ascii	"%d%d%d%d%d\000"
	.text
	.align	2
	.global	loadCliffThresholds
	.syntax unified
	.arm
	.fpu softvfp
	.type	loadCliffThresholds, %function
loadCliffThresholds:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	ldr	r1, .L34
	ldr	r0, .L34+4
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L33
	ldr	r3, .L34+8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L34+12
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L33:
	ldr	r3, .L34+16
	str	r3, [sp, #8]
	ldr	r3, .L34+20
	str	r3, [sp, #4]
	ldr	r3, .L34+24
	str	r3, [sp]
	ldr	r3, .L34+28
	ldr	r2, .L34+32
	ldr	r1, .L34+36
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	ldr	r0, [fp, #-16]
	bl	fclose
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L35:
	.align	2
.L34:
	.word	.LC10
	.word	.LC11
	.word	stderr
	.word	.LC12
	.word	cliffThresholds+12
	.word	cliffThresholds+8
	.word	cliffThresholds+4
	.word	cliffThresholds
	.word	cliffHighValue
	.word	.LC13
	.size	loadCliffThresholds, .-loadCliffThresholds
	.global	__aeabi_dcmpgt
	.section	.rodata
	.align	2
.LC14:
	.ascii	"random action\012\000"
	.global	__aeabi_idivmod
	.text
	.align	2
	.global	epsilonGreedy
	.syntax unified
	.arm
	.fpu softvfp
	.type	epsilonGreedy, %function
epsilonGreedy:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	bl	getPktNum
	mov	r3, r0
	add	r2, r3, #996
	add	r2, r2, #3
	ldr	r3, .L53
	smull	r1, r3, r2, r3
	asr	r1, r3, #6
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #5
	sub	r3, r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #3
	sub	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r2, .L53+4
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L37
	ldr	r2, .L53+8
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L38
.L37:
	mov	r3, #1
	b	.L39
.L38:
	mov	r3, #0
.L39:
	str	r3, [fp, #-8]
	ldr	r2, .L53+12
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L40
	ldr	r2, .L53+16
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L41
.L40:
	mov	r3, #2
	str	r3, [fp, #-16]
	b	.L42
.L41:
	mov	r3, #3
	str	r3, [fp, #-16]
.L42:
	bl	rand
	mov	r3, r0
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, #0
	ldr	r3, .L53+20
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	sub	r1, fp, #44
	ldmia	r1, {r0-r1}
	bl	__aeabi_dcmpgt
	mov	r3, r0
	cmp	r3, #0
	beq	.L52
	ldr	r0, .L53+24
	bl	puts
	bl	rand
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	mov	r1, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	b	.L45
.L52:
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-20]
	b	.L46
.L49:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-32]
	add	r2, r2, r3
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldmia	r3, {r0-r1}
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-32]
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	bl	__aeabi_dcmpgt
	mov	r3, r0
	cmp	r3, #0
	beq	.L47
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-24]
.L47:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L46:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L49
	ldr	r3, [fp, #-24]
.L45:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L54:
	.align	2
.L53:
	.word	274877907
	.word	sCliffFLB
	.word	sCliffFRB
	.word	sCliffLB
	.word	sCliffRB
	.word	1105199104
	.word	.LC14
	.size	epsilonGreedy, .-epsilonGreedy
	.section	.rodata
	.align	2
.LC15:
	.ascii	"Bad action\000"
	.text
	.align	2
	.global	takeAction
	.syntax unified
	.arm
	.fpu softvfp
	.type	takeAction, %function
takeAction:
	@ 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, [fp, #-8]
	cmp	r3, #4
	ldrls	pc, [pc, r3, asl #2]
	b	.L56
.L58:
	.word	.L62
	.word	.L61
	.word	.L60
	.word	.L59
	.word	.L57
.L62:
	mov	r1, #300
	mov	r0, #300
	bl	driveWheels
	b	.L63
.L61:
	mov	r1, #300
	ldr	r0, .L64
	bl	driveWheels
	b	.L63
.L60:
	ldr	r1, .L64
	mov	r0, #300
	bl	driveWheels
	b	.L63
.L59:
	ldr	r1, .L64
	ldr	r0, .L64
	bl	driveWheels
	b	.L63
.L57:
	mov	r1, #0
	mov	r0, #0
	bl	driveWheels
	b	.L63
.L56:
	ldr	r0, .L64+4
	bl	puts
	nop
.L63:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L65:
	.align	2
.L64:
	.word	-300
	.word	.LC15
	.size	takeAction, .-takeAction
	.section	.rodata
	.align	2
.LC16:
	.ascii	"Ending Program\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	endProgram
	.syntax unified
	.arm
	.fpu softvfp
	.type	endProgram, %function
endProgram:
	@ 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, .L68
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L68+4
	bl	puts
	mov	r1, #0
	mov	r0, #0
	bl	driveWheels
	mvn	r3, #105
	strb	r3, [fp, #-12]
	mov	r3, #0
	strb	r3, [fp, #-11]
	sub	r3, fp, #12
	mov	r1, #2
	mov	r0, r3
	bl	sendBytesToRobot
	ldr	r3, .L68+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	tcdrain
	mov	r0, #0
	bl	exit
.L69:
	.align	2
.L68:
	.word	.LC17
	.word	.LC16
	.word	fd
	.size	endProgram, .-endProgram
	.section	.rodata
	.align	2
.LC18:
	.ascii	"Problem with write(): %s\012\000"
	.text
	.align	2
	.global	sendBytesToRobot
	.syntax unified
	.arm
	.fpu softvfp
	.type	sendBytesToRobot, %function
sendBytesToRobot:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L73
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	write
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L72
	ldr	r3, .L73+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L73+8
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L72:
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L74:
	.align	2
.L73:
	.word	fd
	.word	stderr
	.word	.LC18
	.size	sendBytesToRobot, .-sendBytesToRobot
	.section	.rodata
	.align	2
.LC19:
	.ascii	"Problem with tcdrain(): %s\012\000"
	.text
	.align	2
	.global	ensureTransmitted
	.syntax unified
	.arm
	.fpu softvfp
	.type	ensureTransmitted, %function
ensureTransmitted:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r3, .L78
	ldr	r3, [r3]
	mov	r0, r3
	bl	tcdrain
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L77
	ldr	r3, .L78+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L78+8
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L77:
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L79:
	.align	2
.L78:
	.word	fd
	.word	stderr
	.word	.LC19
	.size	ensureTransmitted, .-ensureTransmitted
	.section	.rodata
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	driveWheels
	.syntax unified
	.arm
	.fpu softvfp
	.type	driveWheels, %function
driveWheels:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L82
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	cmp	r3, #500
	movlt	r3, r3
	movge	r3, #500
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	ldr	r2, .L82+4
	cmp	r3, r2
	movge	r3, r3
	movlt	r3, r2
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-28]
	cmp	r3, #500
	movlt	r3, r3
	movge	r3, #500
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	ldr	r2, .L82+4
	cmp	r3, r2
	movge	r3, r3
	movlt	r3, r2
	str	r3, [fp, #-28]
	mvn	r3, #110
	strb	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	asr	r3, r3, #8
	and	r3, r3, #255
	strb	r3, [fp, #-15]
	ldr	r3, [fp, #-28]
	and	r3, r3, #255
	strb	r3, [fp, #-14]
	ldr	r3, [fp, #-24]
	asr	r3, r3, #8
	and	r3, r3, #255
	strb	r3, [fp, #-13]
	ldr	r3, [fp, #-24]
	and	r3, r3, #255
	strb	r3, [fp, #-12]
	sub	r3, fp, #16
	mov	r1, #5
	mov	r0, r3
	bl	sendBytesToRobot
	nop
	ldr	r3, .L82
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L81
	bl	__stack_chk_fail
.L81:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L83:
	.align	2
.L82:
	.word	.LC20
	.word	-500
	.size	driveWheels, .-driveWheels
	.section	.rodata
	.align	2
.LC21:
	.ascii	"Serial port at %s could not be opened: %s\012\000"
	.align	2
.LC22:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	setupSerialPort
	.syntax unified
	.arm
	.fpu softvfp
	.type	setupSerialPort, %function
setupSerialPort:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #92
	str	r0, [fp, #-96]
	ldr	r3, .L87
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r1, .L87+4
	ldr	r0, [fp, #-96]
	bl	open
	mov	r3, r0
	ldr	r2, .L87+8
	str	r3, [r2]
	ldr	r3, .L87+8
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L85
	ldr	r3, .L87+12
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-96]
	ldr	r1, .L87+16
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L85:
	ldr	r3, .L87+8
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	tcflush
	ldr	r3, .L87+8
	ldr	r3, [r3]
	sub	r2, fp, #84
	mov	r1, r2
	mov	r0, r3
	bl	tcgetattr
	mov	r3, #5
	str	r3, [fp, #-84]
	mov	r3, #0
	str	r3, [fp, #-72]
	mov	r3, #0
	str	r3, [fp, #-80]
	mov	r3, #2224
	str	r3, [fp, #-76]
	sub	r3, fp, #84
	ldr	r1, .L87+20
	mov	r0, r3
	bl	cfsetispeed
	sub	r3, fp, #84
	ldr	r1, .L87+20
	mov	r0, r3
	bl	cfsetospeed
	ldr	r3, .L87+8
	ldr	r3, [r3]
	sub	r2, fp, #84
	mov	r1, #0
	mov	r0, r3
	bl	tcsetattr
	mvn	r3, #127
	strb	r3, [fp, #-85]
	sub	r3, fp, #85
	mov	r1, #1
	mov	r0, r3
	bl	sendBytesToRobot
	mvn	r3, #123
	strb	r3, [fp, #-85]
	sub	r3, fp, #85
	mov	r1, #1
	mov	r0, r3
	bl	sendBytesToRobot
	mvn	r3, #107
	strb	r3, [fp, #-24]
	mov	r3, #6
	strb	r3, [fp, #-23]
	mov	r3, #28
	strb	r3, [fp, #-22]
	mov	r3, #29
	strb	r3, [fp, #-21]
	mov	r3, #30
	strb	r3, [fp, #-20]
	mov	r3, #31
	strb	r3, [fp, #-19]
	mov	r3, #19
	strb	r3, [fp, #-18]
	mov	r3, #17
	strb	r3, [fp, #-17]
	sub	r3, fp, #24
	mov	r1, #8
	mov	r0, r3
	bl	sendBytesToRobot
	mvn	r3, #115
	strb	r3, [fp, #-24]
	mov	r3, #0
	strb	r3, [fp, #-23]
	mov	r3, #1
	strb	r3, [fp, #-22]
	mov	r3, #100
	strb	r3, [fp, #-21]
	mov	r3, #6
	strb	r3, [fp, #-20]
	sub	r3, fp, #24
	mov	r1, #5
	mov	r0, r3
	bl	sendBytesToRobot
	bl	ensureTransmitted
	nop
	ldr	r3, .L87
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L86
	bl	__stack_chk_fail
.L86:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L88:
	.align	2
.L87:
	.word	.LC22
	.word	2306
	.word	fd
	.word	stderr
	.word	.LC21
	.word	4097
	.size	setupSerialPort, .-setupSerialPort
	.align	2
	.global	checkPacket
	.syntax unified
	.arm
	.fpu softvfp
	.type	checkPacket, %function
checkPacket:
	@ 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
	ldr	r3, .L94
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #19
	bne	.L90
	ldr	r3, .L94
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	cmp	r3, #17
	bne	.L90
	ldr	r3, .L94
	ldrb	r3, [r3, #2]	@ zero_extendqisi2
	cmp	r3, #28
	bne	.L90
	ldr	r3, .L94
	ldrb	r3, [r3, #5]	@ zero_extendqisi2
	cmp	r3, #29
	bne	.L90
	ldr	r3, .L94
	ldrb	r3, [r3, #8]	@ zero_extendqisi2
	cmp	r3, #30
	bne	.L90
	ldr	r3, .L94
	ldrb	r3, [r3, #11]	@ zero_extendqisi2
	cmp	r3, #31
	bne	.L90
	ldr	r3, .L94
	ldrb	r3, [r3, #14]	@ zero_extendqisi2
	cmp	r3, #19
	bne	.L90
	ldr	r3, .L94
	ldrb	r3, [r3, #17]	@ zero_extendqisi2
	cmp	r3, #17
	bne	.L90
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L91
.L92:
	ldr	r2, .L94
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L91:
	ldr	r3, [fp, #-12]
	cmp	r3, #19
	ble	.L92
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L90
	mov	r3, #1
	b	.L93
.L90:
	mov	r3, #0
.L93:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L95:
	.align	2
.L94:
	.word	packet
	.size	checkPacket, .-checkPacket
	.section	.rodata
	.align	2
.LC23:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	extractPacket
	.syntax unified
	.arm
	.fpu softvfp
	.type	extractPacket, %function
extractPacket:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #16
	ldr	r3, .L106
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	ldr	r3, .L106+4
	ldr	r1, [r3]
	ldr	r3, .L106+8
	umull	r2, r3, r1, r3
	lsr	r2, r3, #6
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	str	r2, [fp, #-36]
	ldr	r3, .L106+12
	ldrb	r3, [r3, #3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, .L106+12
	ldrb	r3, [r3, #4]	@ zero_extendqisi2
	lsl	r3, r3, #16
	asr	r3, r3, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r1, .L106+16
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldr	r2, .L106+16
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	mov	r2, r3
	ldr	r3, .L106+20
	ldr	r3, [r3]
	cmp	r2, r3
	bgt	.L97
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
	rsb	r3, r3, #1
	and	r3, r3, #255
	b	.L98
.L97:
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
.L98:
	ldr	r1, .L106+28
	ldr	r2, [fp, #-36]
	add	r2, r1, r2
	strb	r3, [r2]
	ldr	r3, .L106+12
	ldrb	r3, [r3, #6]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, .L106+12
	ldrb	r3, [r3, #7]	@ zero_extendqisi2
	lsl	r3, r3, #16
	asr	r3, r3, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r1, .L106+32
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldr	r2, .L106+32
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	mov	r2, r3
	ldr	r3, .L106+20
	ldr	r3, [r3, #4]
	cmp	r2, r3
	bgt	.L99
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
	rsb	r3, r3, #1
	and	r3, r3, #255
	b	.L100
.L99:
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
.L100:
	ldr	r1, .L106+36
	ldr	r2, [fp, #-36]
	add	r2, r1, r2
	strb	r3, [r2]
	ldr	r3, .L106+12
	ldrb	r3, [r3, #9]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, .L106+12
	ldrb	r3, [r3, #10]	@ zero_extendqisi2
	lsl	r3, r3, #16
	asr	r3, r3, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r1, .L106+40
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldr	r2, .L106+40
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	mov	r2, r3
	ldr	r3, .L106+20
	ldr	r3, [r3, #8]
	cmp	r2, r3
	bgt	.L101
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
	rsb	r3, r3, #1
	and	r3, r3, #255
	b	.L102
.L101:
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
.L102:
	ldr	r1, .L106+44
	ldr	r2, [fp, #-36]
	add	r2, r1, r2
	strb	r3, [r2]
	ldr	r3, .L106+12
	ldrb	r3, [r3, #12]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, .L106+12
	ldrb	r3, [r3, #13]	@ zero_extendqisi2
	lsl	r3, r3, #16
	asr	r3, r3, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r1, .L106+48
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldr	r2, .L106+48
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	mov	r2, r3
	ldr	r3, .L106+20
	ldr	r3, [r3, #12]
	cmp	r2, r3
	bgt	.L103
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
	rsb	r3, r3, #1
	and	r3, r3, #255
	b	.L104
.L103:
	ldr	r3, .L106+24
	ldr	r3, [r3]
	and	r3, r3, #255
.L104:
	ldr	r1, .L106+52
	ldr	r2, [fp, #-36]
	add	r2, r1, r2
	strb	r3, [r2]
	ldr	r3, .L106+12
	ldrb	r3, [r3, #15]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, .L106+12
	ldrb	r3, [r3, #16]	@ zero_extendqisi2
	lsl	r3, r3, #16
	asr	r3, r3, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r1, .L106+56
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldr	r3, .L106+12
	ldrb	r1, [r3, #18]	@ zero_extendqisi2
	ldr	r2, .L106+60
	ldr	r3, [fp, #-36]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	sub	r3, fp, #32
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r2, [fp, #-32]
	ldr	r3, .L106+64
	ldr	r3, [r3]
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	ldr	r3, [fp, #-28]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r6, r0
	mov	r7, r1
	ldr	r3, .L106+64
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r6
	mov	r1, r7
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L106+68
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L106+72
	ldr	r1, [fp, #-36]
	lsl	r1, r1, #3
	add	r1, r0, r1
	stm	r1, {r2-r3}
	ldr	r3, .L106+64
	mov	r2, r3
	sub	r3, fp, #32
	ldm	r3, {r0, r1}
	stm	r2, {r0, r1}
	nop
	ldr	r3, .L106
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L105
	bl	__stack_chk_fail
.L105:
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L107:
	.align	2
.L106:
	.word	.LC23
	.word	pktNum
	.word	274877907
	.word	packet
	.word	sCliffL
	.word	cliffThresholds
	.word	cliffHighValue
	.word	sCliffLB
	.word	sCliffFL
	.word	sCliffFLB
	.word	sCliffFR
	.word	sCliffFRB
	.word	sCliffR
	.word	sCliffRB
	.word	sDistance
	.word	sIRbyte
	.word	lastPktTime
	.word	1083129856
	.word	sDeltaT
	.size	extractPacket, .-extractPacket
	.section	.rodata
	.align	2
.LC24:
	.ascii	"Timed out at select()\000"
	.align	2
.LC25:
	.ascii	"Problem with select(): %s\012\000"
	.align	2
.LC26:
	.ascii	"Problem with read(): %s\012\000"
	.align	2
.LC27:
	.ascii	"misaligned packet.\000"
	.align	2
.LC28:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	csp3
	.syntax unified
	.arm
	.fpu softvfp
	.type	csp3, %function
csp3:
	@ args = 0, pretend = 0, frame = 184
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #196
	str	r0, [fp, #-192]
	ldr	r3, .L120
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-184]
	mov	r1, #0
	ldr	r0, .L120+4
	bl	gettimeofday
	ldr	r3, .L120+8
	ldr	r3, [r3]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r1, [r3, #-152]
	ldr	r3, .L120+8
	ldr	r3, [r3]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	str	r1, [r3, #-152]
.L118:
	mov	r3, #2
	str	r3, [fp, #-172]
	mov	r3, #0
	str	r3, [fp, #-168]
	ldr	r3, .L120+8
	ldr	r3, [r3]
	add	r0, r3, #1
	sub	r1, fp, #164
	sub	r3, fp, #172
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	str	r0, [fp, #-180]
	ldr	r3, [fp, #-180]
	cmp	r3, #0
	bne	.L109
	ldr	r0, .L120+12
	bl	puts
	b	.L110
.L109:
	ldr	r3, [fp, #-180]
	cmn	r3, #1
	bne	.L110
	ldr	r3, .L120+16
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L120+20
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L110:
	ldr	r3, .L120+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-184]
	rsb	r3, r3, #20
	mov	r2, r3
	sub	r3, fp, #36
	mov	r1, r3
	bl	read
	str	r0, [fp, #-176]
	ldr	r3, [fp, #-176]
	cmn	r3, #1
	bne	.L111
	ldr	r3, .L120+16
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L120+24
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L111:
	mov	r3, #0
	str	r3, [fp, #-188]
	b	.L112
.L113:
	ldr	r2, [fp, #-184]
	ldr	r3, [fp, #-188]
	add	r3, r2, r3
	sub	r1, fp, #36
	ldr	r2, [fp, #-188]
	add	r2, r1, r2
	ldrb	r1, [r2]	@ zero_extendqisi2
	ldr	r2, .L120+28
	strb	r1, [r2, r3]
	ldr	r3, [fp, #-188]
	add	r3, r3, #1
	str	r3, [fp, #-188]
.L112:
	ldr	r2, [fp, #-188]
	ldr	r3, [fp, #-176]
	cmp	r2, r3
	blt	.L113
	ldr	r2, [fp, #-184]
	ldr	r3, [fp, #-176]
	add	r3, r2, r3
	str	r3, [fp, #-184]
	ldr	r3, [fp, #-184]
	cmp	r3, #20
	bne	.L118
	bl	checkPacket
	mov	r3, r0
	cmp	r3, #0
	beq	.L115
	bl	extractPacket
	bl	reflexes
	bl	ensureTransmitted
	ldr	r0, .L120+32
	bl	pthread_mutex_lock
	ldr	r3, .L120+36
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L120+36
	str	r3, [r2]
	ldr	r0, .L120+32
	bl	pthread_mutex_unlock
	mov	r3, #0
	str	r3, [fp, #-184]
	b	.L118
.L115:
	ldr	r0, .L120+40
	bl	puts
	mov	r3, #1
	str	r3, [fp, #-188]
	b	.L116
.L117:
	ldr	r3, [fp, #-188]
	sub	r3, r3, #1
	ldr	r1, .L120+28
	ldr	r2, [fp, #-188]
	add	r2, r1, r2
	ldrb	r1, [r2]	@ zero_extendqisi2
	ldr	r2, .L120+28
	strb	r1, [r2, r3]
	ldr	r3, [fp, #-188]
	add	r3, r3, #1
	str	r3, [fp, #-188]
.L116:
	ldr	r3, [fp, #-188]
	cmp	r3, #19
	ble	.L117
	ldr	r3, [fp, #-184]
	sub	r3, r3, #1
	str	r3, [fp, #-184]
	b	.L118
.L121:
	.align	2
.L120:
	.word	.LC28
	.word	lastPktTime
	.word	fd
	.word	.LC24
	.word	stderr
	.word	.LC25
	.word	.LC26
	.word	packet
	.word	pktNumMutex
	.word	pktNum
	.word	.LC27
	.size	csp3, .-csp3
	.section	.rodata
	.align	2
.LC29:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	reflexes
	.syntax unified
	.arm
	.fpu softvfp
	.type	reflexes, %function
reflexes:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L132
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L132+4
	ldr	r1, [r3]
	ldr	r3, .L132+8
	umull	r2, r3, r1, r3
	lsr	r2, r3, #6
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	str	r2, [fp, #-20]
	ldr	r0, .L132+12
	bl	pthread_mutex_lock
	ldr	r3, .L132+16
	ldr	r3, [r3]
	and	r1, r3, #255
	ldr	r2, .L132+20
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r0, .L132+12
	bl	pthread_mutex_unlock
	ldr	r2, .L132+20
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L123
	ldr	r2, .L132+24
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L124
	ldr	r2, .L132+28
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L124
.L123:
	ldr	r2, .L132+20
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #3
	bne	.L125
	ldr	r2, .L132+32
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L124
	ldr	r2, .L132+36
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L125
.L124:
	ldr	r2, .L132+20
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	mov	r2, #4
	strb	r2, [r3]
.L125:
	ldr	r2, .L132+20
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	takeAction
	ldr	r2, .L132+24
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L126
	ldr	r2, .L132+28
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L127
.L126:
	mov	r3, #1
	b	.L128
.L127:
	mov	r3, #0
.L128:
	strb	r3, [fp, #-22]
	ldr	r2, .L132+32
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldrb	r3, [fp, #-22]	@ zero_extendqisi2
	lsl	r3, r3, #1
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r1, .L132+36
	ldr	r3, [fp, #-20]
	add	r3, r1, r3
	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
	strb	r3, [fp, #-21]
	mvn	r3, #108
	strb	r3, [fp, #-12]
	ldrb	r3, [fp, #-21]
	strb	r3, [fp, #-11]
	sub	r3, fp, #12
	mov	r1, #2
	mov	r0, r3
	bl	sendBytesToRobot
	ldr	r0, .L132+40
	bl	pthread_mutex_lock
	ldr	r3, .L132+44
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r0, .L132+40
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	bne	.L131
	mvn	r3, #114
	strb	r3, [fp, #-12]
	mov	r3, #0
	strb	r3, [fp, #-11]
	sub	r3, fp, #12
	mov	r1, #2
	mov	r0, r3
	bl	sendBytesToRobot
	ldr	r0, .L132+40
	bl	pthread_mutex_lock
	ldr	r3, .L132+44
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L132+40
	bl	pthread_mutex_unlock
.L131:
	nop
	ldr	r3, .L132
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L130
	bl	__stack_chk_fail
.L130:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L133:
	.align	2
.L132:
	.word	.LC29
	.word	pktNum
	.word	274877907
	.word	actionMutex
	.word	action
	.word	sDrive
	.word	sCliffFLB
	.word	sCliffFRB
	.word	sCliffLB
	.word	sCliffRB
	.word	rewardMusicMutex
	.word	rewardMusic
	.size	reflexes, .-reflexes
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
