	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ghb_write_pid_file             ## -- Begin function ghb_write_pid_file
	.p2align	4, 0x90
_ghb_write_pid_file:                    ## @ghb_write_pid_file
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_getpid
	movl	%eax, %r12d
	xorl	%edi, %edi
	callq	_ghb_get_user_config_dir
	movq	%rax, %r14
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	movl	%r12d, %edx
	callq	_g_strdup_printf
	movq	%rax, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	callq	_g_fopen
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, %rdi
	movl	%r12d, %edx
	callq	_fprintf
	movq	%rbx, %rdi
	callq	_fclose
LBB0_2:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_S_IRUSR@GOTPCREL(%rip), %rax
	movq	_S_IWUSR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	_F_TLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	xorl	%edx, %edx
	callq	_lockf
LBB0_4:
	movq	%r14, %rdi
	callq	_g_free
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_g_free                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/ghb.pid.%d"

L_.str.1:                               ## @.str.1
	.asciz	"w"

L_.str.2:                               ## @.str.2
	.asciz	"%d\n"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_S_IRUSR,4,2                    ## @S_IRUSR
	.comm	_S_IWUSR,4,2                    ## @S_IWUSR
	.comm	_F_TLOCK,4,2                    ## @F_TLOCK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ghb_write_pid_file             ; -- Begin function ghb_write_pid_file
	.p2align	2
_ghb_write_pid_file:                    ; @ghb_write_pid_file
	.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
	bl	_getpid
	mov	x21, x0
	mov	x0, #0
	bl	_ghb_get_user_config_dir
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x21
	bl	_g_strdup_printf
	mov	x20, x0
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_g_fopen
	cbz	x0, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_fprintf
	mov	x0, x22
	bl	_fclose
LBB0_2:
Lloh6:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _S_IRUSR@GOTPAGE
Lloh13:
	ldr	x10, [x10, _S_IRUSR@GOTPAGEOFF]
	orr	w1, w9, w8
Lloh14:
	ldr	w8, [x10]
Lloh15:
	adrp	x9, _S_IWUSR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _S_IWUSR@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_open
	tbnz	w0, #31, LBB0_4
; %bb.3:
Lloh18:
	adrp	x8, _F_TLOCK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _F_TLOCK@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_lockf
LBB0_4:
	mov	x0, x19
	bl	_g_free
	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
	b	_g_free
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/ghb.pid.%d"

l_.str.1:                               ; @.str.1
	.asciz	"w"

l_.str.2:                               ; @.str.2
	.asciz	"%d\n"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_S_IRUSR,4,2                    ; @S_IRUSR
	.comm	_S_IWUSR,4,2                    ; @S_IWUSR
	.comm	_F_TLOCK,4,2                    ; @F_TLOCK
.subsections_via_symbols
