	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_create_ah               ## -- Begin function ocrdma_create_ah
	.p2align	4, 0x90
_ocrdma_create_ah:                      ## @ocrdma_create_ah
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %rbx
	callq	_get_ocrdma_ah
	movq	%rax, %r14
	movl	$0, -48(%rbp)
	movl	$65535, -44(%rbp)               ## imm = 0xFFFF
	movl	4(%rbx), %edi
	callq	_get_ocrdma_pd
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_get_ocrdma_dev
	movq	%rax, %r15
	movq	(%r13), %rax
	movq	_RDMA_AH_ATTR_TYPE_ROCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	callq	_rdma_ah_get_ah_flags
	movq	_IB_AH_GRH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.3:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_atomic_cmpxchg
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_ocrdma_init_service_level
LBB0_5:
	movq	8(%r13), %r14
	leaq	-44(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_rdma_read_gid_l2_fields
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ocrdma_alloc_av
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.7:
	movq	%r14, %rdi
	callq	_rdma_gid_attr_network_type
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, 8(%rsi)
	movl	8(%r12), %r8d
	movl	-44(%rbp), %eax
	movl	%eax, (%rsp)
	leaq	-48(%rbp), %r9
	movq	%r15, %rdi
	movq	%r13, %rdx
	movq	%r14, %rcx
	callq	_set_av_attr
	testl	%eax, %eax
	je	LBB0_8
## %bb.14:
	movl	%eax, %ebx
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ocrdma_free_av
	jmp	LBB0_15
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	(%r12), %rax
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_15
## %bb.9:
	movq	(%rax), %r14
	testq	%r14, %r14
	je	LBB0_15
## %bb.10:
	movq	%r13, %rdi
	callq	_rdma_ah_get_dlid
	movslq	%eax, %r12
	movl	$0, (%r14,%r12,4)
	movq	_OCRDMA_AH_ID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	andl	(%r13), %eax
	movl	%eax, (%r14,%r12,4)
	movq	%r15, %rdi
	callq	_ocrdma_is_udp_encap_supported
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_OCRDMA_AH_L3_TYPE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%r13), %eax
	movq	_OCRDMA_AH_L3_TYPE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, (%r14,%r12,4)
LBB0_12:
	cmpl	$0, -48(%rbp)
	je	LBB0_15
## %bb.13:
	movq	_OCRDMA_AH_VLAN_VALID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_OCRDMA_AH_VLAN_VALID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, (%r14,%r12,4)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_RDMA_AH_ATTR_TYPE_ROCE,8,3     ## @RDMA_AH_ATTR_TYPE_ROCE
	.comm	_IB_AH_GRH,4,2                  ## @IB_AH_GRH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OCRDMA_AH_ID_MASK,4,2          ## @OCRDMA_AH_ID_MASK
	.comm	_OCRDMA_AH_L3_TYPE_MASK,4,2     ## @OCRDMA_AH_L3_TYPE_MASK
	.comm	_OCRDMA_AH_L3_TYPE_SHIFT,4,2    ## @OCRDMA_AH_L3_TYPE_SHIFT
	.comm	_OCRDMA_AH_VLAN_VALID_MASK,4,2  ## @OCRDMA_AH_VLAN_VALID_MASK
	.comm	_OCRDMA_AH_VLAN_VALID_SHIFT,4,2 ## @OCRDMA_AH_VLAN_VALID_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_create_ah               ; -- Begin function ocrdma_create_ah
	.p2align	2
_ocrdma_create_ah:                      ; @ocrdma_create_ah
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x21, x0
	bl	_get_ocrdma_ah
	mov	x19, x0
	mov	w8, #65535
	stp	w8, wzr, [sp, #8]
	ldr	w0, [x21, #4]
	bl	_get_ocrdma_pd
	mov	x22, x0
	ldr	w0, [x21]
	bl	_get_ocrdma_dev
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _RDMA_AH_ATTR_TYPE_ROCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RDMA_AH_ATTR_TYPE_ROCE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.1:
	mov	x21, x0
	mov	x0, x20
	bl	_rdma_ah_get_ah_flags
Lloh3:
	adrp	x8, _IB_AH_GRH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_AH_GRH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.2:
	mov	x0, x21
	mov	w1, #1
	mov	w2, #0
	bl	_atomic_cmpxchg
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_ocrdma_init_service_level
LBB0_4:
	ldr	x24, [x20, #8]
	add	x1, sp, #8
	mov	x0, x24
	mov	x2, #0
	bl	_rdma_read_gid_l2_fields
	mov	x23, x0
	cbnz	w0, LBB0_9
; %bb.5:
	mov	x0, x21
	mov	x1, x19
	bl	_ocrdma_alloc_av
	mov	x23, x0
	cbnz	w0, LBB0_9
; %bb.6:
	mov	x0, x24
	bl	_rdma_gid_attr_network_type
	str	x0, [x19, #8]
	ldr	w4, [x22, #8]
	ldr	w6, [sp, #8]
	add	x5, sp, #12
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	mov	x3, x24
	bl	_set_av_attr
	cbz	w0, LBB0_10
; %bb.7:
	mov	x23, x0
	mov	x0, x21
	mov	x1, x19
	bl	_ocrdma_free_av
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_9:
	mov	x0, x23
	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
	add	sp, sp, #80
	ret
LBB0_10:
	ldr	x8, [x22]
	cbz	x8, LBB0_16
; %bb.11:
	ldr	x22, [x8]
	cbz	x22, LBB0_16
; %bb.12:
	mov	x0, x20
	bl	_rdma_ah_get_dlid
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x20, w0
	sbfiz	x8, x0, #2, #32
	str	wzr, [x22, x8]
	ldr	w9, [x19]
Lloh9:
	adrp	x10, _OCRDMA_AH_ID_MASK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _OCRDMA_AH_ID_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	and	w9, w10, w9
	str	w9, [x22, x8]
	mov	x0, x21
	bl	_ocrdma_is_udp_encap_supported
	lsl	x8, x20, #2
	cbz	x0, LBB0_14
; %bb.13:
Lloh12:
	adrp	x9, _OCRDMA_AH_L3_TYPE_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _OCRDMA_AH_L3_TYPE_MASK@GOTPAGEOFF]
	ldr	w10, [x19, #8]
Lloh14:
	ldr	w9, [x9]
	and	w9, w9, w10
Lloh15:
	adrp	x10, _OCRDMA_AH_L3_TYPE_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _OCRDMA_AH_L3_TYPE_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	ldr	w10, [x22, x8]
	orr	w9, w10, w9
	str	w9, [x22, x8]
LBB0_14:
	ldr	w9, [sp, #12]
	cbz	w9, LBB0_16
; %bb.15:
	mov	w23, #0
Lloh18:
	adrp	x9, _OCRDMA_AH_VLAN_VALID_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _OCRDMA_AH_VLAN_VALID_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _OCRDMA_AH_VLAN_VALID_SHIFT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _OCRDMA_AH_VLAN_VALID_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	ldr	w10, [x22, x8]
	orr	w9, w10, w9
	str	w9, [x22, x8]
	b	LBB0_9
LBB0_16:
	mov	w23, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_RDMA_AH_ATTR_TYPE_ROCE,8,3     ; @RDMA_AH_ATTR_TYPE_ROCE
	.comm	_IB_AH_GRH,4,2                  ; @IB_AH_GRH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OCRDMA_AH_ID_MASK,4,2          ; @OCRDMA_AH_ID_MASK
	.comm	_OCRDMA_AH_L3_TYPE_MASK,4,2     ; @OCRDMA_AH_L3_TYPE_MASK
	.comm	_OCRDMA_AH_L3_TYPE_SHIFT,4,2    ; @OCRDMA_AH_L3_TYPE_SHIFT
	.comm	_OCRDMA_AH_VLAN_VALID_MASK,4,2  ; @OCRDMA_AH_VLAN_VALID_MASK
	.comm	_OCRDMA_AH_VLAN_VALID_SHIFT,4,2 ; @OCRDMA_AH_VLAN_VALID_SHIFT
.subsections_via_symbols
