	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_devlink_eswitch_encap_mode_set ## -- Begin function mlx5_devlink_eswitch_encap_mode_set
	.p2align	4, 0x90
_mlx5_devlink_eswitch_encap_mode_set:   ## @mlx5_devlink_eswitch_encap_mode_set
	.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	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %rbx
	callq	_devlink_priv
	movq	%rax, %r13
	movq	(%rax), %r15
	movq	%rbx, %rdi
	callq	_mlx5_devlink_eswitch_check
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.1:
	movq	_DEVLINK_ESWITCH_ENCAP_MODE_NONE@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_5
## %bb.2:
	movq	_reformat@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_MLX5_CAP_ESW_FLOWTABLE_FDB
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	_decap@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_MLX5_CAP_ESW_FLOWTABLE_FDB
	testl	%eax, %eax
	je	LBB0_4
LBB0_5:
	testl	%r12d, %r12d
	je	LBB0_7
## %bb.6:
	movq	_DEVLINK_ESWITCH_ENCAP_MODE_BASIC@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_7
LBB0_4:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	(%r15), %rax
	movq	_MLX5_ESWITCH_LEGACY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	movl	%r12d, 12(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_9:
	xorl	%ebx, %ebx
	cmpl	%r12d, 12(%r15)
	je	LBB0_14
## %bb.10:
	leaq	16(%r15), %rdi
	callq	_atomic64_read
	testq	%rax, %rax
	jle	LBB0_12
## %bb.11:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_NL_SET_ERR_MSG_MOD
	jmp	LBB0_4
LBB0_12:
	movq	%r15, %rdi
	callq	_esw_destroy_offloads_fdb_tables
	movl	%r12d, 12(%r15)
	movl	8(%r15), %esi
	movq	%r15, %rdi
	callq	_esw_create_offloads_fdb_tables
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r13d
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	sete	%bl
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_NL_SET_ERR_MSG_MOD
	movl	%ebx, 12(%r15)
	movl	8(%r15), %esi
	movq	%r15, %rdi
	callq	_esw_create_offloads_fdb_tables
	movl	%r13d, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_DEVLINK_ESWITCH_ENCAP_MODE_NONE,4,2 ## @DEVLINK_ESWITCH_ENCAP_MODE_NONE
	.comm	_reformat,4,2                   ## @reformat
	.comm	_decap,4,2                      ## @decap
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_DEVLINK_ESWITCH_ENCAP_MODE_BASIC,4,2 ## @DEVLINK_ESWITCH_ENCAP_MODE_BASIC
	.comm	_MLX5_ESWITCH_LEGACY,8,3        ## @MLX5_ESWITCH_LEGACY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't set encapsulation when flows are configured"

L_.str.1:                               ## @.str.1
	.asciz	"Failed re-creating fast FDB table"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_devlink_eswitch_encap_mode_set ; -- Begin function mlx5_devlink_eswitch_encap_mode_set
	.p2align	2
_mlx5_devlink_eswitch_encap_mode_set:   ; @mlx5_devlink_eswitch_encap_mode_set
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
	bl	_devlink_priv
	mov	x23, x0
	ldr	x20, [x0]
	mov	x0, x22
	bl	_mlx5_devlink_eswitch_check
	mov	x22, x0
	cbnz	w0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _DEVLINK_ESWITCH_ENCAP_MODE_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEVLINK_ESWITCH_ENCAP_MODE_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _reformat@GOTPAGE
Lloh4:
	ldr	x8, [x8, _reformat@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_MLX5_CAP_ESW_FLOWTABLE_FDB
	cbz	w0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x8, _decap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _decap@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_MLX5_CAP_ESW_FLOWTABLE_FDB
	cbz	w0, LBB0_6
LBB0_4:
	cbz	w21, LBB0_8
; %bb.5:
Lloh9:
	adrp	x8, _DEVLINK_ESWITCH_ENCAP_MODE_BASIC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEVLINK_ESWITCH_ENCAP_MODE_BASIC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_8
LBB0_6:
Lloh12:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	x8, [x20]
Lloh15:
	adrp	x9, _MLX5_ESWITCH_LEGACY@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MLX5_ESWITCH_LEGACY@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
	mov	w22, #0
	str	w21, [x20, #12]
	b	LBB0_7
LBB0_10:
	ldr	w8, [x20, #12]
	cmp	w8, w21
	b.ne	LBB0_12
; %bb.11:
	mov	w22, #0
	b	LBB0_7
LBB0_12:
	add	x0, x20, #16
	bl	_atomic64_read
	cmp	x0, #1
	b.lt	LBB0_14
; %bb.13:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_NL_SET_ERR_MSG_MOD
	b	LBB0_6
LBB0_14:
	mov	x0, x20
	bl	_esw_destroy_offloads_fdb_tables
	str	w21, [x20, #12]
	ldr	w1, [x20, #8]
	mov	x0, x20
	bl	_esw_create_offloads_fdb_tables
	mov	x22, x0
	cbz	w0, LBB0_7
; %bb.15:
	cmp	w21, #0
	cset	w21, eq
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_NL_SET_ERR_MSG_MOD
	str	w21, [x20, #12]
	ldr	w1, [x20, #8]
	mov	x0, x20
	bl	_esw_create_offloads_fdb_tables
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_DEVLINK_ESWITCH_ENCAP_MODE_NONE,4,2 ; @DEVLINK_ESWITCH_ENCAP_MODE_NONE
	.comm	_reformat,4,2                   ; @reformat
	.comm	_decap,4,2                      ; @decap
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_DEVLINK_ESWITCH_ENCAP_MODE_BASIC,4,2 ; @DEVLINK_ESWITCH_ENCAP_MODE_BASIC
	.comm	_MLX5_ESWITCH_LEGACY,8,3        ; @MLX5_ESWITCH_LEGACY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't set encapsulation when flows are configured"

l_.str.1:                               ; @.str.1
	.asciz	"Failed re-creating fast FDB table"

.subsections_via_symbols
