	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function choose_steering_mode
_choose_steering_mode:                  ## @choose_steering_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_mlx4_log_num_mgm_entry_size@GOTPCREL(%rip), %r15
	cmpl	$-1, (%r15)
	je	LBB0_1
LBB0_6:
	movl	16(%rbx), %eax
	movq	_MLX4_DEV_CAP_FLAG_VEP_UC_STEER@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.7:
	movq	_MLX4_DEV_CAP_FLAG_VEP_MC_STEER@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:
	movq	_MLX4_STEERING_MODE_B0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	jmp	LBB0_12
LBB0_1:
	movq	%rsi, %r14
	movq	_MLX4_DEV_CAP_FLAG2_FS_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_6
## %bb.2:
	movq	%rbx, %rdi
	callq	_mlx4_is_mfunc
	movq	8(%r14), %rdi
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	_num_vfs@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jle	LBB0_6
LBB0_4:
	callq	_choose_log_fs_mgm_entry_size
	movq	_MLX4_MIN_MGM_LOG_ENTRY_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_6
## %bb.5:
	movq	8(%r14), %rdi
	callq	_choose_log_fs_mgm_entry_size
	movl	%eax, (%rbx)
	movq	_MLX4_STEERING_MODE_DEVICE_MANAGED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 20(%rbx)
	movq	8(%r14), %rax
	movq	%rax, 8(%rbx)
	movl	16(%r14), %eax
	movl	%eax, 24(%rbx)
	jmp	LBB0_15
LBB0_10:
	movq	_MLX4_STEERING_MODE_A0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 20(%rbx)
	movq	_MLX4_DEV_CAP_FLAG_VEP_MC_STEER@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_11
	jmp	LBB0_12
LBB0_9:
	movq	_MLX4_STEERING_MODE_A0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
LBB0_11:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mlx4_warn
LBB0_12:
	movl	(%r15), %eax
	testl	%eax, %eax
	jg	LBB0_14
## %bb.13:
	movq	_MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_14:
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_mlx4_get_qp_per_mgm
	movq	%rax, 8(%rbx)
	movl	20(%rbx), %edi
LBB0_15:
	callq	_mlx4_steering_mode_str
	movl	(%rbx), %ecx
	movl	(%r15), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mlx4_dbg                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_mlx4_log_num_mgm_entry_size,4,2 ## @mlx4_log_num_mgm_entry_size
	.comm	_MLX4_DEV_CAP_FLAG2_FS_EN,4,2   ## @MLX4_DEV_CAP_FLAG2_FS_EN
	.comm	_num_vfs,8,3                    ## @num_vfs
	.comm	_MLX4_MIN_MGM_LOG_ENTRY_SIZE,8,3 ## @MLX4_MIN_MGM_LOG_ENTRY_SIZE
	.comm	_MLX4_STEERING_MODE_DEVICE_MANAGED,4,2 ## @MLX4_STEERING_MODE_DEVICE_MANAGED
	.comm	_MLX4_DEV_CAP_FLAG_VEP_UC_STEER,4,2 ## @MLX4_DEV_CAP_FLAG_VEP_UC_STEER
	.comm	_MLX4_DEV_CAP_FLAG_VEP_MC_STEER,4,2 ## @MLX4_DEV_CAP_FLAG_VEP_MC_STEER
	.comm	_MLX4_STEERING_MODE_B0,4,2      ## @MLX4_STEERING_MODE_B0
	.comm	_MLX4_STEERING_MODE_A0,4,2      ## @MLX4_STEERING_MODE_A0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Must have both UC_STEER and MC_STEER flags set to use B0 steering. Falling back to A0 steering mode.\n"

	.comm	_MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE,4,2 ## @MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Steering mode is: %s, oper_log_mgm_entry_size = %d, modparam log_num_mgm_entry_size = %d\n"

	.no_dead_strip	_choose_steering_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function choose_steering_mode
_choose_steering_mode:                  ; @choose_steering_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _mlx4_log_num_mgm_entry_size@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mlx4_log_num_mgm_entry_size@GOTPAGEOFF]
	ldr	w8, [x21]
	cmn	w8, #1
	b.eq	LBB0_4
LBB0_1:
	ldr	w8, [x19, #16]
Lloh2:
	adrp	x9, _MLX4_DEV_CAP_FLAG_VEP_UC_STEER@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MLX4_DEV_CAP_FLAG_VEP_UC_STEER@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.2:
Lloh5:
	adrp	x9, _MLX4_DEV_CAP_FLAG_VEP_MC_STEER@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MLX4_DEV_CAP_FLAG_VEP_MC_STEER@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.3:
Lloh8:
	adrp	x8, _MLX4_STEERING_MODE_B0@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MLX4_STEERING_MODE_B0@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	b	LBB0_12
LBB0_4:
	mov	x20, x1
	ldr	w8, [x1]
Lloh11:
	adrp	x9, _MLX4_DEV_CAP_FLAG2_FS_EN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MLX4_DEV_CAP_FLAG2_FS_EN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.5:
	mov	x0, x19
	bl	_mlx4_is_mfunc
	mov	x8, x0
	ldr	x0, [x20, #8]
	cbz	w8, LBB0_7
; %bb.6:
Lloh14:
	adrp	x8, _num_vfs@GOTPAGE
Lloh15:
	ldr	x8, [x8, _num_vfs@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_1
LBB0_7:
	bl	_choose_log_fs_mgm_entry_size
Lloh17:
	adrp	x8, _MLX4_MIN_MGM_LOG_ENTRY_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MLX4_MIN_MGM_LOG_ENTRY_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x0, x8
	b.lt	LBB0_1
; %bb.8:
	ldr	x0, [x20, #8]
	bl	_choose_log_fs_mgm_entry_size
	str	w0, [x19]
Lloh20:
	adrp	x8, _MLX4_STEERING_MODE_DEVICE_MANAGED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MLX4_STEERING_MODE_DEVICE_MANAGED@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	ldr	x8, [x20, #8]
	str	x8, [x19, #8]
	ldr	w8, [x20, #16]
	stp	w0, w8, [x19, #20]
	b	LBB0_13
LBB0_9:
Lloh23:
	adrp	x9, _MLX4_STEERING_MODE_A0@GOTPAGE
Lloh24:
	ldr	x9, [x9, _MLX4_STEERING_MODE_A0@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	str	w9, [x19, #20]
Lloh26:
	adrp	x9, _MLX4_DEV_CAP_FLAG_VEP_MC_STEER@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MLX4_DEV_CAP_FLAG_VEP_MC_STEER@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_11
	b	LBB0_12
LBB0_10:
Lloh29:
	adrp	x8, _MLX4_STEERING_MODE_A0@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MLX4_STEERING_MODE_A0@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	str	w8, [x19, #20]
LBB0_11:
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mlx4_warn
LBB0_12:
	ldr	w8, [x21]
Lloh34:
	adrp	x9, _MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE@GOTPAGE
Lloh35:
	ldr	x9, [x9, _MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w8, w8, w9, gt
	str	w8, [x19]
	mov	x0, x19
	bl	_mlx4_get_qp_per_mgm
	str	x0, [x19, #8]
	ldr	w0, [x19, #20]
LBB0_13:
	bl	_mlx4_steering_mode_str
	mov	x2, x0
	ldr	w3, [x19]
Lloh37:
	adrp	x1, l_.str.1@PAGE
Lloh38:
	add	x1, x1, l_.str.1@PAGEOFF
	ldr	w4, [x21]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mlx4_dbg
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_mlx4_log_num_mgm_entry_size,4,2 ; @mlx4_log_num_mgm_entry_size
	.comm	_MLX4_DEV_CAP_FLAG2_FS_EN,4,2   ; @MLX4_DEV_CAP_FLAG2_FS_EN
	.comm	_num_vfs,8,3                    ; @num_vfs
	.comm	_MLX4_MIN_MGM_LOG_ENTRY_SIZE,8,3 ; @MLX4_MIN_MGM_LOG_ENTRY_SIZE
	.comm	_MLX4_STEERING_MODE_DEVICE_MANAGED,4,2 ; @MLX4_STEERING_MODE_DEVICE_MANAGED
	.comm	_MLX4_DEV_CAP_FLAG_VEP_UC_STEER,4,2 ; @MLX4_DEV_CAP_FLAG_VEP_UC_STEER
	.comm	_MLX4_DEV_CAP_FLAG_VEP_MC_STEER,4,2 ; @MLX4_DEV_CAP_FLAG_VEP_MC_STEER
	.comm	_MLX4_STEERING_MODE_B0,4,2      ; @MLX4_STEERING_MODE_B0
	.comm	_MLX4_STEERING_MODE_A0,4,2      ; @MLX4_STEERING_MODE_A0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Must have both UC_STEER and MC_STEER flags set to use B0 steering. Falling back to A0 steering mode.\n"

	.comm	_MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE,4,2 ; @MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Steering mode is: %s, oper_log_mgm_entry_size = %d, modparam log_num_mgm_entry_size = %d\n"

	.no_dead_strip	_choose_steering_mode
.subsections_via_symbols
