	.file	"162642678.c"
	.intel_syntax noprefix
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	adj
	.align 32
	.type	adj, @object
	.size	adj, 4000000
adj:
	.zero	4000000
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 4000
d1:
	.zero	4000
	.globl	dx
	.align 32
	.type	dx, @object
	.size	dx, 4000
dx:
	.zero	4000
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	QWORD PTR -32[rbp], rdx
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	add	edx, 1
	mov	DWORD PTR [rax], edx
	mov	DWORD PTR -4[rbp], 1
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	imul	rax, rax, 1000
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, adj[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L3
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	imul	rax, rax, 1000
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, adj[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	je	.L4
.L3:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -24[rbp]
	je	.L4
	mov	rdx, QWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	dfs
.L4:
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -4[rbp], eax
	jle	.L5
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"\nAns: %d"
	.text
	.globl	main
	.type	main, @function
main:
.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, x[rip]
	lea	rsi, n[rip]
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	DWORD PTR -16[rbp], 0
	jmp	.L7
.L8:
	lea	rdx, -20[rbp]
	lea	rax, -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edx, DWORD PTR -20[rbp]
	movsx	rsi, edx
	movsx	rcx, eax
	imul	rcx, rcx, 1000
	add	rcx, rsi
	lea	rsi, 0[0+rcx*4]
	lea	rcx, adj[rip]
	mov	DWORD PTR [rsi+rcx], 1
	mov	ecx, DWORD PTR -24[rbp]
	mov	esi, DWORD PTR -20[rbp]
	movsx	rdx, edx
	cdqe
	imul	rax, rax, 1000
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, adj[rip]
	mov	eax, DWORD PTR [rdx+rax]
	movsx	rsi, esi
	movsx	rdx, ecx
	imul	rdx, rdx, 1000
	add	rdx, rsi
	lea	rcx, 0[0+rdx*4]
	lea	rdx, adj[rip]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -16[rbp], 1
.L7:
	mov	eax, DWORD PTR n[rip]
	sub	eax, 1
	cmp	DWORD PTR -16[rbp], eax
	jl	.L8
	mov	DWORD PTR dx[rip], -1
	mov	eax, DWORD PTR dx[rip]
	mov	DWORD PTR d1[rip], eax
	lea	rdx, d1[rip]
	mov	esi, 0
	mov	edi, 1
	call	dfs
	mov	eax, DWORD PTR x[rip]
	lea	rdx, dx[rip]
	mov	esi, 0
	mov	edi, eax
	call	dfs
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -16[rbp], 1
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, dx[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, d1[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jge	.L10
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, d1[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	eax, eax
	cmp	DWORD PTR -12[rbp], eax
	jge	.L10
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, d1[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	eax, eax
	mov	DWORD PTR -12[rbp], eax
.L10:
	add	DWORD PTR -16[rbp], 1
.L9:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -16[rbp], eax
	jle	.L11
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"162642678.c"
	.text
	.comm	n,4,4
	.comm	x,4,4
	.comm	adj,4000000,4
	.comm	d1,4000,4
	.comm	dx,4000,4
	.align	2
	.global	dfs
	.syntax unified
	.arm
	.fpu softvfp
	.type	dfs, %function
dfs:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-24]
	add	r3, r1, r3
	add	r2, r2, #1
	str	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L2
.L5:
	ldr	r1, .L6
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, [fp, #-8]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	cmp	r3, #0
	bne	.L3
	ldr	r1, .L6
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, [fp, #-16]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	cmp	r3, #0
	beq	.L4
.L3:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	beq	.L4
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-8]
	bl	dfs
.L4:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, .L6+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	ble	.L5
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	adj
	.word	n
	.size	dfs, .-dfs
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d %d\000"
	.align	2
.LC1:
	.ascii	"\012Ans: %d\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, .L16+4
	ldr	r1, .L16+8
	ldr	r0, .L16+12
	bl	__isoc99_scanf
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L9
.L10:
	sub	r2, fp, #20
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, .L16+12
	bl	__isoc99_scanf
	ldr	r2, [fp, #-24]
	ldr	r0, [fp, #-20]
	ldr	r1, .L16+16
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r0
	mov	ip, #1
	str	ip, [r1, r3, lsl #2]
	ldr	r1, [fp, #-24]
	ldr	ip, [fp, #-20]
	ldr	lr, .L16+16
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r0
	ldr	r2, [lr, r3, lsl #2]
	ldr	r0, .L16+16
	mov	r3, r1
	lsl	r3, r3, #5
	sub	r3, r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #3
	add	r3, r3, ip
	str	r2, [r0, r3, lsl #2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L9:
	ldr	r3, .L16+8
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L10
	ldr	r3, .L16+20
	mvn	r2, #0
	str	r2, [r3]
	ldr	r3, .L16+20
	ldr	r3, [r3]
	ldr	r2, .L16+24
	str	r3, [r2]
	ldr	r2, .L16+24
	mov	r1, #0
	mov	r0, #1
	bl	dfs
	ldr	r3, .L16+4
	ldr	r3, [r3]
	ldr	r2, .L16+20
	mov	r1, #0
	mov	r0, r3
	bl	dfs
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L11
.L13:
	ldr	r2, .L16+20
	ldr	r3, [fp, #-16]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L16+24
	ldr	r3, [fp, #-16]
	ldr	r3, [r1, r3, lsl #2]
	cmp	r2, r3
	bge	.L12
	ldr	r2, .L16+24
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	lsl	r3, r3, #1
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bge	.L12
	ldr	r2, .L16+24
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	lsl	r3, r3, #1
	str	r3, [fp, #-12]
.L12:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L11:
	ldr	r3, .L16+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L13
	ldr	r1, [fp, #-12]
	ldr	r0, .L16+28
	bl	printf
	mov	r3, #0
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC2
	.word	x
	.word	n
	.word	.LC0
	.word	adj
	.word	dx
	.word	d1
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
