	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_INPUT_SelectMultiJoy           ## -- Begin function INPUT_SelectMultiJoy
	.p2align	4, 0x90
_INPUT_SelectMultiJoy:                  ## @INPUT_SelectMultiJoy
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	andl	$3, %edi
	movq	_joy_multijoy_no@GOTPCREL(%rip), %rax
	movl	%edi, (%rax)
	movq	_INPUT_joy_multijoy@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.1:
	movq	_Atari800_machine_type@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_Atari800_MACHINE_5200@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	_STICK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%edi, %ecx
	movl	$240, %edx
	orl	(%rax,%rcx,4), %edx
	movq	_PIA_PORT_input@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%edx, (%rax)
	movq	_TRIG_input@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rcx,4), %eax
	movq	_GTIA_TRIG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rcx)
LBB0_3:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_joy_multijoy_no,4,2            ## @joy_multijoy_no
	.comm	_INPUT_joy_multijoy,8,3         ## @INPUT_joy_multijoy
	.comm	_Atari800_machine_type,8,3      ## @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ## @Atari800_MACHINE_5200
	.comm	_STICK,8,3                      ## @STICK
	.comm	_PIA_PORT_input,8,3             ## @PIA_PORT_input
	.comm	_TRIG_input,8,3                 ## @TRIG_input
	.comm	_GTIA_TRIG,8,3                  ## @GTIA_TRIG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_INPUT_SelectMultiJoy           ; -- Begin function INPUT_SelectMultiJoy
	.p2align	2
_INPUT_SelectMultiJoy:                  ; @INPUT_SelectMultiJoy
	.cfi_startproc
; %bb.0:
	and	w8, w0, #0x3
Lloh0:
	adrp	x9, _joy_multijoy_no@GOTPAGE
Lloh1:
	ldr	x9, [x9, _joy_multijoy_no@GOTPAGEOFF]
Lloh2:
	str	w8, [x9]
Lloh3:
	adrp	x9, _INPUT_joy_multijoy@GOTPAGE
Lloh4:
	ldr	x9, [x9, _INPUT_joy_multijoy@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cbz	x9, LBB0_3
; %bb.1:
Lloh6:
	adrp	x9, _Atari800_machine_type@GOTPAGE
Lloh7:
	ldr	x9, [x9, _Atari800_machine_type@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _Atari800_MACHINE_5200@GOTPAGE
Lloh10:
	ldr	x10, [x10, _Atari800_MACHINE_5200@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_3
; %bb.2:
Lloh12:
	adrp	x9, _STICK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _STICK@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	lsl	x8, x8, #2
	ldr	w9, [x9, x8]
Lloh15:
	adrp	x10, _PIA_PORT_input@GOTPAGE
Lloh16:
	ldr	x10, [x10, _PIA_PORT_input@GOTPAGEOFF]
	orr	w9, w9, #0xf0
Lloh17:
	ldr	x10, [x10]
	str	w9, [x10]
Lloh18:
	adrp	x9, _TRIG_input@GOTPAGE
Lloh19:
	ldr	x9, [x9, _TRIG_input@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	ldr	w8, [x9, x8]
Lloh21:
	adrp	x9, _GTIA_TRIG@GOTPAGE
Lloh22:
	ldr	x9, [x9, _GTIA_TRIG@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	str	w8, [x9]
LBB0_3:
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_joy_multijoy_no,4,2            ; @joy_multijoy_no
	.comm	_INPUT_joy_multijoy,8,3         ; @INPUT_joy_multijoy
	.comm	_Atari800_machine_type,8,3      ; @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ; @Atari800_MACHINE_5200
	.comm	_STICK,8,3                      ; @STICK
	.comm	_PIA_PORT_input,8,3             ; @PIA_PORT_input
	.comm	_TRIG_input,8,3                 ; @TRIG_input
	.comm	_GTIA_TRIG,8,3                  ; @GTIA_TRIG
.subsections_via_symbols
