// File: /workspace/github_c_makefile_star2_O0/snow1eo[P]IPsec_IKEv2/./transforms.c
// Function: char2transform
uint32_t char2transform (uint8_t *buf, transform *trans)
{
    uint32_t offset = 0;
    CPY (buf, offset, trans->more);
    CPY (buf, offset, trans->reserved1);
    CPY (buf, offset, trans->transform_length);
    CPY (buf, offset, trans->transform_type);
    CPY (buf, offset, trans->reserved2);
    CPY (buf, offset, trans->transform_ID);
    if (trans->transform_length > 8)
    {
        memcpy (&trans->attribute_format, buf+offset, sizeof (trans->attribute_format));
        offset += sizeof (trans->attribute_format);
        memcpy (&trans->attribute_type, buf+offset, sizeof (trans->attribute_type));
        offset += sizeof (trans->attribute_type);
        trans->attribute_value = calloc (1, 2);
        MEMCHECK (trans->attribute_value);
        memcpy (trans->attribute_value, buf+offset, 2);
        offset += 2;
        if (!(trans->attribute_format >> 7))
        {
            trans->attribute_value = realloc (trans->attribute_value,
                2+(trans->attribute_value[0] << 8) + trans->attribute_value[1]);
            MEMCHECK (trans->attribute_value);
            memcpy (trans->attribute_value+2, buf+offset,
                (trans->attribute_value[0] << 8) + trans->attribute_value[1]);
            offset += (trans->attribute_value[0] << 8)+trans->attribute_value[1];
        }
    }
    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 $0x2, %esi
callq 0x3050
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movw (%rcx,%rdx), %cx
movw %cx, 0x6(%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 -0x10(%rbp), %rax
movzwl 0x2(%rax), %eax
cmpl $0x8, %eax
jle 0x4000
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, 0x8(%rax)
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, 0x9(%rax)
movl -0x14(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movl $0x1, %edi
movl $0x2, %esi
callq 0x3250
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xa(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa(%rax)
jne 0x3f01
movq 0xe119(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x918f(%rip), %rsi      # 0xd078
leaq 0x918c(%rip), %rdx      # 0xd07c
movb $0x0, %al
callq 0x3270
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x34c0
movq -0x10(%rbp), %rax
movq 0xa(%rax), %rax
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
movw (%rcx,%rdx), %cx
movw %cx, (%rax)
movl -0x14(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x8(%rax), %eax
sarl $0x7, %eax
cmpl $0x0, %eax
jne 0x3ffe
movq -0x10(%rbp), %rax
movq 0xa(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0xa(%rax), %rax
movzbl (%rax), %eax
shll $0x8, %eax
addl $0x2, %eax
movq -0x10(%rbp), %rcx
movq 0xa(%rcx), %rcx
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x3370
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xa(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa(%rax)
jne 0x3fa2
movq 0xe078(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x90ee(%rip), %rsi      # 0xd078
leaq 0x90eb(%rip), %rdx      # 0xd07c
movb $0x0, %al
callq 0x3270
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x34c0
movq -0x10(%rbp), %rax
movq 0xa(%rax), %rdi
addq $0x2, %rdi
movq -0x8(%rbp), %rsi
movl -0x14(%rbp), %eax
addq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0xa(%rax), %rax
movzbl (%rax), %eax
shll $0x8, %eax
movq -0x10(%rbp), %rcx
movq 0xa(%rcx), %rcx
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
movslq %eax, %rdx
callq 0x32c0
movq -0x10(%rbp), %rax
movq 0xa(%rax), %rax
movzbl (%rax), %eax
shll $0x8, %eax
movq -0x10(%rbp), %rcx
movq 0xa(%rcx), %rcx
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x4000
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)