	.file	"264545.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Failed to write to I2C bus"
.LC1:
	.string	"Failed to read from I2C bus"
	.text
	.type	read_register, @function
read_register:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, esi
	mov	BYTE PTR -24[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	movzx	eax, BYTE PTR -24[rbp]
	mov	BYTE PTR -9[rbp], al
	lea	rcx, -9[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L5
.L2:
	lea	rcx, -9[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, 1
	je	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L5
.L4:
	movzx	eax, BYTE PTR -9[rbp]
	movzx	eax, al
.L5:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_register, .-read_register
	.section	.rodata
	.align 8
.LC3:
	.string	"Received wrong initiator: %02x"
	.align 8
.LC4:
	.string	"Received wrong checksum: 0x%02x != 0x%02x"
	.align 8
.LC5:
	.string	"Received wrong terminator: %02x"
	.text
	.type	read_voltage, @function
read_voltage:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 0
	mov	edi, eax
	call	read_register
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 1
	mov	edi, eax
	call	read_register
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 2
	mov	edi, eax
	call	read_register
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 3
	mov	edi, eax
	call	read_register
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 4
	mov	edi, eax
	call	read_register
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	js	.L8
	cmp	DWORD PTR -20[rbp], 0
	js	.L8
	cmp	DWORD PTR -16[rbp], 0
	js	.L8
	cmp	DWORD PTR -12[rbp], 0
	js	.L8
	cmp	DWORD PTR -8[rbp], 0
	jns	.L9
.L8:
	movss	xmm0, DWORD PTR .LC2[rip]
	jmp	.L10
.L9:
	cmp	DWORD PTR -24[rbp], 255
	je	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -24[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	movss	xmm0, DWORD PTR .LC2[rip]
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -20[rbp]
	xor	eax, DWORD PTR -16[rbp]
	cmp	DWORD PTR -12[rbp], eax
	je	.L12
	mov	eax, DWORD PTR -20[rbp]
	xor	eax, DWORD PTR -16[rbp]
	mov	ecx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -12[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	movss	xmm0, DWORD PTR .LC2[rip]
	jmp	.L10
.L12:
	cmp	DWORD PTR -8[rbp], 170
	je	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -8[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	movss	xmm0, DWORD PTR .LC2[rip]
	jmp	.L10
.L13:
	mov	eax, DWORD PTR -20[rbp]
	sal	eax, 8
	or	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR -4[rbp], eax
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, DWORD PTR -4[rbp]
	pxor	xmm1, xmm1
	cvtss2sd	xmm1, xmm0
	movsd	xmm0, QWORD PTR .LC6[rip]
	mulsd	xmm0, xmm1
	movsd	xmm1, QWORD PTR .LC7[rip]
	divsd	xmm0, xmm1
	cvtsd2ss	xmm0, xmm0
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_voltage, .-read_voltage
	.section	.rodata
.LC8:
	.string	"/dev/i2c-1"
.LC9:
	.string	"Failed to open i2c device"
.LC10:
	.string	"Failed to set I2C address"
.LC11:
	.string	"V = %f\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	esi, 2
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], 0
	jns	.L15
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 66
	mov	esi, 1795
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	test	eax, eax
	jns	.L16
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	read_voltage
	movd	eax, xmm0
	mov	DWORD PTR -4[rbp], eax
	pxor	xmm1, xmm1
	cvtss2sd	xmm1, DWORD PTR -4[rbp]
	movq	rax, xmm1
	movq	xmm0, rax
	lea	rdi, .LC11[rip]
	mov	eax, 1
	call	printf@PLT
	mov	edi, 1
	call	sleep@PLT
	jmp	.L16
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
	.align 4
.LC2:
	.long	2143289344
	.align 8
.LC6:
	.long	0
	.long	1075052544
	.align 8
.LC7:
	.long	0
	.long	1083179008
	.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	"264545.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Failed to write to I2C bus\000"
	.align	2
.LC1:
	.ascii	"Failed to read from I2C bus\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_register, %function
read_register:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r3, r1
	strb	r3, [fp, #-17]
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldrb	r3, [fp, #-17]
	strb	r3, [fp, #-12]
	sub	r3, fp, #12
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L7+4
	bl	perror
	mvn	r3, #0
	b	.L5
.L2:
	sub	r3, fp, #12
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	read
	mov	r3, r0
	cmp	r3, #1
	beq	.L4
	ldr	r0, .L7+8
	bl	perror
	mvn	r3, #0
	b	.L5
.L4:
	ldrb	r3, [fp, #-12]	@ zero_extendqisi2
.L5:
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	read_register, .-read_register
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Received wrong initiator: %02x\000"
	.align	2
.LC4:
	.ascii	"Received wrong checksum: 0x%02x != 0x%02x\000"
	.align	2
.LC5:
	.ascii	"Received wrong terminator: %02x\000"
	.global	__aeabi_i2f
	.global	__aeabi_f2d
	.global	__aeabi_dmul
	.global	__aeabi_ddiv
	.global	__aeabi_d2f
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_voltage, %function
read_voltage:
	@ 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]
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	read_register
	str	r0, [fp, #-28]
	mov	r1, #1
	ldr	r0, [fp, #-32]
	bl	read_register
	str	r0, [fp, #-24]
	mov	r1, #2
	ldr	r0, [fp, #-32]
	bl	read_register
	str	r0, [fp, #-20]
	mov	r1, #3
	ldr	r0, [fp, #-32]
	bl	read_register
	str	r0, [fp, #-16]
	mov	r1, #4
	ldr	r0, [fp, #-32]
	bl	read_register
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	blt	.L10
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	blt	.L10
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L10
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	blt	.L10
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L11
.L10:
	ldr	r3, .L16
	b	.L12
.L11:
	ldr	r3, [fp, #-28]
	cmp	r3, #255
	beq	.L13
	ldr	r3, .L16+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	ldr	r1, .L16+8
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L16
	b	.L12
.L13:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	eor	r3, r3, r2
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	beq	.L14
	ldr	r3, .L16+4
	ldr	r0, [r3]
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	eor	r3, r3, r2
	ldr	r2, [fp, #-16]
	ldr	r1, .L16+12
	bl	fprintf
	ldr	r3, .L16
	b	.L12
.L14:
	ldr	r3, [fp, #-12]
	cmp	r3, #170
	beq	.L15
	ldr	r3, .L16+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, .L16+16
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L16
	b	.L12
.L15:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #8
	ldr	r2, [fp, #-20]
	orr	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	__aeabi_i2f
	mov	r3, r0
	mov	r0, r3
	bl	__aeabi_f2d
	mov	r2, #0
	ldr	r3, .L16+20
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L16+24
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2f
	mov	r3, r0
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	2143289344
	.word	stderr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	1075052544
	.word	1083179008
	.size	read_voltage, .-read_voltage
	.section	.rodata
	.align	2
.LC6:
	.ascii	"/dev/i2c-1\000"
	.align	2
.LC7:
	.ascii	"Failed to open i2c device\000"
	.align	2
.LC8:
	.ascii	"Failed to set I2C address\000"
	.align	2
.LC9:
	.ascii	"V = %f\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r1, #2
	ldr	r0, .L21
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L19
	ldr	r0, .L21+4
	bl	perror
	mov	r0, #1
	bl	exit
.L19:
	mov	r2, #66
	ldr	r1, .L21+8
	ldr	r0, [fp, #-12]
	bl	ioctl
	mov	r3, r0
	cmp	r3, #0
	bge	.L20
	ldr	r0, .L21+12
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	ldr	r0, [fp, #-12]
	bl	read_voltage
	str	r0, [fp, #-8]	@ float
	ldr	r0, [fp, #-8]	@ float
	bl	__aeabi_f2d
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L21+16
	bl	printf
	mov	r0, #1
	bl	sleep
	b	.L20
.L22:
	.align	2
.L21:
	.word	.LC6
	.word	.LC7
	.word	1795
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
