	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_buffers                  ## -- Begin function setup_buffers
	.p2align	4, 0x90
_setup_buffers:                         ## @setup_buffers
	.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
	movl	%esi, %r15d
	movl	%edi, %ebx
	callq	_IS_VALID_CARD
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_sc_adapter@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %r13
	movq	(%rax,%r13,8), %rax
	movl	4(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	(%r14), %rax
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax,%r13,8), %rcx
	movq	_BUFFER_BASE@GOTPCREL(%rip), %rdx
	movl	(%rcx), %eax
	movl	4(%rcx), %esi
	subl	(%rdx), %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %r13d
	shrl	%r13d
	movq	_BUFFERS_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	cmovael	%eax, %r13d
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_pr_debug
	cmpl	$1, %r13d
	ja	LBB0_4
## %bb.3:
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rax
	movl	4(%rax), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movl	$-1, %r15d
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_4:
	movq	%r13, %rax
	movl	%r15d, -64(%rbp)                ## 4-byte Spill
	movslq	%r15d, %r15
	leaq	-1(%r15), %r14
	decl	%r15d
	imull	%r12d, %r15d
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	imull	%eax, %r15d
	movq	_sc_adapter@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	(%rax,%r13,8), %rax
	movl	4(%rax), %esi
	leaq	L_.str.4(%rip), %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_BUFFER_BASE@GOTPCREL(%rip), %rax
	addl	(%rax), %r15d
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r13,8), %rax
	movq	8(%rax), %rcx
	shlq	$4, %r14
	movl	%r15d, (%rcx,%r14)
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	shrl	%r8d
	movl	%r8d, 4(%rcx,%r14)
	movl	%r8d, 8(%rcx,%r14)
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	$0, 12(%rcx,%r14)
	movl	4(%rax), %esi
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %edx
	movl	%r8d, %ecx
	movq	%r8, %r15
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r13,8), %rax
	movl	4(%rax), %esi
	leaq	L_.str.6(%rip), %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	cmpl	$2, %r15d
	movl	$1, %r14d
	movq	%r15, %rax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	cmovael	%r15d, %r14d
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rax
	movq	8(%rax), %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addl	%ebx, %ecx
	imull	%r12d, %ecx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	addl	(%rdx,%rsi), %ecx
	movl	%ecx, -72(%rbp)
	movl	%r12d, -68(%rbp)
	movl	4(%rax), %esi
	incl	%ebx
	leaq	L_.str.7(%rip), %rdi
	movl	%ebx, %edx
	movl	%r12d, %r8d
	movl	%r12d, %r9d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_CEPID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ceReqTypeLnk@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ceReqClass1@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_ceReqLnkRead@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r13d, %edi
	movl	-64(%rbp), %r9d                 ## 4-byte Reload
	leaq	-72(%rbp), %rax
	pushq	%rax
	pushq	$8
	callq	_sendmessage
	addq	$16, %rsp
	cmpl	%r14d, %ebx
	jne	LBB0_5
LBB0_6:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid param: %d is not a valid card id\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"%s: setting up channel buffer space in shared RAM\n"

	.comm	_sc_adapter,8,3                 ## @sc_adapter
	.comm	_BUFFER_SIZE,4,2                ## @BUFFER_SIZE
	.comm	_BUFFER_BASE,4,2                ## @BUFFER_BASE
	.comm	_BUFFERS_MAX,4,2                ## @BUFFERS_MAX
L_.str.2:                               ## @.str.2
	.asciz	"%s: calculating buffer space: %d buffers, %d big\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: not enough buffer space\n"

L_.str.4:                               ## @.str.4
	.asciz	"%s: channel buffer offset from shared RAM: 0x%x\n"

L_.str.5:                               ## @.str.5
	.asciz	"%s: send buffer setup complete: first=0x%lx n=%d f=%d, nxt=%d\n"

L_.str.6:                               ## @.str.6
	.asciz	"%s: adding %d RecvBuffers:\n"

L_.str.7:                               ## @.str.7
	.asciz	"%s: adding RcvBuffer #%d offset=0x%lx sz=%d bufsz:%d\n"

	.comm	_CEPID,4,2                      ## @CEPID
	.comm	_ceReqTypeLnk,4,2               ## @ceReqTypeLnk
	.comm	_ceReqClass1,4,2                ## @ceReqClass1
	.comm	_ceReqLnkRead,4,2               ## @ceReqLnkRead
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_buffers                  ; -- Begin function setup_buffers
	.p2align	2
_setup_buffers:                         ; @setup_buffers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	mov	x19, x0
	bl	_IS_VALID_CARD
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x21, _sc_adapter@GOTPAGE
Lloh1:
	ldr	x21, [x21, _sc_adapter@GOTPAGEOFF]
	ldr	x8, [x21]
	sxtw	x9, w19
	str	x9, [sp, #32]                   ; 8-byte Folded Spill
	sbfiz	x20, x19, #3, #32
	ldr	x8, [x8, x20]
	ldr	w1, [x8, #4]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
Lloh4:
	adrp	x8, _BUFFER_SIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BUFFER_SIZE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	x9, [x21]
	ldr	x9, [x9, x20]
Lloh7:
	adrp	x25, _BUFFER_BASE@GOTPAGE
Lloh8:
	ldr	x25, [x25, _BUFFER_BASE@GOTPAGEOFF]
	mov	x24, x8
	ldr	w10, [x25]
	ldp	w11, w1, [x9]
	sub	w9, w11, w10
	udiv	w9, w9, w8
	lsr	w9, w9, #1
Lloh9:
	adrp	x10, _BUFFERS_MAX@GOTPAGE
Lloh10:
	ldr	x10, [x10, _BUFFERS_MAX@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	w9, w10
	csel	w21, w9, w10, lo
	stp	x21, x8, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_debug
	cmp	w21, #1
	b.hi	LBB0_4
; %bb.2:
Lloh14:
	adrp	x8, _sc_adapter@GOTPAGE
Lloh15:
	ldr	x8, [x8, _sc_adapter@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x8, [x8, x9, lsl #3]
	ldr	w1, [x8, #4]
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_debug
	mov	w0, #-1
	b	LBB0_7
LBB0_3:
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_pr_debug
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_4:
	sxtw	x8, w22
	mov	x20, x22
	sub	x22, x8, #1
	mul	w8, w24, w22
	mul	w23, w8, w21
Lloh24:
	adrp	x27, _sc_adapter@GOTPAGE
Lloh25:
	ldr	x27, [x27, _sc_adapter@GOTPAGEOFF]
	ldr	x8, [x27]
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	lsl	x26, x9, #3
	ldr	x8, [x8, x26]
	ldr	w1, [x8, #4]
	str	x23, [sp]
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
	ldr	w8, [x25]
	add	w8, w8, w23
	ldr	x9, [x27]
	ldr	x9, [x9, x26]
	ldr	x10, [x9, #8]
	add	x10, x10, x22, lsl #4
	lsr	w25, w21, #1
	stp	w8, w25, [x10]
	stp	w25, wzr, [x10, #8]
	ldr	w1, [x9, #4]
	stp	x25, xzr, [sp, #16]
	stp	x8, x25, [sp]
Lloh28:
	adrp	x0, l_.str.5@PAGE
Lloh29:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x27]
	ldr	x8, [x8, x26]
	ldr	w1, [x8, #4]
	str	x25, [sp]
Lloh30:
	adrp	x0, l_.str.6@PAGE
Lloh31:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_debug
	mov	w26, #0
	cmp	w25, #1
	csinc	w27, w25, wzr, hi
	lsl	x28, x22, #4
Lloh32:
	adrp	x23, _ceReqClass1@GOTPAGE
Lloh33:
	ldr	x23, [x23, _ceReqClass1@GOTPAGEOFF]
Lloh34:
	adrp	x22, _ceReqLnkRead@GOTPAGE
Lloh35:
	ldr	x22, [x22, _ceReqLnkRead@GOTPAGEOFF]
Lloh36:
	adrp	x21, l_.str.7@PAGE
Lloh37:
	add	x21, x21, l_.str.7@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
Lloh38:
	adrp	x8, _sc_adapter@GOTPAGE
Lloh39:
	ldr	x8, [x8, _sc_adapter@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x8, [x8, x9, lsl #3]
	ldr	x9, [x8, #8]
	ldr	w9, [x9, x28]
	add	w10, w26, w25
	madd	w9, w10, w24, w9
	stp	w9, w24, [sp, #40]
	ldr	w1, [x8, #4]
	add	w26, w26, #1
	stp	x24, x24, [sp, #16]
	stp	x26, x9, [sp]
	mov	x0, x21
	bl	_pr_debug
Lloh41:
	adrp	x8, _CEPID@GOTPAGE
Lloh42:
	ldr	x8, [x8, _CEPID@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
Lloh44:
	adrp	x8, _ceReqTypeLnk@GOTPAGE
Lloh45:
	ldr	x8, [x8, _ceReqTypeLnk@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
	ldr	w3, [x23]
	ldr	w4, [x22]
	add	x7, sp, #40
	mov	x0, x19
	mov	x5, x20
	mov	w6, #8
	bl	_sendmessage
	cmp	w26, w27
	b.ne	LBB0_5
; %bb.6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid param: %d is not a valid card id\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"%s: setting up channel buffer space in shared RAM\n"

	.comm	_sc_adapter,8,3                 ; @sc_adapter
	.comm	_BUFFER_SIZE,4,2                ; @BUFFER_SIZE
	.comm	_BUFFER_BASE,4,2                ; @BUFFER_BASE
	.comm	_BUFFERS_MAX,4,2                ; @BUFFERS_MAX
l_.str.2:                               ; @.str.2
	.asciz	"%s: calculating buffer space: %d buffers, %d big\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: not enough buffer space\n"

l_.str.4:                               ; @.str.4
	.asciz	"%s: channel buffer offset from shared RAM: 0x%x\n"

l_.str.5:                               ; @.str.5
	.asciz	"%s: send buffer setup complete: first=0x%lx n=%d f=%d, nxt=%d\n"

l_.str.6:                               ; @.str.6
	.asciz	"%s: adding %d RecvBuffers:\n"

l_.str.7:                               ; @.str.7
	.asciz	"%s: adding RcvBuffer #%d offset=0x%lx sz=%d bufsz:%d\n"

	.comm	_CEPID,4,2                      ; @CEPID
	.comm	_ceReqTypeLnk,4,2               ; @ceReqTypeLnk
	.comm	_ceReqClass1,4,2                ; @ceReqClass1
	.comm	_ceReqLnkRead,4,2               ; @ceReqLnkRead
.subsections_via_symbols
