	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gptfind                        ## -- Begin function gptfind
	.p2align	4, 0x90
_gptfind:                               ## @gptfind
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%edx, %edx
	js	LBB0_5
## %bb.1:
	je	LBB0_3
## %bb.2:
	movq	_gpthdr@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	%edx, (%rax)
	jge	LBB0_4
LBB0_3:
	movq	_BOOTPROG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_printf
	jmp	LBB0_15
LBB0_5:
	movq	_curent@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leal	1(%r8), %edi
	movl	%edi, (%rax)
	movq	_gpthdr@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movl	(%rsi), %edx
	cmpl	%edx, %edi
	jge	LBB0_6
## %bb.7:
	movq	_bootonce@GOTPCREL(%rip), %r9
	cmpq	$0, (%r9)
	je	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rax), %edx
	incl	%edx
	movl	%edx, (%rax)
	movq	(%rcx), %rsi
	cmpl	(%rsi), %edx
	jl	LBB0_8
## %bb.9:
	movq	$0, (%r9)
	movl	$0, (%rax)
	movl	(%rsi), %edx
	xorl	%edi, %edi
LBB0_10:
	cmpl	%edx, %edi
	jge	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax), %edx
	incl	%edx
	movl	%edx, (%rax)
	movq	(%rcx), %rsi
	cmpl	(%rsi), %edx
	jl	LBB0_11
LBB0_12:
	cmpl	$-1, %r8d
	jne	LBB0_15
## %bb.13:
	movl	$0, (%rax)
	cmpl	$0, (%rsi)
	jle	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax), %edx
	incl	%edx
	movl	%edx, (%rax)
	movq	(%rcx), %rsi
	cmpl	(%rsi), %edx
	jl	LBB0_14
	jmp	LBB0_15
LBB0_4:
	movq	_BOOTPROG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_printf
	jmp	LBB0_15
LBB0_6:
	movl	%edx, (%rax)
LBB0_15:
	movl	$-1, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gpthdr,8,3                     ## @gpthdr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: invalid partition index\n"

	.comm	_BOOTPROG,8,3                   ## @BOOTPROG
	.comm	_gpttable,8,3                   ## @gpttable
L_.str.1:                               ## @.str.1
	.asciz	"%s: specified partition is not UFS\n"

	.comm	_curent,4,2                     ## @curent
	.comm	_bootonce,8,3                   ## @bootonce
	.comm	_GPT_ENT_ATTR_BOOTME,4,2        ## @GPT_ENT_ATTR_BOOTME
	.comm	_GPT_ENT_ATTR_BOOTONCE,4,2      ## @GPT_ENT_ATTR_BOOTONCE
	.comm	_hdr_primary_lba,8,3            ## @hdr_primary_lba
	.comm	_table_primary,8,3              ## @table_primary
L_.str.2:                               ## @.str.2
	.asciz	"primary"

	.comm	_hdr_primary,4,2                ## @hdr_primary
	.comm	_hdr_backup_lba,8,3             ## @hdr_backup_lba
	.comm	_table_backup,8,3               ## @table_backup
L_.str.3:                               ## @.str.3
	.asciz	"backup"

	.comm	_hdr_backup,4,2                 ## @hdr_backup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gptfind                        ; -- Begin function gptfind
	.p2align	2
_gptfind:                               ; @gptfind
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	tbnz	w2, #31, LBB0_4
; %bb.1:
	cbz	w2, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _gpthdr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _gpthdr@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w8, [x8]
	cmp	w8, w2
	b.ge	LBB0_8
LBB0_3:
Lloh3:
	adrp	x8, _BOOTPROG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BOOTPROG@GOTPAGEOFF]
Lloh5:
	ldr	x1, [x8]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	b	LBB0_16
LBB0_4:
Lloh8:
	adrp	x8, _curent@GOTPAGE
Lloh9:
	ldr	x8, [x8, _curent@GOTPAGEOFF]
	ldr	w10, [x8]
	add	w12, w10, #1
	str	w12, [x8]
Lloh10:
	adrp	x9, _gpthdr@GOTPAGE
Lloh11:
	ldr	x9, [x9, _gpthdr@GOTPAGEOFF]
	ldr	x11, [x9]
	ldr	w13, [x11]
	cmp	w12, w13
	b.ge	LBB0_9
; %bb.5:
Lloh12:
	adrp	x14, _bootonce@GOTPAGE
Lloh13:
	ldr	x14, [x14, _bootonce@GOTPAGEOFF]
	ldr	x15, [x14]
	cbz	x15, LBB0_12
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x8]
	add	w12, w11, #1
	str	w12, [x8]
	ldr	x11, [x9]
	ldr	w13, [x11]
	cmp	w12, w13
	b.lt	LBB0_6
; %bb.7:
	mov	w12, #0
	str	xzr, [x14]
	str	wzr, [x8]
	b	LBB0_11
LBB0_8:
Lloh14:
	adrp	x8, _BOOTPROG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BOOTPROG@GOTPAGEOFF]
Lloh16:
	ldr	x1, [x8]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	b	LBB0_16
LBB0_9:
	str	w13, [x8]
	b	LBB0_16
LBB0_10:
	ldr	w11, [x8]
	add	w12, w11, #1
	str	w12, [x8]
	ldr	x11, [x9]
LBB0_11:
	ldr	w13, [x11]
LBB0_12:
	cmp	w12, w13
	b.lt	LBB0_10
; %bb.13:
	cmn	w10, #1
	b.ne	LBB0_16
; %bb.14:
	str	wzr, [x8]
	ldr	w10, [x11]
	cmp	w10, #1
	b.lt	LBB0_16
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8]
	add	w10, w10, #1
	str	w10, [x8]
	ldr	x11, [x9]
	ldr	w11, [x11]
	cmp	w10, w11
	b.lt	LBB0_15
LBB0_16:
	mov	w0, #-1
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_gpthdr,8,3                     ; @gpthdr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: invalid partition index\n"

	.comm	_BOOTPROG,8,3                   ; @BOOTPROG
	.comm	_gpttable,8,3                   ; @gpttable
l_.str.1:                               ; @.str.1
	.asciz	"%s: specified partition is not UFS\n"

	.comm	_curent,4,2                     ; @curent
	.comm	_bootonce,8,3                   ; @bootonce
	.comm	_GPT_ENT_ATTR_BOOTME,4,2        ; @GPT_ENT_ATTR_BOOTME
	.comm	_GPT_ENT_ATTR_BOOTONCE,4,2      ; @GPT_ENT_ATTR_BOOTONCE
	.comm	_hdr_primary_lba,8,3            ; @hdr_primary_lba
	.comm	_table_primary,8,3              ; @table_primary
l_.str.2:                               ; @.str.2
	.asciz	"primary"

	.comm	_hdr_primary,4,2                ; @hdr_primary
	.comm	_hdr_backup_lba,8,3             ; @hdr_backup_lba
	.comm	_table_backup,8,3               ; @table_backup
l_.str.3:                               ; @.str.3
	.asciz	"backup"

	.comm	_hdr_backup,4,2                 ; @hdr_backup
.subsections_via_symbols
