	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SBIRQHandler
_SBIRQHandler:                          ## @SBIRQHandler
	.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
	movq	_format@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	movq	_SBPort@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	je	LBB0_3
## %bb.1:
	addl	$4, %edi
	movl	$130, %esi
	callq	_outportb
	movl	(%rbx), %edi
	addl	$5, %edi
	callq	_inportb
	testb	$2, %al
	je	LBB0_5
## %bb.2:
	movl	(%rbx), %edi
	addl	$15, %edi
	jmp	LBB0_4
LBB0_3:
	addl	$14, %edi
LBB0_4:
	callq	_inportb
LBB0_5:
	movq	_hbusy@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_9
## %bb.6:
	movl	$32, %edi
	movl	$32, %esi
	callq	_outportb
	movq	_SBIRQ@GOTPCREL(%rip), %rax
	cmpl	$8, (%rax)
	jl	LBB0_8
## %bb.7:
	movl	$160, %edi
	movl	$32, %esi
	callq	_outportb
LBB0_8:
	movq	_whichbuf@GOTPCREL(%rip), %rax
	xorb	$1, (%rax)
	jmp	LBB0_26
LBB0_9:
	movl	$1, (%r15)
	cmpl	$0, (%r12)
	je	LBB0_11
## %bb.10:
	movq	_SBDMA16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	$3, %eax
	leal	194(,%rax,4), %ebx
	jmp	LBB0_12
LBB0_11:
	movq	_SBDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax), %ebx
	incl	%ebx
LBB0_12:
	movl	%ebx, %edi
	callq	_inportb
	movl	%eax, %r14d
	movl	%ebx, %edi
	callq	_inportb
	shll	$8, %eax
	orl	%r14d, %eax
	movq	_fragsize@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r13d
	xorl	%r14d, %r14d
	cmpl	%r13d, %eax
	movq	_LMBuffer@GOTPCREL(%rip), %rax
	cmovll	%r14d, %r13d
	movb	(%r12), %cl
	shll	%cl, %r13d
	addl	(%rax), %r13d
	movq	__dos_ds@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	__farsetsel
	movl	(%r12), %ecx
	movq	_ssilence@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.13:
	testl	%ecx, %ecx
	movl	$-2139062144, %eax              ## imm = 0x80808080
	cmovel	%eax, %r14d
	movl	(%rbx), %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	cmpl	$4, %ebx
	jb	LBB0_21
## %bb.14:
	sarl	$2, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	movl	%r14d, %esi
	callq	__farnspokel
	addl	$4, %r13d
	decl	%ebx
	jne	LBB0_15
	jmp	LBB0_21
LBB0_16:
	movq	_ReadPtr@GOTPCREL(%rip), %rsi
	movl	(%rsi), %eax
	movl	(%rbx), %edx
	movl	%edx, %r12d
	shll	%cl, %r12d
	cmpl	$4, %r12d
	jb	LBB0_20
## %bb.17:
	sarl	$2, %r12d
	movq	_WaveBuffer@GOTPCREL(%rip), %rdx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movslq	%eax, %r14
	addq	(%rdx), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rbx,4), %esi
	movl	%r13d, %edi
	callq	__farnspokel
	addl	$4, %r13d
	incq	%rbx
	cmpl	%ebx, %r12d
	jne	LBB0_18
## %bb.19:
	movq	_ReadPtr@GOTPCREL(%rip), %rsi
	movl	(%rsi), %eax
	movq	_fragsize@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_20:
	addl	%eax, %edx
	movq	_fragtotal@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	andl	%edx, %eax
	movl	%eax, (%rsi)
LBB0_21:
	movq	_soundjoyeron@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_25
## %bb.22:
	movl	_SBIRQHandler.coot(%rip), %eax
	testl	%eax, %eax
	jne	LBB0_24
## %bb.23:
	xorl	%eax, %eax
	callq	_UpdateJoyData
	movq	_soundjoyer@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movl	_SBIRQHandler.coot(%rip), %eax
LBB0_24:
	incl	%eax
	andl	$3, %eax
	movl	%eax, _SBIRQHandler.coot(%rip)
LBB0_25:
	movl	$0, (%r15)
	movl	$32, %edi
	movl	$32, %esi
	callq	_outportb
	movq	_SBIRQ@GOTPCREL(%rip), %rax
	cmpl	$8, (%rax)
	jl	LBB0_26
## %bb.27:
	movl	$160, %edi
	movl	$32, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outportb                       ## TAILCALL
LBB0_26:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_format,4,2                     ## @format
	.comm	_SBPort,4,2                     ## @SBPort
	.comm	_hbusy,4,2                      ## @hbusy
	.comm	_SBIRQ,4,2                      ## @SBIRQ
	.comm	_whichbuf,4,2                   ## @whichbuf
	.comm	_SBDMA16,4,2                    ## @SBDMA16
	.comm	_SBDMA,4,2                      ## @SBDMA
	.comm	_fragsize,4,2                   ## @fragsize
	.comm	_LMBuffer,4,2                   ## @LMBuffer
	.comm	__dos_ds,4,2                    ## @_dos_ds
	.comm	_WaveBuffer,8,3                 ## @WaveBuffer
	.comm	_ReadPtr,4,2                    ## @ReadPtr
	.comm	_ssilence,8,3                   ## @ssilence
	.comm	_fragtotal,4,2                  ## @fragtotal
	.comm	_soundjoyeron,8,3               ## @soundjoyeron
.zerofill __DATA,__bss,_SBIRQHandler.coot,4,2 ## @SBIRQHandler.coot
	.comm	_soundjoyer,4,2                 ## @soundjoyer
	.no_dead_strip	_SBIRQHandler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SBIRQHandler
_SBIRQHandler:                          ; @SBIRQHandler
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x22, _format@GOTPAGE
Lloh1:
	ldr	x22, [x22, _format@GOTPAGEOFF]
	ldr	w9, [x22]
Lloh2:
	adrp	x19, _SBPort@GOTPAGE
Lloh3:
	ldr	x19, [x19, _SBPort@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w9, LBB0_3
; %bb.1:
	add	w0, w8, #4
	mov	w1, #130
	bl	_outportb
	ldr	w8, [x19]
	add	w0, w8, #5
	bl	_inportb
	tbz	w0, #1, LBB0_5
; %bb.2:
	ldr	w8, [x19]
	add	w0, w8, #15
	b	LBB0_4
LBB0_3:
	add	w0, w8, #14
LBB0_4:
	bl	_inportb
LBB0_5:
Lloh4:
	adrp	x21, _hbusy@GOTPAGE
Lloh5:
	ldr	x21, [x21, _hbusy@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_9
; %bb.6:
	mov	w0, #32
	mov	w1, #32
	bl	_outportb
Lloh6:
	adrp	x8, _SBIRQ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SBIRQ@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, #8
	b.lt	LBB0_8
; %bb.7:
	mov	w0, #160
	mov	w1, #32
	bl	_outportb
LBB0_8:
Lloh9:
	adrp	x8, _whichbuf@GOTPAGE
Lloh10:
	ldr	x8, [x8, _whichbuf@GOTPAGEOFF]
	ldr	w9, [x8]
	eor	w9, w9, #0x1
	str	w9, [x8]
	b	LBB0_27
LBB0_9:
	mov	w19, #1
	str	w19, [x21]
	ldr	w8, [x22]
	cbz	w8, LBB0_11
; %bb.10:
Lloh11:
	adrp	x8, _SBDMA16@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SBDMA16@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	mov	w19, #194
	bfi	w19, w8, #2, #2
	b	LBB0_12
LBB0_11:
Lloh14:
	adrp	x8, _SBDMA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SBDMA@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	bfi	w19, w8, #1, #31
LBB0_12:
	mov	x0, x19
	bl	_inportb
	mov	x20, x0
	mov	x0, x19
	bl	_inportb
	orr	w8, w20, w0, lsl #8
Lloh17:
	adrp	x23, _fragsize@GOTPAGE
Lloh18:
	ldr	x23, [x23, _fragsize@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh19:
	adrp	x10, _LMBuffer@GOTPAGE
Lloh20:
	ldr	x10, [x10, _LMBuffer@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	cmp	w8, w9
	csel	w8, wzr, w9, lt
	ldr	w9, [x22]
	lsl	w8, w8, w9
	add	w19, w8, w10
Lloh22:
	adrp	x8, __dos_ds@GOTPAGE
Lloh23:
	ldr	x8, [x8, __dos_ds@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	__farsetsel
	ldr	w9, [x22]
Lloh25:
	adrp	x8, _ssilence@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ssilence@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	cbz	x8, LBB0_16
; %bb.13:
	mov	w8, #-2139062144
	cmp	w9, #0
	csel	w20, w8, wzr, eq
	ldr	w8, [x23]
	lsl	w8, w8, w9
	cmp	w8, #4
	b.lo	LBB0_21
; %bb.14:
	asr	w22, w8, #2
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	__farnspokel
	add	w19, w19, #4
	subs	w22, w22, #1
	b.ne	LBB0_15
	b	LBB0_21
LBB0_16:
Lloh28:
	adrp	x20, _ReadPtr@GOTPAGE
Lloh29:
	ldr	x20, [x20, _ReadPtr@GOTPAGEOFF]
	ldr	w8, [x20]
	ldr	w10, [x23]
	lsl	w11, w10, w9
	cmp	w11, #4
	b.lo	LBB0_20
; %bb.17:
	asr	w22, w11, #2
Lloh30:
	adrp	x10, _WaveBuffer@GOTPAGE
Lloh31:
	ldr	x10, [x10, _WaveBuffer@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x10]
	lsl	w8, w8, w9
	add	x24, x10, w8, sxtw
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24], #4
	mov	x0, x19
	bl	__farnspokel
	add	w19, w19, #4
	subs	w22, w22, #1
	b.ne	LBB0_18
; %bb.19:
	ldr	w8, [x20]
	ldr	w10, [x23]
LBB0_20:
Lloh33:
	adrp	x9, _fragtotal@GOTPAGE
Lloh34:
	ldr	x9, [x9, _fragtotal@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	sub	w9, w9, #1
	add	w8, w10, w8
	and	w8, w9, w8
	str	w8, [x20]
LBB0_21:
Lloh36:
	adrp	x8, _soundjoyeron@GOTPAGE
Lloh37:
	ldr	x8, [x8, _soundjoyeron@GOTPAGEOFF]
Lloh38:
	ldr	x8, [x8]
	cbz	x8, LBB0_25
; %bb.22:
	adrp	x19, _SBIRQHandler.coot@PAGE
	ldr	w8, [x19, _SBIRQHandler.coot@PAGEOFF]
	cbnz	w8, LBB0_24
; %bb.23:
	bl	_UpdateJoyData
Lloh39:
	adrp	x8, _soundjoyer@GOTPAGE
Lloh40:
	ldr	x8, [x8, _soundjoyer@GOTPAGEOFF]
	mov	w9, #1
Lloh41:
	str	w9, [x8]
	ldr	w8, [x19, _SBIRQHandler.coot@PAGEOFF]
LBB0_24:
	add	w8, w8, #1
	and	w8, w8, #0x3
	str	w8, [x19, _SBIRQHandler.coot@PAGEOFF]
LBB0_25:
	str	wzr, [x21]
	mov	w0, #32
	mov	w1, #32
	bl	_outportb
Lloh42:
	adrp	x8, _SBIRQ@GOTPAGE
Lloh43:
	ldr	x8, [x8, _SBIRQ@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	cmp	w8, #8
	b.lt	LBB0_27
; %bb.26:
	mov	w0, #160
	mov	w1, #32
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_outportb
LBB0_27:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotStr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_format,4,2                     ; @format
	.comm	_SBPort,4,2                     ; @SBPort
	.comm	_hbusy,4,2                      ; @hbusy
	.comm	_SBIRQ,4,2                      ; @SBIRQ
	.comm	_whichbuf,4,2                   ; @whichbuf
	.comm	_SBDMA16,4,2                    ; @SBDMA16
	.comm	_SBDMA,4,2                      ; @SBDMA
	.comm	_fragsize,4,2                   ; @fragsize
	.comm	_LMBuffer,4,2                   ; @LMBuffer
	.comm	__dos_ds,4,2                    ; @_dos_ds
	.comm	_WaveBuffer,8,3                 ; @WaveBuffer
	.comm	_ReadPtr,4,2                    ; @ReadPtr
	.comm	_ssilence,8,3                   ; @ssilence
	.comm	_fragtotal,4,2                  ; @fragtotal
	.comm	_soundjoyeron,8,3               ; @soundjoyeron
.zerofill __DATA,__bss,_SBIRQHandler.coot,4,2 ; @SBIRQHandler.coot
	.comm	_soundjoyer,4,2                 ; @soundjoyer
	.no_dead_strip	_SBIRQHandler
.subsections_via_symbols
