	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function openFileForMerging
_openFileForMerging:                    ## @openFileForMerging
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_getProfileFile
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_lprofLockFileHandle
	jmp	LBB0_3
LBB0_2:
	movq	%r14, %rdi
	callq	_createProfileDir
	movq	%r14, %rdi
	callq	_lprofOpenFileEx
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_8
LBB0_3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_doProfileMerging
	testl	%eax, %eax
	je	LBB0_4
LBB0_7:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_PROF_ERR
	movq	%rbx, %rdi
	callq	_fclose
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpl	$0, (%r15)
	je	LBB0_5
LBB0_6:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_fseek
	cmpl	$-1, %eax
	jne	LBB0_9
	jmp	LBB0_7
LBB0_5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_COMPILER_RT_FTRUNCATE
	testq	%rax, %rax
	jne	LBB0_7
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Profile Merging of file %s failed: %s\n"

	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_openFileForMerging
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function openFileForMerging
_openFileForMerging:                    ; @openFileForMerging
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_getProfileFile
	cbz	x0, LBB0_2
; %bb.1:
	mov	x20, x0
	bl	_lprofLockFileHandle
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_createProfileDir
	mov	x0, x19
	bl	_lprofOpenFileEx
	mov	x20, x0
	cbz	x0, LBB0_5
LBB0_3:
	mov	x0, x20
	mov	x1, x21
	bl	_doProfileMerging
	cbz	w0, LBB0_6
LBB0_4:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_PROF_ERR
	mov	x0, x20
	bl	_fclose
	mov	x20, #0
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w8, [x21]
	cbz	w8, LBB0_8
LBB0_7:
Lloh5:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, #0
	bl	_fseek
	cmn	w0, #1
	b.ne	LBB0_5
	b	LBB0_4
LBB0_8:
	mov	x0, x20
	mov	x1, #0
	bl	_COMPILER_RT_FTRUNCATE
	cbnz	x0, LBB0_4
	b	LBB0_7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Profile Merging of file %s failed: %s\n"

	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_openFileForMerging
.subsections_via_symbols
