	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_phdr                     ## -- Begin function setup_phdr
	.p2align	4, 0x90
_setup_phdr:                            ## @setup_phdr
	.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	%rdi, %r15
	movl	28(%rdi), %edi
	leaq	-48(%rbp), %rsi
	callq	_elf_getphnum
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$-1, %edi
	callq	_elf_errmsg
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_errx
LBB0_2:
	movq	-48(%rbp), %rax
	movq	%rax, 8(%r15)
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	movq	16(%r15), %rax
	movq	_STRIP_NONDEBUG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.11:
	movq	$0, (%r15)
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	24(%r15), %r14
	xorl	%ebx, %ebx
	leaq	-80(%rbp), %r12
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	-60(%rbp), %eax
	movl	%eax, 20(%r13)
	movl	-64(%rbp), %eax
	movl	%eax, 16(%r13)
	movaps	-80(%rbp), %xmm0
	movups	%xmm0, (%r13)
	movq	_seg_list@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_STAILQ_INSERT_TAIL
	incq	%rbx
	cmpq	-48(%rbp), %rbx
	jae	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	28(%r15), %edi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_gelf_getphdr
	cmpq	%r12, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$-1, %edi
	callq	_elf_errmsg
	movl	%r13d, %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_errx
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	movl	$24, %esi
	callq	_calloc
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_err
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"elf_getphnum failed: %s"

	.comm	_STRIP_NONDEBUG,8,3             ## @STRIP_NONDEBUG
L_.str.1:                               ## @.str.1
	.asciz	"gelf_getphdr failed: %s"

L_.str.2:                               ## @.str.2
	.asciz	"calloc failed"

	.comm	_seg_list,4,2                   ## @seg_list
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_phdr                     ; -- Begin function setup_phdr
	.p2align	2
_setup_phdr:                            ; @setup_phdr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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, #28]
	add	x1, sp, #8
	bl	_elf_getphnum
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	mov	w0, #-1
	bl	_elf_errmsg
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_errx
LBB0_2:
	ldr	x8, [sp, #8]
	stp	x8, x8, [x19]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x19, #16]
Lloh5:
	adrp	x9, _STRIP_NONDEBUG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _STRIP_NONDEBUG@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	str	xzr, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_6:
	mov	x20, #0
	add	x21, x19, #24
	add	x25, sp, #16
Lloh8:
	adrp	x26, _EXIT_FAILURE@GOTPAGE
Lloh9:
	ldr	x26, [x26, _EXIT_FAILURE@GOTPAGEOFF]
Lloh10:
	adrp	x22, l_.str.2@PAGE
Lloh11:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh12:
	adrp	x27, _seg_list@GOTPAGE
Lloh13:
	ldr	x27, [x27, _seg_list@GOTPAGEOFF]
Lloh14:
	adrp	x23, l_.str.1@PAGE
Lloh15:
	add	x23, x23, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	d0, [sp, #32]
	str	d0, [x24, #16]
	ldr	q0, [sp, #16]
	str	q0, [x24]
	ldr	w2, [x27]
	mov	x0, x21
	mov	x1, x24
	bl	_STAILQ_INSERT_TAIL
	add	x20, x20, #1
	ldr	x8, [sp, #8]
	cmp	x20, x8
	b.hs	LBB0_5
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #28]
	add	x2, sp, #16
	mov	x1, x20
	bl	_gelf_getphdr
	cmp	x0, x25
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w24, [x26]
	mov	w0, #-1
	bl	_elf_errmsg
	mov	x2, x0
	mov	x0, x24
	mov	x1, x23
	bl	_errx
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w0, #1
	mov	w1, #24
	bl	_calloc
	mov	x24, x0
	cbnz	x0, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x26]
	mov	x1, x22
	bl	_err
	b	LBB0_7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"elf_getphnum failed: %s"

	.comm	_STRIP_NONDEBUG,8,3             ; @STRIP_NONDEBUG
l_.str.1:                               ; @.str.1
	.asciz	"gelf_getphdr failed: %s"

l_.str.2:                               ; @.str.2
	.asciz	"calloc failed"

	.comm	_seg_list,4,2                   ; @seg_list
.subsections_via_symbols
