	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kadm5_log_init                 ## -- Begin function kadm5_log_init
	.p2align	4, 0x90
_kadm5_log_init:                        ## @kadm5_log_init
	.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
	cmpl	$-1, 4(%rdi)
	je	LBB0_1
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r15
	movl	12(%rdi), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	$384, %edx                      ## imm = 0x180
	callq	_open
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movl	%eax, %r14d
	movq	_LOCK_EX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_flock
	testq	%rax, %rax
	js	LBB0_4
## %bb.5:
	leaq	8(%r15), %rsi
	movl	%r14d, %edi
	callq	_kadm5_log_get_version_fd
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	movl	%r14d, 4(%r15)
	jmp	LBB0_7
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	(%r15), %edi
	movl	12(%r15), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rsi
	callq	_krb5_set_error_message
	jmp	LBB0_8
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movl	(%r15), %edi
	movl	12(%r15), %ecx
	leaq	L_.str.1(%rip), %rdx
	callq	_krb5_set_error_message
	movl	%r14d, %edi
	callq	_close
	movq	(%rbx), %rbx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_errno,8,3                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kadm5_log_init: open %s"

	.comm	_LOCK_EX,4,2                    ## @LOCK_EX
L_.str.1:                               ## @.str.1
	.asciz	"kadm5_log_init: flock %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kadm5_log_init                 ; -- Begin function kadm5_log_init
	.p2align	2
_kadm5_log_init:                        ; @kadm5_log_init
	.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
	ldr	w8, [x0, #4]
	cmn	w8, #1
	b.eq	LBB0_3
; %bb.1:
	mov	x21, #0
LBB0_2:
	mov	x0, x21
	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_3:
	mov	x19, x0
Lloh0:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
	ldr	w0, [x0, #12]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #384
	bl	_open
	tbnz	w0, #31, LBB0_7
; %bb.4:
	mov	x20, x0
Lloh6:
	adrp	x8, _LOCK_EX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LOCK_EX@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_flock
	tbnz	x0, #63, LBB0_8
; %bb.5:
	add	x1, x19, #8
	mov	x0, x20
	bl	_kadm5_log_get_version_fd
	mov	x21, x0
	cbnz	x0, LBB0_2
; %bb.6:
	str	w20, [x19, #4]
	b	LBB0_2
LBB0_7:
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	ldr	x21, [x8]
	ldr	w0, [x19]
	ldr	w3, [x19, #12]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x1, x21
	bl	_krb5_set_error_message
	b	LBB0_2
LBB0_8:
Lloh14:
	adrp	x21, _errno@GOTPAGE
Lloh15:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	x1, [x21]
	ldr	w0, [x19]
	ldr	w3, [x19, #12]
Lloh16:
	adrp	x2, l_.str.1@PAGE
Lloh17:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_krb5_set_error_message
	mov	x0, x20
	bl	_close
	ldr	x21, [x21]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_errno,8,3                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kadm5_log_init: open %s"

	.comm	_LOCK_EX,4,2                    ; @LOCK_EX
l_.str.1:                               ; @.str.1
	.asciz	"kadm5_log_init: flock %s"

.subsections_via_symbols
