	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ptable_bsdread
_ptable_bsdread:                        ## @ptable_bsdread
	.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
	movq	%rdi, %r12
	movl	(%rdi), %edi
	cmpl	$39, %edi
	ja	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DPRINTF
	jmp	LBB0_20
LBB0_2:
	movq	%rdx, %r15
	movq	%rsi, %rbx
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_20
## %bb.3:
	movq	%rax, %r14
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$1, %edx
	movl	$1, %ecx
	callq	*%r15
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPRINTF
	movq	%r12, %rdi
	callq	_ptable_close
	xorl	%r12d, %r12d
LBB0_19:
	movq	%r14, %rdi
	callq	_free
LBB0_20:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	(%r14), %rdi
	callq	_le32toh
	movq	_DISKMAGIC@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	je	LBB0_7
## %bb.6:
	movq	8(%r14), %rdi
	callq	_le32toh
	cmpl	(%rbx), %eax
	jne	LBB0_19
LBB0_7:
	movq	16(%r14), %rdi
	callq	_le32toh
	cmpl	(%r12), %eax
	jne	LBB0_8
## %bb.9:
	movl	24(%r14), %edi
	callq	_le16toh
	movl	%eax, 24(%r14)
	addl	$-21, %eax
	cmpl	$-14, %eax
	ja	LBB0_11
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	callq	_DPRINTF
	jmp	LBB0_19
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	callq	_DPRINTF
	jmp	LBB0_19
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
	callq	_DPRINTF
	movq	32(%r14), %r15
	movq	_RAW_PART@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	leaq	(%rax,%rax,2), %rax
	movq	(%r15,%rax,8), %rdi
	callq	_le32toh
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	24(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.12:
	leaq	8(%r12), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	addq	$16, %r15
	xorl	%r14d, %r14d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	addq	$24, %r15
	cmpq	%rcx, %r14
	jge	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpq	(%rbx), %r14
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpq	$0, -8(%r15)
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	$20, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%rax, %r13
	movq	-16(%r15), %rdi
	callq	_le32toh
	movl	%eax, %ebx
	subl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%ebx, 4(%r13)
	movq	-8(%r15), %rdi
	callq	_le32toh
                                        ## kill: def $eax killed $eax def $rax
	addl	%ebx, %eax
	decl	%eax
	movq	_RAW_PART@GOTPCREL(%rip), %rbx
	movl	%eax, 8(%r13)
	movl	(%r15), %edi
	callq	_bsd_parttype
	movl	%eax, 16(%r13)
	movl	%r14d, 12(%r13)
	movl	(%r15), %eax
	movl	%eax, (%r13)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r13, %rdx
	callq	_STAILQ_INSERT_TAIL
	leaq	L_.str.5(%rip), %rdi
	callq	_DPRINTF
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	24(%rax), %eax
	jmp	LBB0_17
LBB0_18:
	movq	_PTABLE_BSD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r12)
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Too small sectorsize"

L_.str.1:                               ## @.str.1
	.asciz	"read failed"

	.comm	_DISKMAGIC,4,2                  ## @DISKMAGIC
L_.str.2:                               ## @.str.2
	.asciz	"unsupported sector size"

L_.str.3:                               ## @.str.3
	.asciz	"invalid number of partitions"

L_.str.4:                               ## @.str.4
	.asciz	"BSD detected"

	.comm	_RAW_PART,8,3                   ## @RAW_PART
L_.str.5:                               ## @.str.5
	.asciz	"new BSD partition added"

	.comm	_PTABLE_BSD,4,2                 ## @PTABLE_BSD
	.no_dead_strip	_ptable_bsdread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ptable_bsdread
_ptable_bsdread:                        ; @ptable_bsdread
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	w0, [x0]
	cmp	w0, #39
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINTF
	b	LBB0_6
LBB0_2:
	mov	x21, x2
	mov	x22, x1
	bl	_malloc
	cbz	x0, LBB0_6
; %bb.3:
	mov	x20, x0
	mov	x0, x22
	mov	x1, x20
	mov	w2, #1
	mov	w3, #1
	blr	x21
	cbz	x0, LBB0_7
; %bb.4:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPRINTF
	mov	x0, x19
	bl	_ptable_close
	mov	x19, #0
LBB0_5:
	mov	x0, x20
	bl	_free
LBB0_6:
	mov	x0, x19
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	x0, [x20]
	bl	_le32toh
Lloh4:
	adrp	x21, _DISKMAGIC@GOTPAGE
Lloh5:
	ldr	x21, [x21, _DISKMAGIC@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_9
; %bb.8:
	ldr	x0, [x20, #8]
	bl	_le32toh
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_5
LBB0_9:
	ldr	x0, [x20, #16]
	bl	_le32toh
	ldr	w8, [x19]
	cmp	w0, w8
	b.ne	LBB0_12
; %bb.10:
	ldr	w0, [x20, #24]
	bl	_le16toh
	str	w0, [x20, #24]
	sub	w8, w0, #21
	cmn	w8, #14
	b.hi	LBB0_13
; %bb.11:
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DPRINTF
	b	LBB0_5
LBB0_12:
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DPRINTF
	b	LBB0_5
LBB0_13:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DPRINTF
Lloh12:
	adrp	x25, _RAW_PART@GOTPAGE
Lloh13:
	ldr	x25, [x25, _RAW_PART@GOTPAGEOFF]
	ldr	x23, [x20, #32]
	ldr	x8, [x25]
	mov	w9, #24
	mul	x8, x8, x9
	ldr	x0, [x23, x8]
	bl	_le32toh
	ldr	w8, [x20, #24]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.14:
	mov	x21, x0
	mov	x26, #0
	add	x22, x19, #8
	add	x27, x23, #16
Lloh14:
	adrp	x23, l_.str.5@PAGE
Lloh15:
	add	x23, x23, l_.str.5@PAGEOFF
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x26, x26, #1
	add	x27, x27, #24
	cmp	x26, w8, sxtw
	b.ge	LBB0_20
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x25]
	cmp	x26, x9
	b.eq	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldur	x9, [x27, #-8]
	cbz	x9, LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w0, #20
	bl	_malloc
	cbz	x0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x24, x0
	ldur	x0, [x27, #-16]
	bl	_le32toh
	sub	w28, w0, w21
	str	w28, [x24, #4]
	ldur	x0, [x27, #-8]
	bl	_le32toh
	add	w8, w28, w0
	sub	w8, w8, #1
	str	w8, [x24, #8]
	ldr	w0, [x27]
	bl	_bsd_parttype
	stp	w26, w0, [x24, #12]
	ldr	w8, [x27]
	str	w8, [x24]
	mov	x0, x22
	mov	x1, x24
	mov	x2, x24
	bl	_STAILQ_INSERT_TAIL
	mov	x0, x23
	bl	_DPRINTF
	ldr	w8, [x20, #24]
	b	LBB0_15
LBB0_20:
Lloh16:
	adrp	x8, _PTABLE_BSD@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PTABLE_BSD@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Too small sectorsize"

l_.str.1:                               ; @.str.1
	.asciz	"read failed"

	.comm	_DISKMAGIC,4,2                  ; @DISKMAGIC
l_.str.2:                               ; @.str.2
	.asciz	"unsupported sector size"

l_.str.3:                               ; @.str.3
	.asciz	"invalid number of partitions"

l_.str.4:                               ; @.str.4
	.asciz	"BSD detected"

	.comm	_RAW_PART,8,3                   ; @RAW_PART
l_.str.5:                               ; @.str.5
	.asciz	"new BSD partition added"

	.comm	_PTABLE_BSD,4,2                 ; @PTABLE_BSD
	.no_dead_strip	_ptable_bsdread
.subsections_via_symbols
