	.file	"944620.c"
	.intel_syntax noprefix
	.text
	.data
	.align 2
	.type	ctr, @object
	.size	ctr, 2
ctr:
	.value	-1
	.local	prev
	.comm	prev,32,32
	.text
	.globl	append
	.type	append, @function
append:
.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	QWORD PTR -24[rbp], rdi
	mov	eax, esi
	mov	BYTE PTR -28[rbp], al
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -28[rbp]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	append, .-append
	.globl	ret
	.type	ret, @function
ret:
.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
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, prev[rip]
	call	strcpy@PLT
	lea	rax, prev[rip]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	ret, .-ret
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"headsetcontrol -b -c"
.LC2:
	.string	"Off"
.LC3:
	.string	"Charging"
.LC5:
	.string	"%ld%% (~%.2fh)"
.LC6:
	.string	"idk m8"
	.text
	.globl	headsetcontrol
	.type	headsetcontrol, @function
headsetcontrol:
.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, 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	movzx	eax, WORD PTR ctr[rip]
	add	eax, 1
	mov	WORD PTR ctr[rip], ax
	movzx	ecx, WORD PTR ctr[rip]
	movsx	eax, cx
	imul	eax, eax, -30583
	shr	eax, 16
	add	eax, ecx
	sar	ax, 5
	mov	esi, ecx
	sar	si, 15
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 4
	sub	eax, edx
	sal	eax, 2
	sub	ecx, eax
	mov	edx, ecx
	test	dx, dx
	je	.L5
	lea	rax, prev[rip]
	jmp	.L14
.L5:
	mov	WORD PTR ctr[rip], 0
	mov	QWORD PTR -56[rbp], 0
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	popen@PLT
	mov	QWORD PTR -80[rbp], rax
	cmp	QWORD PTR -80[rbp], 0
	jne	.L8
	mov	eax, 0
	jmp	.L14
.L9:
	movsx	edx, BYTE PTR -81[rbp]
	lea	rax, -56[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	append
.L8:
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -81[rbp], al
	cmp	BYTE PTR -81[rbp], -1
	jne	.L9
	lea	rax, -56[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L10
	lea	rdi, .LC2[rip]
	call	ret
	jmp	.L14
.L10:
	lea	rax, -56[rbp]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	QWORD PTR -72[rbp], rax
	cmp	QWORD PTR -72[rbp], -2
	jne	.L11
	lea	rdi, .LC2[rip]
	call	ret
	jmp	.L14
.L11:
	cmp	QWORD PTR -72[rbp], -1
	jne	.L12
	lea	rdi, .LC3[rip]
	call	ret
	jmp	.L14
.L12:
	cmp	QWORD PTR -72[rbp], 0
	js	.L13
	cmp	QWORD PTR -72[rbp], 100
	jg	.L13
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, QWORD PTR -72[rbp]
	movsd	xmm0, QWORD PTR .LC4[rip]
	mulsd	xmm0, xmm1
	movsd	QWORD PTR -64[rbp], xmm0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	mov	rcx, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR -72[rbp]
	lea	rax, -48[rbp]
	movq	xmm0, rcx
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 1
	call	sprintf@PLT
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	ret
	jmp	.L14
.L13:
	lea	rdi, .LC6[rip]
	call	ret
.L14:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	headsetcontrol, .-headsetcontrol
	.section	.rodata
	.align 8
.LC4:
	.long	1202590843
	.long	1069841121
	.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	"944620.c"
	.text
	.data
	.align	1
	.type	ctr, %object
	.size	ctr, 2
ctr:
	.short	-1
	.local	prev
	.comm	prev,32,4
	.text
	.align	2
	.global	append
	.syntax unified
	.arm
	.fpu softvfp
	.type	append, %function
append:
	@ 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	r0, [fp, #-16]
	bl	strlen
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r2, [fp, #-17]
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	append, .-append
	.align	2
	.global	ret
	.syntax unified
	.arm
	.fpu softvfp
	.type	ret, %function
ret:
	@ 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	r1, [fp, #-8]
	ldr	r0, .L4
	bl	strcpy
	ldr	r3, .L4
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	prev
	.size	ret, .-ret
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"headsetcontrol -b -c\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	headsetcontrol
	.syntax unified
	.arm
	.fpu softvfp
	.type	headsetcontrol, %function
headsetcontrol:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L15+4
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	add	r3, r3, #1
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	lsl	r3, r3, #16
	asr	r3, r3, #16
	ldr	r2, .L15+4
	strh	r3, [r2]	@ movhi
	ldr	r3, .L15+4
	ldrsh	r2, [r3]
	ldr	r3, .L15+8
	smull	r1, r3, r2, r3
	add	r3, r3, r2
	asr	r1, r3, #5
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #4
	sub	r3, r3, r1
	lsl	r3, r3, #2
	sub	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L15+12
	b	.L12
.L7:
	ldr	r3, .L15+4
	mov	r2, #0
	strh	r2, [r3]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r1, .L15+16
	ldr	r0, .L15+20
	bl	popen
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L10
	mov	r3, #0
	b	.L12
.L14:
	ldrb	r2, [fp, #-45]	@ zero_extendqisi2
	sub	r3, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	append
.L10:
	ldr	r0, [fp, #-44]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-45]
	b	.L14
.L12:
	ldr	r2, .L15
	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}
.L16:
	.align	2
.L15:
	.word	.LC2
	.word	ctr
	.word	-2004318071
	.word	prev
	.word	.LC0
	.word	.LC1
	.size	headsetcontrol, .-headsetcontrol
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
