// File: /workspace/github_c_makefile_star2_O0/rpeepz[P]ft_ssl/srcs/rsa/rsa_out.c
// Function: rsa_encode_out
void			rsa_encode_out(t_rsa_out rsa, t_rsa gg)
{
	int			len;
	int			i;
	uint8_t		buf[PAGESIZE];
	uint8_t		buf2[10];

	ft_bzero(buf, PAGESIZE);
	ft_bzero(buf2, 10);
	len = 0;
	(rsa.flag & R_PUBOUT || rsa.flag & R_PUBIN) ?\
	asn1_pub(gg, buf, buf2, &len) : asn1(gg, buf, buf2, &len);
	DEBUG ? ft_printf("asn1 len:[%d]\n", len) : 0;
	(rsa.flag & R_PUBOUT || rsa.flag & R_PUBIN) ? buf[16] = 0x00 : 0;
	(rsa.flag & R_PUBOUT || rsa.flag & R_PUBIN) ? buf[19] = 0x00 : 0;
	i = -1;
	while (++i < len)
		if (buf[i] == 0x02 && buf[i + 2] == 0xFF)
			buf[i + 2] = 0x00;
	ft_putstr_fd((rsa.flag & R_PUBOUT || rsa.flag & R_PUBIN) ?\
	PUB_BEG : PRIV_BEG, rsa.fd_out);
	base64_nstr_fd(buf, len, rsa.fd_out, 0);
	ft_putstr_fd((rsa.flag & R_PUBOUT || rsa.flag & R_PUBIN) ?\
	PUB_END : PRIV_END, rsa.fd_out);
	rsa.fd_out > 1 ? close(rsa.fd_out) : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1080, %rsp           # imm = 0x1080
leaq 0x28(%rbp), %rax
movq %rax, -0x1030(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x1028(%rbp)
leaq -0x1010(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0xa600
leaq -0x101a(%rbp), %rdi
movl $0xa, %esi
callq 0xa600
movq -0x1028(%rbp), %rax
movl $0x0, -0x4(%rbp)
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x779c
movq -0x1028(%rbp), %rax
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x77e5
movq -0x1030(%rbp), %rcx
leaq -0x1010(%rbp), %rdi
leaq -0x101a(%rbp), %rsi
movq 0x40(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0x4(%rbp), %rdx
callq 0x18c0
jmp 0x782c
movq -0x1030(%rbp), %rcx
leaq -0x1010(%rbp), %rdi
leaq -0x101a(%rbp), %rsi
movq 0x40(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0x4(%rbp), %rdx
callq 0x1200
movq -0x1028(%rbp), %rax
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x784e
movq -0x1028(%rbp), %rax
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7857
movb $0x0, -0x1000(%rbp)
jmp 0x7859
jmp 0x7859
movq -0x1028(%rbp), %rax
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x787b
movq -0x1028(%rbp), %rax
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7884
movb $0x0, -0xffd(%rbp)
jmp 0x7886
jmp 0x7886
movl $0xffffffff, -0x8(%rbp) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl -0x4(%rbp), %eax
jge 0x78d5
movslq -0x8(%rbp), %rax
movzbl -0x1010(%rbp,%rax), %eax
cmpl $0x2, %eax
jne 0x78d3
movl -0x8(%rbp), %eax
addl $0x2, %eax
cltq
movzbl -0x1010(%rbp,%rax), %eax
cmpl $0xff, %eax
jne 0x78d3
movl -0x8(%rbp), %eax
addl $0x2, %eax
cltq
movb $0x0, -0x1010(%rbp,%rax)
jmp 0x788d
movq -0x1028(%rbp), %rax
movl (%rax), %ecx
andl $0x40, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1031(%rbp)
jne 0x7906
movq -0x1028(%rbp), %rax
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x1031(%rbp)
movq -0x1028(%rbp), %rax
movb -0x1031(%rbp), %dl
leaq 0xc6d2(%rip), %rdi      # 0x13fec
leaq 0xc6af(%rip), %rcx      # 0x13fd0
testb $0x1, %dl
cmovneq %rcx, %rdi
movl 0xc(%rax), %esi
callq 0xb230
movq -0x1028(%rbp), %rax
leaq -0x1010(%rbp), %rdi
movl -0x4(%rbp), %esi
movl 0xc(%rax), %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1db0
movq -0x1028(%rbp), %rax
movl (%rax), %ecx
andl $0x40, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1032(%rbp)
jne 0x797e
movq -0x1028(%rbp), %rax
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x1032(%rbp)
movq -0x1028(%rbp), %rax
movb -0x1032(%rbp), %dl
leaq 0xc6c8(%rip), %rdi      # 0x1405a
leaq 0xc6a7(%rip), %rcx      # 0x14040
testb $0x1, %dl
cmovneq %rcx, %rdi
movl 0xc(%rax), %esi
callq 0xb230
movq -0x1028(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x79c6
movq -0x1028(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x1070
jmp 0x79c8
jmp 0x79c8
addq $0x1080, %rsp           # imm = 0x1080
popq %rbp
retq
nopw %cs:(%rax,%rax)