	.file	"extr_rdesktop.c_save_licence.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"HOME"
.LC1:
	.string	"%s/.rdesktop"
.LC2:
	.string	"%s/.rdesktop/licence.%s"
.LC3:
	.string	".new"
	.text
	.p2align 4
	.globl	save_licence
	.type	save_licence, @function
save_licence:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdi
	lea	rdi, .LC0[rip]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	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, edx
	call	getenv@PLT
	test	rax, rax
	je	.L1
	mov	rdi, rax
	mov	r12, rax
	call	strlen@PLT
	mov	rdi, QWORD PTR [r14]
	mov	ebp, eax
	call	strlen@PLT
	lea	edi, 20[rbp+rax]
	call	xmalloc@PLT
	lea	rsi, .LC1[rip]
	mov	rdx, r12
	mov	rdi, rax
	mov	rbp, rax
	xor	eax, eax
	call	sprintf@PLT
	mov	esi, 448
	mov	rdi, rbp
	call	mkdir@PLT
	cmp	eax, -1
	jne	.L3
	mov	rax, QWORD PTR EEXIST[rip]
	cmp	QWORD PTR errno[rip], rax
	mov	rdi, rbp
	jne	.L8
.L3:
	mov	rcx, QWORD PTR [r14]
	mov	rdx, r12
	lea	rsi, .LC2[rip]
	mov	rdi, rbp
	xor	eax, eax
	call	sprintf@PLT
	mov	rdi, rbp
	call	strlen@PLT
	lea	edi, 5[rax]
	call	xmalloc@PLT
	mov	rsi, rbp
	mov	r12, rax
	mov	rdi, rax
	call	strcpy@PLT
	lea	rsi, .LC3[rip]
	mov	rdi, r12
	call	strcat@PLT
	mov	esi, DWORD PTR O_WRONLY[rip]
	mov	edx, 384
	mov	rdi, r12
	or	esi, DWORD PTR O_CREAT[rip]
	or	esi, DWORD PTR O_TRUNC[rip]
	call	open@PLT
	mov	r14d, eax
	cmp	eax, -1
	je	.L10
	mov	edx, ebx
	mov	rsi, r13
	mov	edi, eax
	call	write@PLT
	cmp	eax, ebx
	je	.L5
	mov	rdi, r12
	call	perror@PLT
	mov	rdi, r12
	call	unlink@PLT
.L6:
	mov	edi, r14d
	call	close@PLT
	mov	rdi, r12
	call	xfree@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	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
	jmp	xfree@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rdi, r12
.L8:
	pop	rbx
	.cfi_remember_state
	.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
	jmp	perror@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	pop	rbx
	.cfi_remember_state
	.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
.L5:
	.cfi_restore_state
	mov	rsi, rbp
	mov	rdi, r12
	call	rename@PLT
	cmp	eax, -1
	jne	.L6
	mov	rdi, rbp
	call	perror@PLT
	mov	rdi, r12
	call	unlink@PLT
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	save_licence, .-save_licence
	.comm	errno,8,8
	.comm	O_WRONLY,4,4
	.comm	O_TRUNC,4,4
	.comm	O_CREAT,4,4
	.comm	EEXIST,8,8
	.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_rdesktop.c_save_licence.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"HOME\000"
	.align	2
.LC1:
	.ascii	"%s/.rdesktop\000"
	.align	2
.LC2:
	.ascii	"%s/.rdesktop/licence.%s\000"
	.align	2
.LC3:
	.ascii	".new\000"
	.text
	.align	2
	.global	save_licence
	.syntax unified
	.arm
	.fpu softvfp
	.type	save_licence, %function
save_licence:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r8, r0
	ldr	r0, .L11
	mov	r7, r1
	mov	r6, r2
	bl	getenv
	subs	r5, r0, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	bl	strlen
	mov	r4, r0
	ldr	r0, [r8]
	bl	strlen
	add	r0, r4, r0
	add	r0, r0, #20
	bl	xmalloc
	mov	r9, r0
	mov	r2, r5
	ldr	r1, .L11+4
	bl	sprintf
	mov	r0, r9
	mov	r1, #448
	bl	mkdir
	cmn	r0, #1
	bne	.L3
	ldr	r2, .L11+8
	ldr	r3, .L11+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L9
.L3:
	mov	r2, r5
	ldr	r3, [r8]
	ldr	r1, .L11+16
	mov	r0, r9
	bl	sprintf
	mov	r0, r9
	bl	strlen
	add	r0, r0, #5
	bl	xmalloc
	mov	r4, r0
	mov	r1, r9
	bl	strcpy
	mov	r0, r4
	bl	strlen
	mov	r2, #5
	ldr	r1, .L11+20
	add	r0, r4, r0
	bl	memcpy
	ldr	r3, .L11+24
	ldr	r2, .L11+28
	ldr	r1, .L11+32
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r2
	mov	r0, r4
	mov	r2, #384
	orr	r1, r3, r1
	bl	open
	cmn	r0, #1
	mov	r5, r0
	beq	.L10
	mov	r1, r7
	mov	r2, r6
	bl	write
	cmp	r0, r6
	beq	.L5
	mov	r0, r4
	bl	perror
	mov	r0, r4
	bl	unlink
.L6:
	mov	r0, r5
	bl	close
	mov	r0, r4
	bl	xfree
	mov	r0, r9
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	xfree
.L10:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	perror
.L9:
	mov	r0, r9
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	perror
.L5:
	mov	r1, r9
	mov	r0, r4
	bl	rename
	cmn	r0, #1
	bne	.L6
	mov	r0, r9
	bl	perror
	mov	r0, r4
	bl	unlink
	b	.L6
.L12:
	.align	2
.L11:
	.word	.LC0
	.word	.LC1
	.word	errno
	.word	EEXIST
	.word	.LC2
	.word	.LC3
	.word	O_WRONLY
	.word	O_CREAT
	.word	O_TRUNC
	.size	save_licence, .-save_licence
	.comm	errno,4,4
	.comm	O_WRONLY,4,4
	.comm	O_TRUNC,4,4
	.comm	O_CREAT,4,4
	.comm	EEXIST,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
