// File: /workspace/github_c_makefile_star2_O0/snow1eo[P]IPsec_IKEv2/./transforms.c
// Function: char2proposal
uint32_t char2proposal (uint8_t *buf, proposal *prop)
{
    uint32_t offset = 0;
    CPY (buf, offset, prop->more);
    CPY (buf, offset, prop->reserved);
    CPY (buf, offset, prop->proposal_length);
    CPY (buf, offset, prop->proposal_num);
    CPY (buf, offset, prop->protocol_ID);
    CPY (buf, offset, prop->SPI_size);
    CPY (buf, offset, prop->num_transforms);
    if (prop->SPI_size > 0)
    {
        reverse (buf+offset, prop->SPI_size);
        prop->SPI = calloc (prop->SPI_size, 1);
        memcpy (prop->SPI, buf+offset, prop->SPI_size);
        reverse (buf+offset, prop->SPI_size);
        offset += prop->SPI_size;
    }
    prop->transforms = calloc (prop->num_transforms, sizeof (transform));
    MEMCHECK (prop->transforms);
    for (uint32_t i = 0; i < prop->num_transforms; i++)
    {
        offset += char2transform (buf+offset, prop->transforms+i);
        if ((prop->transforms+i)->more == 0)
            break;
    }
    return offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, (%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x2, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movw (%rcx,%rdx), %cx
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x2, %esi
callq 0x3050
movl -0x14(%rbp), %eax
addq $0x2, %rax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, 0x5(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, 0x6(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, 0x7(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movl $0x1, %esi
callq 0x3050
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
cmpl $0x0, %eax
jle 0x43a6
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %esi
callq 0x3050
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x3250
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movl -0x14(%rbp), %eax
addq %rax, %rsi
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
movl %eax, %edx
callq 0x32c0
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %esi
callq 0x3050
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x7(%rax), %eax
movl %eax, %edi
movl $0x12, %esi
callq 0x3250
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x43f9
movq 0xdc21(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x8c97(%rip), %rsi      # 0xd078
leaq 0x8c94(%rip), %rdx      # 0xd07c
movb $0x0, %al
callq 0x3270
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x34c0
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
cmpl %ecx, %eax
jae 0x445f
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x18(%rbp), %eax
imulq $0x12, %rax, %rax
addq %rax, %rsi
callq 0x3220
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x18(%rbp), %ecx
imulq $0x12, %rcx, %rcx
addq %rcx, %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x4452
jmp 0x445f
jmp 0x4454
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4400
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)