	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_ib_add_gid
_mlx4_ib_add_gid:                       ## @mlx4_ib_add_gid
	.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
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	20(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r12
	movl	(%rbx), %esi
	movl	20(%rbx), %edi
	callq	_rdma_cap_roce_gid_table
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movslq	(%rbx), %rcx
	movq	_MLX4_MAX_PORTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jg	LBB0_1
## %bb.3:
	testq	%r14, %r14
	je	LBB0_1
## %bb.4:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	8(%r12), %r13
	movq	%r12, %rdi
	callq	_spin_lock_bh
	movq	_MLX4_MAX_PORT_GIDS@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	jle	LBB0_12
## %bb.5:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leaq	16(%rbx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$-1, %r15d
	movl	$8, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rcx
	incq	%rbx
	movslq	(%r14), %rax
	addq	$24, %r12
	cmpq	%rax, %rbx
	jge	LBB0_11
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %r14
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-8(%r13,%rax,8), %rdi
	addq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_memcmp
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-8(%r13,%rax,8), %rax
	movq	-8(%rax,%r12), %rcx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	cmpq	8(%rdx), %rcx
	je	LBB0_15
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	testl	%r15d, %r15d
	jns	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-8(%r13,%rax,8), %rdi
	addq	%r12, %rdi
	callq	_rdma_is_zero_gid
	testq	%rax, %rax
	cmovnel	%ebx, %r15d
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	testl	%r15d, %r15d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	js	LBB0_12
## %bb.13:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kmalloc
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	-8(%r13,%r12,8), %rdx
	movl	%r15d, %ecx
	leaq	(%rcx,%rcx,2), %rsi
	movq	%rax, 16(%rdx,%rsi,8)
	testq	%rax, %rax
	je	LBB0_14
## %bb.18:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rdx)
	movq	-8(%r13,%r12,8), %rax
	shlq	$3, %rcx
	leaq	(%rcx,%rcx,2), %rbx
	leaq	(%rax,%rbx), %rdi
	addq	$8, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_memcpy
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	-8(%r13,%r12,8), %rcx
	movq	%rax, (%rcx,%rbx)
	movq	16(%rcx,%rbx), %rax
	movl	%r15d, (%rax)
	movl	$1, 4(%rax)
	movq	%r14, %rbx
	movl	(%r14), %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_kmalloc_array
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_24
## %bb.19:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rbx)
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	jle	LBB0_22
## %bb.20:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-8(%rax,%r13,8), %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	8(%rax), %r15
	movl	$8, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	addq	%rbx, %rsi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_memcpy
	movq	%r14, %rcx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-8(%rax,%r13,8), %rsi
	movq	-8(%rsi,%rbx), %rax
	movq	%rax, -8(%r15)
	incq	%r12
	movslq	(%r14), %rax
	addq	$16, %r15
	addq	$24, %rbx
	cmpq	%rax, %r12
	jl	LBB0_21
LBB0_22:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_spin_unlock_bh
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_23:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mlx4_ib_update_gids
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_26
LBB0_12:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_15:
	movq	8(%rax,%r12), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	incl	4(%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
LBB0_17:
	movq	%r12, %rdi
	callq	_spin_unlock_bh
	jmp	LBB0_26
LBB0_24:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_spin_unlock_bh
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.25:
	negl	%ebx
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX4_MAX_PORTS,4,2             ## @MLX4_MAX_PORTS
	.comm	_MLX4_MAX_PORT_GIDS,4,2         ## @MLX4_MAX_PORT_GIDS
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mlx4_ib_add_gid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_ib_add_gid
_mlx4_ib_add_gid:                       ; @mlx4_ib_add_gid
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x20, x0
	ldr	w0, [x0, #20]
	bl	_to_mdev
	mov	x19, x0
	ldr	w0, [x20, #20]
	ldr	w1, [x20]
	bl	_rdma_cap_roce_gid_table
	cbz	w0, LBB0_10
; %bb.1:
	ldrsw	x22, [x20]
Lloh0:
	adrp	x8, _MLX4_MAX_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX4_MAX_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w22, w8
	b.gt	LBB0_10
; %bb.2:
	cbz	x21, LBB0_10
; %bb.3:
	ldr	x23, [x19, #8]
	mov	x0, x19
	bl	_spin_lock_bh
Lloh3:
	adrp	x24, _MLX4_MAX_PORT_GIDS@GOTPAGE
Lloh4:
	ldr	x24, [x24, _MLX4_MAX_PORT_GIDS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.4:
	mov	x27, #0
	mov	x28, #0
	sub	x25, x22, #1
	add	x22, x20, #16
	mov	w26, #-1
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x28, x28, #1
	ldrsw	x8, [x24]
	add	x27, x27, #24
	cmp	x28, x8
	b.ge	LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, x25, lsl #3]
	add	x8, x8, x27
	add	x0, x8, #8
	mov	x1, x22
	mov	w2, #4
	bl	_memcmp
	cbnz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x23, x25, lsl #3]
	ldr	x9, [x8, x27]
	ldr	x10, [x20, #8]
	cmp	x9, x10
	b.eq	LBB0_23
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	tbz	w26, #31, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x23, x25, lsl #3]
	add	x8, x8, x27
	add	x0, x8, #8
	bl	_rdma_is_zero_gid
	cmp	x0, #0
	csel	w26, w26, w28, eq
	b	LBB0_5
LBB0_10:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_11:
	mov	x0, x20
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_13:
	tbnz	w26, #31, LBB0_21
; %bb.14:
Lloh8:
	adrp	x27, _GFP_ATOMIC@GOTPAGE
Lloh9:
	ldr	x27, [x27, _GFP_ATOMIC@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	w0, #8
	bl	_kmalloc
	ldr	x8, [x23, x25, lsl #3]
	mov	w9, #24
	umaddl	x8, w26, w9, x8
	str	x0, [x8, #16]
	cbz	x0, LBB0_25
; %bb.15:
	mov	w8, w26
	str	x0, [x21]
	lsl	x21, x25, #3
	ldr	x9, [x23, x21]
	add	x8, x8, x8, lsl #1
	lsl	x28, x8, #3
	add	x8, x9, x28
	add	x0, x8, #8
	mov	x1, x22
	mov	w2, #4
	bl	_memcpy
	ldr	x8, [x20, #8]
	ldr	x9, [x23, x21]
	add	x9, x9, x28
	str	x8, [x9]
	ldr	x8, [x9, #16]
	mov	w9, #1
	stp	w26, w9, [x8]
	ldr	w0, [x24]
	ldr	w2, [x27]
	mov	w1, #16
	bl	_kmalloc_array
	mov	x21, x0
	cbz	x0, LBB0_26
; %bb.16:
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.17:
	mov	x26, #0
	mov	x27, #0
	ldr	x8, [x23, x25, lsl #3]
	add	x22, x21, #8
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x26
	add	x1, x8, #8
	mov	x0, x22
	mov	w2, #4
	bl	_memcpy
	ldr	x8, [x23, x25, lsl #3]
	ldr	x9, [x8, x26]
	stur	x9, [x22, #-8]
	add	x27, x27, #1
	ldrsw	x9, [x24]
	add	x22, x22, #16
	add	x26, x26, #24
	cmp	x27, x9
	b.lt	LBB0_18
LBB0_19:
	mov	x0, x19
	bl	_spin_unlock_bh
LBB0_20:
	ldr	w2, [x20]
	mov	x0, x21
	mov	x1, x19
	bl	_mlx4_ib_update_gids
	mov	x19, x0
	mov	x0, x21
	bl	_kfree
	mov	x0, x19
	b	LBB0_12
LBB0_21:
Lloh10:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_22:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_24
LBB0_23:
	mov	w20, #0
	add	x8, x8, x27
	ldr	x8, [x8, #16]
	str	x8, [x21]
	ldr	w9, [x8, #4]
	add	w9, w9, #1
	str	w9, [x8, #4]
LBB0_24:
	mov	x0, x19
	bl	_spin_unlock_bh
	b	LBB0_11
LBB0_25:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_22
LBB0_26:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w22, [x8]
	mov	x0, x19
	bl	_spin_unlock_bh
	cbz	w22, LBB0_20
; %bb.27:
	neg	w20, w22
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX4_MAX_PORTS,4,2             ; @MLX4_MAX_PORTS
	.comm	_MLX4_MAX_PORT_GIDS,4,2         ; @MLX4_MAX_PORT_GIDS
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mlx4_ib_add_gid
.subsections_via_symbols
