	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_mhop_alloc_eq
_hns_roce_mhop_alloc_eq:                ## @hns_roce_mhop_alloc_eq
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	4(%rdi), %ecx
	addl	%edx, %ecx
	movl	$1, %r15d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r15d
	movq	%rsi, %r13
	movq	16(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	addl	8(%rdi), %edx
	movl	$1, %ebx
	movl	%edx, -80(%rbp)                 ## 4-byte Spill
	movl	%edx, %ecx
	shll	%cl, %ebx
	movl	(%rdi), %r12d
	movl	4(%rsi), %edi
	imull	(%rsi), %edi
	callq	_PAGE_ALIGN
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %r14d
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rcx
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %eax
	movl	%r12d, %ebx
	cltd
	idivl	(%rcx)
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_DIV_ROUND_UP
	movq	_HNS_ROCE_HOP_NUM_0@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	jne	LBB0_5
## %bb.1:
	movl	(%r13), %ecx
	movl	4(%r13), %esi
	movl	%r15d, %eax
	cltd
	idivl	%esi
	cmpl	%eax, %ecx
	jle	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ecx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_71
LBB0_5:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	%r14d, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_70
## %bb.6:
	movl	(%r12), %edx
	movl	%r14d, -72(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	movq	%r13, %r14
	je	LBB0_69
## %bb.7:
	cmpl	$2, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	jne	LBB0_10
## %bb.8:
	movl	(%r13), %edx
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_68
## %bb.9:
	movl	(%r13), %edx
	movl	%r12d, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 40(%r14)
	testq	%rax, %rax
	je	LBB0_67
LBB0_10:
	movl	%ebx, -76(%rbp)                 ## 4-byte Spill
	leaq	48(%r14), %r12
	movl	(%r13), %ecx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	%r12, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 56(%r14)
	testq	%rax, %rax
	je	LBB0_66
## %bb.11:
	movq	%rbx, %rdi
	movl	-76(%rbp), %eax                 ## 4-byte Reload
	cmpl	$1, %eax
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	jne	LBB0_26
## %bb.12:
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %eax
	cltd
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rbx
	idivl	(%rbx)
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%eax, %ecx
	jle	LBB0_14
## %bb.13:
	leaq	L_.str.1(%rip), %rsi
	movl	%ecx, %edx
	callq	_dev_err
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %eax
	cltd
	idivl	(%rbx)
LBB0_14:
	testl	%eax, %eax
	jle	LBB0_15
## %bb.16:
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	cmpl	$2, %ecx
	movl	$1, %eax
	cmovgel	%ecx, %eax
	decl	%eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	leaq	1(%r15), %r12
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	%r12d, %ecx
	jg	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	(%r14), %esi
	movl	4(%r14), %ecx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%ecx
	movl	%r15d, %edx
	imull	%eax, %edx
	subl	%edx, %esi
	imull	%ecx, %esi
LBB0_19:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	16(%r14), %rdx
	addq	%rbx, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	24(%r14), %rcx
	movq	%rax, (%rcx,%r15,8)
	movq	24(%r14), %rax
	cmpq	$0, (%rax,%r15,8)
	je	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	16(%r14), %r9
	movq	56(%r14), %rax
	movq	(%r9,%r15,8), %rdx
	movq	%rdx, (%rax,%r15,8)
	cmpq	%r15, -64(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	%r13d, %eax
	cltd
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rsi
	idivl	(%rsi)
	cltq
	addq	$8, %rbx
	movq	%r12, %r15
	cmpq	%rax, %r12
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	jl	LBB0_17
## %bb.24:
                                        ## kill: def $r12d killed $r12d killed $r12 def $r12
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_25
LBB0_3:
	imull	%ecx, %esi
	leaq	48(%r13), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_alloc_coherent
	movq	%rax, 56(%r13)
	testq	%rax, %rax
	je	LBB0_70
## %bb.4:
	movq	48(%r13), %rax
	movq	%rax, 72(%r13)
	movq	$0, 64(%r13)
	xorl	%eax, %eax
	jmp	LBB0_72
LBB0_26:
	cmpl	$2, %eax
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rbx
	movl	-72(%rbp), %r8d                 ## 4-byte Reload
	jne	LBB0_29
## %bb.27:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	(%rbx)
	testl	%eax, %eax
	jle	LBB0_28
## %bb.30:
	movl	%r15d, %r9d
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movl	$0, -84(%rbp)                   ## 4-byte Folded Spill
LBB0_31:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_35 Depth 2
	movl	%r9d, %r13d
	leaq	(,%r15,8), %rdx
	addq	32(%r14), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	callq	_dma_alloc_coherent
	movq	40(%r14), %rcx
	movq	%rax, (%rcx,%r15,8)
	movq	40(%r14), %rax
	cmpq	$0, (%rax,%r15,8)
	je	LBB0_48
## %bb.32:                              ##   in Loop: Header=BB0_31 Depth=1
	movq	32(%r14), %rax
	movq	56(%r14), %rcx
	movq	(%rax,%r15,8), %rax
	movq	%rax, (%rcx,%r15,8)
	movl	(%rbx), %esi
	movl	%r12d, %eax
	cltd
	idivl	%esi
	testl	%eax, %eax
	movl	-72(%rbp), %r8d                 ## 4-byte Reload
	jle	LBB0_33
## %bb.34:                              ##   in Loop: Header=BB0_31 Depth=1
	movl	%r15d, %eax
	movl	-80(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %r9d
	xorl	%r13d, %r13d
LBB0_35:                                ##   Parent Loop BB0_31 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%esi
	movl	%eax, %ecx
	addq	%r13, %rcx
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leal	(%rax,%r13), %r12d
	incl	%r12d
	movl	%r9d, %esi
	cmpl	%r8d, %r12d
	jl	LBB0_37
## %bb.36:                              ##   in Loop: Header=BB0_35 Depth=2
	movl	(%r14), %esi
	movl	4(%r14), %ebx
	movl	%r9d, %eax
	cltd
	idivl	%ebx
	movl	%ecx, %edx
	imull	%eax, %edx
	subl	%edx, %esi
	imull	%ebx, %esi
LBB0_37:                                ##   in Loop: Header=BB0_35 Depth=2
	movslq	%ecx, %rbx
	leaq	(,%rbx,8), %rdx
	addq	16(%r14), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	24(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	24(%r14), %rax
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_53
## %bb.38:                              ##   in Loop: Header=BB0_35 Depth=2
	movq	16(%r14), %rax
	movq	40(%r14), %rcx
	movq	(%rax,%rbx,8), %rax
	movq	(%rcx,%r15,8), %rcx
	movq	%rax, (%rcx,%r13,8)
	movl	-72(%rbp), %r8d                 ## 4-byte Reload
	cmpl	%r8d, %r12d
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jge	LBB0_43
## %bb.39:                              ##   in Loop: Header=BB0_35 Depth=2
	incq	%r13
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	cltd
	idivl	%esi
	cltq
	cmpq	%rax, %r13
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jl	LBB0_35
## %bb.40:                              ##   in Loop: Header=BB0_31 Depth=1
	movq	%r13, %rcx
	addl	%r13d, -84(%rbp)                ## 4-byte Folded Spill
	jmp	LBB0_41
LBB0_33:                                ##   in Loop: Header=BB0_31 Depth=1
	cltq
	xorl	%ecx, %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %r9d
LBB0_41:                                ##   in Loop: Header=BB0_31 Depth=1
	incq	%r15
	cmpq	%rax, %r15
	jl	LBB0_31
## %bb.42:
                                        ## kill: def $r15d killed $r15d killed $r15 def $r15
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, %r13
	jmp	LBB0_44
LBB0_29:
	movl	$1, 8(%r14)
	xorl	%eax, %eax
	jmp	LBB0_72
LBB0_15:
	movq	16(%r14), %r9
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_25
LBB0_20:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_54
LBB0_22:
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
LBB0_25:
	movq	(%r9), %rax
	movq	%rax, 72(%r14)
	xorl	%r13d, %r13d
	cmpl	$1, %ecx
	movl	-76(%rbp), %edx                 ## 4-byte Reload
	jle	LBB0_46
LBB0_45:
	movq	8(%r9), %rax
	movq	%rax, 64(%r14)
LBB0_46:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	incl	%ecx
	xorl	%eax, %eax
	movl	%ecx, 8(%r14)
	cmpl	$2, %edx
	jne	LBB0_72
## %bb.47:
	incl	%r13d
	movl	%r13d, 12(%r14)
	jmp	LBB0_72
LBB0_28:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	jmp	LBB0_44
LBB0_53:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %r13d                ## 4-byte Reload
LBB0_54:
	movq	48(%r14), %rcx
	movq	56(%r14), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_dma_free_coherent
	xorps	%xmm0, %xmm0
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movups	%xmm0, (%rax)
	movl	-76(%rbp), %eax                 ## 4-byte Reload
	cmpl	$1, %eax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_58
## %bb.55:
	testl	%r15d, %r15d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_66
## %bb.56:
	incq	%r15
LBB0_57:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movq	24(%r14), %rcx
	movq	-16(%rcx,%r15,8), %rdx
	movq	-16(%rax,%r15,8), %rcx
	movl	%ebx, %esi
	callq	_dma_free_coherent
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	decq	%r15
	cmpq	$1, %r15
	ja	LBB0_57
	jmp	LBB0_66
LBB0_58:
	cmpl	$2, %eax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_66
## %bb.59:
	movl	%r15d, %r12d
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_60
LBB0_65:                                ##   in Loop: Header=BB0_60 Depth=1
	leaq	-1(%r12), %rax
	testq	%r12, %r12
	movq	%rax, %r12
	movq	%r15, %rdi
	jle	LBB0_66
LBB0_60:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_62 Depth 2
	movq	32(%r14), %rax
	movq	40(%r14), %rcx
	movq	(%rcx,%r12,8), %rdx
	movq	(%rax,%r12,8), %rcx
	movq	%rdi, %r15
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	callq	_dma_free_coherent
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %eax
	cltd
	idivl	%esi
	testl	%eax, %eax
	jle	LBB0_65
## %bb.61:                              ##   in Loop: Header=BB0_60 Depth=1
	movl	%r12d, %ebx
	movl	-80(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_62
	.p2align	4, 0x90
LBB0_64:                                ##   in Loop: Header=BB0_62 Depth=2
	movl	%ebx, %eax
	cltd
	idivl	%esi
	movq	16(%r14), %rcx
	movq	24(%r14), %rdx
	cltq
	addq	%r13, %rax
	movq	(%rdx,%rax,8), %rdx
	movq	(%rcx,%rax,8), %rcx
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_dma_free_coherent
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%esi
	incq	%r13
	cmpl	%eax, %r13d
	jge	LBB0_65
LBB0_62:                                ##   Parent Loop BB0_60 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	-72(%rbp), %r12                 ## 8-byte Folded Reload
	jne	LBB0_64
## %bb.63:                              ##   in Loop: Header=BB0_62 Depth=2
	cmpl	-64(%rbp), %r13d                ## 4-byte Folded Reload
	jb	LBB0_64
	jmp	LBB0_65
LBB0_43:
                                        ## kill: def $r15d killed $r15d killed $r15 def $r15
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
LBB0_44:
	movq	16(%r14), %r9
	movq	(%r9), %rax
	movq	%rax, 72(%r14)
	cmpl	$2, %r8d
	movl	-76(%rbp), %edx                 ## 4-byte Reload
	jge	LBB0_45
	jmp	LBB0_46
LBB0_48:
	movq	48(%r14), %rcx
	movq	56(%r14), %rdx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_dma_free_coherent
	xorps	%xmm0, %xmm0
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movups	%xmm0, (%rax)
	testl	%r15d, %r15d
	jne	LBB0_50
LBB0_66:
	movq	40(%r14), %rdi
	callq	_kfree
	movq	$0, 40(%r14)
LBB0_67:
	movq	32(%r14), %rdi
	callq	_kfree
	movq	$0, 32(%r14)
LBB0_68:
	movq	24(%r14), %rdi
	callq	_kfree
	movq	$0, 24(%r14)
LBB0_69:
	movq	16(%r14), %rdi
	callq	_kfree
	movq	$0, 16(%r14)
LBB0_70:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_71:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_72:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_49:                                ##   in Loop: Header=BB0_50 Depth=1
	cmpq	$2, -64(%rbp)                   ## 8-byte Folded Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%r12d, %r13d
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jl	LBB0_66
LBB0_50:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_52 Depth 2
	leaq	-1(%r15), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	32(%r14), %rax
	movq	40(%r14), %rcx
	movq	-8(%rcx,%r15,8), %rdx
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-8(%rax,%r15,8), %rcx
	movq	%rbx, %rdi
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	callq	_dma_free_coherent
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %r8
	movl	(%r8), %edi
	movl	%r15d, %eax
	cltd
	idivl	%edi
	testl	%eax, %eax
	movl	%r13d, %r12d
	jle	LBB0_49
## %bb.51:                              ##   in Loop: Header=BB0_50 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax
	movl	-80(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_52:                                ##   Parent Loop BB0_50 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%edi
	movq	16(%r14), %rcx
	movq	24(%r14), %rdx
	cltq
	addq	%rbx, %rax
	movq	(%rdx,%rax,8), %rdx
	movq	(%rcx,%rax,8), %rcx
	movq	%r8, %r13
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	callq	_dma_free_coherent
	movq	%r13, %r8
	movl	(%r13), %edi
	movl	%r15d, %eax
	cltd
	idivl	%edi
	incq	%rbx
	cmpl	%eax, %ebx
	jl	LBB0_52
	jmp	LBB0_49
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_BA_BYTE_LEN,4,2                ## @BA_BYTE_LEN
	.comm	_HNS_ROCE_HOP_NUM_0,4,2         ## @HNS_ROCE_HOP_NUM_0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"eq entries %d is larger than buf_pg_sz!"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"ba_num %d is too large for 1 hop\n"

	.no_dead_strip	_hns_roce_mhop_alloc_eq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_mhop_alloc_eq
_hns_roce_mhop_alloc_eq:                ; @hns_roce_mhop_alloc_eq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	ldr	x20, [x0, #16]
	ldp	w25, w8, [x0]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w8, w9, w8
	mov	w10, #1
	lsl	w21, w10, w8
	ldr	w8, [x0, #8]
	add	w26, w8, w9
	lsl	w22, w10, w26
	ldp	w8, w9, [x1]
	mul	w0, w9, w8
	bl	_PAGE_ALIGN
	mov	x1, x21
	bl	_DIV_ROUND_UP
	mov	x23, x0
Lloh3:
	adrp	x27, _BA_BYTE_LEN@GOTPAGE
Lloh4:
	ldr	x27, [x27, _BA_BYTE_LEN@GOTPAGEOFF]
	ldr	w8, [x27]
	sdiv	w1, w22, w8
	bl	_DIV_ROUND_UP
Lloh5:
	adrp	x8, _HNS_ROCE_HOP_NUM_0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HNS_ROCE_HOP_NUM_0@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ne	LBB0_3
; %bb.1:
	ldp	w2, w8, [x19]
	sdiv	w9, w21, w8
	cmp	w2, w9
	b.le	LBB0_21
; %bb.2:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_67
LBB0_3:
	mov	x24, x0
Lloh12:
	adrp	x28, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x28, [x28, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x28]
	mov	x0, x23
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_66
; %bb.4:
	ldr	w2, [x28]
	mov	x0, x23
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_65
; %bb.5:
	cmp	w25, #2
	b.ne	LBB0_8
; %bb.6:
	ldr	w2, [x28]
	mov	x0, x24
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #32]
	cbz	x0, LBB0_64
; %bb.7:
	ldr	w2, [x28]
	mov	x0, x24
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #40]
	cbz	x0, LBB0_63
LBB0_8:
	add	x24, x19, #48
	ldr	w3, [x28]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x24
	bl	_dma_alloc_coherent
	str	x0, [x19, #56]
	cbz	x0, LBB0_62
; %bb.9:
	cmp	w25, #1
	b.ne	LBB0_23
; %bb.10:
	ldr	w8, [x27]
	sdiv	w8, w22, w8
	cmp	w23, w8
	b.le	LBB0_12
; %bb.11:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x23
	bl	_dev_err
	ldr	w8, [x27]
	sdiv	w8, w22, w8
LBB0_12:
	cmp	w8, #0
	b.le	LBB0_39
; %bb.13:
	str	x24, [sp, #16]                  ; 8-byte Folded Spill
	str	w25, [sp, #28]                  ; 4-byte Folded Spill
	mov	x28, #0
	mov	x25, #0
	cmp	w23, #1
	csinc	w8, w23, wzr, gt
	sub	w8, w8, #1
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	x24, x25, #1
	mov	x1, x21
	cmp	w23, w24
	b.gt	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldp	w9, w8, [x19]
	sdiv	w10, w21, w8
	msub	w9, w10, w25, w9
	mul	w1, w9, w8
LBB0_16:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x19, #16]
	add	x2, x8, x28
Lloh16:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #24]
	lsl	x9, x25, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_45
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x19, #16]
	ldr	x10, [x8, x9]
	ldr	x11, [x19, #56]
	str	x10, [x11, x9]
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	cmp	x9, x25
	b.eq	LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [x27]
	sdiv	w9, w22, w9
	add	x28, x28, #8
	cmp	x24, w9, sxtw
	mov	x25, x24
	b.lt	LBB0_14
; %bb.19:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	str	x24, [sp, #40]                  ; 8-byte Folded Spill
LBB0_20:
	ldr	w25, [sp, #28]                  ; 4-byte Folded Reload
	b	LBB0_40
LBB0_21:
	mul	w1, w8, w2
	add	x2, x19, #48
Lloh19:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_dma_alloc_coherent
	str	x0, [x19, #56]
	cbz	x0, LBB0_66
; %bb.22:
	mov	w0, #0
	ldr	x8, [x19, #48]
	stp	xzr, x8, [x19, #64]
	b	LBB0_68
LBB0_23:
	cmp	w25, #2
	b.ne	LBB0_38
; %bb.24:
	ldr	w8, [x27]
	sdiv	w8, w22, w8
	cmp	w8, #1
	b.lt	LBB0_46
; %bb.25:
	str	x24, [sp, #16]                  ; 8-byte Folded Spill
	str	w25, [sp, #28]                  ; 4-byte Folded Spill
	mov	x25, #0
	stp	w26, wzr, [sp, #8]              ; 8-byte Folded Spill
LBB0_26:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_29 Depth 2
	ldr	x8, [x19, #32]
	lsl	x24, x25, #3
	add	x2, x8, x24
Lloh22:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #40]
	str	x0, [x8, x24]
	ldr	x8, [x19, #40]
	ldr	x8, [x8, x24]
	cbz	x8, LBB0_61
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=1
	ldr	x8, [x19, #32]
	ldr	x8, [x8, x24]
	ldr	x9, [x19, #56]
	str	x8, [x9, x24]
	ldr	w8, [x27]
	sdiv	w9, w22, w8
	cmp	w9, #0
	b.le	LBB0_35
; %bb.28:                               ;   in Loop: Header=BB0_26 Depth=1
	mov	x28, #0
	lsl	w9, w25, w26
	str	w9, [sp, #40]                   ; 4-byte Folded Spill
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	mov	w9, w9
	str	x9, [sp, #32]                   ; 8-byte Folded Spill
LBB0_29:                                ;   Parent Loop BB0_26 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [sp, #40]                   ; 4-byte Folded Reload
	sdiv	w8, w9, w8
	add	x8, x28, x8
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	add	w9, w9, w28
	add	w24, w9, #1
	mov	x1, x21
	cmp	w24, w23
	b.lt	LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=2
	ldp	w10, w9, [x19]
	sdiv	w11, w21, w9
	msub	w10, w11, w8, w10
	mul	w1, w10, w9
LBB0_31:                                ;   in Loop: Header=BB0_29 Depth=2
	ldr	x9, [x19, #16]
	sxtw	x26, w8
	lsl	x27, x26, #3
	add	x2, x9, x27
Lloh25:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh27:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #24]
	str	x0, [x8, x27]
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x27]
	cbz	x8, LBB0_48
; %bb.32:                               ;   in Loop: Header=BB0_29 Depth=2
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x26, lsl #3]
	ldr	x9, [x19, #40]
	ldr	x9, [x9, x25, lsl #3]
	str	x8, [x9, x28, lsl #3]
	cmp	w24, w23
Lloh28:
	adrp	x27, _BA_BYTE_LEN@GOTPAGE
Lloh29:
	ldr	x27, [x27, _BA_BYTE_LEN@GOTPAGEOFF]
	b.ge	LBB0_37
; %bb.33:                               ;   in Loop: Header=BB0_29 Depth=2
	add	x28, x28, #1
	ldr	w8, [x27]
	sdiv	w9, w22, w8
	sxtw	x9, w9
	cmp	x28, x9
	b.lt	LBB0_29
; %bb.34:                               ;   in Loop: Header=BB0_26 Depth=1
	ldp	w26, w8, [sp, #8]               ; 8-byte Folded Reload
	add	w8, w8, w28
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	b	LBB0_36
LBB0_35:                                ;   in Loop: Header=BB0_26 Depth=1
	mov	w28, #0
	sxtw	x9, w9
LBB0_36:                                ;   in Loop: Header=BB0_26 Depth=1
	add	x25, x25, #1
	cmp	x25, x9
	b.lt	LBB0_26
LBB0_37:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	str	x25, [sp, #40]                  ; 8-byte Folded Spill
	ldr	w25, [sp, #28]                  ; 4-byte Folded Reload
	b	LBB0_47
LBB0_38:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_68
LBB0_39:
	str	xzr, [sp, #40]                  ; 8-byte Folded Spill
	ldr	x8, [x19, #16]
LBB0_40:
	mov	w28, #0
	mov	w9, #0
	ldr	x10, [x8]
	str	x10, [x19, #72]
	cmp	w23, #1
	b.le	LBB0_42
LBB0_41:
	ldr	x8, [x8, #8]
	str	x8, [x19, #64]
	mov	x9, x28
LBB0_42:
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	add	w8, w8, #1
	str	w8, [x19, #8]
	cmp	w25, #2
	b.ne	LBB0_44
; %bb.43:
	mov	w0, #0
	add	w8, w9, #1
	str	w8, [x19, #12]
	b	LBB0_68
LBB0_44:
	mov	w0, #0
	b	LBB0_68
LBB0_45:
	mov	w28, #0
	b	LBB0_49
LBB0_46:
	str	xzr, [sp, #40]                  ; 8-byte Folded Spill
	mov	w28, #0
LBB0_47:
	ldr	x8, [x19, #16]
	ldr	x9, [x8]
	str	x9, [x19, #72]
	mov	x9, x28
	cmp	w23, #1
	b.gt	LBB0_41
	b	LBB0_42
LBB0_48:
	ldr	w26, [sp, #8]                   ; 4-byte Folded Reload
Lloh30:
	adrp	x27, _BA_BYTE_LEN@GOTPAGE
Lloh31:
	ldr	x27, [x27, _BA_BYTE_LEN@GOTPAGEOFF]
LBB0_49:
	ldp	x3, x2, [x19, #48]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_free_coherent
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	stp	xzr, xzr, [x8]
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	cmp	w8, #1
	b.ne	LBB0_53
; %bb.50:
	cbz	w25, LBB0_62
; %bb.51:
	sub	x22, x25, #1
LBB0_52:                                ; =>This Inner Loop Header: Depth=1
	lsl	x8, x22, #3
	ldp	x10, x9, [x19, #16]
	ldr	x2, [x9, x8]
	ldr	x3, [x10, x8]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_free_coherent
	add	x8, x22, #1
	sub	x22, x22, #1
	cmp	x8, #1
	b.hi	LBB0_52
	b	LBB0_62
LBB0_53:
	cmp	w8, #2
	b.ne	LBB0_62
; %bb.54:
	and	x23, x25, #0xffffffff
	mov	x24, x23
	b	LBB0_56
LBB0_55:                                ;   in Loop: Header=BB0_56 Depth=1
	sub	x8, x24, #1
	cmp	x24, #0
	mov	x24, x8
Lloh32:
	adrp	x27, _BA_BYTE_LEN@GOTPAGE
Lloh33:
	ldr	x27, [x27, _BA_BYTE_LEN@GOTPAGEOFF]
	b.le	LBB0_62
LBB0_56:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_59 Depth 2
	lsl	x8, x24, #3
	ldp	x10, x9, [x19, #32]
	ldr	x2, [x9, x8]
	ldr	x3, [x10, x8]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_free_coherent
	ldr	w8, [x27]
	sdiv	w9, w22, w8
	cmp	w9, #1
	b.lt	LBB0_55
; %bb.57:                               ;   in Loop: Header=BB0_56 Depth=1
	mov	x25, #0
	lsl	w27, w24, w26
	b	LBB0_59
LBB0_58:                                ;   in Loop: Header=BB0_59 Depth=2
	sdiv	w8, w27, w8
	add	x8, x25, w8, sxtw
	lsl	x8, x8, #3
	ldp	x10, x9, [x19, #16]
	ldr	x2, [x9, x8]
	ldr	x3, [x10, x8]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_free_coherent
Lloh34:
	adrp	x8, _BA_BYTE_LEN@GOTPAGE
Lloh35:
	ldr	x8, [x8, _BA_BYTE_LEN@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	sdiv	w9, w22, w8
	add	x25, x25, #1
	cmp	w25, w9
	b.ge	LBB0_55
LBB0_59:                                ;   Parent Loop BB0_56 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x24, x23
	b.ne	LBB0_58
; %bb.60:                               ;   in Loop: Header=BB0_59 Depth=2
	cmp	w25, w28
	b.lo	LBB0_58
	b	LBB0_55
LBB0_61:
	ldp	x3, x2, [x19, #48]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_free_coherent
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	stp	xzr, xzr, [x8]
	cbnz	w25, LBB0_70
LBB0_62:
	ldr	x0, [x19, #40]
	bl	_kfree
	str	xzr, [x19, #40]
LBB0_63:
	ldr	x0, [x19, #32]
	bl	_kfree
	str	xzr, [x19, #32]
LBB0_64:
	ldr	x0, [x19, #24]
	bl	_kfree
	str	xzr, [x19, #24]
LBB0_65:
	ldr	x0, [x19, #16]
	bl	_kfree
	str	xzr, [x19, #16]
LBB0_66:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_67:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_68:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_69:                                ;   in Loop: Header=BB0_70 Depth=1
	cmp	x23, #2
	mov	x27, x28
	b.lt	LBB0_62
LBB0_70:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_72 Depth 2
	mov	x23, x25
	sub	x25, x25, #1
	lsl	x8, x25, #3
	ldp	x10, x9, [x19, #32]
	ldr	x2, [x9, x8]
	ldr	x3, [x10, x8]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_free_coherent
	ldr	w8, [x27]
	sdiv	w9, w22, w8
	cmp	w9, #1
	mov	x28, x27
	b.lt	LBB0_69
; %bb.71:                               ;   in Loop: Header=BB0_70 Depth=1
	mov	x24, #0
	lsl	w27, w25, w26
LBB0_72:                                ;   Parent Loop BB0_70 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sdiv	w8, w27, w8
	add	x8, x24, w8, sxtw
	lsl	x8, x8, #3
	ldp	x10, x9, [x19, #16]
	ldr	x2, [x9, x8]
	ldr	x3, [x10, x8]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_free_coherent
	ldr	w8, [x28]
	sdiv	w9, w22, w8
	add	x24, x24, #1
	cmp	w24, w9
	b.lt	LBB0_72
	b	LBB0_69
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_BA_BYTE_LEN,4,2                ; @BA_BYTE_LEN
	.comm	_HNS_ROCE_HOP_NUM_0,4,2         ; @HNS_ROCE_HOP_NUM_0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"eq entries %d is larger than buf_pg_sz!"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"ba_num %d is too large for 1 hop\n"

	.no_dead_strip	_hns_roce_mhop_alloc_eq
.subsections_via_symbols
