	.file	"extr_xinstall.c_create_newfile.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s%s"
.LC1:
	.string	"%s: backup filename too long"
.LC2:
	.string	"install: %s -> %s\n"
.LC3:
	.string	"rename: %s to %s"
	.text
	.p2align 4
	.type	create_newfile, @function
create_newfile:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAXPATHLEN[rip]
	mov	rcx, rsp
	mov	r9, rax
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L24:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L24
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L25
	mov	r13, rsp
	test	esi, esi
	jne	.L26
.L5:
	mov	edx, DWORD PTR S_IRUSR[rip]
	mov	esi, DWORD PTR O_CREAT[rip]
	mov	rdi, r12
	or	esi, DWORD PTR O_RDWR[rip]
	or	edx, DWORD PTR S_IWUSR[rip]
	or	esi, DWORD PTR O_TRUNC[rip]
	call	open@PLT
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L27
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	cmp	QWORD PTR dobackup[rip], 0
	je	.L6
	mov	r8, QWORD PTR suffix[rip]
	mov	rcx, r12
	mov	esi, r9d
	mov	rdi, rsp
	lea	rdx, .LC0[rip]
	call	snprintf@PLT
	mov	rdi, r12
	mov	r14, rax
	call	strlen@PLT
	mov	r15, QWORD PTR suffix[rip]
	mov	rbx, rax
	mov	rdi, r15
	call	strlen@PLT
	add	rax, rbx
	xor	ebx, ebx
	cmp	r14, rax
	jne	.L28
.L7:
	mov	esi, DWORD PTR MAXPATHLEN[rip]
	mov	r8, r15
	mov	rcx, r12
	mov	rdi, r13
	lea	rdx, .LC0[rip]
	call	snprintf@PLT
	cmp	QWORD PTR verbose[rip], 0
	jne	.L29
.L8:
	mov	rsi, r13
	mov	rdi, r12
	call	rename@PLT
	test	rax, rax
	js	.L30
.L9:
	mov	edx, DWORD PTR S_IRUSR[rip]
	mov	esi, DWORD PTR O_CREAT[rip]
	mov	rdi, r12
	or	esi, DWORD PTR O_RDWR[rip]
	or	edx, DWORD PTR S_IWUSR[rip]
	or	esi, DWORD PTR O_TRUNC[rip]
	call	open@PLT
	test	eax, eax
	jns	.L1
	test	ebx, ebx
	je	.L1
	mov	DWORD PTR errno[rip], ebx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, r12
	call	unlink@PLT
	test	rax, rax
	jns	.L5
	mov	ebx, DWORD PTR errno[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L25:
	or	QWORD PTR -8[rsp+rdx], 0
	mov	r13, rsp
	test	esi, esi
	je	.L5
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edi, DWORD PTR EX_OSERR[rip]
	mov	rdx, r12
	lea	rsi, .LC1[rip]
	mov	ebx, DWORD PTR errno[rip]
	call	errx@PLT
	mov	r15, QWORD PTR suffix[rip]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rdx, r13
	mov	rsi, r12
	lea	rdi, .LC2[rip]
	call	printf@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L30:
	mov	edi, DWORD PTR EX_OSERR[rip]
	mov	rcx, r13
	mov	rdx, r12
	lea	rsi, .LC3[rip]
	mov	ebx, DWORD PTR errno[rip]
	call	err@PLT
	jmp	.L9
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	create_newfile, .-create_newfile
	.comm	verbose,8,8
	.comm	suffix,8,8
	.comm	errno,4,4
	.comm	dobackup,8,8
	.comm	S_IWUSR,4,4
	.comm	S_IRUSR,4,4
	.comm	O_TRUNC,4,4
	.comm	O_RDWR,4,4
	.comm	O_CREAT,4,4
	.comm	NOCHANGEBITS,4,4
	.comm	MAXPATHLEN,4,4
	.comm	EX_OSERR,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_xinstall.c_create_newfile.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s%s\000"
	.align	2
.LC1:
	.ascii	"%s: backup filename too long\000"
	.align	2
.LC2:
	.ascii	"install: %s -> %s\012\000"
	.align	2
.LC3:
	.ascii	"rename: %s to %s\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_newfile, %function
create_newfile:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #20
	ldr	r5, .L26
	ldr	r3, .L26+4
	cmp	r1, #0
	ldr	r1, [r5]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	add	r3, r1, #7
	bic	r3, r3, #7
	mov	r4, r0
	sub	sp, sp, r3
	beq	.L2
	ldr	r3, .L26+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r8, .L26+12
	add	r7, sp, #8
	ldr	r2, [r8]
	mov	r3, r0
	str	r2, [sp]
	mov	r0, r7
	ldr	r2, .L26+16
	bl	snprintf
	mov	r9, r0
	mov	r0, r4
	bl	strlen
	ldr	r10, [r8]
	mov	r6, r0
	mov	r0, r10
	bl	strlen
	add	r6, r6, r0
	cmp	r9, r6
	moveq	r6, #0
	bne	.L21
.L4:
	mov	r3, r4
	mov	r0, r7
	ldr	r1, [r5]
	ldr	r2, .L26+16
	str	r10, [sp]
	bl	snprintf
	ldr	r3, .L26+20
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L22
.L5:
	mov	r1, r7
	mov	r0, r4
	bl	rename
	cmp	r0, #0
	blt	.L23
.L6:
	ldr	r3, .L26+24
	ldr	r0, .L26+28
	ldr	r1, .L26+32
	ldr	ip, .L26+36
	ldr	r2, .L26+40
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	ip, [ip]
	ldr	r2, [r2]
	orr	r3, r3, r0
	orr	r1, r3, r1
	mov	r0, r4
	orr	r2, ip, r2
	bl	open
	subs	r3, r6, #0
	movne	r3, #1
	ands	r3, r3, r0, lsr #31
	ldrne	r3, .L26+44
	strne	r6, [r3]
	b	.L1
.L3:
	bl	unlink
	cmp	r0, #0
	blt	.L24
.L2:
	ldr	r3, .L26+24
	ldr	r0, .L26+28
	ldr	r1, .L26+32
	ldr	ip, .L26+36
	ldr	r2, .L26+40
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	ip, [ip]
	ldr	r2, [r2]
	orr	r3, r3, r0
	orr	r1, r3, r1
	mov	r0, r4
	orr	r2, ip, r2
	bl	open
.L1:
	ldr	r3, .L26+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	ldr	r2, .L26+48
	ldr	r3, .L26+44
	ldr	r0, [r2]
	ldr	r1, .L26+52
	mov	r2, r4
	ldr	r6, [r3]
	bl	errx
	ldr	r10, [r8]
	b	.L4
.L24:
	ldr	r3, .L26+44
	ldr	r6, [r3]
	b	.L6
.L22:
	mov	r2, r7
	mov	r1, r4
	ldr	r0, .L26+56
	bl	printf
	b	.L5
.L23:
	ldr	r2, .L26+48
	ldr	ip, .L26+44
	mov	r3, r7
	ldr	r0, [r2]
	ldr	r1, .L26+60
	mov	r2, r4
	ldr	r6, [ip]
	bl	err
	b	.L6
.L25:
	bl	__stack_chk_fail
.L27:
	.align	2
.L26:
	.word	MAXPATHLEN
	.word	.LC4
	.word	dobackup
	.word	suffix
	.word	.LC0
	.word	verbose
	.word	O_CREAT
	.word	O_RDWR
	.word	O_TRUNC
	.word	S_IRUSR
	.word	S_IWUSR
	.word	errno
	.word	EX_OSERR
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	create_newfile, .-create_newfile
	.comm	verbose,4,4
	.comm	suffix,4,4
	.comm	errno,4,4
	.comm	dobackup,4,4
	.comm	S_IWUSR,4,4
	.comm	S_IRUSR,4,4
	.comm	O_TRUNC,4,4
	.comm	O_RDWR,4,4
	.comm	O_CREAT,4,4
	.comm	NOCHANGEBITS,4,4
	.comm	MAXPATHLEN,4,4
	.comm	EX_OSERR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
