	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_alloc_resize_buf
_mthca_alloc_resize_buf:                ## @mthca_alloc_resize_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_spin_lock_irq
	cmpq	$0, 8(%r12)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.5:
	negl	%ebx
	jmp	LBB0_11
LBB0_2:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kmalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movq	_CQ_RESIZE_ALLOC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movq	%r12, %rdi
	callq	_spin_unlock_irq
LBB0_7:
	movq	8(%r12), %rsi
	addq	$8, %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_mthca_alloc_cq_buf
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	8(%r12), %rdi
	callq	_kfree
	movq	$0, 8(%r12)
	jmp	LBB0_10
LBB0_9:
	decl	%r14d
	movq	8(%r12), %rax
	movl	%r14d, (%rax)
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	_CQ_RESIZE_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r12), %rcx
	movl	%eax, 4(%rcx)
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r12, %rdi
	callq	_spin_unlock_irq
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CQ_RESIZE_ALLOC,4,2            ## @CQ_RESIZE_ALLOC
	.comm	_CQ_RESIZE_READY,4,2            ## @CQ_RESIZE_READY
	.no_dead_strip	_mthca_alloc_resize_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_alloc_resize_buf
_mthca_alloc_resize_buf:                ; @mthca_alloc_resize_buf
	.cfi_startproc
; %bb.0:
	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	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	x0, x1
	bl	_spin_lock_irq
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w22, [x8]
	mov	x0, x19
	bl	_spin_unlock_irq
	cbz	w22, LBB0_6
; %bb.3:
	neg	w21, w22
	b	LBB0_10
LBB0_4:
Lloh2:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #12
	bl	_kmalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_11
; %bb.5:
Lloh5:
	adrp	x8, _CQ_RESIZE_ALLOC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CQ_RESIZE_ALLOC@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x0, #4]
	mov	x0, x19
	bl	_spin_unlock_irq
LBB0_6:
	ldr	x8, [x19, #8]
	add	x1, x8, #8
	mov	x0, x21
	mov	x2, x20
	bl	_mthca_alloc_cq_buf
	mov	x21, x0
	cbz	w0, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	x0, [x19, #8]
	bl	_kfree
	str	xzr, [x19, #8]
	b	LBB0_9
LBB0_8:
	sub	w8, w20, #1
	ldr	x9, [x19, #8]
	str	w8, [x9]
	mov	x0, x19
	bl	_spin_lock_irq
Lloh8:
	adrp	x8, _CQ_RESIZE_READY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CQ_RESIZE_READY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
	str	w8, [x9, #4]
LBB0_9:
	mov	x0, x19
	bl	_spin_unlock_irq
LBB0_10:
	mov	x0, x21
	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
	ret
LBB0_11:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CQ_RESIZE_ALLOC,4,2            ; @CQ_RESIZE_ALLOC
	.comm	_CQ_RESIZE_READY,4,2            ; @CQ_RESIZE_READY
	.no_dead_strip	_mthca_alloc_resize_buf
.subsections_via_symbols
