	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_shdrs
_read_shdrs:                            ## @read_shdrs
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_ehdr@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movl	%ebx, %edi
	movl	$88, %esi
	callq	_calloc
	movq	_secs@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_die
LBB0_2:
	movl	4(%r13), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_fseek
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	cmpl	$0, (%r13)
	jg	LBB0_5
	jmp	LBB0_11
LBB0_3:
	movl	4(%r13), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_die
	cmpl	$0, (%r13)
	jle	LBB0_11
LBB0_5:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	addq	$88, %r14
	cmpq	%rax, %rbx
	jge	LBB0_11
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_secs@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	leaq	-80(%rbp), %rdi
	movl	$40, %esi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	_fread
	cmpl	$1, %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r13), %r12d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_die
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	-44(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 72(%r15,%r14)
	movl	-48(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 64(%r15,%r14)
	movl	-52(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 56(%r15,%r14)
	movl	-56(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 48(%r15,%r14)
	movl	-60(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 40(%r15,%r14)
	movl	-64(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 32(%r15,%r14)
	movl	-68(%rbp), %edi
	callq	_elf32_to_cpu
	movl	%eax, (%r15,%r14)
	movl	-72(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 24(%r15,%r14)
	movl	-76(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 16(%r15,%r14)
	movl	-80(%rbp), %edi
	callq	_elf32_to_cpu
	movq	%rax, 8(%r15,%r14)
	movslq	(%r15,%r14), %rcx
	movslq	(%r13), %rax
	cmpl	%eax, %ecx
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	imulq	$88, %rcx, %rcx
	movq	_secs@GOTPCREL(%rip), %rdx
	addq	(%rdx), %rcx
	movq	%rcx, 80(%r15,%r14)
	jmp	LBB0_10
LBB0_11:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ehdr,8,2                       ## @ehdr
	.comm	_secs,8,3                       ## @secs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to allocate %d section headers\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.1:                               ## @.str.1
	.asciz	"Seek to %d failed: %s\n"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"Cannot read ELF section headers %d/%d: %s\n"

	.no_dead_strip	_read_shdrs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_shdrs
_read_shdrs:                            ; @read_shdrs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
Lloh0:
	adrp	x22, _ehdr@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ehdr@GOTPAGEOFF]
	ldr	w20, [x22]
	mov	x0, x20
	mov	w1, #88
	bl	_calloc
Lloh2:
	adrp	x23, _secs@GOTPAGE
Lloh3:
	ldr	x23, [x23, _secs@GOTPAGEOFF]
	str	x0, [x23]
	cbnz	x0, LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_die
LBB0_2:
	ldr	w1, [x22, #4]
Lloh6:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_fseek
Lloh9:
	adrp	x24, _errno@GOTPAGE
Lloh10:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
	tbz	x0, #63, LBB0_4
; %bb.3:
	ldr	w20, [x22, #4]
	ldr	w0, [x24]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_die
LBB0_4:
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.5:
	mov	x20, #0
	mov	w25, #40
	mov	w26, #88
Lloh13:
	adrp	x21, l_.str.2@PAGE
Lloh14:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x20, x20, #1
	add	x25, x25, #88
	cmp	x20, x8
	b.ge	LBB0_11
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x23]
	add	x0, sp, #24
	mov	w1, #40
	mov	w2, #1
	mov	x3, x19
	bl	_fread
	cmp	w0, #1
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x24]
	ldr	w28, [x22]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x28, x0, [sp]
	mov	x0, x21
	mov	x1, x20
	bl	_die
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [sp, #60]
	bl	_elf32_to_cpu
	add	x27, x27, x25
	str	x0, [x27, #32]
	ldr	w0, [sp, #56]
	bl	_elf32_to_cpu
	str	x0, [x27, #24]
	ldr	w0, [sp, #52]
	bl	_elf32_to_cpu
	str	x0, [x27, #16]
	ldr	w0, [sp, #48]
	bl	_elf32_to_cpu
	str	x0, [x27, #8]
	ldr	w0, [sp, #44]
	bl	_elf32_to_cpu
	str	x0, [x27]
	ldr	w0, [sp, #40]
	bl	_elf32_to_cpu
	stur	x0, [x27, #-8]
	ldr	w0, [sp, #36]
	bl	_elf32_to_cpu
	stur	w0, [x27, #-40]
	ldr	w0, [sp, #32]
	bl	_elf32_to_cpu
	stur	x0, [x27, #-16]
	ldr	w0, [sp, #28]
	bl	_elf32_to_cpu
	stur	x0, [x27, #-24]
	ldr	w0, [sp, #24]
	bl	_elf32_to_cpu
	stur	x0, [x27, #-32]
	ldursw	x9, [x27, #-40]
	ldrsw	x8, [x22]
	cmp	w9, w8
	b.ge	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x10, [x23]
	madd	x9, x9, x26, x10
	str	x9, [x27, #40]
	b	LBB0_6
LBB0_11:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ehdr,8,2                       ; @ehdr
	.comm	_secs,8,3                       ; @secs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to allocate %d section headers\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.1:                               ; @.str.1
	.asciz	"Seek to %d failed: %s\n"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"Cannot read ELF section headers %d/%d: %s\n"

	.no_dead_strip	_read_shdrs
.subsections_via_symbols
