LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/sfeed_atom.c
// Function: main
int
main(int argc, char *argv[])
{
	FILE *fp;
	char *name;
	int i;

	if (argc == 1) {
		if (pledge("stdio", NULL) == -1)
			err(1, "pledge");
	} else {
		if (pledge("stdio rpath", NULL) == -1)
			err(1, "pledge");
	}

	fputs("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
	      "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:lang=\"en\">\n",
	      stdout);

	if (argc == 1) {
		printfeed(stdin, "");
	} else {
		for (i = 1; i < argc; i++) {
			if (!(fp = fopen(argv[i], "r")))
				err(1, "fopen: %s", argv[i]);
			name = ((name = strrchr(argv[i], '/'))) ? name + 1 : argv[i];
			printfeed(fp, name);
			if (ferror(fp))
				err(1, "ferror: %s", argv[i]);
			fclose(fp);
		}
	}

	fputs("</feed>\n", stdout);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movq 0x2cf5(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
leaq 0xd17(%rip), %rdi       # 0x2004
callq 0x10c0
cmpl $0x1, %ebp
jne 0x1334
movq 0x2ce2(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
leaq 0xd5c(%rip), %rsi       # 0x2064
callq 0x13b9
movq 0x2cc4(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
leaq 0xd5e(%rip), %rdi       # 0x207c
callq 0x10c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %ebp, %r14
pushq $0x1
popq %r13
pushq $0x2f
popq %rbp
cmpq %r14, %r13
jge 0x130d
movq (%rbx,%r13,8), %rdi
leaq 0xd17(%rip), %rsi       # 0x2065
callq 0x1180
movq (%rbx,%r13,8), %r12
testq %rax, %rax
je 0x1395
movq %rax, %r15
movq %r12, %rdi
movl %ebp, %esi
callq 0x10b0
leaq 0x1(%rax), %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %r15, %rdi
callq 0x13b9
movq %r15, %rdi
callq 0x1060
testl %eax, %eax
jne 0x13a4
movq %r15, %rdi
callq 0x1070
incq %r13
jmp 0x133e
leaq 0xccb(%rip), %rsi       # 0x2067
pushq $0x1
popq %rdi
movq %r12, %rdx
jmp 0x13b2
movq (%rbx,%r13,8), %rdx
leaq 0xcc2(%rip), %rsi       # 0x2071
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/trylock.c
// Function: counter_thread
void *counter_thread(void *arg)
{
	int spin;

	(void)arg;

	while (time(NULL) < end_time)
	{
		pthread_mutex_lock(&mutex);
		for (spin = 0; spin < SPIN; spin++)
			counter++;
		pthread_mutex_unlock(&mutex);
		sleep(1);
	}
	return NULL;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x2eb2(%rip), %rbx      # 0x4078
pushq $0x1
popq %rbp
xorl %edi, %edi
callq 0x1060
cmpq 0x2ec9(%rip), %rax      # 0x40a0
jge 0x11fd
movq %rbx, %rdi
callq 0x10b0
addq $0x989680, 0x2ebc(%rip) # imm = 0x989680
movq %rbx, %rdi
callq 0x1070
movl %ebp, %edi
callq 0x10a0
jmp 0x11c9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/trylock.c
// Function: monitor_thread
void *monitor_thread(void *arg)
{
	int status;

	(void)arg;

	while (time(NULL) < end_time)
	{
		sleep(3);
		status = pthread_mutex_trylock(&mutex);
		if (status != EBUSY)
		{
			printf("Counter is %ld\n", counter/SPIN);
			pthread_mutex_unlock(&mutex);
		}
		else
			puts("(missed)");
	}
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq $0x3
popq %rbx
leaq 0x2e5f(%rip), %r14      # 0x4078
leaq 0xdf4(%rip), %r15       # 0x2014
movl $0x989680, %r13d        # imm = 0x989680
leaq 0xdd7(%rip), %r12       # 0x2004
xorl %edi, %edi
callq 0x1060
cmpq 0x2e65(%rip), %rax      # 0x40a0
jge 0x127e
movl %ebx, %edi
callq 0x10a0
movq %r14, %rdi
callq 0x1050
cmpl $0x10, %eax
jne 0x125b
movq %r15, %rdi
callq 0x1030
jmp 0x122d
movq 0x2e46(%rip), %rax      # 0x40a8
cqto
idivq %r13
movq %r12, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
movq %r14, %rdi
callq 0x1070
jmp 0x122d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/trylock.c
// Function: main
int main(void)
{
	pthread_t counter_thread_id, monitor_thread_id;

	end_time = time(NULL) + 60;
	pthread_create(&counter_thread_id, NULL, counter_thread, NULL);
	pthread_create(&monitor_thread_id, NULL, monitor_thread, NULL);

	pthread_join(counter_thread_id, NULL);
	pthread_join(monitor_thread_id, NULL);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorl %edi, %edi
callq 0x1060
addq $0x3c, %rax
movq %rax, 0x2dfd(%rip)      # 0x40a0
leaq -0xee(%rip), %rdx       # 0x11bc
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x1080
leaq -0xbc(%rip), %rdx       # 0x1206
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x1080
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x1090
movq (%r14), %rdi
xorl %esi, %esi
callq 0x1090
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/vanhauser-thc[P]vulntest/bof.c
// Function: main
int main(int argc, char *argv[]) {
  FILE *f;
  char line[64], *data;
  int size;

  if (argc < 3)
    return -1;

  if ((f = fopen(argv[1], "r")) == NULL)
    return -1;

  if (fgets(line, sizeof(line), f) == NULL)
    return -1;

  size = atoi(line);

  if ((data = malloc(size)) == NULL)
    return -1;

  fread(data, 1, 1024, f);
  data[1023] = 0;

  printf("Data: %s\n", data);

  fclose(f);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
pushq $-0x1
popq %rbx
cmpl $0x3, %edi
jl 0x1226
movq 0x8(%rsi), %rdi
leaq 0xe4c(%rip), %rsi       # 0x2004
callq 0x1080
testq %rax, %rax
je 0x1226
movq %rax, %r14
movq %rsp, %rdi
pushq $0x40
popq %rsi
movq %rax, %rdx
callq 0x1060
testq %rax, %rax
je 0x1226
movq %rsp, %rdi
callq 0x1090
movslq %eax, %rdi
callq 0x1070
testq %rax, %rax
je 0x1226
movq %rax, %r15
pushq $0x1
popq %rsi
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
movq %r14, %rcx
callq 0x1030
movb $0x0, 0x3ff(%r15)
leaq 0xdf4(%rip), %rdi       # 0x2006
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
callq 0x1040
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/marcespie[P]unix-samples/chapter1/fork3.c
// Function: main
int
main()
{

	for (int i = 15; i < 35; i += 2) {
		int pid = fork();
		switch(pid) {
		case -1: 
			err(1, "fork");
		case 0:
			perform_computation(i);
			exit(0);
		}
	}

	// parent
	int rc = 0; // by default we succeed

	// XXX don't do that! this is example code.
	// Here we catch all children, remember that wait is a
	// "destructive" call, it gives you the status of one
	// deceased child, and removes all traces from the system.
	// If you have *other* children in other parts of your code
	// using wait means you *will* get any child that's dead.
	// (there's zero guarantee that you get the deceased in
	// any order at all).

	// there are several solutions
	// - have a central hub where you register all your children
	// and somehow demultiplex any status to the correct part of
	// the code (algorithmic)
	// - use waitpid NOHANG on each child you want (doesn't scale
	// with more than a few processes
	// - put processes into their own groups and use a pgrp
	int status, r;
	while ((r = wait(&status)) != -1)
		if (bad_status(status))
			rc = 1;
	// this normally exits with ECHILD, when we reaped every child
	if (errno != ECHILD)
		err(1, "wait");

	exit(rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
pushq $0xf
popq %rbx
cmpl $0x23, %ebx
jae 0x126b
callq 0x10a0
testl %eax, %eax
je 0x12a3
cmpl $-0x1, %eax
je 0x12b1
addl $0x2, %ebx
jmp 0x1253
xorl %ebx, %ebx
leaq 0xc(%rsp), %r14
pushq $0x1
popq %rbp
movq %r14, %rdi
callq 0x1090
cmpl $-0x1, %eax
je 0x1292
movl 0xc(%rsp), %edi
callq 0x11c4
testb %al, %al
cmovnel %ebp, %ebx
jmp 0x1275
callq 0x1030
cmpl $0xa, (%rax)
jne 0x12ba
movl %ebx, %edi
callq 0x1080
movl %ebx, %edi
callq 0x11ac
xorl %edi, %edi
callq 0x1080
leaq 0xdbc(%rip), %rsi       # 0x2074
jmp 0x12c1
leaq 0xdb8(%rip), %rsi       # 0x2079
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1060
// File: /workspace/github_c_makefile_star2_O2/lacework-dev[P]strace_lab_PUBLIC/./src/example_2.c
// Function: main
int main(int argc, char *argv[])
{
	
	char password[] = "secret123\n";

	for (int i = 0; i < 7; i+=1) {
		fork();

		char fout[10];
		strcpy(fout, &password[i]);

		char *fname = (char *)malloc(100);
		srand(31337);
		sprintf(fname, "/tmp/%d.log", ( getpid() ^ rand()));

		FILE *fd = fopen(fname, "a+");
		fputs(fout, fd);

		free(fname);
		fclose(fd);
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq -0x32(%rbp), %rbx
leaq 0xe23(%rip), %r12       # 0x201b
xorl %r15d, %r15d
cmpq $0x7, %r15
je 0x1287
callq 0x10c0
leaq 0xdf3(%rip), %rax       # 0x2004
leaq (%rax,%r15), %rsi
movq %rbx, %rdi
callq 0x1040
pushq $0x64
popq %rdi
callq 0x1090
movq %rax, %r13
movl $0x7a69, %edi           # imm = 0x7A69
callq 0x1080
callq 0x1050
movl %eax, %r14d
callq 0x10d0
xorl %eax, %r14d
movq %r13, %rdi
leaq 0xdc3(%rip), %rsi       # 0x200f
movl %r14d, %edx
xorl %eax, %eax
callq 0x10b0
movq %r13, %rdi
movq %r12, %rsi
callq 0x10a0
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1070
movq %r13, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1060
incq %r15
jmp 0x11fb
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.7/pipe.c
// Function: writer
void writer(const char *message, int count, FILE *stream)
{
    for (; count > 0; --count)
    {
        /* Write the message to the stream, and send it off immediately.  */
        fprintf(stream, "%s\n", message);
        fflush(stream);
        /* Snooze a while. */
        sleep(1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
leaq 0xe0a(%rip), %r12       # 0x2004
pushq $0x1
popq %r13
testl %r14d, %r14d
jle 0x1228
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
callq 0x10a0
movl %r13d, %edi
callq 0x10c0
decl %r14d
jmp 0x11fe
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/YanjieZe[P]CacheLab/test-trans.c
// Function: usage
void usage(char *argv[]){
    printf("Usage: %s [-h] -M <rows> -N <cols>\n", argv[0]);
    printf("Options:\n");
    printf("  -h          Print this help message.\n");
    printf("  -M <rows>   Number of matrix rows (max %d)\n", MAXN);
    printf("  -N <cols>   Number of  matrix columns (max %d)\n", MAXN);
    printf("Example: %s -M 8 -N 8\n", argv[0]);       
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0x4c2c(%rip), %rdi      # 0x628c
xorl %eax, %eax
callq 0x1070
leaq 0x4d9a(%rip), %rdi      # 0x6408
callq 0x1040
leaq 0x4d97(%rip), %rdi      # 0x6411
callq 0x1040
leaq 0x4c2a(%rip), %rdi      # 0x62b0
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x1070
leaq 0x4c45(%rip), %rdi      # 0x62de
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x1070
movq (%rbx), %rsi
leaq 0x4c61(%rip), %rdi      # 0x6310
xorl %eax, %eax
popq %rbx
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O2/YanjieZe[P]CacheLab/test-trans.c
// Function: sigsegv_handler
void sigsegv_handler(int signum){
    printf("Error: Segmentation Fault.\n");
    printf("TEST_TRANS_RESULTS=0:0\n");
    fflush(stdout);
    exit(1);
}

// Assembly:
pushq %rax
leaq 0x4d79(%rip), %rdi      # 0x6438
callq 0x1040
leaq 0x4dde(%rip), %rdi      # 0x64a9
callq 0x1040
movq 0x68f9(%rip), %rax      # 0x7fd0
movq (%rax), %rdi
callq 0x1110
pushq $0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/YanjieZe[P]CacheLab/test-trans.c
// Function: sigalrm_handler
void sigalrm_handler(int signum){
    printf("Error: Program timed out.\n");
    printf("TEST_TRANS_RESULTS=0:0\n");
    fflush(stdout);
    exit(1);
}

// Assembly:
pushq %rax
leaq 0x4d64(%rip), %rdi      # 0x6453
callq 0x1040
leaq 0x4dae(%rip), %rdi      # 0x64a9
callq 0x1040
movq 0x68c9(%rip), %rax      # 0x7fd0
movq (%rax), %rdi
callq 0x1110
pushq $0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/icarroll[P]clunk/playthud.c
// Function: main
int main(int numargs, char * args[])
{
    struct thudboard * board = & board_data;
    struct move * move = & move_data;

    int memuse = 1024 * 1024 * (numargs > 1 ? strtol(args[1], NULL, 10)
                                            : sizeof(struct tableentry));

    setupgame(board, memuse);

    int c = toupper(getchar());

    if (getchar() != '\n') exit(EXIT_FAILURE);

    if (c == 'T') goto troll;
    else if (c != 'D') exit(EXIT_FAILURE);

    while (true)
    {
        * move = iterdeepen(board, SEARCHSECS);
        showmove(move);
        domoveupdatecapts(board, move);

troll:
        * move = getmove();
        if (! legalmove(board, move)) exit(EXIT_FAILURE);
        domoveupdatecapts(board, move);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rax
movl $0x2000000, %esi        # imm = 0x2000000
cmpl $0x2, %edi
jl 0x1316
movq 0x8(%rax), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x1110
movq %rax, %rsi
shll $0x14, %esi
leaq 0x5ecb(%rip), %rdi      # 0x71e8
callq 0x1538
callq 0x1130
movl %eax, %edi
callq 0x1070
movl %eax, %ebx
callq 0x1130
cmpl $0xa, %eax
jne 0x1344
cmpl $0x44, %ebx
je 0x134c
cmpl $0x54, %ebx
je 0x138b
pushq $0x1
popq %rdi
callq 0x1080
leaq 0x5e95(%rip), %rbx      # 0x71e8
leaq 0x8(%rsp), %r14
pushq $0x1e
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x17da
leaq 0x5efb(%rip), %r15      # 0x7268
pushq $0x16
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
rep  movsl (%rsi), %es:(%rdi)
movq %r15, %rdi
callq 0x3597
movq %rbx, %rdi
movq %r15, %rsi
callq 0x345b
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x13d5
leaq 0x5ec9(%rip), %rax      # 0x7268
pushq $0x16
popq %rcx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsl (%rsi), %es:(%rdi)
leaq 0x5e37(%rip), %rdi      # 0x71e8
movq %rax, %rsi
callq 0x3086
testb %al, %al
je 0x1344
leaq 0x5e24(%rip), %rdi      # 0x71e8
leaq 0x5e9d(%rip), %rsi      # 0x7268
callq 0x345b
jmp 0x134c
// File: /workspace/github_c_makefile_star2_O2/icarroll[P]clunk/playthud.c
// Function: getmove
struct move getmove(void)
{
    struct move move;

    char * line = NULL;
    size_t size = 0;
    int _ = getline(& line, & size, stdin);

    char * cur = line;

    skipspace(& cur);
    if (toupper(* cur) == 'D') move.isdwarfmove = true;
    else if (toupper(* cur) == 'T') move.isdwarfmove = false;
    else exit(EXIT_FAILURE);
    cur += 1;

    bool valid;

    skipspace(& cur);
    valid = getpos(& cur, & move.from);
    if (! valid) exit(EXIT_FAILURE);

    skipspace(& cur);
    if (* cur++ != '-') exit(EXIT_FAILURE);

    skipspace(& cur);
    valid = getpos(& cur, & move.to);
    if (! valid) exit(EXIT_FAILURE);

    move.numcapts = 0;
    while (move.numcapts <= NUMDIRS)
    {
        skipspace(& cur);
        if (* cur == '\0' || * cur == '\n') break;

        skipspace(& cur);
        if (toupper(* cur++) != 'X') exit(EXIT_FAILURE);

        skipspace(& cur);
        valid = getpos(& cur, & move.capts[move.numcapts++]);
        if (! valid) exit(EXIT_FAILURE);
    }

    free(line);
    return move;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
leaq 0x10(%rsp), %rsi
andq $0x0, (%rsi)
movq %rdi, %rbx
movq 0x5be4(%rip), %rax      # 0x6fe0
movq (%rax), %rdx
movq %r14, %rdi
callq 0x1150
movq (%r14), %rax
movq %rsp, %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x3498
callq 0x10d0
movq %rax, %r14
movq (%rax), %rcx
movq (%r15), %rax
movsbq (%rax), %rdx
movl (%rcx,%rdx,4), %edx
movb $0x1, %cl
cmpl $0x44, %edx
je 0x143f
cmpl $0x54, %edx
jne 0x152e
xorl %ecx, %ecx
movb %cl, (%rbx)
incq %rax
movq %rsp, %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x3498
leaq 0x4(%rbx), %rsi
movq %r15, %rdi
callq 0x34e9
testb %al, %al
je 0x152e
movq %rsp, %r15
movq %r15, %rdi
callq 0x3498
movq (%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r15)
cmpb $0x2d, (%rax)
jne 0x152e
movq %rsp, %r15
movq %r15, %rdi
callq 0x3498
leaq 0xc(%rbx), %rsi
movq %r15, %rdi
callq 0x34e9
testb %al, %al
je 0x152e
andl $0x0, 0x14(%rbx)
leaq 0x18(%rbx), %r12
xorl %eax, %eax
movq %rsp, %r15
cmpl $0x8, %eax
jg 0x1515
movq %r15, %rdi
callq 0x3498
movq (%rsp), %rax
movzbl (%rax), %eax
testl %eax, %eax
je 0x1515
cmpl $0xa, %eax
je 0x1515
movq %r15, %rdi
callq 0x3498
movq (%r14), %rax
movq (%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rsp)
movsbq (%rcx), %rcx
cmpl $0x58, (%rax,%rcx,4)
jne 0x152e
movq %r15, %rdi
callq 0x3498
movslq 0x14(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x14(%rbx)
leaq (%r12,%rax,8), %rsi
movq %r15, %rdi
callq 0x34e9
testb %al, %al
je 0x152e
movl 0x14(%rbx), %eax
jmp 0x14b0
movq 0x8(%rsp), %rdi
callq 0x10f0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x1
popq %rdi
callq 0x1080
nop
// File: /workspace/github_c_makefile_star2_O2/fm4dd[P]learn-ssl/certverify-adv.c
// Function: X509_load_ca_file
STACK_OF(X509_INFO) *X509_load_ca_file(int *cert_count, 
                                       struct stat fstat, const char *file) {
  STACK_OF(X509_INFO) *st = NULL;
  BIO *inbio=NULL;

  /* complain if we got an empty filename */
  if (file == NULL)
    BIO_printf(outbio, "Error receiving a valid CA bundle file name.\n");

  /* get file status data */
  if (stat(file, &fstat) != 0) {
    BIO_printf(outbio, "Error cannot stat cert bundle file: %s.\n", file);
    exit(1);
  }

  /* complain if the file is empty (0 bytes) */
  if(fstat.st_size == 0)
    BIO_printf(outbio, "Error cert bundle file size is zero bytes.\n");

  inbio=BIO_new(BIO_s_file());

  /* check if we can open the file for reading */
  if ((inbio == NULL) || (BIO_read_filename(inbio, file) <= 0))
    BIO_printf(outbio, "Error loading cert bundle file into memory.\n");

  /* read all certificates from file */
  if (! (st = PEM_X509_INFO_read_bio(inbio, NULL, NULL, NULL)))
    BIO_printf(outbio, "Error reading certs from BIO.\n");

  /* get the number of certs that are now on the stack */
  *cert_count = sk_X509_INFO_num(st);

  /* return the STACK_OF(X509_INFO) pointer, or exit */
  if (cert_count > 0) return st;
  else exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
testq %rsi, %rsi
jne 0x2822
movq 0x2ebc(%rip), %rdi      # 0x56d0
leaq 0xb8d(%rip), %rsi       # 0x33a8
xorl %eax, %eax
callq 0x22b0
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
testl %eax, %eax
jne 0x28ce
cmpq $0x0, 0x30(%r15)
jne 0x2851
movq 0x2e8d(%rip), %rdi      # 0x56d0
leaq 0xbb5(%rip), %rsi       # 0x33ff
xorl %eax, %eax
callq 0x22b0
callq 0x2060
movq %rax, %rdi
callq 0x2260
movq %rax, %r15
testq %rax, %rax
je 0x287b
pushq $0x6c
popq %rsi
pushq $0x3
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
callq 0x2050
testl %eax, %eax
jg 0x2890
movq 0x2e4e(%rip), %rdi      # 0x56d0
leaq 0xba2(%rip), %rsi       # 0x342b
xorl %eax, %eax
callq 0x22b0
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2070
movq %rax, %r14
testq %rax, %rax
jne 0x28bb
movq 0x2e23(%rip), %rdi      # 0x56d0
leaq 0xba4(%rip), %rsi       # 0x3458
xorl %eax, %eax
callq 0x22b0
movq %r14, %rdi
callq 0x20a0
movl %eax, (%rbx)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2dfb(%rip), %rdi      # 0x56d0
leaq 0xafa(%rip), %rsi       # 0x33d6
movq %r14, %rdx
xorl %eax, %eax
callq 0x22b0
pushq $0x1
popq %rdi
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/fm4dd[P]learn-ssl/certverify-adv.c
// Function: verify_mem_store
X509_STORE_CTX  *verify_mem_store(STACK_OF(X509_INFO) *st) {
  X509_STORE         *store = NULL;
  X509_STORE_CTX       *ctx = NULL;
  //STACK_OF(X509)  *ca_stack = NULL;
  X509_INFO      *list_item = NULL;
  int cert_count            = 0;
  int i                     = 0;

  /* ---------------------------------------------------------- *
   * Initialize the global certificate validation store object. *
   * ---------------------------------------------------------- */
  if (!(store=X509_STORE_new()))
     BIO_printf(outbio, "Error creating X509_STORE_CTX object\n");

  /* ---------------------------------------------------------- *
   * Create the context structure for the validation operation. *
   * ---------------------------------------------------------- */
  ctx = X509_STORE_CTX_new();

  /* ---------------------------------------------------------- *
   * Get the number of certs on the stack                       *
   * ---------------------------------------------------------- */
  cert_count = sk_X509_INFO_num(st);

  /* ---------------------------------------------------------- *
   * Complain if there is no cert                               *
   * ---------------------------------------------------------- */
  if (! (cert_count > 0)) {
    BIO_printf(outbio, "Error no certs on stack.\n");
    exit(1);
  }

  /* ---------------------------------------------------------- *
   * Cycle through all info stack items, extract the X509 cert  *
   * and put it into the X509_STORE called store.               *
   * ---------------------------------------------------------- */
  for (i = 0; i < cert_count; i++) {
    list_item = sk_X509_INFO_value(st, i);
    X509_STORE_add_cert(store, list_item->x509);
  }

  /* ---------------------------------------------------------- *
   * Initialize the ctx structure for a verification operation: *
   * Set the trusted cert store, the unvalidated cert, and any  *
   * potential certs that could be needed (here we set it NULL) *
   * ---------------------------------------------------------- */
  X509_STORE_CTX_init(ctx, store, cert, NULL);

  return ctx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
callq 0x21b0
movq %rax, %rbx
testq %rax, %rax
jne 0x291b
movq 0x2dc3(%rip), %rdi      # 0x56d0
leaq 0xa49(%rip), %rsi       # 0x335d
xorl %eax, %eax
callq 0x22b0
callq 0x2160
movq %rax, %r15
movq %r14, %rdi
callq 0x20a0
testl %eax, %eax
jle 0x2974
movl %eax, %ebp
xorl %r12d, %r12d
cmpl %r12d, %ebp
je 0x2954
movq %r14, %rdi
movl %r12d, %esi
callq 0x21e0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x20c0
incl %r12d
jmp 0x2934
movq 0x2d85(%rip), %rdx      # 0x56e0
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x20d0
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d55(%rip), %rdi      # 0x56d0
leaq 0xaf5(%rip), %rsi       # 0x3477
xorl %eax, %eax
callq 0x22b0
pushq $0x1
popq %rdi
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/fm4dd[P]learn-ssl/certverify-adv.c
// Function: verify_file_direct
X509_STORE_CTX  *verify_file_direct(const char *file) {
  X509_STORE         *store = NULL;
  X509_STORE_CTX  *vrfy_ctx = NULL;

  /* ---------------------------------------------------------- *
   * Initialize the global certificate validation store object. *
   * ---------------------------------------------------------- */
  if (!(store=X509_STORE_new()))
     BIO_printf(outbio, "Error creating X509_STORE_CTX object\n");

  /* ---------------------------------------------------------- *
   * Create the context structure for the validation operation. *
   * ---------------------------------------------------------- */
  vrfy_ctx = X509_STORE_CTX_new();

  /* ---------------------------------------------------------- *
   * Load the certificate and cacert chain from file (PEM).     *
   * ---------------------------------------------------------- */
  if ((X509_STORE_load_locations(store, file, NULL)) != 1)
    BIO_printf(outbio, "Error loading CA cert or chain file\n");

  /* ---------------------------------------------------------- *
   * Initialize the ctx structure for a verification operation: *
   * Set the trusted cert store, the unvalidated cert, and any  *
   * potential certs that could be needed (here we set it NULL) *
   * ---------------------------------------------------------- */
  X509_STORE_CTX_init(vrfy_ctx, store, cert, NULL);

  return vrfy_ctx; 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
callq 0x21b0
movq %rax, %rbx
testq %rax, %rax
jne 0x2b38
movq 0x2ba6(%rip), %rdi      # 0x56d0
leaq 0x82c(%rip), %rsi       # 0x335d
xorl %eax, %eax
callq 0x22b0
callq 0x2160
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x22a0
cmpl $0x1, %eax
je 0x2b67
movq 0x2b77(%rip), %rdi      # 0x56d0
leaq 0x823(%rip), %rsi       # 0x3383
xorl %eax, %eax
callq 0x22b0
movq 0x2b72(%rip), %rdx      # 0x56e0
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x20d0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/dup1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char tmpfile[] = "/tmp/willitscale.XXXXXX";
	int fd = mkstemp(tmpfile);

	assert(fd >= 0);
	unlink(tmpfile);

	while (1) {
		int fd2 = dup(fd);

		assert(fd2 >= 0);
		close(fd2);

		(*iterations)++;
	}

	close(fd);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movaps 0x790(%rip), %xmm0      # 0x32e0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x10(%rdi)
callq 0x21e0
testl %eax, %eax
js 0x2ba7
movl %eax, %ebp
movq %rsp, %rdi
callq 0x2080
movl %ebp, %edi
callq 0x2120
testl %eax, %eax
js 0x2b8e
movl %eax, %edi
callq 0x2150
incq (%rbx)
jmp 0x2b77
leaq 0x733(%rip), %rdi       # 0x32c8
leaq 0x6ec(%rip), %rsi       # 0x3288
leaq 0x6f2(%rip), %rcx       # 0x3295
pushq $0x12
jmp 0x2bbe
leaq 0x6d2(%rip), %rdi       # 0x3280
leaq 0x6d3(%rip), %rsi       # 0x3288
leaq 0x6d9(%rip), %rcx       # 0x3295
pushq $0xc
popq %rdx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/eric-lo[P]3150/8-Synchronization/pthread_producer_consumer.c
// Function: producer
void *producer(void *nothing) {
	int item;
	unsigned int s;		// needed by thread-safe rand_r()

	while(1) {
		pthread_mutex_lock(&mutex);	// start of mutual exclusion.

			if(IS_FULL(head, tail, N))
				pthread_cond_wait(&full, &mutex);	// wait and unlock mutual exclusion.

			if(IS_EMPTY(head, tail, N))
				pthread_cond_signal(&empty);		// wake up the consumer.

			item = (rand_r(&s) % 26) + 'A';	// produce an item.
			buffer[tail] = item;		// insert an item.
			tail = NEXT_SLOT(tail, N);	// occupy one empty slot.
			drawing(PRODUCER_TURN, item);	// draw the change inside mutex.

		pthread_mutex_unlock(&mutex);	// end of mutual exclusion.

		if(rand_r(&s) % SLEEP_CHANCE == 0)
			sleep(1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2cf6(%rip), %rbx      # 0x40a0
pushq $0xa
popq %r13
leaq 0x2d43(%rip), %r15      # 0x40f8
leaq 0x4(%rsp), %r12
pushq $0x1a
popq %rbp
leaq 0x2d6c(%rip), %r14      # 0x4130
movq %rbx, %rdi
callq 0x10f0
movl 0x2d5a(%rip), %ecx      # 0x412c
leal 0x1(%rcx), %eax
cltd
idivl %r13d
movl 0x2d49(%rip), %eax      # 0x4128
cmpl %eax, %edx
jne 0x13fe
leaq 0x2cde(%rip), %rdi      # 0x40c8
movq %rbx, %rsi
callq 0x1030
movl 0x2d34(%rip), %ecx      # 0x412c
movl 0x2d2a(%rip), %eax      # 0x4128
cmpl %eax, %ecx
jne 0x140a
movq %r15, %rdi
callq 0x1060
movq %r12, %rdi
callq 0x1040
cltd
idivl %ebp
leal 0x41(%rdx), %esi
movslq 0x2d0d(%rip), %rax      # 0x412c
movl %esi, (%r14,%rax,4)
incl %eax
cltd
idivl %r13d
movl %edx, 0x2cfd(%rip)      # 0x412c
xorl %edi, %edi
callq 0x11fc
movq %rbx, %rdi
callq 0x1090
movq %r12, %rdi
callq 0x1040
testb $0x3, %al
jne 0x13c4
pushq $0x1
popq %rdi
callq 0x10e0
jmp 0x13c4
// File: /workspace/github_c_makefile_star2_O2/eric-lo[P]3150/8-Synchronization/pthread_producer_consumer.c
// Function: consumer
void *consumer(void *nothing) {
	int item;
	unsigned int s;

	while(1) {
		pthread_mutex_lock(&mutex);	// start of mutual exclusion.

			if(IS_EMPTY(head, tail, N))
				pthread_cond_wait(&empty, &mutex);	// wait and unlock mutual exclusion.

			if(IS_FULL(head, tail, N))
				pthread_cond_signal(&full);		// wakeup the producer.

			item = buffer[head];		// consume an item.
			head = NEXT_SLOT(head, N);	// free one slot.
			drawing(CONSUMER_TURN, item);	// draw the change inside mutex.

		pthread_mutex_unlock(&mutex);	// end of mutual exclusion.

		if(rand_r(&s) % SLEEP_CHANCE == 0)
			sleep(1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2c33(%rip), %rbx      # 0x40a0
pushq $0xa
popq %r13
leaq 0x2c50(%rip), %r15      # 0x40c8
leaq 0x2cb1(%rip), %r14      # 0x4130
pushq $0x1
popq %rbp
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
callq 0x10f0
movl 0x2c97(%rip), %eax      # 0x412c
movl 0x2c8d(%rip), %ecx      # 0x4128
cmpl %ecx, %eax
jne 0x14ba
leaq 0x2c52(%rip), %rdi      # 0x40f8
movq %rbx, %rsi
callq 0x1030
movl 0x2c78(%rip), %eax      # 0x412c
movl 0x2c6e(%rip), %ecx      # 0x4128
incl %eax
cltd
idivl %r13d
cmpl %ecx, %edx
jne 0x14d2
movq %r15, %rdi
callq 0x1060
movl 0x2c56(%rip), %ecx      # 0x4128
movslq %ecx, %rax
movl (%r14,%rax,4), %esi
incl %eax
cltd
idivl %r13d
movl %edx, 0x2c43(%rip)      # 0x4128
movl %ebp, %edi
callq 0x11fc
movq %rbx, %rdi
callq 0x1090
movq %r12, %rdi
callq 0x1040
testb $0x3, %al
jne 0x1487
movl %ebp, %edi
callq 0x10e0
jmp 0x1487
// File: /workspace/github_c_makefile_star2_O2/eric-lo[P]3150/8-Synchronization/pthread_producer_consumer.c
// Function: main
int main(void) {
	pthread_t tid1, tid2;

	srand(time(NULL));
	pthread_create(&tid1, NULL, producer, NULL);	// create producer
	pthread_create(&tid2, NULL, consumer, NULL);	// create consumer

	// The join statements are just used for suspending the main threads.
	pthread_join(tid1, NULL);	// never reached.
	pthread_join(tid2, NULL);	// never reached.

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorl %edi, %edi
callq 0x1080
movl %eax, %edi
callq 0x1050
leaq -0x190(%rip), %rdx      # 0x1398
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x10b0
leaq -0xe5(%rip), %rdx       # 0x145b
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x10b0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x10d0
movq (%r14), %rdi
xorl %esi, %esi
callq 0x10d0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/sys.c
// Function: sys_timestamp
const char *sys_timestamp()
{
	static char buf[256];
	double rt, ct;
	rt = sys_realtime();
	ct = sys_cputime();
	snprintf(buf, 255, "%.3f*%.2f", rt, ct/rt);
	return buf;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
callq 0x138f
movsd %xmm0, 0x8(%rsp)
callq 0x134c
movapd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm0, %xmm1
leaq 0xcd24(%rip), %rbx      # 0xe160
leaq 0x7bcd(%rip), %rdx      # 0x9010
movl $0xff, %esi
movq %rbx, %rdi
movb $0x2, %al
callq 0x10a0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/sdict.c
// Function: sd_destroy
void sd_destroy(sdict_t *d)
{
	uint32_t i;
	if (d == 0) return;
	if (d->h) kh_destroy(str, (shash_t*)d->h);
	for (i = 0; i < d->n_seq; ++i)
		free(d->seq[i].name);
	free(d->seq);
	free(d);
}

// Assembly:
testq %rdi, %rdi
je 0x14d4
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x149f
callq 0x14d5
xorl %r14d, %r14d
xorl %r15d, %r15d
movl (%rbx), %eax
movq 0x8(%rbx), %rdi
cmpq %rax, %r15
jae 0x14c2
movq (%rdi,%r14), %rdi
callq 0x1040
incq %r15
addq $0x10, %r14
jmp 0x14a5
callq 0x1040
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/sdict.c
// Function: sd_put
int32_t sd_put(sdict_t *d, const char *name, uint32_t len)
{
	shash_t *h = (shash_t*)d->h;
	khint_t k;
	int absent;
	k = kh_put(str, h, name, &absent);
	if (absent) {
		sd_seq_t *s;
		if (d->n_seq == d->m_seq) {
			d->m_seq = d->m_seq? d->m_seq<<1 : 16;
			d->seq = (sd_seq_t*)realloc(d->seq, d->m_seq * sizeof(sd_seq_t));
		}
		s = &d->seq[d->n_seq];
		s->len = len, s->aux = 0, s->del = 0;
		kh_key(h, k) = s->name = strdup(name);
		kh_val(h, k) = d->n_seq++;
	} // TODO: test if len is the same;
	return kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %rbx
leaq 0x4(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x15bd
movl %eax, %ebp
cmpl $0x0, (%r13)
je 0x1563
movl (%r14), %eax
cmpl 0x4(%r14), %eax
movl %r12d, (%rsp)
jne 0x156e
leal (%rax,%rax), %ecx
testl %eax, %eax
pushq $0x10
popq %rsi
cmovnel %ecx, %esi
movl %esi, 0x4(%r14)
movq 0x8(%r14), %rdi
shlq $0x4, %rsi
callq 0x1180
movq %rax, %r13
movq %rax, 0x8(%r14)
movl (%r14), %eax
jmp 0x1572
movq 0x20(%rbx), %rax
movl %ebp, %ecx
movl (%rax,%rcx,4), %eax
jmp 0x15ae
movq 0x8(%r14), %r13
movl %eax, %r12d
shlq $0x4, %r12
movl (%rsp), %eax
movl %eax, 0x8(%r13,%r12)
andl $0x0, 0xc(%r13,%r12)
movq %r15, %rdi
callq 0x1230
movq %rax, (%r13,%r12)
movq 0x18(%rbx), %rcx
movl %ebp, %edx
movq %rax, (%rcx,%rdx,8)
movl (%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq 0x20(%rbx), %rcx
movl %eax, (%rcx,%rdx,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/sdict.c
// Function: sd_get
int32_t sd_get(const sdict_t *d, const char *name)
{
	shash_t *h = (shash_t*)d->h;
	khint_t k;
	k = kh_get(str, h, name);
	return k == kh_end(h)? -1 : kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %r14
movl (%r14), %ecx
pushq $-0x1
popq %rax
testl %ecx, %ecx
je 0x185c
movq %rcx, 0x18(%rsp)
leal -0x1(%rcx), %ebx
movq %rsi, 0x20(%rsp)
movq %rsi, %rdi
callq 0x1bf2
movl %eax, %ebp
movl %ebx, 0xc(%rsp)
andl %ebx, %ebp
movq %r14, 0x10(%rsp)
movq 0x10(%r14), %r14
pushq $0x1
popq %r12
movl %ebp, %ebx
movl %ebx, %eax
shrl $0x4, %eax
movl (%r14,%rax,4), %r13d
leal (%rbx,%rbx), %r15d
andl $0x1e, %r15d
movl %r13d, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x1840
testb $0x1, %al
jne 0x182d
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x20(%rsp), %rsi
callq 0x1100
testl %eax, %eax
je 0x1840
addl %r12d, %ebx
andl 0xc(%rsp), %ebx
incl %r12d
cmpl %ebp, %ebx
jne 0x17ef
pushq $-0x1
popq %rax
jmp 0x186b
movl %r15d, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x18(%rsp), %rcx
cmovnel %ecx, %ebx
pushq $-0x1
popq %rax
movq 0x10(%rsp), %r14
jmp 0x185e
xorl %ebx, %ebx
cmpl %ecx, %ebx
je 0x186b
movq 0x20(%r14), %rax
movl %ebx, %ecx
movl (%rax,%rcx,4), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/sdict.c
// Function: sd_hash
void sd_hash(sdict_t *d)
{
	uint32_t i;
	shash_t *h;
	if (d->h) return;
	d->h = h = kh_init(str);
	for (i = 0; i < d->n_seq; ++i) {
		int absent;
		khint_t k;
		k = kh_put(str, h, d->seq[i].name, &absent);
		kh_val(h, k) = i;
	}
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x1882
retq
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x1479
movq %rax, %r14
movq %rax, 0x10(%rbx)
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
xorl %r13d, %r13d
movl (%rbx), %eax
cmpq %rax, %r13
jae 0x18d6
movq 0x8(%rbx), %rax
movq (%rax,%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x15bd
movq 0x20(%r14), %rcx
movl %eax, %eax
movl %r13d, (%rcx,%rax,4)
incq %r13
addq $0x10, %r12
jmp 0x18a9
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/sdict.c
// Function: sd_squeeze
int32_t *sd_squeeze(sdict_t *d)
{
	int32_t *map, i, j;
	if (d->h) {
		kh_destroy(str, (shash_t*)d->h);
		d->h = 0;
	}
	map = (int32_t*)calloc(d->n_seq, 4);
	for (i = j = 0; i < d->n_seq; ++i) {
		if (d->seq[i].del) {
			free(d->seq[i].name);
			map[i] = -1;
		} else d->seq[j] = d->seq[i], map[i] = j++;
	}
	d->n_seq = j;
	sd_hash(d);
	return map;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x1905
callq 0x14d5
andq $0x0, 0x10(%rbx)
movl (%rbx), %r15d
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x10f0
movq %rax, %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movl %r15d, %eax
cmpq %rax, %r13
jae 0x1966
movq 0x8(%rbx), %rax
leaq (%rax,%r12,4), %rcx
cmpl $0x0, 0xc(%rcx)
js 0x194b
movslq %ebp, %rdx
shlq $0x4, %rdx
movups (%rcx), %xmm0
movups %xmm0, (%rax,%rdx)
movl %ebp, %eax
leal 0x1(%rbp), %ecx
movl %ecx, %ebp
jmp 0x1956
movq (%rcx), %rdi
callq 0x1040
pushq $-0x1
popq %rax
movl %eax, (%r14,%r12)
incq %r13
movl (%rbx), %r15d
addq $0x4, %r12
jmp 0x191e
movl %ebp, (%rbx)
movq %rbx, %rdi
callq 0x187a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/paf.c
// Function: paf_open
paf_file_t *paf_open(const char *fn)
{
	kstream_t *ks;
	gzFile fp;
	paf_file_t *pf;
	fp = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r");
	if (fp == 0) return 0;
	ks = ks_init(fp);
	pf = (paf_file_t*)calloc(1, sizeof(paf_file_t));
	pf->fp = ks;
	return pf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1c36
cmpb $0x2d, (%rdi)
jne 0x1c28
cmpb $0x0, 0x1(%rdi)
je 0x1c36
leaq 0x742d(%rip), %rsi      # 0x905c
callq 0x11a0
jmp 0x1c53
movq 0xc38b(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
callq 0x1150
leaq 0x7410(%rip), %rsi      # 0x905c
movl %eax, %edi
callq 0x1080
movq %rax, %rbx
testq %rax, %rax
je 0x1c9b
pushq $0x1
popq %r14
pushq $0x20
popq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x10f0
movq %rax, %r12
movq %rbx, 0x10(%rax)
movl $0x40000, 0x8(%rax)     # imm = 0x40000
movl $0x10000, %edi          # imm = 0x10000
callq 0x1160
movq %rax, 0x18(%r12)
movq %r14, %rdi
movq %r15, %rsi
callq 0x10f0
movq %r12, (%rax)
jmp 0x1c9d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/paf.c
// Function: paf_close
int paf_close(paf_file_t *pf)
{
	kstream_t *ks;
	if (pf == 0) return 0;
	free(pf->buf.s);
	ks = (kstream_t*)pf->fp;
	gzclose(ks->f);
	ks_destroy(ks);
	free(pf);
	return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x1cea
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x1040
movq (%rbx), %r14
movq 0x10(%r14), %rdi
callq 0x1030
movq 0x18(%r14), %rdi
callq 0x1040
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x1040
addq $0x8, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/paf.c
// Function: paf_parse
int paf_parse(int l, char *s, paf_rec_t *pr) // s must be NULL terminated
{ // on return: <0 for failure; 0 for success; >0 for filtered
	char *q, *r;
	int i, t;
	for (i = t = 0, q = s; i <= l; ++i) {
		if (i < l && s[i] != '\t') continue;
		s[i] = 0;
		if (t == 0) pr->qn = q;
		else if (t == 1) pr->ql = strtol(q, &r, 10);
		else if (t == 2) pr->qs = strtol(q, &r, 10);
		else if (t == 3) pr->qe = strtol(q, &r, 10);
		else if (t == 4) pr->rev = (*q == '-');
		else if (t == 5) pr->tn = q;
		else if (t == 6) pr->tl = strtol(q, &r, 10);
		else if (t == 7) pr->ts = strtol(q, &r, 10);
		else if (t == 8) pr->te = strtol(q, &r, 10);
		else if (t == 9) pr->ml = strtol(q, &r, 10);
		else if (t == 10) pr->bl = strtol(q, &r, 10);
		++t, q = i < l? &s[i+1] : 0;
	}
	if (t < 10) return -1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movslq %edi, %r15
leaq 0x1(%rsi), %r12
xorl %r13d, %r13d
leaq 0x7324(%rip), %r14      # 0x9030
xorl %ebp, %ebp
cmpq %r15, %r13
jg 0x1e29
jge 0x1d25
cmpb $0x9, -0x1(%r12)
jne 0x1e1e
movb $0x0, -0x1(%r12)
cmpl $0xa, %ebp
ja 0x1e10
movl %ebp, %eax
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movq %rsi, (%rbx)
jmp 0x1e10
xorl %eax, %eax
cmpb $0x2d, (%rsi)
sete %al
shll $0x1f, %eax
movl 0x28(%rbx), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
orl %eax, %ecx
jmp 0x1d7f
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl 0x28(%rbx), %ecx
movl $0x80000000, %edx       # imm = 0x80000000
andl %edx, %ecx
orl %eax, %ecx
movl %ecx, 0x28(%rbx)
jmp 0x1e10
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
movl %eax, 0x14(%rbx)
jmp 0x1e10
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
movl %eax, 0x18(%rbx)
jmp 0x1e10
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
movl %eax, 0x20(%rbx)
jmp 0x1e10
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
movl %eax, 0x10(%rbx)
jmp 0x1e10
movq %rsi, 0x8(%rbx)
jmp 0x1e10
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
movl %eax, 0x1c(%rbx)
jmp 0x1e10
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
movl %eax, 0x2c(%rbx)
jmp 0x1e10
movq %rsi, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x1130
movl %eax, 0x24(%rbx)
incl %ebp
cmpq %r15, %r13
movl $0x0, %esi
cmovlq %r12, %rsi
incq %r13
incq %r12
jmp 0x1d0e
xorl %eax, %eax
cmpl $0xa, %ebp
setl %al
negl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/paf.c
// Function: paf_read
int paf_read(paf_file_t *pf, paf_rec_t *r)
{
	int ret, dret;
file_read_more:
	ret = ks_getuntil((kstream_t*)pf->fp, KS_SEP_LINE, &pf->buf, &dret);
	if (ret < 0) return ret;
	ret = paf_parse(pf->buf.l, pf->buf.s, r);
	if (ret < 0) goto file_read_more;
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %r12
pushq $-0x1
popq %rbx
movq (%r15), %r13
andq $0x0, 0x8(%r15)
movl (%r13), %ecx
movl 0x4(%r13), %eax
cmpl %eax, %ecx
jl 0x1e79
testb $0x3, 0x8(%r13)
jne 0x1ff2
cmpl %eax, %ecx
jl 0x1ec5
movl 0x8(%r13), %edx
testb $0x3, %dl
jne 0x1f8e
andl $0x0, (%r13)
movq 0x10(%r13), %rdi
movq 0x18(%r13), %rsi
sarl $0x2, %edx
callq 0x1110
movl %eax, 0x4(%r13)
movl 0x8(%r13), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x1eb9
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r13)
testl %eax, %eax
je 0x1f8e
movl (%r13), %ecx
movslq %ecx, %rsi
cltq
cmpl %esi, %eax
movl %esi, %ebp
cmovgl %eax, %ebp
movq %rsi, %rdx
cmpq %rax, %rdx
jge 0x1eea
movq 0x18(%r13), %rdi
cmpb $0xa, (%rdi,%rdx)
je 0x1ee8
incq %rdx
jmp 0x1ed4
movl %edx, %ebp
movq 0x8(%r15), %rdi
movq 0x10(%r15), %r8
subq %rdi, %r8
movl %ebp, %edx
subl %ecx, %edx
leal 0x1(%rdx), %eax
movslq %eax, %rcx
movq 0x18(%r15), %rax
cmpq %rcx, %r8
jae 0x1f5e
movslq %edx, %rcx
addq %rcx, %rdi
movq %rdi, %rcx
shrq %rcx
orq %rdi, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rsi
shrq $0x10, %rsi
orq %rdx, %rsi
incq %rsi
movq %rsi, 0x10(%r15)
movq %rax, %rdi
callq 0x1180
movq %rax, 0x18(%r15)
movq 0x8(%r15), %rdi
movslq (%r13), %rsi
movl %ebp, %edx
subl %esi, %edx
addq %rax, %rdi
addq 0x18(%r13), %rsi
movslq %edx, %rdx
callq 0x1140
movslq (%r13), %rax
movslq %ebp, %rcx
subq %rax, %rcx
addq %rcx, 0x8(%r15)
leal 0x1(%rbp), %ecx
movl %ecx, (%r13)
movl 0x4(%r13), %eax
cmpl %eax, %ebp
jge 0x1e79
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x1fb1
movq 0x8(%r15), %rcx
cmpq $0x2, %rcx
jb 0x1fcc
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x1fcc
decq %rcx
movq %rcx, 0x8(%r15)
jmp 0x1fcc
movq $0x1, 0x10(%r15)
movq %r12, %rdi
movq %r12, %rsi
callq 0x10f0
movq %rax, 0x18(%r15)
movq 0x8(%r15), %rcx
movb $0x0, (%rax,%rcx)
movl 0x8(%r15), %edi
testl %edi, %edi
js 0x1ff0
movq 0x18(%r15), %rsi
movq %r14, %rdx
callq 0x1ced
testl %eax, %eax
js 0x1e5a
xorl %ebx, %ebx
jmp 0x1ff2
movl %edi, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/asg.c
// Function: asg_arc_index_core
uint64_t *asg_arc_index_core(size_t max_seq, size_t n, const asg_arc_t *a)
{
	size_t i, last;
	uint64_t *idx;
	idx = (uint64_t*)calloc(max_seq * 2, 8);
	for (i = 1, last = 0; i <= n; ++i)
		if (i == n || a[i-1].ul>>32 != a[i].ul>>32)
			idx[a[i-1].ul>>32] = (uint64_t)last<<32 | (i - last), last = i;
	return idx;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
addq %rdi, %rdi
pushq $0x8
popq %rsi
callq 0x10f0
movq %r14, %rcx
shlq $0x4, %rcx
addq %rbx, %rcx
addq $-0x10, %rcx
addq $0x10, %rbx
pushq $0x1
popq %rdx
xorl %esi, %esi
cmpq %r14, %rdx
ja 0x22d5
jne 0x22a4
movq (%rcx), %rdi
jmp 0x22b4
movq -0x10(%rbx), %rdi
movq (%rbx), %r8
xorq %rdi, %r8
shrq $0x20, %r8
je 0x22cc
movq %rdx, %r8
subq %rsi, %r8
shlq $0x20, %rsi
orq %r8, %rsi
shrq $0x20, %rdi
movq %rsi, (%rax,%rdi,8)
movq %rdx, %rsi
incq %rdx
addq $0x10, %rbx
jmp 0x2298
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/asg.c
// Function: asg_arc_rm
void asg_arc_rm(asg_t *g)
{
	uint32_t e, n;
	for (e = n = 0; e < g->n_arc; ++e) {
		uint32_t u = g->arc[e].ul>>32, v = g->arc[e].v;
		if (!g->arc[e].del && !g->seq[u>>1].del && !g->seq[v>>1].del)
			g->arc[n++] = g->arc[e];
	}
	if (n < g->n_arc) { // arc index is out of sync
		if (g->idx) free(g->idx);
		g->idx = 0;
	}
	g->n_arc = n;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
xorl %ecx, %ecx
xorl %ebp, %ebp
movl 0x4(%rbx), %edx
movl %edx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmpq %rsi, %rcx
jae 0x241a
movq 0x8(%rbx), %rdx
cmpl $0x0, 0xc(%rdx,%rax)
js 0x2411
leaq (%rdx,%rax), %rsi
movq (%rsi), %r8
movq 0x18(%rbx), %rdi
shrq $0x21, %r8
cmpl $0x0, (%rdi,%r8,4)
js 0x2411
movl 0x8(%rdx,%rax), %r8d
shrl %r8d
cmpl $0x0, (%rdi,%r8,4)
js 0x2411
movl %ebp, %edi
incl %ebp
shlq $0x4, %rdi
movups (%rsi), %xmm0
movups %xmm0, (%rdx,%rdi)
incq %rcx
addq $0x10, %rax
jmp 0x23c2
cmpl %esi, %ebp
jae 0x242f
movq 0x20(%rbx), %rdi
callq 0x1040
andq $0x0, 0x20(%rbx)
movl 0x4(%rbx), %edx
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl $0x80000000, %edx       # imm = 0x80000000
orl %ebp, %edx
movl %edx, 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/asg.c
// Function: asg_cleanup
void asg_cleanup(asg_t *g)
{
	asg_arc_rm(g);
	if (!g->is_srt) {
		asg_arc_sort(g);
		g->is_srt = 1;
	}
	if (g->idx == 0) asg_arc_index(g);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x23b6
cmpl $0x0, 0x4(%rbx)
js 0x2462
movq %rbx, %rdi
callq 0x2250
orb $-0x80, 0x7(%rbx)
cmpq $0x0, 0x20(%rbx)
je 0x246b
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x22dd