	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_alloc_srq_buf             ## -- Begin function mlx4_alloc_srq_buf
	.p2align	4, 0x90
_mlx4_alloc_srq_buf:                    ## @mlx4_alloc_srq_buf
	.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	%rdx, %r12
	movq	%rdi, %r15
	movl	(%rdx), %edi
	shll	$2, %edi
	callq	_malloc
	movl	%eax, 28(%r12)
	movl	$-1, %r14d
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	movl	4(%r12), %eax
	leal	4(,%rax,4), %eax
	movl	$4, %ecx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ecx
	movl	$1, %edx
	shll	%cl, %edx
	cmpl	%eax, %edx
	jl	LBB0_2
## %bb.3:
	movl	%ecx, 8(%r12)
	movl	(%r12), %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	leaq	24(%r12), %r13
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_to_mdev
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_mlx4_alloc_buf
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	28(%r12), %edi
	callq	_free
	jmp	LBB0_12
LBB0_5:
	movl	24(%r12), %edi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_memset
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.6:
	xorl	%r15d, %r15d
	movq	_MLX4_INVALID_LKEY@GOTPCREL(%rip), %r14
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r12), %eax
	cmpl	%eax, %r15d
	jge	LBB0_11
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_get_wqe
	movq	%rax, %rbx
	incl	%r15d
	movl	(%r12), %edi
	movl	$2147483647, %eax               ## imm = 0x7FFFFFFF
	addl	%eax, %edi
	andl	%r15d, %edi
	callq	_htobe16
	movl	%eax, (%rbx)
	movb	8(%r12), %cl
	movl	$1, %eax
	shll	%cl, %eax
	leaq	4(%rbx), %r13
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cltq
	addq	%rbx, %rax
	cmpq	%r13, %rax
	jbe	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=2
	movl	(%r14), %edi
	callq	_htobe32
	movl	%eax, (%r13)
	movzbl	8(%r12), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	addq	$4, %r13
	jmp	LBB0_10
LBB0_11:
	movq	$0, 16(%r12)
	decl	%eax
	movl	%eax, 12(%r12)
	xorl	%r14d, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_INVALID_LKEY,4,2          ## @MLX4_INVALID_LKEY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_alloc_srq_buf             ; -- Begin function mlx4_alloc_srq_buf
	.p2align	2
_mlx4_alloc_srq_buf:                    ; @mlx4_alloc_srq_buf
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x0
	ldr	w8, [x2]
	lsl	w0, w8, #2
	bl	_malloc
	str	w0, [x19, #28]
	cbz	w0, LBB0_5
; %bb.1:
	ldr	w8, [x19, #4]
	lsl	w8, w8, #2
	add	w9, w8, #4
	mov	w8, #4
	mov	w10, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	w8, w8, #1
	lsl	w11, w10, w8
	cmp	w11, w9
	b.lt	LBB0_2
; %bb.3:
	str	w8, [x19, #8]
	ldr	w9, [x19]
	lsl	w21, w9, w8
	add	x22, x19, #24
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_to_mdev
	ldr	w2, [x0]
	mov	x0, x22
	mov	x1, x21
	bl	_mlx4_alloc_buf
	cbz	x0, LBB0_6
; %bb.4:
	ldr	w0, [x19, #28]
	bl	_free
LBB0_5:
	mov	w0, #-1
	b	LBB0_13
LBB0_6:
	ldr	w0, [x19, #24]
	mov	w1, #0
	mov	x2, x21
	bl	_memset
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.7:
	mov	w20, #0
	mov	w22, #2147483647
	mov	w23, #1
Lloh0:
	adrp	x24, _MLX4_INVALID_LKEY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MLX4_INVALID_LKEY@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x19]
	cmp	w20, w8
	b.ge	LBB0_12
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	mov	x0, x19
	mov	x1, x20
	bl	_get_wqe
	mov	x21, x0
	add	w20, w20, #1
	ldr	w8, [x19]
	add	w8, w8, w22
	and	w0, w8, w20
	bl	_htobe16
	mov	x25, x21
LBB0_10:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	w0, [x25], #4
	ldr	w8, [x19, #8]
	lsl	w8, w23, w8
	add	x8, x21, w8, sxtw
	cmp	x8, x25
	b.ls	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w0, [x24]
	bl	_htobe32
	b	LBB0_10
LBB0_12:
	mov	w0, #0
	str	xzr, [x19, #16]
	sub	w8, w8, #1
	str	w8, [x19, #12]
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_INVALID_LKEY,4,2          ; @MLX4_INVALID_LKEY
.subsections_via_symbols
