	.file	"976144.c"
	.intel_syntax noprefix
	.text
	.local	T
	.comm	T,4,4
	.local	N
	.comm	N,4000,32
	.globl	mark_digits
	.type	mark_digits, @function
mark_digits:
.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 -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	jmp	.L2
.L3:
	mov	ecx, DWORD PTR -12[rbp]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	movsx	rdx, edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 1
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx, 2
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -12[rbp], eax
.L2:
	cmp	DWORD PTR -12[rbp], 0
	jg	.L3
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mark_digits, .-mark_digits
	.section	.rodata
.LC0:
	.string	"USAGE:\n\t%s in out\n"
.LC1:
	.string	"rt"
.LC2:
	.string	"Failed to open file %s\n"
.LC3:
	.string	"%d"
.LC4:
	.string	"Failed to read first line"
.LC5:
	.string	"Failed to read line %d\n"
.LC6:
	.string	"wt"
.LC7:
	.string	"Case #%d: "
.LC8:
	.string	"INSOMNIA\n"
.LC9:
	.string	"%d\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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -68[rbp], 3
	je	.L5
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L19
.L5:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L7
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L19
.L7:
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, T[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	cmp	eax, 1
	je	.L8
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L19
.L8:
	mov	DWORD PTR -52[rbp], 0
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, N[rip]
	add	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	cmp	eax, 1
	je	.L10
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L19
.L10:
	add	DWORD PTR -52[rbp], 1
.L9:
	mov	eax, DWORD PTR T[rip]
	cmp	DWORD PTR -52[rbp], eax
	jl	.L11
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L12
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L19
.L12:
	lea	rax, -28[rbp]
	mov	edx, 10
	mov	esi, 1
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -52[rbp], 0
	jmp	.L13
.L18:
	mov	eax, DWORD PTR -52[rbp]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, N[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L14
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, rax
	mov	edx, 9
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	jmp	.L15
.L14:
	lea	rax, -18[rbp]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -48[rbp], 1
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, N[rip]
	mov	ecx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -48[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -48[rbp], edx
	imul	eax, ecx
	mov	DWORD PTR -44[rbp], eax
	mov	edx, DWORD PTR -44[rbp]
	lea	rax, -18[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	mark_digits
.L16:
	lea	rcx, -28[rbp]
	lea	rax, -18[rbp]
	mov	edx, 10
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L17
	mov	edx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L15:
	add	DWORD PTR -52[rbp], 1
.L13:
	mov	eax, DWORD PTR T[rip]
	cmp	DWORD PTR -52[rbp], eax
	jl	.L18
	mov	eax, 0
.L19:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	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	"976144.c"
	.text
	.local	T
	.comm	T,4,4
	.local	N
	.comm	N,4000,4
	.align	2
	.global	mark_digits
	.syntax unified
	.arm
	.fpu softvfp
	.type	mark_digits, %function
mark_digits:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	b	.L2
.L3:
	ldr	r2, [fp, #-12]
	ldr	r3, .L4
	smull	r1, r3, r2, r3
	asr	r1, r3, #2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #1
	sub	r1, r2, r3
	mov	r2, r1
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, .L4
	smull	r1, r2, r3, r2
	asr	r2, r2, #2
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bgt	.L3
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L5:
	.align	2
.L4:
	.word	1717986919
	.size	mark_digits, .-mark_digits
	.section	.rodata
	.align	2
.LC0:
	.ascii	"USAGE:\012\011%s in out\012\000"
	.align	2
.LC1:
	.ascii	"rt\000"
	.align	2
.LC2:
	.ascii	"Failed to open file %s\012\000"
	.align	2
.LC3:
	.ascii	"%d\000"
	.align	2
.LC4:
	.ascii	"Failed to read first line\000"
	.align	2
.LC5:
	.ascii	"Failed to read line %d\012\000"
	.align	2
.LC6:
	.ascii	"wt\000"
	.align	2
.LC7:
	.ascii	"Case #%d: \000"
	.align	2
.LC8:
	.ascii	"INSOMNIA\012\000"
	.align	2
.LC9:
	.ascii	"%d\012\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-56]
	cmp	r3, #3
	beq	.L7
	ldr	r3, [fp, #-60]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+4
	bl	printf
	mvn	r3, #0
	b	.L21
.L7:
	ldr	r3, [fp, #-60]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L23+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L9
	ldr	r3, [fp, #-60]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+12
	bl	printf
	mvn	r3, #0
	b	.L21
.L9:
	ldr	r2, .L23+16
	ldr	r1, .L23+20
	ldr	r0, [fp, #-36]
	bl	__isoc99_fscanf
	mov	r3, r0
	cmp	r3, #1
	beq	.L10
	ldr	r0, .L23+24
	bl	puts
	mvn	r3, #0
	b	.L21
.L10:
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L11
.L13:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, .L23+28
	add	r3, r3, r2
	mov	r2, r3
	ldr	r1, .L23+20
	ldr	r0, [fp, #-36]
	bl	__isoc99_fscanf
	mov	r3, r0
	cmp	r3, #1
	beq	.L12
	ldr	r1, [fp, #-48]
	ldr	r0, .L23+32
	bl	printf
	mvn	r3, #0
	b	.L21
.L12:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L11:
	ldr	r3, .L23+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-48]
	cmp	r2, r3
	blt	.L13
	ldr	r0, [fp, #-36]
	bl	fclose
	ldr	r3, [fp, #-60]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L23+36
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-60]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+12
	bl	printf
	mvn	r3, #0
	b	.L21
.L14:
	sub	r3, fp, #32
	mov	r2, #10
	mov	r1, #1
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L15
.L20:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, .L23+40
	ldr	r0, [fp, #-36]
	bl	fprintf
	ldr	r2, .L23+28
	ldr	r3, [fp, #-48]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	bne	.L16
	ldr	r3, [fp, #-36]
	mov	r2, #9
	mov	r1, #1
	ldr	r0, .L23+44
	bl	fwrite
	b	.L17
.L16:
	sub	r3, fp, #20
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #1
	str	r3, [fp, #-44]
	b	.L18
.L19:
	ldr	r2, .L23+28
	ldr	r3, [fp, #-48]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-44]
	add	r1, r3, #1
	str	r1, [fp, #-44]
	mul	r3, r2, r3
	str	r3, [fp, #-40]
	sub	r3, fp, #20
	ldr	r1, [fp, #-40]
	mov	r0, r3
	bl	mark_digits
.L18:
	sub	r1, fp, #32
	sub	r3, fp, #20
	mov	r2, #10
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L19
	ldr	r2, [fp, #-40]
	ldr	r1, .L23+48
	ldr	r0, [fp, #-36]
	bl	fprintf
.L17:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L15:
	ldr	r3, .L23+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-48]
	cmp	r2, r3
	blt	.L20
	mov	r3, #0
.L21:
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC10
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	T
	.word	.LC3
	.word	.LC4
	.word	N
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
