	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_resize
_handle_resize:                         ## @handle_resize
	.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, %r13
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	16(%rbp), %r12
	movq	(%rcx), %r15
	movq	%r15, %rdi
	callq	_cq_get_mtt_addr
	cltd
	idivl	(%rbx)
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	(%r12), %rax
	movl	(%rax), %edx
	movq	_RES_MTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-64(%rbp), %r8
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_get_res
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	_RES_MTT@GOTPCREL(%rip), %r13
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	-64(%rbp), %rax
	movq	16(%rbp), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	%r13, %r14
	jmp	LBB0_8
LBB0_3:
	movq	%r13, %r14
	movl	(%r13), %ecx
	leaq	-56(%rbp), %r8
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%edx, %r13d
	callq	_get_res
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movq	%r15, %rdi
	callq	_cq_get_mtt_size
	movq	-56(%rbp), %r8
	movq	%rbx, %rdi
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_check_mtt_range
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movq	-80(%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, %r12d
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movq	-56(%rbp), %rax
	movl	(%rax), %edx
	movl	(%r14), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_put_res
LBB0_8:
	movq	-64(%rbp), %rax
	movl	-44(%rbp), %r15d                ## 4-byte Reload
LBB0_9:
	movl	(%rax), %edx
	movl	(%r14), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_put_res
LBB0_10:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	-64(%rbp), %rdi
	addq	$4, %rdi
	callq	_atomic_dec
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movl	(%r14), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_put_res
	movq	-56(%rbp), %rdi
	addq	$4, %rdi
	callq	_atomic_inc
	movq	-56(%rbp), %rax
	movq	16(%rbp), %rcx
	movq	%rax, (%rcx)
	xorl	%r12d, %r12d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_RES_MTT,4,2                    ## @RES_MTT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_handle_resize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_resize
_handle_resize:                         ; @handle_resize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x24, x6
	stp	x4, x5, [sp, #16]               ; 16-byte Folded Spill
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x28, x0
	ldr	x27, [x3]
	mov	x0, x27
	bl	_cq_get_mtt_addr
	mov	x25, x0
	ldr	w19, [x28]
	ldr	x8, [x24]
	ldr	w2, [x8]
Lloh0:
	adrp	x23, _RES_MTT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _RES_MTT@GOTPAGEOFF]
	ldr	w3, [x23]
	add	x4, sp, #40
	mov	x0, x28
	mov	x1, x21
	bl	_get_res
	mov	x26, x0
	cbnz	w0, LBB0_9
; %bb.1:
	stp	x22, x20, [sp]                  ; 16-byte Folded Spill
	mov	x10, x28
	ldr	x8, [sp, #40]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w26, w8
	mov	x20, x10
	b	LBB0_7
LBB0_3:
	ldr	w3, [x23]
	sdiv	w28, w25, w19
	add	x4, sp, #32
	mov	x20, x10
	mov	x0, x10
	mov	x1, x21
	mov	x2, x28
	bl	_get_res
	mov	x26, x0
	cbnz	w0, LBB0_7
; %bb.4:
	mov	x0, x27
	bl	_cq_get_mtt_size
	mov	x3, x0
	ldr	x4, [sp, #32]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x28
	bl	_check_mtt_range
	mov	x26, x0
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	x1, x21
	ldp	x2, x3, [sp]                    ; 16-byte Folded Reload
	ldp	x4, x5, [sp, #16]               ; 16-byte Folded Reload
	bl	_mlx4_DMA_wrapper
	mov	x26, x0
	cbz	w0, LBB0_10
LBB0_6:
	ldr	x8, [sp, #32]
	ldr	w2, [x8]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x21
	bl	_put_res
LBB0_7:
	ldr	x8, [sp, #40]
LBB0_8:
	ldr	w2, [x8]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x21
	bl	_put_res
LBB0_9:
	mov	x0, x26
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_10:
	ldr	x8, [sp, #40]
	add	x0, x8, #4
	bl	_atomic_dec
	ldr	x8, [sp, #40]
	ldr	w2, [x8]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x21
	bl	_put_res
	ldr	x8, [sp, #32]
	add	x0, x8, #4
	bl	_atomic_inc
	ldr	x8, [sp, #32]
	str	x8, [x24]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RES_MTT,4,2                    ; @RES_MTT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_handle_resize
.subsections_via_symbols
