	.file	"extr_cluster.c_clusterSaveConfig.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"vars currentEpoch %llu lastVoteEpoch %llu\n"
	.text
	.p2align 4
	.globl	clusterSaveConfig
	.type	clusterSaveConfig, @function
clusterSaveConfig:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, edi
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rdx, QWORD PTR server[rip]
	mov	edi, DWORD PTR CLUSTER_NODE_HANDSHAKE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR CLUSTER_TODO_SAVE_CONFIG[rip]
	not	eax
	and	DWORD PTR [rdx], eax
	call	clusterGenNodesDescription@PLT
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	rax, QWORD PTR server[rip]
	mov	rdx, QWORD PTR 16[rax]
	mov	rcx, QWORD PTR 8[rax]
	call	sdscatprintf@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	sdslen@PLT
	mov	edi, DWORD PTR server[rip+8]
	mov	esi, DWORD PTR O_WRONLY[rip]
	mov	edx, 420
	or	esi, DWORD PTR O_CREAT[rip]
	mov	r13, rax
	call	open@PLT
	cmp	eax, -1
	je	.L2
	mov	rsi, rsp
	mov	edi, eax
	mov	r12d, eax
	call	fstat@PLT
	cmp	eax, -1
	je	.L3
	mov	rsi, QWORD PTR [rsp]
	cmp	rsi, r13
	jg	.L20
.L3:
	mov	rdi, rbp
	call	sdslen@PLT
	mov	edi, r12d
	mov	rsi, rbp
	mov	rdx, rax
	call	write@PLT
	mov	rdi, rbp
	mov	r14, rax
	call	sdslen@PLT
	cmp	r14, rax
	jne	.L4
	test	ebx, ebx
	jne	.L21
.L5:
	mov	rdi, rbp
	call	sdslen@PLT
	cmp	rax, r13
	jne	.L22
.L6:
	mov	edi, r12d
	call	close@PLT
	mov	rdi, rbp
	call	sdsfree@PLT
	xor	eax, eax
.L1:
	mov	rbx, QWORD PTR 8[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L23
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	mov	rsi, r13
	mov	edi, r12d
	call	ftruncate@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdi, rbp
	call	sdsgrowzero@PLT
	mov	rdx, QWORD PTR [rsp]
	mov	esi, 10
	lea	rdi, [rax+r13]
	mov	rbp, rax
	sub	rdx, r13
	call	memset@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdx, QWORD PTR server[rip]
	mov	eax, DWORD PTR CLUSTER_TODO_FSYNC_CONFIG[rip]
	mov	edi, r12d
	not	eax
	and	DWORD PTR [rdx], eax
	call	fsync@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, r12d
	call	close@PLT
.L2:
	mov	rdi, rbp
	call	sdsfree@PLT
	mov	eax, -1
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	clusterSaveConfig, .-clusterSaveConfig
	.comm	server,16,16
	.comm	O_WRONLY,4,4
	.comm	O_CREAT,4,4
	.comm	CLUSTER_TODO_SAVE_CONFIG,4,4
	.comm	CLUSTER_TODO_FSYNC_CONFIG,4,4
	.comm	CLUSTER_NODE_HANDSHAKE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_cluster.c_clusterSaveConfig.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"vars currentEpoch %llu lastVoteEpoch %llu\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	clusterSaveConfig
	.syntax unified
	.arm
	.fpu softvfp
	.type	clusterSaveConfig, %function
clusterSaveConfig:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r6, .L24
	ldr	r3, .L24+4
	ldr	r2, [r6]
	mov	r7, r0
	ldr	r0, [r3]
	ldr	r3, [r2]
	ldr	r1, .L24+8
	bic	r3, r3, r0
	ldr	r0, .L24+12
	sub	sp, sp, #20
	ldr	r0, [r0]
	str	r0, [sp, #12]
	mov	r0,#0
	ldr	r0, [r1]
	str	r3, [r2]
	bl	clusterGenNodesDescription
	ldr	r3, [r6]
	ldr	r1, .L24+16
	ldr	r4, [r3, #4]
	ldr	r2, [r3, #8]
	asr	r5, r4, #31
	asr	r3, r2, #31
	stm	sp, {r4-r5}
	bl	sdscatprintf
	mov	r4, r0
	bl	sdslen
	ldr	r2, .L24+20
	ldr	r3, .L24+24
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r9, r0
	mov	r2, #420
	ldr	r0, [r6, #4]
	orr	r1, r1, r3
	bl	open
	cmn	r0, #1
	beq	.L2
	add	r1, sp, #8
	mov	r5, r0
	bl	fstat
	cmn	r0, #1
	beq	.L3
	ldr	r1, [sp, #8]
	cmp	r1, r9
	bgt	.L20
.L3:
	mov	r0, r4
	bl	sdslen
	mov	r1, r4
	mov	r2, r0
	mov	r0, r5
	bl	write
	mov	r8, r0
	mov	r0, r4
	bl	sdslen
	cmp	r8, r0
	bne	.L4
	cmp	r7, #0
	bne	.L21
.L5:
	mov	r0, r4
	bl	sdslen
	cmp	r0, r9
	bne	.L22
.L6:
	mov	r0, r5
	bl	close
	mov	r0, r4
	bl	sdsfree
	mov	r0, #0
.L1:
	ldr	r3, .L24+12
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L22:
	mov	r1, r9
	mov	r0, r5
	bl	ftruncate
	b	.L6
.L20:
	mov	r0, r4
	bl	sdsgrowzero
	ldr	r2, [sp, #8]
	mov	r4, r0
	mov	r1, #10
	add	r0, r0, r9
	sub	r2, r2, r9
	bl	memset
	b	.L3
.L21:
	ldr	r2, [r6]
	ldr	r1, .L24+28
	ldr	r3, [r2]
	ldr	r1, [r1]
	mov	r0, r5
	bic	r3, r3, r1
	str	r3, [r2]
	bl	fsync
	b	.L5
.L4:
	mov	r0, r5
	bl	close
.L2:
	mov	r0, r4
	bl	sdsfree
	mvn	r0, #0
	b	.L1
.L23:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	server
	.word	CLUSTER_TODO_SAVE_CONFIG
	.word	CLUSTER_NODE_HANDSHAKE
	.word	.LC1
	.word	.LC0
	.word	O_WRONLY
	.word	O_CREAT
	.word	CLUSTER_TODO_FSYNC_CONFIG
	.size	clusterSaveConfig, .-clusterSaveConfig
	.comm	server,8,4
	.comm	O_WRONLY,4,4
	.comm	O_CREAT,4,4
	.comm	CLUSTER_TODO_SAVE_CONFIG,4,4
	.comm	CLUSTER_TODO_FSYNC_CONFIG,4,4
	.comm	CLUSTER_NODE_HANDSHAKE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
