	.file	"36144.c"
	.intel_syntax noprefix
	.text
	.globl	read_file
	.type	read_file, @function
read_file:
.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, 208
	mov	QWORD PTR -200[rbp], rdi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -176[rbp], 0
	mov	rax, QWORD PTR -200[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -184[rbp], eax
	cmp	DWORD PTR -184[rbp], 0
	jns	.L2
	mov	eax, 0
	jmp	.L8
.L2:
	lea	rdx, -160[rbp]
	mov	eax, DWORD PTR -184[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fstat@PLT
	test	eax, eax
	js	.L10
	mov	rax, QWORD PTR -112[rbp]
	mov	QWORD PTR -168[rbp], rax
	mov	rax, QWORD PTR -168[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -176[rbp], rax
	cmp	QWORD PTR -176[rbp], 0
	je	.L11
	mov	rdx, QWORD PTR -168[rbp]
	mov	rcx, QWORD PTR -176[rbp]
	mov	eax, DWORD PTR -184[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -180[rbp], eax
	mov	eax, DWORD PTR -180[rbp]
	cdqe
	cmp	QWORD PTR -168[rbp], rax
	jne	.L12
	mov	rax, QWORD PTR -208[rbp]
	mov	rdx, QWORD PTR -168[rbp]
	mov	QWORD PTR [rax], rdx
	jmp	.L5
.L10:
	nop
	jmp	.L5
.L11:
	nop
	jmp	.L5
.L12:
	nop
.L5:
	mov	eax, DWORD PTR -184[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -176[rbp]
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_file, .-read_file
	.globl	truncate_sysfs_path
	.type	truncate_sysfs_path, @function
truncate_sysfs_path:
.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	QWORD PTR -40[rbp], rdx
	mov	DWORD PTR -32[rbp], ecx
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	DWORD PTR -12[rbp], 0
	jmp	.L14
.L17:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	jmp	.L15
.L16:
	sub	QWORD PTR -8[rbp], 1
.L15:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L16
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -12[rbp], 1
.L14:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L17
	mov	rax, QWORD PTR -40[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	truncate_sysfs_path, .-truncate_sysfs_path
	.section	.rodata
.LC0:
	.string	"/sys%s/%s"
	.text
	.globl	read_sysfs_var
	.type	read_sysfs_var, @function
read_sysfs_var:
.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, 320
	mov	QWORD PTR -296[rbp], rdi
	mov	QWORD PTR -304[rbp], rsi
	mov	QWORD PTR -312[rbp], rdx
	mov	QWORD PTR -320[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rcx, QWORD PTR -320[rbp]
	mov	rdx, QWORD PTR -312[rbp]
	lea	rax, -272[rbp]
	mov	r8, rcx
	mov	rcx, rdx
	lea	rdx, .LC0[rip]
	mov	esi, 255
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rdx, -288[rbp]
	lea	rax, -272[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	read_file
	mov	QWORD PTR -280[rbp], rax
	mov	rax, QWORD PTR -280[rbp]
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -280[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	rdx, QWORD PTR -304[rbp]
	mov	rcx, QWORD PTR -280[rbp]
	mov	rax, QWORD PTR -296[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	rax, QWORD PTR -280[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -296[rbp]
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	read_sysfs_var, .-read_sysfs_var
	.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	"36144.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_file, %function
read_file:
	@ args = 0, pretend = 0, frame = 120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #120
	str	r0, [fp, #-120]
	str	r1, [fp, #-124]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-116]
	mov	r1, #0
	ldr	r0, [fp, #-120]
	bl	open
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bge	.L2
	mov	r3, #0
	b	.L8
.L2:
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	fstat
	mov	r3, r0
	cmp	r3, #0
	blt	.L10
	ldr	r3, [fp, #-56]
	str	r3, [fp, #-108]
	ldr	r3, [fp, #-108]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	beq	.L11
	ldr	r3, [fp, #-108]
	mov	r2, r3
	ldr	r1, [fp, #-116]
	ldr	r0, [fp, #-112]
	bl	read
	str	r0, [fp, #-104]
	ldr	r2, [fp, #-104]
	ldr	r3, [fp, #-108]
	cmp	r2, r3
	bne	.L12
	ldr	r3, [fp, #-124]
	ldr	r2, [fp, #-108]
	str	r2, [r3]
	b	.L5
.L10:
	nop
	b	.L5
.L11:
	nop
	b	.L5
.L12:
	nop
.L5:
	ldr	r0, [fp, #-112]
	bl	close
	ldr	r3, [fp, #-116]
.L8:
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC0
	.size	read_file, .-read_file
	.align	2
	.global	truncate_sysfs_path
	.syntax unified
	.arm
	.fpu softvfp
	.type	truncate_sysfs_path, %function
truncate_sysfs_path:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-24]
	bl	strncpy
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L16
.L19:
	ldr	r0, [fp, #-24]
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-24]
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	b	.L17
.L18:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
.L17:
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L18
	ldr	r3, [fp, #-8]
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L16:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	blt	.L19
	ldr	r3, [fp, #-24]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	truncate_sysfs_path, .-truncate_sysfs_path
	.section	.rodata
	.align	2
.LC1:
	.ascii	"/sys%s/%s\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_sysfs_var
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_sysfs_var, %function
read_sysfs_var:
	@ args = 0, pretend = 0, frame = 288
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #296
	str	r0, [fp, #-280]
	str	r1, [fp, #-284]
	str	r2, [fp, #-288]
	str	r3, [fp, #-292]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #264
	ldr	r3, [fp, #-292]
	str	r3, [sp]
	ldr	r3, [fp, #-288]
	ldr	r2, .L24+4
	mov	r1, #255
	bl	snprintf
	sub	r2, fp, #272
	sub	r3, fp, #264
	mov	r1, r2
	mov	r0, r3
	bl	read_file
	str	r0, [fp, #-268]
	ldr	r0, [fp, #-268]
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	ldr	r2, [fp, #-268]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r2, [fp, #-284]
	ldr	r1, [fp, #-268]
	ldr	r0, [fp, #-280]
	bl	strncpy
	ldr	r0, [fp, #-268]
	bl	free
	ldr	r3, [fp, #-280]
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC2
	.word	.LC1
	.size	read_sysfs_var, .-read_sysfs_var
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
