	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gptread_hdr
_gptread_hdr:                           ## @gptread_hdr
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %rax
	movq	%rdi, %r14
	movq	_secbuf@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rax, %rdi
	movq	%rcx, %rdx
	movl	$1, %ecx
	callq	_drvread
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_BOOTPROG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_3:
	movl	(%r12), %edi
	movq	%r15, %rsi
	movl	$40, %edx
	callq	_bcopy
	movl	36(%r15), %edi
	movq	_GPT_HDR_SIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_bcmp
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:
	cmpq	%rbx, (%r15)
	jne	LBB0_9
## %bb.5:
	cmpl	$65536, 8(%r15)                 ## imm = 0x10000
	jl	LBB0_9
## %bb.6:
	movl	12(%r15), %ecx
	cmpl	$4, %ecx
	jb	LBB0_9
## %bb.7:
	movq	16(%r15), %rax
	movq	_MAXTBLENTS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jg	LBB0_9
## %bb.8:
	movq	_DEV_BSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	LBB0_10
LBB0_9:
	movq	_BOOTPROG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	movq	%r14, %rdx
	callq	_printf
	movl	$-1, %eax
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	24(%r15), %rbx
	movq	$0, 24(%r15)
	movl	32(%r15), %esi
	movq	%r15, %rdi
	callq	_crc32
	cmpq	%rbx, %rax
	jne	LBB0_11
## %bb.12:
	movq	%rbx, 24(%r15)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_11:
	movq	_BOOTPROG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_secbuf,4,2                     ## @secbuf
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: unable to read %s GPT header\n"

	.comm	_BOOTPROG,8,3                   ## @BOOTPROG
	.comm	_GPT_HDR_SIG,4,2                ## @GPT_HDR_SIG
	.comm	_MAXTBLENTS,8,3                 ## @MAXTBLENTS
	.comm	_DEV_BSIZE,4,2                  ## @DEV_BSIZE
L_.str.1:                               ## @.str.1
	.asciz	"%s: invalid %s GPT header\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: %s GPT header checksum mismatch\n"

	.no_dead_strip	_gptread_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gptread_hdr
_gptread_hdr:                           ; @gptread_hdr
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x8, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _secbuf@GOTPAGE
Lloh1:
	ldr	x22, [x22, _secbuf@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x8
	mov	x2, x3
	mov	w3, #1
	bl	_drvread
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _BOOTPROG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BOOTPROG@GOTPAGEOFF]
Lloh4:
	ldr	x1, [x8]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_2:
	ldr	w0, [x22]
	mov	x1, x20
	mov	w2, #40
	bl	_bcopy
	ldr	w0, [x20, #36]
Lloh7:
	adrp	x8, _GPT_HDR_SIG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GPT_HDR_SIG@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_bcmp
	cbnz	x0, LBB0_8
; %bb.3:
	ldr	x8, [x20]
	cmp	x8, x21
	b.ne	LBB0_8
; %bb.4:
	ldr	w8, [x20, #8]
	cmp	w8, #16, lsl #12                ; =65536
	b.lt	LBB0_8
; %bb.5:
	ldr	w8, [x20, #12]
	cmp	w8, #4
	b.lo	LBB0_8
; %bb.6:
	ldr	x9, [x20, #16]
Lloh10:
	adrp	x10, _MAXTBLENTS@GOTPAGE
Lloh11:
	ldr	x10, [x10, _MAXTBLENTS@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	cmp	x9, x10
	b.gt	LBB0_8
; %bb.7:
Lloh13:
	adrp	x9, _DEV_BSIZE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _DEV_BSIZE@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
	cbz	w8, LBB0_11
LBB0_8:
Lloh16:
	adrp	x8, _BOOTPROG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BOOTPROG@GOTPAGEOFF]
Lloh18:
	ldr	x1, [x8]
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	mov	x2, x19
	bl	_printf
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	x21, [x20, #24]
	str	xzr, [x20, #24]
	ldr	w1, [x20, #32]
	mov	x0, x20
	bl	_crc32
	cmp	x0, x21
	b.ne	LBB0_13
; %bb.12:
	mov	w0, #0
	str	x21, [x20, #24]
	b	LBB0_10
LBB0_13:
Lloh21:
	adrp	x8, _BOOTPROG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BOOTPROG@GOTPAGEOFF]
Lloh23:
	ldr	x1, [x8]
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_secbuf,4,2                     ; @secbuf
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: unable to read %s GPT header\n"

	.comm	_BOOTPROG,8,3                   ; @BOOTPROG
	.comm	_GPT_HDR_SIG,4,2                ; @GPT_HDR_SIG
	.comm	_MAXTBLENTS,8,3                 ; @MAXTBLENTS
	.comm	_DEV_BSIZE,4,2                  ; @DEV_BSIZE
l_.str.1:                               ; @.str.1
	.asciz	"%s: invalid %s GPT header\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: %s GPT header checksum mismatch\n"

	.no_dead_strip	_gptread_hdr
.subsections_via_symbols
