Program: sieve

x86 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.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	$32, %rsp
	movl	$0, -4(%rbp)
	leaq	L_.str(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	leaq	L_.str.1(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	leaq	L_.str.2(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	leaq	L_.str.3(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	movq	$1024, -16(%rbp)                ## imm = 0x400
	movq	$1, -24(%rbp)
	movq	-16(%rbp), %rdi
	movq	-24(%rbp), %rsi
	callq	_SIEVE
	callq	_libmin_success
	xorl	%eax, %eax
	addq	$32, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function SIEVE
_SIEVE:                                 ## @SIEVE
	.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	$0, -32(%rbp)
	movq	-8(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -56(%rbp)
	movq	$0, _N_Prime(%rip)
	movq	$0, _L_Prime(%rip)
	movq	$0, -64(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -24(%rbp)
LBB1_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	-24(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jg	LBB1_4
## %bb.2:                               ##   in Loop: Header=BB1_1 Depth=1
	movq	-24(%rbp), %rcx
	leaq	_flags(%rip), %rax
	movb	$1, (%rax,%rcx)
## %bb.3:                               ##   in Loop: Header=BB1_1 Depth=1
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -24(%rbp)
	jmp	LBB1_1
LBB1_4:
	movq	$0, -24(%rbp)
LBB1_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB1_8 Depth 2
	movq	-24(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jg	LBB1_14
## %bb.6:                               ##   in Loop: Header=BB1_5 Depth=1
	movq	-24(%rbp), %rcx
	leaq	_flags(%rip), %rax
	cmpb	$0, (%rax,%rcx)
	je	LBB1_12
## %bb.7:                               ##   in Loop: Header=BB1_5 Depth=1
	movq	-48(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -48(%rbp)
	movq	-24(%rbp), %rax
	addq	-24(%rbp), %rax
	addq	$3, %rax
	movq	%rax, -32(%rbp)
	movq	-24(%rbp), %rax
	addq	-32(%rbp), %rax
	movq	%rax, -40(%rbp)
LBB1_8:                                 ##   Parent Loop BB1_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-40(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jg	LBB1_11
## %bb.9:                               ##   in Loop: Header=BB1_8 Depth=2
	movq	-40(%rbp), %rcx
	leaq	_flags(%rip), %rax
	movb	$0, (%rax,%rcx)
## %bb.10:                              ##   in Loop: Header=BB1_8 Depth=2
	movq	-32(%rbp), %rax
	addq	-40(%rbp), %rax
	movq	%rax, -40(%rbp)
	jmp	LBB1_8
LBB1_11:                                ##   in Loop: Header=BB1_5 Depth=1
	jmp	LBB1_12
LBB1_12:                                ##   in Loop: Header=BB1_5 Depth=1
	jmp	LBB1_13
LBB1_13:                                ##   in Loop: Header=BB1_5 Depth=1
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -24(%rbp)
	jmp	LBB1_5
LBB1_14:
	movq	-64(%rbp), %rax
	addq	-48(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, _N_Prime(%rip)
	movq	-32(%rbp), %rax
	movq	%rax, _L_Prime(%rip)
	cmpq	$0, -16(%rbp)
	je	LBB1_16
## %bb.15:
	movq	-8(%rbp), %rsi
	movq	_N_Prime(%rip), %rdx
	movq	_L_Prime(%rip), %rcx
	leaq	L_.str.4(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
LBB1_16:
	xorl	%eax, %eax
	addq	$64, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n   Sieve of Eratosthenes (Scaled to 10 Iterations)\n"

L_.str.1:                               ## @.str.1
	.asciz	"   Version 1.2b, 26 Sep 1992\n\n"

L_.str.2:                               ## @.str.2
	.asciz	"   Array Size   Number   Last Prime\n"

L_.str.3:                               ## @.str.3
	.asciz	"    (Bytes)   of Primes\n"

.zerofill __DATA,__bss,_N_Prime,8,3     ## @N_Prime
.zerofill __DATA,__bss,_L_Prime,8,3     ## @L_Prime
.zerofill __DATA,__bss,_flags,8192,4    ## @flags
L_.str.4:                               ## @.str.4
	.asciz	"  %9ld   %8ld     %8ld\n"

.subsections_via_symbols


ARM64 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.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, #4]                    ; 4-byte Folded Spill
	stur	wzr, [x29, #-4]
	adrp	x0, l_.str@PAGE
	add	x0, x0, l_.str@PAGEOFF
	bl	_libmin_printf
	adrp	x0, l_.str.1@PAGE
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_libmin_printf
	adrp	x0, l_.str.2@PAGE
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_libmin_printf
	adrp	x0, l_.str.3@PAGE
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_libmin_printf
	mov	x8, #1024
	str	x8, [sp, #16]
	mov	x8, #1
	str	x8, [sp, #8]
	ldr	x0, [sp, #16]
	ldr	x1, [sp, #8]
	bl	_SIEVE
	bl	_libmin_success
	ldr	w0, [sp, #4]                    ; 4-byte Folded Reload
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function SIEVE
_SIEVE:                                 ; @SIEVE
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	stur	x0, [x29, #-8]
	stur	x1, [x29, #-16]
	stur	xzr, [x29, #-32]
	ldur	x8, [x29, #-8]
	subs	x8, x8, #1
	str	x8, [sp, #40]
	adrp	x8, _N_Prime@PAGE
	str	xzr, [x8, _N_Prime@PAGEOFF]
	adrp	x8, _L_Prime@PAGE
	str	xzr, [x8, _L_Prime@PAGEOFF]
	str	xzr, [sp, #32]
	str	xzr, [sp, #48]
	stur	xzr, [x29, #-24]
	b	LBB1_1
LBB1_1:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x8, [x29, #-24]
	ldr	x9, [sp, #40]
	subs	x8, x8, x9
	cset	w8, gt
	tbnz	w8, #0, LBB1_4
	b	LBB1_2
LBB1_2:                                 ;   in Loop: Header=BB1_1 Depth=1
	ldur	x9, [x29, #-24]
	adrp	x8, _flags@PAGE
	add	x8, x8, _flags@PAGEOFF
	add	x9, x8, x9
	mov	w8, #1
	strb	w8, [x9]
	b	LBB1_3
LBB1_3:                                 ;   in Loop: Header=BB1_1 Depth=1
	ldur	x8, [x29, #-24]
	add	x8, x8, #1
	stur	x8, [x29, #-24]
	b	LBB1_1
LBB1_4:
	stur	xzr, [x29, #-24]
	b	LBB1_5
LBB1_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_8 Depth 2
	ldur	x8, [x29, #-24]
	ldr	x9, [sp, #40]
	subs	x8, x8, x9
	cset	w8, gt
	tbnz	w8, #0, LBB1_14
	b	LBB1_6
LBB1_6:                                 ;   in Loop: Header=BB1_5 Depth=1
	ldur	x9, [x29, #-24]
	adrp	x8, _flags@PAGE
	add	x8, x8, _flags@PAGEOFF
	add	x8, x8, x9
	ldrb	w8, [x8]
	subs	w8, w8, #0
	cset	w8, eq
	tbnz	w8, #0, LBB1_12
	b	LBB1_7
LBB1_7:                                 ;   in Loop: Header=BB1_5 Depth=1
	ldr	x8, [sp, #48]
	add	x8, x8, #1
	str	x8, [sp, #48]
	ldur	x8, [x29, #-24]
	ldur	x9, [x29, #-24]
	add	x8, x8, x9
	add	x8, x8, #3
	stur	x8, [x29, #-32]
	ldur	x8, [x29, #-24]
	ldur	x9, [x29, #-32]
	add	x8, x8, x9
	stur	x8, [x29, #-40]
	b	LBB1_8
LBB1_8:                                 ;   Parent Loop BB1_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldur	x8, [x29, #-40]
	ldr	x9, [sp, #40]
	subs	x8, x8, x9
	cset	w8, gt
	tbnz	w8, #0, LBB1_11
	b	LBB1_9
LBB1_9:                                 ;   in Loop: Header=BB1_8 Depth=2
	ldur	x9, [x29, #-40]
	adrp	x8, _flags@PAGE
	add	x8, x8, _flags@PAGEOFF
	add	x8, x8, x9
	strb	wzr, [x8]
	b	LBB1_10
LBB1_10:                                ;   in Loop: Header=BB1_8 Depth=2
	ldur	x9, [x29, #-32]
	ldur	x8, [x29, #-40]
	add	x8, x8, x9
	stur	x8, [x29, #-40]
	b	LBB1_8
LBB1_11:                                ;   in Loop: Header=BB1_5 Depth=1
	b	LBB1_12
LBB1_12:                                ;   in Loop: Header=BB1_5 Depth=1
	b	LBB1_13
LBB1_13:                                ;   in Loop: Header=BB1_5 Depth=1
	ldur	x8, [x29, #-24]
	add	x8, x8, #1
	stur	x8, [x29, #-24]
	b	LBB1_5
LBB1_14:
	ldr	x8, [sp, #32]
	ldr	x9, [sp, #48]
	add	x8, x8, x9
	str	x8, [sp, #32]
	ldr	x8, [sp, #32]
	adrp	x9, _N_Prime@PAGE
	str	x8, [x9, _N_Prime@PAGEOFF]
	ldur	x8, [x29, #-32]
	adrp	x9, _L_Prime@PAGE
	str	x8, [x9, _L_Prime@PAGEOFF]
	ldur	x8, [x29, #-16]
	subs	x8, x8, #0
	cset	w8, eq
	tbnz	w8, #0, LBB1_16
	b	LBB1_15
LBB1_15:
	ldur	x11, [x29, #-8]
	adrp	x8, _N_Prime@PAGE
	ldr	x10, [x8, _N_Prime@PAGEOFF]
	adrp	x8, _L_Prime@PAGE
	ldr	x8, [x8, _L_Prime@PAGEOFF]
	mov	x9, sp
	str	x11, [x9]
	str	x10, [x9, #8]
	str	x8, [x9, #16]
	adrp	x0, l_.str.4@PAGE
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_libmin_printf
	b	LBB1_16
LBB1_16:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n   Sieve of Eratosthenes (Scaled to 10 Iterations)\n"

l_.str.1:                               ; @.str.1
	.asciz	"   Version 1.2b, 26 Sep 1992\n\n"

l_.str.2:                               ; @.str.2
	.asciz	"   Array Size   Number   Last Prime\n"

l_.str.3:                               ; @.str.3
	.asciz	"    (Bytes)   of Primes\n"

.zerofill __DATA,__bss,_N_Prime,8,3     ; @N_Prime
.zerofill __DATA,__bss,_L_Prime,8,3     ; @L_Prime
.zerofill __DATA,__bss,_flags,8192,0    ; @flags
l_.str.4:                               ; @.str.4
	.asciz	"  %9ld   %8ld     %8ld\n"

.subsections_via_symbols