	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_ib_free_demux_ctx
_mlx4_ib_free_demux_ctx:                ## @mlx4_ib_free_demux_ctx
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	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
	movl	20(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r15
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_mlx4_ib_mcg_port_cleanup
	movq	(%r15), %rax
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_16
## %bb.2:
	movq	8(%r14), %rcx
	cmpl	$1, %r8d
	jne	LBB0_4
## %bb.3:
	xorl	%edx, %edx
LBB0_12:
	testb	$1, %r8b
	je	LBB0_16
## %bb.13:
	movq	(%rcx,%rdx,8), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	(%rax), %rcx
	movq	_DEMUX_PV_STATE_DOWN@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jle	LBB0_16
## %bb.15:
	movq	_DEMUX_PV_STATE_DOWNING@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
LBB0_16:
	movl	(%r14), %edi
	callq	_flush_workqueue
	movq	(%r15), %rax
	cmpl	$0, (%rax)
	jle	LBB0_19
## %bb.17:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	16(%r14), %edx
	movq	8(%r14), %rax
	movq	(%rax,%rbx,8), %rcx
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%r8d, %r8d
	callq	_destroy_pv_resources
	movl	16(%r14), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_free_pv_object
	incq	%rbx
	movq	(%r15), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_18
LBB0_19:
	movq	8(%r14), %rdi
	callq	_kfree
	movl	4(%r14), %edi
	callq	_destroy_workqueue
	movl	(%r14), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_destroy_workqueue              ## TAILCALL
LBB0_20:
	retq
LBB0_4:
	movl	%r8d, %esi
	andl	$-2, %esi
	xorl	%edx, %edx
	movq	_DEMUX_PV_STATE_DOWN@GOTPCREL(%rip), %rdi
	movq	_DEMUX_PV_STATE_DOWNING@GOTPCREL(%rip), %r9
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rax), %rbx
	cmpq	(%rdi), %rbx
	jle	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r9), %rbx
	movq	%rbx, (%rax)
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rcx,%rdx,8), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rax), %rbx
	cmpq	(%rdi), %rbx
	jle	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r9), %rbx
	movq	%rbx, (%rax)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_DEMUX_PV_STATE_DOWN,8,3        ## @DEMUX_PV_STATE_DOWN
	.comm	_DEMUX_PV_STATE_DOWNING,8,3     ## @DEMUX_PV_STATE_DOWNING
	.no_dead_strip	_mlx4_ib_free_demux_ctx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_ib_free_demux_ctx
_mlx4_ib_free_demux_ctx:                ; @mlx4_ib_free_demux_ctx
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_11
; %bb.1:
	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	w0, [x0, #20]
	bl	_to_mdev
	mov	x20, x0
	mov	x0, x19
	mov	w1, #1
	bl	_mlx4_ib_mcg_port_cleanup
	ldr	x8, [x20]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.2:
	ldr	x9, [x19, #8]
Lloh0:
	adrp	x10, _DEMUX_PV_STATE_DOWN@GOTPAGE
Lloh1:
	ldr	x10, [x10, _DEMUX_PV_STATE_DOWN@GOTPAGEOFF]
Lloh2:
	adrp	x11, _DEMUX_PV_STATE_DOWNING@GOTPAGE
Lloh3:
	ldr	x11, [x11, _DEMUX_PV_STATE_DOWNING@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x9]
	cbz	x12, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x13, [x12]
	ldr	x14, [x10]
	cmp	x13, x14
	b.le	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x13, [x11]
	str	x13, [x12]
	b	LBB0_3
LBB0_7:
	ldr	w0, [x19]
	bl	_flush_workqueue
	ldr	x8, [x20]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x21, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x19, #16]
	ldr	x8, [x19, #8]
	ldr	x3, [x8, x21, lsl #3]
	mov	x0, x20
	mov	x1, x21
	mov	w4, #0
	bl	_destroy_pv_resources
	ldr	w2, [x19, #16]
	mov	x0, x20
	mov	x1, x21
	bl	_free_pv_object
	add	x21, x21, #1
	ldr	x8, [x20]
	ldrsw	x8, [x8]
	cmp	x21, x8
	b.lt	LBB0_9
LBB0_10:
	ldr	x0, [x19, #8]
	bl	_kfree
	ldr	w0, [x19, #4]
	bl	_destroy_workqueue
	ldr	w0, [x19]
	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	_destroy_workqueue
LBB0_11:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DEMUX_PV_STATE_DOWN,8,3        ; @DEMUX_PV_STATE_DOWN
	.comm	_DEMUX_PV_STATE_DOWNING,8,3     ; @DEMUX_PV_STATE_DOWNING
	.no_dead_strip	_mlx4_ib_free_demux_ctx
.subsections_via_symbols
