	.file	"388004.c"
	.intel_syntax noprefix
	.text
	.globl	input
	.bss
	.align 32
	.type	input, @object
	.size	input, 16777215
input:
	.zero	16777215
	.globl	output
	.align 32
	.type	output, @object
	.size	output, 16777215
output:
	.zero	16777215
	.text
	.globl	rle_encode
	.type	rle_encode, @function
rle_encode:
.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	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -24[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -2[rbp], al
	mov	BYTE PTR -1[rbp], 1
	jmp	.L2
.L4:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	BYTE PTR -2[rbp], al
	jne	.L3
	movzx	eax, BYTE PTR -1[rbp]
	add	eax, 1
	mov	BYTE PTR -1[rbp], al
	add	QWORD PTR -24[rbp], 1
	jmp	.L2
.L3:
	movzx	eax, BYTE PTR -1[rbp]
	lea	ecx, 48[rax]
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	mov	edx, ecx
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	movzx	edx, BYTE PTR -2[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -24[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -2[rbp], al
	mov	BYTE PTR -1[rbp], 1
.L2:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L4
	movzx	eax, BYTE PTR -1[rbp]
	lea	ecx, 48[rax]
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	mov	edx, ecx
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	movzx	edx, BYTE PTR -2[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -32[rbp]
	mov	BYTE PTR [rax], 0
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	rle_encode, .-rle_encode
	.section	.rodata
	.align 8
.LC0:
	.string	"Part 1, %d iterations, encoded to a string of length %lu\n"
	.align 8
.LC1:
	.string	"Part 2, %d iterations, encoded to a string of length %lu\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	lea	rax, input[rip]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L6
.L7:
	add	QWORD PTR -16[rbp], 1
.L6:
	call	getchar@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, -1
	jne	.L7
	sub	QWORD PTR -16[rbp], 1
	mov	rax, QWORD PTR -16[rbp]
	mov	BYTE PTR [rax], 0
	lea	rdi, input[rip]
	call	strdup@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -24[rbp], 0
	jmp	.L8
.L10:
	lea	rsi, output[rip]
	lea	rdi, input[rip]
	call	rle_encode
	cmp	DWORD PTR -24[rbp], 38
	jg	.L9
	lea	rsi, output[rip]
	lea	rdi, input[rip]
	call	strcpy@PLT
	mov	BYTE PTR output[rip], 0
.L9:
	add	DWORD PTR -24[rbp], 1
.L8:
	cmp	DWORD PTR -24[rbp], 39
	jle	.L10
	lea	rdi, output[rip]
	call	strlen@PLT
	mov	rdx, rax
	mov	esi, 40
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, input[rip]
	call	strcpy@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L11
.L13:
	lea	rsi, output[rip]
	lea	rdi, input[rip]
	call	rle_encode
	cmp	DWORD PTR -20[rbp], 48
	jg	.L12
	lea	rsi, output[rip]
	lea	rdi, input[rip]
	call	strcpy@PLT
	mov	BYTE PTR output[rip], 0
.L12:
	add	DWORD PTR -20[rbp], 1
.L11:
	cmp	DWORD PTR -20[rbp], 49
	jle	.L13
	lea	rdi, output[rip]
	call	strlen@PLT
	mov	rdx, rax
	mov	esi, 50
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	"388004.c"
	.text
	.comm	input,16777215,4
	.comm	output,16777215,4
	.align	2
	.global	rle_encode
	.syntax unified
	.arm
	.fpu softvfp
	.type	rle_encode, %function
rle_encode:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	str	r2, [fp, #-16]
	ldrb	r3, [r3]
	strb	r3, [fp, #-6]
	mov	r3, #1
	strb	r3, [fp, #-5]
	b	.L2
.L4:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldrb	r2, [fp, #-6]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L3
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #1
	strb	r3, [fp, #-5]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L2
.L3:
	ldr	r3, [fp, #-20]
	add	r2, r3, #1
	str	r2, [fp, #-20]
	ldrb	r2, [fp, #-5]
	add	r2, r2, #48
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r2, r3, #1
	str	r2, [fp, #-20]
	ldrb	r2, [fp, #-6]
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	str	r2, [fp, #-16]
	ldrb	r3, [r3]
	strb	r3, [fp, #-6]
	mov	r3, #1
	strb	r3, [fp, #-5]
.L2:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-20]
	add	r2, r3, #1
	str	r2, [fp, #-20]
	ldrb	r2, [fp, #-5]
	add	r2, r2, #48
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r2, r3, #1
	str	r2, [fp, #-20]
	ldrb	r2, [fp, #-6]
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	mov	r2, #0
	strb	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	rle_encode, .-rle_encode
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, .L9
	str	r3, [fp, #-8]
	b	.L6
.L8:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L6:
	bl	getchar
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, [fp, #-8]
	strb	r2, [r3]
	b	.L8
.L10:
	.align	2
.L9:
	.word	input
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
