Program: priority-queue

x86 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_newNode                        ## -- Begin function newNode
	.p2align	4, 0x90
_newNode:                               ## @newNode
	.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	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	$16, %edi
	callq	_libmin_malloc
	movq	%rax, -16(%rbp)
	movl	-4(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, (%rax)
	movl	-8(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, 4(%rax)
	movq	-16(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-16(%rbp), %rax
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_peek                           ## -- Begin function peek
	.p2align	4, 0x90
_peek:                                  ## @peek
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_priopeek                       ## -- Begin function priopeek
	.p2align	4, 0x90
_priopeek:                              ## @priopeek
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	4(%rax), %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_pop                            ## -- Begin function pop
	.p2align	4, 0x90
_pop:                                   ## @pop
	.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
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, (%rax)
	movq	-16(%rbp), %rdi
	callq	_libmin_free
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_push                           ## -- Begin function push
	.p2align	4, 0x90
_push:                                  ## @push
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$48, %rsp
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movl	-12(%rbp), %edi
	movl	-16(%rbp), %esi
	callq	_newNode
	movq	%rax, -32(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	4(%rax), %eax
	cmpl	-16(%rbp), %eax
	jle	LBB4_2
## %bb.1:
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rcx, 8(%rax)
	movq	-32(%rbp), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, (%rax)
	jmp	LBB4_8
LBB4_2:
	jmp	LBB4_3
LBB4_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-24(%rbp), %rcx
	xorl	%eax, %eax
                                        ## kill: def $al killed $al killed $eax
	cmpq	$0, 8(%rcx)
	movb	%al, -33(%rbp)                  ## 1-byte Spill
	je	LBB4_5
## %bb.4:                               ##   in Loop: Header=BB4_3 Depth=1
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movl	4(%rax), %eax
	cmpl	-16(%rbp), %eax
	setl	%al
	movb	%al, -33(%rbp)                  ## 1-byte Spill
LBB4_5:                                 ##   in Loop: Header=BB4_3 Depth=1
	movb	-33(%rbp), %al                  ## 1-byte Reload
	testb	$1, %al
	jne	LBB4_6
	jmp	LBB4_7
LBB4_6:                                 ##   in Loop: Header=BB4_3 Depth=1
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
	jmp	LBB4_3
LBB4_7:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rcx, 8(%rax)
	movq	-32(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, 8(%rax)
LBB4_8:
	addq	$48, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_isEmpty                        ## -- Begin function isEmpty
	.p2align	4, 0x90
_isEmpty:                               ## @isEmpty
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	cmpq	$0, (%rax)
	sete	%al
	andb	$1, %al
	movzbl	%al, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_printPQ                        ## -- Begin function printPQ
	.p2align	4, 0x90
_printPQ:                               ## @printPQ
	.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
	movq	%rdi, -8(%rbp)
	leaq	L_.str(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
LBB6_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	-8(%rbp), %rdi
	callq	_isEmpty
	cmpl	$0, %eax
	setne	%al
	xorb	$-1, %al
	testb	$1, %al
	jne	LBB6_2
	jmp	LBB6_3
LBB6_2:                                 ##   in Loop: Header=BB6_1 Depth=1
	movq	-8(%rbp), %rdi
	callq	_priopeek
	movl	%eax, -12(%rbp)                 ## 4-byte Spill
	movq	-8(%rbp), %rdi
	callq	_peek
	movl	-12(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	leaq	L_.str.1(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	movq	-8(%rbp), %rdi
	callq	_pop
	jmp	LBB6_1
LBB6_3:
	leaq	L_.str.2(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	addq	$16, %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	$32, %rsp
	movl	$0, -4(%rbp)
	movl	$4, %edi
	movl	$1, %esi
	callq	_newNode
	movq	%rax, -16(%rbp)
	leaq	-16(%rbp), %rdi
	movl	$5, %esi
	movl	$2, %edx
	callq	_push
	leaq	-16(%rbp), %rdi
	movl	$6, %esi
	movl	$3, %edx
	callq	_push
	leaq	-16(%rbp), %rdi
	movl	$7, %esi
	xorl	%edx, %edx
	callq	_push
	leaq	-16(%rbp), %rdi
	callq	_printPQ
	movl	$42, %edi
	callq	_libmin_srand
	movl	$4, %edi
	movl	$1, %esi
	callq	_newNode
	movq	%rax, -16(%rbp)
	movl	$0, -20(%rbp)
LBB7_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$250, -20(%rbp)
	jge	LBB7_4
## %bb.2:                               ##   in Loop: Header=BB7_1 Depth=1
	callq	_libmin_rand
	movl	$250, %ecx
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, -24(%rbp)
	callq	_libmin_rand
	movl	$250, %ecx
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, -28(%rbp)
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %edx
	leaq	-16(%rbp), %rdi
	callq	_push
## %bb.3:                               ##   in Loop: Header=BB7_1 Depth=1
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	LBB7_1
LBB7_4:
	leaq	-16(%rbp), %rdi
	callq	_printPQ
	callq	_libmin_success
	xorl	%eax, %eax
	addq	$32, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"priorityQ: "

L_.str.1:                               ## @.str.1
	.asciz	"<prio:%d, val:%d> "

L_.str.2:                               ## @.str.2
	.asciz	"\n"

.subsections_via_symbols


ARM64 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_newNode                        ; -- Begin function newNode
	.p2align	2
_newNode:                               ; @newNode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	stur	w0, [x29, #-4]
	str	w1, [sp, #8]
	mov	x0, #16
	bl	_libmin_malloc
	str	x0, [sp]
	ldur	w8, [x29, #-4]
	ldr	x9, [sp]
	str	w8, [x9]
	ldr	w8, [sp, #8]
	ldr	x9, [sp]
	str	w8, [x9, #4]
	ldr	x8, [sp]
                                        ; kill: def $x9 killed $xzr
	str	xzr, [x8, #8]
	ldr	x0, [sp]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_peek                           ; -- Begin function peek
	.p2align	2
_peek:                                  ; @peek
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #16
	.cfi_def_cfa_offset 16
	str	x0, [sp, #8]
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	add	sp, sp, #16
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_priopeek                       ; -- Begin function priopeek
	.p2align	2
_priopeek:                              ; @priopeek
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #16
	.cfi_def_cfa_offset 16
	str	x0, [sp, #8]
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	w0, [x8, #4]
	add	sp, sp, #16
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_pop                            ; -- Begin function pop
	.p2align	2
_pop:                                   ; @pop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	str	x0, [sp, #8]
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	str	x8, [sp]
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	ldr	x9, [sp, #8]
	str	x8, [x9]
	ldr	x0, [sp]
	bl	_libmin_free
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_push                           ; -- Begin function push
	.p2align	2
_push:                                  ; @push
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	stur	x0, [x29, #-8]
	stur	w1, [x29, #-12]
	stur	w2, [x29, #-16]
	ldur	x8, [x29, #-8]
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldur	w0, [x29, #-12]
	ldur	w1, [x29, #-16]
	bl	_newNode
	str	x0, [sp, #16]
	ldur	x8, [x29, #-8]
	ldr	x8, [x8]
	ldr	w8, [x8, #4]
	ldur	w9, [x29, #-16]
	subs	w8, w8, w9
	cset	w8, le
	tbnz	w8, #0, LBB4_2
	b	LBB4_1
LBB4_1:
	ldur	x8, [x29, #-8]
	ldr	x8, [x8]
	ldr	x9, [sp, #16]
	str	x8, [x9, #8]
	ldr	x8, [sp, #16]
	ldur	x9, [x29, #-8]
	str	x8, [x9]
	b	LBB4_8
LBB4_2:
	b	LBB4_3
LBB4_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #24]
	ldr	x8, [x8, #8]
	subs	x8, x8, #0
	cset	w8, eq
	mov	w9, #0
	str	w9, [sp, #12]                   ; 4-byte Folded Spill
	tbnz	w8, #0, LBB4_5
	b	LBB4_4
LBB4_4:                                 ;   in Loop: Header=BB4_3 Depth=1
	ldr	x8, [sp, #24]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #4]
	ldur	w9, [x29, #-16]
	subs	w8, w8, w9
	cset	w8, lt
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	b	LBB4_5
LBB4_5:                                 ;   in Loop: Header=BB4_3 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	tbz	w8, #0, LBB4_7
	b	LBB4_6
LBB4_6:                                 ;   in Loop: Header=BB4_3 Depth=1
	ldr	x8, [sp, #24]
	ldr	x8, [x8, #8]
	str	x8, [sp, #24]
	b	LBB4_3
LBB4_7:
	ldr	x8, [sp, #24]
	ldr	x8, [x8, #8]
	ldr	x9, [sp, #16]
	str	x8, [x9, #8]
	ldr	x8, [sp, #16]
	ldr	x9, [sp, #24]
	str	x8, [x9, #8]
	b	LBB4_8
LBB4_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_isEmpty                        ; -- Begin function isEmpty
	.p2align	2
_isEmpty:                               ; @isEmpty
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #16
	.cfi_def_cfa_offset 16
	str	x0, [sp, #8]
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	subs	x8, x8, #0
	cset	w8, eq
	and	w0, w8, #0x1
	add	sp, sp, #16
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_printPQ                        ; -- Begin function printPQ
	.p2align	2
_printPQ:                               ; @printPQ
	.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
	stur	x0, [x29, #-8]
	adrp	x0, l_.str@PAGE
	add	x0, x0, l_.str@PAGEOFF
	bl	_libmin_printf
	b	LBB6_1
LBB6_1:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x0, [x29, #-8]
	bl	_isEmpty
	subs	w8, w0, #0
	cset	w8, ne
	tbnz	w8, #0, LBB6_3
	b	LBB6_2
LBB6_2:                                 ;   in Loop: Header=BB6_1 Depth=1
	ldur	x0, [x29, #-8]
	bl	_priopeek
	stur	w0, [x29, #-12]                 ; 4-byte Folded Spill
	ldur	x0, [x29, #-8]
	bl	_peek
	ldur	w10, [x29, #-12]                ; 4-byte Folded Reload
	mov	x9, sp
                                        ; implicit-def: $x8
	mov	x8, x10
	str	x8, [x9]
                                        ; implicit-def: $x8
	mov	x8, x0
	str	x8, [x9, #8]
	adrp	x0, l_.str.1@PAGE
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_libmin_printf
	ldur	x0, [x29, #-8]
	bl	_pop
	b	LBB6_1
LBB6_3:
	adrp	x0, l_.str.2@PAGE
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_libmin_printf
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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]
	mov	w0, #4
	str	w0, [sp, #28]                   ; 4-byte Folded Spill
	mov	w1, #1
	str	w1, [sp, #32]                   ; 4-byte Folded Spill
	bl	_newNode
	mov	x8, x0
	sub	x0, x29, #16
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
	stur	x8, [x29, #-16]
	mov	w1, #5
	mov	w2, #2
	bl	_push
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	mov	w1, #6
	mov	w2, #3
	bl	_push
	ldr	w2, [sp, #12]                   ; 4-byte Folded Reload
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	mov	w1, #7
	bl	_push
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_printPQ
	mov	w0, #42
	bl	_libmin_srand
	ldr	w0, [sp, #28]                   ; 4-byte Folded Reload
	ldr	w1, [sp, #32]                   ; 4-byte Folded Reload
	bl	_newNode
	stur	x0, [x29, #-16]
	stur	wzr, [x29, #-20]
	b	LBB7_1
LBB7_1:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w8, [x29, #-20]
	subs	w8, w8, #250
	cset	w8, ge
	tbnz	w8, #0, LBB7_4
	b	LBB7_2
LBB7_2:                                 ;   in Loop: Header=BB7_1 Depth=1
	bl	_libmin_rand
	mov	w9, #250
	str	w9, [sp, #8]                    ; 4-byte Folded Spill
	udiv	w8, w0, w9
	mul	w8, w8, w9
	subs	w8, w0, w8
	stur	w8, [x29, #-24]
	bl	_libmin_rand
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	udiv	w8, w0, w9
	mul	w8, w8, w9
	subs	w8, w0, w8
	stur	w8, [x29, #-28]
	ldur	w1, [x29, #-24]
	ldur	w2, [x29, #-28]
	sub	x0, x29, #16
	bl	_push
	b	LBB7_3
LBB7_3:                                 ;   in Loop: Header=BB7_1 Depth=1
	ldur	w8, [x29, #-20]
	add	w8, w8, #1
	stur	w8, [x29, #-20]
	b	LBB7_1
LBB7_4:
	sub	x0, x29, #16
	bl	_printPQ
	bl	_libmin_success
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"priorityQ: "

l_.str.1:                               ; @.str.1
	.asciz	"<prio:%d, val:%d> "

l_.str.2:                               ; @.str.2
	.asciz	"\n"

.subsections_via_symbols