LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: set_byte
static void set_byte(_u32 position, _u32 val) {
  _u32 f, roff;
  
  if (!cur_fuzzable) return;
  position %= cur_fuzzable;

  f = lookup_file(position, 1, &roff);
  load_data(f);

  infile[f].dirty = 1;  
  infile[f].data[roff] = val;
}

// Assembly:
movl 0x4ca9(%rip), %ecx      # 0x81a4
testl %ecx, %ecx
je 0x3551
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movl %edi, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %edi
leaq 0xc(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x380f
movl %eax, %ebp
movl %eax, %edi
callq 0x38ae
movq 0x4c65(%rip), %rax      # 0x8198
movl %ebp, %ecx
shlq $0x5, %rcx
movb $0x1, 0x1c(%rax,%rcx)
movq 0x8(%rax,%rcx), %rax
movl (%r14), %ecx
movb %bl, (%rax,%rcx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: set_word
static void set_word(_u32 position, _u32 val) {
  _u32 f, roff;
  
  if (!cur_fuzzable) return;
  position %= cur_fuzzable;

  f = lookup_file(position, 1, &roff);
  load_data(f);

  infile[f].dirty = 1;  
  
  if (roff + 1 < infile[f].cur_len) 
    *(_u16*)(infile[f].data + roff) = val;
  else {
    /* Assume LE - we're IA32 specific anyway */
    infile[f].data[roff] = val;
    set_byte(position + 1, val >> 8);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x4c45(%rip), %ecx      # 0x81a4
testl %ecx, %ecx
je 0x35b3
movl %esi, %ebx
movl %edi, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %ebp
leaq 0x4(%rsp), %r14
movl %edx, %edi
movl $0x1, %esi
movq %r14, %rdx
callq 0x380f
movl %eax, %r15d
movl %eax, %edi
callq 0x38ae
movq 0x4c06(%rip), %rdx      # 0x8198
movl %r15d, %esi
shlq $0x5, %rsi
movb $0x1, 0x1c(%rdx,%rsi)
movl (%r14), %eax
leal 0x1(%rax), %edi
movq 0x8(%rdx,%rsi), %rcx
cmpl 0x18(%rdx,%rsi), %edi
jae 0x35be
movw %bx, (%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb %bl, (%rcx,%rax)
incl %ebp
shrl $0x8, %ebx
movl %ebp, %edi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x34f5
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: remove_data
static void remove_data(_u32 position, _u32 len) {
  _u32 f, roff;

  if (!len) return;

  f = lookup_file(position, 1, &roff);
  load_data(f);
  
  if (roff == infile[f].cur_len) return; /* EOF already */

  infile[f].dirty = 1;
  
  /* Can remove in one operation? */
  if (roff + len <= infile[f].cur_len) {
    if (roff + len < infile[f].cur_len)
      memmove(infile[f].data + roff, infile[f].data + roff + len, infile[f].cur_len - roff);

    infile[f].data = myrealloc(infile[f].data, infile[f].cur_len - len);

    if (!infile[f].data) fatal("out of memory");
    infile[f].cur_len -= len;
    cur_fuzzable -= len;
  } else {
    _u32 candel = infile[f].cur_len - roff;
    /* Remove everything to EOF, repeat */
    infile[f].data = myrealloc(infile[f].data, roff);
    if (!infile[f].data) fatal("out of memory");
    cur_fuzzable -= candel;
    infile[f].cur_len = roff;
    remove_data(position, len - candel);
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
je 0x36c6
movl %esi, %ebx
movl %edi, %ebp
leaq 0x4(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x380f
movl %eax, %r15d
movl %eax, %edi
callq 0x38ae
movl (%r14), %r14d
movq 0x4b82(%rip), %r12      # 0x8198
movl %r15d, %r13d
shlq $0x5, %r13
movl 0x18(%r12,%r13), %eax
movl %eax, %r15d
subl %r14d, %r15d
je 0x36c6
leaq (%r12,%r13), %rdx
movb $0x1, 0x1c(%rdx)
leal (%r14,%rbx), %ecx
cmpl %eax, %ecx
jbe 0x3681
movq 0x8(%rdx), %rdi
cmpl $0x1, %r14d
movl %r14d, %esi
adcl $0x0, %esi
callq 0x1250
movq %rax, 0x8(%r12,%r13)
testq %rax, %rax
je 0x36d5
subl %r15d, 0x4b42(%rip)     # 0x81a4
movl %r14d, 0x18(%r12,%r13)
subl %r15d, %ebx
movl %ebp, %edi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x35d9
movq %rdx, %rbp
jae 0x369d
addq 0x8(%rdx), %r14
movl %ebx, %esi
addq %r14, %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x1240
movq %rbp, %rdx
movq 0x8(%rdx), %rdi
movl 0x18(%rdx), %esi
subl %ebx, %esi
cmpl $0x1, %esi
adcl $0x0, %esi
callq 0x1250
movq %rax, 0x8(%r12,%r13)
cmpq $0x0, 0x8(%rbp)
je 0x36da
subl %ebx, 0x18(%rbp)
subl %ebx, 0x4ade(%rip)      # 0x81a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2085
callq 0x203b
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: commit_connect
static void commit_connect(_u32 daddr,_u16 dport,_u8 udp) {
  _s32 csock;
  struct sockaddr_in sin;
  
  if (lport) { close(lsock); lport = 0; }
  
  csock = socket(AF_INET, udp ? SOCK_DGRAM : SOCK_STREAM, 0); 
  if (csock < 0) pfatal("socket() failed");
  
  sin.sin_family      = AF_INET;
  sin.sin_port        = dport;
  sin.sin_addr.s_addr = daddr;
  
try_connect_again:
  
  if (connect(csock, (struct sockaddr*)&sin, sizeof(sin))) {
  
    if (errno == ECONNREFUSED) {
      fd_set fds;
      FD_ZERO(&fds);
      FD_SET(0,&fds);

      if (select(1, &fds, 0, &fds, 0) < 0) 
        pfatal("select failed");

      if (FD_ISSET(0,&fds)) {
        debug("NOTE: connect() loop aborted by control command (something went wrong!)\n");
	close(csock);
        return;
      } else {
        sched_yield();
        goto try_connect_again;
      }

    }

    close(csock);
    debug("WARNING: Unable to initialize network connection to target.\n");
    return;
    
  }
  
  commit_data_fd(csock);
  
  close(csock);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movl %edx, %ebx
movl %esi, %r15d
movl %edi, %ebp
cmpw $0x0, 0x4aab(%rip)      # 0x81a8
je 0x3713
movl 0x4aa7(%rip), %edi      # 0x81ac
callq 0x12a0
movw $0x0, 0x4a95(%rip)      # 0x81a8
cmpb $0x1, %bl
movl $0x2, %esi
sbbl $0x0, %esi
movl $0x2, %edi
xorl %edx, %edx
callq 0x1050
testl %eax, %eax
js 0x380a
movl %eax, %ebx
leaq 0x80(%rsp), %r14
movw $0x2, (%r14)
movw %r15w, 0x2(%r14)
movl %ebp, 0x4(%r14)
movq %rsp, %r15
movl %ebx, %edi
movq %r14, %rsi
movl $0x10, %edx
callq 0x10f0
testl %eax, %eax
je 0x37de
callq 0x1030
cmpl $0x6f, (%rax)
jne 0x37fc
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq $0x1, (%rsp)
movl $0x1, %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x1120
testl %eax, %eax
js 0x3805
movq (%rsp), %r12
testb $0x1, %r12b
jne 0x37d5
callq 0x11d0
testb $0x1, %r12b
je 0x374e
jmp 0x37ec
movl %ebx, %edi
callq 0x20f6
jmp 0x37c9
movl %ebx, %edi
callq 0x3b4d
movl %ebx, %edi
callq 0x12a0
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, %edi
callq 0x20cf
jmp 0x37ec
callq 0x211e
callq 0x2174
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: lookup_file
static _u32 lookup_file(_u32 position, _u8 skip_blank, _u32* offset) {
  _u32 i;
  _u32 cpos = 0;
  _s32 last0 = -1;
  
  for (i=0;i < infcount - 1;i++) {
    if (infile[i].asis) continue;
    if (position < cpos + infile[i].cur_len) break;
    if (!infile[i].cur_len && last0 < 0) last0 = i;
      else if (infile[i].cur_len) last0 = -1;
    cpos += infile[i].cur_len;
  }
  
  *offset = position - cpos;
  
  if (!*offset) {
    if (!skip_blank) return last0 > 0 ? last0 : i;
  } else {
    if (position >= cur_fuzzable) *offset = infile[i].cur_len; /* EOF */
  }
  
  return i;

}

// Assembly:
pushq %rbp
pushq %rbx
movl 0x4979(%rip), %eax      # 0x8190
decl %eax
je 0x386a
movq 0x4976(%rip), %r9       # 0x8198
movl %eax, %r10d
addq $0x18, %r9
xorl %r11d, %r11d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
cmpb $0x0, -0x8(%r9)
jne 0x385c
movl (%r9), %ebx
leal (%rbx,%r8), %ebp
cmpl %edi, %ebp
ja 0x3876
testl %ecx, %ecx
movl %r11d, %ebp
cmovnsl %ecx, %ebp
negl %ebx
movl $0x0, %ecx
sbbl %ecx, %ecx
orl %ebp, %ecx
addl (%r9), %r8d
incq %r11
addq $0x20, %r9
cmpq %r11, %r10
jne 0x3834
jmp 0x3879
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
jmp 0x3879
movl %r11d, %eax
movl %edi, %r9d
subl %r8d, %r9d
movl %r9d, (%rdx)
jne 0x3890
testb %sil, %sil
jne 0x38ab
testl %ecx, %ecx
cmovgl %ecx, %eax
jmp 0x38ab
cmpl %edi, 0x490e(%rip)      # 0x81a4
ja 0x38ab
movq 0x48f9(%rip), %rcx      # 0x8198
movl %eax, %esi
shlq $0x5, %rsi
movl 0x18(%rcx,%rsi), %ecx
movl %ecx, (%rdx)
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: load_data
static void load_data(_u32 rec) {
  _s32 fd;

  if (infile[rec].data) return;
  
  if (chdir(indir)) pfatal("cannot enter '%s'",indir);
  if (rec >= infcount) fatal("rec out of range");

  fd = open(infile[rec].fname,O_RDONLY);
    
  if (fd < 0)
    pfatal("unable to access '%s/%s'",indir,infile[rec].fname);
        
  infile[rec].dirty = 0;
  infile[rec].data  = malloc(infile[rec].orig_len);
  if (!infile[rec].data) fatal("out of memory");
    
  if (infile[rec].orig_len)
    if (read(fd,infile[rec].data,infile[rec].orig_len) != infile[rec].orig_len)
      fatal("short read from '%s/%s'",indir,infile[rec].fname);

  close(fd);

  if (chdir(workdir)) pfatal("unable to go back to work directory");

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x48de(%rip), %rax      # 0x8198
movl %edi, %r14d
movq %r14, %r15
shlq $0x5, %r15
cmpq $0x0, 0x8(%rax,%r15)
jne 0x396b
movl %edi, %ebx
movq 0x38a7(%rip), %rdi      # 0x7180
callq 0x11e0
testl %eax, %eax
jne 0x3971
cmpl %ebx, 0x48a4(%rip)      # 0x8190
jbe 0x3976
movq 0x489f(%rip), %rax      # 0x8198
movq (%rax,%r15), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
js 0x397b
movl %eax, %ebx
movq 0x4885(%rip), %r14      # 0x8198
movb $0x0, 0x1c(%r14,%r15)
movl 0x14(%r14,%r15), %edi
callq 0x1190
movq %rax, 0x8(%r14,%r15)
testq %rax, %rax
je 0x3983
addq %r15, %r14
movl 0x14(%r14), %edx
testq %rdx, %rdx
je 0x3954
movl %ebx, %edi
movq %rax, %rsi
callq 0x11c0
movq 0x484e(%rip), %rdi      # 0x8198
movl 0x14(%rdi,%r15), %ecx
cmpq %rcx, %rax
jne 0x398d
movl %ebx, %edi
callq 0x12a0
leaq 0x382e(%rip), %rdi      # 0x7190
callq 0x11e0
testl %eax, %eax
jne 0x3988
popq %rbx
popq %r14
popq %r15
retq
callq 0x21ca
callq 0x2223
movq %r14, %rdi
callq 0x2360
callq 0x2316
callq 0x22c0
addq %r15, %rdi
callq 0x226d
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: get_data
static _u8* get_data(_u32 position, _u32 len,_u8* where) {
  _u32 f, roff;
      
  if (!where) {
    where = malloc(len);
    if (!where) fatal("out of memory");
  }

  if (!len) return where;

  /* Absolutely no data left? Just return zeros */ 
  if (!cur_fuzzable) {
    memset(where, 0, len);
    return where;
  }

  /* Otherwise, just wrap the address space */
  position %= cur_fuzzable;
  
  f = lookup_file(position, 1, &roff);
  load_data(f);
  
  /* Can it be done in a single read? */
  if (roff + len <= infile[f].cur_len) {
    memcpy(where,infile[f].data + roff, len);
  /* Multiple reads needed */
  } else {
    _u32 cancopy = infile[f].cur_len - roff;
    memcpy(where,infile[f].data + roff, cancopy);
    position += cancopy;
    len -= cancopy;
    get_data(position, len, where + cancopy);
  }
  
  return where;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movl %esi, %r14d
movl %edi, %ebp
testq %rdx, %rdx
jne 0x39c2
movl %r14d, %edi
callq 0x1190
movq %rax, %rbx
testq %rax, %rax
je 0x3a74
testl %r14d, %r14d
je 0x3a64
movl 0x47d3(%rip), %ecx      # 0x81a4
testl %ecx, %ecx
je 0x3a46
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %ebp
leaq 0xc(%rsp), %r15
movl %edx, %edi
movl $0x1, %esi
movq %r15, %rdx
callq 0x380f
movl %eax, %r12d
movl %eax, %edi
callq 0x38ae
movl (%r15), %esi
leal (%rsi,%r14), %ecx
movq 0x478f(%rip), %rdx      # 0x8198
movl %r12d, %edi
shlq $0x5, %rdi
leaq (%rdx,%rdi), %rax
movl 0x18(%rdx,%rdi), %r15d
cmpl %r15d, %ecx
jbe 0x3a55
subl %esi, %r15d
addq 0x8(%rax), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x10e0
addl %r15d, %ebp
subl %r15d, %r14d
leaq (%rbx,%r15), %rdx
movl %ebp, %edi
movl %r14d, %esi
callq 0x3995
jmp 0x3a64
movl %r14d, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10c0
jmp 0x3a64
addq 0x8(%rax), %rsi
movl %r14d, %edx
movq %rbx, %rdi
callq 0x10e0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x23cb
// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-flow.c
// Function: set_data
static void set_data(_u32 position, _u32 len,_u8* src) {
  _u32 f, roff;

  if (!cur_fuzzable || !len) return;
  position %= cur_fuzzable;
  
  f = lookup_file(position, 1, &roff);
  load_data(f);

  infile[f].dirty = 1;

  if (roff + len <= infile[f].cur_len) {
    memcpy(infile[f].data + roff, src, len);
  } else {
    _u32 cancopy = infile[f].cur_len - roff;
    memcpy(infile[f].data + roff, src, cancopy);
    position += cancopy;
    len -= cancopy;
    set_data(position, len, src + cancopy);
  }
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movl 0x4716(%rip), %ecx      # 0x81a4
testl %ecx, %ecx
sete %al
testl %esi, %esi
sete %dl
orb %al, %dl
jne 0x3b25
movl %esi, %r14d
movl %edi, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %ebp
leaq 0xc(%rsp), %r15
movl %edx, %edi
movl $0x1, %esi
movq %r15, %rdx
callq 0x380f
movl %eax, %r12d
movl %eax, %edi
callq 0x38ae
movq 0x46c8(%rip), %rcx      # 0x8198
movl %r12d, %edx
shlq $0x5, %rdx
leaq (%rcx,%rdx), %rax
movb $0x1, 0x1c(%rcx,%rdx)
movl (%r15), %edi
leal (%rdi,%r14), %esi
movl 0x18(%rcx,%rdx), %r15d
cmpl %r15d, %esi
jbe 0x3b32
subl %edi, %r15d
addq 0x8(%rax), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x10e0
addl %r15d, %ebp
subl %r15d, %r14d
addq %r15, %rbx
movl %ebp, %edi
movl %r14d, %esi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3a79
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq 0x8(%rax), %rdi
movl %r14d, %edx
movq %rbx, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_06/getline.c
// Function: main
int main(void)
{
  char string[150] = "";

  get_line(string);
  puts(string);

  return 0;
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
movq %rsp, %rbx
movl $0x96, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1040
callq 0x1050
movb %al, (%rbx)
cmpb $0xa, %al
je 0x1190
movzbl %al, %eax
cmpl $0xff, %eax
je 0x1190
incq %rbx
jmp 0x1176
movb $0x0, (%rbx)
movq %rsp, %rdi
callq 0x1030
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/KhuramAli[P]JAM-Benchmark/Single-Producer_Single-Consumer_RingBuffer_Lock-free_boost/code10.cpp
// Function: main
int main(int argc, char* argv[])
{
	using namespace std;
	cout << "boost::lockfree::queue is ";
	if (!spsc_queue.is_lock_free())
		cout << "not ";
	cout << "lockfree" << endl;

	std::thread producer_thread(producer);
	std::thread consumer_thread(consumer);

	producer_thread.join();
	done = true;
	consumer_thread.join();

	cout << "produced " << producer_count << " objects." << endl;
	cout << "consumed " << consumer_count << " objects." << endl;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq 0x2c05(%rip), %rbx      # 0x3fd8
leaq 0xc2a(%rip), %rsi       # 0x2004
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x10c0
leaq 0xc31(%rip), %rsi       # 0x201f
movl $0x8, %edx
movq %rbx, %rdi
callq 0x10c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
leaq -0x1dd(%rip), %rsi      # 0x124c
leaq 0x8(%rsp), %rdi
callq 0x1562
leaq -0x15f(%rip), %rsi      # 0x12db
movq %rsp, %rdi
callq 0x1562
leaq 0x8(%rsp), %rdi
callq 0x10e0
movb $0x1, %al
xchgb %al, 0x3cb4(%rip)       # 0x5108
movq %rsp, %rdi
callq 0x10e0
movq 0x2b75(%rip), %rdi      # 0x3fd8
leaq 0xbbe(%rip), %rsi       # 0x2028
movl $0x9, %edx
callq 0x10c0
movl 0x2c32(%rip), %esi      # 0x40ac
movq 0x2b57(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
leaq 0xba2(%rip), %rsi       # 0x2032
movl $0x9, %edx
movq %rax, %rdi
callq 0x10c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq 0x2b0d(%rip), %rdi      # 0x3fd8
leaq 0xb6a(%rip), %rsi       # 0x203c
movl $0x9, %edx
callq 0x10c0
movl 0x2bce(%rip), %esi      # 0x40b0
movq 0x2aef(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
leaq 0xb3a(%rip), %rsi       # 0x2032
movl $0x9, %edx
movq %rax, %rdi
callq 0x10c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
cmpq $0x0, (%rsp)
jne 0x155c
cmpq $0x0, 0x8(%rsp)
jne 0x155c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
jmp 0x154c
cmpq $0x0, (%rsp)
jne 0x155c
cmpq $0x0, 0x8(%rsp)
jne 0x155c
movq %rax, %rdi
callq 0x1100
callq 0x1040
nop
// File: /workspace/github_c_makefile_star2_O1/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_collect32.c
// Function: shmem_collect32
void shmem_collect32(void *dest, const void *source, size_t nelems, 
	int pe_start, int log_pe_stride, int pe_size, long* psync)
{
	int pe = __shmem.my_pe;
	int pe_step = 0x1 << log_pe_stride;
	int pe_end = pe_start + pe_step * (pe_size - 1);
	int my_offset = 0;
	int inelems = (int)nelems;

	/* We know the value here is 0 and we can use it and reset it before
	 * it is needed in the barrier */

	volatile long* offset = psync + SHMEM_COLLECT_SYNC_SIZE - 1;

	int* neighbor_offset = (int*)shmem_ptr((void*)offset, pe + pe_step);

	if (__builtin_expect((pe == pe_start),0)) {

		*neighbor_offset = my_offset + inelems;

	} else {

		/// spin until neighbor sets offset 
		while (!(my_offset = *offset));

		*offset = SHMEM_SYNC_VALUE;

		if (__builtin_expect((pe != pe_end),1))
			*neighbor_offset = my_offset + inelems;
	}

	int i, j;
	for (i = pe_start; i <= pe_end; i += pe_step) {
		int32_t* dst = (int32_t*)shmem_ptr((void*)dest, i) + my_offset;
		for (j = 0; j < inelems; j++) dst[j] = ((int32_t*)source)[j];
	}

	shmem_barrier(pe_start, log_pe_stride, pe_size, psync);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %r12d
movq %rdx, (%rsp)
movq %rsi, %r13
movq %rdi, 0x30(%rsp)
movq 0x70(%rsp), %rdx
leaq 0x4edf(%rip), %rax      # 0x61f0
pushq $0x1
popq %rbp
movl %r8d, %ecx
shll %cl, %ebp
movq %r9, 0x28(%rsp)
leal -0x1(%r9), %esi
movl %r8d, 0x14(%rsp)
shll %cl, %esi
movl 0x4(%rax), %ebx
movq %rsi, 0x8(%rsp)
leal (%rsi,%r12), %r14d
movq %rdx, 0x20(%rsp)
leaq 0x38(%rdx), %r15
leal (%rbx,%rbp), %esi
movq %r15, %rdi
callq 0x1dfc
movq %r12, 0x18(%rsp)
cmpl %r12d, %ebx
je 0x13ef
movq (%r15), %rcx
testl %ecx, %ecx
je 0x1357
movq $0x0, (%r15)
cmpl %r14d, %ebx
je 0x13fa
movq (%rsp), %rdx
addl %ecx, %edx
movq 0x8(%rsp), %rsi
movl %edx, (%rax)
testl %esi, %esi
js 0x13c9
movslq %ecx, %rbx
shlq $0x2, %rbx
movq (%rsp), %r12
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq 0x18(%rsp), %rax
movl %eax, %r15d
movq 0x30(%rsp), %rdi
movl %r15d, %esi
callq 0x1dfc
cmpl $0x0, (%rsp)
jle 0x13c1
addq %rbx, %rax
xorl %ecx, %ecx
movl (%r13,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x13b1
addl %ebp, %r15d
cmpl %r14d, %r15d
jle 0x1399
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3138
xorl %ecx, %ecx
movq (%rsp), %rdx
jmp 0x1374
movq 0x8(%rsp), %rsi
jmp 0x137b
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O1/kevinp89[P]Operating-System-EXT2-file-system-with-commands/./ext2_utils.c
// Function: set_dir_type
void set_dir_type(struct ext2_dir_entry *dir_entry, unsigned char type) {
	switch(type) {
		case 'f':
			dir_entry->file_type = EXT2_FT_REG_FILE;
			break;
		case 'd':
			dir_entry->file_type = EXT2_FT_DIR;
			break;
		case 'l':
			dir_entry->file_type = EXT2_FT_SYMLINK;
			break;
		case '?':
		default:
			dir_entry->file_type = EXT2_FT_UNKNOWN;
	}
}

// Assembly:
cmpl $0x6c, %esi
je 0x1558
cmpl $0x66, %esi
je 0x1554
cmpl $0x64, %esi
jne 0x155c
movb $0x2, %al
jmp 0x155e
movb $0x1, %al
jmp 0x155e
movb $0x7, %al
jmp 0x155e
xorl %eax, %eax
movb %al, 0x7(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/kevinp89[P]Operating-System-EXT2-file-system-with-commands/./ext2_utils.c
// Function: search_directories
unsigned int search_directories(unsigned char *disk, struct ext2_inode *node, char *target, int dir_only) {
	// Dir related
	unsigned int cur_rec_len;
	char filename[256];
	struct ext2_dir_entry *cur_dir;

	int i;
	for (i = 0; node->i_block[i] != 0; i++) {
		for (cur_rec_len = 0; cur_rec_len < 1024; ) {
			cur_dir = (struct ext2_dir_entry *)(disk + (1024 * node->i_block[i]) + cur_rec_len);
			cur_rec_len += cur_dir->rec_len;
			memset(filename, '\0', sizeof(filename));
			strncpy(filename, cur_dir->name, cur_dir->name_len);
			if (strcmp(filename, target) == 0) { // Found matching dir
				if (dir_only) { // If we're only checking for directories
					if (get_dir_type(cur_dir->file_type) == 'd') {
						return cur_dir->inode-1; // Return index, not the node itself.
					}
				} else { // Check all types of files
					return cur_dir->inode-1;
				}
			}
		}
	}
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl %ecx, 0xc(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x18(%rsp)
movl 0x28(%rsi), %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r15d, %r15d
je 0x1638
xorl %eax, %eax
leaq 0x30(%rsp), %r13
movq %rdi, 0x10(%rsp)
movq %rax, 0x20(%rsp)
shll $0xa, %r15d
addq %rdi, %r15
xorl %ebx, %ebx
movl %ebx, %ebp
leaq (%r15,%rbp), %r12
addq $0x8, %r12
movzwl -0x4(%r12), %r14d
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x1090
movzbl -0x2(%r12), %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x1040
movq %r13, %rdi
movq 0x28(%rsp), %rsi
callq 0x10b0
testl %eax, %eax
jne 0x15fe
addq %r15, %rbp
cmpl $0x0, 0xc(%rsp)
je 0x1633
cmpb $0x2, 0x7(%rbp)
je 0x1633
addl %r14d, %ebx
cmpl $0x400, %ebx            # imm = 0x400
jb 0x15ad
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movl 0x2c(%rax,%rcx,4), %r15d
movq %rcx, %rax
incq %rax
testl %r15d, %r15d
movq 0x10(%rsp), %rdi
jne 0x159f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1638
movl (%rbp), %eax
decl %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kevinp89[P]Operating-System-EXT2-file-system-with-commands/./ext2_utils.c
// Function: check_parent
int check_parent(unsigned char *disk, char *path) {
	struct ext2_super_block *sb = (struct ext2_super_block *)(disk + 1024);
	struct ext2_group_desc *desc = (struct ext2_group_desc *)(disk + 2*1024);
	// Copying the path string into an array
	// Getting amount of dir inputs
	char *dupe = strdup(path);
	strcpy(dupe, path);
	int dircount = 0;
	int i;
	for (i = 0; dupe[i] != 0; i++) {
		if (dupe[i] == '/' && dupe[i+1] != '\0') {
			dircount++;
		}
	}
	if (dircount == 0) {
		fprintf(stderr, "Invalid directory.\n");
		exit(ENOENT);
	}
	// Creating array and copying
	char *dirs[dircount];
	char *tail = dupe;
	for (i = 0; i < dircount; i++) {
		dirs[i] = strsep(&tail, "/");
	}

	// Inode related
	struct ext2_inode *curinode;
	int node = 1; // Root directory begins at index 1
	
	i = 1;
	while (i < dircount) {
		if (strcmp(dirs[i], ".") != 0) {
			curinode = (struct ext2_inode *)((disk + 1024 * desc->bg_inode_table) + (sb->s_inode_size * node));
			node = search_directories(disk, curinode, dirs[i], 1);
			if (node == -1) {
				break;
			}
		}
		i++;
	}

	free(dupe);
	return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, -0x38(%rbp)
movq %rsi, %rdi
callq 0x1160
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x1050
movq %r12, %rax
incq %rax
xorl %r13d, %r13d
movzbl -0x1(%rax), %ecx
cmpl $0x2f, %ecx
je 0x1690
testl %ecx, %ecx
jne 0x1697
jmp 0x169c
cmpb $0x1, (%rax)
sbbl $-0x1, %r13d
incq %rax
jmp 0x1681
testl %r13d, %r13d
je 0x1776
movl %r13d, %ebx
movq %rsp, %r14
leaq 0xf(,%rbx,8), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq %r12, -0x30(%rbp)
movq %r12, -0x40(%rbp)
testl %r13d, %r13d
jle 0x16ec
xorl %r15d, %r15d
leaq -0x40(%rbp), %r12
movq %r12, %rdi
leaq 0x93d(%rip), %rsi       # 0x2018
callq 0x1100
movq %rax, (%r14,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x16d1
movl $0x1, %r15d
cmpl $0x2, %r13d
jl 0x175b
movl $0x1, %r12d
movq (%r14,%r12,8), %r13
movq %r13, %rdi
leaq 0xa2d(%rip), %rsi       # 0x2139
callq 0x10b0
testl %eax, %eax
je 0x174b
movq -0x38(%rbp), %rdi
movl 0x808(%rdi), %eax
shll $0xa, %eax
addq %rdi, %rax
movzwl 0x458(%rdi), %ecx
movslq %r15d, %rsi
imulq %rcx, %rsi
addq %rax, %rsi
movq %r13, %rdx
movl $0x1, %ecx
callq 0x1562
movl %eax, %r15d
cmpl $-0x1, %eax
je 0x1755
incq %r12
cmpq %r12, %rbx
jne 0x16fe
jmp 0x175b
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rdi
callq 0x1030
movl %r15d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1180
// File: /workspace/github_c_makefile_star2_O1/kevinp89[P]Operating-System-EXT2-file-system-with-commands/ext2_cp.c
// Function: get_free_blocks
int *get_free_blocks(int blocks_need, unsigned char *block_bit_map){

	int i,j=22;
	
	int* free_blocks = malloc(sizeof(int)*blocks_need);
	
	for(i=0; i<blocks_need; i++){
		while(check_node(j, block_bit_map) == 0){
			j++;
			//if j reaches max block count, return null
			if(j==sb->s_blocks_count){
				return NULL;
			}
		}
		free_blocks[i] = j;	
		set_node(j, block_bit_map);
	}
	return free_blocks;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movslq %edi, %r14
leaq (,%r14,4), %rdi
callq 0x10f0
testl %r14d, %r14d
jle 0x1809
movl %ebp, %edx
movl $0x16, %esi
xorl %edi, %edi
movq 0x290e(%rip), %r8       # 0x40d0
leal 0x7(%rsi), %ecx
testl %esi, %esi
cmovnsl %esi, %ecx
sarl $0x3, %ecx
movslq %ecx, %r9
movzbl (%rbx,%r9), %r10d
movl %esi, %ecx
andl $0x7, %ecx
btl %ecx, %r10d
jb 0x17ea
incl %esi
cmpl 0x4(%r8), %esi
jne 0x17c2
jmp 0x1807
movl %esi, (%rax,%rdi,4)
movl $0x1, %r8d
shll %cl, %r8d
xorb %r10b, %r8b
movb %r8b, (%rbx,%r9)
incq %rdi
cmpq %rdx, %rdi
jne 0x17bb
jmp 0x1809
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kevinp89[P]Operating-System-EXT2-file-system-with-commands/ext2_cp.c
// Function: find_free_block
int find_free_block(unsigned char *bmap){
	int bnode;
	for (bnode = 22; bnode < sb->s_blocks_count; bnode++) {
		if (check_node(bnode, bmap) == 0) {
			break;
		}
	}
	if(bnode == sb->s_blocks_count){
		return -1;	
	}
	set_node(bnode, bmap);
	return bnode;
}

// Assembly:
movq 0x28bb(%rip), %rax      # 0x40d0
movl 0x4(%rax), %ecx
movl $0x16, %edx
cmpl $0x17, %ecx
jb 0x183d
movl %edx, %eax
shrl $0x3, %eax
movzbl (%rdi,%rax), %eax
movl %edx, %esi
andl $0x7, %esi
btl %esi, %eax
jae 0x183d
incl %edx
cmpl %edx, %ecx
jne 0x1822
movl %ecx, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %edx
je 0x185c
movl %edx, %ecx
andb $0x7, %cl
movl $0x1, %eax
shll %cl, %eax
movl %edx, %ecx
shrl $0x3, %ecx
xorb %al, (%rdi,%rcx)
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/ADTIntVector_test.c
// Function: test_insert
void test_insert(void) {
	IntVector vec = int_vector_create(0);

	// insert 1000 στοιχεία ώστε να συμβούν πολλαπλά resizes
	for (int i = 0; i < 1000; i++) {
		int_vector_insert_last(vec, i);
		TEST_ASSERT(int_vector_size(vec) == i+1);	// Το size ενημερώθηκε;
		TEST_ASSERT(int_vector_get_at(vec, i) == i);	// Μπορούμε να κάνουμε at το στοιχείο που μόλις βάλαμε;
	}

	// Δοκιμή ότι μετά τα resizes τα στοιχεία είναι ακόμα προσπελάσιμα
	for (int i = 0; i < 1000; i++)
		TEST_ASSERT(int_vector_get_at(vec, i) == i);

	int_vector_destroy(vec);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0x471c
movq %rax, %rbx
movl $0x3e8, %r12d           # imm = 0x3E8
leaq 0x14ef(%rip), %r14      # 0x5318
leaq 0x1652(%rip), %r15      # 0x5482
xorl %ebp, %ebp
subl $0x1, %r12d
jb 0x3eab
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4777
movq %rbx, %rdi
callq 0x475c
leal 0x1(%rbp), %r13d
xorl %edi, %edi
cmpl %r13d, %eax
sete %dil
movq %r14, %rsi
movl $0x1b, %edx
movq %r15, %rcx
leaq 0x14dd(%rip), %r8       # 0x5346
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3ea6
movq %rbx, %rdi
movl %ebp, %esi
callq 0x476d
xorl %edi, %edi
cmpl %ebp, %eax
sete %dil
movq %r14, %rsi
movl $0x1c, %edx
movq %r15, %rcx
leaq 0x14ca(%rip), %r8       # 0x5362
xorl %eax, %eax
callq 0x25cc
movl %r13d, %ebp
testl %eax, %eax
jne 0x3e32
callq 0x2e13
leaq 0x1466(%rip), %r14      # 0x5318
leaq 0x15c9(%rip), %r15      # 0x5482
leaq 0x14a2(%rip), %r12      # 0x5362
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x476d
xorl %edi, %edi
cmpl %eax, %ebp
sete %dil
movq %r14, %rsi
movl $0x21, %edx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3ea6
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x3ec2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x47cf
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/ADTIntVector_test.c
// Function: test_remove
void test_remove(void) {
	IntVector vec = int_vector_create(1000);

	// replace για προσθήκη δεδομένων, χωρίς ελέγχους (έχουμε ξεχωριστό test για το replace)
	for (int i = 0; i < 1000; i++)
		int_vector_set_at(vec, i, i);

	// Διαδοχικά remove ώστε να συμβούν και resizes
	for (int i = 999; i >= 0; i--) {
		TEST_ASSERT(int_vector_get_at(vec, i) == i);
		int_vector_remove_last(vec);
		TEST_ASSERT(int_vector_size(vec) == i);
	}

	int_vector_destroy(vec);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x471c
movq %rax, %rbx
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0x4761
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x3f27
movl $0x3e7, %ebp            # imm = 0x3E7
leaq 0x13cf(%rip), %r14      # 0x5318
leaq 0x1532(%rip), %r15      # 0x5482
leaq 0x140b(%rip), %r12      # 0x5362
leaq 0x1423(%rip), %r13      # 0x5381
movq %rbx, %rdi
movl %ebp, %esi
callq 0x476d
xorl %edi, %edi
cmpl %eax, %ebp
sete %dil
movq %r14, %rsi
movl $0x2f, %edx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3fd5
movq %rbx, %rdi
callq 0x479e
movq %rbx, %rdi
callq 0x475c
xorl %edi, %edi
cmpl %eax, %ebp
sete %dil
movq %r14, %rsi
movl $0x31, %edx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3fd5
addl $-0x1, %ebp
jb 0x3f5e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x47cf
callq 0x2e13
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/ADTIntVector_test.c
// Function: test_get_set_at
void test_get_set_at(void) {
	IntVector vec = int_vector_create(0);

	// insert πολλαπλά 0, θα τα αλλάξουμε μετά με replace
	for (int i = 0; i < 1000; i++)
		int_vector_insert_last(vec, 0);

	for (int i = 0; i < 1000; i++) {
		TEST_ASSERT(int_vector_get_at(vec, i) == 0);
		int_vector_set_at(vec, i, i);
		TEST_ASSERT(int_vector_get_at(vec, i) == i);
	}

	int_vector_destroy(vec);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0x471c
movq %rax, %rbx
movl $0x3e8, %ebp            # imm = 0x3E8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4777
decl %ebp
jne 0x3ff4
leaq 0x130f(%rip), %r14      # 0x5318
leaq 0x1472(%rip), %r15      # 0x5482
leaq 0x1384(%rip), %r12      # 0x539b
leaq 0x1344(%rip), %r13      # 0x5362
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x476d
xorl %edi, %edi
testl %eax, %eax
sete %dil
movq %r14, %rsi
movl $0x3f, %edx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x40a2
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0x4761
movq %rbx, %rdi
movl %ebp, %esi
callq 0x476d
xorl %edi, %edi
cmpl %eax, %ebp
sete %dil
movq %r14, %rsi
movl $0x41, %edx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x40a2
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x4020
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x47cf
callq 0x2e13
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/ADTIntVector_test.c
// Function: test_find
void test_find(void) {
	IntVector vec = int_vector_create(1000);

	// replace για προσθήκη δεδομένων
	for (int i = 0; i < 1000; i++)
		int_vector_set_at(vec, i, i);

	for (int i = 0; i < 1000; i++) {
		int p = int_vector_find(vec, i);
		TEST_ASSERT(p == i);
	}

	TEST_ASSERT(int_vector_find(vec, -12) == INT_MIN);

	int_vector_destroy(vec);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x471c
movq %rax, %rbx
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0x4761
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x40be
leaq 0x123d(%rip), %r14      # 0x5318
leaq 0x13a0(%rip), %r15      # 0x5482
leaq 0x12d1(%rip), %r12      # 0x53ba
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x47a8
xorl %edi, %edi
cmpl %eax, %ebp
sete %dil
movq %r14, %rsi
movl $0x50, %edx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x416a
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x40eb
movq %rbx, %rdi
movl $0xfffffff4, %esi       # imm = 0xFFFFFFF4
callq 0x47a8
xorl %edi, %edi
negl %eax
seto %dil
leaq 0x11dc(%rip), %rsi      # 0x5318
leaq 0x133f(%rip), %rcx      # 0x5482
leaq 0x1277(%rip), %r8       # 0x53c1
movl $0x53, %edx
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x416a
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x47cf
callq 0x2e13
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/ADTIntVector_test.c
// Function: test_destroy
void test_destroy(void) {
	// Απλά εκτελούμε την destroy, για να ελέγξουμε αν όντως δουλεύει
	// σωστά τρέχουμε το test με valgrind.

	IntVector vec = int_vector_create(1);

	int_vector_set_at(vec, 0, 1);
	int_vector_insert_last(vec, 1);
	int_vector_remove_last(vec);

	int_vector_destroy(vec);
}

// Assembly:
pushq %rbx
movl $0x1, %edi
callq 0x471c
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x4761
movq %rbx, %rdi
movl $0x1, %esi
callq 0x4777
movq %rbx, %rdi
callq 0x479e
movq %rbx, %rdi
popq %rbx
jmp 0x47cf
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/ADTIntVector.c
// Function: int_vector_create
IntVector int_vector_create(int size) {
	// Περνάμε τη free στην vector_create, ώστε κάθε στοιχείο που αφαιρείται να γίνεται free αυτόματα
	Vector vec = vector_create(size, free);

	// Ο πίνακας περιέχει size μη-αρχικοποιημένους ακεραίους, δεσμεύουμε μνήμη για αυτούς
	for (int i = 0; i < size; i ++)
		vector_set_at(vec, i, malloc(sizeof(int)));

	return (IntVector)vec;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x3897(%rip), %rsi      # 0x7fc0
callq 0x47d4
movq %rax, %r14
testl %ebx, %ebx
jle 0x4754
xorl %ebp, %ebp
movl $0x4, %edi
callq 0x21a0
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x484b
incl %ebp
cmpl %ebp, %ebx
jne 0x4737
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/ADTIntVector.c
// Function: int_vector_insert_last
void int_vector_insert_last(IntVector vec, int value) {
	// Νέο στοιχείο, χρειαζόμαστε μνήμη!
	int *p = malloc(sizeof(int));
	*p = value;
	vector_insert_last((Vector)vec, p);		// προσθήκη του int pointer στο vector
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x4, %edi
callq 0x21a0
movl %ebx, (%rax)
movq %r14, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x48a5
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/../../modules/UsingDynamicArray/ADTVector.c
// Function: vector_create
Vector vector_create(int size, DestroyFunc destroy_value) {
	// Δημιουργία του struct
	Vector vec = malloc(sizeof(*vec));

	vec->size = size;
	vec->destroy_value = destroy_value;

	// Δέσμευση μνήμης για τον πίνακα. Αρχικά το vector περιέχει size
	// μη-αρχικοποιημένα στοιχεία, αλλά εμείς δεσμεύουμε xώρο για τουλάχιστον
	// VECTOR_MIN_CAPACITY για να αποφύγουμε τα πολλαπλά resizes.
	//
	vec->capacity = size < VECTOR_MIN_CAPACITY ? VECTOR_MIN_CAPACITY : size;
	vec->array = calloc(vec->capacity, sizeof(*vec->array));		// αρχικοποίηση σε 0 (NULL)

	return vec;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl $0x18, %edi
callq 0x21a0
movq %rax, %r14
movl %ebp, 0x8(%rax)
movq %rbx, 0x10(%rax)
cmpl $0xb, %ebp
movl $0xa, %edi
cmovgel %ebp, %edi
movl %edi, 0xc(%rax)
movl $0x8, %esi
callq 0x2160
movq %rax, (%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/../../modules/UsingDynamicArray/ADTVector.c
// Function: vector_set_at
void vector_set_at(Vector vec, int pos, Pointer value) {
	assert(pos >= 0 && pos < vec->size);	// LCOV_EXCL_LINE

	// Αν υπάρχει συνάρτηση destroy_value, την καλούμε για το στοιχείο που αντικαθίσταται
	if (value != vec->array[pos].value && vec->destroy_value != NULL)
		vec->destroy_value(vec->array[pos].value);

	vec->array[pos].value = value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testl %esi, %esi
js 0x4886
movq %rdi, %r14
cmpl %esi, 0x8(%rdi)
jle 0x4886
movq %rdx, %rbx
movq (%r14), %rax
movl %esi, %r15d
movq (%rax,%r15,8), %rdi
cmpq %rdx, %rdi
je 0x4879
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x4879
callq *%rax
movq (%r14), %rax
movq %rbx, (%rax,%r15,8)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1585(%rip), %rdi      # 0x5e12
leaq 0x159a(%rip), %rsi      # 0x5e2e
leaq 0x15e2(%rip), %rcx      # 0x5e7d
movl $0x3a, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/../../modules/UsingDynamicArray/ADTVector.c
// Function: vector_insert_last
void vector_insert_last(Vector vec, Pointer value) {
	// Μεγαλώνουμε τον πίνακα (αν χρειαστεί), ώστε να χωράει τουλάχιστον size στοιχεία
	// Διπλασιάζουμε κάθε φορά το capacity (σημαντικό για την πολυπλοκότητα!)
	if (vec->capacity == vec->size) {
		// Προσοχή: δεν πρέπει να κάνουμε free τον παλιό pointer, το κάνει η realloc
		vec->capacity *= 2;
		vec->array = realloc(vec->array, vec->capacity * sizeof(*vec->array));
	}

	// Μεγαλώνουμε τον πίνακα και προσθέτουμε το στοιχείο
	vec->array[vec->size].value = value;
	vec->size++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movslq 0xc(%rdi), %rsi
cmpl 0x8(%rdi), %esi
jne 0x48cd
leal (%rsi,%rsi), %eax
movl %eax, 0xc(%rbx)
movq (%rbx), %rdi
shlq $0x4, %rsi
callq 0x21d0
movq %rax, (%rbx)
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/../../modules/UsingDynamicArray/ADTVector.c
// Function: vector_remove_last
void vector_remove_last(Vector vec) {
	assert(vec->size != 0);		// LCOV_EXCL_LINE

	// Αν υπάρχει συνάρτηση destroy_value, την καλούμε για το στοιχείο που αφαιρείται
	if (vec->destroy_value != NULL)
		vec->destroy_value(vec->array[vec->size - 1].value);

	// Αφαιρούμε στοιχείο οπότε ο πίνακας μικραίνει
	vec->size--;

	// Μικραίνουμε τον πίνακα αν χρειαστεί, ώστε να μην υπάρχει υπερβολική σπατάλη χώρου.
	// Για την πολυπλοκότητα είναι σημαντικό να μειώνουμε το μέγεθος στο μισό, και μόνο
	// αν το capacity είναι τετραπλάσιο του size (δηλαδή το 75% του πίνακα είναι άδειος).
	//
	if (vec->capacity > vec->size * 4 && vec->capacity > 2*VECTOR_MIN_CAPACITY) {
		vec->capacity /= 2;
		vec->array = realloc(vec->array, vec->capacity * sizeof(*vec->array));
	}
}

// Assembly:
pushq %rbx
movslq 0x8(%rdi), %rax
testq %rax, %rax
je 0x4942
movq %rdi, %rbx
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x4906
movq (%rbx), %rdx
movq -0x8(%rdx,%rax,8), %rdi
callq *%rcx
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %eax
leal -0x1(%rcx), %edx
movl %edx, 0x8(%rbx)
leal -0x4(,%rcx,4), %ecx
cmpl %ecx, %eax
setle %cl
cmpl $0x15, %eax
setl %dl
orb %cl, %dl
jne 0x4940
shrl %eax
movl %eax, 0xc(%rbx)
movq (%rbx), %rdi
leaq (,%rax,8), %rsi
callq 0x21d0
movq %rax, (%rbx)
popq %rbx
retq
leaq 0x155d(%rip), %rdi      # 0x5ea6
leaq 0x14de(%rip), %rsi      # 0x5e2e
leaq 0x155e(%rip), %rcx      # 0x5eb5
movl $0x52, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/../../modules/UsingDynamicArray/ADTVector.c
// Function: vector_find
Pointer vector_find(Vector vec, Pointer value, CompareFunc compare) {
	// Διάσχιση του vector
	for (int i = 0; i < vec->size; i++)
		if (compare(vec->array[i].value, value) == 0)
			return vec->array[i].value;		// βρέθηκε

	return NULL;				// δεν υπάρχει
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x499d
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
xorl %ebx, %ebx
xorl %r13d, %r13d
movq (%r15), %rax
movq (%rax,%r13,8), %rdi
movq %r12, %rsi
callq *%r14
testl %eax, %eax
je 0x49a1
incq %r13
movslq 0x8(%r15), %rax
cmpq %rax, %r13
jl 0x497e
jmp 0x49a8
xorl %ebx, %ebx
jmp 0x49a8
movq (%r15), %rax
movq (%rax,%r13,8), %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/../../modules/UsingDynamicArray/ADTVector.c
// Function: vector_destroy
void vector_destroy(Vector vec) {
	// Αν υπάρχει συνάρτηση destroy_value, την καλούμε για όλα τα στοιχεία
	if (vec->destroy_value != NULL)
		for (int i = 0; i < vec->size; i++)
			vec->destroy_value(vec->array[i].value);

	// Πρέπει να κάνουμε free τόσο τον πίνακα όσο και το struct!
	free(vec->array);
	free(vec);			// τελευταίο το vec!
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x49eb
cmpl $0x0, 0x8(%rbx)
jle 0x49eb
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq *0x10(%rbx)
incq %r14
movslq 0x8(%rbx), %rax
cmpq %rax, %r14
jl 0x49d5
movq (%rbx), %rdi
callq 0x22a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22a0
// File: /workspace/github_c_makefile_star2_O1/chatziko-k08[P]lecture-code/programs/fibonacci/../../modules/UsingDynamicArray/ADTVector.c
// Function: vector_find_node
VectorNode vector_find_node(Vector vec, Pointer value, CompareFunc compare) {
	// Διάσχιση του vector
	for (int i = 0; i < vec->size; i++)
		if (compare(vec->array[i].value, value) == 0)
			return &vec->array[i];		// βρέθηκε

	return VECTOR_EOF;				// δεν υπάρχει
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x8(%rdi)
jle 0x4a9a
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r14), %rax
movq (%rax,%r13), %rdi
movq %r12, %rsi
callq *%r15
testl %eax, %eax
je 0x4a9e
incq %rbp
movslq 0x8(%r14), %rax
addq $0x8, %r13
cmpq %rax, %rbp
jl 0x4a77
jmp 0x4aa4
xorl %ebx, %ebx
jmp 0x4aa4
addq (%r14), %r13
movq %r13, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/martintopholm[P]xping/xping.c
// Function: target_mark
void
target_mark(struct target *t, int seq, int ch)
{
	if (ch == '.' && t->res[seq % NUM] != ' ')
		t->res[seq % NUM] = ':';
	else
		t->res[seq % NUM] = ch;
	if (a_flag && ch == '.') {
		if (a_flag == 1)
			bell();
		else if (a_flag >=2 && t->npkts >= 4 &&
		    t->res[(seq-3) % NUM] != '.' &&
		    t->res[(seq-2) % NUM] != '.' &&
		    t->res[(seq-1) % NUM] == '.' &&
		    t->res[(seq-0) % NUM] == '.')
			bell();
	}

	if (seq == t->npkts - 1)
		ui_update(t);
	else
		ui_update(NULL); /* this is a late reply, need full update to redraw this */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x2e, %edx
jne 0x262e
movslq %r14d, %rax
imulq $0x1b4e81b5, %rax, %rcx # imm = 0x1B4E81B5
movq %rcx, %rsi
shrq $0x3f, %rsi
shrq $0x20, %rcx
sarl $0x5, %ecx
addl %esi, %ecx
imull $0x12c, %ecx, %ecx      # imm = 0x12C
subl %ecx, %eax
cltq
cmpb $0x20, 0x44(%rbx,%rax)
jne 0x2659
movslq %r14d, %rax
imulq $0x1b4e81b5, %rax, %rax # imm = 0x1B4E81B5
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x12c, %eax, %eax      # imm = 0x12C
movl %r14d, %ecx
subl %eax, %ecx
movslq %ecx, %rax
movb %dl, 0x44(%rbx,%rax)
jmp 0x265e
movb $0x3a, 0x44(%rbx,%rax)
cmpl $0x2e, %edx
setne %cl
movl 0x4bde(%rip), %eax      # 0x7248
testl %eax, %eax
sete %dl
orb %cl, %dl
jne 0x275c
cmpl $0x1, %eax
jne 0x2697
leaq 0x2a78(%rip), %rsi      # 0x50fb
movl $0x1, %edx
movl $0x1, %edi
callq 0x2080
jmp 0x275c
jle 0x275c
cmpl $0x4, 0x40(%rbx)
jl 0x275c
leal -0x3(%r14), %eax
cltq
imulq $0x1b4e81b5, %rax, %rcx # imm = 0x1B4E81B5
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x12c, %ecx, %ecx      # imm = 0x12C
subl %ecx, %eax
cltq
cmpb $0x2e, 0x44(%rbx,%rax)
je 0x275c
leal -0x2(%r14), %eax
cltq
imulq $0x1b4e81b5, %rax, %rcx # imm = 0x1B4E81B5
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x12c, %ecx, %ecx      # imm = 0x12C
subl %ecx, %eax
cltq
cmpb $0x2e, 0x44(%rbx,%rax)
je 0x275c
leal -0x1(%r14), %eax
cltq
imulq $0x1b4e81b5, %rax, %rcx # imm = 0x1B4E81B5
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x12c, %ecx, %ecx      # imm = 0x12C
subl %ecx, %eax
cltq
cmpb $0x2e, 0x44(%rbx,%rax)
jne 0x275c
movslq %r14d, %rax
imulq $0x1b4e81b5, %rax, %rax # imm = 0x1B4E81B5
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x12c, %eax, %eax      # imm = 0x12C
movl %r14d, %ecx
subl %eax, %ecx
movslq %ecx, %rax
cmpb $0x2e, 0x44(%rbx,%rax)
je 0x267c
movl 0x40(%rbx), %eax
decl %eax
xorl %edi, %edi
cmpl %r14d, %eax
cmoveq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x4ab1(%rip)           # 0x7228
// File: /workspace/github_c_makefile_star2_O1/martintopholm[P]xping/xping.c
// Function: usage
void
usage(const char *whine)
{
	if (whine != NULL) {
		fprintf(stderr, "%s\n", whine);
	}
	fprintf(stderr,
	    "usage: xping [-46ABCTVah] [-c count] [-i interval] [-w width] "
	    "host [host [...]]\n"
	    "\n");
	exit(EX_USAGE);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x27a6
movq %rdi, %rdx
movq 0x4843(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
leaq 0x293a(%rip), %rsi      # 0x50d9
xorl %eax, %eax
callq 0x2310
movq 0x482b(%rip), %rax      # 0x6fd8
movq (%rax), %rcx
leaq 0x287d(%rip), %rdi      # 0x5034
movl $0x51, %esi
movl $0x1, %edx
callq 0x23e0
movl $0x40, %edi
callq 0x2260