	.file	"42448.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"ayfreq freq"
.LC1:
	.string	""
	.align 8
.LC2:
	.string	"\tGiven a 'freq' in Hz, which is the frequency at which the AY-3-8912"
	.align 8
.LC3:
	.string	"works for a given computer, calculates the period for each musical note that"
	.align 8
.LC4:
	.string	"can be passed to the chip tone registers, and generates it on the console."
	.align 8
.LC5:
	.string	"For the CPC, pass 1000000. For the ZX Spectrum, pass 1773400."
	.section	.data.rel.local,"aw"
	.align 32
	.type	s_help, @object
	.size	s_help, 56
s_help:
	.quad	.LC0
	.quad	.LC1
	.quad	.LC2
	.quad	.LC3
	.quad	.LC4
	.quad	.LC1
	.quad	.LC5
	.text
	.type	print_help, @function
print_help:
.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, 16
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, s_help[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, 6
	jbe	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	print_help, .-print_help
	.section	.rodata
.LC6:
	.string	"A"
.LC7:
	.string	"AS"
.LC8:
	.string	"B"
.LC9:
	.string	"C"
.LC10:
	.string	"CS"
.LC11:
	.string	"D"
.LC12:
	.string	"DS"
.LC13:
	.string	"E"
.LC14:
	.string	"F"
.LC15:
	.string	"FS"
.LC16:
	.string	"G"
.LC17:
	.string	"GS"
	.section	.data.rel.local
	.align 32
	.type	notes, @object
	.size	notes, 96
notes:
	.quad	.LC6
	.quad	.LC7
	.quad	.LC8
	.quad	.LC9
	.quad	.LC10
	.quad	.LC11
	.quad	.LC12
	.quad	.LC13
	.quad	.LC14
	.quad	.LC15
	.quad	.LC16
	.quad	.LC17
	.section	.rodata
.LC18:
	.string	"Bad input Hz."
.LC23:
	.string	"Y%s%d\t.equ %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -68[rbp], 2
	je	.L5
	mov	eax, 0
	call	print_help
	mov	eax, 1
	jmp	.L14
.L5:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rcx, -40[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -52[rbp], eax
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -40[rbp]
	cmp	rdx, rax
	je	.L7
	cmp	DWORD PTR -52[rbp], 0
	jns	.L8
.L7:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 13
	mov	esi, 1
	lea	rdi, .LC18[rip]
	call	fwrite@PLT
	mov	eax, 0
	call	print_help
	mov	eax, 1
	jmp	.L14
.L8:
	movsd	xmm0, QWORD PTR .LC19[rip]
	movsd	QWORD PTR -16[rbp], xmm0
	mov	DWORD PTR -60[rbp], 0
	mov	DWORD PTR -56[rbp], 0
	movsd	xmm0, QWORD PTR .LC20[rip]
	movsd	QWORD PTR -24[rbp], xmm0
	movsd	xmm0, QWORD PTR -24[rbp]
	movsd	QWORD PTR -32[rbp], xmm0
	mov	DWORD PTR -48[rbp], -1
.L13:
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, DWORD PTR -52[rbp]
	movsd	xmm2, QWORD PTR -32[rbp]
	movsd	xmm1, QWORD PTR .LC21[rip]
	mulsd	xmm2, xmm1
	movapd	xmm1, xmm0
	divsd	xmm1, xmm2
	movsd	xmm0, QWORD PTR .LC22[rip]
	addsd	xmm0, xmm1
	cvttsd2si	eax, xmm0
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jle	.L17
	mov	eax, DWORD PTR -44[rbp]
	mov	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, notes[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	ecx, DWORD PTR -44[rbp]
	mov	edx, DWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
	movsd	xmm0, QWORD PTR -32[rbp]
	mulsd	xmm0, QWORD PTR -16[rbp]
	movsd	QWORD PTR -32[rbp], xmm0
	add	DWORD PTR -60[rbp], 1
	cmp	DWORD PTR -60[rbp], 3
	jne	.L11
	add	DWORD PTR -56[rbp], 1
	jmp	.L13
.L11:
	cmp	DWORD PTR -60[rbp], 12
	jne	.L13
	mov	DWORD PTR -60[rbp], 0
	movsd	xmm0, QWORD PTR -24[rbp]
	addsd	xmm0, xmm0
	movsd	QWORD PTR -24[rbp], xmm0
	movsd	xmm0, QWORD PTR -24[rbp]
	movsd	QWORD PTR -32[rbp], xmm0
	jmp	.L13
.L17:
	nop
	mov	eax, 0
.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
.LFE7:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC19:
	.long	-1831241373
	.long	1072755599
	.align 8
.LC20:
	.long	0
	.long	1077641216
	.align 8
.LC21:
	.long	0
	.long	1076887552
	.align 8
.LC22:
	.long	0
	.long	1071644672
	.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	"42448.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ayfreq freq\000"
	.align	2
.LC1:
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"\011Given a 'freq' in Hz, which is the frequency at"
	.ascii	" which the AY-3-8912\000"
	.align	2
.LC3:
	.ascii	"works for a given computer, calculates the period f"
	.ascii	"or each musical note that\000"
	.align	2
.LC4:
	.ascii	"can be passed to the chip tone registers, and gener"
	.ascii	"ates it on the console.\000"
	.align	2
.LC5:
	.ascii	"For the CPC, pass 1000000. For the ZX Spectrum, pas"
	.ascii	"s 1773400.\000"
	.data
	.align	2
	.type	s_help, %object
	.size	s_help, 28
s_help:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC1
	.word	.LC5
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_help, %function
print_help:
	@ 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	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r2, .L4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #6
	bls	.L3
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	s_help
	.size	print_help, .-print_help
	.section	.rodata
	.align	2
.LC6:
	.ascii	"A\000"
	.align	2
.LC7:
	.ascii	"AS\000"
	.align	2
.LC8:
	.ascii	"B\000"
	.align	2
.LC9:
	.ascii	"C\000"
	.align	2
.LC10:
	.ascii	"CS\000"
	.align	2
.LC11:
	.ascii	"D\000"
	.align	2
.LC12:
	.ascii	"DS\000"
	.align	2
.LC13:
	.ascii	"E\000"
	.align	2
.LC14:
	.ascii	"F\000"
	.align	2
.LC15:
	.ascii	"FS\000"
	.align	2
.LC16:
	.ascii	"G\000"
	.align	2
.LC17:
	.ascii	"GS\000"
	.data
	.align	2
	.type	notes, %object
	.size	notes, 48
notes:
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.section	.rodata
	.align	2
.LC18:
	.ascii	"Bad input Hz.\000"
	.global	__aeabi_i2d
	.global	__aeabi_dmul
	.global	__aeabi_ddiv
	.global	__aeabi_dadd
	.global	__aeabi_d2iz
	.align	2
.LC19:
	.ascii	"Y%s%d\011.equ %d\012\000"
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #64
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-72]
	cmp	r3, #2
	beq	.L7
	bl	print_help
	mov	r3, #1
	b	.L16
.L7:
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r1, fp, #68
	mov	r2, #0
	mov	r0, r3
	bl	strtol
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	ldr	r2, [r3]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	beq	.L9
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bge	.L10
.L9:
	ldr	r3, .L20+4
	ldr	r3, [r3]
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L20+8
	bl	fwrite
	bl	print_help
	mov	r3, #1
	b	.L16
.L10:
	ldr	r2, .L20+12
	ldr	r3, .L20+16
	str	r2, [fp, #-28]
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-64]
	mov	r3, #0
	str	r3, [fp, #-60]
	mov	r2, #0
	ldr	r3, .L20+20
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	mvn	r3, #0
	str	r3, [fp, #-52]
.L15:
	ldr	r0, [fp, #-56]
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	mov	r2, #0
	ldr	r3, .L20+24
	sub	r1, fp, #44
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L20+28
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2iz
	mov	r3, r0
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	ble	.L19
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-52]
	ldr	r2, .L20+32
	ldr	r3, [fp, #-64]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-60]
	ldr	r0, .L20+36
	bl	printf
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	sub	r1, fp, #44
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmp	r3, #3
	bne	.L13
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
	b	.L15
.L13:
	ldr	r3, [fp, #-64]
	cmp	r3, #12
	bne	.L15
	mov	r3, #0
	str	r3, [fp, #-64]
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	mov	r2, r0
	mov	r3, r1
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	b	.L15
.L19:
	nop
	mov	r3, #0
.L16:
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC20
	.word	stderr
	.word	.LC18
	.word	-1831241373
	.word	1072755599
	.word	1077641216
	.word	1076887552
	.word	1071644672
	.word	notes
	.word	.LC19
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
