	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function otrx_create_write_hdr
_otrx_create_write_hdr:                 ## @otrx_create_write_hdr
	.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
	movl	$4120, %eax                     ## imm = 0x1018
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%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
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_TRX_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, 24(%rbx)
	movl	$1, (%rbx)
	movq	_SEEK_SET@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$32, %edx
	movq	%r15, %rcx
	callq	_fwrite
	cmpq	$32, %rax
	jne	LBB0_1
## %bb.2:
	movq	%rbx, -4152(%rbp)               ## 8-byte Spill
	movl	16(%rbx), %edi
	callq	_le32_to_cpu
	movq	%rax, %rbx
	movq	_TRX_FLAGS_OFFSET@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_fseek
	subq	(%r14), %rbx
	movl	$4096, %edi                     ## imm = 0x1000
	movq	%rbx, %rsi
	callq	_otrx_min
	leaq	-4144(%rbp), %rdi
	movl	$1, %esi
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_fread
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movl	$-1, %r12d
	leaq	-4144(%rbp), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_otrx_crc32
	movl	%eax, %r12d
	subq	%r14, %rbx
	movl	$4096, %edi                     ## imm = 0x1000
	movq	%rbx, %rsi
	callq	_otrx_min
	movq	%r13, %rdi
	movl	$1, %esi
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_fread
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_5
	jmp	LBB0_6
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_trx_path@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_3:
	movl	$-1, %r12d
LBB0_6:
	movl	%r12d, %edi
	callq	_cpu_to_le32
	movq	-4152(%rbp), %rbx               ## 8-byte Reload
	movq	%rax, 8(%rbx)
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$32, %edx
	movq	%r15, %rcx
	callq	_fwrite
	cmpq	$32, %rax
	je	LBB0_9
## %bb.7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_trx_path@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_8:
	subl	(%rax), %r14d
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%r14d, %eax
	addq	$4120, %rsp                     ## imm = 0x1018
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TRX_MAGIC,4,2                  ## @TRX_MAGIC
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't write TRX header to %s\n"

	.comm	_trx_path,8,3                   ## @trx_path
	.comm	_EIO,4,2                        ## @EIO
	.comm	_TRX_FLAGS_OFFSET,8,3           ## @TRX_FLAGS_OFFSET
	.no_dead_strip	_otrx_create_write_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function otrx_create_write_hdr
_otrx_create_write_hdr:                 ; @otrx_create_write_hdr
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -72
	.cfi_offset w28, -80
	mov	w9, #4112
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #1, lsl #12             ; =4096
	sub	sp, sp, #16
	mov	x20, x1
	mov	x19, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh5:
	adrp	x8, _TRX_MAGIC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TRX_MAGIC@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_cpu_to_le32
	str	x0, [x20, #24]
	mov	w8, #1
	str	w8, [x20]
Lloh8:
	adrp	x24, _SEEK_SET@GOTPAGE
Lloh9:
	ldr	x24, [x24, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, #0
	bl	_fseek
	mov	x0, x20
	mov	w1, #1
	mov	w2, #32
	mov	x3, x19
	bl	_fwrite
	cmp	x0, #32
	b.ne	LBB0_7
; %bb.1:
	ldr	w0, [x20, #16]
	bl	_le32_to_cpu
	mov	x21, x0
Lloh10:
	adrp	x22, _TRX_FLAGS_OFFSET@GOTPAGE
Lloh11:
	ldr	x22, [x22, _TRX_FLAGS_OFFSET@GOTPAGEOFF]
	ldr	x1, [x22]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_fseek
	ldr	x8, [x22]
	sub	x21, x21, x8
	mov	w0, #4096
	mov	x1, x21
	bl	_otrx_min
	mov	x2, x0
	add	x0, sp, #8
	mov	w1, #1
	mov	x3, x19
	bl	_fread
	cbz	x0, LBB0_4
; %bb.2:
	mov	x23, x0
	mov	w22, #-1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #8
	mov	x0, x22
	mov	x2, x23
	bl	_otrx_crc32
	mov	x22, x0
	sub	x21, x21, x23
	mov	w0, #4096
	mov	x1, x21
	bl	_otrx_min
	mov	x2, x0
	add	x0, sp, #8
	mov	w1, #1
	mov	x3, x19
	bl	_fread
	mov	x23, x0
	cbnz	x0, LBB0_3
	b	LBB0_5
LBB0_4:
	mov	w22, #-1
LBB0_5:
	mov	x0, x22
	bl	_cpu_to_le32
	str	x0, [x20, #8]
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, #0
	bl	_fseek
	mov	x0, x20
	mov	w1, #1
	mov	w2, #32
	mov	x3, x19
	bl	_fwrite
	cmp	x0, #32
	b.ne	LBB0_7
; %bb.6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _stderr@GOTPAGE
Lloh13:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _trx_path@GOTPAGE
Lloh16:
	ldr	x8, [x8, _trx_path@GOTPAGEOFF]
Lloh17:
	ldr	x2, [x8]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldur	x8, [x29, #-72]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	add	sp, sp, #1, lsl #12             ; =4096
	add	sp, sp, #16
	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
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_TRX_MAGIC,4,2                  ; @TRX_MAGIC
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't write TRX header to %s\n"

	.comm	_trx_path,8,3                   ; @trx_path
	.comm	_EIO,4,2                        ; @EIO
	.comm	_TRX_FLAGS_OFFSET,8,3           ; @TRX_FLAGS_OFFSET
	.no_dead_strip	_otrx_create_write_hdr
.subsections_via_symbols
