LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/shmem_sync_all.c
// Function: shmem_sync_all
SHMEM_SCOPE
void shmem_sync_all(void)
{
	int i;

	debug("shmem_sync_all begin");

	volatile int* pcount
		= (volatile int*)shmem_ptr((void*)&__shmem.giant_barrier_count,0);

	sem_t* pgate1 = (sem_t*)shmem_ptr((void*)&__shmem.giant_barrier_gate1,0);
	sem_t* pgate2 = (sem_t*)shmem_ptr((void*)&__shmem.giant_barrier_gate2,0);

	__giant_lock();
	if (++(*pcount) == __shmem.n_pes) {
		debug("shmem_sync_all: before sem_post on pgate1");
		for(i=0;i<__shmem.n_pes;i++) sem_post(pgate1);
		debug("shmem_sync_all: after sem_post on pgate1");
	}
	__giant_unlock();

	debug("shmem_sync_all: before sem_wait on pgate1");
	sem_wait(pgate1);
	debug("shmem_sync_all: after sem_wait on pgate1");

	__giant_lock();
	if (--(*pcount) == 0) {
		debug("shmem_sync_all: before sem_post on pgate2");
		for(i=0;i<__shmem.n_pes;i++) sem_post(pgate2);
		debug("shmem_sync_all: after sem_post on pgate2");
	}
	__giant_unlock();

	sem_wait(pgate2);

	debug("shmem_sync_all end");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x448d(%rip), %r12      # 0x61f0
leaq 0xc8(%r12), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x1d0c
movq %rax, %r14
leaq 0xd0(%r12), %rdi
xorl %esi, %esi
callq 0x1d0c
movq %rax, %r15
leaq 0xf0(%r12), %rdi
xorl %esi, %esi
callq 0x1d0c
movq %rax, %rbx
movq 0xc0(%r12), %rdi
callq 0x1070
movl (%r14), %eax
incl %eax
movl %eax, (%r14)
movl 0x8(%r12), %ecx
cmpl %ecx, %eax
setne %al
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x1dd4
movq %r15, %rdi
callq 0x1160
incl %ebp
cmpl 0x8(%r12), %ebp
jl 0x1dc3
movq 0xc0(%r12), %rdi
callq 0x1160
movq %r15, %rdi
callq 0x1070
movq 0xc0(%r12), %rdi
callq 0x1070
decl (%r14)
jne 0x1e16
cmpl $0x0, 0x8(%r12)
jle 0x1e16
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1160
incl %ebp
cmpl 0x8(%r12), %ebp
jl 0x1e05
movq 0xc0(%r12), %rdi
callq 0x1160
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1070
nop
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/xmalloc.c
// Function: xmalloc_init
struct __xmem_struct* xmalloc_init( void* ptr, size_t size, int flags )
{
	struct __xmem_struct* xm = (struct __xmem_struct*)
		calloc(1,sizeof(struct __xmem_struct));

	xm->malloc_cache = 16;

	xm->malloc_hint = 0;

	malloc_init(xm);
	
	xm->membrk = xm->memlo = ptr;
	xm->memhi = (void*)((intptr_t)ptr + size);

	return xm;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x98, %esi
callq 0x1170
movq %rax, %r15
movq $0x10, 0x18(%rax)
movq %rax, %rdi
callq 0x1efe
movq %r14, 0x80(%r15)
movq %r14, 0x90(%r15)
addq %r14, %rbx
movq %rbx, 0x88(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/xmalloc.c
// Function: xposix_memalign
int
xposix_memalign(struct __xmem_struct* xm, void **memptr, size_t alignment, 
	size_t size)
{
    int err;
    void *result;

    /* Make sure that alignment is a large enough power of 2. */
    if (((alignment - 1) & alignment) != 0 || alignment < sizeof(void *))
	    return EINVAL;

    /* 
     * (size & alignment) is enough to assure the requested alignment, since
     * the allocator always allocates power-of-two blocks.
     */
    err = errno; /* Protect errno against changes in pubrealloc(). */
    result = pubrealloc(xm, NULL, (size & alignment),
		" in xposix_memalign()");
    errno = err;

    if (result == NULL)
	return ENOMEM;

    *memptr = result;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x16, %r14d
cmpq $0x8, %rdx
jb 0x25dd
movq %rcx, %r15
movq %rdx, %r13
movq %rdx, %rax
shrq %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
andq %rax, %rcx
movq %rdx, %rax
subq %rcx, %rax
movabsq $0x3333333333333333, %rcx # imm = 0x3333333333333333
movq %rax, %rdx
andq %rcx, %rdx
shrq $0x2, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rax, %rcx
movabsq $0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rax, %rcx
shrq $0x38, %rcx
cmpl $0x1, %ecx
ja 0x25dd
movq %rdi, %r12
movq %rsi, (%rsp)
callq 0x1060
movq %rax, %rbp
movl (%rax), %ebx
andq %r13, %r15
leaq 0x1c98(%rip), %rcx      # 0x424e
xorl %r14d, %r14d
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2205
movl %ebx, (%rbp)
testq %rax, %rax
je 0x25d7
movq (%rsp), %rcx
movq %rax, (%rcx)
jmp 0x25dd
movl $0xc, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/xmalloc.c
// Function: xcalloc
void *
xcalloc(struct __xmem_struct* xm, size_t num, size_t size)
{
    void *ret;

    if (size != 0 && (num * size) / size != num) {
	/* size_t overflow. */
	errno = ENOMEM;
	return (NULL);
    }

    ret = pubrealloc(xm, NULL, num * size, " in dcalloc():");

    if (ret != NULL)
	memset(ret, 0, num * size);

    return ret;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
testq %rdx, %rdx
je 0x260d
movq %rbx, %rax
mulq %rsi
jno 0x260d
callq 0x1060
movl $0xc, (%rax)
jmp 0x2635
imulq %rsi, %rbx
leaq 0x1c4c(%rip), %rcx      # 0x4264
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2205
testq %rax, %rax
je 0x2635
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
jmp 0x1130
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_fcollect64.c
// Function: shmem_fcollect64
void shmem_fcollect64(void *dest, const void *source, size_t nelems, 
	int pe_start, int log_pe_stride, int pe_size, long* psync)
{
	const int step = 1 << log_pe_stride;
	const int pe_shift = pe_size << log_pe_stride;
	const int pe_end = pe_start + pe_shift;
	const int my_pe = __shmem.my_pe;

	const int nbytes = nelems << 3;

	const ptrdiff_t offset = nbytes * ((my_pe - pe_start) >> log_pe_stride);
	const void* target = (void*)((intptr_t)dest + offset);

	int pe = my_pe;

	do {
		shmemx_memcpy(shmem_ptr(target,pe), source, nelems*sizeof(int64_t));
		pe += step;
	} while (pe < pe_end);

	pe -= pe_shift;
	while (pe < my_pe) {
		shmemx_memcpy(shmem_ptr(target,pe), source, nelems*sizeof(int64_t));
		pe += step;
	}
	shmem_barrier(pe_start, log_pe_stride, pe_size, psync);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r10d
movq %rdx, %r15
movq %rsi, %r12
movl $0x1, %r14d
movl %r8d, %ecx
shll %cl, %r14d
movl %r9d, 0xc(%rsp)
movl %r9d, %edx
shll %cl, %edx
leaq 0x30c8(%rip), %rax      # 0x61f0
movl 0x4(%rax), %ebx
movl %ebx, %eax
subl %r10d, %eax
movl %r8d, 0x8(%rsp)
sarl %cl, %eax
movq 0x60(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rdx, 0x10(%rsp)
leal (%rdx,%r10), %ebp
imull %r15d, %eax
shll $0x3, %eax
movslq %eax, %r13
addq %rdi, %r13
shlq $0x3, %r15
movl %ebx, 0x4(%rsp)
movq %r13, %rdi
movl %ebx, %esi
callq 0x1d0c
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3280
addl %r14d, %ebx
cmpl %ebp, %ebx
jl 0x3164
subl 0x10(%rsp), %ebx
movl 0x4(%rsp), %ebp
cmpl %ebp, %ebx
jge 0x31ac
movq %r13, %rdi
movl %ebx, %esi
callq 0x1d0c
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3280
addl %r14d, %ebx
jmp 0x318b
movq 0x20(%rsp), %rdi
movl 0x8(%rsp), %esi
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %rcx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31d4
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/shmem_sync.c
// Function: shmem_sync
SHMEM_SCOPE
void shmem_sync(int pe_start, int log_pe_stride, int pe_size, long *psync)
{
	debug("[%d] shmem_sync begin",__shmem.my_pe);

	int pe_size_stride = pe_size << log_pe_stride;
	int pe_end = pe_size_stride + pe_start;

	int c, r;
	for (c = 0, r = (1 << log_pe_stride); r < pe_size_stride; c++, r <<= 1)
	{
		int to = __shmem.my_pe + r;
		if (to >= pe_end) to -= pe_size_stride;

		volatile long* lock = (volatile long*)(psync + c);
		long * remote_lock = (long*)shmem_ptr((void*)lock, to);

		__set_spin_lock(remote_lock);

		__clear_spin_lock(lock);
	}

	debug("[%d] shmem_sync end",__shmem.my_pe);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %ecx
shll %cl, %ebp
movl $0x1, %r15d
shll %cl, %r15d
cmpl %ebp, %r15d
jge 0x3271
movl %edi, %r14d
addl %ebp, %r14d
leaq 0x2fb9(%rip), %r12      # 0x61f0
xorl %r13d, %r13d
movl 0x4(%r12), %esi
addl %r15d, %esi
cmpl %r14d, %esi
movl %ebp, %eax
cmovll %r13d, %eax
subl %eax, %esi
movq %rbx, %rdi
callq 0x1d0c
movq %rax, %rdi
callq 0x32b7
movq %rbx, %rdi
callq 0x32a8
addl %r15d, %r15d
addq $0x8, %rbx
cmpl %ebp, %r15d
jl 0x323a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/aux_funcs.c
// Function: create_state
t_qlayer	*create_state(int node, t_vect *path)
{
	t_qlayer	*new = (t_qlayer*)malloc(sizeof(t_qlayer));
	t_vect		*copy = (t_vect*)malloc(sizeof(t_vect));

	init_vector(copy);
	for (int i = 0;i < (int)path->used; i++)
		push_back(copy, path->tab[i]);
	new->prefix = copy;
	new->node = node;
	return new;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
movl $0x20, %edi
callq 0x1070
movq %rax, %r15
movl $0x18, %edi
callq 0x1070
movq %rax, %r12
movq %rax, %rdi
callq 0x1e50
cmpl $0x0, 0x10(%r14)
jle 0x1204
xorl %r13d, %r13d
movq (%r14), %rax
movl (%rax,%r13,4), %esi
movq %r12, %rdi
callq 0x1f03
incq %r13
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jl 0x11e9
movq %r12, (%r15)
movl %ebx, 0x18(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/aux_funcs.c
// Function: append
t_vect	*append(t_vect *src, int add)
{
	t_vect		*copy = (t_vect*)malloc(sizeof(t_vect));

	init_vector(copy);
	for (int i = 0; i < (int)src->used; i++)
		push_back(copy, src->tab[i]);
	push_back(copy, add);
	return copy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
movl $0x18, %edi
callq 0x1070
movq %rax, %r14
movq %rax, %rdi
callq 0x1e50
cmpl $0x0, 0x10(%r15)
jle 0x1267
xorl %r12d, %r12d
movq (%r15), %rax
movl (%rax,%r12,4), %esi
movq %r14, %rdi
callq 0x1f03
incq %r12
movslq 0x10(%r15), %rax
cmpq %rax, %r12
jl 0x124c
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f03
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/graph.c
// Function: init_adj
int	init_adj(t_graph *g)
{
	if(!(g->adj = (t_vect*)malloc(sizeof(t_vect)*g->vertx)))
		return 0;
	for (int i = 0; i < g->vertx; i++)
		if (!(init_vector(&g->adj[i])))
			return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x28(%rdi), %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rdi
callq 0x1070
movq %rax, (%rbx)
testq %rax, %rax
je 0x13f5
testl %r14d, %r14d
jle 0x13f9
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rbx), %rdi
addq %r14, %rdi
callq 0x1e50
testl %eax, %eax
je 0x13ec
incq %r15
movslq 0x28(%rbx), %rcx
addq $0x18, %r14
cmpq %rcx, %r15
jl 0x13cd
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
jmp 0x13fe
xorl %ecx, %ecx
jmp 0x13fe
movl $0x1, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/graph.c
// Function: get_dimensions
int		get_dimensions(t_graph *new)
{
	int n, m, dir, search;

	scanf("%d %d %d %d", &n, &m, &dir, &search);
	if (!valid_dimensions(n,m,new))
	{
		free(new);
		return 0;
	}
	if (!valid_params(dir, search, new))
	{
		free(new);
		return 0;
	}
	if (!init_adj(new))
		return 0;
	new->vis = (int*)malloc(sizeof(int) * new->vertx);
	new->rank = (int*)malloc(sizeof(int) * new->vertx);
	new->search = search - 1;
	memset(new->vis, 0, new->vertx * sizeof(int));
	memset(new->rank, 0 , new->vertx * sizeof(int));
	new->ranked = (t_vect*)malloc(sizeof(t_vect) * (new->vertx + 1));
	for (int i = 0; i < new->vertx + 1 ; i++)
		init_vector(&(new->ranked[i]));
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc20(%rip), %rdi       # 0x2044
xorl %r14d, %r14d
leaq -0x30(%rbp), %r15
leaq -0x2c(%rbp), %r12
leaq -0x28(%rbp), %rcx
leaq -0x24(%rbp), %r8
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1080
movl (%r15), %edi
movl (%r12), %esi
movq %rbx, %rdx
callq 0x1dc9
testl %eax, %eax
je 0x14ff
movl -0x28(%rbp), %edi
movl -0x24(%rbp), %esi
movq %rbx, %rdx
callq 0x1d28
testl %eax, %eax
je 0x14ff
movq %rbx, %rdi
callq 0x1398
testl %eax, %eax
je 0x1517
movslq 0x28(%rbx), %r15
leaq (,%r15,4), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x1060
movq %rax, 0x18(%rbx)
movl $0x1, %edi
movq %r14, %rsi
callq 0x1060
movq %rax, 0x20(%rbx)
movl -0x24(%rbp), %eax
decl %eax
movl %eax, 0x38(%rbx)
leaq (%r15,%r15,2), %rax
leaq 0x18(,%rax,8), %rdi
callq 0x1070
movq %rax, 0x10(%rbx)
movl $0x1, %r14d
testq %r15, %r15
js 0x1507
movq $-0x1, %r15
xorl %r12d, %r12d
movq 0x10(%rbx), %rdi
addq %r12, %rdi
callq 0x1e50
movslq 0x28(%rbx), %rax
incq %r15
addq $0x18, %r12
cmpq %rax, %r15
jl 0x14e1
jmp 0x1507
movq %rbx, %rdi
callq 0x1030
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x1507
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/graph.c
// Function: get_edges
int 	get_edges(t_graph *g)
{
	t_pair *got = (t_pair*)malloc(sizeof(t_pair)*g->in_edg);

	for (int i = 0; i < g->in_edg; i++)
	{
		scanf("%d %d",&(got[i].x),&(got[i].y));
		if (!valid_edge(got, i, g))
			return (error_edge(got, i));
	}
	insert_edges(got, g);
	free(got);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x30(%rdi), %r15
leaq (,%r15,8), %rdi
callq 0x1070
movq %rax, %r14
testq %r15, %r15
jle 0x1586
leaq 0xafd(%rip), %r12       # 0x204a
movq %r14, %r13
xorl %r15d, %r15d
leaq 0x4(%r13), %rdx
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1080
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x1d53
testl %eax, %eax
je 0x15ad
incq %r15
movslq 0x30(%rbx), %rax
addq $0x8, %r13
cmpq %rax, %r15
jl 0x1553
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1357
movq %r14, %rdi
callq 0x1030
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12ac
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/graph.c
// Function: generate_graph
t_graph *generate_graph()
{
	t_graph *new = (t_graph*)malloc(sizeof(t_graph));
	if (!get_dimensions(new))
		error(WRONG_INPUT);
	if (!get_edges(new))
		error(WRONG_EDGE);
	return (new);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x40, %edi
callq 0x1070
movq %rax, %rbx
movq %rax, %rdi
callq 0x140b
testl %eax, %eax
jne 0x15ec
xorl %edi, %edi
callq 0x12cc
movq %rbx, %rdi
callq 0x151c
testl %eax, %eax
jne 0x1602
movl $0x1, %edi
callq 0x12cc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/graph.c
// Function: find_all_paths
void	find_all_paths(t_graph *g, int start)
{
	t_vect *spur = (t_vect*)malloc(sizeof(t_vect));
	t_queue *bfs = init_queue(); 
	init_vector(spur);
	push_back(spur, start);
	push_q(bfs, create_state(start, spur));
	while (bfs->size > 0)
	{
		t_qlayer *front = bfs->head;
		for (int i = 0; i < (int)g->adj[front->node].used; i++)
		{
			for (int j = 0; j < (int)front->prefix->used; j++)
				if (front->prefix->tab[j] == g->adj[front->node].tab[i])
					goto st;
			add_path(g, append(front->prefix, g->adj[front->node].tab[i]), start);
			push_q(bfs, create_state(g->adj[front->node].tab[i], append(front->prefix, g->adj[front->node].tab[i])));
st:;
		}	
		pop_q(bfs);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x18, %edi
callq 0x1070
movq %rax, %r12
xorl %eax, %eax
callq 0x1d0e
movq %rax, %r15
movq %r12, %rdi
callq 0x1e50
movq %r12, %rdi
movl %ebx, %esi
callq 0x1f03
movl %ebx, -0x2c(%rbp)
movl %ebx, %edi
movq %r12, %rsi
callq 0x11aa
movq %r15, %rdi
movq %rax, %rsi
callq 0x1c6c
cmpq $0x0, 0x10(%r15)
je 0x1739
movq (%r15), %r13
movq (%r14), %rax
movl 0x18(%r13), %ecx
movslq %ecx, %rdx
leaq (%rdx,%rdx,2), %rsi
cmpl $0x0, 0x10(%rax,%rsi,8)
jle 0x172c
xorl %ebx, %ebx
movq (%r13), %rdi
movq 0x10(%rdi), %r8
leaq (%rdx,%rdx,2), %rsi
testl %r8d, %r8d
jle 0x16be
movq (%rdi), %rdx
movq (%rax,%rsi,8), %rsi
movl (%rsi,%rbx,4), %esi
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %r9d, %r9d
cmpl %esi, (%rdx,%r9,4)
je 0x1714
incq %r9
cmpq %r9, %r8
jne 0x16ae
jmp 0x16c5
movq (%rax,%rsi,8), %rax
movl (%rax,%rbx,4), %esi
callq 0x121d
movq %r14, %rdi
movq %rax, %rsi
movl -0x2c(%rbp), %edx
callq 0x1be4
movq (%r14), %rax
movslq 0x18(%r13), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax,%rbx,4), %r12d
movq (%r13), %rdi
movl %r12d, %esi
callq 0x121d
movl %r12d, %edi
movq %rax, %rsi
callq 0x11aa
movq %r15, %rdi
movq %rax, %rsi
callq 0x1c6c
movq (%r14), %rax
movl 0x18(%r13), %ecx
incq %rbx
movslq %ecx, %rdx
leaq (%rdx,%rdx,2), %rsi
movslq 0x10(%rax,%rsi,8), %rsi
cmpq %rsi, %rbx
jl 0x1689
movq %r15, %rdi
callq 0x1caa
jmp 0x1660
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/main_rank.c
// Function: all_paths_are_good
int		all_paths_are_good(t_graph *g, int src, int dest, int rank)
{
	size_t pos = 0;
	int		tag = 0;

	while (pos < g->paths[src]->used)
	{
		if (g->paths[src]->path[pos].tab[g->paths[src]->path[pos].used - 1] != dest )
		{
			pos++;
			continue;
		}
		tag = 0;
		if ((int)g->paths[src]->path[pos].used <= 2)
			return 0;
		for (int i = 1; i < (int)g->paths[src]->path[pos].used - 1; i++)
		{
			if (g->rank[g->paths[src]->path[pos].tab[i]] == 0 || g->rank[g->paths[src]->path[pos].tab[i]] > rank)
			{
				tag = 1;
				break;
			}
		}
		if (!tag)
			return 0;
		pos++;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x8(%rdi), %rax
movslq %esi, %rsi
movq (%rax,%rsi,8), %r8
movq 0x10(%r8), %rsi
movl $0x1, %eax
testq %rsi, %rsi
je 0x17bf
movq (%r8), %r8
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r11
movq (%r8,%r11,8), %r10
movq 0x10(%r8,%r11,8), %r11
cmpl %edx, -0x4(%r10,%r11,4)
jne 0x17b3
cmpl $0x3, %r11d
jl 0x17bd
decl %r11d
movq 0x20(%rdi), %rbx
movl $0x1, %r14d
movslq (%r10,%r14,4), %r15
movl (%rbx,%r15,4), %r15d
testl %r15d, %r15d
je 0x17b3
cmpl %ecx, %r15d
jg 0x17b3
incq %r14
cmpq %r14, %r11
jne 0x1797
jmp 0x17bd
incq %r9
cmpq %rsi, %r9
jne 0x1770
jmp 0x17bf
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/main_rank.c
// Function: main
int main()
{
	t_graph *g;
	g = generate_graph();
	init_paths(g);
	int unexplored = 1;
	// finds all paths between all points
	for (int i = 0; i < g->vertx; i++)
		find_all_paths(g, i);
	// loops over all scc s
	while (unexplored)
	{
		unexplored = 0;
		// greedy search for a minimal ranking
		rank(g, g->search);
		// check for unexplored vertices
		for (int i = 0; i < g->vertx; i++)
			if (g->rank[i] == 0)
			{
			   unexplored = 1;
			   g->search = i;
			}
	}
	for (int i = 0; i < g->vertx; i++)
		printf("%d ", g->rank[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x15c6
movq %rax, %rbx
movq %rax, %rdi
callq 0x1a34
cmpl $0x0, 0x28(%rbx)
jle 0x19e5
movq %rbx, %rdi
movl %r14d, %esi
callq 0x160c
incl %r14d
cmpl 0x28(%rbx), %r14d
jl 0x19ad
jmp 0x19e5
movq 0x20(%rbx), %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpl $0x0, (%rcx,%rdx,4)
jne 0x19d9
movl %edx, 0x38(%rbx)
movl $0x1, %esi
incq %rdx
cmpq %rdx, %rax
jne 0x19cb
testl %esi, %esi
je 0x19fb
movl 0x38(%rbx), %esi
movq %rbx, %rdi
callq 0x17c6
movslq 0x28(%rbx), %rax
testq %rax, %rax
jg 0x19c3
jmp 0x1a27
testl %eax, %eax
jle 0x1a27
leaq 0x64a(%rip), %r14       # 0x2050
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
incq %r15
movslq 0x28(%rbx), %rax
cmpq %rax, %r15
jl 0x1a09
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/path_routines.c
// Function: init_paths
void	init_paths(t_graph *g)
{
	t_paths **new = (t_paths**)malloc(sizeof(t_paths*) * g->vertx);

	for (int i = 0; i < g->vertx ; i++)
	{
		new[i] = (t_paths*)malloc(sizeof(t_paths));
		new[i]->path = (t_vect*)malloc(sizeof(t_vect)*50);
		for (int j = 0; j < 50; j++)
			init_vector(&new[i]->path[j]);
		new[i]->size = 50;
		new[i]->used = 0;
	}
	g->paths = new;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x28(%rdi), %r15
leaq (,%r15,8), %rdi
callq 0x1070
movq %rax, %r14
testq %r15, %r15
jle 0x1ab6
xorl %r12d, %r12d
movl $0x18, %edi
callq 0x1070
movq %rax, %r15
movq %rax, (%r14,%r12,8)
movl $0x4b0, %edi            # imm = 0x4B0
callq 0x1070
movq %rax, (%r15)
xorl %r13d, %r13d
movq (%r15), %rdi
addq %r13, %rdi
callq 0x1e50
addq $0x18, %r13
cmpq $0x4b0, %r13            # imm = 0x4B0
jne 0x1a82
movq $0x32, 0x8(%r15)
movq $0x0, 0x10(%r15)
incq %r12
movslq 0x28(%rbx), %rax
cmpq %rax, %r12
jl 0x1a61
movq %r14, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/path_routines.c
// Function: extend_paths
void	extend_paths(t_graph *g, int start)
{
	size_t new_size = g->paths[start]->size * 2;

	t_vect *copy = (t_vect*)malloc(sizeof(t_vect)*new_size); 
	for (int i = 0; i < (int)new_size; i++)
		init_vector(&copy[i]);
	for (int i = 0; i < (int)g->paths[start]->size; i++)
	{
		for (int j = 0; j < (int)g->paths[start]->path[i].used; j++)
			push_back(&copy[i],g->paths[start]->path[i].tab[j]);
	}
	g->paths[start]->path = copy;
	g->paths[start]->size = new_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, -0x40(%rbp)
movq 0x8(%rdi), %r13
movslq %esi, %r12
movq (%r13,%r12,8), %r14
movq 0x8(%r14), %rbx
leaq (%rbx,%rbx), %r15
movq %rbx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
callq 0x1070
movq %rax, -0x30(%rbp)
movq %r15, -0x38(%rbp)
testl %r15d, %r15d
jle 0x1b3f
movq -0x38(%rbp), %rbx
andl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x1e50
addq $0x18, %r15
decq %rbx
jne 0x1b1d
movq -0x40(%rbp), %rax
movq 0x8(%rax), %r13
movq (%r13,%r12,8), %r14
movq 0x8(%r14), %rbx
movq %r12, -0x48(%rbp)
testl %ebx, %ebx
jle 0x1bbd
movq (%r14), %rax
xorl %edx, %edx
movq -0x48(%rbp), %r15
movq -0x40(%rbp), %r12
movq %rdx, -0x58(%rbp)
leaq (%rdx,%rdx,2), %rcx
movq %rcx, -0x50(%rbp)
cmpl $0x0, 0x10(%rax,%rcx,8)
jle 0x1bad
movq -0x50(%rbp), %rdx
leaq (%rax,%rdx,8), %rcx
movq -0x30(%rbp), %rax
leaq (%rax,%rdx,8), %rax
movq %rax, -0x60(%rbp)
xorl %ebx, %ebx
movq (%rcx), %rax
movl (%rax,%rbx,4), %esi
movq -0x60(%rbp), %rdi
callq 0x1f03
incq %rbx
movq 0x8(%r12), %r13
movq (%r13,%r15,8), %r14
movq (%r14), %rax
movq -0x50(%rbp), %rcx
leaq (%rax,%rcx,8), %rcx
movslq 0x10(%rcx), %rdx
cmpq %rdx, %rbx
jl 0x1b7d
movq -0x58(%rbp), %rdx
incq %rdx
movslq 0x8(%r14), %rcx
cmpq %rcx, %rdx
jl 0x1b54
movq -0x30(%rbp), %rax
movq %rax, (%r14)
movq -0x48(%rbp), %rax
movq (%r13,%rax,8), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/path_routines.c
// Function: add_path
void	add_path(t_graph *g, t_vect *new, int start)
{
	size_t pos = g->paths[start]->used;
	size_t size = g->paths[start]->size;

	if (pos >= size)
		extend_paths(g, start);
	for (int i = 0 ; i < (int)new->used; i++)
		push_back(&g->paths[start]->path[pos], new->tab[i]);
	g->paths[start]->used++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movslq %edx, %r15
movq (%rax,%r15,8), %rax
movq 0x10(%rax), %r13
cmpq 0x8(%rax), %r13
jb 0x1c17
movq %rbx, %rdi
movl %edx, %esi
callq 0x1ac9
cmpl $0x0, 0x10(%r14)
jle 0x1c50
xorl %r12d, %r12d
leaq (%r13,%r13,2), %r13
shlq $0x3, %r13
movq 0x8(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax), %rdi
addq %r13, %rdi
movq (%r14), %rax
movl (%rax,%r12,4), %esi
callq 0x1f03
incq %r12
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jl 0x1c2a
movq 0x8(%rbx), %rax
movq (%rax,%r15,8), %rax
incq 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/queue.c
// Function: push_q
void	push_q(t_queue *que, t_qlayer *new)
{
	if (que->size == 0)
	{
		new->next = NULL;
		new->prev = NULL;
		que->head = new;
		que->tail = new;
	}
	else
	{
		new->prev = que->tail;
		que->tail->next = new;
		que->tail = new;
		new->next = NULL;
	}
	que->size++;
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1c94
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rsi)
movq %rsi, 0x10(%rcx)
movq %rsi, 0x8(%rdi)
movq $0x0, 0x10(%rsi)
popq %rbp
jmp 0x1ca2
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movq %rsi, (%rdi)
movq %rsi, 0x8(%rdi)
incq %rax
movq %rax, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/validation.c
// Function: valid_params
int		valid_params(int dir, int node, t_graph *g)
{
	if (dir != 0 && dir != 1)
		return 0;
	if (node <= 0 || node > g->vertx)
		return 0;
	g->search = node - 1;
	g->direct = dir;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x2, %edi
setae %cl
testl %esi, %esi
setle %r8b
xorl %eax, %eax
orb %cl, %r8b
jne 0x1d51
cmpl %esi, 0x28(%rdx)
jl 0x1d51
decl %esi
movl %esi, 0x38(%rdx)
movl %edi, 0x34(%rdx)
movl $0x1, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/validation.c
// Function: valid_edge
int		valid_edge(t_pair *got, int i, t_graph *g)
{
	got[i].x--;
	got[i].y--;
	if (got[i].x < 0 || got[i].x >= g->vertx)
	   return 0;
	if (got[i].y < 0 || got[i].y >= g->vertx)
		return 0;
	if (g->direct == 0 && got[i].x > got[i].y)
		swap(&got[i].x, &got[i].y);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movslq %esi, %rcx
movl (%rdi,%rcx,8), %eax
movl 0x4(%rdi,%rcx,8), %esi
leal -0x1(%rax), %r8d
movl %r8d, (%rdi,%rcx,8)
leal -0x1(%rsi), %r8d
movl %r8d, 0x4(%rdi,%rcx,8)
xorl %ebx, %ebx
testl %eax, %eax
jle 0x1dc0
movl 0x28(%rdx), %r8d
cmpl %r8d, %eax
jg 0x1dc0
testl %esi, %esi
setle %r9b
cmpl %r8d, %esi
setg %r8b
orb %r9b, %r8b
jne 0x1dc0
cmpl $0x0, 0x34(%rdx)
sete %dl
cmpl %esi, %eax
seta %al
andb %dl, %al
movl $0x1, %ebx
cmpb $0x1, %al
jne 0x1dc0
leaq (%rdi,%rcx,8), %rax
leaq (%rdi,%rcx,8), %rsi
addq $0x4, %rsi
movq %rax, %rdi
callq 0x119c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/validation.c
// Function: valid_dimensions
int 	valid_dimensions(int n, int m, t_graph *g)
{
	if (n < 0 || m < 0)
		return 0;
	g->vertx = n;
	g->edg = 0;
	g->in_edg = m;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
orl %edi, %eax
js 0x1de7
movl %edi, 0x28(%rdx)
movl $0x0, 0x2c(%rdx)
movl %esi, 0x30(%rdx)
movl $0x1, %eax
jmp 0x1de9
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/queue_int.c
// Function: push_q_i
void	push_q_i(t_queue_int *que, t_qlayer_int *new)
{
	if (que->size == 0)
	{
		new->next = NULL;
		new->prev = NULL;
		que->head = new;
		que->tail = new;
	}
	else
	{
		new->prev = que->tail;
		que->tail->next = new;
		que->tail = new;
		new->next = NULL;
	}
	que->size++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1e0f
leaq 0x8(%rdi), %rcx
movq 0x8(%rdi), %rdx
movq %rdx, (%rsi)
movq %rsi, 0x8(%rdx)
xorl %edx, %edx
movq %rsi, %r8
jmp 0x1e1e
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
movq %rdi, %rcx
movq %rdi, %r8
movq %rsi, %rdx
movq %rsi, (%rcx)
movq %rdx, 0x8(%r8)
incq %rax
movq %rax, 0x10(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/queue_int.c
// Function: pop_q_i
void	pop_q_i(t_queue_int *que)
{
	t_qlayer_int *tmp;
	if (que->size < 1)
		return;
	else
		tmp = que->head->next;
		que->head = tmp;
		que->size--;
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1e4d
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%rdi)
decq %rax
movq %rax, 0x10(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/vector.c
// Function: extend_vector
void	extend_vector(t_vect *v, int a)
{
	size_t	size = v->size;
	size_t	new_size = size * 2;
	int		*new_nodes = (int*)malloc(sizeof(int)*new_size);

	copy_vector(v->tab, new_nodes, size);
	free(v->tab);
	v->size = new_size;
	v->tab = new_nodes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r15
leaq (,%r15,8), %rdi
callq 0x1070
movq %rax, %r14
movq (%rbx), %rdi
testl %r15d, %r15d
jle 0x1ec9
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movl (%rdi,%rcx,4), %edx
movl %edx, (%r14,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x1eba
addq %r15, %r15
callq 0x1030
movq %r15, 0x8(%rbx)
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jalalium[P]graph_algorithms_task/src_ranking/vector.c
// Function: push_back
void	push_back(t_vect *v, int val)
{
	size_t pos = v->used;
	size_t size = v->size;

	if (pos + 1 == size)
		extend_vector(v, val);
	v->tab[pos] = val;
	v->used++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq 0x10(%rdi), %r15
leaq 0x1(%r15), %rax
cmpq 0x8(%rdi), %rax
jne 0x1f30
movq %rbx, %rdi
callq 0x1e87
movq 0x10(%rbx), %rax
incq %rax
movq (%rbx), %rcx
movl %r14d, (%rcx,%r15,4)
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/zpole[P]IICV/src/test_sqrti.c
// Function: main
int
main (int argc VL_UNUSED, char** argv VL_UNUSED)
{
  vl_index i ;
  for (i = 0 ; i < 0xff ; ++i) {
    vl_uint8 x = (vl_uint8)i ;
    vl_uint8 r = vl_fast_sqrt_ui8(x) ;
    vl_uint8 r_ = (vl_uint8) floor(sqrt((double)x)) ;
    if (r != r_) abort() ;
    /* printf("sqrt(%5d) = %5d -- %5d\n", i, r, r_) ; */
  }

  for (i = 0 ; i < 0xffffffff ; ++i) {
    vl_uint16 x = (vl_uint16)i ;
    vl_uint16 r = vl_fast_sqrt_ui16(x) ;
    vl_uint16 r_ = (vl_uint8) floor(sqrt((double)x)) ;
    if (r != r_) abort() ;
    /* printf("sqrt(%5d) = %5d -- %5d\n", i, r, r_) ; */
  }

  return 0 ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
xorl %r14d, %r14d
movl $0x6, %ecx
xorl %r15d, %r15d
movl %r14d, %eax
addb %r15b, %r15b
movzbl %r15b, %r15d
leal 0x1(,%r15,2), %edx
shll %cl, %edx
movzbl %al, %eax
andl $0xfd, %edx
cmpl %eax, %edx
setbe %sil
cmoval %ebx, %edx
subb %dl, %al
orb %sil, %r15b
addl $-0x2, %ecx
cmpl $-0x2, %ecx
jne 0x1164
movzbl %r14b, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
sqrtsd %xmm0, %xmm0
callq 0x1040
cvttsd2si %xmm0, %eax
cmpb %al, %r15b
jne 0x123a
incq %r14
cmpq $0xff, %r14
jne 0x1159
xorl %ebx, %ebx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movl $0xe, %ecx
xorl %r12d, %r12d
movl %r15d, %eax
leal 0x1(,%r12,4), %edx
shll %cl, %edx
movzwl %ax, %esi
andl $0xfffd, %edx           # imm = 0xFFFD
xorl %edi, %edi
cmpl %esi, %edx
setbe %dil
cmoval %ebx, %edx
subl %edx, %eax
leal (%rdi,%r12,2), %r12d
addl $-0x2, %ecx
cmpl $-0x2, %ecx
jne 0x11d7
movzwl %r15w, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
sqrtsd %xmm0, %xmm0
callq 0x1040
cvttsd2si %xmm0, %eax
movzbl %al, %eax
cmpw %ax, %r12w
jne 0x123a
incq %r15
cmpq %r14, %r15
jne 0x11cc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x1030
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/lunarkeyakv2/compact/KeccakP-1600-compact64.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)
{
    tSmallUInt i;
    tKeccakLane lane = ((tKeccakLane*)state)[lanePosition];
    lane >>= offset*8;
    for(i=0; i<length; i++) {
        output[i] = input[i] ^ (lane & 0xFF);
        lane >>= 8;
    }
}

// Assembly:
testl %r9d, %r9d
je 0x5c24
movl %esi, %eax
shll $0x3, %r8d
shrxq %r8, (%rdi,%rax,8), %rax
movl %r9d, %esi
xorl %edi, %edi
movb (%rdx,%rdi), %r8b
xorb %al, %r8b
movb %r8b, (%rcx,%rdi)
shrq $0x8, %rax
incq %rdi
cmpq %rdi, %rsi
jne 0x5c0d
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/lunarkeyakv2/compact/KeccakP-200-compact.c
// Function: KeccakP200_AddBytes
void KeccakP200_AddBytes(void *argState, const unsigned char *data, unsigned int offset, unsigned int length)
{
    tSmallUInt i;
    tKeccakLane * state = (tKeccakLane*)argState + offset;
    for(i=0; i<length; i++)
        state[i] ^= data[i];
}

// Assembly:
testl %ecx, %ecx
je 0x638c
movl %edx, %eax
addq %rax, %rdi
movl %ecx, %eax
xorl %ecx, %ecx
movb (%rsi,%rcx), %dl
xorb %dl, (%rdi,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x637e
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/lunarkeyakv2/compact/KeccakP-200-compact.c
// Function: KeccakP200_ExtractAndAddBytes
void KeccakP200_ExtractAndAddBytes(const void *argState, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
{
    unsigned int i;
    tKeccakLane * state = (tKeccakLane*)argState + offset;
    for(i=0; i<length; i++)
        output[i] = input[i] ^ state[i];
}

// Assembly:
testl %r8d, %r8d
je 0x6557
movl %ecx, %eax
addq %rax, %rdi
movl %r8d, %eax
xorl %ecx, %ecx
movb (%rdi,%rcx), %r8b
xorb (%rsi,%rcx), %r8b
movb %r8b, (%rdx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x6543
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/lunarkeyakv2/compact/KeccakP-800-compact.c
// Function: KeccakP800_AddBytes
void KeccakP800_AddBytes(void *argState, const unsigned char *data, unsigned int offset, unsigned int length)
{
    tSmallUInt i;
    unsigned char * state = (unsigned char*)argState + offset;

    for(i=0; i<length; i++)
        ((unsigned char *)state)[i] ^= data[i];
}

// Assembly:
testl %ecx, %ecx
je 0x6b97
movl %edx, %eax
addq %rax, %rdi
movl %ecx, %eax
xorl %ecx, %ecx
movb (%rsi,%rcx), %dl
xorb %dl, (%rdi,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x6b89
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/lunarkeyakv2/compact/KeccakP-800-compact.c
// Function: KeccakP800_ExtractAndAddBytes
void KeccakP800_ExtractAndAddBytes(const void *argState, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
{
    tSmallUInt i;
    const unsigned char * state = (const unsigned char*)argState + offset;

    for(i=0; i<length; i++)
        output[i] = input[i] ^ state[i];
}

// Assembly:
testl %r8d, %r8d
je 0x6dd6
movl %ecx, %eax
addq %rax, %rdi
movl %r8d, %eax
xorl %ecx, %ecx
movb (%rdi,%rcx), %r8b
xorb (%rsi,%rcx), %r8b
movb %r8b, (%rdx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x6dc2
retq
nop
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: str_quote
const char *str_quote(const char *s)
{
	static char buf[1024];
	int r = snprintf(buf, sizeof(buf), "\"%.*s\"", (int)sizeof(buf) - 4, s);
	if (r >= (int)sizeof(buf)) {
		buf[sizeof(buf) - 1] = 0;
	}
	return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %r8
leaq 0xe79ba(%rip), %rdi     # 0x4ea470
leaq 0xb17aa(%rip), %rdx     # 0x4b4267
movl $0x400, %esi            # imm = 0x400
movl $0x3fc, %ecx            # imm = 0x3FC
xorl %eax, %eax
callq 0x40d8b0
cmpl $0x400, %eax            # imm = 0x400
jl 0x402adc
movb $0x0, 0xe7d93(%rip)     # 0x4ea86f
leaq 0xe798d(%rip), %rax     # 0x4ea470
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: parse_addr
void parse_addr(struct net_addr *netaddr, const char *addr)
{
	char *colon = strrchr(addr, ':');
	if (colon == NULL) {
		FATAL("You forgot to specify port");
	}
	int port = atoi(colon + 1);
	if (port < 0 || port > 65535) {
		FATAL("Invalid port number %d", port);
	}
	char host[255];
	int addr_len = colon - addr > 254 ? 254 : colon - addr;
	strncpy(host, addr, addr_len);
	host[addr_len] = '\0';
	net_gethostbyname(netaddr, host, port);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x3a, %esi
callq 0x401058
testq %rax, %rax
je 0x402b7d
movq %rax, %r12
leaq 0x1(%rax), %rdi
callq 0x40bb00
movl %eax, %r15d
cmpl $0x10000, %eax          # imm = 0x10000
jae 0x402b82
subq %r14, %r12
movl $0xfe, %eax
cmpq %rax, %r12
cmovgeq %rax, %r12
movslq %r12d, %r12
leaq -0x130(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x401088
movb $0x0, -0x130(%rbp,%r12)
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x402b8a
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x40114b
movl %r15d, %edi
callq 0x401100
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: net_gethostbyname
void net_gethostbyname(struct net_addr *shost, const char *host, int port)
{
	memset(shost, 0, sizeof(struct net_addr));

	struct in_addr in_addr;
	struct in6_addr in6_addr;

	/* Try ipv4 address first */
	if (inet_pton(AF_INET, host, &in_addr) == 1) {
		goto got_ipv4;
	}

	/* Then ipv6 */
	if (inet_pton(AF_INET6, host, &in6_addr) == 1) {
		goto got_ipv6;
	}

	FATAL("inet_pton(%s)", str_quote(host));
	return;

got_ipv4:
	shost->ipver = 4;
	shost->sockaddr = (struct sockaddr *)&shost->sin4;
	shost->sockaddr_len = sizeof(shost->sin4);
	shost->sin4.sin_family = AF_INET;
	shost->sin4.sin_port = htons(port);
	shost->sin4.sin_addr = in_addr;
	return;

got_ipv6:
	shost->ipver = 6;
	shost->sockaddr = (struct sockaddr *)&shost->sin6;
	shost->sockaddr_len = sizeof(shost->sin4);
	shost->sin6.sin6_family = AF_INET6;
	shost->sin6.sin6_port = htons(port);
	shost->sin6.sin6_addr = in6_addr;
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq -0x1c(%rbp), %rdx
movl $0x2, %edi
callq 0x460b60
cmpl $0x1, %eax
jne 0x402bf2
movl $0x4, (%rbx)
leaq 0x4(%rbx), %rax
movq %rax, 0x30(%rbx)
movl $0x10, 0x38(%rbx)
rolw $0x8, %r14w
movw $0x2, 0x4(%rbx)
movw %r14w, 0x6(%rbx)
movl -0x1c(%rbp), %eax
movl %eax, 0x8(%rbx)
jmp 0x402c35
leaq -0x2c(%rbp), %rdx
movl $0xa, %edi
movq %r15, %rsi
callq 0x460b60
cmpl $0x1, %eax
jne 0x402c40
movl $0x6, (%rbx)
leaq 0x14(%rbx), %rax
movq %rax, 0x30(%rbx)
movl $0x10, 0x38(%rbx)
rolw $0x8, %r14w
movw $0xa, 0x14(%rbx)
movw %r14w, 0x16(%rbx)
movups -0x2c(%rbp), %xmm0
movups %xmm0, 0x1c(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x401198
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: addr_to_str
const char *addr_to_str(struct net_addr *addr)
{
	char dst[INET6_ADDRSTRLEN + 1];
	int port = 0;

	switch (addr->ipver) {
	case 4: {
		inet_ntop(AF_INET, &addr->sin4.sin_addr, dst, INET6_ADDRSTRLEN);
		port = ntohs(addr->sin4.sin_port);
	} break;
	case 16: {
		inet_ntop(AF_INET6, &addr->sin6.sin6_addr, dst,
			  INET6_ADDRSTRLEN);
		port = ntohs(addr->sin6.sin6_port);
	} break;
	default:
		dst[0] = '?';
		dst[1] = 0x00;
	}

	static char buf[255];
	snprintf(buf, sizeof(buf), "%s:%i", dst, port);
	return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x10, %eax
je 0x402c7d
cmpl $0x4, %eax
jne 0x402c9e
leaq 0x8(%rbx), %rsi
leaq -0x40(%rbp), %rdx
movl $0x2, %edi
movl $0x2e, %ecx
callq 0x460020
movzwl 0x6(%rbx), %eax
jmp 0x402c98
leaq 0x1c(%rbx), %rsi
leaq -0x40(%rbp), %rdx
movl $0xa, %edi
movl $0x2e, %ecx
callq 0x460020
movzwl 0x16(%rbx), %eax
rolw $0x8, %ax
jmp 0x402ca6
movw $0x3f, -0x40(%rbp)
xorl %eax, %eax
movzwl %ax, %r8d
leaq 0xe7bbf(%rip), %rbx     # 0x4ea870
leaq 0xb1655(%rip), %rdx     # 0x4b430d
leaq -0x40(%rbp), %rcx
movl $0xff, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x40d8b0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: net_bind_udp
int net_bind_udp(struct net_addr *shost, int reuseport, int busy_poll)
{
	int sd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
	if (sd < 0) {
		PFATAL("socket()");
	}

	int one = 1;
	int r = setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (char *)&one,
			   sizeof(one));
	if (r < 0) {
		PFATAL("setsockopt(SO_REUSEADDR)");
	}

	if (reuseport) {
		one = 1;
		r = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT, (char *)&one,
			       sizeof(one));
		if (r < 0) {
			PFATAL("setsockopt(SO_REUSEPORT)");
		}
	}

	one = 1;
	r = setsockopt(sd, SOL_IP, IP_PKTINFO, (char *)&one, sizeof(one));
	if (r < 0) {
		PFATAL("setsockopt(IP_PKTINFO)");
	}

	if (bind(sd, shost->sockaddr, shost->sockaddr_len) < 0) {
		PFATAL("bind()");
	}

	if (busy_poll) {
		r = setsockopt(sd, SOL_SOCKET, SO_BUSY_POLL, (char *)&busy_poll,
			       sizeof(busy_poll));
		if (r < 0) {
			PFATAL("setsockopt(SO_BUSY_POLL)");
		}
	}

	return sd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, %r15
movl %edx, -0x28(%rbp)
movl $0x2, %edi
movl $0x2, %esi
movl $0x11, %edx
callq 0x45fc40
testl %eax, %eax
js 0x402dc9
movl %eax, %ebx
leaq -0x24(%rbp), %rcx
movl $0x1, (%rcx)
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x45fc00
testl %eax, %eax
js 0x402dce
testl %r12d, %r12d
je 0x402d61
leaq -0x24(%rbp), %rcx
movl $0x1, (%rcx)
movl %ebx, %edi
movl $0x1, %esi
movl $0xf, %edx
movl $0x4, %r8d
callq 0x45fc00
testl %eax, %eax
js 0x402ddd
leaq -0x24(%rbp), %rcx
movl $0x1, (%rcx)
movl %ebx, %edi
xorl %esi, %esi
movl $0x8, %edx
movl $0x4, %r8d
callq 0x45fc00
testl %eax, %eax
js 0x402dd3
movq 0x30(%r15), %rsi
movl 0x38(%r15), %edx
movl %ebx, %edi
callq 0x45f9b0
testl %eax, %eax
js 0x402dd8
testl %r14d, %r14d
je 0x402dba
leaq -0x28(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x2e, %edx
movl $0x4, %r8d
callq 0x45fc00
testl %eax, %eax
js 0x402de2
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x4013ef
callq 0x401389
callq 0x401323
callq 0x4012bd
callq 0x4011f1
callq 0x401257
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: net_bind_tcp
int net_bind_tcp(struct net_addr *shost, int reuseport)
{
	int sd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
	if (sd < 0) {
		PFATAL("socket()");
	}

	int one = 1;
	int r = setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (char *)&one,
			   sizeof(one));
	if (r < 0) {
		PFATAL("setsockopt(SO_REUSEADDR)");
	}

	if (reuseport) {
		one = 1;
		r = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT, (char *)&one,
			       sizeof(one));
		if (r < 0) {
			PFATAL("setsockopt(SO_REUSEPORT)");
		}
	}

	r = bind(sd, shost->sockaddr, shost->sockaddr_len);
	if (r < 0) {
		PFATAL("bind()");
	}

	r = listen(sd, 128);
	if (r < 0) {
		PFATAL("listen()");
	}

	return sd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %r14
movl $0x2, %edi
movl $0x1, %esi
movl $0x6, %edx
callq 0x45fc40
testl %eax, %eax
js 0x402e94
movl %eax, %ebx
leaq -0x1c(%rbp), %rcx
movl $0x1, (%rcx)
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x45fc00
testl %eax, %eax
js 0x402e99
testl %r15d, %r15d
je 0x402e64
leaq -0x1c(%rbp), %rcx
movl $0x1, (%rcx)
movl %ebx, %edi
movl $0x1, %esi
movl $0xf, %edx
movl $0x4, %r8d
callq 0x45fc00
testl %eax, %eax
js 0x402ea8
movq 0x30(%r14), %rsi
movl 0x38(%r14), %edx
movl %ebx, %edi
callq 0x45f9b0
testl %eax, %eax
js 0x402e9e
movl %ebx, %edi
movl $0x80, %esi
callq 0x45fa80
testl %eax, %eax
js 0x402ea3
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x4015ed
callq 0x401587
callq 0x401521
callq 0x4014bb
callq 0x401455
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: thread_spawn
struct thread *thread_spawn(void (*callback)(void *), void *userdata)
{
	struct thread *thread = calloc(1, sizeof(struct thread));
	thread->callback = callback;
	thread->userdata = userdata;
	int r = pthread_create(&thread->thread_id, NULL, _thread_start, thread);
	if (r != 0) {
		PFATAL("pthread_create()");
	}
	return thread;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x426f80
movq %rax, %rbx
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
leaq 0x24(%rip), %rdx        # 0x402f02
movq %rax, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x41da20
testl %eax, %eax
jne 0x402efd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x401653
// File: /workspace/github_c_makefile_star2_O3/unixlab[P]cloudflare-udp-ping/net.c
// Function: thread_start
static void *_thread_start(void *userdata)
{
	struct thread *thread = userdata;

	/* Direct all signals to main thread. */
	sigset_t set;
	sigfillset(&set);
	int r = pthread_sigmask(SIG_SETMASK, &set, NULL);
	if (r != 0) {
		PFATAL("pthread_sigmask()");
	}

	thread->callback(thread->userdata);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq -0x90(%rbp), %r14
movq %r14, %rdi
callq 0x40bad0
movl $0x2, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x420fe0
testl %eax, %eax
jne 0x402f4a
movq 0x10(%rbx), %rdi
callq *0x8(%rbx)
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x4016b9