	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_header_template
_check_header_template:                 ## @check_header_template
	.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
	movl	%ecx, %r14d
	movl	%edx, %ebx
	movq	%rsi, %r12
	movl	20(%rdi), %esi
	movq	_PIO_BLOCK_SIZE@GOTPCREL(%rip), %rcx
	movl	%esi, %eax
	cltd
	idivl	(%rcx)
	movl	%ebx, %eax
	andl	$3, %eax
	orl	%edx, %eax
	jne	LBB0_9
## %bb.1:
	movq	%rdi, %r15
	movl	(%r12), %edi
	callq	_get_lrh_len
	cmpl	%ebx, %eax
	jl	LBB0_9
## %bb.2:
	movl	24(%r15), %edi
	callq	_req_opcode
	movq	_EXPECTED@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.3:
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movl	(%rax,%rcx,4), %r13d
	movq	_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_EXP_TID_GET
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_EXP_TID_GET
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_EXP_TID_GET
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%r12), %r13d
	movq	_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_KDETH_GET
	movl	%eax, %r12d
	movl	16(%r15), %edi
	movq	_OM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_KDETH_GET
	testl	%eax, %eax
	jne	LBB0_4
## %bb.5:
	movq	_KDETH_OM_SMALL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_KDETH_OM_LARGE@GOTPCREL(%rip), %rax
LBB0_6:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	imull	(%rax), %r12d
	addl	%r14d, %r12d
	cmpl	%ecx, %r12d
	jg	LBB0_9
## %bb.7:
	movq	_TIDCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_KDETH_GET
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_9
## %bb.8:
	movq	_TID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_KDETH_GET
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PIO_BLOCK_SIZE,4,2             ## @PIO_BLOCK_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EXPECTED,8,3                   ## @EXPECTED
	.comm	_LEN,4,2                        ## @LEN
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_IDX,4,2                        ## @IDX
	.comm	_CTRL,4,2                       ## @CTRL
	.comm	_OFFSET,4,2                     ## @OFFSET
	.comm	_OM,4,2                         ## @OM
	.comm	_KDETH_OM_LARGE,4,2             ## @KDETH_OM_LARGE
	.comm	_KDETH_OM_SMALL,4,2             ## @KDETH_OM_SMALL
	.comm	_TIDCTRL,4,2                    ## @TIDCTRL
	.comm	_TID,4,2                        ## @TID
	.no_dead_strip	_check_header_template
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_header_template
_check_header_template:                 ; @check_header_template
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
Lloh0:
	adrp	x8, _PIO_BLOCK_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIO_BLOCK_SIZE@GOTPAGEOFF]
	ldr	w1, [x0, #20]
Lloh2:
	ldr	w8, [x8]
	sdiv	w9, w1, w8
	msub	w8, w9, w8, w1
	and	w9, w2, #0x3
	orr	w8, w8, w9
	cbnz	w8, LBB0_2
; %bb.1:
	mov	x19, x3
	mov	x22, x2
	mov	x20, x0
	ldr	w0, [x21]
	bl	_get_lrh_len
	cmp	w0, w22
	b.ge	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	w0, [x20, #24]
	bl	_req_opcode
Lloh6:
	adrp	x8, _EXPECTED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EXPECTED@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.5:
	ldp	x8, x9, [x20]
	ldr	w23, [x8, x9, lsl #2]
Lloh9:
	adrp	x8, _LEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LEN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_EXP_TID_GET
Lloh12:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	mul	w25, w8, w0
Lloh15:
	adrp	x8, _IDX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IDX@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_EXP_TID_GET
	mov	x22, x0
Lloh18:
	adrp	x8, _CTRL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CTRL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_EXP_TID_GET
	mov	x23, x0
	ldr	w21, [x21]
Lloh21:
	adrp	x8, _OFFSET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _OFFSET@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_KDETH_GET
	mov	x24, x0
	ldr	w0, [x20, #16]
Lloh24:
	adrp	x8, _OM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _OM@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	bl	_KDETH_GET
Lloh27:
	adrp	x8, _KDETH_OM_LARGE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _KDETH_OM_LARGE@GOTPAGEOFF]
Lloh29:
	adrp	x9, _KDETH_OM_SMALL@GOTPAGE
Lloh30:
	ldr	x9, [x9, _KDETH_OM_SMALL@GOTPAGEOFF]
	cmp	w0, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	madd	w8, w8, w24, w19
	cmp	w8, w25
	b.gt	LBB0_2
; %bb.6:
Lloh31:
	adrp	x8, _TIDCTRL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _TIDCTRL@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_KDETH_GET
	cmp	w0, w23
	b.ne	LBB0_2
; %bb.7:
Lloh34:
	adrp	x8, _TID@GOTPAGE
Lloh35:
	ldr	x8, [x8, _TID@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_KDETH_GET
	cmp	w0, w22
	b.ne	LBB0_2
LBB0_8:
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.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	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_PIO_BLOCK_SIZE,4,2             ; @PIO_BLOCK_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EXPECTED,8,3                   ; @EXPECTED
	.comm	_LEN,4,2                        ; @LEN
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_IDX,4,2                        ; @IDX
	.comm	_CTRL,4,2                       ; @CTRL
	.comm	_OFFSET,4,2                     ; @OFFSET
	.comm	_OM,4,2                         ; @OM
	.comm	_KDETH_OM_LARGE,4,2             ; @KDETH_OM_LARGE
	.comm	_KDETH_OM_SMALL,4,2             ; @KDETH_OM_SMALL
	.comm	_TIDCTRL,4,2                    ; @TIDCTRL
	.comm	_TID,4,2                        ; @TID
	.no_dead_strip	_check_header_template
.subsections_via_symbols
