	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___mlx4_replace_mac             ## -- Begin function __mlx4_replace_mac
	.p2align	4, 0x90
___mlx4_replace_mac:                    ## @__mlx4_replace_mac
	.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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_mlx4_priv
	movq	(%rax), %rax
	leaq	(%r12,%r12,2), %rcx
	leaq	(%rax,%rcx,8), %r14
	addq	$8, %r14
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movslq	(%rax,%rcx,8), %rax
	movslq	%ebx, %rcx
	subq	%rax, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_mlx4_is_mf_bonded
	movl	%eax, %ebx
	xorl	%r13d, %r13d
	cmpq	$1, %r12
	sete	%r13b
	incq	%r13
	movq	%r15, %rdi
	callq	_mlx4_priv
	movq	(%rax), %rcx
	leaq	(,%r13,2), %rdx
	addq	%r13, %rdx
	leaq	(%rcx,%rdx,8), %rax
	addq	$8, %rax
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.1:
	cmpq	$1, %r12
	jne	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	movq	%rax, %rbx
	callq	_mutex_lock
	movq	_SINGLE_DEPTH_NESTING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	jmp	LBB0_5
LBB0_3:
	movq	%r14, %rdi
	callq	_mutex_lock
	jmp	LBB0_6
LBB0_4:
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	_SINGLE_DEPTH_NESTING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
LBB0_5:
	callq	_mutex_lock_nested
LBB0_6:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_validate_index
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_14
	jmp	LBB0_10
LBB0_8:
	movq	_MLX4_MAC_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	%ebx, %edi
	callq	_cpu_to_be64
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	16(%r12,%rbx,8), %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rcx,%rdx,8)
	movq	16(%r12,%rbx,8), %rdx
	movq	%r15, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_mlx4_set_port_mac_table
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	leaq	(%r12,%rbx,8), %r12
	addq	$16, %r12
	movslq	-44(%rbp), %rdx                 ## 4-byte Folded Reload
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_mlx4_err
	movq	(%r12), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	$0, (%rax,%rcx,8)
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_14
	jmp	LBB0_10
LBB0_11:
	movq	_MLX4_MAC_VALID@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.12:
	movl	(%rax), %edi
	movl	%ebx, %r12d
	orl	%ebx, %edi
	callq	_cpu_to_be64
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rsi,%rbx,8), %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rcx,%rdx,8)
	movq	16(%rsi,%rbx,8), %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mlx4_set_port_mac_table
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movl	%r12d, %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rbx,8), %r12
	addq	$16, %r12
	movslq	%eax, %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_mlx4_err
	movq	(%r12), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	$0, (%rax,%rcx,8)
LBB0_14:
	cmpq	$2, -88(%rbp)                   ## 8-byte Folded Reload
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	%rax, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmoveq	%rbx, %rdi
	cmoveq	%rax, %rbx
	callq	_mutex_unlock
	jmp	LBB0_15
LBB0_10:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_15:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SINGLE_DEPTH_NESTING,4,2       ## @SINGLE_DEPTH_NESTING
	.comm	_MLX4_MAC_VALID,4,2             ## @MLX4_MAC_VALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed adding MAC: 0x%llx\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed adding duplicate MAC: 0x%llx\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___mlx4_replace_mac             ; -- Begin function __mlx4_replace_mac
	.p2align	2
___mlx4_replace_mac:                    ; @__mlx4_replace_mac
	.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
	str	x3, [sp, #24]                   ; 8-byte Folded Spill
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	bl	_mlx4_priv
	ldr	x23, [x0]
	mov	w26, #24
	madd	x19, x20, x26, x23
	ldr	w8, [x19], #8
	sub	w27, w21, w8
	mov	x0, x22
	bl	_mlx4_is_mf_bonded
	mov	x24, x0
	cmp	x20, #1
	mov	w8, #1
	cinc	x25, x8, eq
	mov	x0, x22
	bl	_mlx4_priv
	ldr	x28, [x0]
	madd	x8, x25, x26, x28
	add	x21, x8, #8
	cbz	w24, LBB0_3
; %bb.1:
	cmp	x20, #1
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x8, _SINGLE_DEPTH_NESTING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SINGLE_DEPTH_NESTING@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_mutex_lock
	b	LBB0_6
LBB0_4:
	mov	x0, x21
	bl	_mutex_lock
Lloh3:
	adrp	x8, _SINGLE_DEPTH_NESTING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SINGLE_DEPTH_NESTING@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
LBB0_5:
	bl	_mutex_lock_nested
LBB0_6:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x27
	bl	_validate_index
	mov	x26, x0
	cbz	w0, LBB0_8
; %bb.7:
	cbnz	w24, LBB0_14
	b	LBB0_15
LBB0_8:
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
Lloh6:
	adrp	x8, _MLX4_MAC_VALID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX4_MAC_VALID@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	x21, [sp, #24]                  ; 8-byte Folded Reload
	orr	w0, w8, w21
	bl	_cpu_to_be64
	mov	w8, #24
	madd	x23, x20, x8, x23
	ldr	x8, [x23, #16]!
	sxtw	x9, w27
	str	x9, [sp, #16]                   ; 8-byte Folded Spill
	str	x0, [x8, w27, sxtw #3]
	ldr	x2, [x23]
	mov	x0, x22
	mov	x1, x20
	bl	_mlx4_set_port_mac_table
	mov	x26, x0
	bl	_unlikely
	cbz	x0, LBB0_10
; %bb.9:
	sxtw	x2, w21
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_mlx4_err
	ldr	x8, [x23]
	ldp	x21, x9, [sp, #8]               ; 16-byte Folded Reload
	str	xzr, [x8, x9, lsl #3]
	cbnz	w24, LBB0_14
	b	LBB0_15
LBB0_10:
Lloh11:
	adrp	x8, _MLX4_MAC_VALID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MLX4_MAC_VALID@GOTPAGEOFF]
	ldr	x27, [sp, #16]                  ; 8-byte Folded Reload
	cbz	w24, LBB0_15
; %bb.11:
	ldr	w8, [x8]
	ldr	x21, [sp, #24]                  ; 8-byte Folded Reload
	orr	w0, w8, w21
	bl	_cpu_to_be64
	mov	w8, #24
	madd	x23, x25, x8, x28
	ldr	x8, [x23, #16]!
	mov	x24, x27
	str	x0, [x8, x27, lsl #3]
	ldr	x2, [x23]
	mov	x0, x22
	mov	x1, x25
	bl	_mlx4_set_port_mac_table
	mov	x26, x0
	bl	_unlikely
	cbz	x0, LBB0_13
; %bb.12:
	mov	x8, x21
	sxtw	x2, w8
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_mlx4_err
	ldr	x8, [x23]
	str	xzr, [x8, x24, lsl #3]
LBB0_13:
	ldr	x21, [sp, #8]                   ; 8-byte Folded Reload
LBB0_14:
	cmp	x20, #2
	csel	x0, x19, x21, eq
	csel	x19, x21, x19, eq
	bl	_mutex_unlock
LBB0_15:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x26
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SINGLE_DEPTH_NESTING,4,2       ; @SINGLE_DEPTH_NESTING
	.comm	_MLX4_MAC_VALID,4,2             ; @MLX4_MAC_VALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed adding MAC: 0x%llx\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed adding duplicate MAC: 0x%llx\n"

.subsections_via_symbols
