	.file	"22013830.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"rt"
.LC1:
	.string	"001-050/problem-022.txt"
.LC2:
	.string	"Unable to open file"
.LC3:
	.string	"\"%[^\",]\","
.LC4:
	.string	"%lu\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
	lea	r11, -102400[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 1664
	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 -104024[rbp], rax
	cmp	QWORD PTR -104024[rbp], 0
	jne	.L2
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L10
.L2:
	mov	QWORD PTR -104048[rbp], 0
.L5:
	mov	rdx, QWORD PTR -104048[rbp]
	lea	rax, 1[rdx]
	mov	QWORD PTR -104048[rbp], rax
	lea	rcx, -104016[rbp]
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	rax, QWORD PTR -104024[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	DWORD PTR -104052[rbp], eax
	cmp	DWORD PTR -104052[rbp], 0
	mov	rax, QWORD PTR -104024[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L5
	mov	rax, QWORD PTR -104024[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -104048[rbp]
	mov	edx, eax
	lea	rax, -104016[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	sort
	mov	QWORD PTR -104040[rbp], 0
	mov	DWORD PTR -104060[rbp], 0
	jmp	.L6
.L9:
	mov	QWORD PTR -104032[rbp], 0
	mov	DWORD PTR -104056[rbp], 0
	jmp	.L7
.L8:
	mov	ecx, DWORD PTR -104056[rbp]
	mov	edx, DWORD PTR -104060[rbp]
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 2
	add	rax, rbp
	add	rax, rcx
	sub	rax, 104016
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sub	eax, 64
	cdqe
	add	QWORD PTR -104032[rbp], rax
	add	DWORD PTR -104056[rbp], 1
.L7:
	mov	ecx, DWORD PTR -104056[rbp]
	mov	edx, DWORD PTR -104060[rbp]
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 2
	add	rax, rbp
	add	rax, rcx
	sub	rax, 104016
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L8
	mov	eax, DWORD PTR -104060[rbp]
	add	eax, 1
	mov	eax, eax
	imul	rax, QWORD PTR -104032[rbp]
	add	QWORD PTR -104040[rbp], rax
	add	DWORD PTR -104060[rbp], 1
.L6:
	mov	eax, DWORD PTR -104060[rbp]
	cmp	QWORD PTR -104048[rbp], rax
	ja	.L9
	mov	rax, QWORD PTR -104040[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
.L10:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	sort
	.type	sort, @function
sort:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	QWORD PTR -88[rbp], rdi
	mov	DWORD PTR -92[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -64[rbp], 701
	mov	DWORD PTR -60[rbp], 301
	mov	DWORD PTR -56[rbp], 132
	mov	DWORD PTR -52[rbp], 57
	mov	DWORD PTR -48[rbp], 23
	mov	DWORD PTR -44[rbp], 10
	mov	DWORD PTR -40[rbp], 4
	mov	DWORD PTR -36[rbp], 1
	mov	DWORD PTR -80[rbp], 0
	jmp	.L13
.L19:
	mov	eax, DWORD PTR -80[rbp]
	mov	eax, DWORD PTR -64[rbp+rax*4]
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR -76[rbp], eax
	jmp	.L14
.L18:
	mov	edx, DWORD PTR -76[rbp]
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rdx, rax
	lea	rax, -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	eax, DWORD PTR -76[rbp]
	mov	DWORD PTR -72[rbp], eax
	jmp	.L15
.L17:
	mov	eax, DWORD PTR -72[rbp]
	sub	eax, DWORD PTR -68[rbp]
	mov	edx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rdx, rax
	mov	ecx, DWORD PTR -72[rbp]
	mov	rax, rcx
	sal	rax, 2
	add	rax, rcx
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rcx
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	eax, DWORD PTR -68[rbp]
	sub	DWORD PTR -72[rbp], eax
.L15:
	mov	eax, DWORD PTR -72[rbp]
	cmp	eax, DWORD PTR -68[rbp]
	jb	.L16
	mov	eax, DWORD PTR -72[rbp]
	sub	eax, DWORD PTR -68[rbp]
	mov	edx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rdx, rax
	lea	rax, -32[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	strcmp@PLT
	test	eax, eax
	jg	.L17
.L16:
	mov	edx, DWORD PTR -72[rbp]
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rdx, rax
	lea	rax, -32[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	strcpy@PLT
	add	DWORD PTR -76[rbp], 1
.L14:
	mov	eax, DWORD PTR -76[rbp]
	cmp	eax, DWORD PTR -92[rbp]
	jb	.L18
	add	DWORD PTR -80[rbp], 1
.L13:
	cmp	DWORD PTR -80[rbp], 7
	jbe	.L19
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sort, .-sort
	.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	"22013830.c"
	.text
	.section	.rodata
	.align	2
.LC1:
	.ascii	"rt\000"
	.align	2
.LC2:
	.ascii	"001-050/problem-022.txt\000"
	.align	2
.LC3:
	.ascii	"Unable to open file\000"
	.align	2
.LC4:
	.ascii	"\"%[^\",]\",\000"
	.align	2
.LC5:
	.ascii	"%lu\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 104048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #103424
	sub	sp, sp, #628
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	sub	r3, fp, #102400
	sub	r3, r3, #36
	mov	r10, r3
	ldr	r1, .L12+4
	ldr	r0, .L12+8
	bl	fopen
	str	r0, [r10, #-1640]
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1640]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L12+12
	bl	perror
	mov	r3, #1
	b	.L10
.L2:
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #608
	mov	r1, r3
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
.L5:
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #608
	ldmia	r3, {r2-r3}
	sub	r1, fp, #103424
	sub	r1, r1, #36
	sub	r1, r1, #608
	adds	r8, r2, #1
	adc	r9, r3, #0
	stm	r1, {r8-r9}
	sub	r1, fp, #103424
	sub	r1, r1, #36
	sub	r1, r1, #580
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	sub	r2, fp, #102400
	sub	r2, r2, #36
	mov	r0, r2
	mov	r2, r3
	ldr	r1, .L12+16
	ldr	r0, [r0, #-1640]
	bl	__isoc99_fscanf
	mov	r3, r0
	sub	r2, fp, #102400
	sub	r2, r2, #36
	str	r3, [r2, #-1636]
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1636]
	cmp	r3, #0
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r0, [r3, #-1640]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L5
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r0, [r3, #-1640]
	bl	fclose
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #608
	ldr	r2, [r3]
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #580
	mov	r1, r2
	mov	r0, r3
	bl	sort
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #592
	mov	r1, r3
	mov	r2, #0
	mov	r3, #0
	stmdb	r1, {r2-r3}
	sub	r3, fp, #102400
	sub	r3, r3, #36
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1648]
	b	.L6
.L9:
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #592
	mov	r1, r3
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	sub	r3, fp, #102400
	sub	r3, r3, #36
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1644]
	b	.L7
.L8:
	sub	r3, fp, #102400
	sub	r3, r3, #36
	mov	r1, r3
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r2, [r3, #-1648]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1644]
	add	r3, r2, r3
	sub	r3, r3, #1600
	sub	r3, r3, #4
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #64
	mov	r2, r3
	asr	r3, r2, #31
	sub	r1, fp, #103424
	sub	r1, r1, #36
	sub	r1, r1, #592
	mov	ip, r1
	sub	r1, fp, #103424
	sub	r1, r1, #36
	sub	r1, r1, #592
	ldmia	r1, {r0-r1}
	adds	r4, r0, r2
	adc	r5, r1, r3
	stm	ip, {r4-r5}
	sub	r3, fp, #102400
	sub	r3, r3, #36
	mov	r2, r3
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1644]
	add	r3, r3, #1
	str	r3, [r2, #-1644]
.L7:
	sub	r3, fp, #102400
	sub	r3, r3, #36
	mov	r1, r3
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r2, [r3, #-1648]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1644]
	add	r3, r2, r3
	sub	r3, r3, #1600
	sub	r3, r3, #4
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L8
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1648]
	add	r3, r3, #1
	mov	r0, r3
	mov	r1, #0
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #592
	ldr	r2, [r3]
	mul	ip, r1, r2
	ldr	r2, [r3, #4]
	mul	r2, r0, r2
	add	ip, ip, r2
	ldr	lr, [r3]
	umull	r2, r3, lr, r0
	add	r1, ip, r3
	mov	r3, r1
	sub	r1, fp, #103424
	sub	r1, r1, #36
	sub	r1, r1, #592
	mov	ip, r1
	sub	r1, fp, #103424
	sub	r1, r1, #36
	sub	r1, r1, #592
	ldmdb	r1, {r0-r1}
	adds	r6, r0, r2
	adc	r7, r1, r3
	stmdb	ip, {r6-r7}
	sub	r3, fp, #102400
	sub	r3, r3, #36
	mov	r2, r3
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1648]
	add	r3, r3, #1
	str	r3, [r2, #-1648]
.L6:
	sub	r3, fp, #102400
	sub	r3, r3, #36
	ldr	r3, [r3, #-1648]
	mov	r0, r3
	mov	r1, #0
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #608
	ldmia	r3, {r2-r3}
	cmp	r3, r1
	cmpeq	r2, r0
	bhi	.L9
	sub	r3, fp, #103424
	sub	r3, r3, #36
	sub	r3, r3, #592
	ldmdb	r3, {r2-r3}
	ldr	r0, .L12+20
	bl	printf
	mov	r3, #0
.L10:
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-40]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC6
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC0:
	.word	701
	.word	301
	.word	132
	.word	57
	.word	23
	.word	10
	.word	4
	.word	1
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sort
	.syntax unified
	.arm
	.fpu softvfp
	.type	sort, %function
sort:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L23+4
	sub	ip, fp, #60
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	mov	r3, #0
	str	r3, [fp, #-76]
	b	.L15
.L21:
	ldr	r3, [fp, #-76]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-56]
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-72]
	b	.L16
.L20:
	ldr	r2, [fp, #-72]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-80]
	add	r2, r3, r2
	sub	r3, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	ldr	r3, [fp, #-72]
	str	r3, [fp, #-68]
	b	.L17
.L19:
	ldr	r2, [fp, #-68]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-80]
	add	r0, r3, r2
	ldr	r2, [fp, #-68]
	ldr	r3, [fp, #-64]
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-80]
	add	r3, r3, r2
	mov	r1, r3
	bl	strcpy
	ldr	r2, [fp, #-68]
	ldr	r3, [fp, #-64]
	sub	r3, r2, r3
	str	r3, [fp, #-68]
.L17:
	ldr	r2, [fp, #-68]
	ldr	r3, [fp, #-64]
	cmp	r2, r3
	bcc	.L18
	ldr	r2, [fp, #-68]
	ldr	r3, [fp, #-64]
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-80]
	add	r3, r3, r2
	sub	r2, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bgt	.L19
.L18:
	ldr	r2, [fp, #-68]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-80]
	add	r3, r3, r2
	sub	r2, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L16:
	ldr	r2, [fp, #-72]
	ldr	r3, [fp, #-84]
	cmp	r2, r3
	bcc	.L20
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
.L15:
	ldr	r3, [fp, #-76]
	cmp	r3, #7
	bls	.L21
	nop
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC7
	.word	.LC0
	.size	sort, .-sort
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
