	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ibmveth_cleanup
_ibmveth_cleanup:                       ## @ibmveth_cleanup
	.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, %r12
	movq	24(%rdi), %r14
	cmpq	$0, 80(%rdi)
	je	LBB0_4
## %bb.1:
	movq	88(%r12), %rsi
	movq	%r14, %rdi
	callq	_dma_mapping_error
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	88(%r12), %rsi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_dma_unmap_single
	movq	_DMA_ERROR_CODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 88(%r12)
LBB0_3:
	movq	80(%r12), %rdi
	callq	_free_page
	movq	$0, 80(%r12)
LBB0_4:
	cmpq	$0, 64(%r12)
	je	LBB0_8
## %bb.5:
	movq	72(%r12), %rsi
	movq	%r14, %rdi
	callq	_dma_mapping_error
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	72(%r12), %rsi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_dma_unmap_single
	movq	_DMA_ERROR_CODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 72(%r12)
LBB0_7:
	movq	64(%r12), %rdi
	callq	_free_page
	movq	$0, 64(%r12)
LBB0_8:
	cmpq	$0, 48(%r12)
	je	LBB0_12
## %bb.9:
	movq	56(%r12), %rsi
	movq	%r14, %rdi
	callq	_dma_mapping_error
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	56(%r12), %rsi
	movl	40(%r12), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_dma_unmap_single
	movq	_DMA_ERROR_CODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 56(%r12)
LBB0_11:
	movq	48(%r12), %rdi
	callq	_kfree
	movq	$0, 48(%r12)
LBB0_12:
	movq	_IBMVETH_NUM_BUFF_POOLS@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_17
## %bb.13:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r13
	movslq	%eax, %rcx
	addq	$8, %rbx
	cmpq	%rcx, %r13
	jge	LBB0_17
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rsi
	cmpq	$0, (%rsi,%rbx)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	addq	%rbx, %rsi
	movq	%r12, %rdi
	callq	_ibmveth_free_buffer_pool
	movl	(%r15), %eax
	jmp	LBB0_16
LBB0_17:
	cmpq	$0, (%r12)
	je	LBB0_21
## %bb.18:
	movq	8(%r12), %rsi
	movq	%r14, %rdi
	callq	_dma_mapping_error
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	movq	24(%r12), %rdi
	movq	8(%r12), %rsi
	movq	16(%r12), %rax
	movq	_IBMVETH_BUFF_OH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	addl	(%rax), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_single
	movq	_DMA_ERROR_CODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r12)
LBB0_20:
	movq	(%r12), %rdi
	callq	_kfree
	movq	$0, (%r12)
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_DMA_ERROR_CODE,8,3             ## @DMA_ERROR_CODE
	.comm	_IBMVETH_NUM_BUFF_POOLS,4,2     ## @IBMVETH_NUM_BUFF_POOLS
	.comm	_IBMVETH_BUFF_OH,4,2            ## @IBMVETH_BUFF_OH
	.no_dead_strip	_ibmveth_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ibmveth_cleanup
_ibmveth_cleanup:                       ; @ibmveth_cleanup
	.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
	ldr	x20, [x0, #24]
	ldr	x8, [x0, #80]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x1, [x19, #88]
	mov	x0, x20
	bl	_dma_mapping_error
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	x1, [x19, #88]
Lloh0:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w2, #4096
	bl	_dma_unmap_single
Lloh3:
	adrp	x8, _DMA_ERROR_CODE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_ERROR_CODE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x19, #88]
LBB0_3:
	ldr	x0, [x19, #80]
	bl	_free_page
	str	xzr, [x19, #80]
LBB0_4:
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	x1, [x19, #72]
	mov	x0, x20
	bl	_dma_mapping_error
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x1, [x19, #72]
Lloh6:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w2, #4096
	bl	_dma_unmap_single
Lloh9:
	adrp	x8, _DMA_ERROR_CODE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_ERROR_CODE@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [x19, #72]
LBB0_7:
	ldr	x0, [x19, #64]
	bl	_free_page
	str	xzr, [x19, #64]
LBB0_8:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_12
; %bb.9:
	ldr	x1, [x19, #56]
	mov	x0, x20
	bl	_dma_mapping_error
	cbnz	w0, LBB0_11
; %bb.10:
	ldr	x1, [x19, #56]
	ldr	w2, [x19, #40]
Lloh12:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_dma_unmap_single
Lloh15:
	adrp	x8, _DMA_ERROR_CODE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMA_ERROR_CODE@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	x8, [x19, #56]
LBB0_11:
	ldr	x0, [x19, #48]
	bl	_kfree
	str	xzr, [x19, #48]
LBB0_12:
Lloh18:
	adrp	x21, _IBMVETH_NUM_BUFF_POOLS@GOTPAGE
Lloh19:
	ldr	x21, [x21, _IBMVETH_NUM_BUFF_POOLS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.13:
	mov	x22, #0
	mov	x23, #0
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x23, x23, #1
	add	x22, x22, #8
	cmp	x23, w8, sxtw
	b.ge	LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #32]
	add	x1, x9, x22
	ldr	x9, [x1]
	cbz	x9, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x19
	bl	_ibmveth_free_buffer_pool
	ldr	w8, [x21]
	b	LBB0_14
LBB0_17:
	ldr	x8, [x19]
	cbz	x8, LBB0_21
; %bb.18:
	ldr	x1, [x19, #8]
	mov	x0, x20
	bl	_dma_mapping_error
	cbnz	w0, LBB0_20
; %bb.19:
	ldp	x8, x0, [x19, #16]
	ldr	x1, [x19, #8]
Lloh20:
	adrp	x9, _IBMVETH_BUFF_OH@GOTPAGE
Lloh21:
	ldr	x9, [x9, _IBMVETH_BUFF_OH@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh22:
	ldr	w9, [x9]
	add	w2, w9, w8
Lloh23:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	bl	_dma_unmap_single
Lloh26:
	adrp	x8, _DMA_ERROR_CODE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DMA_ERROR_CODE@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	str	x8, [x19, #8]
LBB0_20:
	ldr	x0, [x19]
	bl	_kfree
	str	xzr, [x19]
LBB0_21:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_DMA_ERROR_CODE,8,3             ; @DMA_ERROR_CODE
	.comm	_IBMVETH_NUM_BUFF_POOLS,4,2     ; @IBMVETH_NUM_BUFF_POOLS
	.comm	_IBMVETH_BUFF_OH,4,2            ; @IBMVETH_BUFF_OH
	.no_dead_strip	_ibmveth_cleanup
.subsections_via_symbols
