	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switchtec_ntb_init_db_msg_irq
_switchtec_ntb_init_db_msg_irq:         ## @switchtec_ntb_init_db_msg_irq
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	movq	8(%rax), %rdi
	callq	_ioread32
                                        ## kill: def $eax killed $eax def $rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %ebx
	leal	1(%rbx), %ecx
	cmpl	%eax, %ebx
	je	LBB0_1
## %bb.2:
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%rax,%r15), %ecx
	leal	(%rbx,%r15), %edx
	decl	%r15d
	cmpl	$1, %edx
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$1, %ecx
	je	LBB0_3
## %bb.5:
	movq	16(%r14), %rdi
	addq	$4, %rdi
	negl	%r15d
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	movl	%ebx, %ecx
	movl	%r15d, %r8d
	callq	_dev_dbg
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	movl	%ebx, %edi
	callq	_iowrite8
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	addq	$4, %rsi
	movl	%ebx, %edi
	callq	_iowrite8
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	addq	$8, %rsi
	movl	%ebx, %edi
	callq	_iowrite8
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	addq	$12, %rsi
	movl	%ebx, %edi
	callq	_iowrite8
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	addq	$16, %rsi
	movl	%r15d, %edi
	callq	_iowrite8
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	addq	$20, %rsi
	movl	%r15d, %edi
	callq	_iowrite8
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	addq	$24, %rsi
	movl	%r15d, %edi
	callq	_iowrite8
	movq	24(%r14), %rax
	movq	(%rax), %rsi
	addq	$28, %rsi
	movl	%r15d, %edi
	callq	_iowrite8
	movq	16(%r14), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_pci_irq_vector
	movq	%rax, (%r14)
	movq	16(%r14), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_pci_irq_vector
	movq	%rax, 8(%r14)
	movq	(%r14), %rdi
	movq	_switchtec_ntb_doorbell_isr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rcx
	xorl	%edx, %edx
	movq	%r14, %r8
	callq	_request_irq
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:
	movq	8(%r14), %rdi
	movq	_switchtec_ntb_message_isr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rcx
	xorl	%edx, %edx
	movq	%r14, %r8
	callq	_request_irq
	movl	%eax, %ebx
	movl	$0, %eax
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.7:
	movq	(%r14), %rdi
	movq	%r14, %rsi
	callq	_free_irq
	movl	%ebx, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"irqs - event: %d, db: %d, msgs: %d\n"

	.comm	_switchtec_ntb_doorbell_isr,4,2 ## @switchtec_ntb_doorbell_isr
L_.str.1:                               ## @.str.1
	.asciz	"switchtec_ntb_doorbell"

	.comm	_switchtec_ntb_message_isr,4,2  ## @switchtec_ntb_message_isr
L_.str.2:                               ## @.str.2
	.asciz	"switchtec_ntb_message"

	.no_dead_strip	_switchtec_ntb_init_db_msg_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switchtec_ntb_init_db_msg_irq
_switchtec_ntb_init_db_msg_irq:         ; @switchtec_ntb_init_db_msg_irq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x0, [x8, #8]
	bl	_ioread32
	mov	x2, x0
	mov	w20, #-1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	w20, w20, #1
	cmp	w2, w20
	b.eq	LBB0_1
; %bb.2:
	mov	w8, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x9, x8
	add	w8, w8, #1
	cmp	w20, w9
	b.eq	LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w2, w9
	b.eq	LBB0_3
; %bb.5:
	ldr	x9, [x19, #16]
	add	x0, x9, #4
	sub	w21, w8, #1
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x20
	mov	x4, x21
	bl	_dev_dbg
	ldr	x8, [x19, #24]
	ldr	x1, [x8]
	mov	x0, x20
	bl	_iowrite8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x8, #4
	mov	x0, x20
	bl	_iowrite8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x8, #8
	mov	x0, x20
	bl	_iowrite8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x8, #12
	mov	x0, x20
	bl	_iowrite8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x8, #16
	mov	x0, x21
	bl	_iowrite8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x8, #20
	mov	x0, x21
	bl	_iowrite8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x8, #24
	mov	x0, x21
	bl	_iowrite8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x8, #28
	mov	x0, x21
	bl	_iowrite8
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_pci_irq_vector
	str	x0, [x19]
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	mov	x1, x21
	bl	_pci_irq_vector
	str	x0, [x19, #8]
	ldr	x0, [x19]
Lloh2:
	adrp	x8, _switchtec_ntb_doorbell_isr@GOTPAGE
Lloh3:
	ldr	x8, [x8, _switchtec_ntb_doorbell_isr@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x3, l_.str.1@PAGE
Lloh6:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w2, #0
	mov	x4, x19
	bl	_request_irq
	mov	x20, x0
	cbnz	w0, LBB0_8
; %bb.6:
	ldr	x0, [x19, #8]
Lloh7:
	adrp	x8, _switchtec_ntb_message_isr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _switchtec_ntb_message_isr@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x3, l_.str.2@PAGE
Lloh11:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	w2, #0
	mov	x4, x19
	bl	_request_irq
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
	ldr	x0, [x19]
	mov	x1, x19
	bl	_free_irq
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"irqs - event: %d, db: %d, msgs: %d\n"

	.comm	_switchtec_ntb_doorbell_isr,4,2 ; @switchtec_ntb_doorbell_isr
l_.str.1:                               ; @.str.1
	.asciz	"switchtec_ntb_doorbell"

	.comm	_switchtec_ntb_message_isr,4,2  ; @switchtec_ntb_message_isr
l_.str.2:                               ; @.str.2
	.asciz	"switchtec_ntb_message"

	.no_dead_strip	_switchtec_ntb_init_db_msg_irq
.subsections_via_symbols
