	.file	"1239975.c"
	.intel_syntax noprefix
	.text
	.globl	last_filename
	.bss
	.align 32
	.type	last_filename, @object
	.size	last_filename, 200
last_filename:
	.zero	200
	.globl	full_filename
	.align 32
	.type	full_filename, @object
	.size	full_filename, 200
full_filename:
	.zero	200
	.globl	len_response
	.align 4
	.type	len_response, @object
	.size	len_response, 4
len_response:
	.zero	4
	.text
	.globl	openfile
	.type	openfile, @function
openfile:
.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, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	nop
.L2:
	mov	edx, DWORD PTR -36[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	open_it
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	je	.L2
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	openfile, .-openfile
	.section	.rodata
.LC0:
	.string	"%s (%s.%s) "
.LC1:
	.string	"%s"
.LC2:
	.string	"r"
.LC3:
	.string	"w"
.LC4:
	.string	"rw"
.LC5:
	.string	"openfile"
	.text
	.globl	open_it
	.type	open_it, @function
open_it:
.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, 368
	mov	QWORD PTR -344[rbp], rdi
	mov	QWORD PTR -352[rbp], rsi
	mov	DWORD PTR -356[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -352[rbp]
	mov	rax, QWORD PTR -344[rbp]
	mov	rcx, rdx
	lea	rdx, last_filename[rip]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	BYTE PTR -288[rbp], 0
	lea	rax, -288[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	test	rax, rax
	jne	.L5
	mov	eax, 0
	jmp	.L26
.L5:
	mov	BYTE PTR -208[rbp], 0
	lea	rdx, -208[rbp]
	lea	rax, -288[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	lea	rax, -208[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -328[rbp], eax
	cmp	DWORD PTR -328[rbp], 0
	jne	.L7
	lea	rax, -208[rbp]
	lea	rsi, last_filename[rip]
	mov	rdi, rax
	call	strcpy@PLT
	lea	rax, -208[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -328[rbp], eax
.L7:
	cmp	DWORD PTR -328[rbp], 0
	jne	.L8
	mov	eax, 0
	jmp	.L26
.L8:
	lea	rax, -208[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -328[rbp], eax
	lea	rax, -208[rbp]
	mov	esi, 46
	mov	rdi, rax
	call	index@PLT
	mov	QWORD PTR -296[rbp], rax
	cmp	QWORD PTR -296[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR -352[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -324[rbp], eax
	mov	eax, DWORD PTR -328[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -328[rbp], edx
	cdqe
	lea	rdx, -208[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 46
	mov	DWORD PTR -332[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -332[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -352[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -328[rbp]
	movsx	rcx, edx
	mov	edx, DWORD PTR -332[rbp]
	movsx	rdx, edx
	add	rcx, rdx
	lea	rdx, -208[rbp]
	add	rdx, rcx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -332[rbp], 1
.L10:
	mov	eax, DWORD PTR -332[rbp]
	cmp	eax, DWORD PTR -324[rbp]
	jl	.L11
	mov	eax, DWORD PTR -328[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -332[rbp]
	cdqe
	add	rdx, rax
	lea	rax, -208[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -324[rbp]
	add	DWORD PTR -328[rbp], eax
.L9:
	cmp	DWORD PTR -356[rbp], 0
	jns	.L12
	mov	eax, DWORD PTR -356[rbp]
	neg	eax
	cmp	eax, 3
	je	.L13
	cmp	eax, 3
	jg	.L17
	cmp	eax, 1
	je	.L15
	cmp	eax, 2
	je	.L16
	jmp	.L17
.L15:
	lea	rax, -208[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -304[rbp], rax
	jmp	.L17
.L16:
	lea	rax, -208[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -304[rbp], rax
	jmp	.L17
.L13:
	lea	rax, -208[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -304[rbp], rax
	jmp	.L17
.L12:
	cmp	DWORD PTR -356[rbp], 3
	je	.L18
	cmp	DWORD PTR -356[rbp], 3
	jg	.L17
	cmp	DWORD PTR -356[rbp], 1
	je	.L19
	cmp	DWORD PTR -356[rbp], 2
	je	.L20
	jmp	.L17
.L19:
	lea	rax, -208[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -304[rbp], rax
	jmp	.L17
.L20:
	lea	rax, -208[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -304[rbp], rax
	jmp	.L17
.L18:
	lea	rax, -208[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -304[rbp], rax
	nop
.L17:
	cmp	QWORD PTR -304[rbp], 0
	jne	.L21
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	QWORD PTR -304[rbp], -1
.L21:
	cmp	QWORD PTR -304[rbp], -1
	je	.L22
	lea	rax, last_filename[rip]
	mov	QWORD PTR -320[rbp], rax
	lea	rax, -208[rbp]
	mov	QWORD PTR -312[rbp], rax
	jmp	.L23
.L25:
	mov	rdx, QWORD PTR -312[rbp]
	lea	rax, 1[rdx]
	mov	QWORD PTR -312[rbp], rax
	mov	rax, QWORD PTR -320[rbp]
	lea	rcx, 1[rax]
	mov	QWORD PTR -320[rbp], rcx
	movzx	edx, BYTE PTR [rdx]
	mov	BYTE PTR [rax], dl
.L23:
	mov	rax, QWORD PTR -312[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L24
	mov	rax, QWORD PTR -312[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 46
	jne	.L25
.L24:
	mov	rax, QWORD PTR -320[rbp]
	mov	BYTE PTR [rax], 0
.L22:
	lea	rax, -208[rbp]
	mov	rsi, rax
	lea	rdi, full_filename[rip]
	call	strcpy@PLT
	mov	rax, QWORD PTR -304[rbp]
.L26:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	open_it, .-open_it
	.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	"1239975.c"
	.text
	.global	last_filename
	.bss
	.align	2
	.type	last_filename, %object
	.size	last_filename, 200
last_filename:
	.space	200
	.global	full_filename
	.align	2
	.type	full_filename, %object
	.size	full_filename, 200
full_filename:
	.space	200
	.comm	len_response,4,4
	.text
	.align	2
	.global	openfile
	.syntax unified
	.arm
	.fpu softvfp
	.type	openfile, %function
openfile:
	@ 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]
	nop
.L2:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	open_it
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	beq	.L2
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	openfile, .-openfile
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s (%s.%s) \000"
	.align	2
.LC1:
	.ascii	"%s\000"
	.align	2
.LC2:
	.ascii	"r\000"
	.align	2
.LC3:
	.ascii	"w\000"
	.align	2
.LC4:
	.ascii	"rw\000"
	.align	2
.LC5:
	.ascii	"openfile\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	open_it
	.syntax unified
	.arm
	.fpu softvfp
	.type	open_it, %function
open_it:
	@ args = 0, pretend = 0, frame = 328
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #328
	str	r0, [fp, #-320]
	str	r1, [fp, #-324]
	str	r2, [fp, #-328]
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-324]
	ldr	r2, .L28+4
	ldr	r1, [fp, #-320]
	ldr	r0, .L28+8
	bl	printf
	mov	r3, #0
	strb	r3, [fp, #-288]
	sub	r3, fp, #288
	mov	r0, r3
	bl	gets
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	mov	r3, #0
	b	.L26
.L5:
	mov	r3, #0
	strb	r3, [fp, #-208]
	sub	r2, fp, #208
	sub	r3, fp, #288
	ldr	r1, .L28+12
	mov	r0, r3
	bl	__isoc99_sscanf
	sub	r3, fp, #208
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-300]
	ldr	r3, [fp, #-300]
	cmp	r3, #0
	bne	.L7
	sub	r3, fp, #208
	ldr	r1, .L28+4
	mov	r0, r3
	bl	strcpy
	sub	r3, fp, #208
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-300]
.L7:
	ldr	r3, [fp, #-300]
	cmp	r3, #0
	bne	.L8
	mov	r3, #0
	b	.L26
.L8:
	sub	r3, fp, #208
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-300]
	sub	r3, fp, #208
	mov	r1, #46
	mov	r0, r3
	bl	index
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmp	r3, #0
	bne	.L9
	ldr	r0, [fp, #-324]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-292]
	ldr	r3, [fp, #-300]
	add	r2, r3, #1
	str	r2, [fp, #-300]
	mov	r2, r3
	sub	r3, fp, #208
	add	r3, r3, r2
	mov	r2, #46
	strb	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-304]
	b	.L10
.L11:
	ldr	r3, [fp, #-304]
	ldr	r2, [fp, #-324]
	add	r2, r2, r3
	ldr	r1, [fp, #-300]
	ldr	r3, [fp, #-304]
	add	r3, r1, r3
	sub	r1, fp, #208
	add	r3, r1, r3
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-304]
	add	r3, r3, #1
	str	r3, [fp, #-304]
.L10:
	ldr	r2, [fp, #-304]
	ldr	r3, [fp, #-292]
	cmp	r2, r3
	blt	.L11
	ldr	r2, [fp, #-300]
	ldr	r3, [fp, #-304]
	add	r3, r2, r3
	sub	r2, fp, #208
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r2, [fp, #-300]
	ldr	r3, [fp, #-292]
	add	r3, r2, r3
	str	r3, [fp, #-300]
.L9:
	ldr	r3, [fp, #-328]
	cmp	r3, #0
	bge	.L12
	ldr	r3, [fp, #-328]
	rsb	r3, r3, #0
	cmp	r3, #3
	beq	.L13
	cmp	r3, #3
	bgt	.L17
	cmp	r3, #1
	beq	.L15
	cmp	r3, #2
	beq	.L16
	b	.L17
.L15:
	sub	r3, fp, #208
	ldr	r1, .L28+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-308]
	b	.L17
.L16:
	sub	r3, fp, #208
	ldr	r1, .L28+20
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-308]
	b	.L17
.L13:
	sub	r3, fp, #208
	ldr	r1, .L28+24
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-308]
	b	.L17
.L12:
	ldr	r3, [fp, #-328]
	cmp	r3, #3
	beq	.L18
	ldr	r3, [fp, #-328]
	cmp	r3, #3
	bgt	.L17
	ldr	r3, [fp, #-328]
	cmp	r3, #1
	beq	.L19
	ldr	r3, [fp, #-328]
	cmp	r3, #2
	beq	.L20
	b	.L17
.L19:
	sub	r3, fp, #208
	ldr	r1, .L28+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-308]
	b	.L17
.L20:
	sub	r3, fp, #208
	ldr	r1, .L28+20
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-308]
	b	.L17
.L18:
	sub	r3, fp, #208
	ldr	r1, .L28+24
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-308]
	nop
.L17:
	ldr	r3, [fp, #-308]
	cmp	r3, #0
	bne	.L21
	ldr	r0, .L28+28
	bl	perror
	mvn	r3, #0
	str	r3, [fp, #-308]
.L21:
	ldr	r3, [fp, #-308]
	cmn	r3, #1
	beq	.L22
	ldr	r3, .L28+4
	str	r3, [fp, #-316]
	sub	r3, fp, #208
	str	r3, [fp, #-312]
	b	.L23
.L25:
	ldr	r2, [fp, #-312]
	add	r3, r2, #1
	str	r3, [fp, #-312]
	ldr	r3, [fp, #-316]
	add	r1, r3, #1
	str	r1, [fp, #-316]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
.L23:
	ldr	r3, [fp, #-312]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-312]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #46
	bne	.L25
.L24:
	ldr	r3, [fp, #-316]
	mov	r2, #0
	strb	r2, [r3]
.L22:
	sub	r3, fp, #208
	mov	r1, r3
	ldr	r0, .L28+32
	bl	strcpy
	ldr	r3, [fp, #-308]
.L26:
	ldr	r2, .L28
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC6
	.word	last_filename
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	full_filename
	.size	open_it, .-open_it
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
