	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_getdisklabel                   ## -- Begin function getdisklabel
	.p2align	4, 0x90
_getdisklabel:                          ## @getdisklabel
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_is_file@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.1:
	movq	_disk@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_bootarea@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movq	_BBSIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	callq	_read
	cmpq	(%rbx), %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movl	$4, %edi
	callq	_err
LBB0_3:
	movq	_sectorsize@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	addq	(%r14), %rdi
	movq	_MAXPARTITIONS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	_getdisklabel.lab(%rip), %rbx
	movq	%rbx, %rsi
	callq	_bsd_disklabel_le_dec
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_errx
	jmp	LBB0_8
LBB0_5:
	movq	_disktype@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_getdiskbyname
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_8
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_getdisklabel.lab,4,2 ## @getdisklabel.lab
	.comm	_is_file,8,3                    ## @is_file
	.comm	_disk,4,2                       ## @disk
	.comm	_bootarea,8,3                   ## @bootarea
	.comm	_BBSIZE,8,3                     ## @BBSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot read bootarea"

	.comm	_sectorsize,4,2                 ## @sectorsize
	.comm	_MAXPARTITIONS,4,2              ## @MAXPARTITIONS
L_.str.1:                               ## @.str.1
	.asciz	"no valid label found"

	.comm	_disktype,8,3                   ## @disktype
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_getdisklabel                   ; -- Begin function getdisklabel
	.p2align	2
_getdisklabel:                          ; @getdisklabel
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _is_file@GOTPAGE
Lloh1:
	ldr	x8, [x8, _is_file@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _disk@GOTPAGE
Lloh4:
	ldr	x8, [x8, _disk@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x19, _bootarea@GOTPAGE
Lloh7:
	ldr	x19, [x19, _bootarea@GOTPAGEOFF]
	ldr	x1, [x19]
Lloh8:
	adrp	x20, _BBSIZE@GOTPAGE
Lloh9:
	ldr	x20, [x20, _BBSIZE@GOTPAGEOFF]
	ldr	x2, [x20]
	bl	_read
	ldr	x8, [x20]
	cmp	x0, x8
	b.eq	LBB0_3
; %bb.2:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	bl	_err
LBB0_3:
Lloh12:
	adrp	x8, _sectorsize@GOTPAGE
Lloh13:
	ldr	x8, [x8, _sectorsize@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh14:
	ldrsw	x8, [x8]
	add	x0, x9, x8
Lloh15:
	adrp	x8, _MAXPARTITIONS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAXPARTITIONS@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x19, _getdisklabel.lab@PAGE
Lloh19:
	add	x19, x19, _getdisklabel.lab@PAGEOFF
	mov	x1, x19
	bl	_bsd_disklabel_le_dec
	cbz	x0, LBB0_8
; %bb.4:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
Lloh22:
	adrp	x19, _getdisklabel.lab@PAGE
Lloh23:
	add	x19, x19, _getdisklabel.lab@PAGEOFF
	b	LBB0_8
LBB0_5:
Lloh24:
	adrp	x8, _disktype@GOTPAGE
Lloh25:
	ldr	x8, [x8, _disktype@GOTPAGEOFF]
Lloh26:
	ldr	x0, [x8]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_getdiskbyname
	mov	x19, x0
	cbnz	x0, LBB0_8
LBB0_7:
	mov	x19, #0
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_getdisklabel.lab,4,2 ; @getdisklabel.lab
	.comm	_is_file,8,3                    ; @is_file
	.comm	_disk,4,2                       ; @disk
	.comm	_bootarea,8,3                   ; @bootarea
	.comm	_BBSIZE,8,3                     ; @BBSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot read bootarea"

	.comm	_sectorsize,4,2                 ; @sectorsize
	.comm	_MAXPARTITIONS,4,2              ; @MAXPARTITIONS
l_.str.1:                               ; @.str.1
	.asciz	"no valid label found"

	.comm	_disktype,8,3                   ; @disktype
.subsections_via_symbols
