	.file	"198580552.c"
	.intel_syntax noprefix
	.text
	.globl	chip_select
	.bss
	.type	chip_select, @object
	.size	chip_select, 1
chip_select:
	.zero	1
	.section	.rodata
.LC0:
	.string	"/dev/spidev1.%d"
.LC1:
	.string	"Can't open SPI device"
.LC2:
	.string	"Failed to send SPI message"
	.text
	.type	spi_comms, @function
spi_comms:
.LFB0:
	.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 -88[rbp], rdi
	mov	DWORD PTR -92[rbp], esi
	mov	QWORD PTR -104[rbp], rdx
	mov	eax, ecx
	mov	BYTE PTR -96[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	QWORD PTR -88[rbp], 0
	je	.L2
	cmp	QWORD PTR -104[rbp], 0
	jne	.L3
.L2:
	mov	eax, -2
	jmp	.L7
.L3:
	movabs	rax, 7597699219061040175
	mov	QWORD PTR -23[rbp], rax
	mov	DWORD PTR -15[rbp], 829842788
	mov	WORD PTR -11[rbp], 28206
	mov	BYTE PTR -9[rbp], 0
	movzx	eax, BYTE PTR chip_select[rip]
	movzx	edx, al
	lea	rax, -23[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -23[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -72[rbp], eax
	cmp	DWORD PTR -72[rbp], 0
	jns	.L5
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L7
.L5:
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	rax, QWORD PTR -88[rbp]
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -104[rbp]
	mov	QWORD PTR -56[rbp], rax
	mov	eax, DWORD PTR -92[rbp]
	mov	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR speed.3[rip]
	mov	DWORD PTR -44[rbp], eax
	movzx	eax, WORD PTR delay.2[rip]
	mov	WORD PTR -40[rbp], ax
	movzx	eax, BYTE PTR bits.1[rip]
	mov	BYTE PTR -38[rbp], al
	lea	rdx, -64[rbp]
	mov	eax, DWORD PTR -72[rbp]
	mov	esi, 1075866368
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], 0
	jns	.L6
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L7
.L6:
	mov	eax, DWORD PTR -72[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L7:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	spi_comms, .-spi_comms
	.type	write_byte, @function
write_byte:
.LFB1:
	.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	edx, edi
	mov	eax, esi
	mov	BYTE PTR -20[rbp], dl
	mov	BYTE PTR -24[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -12[rbp], 0
	mov	WORD PTR -10[rbp], 0
	movzx	eax, BYTE PTR -20[rbp]
	and	eax, 127
	mov	BYTE PTR -13[rbp], al
	movzx	eax, BYTE PTR -13[rbp]
	mov	BYTE PTR -12[rbp], al
	movzx	eax, BYTE PTR -24[rbp]
	mov	BYTE PTR -11[rbp], al
	lea	rdx, -10[rbp]
	lea	rax, -12[rbp]
	mov	ecx, 2
	mov	esi, 2
	mov	rdi, rax
	call	spi_comms
	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
.LFE1:
	.size	write_byte, .-write_byte
	.type	read_byte, @function
read_byte:
.LFB2:
	.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	eax, edi
	mov	QWORD PTR -32[rbp], rsi
	mov	BYTE PTR -20[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -12[rbp], 0
	mov	WORD PTR -10[rbp], 0
	movzx	eax, BYTE PTR -20[rbp]
	or	eax, -128
	mov	BYTE PTR -13[rbp], al
	movzx	eax, BYTE PTR -13[rbp]
	mov	BYTE PTR -12[rbp], al
	lea	rdx, -10[rbp]
	lea	rax, -12[rbp]
	mov	ecx, 2
	mov	esi, 2
	mov	rdi, rax
	call	spi_comms
	test	eax, eax
	je	.L13
	mov	eax, -1
	jmp	.L15
.L13:
	movzx	edx, BYTE PTR -9[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	BYTE PTR [rax], dl
	mov	eax, 0
.L15:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	read_byte, .-read_byte
	.section	.rodata
.LC3:
	.string	"Couldn't send soft reset\n"
	.align 8
.LC4:
	.string	"Timed out while trying to get chipid\n"
	.align 8
.LC5:
	.string	"BME280 SPI test completed successfully!"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 50000
	cmp	DWORD PTR -52[rbp], 2
	jne	.L18
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	sub	eax, 48
	mov	BYTE PTR chip_select[rip], al
	jmp	.L19
.L18:
	mov	BYTE PTR chip_select[rip], 0
.L19:
	mov	esi, 182
	mov	edi, 224
	call	write_byte
	test	eax, eax
	je	.L20
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, -1
	jmp	.L25
.L20:
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	nanosleep@PLT
	mov	DWORD PTR -36[rbp], 20
	mov	BYTE PTR -37[rbp], 0
	lea	rax, -37[rbp]
	mov	rsi, rax
	mov	edi, 208
	call	read_byte
	jmp	.L22
.L24:
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	nanosleep@PLT
	lea	rax, -37[rbp]
	mov	rsi, rax
	mov	edi, 208
	call	read_byte
	cmp	DWORD PTR -36[rbp], 0
	jg	.L23
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 37
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, -3
	jmp	.L25
.L23:
	sub	DWORD PTR -36[rbp], 1
.L22:
	movzx	eax, BYTE PTR -37[rbp]
	cmp	al, 96
	jne	.L24
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 0
.L25:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.data
	.align 4
	.type	speed.3, @object
	.size	speed.3, 4
speed.3:
	.long	1000000
	.local	delay.2
	.comm	delay.2,2,2
	.type	bits.1, @object
	.size	bits.1, 1
bits.1:
	.byte	8
	.local	mode.0
	.comm	mode.0,1,1
	.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	"198580552.c"
	.text
	.comm	chip_select,1,1
	.section	.rodata
	.align	2
.LC1:
	.ascii	"/dev/spidev1.%d\000"
	.align	2
.LC2:
	.ascii	"Can't open SPI device\000"
	.align	2
.LC3:
	.ascii	"Failed to send SPI message\000"
	.align	2
.LC0:
	.ascii	"/dev/spidev1.n\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	spi_comms, %function
spi_comms:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	str	r2, [fp, #-80]
	strb	r3, [fp, #-81]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bne	.L3
.L2:
	mvn	r3, #1
	b	.L7
.L3:
	ldr	r3, .L9+4
	sub	ip, fp, #24
	ldm	r3, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2}
	strh	r3, [ip]	@ movhi
	add	ip, ip, #2
	lsr	r3, r3, #16
	strb	r3, [ip]
	ldr	r3, .L9+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	sub	r3, fp, #24
	ldr	r1, .L9+12
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #24
	mov	r1, #2
	mov	r0, r3
	bl	open
	str	r0, [fp, #-68]
	ldr	r3, [fp, #-68]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L9+16
	bl	perror
	mvn	r3, #0
	b	.L7
.L5:
	sub	r3, fp, #60
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-72]
	mov	r2, r3
	mov	r3, #0
	str	r2, [fp, #-60]
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-80]
	mov	r2, r3
	mov	r3, #0
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-76]
	str	r3, [fp, #-44]
	ldr	r3, .L9+20
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	ldr	r3, .L9+24
	ldrh	r3, [r3]
	strh	r3, [fp, #-36]	@ movhi
	ldr	r3, .L9+28
	ldrb	r3, [r3]	@ zero_extendqisi2
	strb	r3, [fp, #-34]
	sub	r3, fp, #60
	mov	r2, r3
	ldr	r1, .L9+32
	ldr	r0, [fp, #-68]
	bl	ioctl
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L9+36
	bl	perror
	mvn	r3, #0
	b	.L7
.L6:
	ldr	r0, [fp, #-68]
	bl	close
	mov	r3, #0
.L7:
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC4
	.word	.LC0
	.word	chip_select
	.word	.LC1
	.word	.LC2
	.word	speed.5500
	.word	delay.5501
	.word	bits.5499
	.word	1075866368
	.word	.LC3
	.size	spi_comms, .-spi_comms
	.section	.rodata
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_byte, %function
write_byte:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	mov	r3, r0
	mov	r2, r1
	strb	r3, [fp, #-21]
	mov	r3, r2
	strb	r3, [fp, #-22]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-12]	@ movhi
	ldrb	r3, [fp, #-21]
	and	r3, r3, #127
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]
	strb	r3, [fp, #-16]
	ldrb	r3, [fp, #-22]
	strb	r3, [fp, #-15]
	sub	r2, fp, #12
	sub	r0, fp, #16
	mov	r3, #2
	mov	r1, #2
	bl	spi_comms
	mov	r3, r0
	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	.LC5
	.size	write_byte, .-write_byte
	.section	.rodata
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_byte, %function
read_byte:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	mov	r3, r0
	str	r1, [fp, #-28]
	strb	r3, [fp, #-21]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-12]	@ movhi
	ldrb	r3, [fp, #-21]
	mvn	r3, r3, lsl #25
	mvn	r3, r3, lsr #25
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]
	strb	r3, [fp, #-16]
	sub	r2, fp, #12
	sub	r0, fp, #16
	mov	r3, #2
	mov	r1, #2
	bl	spi_comms
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	mvn	r3, #0
	b	.L19
.L17:
	ldrb	r2, [fp, #-11]	@ zero_extendqisi2
	ldr	r3, [fp, #-28]
	strb	r2, [r3]
	mov	r3, #0
.L19:
	ldr	r2, .L21
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L20
	bl	__stack_chk_fail
.L20:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC6
	.size	read_byte, .-read_byte
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Couldn't send soft reset\012\000"
	.align	2
.LC8:
	.ascii	"Timed out while trying to get chipid\012\000"
	.align	2
.LC9:
	.ascii	"BME280 SPI test completed successfully!\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, .L33+4
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	bne	.L24
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	and	r2, r3, #255
	ldr	r3, .L33+8
	strb	r2, [r3]
	b	.L25
.L24:
	ldr	r3, .L33+8
	mov	r2, #0
	strb	r2, [r3]
.L25:
	mov	r1, #182
	mov	r0, #224
	bl	write_byte
	mov	r3, r0
	cmp	r3, #0
	beq	.L26
	ldr	r3, .L33+12
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L33+16
	bl	fwrite
	mvn	r3, #0
	b	.L31
.L26:
	sub	r3, fp, #16
	mov	r1, #0
	mov	r0, r3
	bl	nanosleep
	mov	r3, #20
	str	r3, [fp, #-20]
	mov	r3, #0
	strb	r3, [fp, #-21]
	sub	r3, fp, #21
	mov	r1, r3
	mov	r0, #208
	bl	read_byte
	b	.L28
.L30:
	sub	r3, fp, #16
	mov	r1, #0
	mov	r0, r3
	bl	nanosleep
	sub	r3, fp, #21
	mov	r1, r3
	mov	r0, #208
	bl	read_byte
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L29
	ldr	r3, .L33+12
	ldr	r3, [r3]
	mov	r2, #37
	mov	r1, #1
	ldr	r0, .L33+20
	bl	fwrite
	mvn	r3, #2
	b	.L31
.L29:
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-20]
.L28:
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #96
	bne	.L30
	ldr	r0, .L33+24
	bl	puts
	mov	r3, #0
.L31:
	ldr	r2, .L33
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L32
	bl	__stack_chk_fail
.L32:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC10
	.word	50000
	.word	chip_select
	.word	stderr
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.data
	.align	2
	.type	speed.5500, %object
	.size	speed.5500, 4
speed.5500:
	.word	1000000
	.local	delay.5501
	.comm	delay.5501,2,2
	.type	bits.5499, %object
	.size	bits.5499, 1
bits.5499:
	.byte	8
	.local	mode.5498
	.comm	mode.5498,1,1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
