	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gptread                        ## -- Begin function gptread
	.p2align	4, 0x90
_gptread:                               ## @gptread
	.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	%rdi, %rbx
	movq	_secbuf@GOTPCREL(%rip), %rax
	movq	%rsi, (%rax)
	movq	_hdr_backup_lba@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_hdr_primary_lba@GOTPCREL(%rip), %r12
	movq	$0, (%r12)
	movq	_curent@GOTPCREL(%rip), %rax
	movl	$-1, (%rax)
	movq	_bootonce@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	$0, (%rdi)
	leaq	L_.str(%rip), %rdi
	movq	_hdr_primary@GOTPCREL(%rip), %r14
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	_gptread_hdr
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movq	_table_primary@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	leaq	L_.str(%rip), %rdi
	movq	_hdr_primary@GOTPCREL(%rip), %r15
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_gptread_table
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	movq	(%r12), %rax
	testq	%rax, %rax
	jle	LBB0_6
LBB0_5:
	movl	8(%r14), %ecx
	jmp	LBB0_7
LBB0_2:
	movq	(%r15), %rax
	movq	%rax, (%r12)
	movq	_gpthdr@GOTPCREL(%rip), %rcx
	movq	%r15, (%rcx)
	movl	(%r13), %ecx
	movq	_gpttable@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	testq	%rax, %rax
	jg	LBB0_5
LBB0_6:
	movq	%rbx, %rdi
	callq	_drvsize
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	setg	%al
	subl	%eax, %ecx
LBB0_7:
	testl	%ecx, %ecx
	movq	_hdr_backup_lba@GOTPCREL(%rip), %r13
	je	LBB0_8
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	movq	_hdr_backup@GOTPCREL(%rip), %rdx
	movq	%rbx, %rsi
	callq	_gptread_hdr
	testq	%rax, %rax
	jne	LBB0_14
## %bb.10:
	movq	_table_backup@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	L_.str.2(%rip), %rdi
	movq	_hdr_backup@GOTPCREL(%rip), %r14
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_gptread_table
	testq	%rax, %rax
	jne	LBB0_14
## %bb.11:
	movq	(%r14), %rax
	movq	%rax, (%r13)
	cmpq	$0, (%r12)
	jne	LBB0_15
## %bb.12:
	movq	_gpthdr@GOTPCREL(%rip), %rax
	movq	%r14, (%rax)
	movl	(%r15), %eax
	movq	_gpttable@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_13
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
LBB0_13:
	movq	_BOOTPROG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_printf
LBB0_14:
	cmpq	$0, (%r12)
	je	LBB0_16
LBB0_15:
	movq	_table_primary@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rdi
	movq	_hdr_primary@GOTPCREL(%rip), %rdx
	movq	%rbx, %rsi
	callq	_gptbootconv
LBB0_16:
	cmpq	$0, (%r13)
	je	LBB0_17
## %bb.18:
	movq	_table_backup@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.2(%rip), %rdi
	movq	_hdr_backup@GOTPCREL(%rip), %rdx
	movq	%rbx, %rsi
	callq	_gptbootconv
	cmpq	$0, (%r13)
	sete	%al
	jmp	LBB0_19
LBB0_17:
	movb	$1, %al
LBB0_19:
	cmpq	$0, (%r12)
	sete	%cl
	andb	%al, %cl
	movzbl	%cl, %eax
	negl	%eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_secbuf,8,3                     ## @secbuf
	.comm	_hdr_backup_lba,8,3             ## @hdr_backup_lba
	.comm	_hdr_primary_lba,8,3            ## @hdr_primary_lba
	.comm	_curent,4,2                     ## @curent
	.comm	_bootonce,4,2                   ## @bootonce
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"primary"

	.comm	_hdr_primary,16,3               ## @hdr_primary
	.comm	_table_primary,4,2              ## @table_primary
	.comm	_gpthdr,8,3                     ## @gpthdr
	.comm	_gpttable,4,2                   ## @gpttable
L_.str.1:                               ## @.str.1
	.asciz	"%s: unable to locate backup GPT header\n"

	.comm	_BOOTPROG,8,3                   ## @BOOTPROG
L_.str.2:                               ## @.str.2
	.asciz	"backup"

	.comm	_hdr_backup,16,3                ## @hdr_backup
	.comm	_table_backup,4,2               ## @table_backup
L_.str.3:                               ## @.str.3
	.asciz	"%s: using backup GPT\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gptread                        ; -- Begin function gptread
	.p2align	2
_gptread:                               ; @gptread
	.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	x19, x0
Lloh0:
	adrp	x8, _secbuf@GOTPAGE
Lloh1:
	ldr	x8, [x8, _secbuf@GOTPAGEOFF]
Lloh2:
	str	x1, [x8]
Lloh3:
	adrp	x23, _hdr_backup_lba@GOTPAGE
Lloh4:
	ldr	x23, [x23, _hdr_backup_lba@GOTPAGEOFF]
	str	xzr, [x23]
Lloh5:
	adrp	x22, _hdr_primary_lba@GOTPAGE
Lloh6:
	ldr	x22, [x22, _hdr_primary_lba@GOTPAGEOFF]
	str	xzr, [x22]
Lloh7:
	adrp	x8, _curent@GOTPAGE
Lloh8:
	ldr	x8, [x8, _curent@GOTPAGEOFF]
	mov	w9, #-1
Lloh9:
	str	w9, [x8]
Lloh10:
	adrp	x8, _bootonce@GOTPAGE
Lloh11:
	ldr	x8, [x8, _bootonce@GOTPAGEOFF]
	mov	w9, #1
Lloh12:
	str	w9, [x8]
	str	xzr, [x0]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
Lloh15:
	adrp	x20, _hdr_primary@GOTPAGE
Lloh16:
	ldr	x20, [x20, _hdr_primary@GOTPAGEOFF]
	mov	x1, x19
	mov	x2, x20
	mov	w3, #1
	bl	_gptread_hdr
Lloh17:
	adrp	x24, _table_primary@GOTPAGE
Lloh18:
	ldr	x24, [x24, _table_primary@GOTPAGEOFF]
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w3, [x24]
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
Lloh21:
	adrp	x21, _hdr_primary@GOTPAGE
Lloh22:
	ldr	x21, [x21, _hdr_primary@GOTPAGEOFF]
	mov	x1, x19
	mov	x2, x21
	bl	_gptread_table
	cbz	x0, LBB0_8
LBB0_2:
	ldr	x8, [x22]
	cmp	x8, #1
	b.lt	LBB0_9
LBB0_3:
	ldr	w3, [x20, #8]
	cbz	w3, LBB0_10
LBB0_4:
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh25:
	adrp	x2, _hdr_backup@GOTPAGE
Lloh26:
	ldr	x2, [x2, _hdr_backup@GOTPAGEOFF]
	mov	x1, x19
	bl	_gptread_hdr
	cbnz	x0, LBB0_12
; %bb.5:
Lloh27:
	adrp	x21, _table_backup@GOTPAGE
Lloh28:
	ldr	x21, [x21, _table_backup@GOTPAGEOFF]
	ldr	w3, [x21]
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh31:
	adrp	x20, _hdr_backup@GOTPAGE
Lloh32:
	ldr	x20, [x20, _hdr_backup@GOTPAGEOFF]
	mov	x1, x19
	mov	x2, x20
	bl	_gptread_table
	cbnz	x0, LBB0_12
; %bb.6:
	ldr	x8, [x20]
	str	x8, [x23]
	ldr	x8, [x22]
	cbnz	x8, LBB0_13
; %bb.7:
Lloh33:
	adrp	x8, _gpthdr@GOTPAGE
Lloh34:
	ldr	x8, [x8, _gpthdr@GOTPAGEOFF]
Lloh35:
	str	x20, [x8]
	ldr	w8, [x21]
Lloh36:
	adrp	x9, _gpttable@GOTPAGE
Lloh37:
	ldr	x9, [x9, _gpttable@GOTPAGEOFF]
Lloh38:
	str	w8, [x9]
Lloh39:
	adrp	x0, l_.str.3@PAGE
Lloh40:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_8:
	ldr	x8, [x21]
Lloh41:
	adrp	x9, _gpthdr@GOTPAGE
Lloh42:
	ldr	x9, [x9, _gpthdr@GOTPAGEOFF]
	str	x8, [x22]
Lloh43:
	str	x21, [x9]
	ldr	w9, [x24]
Lloh44:
	adrp	x10, _gpttable@GOTPAGE
Lloh45:
	ldr	x10, [x10, _gpttable@GOTPAGEOFF]
Lloh46:
	str	w9, [x10]
	cmp	x8, #1
	b.ge	LBB0_3
LBB0_9:
	mov	x0, x19
	bl	_drvsize
	cmp	w0, #0
	cset	w8, gt
	sub	w3, w0, w8
	cbnz	w3, LBB0_4
LBB0_10:
Lloh47:
	adrp	x0, l_.str.1@PAGE
Lloh48:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
Lloh49:
	adrp	x8, _BOOTPROG@GOTPAGE
Lloh50:
	ldr	x8, [x8, _BOOTPROG@GOTPAGEOFF]
Lloh51:
	ldr	x1, [x8]
	bl	_printf
LBB0_12:
	ldr	x8, [x22]
	cbz	x8, LBB0_14
LBB0_13:
	ldr	w3, [x24]
Lloh52:
	adrp	x0, l_.str@PAGE
Lloh53:
	add	x0, x0, l_.str@PAGEOFF
Lloh54:
	adrp	x2, _hdr_primary@GOTPAGE
Lloh55:
	ldr	x2, [x2, _hdr_primary@GOTPAGEOFF]
	mov	x1, x19
	bl	_gptbootconv
LBB0_14:
	ldr	x8, [x23]
	cbz	x8, LBB0_16
; %bb.15:
Lloh56:
	adrp	x8, _table_backup@GOTPAGE
Lloh57:
	ldr	x8, [x8, _table_backup@GOTPAGEOFF]
Lloh58:
	ldr	w3, [x8]
Lloh59:
	adrp	x0, l_.str.2@PAGE
Lloh60:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh61:
	adrp	x2, _hdr_backup@GOTPAGE
Lloh62:
	ldr	x2, [x2, _hdr_backup@GOTPAGEOFF]
	mov	x1, x19
	bl	_gptbootconv
	ldr	x8, [x23]
	cmp	x8, #0
	cset	w8, eq
	b	LBB0_17
LBB0_16:
	mov	w8, #1
LBB0_17:
	ldr	x9, [x22]
	cmp	x9, #0
	cset	w9, eq
	and	w8, w9, w8
	sbfx	w0, w8, #0, #1
	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
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotStr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotStr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotStr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotStr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh54, Lloh55
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh61, Lloh62
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_secbuf,8,3                     ; @secbuf
	.comm	_hdr_backup_lba,8,3             ; @hdr_backup_lba
	.comm	_hdr_primary_lba,8,3            ; @hdr_primary_lba
	.comm	_curent,4,2                     ; @curent
	.comm	_bootonce,4,2                   ; @bootonce
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"primary"

	.comm	_hdr_primary,16,3               ; @hdr_primary
	.comm	_table_primary,4,2              ; @table_primary
	.comm	_gpthdr,8,3                     ; @gpthdr
	.comm	_gpttable,4,2                   ; @gpttable
l_.str.1:                               ; @.str.1
	.asciz	"%s: unable to locate backup GPT header\n"

	.comm	_BOOTPROG,8,3                   ; @BOOTPROG
l_.str.2:                               ; @.str.2
	.asciz	"backup"

	.comm	_hdr_backup,16,3                ; @hdr_backup
	.comm	_table_backup,4,2               ; @table_backup
l_.str.3:                               ; @.str.3
	.asciz	"%s: using backup GPT\n"

.subsections_via_symbols
