	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rewrite_client_leases          ## -- Begin function rewrite_client_leases
	.p2align	4, 0x90
_rewrite_client_leases:                 ## @rewrite_client_leases
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_leaseFile@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.7:
	callq	_fflush
	movq	(%r14), %rdi
	callq	_rewind
	jmp	LBB0_8
LBB0_1:
	movq	_path_dhclient_db@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_3:
	movq	_CAP_FCNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CAP_FSTAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CAP_FSYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_CAP_FTRUNCATE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_CAP_SEEK@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_CAP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	leaq	-28(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_cap_rights_init
	movq	(%r14), %rdi
	callq	_fileno
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_caph_rights_limit
	testq	%rax, %rax
	jns	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_5:
	movq	(%r14), %rdi
	callq	_fileno
	movq	_CAP_FCNTL_GETFL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_caph_fcntls_limit
	testq	%rax, %rax
	jns	LBB0_8
## %bb.6:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_8:
	movq	_ifi@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movq	(%rdi), %rax
	movq	8(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_write_client_lease
	movq	(%rbx), %rbx
	movq	(%r15), %rdi
	testq	%rbx, %rbx
	jne	LBB0_9
## %bb.10:
	movq	(%rdi), %rax
LBB0_11:
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.12:
	movl	$1, %edx
	callq	_write_client_lease
LBB0_13:
	movq	(%r14), %rdi
	callq	_fflush
	movq	(%r14), %rdi
	callq	_fileno
	movl	%eax, %ebx
	movq	(%r14), %rdi
	callq	_ftello
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ftruncate
	movq	(%r14), %rdi
	callq	_fileno
	movl	%eax, %edi
	callq	_fsync
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_leaseFile,8,3                  ## @leaseFile
	.comm	_path_dhclient_db,4,2           ## @path_dhclient_db
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w"

L_.str.1:                               ## @.str.1
	.asciz	"can't create %s: %m"

	.comm	_CAP_FCNTL,4,2                  ## @CAP_FCNTL
	.comm	_CAP_FSTAT,4,2                  ## @CAP_FSTAT
	.comm	_CAP_FSYNC,4,2                  ## @CAP_FSYNC
	.comm	_CAP_FTRUNCATE,4,2              ## @CAP_FTRUNCATE
	.comm	_CAP_SEEK,4,2                   ## @CAP_SEEK
	.comm	_CAP_WRITE,4,2                  ## @CAP_WRITE
L_.str.2:                               ## @.str.2
	.asciz	"can't limit lease descriptor: %m"

	.comm	_CAP_FCNTL_GETFL,4,2            ## @CAP_FCNTL_GETFL
L_.str.3:                               ## @.str.3
	.asciz	"can't limit lease descriptor fcntls: %m"

	.comm	_ifi,8,3                        ## @ifi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rewrite_client_leases          ; -- Begin function rewrite_client_leases
	.p2align	2
_rewrite_client_leases:                 ; @rewrite_client_leases
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x20, _leaseFile@GOTPAGE
Lloh1:
	ldr	x20, [x20, _leaseFile@GOTPAGEOFF]
	ldr	x0, [x20]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_fflush
	ldr	x0, [x20]
	bl	_rewind
	b	LBB0_8
LBB0_2:
Lloh2:
	adrp	x19, _path_dhclient_db@GOTPAGE
Lloh3:
	ldr	x19, [x19, _path_dhclient_db@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	str	x0, [x20]
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_4:
Lloh8:
	adrp	x8, _CAP_FCNTL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CAP_FCNTL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _CAP_FSTAT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CAP_FSTAT@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _CAP_FSYNC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CAP_FSYNC@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
Lloh17:
	adrp	x8, _CAP_FTRUNCATE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CAP_FTRUNCATE@GOTPAGEOFF]
Lloh19:
	ldr	w4, [x8]
Lloh20:
	adrp	x8, _CAP_SEEK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CAP_SEEK@GOTPAGEOFF]
Lloh22:
	ldr	w5, [x8]
Lloh23:
	adrp	x8, _CAP_WRITE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CAP_WRITE@GOTPAGEOFF]
Lloh25:
	ldr	w6, [x8]
	add	x0, sp, #12
	bl	_cap_rights_init
	ldr	x0, [x20]
	bl	_fileno
	add	x1, sp, #12
	bl	_caph_rights_limit
	tbz	x0, #63, LBB0_6
; %bb.5:
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_error
LBB0_6:
	ldr	x0, [x20]
	bl	_fileno
Lloh28:
	adrp	x8, _CAP_FCNTL_GETFL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CAP_FCNTL_GETFL@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	bl	_caph_fcntls_limit
	tbz	x0, #63, LBB0_8
; %bb.7:
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_error
LBB0_8:
Lloh33:
	adrp	x21, _ifi@GOTPAGE
Lloh34:
	ldr	x21, [x21, _ifi@GOTPAGEOFF]
	ldr	x0, [x21]
	ldr	x8, [x0]
	ldr	x19, [x8, #8]
	cbz	x19, LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, x19
	mov	w2, #1
	bl	_write_client_lease
	ldr	x19, [x19]
	ldr	x0, [x21]
	cbnz	x19, LBB0_9
; %bb.10:
	ldr	x8, [x0]
LBB0_11:
	ldr	x1, [x8]
	cbz	x1, LBB0_13
; %bb.12:
	mov	w2, #1
	bl	_write_client_lease
LBB0_13:
	ldr	x0, [x20]
	bl	_fflush
	ldr	x0, [x20]
	bl	_fileno
	mov	x19, x0
	ldr	x0, [x20]
	bl	_ftello
	mov	x1, x0
	mov	x0, x19
	bl	_ftruncate
	ldr	x0, [x20]
	bl	_fileno
	bl	_fsync
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_leaseFile,8,3                  ; @leaseFile
	.comm	_path_dhclient_db,4,2           ; @path_dhclient_db
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

l_.str.1:                               ; @.str.1
	.asciz	"can't create %s: %m"

	.comm	_CAP_FCNTL,4,2                  ; @CAP_FCNTL
	.comm	_CAP_FSTAT,4,2                  ; @CAP_FSTAT
	.comm	_CAP_FSYNC,4,2                  ; @CAP_FSYNC
	.comm	_CAP_FTRUNCATE,4,2              ; @CAP_FTRUNCATE
	.comm	_CAP_SEEK,4,2                   ; @CAP_SEEK
	.comm	_CAP_WRITE,4,2                  ; @CAP_WRITE
l_.str.2:                               ; @.str.2
	.asciz	"can't limit lease descriptor: %m"

	.comm	_CAP_FCNTL_GETFL,4,2            ; @CAP_FCNTL_GETFL
l_.str.3:                               ; @.str.3
	.asciz	"can't limit lease descriptor fcntls: %m"

	.comm	_ifi,8,3                        ; @ifi
.subsections_via_symbols
