	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_rite_binary_header
_write_rite_binary_header:              ## @write_rite_binary_header
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	testb	$-128, %cl
	je	LBB0_5
## %bb.1:
	xorl	%eax, %eax
	callq	_bigendian_p
	movl	24(%rbx), %edi
	testl	%eax, %eax
	jne	LBB0_2
## %bb.3:
	movq	_RITE_BINARY_IDENT_LIL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_RITE_BINARY_IDENT@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_memcpy
LBB0_5:
	movl	20(%rbx), %edi
	movq	_RITE_BINARY_FORMAT_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_memcpy
	movl	16(%rbx), %edi
	movq	_RITE_COMPILER_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_memcpy
	movl	12(%rbx), %edi
	movq	_RITE_COMPILER_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_memcpy
	movq	_UINT32_MAX@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	%r14, (%rax)
	setae	%dil
	callq	_mrb_assert
	movl	8(%rbx), %esi
	movl	%r14d, %edi
	callq	_uint32_to_bin
	movq	(%rbx), %rax
	subq	%rbx, %rax
	shlq	$30, %rax
	movabsq	$17179869184, %rcx              ## imm = 0x400000000
	addq	%rax, %rcx
	sarq	$32, %rcx
	leaq	(%rbx,%rcx,4), %rdi
	subl	%ecx, %r14d
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_calc_crc_16_ccitt
	movq	(%rbx), %rsi
	movl	%eax, %edi
	callq	_uint16_to_bin
	movq	_MRB_DUMP_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RITE_BINARY_IDENT,4,2          ## @RITE_BINARY_IDENT
	.comm	_RITE_BINARY_IDENT_LIL,4,2      ## @RITE_BINARY_IDENT_LIL
	.comm	_RITE_BINARY_FORMAT_VER,4,2     ## @RITE_BINARY_FORMAT_VER
	.comm	_RITE_COMPILER_NAME,4,2         ## @RITE_COMPILER_NAME
	.comm	_RITE_COMPILER_VERSION,4,2      ## @RITE_COMPILER_VERSION
	.comm	_UINT32_MAX,8,3                 ## @UINT32_MAX
	.comm	_MRB_DUMP_OK,4,2                ## @MRB_DUMP_OK
	.no_dead_strip	_write_rite_binary_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_rite_binary_header
_write_rite_binary_header:              ; @write_rite_binary_header
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	mov	x20, x1
	tbz	w3, #7, LBB0_2
; %bb.1:
	bl	_bigendian_p
Lloh0:
	adrp	x9, _RITE_BINARY_IDENT_LIL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RITE_BINARY_IDENT_LIL@GOTPAGEOFF]
	ldr	w8, [x19, #24]
Lloh2:
	adrp	x10, _RITE_BINARY_IDENT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _RITE_BINARY_IDENT@GOTPAGEOFF]
	cmp	w0, #0
	csel	x9, x9, x10, eq
	ldr	w1, [x9]
	mov	x0, x8
	mov	w2, #4
	bl	_memcpy
LBB0_2:
	ldr	w0, [x19, #20]
Lloh4:
	adrp	x8, _RITE_BINARY_FORMAT_VER@GOTPAGE
Lloh5:
	ldr	x8, [x8, _RITE_BINARY_FORMAT_VER@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_memcpy
	ldr	w0, [x19, #16]
Lloh7:
	adrp	x8, _RITE_COMPILER_NAME@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RITE_COMPILER_NAME@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_memcpy
	ldr	w0, [x19, #12]
Lloh10:
	adrp	x8, _RITE_COMPILER_VERSION@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RITE_COMPILER_VERSION@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_memcpy
Lloh13:
	adrp	x8, _UINT32_MAX@GOTPAGE
Lloh14:
	ldr	x8, [x8, _UINT32_MAX@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x8, x20
	cset	w0, hs
	bl	_mrb_assert
	ldr	w1, [x19, #8]
	mov	x0, x20
	bl	_uint32_to_bin
	ldr	x8, [x19]
	sub	x8, x8, x19
	mov	x9, #17179869184
	add	x8, x9, x8, lsl #30
	asr	x8, x8, #32
	add	x0, x19, x8, lsl #2
	sub	w1, w20, w8
	mov	w2, #0
	bl	_calc_crc_16_ccitt
	ldr	x1, [x19]
	bl	_uint16_to_bin
Lloh16:
	adrp	x8, _MRB_DUMP_OK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MRB_DUMP_OK@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_RITE_BINARY_IDENT,4,2          ; @RITE_BINARY_IDENT
	.comm	_RITE_BINARY_IDENT_LIL,4,2      ; @RITE_BINARY_IDENT_LIL
	.comm	_RITE_BINARY_FORMAT_VER,4,2     ; @RITE_BINARY_FORMAT_VER
	.comm	_RITE_COMPILER_NAME,4,2         ; @RITE_COMPILER_NAME
	.comm	_RITE_COMPILER_VERSION,4,2      ; @RITE_COMPILER_VERSION
	.comm	_UINT32_MAX,8,3                 ; @UINT32_MAX
	.comm	_MRB_DUMP_OK,4,2                ; @MRB_DUMP_OK
	.no_dead_strip	_write_rite_binary_header
.subsections_via_symbols
