	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function isicom_find_port
_isicom_find_port:                      ## @isicom_find_port
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	(%rdi), %ebx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.1:
	movq	_PORT_COUNT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jge	LBB0_7
## %bb.2:
	movq	%rdi, %r14
	movl	%ebx, %edi
	callq	_BOARD
	movq	_isi_card@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, %eax
	movq	_FIRMWARE_LOADED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx,%rax,8)
	je	LBB0_5
## %bb.3:
	movl	%eax, %edx
	shll	$4, %edx
	movl	4(%rcx,%rax,8), %eax
	addl	%edx, %eax
	decl	%eax
	cmpl	%eax, %ebx
	jbe	LBB0_6
LBB0_5:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_6:
	movq	_isi_ports@GOTPCREL(%rip), %rax
	shlq	$2, %rbx
	addq	(%rax), %rbx
	movl	4(%r14), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_isicom_paranoia_check
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	cmoveq	%rbx, %rax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PORT_COUNT,4,2                 ## @PORT_COUNT
	.comm	_isi_card,8,3                   ## @isi_card
	.comm	_FIRMWARE_LOADED,4,2            ## @FIRMWARE_LOADED
	.comm	_isi_ports,8,3                  ## @isi_ports
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"isicom_open"

	.no_dead_strip	_isicom_find_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function isicom_find_port
_isicom_find_port:                      ; @isicom_find_port
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	x0, #0
	ldr	w20, [x19]
	tbnz	w20, #31, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _PORT_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PORT_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ge	LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_BOARD
Lloh3:
	adrp	x8, _isi_card@GOTPAGE
Lloh4:
	ldr	x8, [x8, _isi_card@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x8]
	mov	w8, w0
	lsl	x10, x8, #3
	ldr	w10, [x9, x10]
Lloh6:
	adrp	x11, _FIRMWARE_LOADED@GOTPAGE
Lloh7:
	ldr	x11, [x11, _FIRMWARE_LOADED@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_4
; %bb.3:
	add	x9, x9, x8, lsl #3
	ldr	w9, [x9, #4]
	add	w8, w9, w8, lsl #4
	sub	w8, w8, #1
	cmp	w20, w8
	b.ls	LBB0_5
LBB0_4:
	mov	x0, #0
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x8, _isi_ports@GOTPAGE
Lloh10:
	ldr	x8, [x8, _isi_ports@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x20, x8, x20, lsl #2
	ldr	w1, [x19, #4]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_isicom_paranoia_check
	cmp	x0, #0
	csel	x0, x20, xzr, eq
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PORT_COUNT,4,2                 ; @PORT_COUNT
	.comm	_isi_card,8,3                   ; @isi_card
	.comm	_FIRMWARE_LOADED,4,2            ; @FIRMWARE_LOADED
	.comm	_isi_ports,8,3                  ; @isi_ports
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"isicom_open"

	.no_dead_strip	_isicom_find_port
.subsections_via_symbols
