	.file	"20838.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"beads.in"
.LC2:
	.string	"w"
.LC3:
	.string	"beads.out"
.LC4:
	.string	"%d"
.LC5:
	.string	"%s"
.LC6:
	.string	"%d\n"
	.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, 864
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -832[rbp], rax
	lea	rsi, .LC2[rip]
	lea	rdi, .LC3[rip]
	call	fopen@PLT
	mov	QWORD PTR -824[rbp], rax
	lea	rdx, -856[rbp]
	mov	rax, QWORD PTR -832[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	lea	rdx, -816[rbp]
	mov	rax, QWORD PTR -832[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	eax, DWORD PTR -856[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -856[rbp]
	lea	rcx, -816[rbp]
	cdqe
	add	rcx, rax
	lea	rax, -816[rbp]
	mov	rsi, rax
	mov	rdi, rcx
	call	strncpy@PLT
	mov	DWORD PTR -848[rbp], 0
	mov	DWORD PTR -844[rbp], 0
	jmp	.L2
.L13:
	mov	DWORD PTR -852[rbp], 0
	mov	BYTE PTR -857[rbp], 0
	mov	DWORD PTR -836[rbp], 0
	mov	DWORD PTR -840[rbp], 0
	jmp	.L3
.L11:
	mov	edx, DWORD PTR -844[rbp]
	mov	eax, DWORD PTR -840[rbp]
	add	eax, edx
	cdqe
	movzx	eax, BYTE PTR -816[rbp+rax]
	cmp	al, 119
	jne	.L4
	add	DWORD PTR -852[rbp], 1
	jmp	.L5
.L4:
	mov	edx, DWORD PTR -844[rbp]
	mov	eax, DWORD PTR -840[rbp]
	add	eax, edx
	cdqe
	movzx	eax, BYTE PTR -816[rbp+rax]
	cmp	al, 114
	je	.L6
	mov	edx, DWORD PTR -844[rbp]
	mov	eax, DWORD PTR -840[rbp]
	add	eax, edx
	cdqe
	movzx	eax, BYTE PTR -816[rbp+rax]
	cmp	al, 98
	jne	.L5
.L6:
	cmp	BYTE PTR -857[rbp], 0
	jne	.L7
	mov	edx, DWORD PTR -844[rbp]
	mov	eax, DWORD PTR -840[rbp]
	add	eax, edx
	cdqe
	movzx	eax, BYTE PTR -816[rbp+rax]
	mov	BYTE PTR -857[rbp], al
.L7:
	mov	edx, DWORD PTR -844[rbp]
	mov	eax, DWORD PTR -840[rbp]
	add	eax, edx
	cdqe
	movzx	eax, BYTE PTR -816[rbp+rax]
	cmp	BYTE PTR -857[rbp], al
	jne	.L8
	add	DWORD PTR -852[rbp], 1
	jmp	.L5
.L8:
	cmp	DWORD PTR -836[rbp], 0
	jne	.L15
	mov	DWORD PTR -836[rbp], 1
	mov	edx, DWORD PTR -844[rbp]
	mov	eax, DWORD PTR -840[rbp]
	add	eax, edx
	cdqe
	movzx	eax, BYTE PTR -816[rbp+rax]
	mov	BYTE PTR -857[rbp], al
	add	DWORD PTR -852[rbp], 1
.L5:
	add	DWORD PTR -840[rbp], 1
.L3:
	mov	eax, DWORD PTR -856[rbp]
	cmp	DWORD PTR -840[rbp], eax
	jl	.L11
	jmp	.L10
.L15:
	nop
.L10:
	mov	eax, DWORD PTR -852[rbp]
	cmp	eax, DWORD PTR -848[rbp]
	jle	.L12
	mov	eax, DWORD PTR -852[rbp]
	mov	DWORD PTR -848[rbp], eax
.L12:
	add	DWORD PTR -844[rbp], 1
.L2:
	mov	eax, DWORD PTR -856[rbp]
	cmp	DWORD PTR -844[rbp], eax
	jl	.L13
	mov	edx, DWORD PTR -848[rbp]
	mov	rax, QWORD PTR -824[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@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	"20838.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"beads.in\000"
	.align	2
.LC2:
	.ascii	"w\000"
	.align	2
.LC3:
	.ascii	"beads.out\000"
	.align	2
.LC4:
	.ascii	"%d\000"
	.align	2
.LC5:
	.ascii	"%s\000"
	.align	2
.LC6:
	.ascii	"%d\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 840
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #840
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L16+4
	ldr	r0, .L16+8
	bl	fopen
	str	r0, [fp, #-816]
	ldr	r1, .L16+12
	ldr	r0, .L16+16
	bl	fopen
	str	r0, [fp, #-812]
	sub	r3, fp, #840
	mov	r2, r3
	ldr	r1, .L16+20
	ldr	r0, [fp, #-816]
	bl	__isoc99_fscanf
	sub	r3, fp, #808
	mov	r2, r3
	ldr	r1, .L16+24
	ldr	r0, [fp, #-816]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-840]
	sub	r2, fp, #808
	add	r3, r2, r3
	ldr	r2, [fp, #-840]
	sub	r1, fp, #808
	mov	r0, r3
	bl	strncpy
	mov	r3, #0
	str	r3, [fp, #-832]
	mov	r3, #0
	str	r3, [fp, #-828]
	b	.L2
.L13:
	mov	r3, #0
	str	r3, [fp, #-836]
	mov	r3, #0
	strb	r3, [fp, #-841]
	mov	r3, #0
	str	r3, [fp, #-820]
	mov	r3, #0
	str	r3, [fp, #-824]
	b	.L3
.L11:
	ldr	r2, [fp, #-828]
	ldr	r3, [fp, #-824]
	add	r3, r2, r3
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-804]	@ zero_extendqisi2
	cmp	r3, #119
	bne	.L4
	ldr	r3, [fp, #-836]
	add	r3, r3, #1
	str	r3, [fp, #-836]
	b	.L5
.L4:
	ldr	r2, [fp, #-828]
	ldr	r3, [fp, #-824]
	add	r3, r2, r3
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-804]	@ zero_extendqisi2
	cmp	r3, #114
	beq	.L6
	ldr	r2, [fp, #-828]
	ldr	r3, [fp, #-824]
	add	r3, r2, r3
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-804]	@ zero_extendqisi2
	cmp	r3, #98
	bne	.L5
.L6:
	ldrb	r3, [fp, #-841]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L7
	ldr	r2, [fp, #-828]
	ldr	r3, [fp, #-824]
	add	r3, r2, r3
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-804]
	strb	r3, [fp, #-841]
.L7:
	ldr	r2, [fp, #-828]
	ldr	r3, [fp, #-824]
	add	r3, r2, r3
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-804]	@ zero_extendqisi2
	ldrb	r2, [fp, #-841]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L8
	ldr	r3, [fp, #-836]
	add	r3, r3, #1
	str	r3, [fp, #-836]
	b	.L5
.L8:
	ldr	r3, [fp, #-820]
	cmp	r3, #0
	bne	.L15
	mov	r3, #1
	str	r3, [fp, #-820]
	ldr	r2, [fp, #-828]
	ldr	r3, [fp, #-824]
	add	r3, r2, r3
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-804]
	strb	r3, [fp, #-841]
	ldr	r3, [fp, #-836]
	add	r3, r3, #1
	str	r3, [fp, #-836]
.L5:
	ldr	r3, [fp, #-824]
	add	r3, r3, #1
	str	r3, [fp, #-824]
.L3:
	ldr	r3, [fp, #-840]
	ldr	r2, [fp, #-824]
	cmp	r2, r3
	blt	.L11
	b	.L10
.L15:
	nop
.L10:
	ldr	r2, [fp, #-836]
	ldr	r3, [fp, #-832]
	cmp	r2, r3
	ble	.L12
	ldr	r3, [fp, #-836]
	str	r3, [fp, #-832]
.L12:
	ldr	r3, [fp, #-828]
	add	r3, r3, #1
	str	r3, [fp, #-828]
.L2:
	ldr	r3, [fp, #-840]
	ldr	r2, [fp, #-828]
	cmp	r2, r3
	blt	.L13
	ldr	r2, [fp, #-832]
	ldr	r1, .L16+28
	ldr	r0, [fp, #-812]
	bl	fprintf
	mov	r0, #0
	bl	exit
.L17:
	.align	2
.L16:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
