	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_disarm_piobufs_ifneeded    ## -- Begin function qib_disarm_piobufs_ifneeded
	.p2align	4, 0x90
_qib_disarm_piobufs_ifneeded:           ## @qib_disarm_piobufs_ifneeded
	.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, %r15
	movq	24(%rdi), %r14
	movl	4(%rdi), %eax
	addl	(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	16(%rdi), %rsi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	__QIB_EVENT_DISARM_BUFS_BIT@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_clear_bit
	cmpl	$2, 8(%r15)
	jb	LBB0_4
## %bb.2:
	movl	$1, %ebx
	movl	$4, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movq	16(%r15), %rsi
	addq	%r12, %rsi
	callq	_clear_bit
	incq	%rbx
	movl	8(%r15), %eax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jb	LBB0_3
LBB0_4:
	movq	%r14, %rdi
	callq	_spin_lock_irq
	movl	(%r15), %ebx
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jb	LBB0_5
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	cmpl	%ebx, -44(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%r14), %esi
	movl	%ebx, %edi
	callq	___test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r14), %r13
	movl	12(%r15), %r12d
	movl	%ebx, %edi
	callq	_QIB_SENDCTRL_DISARM_BUF
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	*%r13
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	__QIB_EVENT_DISARM_BUFS_BIT,4,2 ## @_QIB_EVENT_DISARM_BUFS_BIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_disarm_piobufs_ifneeded    ; -- Begin function qib_disarm_piobufs_ifneeded
	.p2align	2
_qib_disarm_piobufs_ifneeded:           ; @qib_disarm_piobufs_ifneeded
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldp	w8, w9, [x0]
	add	w23, w9, w8
	ldp	x1, x20, [x0, #16]
	cbz	x1, LBB0_4
; %bb.1:
Lloh0:
	adrp	x21, __QIB_EVENT_DISARM_BUFS_BIT@GOTPAGE
Lloh1:
	ldr	x21, [x21, __QIB_EVENT_DISARM_BUFS_BIT@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_clear_bit
	ldr	w8, [x19, #8]
	cmp	w8, #2
	b.lo	LBB0_4
; %bb.2:
	mov	w22, #1
	mov	w24, #4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	ldr	x8, [x19, #16]
	add	x1, x8, x24
	bl	_clear_bit
	add	x22, x22, #1
	ldr	w8, [x19, #8]
	add	x24, x24, #4
	cmp	x22, x8
	b.lo	LBB0_3
LBB0_4:
	mov	x0, x20
	bl	_spin_lock_irq
	ldr	w21, [x19]
	cmp	w21, w23
	b.lo	LBB0_7
LBB0_5:
	mov	x0, x20
	bl	_spin_unlock_irq
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w21, w21, #1
	cmp	w23, w21
	b.eq	LBB0_5
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20, #16]
	mov	x0, x21
	bl	___test_and_clear_bit
	cbz	x0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x24, [x20, #8]
	ldr	w22, [x19, #12]
	mov	x0, x21
	bl	_QIB_SENDCTRL_DISARM_BUF
	mov	x1, x0
	mov	x0, x22
	blr	x24
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	__QIB_EVENT_DISARM_BUFS_BIT,4,2 ; @_QIB_EVENT_DISARM_BUFS_BIT
.subsections_via_symbols
