// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/cactustree.c
// Function: mergeCharacteristics
struct Characteristics *mergeCharacteristics(struct Characteristics *one, struct Characteristics *two){
    struct Characteristics *start, *hlp1=one, *hlp2=two, *hlp3;
    int i=0;
    if(one == NULL) return two;
    if(two == NULL) return one;
    /*
    printf("\n\t\t\tmerging chars\n\n");
    printCharacteristics(one);
    printf("\n===============\n");
    printCharacteristics(two);
    printf("\t both are not null\n");
    printf("\t %i\n",hlp1);
    printf("\t %i\n", hlp2->masterID);
    */
    if(hlp1->masterID==hlp2->masterID){
   // printf("\t equal\n");
        hlp3=hlp2;
        hlp2=hlp2->next;
        hlp1->treeIDs=mergeTreeArrays(hlp1->treeIDs, hlp3->treeIDs, hlp1->size);
        for(;i<hlp3->size;++i){
            free(hlp3->treeIDs[i]);
        }
        free(hlp3->treeIDs);
        free(hlp3);
    }
    if(hlp1->masterID>hlp2->masterID){
    //printf("\t first larger\n");
        hlp3=hlp1;
        hlp1=hlp2;
        hlp2=hlp3;
    }
    start=hlp1;
    hlp1=start->next;
    hlp3=start;
    while(hlp1 && hlp2){
    //printf("\t while loop\n");
        if(hlp1->masterID<hlp2->masterID){
            hlp3->next=hlp1;
            hlp3=hlp1;
            hlp1=hlp1->next;
        }
        else{
            hlp3->next=hlp2;
            hlp3=hlp2;
            if(hlp1->masterID==hlp3->masterID){
                hlp3->treeIDs=mergeTreeArrays(hlp3->treeIDs, hlp1->treeIDs, hlp1->size);
                for(i=0;i<hlp1->size;++i){
                    free(hlp1->treeIDs[i]);
                }
                free(hlp1->treeIDs);
                hlp2=hlp1->next;
                free(hlp1);
                hlp1=hlp2;
            }
            hlp2=hlp3->next;
        }
    }
    if(hlp1) hlp3->next=hlp1;
    else hlp3->next=hlp2;
    //printCharacteristics(start);
    return start;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x36a1
movq 0x30(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x3910
cmpq $0x0, 0x30(%rsp)
jne 0x36b8
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x3910
movq 0x20(%rsp), %rax
movl (%rax), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jne 0x3759
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rsp), %rax
movl 0x4(%rax), %edx
callq 0x4b60
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x3741
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1030
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x370f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1030
movq 0x10(%rsp), %rdi
callq 0x1030
movq 0x20(%rsp), %rax
movl (%rax), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jle 0x3787
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x20(%rsp)
movb %al, 0xb(%rsp)
je 0x37c4
cmpq $0x0, 0x18(%rsp)
setne %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x37d1
jmp 0x38e0
movq 0x20(%rsp), %rax
movl (%rax), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x380c
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x38db
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movl (%rax), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
jne 0x38cd
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rsp), %rax
movl 0x4(%rax), %edx
callq 0x4b60
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x389d
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1030
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x386b
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1030
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
callq 0x1030
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x37a9
cmpq $0x0, 0x20(%rsp)
je 0x38f8
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x3906
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw (%rax,%rax)