	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sx_open
_sx_open:                               ## @sx_open
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_func_enter
	movl	12(%r15), %edi
	callq	_SX_BOARD
	movq	_SX_NBOARD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_2
## %bb.1:
	movq	_sx_board@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
	movslq	%eax, %r14
	leaq	(%r14,%r14,2), %r13
	movq	_SX_BOARD_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12,%r13,4)
	je	LBB0_2
## %bb.4:
	leaq	(%r12,%r13,4), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_sx_port@GOTPCREL(%rip), %rax
	movq	_SX_NPORT@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rbx
	imulq	%r14, %rbx
	shlq	$5, %rbx
	addq	(%rax), %rbx
	movl	12(%r15), %edi
	callq	_SX_PORT
	cltq
	shlq	$5, %rax
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%rax), %r12
	movq	$0, 24(%rax,%rbx)
	movq	16(%rax,%rbx), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 64(%rax)
	movups	%xmm0, 48(%rax)
	movups	%xmm0, 32(%rax)
	movups	%xmm0, 16(%rax)
	movups	%xmm0, (%rax)
	movq	_SX_DEBUG_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	12(%r15), %edi
	callq	_SX_PORT
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%r14d, %edx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rcx
	movq	%r12, %r8
	movl	%eax, %r9d
	callq	_dprintk
	movl	8(%r15), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	callq	_sx_paranoia_check
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_func_enter
	jmp	LBB0_3
LBB0_2:
	xorl	%eax, %eax
	callq	_func_exit
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r14, %rdi
	callq	_sx_setup_board
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
LBB0_12:
	xorl	%eax, %eax
	callq	_func_exit
	jmp	LBB0_13
LBB0_8:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%rbx,%r13,4), %rdi
	addq	$4, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	incl	8(%r12)
	incl	8(%rbx,%r13,4)
	movq	%r12, (%r15)
	movq	%r15, (%r12)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_sx_setup_port
	testl	%eax, %eax
	jne	LBB0_9
## %bb.10:
	movq	%r15, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_block_til_ready
	testl	%eax, %eax
	je	LBB0_11
LBB0_9:
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_func_enter
	jmp	LBB0_13
LBB0_11:
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_SX_NBOARD,4,2                  ## @SX_NBOARD
	.comm	_sx_board,8,3                   ## @sx_board
	.comm	_SX_BOARD_PRESENT,4,2           ## @SX_BOARD_PRESENT
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_sx_port,8,3                    ## @sx_port
	.comm	_SX_NPORT,4,2                   ## @SX_NPORT
	.comm	_SX_DEBUG_OPEN,4,2              ## @SX_DEBUG_OPEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Board = %d, bp = %p, port = %p, portno = %d.\n"

L_.str.1:                               ## @.str.1
	.asciz	"sx_open"

	.no_dead_strip	_sx_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sx_open
_sx_open:                               ; @sx_open
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
	bl	_func_enter
	ldr	w0, [x20, #12]
	bl	_SX_BOARD
Lloh0:
	adrp	x8, _SX_NBOARD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SX_NBOARD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_4
; %bb.1:
	mov	x22, x0
Lloh3:
	adrp	x8, _sx_board@GOTPAGE
Lloh4:
	ldr	x8, [x8, _sx_board@GOTPAGEOFF]
Lloh5:
	ldr	x25, [x8]
	mov	w8, #12
	smaddl	x21, w0, w8, x25
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _SX_BOARD_PRESENT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SX_BOARD_PRESENT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh9:
	adrp	x8, _sx_port@GOTPAGE
Lloh10:
	ldr	x8, [x8, _sx_port@GOTPAGEOFF]
Lloh11:
	adrp	x9, _SX_NPORT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SX_NPORT@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	ldrsw	x9, [x9]
	sxtw	x10, w22
	mul	x9, x9, x10
	add	x23, x8, x9, lsl #5
	ldr	w0, [x20, #12]
	bl	_SX_PORT
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	add	x23, x23, x8, lsl #5
	str	xzr, [x23, #24]
	ldr	x8, [x23, #16]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x8, #48]
	stp	q0, q0, [x8, #16]
	str	q0, [x8]
Lloh15:
	adrp	x8, _SX_DEBUG_OPEN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SX_DEBUG_OPEN@GOTPAGEOFF]
Lloh17:
	ldr	w24, [x8]
	ldr	w0, [x20, #12]
	bl	_SX_PORT
	mov	x5, x0
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x22
	mov	x3, x21
	mov	x4, x23
	bl	_dprintk
	ldr	w1, [x20, #8]
Lloh20:
	adrp	x2, l_.str.1@PAGE
Lloh21:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_sx_paranoia_check
	cbz	x0, LBB0_7
; %bb.3:
	bl	_func_enter
	b	LBB0_5
LBB0_4:
	bl	_func_exit
LBB0_5:
Lloh22:
	adrp	x8, _ENODEV@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_6:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x21
	bl	_sx_setup_board
	cbz	w0, LBB0_10
; %bb.8:
	mov	x24, x0
LBB0_9:
	bl	_func_exit
	b	LBB0_6
LBB0_10:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	sxtw	x8, w22
	mov	w9, #12
	madd	x24, x8, x9, x25
	add	x22, x24, #4
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	w8, [x23, #8]
	add	w8, w8, #1
	str	w8, [x23, #8]
	ldr	w8, [x24, #8]
	add	w8, w8, #1
	str	w8, [x24, #8]
	str	x23, [x20]
	str	x20, [x23]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	mov	x0, x21
	mov	x1, x23
	bl	_sx_setup_port
	cbz	w0, LBB0_12
; %bb.11:
	mov	x24, x0
	b	LBB0_13
LBB0_12:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	bl	_block_til_ready
	mov	x24, x0
	cbz	w0, LBB0_9
LBB0_13:
	bl	_func_enter
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_SX_NBOARD,4,2                  ; @SX_NBOARD
	.comm	_sx_board,8,3                   ; @sx_board
	.comm	_SX_BOARD_PRESENT,4,2           ; @SX_BOARD_PRESENT
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_sx_port,8,3                    ; @sx_port
	.comm	_SX_NPORT,4,2                   ; @SX_NPORT
	.comm	_SX_DEBUG_OPEN,4,2              ; @SX_DEBUG_OPEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Board = %d, bp = %p, port = %p, portno = %d.\n"

l_.str.1:                               ; @.str.1
	.asciz	"sx_open"

	.no_dead_strip	_sx_open
.subsections_via_symbols
