Program: weekday

x86 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dayOfWeek                      ## -- Begin function dayOfWeek
	.p2align	4, 0x90
_dayOfWeek:                             ## @dayOfWeek
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$96, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	%edi, -68(%rbp)
	movl	%esi, -72(%rbp)
	movl	%edx, -76(%rbp)
	leaq	-64(%rbp), %rdi
	leaq	l___const.dayOfWeek.t(%rip), %rsi
	movl	$48, %edx
	callq	_memcpy
	movl	-72(%rbp), %edx
	xorl	%ecx, %ecx
	movl	$1, %eax
	cmpl	$3, %edx
	cmovll	%eax, %ecx
	movl	-68(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
	movl	-68(%rbp), %eax
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	movl	-68(%rbp), %eax
	movl	$4, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	movl	-92(%rbp), %eax                 ## 4-byte Reload
	addl	%ecx, %eax
	movl	%eax, -88(%rbp)                 ## 4-byte Spill
	movl	-68(%rbp), %eax
	movl	$100, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	movl	-88(%rbp), %eax                 ## 4-byte Reload
	subl	%ecx, %eax
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movl	-68(%rbp), %eax
	movl	$400, %ecx                      ## imm = 0x190
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	addl	%ecx, %eax
	movl	-72(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	addl	-64(%rbp,%rcx,4), %eax
	addl	-76(%rbp), %eax
	movl	$7, %ecx
	cltd
	idivl	%ecx
	movl	%edx, -80(%rbp)                 ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-8(%rbp), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_2
## %bb.1:
	movl	-80(%rbp), %eax                 ## 4-byte Reload
	addq	$96, %rsp
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	ud2
	.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	$80, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	$0, -68(%rbp)
	movl	%edi, -72(%rbp)
	movq	%rsi, -80(%rbp)
	leaq	-64(%rbp), %rdi
	leaq	l___const.main.days(%rip), %rsi
	movl	$56, %edx
	callq	_memcpy
	movl	$2024, %edi                     ## imm = 0x7E8
	movl	$2, %esi
	movl	$20, %edx
	callq	_dayOfWeek
	cltq
	movq	-64(%rbp,%rax,8), %r8
	leaq	L_.str.7(%rip), %rdi
	movl	$2, %esi
	movl	$20, %edx
	movl	$2024, %ecx                     ## imm = 0x7E8
	movb	$0, %al
	callq	_libmin_printf
	movl	$1994, %edi                     ## imm = 0x7CA
	movl	$4, %esi
	movl	$5, %edx
	callq	_dayOfWeek
	cltq
	movq	-64(%rbp,%rax,8), %r8
	leaq	L_.str.7(%rip), %rdi
	movl	$4, %esi
	movl	$5, %edx
	movl	$1994, %ecx                     ## imm = 0x7CA
	movb	$0, %al
	callq	_libmin_printf
	movl	$1975, %edi                     ## imm = 0x7B7
	movl	$1, %edx
	movl	%edx, %esi
	callq	_dayOfWeek
	cltq
	movq	-64(%rbp,%rax,8), %r8
	leaq	L_.str.7(%rip), %rdi
	movl	$1, %edx
	movl	$1975, %ecx                     ## imm = 0x7B7
	movl	%edx, %esi
	movb	$0, %al
	callq	_libmin_printf
	movl	$1964, %edi                     ## imm = 0x7AC
	movl	$2, %esi
	movl	$7, %edx
	callq	_dayOfWeek
	cltq
	movq	-64(%rbp,%rax,8), %r8
	leaq	L_.str.7(%rip), %rdi
	movl	$2, %esi
	movl	$7, %edx
	movl	$1964, %ecx                     ## imm = 0x7AC
	movb	$0, %al
	callq	_libmin_printf
	callq	_libmin_success
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-8(%rbp), %rcx
	cmpq	%rcx, %rax
	jne	LBB1_2
## %bb.1:
	xorl	%eax, %eax
	addq	$80, %rsp
	popq	%rbp
	retq
LBB1_2:
	callq	___stack_chk_fail
	ud2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @__const.dayOfWeek.t
l___const.dayOfWeek.t:
	.long	0                               ## 0x0
	.long	3                               ## 0x3
	.long	2                               ## 0x2
	.long	5                               ## 0x5
	.long	0                               ## 0x0
	.long	3                               ## 0x3
	.long	5                               ## 0x5
	.long	1                               ## 0x1
	.long	4                               ## 0x4
	.long	6                               ## 0x6
	.long	2                               ## 0x2
	.long	4                               ## 0x4

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sunday"

L_.str.1:                               ## @.str.1
	.asciz	"Monday"

L_.str.2:                               ## @.str.2
	.asciz	"Tuesday"

L_.str.3:                               ## @.str.3
	.asciz	"Wednesday"

L_.str.4:                               ## @.str.4
	.asciz	"Thursday"

L_.str.5:                               ## @.str.5
	.asciz	"Friday"

L_.str.6:                               ## @.str.6
	.asciz	"Saturday"

	.section	__DATA,__const
	.p2align	4                               ## @__const.main.days
l___const.main.days:
	.quad	L_.str
	.quad	L_.str.1
	.quad	L_.str.2
	.quad	L_.str.3
	.quad	L_.str.4
	.quad	L_.str.5
	.quad	L_.str.6

	.section	__TEXT,__cstring,cstring_literals
L_.str.7:                               ## @.str.7
	.asciz	"%02d/%02d/%04d was a `%s'\n"

.subsections_via_symbols


ARM64 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dayOfWeek                      ; -- Begin function dayOfWeek
	.p2align	2
_dayOfWeek:                             ; @dayOfWeek
	.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
	adrp	x8, ___stack_chk_guard@GOTPAGE
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
	ldr	x8, [x8]
	stur	x8, [x29, #-8]
	str	w0, [sp, #20]
	str	w1, [sp, #16]
	str	w2, [sp, #12]
	add	x0, sp, #24
	str	x0, [sp]                        ; 8-byte Folded Spill
	adrp	x1, l___const.dayOfWeek.t@PAGE
	add	x1, x1, l___const.dayOfWeek.t@PAGEOFF
	mov	x2, #48
	bl	_memcpy
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	ldr	w8, [sp, #16]
	subs	w8, w8, #3
	cset	w8, lt
	and	w10, w8, #0x1
	mov	w8, #0
	ands	w10, w10, #0x1
	csinc	w10, w8, wzr, eq
	ldr	w8, [sp, #20]
	subs	w8, w8, w10
	str	w8, [sp, #20]
	ldr	w8, [sp, #20]
	ldr	w10, [sp, #20]
	mov	w11, #4
	sdiv	w10, w10, w11
	add	w8, w8, w10
	ldr	w10, [sp, #20]
	mov	w11, #100
	sdiv	w10, w10, w11
	subs	w8, w8, w10
	ldr	w10, [sp, #20]
	mov	w11, #400
	sdiv	w10, w10, w11
	add	w8, w8, w10
	ldr	w10, [sp, #16]
	subs	w10, w10, #1
	ldr	w9, [x9, w10, sxtw #2]
	add	w8, w8, w9
	ldr	w9, [sp, #12]
	add	w8, w8, w9
	mov	w10, #7
	sdiv	w9, w8, w10
	mul	w9, w9, w10
	subs	w8, w8, w9
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	ldur	x9, [x29, #-8]
	adrp	x8, ___stack_chk_guard@GOTPAGE
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
	ldr	x8, [x8]
	subs	x8, x8, x9
	cset	w8, eq
	tbnz	w8, #0, LBB0_2
	b	LBB0_1
LBB0_1:
	bl	___stack_chk_fail
LBB0_2:
	ldr	w0, [sp, #8]                    ; 4-byte Folded Reload
	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, #160
	.cfi_def_cfa_offset 160
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	adrp	x8, ___stack_chk_guard@GOTPAGE
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
	ldr	x8, [x8]
	stur	x8, [x29, #-8]
	stur	wzr, [x29, #-68]
	str	w0, [sp, #72]
	str	x1, [sp, #64]
	sub	x0, x29, #64
	str	x0, [sp, #40]                   ; 8-byte Folded Spill
	adrp	x1, l___const.main.days@PAGE
	add	x1, x1, l___const.main.days@PAGEOFF
	mov	x2, #56
	bl	_memcpy
	mov	w0, #2024
	mov	w1, #2
	str	w1, [sp, #36]                   ; 4-byte Folded Spill
	mov	w2, #20
	bl	_dayOfWeek
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x8, [x8, w0, sxtw #3]
	mov	x9, sp
	mov	x10, #2
	str	x10, [sp, #48]                  ; 8-byte Folded Spill
	str	x10, [x9]
	mov	x10, #20
	str	x10, [x9, #8]
	mov	x10, #2024
	str	x10, [x9, #16]
	str	x8, [x9, #24]
	adrp	x0, l_.str.7@PAGE
	add	x0, x0, l_.str.7@PAGEOFF
	str	x0, [sp, #56]                   ; 8-byte Folded Spill
	bl	_libmin_printf
	mov	w0, #1994
	mov	w1, #4
	mov	w2, #5
	bl	_dayOfWeek
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	mov	x9, x0
	ldr	x0, [sp, #56]                   ; 8-byte Folded Reload
	ldr	x8, [x8, w9, sxtw #3]
	mov	x9, sp
	mov	x10, #4
	str	x10, [x9]
	mov	x10, #5
	str	x10, [x9, #8]
	mov	x10, #1994
	str	x10, [x9, #16]
	str	x8, [x9, #24]
	bl	_libmin_printf
	mov	w0, #1975
	mov	w2, #1
	mov	x1, x2
	bl	_dayOfWeek
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	mov	x9, x0
	ldr	x0, [sp, #56]                   ; 8-byte Folded Reload
	ldr	x8, [x8, w9, sxtw #3]
	mov	x9, sp
	mov	x10, #1
	str	x10, [x9]
	str	x10, [x9, #8]
	mov	x10, #1975
	str	x10, [x9, #16]
	str	x8, [x9, #24]
	bl	_libmin_printf
	ldr	w1, [sp, #36]                   ; 4-byte Folded Reload
	mov	w0, #1964
	mov	w2, #7
	bl	_dayOfWeek
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x10, [sp, #48]                  ; 8-byte Folded Reload
	mov	x9, x0
	ldr	x0, [sp, #56]                   ; 8-byte Folded Reload
	ldr	x8, [x8, w9, sxtw #3]
	mov	x9, sp
	str	x10, [x9]
	mov	x10, #7
	str	x10, [x9, #8]
	mov	x10, #1964
	str	x10, [x9, #16]
	str	x8, [x9, #24]
	bl	_libmin_printf
	bl	_libmin_success
	ldur	x9, [x29, #-8]
	adrp	x8, ___stack_chk_guard@GOTPAGE
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
	ldr	x8, [x8]
	subs	x8, x8, x9
	cset	w8, eq
	tbnz	w8, #0, LBB1_2
	b	LBB1_1
LBB1_1:
	bl	___stack_chk_fail
LBB1_2:
	mov	w0, #0
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @__const.dayOfWeek.t
l___const.dayOfWeek.t:
	.long	0                               ; 0x0
	.long	3                               ; 0x3
	.long	2                               ; 0x2
	.long	5                               ; 0x5
	.long	0                               ; 0x0
	.long	3                               ; 0x3
	.long	5                               ; 0x5
	.long	1                               ; 0x1
	.long	4                               ; 0x4
	.long	6                               ; 0x6
	.long	2                               ; 0x2
	.long	4                               ; 0x4

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sunday"

l_.str.1:                               ; @.str.1
	.asciz	"Monday"

l_.str.2:                               ; @.str.2
	.asciz	"Tuesday"

l_.str.3:                               ; @.str.3
	.asciz	"Wednesday"

l_.str.4:                               ; @.str.4
	.asciz	"Thursday"

l_.str.5:                               ; @.str.5
	.asciz	"Friday"

l_.str.6:                               ; @.str.6
	.asciz	"Saturday"

	.section	__DATA,__const
	.p2align	3                               ; @__const.main.days
l___const.main.days:
	.quad	l_.str
	.quad	l_.str.1
	.quad	l_.str.2
	.quad	l_.str.3
	.quad	l_.str.4
	.quad	l_.str.5
	.quad	l_.str.6

	.section	__TEXT,__cstring,cstring_literals
l_.str.7:                               ; @.str.7
	.asciz	"%02d/%02d/%04d was a `%s'\n"

.subsections_via_symbols