	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_ib_alloc_pv_bufs
_mlx4_ib_alloc_pv_bufs:                 ## @mlx4_ib_alloc_pv_bufs
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_IB_QPT_GSI@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jae	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_15
LBB0_2:
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	8(%rdi), %r13
	movl	%esi, %r12d
	movq	_MLX4_NUM_TUNNEL_BUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	$4, %esi
	callq	_kcalloc
	leaq	(%r12,%r12,2), %rcx
	shlq	$4, %rcx
	movq	%rax, 8(%r13,%rcx)
	testq	%rax, %rax
	je	LBB0_14
## %bb.3:
	movq	%r14, %rdx
	movq	%rcx, %r14
	leaq	(%rcx,%r13), %r12
	addq	$8, %r12
	movq	_MLX4_NUM_TUNNEL_BUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rdx), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, 16(%r13,%r14)
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_MLX4_NUM_TUNNEL_BUFS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_27
## %bb.5:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	addq	%rcx, %rax
	addq	$16, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %r13
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kmalloc
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%rbx)
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r15), %edi
	movl	(%r13), %ecx
	movq	%rax, %rsi
	movl	$4, %edx
	callq	_ib_dma_map_single
	movq	(%r12), %rcx
	movq	%rax, 8(%rcx,%rbx)
	movl	(%r15), %edi
	movq	%rax, %rsi
	callq	_ib_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_8
## %bb.16:                              ##   in Loop: Header=BB0_6 Depth=1
	incq	%r14
	movq	_MLX4_NUM_TUNNEL_BUFS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$40, %rbx
	cmpq	%rax, %r14
	jl	LBB0_6
## %bb.17:
	testl	%eax, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jle	LBB0_27
## %bb.18:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kmalloc
	movq	(%rbx), %rcx
	movq	%rax, 16(%rcx,%r13)
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	(%r15), %edi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%rax, %rsi
	movl	$4, %edx
	callq	_ib_dma_map_single
	movq	(%rbx), %rcx
	movq	%rax, 24(%rcx,%r13)
	movl	(%r15), %edi
	movq	%rax, %rsi
	callq	_ib_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_21
## %bb.26:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	(%rbx), %rax
	movq	$0, 32(%rax,%r13)
	incq	%r14
	movq	_MLX4_NUM_TUNNEL_BUFS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$40, %r13
	cmpq	%rax, %r14
	jl	LBB0_19
LBB0_27:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%r14,%rbx), %rdi
	addq	$40, %rdi
	callq	_spin_lock_init
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r14,%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14,%rbx)
	xorl	%eax, %eax
	jmp	LBB0_28
LBB0_8:
	movq	(%r12), %rax
	movq	(%rax,%rbx), %rdi
	callq	_kfree
LBB0_9:
	testl	%r14d, %r14d
	jle	LBB0_12
LBB0_10:
	movl	%r14d, %ebx
	incq	%rbx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %eax
	movl	(%r15), %edi
	movq	(%r12), %rcx
	shlq	$3, %rax
	leaq	(%rax,%rax,4), %r14
	movq	8(%rcx,%r14), %rsi
	movl	(%r13), %ecx
	movl	$4, %edx
	callq	_ib_dma_unmap_single
	movq	(%r12), %rax
	movq	(%rax,%r14), %rdi
	callq	_kfree
	decq	%rbx
	cmpq	$1, %rbx
	ja	LBB0_11
LBB0_12:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rdi
	callq	_kfree
	movq	$0, (%rbx)
LBB0_13:
	movq	(%r12), %rdi
	callq	_kfree
	movq	$0, (%r12)
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_15:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_28:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	(%rbx), %rax
	movq	16(%rax,%r13), %rdi
	callq	_kfree
LBB0_22:
	testl	%r14d, %r14d
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	je	LBB0_25
## %bb.23:
	incq	%r14
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movq	(%rbx), %rax
	movq	-16(%rax,%r13), %rsi
	movq	%rbx, %r15
	movq	%rcx, %rbx
	movl	(%rcx), %ecx
	movl	$4, %edx
	callq	_ib_dma_unmap_single
	movq	(%r15), %rax
	movq	-24(%rax,%r13), %rdi
	callq	_kfree
	movq	%rbx, %rcx
	movq	%r15, %rbx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	decq	%r14
	addq	$-40, %r13
	cmpq	$1, %r14
	ja	LBB0_24
LBB0_25:
	movq	_MLX4_NUM_TUNNEL_BUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %r13
	testl	%r14d, %r14d
	jg	LBB0_10
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_QPT_GSI,4,2                 ## @IB_QPT_GSI
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX4_NUM_TUNNEL_BUFS,4,2       ## @MLX4_NUM_TUNNEL_BUFS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.no_dead_strip	_mlx4_ib_alloc_pv_bufs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_ib_alloc_pv_bufs
_mlx4_ib_alloc_pv_bufs:                 ; @mlx4_ib_alloc_pv_bufs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, _IB_QPT_GSI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_QPT_GSI@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.hs	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_22
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	ldr	x25, [x0, #8]
Lloh5:
	adrp	x24, _MLX4_NUM_TUNNEL_BUFS@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MLX4_NUM_TUNNEL_BUFS@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh7:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	w1, #4
	bl	_kcalloc
	mov	w8, #48
	umaddl	x21, w20, w8, x25
	str	x0, [x21, #8]!
	cbz	x0, LBB0_21
; %bb.3:
	mov	w23, w20
	ldr	w0, [x24]
	ldr	w2, [x26]
	mov	w1, #4
	bl	_kcalloc
	mov	w8, #48
	madd	x22, x23, x8, x25
	str	x0, [x22, #16]!
	cbz	x0, LBB0_20
; %bb.4:
	str	x23, [sp, #8]                   ; 8-byte Folded Spill
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.5:
	mov	x27, #0
	mov	x28, #0
Lloh9:
	adrp	x23, _DMA_FROM_DEVICE@GOTPAGE
Lloh10:
	ldr	x23, [x23, _DMA_FROM_DEVICE@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	w0, #4
	bl	_kmalloc
	ldr	x8, [x21]
	str	x0, [x8, x27]
	cbz	x0, LBB0_16
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x1, x0
	ldr	w0, [x19]
	ldr	w3, [x23]
	mov	w2, #4
	bl	_ib_dma_map_single
	mov	x1, x0
	ldr	x8, [x21]
	add	x8, x8, x27
	str	x0, [x8, #8]
	ldr	w0, [x19]
	bl	_ib_dma_mapping_error
	cbnz	x0, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x28, x28, #1
	ldrsw	x8, [x24]
	add	x27, x27, #40
	cmp	x28, x8
	b.lt	LBB0_6
; %bb.9:
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.10:
	mov	x28, #0
	mov	x27, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	w0, #4
	bl	_kmalloc
	ldr	x8, [x22]
	add	x8, x8, x28
	str	x0, [x8, #16]
	cbz	x0, LBB0_25
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x1, x0
	ldr	w0, [x19]
Lloh11:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	mov	w2, #4
	bl	_ib_dma_map_single
	mov	x1, x0
	ldr	x8, [x22]
	add	x8, x8, x28
	str	x0, [x8, #24]
	ldr	w0, [x19]
	bl	_ib_dma_mapping_error
	cbnz	x0, LBB0_24
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x22]
	add	x8, x8, x28
	str	xzr, [x8, #32]
	add	x27, x27, #1
	ldrsw	x8, [x24]
	add	x28, x28, #40
	cmp	x27, x8
	b.lt	LBB0_11
LBB0_14:
	mov	w8, #48
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	madd	x19, x9, x8, x25
	add	x0, x19, #40
	bl	_spin_lock_init
	mov	w0, #0
	stp	xzr, xzr, [x19, #24]
	str	w20, [x19]
	b	LBB0_23
LBB0_15:
	ldr	x8, [x21]
	ldr	x0, [x8, x27]
	bl	_kfree
LBB0_16:
	cmp	w28, #1
	b.lt	LBB0_19
LBB0_17:
	mov	w8, w28
	add	x20, x8, #1
	mov	w24, #40
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w20, #2
	ldr	w0, [x19]
	ldr	x9, [x21]
	umaddl	x9, w8, w24, x9
	umull	x25, w8, w24
	ldr	x1, [x9, #8]
	ldr	w3, [x23]
	mov	w2, #4
	bl	_ib_dma_unmap_single
	ldr	x8, [x21]
	ldr	x0, [x8, x25]
	bl	_kfree
	sub	x20, x20, #1
	cmp	x20, #1
	b.hi	LBB0_18
LBB0_19:
	ldr	x0, [x22]
	bl	_kfree
	str	xzr, [x22]
LBB0_20:
	ldr	x0, [x21]
	bl	_kfree
	str	xzr, [x21]
LBB0_21:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_23:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_24:
	ldr	x8, [x22]
	add	x8, x8, x28
	ldr	x0, [x8, #16]
	bl	_kfree
LBB0_25:
Lloh16:
	adrp	x25, _DMA_TO_DEVICE@GOTPAGE
Lloh17:
	ldr	x25, [x25, _DMA_TO_DEVICE@GOTPAGEOFF]
	cbz	w27, LBB0_28
; %bb.26:
	add	x20, x27, #1
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	ldr	x8, [x22]
	add	x8, x8, x28
	ldur	x1, [x8, #-16]
	ldr	w3, [x25]
	mov	w2, #4
	bl	_ib_dma_unmap_single
	ldr	x8, [x22]
	add	x8, x8, x28
	ldur	x0, [x8, #-24]
	bl	_kfree
	sub	x20, x20, #1
	sub	x28, x28, #40
	cmp	x20, #1
	b.hi	LBB0_27
LBB0_28:
	ldr	w28, [x24]
	cmp	w28, #1
	b.ge	LBB0_17
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_QPT_GSI,4,2                 ; @IB_QPT_GSI
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX4_NUM_TUNNEL_BUFS,4,2       ; @MLX4_NUM_TUNNEL_BUFS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.no_dead_strip	_mlx4_ib_alloc_pv_bufs
.subsections_via_symbols
