	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ecd_read
_ecd_read:                              ## @ecd_read
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	(%rdi), %esi
	cmpl	$1024, %esi                     ## imm = 0x400
	movl	$1024, %ebx                     ## imm = 0x400
	cmovll	%esi, %ebx
	movl	16(%rdi), %edi
	subl	%ebx, %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	callq	_fseek
	movl	$-1, %r14d
	testq	%rax, %rax
	jne	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
	movl	16(%r15), %ecx
	movq	%rax, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_fread
	cmpl	$1, %eax
	jne	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	%ebx, %esi
	leaq	-44(%rbp), %rdx
	callq	_ecd_find_sig
	testq	%rax, %rax
	jne	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	callq	_free
	cmpl	(%r15), %ebx
	jge	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%ebx, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_logerror
	movl	(%r15), %esi
	movl	16(%r15), %edi
	cmpl	%esi, %ebx
	cmovgel	%esi, %ebx
	subl	%ebx, %esi
	movl	(%r12), %edx
	callq	_fseek
	testq	%rax, %rax
	je	LBB0_2
	jmp	LBB0_11
LBB0_5:
	subl	-44(%rbp), %ebx
	movl	%ebx, 4(%r15)
	movl	%ebx, %edi
	callq	_malloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movslq	-44(%rbp), %rcx
	movq	%r13, %rsi
	addq	%rcx, %rsi
	movl	4(%r15), %edx
	movq	%rax, %rdi
	callq	_memcpy
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_9:
	movl	$-1, %r14d
LBB0_10:
	movq	%r13, %rdi
	callq	_free
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Retry reading of zip ecd for %d bytes\n"

	.no_dead_strip	_ecd_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ecd_read
_ecd_read:                              ; @ecd_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	w8, [x0]
	mov	w9, #1024
	cmp	w8, #1024
	csel	w20, w8, w9, lt
	ldr	w0, [x0, #16]
	sub	w1, w8, w20
Lloh0:
	adrp	x23, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_fseek
	cbz	x0, LBB0_3
LBB0_1:
	mov	w19, #-1
LBB0_2:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
LBB0_3:
Lloh2:
	adrp	x22, l_.str@PAGE
Lloh3:
	add	x22, x22, l_.str@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_malloc
	cbz	x0, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, x0
	ldr	w3, [x19, #16]
	mov	x1, x20
	mov	w2, #1
	bl	_fread
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_ecd_find_sig
	cbnz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_free
	ldr	w8, [x19]
	cmp	w20, w8
	b.ge	LBB0_1
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w20, w20, #1
	mov	x0, x22
	mov	x1, x20
	bl	_logerror
	ldr	w8, [x19]
	cmp	w20, w8
	csel	w20, w20, w8, lt
	ldr	w0, [x19, #16]
	sub	w1, w8, w20
	ldr	w2, [x23]
	bl	_fseek
	cbz	x0, LBB0_4
	b	LBB0_1
LBB0_9:
	ldr	w8, [sp, #12]
	sub	w0, w20, w8
	str	w0, [x19, #4]
	bl	_malloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_11
; %bb.10:
	ldrsw	x8, [sp, #12]
	add	x1, x21, x8
	ldr	w2, [x19, #4]
	bl	_memcpy
	mov	w19, #0
	b	LBB0_12
LBB0_11:
	mov	w19, #-1
LBB0_12:
	mov	x0, x21
	bl	_free
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Retry reading of zip ecd for %d bytes\n"

	.no_dead_strip	_ecd_read
.subsections_via_symbols
