	.file	"80707.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: ./rsa_genkey <p> <q>\n"
	.text
	.type	usageError, @function
usageError:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 28
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	usageError, .-usageError
	.section	.rodata
	.align 8
.LC1:
	.string	"Both, p and q should be prime numbers\n"
	.align 8
.LC2:
	.string	"Private key (e,n) = (%lu,%lu)\n"
	.align 8
.LC3:
	.string	"Public  key (d,n) = (%lu,%lu)\n"
	.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	cmp	DWORD PTR -52[rbp], 2
	jg	.L3
	mov	eax, 0
	call	usageError
.L3:
	mov	QWORD PTR -48[rbp], 42
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoll@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoll@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	isPrime
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	isPrime
	test	eax, eax
	jne	.L5
.L4:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 38
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	rax, QWORD PTR -40[rbp]
	imul	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -32[rbp]
	sub	rax, 1
	imul	rax, rdx
	mov	QWORD PTR -16[rbp], rax
.L6:
	add	QWORD PTR -48[rbp], 1
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	gcd
	cmp	rax, 1
	jne	.L6
	mov	QWORD PTR -8[rbp], 0
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	computeD
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.type	isPrime, @function
isPrime:
.LFB8:
	.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
	cmp	QWORD PTR -24[rbp], 1
	ja	.L9
	mov	eax, 0
	jmp	.L10
.L9:
	mov	QWORD PTR -8[rbp], 3
	jmp	.L11
.L13:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	div	QWORD PTR -8[rbp]
	mov	rax, rdx
	test	rax, rax
	jne	.L12
	mov	eax, 0
	jmp	.L10
.L12:
	add	QWORD PTR -8[rbp], 2
.L11:
	mov	rax, QWORD PTR -8[rbp]
	cmp	rax, QWORD PTR -24[rbp]
	jb	.L13
	mov	eax, 1
.L10:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	isPrime, .-isPrime
	.type	gcd, @function
gcd:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	cmp	QWORD PTR -16[rbp], 0
	jne	.L15
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L16
.L15:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 0
	div	QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	gcd
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	gcd, .-gcd
	.type	computeD, @function
computeD:
.LFB10:
	.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	QWORD PTR -8[rbp], 1
	jmp	.L18
.L21:
	mov	rax, QWORD PTR -8[rbp]
	imul	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	div	QWORD PTR -32[rbp]
	mov	rax, rdx
	cmp	rax, 1
	jne	.L19
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L20
.L19:
	add	QWORD PTR -8[rbp], 1
.L18:
	mov	rax, QWORD PTR -8[rbp]
	cmp	rax, QWORD PTR -32[rbp]
	jbe	.L21
	mov	rax, -1
.L20:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	computeD, .-computeD
	.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	"80707.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: ./rsa_genkey <p> <q>\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usageError, %function
usageError:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #28
	mov	r1, #1
	ldr	r0, .L2+4
	bl	fwrite
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.size	usageError, .-usageError
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Both, p and q should be prime numbers\012\000"
	.align	2
.LC2:
	.ascii	"Private key (e,n) = (%llu,%llu)\012\000"
	.align	2
.LC3:
	.ascii	"Public  key (d,n) = (%llu,%llu)\012\000"
	.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	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #64
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, [fp, #-80]
	cmp	r3, #2
	bgt	.L5
	bl	usageError
.L5:
	mov	r2, #42
	mov	r3, #0
	str	r2, [fp, #-76]
	str	r3, [fp, #-72]
	ldr	r3, [fp, #-84]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoll
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-68]
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-84]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoll
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-60]
	str	r3, [fp, #-56]
	sub	r1, fp, #68
	ldmia	r1, {r0-r1}
	bl	isPrime
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	sub	r1, fp, #60
	ldmia	r1, {r0-r1}
	bl	isPrime
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
.L6:
	ldr	r3, .L10
	ldr	r3, [r3]
	mov	r2, #38
	mov	r1, #1
	ldr	r0, .L10+4
	bl	fwrite
	mov	r0, #1
	bl	exit
.L7:
	ldr	r3, [fp, #-64]
	ldr	r2, [fp, #-60]
	mul	r2, r3, r2
	ldr	r3, [fp, #-56]
	ldr	r1, [fp, #-68]
	mul	r3, r1, r3
	add	r1, r2, r3
	ldr	ip, [fp, #-68]
	ldr	r0, [fp, #-60]
	umull	r2, r3, ip, r0
	add	r1, r1, r3
	mov	r3, r1
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	sub	r3, fp, #68
	ldmia	r3, {r2-r3}
	subs	r6, r2, #1
	sbc	r7, r3, #0
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	subs	r4, r2, #1
	sbc	r5, r3, #0
	mul	r2, r4, r7
	mul	r3, r6, r5
	add	r1, r2, r3
	umull	r2, r3, r6, r4
	add	r1, r1, r3
	mov	r3, r1
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
.L8:
	sub	r3, fp, #76
	ldmia	r3, {r2-r3}
	adds	r8, r2, #1
	adc	r9, r3, #0
	str	r8, [fp, #-76]
	str	r9, [fp, #-72]
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	sub	r1, fp, #76
	ldmia	r1, {r0-r1}
	bl	gcd
	mov	r2, r0
	mov	r3, r1
	cmp	r3, #0
	cmpeq	r2, #1
	bne	.L8
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	sub	r1, fp, #76
	ldmia	r1, {r0-r1}
	bl	computeD
	str	r0, [fp, #-36]
	str	r1, [fp, #-32]
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	stm	sp, {r2-r3}
	sub	r3, fp, #76
	ldmia	r3, {r2-r3}
	ldr	r0, .L10+8
	bl	printf
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	stm	sp, {r2-r3}
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	ldr	r0, .L10+12
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L11:
	.align	2
.L10:
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.global	__aeabi_uldivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	isPrime, %function
isPrime:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #16
	str	r0, [fp, #-28]
	str	r1, [fp, #-24]
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	cmp	r3, #0
	cmpeq	r2, #1
	bhi	.L13
	mov	r3, #0
	b	.L14
.L13:
	mov	r2, #3
	mov	r3, #0
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	b	.L15
.L17:
	sub	r1, fp, #28
	ldmia	r1, {r0-r1}
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	bl	__aeabi_uldivmod
	orrs	r3, r2, r3
	bne	.L16
	mov	r3, #0
	b	.L14
.L16:
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	adds	r4, r2, #2
	adc	r5, r3, #0
	str	r4, [fp, #-20]
	str	r5, [fp, #-16]
.L15:
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	cmp	r1, r3
	cmpeq	r0, r2
	bcc	.L17
	mov	r3, #1
.L14:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
	.size	isPrime, .-isPrime
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gcd, %function
gcd:
	@ 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, #-12]
	str	r1, [fp, #-8]
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	orrs	r3, r2, r3
	bne	.L19
	sub	r3, fp, #12
	ldmia	r3, {r2-r3}
	b	.L20
.L19:
	sub	r1, fp, #12
	ldmia	r1, {r0-r1}
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	bl	__aeabi_uldivmod
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	bl	gcd
	mov	r2, r0
	mov	r3, r1
.L20:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	gcd, .-gcd
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	computeD, %function
computeD:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #24
	str	r0, [fp, #-28]
	str	r1, [fp, #-24]
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	mov	r2, #1
	mov	r3, #0
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	b	.L22
.L25:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-28]
	mul	r2, r3, r2
	ldr	r3, [fp, #-24]
	ldr	r1, [fp, #-20]
	mul	r3, r1, r3
	add	r3, r2, r3
	ldr	ip, [fp, #-20]
	ldr	r2, [fp, #-28]
	umull	r0, r1, ip, r2
	add	r3, r3, r1
	mov	r1, r3
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	bl	__aeabi_uldivmod
	cmp	r3, #0
	cmpeq	r2, #1
	bne	.L23
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	b	.L24
.L23:
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	adds	r4, r2, #1
	adc	r5, r3, #0
	str	r4, [fp, #-20]
	str	r5, [fp, #-16]
.L22:
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	cmp	r1, r3
	cmpeq	r0, r2
	bls	.L25
	mvn	r2, #0
	mvn	r3, #0
.L24:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
	.size	computeD, .-computeD
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
