	.file	"24851.c"
	.intel_syntax noprefix
	.text
	.globl	magic
	.type	magic, @function
magic:
.LFB6:
	.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
	mov	DWORD PTR -36[rbp], edx
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	lea	ecx, -42[rax]
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, ecx
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L6
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L5
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	jmp	.L1
.L6:
	nop
.L1:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	magic, .-magic
	.globl	ss1
	.data
	.align 32
	.type	ss1, @object
	.size	ss1, 2120
ss1:
	.zero	2104
	.string	"\304\336\352\334\350\362@\320\352\334\350\312\344BB"
	.section	.rodata
.LC0:
	.string	"Frobbing inputs ..."
.LC1:
	.string	"Enter string:"
.LC2:
	.string	"good job~~!"
.LC3:
	.string	"r"
.LC4:
	.string	"flag.txt"
.LC5:
	.string	"The flag is: %s\n"
.LC6:
	.string	"Frobbed output:"
.LC7:
	.string	"%c%c%c"
.LC8:
	.string	""
.LC9:
	.string	"Press any key to continue..."
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1344
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	edi, 96
	call	malloc@PLT
	mov	QWORD PTR ss1[rip+16], rax
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR ss1[rip+24], rax
	mov	edi, 144
	call	malloc@PLT
	mov	QWORD PTR ss1[rip+32], rax
	mov	edi, 112
	call	malloc@PLT
	mov	QWORD PTR ss1[rip+8], rax
	mov	DWORD PTR -1332[rbp], 0
	jmp	.L8
.L9:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR stdin[rip]
	lea	rcx, -1312[rbp]
	mov	edx, DWORD PTR -1332[rbp]
	movsx	rdx, edx
	sal	rdx, 8
	add	rcx, rdx
	mov	rdx, rax
	mov	esi, 256
	mov	rdi, rcx
	call	fgets@PLT
	add	DWORD PTR -1332[rbp], 1
.L8:
	cmp	DWORD PTR -1332[rbp], 4
	jle	.L9
	mov	rax, QWORD PTR ss1[rip+16]
	lea	rcx, -1312[rbp]
	mov	edx, 96
	mov	rsi, rcx
	mov	rdi, rax
	call	magic
	mov	rax, QWORD PTR ss1[rip+32]
	lea	rdx, -1312[rbp]
	lea	rcx, 512[rdx]
	mov	edx, 128
	mov	rsi, rcx
	mov	rdi, rax
	call	magic
	mov	rax, QWORD PTR ss1[rip+8]
	lea	rdx, -1312[rbp]
	lea	rcx, 768[rdx]
	mov	edx, 112
	mov	rsi, rcx
	mov	rdi, rax
	call	magic
	mov	rax, QWORD PTR ss1[rip+24]
	lea	rdx, -1312[rbp]
	lea	rcx, 1024[rdx]
	mov	edx, 144
	mov	rsi, rcx
	mov	rdi, rax
	call	magic
	mov	rax, QWORD PTR ss1[rip+32]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR ss1[rip+8]
	mov	QWORD PTR -1328[rbp], rax
	jmp	.L10
.L12:
	mov	rax, QWORD PTR -1328[rbp]
	movzx	eax, BYTE PTR [rax]
	xor	eax, 42
	mov	edx, eax
	mov	rax, QWORD PTR -1328[rbp]
	mov	BYTE PTR [rax], dl
	add	QWORD PTR -1328[rbp], 1
.L10:
	cmp	QWORD PTR -1328[rbp], 0
	je	.L11
	mov	rax, QWORD PTR -1328[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L12
.L11:
	mov	rax, QWORD PTR ss1[rip+16]
	mov	QWORD PTR -1328[rbp], rax
	jmp	.L13
.L15:
	mov	rax, QWORD PTR -1328[rbp]
	movzx	eax, BYTE PTR [rax]
	xor	eax, 66
	mov	edx, eax
	mov	rax, QWORD PTR -1328[rbp]
	mov	BYTE PTR [rax], dl
	add	QWORD PTR -1328[rbp], 1
.L13:
	cmp	QWORD PTR -1328[rbp], 0
	je	.L14
	mov	rax, QWORD PTR -1328[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L15
.L14:
	mov	rax, QWORD PTR ss1[rip+24]
	lea	rdx, -1312[rbp]
	lea	rcx, 512[rdx]
	mov	edx, 56
	mov	rsi, rcx
	mov	rdi, rax
	call	magic
	mov	DWORD PTR -1332[rbp], 0
	jmp	.L16
.L18:
	add	DWORD PTR -1332[rbp], 1
.L16:
	cmp	DWORD PTR -1332[rbp], 15
	jg	.L17
	mov	eax, DWORD PTR -1332[rbp]
	cdqe
	lea	rdx, ss1[rip+40]
	movzx	eax, BYTE PTR [rax+rdx]
	mov	ecx, eax
	mov	eax, DWORD PTR -1332[rbp]
	cdqe
	lea	rdx, ss1[rip+2104]
	movzx	eax, BYTE PTR [rax+rdx]
	shr	al
	cmp	cl, al
	je	.L18
.L17:
	cmp	DWORD PTR -1332[rbp], 16
	jne	.L19
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	call	fopen@PLT
	mov	QWORD PTR -1320[rbp], rax
	cmp	QWORD PTR -1320[rbp], 0
	je	.L21
	mov	rdx, QWORD PTR -1320[rbp]
	lea	rax, -32[rbp]
	mov	esi, 24
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	je	.L21
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L21
.L19:
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	DWORD PTR -1332[rbp], 0
	jmp	.L22
.L23:
	mov	rdx, QWORD PTR ss1[rip+24]
	mov	eax, DWORD PTR -1332[rbp]
	cdqe
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	ecx, al
	mov	rdx, QWORD PTR ss1[rip+16]
	mov	eax, DWORD PTR -1332[rbp]
	cdqe
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	edx, al
	mov	rsi, QWORD PTR ss1[rip+8]
	mov	eax, DWORD PTR -1332[rbp]
	cdqe
	add	rax, rsi
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -1332[rbp], 1
.L22:
	cmp	DWORD PTR -1332[rbp], 9
	jle	.L23
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L21:
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	call	getchar@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"24851.c"
	.text
	.align	2
	.global	magic
	.syntax unified
	.arm
	.fpu softvfp
	.type	magic, %function
magic:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L5:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-8]
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	sub	r2, r2, #42
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L6
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L5
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	b	.L1
.L6:
	nop
.L1:
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	magic, .-magic
	.global	ss1
	.data
	.align	2
	.type	ss1, %object
	.size	ss1, 2100
ss1:
	.space	2084
	.ascii	"\304\336\352\334\350\362@\320\352\334\350\312\344BB"
	.ascii	"\000"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Frobbing inputs ...\000"
	.align	2
.LC1:
	.ascii	"Enter string:\000"
	.align	2
.LC2:
	.ascii	"good job~~!\000"
	.align	2
.LC3:
	.ascii	"r\000"
	.align	2
.LC4:
	.ascii	"flag.txt\000"
	.align	2
.LC5:
	.ascii	"The flag is: %s\012\000"
	.align	2
.LC6:
	.ascii	"Frobbed output:\000"
	.align	2
.LC7:
	.ascii	"%c%c%c\000"
	.align	2
.LC8:
	.ascii	"\000"
	.align	2
.LC9:
	.ascii	"Press any key to continue...\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1320
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1312
	sub	sp, sp, #8
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L26+4
	bl	puts
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r0, #96
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L26+12
	str	r2, [r3, #8]
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L26+12
	str	r2, [r3, #12]
	mov	r0, #144
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L26+12
	str	r2, [r3, #16]
	mov	r0, #112
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L26+12
	str	r2, [r3, #4]
	mov	r3, #0
	str	r3, [fp, #-1324]
	b	.L8
.L9:
	ldr	r0, .L26+16
	bl	puts
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r2, [fp, #-1324]
	lsl	r2, r2, #8
	add	r3, r3, r2
	ldr	r2, .L26+20
	ldr	r2, [r2]
	mov	r1, #256
	mov	r0, r3
	bl	fgets
	ldr	r3, [fp, #-1324]
	add	r3, r3, #1
	str	r3, [fp, #-1324]
.L8:
	ldr	r3, [fp, #-1324]
	cmp	r3, #4
	ble	.L9
	ldr	r3, .L26+12
	ldr	r0, [r3, #8]
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r2, #96
	mov	r1, r3
	bl	magic
	ldr	r3, .L26+12
	ldr	r0, [r3, #16]
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #12
	add	r3, r3, #512
	mov	r2, #128
	mov	r1, r3
	bl	magic
	ldr	r3, .L26+12
	ldr	r0, [r3, #4]
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #12
	add	r3, r3, #768
	mov	r2, #112
	mov	r1, r3
	bl	magic
	ldr	r3, .L26+12
	ldr	r0, [r3, #12]
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #12
	add	r3, r3, #1024
	mov	r2, #144
	mov	r1, r3
	bl	magic
	ldr	r3, .L26+12
	ldr	r3, [r3, #16]
	mov	r0, r3
	bl	free
	ldr	r3, .L26+12
	ldr	r3, [r3, #4]
	str	r3, [fp, #-1320]
	b	.L10
.L12:
	ldr	r3, [fp, #-1320]
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, #42
	and	r2, r3, #255
	ldr	r3, [fp, #-1320]
	strb	r2, [r3]
	ldr	r3, [fp, #-1320]
	add	r3, r3, #1
	str	r3, [fp, #-1320]
.L10:
	ldr	r3, [fp, #-1320]
	cmp	r3, #0
	beq	.L11
	ldr	r3, [fp, #-1320]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L12
.L11:
	ldr	r3, .L26+12
	ldr	r3, [r3, #8]
	str	r3, [fp, #-1320]
	b	.L13
.L15:
	ldr	r3, [fp, #-1320]
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, #66
	and	r2, r3, #255
	ldr	r3, [fp, #-1320]
	strb	r2, [r3]
	ldr	r3, [fp, #-1320]
	add	r3, r3, #1
	str	r3, [fp, #-1320]
.L13:
	ldr	r3, [fp, #-1320]
	cmp	r3, #0
	beq	.L14
	ldr	r3, [fp, #-1320]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L15
.L14:
	ldr	r3, .L26+12
	ldr	r0, [r3, #12]
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #12
	add	r3, r3, #512
	mov	r2, #56
	mov	r1, r3
	bl	magic
	mov	r3, #0
	str	r3, [fp, #-1324]
	b	.L16
.L18:
	ldr	r3, [fp, #-1324]
	add	r3, r3, #1
	str	r3, [fp, #-1324]
.L16:
	ldr	r3, [fp, #-1324]
	cmp	r3, #15
	bgt	.L17
	ldr	r2, .L26+12
	ldr	r3, [fp, #-1324]
	add	r3, r2, r3
	add	r3, r3, #20
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r1, .L26+12
	ldr	r3, [fp, #-1324]
	add	r3, r1, r3
	add	r3, r3, #2080
	add	r3, r3, #4
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsr	r3, r3, #1
	and	r3, r3, #255
	cmp	r2, r3
	beq	.L18
.L17:
	ldr	r3, [fp, #-1324]
	cmp	r3, #16
	bne	.L19
	ldr	r0, .L26+24
	bl	puts
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r1, .L26+28
	ldr	r0, .L26+32
	bl	fopen
	str	r0, [fp, #-1316]
	ldr	r3, [fp, #-1316]
	cmp	r3, #0
	beq	.L21
	sub	r3, fp, #32
	ldr	r2, [fp, #-1316]
	mov	r1, #24
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	beq	.L21
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, .L26+36
	bl	printf
	b	.L21
.L19:
	ldr	r0, .L26+40
	bl	puts
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r3, #0
	str	r3, [fp, #-1324]
	b	.L22
.L23:
	ldr	r3, .L26+12
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-1324]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r3, .L26+12
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-1324]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	ldr	r3, .L26+12
	ldr	r2, [r3, #12]
	ldr	r3, [fp, #-1324]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r0
	ldr	r0, .L26+44
	bl	printf
	ldr	r3, [fp, #-1324]
	add	r3, r3, #1
	str	r3, [fp, #-1324]
.L22:
	ldr	r3, [fp, #-1324]
	cmp	r3, #9
	ble	.L23
	ldr	r0, .L26+48
	bl	puts
.L21:
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r0, .L26+52
	bl	printf
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	bl	getchar
	mov	r3, #0
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC10
	.word	.LC0
	.word	stdout
	.word	ss1
	.word	.LC1
	.word	stdin
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
