	.file	"15763601.c"
	.intel_syntax noprefix
	.text
	.globl	reverse
	.type	reverse, @function
reverse:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	QWORD PTR -32[rbp], rdx
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cmp	DWORD PTR -24[rbp], eax
	jg	.L4
	mov	eax, DWORD PTR -20[rbp]
	sub	eax, DWORD PTR -24[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -24[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -24[rbp], edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR [rcx]
	mov	BYTE PTR [rdx], al
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	mov	BYTE PTR [rax], dl
	mov	rdx, QWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	reverse
	jmp	.L1
.L4:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	reverse, .-reverse
	.globl	reverse_2
	.type	reverse_2, @function
reverse_2:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	cmp	DWORD PTR -32[rbp], 1
	jne	.L6
	mov	eax, 1
	jmp	.L7
.L6:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -28[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, rcx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	mov	BYTE PTR [rax], dl
	sub	DWORD PTR -32[rbp], 1
	add	DWORD PTR -28[rbp], 1
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	reverse_2
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	reverse_2, .-reverse_2
	.section	.rodata
	.align 8
.LC0:
	.string	"Please input a string to reverse: "
.LC1:
	.string	"Reverse string is: %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
.L12:
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -112[rbp]
	mov	esi, 100
	mov	rdi, rax
	call	fgets@PLT
	mov	QWORD PTR -120[rbp], rax
	cmp	QWORD PTR -120[rbp], 0
	jne	.L9
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	jmp	.L14
.L9:
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -124[rbp], eax
	mov	eax, DWORD PTR -124[rbp]
	sub	eax, 1
	cdqe
	movzx	eax, BYTE PTR -112[rbp+rax]
	cmp	al, 10
	jne	.L11
	sub	DWORD PTR -124[rbp], 1
	mov	eax, DWORD PTR -124[rbp]
	cdqe
	mov	BYTE PTR -112[rbp+rax], 0
.L11:
	lea	rdx, -112[rbp]
	mov	eax, DWORD PTR -124[rbp]
	mov	esi, 0
	mov	edi, eax
	call	reverse
	lea	rax, -112[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L12
.L14:
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.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	"15763601.c"
	.text
	.align	2
	.global	reverse
	.syntax unified
	.arm
	.fpu softvfp
	.type	reverse, %function
reverse:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-20]
	cmp	r3, r2
	bgt	.L4
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-24]
	add	r2, r2, r3
	ldr	r3, [fp, #-20]
	add	r1, r3, #1
	str	r1, [fp, #-20]
	mov	r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, r1
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	reverse
	b	.L1
.L4:
	nop
.L1:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	reverse, .-reverse
	.align	2
	.global	reverse_2
	.syntax unified
	.arm
	.fpu softvfp
	.type	reverse_2, %function
reverse_2:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	bne	.L6
	mov	r3, #1
	b	.L7
.L6:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-16]
	add	r2, r2, r3
	ldr	r3, [fp, #-20]
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	str	r3, [fp, #-24]
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	reverse_2
	mov	r3, r0
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	reverse_2, .-reverse_2
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Please input a string to reverse: \000"
	.align	2
.LC1:
	.ascii	"Reverse string is: %s\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
.L12:
	ldr	r0, .L15+4
	bl	printf
	ldr	r3, .L15+8
	ldr	r2, [r3]
	sub	r3, fp, #108
	mov	r1, #100
	mov	r0, r3
	bl	fgets
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bne	.L9
	mov	r3, #0
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	b	.L14
.L9:
	sub	r3, fp, #108
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-116]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-104]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L11
	ldr	r3, [fp, #-116]
	sub	r3, r3, #1
	str	r3, [fp, #-116]
	sub	r2, fp, #108
	ldr	r3, [fp, #-116]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
.L11:
	sub	r3, fp, #108
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-116]
	bl	reverse
	sub	r3, fp, #108
	mov	r1, r3
	ldr	r0, .L15+12
	bl	printf
	b	.L12
.L14:
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC2
	.word	.LC0
	.word	stdin
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
