	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sw_init_digital
_sw_init_digital:                       ## @sw_init_digital
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_local_irq_save
	movq	%r14, %rdi
	callq	_gameport_trigger
	movq	_SW_TIMEOUT@GOTPCREL(%rip), %r15
	imull	$1000, (%r15), %esi             ## imm = 0x3E8
	movq	%r14, %rdi
	callq	_gameport_time
	movl	%eax, %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_gameport_read
	addl	$-1, %ebx
	setb	%cl
	testb	$1, %al
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testb	%cl, %cl
	jne	LBB0_1
LBB0_3:
	movl	$140, %edi
	callq	_udelay
	movq	%r14, %rdi
	callq	_gameport_trigger
	imull	$1000, (%r15), %esi             ## imm = 0x3E8
	movq	%r14, %rdi
	callq	_gameport_time
	movl	%eax, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_gameport_read
	addl	$-1, %ebx
	setb	%cl
	testb	$1, %al
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testb	%cl, %cl
	jne	LBB0_4
LBB0_6:
	movl	$865, %edi                      ## imm = 0x361
	callq	_udelay
	movq	%r14, %rdi
	callq	_gameport_trigger
	imull	$1000, (%r15), %esi             ## imm = 0x3E8
	movq	%r14, %rdi
	callq	_gameport_time
	movl	%eax, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_gameport_read
	addl	$-1, %ebx
	setb	%cl
	testb	$1, %al
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	testb	%cl, %cl
	jne	LBB0_7
LBB0_9:
	movl	$440, %edi                      ## imm = 0x1B8
	callq	_udelay
	movq	%r14, %rdi
	callq	_gameport_trigger
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_local_irq_restore              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SW_TIMEOUT,4,2                 ## @SW_TIMEOUT
	.no_dead_strip	_sw_init_digital
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sw_init_digital
_sw_init_digital:                       ; @sw_init_digital
	.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
	mov	x19, x0
	bl	_local_irq_save
	mov	x0, x19
	bl	_gameport_trigger
Lloh0:
	adrp	x21, _SW_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SW_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x21]
	mov	w9, #1000
	mul	w1, w8, w9
	mov	x0, x19
	bl	_gameport_time
	mov	x20, x0
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_gameport_read
	subs	w20, w20, #1
	cset	w8, hs
	tbz	w0, #0, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	tbnz	w8, #0, LBB0_1
LBB0_3:
	mov	w0, #140
	bl	_udelay
	mov	x0, x19
	bl	_gameport_trigger
	ldr	w8, [x21]
	mov	w9, #1000
	mul	w1, w8, w9
	mov	x0, x19
	bl	_gameport_time
	mov	x20, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_gameport_read
	subs	w20, w20, #1
	cset	w8, hs
	tbz	w0, #0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	tbnz	w8, #0, LBB0_4
LBB0_6:
	mov	w0, #865
	bl	_udelay
	mov	x0, x19
	bl	_gameport_trigger
	ldr	w8, [x21]
	mov	w9, #1000
	mul	w1, w8, w9
	mov	x0, x19
	bl	_gameport_time
	mov	x20, x0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_gameport_read
	subs	w20, w20, #1
	cset	w8, hs
	tbz	w0, #0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	tbnz	w8, #0, LBB0_7
LBB0_9:
	mov	w0, #440
	bl	_udelay
	mov	x0, x19
	bl	_gameport_trigger
	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	_local_irq_restore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SW_TIMEOUT,4,2                 ; @SW_TIMEOUT
	.no_dead_strip	_sw_init_digital
.subsections_via_symbols
