Program: spirograph

x86 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function spirograph
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
LCPI0_1:
	.quad	0x400921fb54442d18              ## double 3.1415926535897931
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4
LCPI0_2:
	.long	1127219200                      ## 0x43300000
	.long	1160773632                      ## 0x45300000
	.long	0                               ## 0x0
	.long	0                               ## 0x0
LCPI0_3:
	.quad	0x4330000000000000              ## double 4503599627370496
	.quad	0x4530000000000000              ## double 1.9342813113834067E+25
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_spirograph
	.p2align	4, 0x90
_spirograph:                            ## @spirograph
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$160, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movsd	%xmm0, -24(%rbp)
	movsd	%xmm1, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movsd	%xmm2, -48(%rbp)
	movsd	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero
	addsd	%xmm0, %xmm0
	movsd	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	movaps	LCPI0_2(%rip), %xmm2            ## xmm2 = [1127219200,1160773632,0,0]
	movq	-40(%rbp), %xmm1                ## xmm1 = mem[0],zero
	punpckldq	%xmm2, %xmm1            ## xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
	movapd	LCPI0_3(%rip), %xmm2            ## xmm2 = [4.503599627370496E+15,1.9342813113834067E+25]
	subpd	%xmm2, %xmm1
	movaps	%xmm1, %xmm2
	unpckhpd	%xmm1, %xmm1                    ## xmm1 = xmm1[1,1]
	addsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -56(%rbp)
	xorps	%xmm0, %xmm0
	movsd	%xmm0, -64(%rbp)
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	movsd	%xmm0, -72(%rbp)
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	subsd	-32(%rbp), %xmm0
	movsd	%xmm0, -80(%rbp)
	movq	$0, -88(%rbp)
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	-88(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jae	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movsd	-72(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movsd	%xmm0, -128(%rbp)               ## 8-byte Spill
	movsd	-80(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movsd	%xmm0, -144(%rbp)               ## 8-byte Spill
	movsd	-64(%rbp), %xmm0                ## xmm0 = mem[0],zero
	callq	_libmin_cos
	movsd	%xmm0, -136(%rbp)               ## 8-byte Spill
	movsd	-24(%rbp), %xmm0                ## xmm0 = mem[0],zero
	mulsd	-32(%rbp), %xmm0
	movsd	%xmm0, -152(%rbp)               ## 8-byte Spill
	movsd	-80(%rbp), %xmm0                ## xmm0 = mem[0],zero
	mulsd	-64(%rbp), %xmm0
	divsd	-32(%rbp), %xmm0
	callq	_libmin_cos
	movsd	-152(%rbp), %xmm2               ## 8-byte Reload
                                        ## xmm2 = mem[0],zero
	movsd	-144(%rbp), %xmm1               ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	movsd	-136(%rbp), %xmm3               ## 8-byte Reload
                                        ## xmm3 = mem[0],zero
	movaps	%xmm0, %xmm4
	movsd	-128(%rbp), %xmm0               ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	mulsd	%xmm4, %xmm2
	mulsd	%xmm3, %xmm1
	addsd	%xmm2, %xmm1
	mulsd	%xmm1, %xmm0
	movq	-8(%rbp), %rax
	movq	-88(%rbp), %rcx
	movsd	%xmm0, (%rax,%rcx,8)
	movsd	-72(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movsd	%xmm0, -96(%rbp)                ## 8-byte Spill
	movsd	-80(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movsd	%xmm0, -112(%rbp)               ## 8-byte Spill
	movsd	-64(%rbp), %xmm0                ## xmm0 = mem[0],zero
	callq	_libmin_sin
	movsd	%xmm0, -104(%rbp)               ## 8-byte Spill
	movsd	-24(%rbp), %xmm0                ## xmm0 = mem[0],zero
	mulsd	-32(%rbp), %xmm0
	movsd	%xmm0, -120(%rbp)               ## 8-byte Spill
	movsd	-80(%rbp), %xmm0                ## xmm0 = mem[0],zero
	mulsd	-64(%rbp), %xmm0
	divsd	-32(%rbp), %xmm0
	callq	_libmin_sin
	movsd	-120(%rbp), %xmm2               ## 8-byte Reload
                                        ## xmm2 = mem[0],zero
	movsd	-112(%rbp), %xmm1               ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	movsd	-104(%rbp), %xmm3               ## 8-byte Reload
                                        ## xmm3 = mem[0],zero
	movaps	%xmm0, %xmm4
	movsd	-96(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	mulsd	%xmm4, %xmm2
	movq	%xmm2, %rax
	movabsq	$-9223372036854775808, %rcx     ## imm = 0x8000000000000000
	xorq	%rcx, %rax
	movq	%rax, %xmm2
	mulsd	%xmm3, %xmm1
	addsd	%xmm2, %xmm1
	mulsd	%xmm1, %xmm0
	movq	-16(%rbp), %rax
	movq	-88(%rbp), %rcx
	movsd	%xmm0, (%rax,%rcx,8)
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-88(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -88(%rbp)
	movsd	-56(%rbp), %xmm0                ## xmm0 = mem[0],zero
	addsd	-64(%rbp), %xmm0
	movsd	%xmm0, -64(%rbp)
	jmp	LBB0_1
LBB0_4:
	addq	$160, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function test
LCPI1_0:
	.quad	0x4024000000000000              ## double 10
LCPI1_1:
	.quad	0x3fe8000000000000              ## double 0.75
LCPI1_2:
	.quad	0x3fd3333333333333              ## double 0.29999999999999999
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_test
	.p2align	4, 0x90
_test:                                  ## @test
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$64, %rsp
	movq	$500, -8(%rbp)                  ## imm = 0x1F4
	movsd	LCPI1_2(%rip), %xmm0            ## xmm0 = mem[0],zero
	movsd	%xmm0, -16(%rbp)
	movsd	LCPI1_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	movsd	%xmm0, -24(%rbp)
	movsd	LCPI1_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	movsd	%xmm0, -32(%rbp)
	movq	-8(%rbp), %rdi
	shlq	$3, %rdi
	callq	_libmin_malloc
	movq	%rax, -40(%rbp)
	movq	-8(%rbp), %rdi
	shlq	$3, %rdi
	callq	_libmin_malloc
	movq	%rax, -48(%rbp)
	movq	-40(%rbp), %rdi
	movq	-48(%rbp), %rsi
	movsd	-16(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movsd	-24(%rbp), %xmm1                ## xmm1 = mem[0],zero
	movq	-8(%rbp), %rdx
	movsd	-32(%rbp), %xmm2                ## xmm2 = mem[0],zero
	callq	_spirograph
	movq	$0, -56(%rbp)
LBB1_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jae	LBB1_4
## %bb.2:                               ##   in Loop: Header=BB1_1 Depth=1
	movq	-40(%rbp), %rax
	movq	-56(%rbp), %rcx
	movsd	(%rax,%rcx,8), %xmm0            ## xmm0 = mem[0],zero
	movq	-48(%rbp), %rax
	movq	-56(%rbp), %rcx
	movsd	(%rax,%rcx,8), %xmm1            ## xmm1 = mem[0],zero
	leaq	L_.str(%rip), %rdi
	movb	$2, %al
	callq	_libmin_printf
## %bb.3:                               ##   in Loop: Header=BB1_1 Depth=1
	movq	-56(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -56(%rbp)
	jmp	LBB1_1
LBB1_4:
	movq	-40(%rbp), %rdi
	callq	_libmin_free
	movq	-48(%rbp), %rdi
	callq	_libmin_free
	addq	$64, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	movl	%edi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	callq	_test
	callq	_libmin_success
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%.5lf, %.5lf\n"

.subsections_via_symbols


ARM64 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function spirograph
lCPI0_0:
	.quad	0x400921fb54442d18              ; double 3.1415926535897931
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_spirograph
	.p2align	2
_spirograph:                            ; @spirograph
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	stur	x0, [x29, #-8]
	stur	x1, [x29, #-16]
	stur	d0, [x29, #-24]
	stur	d1, [x29, #-32]
	stur	x2, [x29, #-40]
	stur	d2, [x29, #-48]
	ldur	d0, [x29, #-48]
	fmov	d1, #2.00000000
	fmul	d0, d0, d1
	adrp	x8, lCPI0_0@PAGE
	ldr	d1, [x8, lCPI0_0@PAGEOFF]
	fmul	d0, d0, d1
	ldur	d1, [x29, #-40]
	ucvtf	d1, d1
	fdiv	d0, d0, d1
	stur	d0, [x29, #-56]
	movi	d0, #0000000000000000
	stur	d0, [x29, #-64]
	fmov	d0, #1.00000000
	stur	d0, [x29, #-72]
	ldur	d1, [x29, #-32]
	fsub	d0, d0, d1
	str	d0, [sp, #80]
	str	xzr, [sp, #72]
	b	LBB0_1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #72]
	ldur	x9, [x29, #-40]
	subs	x8, x8, x9
	cset	w8, hs
	tbnz	w8, #0, LBB0_4
	b	LBB0_2
LBB0_2:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldur	d0, [x29, #-72]
	str	d0, [sp, #32]                   ; 8-byte Folded Spill
	ldr	d0, [sp, #80]
	str	d0, [sp, #24]                   ; 8-byte Folded Spill
	ldur	d0, [x29, #-64]
	bl	_libmin_cos
	str	d0, [sp, #16]                   ; 8-byte Folded Spill
	ldur	d0, [x29, #-24]
	ldur	d1, [x29, #-32]
	fmul	d0, d0, d1
	str	d0, [sp, #8]                    ; 8-byte Folded Spill
	ldr	d0, [sp, #80]
	ldur	d1, [x29, #-64]
	fmul	d0, d0, d1
	ldur	d1, [x29, #-32]
	fdiv	d0, d0, d1
	bl	_libmin_cos
	ldr	d3, [sp, #8]                    ; 8-byte Folded Reload
	ldr	d2, [sp, #16]                   ; 8-byte Folded Reload
	ldr	d1, [sp, #24]                   ; 8-byte Folded Reload
	fmov	d4, d0
	ldr	d0, [sp, #32]                   ; 8-byte Folded Reload
	fmul	d3, d3, d4
	fmadd	d1, d1, d2, d3
	fmul	d0, d0, d1
	ldur	x8, [x29, #-8]
	ldr	x9, [sp, #72]
	str	d0, [x8, x9, lsl #3]
	ldur	d0, [x29, #-72]
	str	d0, [sp, #64]                   ; 8-byte Folded Spill
	ldr	d0, [sp, #80]
	str	d0, [sp, #56]                   ; 8-byte Folded Spill
	ldur	d0, [x29, #-64]
	bl	_libmin_sin
	str	d0, [sp, #48]                   ; 8-byte Folded Spill
	ldur	d0, [x29, #-24]
	ldur	d1, [x29, #-32]
	fmul	d0, d0, d1
	str	d0, [sp, #40]                   ; 8-byte Folded Spill
	ldr	d0, [sp, #80]
	ldur	d1, [x29, #-64]
	fmul	d0, d0, d1
	ldur	d1, [x29, #-32]
	fdiv	d0, d0, d1
	bl	_libmin_sin
	ldr	d3, [sp, #40]                   ; 8-byte Folded Reload
	ldr	d2, [sp, #48]                   ; 8-byte Folded Reload
	ldr	d1, [sp, #56]                   ; 8-byte Folded Reload
	fmov	d4, d0
	ldr	d0, [sp, #64]                   ; 8-byte Folded Reload
	fmul	d3, d3, d4
	fnmsub	d1, d1, d2, d3
	fmul	d0, d0, d1
	ldur	x8, [x29, #-16]
	ldr	x9, [sp, #72]
	str	d0, [x8, x9, lsl #3]
	b	LBB0_3
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [sp, #72]
	add	x8, x8, #1
	str	x8, [sp, #72]
	ldur	d1, [x29, #-56]
	ldur	d0, [x29, #-64]
	fadd	d0, d0, d1
	stur	d0, [x29, #-64]
	b	LBB0_1
LBB0_4:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function test
lCPI1_0:
	.quad	0x3fd3333333333333              ; double 0.29999999999999999
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_test
	.p2align	2
_test:                                  ; @test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	mov	x8, #500
	stur	x8, [x29, #-8]
	adrp	x8, lCPI1_0@PAGE
	ldr	d0, [x8, lCPI1_0@PAGEOFF]
	stur	d0, [x29, #-16]
	fmov	d0, #0.75000000
	stur	d0, [x29, #-24]
	fmov	d0, #10.00000000
	stur	d0, [x29, #-32]
	ldur	x8, [x29, #-8]
	lsl	x0, x8, #3
	bl	_libmin_malloc
	str	x0, [sp, #40]
	ldur	x8, [x29, #-8]
	lsl	x0, x8, #3
	bl	_libmin_malloc
	str	x0, [sp, #32]
	ldr	x0, [sp, #40]
	ldr	x1, [sp, #32]
	ldur	d0, [x29, #-16]
	ldur	d1, [x29, #-24]
	ldur	x2, [x29, #-8]
	ldur	d2, [x29, #-32]
	bl	_spirograph
	str	xzr, [sp, #24]
	b	LBB1_1
LBB1_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #24]
	ldur	x9, [x29, #-8]
	subs	x8, x8, x9
	cset	w8, hs
	tbnz	w8, #0, LBB1_4
	b	LBB1_2
LBB1_2:                                 ;   in Loop: Header=BB1_1 Depth=1
	ldr	x8, [sp, #40]
	ldr	x9, [sp, #24]
	ldr	d1, [x8, x9, lsl #3]
	ldr	x8, [sp, #32]
	ldr	x9, [sp, #24]
	ldr	d0, [x8, x9, lsl #3]
	mov	x8, sp
	str	d1, [x8]
	str	d0, [x8, #8]
	adrp	x0, l_.str@PAGE
	add	x0, x0, l_.str@PAGEOFF
	bl	_libmin_printf
	b	LBB1_3
LBB1_3:                                 ;   in Loop: Header=BB1_1 Depth=1
	ldr	x8, [sp, #24]
	add	x8, x8, #1
	str	x8, [sp, #24]
	b	LBB1_1
LBB1_4:
	ldr	x0, [sp, #40]
	bl	_libmin_free
	ldr	x0, [sp, #32]
	bl	_libmin_free
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	mov	w8, #0
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	stur	wzr, [x29, #-4]
	stur	w0, [x29, #-8]
	str	x1, [sp, #16]
	bl	_test
	bl	_libmin_success
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%.5lf, %.5lf\n"

.subsections_via_symbols