	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hfi1_make_bth_deth
_hfi1_make_bth_deth:                    ## @hfi1_make_bth_deth
	.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	%r9d, %r13d
	movl	%r8d, %r12d
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %rax
	movl	20(%rdi), %edi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	28(%rax), %esi
	callq	_to_iport
	movq	%rax, %rdi
	movq	8(%rbx), %rax
	movq	_IB_WR_SEND_WITH_IMM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	jne	LBB0_1
## %bb.2:
	movl	20(%rbx), %eax
	movl	%eax, 8(%r15)
	movq	_IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_IB_OPCODE_UD_SEND_ONLY@GOTPCREL(%rip), %rax
LBB0_3:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rax), %r13d
	movq	_IB_SEND_SOLICITED@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	andl	16(%rbx), %r14d
	je	LBB0_5
## %bb.4:
	movq	_IB_BTH_SOLICITED@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_5:
	shll	$24, %r13d
	shll	$20, %r12d
	movq	8(%rdx), %rax
	movq	_IB_QPT_GSI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_IB_QPT_SMI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.8:
	movl	24(%rdx), %esi
	jmp	LBB0_9
LBB0_7:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_rvt_get_swqe_pkey_index
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
LBB0_9:
	callq	_hfi1_get_pkey
	xorl	%ecx, %ecx
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	cmovel	%eax, %ecx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	orl	%r12d, %r13d
	orl	%r14d, %r13d
	orl	%ecx, %r13d
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	16(%r15), %rcx
	movq	%rax, (%rcx)
	movq	%rbx, %rdi
	callq	_rvt_get_swqe_remote_qpn
	movl	%eax, %edi
	callq	_cpu_to_be32
	movq	16(%r15), %rcx
	movq	%rax, 8(%rcx)
	movl	(%rbx), %edi
	callq	_mask_psn
	movl	%eax, %edi
	callq	_cpu_to_be32
	movq	16(%r15), %rcx
	movq	%rax, 16(%rcx)
	movq	%rbx, %rdi
	callq	_rvt_get_swqe_remote_qkey
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	%rbx, %rdi
	callq	_rvt_get_swqe_remote_qkey
	movl	%eax, %edi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_10:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
LBB0_12:
	callq	_cpu_to_be32
	movq	(%r15), %rcx
	movq	%rax, (%rcx)
	movl	16(%rbx), %edi
	callq	_cpu_to_be32
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_WR_SEND_WITH_IMM,8,3        ## @IB_WR_SEND_WITH_IMM
	.comm	_IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE,4,2 ## @IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE
	.comm	_IB_OPCODE_UD_SEND_ONLY,4,2     ## @IB_OPCODE_UD_SEND_ONLY
	.comm	_IB_SEND_SOLICITED,4,2          ## @IB_SEND_SOLICITED
	.comm	_IB_BTH_SOLICITED,4,2           ## @IB_BTH_SOLICITED
	.comm	_IB_QPT_GSI,8,3                 ## @IB_QPT_GSI
	.comm	_IB_QPT_SMI,8,3                 ## @IB_QPT_SMI
	.no_dead_strip	_hfi1_make_bth_deth
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hfi1_make_bth_deth
_hfi1_make_bth_deth:                    ; @hfi1_make_bth_deth
	.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	x22, x5
	mov	x25, x4
	mov	x23, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w0, [x0, #20]
	ldr	w1, [x20, #28]
	bl	_to_iport
	mov	x24, x0
	ldr	x8, [x21, #8]
Lloh0:
	adrp	x9, _IB_WR_SEND_WITH_IMM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IB_WR_SEND_WITH_IMM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x21, #20]
	str	w8, [x19, #8]
Lloh3:
	adrp	x8, _IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x8, _IB_OPCODE_UD_SEND_ONLY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_OPCODE_UD_SEND_ONLY@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	lsl	w26, w8, #24
	ldr	w8, [x21, #16]
Lloh7:
	adrp	x9, _IB_SEND_SOLICITED@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IB_SEND_SOLICITED@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _IB_BTH_SOLICITED@GOTPAGE
Lloh11:
	ldr	x10, [x10, _IB_BTH_SOLICITED@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w27, wzr, w10, eq
	lsl	w25, w25, #20
	ldr	x8, [x20, #8]
Lloh13:
	adrp	x9, _IB_QPT_GSI@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IB_QPT_GSI@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
Lloh16:
	adrp	x10, _IB_QPT_SMI@GOTPAGE
Lloh17:
	ldr	x10, [x10, _IB_QPT_SMI@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_rvt_get_swqe_pkey_index
	mov	x1, x0
	b	LBB0_6
LBB0_5:
	ldr	w1, [x20, #24]
LBB0_6:
	mov	x0, x24
	bl	_hfi1_get_pkey
	str	w0, [x23]
	cmp	w22, #0
	csel	w8, w0, wzr, eq
	orr	w9, w26, w25
	orr	w9, w9, w27
	orr	w0, w9, w8
	bl	_cpu_to_be32
	ldr	x8, [x19, #16]
	str	x0, [x8]
	mov	x0, x21
	bl	_rvt_get_swqe_remote_qpn
	bl	_cpu_to_be32
	ldr	x8, [x19, #16]
	str	x0, [x8, #8]
	ldr	w0, [x21]
	bl	_mask_psn
	bl	_cpu_to_be32
	ldr	x8, [x19, #16]
	str	x0, [x8, #16]
	mov	x0, x21
	bl	_rvt_get_swqe_remote_qkey
	tbnz	w0, #31, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_rvt_get_swqe_remote_qkey
	b	LBB0_9
LBB0_8:
	ldr	w0, [x20]
LBB0_9:
	bl	_cpu_to_be32
	ldr	x8, [x19]
	str	x0, [x8]
	ldr	w0, [x20, #16]
	bl	_cpu_to_be32
	ldr	x8, [x19]
	str	x0, [x8, #8]
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_WR_SEND_WITH_IMM,8,3        ; @IB_WR_SEND_WITH_IMM
	.comm	_IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE,4,2 ; @IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE
	.comm	_IB_OPCODE_UD_SEND_ONLY,4,2     ; @IB_OPCODE_UD_SEND_ONLY
	.comm	_IB_SEND_SOLICITED,4,2          ; @IB_SEND_SOLICITED
	.comm	_IB_BTH_SOLICITED,4,2           ; @IB_BTH_SOLICITED
	.comm	_IB_QPT_GSI,8,3                 ; @IB_QPT_GSI
	.comm	_IB_QPT_SMI,8,3                 ; @IB_QPT_SMI
	.no_dead_strip	_hfi1_make_bth_deth
.subsections_via_symbols
