	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hermes_read_pda
_hermes_read_pda:                       ## @hermes_read_pda
	.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
	movq	%rsi, %r15
	movq	%rdi, %rbx
	cmpq	$0, 8(%rdi)
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rax
	movq	_HERMES_CMD_READMIF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	*(%rax)
	movl	%eax, %r12d
	movl	%r14d, %r13d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	jne	LBB0_6
	jmp	LBB0_3
LBB0_2:
	leal	-2(%r14), %edi
	callq	_cpu_to_le16
	movl	%eax, (%r15)
	movl	$2048, %edi                     ## imm = 0x800
	callq	_cpu_to_le16
	movl	%eax, 4(%r15)
	leal	-4(%r14), %r13d
	leaq	8(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_3:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_hermes_aux_control
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	testl	%r12d, %r12d
	jne	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_hermes_aux_setaddr
	movq	_HERMES_AUXDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %ecx
	shrl	$31, %ecx
	addl	%r13d, %ecx
	sarl	%ecx
	movq	%rbx, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_hermes_read_words
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_hermes_aux_control
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	movl	(%r15), %edi
	callq	_le16_to_cpu
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	movl	$0, %r12d
	cmpl	%r14d, %ebx
	jle	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HERMES_CMD_READMIF,4,2         ## @HERMES_CMD_READMIF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AUX enable returned %d\n"

	.comm	_HERMES_AUXDATA,4,2             ## @HERMES_AUXDATA
L_.str.1:                               ## @.str.1
	.asciz	"AUX disable returned %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Actual PDA length %d, Max allowed %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_hermes_read_pda
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hermes_read_pda
_hermes_read_pda:                       ; @hermes_read_pda
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x21]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _HERMES_CMD_READMIF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HERMES_CMD_READMIF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	mov	x0, x21
	mov	w2, #0
	mov	x3, #0
	blr	x8
	mov	x24, x0
	mov	x25, x19
	mov	x23, x20
	cbnz	w0, LBB0_6
	b	LBB0_3
LBB0_2:
	sub	w0, w19, #2
	bl	_cpu_to_le16
	str	w0, [x20]
	mov	w0, #2048
	bl	_cpu_to_le16
	str	w0, [x20, #4]
	sub	w25, w19, #4
	add	x23, x20, #8
LBB0_3:
	mov	x0, x21
	mov	w1, #1
	bl	_hermes_aux_control
	mov	x24, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	bl	_pr_debug
	cbnz	w24, LBB0_6
; %bb.4:
	mov	x0, x21
	mov	x1, x22
	bl	_hermes_aux_setaddr
Lloh5:
	adrp	x8, _HERMES_AUXDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HERMES_AUXDATA@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	cmp	w25, #0
	cinc	w8, w25, lt
	asr	w3, w8, #1
	mov	x0, x21
	mov	x2, x23
	bl	_hermes_read_words
	mov	x0, x21
	mov	w1, #0
	bl	_hermes_aux_control
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	ldr	w0, [x20]
	bl	_le16_to_cpu
	mov	x20, x0
	str	x19, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_pr_debug
	cmp	w20, w19
	b.le	LBB0_6
; %bb.5:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_6:
	mov	x0, x24
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_HERMES_CMD_READMIF,4,2         ; @HERMES_CMD_READMIF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AUX enable returned %d\n"

	.comm	_HERMES_AUXDATA,4,2             ; @HERMES_AUXDATA
l_.str.1:                               ; @.str.1
	.asciz	"AUX disable returned %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Actual PDA length %d, Max allowed %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_hermes_read_pda
.subsections_via_symbols
