Program: cipher

x86 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_encipher                       ## -- Begin function encipher
	.p2align	4, 0x90
_encipher:                              ## @encipher
	.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	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, -32(%rbp)
	movl	$0, -36(%rbp)
	movl	$-1640531527, -40(%rbp)         ## imm = 0x9E3779B9
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	$32, -60(%rbp)
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	-60(%rbp), %eax
	movl	%eax, %ecx
	addl	$-1, %ecx
	movl	%ecx, -60(%rbp)
	cmpl	$0, %eax
	jbe	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-40(%rbp), %eax
	addl	-36(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	shll	$4, %eax
	addl	-44(%rbp), %eax
	movl	-32(%rbp), %ecx
	addl	-36(%rbp), %ecx
	xorl	%ecx, %eax
	movl	-32(%rbp), %ecx
	shrl	$5, %ecx
	addl	-48(%rbp), %ecx
	xorl	%ecx, %eax
	addl	-28(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	shll	$4, %eax
	addl	-52(%rbp), %eax
	movl	-28(%rbp), %ecx
	addl	-36(%rbp), %ecx
	xorl	%ecx, %eax
	movl	-28(%rbp), %ecx
	shrl	$5, %ecx
	addl	-56(%rbp), %ecx
	xorl	%ecx, %eax
	addl	-32(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	LBB0_1
LBB0_3:
	movl	-28(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, (%rax)
	movl	-32(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, 4(%rax)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_decipher                       ## -- Begin function decipher
	.p2align	4, 0x90
_decipher:                              ## @decipher
	.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	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, -32(%rbp)
	movl	$-957401312, -36(%rbp)          ## imm = 0xC6EF3720
	movl	$-1640531527, -40(%rbp)         ## imm = 0x9E3779B9
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	$32, -60(%rbp)
LBB1_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	-60(%rbp), %eax
	movl	%eax, %ecx
	addl	$-1, %ecx
	movl	%ecx, -60(%rbp)
	cmpl	$0, %eax
	jbe	LBB1_3
## %bb.2:                               ##   in Loop: Header=BB1_1 Depth=1
	movl	-28(%rbp), %ecx
	shll	$4, %ecx
	addl	-52(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	-36(%rbp), %eax
	xorl	%eax, %ecx
	movl	-28(%rbp), %eax
	shrl	$5, %eax
	addl	-56(%rbp), %eax
	xorl	%eax, %ecx
	movl	-32(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %ecx
	shll	$4, %ecx
	addl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	addl	-36(%rbp), %eax
	xorl	%eax, %ecx
	movl	-32(%rbp), %eax
	shrl	$5, %eax
	addl	-48(%rbp), %eax
	xorl	%eax, %ecx
	movl	-28(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, -36(%rbp)
	jmp	LBB1_1
LBB1_3:
	movl	-28(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, (%rax)
	movl	-32(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, 4(%rax)
	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)
	leaq	_plaintext(%rip), %rdi
	movq	_ciphertext@GOTPCREL(%rip), %rsi
	leaq	_keytext(%rip), %rdx
	callq	_encipher
	movq	_ciphertext@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	_cipherref(%rip), %eax
	jne	LBB2_2
## %bb.1:
	movq	_ciphertext@GOTPCREL(%rip), %rax
	movl	4(%rax), %eax
	cmpl	_cipherref+4(%rip), %eax
	je	LBB2_3
LBB2_2:
	movl	$1, %edi
	callq	_libmin_fail
LBB2_3:
	movq	_ciphertext@GOTPCREL(%rip), %rdi
	movq	_newplain@GOTPCREL(%rip), %rsi
	leaq	_keytext(%rip), %rdx
	callq	_decipher
	movq	_newplain@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	_plaintext(%rip), %eax
	jne	LBB2_5
## %bb.4:
	movq	_newplain@GOTPCREL(%rip), %rax
	movl	4(%rax), %eax
	cmpl	_plaintext+4(%rip), %eax
	je	LBB2_6
LBB2_5:
	movl	$2, %edi
	callq	_libmin_fail
LBB2_6:
	leaq	L_.str(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	movl	_plaintext(%rip), %esi
	movl	_plaintext+4(%rip), %edx
	leaq	L_.str.1(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	movq	_ciphertext@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ciphertext@GOTPCREL(%rip), %rax
	movl	4(%rax), %edx
	leaq	L_.str.2(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	movq	_newplain@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_newplain@GOTPCREL(%rip), %rax
	movl	4(%rax), %edx
	leaq	L_.str.3(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	callq	_libmin_success
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.globl	_keytext                        ## @keytext
	.p2align	4
_keytext:
	.long	358852050                       ## 0x1563a5d2
	.long	311606025                       ## 0x1292bb09
	.long	739108171                       ## 0x2c0de54b
	.long	861449956                       ## 0x3358aee4

	.globl	_plaintext                      ## @plaintext
	.p2align	2
_plaintext:
	.long	765625614                       ## 0x2da2850e
	.long	14247501                        ## 0xd9664d

	.globl	_cipherref                      ## @cipherref
	.p2align	2
_cipherref:
	.long	2682439780                      ## 0x9fe2c864
	.long	3621408164                      ## 0xd7da4da4

	.comm	_ciphertext,8,2                 ## @ciphertext
	.comm	_newplain,8,2                   ## @newplain
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TEA Cipher results:\n"

L_.str.1:                               ## @.str.1
	.asciz	"  plaintext:  0x%08lx 0x%08lx\n"

L_.str.2:                               ## @.str.2
	.asciz	"  ciphertext: 0x%08lx 0x%08lx\n"

L_.str.3:                               ## @.str.3
	.asciz	"  newplain:   0x%08lx 0x%08lx\n"

.subsections_via_symbols


ARM64 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_encipher                       ; -- Begin function encipher
	.p2align	2
_encipher:                              ; @encipher
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	str	x0, [sp, #56]
	str	x1, [sp, #48]
	str	x2, [sp, #40]
	ldr	x8, [sp, #56]
	ldr	w8, [x8]
	str	w8, [sp, #36]
	ldr	x8, [sp, #56]
	ldr	w8, [x8, #4]
	str	w8, [sp, #32]
	str	wzr, [sp, #28]
	mov	w8, #31161
	movk	w8, #40503, lsl #16
	str	w8, [sp, #24]
	ldr	x8, [sp, #40]
	ldr	w8, [x8]
	str	w8, [sp, #20]
	ldr	x8, [sp, #40]
	ldr	w8, [x8, #4]
	str	w8, [sp, #16]
	ldr	x8, [sp, #40]
	ldr	w8, [x8, #8]
	str	w8, [sp, #12]
	ldr	x8, [sp, #40]
	ldr	w8, [x8, #12]
	str	w8, [sp, #8]
	mov	w8, #32
	str	w8, [sp, #4]
	b	LBB0_1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #4]
	subs	w9, w8, #1
	str	w9, [sp, #4]
	subs	w8, w8, #0
	cset	w8, ls
	tbnz	w8, #0, LBB0_3
	b	LBB0_2
LBB0_2:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [sp, #24]
	ldr	w8, [sp, #28]
	add	w8, w8, w9
	str	w8, [sp, #28]
	ldr	w9, [sp, #32]
	ldr	w8, [sp, #20]
	add	w8, w8, w9, lsl #4
	ldr	w9, [sp, #32]
	ldr	w10, [sp, #28]
	add	w9, w9, w10
	eor	w8, w8, w9
	ldr	w10, [sp, #32]
	ldr	w9, [sp, #16]
	add	w9, w9, w10, lsr #5
	eor	w9, w8, w9
	ldr	w8, [sp, #36]
	add	w8, w8, w9
	str	w8, [sp, #36]
	ldr	w9, [sp, #36]
	ldr	w8, [sp, #12]
	add	w8, w8, w9, lsl #4
	ldr	w9, [sp, #36]
	ldr	w10, [sp, #28]
	add	w9, w9, w10
	eor	w8, w8, w9
	ldr	w10, [sp, #36]
	ldr	w9, [sp, #8]
	add	w9, w9, w10, lsr #5
	eor	w9, w8, w9
	ldr	w8, [sp, #32]
	add	w8, w8, w9
	str	w8, [sp, #32]
	b	LBB0_1
LBB0_3:
	ldr	w8, [sp, #36]
	ldr	x9, [sp, #48]
	str	w8, [x9]
	ldr	w8, [sp, #32]
	ldr	x9, [sp, #48]
	str	w8, [x9, #4]
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_decipher                       ; -- Begin function decipher
	.p2align	2
_decipher:                              ; @decipher
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	str	x0, [sp, #56]
	str	x1, [sp, #48]
	str	x2, [sp, #40]
	ldr	x8, [sp, #56]
	ldr	w8, [x8]
	str	w8, [sp, #36]
	ldr	x8, [sp, #56]
	ldr	w8, [x8, #4]
	str	w8, [sp, #32]
	mov	w8, #14112
	movk	w8, #50927, lsl #16
	str	w8, [sp, #28]
	mov	w8, #31161
	movk	w8, #40503, lsl #16
	str	w8, [sp, #24]
	ldr	x8, [sp, #40]
	ldr	w8, [x8]
	str	w8, [sp, #20]
	ldr	x8, [sp, #40]
	ldr	w8, [x8, #4]
	str	w8, [sp, #16]
	ldr	x8, [sp, #40]
	ldr	w8, [x8, #8]
	str	w8, [sp, #12]
	ldr	x8, [sp, #40]
	ldr	w8, [x8, #12]
	str	w8, [sp, #8]
	mov	w8, #32
	str	w8, [sp, #4]
	b	LBB1_1
LBB1_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #4]
	subs	w9, w8, #1
	str	w9, [sp, #4]
	subs	w8, w8, #0
	cset	w8, ls
	tbnz	w8, #0, LBB1_3
	b	LBB1_2
LBB1_2:                                 ;   in Loop: Header=BB1_1 Depth=1
	ldr	w9, [sp, #36]
	ldr	w8, [sp, #12]
	add	w8, w8, w9, lsl #4
	ldr	w9, [sp, #36]
	ldr	w10, [sp, #28]
	add	w9, w9, w10
	eor	w8, w8, w9
	ldr	w10, [sp, #36]
	ldr	w9, [sp, #8]
	add	w9, w9, w10, lsr #5
	eor	w9, w8, w9
	ldr	w8, [sp, #32]
	subs	w8, w8, w9
	str	w8, [sp, #32]
	ldr	w9, [sp, #32]
	ldr	w8, [sp, #20]
	add	w8, w8, w9, lsl #4
	ldr	w9, [sp, #32]
	ldr	w10, [sp, #28]
	add	w9, w9, w10
	eor	w8, w8, w9
	ldr	w10, [sp, #32]
	ldr	w9, [sp, #16]
	add	w9, w9, w10, lsr #5
	eor	w9, w8, w9
	ldr	w8, [sp, #36]
	subs	w8, w8, w9
	str	w8, [sp, #36]
	ldr	w9, [sp, #24]
	ldr	w8, [sp, #28]
	subs	w8, w8, w9
	str	w8, [sp, #28]
	b	LBB1_1
LBB1_3:
	ldr	w8, [sp, #36]
	ldr	x9, [sp, #48]
	str	w8, [x9]
	ldr	w8, [sp, #32]
	ldr	x9, [sp, #48]
	str	w8, [x9, #4]
	add	sp, sp, #64
	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
	adrp	x1, _ciphertext@GOTPAGE
	ldr	x1, [x1, _ciphertext@GOTPAGEOFF]
	stur	x1, [x29, #-24]                 ; 8-byte Folded Spill
	adrp	x8, _cipherref@PAGE
	stur	x8, [x29, #-16]                 ; 8-byte Folded Spill
	adrp	x8, _cipherref@PAGE
	add	x8, x8, _cipherref@PAGEOFF
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	adrp	x8, _newplain@GOTPAGE
	ldr	x8, [x8, _newplain@GOTPAGEOFF]
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	adrp	x0, _plaintext@PAGE
	add	x0, x0, _plaintext@PAGEOFF
	str	x0, [sp, #32]                   ; 8-byte Folded Spill
	stur	wzr, [x29, #-4]
	adrp	x2, _keytext@PAGE
	add	x2, x2, _keytext@PAGEOFF
	bl	_encipher
	ldur	x8, [x29, #-24]                 ; 8-byte Folded Reload
	ldur	x9, [x29, #-16]                 ; 8-byte Folded Reload
	ldr	w8, [x8]
	ldr	w9, [x9, _cipherref@PAGEOFF]
	subs	w8, w8, w9
	cset	w8, ne
	tbnz	w8, #0, LBB2_2
	b	LBB2_1
LBB2_1:
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	ldur	x8, [x29, #-24]                 ; 8-byte Folded Reload
	ldr	w8, [x8, #4]
	ldr	w9, [x9, #4]
	subs	w8, w8, w9
	cset	w8, eq
	tbnz	w8, #0, LBB2_3
	b	LBB2_2
LBB2_2:
	mov	w0, #1
	bl	_libmin_fail
	b	LBB2_3
LBB2_3:
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	ldur	x0, [x29, #-24]                 ; 8-byte Folded Reload
	adrp	x2, _keytext@PAGE
	add	x2, x2, _keytext@PAGEOFF
	bl	_decipher
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w8, [x8]
	adrp	x9, _plaintext@PAGE
	ldr	w9, [x9, _plaintext@PAGEOFF]
	subs	w8, w8, w9
	cset	w8, ne
	tbnz	w8, #0, LBB2_5
	b	LBB2_4
LBB2_4:
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w8, [x8, #4]
	ldr	w9, [x9, #4]
	subs	w8, w8, w9
	cset	w8, eq
	tbnz	w8, #0, LBB2_6
	b	LBB2_5
LBB2_5:
	mov	w0, #2
	bl	_libmin_fail
	b	LBB2_6
LBB2_6:
	adrp	x0, l_.str@PAGE
	add	x0, x0, l_.str@PAGEOFF
	bl	_libmin_printf
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	adrp	x9, _plaintext@PAGE
	ldr	w9, [x9, _plaintext@PAGEOFF]
                                        ; implicit-def: $x10
	mov	x10, x9
	ldr	w9, [x8, #4]
                                        ; implicit-def: $x8
	mov	x8, x9
	mov	x9, sp
	str	x10, [x9]
	str	x8, [x9, #8]
	adrp	x0, l_.str.1@PAGE
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_libmin_printf
	ldur	x8, [x29, #-24]                 ; 8-byte Folded Reload
	ldr	w9, [x8]
                                        ; implicit-def: $x10
	mov	x10, x9
	ldr	w9, [x8, #4]
                                        ; implicit-def: $x8
	mov	x8, x9
	mov	x9, sp
	str	x10, [x9]
	str	x8, [x9, #8]
	adrp	x0, l_.str.2@PAGE
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_libmin_printf
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w9, [x8]
                                        ; implicit-def: $x10
	mov	x10, x9
	ldr	w9, [x8, #4]
                                        ; implicit-def: $x8
	mov	x8, x9
	mov	x9, sp
	str	x10, [x9]
	str	x8, [x9, #8]
	adrp	x0, l_.str.3@PAGE
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_libmin_printf
	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	__DATA,__data
	.globl	_keytext                        ; @keytext
	.p2align	2
_keytext:
	.long	358852050                       ; 0x1563a5d2
	.long	311606025                       ; 0x1292bb09
	.long	739108171                       ; 0x2c0de54b
	.long	861449956                       ; 0x3358aee4

	.globl	_plaintext                      ; @plaintext
	.p2align	2
_plaintext:
	.long	765625614                       ; 0x2da2850e
	.long	14247501                        ; 0xd9664d

	.globl	_cipherref                      ; @cipherref
	.p2align	2
_cipherref:
	.long	2682439780                      ; 0x9fe2c864
	.long	3621408164                      ; 0xd7da4da4

	.comm	_ciphertext,8,2                 ; @ciphertext
	.comm	_newplain,8,2                   ; @newplain
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TEA Cipher results:\n"

l_.str.1:                               ; @.str.1
	.asciz	"  plaintext:  0x%08lx 0x%08lx\n"

l_.str.2:                               ; @.str.2
	.asciz	"  ciphertext: 0x%08lx 0x%08lx\n"

l_.str.3:                               ; @.str.3
	.asciz	"  newplain:   0x%08lx 0x%08lx\n"

.subsections_via_symbols