	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __bba_link_tx
___bba_link_tx:                         ## @__bba_link_tx
	.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	$248, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_EXI_DEVICE_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_EXI_Lock
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	(%rbx), %rax
	movq	_BBA_TX_MAX_PACKET_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_UIP_LOG
	movl	(%r14), %edi
	callq	_EXI_Unlock
	movq	_UIP_ERR_PKTSIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_1:
	movq	_UIP_ERR_IF@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_4:
	xorl	%eax, %eax
	callq	___linkstate
	testl	%eax, %eax
	je	LBB0_14
## %bb.5:
	movq	_BBA_NCRA@GOTPCREL(%rip), %r15
	movq	_BBA_NCRA_ST0@GOTPCREL(%rip), %r13
	movq	_BBA_NCRA_ST1@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_bba_in8
	movl	(%r12), %ecx
	orl	(%r13), %ecx
	testl	%eax, %ecx
	jne	LBB0_6
## %bb.7:
	movq	(%rbx), %r14
	movq	_BBA_TXFIFOCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_bba_out12
	xorl	%eax, %eax
	callq	_bba_select
	movq	_BBA_WRTXFIFOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_bba_outsregister
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rdi
	callq	_bba_outsdata
	movq	24(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_8
## %bb.9:
	movq	_BBA_MINPKTSIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	subq	%r14, %rsi
	jle	LBB0_11
## %bb.10:
	leaq	-288(%rbp), %rdi
	callq	_bba_outsdata
LBB0_11:
	xorl	%eax, %eax
	callq	_bba_deselect
	movl	(%r15), %ebx
	movl	%ebx, %edi
	callq	_bba_in8
	movl	(%r13), %esi
	notl	%esi
	andl	%eax, %esi
	orl	(%r12), %esi
	movl	%ebx, %edi
	callq	_bba_out8
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_EXI_Unlock
	movq	_UIP_ERR_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_14:
	movl	(%r14), %edi
	callq	_EXI_Unlock
	movq	_UIP_ERR_ABRT@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_15
## %bb.13:
	addq	$248, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EXI_CHANNEL_0,4,2              ## @EXI_CHANNEL_0
	.comm	_EXI_DEVICE_2,4,2               ## @EXI_DEVICE_2
	.comm	_UIP_ERR_IF,4,2                 ## @UIP_ERR_IF
	.comm	_BBA_TX_MAX_PACKET_SIZE,8,3     ## @BBA_TX_MAX_PACKET_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"__bba_link_tx: packet dropped due to big buffer.\n"

	.comm	_UIP_ERR_PKTSIZE,4,2            ## @UIP_ERR_PKTSIZE
	.comm	_UIP_ERR_ABRT,4,2               ## @UIP_ERR_ABRT
	.comm	_BBA_NCRA,4,2                   ## @BBA_NCRA
	.comm	_BBA_NCRA_ST0,4,2               ## @BBA_NCRA_ST0
	.comm	_BBA_NCRA_ST1,4,2               ## @BBA_NCRA_ST1
	.comm	_BBA_TXFIFOCNT,4,2              ## @BBA_TXFIFOCNT
	.comm	_BBA_WRTXFIFOD,4,2              ## @BBA_WRTXFIFOD
	.comm	_BBA_MINPKTSIZE,8,3             ## @BBA_MINPKTSIZE
	.comm	_UIP_ERR_OK,4,2                 ## @UIP_ERR_OK
	.no_dead_strip	___bba_link_tx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __bba_link_tx
___bba_link_tx:                         ; @__bba_link_tx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #336
	.cfi_def_cfa_offset 336
	stp	x28, x27, [sp, #256]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #272]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #288]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #304]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #320]            ; 16-byte Folded Spill
	add	x29, sp, #320
	.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 w27, -72
	.cfi_offset w28, -80
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x21, _EXI_CHANNEL_0@GOTPAGE
Lloh4:
	ldr	x21, [x21, _EXI_CHANNEL_0@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh5:
	adrp	x8, _EXI_DEVICE_2@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EXI_DEVICE_2@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_EXI_Lock
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _BBA_TX_MAX_PACKET_SIZE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BBA_TX_MAX_PACKET_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_4
; %bb.2:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_UIP_LOG
	ldr	w0, [x21]
	bl	_EXI_Unlock
Lloh13:
	adrp	x8, _UIP_ERR_PKTSIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _UIP_ERR_PKTSIZE@GOTPAGEOFF]
	b	LBB0_13
LBB0_3:
Lloh15:
	adrp	x8, _UIP_ERR_IF@GOTPAGE
Lloh16:
	ldr	x8, [x8, _UIP_ERR_IF@GOTPAGEOFF]
	b	LBB0_13
LBB0_4:
	bl	___linkstate
	cbz	w0, LBB0_12
; %bb.5:
Lloh17:
	adrp	x24, _BBA_NCRA@GOTPAGE
Lloh18:
	ldr	x24, [x24, _BBA_NCRA@GOTPAGEOFF]
Lloh19:
	adrp	x23, _BBA_NCRA_ST0@GOTPAGE
Lloh20:
	ldr	x23, [x23, _BBA_NCRA_ST0@GOTPAGEOFF]
Lloh21:
	adrp	x22, _BBA_NCRA_ST1@GOTPAGE
Lloh22:
	ldr	x22, [x22, _BBA_NCRA_ST1@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	bl	_bba_in8
	ldr	w8, [x23]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w0
	b.ne	LBB0_6
; %bb.7:
	ldr	x20, [x19]
Lloh23:
	adrp	x8, _BBA_TXFIFOCNT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BBA_TXFIFOCNT@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_bba_out12
	bl	_bba_select
Lloh26:
	adrp	x8, _BBA_WRTXFIFOD@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BBA_WRTXFIFOD@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_bba_outsregister
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x1, x0, [x19, #8]
	bl	_bba_outsdata
	ldr	x19, [x19, #24]
	cbnz	x19, LBB0_8
; %bb.9:
Lloh29:
	adrp	x8, _BBA_MINPKTSIZE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _BBA_MINPKTSIZE@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	subs	x1, x8, x20
	b.le	LBB0_11
; %bb.10:
	add	x0, sp, #8
	bl	_bba_outsdata
LBB0_11:
	bl	_bba_deselect
	ldr	w19, [x24]
	mov	x0, x19
	bl	_bba_in8
	ldr	w8, [x23]
	bic	w8, w0, w8
	ldr	w9, [x22]
	orr	w1, w8, w9
	mov	x0, x19
	bl	_bba_out8
	ldr	w0, [x21]
	bl	_EXI_Unlock
Lloh32:
	adrp	x8, _UIP_ERR_OK@GOTPAGE
Lloh33:
	ldr	x8, [x8, _UIP_ERR_OK@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
	ldr	w0, [x21]
	bl	_EXI_Unlock
Lloh34:
	adrp	x8, _UIP_ERR_ABRT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _UIP_ERR_ABRT@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	ldur	x8, [x29, #-72]
Lloh36:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh37:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #320]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #304]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #288]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #272]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #256]            ; 16-byte Folded Reload
	add	sp, sp, #336
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_EXI_CHANNEL_0,4,2              ; @EXI_CHANNEL_0
	.comm	_EXI_DEVICE_2,4,2               ; @EXI_DEVICE_2
	.comm	_UIP_ERR_IF,4,2                 ; @UIP_ERR_IF
	.comm	_BBA_TX_MAX_PACKET_SIZE,8,3     ; @BBA_TX_MAX_PACKET_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"__bba_link_tx: packet dropped due to big buffer.\n"

	.comm	_UIP_ERR_PKTSIZE,4,2            ; @UIP_ERR_PKTSIZE
	.comm	_UIP_ERR_ABRT,4,2               ; @UIP_ERR_ABRT
	.comm	_BBA_NCRA,4,2                   ; @BBA_NCRA
	.comm	_BBA_NCRA_ST0,4,2               ; @BBA_NCRA_ST0
	.comm	_BBA_NCRA_ST1,4,2               ; @BBA_NCRA_ST1
	.comm	_BBA_TXFIFOCNT,4,2              ; @BBA_TXFIFOCNT
	.comm	_BBA_WRTXFIFOD,4,2              ; @BBA_WRTXFIFOD
	.comm	_BBA_MINPKTSIZE,8,3             ; @BBA_MINPKTSIZE
	.comm	_UIP_ERR_OK,4,2                 ; @UIP_ERR_OK
	.no_dead_strip	___bba_link_tx
.subsections_via_symbols
