	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_kernel_sq_size
_set_kernel_sq_size:                    ## @set_kernel_sq_size
	.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	%rcx, %r13
	movl	%edx, %r12d
	movq	(%rdi), %rax
	movl	(%rax), %ecx
	movq	_MLX4_IB_SQ_MAX_SPARE@GOTPCREL(%rip), %rdx
	subl	(%rdx), %ecx
	cmpl	%ecx, (%rsi)
	jg	LBB0_3
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	4(%rsi), %ebx
	movl	4(%rax), %edi
	movl	8(%rax), %esi
	callq	_min
	cmpl	%eax, %ebx
	jg	LBB0_3
## %bb.2:
	movslq	8(%r14), %rbx
	movl	44(%r13), %esi
	movl	%r12d, %edi
	callq	_send_wqe_overhead
	cltq
	leaq	(%rax,%rbx), %rcx
	addq	$4, %rcx
	movq	(%r15), %rax
	movslq	12(%rax), %rdx
	cmpq	%rdx, %rcx
	ja	LBB0_3
## %bb.4:
	movq	_MLX4_IB_QPT_SMI@GOTPCREL(%rip), %rdx
	movq	_MLX4_IB_QPT_GSI@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rdx)
	je	LBB0_8
## %bb.5:
	cmpl	%r12d, (%rcx)
	je	LBB0_8
## %bb.6:
	movq	_MLX4_IB_QPT_PROXY_SMI_OWNER@GOTPCREL(%rip), %rcx
	movq	_MLX4_IB_QPT_TUN_SMI_OWNER@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%r12d, %edx
	je	LBB0_7
LBB0_8:
	movl	4(%r14), %edi
	leal	2(%rdi), %ecx
	cmpl	4(%rax), %ecx
	jle	LBB0_9
	jmp	LBB0_3
LBB0_7:
	movl	4(%r14), %edi
LBB0_9:
	shll	$2, %edi
	movl	8(%r14), %esi
	addl	$4, %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_max
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	44(%r13), %esi
	movl	%r12d, %edi
	callq	_send_wqe_overhead
	movl	%eax, %ebx
	addl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	(%r15), %rax
	cmpl	12(%rax), %ebx
	jle	LBB0_10
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	16(%rax), %rax
	movq	_MLX4_FW_VER_WQE_CTRL_NEC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_17
## %bb.11:
	cmpq	$0, 48(%r13)
	je	LBB0_17
## %bb.12:
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rax
	cmpl	$64, (%rax)
	jne	LBB0_17
## %bb.13:
	movq	_MLX4_IB_QPT_SMI@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_17
## %bb.14:
	movq	_MLX4_IB_QPT_GSI@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_17
## %bb.15:
	movq	_MLX4_IB_QPT_PROXY_SMI_OWNER@GOTPCREL(%rip), %rax
	movq	_MLX4_IB_QPT_PROXY_SMI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_MLX4_IB_QPT_PROXY_GSI@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_MLX4_IB_QPT_TUN_SMI_OWNER@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	testl	%r12d, %ecx
	je	LBB0_16
LBB0_17:
	movl	%ebx, %edi
	callq	_roundup_pow_of_two
	movl	%eax, %edi
LBB0_18:
	callq	_ilog2
	movq	%rax, %rcx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	%ecx, 12(%r13)
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $rcx
	shll	%cl, %esi
	movl	%ebx, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, (%r13)
	movzbl	12(%r13), %ecx
	movl	$2048, %edi                     ## imm = 0x800
	shrl	%cl, %edi
	addl	%eax, %edi
	movl	%edi, 4(%r13)
	imull	(%r14), %eax
	addl	%eax, %edi
	callq	_roundup_pow_of_two
	movl	%eax, 16(%r13)
	movq	(%r15), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpl	$1, (%r13)
	jle	LBB0_3
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	12(%r13), %ecx
	incl	%ecx
	jmp	LBB0_19
LBB0_22:
	movl	12(%rcx), %edi
	movl	(%r13), %esi
	movb	12(%r13), %cl
	shll	%cl, %esi
	callq	_min
	movl	%eax, %ebx
	movl	44(%r13), %esi
	movl	%r12d, %edi
	callq	_send_wqe_overhead
	subl	%eax, %ebx
	sarl	$2, %ebx
	movl	%ebx, 20(%r13)
	movl	%ebx, %r12d
	movl	32(%r13), %esi
	movl	36(%r13), %edx
	movl	%edx, %ecx
	shll	%cl, %esi
	movl	12(%r13), %ecx
	movl	16(%r13), %eax
	movl	%eax, %edi
	shll	%cl, %edi
	xorl	%ebx, %ebx
	cmpl	%ecx, %edx
	leal	(%rdi,%rsi), %ecx
	cmoval	%ebx, %edi
	movl	%ecx, 8(%r13)
	cmovbel	%ebx, %esi
	movl	%edi, 40(%r13)
	movl	%esi, 24(%r13)
	subl	4(%r13), %eax
	cltd
	idivl	(%r13)
	movl	%eax, 28(%r13)
	movl	%eax, (%r14)
	movq	(%r15), %rax
	movl	4(%rax), %edi
	movl	8(%rax), %esi
	callq	_min
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_min
	movl	%eax, 4(%r14)
	movl	$0, 8(%r14)
	jmp	LBB0_23
LBB0_16:
	movl	$64, %edi
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_IB_SQ_MAX_SPARE,4,2       ## @MLX4_IB_SQ_MAX_SPARE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX4_IB_QPT_SMI,4,2            ## @MLX4_IB_QPT_SMI
	.comm	_MLX4_IB_QPT_GSI,4,2            ## @MLX4_IB_QPT_GSI
	.comm	_MLX4_IB_QPT_PROXY_SMI_OWNER,4,2 ## @MLX4_IB_QPT_PROXY_SMI_OWNER
	.comm	_MLX4_IB_QPT_TUN_SMI_OWNER,4,2  ## @MLX4_IB_QPT_TUN_SMI_OWNER
	.comm	_MLX4_FW_VER_WQE_CTRL_NEC,8,3   ## @MLX4_FW_VER_WQE_CTRL_NEC
	.comm	_BITS_PER_LONG,4,2              ## @BITS_PER_LONG
	.comm	_MLX4_IB_QPT_PROXY_SMI,4,2      ## @MLX4_IB_QPT_PROXY_SMI
	.comm	_MLX4_IB_QPT_PROXY_GSI,4,2      ## @MLX4_IB_QPT_PROXY_GSI
	.no_dead_strip	_set_kernel_sq_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_kernel_sq_size
_set_kernel_sq_size:                    ; @set_kernel_sq_size
	.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
	ldr	w9, [x1]
	ldr	x8, [x0]
	ldr	w10, [x8]
Lloh0:
	adrp	x11, _MLX4_IB_SQ_MAX_SPARE@GOTPAGE
Lloh1:
	ldr	x11, [x11, _MLX4_IB_SQ_MAX_SPARE@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	sub	w10, w10, w11
	cmp	w9, w10
	b.gt	LBB0_8
; %bb.1:
	mov	x20, x3
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
	ldr	w23, [x1, #4]
	ldp	w0, w1, [x8, #4]
	bl	_min
	cmp	w23, w0
	b.gt	LBB0_8
; %bb.2:
	ldrsw	x23, [x19, #8]
	ldr	w1, [x20, #44]
	mov	x0, x22
	bl	_send_wqe_overhead
	add	x8, x23, w0, sxtw
	add	x9, x8, #4
	ldr	x8, [x21]
	ldrsw	x10, [x8, #12]
	cmp	x9, x10
	b.hi	LBB0_8
; %bb.3:
Lloh3:
	adrp	x25, _MLX4_IB_QPT_SMI@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MLX4_IB_QPT_SMI@GOTPAGEOFF]
	ldr	w9, [x25]
Lloh5:
	adrp	x24, _MLX4_IB_QPT_GSI@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MLX4_IB_QPT_GSI@GOTPAGEOFF]
	ldr	w10, [x24]
	cmp	w9, w22
	ccmp	w10, w22, #4, ne
	b.eq	LBB0_5
; %bb.4:
Lloh7:
	adrp	x9, _MLX4_IB_QPT_PROXY_SMI_OWNER@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MLX4_IB_QPT_PROXY_SMI_OWNER@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _MLX4_IB_QPT_TUN_SMI_OWNER@GOTPAGE
Lloh11:
	ldr	x10, [x10, _MLX4_IB_QPT_TUN_SMI_OWNER@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w22
	b.eq	LBB0_6
LBB0_5:
	ldr	w9, [x19, #4]
	add	w10, w9, #2
	ldr	w8, [x8, #4]
	cmp	w10, w8
	b.le	LBB0_7
	b	LBB0_8
LBB0_6:
	ldr	w9, [x19, #4]
LBB0_7:
	lsl	w0, w9, #2
	ldr	w8, [x19, #8]
	add	w1, w8, #4
	bl	_max
	mov	x23, x0
	ldr	w1, [x20, #44]
	mov	x0, x22
	bl	_send_wqe_overhead
	ldr	x8, [x21]
	ldr	w9, [x8, #12]
	add	w23, w0, w23
	cmp	w23, w9
	b.le	LBB0_10
LBB0_8:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
LBB0_10:
	ldr	x8, [x8, #16]
Lloh16:
	adrp	x9, _MLX4_FW_VER_WQE_CTRL_NEC@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MLX4_FW_VER_WQE_CTRL_NEC@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_16
; %bb.11:
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_16
; %bb.12:
Lloh19:
	adrp	x8, _BITS_PER_LONG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BITS_PER_LONG@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w8, #64
	b.ne	LBB0_16
; %bb.13:
	ldr	w8, [x25]
	cmp	w8, w22
	b.eq	LBB0_16
; %bb.14:
	ldr	w8, [x24]
	cmp	w8, w22
	b.eq	LBB0_16
; %bb.15:
Lloh22:
	adrp	x8, _MLX4_IB_QPT_PROXY_SMI_OWNER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MLX4_IB_QPT_PROXY_SMI_OWNER@GOTPAGEOFF]
Lloh24:
	adrp	x9, _MLX4_IB_QPT_PROXY_SMI@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MLX4_IB_QPT_PROXY_SMI@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh28:
	adrp	x9, _MLX4_IB_QPT_PROXY_GSI@GOTPAGE
Lloh29:
	ldr	x9, [x9, _MLX4_IB_QPT_PROXY_GSI@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh31:
	adrp	x9, _MLX4_IB_QPT_TUN_SMI_OWNER@GOTPAGE
Lloh32:
	ldr	x9, [x9, _MLX4_IB_QPT_TUN_SMI_OWNER@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w8, w8, w9
	tst	w8, w22
	b.eq	LBB0_22
LBB0_16:
	mov	x0, x23
	bl	_roundup_pow_of_two
LBB0_17:
	bl	_ilog2
	str	w0, [x20, #12]
	mov	w24, #1
	mov	w25, #2048
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	lsl	w1, w24, w0
	mov	x0, x23
	bl	_DIV_ROUND_UP
	ldr	w8, [x20, #12]
	lsr	w8, w25, w8
	add	w8, w8, w0
	stp	w0, w8, [x20]
	ldr	w9, [x19]
	madd	w0, w9, w0, w8
	bl	_roundup_pow_of_two
	str	w0, [x20, #16]
	ldr	x8, [x21]
	ldr	w9, [x8]
	cmp	w0, w9
	b.le	LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x20]
	cmp	w8, #1
	b.le	LBB0_8
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x20, #12]
	add	w0, w8, #1
	str	w0, [x20, #12]
	b	LBB0_18
LBB0_21:
	ldr	w0, [x8, #12]
	ldr	w8, [x20]
	ldr	w9, [x20, #12]
	lsl	w1, w8, w9
	bl	_min
	mov	x23, x0
	ldr	w1, [x20, #44]
	mov	x0, x22
	bl	_send_wqe_overhead
	sub	w8, w23, w0
	asr	w22, w8, #2
	ldp	w8, w9, [x20, #32]
	lsl	w8, w8, w9
	ldp	w11, w10, [x20, #12]
	lsl	w12, w10, w11
	add	w13, w12, w8
	str	w13, [x20, #8]
	cmp	w9, w11
	csel	w9, wzr, w12, hi
	csel	w8, w8, wzr, hi
	str	w9, [x20, #40]
	stp	w22, w8, [x20, #20]
	ldp	w9, w8, [x20]
	sub	w8, w10, w8
	sdiv	w8, w8, w9
	str	w8, [x20, #28]
	str	w8, [x19]
	ldr	x8, [x21]
	ldp	w0, w1, [x8, #4]
	bl	_min
	mov	x1, x0
	mov	x0, x22
	bl	_min
	mov	x8, x0
	mov	w0, #0
	stp	w8, wzr, [x19, #4]
	b	LBB0_9
LBB0_22:
	mov	w0, #64
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_IB_SQ_MAX_SPARE,4,2       ; @MLX4_IB_SQ_MAX_SPARE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX4_IB_QPT_SMI,4,2            ; @MLX4_IB_QPT_SMI
	.comm	_MLX4_IB_QPT_GSI,4,2            ; @MLX4_IB_QPT_GSI
	.comm	_MLX4_IB_QPT_PROXY_SMI_OWNER,4,2 ; @MLX4_IB_QPT_PROXY_SMI_OWNER
	.comm	_MLX4_IB_QPT_TUN_SMI_OWNER,4,2  ; @MLX4_IB_QPT_TUN_SMI_OWNER
	.comm	_MLX4_FW_VER_WQE_CTRL_NEC,8,3   ; @MLX4_FW_VER_WQE_CTRL_NEC
	.comm	_BITS_PER_LONG,4,2              ; @BITS_PER_LONG
	.comm	_MLX4_IB_QPT_PROXY_SMI,4,2      ; @MLX4_IB_QPT_PROXY_SMI
	.comm	_MLX4_IB_QPT_PROXY_GSI,4,2      ; @MLX4_IB_QPT_PROXY_GSI
	.no_dead_strip	_set_kernel_sq_size
.subsections_via_symbols
