LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/coapp-packages[P]bzip2/bzip2.c
// Function: compressedStreamEOF
static 
void compressedStreamEOF ( void )
{
  if (noisy) {
    fprintf ( stderr,
	      "\n%s: Compressed file ends unexpectedly;\n\t"
	      "perhaps it is corrupted?  *Possible* reason follows.\n",
	      progName );
    perror ( progName );
    showFileNames();
    cadvise();
  }
  cleanUpAndFail( 2 );
}

// Assembly:
pushq %rax
cmpb $0x0, 0xf121(%rip)      # 0x12dab
je 0x3cc1
movq 0xe365(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xfd63(%rip), %rdx      # 0x13a00
leaq 0xac23(%rip), %rsi      # 0xe8c7
xorl %eax, %eax
callq 0x1160
movq 0xfd4e(%rip), %rdi      # 0x13a00
callq 0x1210
callq 0x36b7
callq 0x3857
pushq $0x2
popq %rdi
callq 0x36e7
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/serverC.c
// Function: parse_data2
int parse_data2(char *args[], char *data, char *edges, int *vertices) {
    char *end_str;
    char *token = strtok_r(data, "\n", &end_str);
    int i = 0;

    while (token != NULL) {
        char *end_token;
        //printf("debug: check line -- %s\n", token);
        if(i == 0) {
            split_args2(args, token);
        } else if (i < 4) {
            args[i+2] = token;
        } else {
            strcat(edges, token);
            strcat(edges, "\n");
            char *token2 = strtok_r(token, " ", &end_token);
            int j = 0;
            while (token2 != NULL && j < 2) {
                for(int k = 0; k < MAXNUMVERTICES; k++) {
                    if(vertices[k] == atoi(token2)) {
                        break;
                    } else if(vertices[k] == -1) {
                        vertices[k] = atoi(token2);
                        break;
                    }
                }
                token2 = strtok_r(NULL, " ", &end_token);
                j++;
            }
        }
        token = strtok_r(NULL, "\n", &end_str);
        i++;
    }

    int vtx_num = 0;
    while(vertices[vtx_num] != -1 && vtx_num < MAXNUMVERTICES) {
        vtx_num++;
    }
    return vtx_num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, -0x38(%rbp)
movq %rsi, %rax
movq %rdi, -0x30(%rbp)
leaq 0xe3e(%rip), %rsi       # 0x2148
leaq -0x50(%rbp), %rdx
movq %rax, %rdi
callq 0x10b0
movq %rax, %r15
xorl %ecx, %ecx
testq %r15, %r15
je 0x13ec
testq %rcx, %rcx
movq %rcx, -0x40(%rbp)
je 0x133e
cmpq $0x3, %rcx
ja 0x1368
movq -0x30(%rbp), %rax
movq %r15, 0x10(%rax,%rcx,8)
jmp 0x134a
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x12b3
xorl %edi, %edi
leaq 0xdf5(%rip), %rsi       # 0x2148
leaq -0x50(%rbp), %rdx
callq 0x10b0
movq %rax, %r15
movq -0x40(%rbp), %rcx
incq %rcx
jmp 0x131b
movq -0x38(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x1130
movq %r14, %rdi
callq 0x1050
movw $0xa, (%r14,%rax)
movq %r15, %rdi
leaq 0xe9b(%rip), %rsi       # 0x222b
leaq -0x48(%rbp), %rdx
callq 0x10b0
movq %rax, %r15
xorl %r14d, %r14d
testq %r15, %r15
je 0x134a
cmpl $0x1, %r14d
ja 0x134a
xorl %r12d, %r12d
cmpq $0xf, %r12
je 0x13d2
movl (%rbx,%r12,4), %r13d
movq %r15, %rdi
callq 0x1120
cmpl %eax, %r13d
je 0x13d2
incq %r12
cmpl $-0x1, %r13d
jne 0x13ad
movl %eax, -0x4(%rbx,%r12,4)
xorl %edi, %edi
leaq 0xe50(%rip), %rsi       # 0x222b
leaq -0x48(%rbp), %rdx
callq 0x10b0
movq %rax, %r15
incl %r14d
jmp 0x139f
xorl %ecx, %ecx
leaq 0x1(%rcx), %rax
cmpq $0xe, %rcx
ja 0x1401
cmpl $-0x1, (%rbx,%rcx,4)
movq %rax, %rcx
jne 0x13ee
decl %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/serverC.c
// Function: get_index
int get_index(int *vtx_set, int vtx_num, int target) {
    for(int i = 0; i < vtx_num; i++) {
        if(vtx_set[i] == target)
            return i;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, %rsi
je 0x1433
cmpl %edx, (%rdi,%rcx,4)
je 0x1431
incq %rcx
jmp 0x1422
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/serverC.c
// Function: add_edges
void add_edges(int vtx_num, float G[][vtx_num], int *vtx_set, char *edges) {
    char *end_str;
    char *token = strtok_r(edges, "\n", &end_str);
    int i = 0, j = 0;

    while (token != NULL) {
        char *end_token;
        //printf("debug: check line -- %s\n", token);
        int token_idx = 0;
        char *token2 = strtok_r(token, " ", &end_token);
        while (token2 != NULL) {
            if(token_idx == 0) {
                i = get_index(vtx_set, vtx_num, atoi(token2));
            } else if(token_idx == 1) {
                j = get_index(vtx_set, vtx_num, atoi(token2));
            } else {
                //printf("debug: assign edge (%d, %d): %f\n", i, j, atof(token2));
                // Assign the edge value twice as the graph is undirected
                G[i][j] = atof(token2);
                G[j][i] = atof(token2);
            }
            token2 = strtok_r(NULL, " ", &end_token);
            token_idx++;
        }
        token = strtok_r(NULL, "\n", &end_str);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, -0x50(%rbp)
movl %edi, %r12d
movl %edi, %eax
movq %rax, -0x40(%rbp)
leaq 0xceb(%rip), %rsi       # 0x2148
leaq -0x68(%rbp), %rdx
movq %rcx, %rdi
callq 0x10b0
movq $0x0, -0x38(%rbp)
leaq 0xdb3(%rip), %r13       # 0x222b
movl $0x0, -0x2c(%rbp)
movq %r15, -0x48(%rbp)
movl %r12d, -0x30(%rbp)
testq %rax, %rax
je 0x1589
movq %rax, %rdi
movq %r13, %rsi
leaq -0x60(%rbp), %rdx
callq 0x10b0
movq %rax, %rbx
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x1572
cmpl $0x1, %r14d
je 0x14d7
testl %r14d, %r14d
jne 0x14f1
movq %rbx, %rdi
callq 0x1120
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x1412
movq %rax, -0x38(%rbp)
jmp 0x1559
movq %rbx, %rdi
callq 0x1120
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x1412
movl %eax, -0x2c(%rbp)
jmp 0x1559
movq %rbx, %rdi
callq 0x1040
cvtsd2ss %xmm0, %xmm0
movslq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %r15
imulq %r15, %rax
movq -0x50(%rbp), %r13
leaq (,%rax,4), %rax
addq %r13, %rax
movslq -0x2c(%rbp), %r12
movss %xmm0, (%rax,%r12,4)
movq %rbx, %rdi
callq 0x1040
cvtsd2ss %xmm0, %xmm0
imulq %r15, %r12
leaq (,%r12,4), %rax
addq %r13, %rax
leaq 0xce3(%rip), %r13       # 0x222b
movl -0x30(%rbp), %r12d
movq -0x58(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x48(%rbp), %r15
xorl %edi, %edi
movq %r13, %rsi
leaq -0x60(%rbp), %rdx
callq 0x10b0
movq %rax, %rbx
incl %r14d
jmp 0x14a5
xorl %edi, %edi
leaq 0xbcd(%rip), %rsi       # 0x2148
leaq -0x68(%rbp), %rdx
callq 0x10b0
jmp 0x1487
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/serverC.c
// Function: minDistance
int minDistance(float dist[], bool sptSet[], int V) 
{ 
    // Initialize min value 
    float min = FLT_MAX, min_index; 
  
    for (int v = 0; v < V; v++) 
        if (sptSet[v] == false && dist[v] <= min) 
            min = dist[v], min_index = v; 
  
    return min_index; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
movss 0xa59(%rip), %xmm0      # 0x2004
cmpq %rax, %rdx
je 0x15cc
cmpb $0x0, (%rsi,%rax)
jne 0x15c7
movss (%rdi,%rax,4), %xmm2
ucomiss %xmm2, %xmm0
jb 0x15c7
cvtsi2ss %eax, %xmm1
movaps %xmm2, %xmm0
incq %rax
jmp 0x15ab
cvttss2si %xmm1, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/serverC.c
// Function: printSolution
int printSolution(int src, float dist[], int V, int parent[]) 
{ 
    //int src = 0; 
    printf("Vertex\t Distance\tPath"); 
    for (int i = 0; i < V; i++) 
    { 
        printf("\n%d -> %d \t\t %.2f\t\t%d", 
                      src, i, dist[i], src); 
        printPath(parent, i); 
    } 
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r14d
movq %rsi, %r15
movl %edi, %r12d
leaq 0x9e7(%rip), %rdi       # 0x200f
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x1060
testl %r14d, %r14d
cmovlel %r13d, %r14d
cmpq %r13, %r14
je 0x166b
cvtss2sd (%r15,%r13,4), %xmm0
leaq 0x9da(%rip), %rdi       # 0x2025
movl %r12d, %esi
movl %r13d, %edx
movl %r12d, %ecx
movb $0x1, %al
callq 0x1060
movq %rbx, %rdi
movl %r13d, %esi
callq 0x15d2
incq %r13
jmp 0x1639
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/serverC.c
// Function: rec_path
void rec_path(int j, int parent[], int vtx_set[], char *path) 
{ 
      
    // Base Case : If j is source 
    if (parent[j] == - 1) 
        return; 
  
    rec_path(parent[j], parent, vtx_set, path); 

    char tmp[20] = "";
    sprintf(tmp, " -- %d", vtx_set[j]);
    strcat(path, tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movslq %edi, %r12
movl (%rsi,%r12,4), %edi
cmpl $-0x1, %edi
je 0x16d2
movq %rcx, %rbx
movq %rdx, %r14
callq 0x167c
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %r15
movaps %xmm0, (%r15)
andl $0x0, 0x10(%r15)
movl (%r14,%r12,4), %edx
leaq 0x94b(%rip), %rsi       # 0x2008
movq %r15, %rdi
xorl %eax, %eax
callq 0x1140
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1130
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_05/fsize.c
// Function: main
int main(int argc, char *argv[])
{
  if (argc == 1)
  {
    fsize(".");
  }
  else
  {
    while (--argc > 0)
    {
      fsize(*++argv);
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jne 0x1239
leaq 0xe0d(%rip), %rdi       # 0x2038
callq 0x1253
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rsi, %rbx
movl %edi, %ebp
addq $0x8, %rbx
cmpl $0x2, %ebp
jl 0x1230
decl %ebp
movq (%rbx), %rdi
callq 0x1253
jmp 0x123e
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_05/fsize.c
// Function: fsize
void fsize(char *name)
{
  struct stat buffer;

  if (stat(name, &buffer) == -1)
  {
    fprintf(stderr, "fsize: cannot access %s\n", name);
    return;
  }

  if ((buffer.st_mode & S_IFMT) == S_IFDIR)
  {
    dir_walk(name, fsize);
  }

  /**
   * off_t st_size         File size, in bytes
   * dev_t st_dev          ID of device containing file
   * ino_t st_ino          File serial number
   * mode_t st_mode        Mode of file (see below)
   * nlink_t st_nlink      Number of hard links
   * uid_t st_uid          User ID of the file
   * gid_t st_gid          Group ID of the file
   * dev_t st_rdev         Device ID
   * time_t st_atime       Time of last access
   * time_t st_mtime       Last data modification time
   * time_t st_ctime       Time of last status change
   * blkcnt_t st_blocks    Blocks allocated for file
   * blksize_t st_blksize  Optimal blocksize for I/O
   */

  // Printed in a similary fashion to ls -l
  print_file_flags(buffer.st_mode);
  printf("%lu ", buffer.st_nlink);
  print_file_user(buffer.st_uid);
  print_file_group(buffer.st_gid);
  print_file_size(buffer.st_size);
  print_file_time(buffer.st_atime);
  printf("%s\n", name);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
callq 0x10d0
cmpl $-0x1, %eax
je 0x12e0
movl 0x20(%rsp), %ebp
movl %ebp, %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x128f
leaq -0x34(%rip), %rsi       # 0x1253
movq %rbx, %rdi
callq 0x1304
movl %ebp, %edi
callq 0x1409
movq 0x18(%rsp), %rsi
leaq 0xdb1(%rip), %rdi       # 0x2053
xorl %eax, %eax
callq 0x1090
movl 0x24(%rsp), %edi
callq 0x150a
movl 0x28(%rsp), %edi
callq 0x1544
movq 0x38(%rsp), %rdi
callq 0x157e
movq 0x50(%rsp), %rdi
callq 0x15fe
movq %rbx, %rdi
addq $0x98, %rsp
popq %rbx
popq %rbp
jmp 0x1050
movq 0x2d11(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd49(%rip), %rsi       # 0x203a
movq %rbx, %rdx
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_05/fsize.c
// Function: dir_walk
void dir_walk(char *dir_name, void (*func)(char *))
{
  char name[MAX_PATH_LEN];
  struct dirent *dir_entry;
  DIR *dir;

  if ((dir = opendir(dir_name)) == NULL)
  {
    fprintf(stderr, "dir_walk: cannot open %s\n", dir_name);
    return;
  }

  while ((dir_entry = readdir(dir)) != NULL)
  {
    if (strcmp(dir_entry->d_name, ".") == 0 || strcmp(dir_entry->d_name, "..") == 0)
    {
      continue; // Skip self and parent.
    }

    if (strlen(dir_name) + strlen(dir_entry->d_name) + 2 > MAX_PATH_LEN)
    {
      fprintf(stderr, "dir_walk: path too long\n");
    }
    else
    {
      sprintf(name, "%s/%s", dir_name, dir_entry->d_name);
      (*func)(name);
    }
  }

  closedir(dir);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1060
testq %rax, %rax
je 0x13dd
movq %rax, %r15
movq %rsp, %r13
movq %r15, %rdi
callq 0x10e0
testq %rax, %rax
je 0x13c3
movq %rax, %rbp
cmpb $0x2e, 0x13(%rax)
jne 0x135b
cmpb $0x0, 0x14(%rbp)
je 0x132f
cmpb $0x2e, 0x14(%rbp)
jne 0x135b
cmpb $0x0, 0x15(%rbp)
je 0x132f
addq $0x13, %rbp
movq %rbx, %rdi
callq 0x1080
movq %rax, %r12
movq %rbp, %rdi
callq 0x1080
addq %r12, %rax
addq $-0x3ff, %rax           # imm = 0xFC01
cmpq $-0x402, %rax           # imm = 0xFBFE
jbe 0x13a2
movq %r13, %rdi
leaq 0xcfe(%rip), %rsi       # 0x208b
movq %rbx, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1100
movq %r13, %rdi
callq *%r14
jmp 0x132f
movq 0x2c4f(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xcbf(%rip), %rdi       # 0x2072
pushq $0x18
popq %rsi
pushq $0x1
popq %rdx
callq 0x1110
jmp 0x132f
movq %r15, %rdi
callq 0x10b0
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2c14(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xc6a(%rip), %rsi       # 0x2058
movq %rbx, %rdx
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_05/fsize.c
// Function: print_file_flags
void print_file_flags(mode_t st_mode)
{
  printf("%c", ((st_mode & S_IFMT) == S_IFDIR) ? 'd' : '-');
  printf("%c", (st_mode & S_IRUSR) ? 'r' : '-');
  printf("%c", (st_mode & S_IWUSR) ? 'w' : '-');
  printf("%c", (st_mode & S_IXUSR) ? 'x' : '-');
  printf("%c", (st_mode & S_IRGRP) ? 'r' : '-');
  printf("%c", (st_mode & S_IWGRP) ? 'w' : '-');
  printf("%c", (st_mode & S_IXGRP) ? 'x' : '-');
  printf("%c", (st_mode & S_IROTH) ? 'r' : '-');
  printf("%c", (st_mode & S_IWOTH) ? 'w' : '-');
  printf("%c ", (st_mode & S_IXOTH) ? 'x' : '-');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebp
movl %edi, %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
pushq $0x64
popq %rdi
pushq $0x2d
popq %r15
cmovnel %r15d, %edi
callq 0x1030
btl $0x8, %ebp
pushq $0x72
popq %rbx
movl %ebx, %edi
cmovael %r15d, %edi
callq 0x1030
movd %ebp, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa 0xbbe(%rip), %xmm1      # 0x2010
pand %xmm0, %xmm1
pand 0xbc2(%rip), %xmm0      # 0x2020
pxor %xmm2, %xmm2
pcmpeqd %xmm2, %xmm0
pcmpeqd %xmm2, %xmm1
packssdw %xmm0, %xmm1
packsswb %xmm1, %xmm1
pmovmskb %xmm1, %r12d
testb $-0x80, %r12b
pushq $0x77
popq %r14
movl %r14d, %edi
cmovnel %r15d, %edi
callq 0x1030
testb $0x40, %r12b
pushq $0x78
popq %rbp
movl %ebp, %edi
cmovnel %r15d, %edi
callq 0x1030
testb $0x20, %r12b
movl %ebx, %edi
cmovnel %r15d, %edi
callq 0x1030
testb $0x10, %r12b
movl %r14d, %edi
cmovnel %r15d, %edi
callq 0x1030
testb $0x8, %r12b
movl %ebp, %edi
cmovnel %r15d, %edi
callq 0x1030
testb $0x4, %r12b
cmovnel %r15d, %ebx
movl %ebx, %edi
callq 0x1030
testb $0x2, %r12b
cmovnel %r15d, %r14d
movl %r14d, %edi
callq 0x1030
testb $0x1, %r12b
cmovnel %r15d, %ebp
leaq 0xb98(%rip), %rdi       # 0x2091
movl %ebp, %esi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_05/fsize.c
// Function: print_file_user
void print_file_user(uid_t st_uid)
{
  struct passwd *password;
  password = getpwuid(st_uid);

  if (password == NULL)
  {
    fprintf(stderr, "Error: cannot find user\n");
    return;
  }

  printf("%s ", password->pw_name);
}

// Assembly:
pushq %rax
callq 0x1070
testq %rax, %rax
je 0x1527
movq (%rax), %rsi
leaq 0xbb4(%rip), %rdi       # 0x20d3
xorl %eax, %eax
popq %rcx
jmp 0x1090
movq 0x2aca(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xb5d(%rip), %rdi       # 0x2095
pushq $0x18
popq %rsi
pushq $0x1
popq %rdx
popq %rax
jmp 0x1110
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_05/fsize.c
// Function: print_file_group
void print_file_group(gid_t st_gid)
{
  struct group *group;
  group = getgrgid(st_gid);

  if (group == NULL)
  {
    fprintf(stderr, "Error: cannot find group\n");
    return;
  }

  printf("%s ", group->gr_name);
}

// Assembly:
pushq %rax
callq 0x10a0
testq %rax, %rax
je 0x1561
movq (%rax), %rsi
leaq 0xb7a(%rip), %rdi       # 0x20d3
xorl %eax, %eax
popq %rcx
jmp 0x1090
movq 0x2a90(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xb3c(%rip), %rdi       # 0x20ae
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
popq %rax
jmp 0x1110
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_05/fsize.c
// Function: print_file_size
void print_file_size(size_t size)
{
  static const char *SIZES[] = {"B", "K", "M", "G"};
  size_t div = 0;
  size_t rem = 0;

  while (size >= 1024 && div < (sizeof SIZES / sizeof *SIZES))
  {
    rem = (size % 1024);
    div++;
    size /= 1024;
  }

  printf("%6.1f%s ", (float)size + (float)rem / 1024.0, SIZES[div]);
}

// Assembly:
leaq 0xb5f(%rip), %rax       # 0x20e4
xorl %edx, %edx
xorl %ecx, %ecx
cmpq $0x400, %rdi            # imm = 0x400
jb 0x15ad
cmpq $0x3, %rdx
ja 0x15ad
movl %edi, %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
incq %rdx
shrq $0xa, %rdi
addq $0x4, %rax
jmp 0x1589
testq %rdi, %rdi
js 0x15b9
cvtsi2ss %rdi, %xmm1
jmp 0x15ce
movq %rdi, %rdx
shrq %rdx
andl $0x1, %edi
orq %rdx, %rdi
cvtsi2ss %rdi, %xmm1
addss %xmm1, %xmm1
cvtsi2sd %rcx, %xmm0
cvtss2sd %xmm1, %xmm1
mulsd 0xa51(%rip), %xmm0      # 0x2030
addsd %xmm1, %xmm0
movslq (%rax), %rax
leaq 0xaf7(%rip), %rsi       # 0x20e4
addq %rax, %rsi
leaq 0xad7(%rip), %rdi       # 0x20ce
movb $0x1, %al
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O2/dropletzhu[P]msuite/pim_sender.c
// Function: csum
unsigned short
csum (unsigned short *buf, int nwords)
{
	unsigned long sum;
	for (sum = 0; nwords > 0; nwords--)
		sum += *buf++;
	sum = (sum >> 16) + (sum & 0xffff);
	sum += (sum >> 16);

	return ~sum;
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
jle 0x1220
movzwl (%rdi), %ecx
addq $0x2, %rdi
addq %rcx, %rax
decl %esi
jmp 0x120e
movq %rax, %rcx
shrq $0x10, %rcx
movzwl %ax, %eax
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
addl %ecx, %eax
notl %eax
retq
// File: /workspace/github_c_makefile_star2_O2/dropletzhu[P]msuite/pim_sender.c
// Function: make_pim_null_register
int make_pim_null_register()
{
	struct ip *iph;
	struct _SPimRegHdr *pim_reg_header;
	UINT2 *flags;
	char *header = datagram;

	if( has_local_source ) {
		iph = (struct ip*)(header);
		iph->ip_hl = 5;
		iph->ip_v = 4;
		iph->ip_tos = 0;
		iph->ip_len = htons(length);
		iph->ip_id = htonl(random());
		iph->ip_off = 0;
		iph->ip_ttl = 255;
		iph->ip_p = IPPROTO_PIM;
		iph->ip_sum = 0;
		iph->ip_src.s_addr = inet_addr (local_source);
		iph->ip_dst.s_addr = inet_addr (rp);

		header += sizeof(struct ip);
	}

	pim_reg_header = (struct _SPimRegHdr*)(header); 
	pim_reg_header->msgtpe = PIMSM_REGISTER_MSG;
	pim_reg_header->pimver = 2;
	pim_reg_header->nulbit = 1;
	flags = (UINT2*)(header + 4);
	*flags = htons(*flags);
	pim_reg_header->u2Checksum = csum((unsigned short*)pim_reg_header,sizeof(struct _SPimRegHdr)>>1);

	if( has_local_source ) {
		iph->ip_sum = csum((unsigned short*)iph, length>>1);
	}

	return 0;
}

// Assembly:
pushq %rbx
cmpl $0x0, 0x2e76(%rip)      # 0x40b4
je 0x12f1
movw $0x45, 0x2e73(%rip)     # 0x40c0
movzwl 0x2e44(%rip), %eax      # 0x4098
rolw $0x8, %ax
movw %ax, 0x2e63(%rip)       # 0x40c2
callq 0x10b0
bswapl %eax
movw %ax, 0x2e57(%rip)       # 0x40c4
movl $0x67ff0000, 0x2e4f(%rip) # imm = 0x67FF0000
andw $0x0, 0x2e4b(%rip)      # 0x40ca
leaq 0x12e3a(%rip), %rdi     # 0x140c0
callq 0x10a0
movl %eax, 0x2e3b(%rip)      # 0x40cc
leaq 0x12e38(%rip), %rdi     # 0x140d0
callq 0x10a0
movl %eax, 0x2e2d(%rip)      # 0x40d0
movl 0x2e0b(%rip), %ebx      # 0x40b4
movb $0x21, 0x2e24(%rip)     # 0x40d4
movl $0x4000, %eax           # imm = 0x4000
orl 0x2e1d(%rip), %eax      # 0x40d8
leaq 0x2e12(%rip), %rdi      # 0x40d4
rolw $0x8, %ax
movw %ax, 0x2e0b(%rip)       # 0x40d8
pushq $0x4
popq %rsi
callq 0x120c
movw %ax, 0x2dfa(%rip)       # 0x40d6
testl %ebx, %ebx
je 0x1327
movl 0x2db2(%rip), %esi      # 0x4098
sarl %esi
leaq 0x2ddb(%rip), %rbx      # 0x40ca
jmp 0x1318
movb $0x21, 0x2dc8(%rip)     # 0x40c0
movl $0x4000, %eax           # imm = 0x4000
orl 0x2dc1(%rip), %eax      # 0x40c4
rolw $0x8, %ax
movw %ax, 0x2db6(%rip)       # 0x40c4
leaq 0x2dad(%rip), %rbx      # 0x40c2
pushq $0x4
popq %rsi
leaq 0x2da1(%rip), %rdi      # 0x40c0
callq 0x120c
movw %ax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/dropletzhu[P]msuite/pim_sender.c
// Function: make_pim_register_stop
int make_pim_register_stop()
{
	struct ip *iph;
	struct _SPimHdr *pim_header;
	struct _SPimSmUnAlignedRegStopMsg *register_stop;
	char *header = datagram;
	in_addr_t tmp_group, tmp_source;

	if( has_local_source ) {
		iph = (struct ip*)(header);
		iph->ip_hl = 5;
		iph->ip_v = 4;
		iph->ip_tos = 0;
		iph->ip_len = htons(length);
		iph->ip_id = htonl(random());
		iph->ip_off = 0;
		iph->ip_ttl = 255;
		iph->ip_p = IPPROTO_PIM;
		iph->ip_sum = 0;
		iph->ip_src.s_addr = inet_addr (local_source);
		iph->ip_dst.s_addr = inet_addr (rp);

		header += sizeof(struct ip);
	}

	pim_header = (struct _SPimHdr*)(header);
	pim_header->msgtpe = PIMSM_REGISTER_STOP_MSG;
	pim_header->pimver = 2;
	header += sizeof(struct _SPimHdr);

	register_stop = (struct _SPimSmUnAlignedRegStopMsg*)header;
	register_stop->EncGrpAddr.u1AddrFamily = PIMSM_ADDRFMLY_IPV4;
	register_stop->EncGrpAddr.u1EncType = PIMSM_ENCTYPE_IPV4;
	tmp_group = inet_addr(mcast_group);
	memcpy(&(register_stop->EncGrpAddr.u4GrpAddr),&tmp_group,4);
	register_stop->EncUcastAddr.u1AddrFamily = PIMSM_ADDRFMLY_IPV4;
	register_stop->EncUcastAddr.u1EncType = PIMSM_ENCTYPE_IPV4;
	tmp_source = inet_addr(mcast_source);
	memcpy(&(register_stop->EncUcastAddr.u4UcastAddr),&tmp_source,4);

	pim_header->u2Checksum = csum((unsigned short*)pim_header,(sizeof(struct _SPimHdr)+sizeof(struct _SPimSmUnAlignedRegStopMsg))>>1);

	if( has_local_source ) {
		iph->ip_sum = csum((unsigned short*)iph, length>>1);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x0, 0x2bd2(%rip)      # 0x40b4
je 0x154c
movw $0x45, 0x2bd3(%rip)     # 0x40c0
movzwl 0x2ba4(%rip), %eax      # 0x4098
rolw $0x8, %ax
movw %ax, 0x2bc3(%rip)       # 0x40c2
callq 0x10b0
bswapl %eax
movw %ax, 0x2bb7(%rip)       # 0x40c4
movl $0x67ff0000, 0x2baf(%rip) # imm = 0x67FF0000
andw $0x0, 0x2bab(%rip)      # 0x40ca
leaq 0x12b9a(%rip), %rdi     # 0x140c0
callq 0x10a0
movl %eax, 0x2b9b(%rip)      # 0x40cc
leaq 0x12b98(%rip), %rdi     # 0x140d0
callq 0x10a0
movl %eax, 0x2b8d(%rip)      # 0x40d0
leaq 0x2b8a(%rip), %rbx      # 0x40d4
jmp 0x1553
leaq 0x2b6d(%rip), %rbx      # 0x40c0
movb $0x22, (%rbx)
movw $0x1, %bp
movw %bp, 0x4(%rbx)
leaq 0x12b8b(%rip), %rdi     # 0x140f0
callq 0x10a0
movl %eax, 0xc(%rbx)
movw %bp, 0x14(%rbx)
leaq 0x12b68(%rip), %rdi     # 0x140e0
callq 0x10a0
movl %eax, 0x16(%rbx)
pushq $0x12
popq %rsi
movq %rbx, %rdi
callq 0x120c
movw %ax, 0x2(%rbx)
cmpl $0x0, 0x2b1e(%rip)      # 0x40b4
je 0x15b3
movl 0x2afa(%rip), %esi      # 0x4098
sarl %esi
leaq 0x2b19(%rip), %rdi      # 0x40c0
callq 0x120c
movw %ax, 0x2b17(%rip)       # 0x40ca
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dropletzhu[P]msuite/pim_sender.c
// Function: usage
void usage()
{
	printf("Usage: ./pim_sender -i local_source -r rp -t type -s mcast_source -g mcast_group -p mcast_port -c count -l length\n");
	printf(" -i local_source    local source address\n");
	printf(" -r rp              rp address\n");
	printf(" -t type            1: null register;  2: register;  3: register-stop\n");	
	printf(" -s mcast_source    multicast payload source address\n");
	printf(" -g mcast_group     multicast payload group address\n");
	printf(" -p mcast_port      multicast payload port\n");
	printf(" -c count           the packet count, default count is unlimited\n");
	printf(" -l length          pim packet length, default is 256 bytes\n");
	printf(" Version:           %s\n", version);
}

// Assembly:
pushq %rax
leaq 0xb99(%rip), %rdi       # 0x215d
callq 0x1040
leaq 0xbff(%rip), %rdi       # 0x21cf
callq 0x1040
leaq 0xc1c(%rip), %rdi       # 0x21f8
callq 0x1040
leaq 0xc2f(%rip), %rdi       # 0x2217
callq 0x1040
leaq 0xc69(%rip), %rdi       # 0x225d
callq 0x1040
leaq 0xc92(%rip), %rdi       # 0x2292
callq 0x1040
leaq 0xcba(%rip), %rdi       # 0x22c6
callq 0x1040
leaq 0xcd9(%rip), %rdi       # 0x22f1
callq 0x1040
leaq 0xd0e(%rip), %rdi       # 0x2332
callq 0x1040
leaq 0xa1c(%rip), %rdi       # 0x204c
leaq 0xa2d(%rip), %rsi       # 0x2064
xorl %eax, %eax
popq %rcx
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/joltikneq6464v13/ref/joltik.c
// Function: set_nonce_in_tweak
static void set_nonce_in_tweak(uint8_t *tweak, const uint8_t *nonce) {
    tweak[0] =	(tweak[0]&0xf0)      ^ (nonce[0] >> 4);
    tweak[1] = ((nonce[0]&0xf) << 4) ^ (nonce[1] >> 4);
    tweak[2] = ((nonce[1]&0xf) << 4) ^ (nonce[2] >> 4);
    tweak[3] = ((nonce[2]&0xf) << 4) ^ (nonce[3] >> 4);
    tweak[4] = ((nonce[3]&0xf) << 4);
}

// Assembly:
movb (%rdi), %al
andb $-0x10, %al
movb (%rsi), %cl
shrb $0x4, %cl
orb %al, %cl
movb %cl, (%rdi)
movb (%rsi), %al
movb 0x1(%rsi), %cl
shrb $0x4, %cl
shlb $0x4, %al
orb %cl, %al
movb %al, 0x1(%rdi)
movb 0x1(%rsi), %al
movb 0x2(%rsi), %cl
shrb $0x4, %cl
shlb $0x4, %al
orb %cl, %al
movb %al, 0x2(%rdi)
movb 0x2(%rsi), %al
movb 0x3(%rsi), %cl
shrb $0x4, %cl
shlb $0x4, %al
orb %cl, %al
movb %al, 0x3(%rdi)
movb 0x3(%rsi), %al
shlb $0x4, %al
movb %al, 0x4(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_10/calculator.c
// Function: get_line
int get_line(char line[], unsigned int max_line_len)
{
  int c, i;

  for (i = 0; i < max_line_len - 1 && (c = getchar()) != EOF && c != '\n'; ++i)
  {
    line[i] = c;
  }

  if (c == '\n')
  {
    line[i] = c;
    ++i;
  }

  line[i] = '\0';

  return i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
decl %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x1477
callq 0x1080
cmpl $-0x1, %eax
je 0x1474
cmpl $0xa, %eax
je 0x1474
movb %al, (%rbx,%r15)
incq %r15
jmp 0x1457
movl %r15d, %r14d
cmpl $0xa, %eax
jne 0x1486
movl %r14d, %eax
movb $0xa, (%rbx,%rax)
incl %r14d
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_10/calculator.c
// Function: getop
int getop(char s[])
{
  int i = 0, c;

  while ((s[0] = c = line[line_i++]) == ' ' || c == '\t')
    ;

  s[1] = '\0';

  if (isalpha(c))
  {
    var = c;
    return VARGET;
  }

  if (!isdigit(c) && c != '.' && c != '-')
  {
    return c;
  }

  if (c == '-')
  {
    int next = line[line_i++];
    if (next == '\n' || next == ' ' || next == '\t' || next == '\0')
    {
      --line_i;
      return '-';
    }
    else if (!isdigit(next) && next != '.') // not a number
    {
      return next;
    }
    else
    {
      s[++i] = c = next;
    }
  }
  else
  {
    c = line[line_i++];
  }

  if (isdigit(c))
  {
    while (isdigit(s[++i] = c = line[line_i++]))
      ;
  }

  if (c == '.')
  {
    while (isdigit(s[++i] = c = line[line_i++]))
      ;
  }

  --line_i;

  return NUMBER;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2bfb(%rip), %r14      # 0x40a0
movslq 0x2be4(%rip), %rax      # 0x4090
leal 0x1(%rax), %ecx
movl %ecx, 0x2bdb(%rip)      # 0x4090
movzbl (%rax,%r14), %r15d
movb %r15b, (%rbx)
cmpl $0x9, %r15d
je 0x14a5
cmpl $0x20, %r15d
je 0x14a5
movsbq %r15b, %r12
movb $0x0, 0x1(%rbx)
callq 0x10b0
movq (%rax), %rdx
movzwl (%rdx,%r12,2), %ecx
btl $0xa, %ecx
jb 0x14ff
leal -0x2f(%r15), %esi
cmpb $-0x3, %sil
ja 0x150d
andl $0x800, %ecx            # imm = 0x800
jne 0x150d
movsbl %r15b, %ecx
jmp 0x15e1
movb %r15b, 0x2b6a(%rip)     # 0x4070
pushq $0x61
jmp 0x15e0
movslq 0x2b7c(%rip), %r9       # 0x4090
leal 0x1(%r9), %ecx
xorl %esi, %esi
movl %ecx, 0x2b70(%rip)      # 0x4090
movb (%r9,%r14), %r8b
movsbq %r8b, %rdi
movsbl %r8b, %ecx
cmpb $0x2d, %r15b
jne 0x1577
movzbl %r8b, %esi
cmpl $0x20, %esi
ja 0x155b
movl %esi, %esi
movabsq $0x100000601, %r10      # imm = 0x100000601
btq %rsi, %r10
jae 0x155b
movl %r9d, 0x2b3c(%rip)      # 0x4090
pushq $0x2d
jmp 0x15e0
cmpb $0x2e, %r8b
je 0x156d
movzwl (%rdx,%rdi,2), %edx
andl $0x800, %edx            # imm = 0x800
je 0x15e1
movb %r8b, 0x1(%rbx)
movq (%rax), %rdx
pushq $0x1
popq %rsi
testb $0x8, 0x1(%rdx,%rdi,2)
je 0x15a6
movl %esi, %esi
movq (%rax), %rdx
movslq 0x2b06(%rip), %rcx      # 0x4090
leal 0x1(%rcx), %edi
movl %edi, 0x2afd(%rip)      # 0x4090
movsbq (%rcx,%r14), %rcx
movb %cl, 0x1(%rbx,%rsi)
incq %rsi
testb $0x8, 0x1(%rdx,%rcx,2)
jne 0x1580
cmpl $0x2e, %ecx
jne 0x15d8
movl %esi, %ecx
addq %rbx, %rcx
incq %rcx
movq (%rax), %rdx
movslq 0x2ad3(%rip), %rsi      # 0x4090
leal 0x1(%rsi), %edi
movl %edi, 0x2aca(%rip)      # 0x4090
movsbq (%rsi,%r14), %rsi
movb %sil, (%rcx)
incq %rcx
testb $0x8, 0x1(%rdx,%rsi,2)
jne 0x15b3
decl 0x2ab2(%rip)            # 0x4090
pushq $0x30
popq %rcx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/aegis128l/aesnic/encrypt.c
// Function: aegis128L_ad_partial
void aegis128L_ad_partial(__m128i *state, const unsigned char *ad, unsigned long long adlen)  
{
    unsigned char plaintextblock[32], ciphertextblock[32]; 
    unsigned long long i;  
     
    for (i = 0; (i+32) <= adlen; i += 32) aegis128L_enc_aut_step(ad+i, ciphertextblock, state);  

    if ( (adlen & 0x1f) != 0 )  { 
         memset(plaintextblock, 0, 32);  
         memcpy(plaintextblock, ad+i, adlen & 0x1f);  
         aegis128L_enc_aut_step(plaintextblock, ciphertextblock, state);  
    }  
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x20
popq %r13
movq %rsp, %r12
cmpq %r14, %r13
ja 0x1509
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x1070
addq $0x20, %r15
addq $0x20, %r13
jmp 0x14ec
andq $0x1f, %r14
je 0x1545
pushq $0x20
popq %rdx
subq %r14, %rdx
leaq (%rsp,%r14), %rdi
addq $0x20, %rdi
xorl %esi, %esi
callq 0x1030
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x10e0
movq %rsp, %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x1070
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/aegis128l/aesnic/encrypt.c
// Function: aegis128L_enc_partial
void aegis128L_enc_partial(__m128i *state, const unsigned char *m, unsigned long long mlen, unsigned char* c)  
{
    unsigned char plaintextblock[32], ciphertextblock[32];  
    unsigned long long i;  
     
    for (i = 0; (i+32) <= mlen; i += 32) aegis128L_enc_aut_step(m+i, c+i, state);  

    if ( (mlen & 0x1f) != 0 )  {
         memset(plaintextblock, 0, 32);    
         memcpy(plaintextblock, m + i, mlen & 0x1f);    
         aegis128L_enc_aut_step(plaintextblock, ciphertextblock, state);
         memcpy(c+i,ciphertextblock,mlen & 0x1f); 
    }  
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
pushq $0x20
popq %r13
cmpq %rbx, %r13
ja 0x1591
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1070
addq $0x20, %r14
addq $0x20, %r12
addq $0x20, %r13
jmp 0x1570
andq $0x1f, %rbx
je 0x15da
pushq $0x20
popq %rdx
subq %rbx, %rdx
leaq (%rsp,%rbx), %rdi
xorl %esi, %esi
callq 0x1030
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x10e0
leaq 0x20(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1070
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x10e0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/aegis128l/aesnic/encrypt.c
// Function: aegis128L_dec_partial
void aegis128L_dec_partial(__m128i *state, unsigned char *m, unsigned long long mlen, const unsigned char *c)  
{
    unsigned char plaintextblock[32], ciphertextblock[32];  
    unsigned long long i;  
     
    for (i = 0; (i+32) <= mlen; i += 32) aegis128L_dec_aut_step(m+i, c+i, state);  

    if (  (mlen & 0x1f) != 0 )  {
        memset(ciphertextblock, 0, 32);
        memcpy(ciphertextblock, c+i, mlen & 0x1f);
        aegis128L_dec_aut_step(plaintextblock, ciphertextblock, state);
        memcpy(m+i, plaintextblock, mlen & 0x1f);

        //need to modify the state here (because in the last block, keystream is wrongly used to update the state)
        memset(plaintextblock, 0, mlen & 0x1f);
        state[0] = _mm_xor_si128( state[0], _mm_load_si128((__m128i*)plaintextblock)  ) ;
        state[4] = _mm_xor_si128( state[4], _mm_load_si128((__m128i*)(plaintextblock+16) )  ) ;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x20
popq %r13
cmpq %r14, %r13
ja 0x1626
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x10c0
addq $0x20, %r15
addq $0x20, %r12
addq $0x20, %r13
jmp 0x1605
andq $0x1f, %r14
je 0x169b
pushq $0x20
popq %rdx
subq %r14, %rdx
leaq (%rsp,%r14), %rdi
xorl %esi, %esi
callq 0x1030
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x10e0
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x10c0
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x10e0
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1030
vmovaps (%r12), %xmm0
vxorps (%rbx), %xmm0, %xmm0
vmovaps %xmm0, (%rbx)
vmovaps 0x10(%r12), %xmm0
vxorps 0x40(%rbx), %xmm0, %xmm0
vmovaps %xmm0, 0x40(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: tmpfile_close
static void tmpfile_close(FILE **f, char **nam)
{
if(f)
        {
        if(*f) { fclose(*f); *f = NULL; }
        }

if(nam)
        {
        if(*nam)
                {
                unlink(*nam);
                free(*nam);
                *nam = NULL;
                }
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x3834
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3834
callq 0x2110
andq $0x0, (%r14)
testq %rbx, %rbx
je 0x3852
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3852
callq 0x2080
movq (%rbx), %rdi
callq 0x2050
andq $0x0, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterFseeko
static int fstWriterFseeko(struct fstWriterContext *xc, FILE *stream, off_t offset, int whence)
{
int rc = fseeko(stream, offset, whence);

if(rc<0)
        {
        xc->fseek_failed = 1;
#ifdef FST_DEBUG
        fprintf(stderr, FST_APIMESS "Seek to #%" PRId64 " (whence = %d) failed!\n", offset, whence);
        perror("Why");
#endif
        }

return(rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x2320
testl %eax, %eax
jns 0x423d
orb $0x1, 0x12c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterEmitTimeChange
void fstWriterEmitTimeChange(void *ctx, uint64_t tim)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
unsigned int i;
int skip = 0;
if(xc)
        {
        if(FST_UNLIKELY(xc->is_initial_time))
                {
                if(xc->size_limit_locked)       /* this resets xc->is_initial_time to one */
                        {
                        return;
                        }

                if(!xc->valpos_mem)
                        {
                        fstWriterCreateMmaps(xc);
                        }

                skip = 1;

                xc->firsttime = (xc->vc_emitted) ? 0: tim;
                xc->curtime = 0;
                xc->vchg_mem[0] = '!';
                xc->vchg_siz = 1;
                fstWriterEmitSectionHeader(xc);
                for(i=0;i<xc->maxhandle;i++)
                        {
                        xc->valpos_mem[4*i+2] = 0; /* zero out offset val */
                        xc->valpos_mem[4*i+3] = 0; /* zero out last time change val */
                        }
                xc->is_initial_time = 0;
                }
                else
                {
                if((xc->vchg_siz >= xc->fst_break_size) || (xc->flush_context_pending))
                        {
                        xc->flush_context_pending = 0;
                        fstWriterFlushContextPrivate(xc);
                        xc->tchn_cnt++;
                        fstWriterVarint(xc->tchn_handle, xc->curtime);
                        }
                }

        if(!skip)
                {
                xc->tchn_idx++;
                }
        fstWriterVarint(xc->tchn_handle, tim - xc->curtime);
        xc->tchn_cnt++;
        xc->curtime = tim;
        }
}

// Assembly:
testq %rdi, %rdi
je 0x42df
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb 0x74(%rdi), %al
testb $0x2, %al
jne 0x42e0
movl 0xa0(%r14), %eax
cmpq %rax, 0x100(%r14)
seta %cl
movb 0xe9(%r14), %al
testb $0x20, %al
sete %dl
testb %dl, %cl
jne 0x42ad
andb $-0x21, %al
movb %al, 0xe9(%r14)
movq %r14, %rdi
callq 0x44e8
incl 0x88(%r14)
movq 0x28(%r14), %rdi
movq 0x90(%r14), %rsi
callq 0x5060
incl 0x8c(%r14)
movq 0x28(%r14), %rdi
movq %rbx, %rsi
subq 0x90(%r14), %rsi
callq 0x5060
incl 0x88(%r14)
movq %rbx, 0x90(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testb $0x8, 0xe9(%r14)
jne 0x42d5
cmpq $0x0, 0x40(%r14)
jne 0x42fd
movq %r14, %rdi
callq 0x5ff1
movb 0x74(%r14), %al
xorl %r15d, %r15d
testb $0x1, %al
movl $0x0, %eax
cmoveq %rbx, %rax
movq %rax, 0x98(%r14)
andq $0x0, 0x90(%r14)
movq 0x30(%r14), %rax
movb $0x21, (%rax)
movl $0x1, 0xa0(%r14)
movq %r14, %rdi
callq 0x65fc
pushq $0x3
popq %rax
movl 0x68(%r14), %ecx
cmpq %rcx, %r15
jae 0x4359
movq 0x40(%r14), %rcx
leal -0x1(%rax), %edx
andl $0x0, (%rcx,%rdx,4)
movl %eax, %edx
andl $0x0, (%rcx,%rdx,4)
incq %r15
addl $0x4, %eax
jmp 0x4337
andb $-0x3, 0x74(%r14)
jmp 0x42b4
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterUint64
static int fstWriterUint64(FILE *handle, uint64_t v)
{
unsigned char buf[8];
int i;

for(i=7;i>=0;i--)
        {
        buf[i] = v & 0xff;
        v >>= 8;
        }

fstFwrite(buf, 8, 1, handle);
return(8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, %rcx
pushq $0x7
popq %rax
testl %eax, %eax
js 0x504b
movl %eax, %edx
movb %sil, -0x8(%rbp,%rdx)
shrq $0x8, %rsi
decl %eax
jmp 0x5038
leaq -0x8(%rbp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2390
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterVarint
static int fstWriterVarint(FILE *handle, uint64_t v)
{
uint64_t nxt;
unsigned char buf[10]; /* ceil(64/7) = 10 */
unsigned char *pnt = buf;
int len;

while((nxt = v>>7))
        {
        *(pnt++) = ((unsigned char)v) | 0x80;
        v = nxt;
        }
*(pnt++) = (unsigned char)v;

len = pnt-buf;
fstFwrite(buf, len, 1, handle);
return(len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rcx
pushq $0x1
popq %rbx
cmpq $0x80, %rsi
jb 0x5090
movq %rsi, %rax
shrq $0x7, %rax
orb $-0x80, %sil
movb %sil, -0x13(%rbp,%rbx)
incq %rbx
movq %rax, %rsi
jmp 0x506f
movb %sil, -0x13(%rbp,%rbx)
leaq -0x12(%rbp), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rsi
callq 0x2390
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: JenkinsFree
void JenkinsFree(void *base_i, uint32_t hashmask)
{
struct collchain_t ***base = (struct collchain_t ***)base_i;
uint32_t h;
struct collchain_t **ar;
struct collchain_t *chain, *chain_next;

if(base && *base)
        {
        ar = *base;
        for(h=0;h<=hashmask;h++)
                {
                chain = ar[h];
                while(chain)
                        {
                        chain_next = chain->next;
                        free(chain);
                        chain = chain_next;
                        }
                }

        free(*base);
        *base = NULL;
        }
}

// Assembly:
testq %rdi, %rdi
je 0x510e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r15
testq %r15, %r15
je 0x5100
movl %esi, %r14d
xorl %r12d, %r12d
cmpl %r14d, %r12d
ja 0x50f4
movl %r12d, %eax
movq (%r15,%rax,8), %rdi
testq %rdi, %rdi
je 0x50ef
movq (%rdi), %r13
callq 0x2050
movq %r13, %rdi
jmp 0x50dd
incl %r12d
jmp 0x50d1
movq (%rbx), %rdi
callq 0x2050
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetDate
void fstWriterSetDate(void *ctx, const char *dat)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
        {
        char s[FST_HDR_DATE_SIZE];
        off_t fpos = ftello(xc->handle);
        int len = strlen(dat);

        fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_DATE, SEEK_SET);
        memset(s, 0, FST_HDR_DATE_SIZE);
        memcpy(s, dat, (len < FST_HDR_DATE_SIZE) ? len : FST_HDR_DATE_SIZE);
        fstFwrite(s, FST_HDR_DATE_SIZE, 1, xc->handle);
        fflush(xc->handle);
        fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
        }
}

// Assembly:
testq %rdi, %rdi
je 0x51d9
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movq %r15, %rdi
callq 0x2130
movq %rax, %r12
movq (%rbx), %rsi
movl $0xca, %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x421c
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %r13
movaps %xmm0, 0x60(%r13)
movaps %xmm0, 0x50(%r13)
movaps %xmm0, 0x40(%r13)
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x20(%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
andq $0x0, 0x6f(%r13)
cmpl $0x77, %r12d
pushq $0x77
popq %rax
cmovll %r12d, %eax
movslq %eax, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2240
movq (%rbx), %rcx
pushq $0x77
popq %rsi
pushq $0x1
popq %rdx
movq %r13, %rdi
callq 0x2390
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x421c
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetVersion
void fstWriterSetVersion(void *ctx, const char *vers)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc && vers)
        {
        char s[FST_HDR_SIM_VERSION_SIZE];
        off_t fpos = ftello(xc->handle);
        int len = strlen(vers);

        fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_SIM_VERSION, SEEK_SET);
        memset(s, 0, FST_HDR_SIM_VERSION_SIZE);
        memcpy(s, vers, (len < FST_HDR_SIM_VERSION_SIZE) ? len : FST_HDR_SIM_VERSION_SIZE);
        fstFwrite(s, FST_HDR_SIM_VERSION_SIZE, 1, xc->handle);
        fflush(xc->handle);
        fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
        }
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x52b6
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movq %r15, %rdi
callq 0x2130
movq %rax, %r12
movq (%rbx), %rsi
pushq $0x4a
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x421c
xorps %xmm0, %xmm0
leaq -0xb0(%rbp), %r13
movaps %xmm0, 0x70(%r13)
movaps %xmm0, 0x60(%r13)
movaps %xmm0, 0x50(%r13)
movaps %xmm0, 0x40(%r13)
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x20(%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
movl $0x80, %eax
cmpl %eax, %r12d
cmovll %r12d, %eax
movslq %eax, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2240
movq (%rbx), %rcx
pushq $0x1
popq %rdx
movl $0x80, %esi
movq %r13, %rdi
callq 0x2390
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x421c
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetFileType
void fstWriterSetFileType(void *ctx, enum fstFileType filetype)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
        {
        if(/*(filetype >= FST_FT_MIN) &&*/ (filetype <= FST_FT_MAX))
                {
                off_t fpos = ftello(xc->handle);

                xc->filetype = filetype;

                fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_FILETYPE, SEEK_SET);
                fputc(xc->filetype, xc->handle);
                fflush(xc->handle);
                fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
                }
        }
}

// Assembly:
testq %rdi, %rdi
sete %al
cmpl $0x3, %esi
setae %cl
orb %al, %cl
jne 0x532c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movb %r15b, 0xe8(%rbx)
movq (%rbx), %rsi
movl $0x141, %edx            # imm = 0x141
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x421c
movzbl 0xe8(%rbx), %edi
movq (%rbx), %rsi
callq 0x21c0
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x421c
retq