	.file	"58851.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Enter name of file to be encrypted: "
.LC1:
	.string	"%s"
.LC2:
	.string	"r"
	.align 8
.LC3:
	.string	"Error: file %s cannot be opened\n"
.LC4:
	.string	"w"
	.align 8
.LC5:
	.string	"Error: file %s cannot be written\n"
.LC6:
	.string	"Enter shift amount (1-25): "
.LC7:
	.string	"%d"
	.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, 304
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -272[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rax, -272[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -296[rbp], rax
	cmp	QWORD PTR -296[rbp], 0
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -272[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rax, -272[rbp]
	mov	rdi, rax
	call	strlen@PLT
	add	rax, 5
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -288[rbp], rax
	lea	rdx, -272[rbp]
	mov	rax, QWORD PTR -288[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -288[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -288[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], 1668179246
	mov	BYTE PTR 4[rax], 0
	mov	rax, QWORD PTR -288[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -280[rbp], rax
	cmp	QWORD PTR -280[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -288[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -300[rbp]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	jmp	.L4
.L7:
	cmp	BYTE PTR -301[rbp], 64
	jle	.L5
	cmp	BYTE PTR -301[rbp], 90
	jg	.L5
	movsx	eax, BYTE PTR -301[rbp]
	lea	edx, -65[rax]
	mov	eax, DWORD PTR -300[rbp]
	add	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1321528399
	shr	rax, 32
	sar	eax, 3
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	imul	ecx, eax, 26
	mov	eax, edx
	sub	eax, ecx
	lea	edx, 65[rax]
	mov	rax, QWORD PTR -280[rbp]
	mov	rsi, rax
	mov	edi, edx
	call	putc@PLT
	jmp	.L4
.L5:
	cmp	BYTE PTR -301[rbp], 96
	jle	.L6
	cmp	BYTE PTR -301[rbp], 122
	jg	.L6
	movsx	eax, BYTE PTR -301[rbp]
	lea	edx, -97[rax]
	mov	eax, DWORD PTR -300[rbp]
	add	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1321528399
	shr	rax, 32
	sar	eax, 3
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	imul	ecx, eax, 26
	mov	eax, edx
	sub	eax, ecx
	lea	edx, 97[rax]
	mov	rax, QWORD PTR -280[rbp]
	mov	rsi, rax
	mov	edi, edx
	call	putc@PLT
	jmp	.L4
.L6:
	movsx	eax, BYTE PTR -301[rbp]
	mov	rdx, QWORD PTR -280[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
.L4:
	mov	rax, QWORD PTR -296[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	BYTE PTR -301[rbp], al
	cmp	BYTE PTR -301[rbp], -1
	jne	.L7
	mov	rax, QWORD PTR -296[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -280[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.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	"58851.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Enter name of file to be encrypted: \000"
	.align	2
.LC1:
	.ascii	"%s\000"
	.align	2
.LC2:
	.ascii	"r\000"
	.align	2
.LC3:
	.ascii	"Error: file %s cannot be opened\012\000"
	.align	2
.LC4:
	.ascii	".enc\000"
	.align	2
.LC5:
	.ascii	"w\000"
	.align	2
.LC6:
	.ascii	"Error: file %s cannot be written\012\000"
	.align	2
.LC7:
	.ascii	"Enter shift amount (1-25): \000"
	.align	2
.LC8:
	.ascii	"%d\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #280
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L10+4
	bl	printf
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, .L10+8
	bl	__isoc99_scanf
	sub	r3, fp, #264
	ldr	r1, .L10+12
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-276]
	ldr	r3, [fp, #-276]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L10+16
	ldr	r3, [r3]
	sub	r2, fp, #264
	ldr	r1, .L10+20
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #264
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r3, r3, #5
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-272]
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, [fp, #-272]
	bl	strcpy
	ldr	r0, [fp, #-272]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-272]
	add	r3, r3, r2
	ldr	r2, .L10+24
	mov	r0, r3
	mov	r1, r2
	mov	r3, #5
	mov	r2, r3
	bl	memcpy
	ldr	r1, .L10+28
	ldr	r0, [fp, #-272]
	bl	fopen
	str	r0, [fp, #-268]
	ldr	r3, [fp, #-268]
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L10+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-272]
	ldr	r1, .L10+32
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r0, .L10+36
	bl	printf
	sub	r3, fp, #280
	mov	r1, r3
	ldr	r0, .L10+40
	bl	__isoc99_scanf
	b	.L4
.L9:
	ldrb	r3, [fp, #-281]	@ zero_extendqisi2
	cmp	r3, #90
	bhi	.L5
	ldrb	r3, [fp, #-281]	@ zero_extendqisi2
	sub	r2, r3, #65
	ldr	r3, [fp, #-280]
	add	r1, r2, r3
	ldr	r3, .L10+44
	smull	r2, r3, r1, r3
	asr	r2, r3, #3
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	add	r3, r2, #65
	ldr	r1, [fp, #-268]
	mov	r0, r3
	bl	putc
	b	.L4
.L5:
	ldrb	r3, [fp, #-281]	@ zero_extendqisi2
	cmp	r3, #96
	bls	.L6
	ldrb	r3, [fp, #-281]	@ zero_extendqisi2
	cmp	r3, #122
	bhi	.L6
	ldrb	r3, [fp, #-281]	@ zero_extendqisi2
	sub	r2, r3, #97
	ldr	r3, [fp, #-280]
	add	r1, r2, r3
	ldr	r3, .L10+44
	smull	r2, r3, r1, r3
	asr	r2, r3, #3
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	add	r3, r2, #97
	ldr	r1, [fp, #-268]
	mov	r0, r3
	bl	putc
	b	.L4
.L6:
	ldrb	r3, [fp, #-281]	@ zero_extendqisi2
	ldr	r1, [fp, #-268]
	mov	r0, r3
	bl	putc
.L4:
	ldr	r0, [fp, #-276]
	bl	getc
	mov	r3, r0
	strb	r3, [fp, #-281]
	ldrb	r3, [fp, #-281]	@ zero_extendqisi2
	cmp	r3, #64
	bls	.L5
	b	.L9
.L11:
	.align	2
.L10:
	.word	.LC9
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	stderr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	1321528399
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
