	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdlc_fill_fifo
_hdlc_fill_fifo:                        ## @hdlc_fill_fifo
	.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	%rdi, %rbx
	movq	32(%rdi), %r14
	movl	(%rdi), %edx
	movl	%edx, %r15d
	notl	%r15d
	andl	$1, %r15d
	movq	(%r14), %rax
	movq	_AVM_FRITZ_PCIV2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	_HDLC_FIFO_SIZE_V2@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_HDLC_FIFO_SIZE_V1@GOTPCREL(%rip), %rax
LBB0_3:
	movq	32(%r14), %rsi
	movl	(%rax), %ecx
	movq	8(%rbx), %rax
	testq	%rax, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.6:
	movl	(%rax), %r9d
	movl	4(%rbx), %r8d
	movl	%r9d, %r13d
	subl	%r8d, %r13d
	jle	LBB0_30
## %bb.7:
	movslq	%r8d, %r12
	shlq	$2, %r12
	addq	8(%rax), %r12
	movq	_HDLC_CMD_XME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 4(%rsi,%r15,8)
	cmpl	%ecx, %r13d
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_8
## %bb.31:
	movl	%ecx, %r13d
	jmp	LBB0_13
LBB0_4:
	movq	_FLG_TX_EMPTY@GOTPCREL(%rip), %rax
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	(%rax), %edi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	leaq	16(%rbx), %rsi
	callq	_test_bit
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	testq	%rax, %rax
	je	LBB0_30
## %bb.5:
	movq	24(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_HDLC_CMD_XME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	%rbx, %rcx
	leaq	(%rdx,%r15,8), %r12
	addq	$4, %r12
	andl	%eax, 4(%rdx,%r15,8)
	jmp	LBB0_9
LBB0_8:
	movq	%rbx, %rcx
	leaq	(%rsi,%r15,8), %r12
	addq	$4, %r12
LBB0_9:
	movq	_FLG_HDLC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rcx, %rbx
	leaq	16(%rcx), %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_HDLC_CMD_XME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
LBB0_11:
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_14
## %bb.12:
	movl	(%rbx), %edx
	movl	4(%rbx), %r8d
	movq	8(%rbx), %rax
	movl	(%rax), %r9d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
LBB0_13:
	movq	8(%r14), %rsi
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_pr_debug
	addl	%r13d, 4(%rbx)
	jmp	LBB0_15
LBB0_14:
	movq	8(%r14), %rsi
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	-72(%rbp), %r12                 ## 8-byte Reload
LBB0_15:
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r15,8), %rsi
	xorl	%eax, %eax
	cmpl	%ecx, %r13d
	cmovnel	%r13d, %eax
	movl	%eax, (%rsi)
	movq	(%r14), %rax
	movl	(%rbx), %edx
	movq	_AVM_FRITZ_PCIV2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_20
## %bb.16:
	movq	%r14, %rdi
	callq	___write_ctrl_pciv2
	cmpl	$2, (%rbx)
	jne	LBB0_17
## %bb.18:
	movq	_AVM_HDLC_FIFO_2@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_20:
	movq	%r14, %rdi
	callq	___write_ctrl_pci
	movq	_CHIP_WINDOW@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	addq	24(%r14), %r15
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_25
LBB0_22:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	jle	LBB0_28
## %bb.23:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_get_unaligned
	movq	%rax, %rdi
	callq	_cpu_to_le32
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_outl
	addq	$8, %r12
	addl	$4, %r14d
	cmpl	%r13d, %r14d
	jl	LBB0_24
	jmp	LBB0_28
LBB0_17:
	movq	_AVM_HDLC_FIFO_1@GOTPCREL(%rip), %rax
LBB0_19:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax), %r15
	addq	24(%r14), %r15
	testq	%rcx, %rcx
	jne	LBB0_22
LBB0_25:
	testl	%r13d, %r13d
	jle	LBB0_30
## %bb.26:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	movq	%r15, %rsi
	callq	_outl
	addl	$4, %ebx
	cmpl	%r13d, %ebx
	jl	LBB0_27
LBB0_28:
	movq	_debug@GOTPCREL(%rip), %rax
	movq	_DEBUG_HW_BFIFO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_30
## %bb.29:
	testq	%rax, %rax
	je	LBB0_30
## %bb.32:
	movl	16(%rbx), %edi
	movq	_LOG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rcx), %ecx
	movq	8(%rbx), %r8
	leaq	L_.str.2(%rip), %rdx
	movl	%r13d, %r9d
	callq	_snprintf
	movl	16(%rbx), %edi
	movq	_DUMP_PREFIX_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %ecx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_print_hex_dump_bytes           ## TAILCALL
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVM_FRITZ_PCIV2,8,3            ## @AVM_FRITZ_PCIV2
	.comm	_HDLC_FIFO_SIZE_V2,4,2          ## @HDLC_FIFO_SIZE_V2
	.comm	_HDLC_FIFO_SIZE_V1,4,2          ## @HDLC_FIFO_SIZE_V1
	.comm	_FLG_TX_EMPTY,4,2               ## @FLG_TX_EMPTY
	.comm	_HDLC_CMD_XME,4,2               ## @HDLC_CMD_XME
	.comm	_FLG_HDLC,4,2                   ## @FLG_HDLC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s.B%d: %d/%d/%d"

L_.str.1:                               ## @.str.1
	.asciz	"%s.B%d: fillempty %d\n"

	.comm	_AVM_HDLC_FIFO_2,8,3            ## @AVM_HDLC_FIFO_2
	.comm	_AVM_HDLC_FIFO_1,8,3            ## @AVM_HDLC_FIFO_1
	.comm	_CHIP_WINDOW,8,3                ## @CHIP_WINDOW
	.comm	_debug,4,2                      ## @debug
	.comm	_DEBUG_HW_BFIFO,4,2             ## @DEBUG_HW_BFIFO
	.comm	_LOG_SIZE,4,2                   ## @LOG_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"B%1d-send %s %d "

	.comm	_DUMP_PREFIX_OFFSET,4,2         ## @DUMP_PREFIX_OFFSET
	.no_dead_strip	_hdlc_fill_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdlc_fill_fifo
_hdlc_fill_fifo:                        ; @hdlc_fill_fifo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x0
	ldr	x19, [x0, #32]
	ldr	w23, [x0]
	ldr	x27, [x19, #32]
	ldr	x8, [x19]
Lloh0:
	adrp	x11, _AVM_FRITZ_PCIV2@GOTPAGE
Lloh1:
	ldr	x11, [x11, _AVM_FRITZ_PCIV2@GOTPAGEOFF]
Lloh2:
	adrp	x9, _HDLC_FIFO_SIZE_V2@GOTPAGE
Lloh3:
	ldr	x9, [x9, _HDLC_FIFO_SIZE_V2@GOTPAGEOFF]
Lloh4:
	adrp	x10, _HDLC_FIFO_SIZE_V1@GOTPAGE
Lloh5:
	ldr	x10, [x10, _HDLC_FIFO_SIZE_V1@GOTPAGEOFF]
Lloh6:
	ldr	x11, [x11]
	cmp	x8, x11
	csel	x8, x9, x10, eq
	ldr	w26, [x8]
	mov	x21, x26
	ldr	x25, [x0, #8]
	cbz	x25, LBB0_3
; %bb.1:
	ldr	w9, [x25]
	ldrsw	x8, [x20, #4]
	sub	w28, w9, w8
	cmp	w28, #1
	b.lt	LBB0_23
; %bb.2:
	ldr	x9, [x25, #8]
	add	x22, x9, x8, lsl #2
	b	LBB0_5
LBB0_3:
Lloh7:
	adrp	x8, _FLG_TX_EMPTY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FLG_TX_EMPTY@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	add	x1, x20, #16
	bl	_test_bit
	cbz	x0, LBB0_23
; %bb.4:
	ldr	x22, [x20, #24]
	mov	x28, x21
LBB0_5:
	mvn	w8, w23
	and	x8, x8, #0x1
	add	x23, x27, x8, lsl #3
Lloh10:
	adrp	x24, _HDLC_CMD_XME@GOTPAGE
Lloh11:
	ldr	x24, [x24, _HDLC_CMD_XME@GOTPAGEOFF]
	ldr	w9, [x24]
	add	x27, x27, x8, lsl #3
	ldr	w8, [x27, #4]!
	bic	w8, w8, w9
	str	w8, [x27]
	cmp	w28, w26
	b.gt	LBB0_9
; %bb.6:
Lloh12:
	adrp	x8, _FLG_HDLC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FLG_HDLC@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	add	x1, x20, #16
	bl	_test_bit
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w8, [x24]
	ldr	w9, [x27]
	orr	w8, w9, w8
	str	w8, [x27]
LBB0_8:
	mov	x21, x28
LBB0_9:
	ldr	x1, [x19, #8]
	ldr	w2, [x20]
	cbz	x25, LBB0_11
; %bb.10:
	ldr	x8, [x20, #8]
	ldr	w9, [x20, #4]
	ldr	w8, [x8]
	stp	x9, x8, [sp]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x21
	bl	_pr_debug
	ldr	w8, [x20, #4]
	add	w8, w8, w21
	str	w8, [x20, #4]
	b	LBB0_12
LBB0_11:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x21
	bl	_pr_debug
LBB0_12:
Lloh19:
	adrp	x9, _AVM_FRITZ_PCIV2@GOTPAGE
Lloh20:
	ldr	x9, [x9, _AVM_FRITZ_PCIV2@GOTPAGEOFF]
	cmp	w21, w26
	csel	w8, wzr, w21, eq
	str	w8, [x23]
	ldr	x8, [x19]
Lloh21:
	ldr	x9, [x9]
	ldr	w2, [x20]
	mov	x0, x19
	mov	x1, x23
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
	bl	___write_ctrl_pciv2
	ldr	x8, [x19, #24]
	ldr	w9, [x20]
Lloh22:
	adrp	x10, _AVM_HDLC_FIFO_2@GOTPAGE
Lloh23:
	ldr	x10, [x10, _AVM_HDLC_FIFO_2@GOTPAGEOFF]
Lloh24:
	adrp	x11, _AVM_HDLC_FIFO_1@GOTPAGE
Lloh25:
	ldr	x11, [x11, _AVM_HDLC_FIFO_1@GOTPAGEOFF]
	cmp	w9, #2
	csel	x9, x10, x11, eq
	b	LBB0_15
LBB0_14:
	bl	___write_ctrl_pci
	ldr	x8, [x19, #24]
Lloh26:
	adrp	x9, _CHIP_WINDOW@GOTPAGE
Lloh27:
	ldr	x9, [x9, _CHIP_WINDOW@GOTPAGEOFF]
LBB0_15:
	ldr	x9, [x9]
	add	x23, x9, x8
	cmp	w21, #1
	cbz	x25, LBB0_19
; %bb.16:
	b.lt	LBB0_22
; %bb.17:
	mov	w26, #0
	mov	x24, x22
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_get_unaligned
	bl	_cpu_to_le32
	mov	x1, x23
	bl	_outl
	add	x24, x24, #8
	add	w26, w26, #4
	cmp	w26, w21
	b.lt	LBB0_18
	b	LBB0_22
LBB0_19:
	b.lt	LBB0_23
; %bb.20:
	mov	w24, #0
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	mov	x1, x23
	bl	_outl
	add	w24, w24, #4
	cmp	w24, w21
	b.lt	LBB0_21
LBB0_22:
Lloh28:
	adrp	x8, _debug@GOTPAGE
Lloh29:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	adrp	x9, _DEBUG_HW_BFIFO@GOTPAGE
Lloh32:
	ldr	x9, [x9, _DEBUG_HW_BFIFO@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	x25, #0, #4, ne
	b.ne	LBB0_24
LBB0_23:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_24:
	ldr	w0, [x19, #16]
Lloh34:
	adrp	x8, _LOG_SIZE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _LOG_SIZE@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	ldr	w3, [x20]
	ldr	x4, [x19, #8]
Lloh37:
	adrp	x2, l_.str.2@PAGE
Lloh38:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x5, x21
	bl	_snprintf
Lloh39:
	adrp	x8, _DUMP_PREFIX_OFFSET@GOTPAGE
Lloh40:
	ldr	x8, [x8, _DUMP_PREFIX_OFFSET@GOTPAGEOFF]
	ldr	w0, [x19, #16]
Lloh41:
	ldr	w1, [x8]
	mov	x2, x22
	mov	x3, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_print_hex_dump_bytes
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_AVM_FRITZ_PCIV2,8,3            ; @AVM_FRITZ_PCIV2
	.comm	_HDLC_FIFO_SIZE_V2,4,2          ; @HDLC_FIFO_SIZE_V2
	.comm	_HDLC_FIFO_SIZE_V1,4,2          ; @HDLC_FIFO_SIZE_V1
	.comm	_FLG_TX_EMPTY,4,2               ; @FLG_TX_EMPTY
	.comm	_HDLC_CMD_XME,4,2               ; @HDLC_CMD_XME
	.comm	_FLG_HDLC,4,2                   ; @FLG_HDLC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s.B%d: %d/%d/%d"

l_.str.1:                               ; @.str.1
	.asciz	"%s.B%d: fillempty %d\n"

	.comm	_AVM_HDLC_FIFO_2,8,3            ; @AVM_HDLC_FIFO_2
	.comm	_AVM_HDLC_FIFO_1,8,3            ; @AVM_HDLC_FIFO_1
	.comm	_CHIP_WINDOW,8,3                ; @CHIP_WINDOW
	.comm	_debug,4,2                      ; @debug
	.comm	_DEBUG_HW_BFIFO,4,2             ; @DEBUG_HW_BFIFO
	.comm	_LOG_SIZE,4,2                   ; @LOG_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"B%1d-send %s %d "

	.comm	_DUMP_PREFIX_OFFSET,4,2         ; @DUMP_PREFIX_OFFSET
	.no_dead_strip	_hdlc_fill_fifo
.subsections_via_symbols
