	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SW2HW_SRQ_wrapper         ## -- Begin function mlx4_SW2HW_SRQ_wrapper
	.p2align	4, 0x90
_mlx4_SW2HW_SRQ_wrapper:                ## @mlx4_SW2HW_SRQ_wrapper
	.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	%r9, -104(%rbp)                 ## 8-byte Spill
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r15
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movl	(%rdx), %ebx
	movq	$0, -72(%rbp)
	movq	(%rcx), %r14
	movq	%r14, %rdi
	callq	_srq_get_mtt_addr
	cltd
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	idivl	(%r13)
	movl	%eax, %r13d
	movl	(%r14), %edi
	callq	_be32_to_cpu
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	cmpl	%eax, %ebx
	jne	LBB0_1
## %bb.2:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	_RES_SRQ_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-72(%rbp), %r8
	movq	-112(%rbp), %r12                ## 8-byte Reload
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_srq_res_start_move_to
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movq	_RES_MTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %r8
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %ebx
	movl	%r13d, %edx
	callq	_get_res
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movq	_RES_MTT@GOTPCREL(%rip), %r13
	movq	%r14, %rdi
	callq	_srq_get_mtt_size
	movq	-56(%rbp), %r8
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_check_mtt_range
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movq	-104(%rbp), %r9                 ## 8-byte Reload
	callq	_mlx4_DMA_wrapper
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movq	-56(%rbp), %rax
	movl	(%rax), %edx
	movl	(%r13), %ecx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_put_res
LBB0_8:
	movq	_RES_SRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	callq	_res_abort_move
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	-56(%rbp), %rdi
	addq	$4, %rdi
	callq	_atomic_inc
	movq	-56(%rbp), %rax
	movq	-72(%rbp), %rcx
	movq	%rax, (%rcx)
	movq	-56(%rbp), %rax
	movl	(%rax), %edx
	movl	(%r13), %ecx
	movq	%r12, %rdi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	callq	_put_res
	movq	_RES_SRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	callq	_res_end_move
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RES_SRQ_HW,4,2                 ## @RES_SRQ_HW
	.comm	_RES_MTT,4,2                    ## @RES_MTT
	.comm	_RES_SRQ,4,2                    ## @RES_SRQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SW2HW_SRQ_wrapper         ; -- Begin function mlx4_SW2HW_SRQ_wrapper
	.p2align	2
_mlx4_SW2HW_SRQ_wrapper:                ; @mlx4_SW2HW_SRQ_wrapper
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x27, x5
	mov	x23, x4
	mov	x24, x3
	mov	x25, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w19, [x2]
	str	xzr, [sp, #16]
	ldr	x26, [x3]
	mov	x0, x26
	bl	_srq_get_mtt_addr
	mov	x28, x0
	ldr	w22, [x21]
	ldr	w0, [x26]
	bl	_be32_to_cpu
	and	w8, w0, #0xffffff
	cmp	w19, w8
	b.ne	LBB0_7
; %bb.1:
	str	x27, [sp, #8]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _RES_SRQ_HW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RES_SRQ_HW@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	add	x4, sp, #16
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_srq_res_start_move_to
	mov	x27, x0
	cbnz	w0, LBB0_8
; %bb.2:
Lloh3:
	adrp	x8, _RES_MTT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RES_MTT@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	sdiv	w28, w28, w22
	add	x4, sp, #24
	mov	x0, x21
	mov	x1, x20
	mov	x2, x28
	bl	_get_res
	mov	x27, x0
	cbnz	w0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x22, _RES_MTT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _RES_MTT@GOTPAGEOFF]
	mov	x0, x26
	bl	_srq_get_mtt_size
	mov	x3, x0
	ldr	x4, [sp, #24]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x28
	bl	_check_mtt_range
	mov	x27, x0
	cbnz	w0, LBB0_5
; %bb.4:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	ldr	x5, [sp, #8]                    ; 8-byte Folded Reload
	bl	_mlx4_DMA_wrapper
	mov	x27, x0
	cbz	w0, LBB0_9
LBB0_5:
	ldr	x8, [sp, #24]
	ldr	w2, [x8]
	ldr	w3, [x22]
	mov	x0, x21
	mov	x1, x20
	bl	_put_res
LBB0_6:
Lloh8:
	adrp	x8, _RES_SRQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RES_SRQ@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x3, x19
	bl	_res_abort_move
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_8:
	mov	x0, x27
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_9:
	ldr	x8, [sp, #24]
	add	x0, x8, #4
	bl	_atomic_inc
	ldp	x9, x8, [sp, #16]
	str	x8, [x9]
	ldr	x8, [sp, #24]
	ldr	w2, [x8]
	ldr	w3, [x22]
	mov	x0, x21
	mov	x1, x20
	bl	_put_res
Lloh14:
	adrp	x8, _RES_SRQ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RES_SRQ@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x3, x19
	bl	_res_end_move
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RES_SRQ_HW,4,2                 ; @RES_SRQ_HW
	.comm	_RES_MTT,4,2                    ; @RES_MTT
	.comm	_RES_SRQ,4,2                    ; @RES_SRQ
.subsections_via_symbols
