	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_instance
_setup_instance:                        ## @setup_instance
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	68(%rdi), %edi
	movq	_MISDN_MAX_IDLEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	decq	%rsi
	movq	_AVM_cnt@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	incl	%ecx
	leaq	L_.str(%rip), %rdx
	callq	_snprintf
	movq	_card_lock@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_write_lock_irqsave
	leaq	8(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_Cards@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	movq	%r15, %rdi
	callq	_write_unlock_irqrestore
	movq	%rbx, %rdi
	callq	__set_debug
	movl	68(%rbx), %eax
	leaq	24(%rbx), %r15
	movl	%eax, 56(%rbx)
	leaq	80(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock_init
	movq	%r12, 48(%rbx)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mISDNisac_init
	movq	_ISDN_P_B_RAW@GOTPCREL(%rip), %rax
	movq	_ISDN_P_B_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%rax), %eax
	andl	%ecx, %eax
	movq	_ISDN_P_B_HDLC@GOTPCREL(%rip), %rdx
	andl	(%rdx), %ecx
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	btsl	%eax, %edx
	movl	%edx, 32(%rbx)
	movq	_avm_dctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	leaq	36(%rbx), %r12
	movq	16(%rbx), %rax
	movl	$1, (%rax)
	movl	40(%rbx), %esi
	movl	$1, %edi
	callq	_set_channelmap
	movq	_AVM_FRITZ_PCIV2@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%rbx), %rax
	movq	_HDLC_FIFO_SIZE_V1@GOTPCREL(%rip), %r14
	movq	16(%rbx), %rdi
	movq	_MAX_DATA_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rax
	cmoveq	_HDLC_FIFO_SIZE_V2@GOTPCREL(%rip), %rax
	movzwl	(%rax), %edx
	callq	_mISDN_initbchannel
	movq	16(%rbx), %rdi
	movq	%rbx, 24(%rdi)
	movq	_avm_l2l1B@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rdi)
	movq	_avm_bctrl@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, 12(%rdi)
	movl	$1, 4(%rdi)
	addq	$8, %rdi
	movq	%r12, %rsi
	callq	_list_add
	movq	16(%rbx), %rax
	movl	$2, 32(%rax)
	movl	40(%rbx), %esi
	movl	$2, %edi
	callq	_set_channelmap
	movq	_AVM_FRITZ_PCIV2@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%rbx), %rdi
	addq	$32, %rdi
	cmpq	(%rbx), %rax
	movq	_MAX_DATA_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmoveq	_HDLC_FIFO_SIZE_V2@GOTPCREL(%rip), %r14
	movzwl	(%r14), %edx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	callq	_mISDN_initbchannel
	movq	16(%rbx), %rdi
	movq	%rbx, 56(%rdi)
	movq	_avm_l2l1B@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rdi)
	movl	(%r13), %eax
	movl	%eax, 44(%rdi)
	movl	$2, 36(%rdi)
	addq	$40, %rdi
	movq	%r12, %rsi
	callq	_list_add
	movq	%rbx, %rdi
	callq	_setup_fritz
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	leaq	32(%rbx), %r13
	movq	72(%rbx), %rsi
	movl	68(%rbx), %edx
	movq	%r13, %rdi
	callq	_mISDN_register_device
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movq	%rbx, %rdi
	callq	_init_card
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_mISDN_unregister_device
LBB0_5:
	movl	64(%rbx), %edi
	movl	$32, %esi
	callq	_release_region
LBB0_6:
	movq	%r15, %rdi
	callq	*24(%rbx)
	movq	16(%rbx), %rdi
	addq	$32, %rdi
	callq	_mISDN_freebchannel
	movq	16(%rbx), %rdi
	callq	_mISDN_freebchannel
	movq	_card_lock@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_write_lock_irqsave
	movq	%r14, %rdi
	callq	_list_del
	movq	%r15, %rdi
	callq	_write_unlock_irqrestore
	movq	%rbx, %rdi
	callq	_kfree
LBB0_7:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_AVM_cnt@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	incl	%esi
	movl	%esi, (%r15)
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_notice
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_MISDN_MAX_IDLEN,8,3            ## @MISDN_MAX_IDLEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AVM.%d"

	.comm	_AVM_cnt,4,2                    ## @AVM_cnt
	.comm	_card_lock,4,2                  ## @card_lock
	.comm	_Cards,4,2                      ## @Cards
	.comm	_ISDN_P_B_RAW,4,2               ## @ISDN_P_B_RAW
	.comm	_ISDN_P_B_MASK,4,2              ## @ISDN_P_B_MASK
	.comm	_ISDN_P_B_HDLC,4,2              ## @ISDN_P_B_HDLC
	.comm	_avm_dctrl,4,2                  ## @avm_dctrl
	.comm	_AVM_FRITZ_PCIV2,8,3            ## @AVM_FRITZ_PCIV2
	.comm	_HDLC_FIFO_SIZE_V2,2,1          ## @HDLC_FIFO_SIZE_V2
	.comm	_HDLC_FIFO_SIZE_V1,2,1          ## @HDLC_FIFO_SIZE_V1
	.comm	_MAX_DATA_MEM,4,2               ## @MAX_DATA_MEM
	.comm	_avm_l2l1B,4,2                  ## @avm_l2l1B
	.comm	_avm_bctrl,4,2                  ## @avm_bctrl
L_.str.1:                               ## @.str.1
	.asciz	"AVM %d cards installed DEBUG\n"

	.no_dead_strip	_setup_instance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_instance
_setup_instance:                        ; @setup_instance
	.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	x19, x0
	ldr	w0, [x0, #68]
Lloh0:
	adrp	x8, _MISDN_MAX_IDLEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MISDN_MAX_IDLEN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sub	x1, x8, #1
Lloh3:
	adrp	x8, _AVM_cnt@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVM_cnt@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w3, w8, #1
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	bl	_snprintf
Lloh8:
	adrp	x21, _card_lock@GOTPAGE
Lloh9:
	ldr	x21, [x21, _card_lock@GOTPAGEOFF]
	mov	x0, x21
	bl	_write_lock_irqsave
	add	x0, x19, #8
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
Lloh10:
	adrp	x1, _Cards@GOTPAGE
Lloh11:
	ldr	x1, [x1, _Cards@GOTPAGEOFF]
	bl	_list_add_tail
	mov	x0, x21
	bl	_write_unlock_irqrestore
	mov	x0, x19
	bl	__set_debug
	ldr	w8, [x19, #68]
	add	x27, x19, #24
	str	w8, [x19, #56]
	add	x22, x19, #80
	mov	x0, x22
	bl	_spin_lock_init
	str	x22, [x19, #48]
	mov	x0, x27
	mov	x1, x19
	bl	_mISDNisac_init
Lloh12:
	adrp	x8, _ISDN_P_B_RAW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ISDN_P_B_RAW@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _ISDN_P_B_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ISDN_P_B_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w8, w9, w8
	mov	w25, #1
	lsl	w8, w25, w8
Lloh18:
	adrp	x10, _ISDN_P_B_HDLC@GOTPAGE
Lloh19:
	ldr	x10, [x10, _ISDN_P_B_HDLC@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	and	w9, w10, w9
	lsl	w9, w25, w9
	orr	w8, w9, w8
	mov	x22, x19
	str	w8, [x22, #32]!
Lloh21:
	adrp	x8, _avm_dctrl@GOTPAGE
Lloh22:
	ldr	x8, [x8, _avm_dctrl@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x19, #44]
	add	x23, x19, #36
	ldr	x8, [x19, #16]
	str	w25, [x8]
	ldr	w1, [x19, #40]
	mov	w0, #1
	bl	_set_channelmap
Lloh24:
	adrp	x26, _AVM_FRITZ_PCIV2@GOTPAGE
Lloh25:
	ldr	x26, [x26, _AVM_FRITZ_PCIV2@GOTPAGEOFF]
	ldr	x8, [x26]
	ldr	x9, [x19]
Lloh26:
	adrp	x10, _HDLC_FIFO_SIZE_V2@GOTPAGE
Lloh27:
	ldr	x10, [x10, _HDLC_FIFO_SIZE_V2@GOTPAGEOFF]
Lloh28:
	adrp	x28, _HDLC_FIFO_SIZE_V1@GOTPAGE
Lloh29:
	ldr	x28, [x28, _HDLC_FIFO_SIZE_V1@GOTPAGEOFF]
	ldr	x0, [x19, #16]
Lloh30:
	adrp	x24, _MAX_DATA_MEM@GOTPAGE
Lloh31:
	ldr	x24, [x24, _MAX_DATA_MEM@GOTPAGEOFF]
	ldr	w1, [x24]
	cmp	x8, x9
	csel	x8, x10, x28, eq
	ldrh	w2, [x8]
	bl	_mISDN_initbchannel
	ldr	x8, [x19, #16]
	str	x19, [x8, #24]
Lloh32:
	adrp	x20, _avm_l2l1B@GOTPAGE
Lloh33:
	ldr	x20, [x20, _avm_l2l1B@GOTPAGEOFF]
Lloh34:
	adrp	x21, _avm_bctrl@GOTPAGE
Lloh35:
	ldr	x21, [x21, _avm_bctrl@GOTPAGEOFF]
	ldr	w9, [x20]
	ldr	w10, [x21]
	stp	w10, w9, [x8, #12]
	str	w25, [x8, #4]
	add	x0, x8, #8
	mov	x1, x23
	bl	_list_add
	ldr	x8, [x19, #16]
	mov	w25, #2
	str	w25, [x8, #32]
	ldr	w1, [x19, #40]
	mov	w0, #2
	bl	_set_channelmap
	ldr	x8, [x26]
	ldr	x9, [x19]
	ldr	x10, [x19, #16]
	add	x0, x10, #32
	ldr	w1, [x24]
	cmp	x8, x9
Lloh36:
	adrp	x8, _HDLC_FIFO_SIZE_V2@GOTPAGE
Lloh37:
	ldr	x8, [x8, _HDLC_FIFO_SIZE_V2@GOTPAGEOFF]
	csel	x8, x8, x28, eq
	ldrh	w2, [x8]
	bl	_mISDN_initbchannel
	ldr	x8, [x19, #16]
	str	x19, [x8, #56]
	ldr	w9, [x20]
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
	ldr	w10, [x21]
	stp	w10, w9, [x8, #44]
	str	w25, [x8, #36]
	add	x0, x8, #40
	mov	x1, x23
	bl	_list_add
	mov	x0, x19
	bl	_setup_fritz
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.1:
Lloh38:
	adrp	x21, _AVM_cnt@GOTPAGE
Lloh39:
	ldr	x21, [x21, _AVM_cnt@GOTPAGEOFF]
	ldr	x1, [x19, #72]
	ldr	w2, [x19, #68]
	mov	x0, x22
	bl	_mISDN_register_device
	mov	x23, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_init_card
	mov	x23, x0
	cbz	w0, LBB0_7
; %bb.3:
	mov	x0, x22
	bl	_mISDN_unregister_device
LBB0_4:
	ldr	w0, [x19, #64]
	mov	w1, #32
	bl	_release_region
LBB0_5:
	ldr	x8, [x19, #24]
	mov	x0, x27
	blr	x8
	ldr	x8, [x19, #16]
	add	x0, x8, #32
	bl	_mISDN_freebchannel
	ldr	x0, [x19, #16]
	bl	_mISDN_freebchannel
Lloh40:
	adrp	x21, _card_lock@GOTPAGE
Lloh41:
	ldr	x21, [x21, _card_lock@GOTPAGEOFF]
	mov	x0, x21
	bl	_write_lock_irqsave
	mov	x0, x20
	bl	_list_del
	mov	x0, x21
	bl	_write_unlock_irqrestore
	mov	x0, x19
	bl	_kfree
LBB0_6:
	mov	x0, x23
	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_7:
	ldr	w8, [x21]
	add	w1, w8, #1
	str	w1, [x21]
Lloh42:
	adrp	x0, l_.str.1@PAGE
Lloh43:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_notice
	b	LBB0_6
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_MISDN_MAX_IDLEN,8,3            ; @MISDN_MAX_IDLEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AVM.%d"

	.comm	_AVM_cnt,4,2                    ; @AVM_cnt
	.comm	_card_lock,4,2                  ; @card_lock
	.comm	_Cards,4,2                      ; @Cards
	.comm	_ISDN_P_B_RAW,4,2               ; @ISDN_P_B_RAW
	.comm	_ISDN_P_B_MASK,4,2              ; @ISDN_P_B_MASK
	.comm	_ISDN_P_B_HDLC,4,2              ; @ISDN_P_B_HDLC
	.comm	_avm_dctrl,4,2                  ; @avm_dctrl
	.comm	_AVM_FRITZ_PCIV2,8,3            ; @AVM_FRITZ_PCIV2
	.comm	_HDLC_FIFO_SIZE_V2,2,1          ; @HDLC_FIFO_SIZE_V2
	.comm	_HDLC_FIFO_SIZE_V1,2,1          ; @HDLC_FIFO_SIZE_V1
	.comm	_MAX_DATA_MEM,4,2               ; @MAX_DATA_MEM
	.comm	_avm_l2l1B,4,2                  ; @avm_l2l1B
	.comm	_avm_bctrl,4,2                  ; @avm_bctrl
l_.str.1:                               ; @.str.1
	.asciz	"AVM %d cards installed DEBUG\n"

	.no_dead_strip	_setup_instance
.subsections_via_symbols
