	.file	"50139035.c"
	.intel_syntax noprefix
	.text
	.local	fdw
	.comm	fdw,44,32
	.globl	fd
	.bss
	.align 8
	.type	fd, @object
	.size	fd, 8
fd:
	.zero	8
	.globl	y8
	.type	y8, @object
	.size	y8, 1
y8:
	.zero	1
	.globl	y16
	.align 2
	.type	y16, @object
	.size	y16, 2
y16:
	.zero	2
	.section	.rodata
.LC0:
	.string	"wb"
.LC1:
	.string	"fopen():error en genwav()"
	.align 8
.LC4:
	.string	"savewav() error: no 16 u 8 bits"
	.text
	.globl	savewav
	.type	savewav, @function
savewav:
.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, 64
	movsd	QWORD PTR -24[rbp], xmm0
	movsd	QWORD PTR -32[rbp], xmm1
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR fd[rip], rax
	mov	rax, QWORD PTR fd[rip]
	test	rax, rax
	jne	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
.L2:
	mov	DWORD PTR fdw[rip], 1179011410
	mov	DWORD PTR fdw[rip+8], 1163280727
	mov	DWORD PTR fdw[rip+12], 544501094
	mov	DWORD PTR fdw[rip+16], 16
	mov	WORD PTR fdw[rip+20], 1
	mov	WORD PTR fdw[rip+22], 1
	movsd	xmm0, QWORD PTR -32[rbp]
	cvttsd2si	eax, xmm0
	mov	DWORD PTR fdw[rip+24], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	WORD PTR fdw[rip+34], ax
	mov	edx, DWORD PTR fdw[rip+24]
	movzx	eax, WORD PTR fdw[rip+22]
	cwde
	imul	edx, eax
	movzx	eax, WORD PTR fdw[rip+34]
	cwde
	imul	eax, edx
	lea	edx, 7[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 3
	mov	DWORD PTR fdw[rip+28], eax
	movzx	eax, WORD PTR fdw[rip+22]
	movsx	edx, ax
	movzx	eax, WORD PTR fdw[rip+34]
	cwde
	imul	eax, edx
	lea	edx, 7[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 3
	mov	WORD PTR fdw[rip+32], ax
	mov	DWORD PTR fdw[rip+36], 1635017060
	movsd	xmm0, QWORD PTR -24[rbp]
	cvttsd2si	edx, xmm0
	movzx	eax, WORD PTR fdw[rip+22]
	cwde
	imul	edx, eax
	movzx	eax, WORD PTR fdw[rip+34]
	cwde
	imul	eax, edx
	lea	edx, 7[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 3
	mov	DWORD PTR fdw[rip+40], eax
	mov	eax, DWORD PTR fdw[rip+16]
	lea	edx, 12[rax]
	mov	eax, DWORD PTR fdw[rip+40]
	add	eax, 8
	add	eax, edx
	mov	DWORD PTR fdw[rip+4], eax
	mov	rax, QWORD PTR fd[rip]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 44
	lea	rdi, fdw[rip]
	call	fwrite@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L3
.L8:
	movzx	eax, WORD PTR fdw[rip+34]
	cmp	ax, 8
	jne	.L4
	mov	eax, DWORD PTR -4[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	movsd	xmm1, QWORD PTR [rax]
	movsd	xmm0, QWORD PTR .LC2[rip]
	mulsd	xmm1, xmm0
	movsd	xmm0, QWORD PTR .LC2[rip]
	addsd	xmm0, xmm1
	cvttsd2si	eax, xmm0
	mov	BYTE PTR y8[rip], al
	mov	rax, QWORD PTR fd[rip]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 1
	lea	rdi, y8[rip]
	call	fwrite@PLT
	jmp	.L5
.L4:
	movzx	eax, WORD PTR fdw[rip+34]
	cmp	ax, 16
	jne	.L6
	mov	eax, DWORD PTR -4[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	movsd	xmm1, QWORD PTR [rax]
	movsd	xmm0, QWORD PTR .LC3[rip]
	mulsd	xmm0, xmm1
	cvttsd2si	eax, xmm0
	mov	WORD PTR y16[rip], ax
	mov	rax, QWORD PTR fd[rip]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 2
	lea	rdi, y16[rip]
	call	fwrite@PLT
	jmp	.L5
.L6:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	rax, QWORD PTR fd[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
	jmp	.L7
.L5:
	add	DWORD PTR -4[rbp], 1
.L3:
	movsd	xmm0, QWORD PTR -24[rbp]
	cvttsd2si	eax, xmm0
	cmp	DWORD PTR -4[rbp], eax
	jb	.L8
	mov	rax, QWORD PTR fd[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	savewav, .-savewav
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1080016896
	.align 8
.LC3:
	.long	0
	.long	1088421824
	.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	"50139035.c"
	.text
	.local	fdw
	.comm	fdw,44,4
	.comm	fd,4,4
	.comm	y8,1,1
	.comm	y16,2,2
	.section	.rodata
	.align	2
.LC0:
	.ascii	"wb\000"
	.align	2
.LC1:
	.ascii	"fopen():error en genwav()\000"
	.global	__aeabi_d2iz
	.global	__aeabi_dmul
	.global	__aeabi_dadd
	.global	__aeabi_d2uiz
	.align	2
.LC2:
	.ascii	"savewav() error: no 16 u 8 bits\000"
	.text
	.align	2
	.global	savewav
	.syntax unified
	.arm
	.fpu softvfp
	.type	savewav, %function
savewav:
	@ args = 12, 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, #-20]
	str	r1, [fp, #-16]
	str	r2, [fp, #-28]
	str	r3, [fp, #-24]
	ldr	r1, .L9
	ldr	r0, [fp, #8]
	bl	fopen
	mov	r3, r0
	ldr	r2, .L9+4
	str	r3, [r2]
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L9+8
	bl	puts
.L2:
	ldr	r3, .L9+12
	ldr	r2, .L9+16
	str	r2, [r3]
	ldr	r3, .L9+12
	ldr	r2, .L9+20
	str	r2, [r3, #8]
	ldr	r3, .L9+12
	ldr	r2, .L9+24
	str	r2, [r3, #12]
	ldr	r3, .L9+12
	mov	r2, #16
	str	r2, [r3, #16]
	ldr	r3, .L9+12
	mov	r2, #1
	strh	r2, [r3, #20]	@ movhi
	ldr	r3, .L9+12
	mov	r2, #1
	strh	r2, [r3, #22]	@ movhi
	sub	r1, fp, #28
	ldmia	r1, {r0-r1}
	bl	__aeabi_d2iz
	mov	r3, r0
	ldr	r2, .L9+12
	str	r3, [r2, #24]
	ldr	r3, [fp, #4]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	ldr	r2, .L9+12
	strh	r3, [r2, #34]	@ movhi
	ldr	r3, .L9+12
	ldr	r3, [r3, #24]
	ldr	r2, .L9+12
	ldrsh	r2, [r2, #22]
	mul	r3, r2, r3
	ldr	r2, .L9+12
	ldrsh	r2, [r2, #34]
	mul	r3, r2, r3
	add	r2, r3, #7
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #3
	mov	r2, r3
	ldr	r3, .L9+12
	str	r2, [r3, #28]
	ldr	r3, .L9+12
	ldrsh	r3, [r3, #22]
	mov	r2, r3
	ldr	r3, .L9+12
	ldrsh	r3, [r3, #34]
	mul	r3, r2, r3
	add	r2, r3, #7
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	ldr	r2, .L9+12
	strh	r3, [r2, #32]	@ movhi
	ldr	r3, .L9+12
	ldr	r2, .L9+28
	str	r2, [r3, #36]
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	bl	__aeabi_d2iz
	mov	r3, r0
	ldr	r2, .L9+12
	ldrsh	r2, [r2, #22]
	mul	r3, r2, r3
	ldr	r2, .L9+12
	ldrsh	r2, [r2, #34]
	mul	r3, r2, r3
	add	r2, r3, #7
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #3
	mov	r2, r3
	ldr	r3, .L9+12
	str	r2, [r3, #40]
	ldr	r3, .L9+12
	ldr	r3, [r3, #16]
	add	r2, r3, #12
	ldr	r3, .L9+12
	ldr	r3, [r3, #40]
	add	r3, r3, #8
	add	r3, r2, r3
	ldr	r2, .L9+12
	str	r3, [r2, #4]
	ldr	r3, .L9+4
	ldr	r3, [r3]
	mov	r2, #1
	mov	r1, #44
	ldr	r0, .L9+12
	bl	fwrite
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L3
.L8:
	ldr	r3, .L9+12
	ldrsh	r3, [r3, #34]
	cmp	r3, #8
	bne	.L4
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	ldr	r2, [fp, #12]
	add	r3, r2, r3
	ldmia	r3, {r0-r1}
	mov	r2, #0
	ldr	r3, .L9+32
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L9+32
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2uiz
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, .L9+36
	strb	r2, [r3]
	ldr	r3, .L9+4
	ldr	r3, [r3]
	mov	r2, #1
	mov	r1, #1
	ldr	r0, .L9+36
	bl	fwrite
	b	.L5
.L4:
	ldr	r3, .L9+12
	ldrsh	r3, [r3, #34]
	cmp	r3, #16
	bne	.L6
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	ldr	r2, [fp, #12]
	add	r3, r2, r3
	ldmia	r3, {r0-r1}
	mov	r2, #0
	ldr	r3, .L9+40
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2uiz
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L9+44
	strh	r3, [r2]	@ movhi
	ldr	r3, .L9+4
	ldr	r3, [r3]
	mov	r2, #1
	mov	r1, #2
	ldr	r0, .L9+44
	bl	fwrite
	b	.L5
.L6:
	ldr	r0, .L9+48
	bl	puts
	ldr	r3, .L9+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	mov	r3, #1
	b	.L7
.L5:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L3:
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	bl	__aeabi_d2iz
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-8]
	cmp	r3, r2
	bcc	.L8
	ldr	r3, .L9+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	mov	r3, #0
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.word	fd
	.word	.LC1
	.word	fdw
	.word	1179011410
	.word	1163280727
	.word	544501094
	.word	1635017060
	.word	1080016896
	.word	y8
	.word	1088421824
	.word	y16
	.word	.LC2
	.size	savewav, .-savewav
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
