	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SET_PORT_SCHEDULER        ## -- Begin function mlx4_SET_PORT_SCHEDULER
	.p2align	4, 0x90
_mlx4_SET_PORT_SCHEDULER:               ## @mlx4_SET_PORT_SCHEDULER
	.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	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r14
	callq	_mlx4_alloc_cmd_mailbox
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.9:
	movq	%r15, %rdi
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	_MLX4_NUM_TC@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_8
## %bb.2:
	movq	%r13, %rbx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	$24, %r13d
	xorl	%r15d, %r15d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_MLX4_RATELIMIT_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htons
	movq	%rax, (%r12,%r13)
	movq	_MLX4_RATELIMIT_1G_UNITS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htons
	movq	%rax, -8(%r12,%r13)
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx,%r15,4), %edi
	callq	_htons
	movq	%rax, -16(%r12,%r13)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r15,4), %edi
	callq	_htons
	movq	%rax, -24(%r12,%r13)
	incq	%r15
	movq	_MLX4_NUM_TC@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$32, %r13
	cmpq	%rax, %r15
	jge	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r12
	testq	%r14, %r14
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14,%r15,4), %eax
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movslq	%eax, %rcx
	movq	%r14, %rbx
	imulq	$1717986919, %rcx, %r14         ## imm = 0x66666667
	movq	%r14, %rcx
	shrq	$63, %rcx
	sarq	$34, %r14
	addl	%ecx, %r14d
	movq	_MLX4_MAX_100M_UNITS_VAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	cmovlel	%eax, %r14d
	movq	_MLX4_RATELIMIT_100M_UNITS@GOTPCREL(%rip), %rax
	cmovgq	_MLX4_RATELIMIT_1G_UNITS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htons
	movq	%rax, -8(%r12,%r13)
	movl	%r14d, %edi
	movq	%rbx, %r14
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	callq	_htons
	movq	%rax, (%r12,%r13)
	jmp	LBB0_7
LBB0_8:
	movq	_MLX4_SET_PORT_SCHEDULER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$8, %edx
	orl	-44(%rbp), %edx                 ## 4-byte Folded Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %esi
	movq	_MLX4_CMD_SET_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_MLX4_CMD_TIME_CLASS_B@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_MLX4_CMD_NATIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_mlx4_cmd
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_mlx4_free_cmd_mailbox
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_NUM_TC,4,2                ## @MLX4_NUM_TC
	.comm	_MLX4_MAX_100M_UNITS_VAL,4,2    ## @MLX4_MAX_100M_UNITS_VAL
	.comm	_MLX4_RATELIMIT_100M_UNITS,4,2  ## @MLX4_RATELIMIT_100M_UNITS
	.comm	_MLX4_RATELIMIT_1G_UNITS,4,2    ## @MLX4_RATELIMIT_1G_UNITS
	.comm	_MLX4_RATELIMIT_DEFAULT,4,2     ## @MLX4_RATELIMIT_DEFAULT
	.comm	_MLX4_SET_PORT_SCHEDULER,4,2    ## @MLX4_SET_PORT_SCHEDULER
	.comm	_MLX4_CMD_SET_PORT,4,2          ## @MLX4_CMD_SET_PORT
	.comm	_MLX4_CMD_TIME_CLASS_B,4,2      ## @MLX4_CMD_TIME_CLASS_B
	.comm	_MLX4_CMD_NATIVE,4,2            ## @MLX4_CMD_NATIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SET_PORT_SCHEDULER        ; -- Begin function mlx4_SET_PORT_SCHEDULER
	.p2align	2
_mlx4_SET_PORT_SCHEDULER:               ; @mlx4_SET_PORT_SCHEDULER
	.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	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x21, x1
	mov	x19, x0
	bl	_mlx4_alloc_cmd_mailbox
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	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
	b	_PTR_ERR
LBB0_2:
	str	w21, [sp, #4]                   ; 4-byte Folded Spill
	stp	x19, x20, [sp, #8]              ; 16-byte Folded Spill
Lloh0:
	adrp	x26, _MLX4_NUM_TC@GOTPAGE
Lloh1:
	ldr	x26, [x26, _MLX4_NUM_TC@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x27, #0
	mov	x28, #0
Lloh2:
	adrp	x19, _MLX4_RATELIMIT_1G_UNITS@GOTPAGE
Lloh3:
	ldr	x19, [x19, _MLX4_RATELIMIT_1G_UNITS@GOTPAGEOFF]
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x21, [x8, #8]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
Lloh4:
	adrp	x8, _MLX4_RATELIMIT_DEFAULT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MLX4_RATELIMIT_DEFAULT@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_htons
	add	x25, x20, x27
	str	x0, [x25, #24]
	ldr	w0, [x19]
	bl	_htons
	str	x0, [x25, #16]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	lsl	x25, x28, #2
	ldr	w0, [x23, x25]
	bl	_htons
	add	x20, x20, x27
	str	x0, [x20, #8]
	ldr	w0, [x24, x25]
	bl	_htons
	str	x0, [x20]
	add	x28, x28, #1
	ldrsw	x8, [x26]
	add	x27, x27, #32
	cmp	x28, x8
	b.ge	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x21]
	cbz	x22, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x22, x28, lsl #2]
	cbz	w8, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh7:
	adrp	x9, _MLX4_MAX_100M_UNITS_VAL@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MLX4_MAX_100M_UNITS_VAL@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	smull	x10, w8, w10
	lsr	x11, x10, #63
	asr	x10, x10, #34
	add	w10, w10, w11
	cmp	w8, w9
	csel	w8, w10, w8, gt
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
Lloh10:
	adrp	x8, _MLX4_RATELIMIT_100M_UNITS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MLX4_RATELIMIT_100M_UNITS@GOTPAGEOFF]
	csel	x8, x19, x8, gt
	ldr	w0, [x8]
	bl	_htons
	mov	x25, x22
	mov	x22, x21
	mov	x21, x24
	mov	x24, x23
	mov	x23, x19
	mov	x19, x26
	add	x26, x20, x27
	str	x0, [x26, #16]
	ldr	w0, [sp, #28]                   ; 4-byte Folded Reload
	bl	_htons
	str	x0, [x26, #24]
	mov	x26, x19
	mov	x19, x23
	mov	x23, x24
	mov	x24, x21
	mov	x21, x22
	mov	x22, x25
	b	LBB0_5
LBB0_9:
Lloh12:
	adrp	x8, _MLX4_SET_PORT_SCHEDULER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MLX4_SET_PORT_SCHEDULER@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [sp, #4]                    ; 4-byte Folded Reload
	orr	w2, w9, w8, lsl #8
	ldp	x19, x20, [sp, #8]              ; 16-byte Folded Reload
	ldr	w1, [x20]
Lloh15:
	adrp	x8, _MLX4_CMD_SET_PORT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MLX4_CMD_SET_PORT@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
Lloh18:
	adrp	x8, _MLX4_CMD_TIME_CLASS_B@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MLX4_CMD_TIME_CLASS_B@GOTPAGEOFF]
Lloh20:
	ldr	w5, [x8]
Lloh21:
	adrp	x8, _MLX4_CMD_NATIVE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MLX4_CMD_NATIVE@GOTPAGEOFF]
Lloh23:
	ldr	w6, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_mlx4_cmd
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_mlx4_free_cmd_mailbox
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_NUM_TC,4,2                ; @MLX4_NUM_TC
	.comm	_MLX4_MAX_100M_UNITS_VAL,4,2    ; @MLX4_MAX_100M_UNITS_VAL
	.comm	_MLX4_RATELIMIT_100M_UNITS,4,2  ; @MLX4_RATELIMIT_100M_UNITS
	.comm	_MLX4_RATELIMIT_1G_UNITS,4,2    ; @MLX4_RATELIMIT_1G_UNITS
	.comm	_MLX4_RATELIMIT_DEFAULT,4,2     ; @MLX4_RATELIMIT_DEFAULT
	.comm	_MLX4_SET_PORT_SCHEDULER,4,2    ; @MLX4_SET_PORT_SCHEDULER
	.comm	_MLX4_CMD_SET_PORT,4,2          ; @MLX4_CMD_SET_PORT
	.comm	_MLX4_CMD_TIME_CLASS_B,4,2      ; @MLX4_CMD_TIME_CLASS_B
	.comm	_MLX4_CMD_NATIVE,4,2            ; @MLX4_CMD_NATIVE
.subsections_via_symbols
