	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hfi1_create_rcvhdrq            ## -- Begin function hfi1_create_rcvhdrq
	.p2align	4, 0x90
_hfi1_create_rcvhdrq:                   ## @hfi1_create_rcvhdrq
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	cmpq	$0, 8(%rsi)
	je	LBB0_2
LBB0_1:
	movq	_HDRQ_SIZE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	(%rbx), %eax
	sarl	%cl, %eax
	movq	_RCV_HDR_CNT_CNT_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_RCV_HDR_CNT_CNT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	20(%rbx), %esi
	movq	_RCV_HDR_CNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_write_kctxt_csr
	movl	24(%rbx), %edi
	callq	_encode_rcv_header_entry_size
	movq	_RCV_HDR_ENT_SIZE_ENT_SIZE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_RCV_HDR_ENT_SIZE_ENT_SIZE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	20(%rbx), %esi
	movq	_RCV_HDR_ENT_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_write_kctxt_csr
	movq	_DEFAULT_RCVHDRSIZE@GOTPCREL(%rip), %rcx
	movq	_RCV_HDR_SIZE_HDR_SIZE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rcx), %eax
	movq	_RCV_HDR_SIZE_HDR_SIZE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	20(%rbx), %esi
	movq	_RCV_HDR_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_write_kctxt_csr
	movl	20(%rbx), %esi
	movq	_RCV_HDR_TAIL_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r14), %ecx
	movq	%r14, %rdi
	callq	_write_kctxt_csr
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_2:
	movq	%rbx, %rdi
	callq	_rcvhdrq_size
	movl	%eax, %r15d
	movl	20(%rbx), %eax
	cmpl	16(%r14), %eax
	jl	LBB0_6
## %bb.4:
	cmpq	$0, 48(%rbx)
	jne	LBB0_6
## %bb.5:
	movq	_GFP_USER@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %r12d
	movq	8(%r14), %rdi
	leaq	16(%rbx), %rdx
	movq	___GFP_COMP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	%r12d, %ecx
	movl	%r15d, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	movl	44(%rbx), %edi
	movq	_DMA_RTAIL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_HFI1_CAP_KGET_MASK
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	movl	44(%rbx), %edi
	movl	(%r13), %esi
	callq	_HFI1_CAP_UGET_MASK
	testq	%rax, %rax
	je	LBB0_1
LBB0_10:
	movq	8(%r14), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	40(%rbx), %rdx
	movl	%r12d, %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	jne	LBB0_1
## %bb.11:
	movl	20(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dd_dev_err
	movq	8(%r14), %rdi
	movq	8(%rbx), %rdx
	movl	16(%rbx), %ecx
	movl	%r15d, %esi
	callq	_dma_free_coherent
	movq	$0, 8(%rbx)
	jmp	LBB0_13
LBB0_12:
	movl	20(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dd_dev_err
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_USER,4,2                   ## @GFP_USER
	.comm	___GFP_COMP,4,2                 ## @__GFP_COMP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"attempt to allocate %d bytes for ctxt %u rcvhdrq failed\n"

	.comm	_DMA_RTAIL,4,2                  ## @DMA_RTAIL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_HDRQ_SIZE_SHIFT,4,2            ## @HDRQ_SIZE_SHIFT
	.comm	_RCV_HDR_CNT_CNT_MASK,4,2       ## @RCV_HDR_CNT_CNT_MASK
	.comm	_RCV_HDR_CNT_CNT_SHIFT,4,2      ## @RCV_HDR_CNT_CNT_SHIFT
	.comm	_RCV_HDR_CNT,4,2                ## @RCV_HDR_CNT
	.comm	_RCV_HDR_ENT_SIZE_ENT_SIZE_MASK,4,2 ## @RCV_HDR_ENT_SIZE_ENT_SIZE_MASK
	.comm	_RCV_HDR_ENT_SIZE_ENT_SIZE_SHIFT,4,2 ## @RCV_HDR_ENT_SIZE_ENT_SIZE_SHIFT
	.comm	_RCV_HDR_ENT_SIZE,4,2           ## @RCV_HDR_ENT_SIZE
	.comm	_DEFAULT_RCVHDRSIZE,8,3         ## @DEFAULT_RCVHDRSIZE
	.comm	_RCV_HDR_SIZE_HDR_SIZE_MASK,4,2 ## @RCV_HDR_SIZE_HDR_SIZE_MASK
	.comm	_RCV_HDR_SIZE_HDR_SIZE_SHIFT,4,2 ## @RCV_HDR_SIZE_HDR_SIZE_SHIFT
	.comm	_RCV_HDR_SIZE,4,2               ## @RCV_HDR_SIZE
	.comm	_RCV_HDR_TAIL_ADDR,4,2          ## @RCV_HDR_TAIL_ADDR
L_.str.1:                               ## @.str.1
	.asciz	"attempt to allocate 1 page for ctxt %u rcvhdrqtailaddr failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hfi1_create_rcvhdrq            ; -- Begin function hfi1_create_rcvhdrq
	.p2align	2
_hfi1_create_rcvhdrq:                   ; @hfi1_create_rcvhdrq
	.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	x19, x1
	mov	x20, x0
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_2
LBB0_1:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _HDRQ_SIZE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HDRQ_SIZE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh3:
	adrp	x9, _RCV_HDR_CNT_CNT_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RCV_HDR_CNT_CNT_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w8, w8, w9
Lloh6:
	adrp	x9, _RCV_HDR_CNT_CNT_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RCV_HDR_CNT_CNT_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w3, w8, w9
	ldr	w1, [x19, #20]
Lloh9:
	adrp	x8, _RCV_HDR_CNT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RCV_HDR_CNT@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_write_kctxt_csr
	ldr	w0, [x19, #24]
	bl	_encode_rcv_header_entry_size
Lloh12:
	adrp	x8, _RCV_HDR_ENT_SIZE_ENT_SIZE_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RCV_HDR_ENT_SIZE_ENT_SIZE_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh15:
	adrp	x9, _RCV_HDR_ENT_SIZE_ENT_SIZE_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _RCV_HDR_ENT_SIZE_ENT_SIZE_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	lsl	w3, w8, w9
	ldr	w1, [x19, #20]
Lloh18:
	adrp	x8, _RCV_HDR_ENT_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RCV_HDR_ENT_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_write_kctxt_csr
Lloh21:
	adrp	x8, _DEFAULT_RCVHDRSIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DEFAULT_RCVHDRSIZE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _RCV_HDR_SIZE_HDR_SIZE_MASK@GOTPAGE
Lloh25:
	ldr	x9, [x9, _RCV_HDR_SIZE_HDR_SIZE_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh27:
	adrp	x9, _RCV_HDR_SIZE_HDR_SIZE_SHIFT@GOTPAGE
Lloh28:
	ldr	x9, [x9, _RCV_HDR_SIZE_HDR_SIZE_SHIFT@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	lsl	w3, w8, w9
	ldr	w1, [x19, #20]
Lloh30:
	adrp	x8, _RCV_HDR_SIZE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RCV_HDR_SIZE@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_write_kctxt_csr
	ldr	w1, [x19, #20]
Lloh33:
	adrp	x8, _RCV_HDR_TAIL_ADDR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _RCV_HDR_TAIL_ADDR@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
	ldr	w3, [x20]
	mov	x0, x20
	bl	_write_kctxt_csr
	mov	w0, #0
	b	LBB0_11
LBB0_2:
	mov	x0, x19
	bl	_rcvhdrq_size
	mov	x21, x0
	ldr	w9, [x19, #20]
	ldr	w10, [x20, #16]
Lloh36:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
	cmp	w9, w10
	b.lt	LBB0_4
; %bb.3:
	ldr	x9, [x19, #48]
Lloh38:
	adrp	x10, _GFP_USER@GOTPAGE
Lloh39:
	ldr	x10, [x10, _GFP_USER@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
LBB0_4:
	ldr	w22, [x8]
	ldr	x0, [x20, #8]
	add	x2, x19, #16
Lloh40:
	adrp	x8, ___GFP_COMP@GOTPAGE
Lloh41:
	ldr	x8, [x8, ___GFP_COMP@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	orr	w3, w8, w22
	mov	x1, x21
	bl	_dma_alloc_coherent
	str	x0, [x19, #8]
	cbz	x0, LBB0_9
; %bb.5:
	ldr	w0, [x19, #44]
Lloh43:
	adrp	x23, _DMA_RTAIL@GOTPAGE
Lloh44:
	ldr	x23, [x23, _DMA_RTAIL@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_HFI1_CAP_KGET_MASK
	cbnz	x0, LBB0_7
; %bb.6:
	ldr	w0, [x19, #44]
	ldr	w1, [x23]
	bl	_HFI1_CAP_UGET_MASK
	cbz	x0, LBB0_1
LBB0_7:
	ldr	x0, [x20, #8]
Lloh45:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh46:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
	add	x2, x19, #40
	mov	x3, x22
	bl	_dma_alloc_coherent
	str	x0, [x19, #32]
	cbnz	x0, LBB0_1
; %bb.8:
	ldr	w2, [x19, #20]
Lloh48:
	adrp	x1, l_.str.1@PAGE
Lloh49:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dd_dev_err
	ldr	x0, [x20, #8]
	ldr	x2, [x19, #8]
	ldr	w3, [x19, #16]
	mov	x1, x21
	bl	_dma_free_coherent
	str	xzr, [x19, #8]
	b	LBB0_10
LBB0_9:
	ldr	w8, [x19, #20]
	str	x8, [sp]
Lloh50:
	adrp	x1, l_.str@PAGE
Lloh51:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dd_dev_err
LBB0_10:
Lloh52:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_USER,4,2                   ; @GFP_USER
	.comm	___GFP_COMP,4,2                 ; @__GFP_COMP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"attempt to allocate %d bytes for ctxt %u rcvhdrq failed\n"

	.comm	_DMA_RTAIL,4,2                  ; @DMA_RTAIL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_HDRQ_SIZE_SHIFT,4,2            ; @HDRQ_SIZE_SHIFT
	.comm	_RCV_HDR_CNT_CNT_MASK,4,2       ; @RCV_HDR_CNT_CNT_MASK
	.comm	_RCV_HDR_CNT_CNT_SHIFT,4,2      ; @RCV_HDR_CNT_CNT_SHIFT
	.comm	_RCV_HDR_CNT,4,2                ; @RCV_HDR_CNT
	.comm	_RCV_HDR_ENT_SIZE_ENT_SIZE_MASK,4,2 ; @RCV_HDR_ENT_SIZE_ENT_SIZE_MASK
	.comm	_RCV_HDR_ENT_SIZE_ENT_SIZE_SHIFT,4,2 ; @RCV_HDR_ENT_SIZE_ENT_SIZE_SHIFT
	.comm	_RCV_HDR_ENT_SIZE,4,2           ; @RCV_HDR_ENT_SIZE
	.comm	_DEFAULT_RCVHDRSIZE,8,3         ; @DEFAULT_RCVHDRSIZE
	.comm	_RCV_HDR_SIZE_HDR_SIZE_MASK,4,2 ; @RCV_HDR_SIZE_HDR_SIZE_MASK
	.comm	_RCV_HDR_SIZE_HDR_SIZE_SHIFT,4,2 ; @RCV_HDR_SIZE_HDR_SIZE_SHIFT
	.comm	_RCV_HDR_SIZE,4,2               ; @RCV_HDR_SIZE
	.comm	_RCV_HDR_TAIL_ADDR,4,2          ; @RCV_HDR_TAIL_ADDR
l_.str.1:                               ; @.str.1
	.asciz	"attempt to allocate 1 page for ctxt %u rcvhdrqtailaddr failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
