	.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	$40, %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, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_mlx4_priv
	movq	(%rax), %rax
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	leaq	(%r14,%r14,2), %r14
	leaq	(%rax,%r14,8), %r13
	addq	$8, %r13
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	(%rax,%r14,8), %rax
	movslq	%r15d, %r12
	subq	%rax, %r12
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r13, %rbx
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_validate_index
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	_MLX4_MAC_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	orl	%r13d, %edi
	callq	_cpu_to_be64
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%rcx,%r14,8), %rdx
	movq	%rax, (%rdx,%r12,8)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_mlx4_set_port_mac_table
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,8), %r14
	addq	$16, %r14
	movslq	%r13d, %rdx
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx4_err
	movq	(%r14), %rax
	movq	$0, (%rax,%r12,8)
LBB0_3:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_MAC_VALID,4,2             ## @MLX4_MAC_VALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed adding 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:
	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
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	bl	_mlx4_priv
	ldr	x25, [x0]
	mov	w8, #24
	madd	x19, x22, x8, x25
	ldr	w8, [x19], #8
	sub	w23, w23, w8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	bl	_validate_index
	mov	x24, x0
	cbnz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _MLX4_MAC_VALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX4_MAC_VALID@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w0, w8, w21
	bl	_cpu_to_be64
	mov	w8, #24
	madd	x25, x22, x8, x25
	ldr	x2, [x25, #16]!
	str	x0, [x2, w23, sxtw #3]
	mov	x0, x20
	mov	x1, x22
	bl	_mlx4_set_port_mac_table
	mov	x24, x0
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.2:
	sxtw	x22, w23
	sxtw	x2, w21
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_mlx4_err
	ldr	x8, [x25]
	str	xzr, [x8, x22, lsl #3]
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x24
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_MAC_VALID,4,2             ; @MLX4_MAC_VALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed adding MAC: 0x%llx\n"

.subsections_via_symbols
