	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SW2HW_EQ_wrapper          ## -- Begin function mlx4_SW2HW_EQ_wrapper
	.p2align	4, 0x90
_mlx4_SW2HW_EQ_wrapper:                 ## @mlx4_SW2HW_EQ_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, -88(%rbp)                  ## 8-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rdx, %r15
	movl	%esi, %r12d
	movq	%rdi, %r13
	movl	%esi, %r14d
	shll	$10, %r14d
	orl	(%rdx), %r14d
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %rbx
	movq	%rbx, %rdi
	callq	_eq_get_mtt_addr
	cltd
	idivl	(%r13)
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_eq_get_mtt_size
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_RES_EQ@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	%r12d, %ebx
	movl	%r12d, %esi
	movl	%r14d, %edx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	_add_res_range
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	_RES_EQ_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-104(%rbp), %r8
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_eq_res_start_move_to
	movl	%eax, %r12d
	testl	%eax, %eax
	movq	_RES_EQ@GOTPCREL(%rip), %rax
	jne	LBB0_8
## %bb.2:
	movq	_RES_MTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %r8
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_get_res
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movq	-48(%rbp), %r8
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_check_mtt_range
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	movq	-88(%rbp), %r9                  ## 8-byte Reload
	callq	_mlx4_DMA_wrapper
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	movq	_RES_MTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_put_res
LBB0_7:
	movq	_RES_EQ@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %ecx
	callq	_res_abort_move
	movq	%r13, %rax
LBB0_8:
	movl	(%rax), %r8d
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	_rem_res_range
LBB0_9:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	-48(%rbp), %rdi
	addq	$4, %rdi
	callq	_atomic_inc
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rcx
	movq	%rax, (%rcx)
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	movq	_RES_MTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_put_res
	movq	_RES_EQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %ecx
	callq	_res_end_move
	xorl	%r12d, %r12d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_RES_EQ,4,2                     ## @RES_EQ
	.comm	_RES_EQ_HW,4,2                  ## @RES_EQ_HW
	.comm	_RES_MTT,4,2                    ## @RES_MTT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SW2HW_EQ_wrapper          ; -- Begin function mlx4_SW2HW_EQ_wrapper
	.p2align	2
_mlx4_SW2HW_EQ_wrapper:                 ; @mlx4_SW2HW_EQ_wrapper
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	str	x5, [sp, #40]                   ; 8-byte Folded Spill
	mov	x24, x4
	mov	x25, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w8, [x2]
	orr	w27, w8, w1, lsl #10
	ldr	x26, [x3]
	mov	x0, x26
	bl	_eq_get_mtt_addr
	mov	x22, x0
	ldr	w19, [x21]
	mov	x0, x26
	bl	_eq_get_mtt_size
	mov	x28, x0
Lloh0:
	adrp	x8, _RES_EQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RES_EQ@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x27
	mov	w3, #1
	mov	w5, #0
	bl	_add_res_range
	mov	x26, x0
	cbnz	w0, LBB0_8
; %bb.1:
	stp	x23, x25, [sp, #8]              ; 16-byte Folded Spill
	str	w28, [sp, #36]                  ; 4-byte Folded Spill
	str	x24, [sp, #24]                  ; 8-byte Folded Spill
Lloh3:
	adrp	x8, _RES_EQ_HW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RES_EQ_HW@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x4, sp, #56
	mov	x0, x21
	mov	x1, x20
	mov	x2, x27
	bl	_eq_res_start_move_to
	mov	x26, x0
	cbnz	w0, LBB0_7
; %bb.2:
Lloh6:
	adrp	x23, _RES_MTT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _RES_MTT@GOTPAGEOFF]
	ldr	w3, [x23]
	sdiv	w28, w22, w19
	add	x4, sp, #48
	mov	x0, x21
	mov	x1, x20
	mov	x2, x28
	bl	_get_res
	mov	x26, x0
Lloh8:
	adrp	x22, _RES_EQ@GOTPAGE
Lloh9:
	ldr	x22, [x22, _RES_EQ@GOTPAGEOFF]
	cbnz	w0, LBB0_6
; %bb.3:
	ldr	x4, [sp, #48]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x28
	ldr	w3, [sp, #36]                   ; 4-byte Folded Reload
	bl	_check_mtt_range
	mov	x26, x0
	cbnz	w0, LBB0_5
; %bb.4:
	mov	x0, x21
	mov	x1, x20
	ldp	x2, x3, [sp, #8]                ; 16-byte Folded Reload
	ldr	x4, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x5, [sp, #40]                   ; 8-byte Folded Reload
	bl	_mlx4_DMA_wrapper
	mov	x26, x0
	cbz	w0, LBB0_9
LBB0_5:
	ldr	x8, [sp, #48]
	ldr	w2, [x8]
	ldr	w3, [x23]
	mov	x0, x21
	mov	x1, x20
	bl	_put_res
LBB0_6:
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, x20
	mov	x3, x27
	bl	_res_abort_move
LBB0_7:
Lloh10:
	adrp	x8, _RES_EQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RES_EQ@GOTPAGEOFF]
Lloh12:
	ldr	w4, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x27
	mov	w3, #1
	mov	w5, #0
	bl	_rem_res_range
LBB0_8:
	mov	x0, x26
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_9:
	ldr	x8, [sp, #48]
	add	x0, x8, #4
	bl	_atomic_inc
	ldp	x8, x9, [sp, #48]
	str	x8, [x9]
	ldr	x8, [sp, #48]
	ldr	w2, [x8]
	ldr	w3, [x23]
	mov	x0, x21
	mov	x1, x20
	bl	_put_res
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, x20
	mov	x3, x27
	bl	_res_end_move
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_RES_EQ,4,2                     ; @RES_EQ
	.comm	_RES_EQ_HW,4,2                  ; @RES_EQ_HW
	.comm	_RES_MTT,4,2                    ; @RES_MTT
.subsections_via_symbols
