	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___mlx4_register_mac            ## -- Begin function __mlx4_register_mac
	.p2align	4, 0x90
___mlx4_register_mac:                   ## @__mlx4_register_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_mlx4_priv
	movq	(%rax), %r13
	leaq	(%rbx,%rbx,4), %r12
	leaq	(,%r12,8), %rax
	addq	%r13, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	%r15d, %edx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_mlx4_dbg
	leaq	24(,%r12,8), %r15
	addq	%r13, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_MLX4_MAX_MAC_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.2:
	leaq	32(,%r12,8), %r12
	addq	%r13, %r12
	movl	$-1, %ebx
	xorl	%r14d, %r14d
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %ebx
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rcx
	movq	(%rcx,%r14,8), %rdi
	testl	%ebx, %ebx
	jns	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rdi, %rdi
	je	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_MLX4_MAC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	callq	_be64_to_cpu
	andl	%r15d, %eax
	cmpl	%r13d, %eax
	je	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_MLX4_MAX_MAC_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_8
LBB0_1:
	movl	$-1, %ebx
	movl	-44(%rbp), %r13d                ## 4-byte Reload
LBB0_9:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_mlx4_dbg
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r12,%r15,8), %rax
	cmpq	16(%r12,%r15,8), %rax
	jne	LBB0_11
## %bb.10:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movl	%r14d, %ebx
	jmp	LBB0_14
LBB0_11:
	movq	_MLX4_MAC_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	%r13d, %edi
	callq	_cpu_to_be64
	movq	32(%r12,%r15,8), %rdx
	movslq	%ebx, %r14
	movq	%rax, (%rdx,%r14,8)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_mlx4_set_port_mac_table
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movslq	%r13d, %rdx
	leaq	(%r12,%r15,8), %rbx
	addq	$32, %rbx
	leaq	L_.str.2(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx4_err
	movq	(%rbx), %rax
	movq	$0, (%rax,%r14,8)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_14
LBB0_15:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	incl	(%rax,%r14,4)
	movl	%r14d, %ebx
	jmp	LBB0_14
LBB0_13:
	leaq	(%r12,%r15,8), %rax
	addq	$8, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	$1, (%rcx,%r14,4)
	incq	(%rax)
LBB0_14:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Registering MAC: 0x%llx for port %d\n"

	.comm	_MLX4_MAX_MAC_NUM,4,2           ## @MLX4_MAX_MAC_NUM
	.comm	_MLX4_MAC_MASK,4,2              ## @MLX4_MAC_MASK
L_.str.1:                               ## @.str.1
	.asciz	"Free MAC index is %d\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_MLX4_MAC_VALID,4,2             ## @MLX4_MAC_VALID
L_.str.2:                               ## @.str.2
	.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_register_mac            ; -- Begin function __mlx4_register_mac
	.p2align	2
___mlx4_register_mac:                   ; @__mlx4_register_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
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	bl	_mlx4_priv
	ldr	x25, [x0]
	mov	w8, #40
	madd	x23, x22, x8, x25
	str	x22, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_mlx4_dbg
	add	x19, x23, #24
	mov	x0, x19
	bl	_mutex_lock
Lloh2:
	adrp	x27, _MLX4_MAX_MAC_NUM@GOTPAGE
Lloh3:
	ldr	x27, [x27, _MLX4_MAX_MAC_NUM@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w8, #1
	stp	x23, x19, [sp, #16]             ; 16-byte Folded Spill
	b.lt	LBB0_8
; %bb.1:
	mov	x26, #0
	mov	w9, #40
	madd	x9, x22, x9, x25
	add	x28, x9, #32
	mov	w23, #-1
Lloh4:
	adrp	x24, _MLX4_MAC_MASK@GOTPAGE
Lloh5:
	ldr	x24, [x24, _MLX4_MAC_MASK@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x26
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	cmp	x26, w8, sxtw
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x28]
	ldr	x0, [x9, x26, lsl #3]
	tbz	w23, #31, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x0, LBB0_2
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w19, [x24]
	bl	_be64_to_cpu
	and	w8, w0, w19
	cmp	w8, w21
	b.eq	LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x27]
	b	LBB0_3
LBB0_8:
	mov	w23, #-1
LBB0_9:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x23
	bl	_mlx4_dbg
	mov	w8, #40
	madd	x24, x22, x8, x25
	ldp	x8, x9, [x24, #8]!
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
Lloh8:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_15
LBB0_11:
Lloh11:
	adrp	x8, _MLX4_MAC_VALID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MLX4_MAC_VALID@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w0, w8, w21
	bl	_cpu_to_be64
	mov	w8, #40
	madd	x26, x22, x8, x25
	ldr	x2, [x26, #32]!
	sxtw	x25, w23
	str	x0, [x2, w23, sxtw #3]
	mov	x0, x20
	mov	x1, x22
	bl	_mlx4_set_port_mac_table
	mov	x22, x0
	bl	_unlikely
	cbz	x0, LBB0_14
; %bb.12:
	sxtw	x2, w21
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_mlx4_err
	ldr	x8, [x26]
	str	xzr, [x8, x25, lsl #3]
	mov	x23, x22
	b	LBB0_15
LBB0_13:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	lsl	x9, x26, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	mov	x23, x26
	b	LBB0_15
LBB0_14:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	mov	w9, #1
	str	w9, [x8, x25, lsl #2]
	ldr	x8, [x24]
	add	x8, x8, #1
	str	x8, [x24]
LBB0_15:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_mutex_unlock
	mov	x0, x23
	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	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Registering MAC: 0x%llx for port %d\n"

	.comm	_MLX4_MAX_MAC_NUM,4,2           ; @MLX4_MAX_MAC_NUM
	.comm	_MLX4_MAC_MASK,4,2              ; @MLX4_MAC_MASK
l_.str.1:                               ; @.str.1
	.asciz	"Free MAC index is %d\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_MLX4_MAC_VALID,4,2             ; @MLX4_MAC_VALID
l_.str.2:                               ; @.str.2
	.asciz	"Failed adding MAC: 0x%llx\n"

.subsections_via_symbols
