// File: /workspace/github_c_makefile_star2_O0/rpeepz[P]ft_ssl/srcs/rsa/asn1.c
// Function: asn1_pub
void			asn1_pub(t_rsa gg, uint8_t *buf, uint8_t *buf2, int *len)
{
	uint8_t		copy[PAGESIZE];
	int			index;

	dump_to_buf(buf, INT, NULL, len);
	dump_to_buf(buf, byte_string(buf2, gg.n)[0] == 0xFF ?
	byte_len(gg.n) + 1 : byte_len(gg.n), NULL, len);
	dump_to_buf(buf, 0, byte_string(buf2, gg.n), len);
	dump_to_buf(buf, INT, NULL, len);
	dump_to_buf(buf, byte_len(gg.e), NULL, len);
	dump_to_buf(buf, 0, byte_string(buf2, gg.e), len);
	ft_memcpy(copy, buf, *len);
	ft_bzero(buf, PAGESIZE);
	index = 2;
	dump_to_buf(buf, SEQUENCE, NULL, &index);
	dump_to_buf(buf, 0, (uint8_t*)PKCS_1, &index);
	dump_to_buf(buf, BIT, NULL, &index);
	dump_to_buf(buf, (char)(*len) + 3, NULL, &index);
	dump_to_buf(buf, V1, NULL, &index);
	dump_to_buf(buf, SEQUENCE, NULL, &index);
	dump_to_buf(buf, (char)(*len), NULL, &index);
	ft_memcpy(&buf[index], copy, *len);
	*len += index;
	buf[0] = SEQUENCE;
	buf[1] = (uint8_t)*len - 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1060, %rsp           # imm = 0x1060
leaq 0x10(%rbp), %rax
movq %rax, -0x1038(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1cd0
movq -0x1038(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, -0x1030(%rbp)
movq -0x10(%rbp), %rdi
movq 0x10(%rax), %rsi
callq 0x1ba0
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x193f
movq -0x1038(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1b70
movsbl %al, %eax
addl $0x1, %eax
movl %eax, -0x103c(%rbp)
jmp 0x1958
movq -0x1038(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1b70
movsbl %al, %eax
movl %eax, -0x103c(%rbp)
movq -0x1030(%rbp), %rdi
movl -0x103c(%rbp), %eax
movq -0x18(%rbp), %rcx
xorl %edx, %edx
movsbl %al, %esi
callq 0x1cd0
movq -0x1038(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, -0x1058(%rbp)
movq -0x10(%rbp), %rdi
movq 0x10(%rax), %rsi
callq 0x1ba0
movq -0x1058(%rbp), %rdi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
xorl %esi, %esi
callq 0x1cd0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1cd0
movq -0x1038(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, -0x1050(%rbp)
movq 0x38(%rax), %rdi
callq 0x1b70
movq -0x1050(%rbp), %rdi
movq -0x18(%rbp), %rcx
xorl %edx, %edx
movsbl %al, %esi
callq 0x1cd0
movq -0x1038(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, -0x1048(%rbp)
movq -0x10(%rbp), %rdi
movq 0x38(%rax), %rsi
callq 0x1ba0
movq -0x1048(%rbp), %rdi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
xorl %esi, %esi
callq 0x1cd0
leaq -0x1020(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rax
movslq (%rax), %rdx
callq 0xa6a0
movq -0x8(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0xa600
movl $0x2, -0x1024(%rbp)
movq -0x8(%rbp), %rdi
movl $0x30, %esi
xorl %eax, %eax
movl %eax, %edx
leaq -0x1024(%rbp), %rcx
callq 0x1cd0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0x1158e(%rip), %rdx     # 0x13004
leaq -0x1024(%rbp), %rcx
callq 0x1cd0
movq -0x8(%rbp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
leaq -0x1024(%rbp), %rcx
callq 0x1cd0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
movsbl %al, %eax
addl $0x3, %eax
xorl %ecx, %ecx
movl %ecx, %edx
leaq -0x1024(%rbp), %rcx
movsbl %al, %esi
callq 0x1cd0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
leaq -0x1024(%rbp), %rcx
callq 0x1cd0
movq -0x8(%rbp), %rdi
movl $0x30, %esi
xorl %eax, %eax
movl %eax, %edx
leaq -0x1024(%rbp), %rcx
callq 0x1cd0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
xorl %ecx, %ecx
movl %ecx, %edx
leaq -0x1024(%rbp), %rcx
movsbl %al, %esi
callq 0x1cd0
movq -0x8(%rbp), %rdi
movslq -0x1024(%rbp), %rax
addq %rax, %rdi
leaq -0x1020(%rbp), %rsi
movq -0x18(%rbp), %rax
movslq (%rax), %rdx
callq 0xa6a0
movl -0x1024(%rbp), %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movb $0x30, (%rax)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movzbl %al, %eax
subl $0x2, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x1(%rax)
addq $0x1060, %rsp           # imm = 0x1060
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)