	.file	"183709.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Enter a string: "
.LC1:
	.string	"%[^\n]"
	.align 8
.LC2:
	.string	"Error: Failed to get a string from standard in.\n"
	.align 8
.LC3:
	.string	"Error: This line should not have executed!\n"
.LC4:
	.string	"Duplicated string: %s\n"
.LC5:
	.string	"Length: %zu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 160
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -144[rbp], 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -144[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	test	eax, eax
	jns	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 48
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L6
.L2:
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	my_strlen
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -152[rbp], rax
	cmp	QWORD PTR -152[rbp], 0
	jne	.L4
	mov	eax, 1
	jmp	.L6
.L4:
	mov	edi, 0
	call	my_strlen
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	my_strcpy
	test	rax, rax
	je	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 43
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
.L5:
	lea	rdx, -144[rbp]
	mov	rax, QWORD PTR -152[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	my_strcpy
	mov	rax, QWORD PTR -152[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	my_strlen
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L6:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	my_strlen
	.type	my_strlen, @function
my_strlen:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -8[rbp], 0
	cmp	QWORD PTR -24[rbp], 0
	jne	.L11
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L10
.L12:
	add	QWORD PTR -8[rbp], 1
.L11:
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -24[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L12
	mov	rax, QWORD PTR -8[rbp]
.L10:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	my_strlen, .-my_strlen
	.globl	my_strcpy
	.type	my_strcpy, @function
my_strcpy:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	cmp	QWORD PTR -32[rbp], 0
	jne	.L14
	mov	eax, 0
	jmp	.L15
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L16
.L17:
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, 1[rdx]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, 1[rax]
	mov	QWORD PTR -24[rbp], rcx
	movzx	edx, BYTE PTR [rdx]
	mov	BYTE PTR [rax], dl
.L16:
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L17
	mov	rax, QWORD PTR -24[rbp]
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -8[rbp]
.L15:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	my_strcpy, .-my_strcpy
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"183709.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Enter a string: \000"
	.align	2
.LC1:
	.ascii	"%[^\012]\000"
	.align	2
.LC2:
	.ascii	"Error: Failed to get a string from standard in.\012"
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"Error: This line should not have executed!\012\000"
	.align	2
.LC4:
	.ascii	"Duplicated string: %s\012\000"
	.align	2
.LC5:
	.ascii	"Length: %zu\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-136]
	ldr	r0, .L8+4
	bl	printf
	sub	r3, fp, #136
	mov	r1, r3
	ldr	r0, .L8+8
	bl	__isoc99_scanf
	mov	r3, r0
	cmp	r3, #0
	bge	.L2
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #48
	mov	r1, #1
	ldr	r0, .L8+16
	bl	fwrite
	mov	r3, #1
	b	.L6
.L2:
	sub	r3, fp, #136
	mov	r0, r3
	bl	my_strlen
	mov	r3, r0
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-140]
	ldr	r3, [fp, #-140]
	cmp	r3, #0
	bne	.L4
	mov	r3, #1
	b	.L6
.L4:
	mov	r0, #0
	bl	my_strlen
	mov	r1, #0
	ldr	r0, [fp, #-140]
	bl	my_strcpy
	mov	r3, r0
	cmp	r3, #0
	beq	.L5
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #43
	mov	r1, #1
	ldr	r0, .L8+20
	bl	fwrite
.L5:
	sub	r3, fp, #136
	mov	r1, r3
	ldr	r0, [fp, #-140]
	bl	my_strcpy
	ldr	r1, [fp, #-140]
	ldr	r0, .L8+24
	bl	printf
	ldr	r0, [fp, #-140]
	bl	my_strlen
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L8+28
	bl	printf
	ldr	r0, [fp, #-140]
	bl	free
	mov	r3, #0
.L6:
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.align	2
	.global	my_strlen
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_strlen, %function
my_strlen:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L13
	ldr	r3, [fp, #-8]
	b	.L12
.L14:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L13:
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	str	r2, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-8]
.L12:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	my_strlen, .-my_strlen
	.align	2
	.global	my_strcpy
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_strcpy, %function
my_strcpy:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L16
	mov	r3, #0
	b	.L17
.L16:
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	b	.L18
.L19:
	ldr	r2, [fp, #-20]
	add	r3, r2, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-16]
	add	r1, r3, #1
	str	r1, [fp, #-16]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
.L18:
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L19
	ldr	r3, [fp, #-16]
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
.L17:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	my_strcpy, .-my_strcpy
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
