	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _kvm_read_kernel_ehdr
__kvm_read_kernel_ehdr:                 ## @_kvm_read_kernel_ehdr
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_EV_CURRENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_elf_version
	movq	_EV_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_10
LBB0_2:
	movl	16(%rbx), %edi
	movq	_ELF_C_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_elf_begin
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_elf_kind
	movq	_ELF_K_ELF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.6:
	leaq	8(%rbx), %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_gelf_getehdr
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	callq	_elf_end
	movq	(%r15), %rax
	movq	_EI_DATA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %ecx
	andl	$-2, %ecx
	xorl	%eax, %eax
	cmpl	$128, %ecx
	je	LBB0_12
## %bb.9:
	movl	(%rbx), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_10
LBB0_3:
	movl	(%rbx), %r14d
	xorl	%edi, %edi
	callq	_elf_errmsg
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	__kvm_err
	jmp	LBB0_11
LBB0_5:
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdx
LBB0_10:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	__kvm_err
LBB0_11:
	movl	$-1, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%rbx), %r15d
	xorl	%edi, %edi
	callq	_elf_errmsg
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	__kvm_err
	movq	%r14, %rdi
	callq	_elf_end
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EV_CURRENT,4,2                 ## @EV_CURRENT
	.comm	_EV_NONE,8,3                    ## @EV_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported libelf"

	.comm	_ELF_C_READ,4,2                 ## @ELF_C_READ
L_.str.1:                               ## @.str.1
	.asciz	"%s"

	.comm	_ELF_K_ELF,8,3                  ## @ELF_K_ELF
L_.str.2:                               ## @.str.2
	.asciz	"kernel is not an ELF file"

	.comm	_EI_DATA,8,3                    ## @EI_DATA
L_.str.3:                               ## @.str.3
	.asciz	"unsupported ELF data encoding for kernel"

	.no_dead_strip	__kvm_read_kernel_ehdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _kvm_read_kernel_ehdr
__kvm_read_kernel_ehdr:                 ; @_kvm_read_kernel_ehdr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _EV_CURRENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EV_CURRENT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_elf_version
Lloh3:
	adrp	x8, _EV_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EV_NONE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
	ldr	w1, [x19]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_11
LBB0_2:
	ldr	w0, [x19, #16]
Lloh8:
	adrp	x8, _ELF_C_READ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ELF_C_READ@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_elf_begin
	cbz	x0, LBB0_7
; %bb.3:
	mov	x20, x0
	bl	_elf_kind
Lloh11:
	adrp	x8, _ELF_K_ELF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ELF_K_ELF@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:
	add	x21, x19, #8
	mov	x0, x20
	mov	x1, x21
	bl	_gelf_getehdr
	cbz	x0, LBB0_9
; %bb.5:
	mov	x0, x20
	bl	_elf_end
Lloh14:
	adrp	x8, _EI_DATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EI_DATA@GOTPAGEOFF]
	ldr	x9, [x21]
Lloh16:
	ldr	x8, [x8]
	ldr	w8, [x9, x8, lsl #2]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_10
; %bb.6:
	mov	w0, #0
	b	LBB0_14
LBB0_7:
	ldr	w20, [x19]
	bl	_elf_errmsg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	b	LBB0_12
LBB0_8:
	ldr	w1, [x19]
Lloh19:
	adrp	x2, l_.str.2@PAGE
Lloh20:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_9:
	ldr	w21, [x19]
	bl	_elf_errmsg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh21:
	adrp	x2, l_.str.1@PAGE
Lloh22:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	__kvm_err
	mov	x0, x20
	bl	_elf_end
	b	LBB0_13
LBB0_10:
	ldr	w1, [x19]
Lloh23:
	adrp	x2, l_.str.3@PAGE
Lloh24:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_11:
	mov	x0, x19
LBB0_12:
	bl	__kvm_err
LBB0_13:
	mov	w0, #-1
LBB0_14:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EV_CURRENT,4,2                 ; @EV_CURRENT
	.comm	_EV_NONE,8,3                    ; @EV_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported libelf"

	.comm	_ELF_C_READ,4,2                 ; @ELF_C_READ
l_.str.1:                               ; @.str.1
	.asciz	"%s"

	.comm	_ELF_K_ELF,8,3                  ; @ELF_K_ELF
l_.str.2:                               ; @.str.2
	.asciz	"kernel is not an ELF file"

	.comm	_EI_DATA,8,3                    ; @EI_DATA
l_.str.3:                               ; @.str.3
	.asciz	"unsupported ELF data encoding for kernel"

	.no_dead_strip	__kvm_read_kernel_ehdr
.subsections_via_symbols
