	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_mbr
_read_mbr:                              ## @read_mbr
	.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
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MBRSIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %r13d
	leaq	(,%r13,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %r14
	movq	%rbx, %rdi
	callq	_open
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_err
LBB0_2:
	movl	(%r15), %edx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_read
	movq	%r15, %rbx
	movl	%eax, %r15d
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_err
LBB0_4:
	cmpl	(%rbx), %r15d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_errx
LBB0_6:
	movq	_OFF_MAGIC@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(%r12,%rax,4), %rdi
	callq	_cv2
	cmpl	$43605, %eax                    ## imm = 0xAA55
	je	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_errx
LBB0_8:
	movq	%r12, %rdi
	callq	_boot0bs
	testl	%eax, %eax
	je	LBB0_9
## %bb.14:
	movq	%r12, %rdi
	callq	_boot0version
	cmpl	$257, %eax                      ## imm = 0x101
	jne	LBB0_11
## %bb.15:
	movl	$1024, %edi                     ## imm = 0x400
	callq	_malloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_errx
LBB0_17:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_lseek
	cmpl	$-1, %eax
	je	LBB0_20
## %bb.18:
	movq	(%rbx), %rsi
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movl	$1024, %edx                     ## imm = 0x400
	callq	_read
	movl	%eax, %r15d
	cmpl	$-1, %eax
	jne	LBB0_21
## %bb.19:
	movl	$-1, %r15d
LBB0_20:
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_err
LBB0_21:
	movl	$1024, %r13d                    ## imm = 0x400
	cmpl	$1024, %r15d                    ## imm = 0x400
	je	LBB0_23
## %bb.22:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_errx
	jmp	LBB0_23
LBB0_9:
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
## %bb.10:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_errx
LBB0_11:
	shll	$2, %r13d
	movl	%r13d, %edi
	callq	_malloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_errx
	movq	(%rbx), %rax
LBB0_13:
	movq	%rax, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	callq	_memcpy
LBB0_23:
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_close
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.24:
	movl	%r13d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MBRSIZE,4,2                    ## @MBRSIZE
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open %s"

L_.str.1:                               ## @.str.1
	.asciz	"read %s"

L_.str.2:                               ## @.str.2
	.asciz	"%s: short read"

	.comm	_OFF_MAGIC,4,2                  ## @OFF_MAGIC
L_.str.3:                               ## @.str.3
	.asciz	"%s: bad magic"

L_.str.4:                               ## @.str.4
	.asciz	"%s: unknown or incompatible boot code"

L_.str.5:                               ## @.str.5
	.asciz	"%s: unable to allocate read buffer"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.6:                               ## @.str.6
	.asciz	"%s"

L_.str.7:                               ## @.str.7
	.asciz	"%s: unable to allocate MBR buffer"

	.no_dead_strip	_read_mbr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_mbr
_read_mbr:                              ; @read_mbr
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x24, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x26, _MBRSIZE@GOTPAGE
Lloh4:
	ldr	x26, [x26, _MBRSIZE@GOTPAGEOFF]
	ldr	w25, [x26]
	lsl	x8, x25, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
Lloh7:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_open
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_err
LBB0_2:
	ldr	w2, [x26]
	mov	x0, x19
	mov	x1, x22
	bl	_read
	mov	x23, x0
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_err
LBB0_4:
	ldr	w8, [x26]
	cmp	w23, w8
	b.eq	LBB0_6
; %bb.5:
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_errx
LBB0_6:
Lloh16:
	adrp	x8, _OFF_MAGIC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _OFF_MAGIC@GOTPAGEOFF]
Lloh18:
	ldrsw	x8, [x8]
	add	x0, x22, x8, lsl #2
	bl	_cv2
	mov	w8, #43605
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.7:
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_errx
LBB0_8:
	mov	x0, x22
	bl	_boot0bs
	cbz	w0, LBB0_17
; %bb.9:
	mov	x0, x22
	bl	_boot0version
	cmp	w0, #257
	b.ne	LBB0_19
; %bb.10:
	mov	w0, #1024
	bl	_malloc
	str	x0, [x21]
	cbnz	x0, LBB0_12
; %bb.11:
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_errx
LBB0_12:
Lloh23:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_lseek
	cmn	w0, #1
	b.eq	LBB0_14
; %bb.13:
	ldr	x1, [x21]
	mov	x0, x19
	mov	w2, #1024
	bl	_read
	mov	x23, x0
	cmn	w0, #1
	b.ne	LBB0_15
LBB0_14:
Lloh26:
	adrp	x1, l_.str.6@PAGE
Lloh27:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_err
LBB0_15:
	cmp	w23, #1024
	b.eq	LBB0_22
; %bb.16:
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_errx
	mov	w23, #1024
	b	LBB0_22
LBB0_17:
	cbz	w24, LBB0_19
; %bb.18:
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_errx
LBB0_19:
	lsl	w23, w25, #2
	mov	x0, x23
	bl	_malloc
	str	x0, [x21]
	cbnz	x0, LBB0_21
; %bb.20:
Lloh32:
	adrp	x1, l_.str.7@PAGE
Lloh33:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_errx
	ldr	x0, [x21]
LBB0_21:
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
LBB0_22:
	mov	x0, x19
	bl	_close
	ldur	x8, [x29, #-72]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.23:
	mov	x0, x23
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_MBRSIZE,4,2                    ; @MBRSIZE
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open %s"

l_.str.1:                               ; @.str.1
	.asciz	"read %s"

l_.str.2:                               ; @.str.2
	.asciz	"%s: short read"

	.comm	_OFF_MAGIC,4,2                  ; @OFF_MAGIC
l_.str.3:                               ; @.str.3
	.asciz	"%s: bad magic"

l_.str.4:                               ; @.str.4
	.asciz	"%s: unknown or incompatible boot code"

l_.str.5:                               ; @.str.5
	.asciz	"%s: unable to allocate read buffer"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.6:                               ; @.str.6
	.asciz	"%s"

l_.str.7:                               ; @.str.7
	.asciz	"%s: unable to allocate MBR buffer"

	.no_dead_strip	_read_mbr
.subsections_via_symbols
