	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tpm_inf_recv
_tpm_inf_recv:                          ## @tpm_inf_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	%rsi, %r14
	movq	%rdi, %r15
	movq	_number_of_wtx@GOTPCREL(%rip), %r13
	movq	$0, (%r13)
	movq	_STAT_RDA@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_wait
	testl	%eax, %eax
	je	LBB0_1
LBB0_27:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_28:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_RDFIFO@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_tpm_wtx
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_wait
	testl	%eax, %eax
	jne	LBB0_27
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_tpm_data_in
	movl	%eax, (%r14)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_wait
	testl	%eax, %eax
	jne	LBB0_27
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	callq	_tpm_data_in
	movl	%eax, 4(%r14)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_wait
	testl	%eax, %eax
	jne	LBB0_27
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	callq	_tpm_data_in
	movl	%eax, 8(%r14)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_wait
	testl	%eax, %eax
	jne	LBB0_27
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	callq	_tpm_data_in
	movl	%eax, 12(%r14)
	movl	(%r14), %ecx
	movq	_TPM_VL_VER@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r14), %ecx
	movq	_TPM_CTRL_DATA@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_8
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_TPM_CTRL_WTX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_info
	movq	(%r13), %rax
	movq	_TPM_MAX_WTX_PACKAGES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_18
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_tpm_wtx_abort
	jmp	LBB0_19
LBB0_6:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
LBB0_26:
	callq	_dev_err
	jmp	LBB0_27
LBB0_8:
	movl	8(%r14), %r13d
	shll	$8, %r13d
	orl	%eax, %r13d
	jle	LBB0_15
## %bb.9:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, %edx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%rdx, %r13
	callq	_wait
	movq	_RDFIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_tpm_data_in
	movq	%r13, %rdx
	movl	%eax, (%r14,%r12,4)
	incq	%r12
	cmpq	%r12, %r13
	jne	LBB0_10
## %bb.11:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	cmpl	$27904, %r13d                   ## imm = 0x6D00
	jne	LBB0_14
## %bb.12:
	cmpl	$128, 4(%r14)
	jne	LBB0_14
## %bb.13:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_26
LBB0_21:
	movq	_TPM_CTRL_WTX_ABORT_ACK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_23
## %bb.22:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_info
	xorl	%r13d, %r13d
	jmp	LBB0_28
LBB0_23:
	movq	_TPM_CTRL_ERROR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_27
## %bb.24:
	movl	(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
	movl	16(%r14), %eax
	movq	_TPM_INF_NAK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_27
## %bb.25:
	movl	(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_26
LBB0_14:
	leaq	24(%r14), %rsi
	shlq	$2, %rdx
	movq	%r14, %rdi
	callq	_memmove
LBB0_15:
	addl	$-6, %r13d
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_number_of_wtx,8,3              ## @number_of_wtx
	.comm	_STAT_RDA,4,2                   ## @STAT_RDA
	.comm	_EIO,4,2                        ## @EIO
	.comm	_RDFIFO,4,2                     ## @RDFIFO
	.comm	_TPM_VL_VER,4,2                 ## @TPM_VL_VER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wrong transport protocol implementation!\n"

	.comm	_TPM_CTRL_DATA,4,2              ## @TPM_CTRL_DATA
L_.str.1:                               ## @.str.1
	.asciz	"Error handling on vendor layer!\n"

	.comm	_TPM_CTRL_WTX,4,2               ## @TPM_CTRL_WTX
L_.str.2:                               ## @.str.2
	.asciz	"WTX-package received\n"

	.comm	_TPM_MAX_WTX_PACKAGES,8,3       ## @TPM_MAX_WTX_PACKAGES
	.comm	_TPM_CTRL_WTX_ABORT_ACK,4,2     ## @TPM_CTRL_WTX_ABORT_ACK
L_.str.3:                               ## @.str.3
	.asciz	"WTX-abort acknowledged\n"

	.comm	_TPM_CTRL_ERROR,4,2             ## @TPM_CTRL_ERROR
L_.str.4:                               ## @.str.4
	.asciz	"ERROR-package received:\n"

	.comm	_TPM_INF_NAK,4,2                ## @TPM_INF_NAK
L_.str.5:                               ## @.str.5
	.asciz	"-> Negative acknowledgement - retransmit command!\n"

	.no_dead_strip	_tpm_inf_recv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tpm_inf_recv
_tpm_inf_recv:                          ; @tpm_inf_recv
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _number_of_wtx@GOTPAGE
Lloh1:
	ldr	x24, [x24, _number_of_wtx@GOTPAGEOFF]
	str	xzr, [x24]
Lloh2:
	adrp	x22, _STAT_RDA@GOTPAGE
Lloh3:
	ldr	x22, [x22, _STAT_RDA@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_wait
	cbz	w0, LBB0_3
LBB0_1:
Lloh4:
	adrp	x8, _EIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	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
LBB0_3:
Lloh7:
	adrp	x23, _RDFIFO@GOTPAGE
Lloh8:
	ldr	x23, [x23, _RDFIFO@GOTPAGEOFF]
Lloh9:
	adrp	x25, _TPM_VL_VER@GOTPAGE
Lloh10:
	ldr	x25, [x25, _TPM_VL_VER@GOTPAGEOFF]
Lloh11:
	adrp	x26, _TPM_CTRL_DATA@GOTPAGE
Lloh12:
	ldr	x26, [x26, _TPM_CTRL_DATA@GOTPAGEOFF]
Lloh13:
	adrp	x27, _TPM_CTRL_WTX@GOTPAGE
Lloh14:
	ldr	x27, [x27, _TPM_CTRL_WTX@GOTPAGEOFF]
Lloh15:
	adrp	x21, l_.str.2@PAGE
Lloh16:
	add	x21, x21, l_.str.2@PAGEOFF
Lloh17:
	adrp	x28, _TPM_MAX_WTX_PACKAGES@GOTPAGE
Lloh18:
	ldr	x28, [x28, _TPM_MAX_WTX_PACKAGES@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	bl	_tpm_wtx
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_wait
	cbnz	w0, LBB0_1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_tpm_data_in
	str	w0, [x20]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_wait
	cbnz	w0, LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x23]
	bl	_tpm_data_in
	str	w0, [x20, #4]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_wait
	cbnz	w0, LBB0_1
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x23]
	bl	_tpm_data_in
	str	w0, [x20, #8]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_wait
	cbnz	w0, LBB0_1
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x23]
	bl	_tpm_data_in
	str	w0, [x20, #12]
	ldr	w8, [x20]
	ldr	w9, [x25]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x20, #4]
	ldr	w9, [x26]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x27]
	cmp	w8, w9
	b.ne	LBB0_22
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19]
	mov	x1, x21
	bl	_dev_info
	ldr	x8, [x24]
	ldr	x9, [x28]
	mov	x0, x19
	cmp	x8, x9
	b.lt	LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	bl	_tpm_wtx_abort
	b	LBB0_5
LBB0_14:
	ldr	w0, [x19]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
LBB0_15:
	bl	_dev_err
	b	LBB0_1
LBB0_16:
	ldr	w8, [x20, #8]
	orr	w21, w0, w8, lsl #8
	cmp	w21, #1
	b.lt	LBB0_28
; %bb.17:
	mov	x24, x21
	mov	x25, x20
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_wait
	ldr	w0, [x23]
	bl	_tpm_data_in
	str	w0, [x25], #4
	subs	x24, x24, #1
	b.ne	LBB0_18
; %bb.19:
	mov	w8, #27904
	cmp	w21, w8
	b.ne	LBB0_27
; %bb.20:
	ldr	w8, [x20, #4]
	cmp	w8, #128
	b.ne	LBB0_27
; %bb.21:
	ldr	w0, [x19]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_22:
Lloh23:
	adrp	x9, _TPM_CTRL_WTX_ABORT_ACK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _TPM_CTRL_WTX_ABORT_ACK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_24
; %bb.23:
	ldr	w0, [x19]
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	mov	w0, #0
	b	LBB0_2
LBB0_24:
Lloh28:
	adrp	x9, _TPM_CTRL_ERROR@GOTPAGE
Lloh29:
	ldr	x9, [x9, _TPM_CTRL_ERROR@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_1
; %bb.25:
	ldr	w0, [x19]
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	ldr	w8, [x20, #16]
Lloh33:
	adrp	x9, _TPM_INF_NAK@GOTPAGE
Lloh34:
	ldr	x9, [x9, _TPM_INF_NAK@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_1
; %bb.26:
	ldr	w0, [x19]
Lloh36:
	adrp	x1, l_.str.5@PAGE
Lloh37:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_27:
	add	x1, x20, #24
	lsl	x2, x21, #2
	mov	x0, x20
	bl	_memmove
LBB0_28:
	sub	w0, w21, #6
	b	LBB0_2
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_number_of_wtx,8,3              ; @number_of_wtx
	.comm	_STAT_RDA,4,2                   ; @STAT_RDA
	.comm	_EIO,4,2                        ; @EIO
	.comm	_RDFIFO,4,2                     ; @RDFIFO
	.comm	_TPM_VL_VER,4,2                 ; @TPM_VL_VER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wrong transport protocol implementation!\n"

	.comm	_TPM_CTRL_DATA,4,2              ; @TPM_CTRL_DATA
l_.str.1:                               ; @.str.1
	.asciz	"Error handling on vendor layer!\n"

	.comm	_TPM_CTRL_WTX,4,2               ; @TPM_CTRL_WTX
l_.str.2:                               ; @.str.2
	.asciz	"WTX-package received\n"

	.comm	_TPM_MAX_WTX_PACKAGES,8,3       ; @TPM_MAX_WTX_PACKAGES
	.comm	_TPM_CTRL_WTX_ABORT_ACK,4,2     ; @TPM_CTRL_WTX_ABORT_ACK
l_.str.3:                               ; @.str.3
	.asciz	"WTX-abort acknowledged\n"

	.comm	_TPM_CTRL_ERROR,4,2             ; @TPM_CTRL_ERROR
l_.str.4:                               ; @.str.4
	.asciz	"ERROR-package received:\n"

	.comm	_TPM_INF_NAK,4,2                ; @TPM_INF_NAK
l_.str.5:                               ; @.str.5
	.asciz	"-> Negative acknowledgement - retransmit command!\n"

	.no_dead_strip	_tpm_inf_recv
.subsections_via_symbols
