	.file	"113260.c"
	.intel_syntax noprefix
	.text
	.globl	exgcd
	.type	exgcd, @function
exgcd:
.LFB0:
	.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	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	QWORD PTR -48[rbp], rcx
	cmp	QWORD PTR -32[rbp], 0
	je	.L2
	mov	rax, QWORD PTR -24[rbp]
	cqo
	idiv	QWORD PTR -32[rbp]
	mov	rsi, rdx
	mov	rcx, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	exgcd
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	cqo
	idiv	QWORD PTR -32[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR [rax]
	imul	rax, rdx
	sub	rcx, rax
	mov	rdx, rcx
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR [rax], rdx
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR [rax], 0
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR [rax], 1
	mov	QWORD PTR -8[rbp], 1
.L3:
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	exgcd, .-exgcd
	.section	.rodata
.LC0:
	.string	"%lld%lld%lld%lld"
.LC1:
	.string	"%lld %lld %lld\n"
.LC2:
	.string	"-1"
	.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, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, -40[rbp]
	lea	rcx, -48[rbp]
	lea	rdx, -56[rbp]
	lea	rax, -64[rbp]
	mov	r8, rsi
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, QWORD PTR -48[rbp]
	cqo
	idiv	rsi
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L6
.L10:
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -48[rbp]
	imul	rax, QWORD PTR -32[rbp]
	mov	rcx, rax
	mov	rax, rdx
	sub	rax, rcx
	mov	rdi, QWORD PTR -40[rbp]
	cqo
	idiv	rdi
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	imul	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	imul	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -56[rbp]
	cmp	rdx, rax
	je	.L15
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -64[rbp]
	cmp	rdx, rax
	jg	.L16
	sub	QWORD PTR -32[rbp], 1
.L6:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, rdx
	cmp	QWORD PTR -32[rbp], rax
	jge	.L10
	jmp	.L8
.L15:
	nop
	jmp	.L8
.L16:
	nop
.L8:
	mov	rax, QWORD PTR -48[rbp]
	imul	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	imul	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -56[rbp]
	cmp	rdx, rax
	jne	.L11
	cmp	QWORD PTR -32[rbp], 0
	js	.L11
	cmp	QWORD PTR -24[rbp], 0
	js	.L11
	mov	rax, QWORD PTR -64[rbp]
	sub	rax, QWORD PTR -32[rbp]
	sub	rax, QWORD PTR -24[rbp]
	test	rax, rax
	js	.L11
	mov	rax, QWORD PTR -64[rbp]
	sub	rax, QWORD PTR -32[rbp]
	sub	rax, QWORD PTR -24[rbp]
	mov	rcx, rax
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L12
.L11:
	lea	rdi, .LC2[rip]
	call	puts@PLT
.L12:
	mov	eax, 0
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"113260.c"
	.text
	.global	__aeabi_ldivmod
	.align	2
	.global	exgcd
	.syntax unified
	.arm
	.fpu softvfp
	.type	exgcd, %function
exgcd:
	@ args = 8, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #32
	str	r0, [fp, #-44]
	str	r1, [fp, #-40]
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	orrs	r3, r2, r3
	beq	.L2
	sub	r1, fp, #44
	ldmia	r1, {r0-r1}
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	bl	__aeabi_ldivmod
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #4]
	str	r3, [sp, #4]
	ldr	r3, [fp, #8]
	str	r3, [sp]
	mov	r2, r0
	mov	r3, r1
	sub	r1, fp, #52
	ldmia	r1, {r0-r1}
	bl	exgcd
	str	r0, [fp, #-36]
	str	r1, [fp, #-32]
	ldr	r3, [fp, #8]
	ldmia	r3, {r6-r7}
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	sub	r1, fp, #44
	ldmia	r1, {r0-r1}
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	mov	r5, r3
	ldr	r3, [fp, #4]
	ldmia	r3, {r0-r1}
	mul	r2, r0, r5
	mul	r3, r4, r1
	add	ip, r2, r3
	umull	r2, r3, r4, r0
	add	r1, ip, r3
	mov	r3, r1
	subs	r8, r6, r2
	sbc	r9, r7, r3
	ldr	r3, [fp, #8]
	stm	r3, {r8-r9}
	b	.L3
.L2:
	ldr	r1, [fp, #8]
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	ldr	r1, [fp, #4]
	mov	r2, #1
	mov	r3, #0
	stm	r1, {r2-r3}
	mov	r2, #1
	mov	r3, #0
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
.L3:
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
	.size	exgcd, .-exgcd
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%lld%lld%lld%lld\000"
	.align	2
.LC1:
	.ascii	"%lld %lld %lld\012\000"
	.align	2
.LC2:
	.ascii	"-1\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #152
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	sub	r0, fp, #76
	sub	r2, fp, #84
	sub	r1, fp, #92
	sub	r3, fp, #68
	str	r3, [sp]
	mov	r3, r0
	ldr	r0, .L17+4
	bl	__isoc99_scanf
	sub	r1, fp, #84
	ldmia	r1, {r0-r1}
	sub	r3, fp, #76
	ldmia	r3, {r2-r3}
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-60]
	str	r3, [fp, #-56]
	b	.L6
.L10:
	sub	r5, fp, #84
	ldmia	r5, {r4-r5}
	sub	r1, fp, #76
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-60]
	mul	r2, r1, r3
	ldr	r3, [fp, #-56]
	mul	r3, r0, r3
	add	r2, r2, r3
	ldr	r3, [fp, #-60]
	umull	r6, r7, r3, r0
	add	r3, r2, r7
	mov	r7, r3
	subs	r3, r4, r6
	str	r3, [fp, #-100]
	sbc	r3, r5, r7
	str	r3, [fp, #-96]
	sub	r3, fp, #68
	ldmia	r3, {r2-r3}
	sub	r1, fp, #100
	ldmia	r1, {r0-r1}
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	sub	r1, fp, #76
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-60]
	mul	r2, r1, r3
	ldr	r3, [fp, #-56]
	mul	r3, r0, r3
	add	r2, r2, r3
	ldr	r3, [fp, #-60]
	umull	r6, r7, r3, r0
	add	r3, r2, r7
	mov	r7, r3
	sub	r1, fp, #68
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-52]
	mul	r2, r1, r3
	ldr	r3, [fp, #-48]
	mul	r3, r0, r3
	add	r2, r2, r3
	ldr	r3, [fp, #-52]
	umull	r4, r5, r3, r0
	add	r3, r2, r5
	mov	r5, r3
	adds	r3, r6, r4
	str	r3, [fp, #-108]
	adc	r3, r7, r5
	str	r3, [fp, #-104]
	sub	r3, fp, #84
	ldmia	r3, {r2-r3}
	sub	r1, fp, #108
	ldmia	r1, {r0-r1}
	cmp	r1, r3
	cmpeq	r0, r2
	beq	.L15
	sub	r1, fp, #60
	ldmia	r1, {r0-r1}
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	adds	ip, r0, r2
	str	ip, [fp, #-116]
	adc	r3, r1, r3
	str	r3, [fp, #-112]
	sub	r3, fp, #92
	ldmia	r3, {r2-r3}
	sub	r1, fp, #116
	ldmia	r1, {r0-r1}
	cmp	r2, r0
	sbcs	r3, r3, r1
	blt	.L16
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	subs	r1, r2, #1
	str	r1, [fp, #-164]
	sbc	r3, r3, #0
	str	r3, [fp, #-160]
	sub	r4, fp, #164
	ldmia	r4, {r3-r4}
	str	r3, [fp, #-60]
	str	r4, [fp, #-56]
.L6:
	sub	r1, fp, #68
	ldmia	r1, {r0-r1}
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	subs	ip, r2, r0
	str	ip, [fp, #-124]
	sbc	r3, r3, r1
	str	r3, [fp, #-120]
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	sub	r1, fp, #124
	ldmia	r1, {r0-r1}
	cmp	r2, r0
	sbcs	r3, r3, r1
	bge	.L10
	b	.L8
.L15:
	nop
	b	.L8
.L16:
	nop
.L8:
	sub	r3, fp, #76
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-60]
	mul	r0, r3, r1
	ldr	r1, [fp, #-56]
	mul	r1, r2, r1
	add	r0, r0, r1
	ldr	r1, [fp, #-60]
	umull	r4, r5, r1, r2
	add	r3, r0, r5
	mov	r5, r3
	sub	r1, fp, #68
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-52]
	mul	r2, r1, r3
	ldr	r3, [fp, #-48]
	mul	r3, r0, r3
	add	lr, r2, r3
	ldr	ip, [fp, #-52]
	umull	r2, r3, ip, r0
	add	r1, lr, r3
	mov	r3, r1
	adds	r1, r4, r2
	str	r1, [fp, #-132]
	adc	r3, r5, r3
	str	r3, [fp, #-128]
	sub	r3, fp, #84
	ldmia	r3, {r2-r3}
	sub	r1, fp, #132
	ldmia	r1, {r0-r1}
	cmp	r1, r3
	cmpeq	r0, r2
	bne	.L11
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	cmp	r2, #0
	sbcs	r3, r3, #0
	blt	.L11
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	cmp	r2, #0
	sbcs	r3, r3, #0
	blt	.L11
	sub	r1, fp, #92
	ldmia	r1, {r0-r1}
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	subs	ip, r0, r2
	str	ip, [fp, #-140]
	sbc	r3, r1, r3
	str	r3, [fp, #-136]
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	sub	r1, fp, #140
	ldmia	r1, {r0-r1}
	mov	ip, r0
	subs	ip, ip, r2
	str	ip, [fp, #-148]
	sbc	r3, r1, r3
	str	r3, [fp, #-144]
	sub	r4, fp, #148
	ldmia	r4, {r3-r4}
	cmp	r3, #0
	sbcs	r3, r4, #0
	blt	.L11
	sub	r1, fp, #92
	ldmia	r1, {r0-r1}
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	subs	r8, r0, r2
	sbc	r9, r1, r3
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	subs	r1, r8, r2
	str	r1, [fp, #-156]
	sbc	r3, r9, r3
	str	r3, [fp, #-152]
	sub	r4, fp, #156
	ldmia	r4, {r3-r4}
	str	r3, [sp, #8]
	str	r4, [sp, #12]
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	stm	sp, {r2-r3}
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	ldr	r0, .L17+8
	bl	printf
	b	.L12
.L11:
	ldr	r0, .L17+12
	bl	puts
.L12:
	mov	r3, #0
	ldr	r2, .L17
	ldr	r1, [r2]
	ldr	r2, [fp, #-32]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
