LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_14/sort.c
// Function: main
int main(int argc, char *argv[])
{
  if (!parse_arg_list(argc, argv))
  {
    puts("Error: invalid arguments.");
    return EXIT_FAILURE;
  }

  size_t nr_of_lines;
  char *line_ptr[MAX_NR_OF_LINES];

  if ((nr_of_lines = read_lines(line_ptr, MAX_NR_OF_LINES)) != -1)
  {
    quick_sort((void **)line_ptr, 0, nr_of_lines - 1, (int (*)(void *, void *))comp);
    write_lines(line_ptr, nr_of_lines);
  }
  else
  {
    puts("Error: input too large.");
    return EXIT_FAILURE;
  }

  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9c60, %rsp           # imm = 0x9C60
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1290
cmpl $0x0, %eax
jne 0x120f
leaq 0xe03(%rip), %rdi       # 0x2004
callq 0x1040
movl $0x1, -0x4(%rbp)
jmp 0x1277
leaq -0x9c60(%rbp), %rdi
movl $0x1388, %esi           # imm = 0x1388
callq 0x1380
movq %rax, -0x18(%rbp)
cmpq $-0x1, %rax
je 0x125b
leaq -0x9c60(%rbp), %rdi
movq -0x18(%rbp), %rdx
subq $0x1, %rdx
movq 0x2e20(%rip), %rcx      # 0x4060
xorl %eax, %eax
movl %eax, %esi
callq 0x1450
leaq -0x9c60(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1550
jmp 0x1270
leaq 0xdbc(%rip), %rdi       # 0x201e
callq 0x1040
movl $0x1, -0x4(%rbp)
jmp 0x1277
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x9c60, %rsp           # imm = 0x9C60
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_14/sort.c
// Function: parse_arg_list
int parse_arg_list(int argc, char *argv[])
{
  for (int i = 1; i < argc; ++i)
  {
    size_t arg_len = strlen(argv[i]);
    if (arg_len > 1 && argv[i][0] == '-')
    {
      for (size_t j = 1; j < arg_len; ++j)
      {
        switch (argv[i][j])
        {
        case 'n':
          comp = numcmp;
          break;

        case 'r':
          order = -1;
          break;

        default:
          return 0;
          break;
        }
      }
    }
    else
    {
      return 0;
    }
  }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1370
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1060
movq %rax, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jbe 0x1357
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1357
movq $0x1, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1355
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
subl $0x6e, %eax
je 0x1320
jmp 0x1316
movl -0x2c(%rbp), %eax
subl $0x72, %eax
je 0x1330
jmp 0x133c
leaq 0x289(%rip), %rax       # 0x15b0
movq %rax, 0x2d32(%rip)      # 0x4060
jmp 0x1345
movl $0xffffffff, 0x2d1e(%rip) # imm = 0xFFFFFFFF
jmp 0x1345
movl $0x0, -0x4(%rbp)
jmp 0x1377
jmp 0x1347
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x12ee
jmp 0x1360
movl $0x0, -0x4(%rbp)
jmp 0x1377
jmp 0x1362
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x12a6
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_14/sort.c
// Function: read_lines
size_t read_lines(char *line_ptr[], const size_t max_nr_of_lines)
{
  size_t line_length;
  size_t nr_of_lines = 0;

  char *current_line = alloc(MAX_LINE_LEN);
  char *current_line_copy = NULL;

  while ((line_length = get_line(current_line, MAX_LINE_LEN)))
  {
    if (nr_of_lines >= max_nr_of_lines || (current_line_copy = alloc(line_length)) == NULL)
    {
      return -1;
    }
    else
    {
      current_line[line_length - 1] = '\0';
      strcpy(current_line_copy, current_line);
      line_ptr[nr_of_lines++] = current_line_copy;
    }
  }

  afree(current_line);

  return nr_of_lines;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x16f0
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x1630
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x1427
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x13e3
movq -0x20(%rbp), %rdi
callq 0x16f0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x13ed
movq $-0x1, -0x8(%rbp)
jmp 0x1438
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1030
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x28(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x13ae
movq -0x30(%rbp), %rdi
callq 0x1750
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_14/sort.c
// Function: quick_sort
void quick_sort(void *v[], size_t start, size_t end, int (*comp)(void *, void *))
{
  if ((long)start >= (long)end)
  {
    return;
  }

  swap(v, start, (start + end) / 2);

  size_t last = start;
  for (size_t i = start + 1; i <= end; ++i)
  {
    if ((*comp)(v[i], v[start]) < 0)
    {
      swap(v, ++last, i);
    }
  }

  swap(v, start, last);
  quick_sort(v, start, last - 1, comp);
  quick_sort(v, last + 1, end, comp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jl 0x1477
jmp 0x153c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq -0x18(%rbp), %rdx
shrq %rdx
callq 0x1790
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x14f9
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
callq *%rax
cmpl $0x0, %eax
jge 0x14e9
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x1, %rsi
movq %rsi, -0x28(%rbp)
movq -0x30(%rbp), %rdx
callq 0x1790
jmp 0x14eb
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x14a3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1790
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
subq $0x1, %rdx
movq -0x20(%rbp), %rcx
callq 0x1450
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x1, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x1450
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_14/sort.c
// Function: numcmp
int numcmp(const char *s1, const char *s2)
{
  double nr1 = atof(s1);
  double nr2 = atof(s2);

  if (nr1 < nr2)
  {
    return order * -1;
  }
  else if (nr1 > nr2)
  {
    return order * 1;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1050
movsd %xmm0, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1050
movsd %xmm0, -0x28(%rbp)
movsd -0x20(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x15f8
imull $-0x1, 0x2a65(%rip), %eax # 0x4058
movl %eax, -0x4(%rbp)
jmp 0x161b
movsd -0x20(%rbp), %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x1612
movl 0x2a4e(%rip), %eax      # 0x4058
shll $0x0, %eax
movl %eax, -0x4(%rbp)
jmp 0x161b
jmp 0x1614
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_14/sort.c
// Function: alloc
char *alloc(size_t size)
{
  if (alloc_buf + ALLOC_SIZE - alloc_p >= size)
  {
    alloc_p += size;
    return alloc_p - size;
  }

  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq 0x2969(%rip), %rcx      # 0x4068
leaq 0x297a(%rip), %rax      # 0x4080
addq $0x2710, %rax           # imm = 0x2710
subq %rcx, %rax
cmpq -0x10(%rbp), %rax
jb 0x173d
movq -0x10(%rbp), %rax
addq 0x2948(%rip), %rax      # 0x4068
movq %rax, 0x2941(%rip)      # 0x4068
movq 0x293a(%rip), %rax      # 0x4068
xorl %ecx, %ecx
subq -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x1745
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ryuichiueda[P]glueutils/src/ign12.c
// Function: usage
void usage(void){
	fputs("ign2: erase stderr\n", stderr);
	fputs("usage: ign2 <command> [args]\n", stderr);
	fputs("\nCopyright (C) 2021 Ryuichi Ueda\n", stderr);
	fputs("Released under the MIT License.\n", stderr);
	fputs("https://github.com/ryuichiueda/glueutils\n", stderr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x2e2d(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xe2f(%rip), %rdi       # 0x2004
callq 0x1060
movq 0x2e17(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xe2d(%rip), %rdi       # 0x2018
callq 0x1060
movq 0x2e01(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xe35(%rip), %rdi       # 0x2036
callq 0x1060
movq 0x2deb(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xe41(%rip), %rdi       # 0x2058
callq 0x1060
movq 0x2dd5(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xe4c(%rip), %rdi       # 0x2079
callq 0x1060
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ryuichiueda[P]glueutils/src/ign12.c
// Function: tryopen
int tryopen(char *filename){
	int fd = open(filename, O_WRONLY);
	if(fd < 0){
		printf("Error: %s: %s\n", filename, strerror(errno));
		exit(1);
	}

	return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
movb $0x0, %al
callq 0x1080
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x12f8
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x10b0
movq -0x18(%rbp), %rsi
movq %rax, %rdx
leaq 0xdc7(%rip), %rdi       # 0x20ae
movb $0x0, %al
callq 0x1050
movl $0x1, %edi
callq 0x10a0
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ryuichiueda[P]glueutils/src/ign12.c
// Function: main
int main(int argc, char * argv[])
{
	if(argc < 2){
		usage();
		exit(1);
	}

	int fd = tryopen("/dev/null");
	trydup2(1, fd);
	trydup2(2, fd);

	return - execvp(argv[1], &argv[1]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x133b
callq 0x11c0
movl $0x1, %edi
callq 0x10a0
leaq 0xd7b(%rip), %rdi       # 0x20bd
callq 0x12a0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
movl $0x1, %edi
callq 0x1240
movl -0x14(%rbp), %esi
movl $0x2, %edi
callq 0x1240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x1090
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl-morsestrobo.c
// Function: lock
static int lock(void) {
	int fd;
	
	/* if the file exists, fail. otherwise, create it */
	fd = open(LOCKFILE, O_CREAT | O_EXCL | O_WRONLY, 0644);
	if(fd < 0)
		return 1;
	
	/* close it again, we only want the file to exist */
	close(fd);
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xddc(%rip), %rdi       # 0x20ab
movl $0xc1, %esi
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x10c0
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jge 0x12f2
movl $0x1, -0x4(%rbp)
jmp 0x1301
movl -0x8(%rbp), %edi
callq 0x1090
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl-morsestrobo.c
// Function: install_signal_handler
static void install_signal_handler(void) {
	struct sigaction sa;
	
	sa.sa_handler = restore_status_and_exit;
	sa.sa_flags = 0;
	sigemptyset(&sa.sa_mask);
	if((sigaction(SIGINT, &sa, NULL) == -1)
	|| (sigaction(SIGTERM, &sa, NULL) == -1))
		fputs("Cannot install signal handler! "
				"The initial light-status will not be saved!\n", stderr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x7e(%rip), %rax        # 0x13a0
movq %rax, -0x98(%rbp)
movl $0x0, -0x10(%rbp)
leaq -0x98(%rbp), %rdi
addq $0x8, %rdi
callq 0x10b0
movl $0x2, %edi
leaq -0x98(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1050
cmpl $-0x1, %eax
je 0x1374
movl $0xf, %edi
leaq -0x98(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1050
cmpl $-0x1, %eax
jne 0x138a
movq 0x2c7d(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xcd3(%rip), %rdi       # 0x2058
callq 0x1080
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl-morsestrobo.c
// Function: restore_status_and_exit
static void restore_status_and_exit(int s) {
	(void) s;
	
	if(initial_status == TL_ON)
		tl_on();
	else
		tl_off();
	
	tl_deinit();
	unlock();
	exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x1, 0x2ce6(%rip)      # 0x4098
jne 0x13bb
callq 0x1490
jmp 0x13c0
callq 0x14e0
callq 0x1460
callq 0x13e0
xorl %edi, %edi
callq 0x10e0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl_init.c
// Function: tl_init
int tl_init(void) {
	light_fd = open(LIGHT_PATH, O_RDWR);
	if(light_fd < 0)
		return 1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xca1(%rip), %rdi       # 0x20c0
movl $0x2, %esi
movb $0x0, %al
callq 0x10c0
movl %eax, 0x2c5f(%rip)      # 0x4090
cmpl $0x0, 0x2c58(%rip)      # 0x4090
jge 0x1443
movl $0x1, -0x4(%rbp)
jmp 0x144a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl_deinit.c
// Function: tl_deinit
void tl_deinit(void) {
	if(light_fd < 0)
		return;
	
	close(light_fd);
	light_fd = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2c25(%rip), %rax      # 0x4090
cmpl $0x0, (%rax)
jge 0x1472
jmp 0x148d
leaq 0x2c17(%rip), %rax      # 0x4090
movl (%rax), %edi
callq 0x1090
leaq 0x2c09(%rip), %rax      # 0x4090
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl_on.c
// Function: tl_on
void tl_on(void) {
	if(light_fd < 0)
		return;
	
	lseek(light_fd, 0, SEEK_SET);
	write(light_fd, ON_MESSAGE, sizeof(ON_MESSAGE) - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2bf5(%rip), %rax      # 0x4090
cmpl $0x0, (%rax)
jge 0x14a2
jmp 0x14d0
leaq 0x2be7(%rip), %rax      # 0x4090
movl (%rax), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1070
leaq 0x2bd3(%rip), %rax      # 0x4090
movl (%rax), %edi
leaq 0xc28(%rip), %rsi       # 0x20ee
movl $0x3, %edx
callq 0x1060
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl_off.c
// Function: tl_off
void tl_off(void) {
	if(light_fd < 0)
		return;
	
	lseek(light_fd, 0, SEEK_SET);
	write(light_fd, OFF_MESSAGE, sizeof(OFF_MESSAGE) - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2ba5(%rip), %rax      # 0x4090
cmpl $0x0, (%rax)
jge 0x14f2
jmp 0x1520
leaq 0x2b97(%rip), %rax      # 0x4090
movl (%rax), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1070
leaq 0x2b83(%rip), %rax      # 0x4090
movl (%rax), %edi
leaq 0xbdc(%rip), %rsi       # 0x20f2
movl $0x1, %edx
callq 0x1060
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl_status.c
// Function: tl_status
int tl_status(void) {
#ifdef PROC_LEGACY
	char buf[sizeof("status:\t\tof") - 1];
	char n_or_f;
#else
	char buf[sizeof("0")];
#endif
	
	if(light_fd < 0)
		return TL_UNDEF;
	
	lseek(light_fd, 0, SEEK_SET);
	
	if(read(light_fd, buf, sizeof(buf)) != sizeof(buf))
		return TL_UNDEF;
	
#ifdef PROC_LEGACY
	/* we only look if the char which should be
	after the 'o' is an 'n' or an 'f'. */
	n_or_f = buf[sizeof(buf) - 1];
	if(n_or_f == 'n')
		return TL_ON;
	else if(n_or_f == 'f')
		return TL_OFF;
	else
		return TL_UNDEF;
#else
	/* we look for 0, which means off or something else, which means on */
	if(buf[0] == '0')
		return TL_OFF;
	else
		return TL_ON;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x2b51(%rip), %rax      # 0x4090
cmpl $0x0, (%rax)
jge 0x154d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x15a0
leaq 0x2b3c(%rip), %rax      # 0x4090
movl (%rax), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1070
leaq 0x2b28(%rip), %rax      # 0x4090
movl (%rax), %edi
leaq -0x6(%rbp), %rsi
movl $0x2, %edx
callq 0x10a0
cmpq $0x2, %rax
je 0x1587
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x15a0
movsbl -0x6(%rbp), %eax
cmpl $0x30, %eax
jne 0x1599
movl $0x0, -0x4(%rbp)
jmp 0x15a0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/timocramer[P]thinklight-fun/tl_toggle.c
// Function: tl_toggle
void tl_toggle(void) {
	int status = tl_status();
	
	if(status == TL_OFF)
		tl_on();
	else if(status == TL_ON)
		tl_off();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x1530
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x15cd
callq 0x1490
jmp 0x15da
cmpl $0x1, -0x4(%rbp)
jne 0x15d8
callq 0x14e0
jmp 0x15da
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/vanhauser-thc[P]vulntest/hardcoded_password.c
// Function: getpass_r
char *getpass_r(const char *prompt) {
  struct termios oflags, nflags;
  char password[64] = {'\0'};
  char *ret = NULL;

  /* Disabling echo */
  if (tcgetattr(fileno(stdin), &oflags))
    return NULL;

  nflags = oflags;
  nflags.c_lflag &= ~ECHO;
  nflags.c_lflag |= ECHONL;

  if (tcsetattr(fileno(stdin), TCSAFLUSH, &nflags))
    return NULL;

  /* Read the password */
  fprintf(stderr, "%s", prompt);
  ret = fgets(password, sizeof(password), stdin);

  /* Restore echo */
  if (tcsetattr(fileno(stdin), TCSAFLUSH, &oflags)) {
    my_memset_s(password, 0, sizeof(password));
    return NULL;
  }

  if (ret) {
    strtok(password, "\n");
    ret = strdup(password);
    my_memset_s(password, 0, sizeof(password));
  }

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x1060
movq $0x0, -0xd8(%rbp)
movq 0x2d54(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x10b0
movl %eax, %edi
leaq -0x4c(%rbp), %rsi
callq 0x10c0
cmpl $0x0, %eax
je 0x12a9
movq $0x0, -0x8(%rbp)
jmp 0x13d1
leaq -0x88(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
movl $0x3c, %edx
callq 0x10a0
movl -0x7c(%rbp), %eax
andl $-0x9, %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
orl $0x40, %eax
movl %eax, -0x7c(%rbp)
movq 0x2d01(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x10b0
movl %eax, %edi
movl $0x2, %esi
leaq -0x88(%rbp), %rdx
callq 0x10d0
cmpl $0x0, %eax
je 0x1304
movq $0x0, -0x8(%rbp)
jmp 0x13d1
movq 0x2ced(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xceb(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x1090
leaq -0xd0(%rbp), %rdi
movq 0x2caa(%rip), %rax      # 0x3fd8
movq (%rax), %rdx
movl $0x40, %esi
callq 0x1070
movq %rax, -0xd8(%rbp)
movq 0x2c8f(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x10b0
movl %eax, %edi
movl $0x2, %esi
leaq -0x4c(%rbp), %rdx
callq 0x10d0
cmpl $0x0, %eax
je 0x1383
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x1200
movq $0x0, -0x8(%rbp)
jmp 0x13d1
cmpq $0x0, -0xd8(%rbp)
je 0x13c6
leaq -0xd0(%rbp), %rdi
leaq 0xc9b(%rip), %rsi       # 0x2036
callq 0x10e0
leaq -0xd0(%rbp), %rdi
callq 0x10f0
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x1200
movq -0xd8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/vanhauser-thc[P]vulntest/hardcoded_password.c
// Function: main
int main(int argc, char *argv[]) {
  int attempts = 0;
  char *password;

  while (attempts++ < 3 && !loggedin) {
    password = getpass_r("Password: ");

    if (password != NULL) {
      if (strcmp(password, "0xDEADBEEF") == 0) {
        loggedin = true;
        printf("Logged in\n");
      } else
        printf("Wrong password\n");

      my_memset_s(password, 0, strlen(password));
      free(password);
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x3, %ecx
movb %al, -0x21(%rbp)
jge 0x141d
movb 0x2c79(%rip), %al       # 0x4091
xorb $-0x1, %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x1426
jmp 0x14a4
leaq 0xbda(%rip), %rdi       # 0x2007
callq 0x1250
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x149f
movq -0x20(%rbp), %rdi
leaq 0xbca(%rip), %rsi       # 0x2012
callq 0x1080
cmpl $0x0, %eax
jne 0x1469
movb $0x1, 0x2c38(%rip)      # 0x4091
leaq 0xbbd(%rip), %rdi       # 0x201d
movb $0x0, %al
callq 0x1050
jmp 0x1477
leaq 0xbb8(%rip), %rdi       # 0x2028
movb $0x0, %al
callq 0x1050
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1040
movq -0x30(%rbp), %rdi
movq %rax, %rdx
xorl %esi, %esi
callq 0x1200
movq -0x20(%rbp), %rdi
callq 0x1030
jmp 0x13fd
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test-vcf-api.c
// Function: error
void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) error(const char *format, ...)
{
    va_list ap;
    va_start(ap, format);
    vfprintf(stderr, format, ap);
    va_end(ap);
    if (strrchr(format, '\n') == NULL) fputc('\n', stderr);
    exit(-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x5b15
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0x125471(%rip), %rax    # 0x12afd8
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x4690
leaq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x4510
cmpq $0x0, %rax
jne 0x5ba3
movq 0x125442(%rip), %rax    # 0x12afd8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x4630
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x45d0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test-vcf-api.c
// Function: check_alleles
static int check_alleles(bcf1_t *rec, const char **alleles, int num) {
    int i;
    if (rec->n_allele !=  num) {
        fprintf(stderr, "Wrong number of alleles - expected %d, got %d\n",
                num, rec->n_allele);
        return -1;
    }
    if (bcf_unpack(rec, BCF_UN_STR) != 0)
        return -1;
    for (i = 0; i < num; i++) {
        if (0 != strcmp(alleles[i], rec->d.allele[i])) {
            fprintf(stderr,
                    "Mismatch for allele %d : expected '%s' got '%s'\n",
                    i, alleles[i], rec->d.allele[i]);
            return -1;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpl -0x1c(%rbp), %eax
je 0x7235
movq 0x123dd7(%rip), %rax    # 0x12afd8
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, %ecx
leaq 0x1012e9(%rip), %rsi    # 0x10850b
movb $0x0, %al
callq 0x4700
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x72e9
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4b190
cmpl $0x0, %eax
je 0x7254
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x72e9
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x72e2
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x46c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x72d2
movq 0x123d42(%rip), %rax    # 0x12afd8
movq (%rax), %rdi
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x20(%rbp), %rsi
movq (%rax,%rsi,8), %r8
leaq 0x101278(%rip), %rsi    # 0x10853a
movb $0x0, %al
callq 0x4700
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x72e9
jmp 0x72d4
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x725b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test-vcf-api.c
// Function: iterator
void iterator(const char *fname)
{
    htsFile *fp = hts_open(fname, "r");
    if (!fp) error("Failed to open \"%s\" : %s", fname, strerror(errno));
    bcf_hdr_t *hdr = bcf_hdr_read(fp);
    if (!hdr) error("bcf_hdr_read : %s", strerror(errno));
    hts_idx_t *idx;
    hts_itr_t *iter;

    bcf_index_build(fname, 0);
    idx = bcf_index_load(fname);

    iter = bcf_itr_queryi(idx, bcf_hdr_name2id(hdr, "20"), 1110600, 1110800);
    bcf_itr_destroy(iter);

    iter = bcf_itr_querys(idx, hdr, "20:1110600-1110800");
    bcf_itr_destroy(iter);

    hts_idx_destroy(idx);
    bcf_hdr_destroy(hdr);
    int ret;
    if ( (ret=hts_close(fp)) )
    {
        fprintf(stderr,"hts_close(%s): non-zero status %d\n",fname,ret);
        exit(ret);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x103bb3(%rip), %rsi    # 0x10b79a
callq 0xcf30
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7c20
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x4050
movl (%rax), %edi
callq 0x4120
movq -0x38(%rbp), %rsi
movq %rax, %rdx
leaq 0xfe406(%rip), %rdi     # 0x10601f
movb $0x0, %al
callq 0x5ae0
movq -0x10(%rbp), %rdi
callq 0x43030
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x7c51
callq 0x4050
movl (%rax), %edi
callq 0x4120
movq %rax, %rsi
leaq 0xffa84(%rip), %rdi     # 0x1076ce
movb $0x0, %al
callq 0x5ae0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x4dd10
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x17890
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xff59f(%rip), %rsi     # 0x10721d
callq 0x6e10
movq -0x40(%rbp), %rdi
movl %eax, %esi
movl $0x10f248, %edx         # imm = 0x10F248
movl $0x10f310, %ecx         # imm = 0x10F310
leaq 0x3d826(%rip), %r8      # 0x454c0
callq 0x12be0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x138b0
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rcx
leaq 0xffdad(%rip), %rsi     # 0x107a68
leaq -0xeb2(%rip), %rdx      # 0x6e10
leaq 0xaf17(%rip), %r8       # 0x12be0
leaq 0x3d7f0(%rip), %r9      # 0x454c0
callq 0x15d00
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x138b0
movq -0x20(%rbp), %rdi
callq 0xf340
movq -0x18(%rbp), %rdi
callq 0x42dd0
movq -0x10(%rbp), %rdi
callq 0xf050
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x7d2c
movq 0x1232cc(%rip), %rax    # 0x12afd8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
movl -0x2c(%rbp), %ecx
leaq 0xff98b(%rip), %rsi     # 0x1076a8
movb $0x0, %al
callq 0x4700
movl -0x2c(%rbp), %edi
callq 0x45d0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test-vcf-api.c
// Function: check_format_values
void check_format_values(const char *fname)
{
    htsFile *fp = hts_open(fname, "r");
    bcf_hdr_t *hdr = bcf_hdr_read(fp);
    bcf1_t *line = bcf_init();

    while (bcf_read(fp, hdr, line) == 0)
    {
        float *values = 0;
        int count = 0;
        int ret = bcf_get_format_float(hdr, line, "TF", &values, &count);

        // NOTE the return value from bcf_get_format_float is different from
        // bcf_get_info_float in the sense that vector-end markers also count.
        if (ret != 4 ||
            count < ret ||
            !bcf_float_is_missing(values[0]) ||
            values[1] != 47.11f ||
            !bcf_float_is_vector_end(values[2]) ||
            !bcf_float_is_vector_end(values[3]))
        {
            fprintf(stderr, "bcf_get_format_float didn't produce the expected output.\n");
            exit(-1);
        }

        free(values);
    }

    bcf_destroy(line);
    bcf_hdr_destroy(hdr);
    hts_close(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x1034c3(%rip), %rsi    # 0x10b79a
callq 0xcf30
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x43030
movq %rax, -0x18(%rbp)
callq 0x43c30
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x44620
cmpl $0x0, %eax
jne 0x83d2
movq $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xff918(%rip), %rdx     # 0x107c46
leaq -0x28(%rbp), %rcx
leaq -0x2c(%rbp), %r8
movl $0x2, %r9d
callq 0x53bb0
movl %eax, -0x30(%rbp)
cmpl $0x4, -0x30(%rbp)
jne 0x83a2
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jl 0x83a2
movq -0x28(%rbp), %rax
movss (%rax), %xmm0
callq 0x8010
cmpl $0x0, %eax
je 0x83a2
movq -0x28(%rbp), %rax
movss 0x4(%rax), %xmm0
movss 0xfdca3(%rip), %xmm1    # 0x106018
ucomiss %xmm1, %xmm0
jne 0x83a2
jp 0x83a2
movq -0x28(%rbp), %rax
movss 0x8(%rax), %xmm0
callq 0x8400
cmpl $0x0, %eax
je 0x83a2
movq -0x28(%rbp), %rax
movss 0xc(%rax), %xmm0
callq 0x8400
cmpl $0x0, %eax
jne 0x83c4
movq 0x122c2f(%rip), %rax    # 0x12afd8
movq (%rax), %rdi
leaq 0xff8c9(%rip), %rsi     # 0x107c7c
movb $0x0, %al
callq 0x4700
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x45d0
movq -0x28(%rbp), %rdi
callq 0x45a0
jmp 0x82f6
movq -0x20(%rbp), %rdi
callq 0x44020
movq -0x18(%rbp), %rdi
callq 0x42dd0
movq -0x10(%rbp), %rdi
callq 0xf050
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test-vcf-api.c
// Function: main
int main(int argc, char **argv)
{
    char *fname = argc>1 ? argv[1] : "rmme.bcf";

    // format test. quiet unless there's a failure
    test_get_format_values(fname);

    // main test. writes to stdout
    write_bcf(fname);
    bcf_to_vcf(fname);
    iterator(fname);

    // additional tests. quiet unless there's a failure.
    test_get_info_values(fname);
    test_invalid_end_tag();
    test_open_format();
    test_rlen_values();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x906a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x9077
leaq 0xff1d5(%rip), %rax     # 0x108246
movq %rax, -0x20(%rbp)
jmp 0x9077
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8430
movq -0x18(%rbp), %rdi
callq 0x5bb0
movq -0x18(%rbp), %rdi
callq 0x7320
movq -0x18(%rbp), %rdi
callq 0x7bd0
movq -0x18(%rbp), %rdi
callq 0x7d40
callq 0x8460
callq 0x8690
callq 0x88b0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_Initialize
void KeccakP1600_Initialize(void *state)
{
    memset(state, 0, 200);
#ifdef KeccakP1600_useLaneComplementing
    ((UINT64*)state)[ 1] = ~(UINT64)0;
    ((UINT64*)state)[ 2] = ~(UINT64)0;
    ((UINT64*)state)[ 8] = ~(UINT64)0;
    ((UINT64*)state)[12] = ~(UINT64)0;
    ((UINT64*)state)[17] = ~(UINT64)0;
    ((UINT64*)state)[20] = ~(UINT64)0;
#endif
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rdi
xorl %esi, %esi
movl $0xc8, %edx
callq 0x5080
movq (%rsp), %rax
movq $-0x1, 0x8(%rax)
movq (%rsp), %rax
movq $-0x1, 0x10(%rax)
movq (%rsp), %rax
movq $-0x1, 0x40(%rax)
movq (%rsp), %rax
movq $-0x1, 0x60(%rax)
movq (%rsp), %rax
movq $-0x1, 0x88(%rax)
movq (%rsp), %rax
movq $-0x1, 0xa0(%rax)
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_AddBytesInLane
void KeccakP1600_AddBytesInLane(void *state, unsigned int lanePosition, const unsigned char *data, unsigned int offset, unsigned int length)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
    UINT64 lane;
    if (length == 0)
        return;
    if (length == 1)
        lane = data[0];
    else {
        lane = 0;
        memcpy(&lane, data, length);
    }
    lane <<= offset*8;
#else
    UINT64 lane = 0;
    unsigned int i;
    for(i=0; i<length; i++)
        lane |= ((UINT64)data[i]) << ((i+offset)*8);
#endif
    ((UINT64*)state)[lanePosition] ^= lane;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl %r8d, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jne 0x5884
jmp 0x58dd
cmpl $0x1, 0x8(%rsp)
jne 0x5899
movq 0x10(%rsp), %rax
movzbl (%rax), %eax
movq %rax, (%rsp)
jmp 0x58b4
movq $0x0, (%rsp)
movq 0x10(%rsp), %rsi
movl 0x8(%rsp), %eax
movl %eax, %edx
movq %rsp, %rdi
callq 0x56b0
movl 0xc(%rsp), %ecx
shll $0x3, %ecx
movq (%rsp), %rax
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, (%rsp)
movq (%rsp), %rdx
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
xorq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_OverwriteBytesInLane
void KeccakP1600_OverwriteBytesInLane(void *state, unsigned int lanePosition, const unsigned char *data, unsigned int offset, unsigned int length)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
#ifdef KeccakP1600_useLaneComplementing
    if ((lanePosition == 1) || (lanePosition == 2) || (lanePosition == 8) || (lanePosition == 12) || (lanePosition == 17) || (lanePosition == 20)) {
        unsigned int i;
        for(i=0; i<length; i++)
            ((unsigned char*)state)[lanePosition*8+offset+i] = ~data[i];
    }
    else
#endif
    {
        memcpy((unsigned char*)state+lanePosition*8+offset, data, length);
    }
#else
#error "Not yet implemented"
#endif
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl %r8d, 0x8(%rsp)
cmpl $0x1, 0x1c(%rsp)
je 0x5d25
cmpl $0x2, 0x1c(%rsp)
je 0x5d25
cmpl $0x8, 0x1c(%rsp)
je 0x5d25
cmpl $0xc, 0x1c(%rsp)
je 0x5d25
cmpl $0x11, 0x1c(%rsp)
je 0x5d25
cmpl $0x14, 0x1c(%rsp)
jne 0x5d71
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x8(%rsp), %eax
jae 0x5d6f
movq 0x10(%rsp), %rax
movl 0x4(%rsp), %ecx
movzbl (%rax,%rcx), %eax
xorl $-0x1, %eax
movb %al, %dl
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
shll $0x3, %ecx
addl 0xc(%rsp), %ecx
addl 0x4(%rsp), %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x5d2d
jmp 0x5d99
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %eax
shll $0x3, %eax
movl %eax, %eax
addq %rax, %rdi
movl 0xc(%rsp), %eax
addq %rax, %rdi
movq 0x10(%rsp), %rsi
movl 0x8(%rsp), %eax
movl %eax, %edx
callq 0x56b0
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_OverwriteLanes
void KeccakP1600_OverwriteLanes(void *state, const unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
#ifdef KeccakP1600_useLaneComplementing
    unsigned int lanePosition;

    for(lanePosition=0; lanePosition<laneCount; lanePosition++)
        if ((lanePosition == 1) || (lanePosition == 2) || (lanePosition == 8) || (lanePosition == 12) || (lanePosition == 17) || (lanePosition == 20))
            ((UINT64*)state)[lanePosition] = ~((const UINT64*)data)[lanePosition];
        else
            ((UINT64*)state)[lanePosition] = ((const UINT64*)data)[lanePosition];
#else
    memcpy(state, data, laneCount*8);
#endif
#else
#error "Not yet implemented"
#endif
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movl %edx, -0x14(%rsp)
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
cmpl -0x14(%rsp), %eax
jae 0x5e33
cmpl $0x1, -0x18(%rsp)
je 0x5dea
cmpl $0x2, -0x18(%rsp)
je 0x5dea
cmpl $0x8, -0x18(%rsp)
je 0x5dea
cmpl $0xc, -0x18(%rsp)
je 0x5dea
cmpl $0x11, -0x18(%rsp)
je 0x5dea
cmpl $0x14, -0x18(%rsp)
jne 0x5e0a
movq -0x10(%rsp), %rax
movl -0x18(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
xorq $-0x1, %rdx
movq -0x8(%rsp), %rax
movl -0x18(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x5e24
movq -0x10(%rsp), %rax
movl -0x18(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rsp), %rax
movl -0x18(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x5e26
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x5db6
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_OverwriteWithZeroes
void KeccakP1600_OverwriteWithZeroes(void *state, unsigned int byteCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
#ifdef KeccakP1600_useLaneComplementing
    unsigned int lanePosition;

    for(lanePosition=0; lanePosition<byteCount/8; lanePosition++)
        if ((lanePosition == 1) || (lanePosition == 2) || (lanePosition == 8) || (lanePosition == 12) || (lanePosition == 17) || (lanePosition == 20))
            ((UINT64*)state)[lanePosition] = ~0;
        else
            ((UINT64*)state)[lanePosition] = 0;
    if (byteCount%8 != 0) {
        lanePosition = byteCount/8;
        if ((lanePosition == 1) || (lanePosition == 2) || (lanePosition == 8) || (lanePosition == 12) || (lanePosition == 17) || (lanePosition == 20))
            memset((unsigned char*)state+lanePosition*8, 0xFF, byteCount%8);
        else
            memset((unsigned char*)state+lanePosition*8, 0, byteCount%8);
    }
#else
    memset(state, 0, byteCount);
#endif
#else
#error "Not yet implemented"
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl 0xc(%rsp), %ecx
shrl $0x3, %ecx
cmpl %ecx, %eax
jae 0x5fd1
cmpl $0x1, 0x8(%rsp)
je 0x5f9e
cmpl $0x2, 0x8(%rsp)
je 0x5f9e
cmpl $0x8, 0x8(%rsp)
je 0x5f9e
cmpl $0xc, 0x8(%rsp)
je 0x5f9e
cmpl $0x11, 0x8(%rsp)
je 0x5f9e
cmpl $0x14, 0x8(%rsp)
jne 0x5fb1
movq 0x10(%rsp), %rax
movl 0x8(%rsp), %ecx
movq $-0x1, (%rax,%rcx,8)
jmp 0x5fc2
movq 0x10(%rsp), %rax
movl 0x8(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
jmp 0x5fc4
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x5f65
movl 0xc(%rsp), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0x6063
movl 0xc(%rsp), %eax
shrl $0x3, %eax
movl %eax, 0x8(%rsp)
cmpl $0x1, 0x8(%rsp)
je 0x6016
cmpl $0x2, 0x8(%rsp)
je 0x6016
cmpl $0x8, 0x8(%rsp)
je 0x6016
cmpl $0xc, 0x8(%rsp)
je 0x6016
cmpl $0x11, 0x8(%rsp)
je 0x6016
cmpl $0x14, 0x8(%rsp)
jne 0x603e
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %eax
shll $0x3, %eax
movl %eax, %eax
addq %rax, %rdi
movl 0xc(%rsp), %eax
andl $0x7, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xff, %esi
callq 0x5080
jmp 0x6061
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %eax
shll $0x3, %eax
movl %eax, %eax
addq %rax, %rdi
movl 0xc(%rsp), %eax
andl $0x7, %eax
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x5080
jmp 0x6063
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_ExtractLanes
void KeccakP1600_ExtractLanes(const void *state, unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
    memcpy(data, state, laneCount*8);
#else
    unsigned int i;

    for(i=0; i<laneCount; i++)
        fromWordToBytes(data+(i*8), ((const UINT64*)state)[i]);
#endif
#ifdef KeccakP1600_useLaneComplementing
    if (laneCount > 1) {
        ((UINT64*)data)[ 1] = ~((UINT64*)data)[ 1];
        if (laneCount > 2) {
            ((UINT64*)data)[ 2] = ~((UINT64*)data)[ 2];
            if (laneCount > 8) {
                ((UINT64*)data)[ 8] = ~((UINT64*)data)[ 8];
                if (laneCount > 12) {
                    ((UINT64*)data)[12] = ~((UINT64*)data)[12];
                    if (laneCount > 17) {
                        ((UINT64*)data)[17] = ~((UINT64*)data)[17];
                        if (laneCount > 20) {
                            ((UINT64*)data)[20] = ~((UINT64*)data)[20];
                        }
                    }
                }
            }
        }
    }
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x4(%rsp), %eax
shll $0x3, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x56b0
cmpl $0x1, 0x4(%rsp)
jbe 0x1f348
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rcx
xorq $-0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
cmpl $0x2, 0x4(%rsp)
jbe 0x1f346
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
xorq $-0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpl $0x8, 0x4(%rsp)
jbe 0x1f344
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rcx
xorq $-0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x40(%rax)
cmpl $0xc, 0x4(%rsp)
jbe 0x1f342
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rcx
xorq $-0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x60(%rax)
cmpl $0x11, 0x4(%rsp)
jbe 0x1f340
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rcx
xorq $-0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x88(%rax)
cmpl $0x14, 0x4(%rsp)
jbe 0x1f33e
movq 0x8(%rsp), %rax
movq 0xa0(%rax), %rcx
xorq $-0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0xa0(%rax)
jmp 0x1f340
jmp 0x1f342
jmp 0x1f344
jmp 0x1f346
jmp 0x1f348
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_ExtractAndAddBytesInLane
void KeccakP1600_ExtractAndAddBytesInLane(const void *state, unsigned int lanePosition, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
{
    UINT64 lane = ((UINT64*)state)[lanePosition];
#ifdef KeccakP1600_useLaneComplementing
    if ((lanePosition == 1) || (lanePosition == 2) || (lanePosition == 8) || (lanePosition == 12) || (lanePosition == 17) || (lanePosition == 20))
        lane = ~lane;
#endif
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
    {
        unsigned int i;
        UINT64 lane1[1];
        lane1[0] = lane;
        for(i=0; i<length; i++)
            output[i] = input[i] ^ ((UINT8*)lane1)[offset+i];
    }
#else
    unsigned int i;
    lane >>= offset*8;
    for(i=0; i<length; i++) {
        output[i] = input[i] ^ (lane & 0xFF);
        lane >>= 8;
    }
#endif
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movl %r8d, -0x24(%rsp)
movl %r9d, -0x28(%rsp)
movq -0x8(%rsp), %rax
movl -0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
cmpl $0x1, -0xc(%rsp)
je 0x1f4b9
cmpl $0x2, -0xc(%rsp)
je 0x1f4b9
cmpl $0x8, -0xc(%rsp)
je 0x1f4b9
cmpl $0xc, -0xc(%rsp)
je 0x1f4b9
cmpl $0x11, -0xc(%rsp)
je 0x1f4b9
cmpl $0x14, -0xc(%rsp)
jne 0x1f4c7
movq -0x30(%rsp), %rax
xorq $-0x1, %rax
movq %rax, -0x30(%rsp)
movq -0x30(%rsp), %rax
movq %rax, -0x40(%rsp)
movl $0x0, -0x34(%rsp)
movl -0x34(%rsp), %eax
cmpl -0x28(%rsp), %eax
jae 0x1f51c
movq -0x18(%rsp), %rax
movl -0x34(%rsp), %ecx
movzbl (%rax,%rcx), %eax
movl -0x24(%rsp), %ecx
addl -0x34(%rsp), %ecx
movl %ecx, %ecx
movzbl -0x40(%rsp,%rcx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x20(%rsp), %rax
movl -0x34(%rsp), %ecx
movb %dl, (%rax,%rcx)
movl -0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rsp)
jmp 0x1f4d9
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/generic64lc/KeccakP-1600-opt64.c
// Function: KeccakP1600_ExtractAndAddLanes
void KeccakP1600_ExtractAndAddLanes(const void *state, const unsigned char *input, unsigned char *output, unsigned int laneCount)
{
    unsigned int i;
#if (PLATFORM_BYTE_ORDER != IS_LITTLE_ENDIAN)
    unsigned char temp[8];
    unsigned int j;
#endif

    for(i=0; i<laneCount; i++) {
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
        ((UINT64*)output)[i] = ((UINT64*)input)[i] ^ ((const UINT64*)state)[i];
#else
        fromWordToBytes(temp, ((const UINT64*)state)[i]);
        for(j=0; j<8; j++)
            output[i*8+j] = input[i*8+j] ^ temp[j];
#endif
    }
#ifdef KeccakP1600_useLaneComplementing
    if (laneCount > 1) {
        ((UINT64*)output)[ 1] = ~((UINT64*)output)[ 1];
        if (laneCount > 2) {
            ((UINT64*)output)[ 2] = ~((UINT64*)output)[ 2];
            if (laneCount > 8) {
                ((UINT64*)output)[ 8] = ~((UINT64*)output)[ 8];
                if (laneCount > 12) {
                    ((UINT64*)output)[12] = ~((UINT64*)output)[12];
                    if (laneCount > 17) {
                        ((UINT64*)output)[17] = ~((UINT64*)output)[17];
                        if (laneCount > 20) {
                            ((UINT64*)output)[20] = ~((UINT64*)output)[20];
                        }
                    }
                }
            }
        }
    }
#endif
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movl $0x0, -0x20(%rsp)
movl -0x20(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jae 0x1f579
movq -0x10(%rsp), %rax
movl -0x20(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rsp), %rax
movl -0x20(%rsp), %ecx
xorq (%rax,%rcx,8), %rdx
movq -0x18(%rsp), %rax
movl -0x20(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x1f53b
cmpl $0x1, -0x1c(%rsp)
jbe 0x1f645
movq -0x18(%rsp), %rax
movq 0x8(%rax), %rcx
xorq $-0x1, %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
cmpl $0x2, -0x1c(%rsp)
jbe 0x1f643
movq -0x18(%rsp), %rax
movq 0x10(%rax), %rcx
xorq $-0x1, %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpl $0x8, -0x1c(%rsp)
jbe 0x1f641
movq -0x18(%rsp), %rax
movq 0x40(%rax), %rcx
xorq $-0x1, %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x40(%rax)
cmpl $0xc, -0x1c(%rsp)
jbe 0x1f63f
movq -0x18(%rsp), %rax
movq 0x60(%rax), %rcx
xorq $-0x1, %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x60(%rax)
cmpl $0x11, -0x1c(%rsp)
jbe 0x1f63d
movq -0x18(%rsp), %rax
movq 0x88(%rax), %rcx
xorq $-0x1, %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x88(%rax)
cmpl $0x14, -0x1c(%rsp)
jbe 0x1f63b
movq -0x18(%rsp), %rax
movq 0xa0(%rax), %rcx
xorq $-0x1, %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0xa0(%rax)
jmp 0x1f63d
jmp 0x1f63f
jmp 0x1f641
jmp 0x1f643
jmp 0x1f645
retq
nopw %cs:(%rax,%rax)