	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_testcollisions                 ## -- Begin function testcollisions
	.p2align	4, 0x90
_testcollisions:                        ## @testcollisions
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_clrscr
	movq	_BACKGROUND@GOTPCREL(%rip), %rax
	movq	_MENUITEM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	(%rax), %rdi
	callq	_textattr
	movl	$27, %edi
	movl	$3, %esi
	callq	_gotoxy
	leaq	L_.str(%rip), %rdi
	callq	_cputs
	movl	$8, %edi
	movl	$5, %esi
	callq	_gotoxy
	leaq	L_.str.1(%rip), %rdi
	callq	_cputs
	movl	$17, %edi
	movl	$6, %esi
	callq	_gotoxy
	leaq	L_.str.2(%rip), %rdi
	callq	_cputs
	movl	$30, %edi
	movl	$8, %esi
	callq	_gotoxy
	leaq	L_.str.3(%rip), %rdi
	callq	_cputs
	movq	_pressed@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movl	$1024, %esi                     ## imm = 0x400
	callq	___bzero
	xorl	%eax, %eax
	callq	_key_init
	movq	_hi@GOTPCREL(%rip), %r15
	movq	_lo@GOTPCREL(%rip), %r13
	movq	_buffer@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$17, %edi
	movl	$12, %esi
	xorl	%edx, %edx
	callq	_showjoy
	movl	$29, %edi
	movl	$12, %esi
	movl	$1, %edx
	callq	_showjoy
	movl	$41, %edi
	movl	$12, %esi
	movl	$2, %edx
	callq	_showjoy
	movl	$53, %edi
	movl	$12, %esi
	movl	$3, %edx
	callq	_showjoy
	movq	(%r15), %rax
	movq	(%r13), %rsi
	cmpq	%rsi, %rax
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rcx
	movl	(%rcx,%rsi,4), %edi
	xorl	%ebx, %ebx
	cmpl	$256, %edi                      ## imm = 0x100
	setl	%bl
	incq	%rsi
	cmpq	$100, %rsi
	movl	$0, %edx
	cmovneq	%rsi, %rdx
	movq	(%r14), %rsi
	movzbl	%dil, %edi
	movl	%ebx, (%rsi,%rdi,4)
	movq	%rdx, (%r13)
	cmpl	$0, 4(%rsi)
	je	LBB0_1
## %bb.4:
	xorl	%r8d, %r8d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdx, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rcx,%rdx,4), %ebx
	xorl	%edi, %edi
	cmpl	$256, %ebx                      ## imm = 0x100
	setl	%dil
	movzbl	%bl, %ebx
	incq	%rdx
	cmpq	$100, %rdx
	cmoveq	%r8, %rdx
	movl	%edi, (%rsi,%rbx,4)
	movq	%rdx, (%r13)
	cmpl	$0, 4(%rsi)
	jne	LBB0_5
## %bb.8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_key_done                       ## TAILCALL
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_BACKGROUND,8,3                 ## @BACKGROUND
	.comm	_MENUITEM,8,3                   ## @MENUITEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Test keyboard collisions"

L_.str.1:                               ## @.str.1
	.asciz	"Here you can test, if the keys you've choosen do not collide."

L_.str.2:                               ## @.str.2
	.asciz	"(only few keyboards allow all combinations)"

L_.str.3:                               ## @.str.3
	.asciz	"Press ESC to exit."

	.comm	_pressed,8,3                    ## @pressed
	.comm	_hi,8,3                         ## @hi
	.comm	_lo,8,3                         ## @lo
	.comm	_buffer,8,3                     ## @buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_testcollisions                 ; -- Begin function testcollisions
	.p2align	2
_testcollisions:                        ; @testcollisions
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	bl	_clrscr
Lloh0:
	adrp	x8, _BACKGROUND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BACKGROUND@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _MENUITEM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MENUITEM@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_textattr
	mov	w0, #27
	mov	w1, #3
	bl	_gotoxy
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_cputs
	mov	w0, #8
	mov	w1, #5
	bl	_gotoxy
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_cputs
	mov	w0, #17
	mov	w1, #6
	bl	_gotoxy
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_cputs
	mov	w0, #30
	mov	w1, #8
	bl	_gotoxy
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_cputs
Lloh14:
	adrp	x20, _pressed@GOTPAGE
Lloh15:
	ldr	x20, [x20, _pressed@GOTPAGEOFF]
	ldr	x0, [x20]
	mov	w1, #1024
	bl	_bzero
	bl	_key_init
Lloh16:
	adrp	x21, _hi@GOTPAGE
Lloh17:
	ldr	x21, [x21, _hi@GOTPAGEOFF]
Lloh18:
	adrp	x19, _lo@GOTPAGE
Lloh19:
	ldr	x19, [x19, _lo@GOTPAGEOFF]
Lloh20:
	adrp	x22, _buffer@GOTPAGE
Lloh21:
	ldr	x22, [x22, _buffer@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #17
	mov	w1, #12
	mov	w2, #0
	bl	_showjoy
	mov	w0, #29
	mov	w1, #12
	mov	w2, #1
	bl	_showjoy
	mov	w0, #41
	mov	w1, #12
	mov	w2, #2
	bl	_showjoy
	mov	w0, #53
	mov	w1, #12
	mov	w2, #3
	bl	_showjoy
	ldr	x8, [x21]
	ldr	x11, [x19]
	cmp	x8, x11
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x9, [x22]
	ldr	w12, [x9, x11, lsl #2]
	cmp	w12, #256
	cset	w13, lt
	ldr	x10, [x20]
	and	x12, x12, #0xff
	str	w13, [x10, x12, lsl #2]
	add	x12, x11, #1
	cmp	x12, #100
	csinc	x11, xzr, x11, eq
	str	x11, [x19]
	ldr	w12, [x10, #4]
	cbz	w12, LBB0_1
	b	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	b	LBB0_3
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w12, [x9, x11, lsl #2]
	cmp	w12, #256
	cset	w13, lt
	and	x12, x12, #0xff
	str	w13, [x10, x12, lsl #2]
	add	x12, x11, #1
	cmp	x12, #100
	csinc	x11, xzr, x11, eq
	str	x11, [x19]
	ldr	w12, [x10, #4]
	cbz	w12, LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x8, x11
	b.ne	LBB0_4
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	b	LBB0_6
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_key_done
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BACKGROUND,8,3                 ; @BACKGROUND
	.comm	_MENUITEM,8,3                   ; @MENUITEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Test keyboard collisions"

l_.str.1:                               ; @.str.1
	.asciz	"Here you can test, if the keys you've choosen do not collide."

l_.str.2:                               ; @.str.2
	.asciz	"(only few keyboards allow all combinations)"

l_.str.3:                               ; @.str.3
	.asciz	"Press ESC to exit."

	.comm	_pressed,8,3                    ; @pressed
	.comm	_hi,8,3                         ; @hi
	.comm	_lo,8,3                         ; @lo
	.comm	_buffer,8,3                     ; @buffer
.subsections_via_symbols
