// File: /workspace/github_c_makefile_star2_O0/rpeepz[P]ft_ssl/srcs/rsa/rsa.c
// Function: validate_key
int				validate_key(char *buf, t_rsa *gg, int flag)
{
	uint8_t		seq_decode[3];
	uint8_t		*decoded;
	int			n;
	float		decode_len;

	decode_len = 0;
	n = base64_decode((uint8_t *)buf, seq_decode, 4);
	decode_len = (((float)seq_decode[1] / 3.0) * 4.0);
	decoded = ft_memalloc((int)decode_len);
	n += base64_decode((uint8_t *)buf + n, decoded, (int)decode_len);
	if (buf[n + 1] != '-' && ft_pipewrench("-s", &decoded))
		return (0);
	if ((n <= 64 ? ((ft_strchri(buf, '-') - 1) % 4) :\
	((n + 1 != ft_strchri(buf, '-')) || ((n - (65 * (n / 64))) % 4))) &&\
		ft_error(flag ? 7 : 8, NULL, NULL) && ft_pipewrench("-s", &decoded))
		return ((buf[0] = 0));
	decode_len = (int)((decode_len / 4.0) * 3.0);
	if (assign(decoded, gg, (int)decode_len, flag))
		return (0);
	if (get_value(gg, 0, flag) && ft_error(flag ? 13 : 14, NULL, NULL))
		return ((buf[0] = 0));
	return (n <= 64 ? ft_strchri(buf, '-') : n + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x1f(%rbp), %rsi
movl $0x4, %edx
callq 0x2030
movl %eax, -0x2c(%rbp)
movzbl -0x1e(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xc3c5(%rip), %xmm1     # 0x13018
divsd %xmm1, %xmm0
movsd 0xd369(%rip), %xmm1     # 0x13fc8
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
cvttss2si -0x30(%rbp), %eax
movslq %eax, %rdi
callq 0xa650
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x2c(%rbp), %rax
addq %rax, %rdi
movq -0x28(%rbp), %rsi
cvttss2si -0x30(%rbp), %edx
callq 0x2030
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
je 0x6cd5
leaq 0xd099(%rip), %rdi      # 0x13d52
leaq -0x28(%rbp), %rsi
movb $0x0, %al
callq 0xa8d0
cmpl $0x0, %eax
je 0x6cd5
movl $0x0, -0x4(%rbp)
jmp 0x6e56
cmpl $0x40, -0x2c(%rbp)
jg 0x6cfe
movq -0x10(%rbp), %rdi
movl $0x2d, %esi
callq 0xb7f0
subl $0x1, %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x6d46
jmp 0x6d94
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2d, %esi
callq 0xb7f0
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
jne 0x6d46
movl -0x2c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x2c(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x38(%rbp), %eax
imull $0x41, %ecx, %ecx
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x6d94
movl -0x1c(%rbp), %ecx
movl $0x8, %edi
movl $0x7, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x33a0
cmpl $0x0, %eax
je 0x6d94
leaq 0xcfe1(%rip), %rdi      # 0x13d52
leaq -0x28(%rbp), %rsi
movb $0x0, %al
callq 0xa8d0
cmpl $0x0, %eax
je 0x6d94
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x6e56
movss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xd223(%rip), %xmm1     # 0x13fc8
divsd %xmm1, %xmm0
movsd 0xc267(%rip), %xmm1     # 0x13018
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
cvttss2si -0x30(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x6b10
cmpl $0x0, %eax
je 0x6de5
movl $0x0, -0x4(%rbp)
jmp 0x6e56
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0x69e0
cmpl $0x0, %eax
je 0x6e2e
movl -0x1c(%rbp), %ecx
movl $0xe, %edi
movl $0xd, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x33a0
cmpl $0x0, %eax
je 0x6e2e
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x6e56
cmpl $0x40, -0x2c(%rbp)
jg 0x6e47
movq -0x10(%rbp), %rdi
movl $0x2d, %esi
callq 0xb7f0
movl %eax, -0x3c(%rbp)
jmp 0x6e50
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop