	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_restart_sdma             ## -- Begin function ipath_restart_sdma
	.p2align	4, 0x90
_ipath_restart_sdma:                    ## @ipath_restart_sdma
	.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	_IPATH_HAS_SEND_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	leaq	32(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_IPATH_SDMA_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	28(%rbx), %r15
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_IPATH_SDMA_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_5
LBB0_3:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ipath_dbg                      ## TAILCALL
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_IPATH_SDMA_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	___clear_bit
	movq	_IPATH_SDMA_DISARMED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	___clear_bit
	movq	_IPATH_SDMA_ABORTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	___clear_bit
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_INFINIPATH_S_SDMAENABLE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	notl	%edx
	andl	24(%rbx), %edx
	movl	%edx, 24(%rbx)
	movq	16(%rbx), %rax
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_ipath_write_kreg
	movq	16(%rbx), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ipath_read_kreg64
	movl	24(%rbx), %edx
	orl	(%r15), %edx
	movl	%edx, 24(%rbx)
	movq	16(%rbx), %rax
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_ipath_write_kreg
	movq	16(%rbx), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ipath_read_kreg64
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	4(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ipath_ib_piobufavail           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IPATH_HAS_SEND_DMA,4,2         ## @IPATH_HAS_SEND_DMA
	.comm	_IPATH_SDMA_RUNNING,4,2         ## @IPATH_SDMA_RUNNING
	.comm	_IPATH_SDMA_SHUTDOWN,4,2        ## @IPATH_SDMA_SHUTDOWN
	.comm	_IPATH_SDMA_DISABLED,4,2        ## @IPATH_SDMA_DISABLED
	.comm	_IPATH_SDMA_DISARMED,4,2        ## @IPATH_SDMA_DISARMED
	.comm	_IPATH_SDMA_ABORTING,4,2        ## @IPATH_SDMA_ABORTING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid attempt to restart SDMA, status 0x%08lx\n"

	.comm	_INFINIPATH_S_SDMAENABLE,4,2    ## @INFINIPATH_S_SDMAENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_restart_sdma             ; -- Begin function ipath_restart_sdma
	.p2align	2
_ipath_restart_sdma:                    ; @ipath_restart_sdma
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _IPATH_HAS_SEND_DMA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IPATH_HAS_SEND_DMA@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	mov	x19, x0
	add	x20, x0, #32
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh3:
	adrp	x8, _IPATH_SDMA_RUNNING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IPATH_SDMA_RUNNING@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x21, x19, #28
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _IPATH_SDMA_SHUTDOWN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IPATH_SDMA_SHUTDOWN@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_5
LBB0_3:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w1, [x21]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_ipath_dbg
LBB0_4:
	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
LBB0_5:
Lloh11:
	adrp	x8, _IPATH_SDMA_DISABLED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IPATH_SDMA_DISABLED@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x21
	bl	___clear_bit
Lloh14:
	adrp	x8, _IPATH_SDMA_DISARMED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _IPATH_SDMA_DISARMED@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	mov	x1, x21
	bl	___clear_bit
Lloh17:
	adrp	x8, _IPATH_SDMA_ABORTING@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IPATH_SDMA_ABORTING@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	x1, x21
	bl	___clear_bit
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	add	x20, x19, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh20:
	adrp	x21, _INFINIPATH_S_SDMAENABLE@GOTPAGE
Lloh21:
	ldr	x21, [x21, _INFINIPATH_S_SDMAENABLE@GOTPAGEOFF]
	ldr	w8, [x21]
	ldr	w9, [x19, #24]
	bic	w2, w9, w8
	str	w2, [x19, #24]
	ldr	x8, [x19, #16]
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_ipath_write_kreg
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ipath_read_kreg64
	ldr	w8, [x21]
	ldr	w9, [x19, #24]
	orr	w2, w9, w8
	str	w2, [x19, #24]
	ldr	x8, [x19, #16]
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_ipath_write_kreg
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ipath_read_kreg64
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19, #4]
	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
	b	_ipath_ib_piobufavail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_IPATH_HAS_SEND_DMA,4,2         ; @IPATH_HAS_SEND_DMA
	.comm	_IPATH_SDMA_RUNNING,4,2         ; @IPATH_SDMA_RUNNING
	.comm	_IPATH_SDMA_SHUTDOWN,4,2        ; @IPATH_SDMA_SHUTDOWN
	.comm	_IPATH_SDMA_DISABLED,4,2        ; @IPATH_SDMA_DISABLED
	.comm	_IPATH_SDMA_DISARMED,4,2        ; @IPATH_SDMA_DISARMED
	.comm	_IPATH_SDMA_ABORTING,4,2        ; @IPATH_SDMA_ABORTING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid attempt to restart SDMA, status 0x%08lx\n"

	.comm	_INFINIPATH_S_SDMAENABLE,4,2    ; @INFINIPATH_S_SDMAENABLE
.subsections_via_symbols
