LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_3/exercise_3_06/itoa.c
// Function: int_to_array
void int_to_array(int n, char s[], int padding)
{
  int i = 0, sign = n;

  do
  {
    s[i++] = abs(n % 10) + '0';
  } while (n /= 10);

  if (sign < 0)
  {
    s[i++] = '-';
  }

  int len = ilen(sign);
  while (len < padding)
  {
    s[i++] = ' ';
    --padding;
  }

  s[i] = '\0';

  int s_len = strlen(s);
  str_reverse(s, 0, s_len - 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
xorl %eax, %eax
movl %edi, %ecx
movslq %ecx, %rdx
imulq $0x66666667, %rdx, %rcx # imm = 0x66666667
movq %rcx, %rsi
shrq $0x3f, %rsi
sarq $0x22, %rcx
addl %esi, %ecx
leal (%rcx,%rcx), %esi
leal (%rsi,%rsi,4), %esi
movl %edx, %r8d
subl %esi, %r8d
movl %r8d, %esi
negl %esi
cmovsl %r8d, %esi
addb $0x30, %sil
movb %sil, (%rbx,%rax)
incq %rax
addl $0x9, %edx
cmpl $0x12, %edx
ja 0x119d
testl %edi, %edi
jns 0x11e8
movl %eax, %ecx
incl %eax
movb $0x2d, (%rbx,%rcx)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movslq %edi, %rcx
imulq $0x66666667, %rcx, %rdi # imm = 0x66666667
movq %rdi, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rdi
addl %edx, %edi
addl $0x9, %ecx
incl %r14d
cmpl $0x12, %ecx
ja 0x11ee
leal 0x1(%r14), %r15d
cmpl %ebp, %r15d
jge 0x1248
movslq %eax, %r12
leaq (%rbx,%r12), %rdi
movl %ebp, %edx
subl %r14d, %edx
addl $-0x2, %edx
incq %rdx
movl $0x20, %esi
callq 0x1050
addl %ebp, %r12d
notl %r14d
movl %r14d, %eax
addl %r12d, %eax
decl %ebp
cmpl %ebp, %r15d
jl 0x1241
cltq
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x1040
leal -0x1(%rax), %edx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x128f
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_3/exercise_3_06/itoa.c
// Function: str_reverse
void str_reverse(char str1[], int index, int size)
{
  char temp;

  temp = str1[index];
  str1[index] = str1[size - index];
  str1[size - index] = temp;

  if (index == size / 2)
  {
    return;
  }

  str_reverse(str1, index + 1, size);
}

// Assembly:
movslq %esi, %rax
movslq %edx, %rdx
movl %edx, %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
subq %rax, %rdx
addq %rdi, %rdx
sarl %ecx
movb (%rdi,%rax), %sil
movb (%rdx), %r8b
movb %r8b, (%rdi,%rax)
movb %sil, (%rdx)
cmpl %ecx, %eax
je 0x12be
incq %rax
decq %rdx
jmp 0x12a4
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: append
long append(long xs, long ys)
{
    long x2, x1, us, u;
    goto L1;
L1:
    switch (runtime_class(xs)) {
    case CLASS_Cons:
        u = prim_fetch(xs, runtime_makeNumber(0));
        us = prim_fetch(xs, runtime_makeNumber(1));
        goto L2;
    default:
        goto L3;
    }
L2:
    x1 = append(us, ys);
    goto L4;
L3:
    return ys;
L4:
    x2 = prim_cons(u, x1);
    return x2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3fbd
cmpw $0x3, %ax
jne 0x14a9
xorl %edi, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movl $0x1, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %rdi
movq %rbx, %rsi
callq 0x144e
movq %r15, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x4350
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1
long pass1(long hi1)
{
    long x3, x2, x1, defs, def;
    goto L1;
L1:
    switch (runtime_class(hi1)) {
    case CLASS_Cons:
        def = prim_fetch(hi1, runtime_makeNumber(0));
        defs = prim_fetch(hi1, runtime_makeNumber(1));
        goto L2;
    default:
        goto L3;
    }
L2:
    x1 = pass1Toplevel(def);
    goto L4;
L3:
    return nil;
L4:
    x2 = pass1(defs);
    goto L5;
L5:
    x3 = prim_cons(x1, x2);
    return x3;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3fbd
cmpw $0x3, %ax
jne 0x1540
xorl %edi, %edi
callq 0x4043
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r14
movl $0x1, %edi
callq 0x4043
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %rbx
movq %r14, %rdi
callq 0x1552
movq %rax, %r14
movq %rbx, %rdi
callq 0x14dc
movq %r14, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4350
leaq 0x26ce1(%rip), %rax     # 0x28228
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1SimpleExpr
long pass1SimpleExpr(long expr, long cont)
{
    long clauses, test, args, f, cpArgs, cp, name;
    goto L1;
L1:
    switch (runtime_class(expr)) {
    case CLASS_Fixnum:
        goto L2;
    case CLASS_String:
        goto L2;
    case CLASS_Id:
        name = prim_fetch(expr, runtime_makeNumber(0));
        goto L3;
    case CLASS_HiConsApp:
        cp = prim_fetch(expr, runtime_makeNumber(0));
        cpArgs = prim_fetch(expr, runtime_makeNumber(1));
        goto L4;
    case CLASS_HiPrimApp:
        cp = prim_fetch(expr, runtime_makeNumber(0));
        cpArgs = prim_fetch(expr, runtime_makeNumber(1));
        goto L4;
    case CLASS_HiCall:
        f = prim_fetch(expr, runtime_makeNumber(0));
        args = prim_fetch(expr, runtime_makeNumber(1));
        goto L5;
    case CLASS_HiMatch:
        test = prim_fetch(expr, runtime_makeNumber(0));
        clauses = prim_fetch(expr, runtime_makeNumber(1));
        goto L6;
    default:
        runtime_matchFailure(__LINE__);
    }
L2:
    return pass1TrivialExpr(expr, cont);
L3:
    return pass1TrivialExpr(expr, cont);
L4:
    return pass1TrivialExpr(expr, cont);
L5:
    return pass1CallExpr(f, args, cont);
L6:
    return pass1MatchExpr(test, clauses, cont);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3fbd
cmpw $0xf, %ax
ja 0x19b1
movzwl %ax, %eax
leaq 0x3675(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movl $0x1, %edi
jmp 0x19fc
movl $0x122, %edi            # imm = 0x122
callq 0x4314
jmp 0x1a0c
xorl %edi, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movl $0x1, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1d84
xorl %edi, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x1a59
xorl %edi, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movl $0x1, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1c90
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1CallExpr
long pass1CallExpr(long f, long args, long cont)
{
    long x5, x4, label, x3, x2, contBlocks, explicitCont, x1;
    goto L1;
L1:
    x1 = pass1ExplicitCont(cont);
    goto L2;
L2:
    switch (runtime_class(x1)) {
    case CLASS_Pair:
        explicitCont = prim_fetch(x1, runtime_makeNumber(0));
        contBlocks = prim_fetch(x1, runtime_makeNumber(1));
        goto L3;
    default:
        runtime_matchFailure(__LINE__);
    }
L3:
    switch (runtime_class(explicitCont)) {
    case CLASS_P1TailCont:
        goto L4;
    case CLASS_P1BlockCont:
        label = prim_fetch(explicitCont, runtime_makeNumber(0));
        goto L5;
    default:
        runtime_matchFailure(__LINE__);
    }
L4:
    x2 = FiCall(nil, f, args);
    x3 = Triple(nil, x2, nil);
    return x3;
L5:
    x4 = FiCall(label, f, args);
    x5 = Triple(nil, x4, contBlocks);
    return x5;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x1e45
movq %rax, %r15
movq %rax, %rdi
callq 0x3fbd
cmpw $0x1f, %ax
jne 0x1ce6
xorl %edi, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r12
movl $0x1, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
jmp 0x1cf0
movl $0x13e, %edi            # imm = 0x13E
callq 0x4314
movq %r12, %rdi
callq 0x3fbd
cmpw $0x21, %ax
je 0x1d4c
movzwl %ax, %eax
cmpl $0x22, %eax
jne 0x1d42
xorl %edi, %edi
callq 0x4043
movq %r12, %rdi
movq %rax, %rsi
callq 0x3fe4
movl $0x17, %edi
movq %rax, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x41b2
leaq 0x264f6(%rip), %rcx     # 0x28228
movq (%rcx), %rsi
movl $0x20, %edi
movq %rax, %rdx
movq %r15, %rcx
jmp 0x1d74
movl $0x148, %edi            # imm = 0x148
callq 0x4314
leaq 0x264d5(%rip), %r15     # 0x28228
movq (%r15), %rsi
movl $0x17, %edi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x41b2
movq (%r15), %rcx
movl $0x20, %edi
movq %rcx, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x41b2
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1MatchExpr
long pass1MatchExpr(long test, long clauses, long cont)
{
    long x5, x4, clauseBlocks, x3, x2, contBlocks, explicitCont, x1, labeledClauses;
    goto L1;
L1:
    labeledClauses = pass1LabeledClauses(clauses);
    goto L2;
L2:
    x1 = pass1ExplicitCont(cont);
    goto L3;
L3:
    switch (runtime_class(x1)) {
    case CLASS_Pair:
        explicitCont = prim_fetch(x1, runtime_makeNumber(0));
        contBlocks = prim_fetch(x1, runtime_makeNumber(1));
        goto L4;
    default:
        runtime_matchFailure(__LINE__);
    }
L4:
    clauseBlocks = pass1ClauseBlocks(labeledClauses, explicitCont);
    goto L6;
L5:
    x3 = FiMatch(test, x2);
    x4 = append(contBlocks, clauseBlocks);
    goto L7;
L6:
    x2 = pass1TransformedClauses(labeledClauses);
    goto L5;
L7:
    x5 = Triple(nil, x3, x4);
    return x5;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1f8a
movq %rax, %r14
movq %r15, %rdi
callq 0x1e45
movq %rax, %r15
movq %rax, %rdi
callq 0x3fbd
cmpw $0x1f, %ax
jne 0x1e40
xorl %edi, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r12
movl $0x1, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x1ff4
movq %rax, %r12
movq %r14, %rdi
callq 0x2070
movl $0x1a, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4126
movq %rax, %rbx
movq %r15, %rdi
movq %r12, %rsi
callq 0x144e
leaq 0x26406(%rip), %rcx     # 0x28228
movq (%rcx), %rsi
movl $0x20, %edi
movq %rbx, %rdx
movq %rax, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x41b2
callq 0x114b
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1ExplicitCont
long pass1ExplicitCont(long cont)
{
    long x2, explicitCont, contBlocks, blk, args, blks, xfer, stmts, triple, x1, label, formsCont, forms, x;
    goto L1;
L1:
    switch (runtime_class(cont)) {
    case CLASS_P1TrivialCont:
        x = prim_fetch(cont, runtime_makeNumber(0));
        forms = prim_fetch(cont, runtime_makeNumber(1));
        formsCont = prim_fetch(cont, runtime_makeNumber(2));
        goto L2;
    default:
        goto L3;
    }
L2:
    label = prim_genLabel();
    triple = pass1Begin(forms, formsCont);
    goto L4;
L3:
    x1 = Pair(cont, nil);
    return x1;
L4:
    switch (runtime_class(triple)) {
    case CLASS_Triple:
        stmts = prim_fetch(triple, runtime_makeNumber(0));
        xfer = prim_fetch(triple, runtime_makeNumber(1));
        blks = prim_fetch(triple, runtime_makeNumber(2));
        goto L5;
    default:
        runtime_matchFailure(__LINE__);
    }
L5:
    args = prim_cons(x, nil);
    blk = FiBlock(label, args, stmts, xfer);
    contBlocks = prim_cons(blk, blks);
    explicitCont = P1BlockCont(label);
    x2 = Pair(explicitCont, contBlocks);
    return x2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
callq 0x3fbd
cmpw $0x23, %ax
jne 0x1f10
xorl %edi, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %rbx
movl $0x1, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movl $0x2, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r12
callq 0x43a7
movq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0x1772
movq %rax, %r12
movq %rax, %rdi
callq 0x3fbd
cmpw $0x20, %ax
jne 0x1f24
xorl %edi, %edi
callq 0x4043
movq %r12, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movl $0x1, %edi
callq 0x4043
movq %r12, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r13
movl $0x2, %edi
callq 0x4043
movq %r12, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r12
jmp 0x1f2e
leaq 0x26311(%rip), %rax     # 0x28228
movq (%rax), %rdx
movl $0x1f, %edi
movq %r14, %rsi
jmp 0x1f7c
movl $0x289, %edi            # imm = 0x289
callq 0x4314
leaq 0x262f3(%rip), %rax     # 0x28228
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x4350
movl $0x15, %edi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, %rcx
movq %r13, %r8
callq 0x424e
movq %rax, %rdi
movq %r12, %rsi
callq 0x4350
movq %rax, %rbx
movl $0x22, %edi
movq %r14, %rsi
callq 0x40a0
movl $0x1f, %edi
movq %rax, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4126
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1LabeledClauses
long pass1LabeledClauses(long clauses)
{
    long x2, x1, moreClauses, clause;
    goto L1;
L1:
    switch (runtime_class(clauses)) {
    case CLASS_Cons:
        clause = prim_fetch(clauses, runtime_makeNumber(0));
        moreClauses = prim_fetch(clauses, runtime_makeNumber(1));
        goto L2;
    default:
        goto L3;
    }
L2:
    x1 = prim_genLabel();
    x2 = Pair(x1, clause);
    return x2;
L3:
    return nil;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3fbd
cmpw $0x3, %ax
jne 0x1fe2
xorl %edi, %edi
callq 0x4043
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r14
movl $0x1, %edi
callq 0x4043
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3fe4
callq 0x43a7
movl $0x1f, %edi
movq %rax, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4126
leaq 0x2623f(%rip), %rax     # 0x28228
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1ClauseBlocks
long pass1ClauseBlocks(long labeledClauses, long cont)
{
    long x2, x1, moreLabeledClauses, labeledClause;
    goto L1;
L1:
    switch (runtime_class(labeledClauses)) {
    case CLASS_Cons:
        labeledClause = prim_fetch(labeledClauses, runtime_makeNumber(0));
        moreLabeledClauses = prim_fetch(labeledClauses, runtime_makeNumber(1));
        goto L2;
    default:
        goto L3;
    }
L2:
    x1 = pass1OneClauseBlocks(labeledClause, cont);
    goto L4;
L3:
    return nil;
L4:
    x2 = pass1ClauseBlocks(moreLabeledClauses, cont);
    goto L5;
L5:
    return append(x1, x2);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3fbd
cmpw $0x3, %ax
jne 0x2060
xorl %edi, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movl $0x1, %edi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
callq 0x21c2
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ff4
movq %r15, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x144e
leaq 0x261c1(%rip), %rax     # 0x28228
movq (%rax), %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/bootstrap1.c
// Function: pass1TransformedClauses
long pass1TransformedClauses(long labeledClauses)
{
    long x5, x4, x3, x2, elseBlk, x1, caseBlk, caseArgs, c, clause, label, moreLabeledClauses, labeledClause;
    goto L1;
L1:
    switch (runtime_class(labeledClauses)) {
    case CLASS_Cons:
        labeledClause = prim_fetch(labeledClauses, runtime_makeNumber(0));
        moreLabeledClauses = prim_fetch(labeledClauses, runtime_makeNumber(1));
        goto L2;
    default:
        goto L3;
    }
L2:
    switch (runtime_class(labeledClause)) {
    case CLASS_Pair:
        label = prim_fetch(labeledClause, runtime_makeNumber(0));
        clause = prim_fetch(labeledClause, runtime_makeNumber(1));
        goto L4;
    default:
        runtime_matchFailure(__LINE__);
    }
L3:
    return nil;
L4:
    switch (runtime_class(clause)) {
    case CLASS_HiCase:
        c = prim_fetch(clause, runtime_makeNumber(0));
        caseArgs = prim_fetch(clause, runtime_makeNumber(1));
        caseBlk = prim_fetch(clause, runtime_makeNumber(2));
        goto L5;
    case CLASS_HiElse:
        elseBlk = prim_fetch(clause, runtime_makeNumber(0));
        goto L6;
    default:
        runtime_matchFailure(__LINE__);
    }
L5:
    x1 = FiCase(c, label);
        x3 = x1;
    goto L7;
L6:
    x2 = FiElse(label);
        x3 = x2;
    goto L7;
L7:
    x4 = pass1TransformedClauses(moreLabeledClauses);
    goto L8;
L8:
    x5 = prim_cons(x3, x4);
    return x5;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3fbd
cmpw $0x3, %ax
jne 0x2137
xorl %edi, %edi
callq 0x4043
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movl $0x1, %edi
callq 0x4043
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %rbx
movq %r15, %rdi
callq 0x3fbd
cmpw $0x1f, %ax
jne 0x212d
xorl %edi, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r14
movl $0x1, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r15
movq %rax, %rdi
callq 0x3fbd
cmpw $0x10, %ax
je 0x214d
movzwl %ax, %eax
cmpl $0x11, %eax
jne 0x21bd
xorl %edi, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movl $0x1c, %edi
movq %r14, %rsi
callq 0x40a0
jmp 0x219c
movl $0x18a, %edi            # imm = 0x18A
callq 0x4314
leaq 0x260ea(%rip), %rax     # 0x28228
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %edi, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, %r12
movl $0x1, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movl $0x2, %edi
callq 0x4043
movq %r15, %rdi
movq %rax, %rsi
callq 0x3fe4
movl $0x1b, %edi
movq %r12, %rsi
movq %r14, %rdx
callq 0x4126
movq %rax, %r14
movq %rbx, %rdi
callq 0x2070
movq %r14, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4350
callq 0x1156
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/printer.c
// Function: match
static int match(long x, unsigned short class, ...)
{
    va_list ap;
    long *p;
    int arity, i, matched;

    va_start(ap, class);

    matched = (runtime_class(x) == class);
    arity = runtime_classArities[class];
    for (i = 0; i < arity; i++) {
        p = va_arg(ap, long *);
        if (matched)
            *p = prim_fetch(x, runtime_makeNumber(i));
    }

    va_end(ap);

    return matched;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x3b9f
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
callq 0x3fbd
movl %eax, %ebp
movl %ebx, %eax
leaq 0x45b1(%rip), %rcx      # 0x8180
movzbl (%rcx,%rax), %r12d
testq %r12, %r12
je 0x3c2a
xorl %r15d, %r15d
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x3bf5
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x3c03
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpw %bx, %bp
jne 0x3c22
movq (%rax), %r13
movq %r15, %rdi
callq 0x4043
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fe4
movq %rax, (%r13)
incq %r15
cmpq %r15, %r12
jne 0x3bdc
xorl %eax, %eax
cmpw %bx, %bp
sete %al
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/printer.c
// Function: prFuncSpec
static void prFuncSpec(long name, long args)
{
    pr("long "), prStr(name), pr("(");
    if (length(args) > 0)
        prTypedIds(args);
    else
        pr("void");
    pr(")");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1903(%rip), %rdi      # 0x5582
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x3f8c
movq %rax, %rdi
xorl %eax, %eax
callq 0x1070
movl $0x28, %edi
callq 0x1040
movq %rbx, %rdi
callq 0x3d4c
testl %eax, %eax
jle 0x3d28
leaq 0x8(%rsp), %rcx
movq %rbx, (%rcx)
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x3b39
testl %eax, %eax
je 0x3d36
leaq 0x18d2(%rip), %rdi      # 0x55a7
leaq 0x18a6(%rip), %rbx      # 0x5582
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x1821(%rip), %r12      # 0x550e
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
movq 0x10(%rsp), %rdi
callq 0x3c44
movq 0x8(%rsp), %rdi
movl $0x3, %esi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x3b39
movq %r12, %rdi
testl %eax, %eax
jne 0x3ced
jmp 0x3d36
leaq 0x184a(%rip), %rdi      # 0x5579
xorl %eax, %eax
callq 0x1070
movl $0x29, %edi
callq 0x1040
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/printer.c
// Function: prIds
static void prIds(long ids)
{
    long id;
    const char *sep = "";

    forEach(ids, id)
        pr(sep), prId(id), sep = ", ";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rcx
movq %rdi, (%rcx)
leaq 0x8(%rsp), %rdx
movl $0x3, %esi
xorl %eax, %eax
callq 0x3b39
testl %eax, %eax
je 0x3df3
leaq 0x17f1(%rip), %rdi      # 0x55a7
leaq 0x8(%rsp), %rbx
movq %rsp, %r14
leaq 0x1749(%rip), %r15      # 0x550e
xorl %eax, %eax
callq 0x1070
movq 0x8(%rsp), %rdi
callq 0x3c44
movq (%rsp), %rdi
movl $0x3, %esi
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x3b39
movq %r15, %rdi
testl %eax, %eax
jne 0x3dc5
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/printer.c
// Function: findArgs
static long findArgs(long key, long blocks)
{
    const char *keyString;
    long id, args, stmts, transfer, block;

    keyString = runtime_stringValue(key);
    forEach(blocks, block) {
        if (match(block, CLASS_FiBlock, &id, &args, &stmts, &transfer))
            if (!strcmp(runtime_stringValue(idName(id)), keyString))
                return args;
    }

    die("Failed to find arguments for block.");
    return nil;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
callq 0x3f8c
movq %rax, %rbx
leaq 0x8(%rsp), %rcx
movq %r14, (%rcx)
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x3b39
testl %eax, %eax
sete %r15b
je 0x3ec5
leaq 0x30(%rsp), %r12
leaq 0x28(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x8(%rsp), %r14
movq 0x10(%rsp), %rdi
movl $0x15, %esi
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x3b39
testl %eax, %eax
je 0x3ea2
movq 0x20(%rsp), %rdi
leaq 0x24385(%rip), %rax     # 0x28208
movq (%rax), %rsi
callq 0x3fe4
movq %rax, %rdi
callq 0x3f8c
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10a0
testl %eax, %eax
je 0x3ec7
movq 0x8(%rsp), %rdi
movl $0x3, %esi
movq %rbp, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x3b39
movl %eax, %ecx
testl %ecx, %ecx
sete %r15b
jne 0x3e52
jmp 0x3ecc
jmp 0x3ecc
movq 0x18(%rsp), %rax
testb $0x1, %r15b
je 0x3ee8
leaq 0x1780(%rip), %rdi      # 0x5659
callq 0x44a0
leaq 0x24343(%rip), %rax     # 0x28228
movq (%rax), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: makeString
static long makeString(const char *s)
{
    unsigned long align;
    unsigned long size;
    unsigned long len;
    unsigned long i;

    len = strlen(s);
    align = sizeof(long);
    size = sizeof(long) + len + 1;
    i = storeAlloc(align, size);
    *(long *)(store.data + i) = makeNumber((long)len);
    memmove(store.data + i + sizeof(long), s, len + 1);

    return (long)(i << 16 | CLASS_String);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
callq 0x1060
movq %rax, %r15
movq 0x242db(%rip), %rbx     # 0x281f0
addq $0x7, %rbx
movabsq $0x1fffffffffffffff, %r12 # imm = 0x1FFFFFFFFFFFFFFF
andq %rbx, %r12
leaq (%rax,%r12), %r13
addq $0x9, %r13
movzbl 0x242b3(%rip), %eax     # 0x281e8
shll $0x1b, %eax
cmpq %rax, %r13
jbe 0x3f49
leaq 0x1846(%rip), %rdi      # 0x578a
callq 0x44a0
movq %r13, 0x242a0(%rip)     # 0x281f0
movq %r15, %rax
shlq $0x10, %rax
movq 0x2429a(%rip), %rcx     # 0x281f8
leaq (%rcx,%r12), %rdi
addq $0x8, %rdi
movq %rax, -0x8(%rdi)
incq %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x10f0
shlq $0x10, %rbx
incq %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: prim_fetch
long prim_fetch(long m, long k)
{
    long *tuple;
    unsigned char arity;
    long i;

    /* TODO What sanity checks do we want here? */

    arity = runtime_classArities[runtime_class(m)];
    i = fixnumValue(k);

    if (i >= arity)
        die("Fetching slot that does not exist.");

    tuple = storeAddr(m);
    return tuple[i];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, 0x241ee(%rip)     # 0x281e0
movzwl %bx, %eax
leaq 0x4184(%rip), %rcx      # 0x8180
movzbl (%rax,%rcx), %eax
movq %rsi, %rcx
shrq $0x10, %rcx
movabsq $-0x1000000000000, %r14 # imm = 0xFFFF000000000000
orq %rcx, %r14
testq %rsi, %rsi
cmovnsq %rcx, %r14
cmpq %rax, %r14
jl 0x402c
leaq 0x16e0(%rip), %rdi      # 0x5707
callq 0x44a0
shrq $0x10, %rbx
addq 0x241c1(%rip), %rbx     # 0x281f8
movq (%rbx,%r14,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: prim_die
long prim_die(long e)
{
    const char *s;

    mustBe(CLASS_String, e);

    s = storeAddr(e) + sizeof(long);
    die(s);

    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rdi, 0x2418a(%rip)     # 0x281e0
cmpw $0x1, %bx
je 0x4068
leaq 0x1698(%rip), %rdi      # 0x56fb
callq 0x44a0
movq 0x24189(%rip), %rax     # 0x281f8
shrq $0x10, %rbx
leaq (%rax,%rbx), %rdi
addq $0x8, %rdi
callq 0x44a0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: runtime_makeTuple1
long runtime_makeTuple1(unsigned short class, long a)
{
    unsigned long align;
    unsigned long size;
    unsigned long i;
    long *tuple;

    if (runtime_classArities[class] != 1) {
        fprintf(stderr, "Class: %d Arity: %d\n", (int)class, 1);
        die("Arity error while making tuple.");
    }

    align = sizeof(long);
    size = sizeof(long);
    i = storeAlloc(align, size);
    tuple = store.data + i;

    tuple[0] = a;

    return (long)(i << 16 | class);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r15d
leaq 0x40cb(%rip), %rax      # 0x8180
cmpb $0x1, (%r15,%rax)
jne 0x411f
movq 0x2412d(%rip), %r14     # 0x281f0
addq $0x7, %r14
movabsq $0x1fffffffffffffff, %r12 # imm = 0x1FFFFFFFFFFFFFFF
andq %r14, %r12
cmpq $0x7fffff9, %r12        # imm = 0x7FFFFF9
setb %al
testb %al, 0x24104(%rip)      # 0x281e8
jne 0x40f2
leaq 0x169d(%rip), %rdi      # 0x578a
callq 0x44a0
leaq 0x8(%r12), %rax
movq %rax, 0x240f2(%rip)     # 0x281f0
movq 0x240f3(%rip), %rax     # 0x281f8
movq %rbx, (%rax,%r12)
shlq $0x10, %r14
orq %r15, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x126b
jmp 0x40bc
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: runtime_makeTuple2
long runtime_makeTuple2(unsigned short class, long a, long b)
{
    unsigned long align;
    unsigned long size;
    unsigned long i;
    long *tuple;

    if (runtime_classArities[class] != 2) {
        fprintf(stderr, "Class: %d Arity: %d\n", (int)class, 2);
        die("Arity error while making tuple.");
    }

    align = sizeof(long);
    size = 2 * sizeof(long);
    i = storeAlloc(align, size);
    tuple = store.data + i;

    tuple[0] = a;
    tuple[1] = b;

    return (long)(i << 16 | class);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r12d
leaq 0x4041(%rip), %rax      # 0x8180
cmpb $0x2, (%r12,%rax)
jne 0x41ab
movq 0x240a3(%rip), %r15     # 0x281f0
addq $0x7, %r15
movabsq $0x1fffffffffffffff, %r13 # imm = 0x1FFFFFFFFFFFFFFF
andq %r15, %r13
cmpq $0x7fffff1, %r13        # imm = 0x7FFFFF1
setb %al
testb %al, 0x2407a(%rip)      # 0x281e8
jne 0x417c
leaq 0x1613(%rip), %rdi      # 0x578a
callq 0x44a0
leaq 0x10(%r13), %rax
movq %rax, 0x24069(%rip)     # 0x281f0
movq 0x2406a(%rip), %rax     # 0x281f8
movq %r14, (%rax,%r13)
movq %rbx, 0x8(%rax,%r13)
shlq $0x10, %r15
orq %r12, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x129a
jmp 0x4146
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: runtime_makeTuple3
long runtime_makeTuple3(unsigned short class, long a, long b, long c)
{
    unsigned long align;
    unsigned long size;
    unsigned long i;
    long *tuple;

    if (runtime_classArities[class] != 3) {
        fprintf(stderr, "Class: %d Arity: %d\n", (int)class, 3);
        die("Arity error while making tuple.");
    }

    align = sizeof(long);
    size = 3 * sizeof(long);
    i = storeAlloc(align, size);
    tuple = store.data + i;

    tuple[0] = a;
    tuple[1] = b;
    tuple[2] = c;

    return (long)(i << 16 | class);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r13d
leaq 0x3fb0(%rip), %rax      # 0x8180
cmpb $0x3, (%r13,%rax)
jne 0x4247
movq 0x24011(%rip), %r12     # 0x281f0
addq $0x7, %r12
movabsq $0x1fffffffffffffff, %rbp # imm = 0x1FFFFFFFFFFFFFFF
andq %r12, %rbp
cmpq $0x7ffffe9, %rbp        # imm = 0x7FFFFE9
setb %al
testb %al, 0x23fe8(%rip)      # 0x281e8
jne 0x420e
leaq 0x1581(%rip), %rdi      # 0x578a
callq 0x44a0
leaq 0x18(%rbp), %rax
movq %rax, 0x23fd7(%rip)     # 0x281f0
movq 0x23fd8(%rip), %rax     # 0x281f8
movq %r15, (%rax,%rbp)
movq %r14, 0x8(%rax,%rbp)
movq %rbx, 0x10(%rax,%rbp)
shlq $0x10, %r12
orq %r13, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x12c9
jmp 0x41d8
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: runtime_makeTuple4
long runtime_makeTuple4(unsigned short class, long a, long b, long c, long d)
{
    unsigned long align;
    unsigned long size;
    unsigned long i;
    long *tuple;

    if (runtime_classArities[class] != 4) {
        fprintf(stderr, "Class: %d Arity: %d\n", (int)class, 4);
        die("Arity error while making tuple.");
    }

    align = sizeof(long);
    size = 4 * sizeof(long);
    i = storeAlloc(align, size);
    tuple = store.data + i;

    tuple[0] = a;
    tuple[1] = b;
    tuple[2] = c;
    tuple[3] = d;

    return (long)(i << 16 | class);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %ebp
leaq 0x3f15(%rip), %rax      # 0x8180
cmpb $0x4, (%rbp,%rax)
jne 0x4304
movq 0x23f73(%rip), %r13     # 0x281f0
addq $0x7, %r13
movabsq $0x1fffffffffffffff, %rbx # imm = 0x1FFFFFFFFFFFFFFF
andq %r13, %rbx
cmpq $0x7ffffe1, %rbx        # imm = 0x7FFFFE1
setb %al
testb %al, 0x23f4a(%rip)      # 0x281e8
jne 0x42c6
leaq 0x14e3(%rip), %rdi      # 0x578a
movq %r12, (%rsp)
movq %r15, %r12
movq %r14, %r15
movq %r8, %r14
callq 0x44a0
movq %r14, %r8
movq %r15, %r14
movq %r12, %r15
movq (%rsp), %r12
leaq 0x20(%rbx), %rax
movq %rax, 0x23f1f(%rip)     # 0x281f0
movq 0x23f20(%rip), %rax     # 0x281f8
movq %r12, (%rax,%rbx)
movq %r15, 0x8(%rax,%rbx)
movq %r14, 0x10(%rax,%rbx)
movq %r8, 0x18(%rax,%rbx)
shlq $0x10, %r13
orq %rbp, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r8, %rbx
callq 0x12f8
movq %rbx, %r8
jmp 0x4276
// File: /workspace/github_c_makefile_star2_O1/ebb[P]chisa/runtime.c
// Function: runtime_init
void runtime_init(void)
{
    storeInit(128 * 1024 * 1024);
    runtime_0 = runtime_makeNumber(0);
    runtime_1 = runtime_makeNumber(1);
    runtime_2 = runtime_makeNumber(2);
    runtime_3 = runtime_makeNumber(3);
    nil = runtime_makeTuple0(CLASS_Nil);
}

// Assembly:
pushq %rax
movb $0x1, 0x23db4(%rip)     # 0x281e8
movq $0x0, 0x23db1(%rip) # 0x281f0
movl $0x8000000, %edi        # imm = 0x8000000
callq 0x10d0
movq %rax, 0x23da8(%rip)     # 0x281f8
testq %rax, %rax
jne 0x4461
leaq 0x135c(%rip), %rdi      # 0x57b8
callq 0x44a0
movq $0x0, 0x23d9c(%rip) # 0x28208
movq $0x10000, 0x23d99(%rip) # imm = 0x10000
movq $0x20000, 0x23d96(%rip) # imm = 0x20000
movq $0x30000, 0x23d93(%rip) # imm = 0x30000
movl $0x2, %edi
callq 0x4084
movq %rax, 0x23d8a(%rip)     # 0x28228
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/eric-lo[P]3150/8-Synchronization/normal_strtok.c
// Function: main
int main(void)
{
	char buf[STR_MAX];
	char *token;
	int i = 0;

	sprintf(buf, "Linux is a cool operating system");

	token = strtok((char *) buf, " ");		// 1st step for strtok()
	do
	{
		printf("Token %d = %s\n", i++, token);
	}
	while((token = strtok(NULL, " ")) != NULL);	// later steps for strtok()

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movups 0xeb6(%rip), %xmm0      # 0x2014
movq %rsp, %rdi
movaps %xmm0, 0x10(%rdi)
movups 0xe98(%rip), %xmm0      # 0x2004
movaps %xmm0, (%rdi)
movb $0x0, 0x20(%rdi)
leaq 0xeab(%rip), %rbx       # 0x2025
movq %rbx, %rsi
callq 0x1040
leaq 0xe9e(%rip), %r14       # 0x2027
xorl %esi, %esi
leal 0x1(%rsi), %ebp
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1030
xorl %edi, %edi
movq %rbx, %rsi
callq 0x1040
movl %ebp, %esi
testq %rax, %rax
jne 0x118b
xorl %eax, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: dthread_init
void dthread_init(void) {
    threads = (queue *)malloc(sizeof(queue));
    td_cur = (dthread *)malloc(sizeof(dthread));
    init_threads(threads);

    //initialising the current thread with main thread details
    td_cur->tid = tid_count++;
    td_cur->status = RUNNING;
    td_cur->state = JOINABLE;
    td_cur->start_routine = NULL;
    td_cur->args = NULL;
    td_cur->retval = NULL;
    td_cur->signal = -1;
    sigsetjmp(td_cur->context, 1);


    //initialising signal for timer
    struct sigaction sa;
    sigset_t mask;
    sigemptyset(&mask);
    sigaddset(&mask,SIGVTALRM);
    //whenever sigvtalrm is raised, scheduler is called
    sa.sa_handler = &scheduler;
    sa.sa_flags = 0;
    sa.sa_mask = mask;
    sigaction (SIGVTALRM, &sa, NULL);
    atexit(dthread_cleanup);
    start_timer(&timer);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movl $0x18, %edi
callq 0x10c0
movq %rax, %rbx
movq %rax, 0x2e76(%rip)      # 0x40b8
movl $0x100, %edi            # imm = 0x100
callq 0x10c0
movq %rax, 0x2e6d(%rip)      # 0x40c0
movq %rbx, %rdi
callq 0x17b4
movq 0x2e66(%rip), %rax      # 0x40c8
leaq 0x1(%rax), %rcx
movq %rcx, 0x2e5b(%rip)      # 0x40c8
movq 0x2e4c(%rip), %rdi      # 0x40c0
movq %rax, (%rdi)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
xorl %eax, %eax
movl %eax, %ebx
movq %rbx, 0x28(%rdi)
movl $0xffffffff, 0xf8(%rdi) # imm = 0xFFFFFFFF
addq $0x30, %rdi
movl $0x1, %r14d
movl %r14d, %esi
callq 0x1100
leaq -0x138(%rbp), %r15
movq %r15, %rdi
callq 0x10b0
movl $0x1a, %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x1110
leaq 0x118(%rip), %rax       # 0x13ef
leaq -0xb0(%rbp), %rdi
movq %rax, -0x8(%rdi)
movl $0x0, 0x80(%rdi)
movl $0x10, %ecx
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0xb8(%rbp), %rsi
movl %r12d, %edi
movq %rbx, %rdx
callq 0x1060
leaq 0x48(%rip), %rdi        # 0x1358
callq 0x1cb0
movq %rbx, 0x2dc4(%rip)      # 0x40e0
leaq 0x2dad(%rip), %rsi      # 0x40d0
movl $0x7d0, %eax            # imm = 0x7D0
movq %rax, 0x2db9(%rip)      # 0x40e8
movq %rbx, 0x2d9a(%rip)      # 0x40d0
movq %rax, 0x2d9b(%rip)      # 0x40d8
movl %r14d, %edi
movq %rbx, %rdx
callq 0x10d0
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: dthread_cleanup
void dthread_cleanup() {
    dthread *td;
    int count = threads->count;
    for(int i = 0; i < count; i++){
        td = dequeue(threads);
        free(td);
    }
    //final threads remove
    free(threads);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x2d53(%rip), %rax      # 0x40b8
movl 0x10(%rax), %ebx
testl %ebx, %ebx
jle 0x1384
movq 0x2d45(%rip), %rdi      # 0x40b8
callq 0x1813
movq %rax, %rdi
callq 0x1040
decl %ebx
jne 0x136c
movq 0x2d2d(%rip), %rdi      # 0x40b8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: start_timer
void start_timer(struct itimerval *timer) {
    timer->it_value.tv_sec = 0;
    timer->it_value.tv_usec = ALARM;
    timer->it_interval.tv_sec = 0;
    timer->it_interval.tv_usec = ALARM;
    setitimer(ITIMER_VIRTUAL, timer, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rsi
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movl $0x7d0, %ecx            # imm = 0x7D0
movq %rcx, 0x18(%rdi)
movq %rax, (%rdi)
movq %rcx, 0x8(%rdi)
movl $0x1, %edi
xorl %edx, %edx
popq %rbp
jmp 0x10d0
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: fn
void fn(void) {
    td_cur->retval = td_cur->start_routine(td_cur->args);
    td_cur->status = TERMINATED;
    raise(SIGVTALRM);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x2cf5(%rip), %rax      # 0x40c0
movq 0x20(%rax), %rdi
callq *0x18(%rax)
movq 0x2ce7(%rip), %rcx      # 0x40c0
movq %rax, 0x28(%rcx)
movl $0x3, 0xc(%rcx)
movl $0x1a, %edi
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: scheduler
void scheduler(int sig) {
    stop_timer(&timer);
    dthread_t temp_tid = td_cur->tid;
    if(sigsetjmp(td_cur->context, 1) == 1) {
        return;
    }
    
    enqueue(threads, td_cur);
    if(td_cur->status == RUNNING) {
        td_cur->status = READY;
    }

    //getting the next thread details:
    //in loop, to check if the thread is already terminated or not
    dthread *temp;
    int threads_count = threads->count;
    for(int i = 0; i < threads_count; i++) {
        temp = dequeue(threads);
        if(temp->status == READY) {
            td_cur = temp;
            td_cur->status = RUNNING;
            break;
        }
        else if(temp->status == TERMINATED) {
            enqueue(threads, temp);
        }
    }
    if(td_cur->tid == temp_tid) {
        exit(0);
    }
    if(td_cur->signal != -1) {
        raise(td_cur->signal);
        td_cur->signal = -1;
    }

    start_timer(&timer);
    siglongjmp(td_cur->context, 1);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x2ce0(%rip)     # 0x40e0
movups %xmm0, 0x2cc9(%rip)     # 0x40d0
leaq 0x2cc2(%rip), %rsi      # 0x40d0
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ebx
movl %ebx, %edi
callq 0x10d0
movq 0x2c9b(%rip), %rdi      # 0x40c0
movq (%rdi), %r14
addq $0x30, %rdi
movl %ebx, %esi
callq 0x1100
cmpl $0x1, %eax
jne 0x143d
popq %rbx
popq %r14
popq %rbp
retq
movq 0x2c74(%rip), %rdi      # 0x40b8
movq 0x2c75(%rip), %rsi      # 0x40c0
callq 0x17c7
movq 0x2c69(%rip), %rax      # 0x40c0
cmpl $0x2, 0xc(%rax)
jne 0x1464
movl $0x1, 0xc(%rax)
movq 0x2c4d(%rip), %rax      # 0x40b8
movl 0x10(%rax), %eax
testl %eax, %eax
jle 0x14b2
movl %eax, %ebx
movq 0x2c3d(%rip), %rdi      # 0x40b8
callq 0x1813
movl 0xc(%rax), %ecx
movq %rax, %rsi
cmpl $0x3, %ecx
je 0x1492
cmpl $0x1, %ecx
jne 0x149e
jmp 0x14a4
movq 0x2c1f(%rip), %rdi      # 0x40b8
callq 0x17c7
decl %ebx
jne 0x1474
jmp 0x14b2
movq %rsi, 0x2c15(%rip)      # 0x40c0
movl $0x2, 0xc(%rsi)
movq 0x2c07(%rip), %rax      # 0x40c0
cmpq %r14, (%rax)
jne 0x14c5
xorl %edi, %edi
callq 0x10f0
movl 0xf8(%rax), %edi
cmpl $-0x1, %edi
je 0x14e6
callq 0x1030
movq 0x2be4(%rip), %rax      # 0x40c0
movl $0xffffffff, 0xf8(%rax) # imm = 0xFFFFFFFF
leaq 0x2be3(%rip), %rdi      # 0x40d0
callq 0x1396
movq 0x2bc7(%rip), %rdi      # 0x40c0
addq $0x30, %rdi
movl $0x1, %esi
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: dthread_create
int dthread_create(dthread_t *thread, void *(*start_routine) (void *), void *args) {

    struct dthread *t;
    t = (dthread *) malloc(sizeof(dthread));

    t->tid = tid_count++;
	t->args = args;
    t->status = READY;
	t->start_routine = start_routine;
    t->signal = -1;
    t->state = JOINABLE;

    // allocate the memory for stack with mmap

    t->stack = mmap(NULL,THREAD_STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK,-1, 0);

    if(t->stack == MAP_FAILED) {
        start_timer(&timer);
        printf("Insufficient res");
        return EAGAIN;  //insufficient resources
    }

    //assigning the thread with the tid
    *thread = t->tid;

    //saving the context and changing the stack pointer, base pointer and program counter
    sigsetjmp(t->context, 1);
    t->context[0].__jmpbuf[6] = i64_ptr_mangle((long int) t->stack + THREAD_STACK_SIZE - sizeof(long int));
    t->context[0].__jmpbuf[1] = i64_ptr_mangle((long int) t->stack + THREAD_STACK_SIZE - sizeof(long int));
	t->context[0].__jmpbuf[7] = i64_ptr_mangle((long int) fn);
    // printf("%p", t->context);

    enqueue(threads, t);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movl $0x100, %edi            # imm = 0x100
callq 0x10c0
movq %rax, %r14
movq 0x2b7b(%rip), %rax      # 0x40c8
leaq 0x1(%rax), %rcx
movq %rcx, 0x2b70(%rip)      # 0x40c8
movq %rax, (%r14)
movq %r15, 0x20(%r14)
movq %r12, 0x18(%r14)
movl $0xffffffff, 0xf8(%r14) # imm = 0xFFFFFFFF
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r14)
xorl %r12d, %r12d
movl %r12d, %edi
movl $0x10000, %esi          # imm = 0x10000
movl $0x3, %edx
movl $0x20022, %ecx          # imm = 0x20022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq %rdi, %r9
callq 0x1070
movq %rax, 0x10(%r14)
cmpq $-0x1, %rax
je 0x161c
movq %r14, %r15
movq (%r14), %rax
movq %rax, (%rbx)
addq $0x30, %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x1100
movl $0xfff8, %eax           # imm = 0xFFF8
addq 0x10(%r15), %rax
movq %rax, %rcx
movq %rcx, %rax
xorq %fs:0x30, %rax
rolq $0x11, %rax
movq %rax, %rcx
movq %rcx, 0x60(%r15)
movq %rcx, 0x38(%r15)
leaq -0x231(%rip), %rcx      # 0x13c0
movq %rcx, %rax
xorq %fs:0x30, %rax
rolq $0x11, %rax
movq %rax, %rcx
movq %rcx, 0x68(%r15)
movq 0x2aa9(%rip), %rdi      # 0x40b8
movq %r15, %rsi
callq 0x17c7
movl %r12d, %eax
jmp 0x1665
xorl %ebx, %ebx
movl %ebx, %edx
movq %rdx, 0x2ab9(%rip)      # 0x40e0
leaq 0x2aa2(%rip), %rsi      # 0x40d0
movl $0x7d0, %eax            # imm = 0x7D0
movq %rax, 0x2aae(%rip)      # 0x40e8
movq %rdx, 0x2a8f(%rip)      # 0x40d0
movq %rax, 0x2a90(%rip)      # 0x40d8
movl $0x1, %edi
callq 0x10d0
leaq 0x9ab(%rip), %rdi       # 0x2004
movl %ebx, %eax
callq 0x1080
movl $0xb, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: dthread_join
int dthread_join(dthread_t thread, void **retval) {

    //find the node having that particular thread id
    
    dthread *temp;
    if(thread == td_cur->tid) {
        return EDEADLK;
    }
    temp = get_node_by_tid(threads,thread);
    if(temp == NULL) {
        return ESRCH;
    }

    //check if the thread is already joined or not
    if(temp->state == JOINED) {
        return EINVAL;
    }
    temp->state = JOINED;

    //othewise loop until the process is terminated
    while(1) {
        if (temp->status == TERMINATED) {
            break;
        }
    }
    //updating the retval  with the routine return value
    if(retval) {
        *retval = temp->retval;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x2a45(%rip), %rcx      # 0x40c0
movl $0x23, %eax
cmpq %rdi, (%rcx)
je 0x16ce
movq %rsi, %rbx
movq %rdi, %rsi
movq 0x2a26(%rip), %rdi      # 0x40b8
callq 0x18aa
testq %rax, %rax
je 0x16c9
movq %rax, %rcx
movl $0x16, %eax
cmpl $0x2, 0x8(%rcx)
je 0x16ce
movl $0x2, 0x8(%rcx)
cmpl $0x3, 0xc(%rcx)
jne 0x16c7
xorl %eax, %eax
testq %rbx, %rbx
je 0x16ce
movq 0x28(%rcx), %rcx
movq %rcx, (%rbx)
jmp 0x16ce
jmp 0x16c7
movl $0x3, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: dthread_exit
void dthread_exit(void *retval) {
    // changing the retval for the current running thread.
    td_cur->retval = retval;
    td_cur->status = TERMINATED;
    
    //raising the signal to call the scheduler 
    raise(SIGVTALRM);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x29e0(%rip), %rax      # 0x40c0
movq %rdi, 0x28(%rax)
movl $0x3, 0xc(%rax)
movl $0x1a, %edi
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/dthread.c
// Function: dthread_kill
int dthread_kill(dthread_t thread, int sig) {
    //no signal
    if(sig == 0) {
        return 0;
    }
    //invalid signal
    if(sig < 0 || sig > 64) {
        return EINVAL;
    }

    // check if current thread id is same as the thread passed

    int status = -1;
    if(thread == td_cur->tid) {
        status = raise(sig);
    }

    //otherwise store it into the thread structure to raise it later
    else {
        dthread *temp = get_node_by_tid(threads, thread);
        if(temp != NULL) {
            temp->signal = sig;
            status = 0;
        }
        else {
            status = ESRCH;
        }
    }
   
    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
xorl %eax, %eax
testl %esi, %esi
je 0x174a
movl $0x16, %eax
cmpl $0x40, %ebx
ja 0x174a
movq %rdi, %rsi
movq 0x29a8(%rip), %rax      # 0x40c0
cmpq %rdi, (%rax)
jne 0x172a
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1030
movq 0x2987(%rip), %rdi      # 0x40b8
callq 0x18aa
testq %rax, %rax
je 0x1745
movl %ebx, 0xf8(%rax)
xorl %eax, %eax
jmp 0x174a
movl $0x3, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/queue.c
// Function: enqueue
void enqueue(queue *t, dthread *td) {
    node *ptr = (node *)malloc(sizeof(node));
    //assigning the new node details
    ptr->td = td;
    ptr->next = NULL;
    //checking if the queue is empty, if empty head and tail points to ptr
    if(t->count == 0) {
        t->head = t->tail = ptr;
    }

    //otherwise append the node to last changing the tail pointer to ptr
    else {
        t->tail->next = ptr;
        t->tail = ptr;
    }
    //increment the count
    t->count = t->count+ 1;
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x10, %edi
callq 0x10c0
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
movl 0x10(%rbx), %ecx
leaq 0x8(%rbx), %rdx
testl %ecx, %ecx
je 0x17fd
movq (%rdx), %rsi
addq $0x8, %rsi
jmp 0x1803
movq %rdx, %rsi
movq %rbx, %rdx
movq %rax, (%rsi)
movq %rax, (%rdx)
incl %ecx
movl %ecx, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq