	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b1_detect                      ## -- Begin function b1_detect
	.p2align	4, 0x90
_b1_detect:                             ## @b1_detect
	.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
	movl	%esi, %ebx
	movl	%edi, %r15d
	movl	%edi, %r14d
	movq	_B1_INSTAT@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	%r14, %rdi
	callq	_inb
	movl	$1, %r12d
	testb	$-4, %al
	jne	LBB0_17
## %bb.1:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_B1_OUTSTAT@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	%r14, %rdi
	callq	_inb
	testb	$-4, %al
	jne	LBB0_17
## %bb.2:
	movq	(%r13), %rsi
	movl	$2, %r12d
	movl	%r15d, %edi
	movl	$2, %edx
	callq	_b1outp
	movq	(%r13), %rdi
	addq	%r14, %rdi
	callq	_inb
	andl	$254, %eax
	cmpl	$2, %eax
	jne	LBB0_17
## %bb.3:
	movq	(%r13), %rsi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_b1outp
	movq	(%rbx), %rsi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_b1outp
	movq	(%r13), %rdi
	addq	%r14, %rdi
	callq	_inb
	movl	$3, %r12d
	testb	$-2, %al
	jne	LBB0_17
## %bb.4:
	addq	(%rbx), %r14
	movq	%r14, %rdi
	callq	_inb
	testb	$-2, %al
	jne	LBB0_17
## %bb.5:
	movl	%r15d, %edi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	movl	$4, %r12d
	cmpl	$1, %eax
	jne	LBB0_17
## %bb.6:
	movl	%r15d, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	testl	%eax, %eax
	jne	LBB0_17
## %bb.7:
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	cmpl	$1, %eax
	jne	LBB0_17
## %bb.8:
	movl	%r15d, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	testl	%eax, %eax
	jne	LBB0_17
## %bb.9:
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	cmpl	$1, %eax
	jne	LBB0_17
## %bb.10:
	movl	%r15d, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	testl	%eax, %eax
	jne	LBB0_17
## %bb.11:
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	cmpl	$1, %eax
	jne	LBB0_17
## %bb.12:
	movl	%r15d, %edi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	testl	%eax, %eax
	jne	LBB0_17
## %bb.13:
	movl	%r15d, %edi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	cmpl	$1, %eax
	jne	LBB0_17
## %bb.14:
	movl	%r15d, %edi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_b1_set_test_bit
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_b1_get_test_bit
	testl	%eax, %eax
	jne	LBB0_17
## %bb.15:
	movq	_avm_m1@GOTPCREL(%rip), %rax
	movl	$0, %r12d
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	je	LBB0_17
## %bb.16:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_B1_STAT1
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_b1_rd_reg
	andl	$15, %eax
	xorl	%ecx, %ecx
	cmpl	$1, %eax
	setne	%cl
	leal	(%rcx,%rcx,4), %r12d
LBB0_17:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_B1_INSTAT,8,3                  ## @B1_INSTAT
	.comm	_B1_OUTSTAT,8,3                 ## @B1_OUTSTAT
	.comm	_avm_m1,4,2                     ## @avm_m1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b1_detect                      ; -- Begin function b1_detect
	.p2align	2
_b1_detect:                             ; @b1_detect
	.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
	mov	x20, x1
	mov	x19, x0
	mov	w22, w0
Lloh0:
	adrp	x23, _B1_INSTAT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _B1_INSTAT@GOTPAGEOFF]
	ldr	x8, [x23]
	add	x0, x8, x22
	bl	_inb
	tst	w0, #0xfc
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x24, _B1_OUTSTAT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _B1_OUTSTAT@GOTPAGEOFF]
	ldr	x8, [x24]
	add	x0, x8, x22
	bl	_inb
	tst	w0, #0xfc
	b.eq	LBB0_4
LBB0_2:
	mov	w21, #1
LBB0_3:
	mov	x0, x21
	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
LBB0_4:
	ldr	x1, [x23]
	mov	w21, #2
	mov	x0, x19
	mov	w2, #2
	bl	_b1outp
	ldr	x8, [x23]
	add	x0, x8, x22
	bl	_inb
	and	w8, w0, #0xfe
	cmp	w8, #2
	b.ne	LBB0_3
; %bb.5:
	ldr	x1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_b1outp
	ldr	x1, [x24]
	mov	x0, x19
	mov	w2, #0
	bl	_b1outp
	ldr	x8, [x23]
	add	x0, x8, x22
	bl	_inb
	tst	w0, #0xfe
	b.ne	LBB0_7
; %bb.6:
	ldr	x8, [x24]
	add	x0, x8, x22
	bl	_inb
	tst	w0, #0xfe
	b.eq	LBB0_8
LBB0_7:
	mov	w21, #3
	b	LBB0_3
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cmp	w0, #1
	b.ne	LBB0_18
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cbnz	w0, LBB0_18
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cmp	w0, #1
	b.ne	LBB0_18
; %bb.11:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cbnz	w0, LBB0_18
; %bb.12:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cmp	w0, #1
	b.ne	LBB0_18
; %bb.13:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cbnz	w0, LBB0_18
; %bb.14:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cmp	w0, #1
	b.ne	LBB0_18
; %bb.15:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cbnz	w0, LBB0_18
; %bb.16:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cmp	w0, #1
	b.ne	LBB0_18
; %bb.17:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_b1_set_test_bit
	mov	x0, x19
	mov	x1, x20
	bl	_b1_get_test_bit
	cbz	w0, LBB0_19
LBB0_18:
	mov	w21, #4
	b	LBB0_3
LBB0_19:
Lloh4:
	adrp	x8, _avm_m1@GOTPAGE
Lloh5:
	ldr	x8, [x8, _avm_m1@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_21
; %bb.20:
	mov	w21, #0
	b	LBB0_3
LBB0_21:
	mov	x0, x20
	bl	_B1_STAT1
	mov	x1, x0
	mov	x0, x19
	bl	_b1_rd_reg
	and	w8, w0, #0xf
	mov	w9, #5
	cmp	w8, #1
	csel	w21, wzr, w9, eq
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_B1_INSTAT,8,3                  ; @B1_INSTAT
	.comm	_B1_OUTSTAT,8,3                 ; @B1_OUTSTAT
	.comm	_avm_m1,4,2                     ; @avm_m1
.subsections_via_symbols
