	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function waveangle
LCPI0_0:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_waveangle:                             ## @waveangle
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	movsd	%xmm1, -32(%rbp)                ## 8-byte Spill
	movq	_EARTHRADIUS@GOTPCREL(%rip), %rax
	movsd	(%rax), %xmm2                   ## xmm2 = mem[0],zero
	movsd	%xmm2, -24(%rbp)                ## 8-byte Spill
	leal	(%rbx,%rbx), %eax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
	mulsd	%xmm2, %xmm1
	movsd	%xmm0, -40(%rbp)                ## 8-byte Spill
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)                ## 8-byte Spill
	callq	_sin
	mulsd	-24(%rbp), %xmm0                ## 8-byte Folded Reload
	movsd	-32(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	divsd	%xmm0, %xmm1
	movsd	%xmm1, -24(%rbp)                ## 8-byte Spill
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	mulsd	-16(%rbp), %xmm0                ## 8-byte Folded Reload
	callq	_tan
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	addsd	-24(%rbp), %xmm0                ## 8-byte Folded Reload
	cvttsd2si	%xmm0, %rdi
	callq	_atan
	subsd	-16(%rbp), %xmm0                ## 8-byte Folded Reload
	movq	_debug@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jl	LBB0_2
## %bb.1:
	movq	_RADPERDEG@GOTPCREL(%rip), %rax
	movapd	%xmm0, %xmm2
	divsd	(%rax), %xmm2
	leaq	L_.str(%rip), %rdi
	movsd	%xmm0, -16(%rbp)                ## 8-byte Spill
	movsd	-40(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	movsd	-32(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	movl	%ebx, %esi
	callq	_printf
	movsd	-16(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
LBB0_2:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EARTHRADIUS,8,3                ## @EARTHRADIUS
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waveangle dist %g height %g hops %d angle %g\n"

	.comm	_RADPERDEG,8,3                  ## @RADPERDEG
	.no_dead_strip	_waveangle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function waveangle
_waveangle:                             ; @waveangle
	.cfi_startproc
; %bb.0:
	stp	d11, d10, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset b8, -40
	.cfi_offset b9, -48
	.cfi_offset b10, -56
	.cfi_offset b11, -64
	mov	x19, x0
	fmov	d8, d1
	fmov	d9, d0
Lloh0:
	adrp	x8, _EARTHRADIUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EARTHRADIUS@GOTPAGEOFF]
Lloh2:
	ldr	d11, [x8]
	lsl	w8, w0, #1
	scvtf	d0, w8
	fmul	d0, d11, d0
	fdiv	d10, d9, d0
	fmov	d0, d10
	bl	_sin
	fmul	d1, d11, d0
	fmov	d0, #0.50000000
	fmul	d0, d10, d0
	fdiv	d11, d8, d1
	bl	_tan
	scvtf	d0, x0
	fadd	d0, d11, d0
	fcvtzs	x0, d0
	bl	_atan
	fsub	d10, d0, d10
Lloh3:
	adrp	x8, _debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #2
	b.lt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _RADPERDEG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RADPERDEG@GOTPAGEOFF]
Lloh8:
	ldr	d0, [x8]
	fdiv	d2, d10, d0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	fmov	d0, d9
	fmov	d1, d8
	mov	x1, x19
	bl	_printf
LBB0_2:
	fmov	d0, d10
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EARTHRADIUS,8,3                ; @EARTHRADIUS
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waveangle dist %g height %g hops %d angle %g\n"

	.comm	_RADPERDEG,8,3                  ; @RADPERDEG
	.no_dead_strip	_waveangle
.subsections_via_symbols
