	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_part
_write_part:                            ## @write_part
	.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	%rsi, %rbx
	movq	%rdi, %r15
	movslq	8(%rsi), %r14
	movl	32(%rsi), %edi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %r12d
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	8(%rbx), %esi
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	movl	%r12d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %r13
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	je	LBB0_3
## %bb.4:
	leaq	64(%r15), %rdi
	movl	8(%rbx), %edx
	movq	%r13, %rsi
	callq	_memcpy
	movl	8(%rbx), %esi
	movq	%r13, %rdi
	callq	_munmap
	movq	(%r15), %rdi
	movq	_PART_NAME_LENGTH@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	xorl	%esi, %esi
	callq	_memset
	movq	8(%r15), %rdi
	movq	_MAGIC_PART@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_MAGIC_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	(%r15), %rdi
	movq	(%rbx), %rsi
	movl	(%r12), %edx
	callq	_memcpy
	movl	28(%rbx), %edi
	callq	_htonl
	movq	%rax, 56(%r15)
	movl	8(%rbx), %edi
	callq	_htonl
	movq	%rax, 48(%r15)
	movl	24(%rbx), %edi
	callq	_htonl
	movq	%rax, 40(%r15)
	movl	20(%rbx), %edi
	callq	_htonl
	movq	%rax, 32(%r15)
	movl	16(%rbx), %edi
	callq	_htonl
	movq	%rax, 24(%r15)
	movl	12(%rbx), %edi
	callq	_htonl
	movq	%rax, 16(%r15)
	movl	8(%rbx), %edx
	addl	$64, %edx
	xorl	%edi, %edi
	movq	%r15, %rsi
	callq	_crc32
	movl	%eax, %edi
	callq	_htonl
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 72(%r15,%rcx)
	movq	$0, 64(%r15,%rcx)
	jmp	LBB0_5
LBB0_1:
	movl	32(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_ERROR
	movl	$-1, %r14d
	jmp	LBB0_5
LBB0_3:
	movl	32(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_ERROR
	movl	%r12d, %edi
	callq	_close
	movl	$-2, %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed opening file '%s'\n"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.1:                               ## @.str.1
	.asciz	"Failed mmaping memory for file '%s'\n"

	.comm	_PART_NAME_LENGTH,4,2           ## @PART_NAME_LENGTH
	.comm	_MAGIC_PART,8,3                 ## @MAGIC_PART
	.comm	_MAGIC_LENGTH,4,2               ## @MAGIC_LENGTH
	.no_dead_strip	_write_part
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_part
_write_part:                            ; @write_part
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	ldrsw	x23, [x1, #8]
	ldr	w0, [x1, #32]
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_open
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	w1, [x20, #8]
Lloh3:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	w0, #0
	mov	x4, x21
	mov	w5, #0
	bl	_mmap
Lloh9:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x8, x0
	b.eq	LBB0_4
; %bb.2:
	mov	x22, x0
	add	x0, x19, #64
	add	x21, x0, x23
	ldr	w2, [x20, #8]
	mov	x1, x22
	bl	_memcpy
	ldr	w1, [x20, #8]
	mov	x0, x22
	bl	_munmap
	ldr	x0, [x19]
Lloh12:
	adrp	x22, _PART_NAME_LENGTH@GOTPAGE
Lloh13:
	ldr	x22, [x22, _PART_NAME_LENGTH@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	w1, #0
	bl	_memset
	ldr	x0, [x19, #8]
Lloh14:
	adrp	x8, _MAGIC_PART@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAGIC_PART@GOTPAGEOFF]
Lloh16:
	ldr	x1, [x8]
Lloh17:
	adrp	x8, _MAGIC_LENGTH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAGIC_LENGTH@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	bl	_memcpy
	ldr	x0, [x19]
	ldr	x1, [x20]
	ldr	w2, [x22]
	bl	_memcpy
	ldr	w0, [x20, #28]
	bl	_htonl
	str	x0, [x19, #56]
	ldr	w0, [x20, #8]
	bl	_htonl
	str	x0, [x19, #48]
	ldr	w0, [x20, #24]
	bl	_htonl
	str	x0, [x19, #40]
	ldr	w0, [x20, #20]
	bl	_htonl
	str	x0, [x19, #32]
	ldr	w0, [x20, #16]
	bl	_htonl
	str	x0, [x19, #24]
	ldr	w0, [x20, #12]
	bl	_htonl
	str	x0, [x19, #16]
	ldr	w8, [x20, #8]
	add	w2, w8, #64
	mov	x0, #0
	mov	x1, x19
	bl	_crc32
	bl	_htonl
	mov	x8, x0
	mov	w0, #0
	stp	xzr, x8, [x21]
	b	LBB0_5
LBB0_3:
	ldr	w1, [x20, #32]
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERROR
	mov	w0, #-1
	b	LBB0_5
LBB0_4:
	ldr	w1, [x20, #32]
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERROR
	mov	x0, x21
	bl	_close
	mov	w0, #-2
LBB0_5:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed opening file '%s'\n"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.1:                               ; @.str.1
	.asciz	"Failed mmaping memory for file '%s'\n"

	.comm	_PART_NAME_LENGTH,4,2           ; @PART_NAME_LENGTH
	.comm	_MAGIC_PART,8,3                 ; @MAGIC_PART
	.comm	_MAGIC_LENGTH,4,2               ; @MAGIC_LENGTH
	.no_dead_strip	_write_part
.subsections_via_symbols
