	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__kvm_read_core_phdrs           ## -- Begin function _kvm_read_core_phdrs
	.p2align	4, 0x90
__kvm_read_core_phdrs:                  ## @_kvm_read_core_phdrs
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	24(%rdi), %edi
	movq	_ELF_C_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_elf_begin
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_elf_kind
	movq	_ELF_K_ELF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.2:
	movq	%r14, %rdi
	callq	_gelf_getclass
	movq	8(%r12), %rcx
	movq	_EI_CLASS@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	(%rcx,%rdx,8), %rax
	jne	LBB0_13
## %bb.3:
	leaq	-80(%rbp), %rsi
	movq	%r14, %rdi
	callq	_gelf_getehdr
	testq	%rax, %rax
	je	LBB0_21
## %bb.4:
	movq	-80(%rbp), %rax
	movq	_ET_CORE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.5:
	movq	-72(%rbp), %rax
	cmpq	16(%r12), %rax
	jne	LBB0_13
## %bb.6:
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_elf_getphdrnum
	cmpl	$-1, %eax
	je	LBB0_21
## %bb.7:
	movq	-48(%rbp), %rdi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_19
## %bb.8:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	cmpq	$0, -48(%rbp)
	je	LBB0_12
## %bb.9:
	xorl	%r13d, %r13d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_gelf_getphdr
	testq	%rax, %rax
	je	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	incq	%r13
	addq	$4, %r15
	cmpq	-48(%rbp), %r13
	jb	LBB0_10
LBB0_12:
	movq	%r14, %rdi
	callq	_elf_end
	movq	-48(%rbp), %rax
	movq	%rax, (%rbx)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_13:
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_14:
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	__kvm_err
LBB0_15:
	movq	%r14, %rdi
	callq	_elf_end
	jmp	LBB0_17
LBB0_16:
	movl	(%r12), %ebx
	xorl	%edi, %edi
	callq	_elf_errmsg
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	__kvm_err
LBB0_17:
	movl	$-1, %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	(%r12), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_14
LBB0_20:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
LBB0_21:
	movl	(%r12), %ebx
	xorl	%edi, %edi
	callq	_elf_errmsg
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	__kvm_err
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_ELF_C_READ,4,2                 ## @ELF_C_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_ELF_K_ELF,8,3                  ## @ELF_K_ELF
L_.str.1:                               ## @.str.1
	.asciz	"invalid core"

	.comm	_EI_CLASS,8,3                   ## @EI_CLASS
	.comm	_ET_CORE,8,3                    ## @ET_CORE
L_.str.2:                               ## @.str.2
	.asciz	"failed to allocate phdrs"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__kvm_read_core_phdrs           ; -- Begin function _kvm_read_core_phdrs
	.p2align	2
__kvm_read_core_phdrs:                  ; @_kvm_read_core_phdrs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w0, [x0, #24]
Lloh0:
	adrp	x8, _ELF_C_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ELF_C_READ@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_elf_begin
	cbz	x0, LBB0_16
; %bb.1:
	mov	x19, x0
	bl	_elf_kind
Lloh3:
	adrp	x8, _ELF_K_ELF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ELF_K_ELF@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.2:
	mov	x0, x19
	bl	_gelf_getclass
	ldr	x8, [x20, #8]
Lloh6:
	adrp	x9, _EI_CLASS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EI_CLASS@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.3:
	add	x1, sp, #16
	mov	x0, x19
	bl	_gelf_getehdr
	cbz	x0, LBB0_19
; %bb.4:
	ldr	x8, [sp, #16]
Lloh9:
	adrp	x9, _ET_CORE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ET_CORE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.5:
	ldr	x8, [sp, #24]
	ldr	x9, [x20, #16]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.6:
	add	x1, sp, #8
	mov	x0, x19
	bl	_elf_getphdrnum
	cmn	w0, #1
	b.eq	LBB0_23
; %bb.7:
	ldr	x0, [sp, #8]
	mov	w1, #4
	bl	_calloc
	cbz	x0, LBB0_21
; %bb.8:
	mov	x23, x0
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_12
; %bb.9:
	mov	x24, #0
	mov	x25, x23
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x24
	mov	x2, x25
	bl	_gelf_getphdr
	cbz	x0, LBB0_22
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x24, x24, #1
	ldr	x8, [sp, #8]
	add	x25, x25, #4
	cmp	x24, x8
	b.lo	LBB0_10
LBB0_12:
	mov	x0, x19
	bl	_elf_end
	mov	w0, #0
	ldr	x8, [sp, #8]
	str	x8, [x22]
	str	x23, [x21]
	b	LBB0_18
LBB0_13:
	ldr	w1, [x20]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_14:
	mov	x0, x20
LBB0_15:
	bl	__kvm_err
	mov	x0, x19
	bl	_elf_end
	b	LBB0_17
LBB0_16:
	ldr	w19, [x20]
	bl	_elf_errmsg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	__kvm_err
LBB0_17:
	mov	w0, #-1
LBB0_18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_19:
	ldr	w21, [x20]
LBB0_20:
	bl	_elf_errmsg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh16:
	adrp	x2, l_.str@PAGE
Lloh17:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	b	LBB0_15
LBB0_21:
	ldr	w1, [x20]
Lloh18:
	adrp	x2, l_.str.2@PAGE
Lloh19:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_22:
	mov	x0, x23
	bl	_free
LBB0_23:
	ldr	w21, [x20]
	mov	w0, #0
	b	LBB0_20
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ELF_C_READ,4,2                 ; @ELF_C_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_ELF_K_ELF,8,3                  ; @ELF_K_ELF
l_.str.1:                               ; @.str.1
	.asciz	"invalid core"

	.comm	_EI_CLASS,8,3                   ; @EI_CLASS
	.comm	_ET_CORE,8,3                    ; @ET_CORE
l_.str.2:                               ; @.str.2
	.asciz	"failed to allocate phdrs"

.subsections_via_symbols
