	.file	"852943.c"
	.intel_syntax noprefix
	.text
	.globl	str_to_int
	.type	str_to_int, @function
str_to_int:
.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 -24[rbp], rdi
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L3:
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	mov	ecx, eax
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sub	eax, 48
	add	eax, ecx
	mov	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L3
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	str_to_int, .-str_to_int
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	int_to_char
	.type	int_to_char, @function
int_to_char:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	edx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	int_to_char, .-int_to_char
	.globl	check_if_number
	.type	check_if_number, @function
check_if_number:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	BYTE PTR -20[rbp], al
	movsx	eax, BYTE PTR -20[rbp]
	mov	DWORD PTR -4[rbp], eax
	cmp	BYTE PTR -20[rbp], 47
	jle	.L8
	cmp	BYTE PTR -20[rbp], 57
	jg	.L8
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L9
.L8:
	mov	eax, 0
.L9:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	check_if_number, .-check_if_number
	.section	.rodata
.LC1:
	.string	" too many arguments passed"
.LC2:
	.string	"File Error: cannot open file"
.LC3:
	.string	"bar"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 168
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -196[rbp], 2
	je	.L11
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L19
.L11:
	mov	rax, QWORD PTR -208[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -184[rbp], eax
	cmp	DWORD PTR -184[rbp], -1
	jne	.L13
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L19
.L13:
	mov	edx, 384
	mov	esi, 65
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -180[rbp], eax
	mov	DWORD PTR -188[rbp], 0
	jmp	.L14
.L15:
	movzx	eax, BYTE PTR -145[rbp]
	movsx	eax, al
	mov	edi, eax
	call	check_if_number
	test	eax, eax
	je	.L14
	movzx	edx, BYTE PTR -145[rbp]
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	mov	BYTE PTR -144[rbp+rax], dl
	add	DWORD PTR -188[rbp], 1
.L14:
	lea	rcx, -145[rbp]
	mov	eax, DWORD PTR -184[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	setg	al
	movzx	eax, al
	mov	DWORD PTR -176[rbp], eax
	cmp	DWORD PTR -176[rbp], 0
	jne	.L15
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	str_to_int
	mov	DWORD PTR -172[rbp], eax
	add	DWORD PTR -172[rbp], 10
	mov	eax, DWORD PTR -188[rbp]
	mov	rdx, rsp
	mov	rbx, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -168[rbp], rdx
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L16:
	cmp	rsp, rdx
	je	.L17
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L16
.L17:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L18
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L18:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -160[rbp], rax
	mov	edx, DWORD PTR -172[rbp]
	mov	rax, QWORD PTR -160[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	int_to_char
	mov	eax, DWORD PTR -188[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -160[rbp]
	mov	eax, DWORD PTR -180[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -184[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 1
	mov	rsp, rbx
.L19:
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	"852943.c"
	.text
	.align	2
	.global	str_to_int
	.syntax unified
	.arm
	.fpu softvfp
	.type	str_to_int, %function
str_to_int:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	mov	r1, r3
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	add	r3, r1, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L3
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	str_to_int, .-str_to_int
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\000"
	.text
	.align	2
	.global	int_to_char
	.syntax unified
	.arm
	.fpu softvfp
	.type	int_to_char, %function
int_to_char:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r1, .L7
	ldr	r0, [fp, #-8]
	bl	sprintf
	ldr	r0, [fp, #-8]
	bl	strlen
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC0
	.size	int_to_char, .-int_to_char
	.align	2
	.global	check_if_number
	.syntax unified
	.arm
	.fpu softvfp
	.type	check_if_number, %function
check_if_number:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	mov	r3, r0
	strb	r3, [fp, #-13]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	str	r3, [fp, #-8]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #47
	bls	.L10
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #57
	bhi	.L10
	ldr	r3, [fp, #-8]
	b	.L11
.L10:
	mov	r3, #0
.L11:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	check_if_number, .-check_if_number
	.section	.rodata
	.align	2
.LC1:
	.ascii	" too many arguments passed\000"
	.align	2
.LC2:
	.ascii	"File Error: cannot open file\000"
	.align	2
.LC3:
	.ascii	"bar\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #132
	str	r0, [fp, #-136]
	str	r1, [fp, #-140]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-136]
	cmp	r3, #2
	beq	.L13
	ldr	r0, .L20+4
	bl	printf
	mov	r3, #1
	b	.L18
.L13:
	ldr	r3, [fp, #-140]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-124]
	ldr	r3, [fp, #-124]
	cmn	r3, #1
	bne	.L15
	ldr	r0, .L20+8
	bl	printf
	mov	r3, #1
	b	.L18
.L15:
	mov	r2, #384
	mov	r1, #65
	ldr	r0, .L20+12
	bl	open
	str	r0, [fp, #-120]
	mov	r3, #0
	str	r3, [fp, #-128]
	b	.L16
.L17:
	ldrb	r3, [fp, #-100]	@ zero_extendqisi2
	mov	r0, r3
	bl	check_if_number
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	ldrb	r1, [fp, #-100]	@ zero_extendqisi2
	sub	r2, fp, #96
	ldr	r3, [fp, #-128]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-128]
	add	r3, r3, #1
	str	r3, [fp, #-128]
.L16:
	sub	r3, fp, #100
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-124]
	bl	read
	mov	r3, r0
	cmp	r3, #0
	movgt	r3, #1
	movle	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bne	.L17
	sub	r3, fp, #96
	mov	r0, r3
	bl	str_to_int
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	add	r3, r3, #10
	str	r3, [fp, #-112]
	ldr	ip, [fp, #-128]
	mov	r3, sp
	mov	r4, r3
	sub	r3, ip, #1
	str	r3, [fp, #-108]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-104]
	ldr	r1, [fp, #-112]
	ldr	r0, [fp, #-104]
	bl	int_to_char
	ldr	r3, [fp, #-128]
	mov	r2, r3
	ldr	r1, [fp, #-104]
	ldr	r0, [fp, #-120]
	bl	write
	ldr	r0, [fp, #-124]
	bl	close
	mov	r3, #1
	mov	sp, r4
.L18:
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC4
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
