	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tpm_tis_recv
_tpm_tis_recv:                          ## @tpm_tis_recv
	.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	%rdx, %rbx
	movq	%rdi, %r14
	movq	_TPM_HEADER_SIZE@GOTPCREL(%rip), %r13
	movq	(%r13), %rdx
	cmpq	%rbx, %rdx
	jbe	LBB0_1
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_1:
	movq	%rsi, %r12
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_recv_data
	movl	%eax, %r15d
	cltq
	cmpq	%rax, (%r13)
	jbe	LBB0_3
## %bb.2:
	movl	12(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	%r15d, %ebx
LBB0_10:
	movq	%r14, %rdi
	callq	_tpm_tis_ready
	movl	(%r14), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_release_locality
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	8(%r12), %edi
	callq	_be32_to_cpu
	movslq	%eax, %rcx
	cmpq	%rbx, %rcx
	ja	LBB0_8
## %bb.4:
	movq	(%r13), %rcx
	leaq	(%r12,%rcx,4), %rsi
	movl	%eax, %r12d
	movl	%eax, %edx
	subl	%ecx, %edx
	movq	%r14, %rdi
	callq	_recv_data
	movl	%eax, %ebx
	addl	%r15d, %ebx
	cmpl	%r12d, %ebx
	jge	LBB0_6
## %bb.5:
	movl	12(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_ETIME@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	movq	_TPM_STS_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	leaq	4(%r14), %rcx
	movq	%r14, %rdi
	callq	_wait_for_tpm_stat
	movq	%r14, %rdi
	callq	_tpm_tis_status
	movq	_TPM_STS_DATA_AVAIL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.7:
	movl	12(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_TPM_HEADER_SIZE,8,3            ## @TPM_HEADER_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to read header\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unable to read remainder of result\n"

	.comm	_ETIME,4,2                      ## @ETIME
	.comm	_TPM_STS_VALID,4,2              ## @TPM_STS_VALID
	.comm	_TPM_STS_DATA_AVAIL,4,2         ## @TPM_STS_DATA_AVAIL
L_.str.2:                               ## @.str.2
	.asciz	"Error left over data\n"

	.no_dead_strip	_tpm_tis_recv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tpm_tis_recv
_tpm_tis_recv:                          ; @tpm_tis_recv
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x2
	mov	x19, x0
Lloh0:
	adrp	x24, _TPM_HEADER_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _TPM_HEADER_SIZE@GOTPAGEOFF]
	ldr	x2, [x24]
	cmp	x2, x22
	b.ls	LBB0_3
LBB0_1:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_3:
	mov	x21, x1
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_recv_data
	mov	x20, x0
	ldr	x8, [x24]
	cmp	x8, w0, sxtw
	b.ls	LBB0_6
; %bb.4:
	ldr	w0, [x19, #12]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_5:
	mov	x0, x19
	bl	_tpm_tis_ready
	ldr	w1, [x19]
	mov	x0, x19
	mov	w2, #0
	bl	_release_locality
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w0, [x21, #8]
	bl	_be32_to_cpu
	mov	x23, x0
	sxtw	x8, w23
	cmp	x8, x22
	b.hi	LBB0_1
; %bb.7:
	ldr	x8, [x24]
	add	x1, x21, x8, lsl #2
	sub	w2, w23, w8
	mov	x0, x19
	bl	_recv_data
	add	w20, w0, w20
	cmp	w20, w23
	b.ge	LBB0_9
; %bb.8:
	ldr	w0, [x19, #12]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh8:
	adrp	x8, _ETIME@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
	b	LBB0_2
LBB0_9:
Lloh10:
	adrp	x8, _TPM_STS_VALID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TPM_STS_VALID@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	add	x3, x19, #4
	mov	x0, x19
	bl	_wait_for_tpm_stat
	mov	x0, x19
	bl	_tpm_tis_status
Lloh13:
	adrp	x8, _TPM_STS_DATA_AVAIL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TPM_STS_DATA_AVAIL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.10:
	ldr	w0, [x19, #12]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_TPM_HEADER_SIZE,8,3            ; @TPM_HEADER_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to read header\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unable to read remainder of result\n"

	.comm	_ETIME,4,2                      ; @ETIME
	.comm	_TPM_STS_VALID,4,2              ; @TPM_STS_VALID
	.comm	_TPM_STS_DATA_AVAIL,4,2         ; @TPM_STS_DATA_AVAIL
l_.str.2:                               ; @.str.2
	.asciz	"Error left over data\n"

	.no_dead_strip	_tpm_tis_recv
.subsections_via_symbols
