	.file	"54824924.c"
	.intel_syntax noprefix
	.text
	.globl	fun
	.type	fun, @function
fun:
.LFB0:
	.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 -40[rbp], rdi
	mov	DWORD PTR -12[rbp], 1
	mov	DWORD PTR -16[rbp], 0
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L2
.L3:
	add	DWORD PTR -16[rbp], 1
	add	QWORD PTR -8[rbp], 1
.L2:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L3
	mov	DWORD PTR -20[rbp], 0
	jmp	.L4
.L7:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	movzx	edx, BYTE PTR [rax]
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	sub	eax, DWORD PTR -20[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	movzx	eax, BYTE PTR [rax]
	cmp	dl, al
	je	.L5
	mov	eax, 0
	jmp	.L6
.L5:
	add	DWORD PTR -20[rbp], 1
.L4:
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cmp	DWORD PTR -20[rbp], eax
	jl	.L7
	mov	eax, DWORD PTR -12[rbp]
.L6:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	fun, .-fun
	.section	.rodata
.LC0:
	.string	"1234321"
.LC1:
	.string	"123421"
.LC2:
	.string	"123321"
.LC3:
	.string	"abcdCBA"
.LC4:
	.string	"Enter a string : "
.LC5:
	.string	"\n"
.LC6:
	.string	"YES"
.LC7:
	.string	"NO"
.LC8:
	.string	"w"
.LC9:
	.string	"out.dat"
.LC10:
	.string	"YES\n"
.LC11:
	.string	"NO\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, .LC0[rip]
	mov	QWORD PTR -128[rbp], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR -120[rbp], rax
	lea	rax, .LC2[rip]
	mov	QWORD PTR -112[rbp], rax
	lea	rax, .LC3[rip]
	mov	QWORD PTR -104[rbp], rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -96[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rax, -96[rbp]
	mov	rdi, rax
	call	fun
	test	eax, eax
	je	.L9
	lea	rdi, .LC6[rip]
	call	puts@PLT
	jmp	.L10
.L9:
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L10:
	lea	rsi, .LC8[rip]
	lea	rdi, .LC9[rip]
	call	fopen@PLT
	mov	QWORD PTR -136[rbp], rax
	mov	DWORD PTR -140[rbp], 0
	jmp	.L11
.L14:
	mov	eax, DWORD PTR -140[rbp]
	cdqe
	mov	rax, QWORD PTR -128[rbp+rax*8]
	mov	rdi, rax
	call	fun
	test	eax, eax
	je	.L12
	mov	rax, QWORD PTR -136[rbp]
	mov	rcx, rax
	mov	edx, 4
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	jmp	.L13
.L12:
	mov	rax, QWORD PTR -136[rbp]
	mov	rcx, rax
	mov	edx, 3
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
.L13:
	add	DWORD PTR -140[rbp], 1
.L11:
	cmp	DWORD PTR -140[rbp], 3
	jle	.L14
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	fclose@PLT
	call	getchar@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	"54824924.c"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"1234321\000"
	.align	2
.LC1:
	.ascii	"123421\000"
	.align	2
.LC2:
	.ascii	"123321\000"
	.align	2
.LC3:
	.ascii	"abcdCBA\000"
	.text
	.align	2
	.global	fun
	.syntax unified
	.arm
	.fpu softvfp
	.type	fun, %function
fun:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	mov	r3, #1
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-12]
	b	.L2
.L3:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L3
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L4
.L7:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-16]
	sub	r1, r3, #1
	ldr	r3, [fp, #-20]
	sub	r3, r1, r3
	mov	r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, r1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r2, r3
	beq	.L5
	mov	r3, #0
	b	.L6
.L5:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L4:
	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
	blt	.L7
	ldr	r3, [fp, #-8]
.L6:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	fun, .-fun
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Enter a string : \000"
	.align	2
.LC7:
	.ascii	"\012\000"
	.align	2
.LC8:
	.ascii	"YES\000"
	.align	2
.LC9:
	.ascii	"NO\000"
	.align	2
.LC10:
	.ascii	"w\000"
	.align	2
.LC11:
	.ascii	"out.dat\000"
	.align	2
.LC12:
	.ascii	"YES\012\000"
	.align	2
.LC13:
	.ascii	"NO\012\000"
	.align	2
.LC5:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.align	2
.LC14:
	.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, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L16+4
	sub	ip, fp, #104
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	ldr	r0, .L16+8
	bl	printf
	sub	r3, fp, #88
	mov	r0, r3
	bl	gets
	ldr	r0, .L16+12
	bl	puts
	sub	r3, fp, #88
	mov	r0, r3
	bl	fun
	mov	r3, r0
	cmp	r3, #0
	beq	.L9
	ldr	r0, .L16+16
	bl	puts
	b	.L10
.L9:
	ldr	r0, .L16+20
	bl	puts
.L10:
	ldr	r1, .L16+24
	ldr	r0, .L16+28
	bl	fopen
	str	r0, [fp, #-108]
	mov	r3, #0
	str	r3, [fp, #-112]
	b	.L11
.L14:
	ldr	r3, [fp, #-112]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-100]
	mov	r0, r3
	bl	fun
	mov	r3, r0
	cmp	r3, #0
	beq	.L12
	ldr	r3, [fp, #-108]
	mov	r2, #4
	mov	r1, #1
	ldr	r0, .L16+32
	bl	fwrite
	b	.L13
.L12:
	ldr	r3, [fp, #-108]
	mov	r2, #3
	mov	r1, #1
	ldr	r0, .L16+36
	bl	fwrite
.L13:
	ldr	r3, [fp, #-112]
	add	r3, r3, #1
	str	r3, [fp, #-112]
.L11:
	ldr	r3, [fp, #-112]
	cmp	r3, #3
	ble	.L14
	ldr	r0, [fp, #-108]
	bl	fclose
	bl	getchar
	nop
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC14
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
