LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_create
int dthread_create(dthread_t *thread, void *(*start_routine) (void *), void *args) {

    dthread_spin_lock(&lock);
    struct dthread *t;
    t = (dthread *) malloc(sizeof(dthread));
    if(t == NULL) {
        dthread_spin_unlock(&lock);
        return -1;        
    }
    int clone_return;
    char *stack_top;

    // by using mmap allocate the stack
    t->stack = mmap(NULL, THREAD_STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
    if (t->stack == MAP_FAILED) {
        dthread_spin_unlock(&lock);
        return EAGAIN;
    }
    
    stack_top = t->stack + THREAD_STACK_SIZE;

    t->args = args;
    t->start_routine = start_routine;
    t->state = JOINABLE;
    clone_return = clone(fn, stack_top, SIGCHLD | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_VM, (void *)t);
    if(clone_return == -1) {
        dthread_spin_unlock(&lock);
        return EINVAL;
    }
    t->tid = clone_return;      //assigning the thread_id

    insert_beg(threads, t);
    *thread = t->tid;
    dthread_spin_unlock(&lock);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq 0x2d65(%rip), %rdi      # 0x40e0
callq 0x12d0
movl $0x30, %edi
callq 0x10b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x13ad
leaq 0x2d44(%rip), %rdi      # 0x40e0
callq 0x12f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14ad
xorl %eax, %eax
movl %eax, %r9d
movl $0x10000, %esi          # imm = 0x10000
movl $0x3, %edx
movl $0x20022, %ecx          # imm = 0x20022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq %r9, %rdi
callq 0x1070
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq $-0x1, %rcx
cmpq %rcx, 0x10(%rax)
jne 0x1403
leaq 0x2cee(%rip), %rdi      # 0x40e0
callq 0x12f0
movl $0xb, -0x4(%rbp)
jmp 0x14ad
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x10000, %rax          # imm = 0x10000
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq -0x127(%rip), %rdi      # 0x1320
movl $0xf11, %edx            # imm = 0xF11
movb $0x0, %al
callq 0x1050
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0x1471
leaq 0x2c7d(%rip), %rdi      # 0x40e0
callq 0x12f0
movl $0x16, -0x4(%rbp)
jmp 0x14ad
movslq -0x2c(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq 0x2c65(%rip), %rdi      # 0x40e8
movq -0x28(%rbp), %rsi
callq 0x18e0
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
leaq 0x2c3f(%rip), %rdi      # 0x40e0
callq 0x12f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_exit
void dthread_exit(void *retval) {
    dthread_t tid = dthread_self();

    //get the node with tid and change its return value;
    dthread *td = get_node_by_tid(threads, tid);
    
    if(main_thread_pid == tid) {
        // fetch all the tid and pass it to join function 
        node *ptr;
        if(threads->head == NULL) {
            // printf("\nEmpty");
            return;
        }
        dthread_spin_lock(&lock);
        ptr = threads->head;
        dthread_spin_unlock(&lock);

        while(ptr != NULL) {
            if(ptr->td->state == JOINABLE) {
                dthread_join(ptr->td->tid, NULL);
            }
            ptr = ptr->next;
        }
        dthread_cleanup();
        exit(0);
    }
    if(td == NULL) {
        return;
    }
    
    td->retval = retval;
    exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x15a0
movq %rax, -0x10(%rbp)
movq 0x2c0c(%rip), %rdi      # 0x40e8
movq -0x10(%rbp), %rsi
callq 0x1b00
movq %rax, -0x18(%rbp)
movslq 0x2c00(%rip), %rax      # 0x40f0
cmpq -0x10(%rbp), %rax
jne 0x156f
movq 0x2beb(%rip), %rax      # 0x40e8
cmpq $0x0, (%rax)
jne 0x1508
jmp 0x158b
leaq 0x2bd1(%rip), %rdi      # 0x40e0
callq 0x12d0
movq 0x2bcd(%rip), %rax      # 0x40e8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
leaq 0x2bb7(%rip), %rdi      # 0x40e0
callq 0x12f0
cmpq $0x0, -0x20(%rbp)
je 0x1563
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, 0x8(%rax)
jne 0x1555
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x15c0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x152e
callq 0x1250
xorl %edi, %edi
callq 0x10e0
cmpq $0x0, -0x18(%rbp)
jne 0x1578
jmp 0x158b
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
xorl %edi, %edi
callq 0x10e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_join
int dthread_join(dthread_t thread, void **retval) {

    // function shall suspend execution of the calling thread until the target thread terminates,
    dthread_spin_lock(&lock);
    dthread *td = get_node_by_tid(threads, thread);
    dthread_t tid = dthread_self();
    dthread_spin_unlock(&lock);

    //join calling from same calling function
    if(tid == thread) {
        return EDEADLK;
    }

    if(td == NULL){
        return ESRCH;
    }

    
    if(td->state == JOINED) {
        return EINVAL;
    }
    int status;

    if(td->state == JOINABLE) {
        td->state = JOINED;
        waitpid(thread,&status, 0);
        if(status == -1) {
            perror("waitpid");
            exit(EXIT_FAILURE);
        }
    } 
    //updating the retval
    if(retval) {
        *retval = td->retval;
    }
    return 0; //success
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x2b09(%rip), %rdi      # 0x40e0
callq 0x12d0
movq 0x2b05(%rip), %rdi      # 0x40e8
movq -0x10(%rbp), %rsi
callq 0x1b00
movq %rax, -0x20(%rbp)
callq 0x15a0
movq %rax, -0x28(%rbp)
leaq 0x2ae0(%rip), %rdi      # 0x40e0
callq 0x12f0
movq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x161b
movl $0x23, -0x4(%rbp)
jmp 0x169f
cmpq $0x0, -0x20(%rbp)
jne 0x162b
movl $0x3, -0x4(%rbp)
jmp 0x169f
movq -0x20(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x163e
movl $0x16, -0x4(%rbp)
jmp 0x169f
movq -0x20(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x1682
movq -0x20(%rbp), %rax
movl $0x2, 0x8(%rax)
movq -0x10(%rbp), %rax
movl %eax, %edi
leaq -0x2c(%rbp), %rsi
xorl %edx, %edx
callq 0x10c0
cmpl $-0x1, -0x2c(%rbp)
jne 0x1680
leaq 0x993(%rip), %rdi       # 0x2004
callq 0x10d0
movl $0x1, %edi
callq 0x10e0
jmp 0x1682
cmpq $0x0, -0x18(%rbp)
je 0x1698
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_kill
int dthread_kill(dthread_t thread, int sig) {
    //if sig is 0, no signal is sent
    if(sig == 0) {
        return 0;
    }

    if(sig < 0 || sig > 64) {
        return EINVAL;
    }
    //check if the thread exist
    dthread *temp = get_node_by_tid(threads,thread);

    if(temp == NULL) {
        return ESRCH;
    }
    
    temp->state = SIGNAL;
    int status = kill(thread,sig);
    return status;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x16ce
movl $0x0, -0x4(%rbp)
jmp 0x1729
cmpl $0x0, -0x14(%rbp)
jl 0x16da
cmpl $0x40, -0x14(%rbp)
jle 0x16e3
movl $0x16, -0x4(%rbp)
jmp 0x1729
movq 0x29fe(%rip), %rdi      # 0x40e8
movq -0x10(%rbp), %rsi
callq 0x1b00
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1707
movl $0x3, -0x4(%rbp)
jmp 0x1729
movq -0x20(%rbp), %rax
movl $0x3, 0x8(%rax)
movq -0x10(%rbp), %rax
movl %eax, %edi
movl -0x14(%rbp), %esi
callq 0x10a0
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_mutex_lock
int dthread_mutex_lock(dthread_mutex_t *mutex) {
    
    unsigned int temp = __sync_val_compare_and_swap(mutex, 0, 1);
    if(temp != 0) {
        do  {
            if((temp == 2) || __sync_val_compare_and_swap(mutex, 1, 2) != 0)
                syscall(SYS_futex, mutex, FUTEX_WAIT_PRIVATE, 2, 0, 0, 0);
        } while((temp = __sync_val_compare_and_swap(mutex, 0, 2)) != 0);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
movl $0x1, %edx
lock
cmpxchgl %edx, (%rcx)
sete %cl
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x181e
jmp 0x17b9
cmpl $0x2, -0xc(%rbp)
je 0x17d9
movq -0x8(%rbp), %rcx
movl $0x1, %eax
movl $0x2, %edx
lock
cmpxchgl %edx, (%rcx)
sete %cl
cmpl $0x0, %eax
je 0x1800
movq -0x8(%rbp), %rsi
movl $0xca, %edi
movl $0x80, %edx
movl $0x2, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
movl $0x0, (%rsp)
movb $0x0, %al
callq 0x1090
jmp 0x1802
movq -0x8(%rbp), %rcx
xorl %eax, %eax
movl $0x2, %edx
lock
cmpxchgl %edx, (%rcx)
sete %cl
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jne 0x17b9
jmp 0x181e
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_mutex_unlock
int dthread_mutex_unlock(dthread_mutex_t *mutex) {
    if(__sync_fetch_and_sub(mutex, 1) != 1)  {
    *mutex = 0;
    syscall(SYS_futex, mutex, FUTEX_WAKE_PRIVATE, 1, 0, 0, 0);
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
lock
decl (%rax)
setne %al
testb $0x1, %al
je 0x187b
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rsi
movl $0xca, %edi
movl $0x81, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
movl $0x0, (%rsp)
movb $0x0, %al
callq 0x1090
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/singlyll.c
// Function: insert_beg
void insert_beg(list *t, dthread *td) {
    //add condition for maximum
    node *ptr;
    ptr = (node*)malloc(sizeof(node));
    if(ptr == NULL) {
        printf("\nMemory full");
        return;
    }
    ptr->td = td;
    ptr->next = NULL;
    if(t->head == NULL) {
        t->head = ptr;
        t->tail = ptr;
    }
    else {
        ptr->next = t->head;
        t->head = ptr;
    }
    t->count = t->count + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x10, %edi
callq 0x10b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1915
leaq 0x700(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1080
jmp 0x197a
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x194f
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1969
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/singlyll.c
// Function: remove_last
dthread* remove_last(list *t) {
    node *temp;
    dthread *td;
    if(t->count == 0) {
        printf("\nEmpty list");
        return NULL;
    }
    temp = t->head;
    if(t->count == 1) {
        td = temp->td;
        t->tail = NULL;
        t->head = NULL;
        t->count = t->count -1;
        return td;
    }
    
    while(temp->next != t->tail ) {
        temp = temp->next;
    }
    td = t->tail->td;
    t->tail = temp;
    t->tail->next = NULL;
    t->count = t->count -1;
    return td;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x1a31
leaq 0x618(%rip), %rdi       # 0x2035
movb $0x0, %al
callq 0x1080
movq $0x0, -0x8(%rbp)
jmp 0x1ae9
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x1a83
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1ae9
jmp 0x1a85
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x1aa5
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x1a85
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/singlyll.c
// Function: get_node_by_tid
dthread* get_node_by_tid(list *t, dthread_t tid) {
    node *temp;
    dthread *td;
    if(t->tail == NULL) {
        return NULL;
    }
    temp = t->head;
    while(temp != NULL) {
        if(tid == temp->td->tid) {
            return temp->td;
        }
        else {
            temp = temp->next;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1b21
movq $0x0, -0x8(%rbp)
jmp 0x1b66
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1b5e
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jne 0x1b50
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b66
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x1b2c
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/tests/test_verify_rowcols.c
// Function: diff_array
static inline int diff_array(
        unsigned long size,
        int *a,
        int *b)
{
    unsigned long i = 0;
    for (i=0; i<size; ++i) {
        if (a[i] != b[i]) return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x14e10b
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
je 0x14e0fb
movl $0x1, -0x4(%rbp)
jmp 0x14e112
jmp 0x14e0fd
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x14e0d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]libcperciva/tests/mpool/main.c
// Function: check_mem
int
check_mem(volatile struct stuff * vol)
{

	/* This is `volatile`, so it shouldn't be optimized out. */
	vol->buf[0] = 0;
	if (vol->buf[0] != 0)
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movb (%rax), %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x12af
jmp 0x12b8
movl $0x0, -0x4(%rbp)
jmp 0x12bf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/kilobyte[P]colormatch/ct.c
// Function: main
int main()
{
    double a[3], b[3];
    rgb2lab(0xfffffe, a);
    printf("%g %g %g\n", a[0], a[1], a[2]);
    rgb2lab(0xffffff, b);
    printf("%g %g %g\n", b[0], b[1], b[2]);
    printf("dist=%g\n", deltaE2000(a,b));
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x20(%rbp), %rsi
movl $0xfffffe, %edi         # imm = 0xFFFFFE
callq 0x1a90
movsd -0x20(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd -0x10(%rbp), %xmm2
leaq 0xe31(%rip), %rdi       # 0x2004
movb $0x3, %al
callq 0x1040
leaq -0x40(%rbp), %rsi
movl $0xffffff, %edi         # imm = 0xFFFFFF
callq 0x1a90
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
leaq 0xe06(%rip), %rdi       # 0x2004
movb $0x3, %al
callq 0x1040
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1230
leaq 0xdf5(%rip), %rdi       # 0x200e
movb $0x1, %al
callq 0x1040
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/codeniko[P]CS214-Malloc-Free/Test2.c
// Function: main
void main()
{
    int* p = malloc(sizeof(int));
    *p = 5;
    printf("address: %p, value: %d\n",p, *p);
    free(p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x4, %edi
leaq 0xea0(%rip), %rsi       # 0x2004
movl $0x6, %edx
callq 0x11b0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x5, (%rax)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rax
movl (%rax), %edx
leaq 0xe7f(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1030
movq -0x8(%rbp), %rdi
leaq 0xe65(%rip), %rsi       # 0x2004
movl $0x9, %edx
callq 0x13b0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/ibkvcli.c
// Function: test_ibkv
int
test_ibkv(const int argc, char ** const argv)
{
  if (argc < 6 || (strcmp(argv[0], "api") != 0)) {
    return -1;
  }

  const u64 pid = strtoull(argv[1], NULL, 10);
  char * const host = argv[2];
  const int pn = atoi(argv[3]);
  const u64 depth = strtoull(argv[4], NULL, 10);
  const u64 batch = strtoull(argv[5], NULL, 10);

  char *pref[64] = {};
  for (int i = 0; i < 6; i++) {
    pref[i] = argv[i];
  }
  pref[6] = NULL;

  struct worker_info wi;
  wi.port = ib_port_create(pid);
  wi.host = host;
  wi.pn = pn;
  wi.depth = depth;
  wi.batch = batch;

  struct pass_info pi = {};
  pi.api = &wi;
  pi.vctr_size = 4;
  pi.wf = ibkv_worker;
  pi.af = ibkv_analyze;
  const int n2 = maptest_passes(argc - 6, argv + 6, pref, &pi);
  ib_port_destroy(wi.port);
  if (n2 < 0) {
    return n2;
  }
  return 6 + n2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x6, -0x8(%rbp)
jl 0x6820
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x157fa(%rip), %rsi     # 0x1c010
callq 0x6490
cmpl $0x0, %eax
je 0x682c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x69cb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x6560
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x63c0
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x6560
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x6560
movq %rax, -0x38(%rbp)
leaq -0x240(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x6080
movl $0x0, -0x244(%rbp)
cmpl $0x6, -0x244(%rbp)
jge 0x68eb
movq -0x10(%rbp), %rax
movslq -0x244(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x244(%rbp), %rax
movq %rcx, -0x240(%rbp,%rax,8)
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
jmp 0x68b3
movq $0x0, -0x210(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a440
movq %rax, -0x270(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x268(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x260(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x298(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x6080
leaq -0x270(%rbp), %rax
movq %rax, -0x290(%rbp)
movq $0x4, -0x288(%rbp)
leaq 0x7d(%rip), %rax        # 0x69e0
movq %rax, -0x280(%rbp)
leaq 0x49f(%rip), %rax       # 0x6e10
movq %rax, -0x278(%rbp)
movl -0x8(%rbp), %edi
subl $0x6, %edi
movq -0x10(%rbp), %rsi
addq $0x30, %rsi
leaq -0x240(%rbp), %rdx
leaq -0x298(%rbp), %rcx
callq 0x17610
movl %eax, -0x29c(%rbp)
movq -0x270(%rbp), %rdi
callq 0x1a5f0
cmpl $0x0, -0x29c(%rbp)
jge 0x69bf
movl -0x29c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x69cb
movl -0x29c(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/ibkvcli.c
// Function: ibkv_analyze
static bool
ibkv_analyze(struct vctr * const va, const double dt, struct damp * const damp, char * const out)
{
  u64 v[8];
  for (u64 i = 0; i < 4; i++) {
    v[i] = vctr_get(va, i);
  }

  const u64 nrop = v[XSA] + v[XDA] + v[XGA] + v[XPA];
  const double mops = ((double)nrop) / (dt * 1.0e6);
  const bool done = damp_add_test(damp, mops);
  const double havg = damp_average(damp);
  const char * const pat = " set %"PRIu64" del %"PRIu64" get %"PRIu64" pro %"PRIu64" mops %.2lf havg %.2lf\n";
  sprintf(out, pat, v[XSA], v[XDA], v[XGA], v[XPA], mops, havg);
  return done;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
vmovsd %xmm0, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x68(%rbp)
cmpq $0x4, -0x68(%rbp)
jae 0x6e62
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0xb420
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0x60(%rbp,%rax,8)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x6e34
movq -0x60(%rbp), %rax
addq -0x58(%rbp), %rax
addq -0x50(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
vcvtusi2sdq -0x70(%rbp), %xmm0, %xmm0
vmovsd 0x15183(%rip), %xmm1    # 0x1c008
vmulsd -0x10(%rbp), %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, -0x78(%rbp)
movq -0x18(%rbp), %rdi
vmovsd -0x78(%rbp), %xmm0
callq 0xaf80
andb $0x1, %al
movb %al, -0x79(%rbp)
movq -0x18(%rbp), %rdi
callq 0xad10
vmovsd %xmm0, -0x88(%rbp)
leaq 0x15156(%rip), %rax     # 0x1c014
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x48(%rbp), %r9
vmovsd -0x78(%rbp), %xmm0
vmovsd -0x88(%rbp), %xmm1
leaq 0x15127(%rip), %rsi     # 0x1c014
movb $0x2, %al
callq 0x62f0
movb -0x79(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/evm.c
// Function: disassemble
static void disassemble(const char *contents) {
    disassembleInit();
    while (disassembleValid(&contents)) {
        disassembleNextOp(&contents);
    }
    disassembleFinalize();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, %al
callq 0x18990
leaq -0x8(%rbp), %rdi
callq 0x19170
cmpl $0x0, %eax
je 0x395c
leaq -0x8(%rbp), %rdi
callq 0x18af0
jmp 0x3943
movb $0x0, %al
callq 0x191a0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: applyConfig
void applyConfig(const char *json) {
    testResults.head = NULL;
    testResults.tail = &testResults.head;
    lineNumber = 1;

    jsonScanChar(&json, '[');
    do {
        jsonScanEntry(&json);
        jsonScanWaste(&json);
        if (*json == ',') {
            jsonSkipExpectedChar(&json, ',');
            jsonScanWaste(&json);
            continue;
        } else {
            break;
        }
    } while (1);
    jsonScanChar(&json, ']');
    if (anyTestFailure) {
        _exit(1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, 0x24a51(%rip) # 0x28a28
leaq 0x24a4a(%rip), %rax     # 0x28a28
movq %rax, 0x24a4b(%rip)     # 0x28a30
movq $0x1, 0x24a48(%rip) # 0x28a38
leaq -0x8(%rbp), %rdi
movl $0x5b, %esi
callq 0x4070
leaq -0x8(%rbp), %rdi
callq 0x4120
leaq -0x8(%rbp), %rdi
callq 0x5890
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x4035
leaq -0x8(%rbp), %rdi
movl $0x2c, %esi
callq 0x58f0
leaq -0x8(%rbp), %rdi
callq 0x5890
jmp 0x4037
jmp 0x403f
movb $0x1, %al
testb $0x1, %al
jne 0x3ffe
jmp 0x403f
leaq -0x8(%rbp), %rdi
movl $0x5d, %esi
callq 0x4070
cmpl $0x0, 0x249ec(%rip)     # 0x28a40
je 0x4060
movl $0x1, %edi
callq 0x3080
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonScanChar
static void jsonScanChar(const char **iter, char expected) {
    for (char ch; (ch = **iter) != expected; (*iter)++) {
        if (jsonIgnores(ch)) {
            if (ch == '\n') {
                lineNumber++;
            }
        } else {
            fprintf(stderr, "Config: when seeking '%c' found unexpected character '%c' on line %" PRIu64 "\n", expected, ch, lineNumber);
            _exit(1);
        }
    }
    (*iter)++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movb (%rax), %al
movb %al, -0xa(%rbp)
movsbl %al, %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
je 0x410a
movsbl -0xa(%rbp), %edi
callq 0x5ce0
cmpl $0x0, %eax
je 0x40c4
movsbl -0xa(%rbp), %eax
cmpl $0xa, %eax
jne 0x40c2
movq 0x24981(%rip), %rax     # 0x28a38
addq $0x1, %rax
movq %rax, 0x24976(%rip)     # 0x28a38
jmp 0x40f5
movq 0x1bf2d(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movsbl -0x9(%rbp), %edx
movsbl -0xa(%rbp), %ecx
movq 0x2495b(%rip), %r8      # 0x28a38
leaq 0x161b1(%rip), %rsi     # 0x1a295
movb $0x0, %al
callq 0x31e0
movl $0x1, %edi
callq 0x3080
jmp 0x40f7
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x4082
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonSkipExpectedChar
static void jsonSkipExpectedChar(const char **iter, char expected) {
    if (**iter == expected) {
        (*iter)++;
    } else {
        fprintf(stderr, "Config: expecting '%c', found '%c' on line %" PRIu64 "\n", expected, **iter, lineNumber);
        _exit(1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
jne 0x5924
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x595b
movq 0x1a6cd(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movsbl -0x9(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %ecx
movq 0x230f5(%rip), %r8      # 0x28a38
leaq 0x14c0c(%rip), %rsi     # 0x1a556
movb $0x0, %al
callq 0x31e0
movl $0x1, %edi
callq 0x3080
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: loadConfig
void loadConfig(const char *_configFile, int updateConfigFile) {
    if (_configFile != NULL) {
        int fd = open(_configFile, O_RDONLY);
        if (fd == -1) {
            perror(_configFile);
            _exit(1);
        }

        struct stat fstatus;
        int fstatSuccess = fstat(fd, &fstatus);
        if (fstatSuccess == -1) {
            perror(_configFile);
            _exit(1);
        }
        char *configContents = mmap(NULL, fstatus.st_size, PROT_READ, MAP_PRIVATE | MAP_FILE, fd, 0);
        {
            uint64_t prevLineNumber = lineNumber;
            struct testResults results = testResults;

            applyConfig(configContents);
            if (updateConfigFile) {
                updateConfig(configContents, _configFile);
            }

            lineNumber = prevLineNumber;
            testResults = results;
        }
        munmap(configContents, fstatus.st_size);
        close(fd);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5a9b
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x3250
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0x59b6
movq -0x8(%rbp), %rdi
callq 0x3260
movl $0x1, %edi
callq 0x3080
movl -0x10(%rbp), %edi
leaq -0xa0(%rbp), %rsi
callq 0x3290
movl %eax, -0xa4(%rbp)
cmpl $-0x1, -0xa4(%rbp)
jne 0x59e7
movq -0x8(%rbp), %rdi
callq 0x3260
movl $0x1, %edi
callq 0x3080
movq -0x70(%rbp), %rsi
movl -0x10(%rbp), %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %edx
movl $0x2, %ecx
movq %r9, %rdi
callq 0x30d0
movq %rax, -0xb0(%rbp)
movq 0x23024(%rip), %rax     # 0x28a38
movq %rax, -0xb8(%rbp)
movq 0x23006(%rip), %rax     # 0x28a28
movq %rax, -0xc8(%rbp)
movq 0x23000(%rip), %rax     # 0x28a30
movq %rax, -0xc0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x3fc0
cmpl $0x0, -0xc(%rbp)
je 0x5a59
movq -0xb0(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x5ab0
movq -0xb8(%rbp), %rax
movq %rax, 0x22fd1(%rip)     # 0x28a38
movq -0xc8(%rbp), %rax
movq %rax, 0x22fb3(%rip)     # 0x28a28
movq -0xc0(%rbp), %rax
movq %rax, 0x22fad(%rip)     # 0x28a30
movq -0xb0(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x3230
movl -0x10(%rbp), %edi
callq 0x3160
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonIgnores
static inline int jsonIgnores(char ch) {
    return ch != '{'
        && ch != '}'
        && ch != '['
        && ch != ']'
        && ch != ','
        && ch != ':'
        && ch != '"'
        && (ch < '0' || ch > '9')
        && (ch < 'A' || ch > 'Z')
        && (ch < 'a' || ch > 'z')
    ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x1(%rbp)
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x7b, %ecx
movb %al, -0x2(%rbp)
je 0x5da7
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x7d, %ecx
movb %al, -0x2(%rbp)
je 0x5da7
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x5b, %ecx
movb %al, -0x2(%rbp)
je 0x5da7
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x5d, %ecx
movb %al, -0x2(%rbp)
je 0x5da7
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x2c, %ecx
movb %al, -0x2(%rbp)
je 0x5da7
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0x2(%rbp)
je 0x5da7
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x22, %ecx
movb %al, -0x2(%rbp)
je 0x5da7
movsbl -0x1(%rbp), %eax
cmpl $0x30, %eax
jl 0x5d6f
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x39, %ecx
movb %al, -0x2(%rbp)
jle 0x5da7
movsbl -0x1(%rbp), %eax
cmpl $0x41, %eax
jl 0x5d86
movsbl -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x5a, %ecx
movb %al, -0x2(%rbp)
jle 0x5da7
movsbl -0x1(%rbp), %ecx
movb $0x1, %al
cmpl $0x61, %ecx
movb %al, -0x3(%rbp)
jl 0x5da1
movsbl -0x1(%rbp), %eax
cmpl $0x7a, %eax
setg %al
movb %al, -0x3(%rbp)
movb -0x3(%rbp), %al
movb %al, -0x2(%rbp)
movb -0x2(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonScanStr
static const char *jsonScanStr(const char **iter) {
    jsonScanChar(iter, '"');
    const char *start = *iter;
    for (char ch; (ch = **iter) != '"' && ch; (*iter)++);
    jsonSkipExpectedChar(iter, '"');
    return start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x4070
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
movsbl %al, %ecx
xorl %eax, %eax
cmpl $0x22, %ecx
movb %al, -0x12(%rbp)
je 0x5e0b
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %al
testb $0x1, %al
jne 0x5e14
jmp 0x5e26
jmp 0x5e16
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x5de5
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x58f0
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonReadAddressString
static address_t *jsonReadAddressString(const char **iter) {
    jsonSkipExpectedChar(iter, '"');
    address_t *address = jsonReadAddress(iter);
    jsonSkipExpectedChar(iter, '"');
    return address;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x58f0
movq -0x8(%rbp), %rdi
callq 0x6120
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x58f0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/include/address.h
// Function: AddressFromHex40
static inline address_t AddressFromHex40(const char *hex) {
    address_t address;
    for (uint8_t i = 0; i < 40; i += 2) {
        address.address[i >> 1] = hexString16ToUint8(hex+i);
    }
    return address;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x20(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x28, %eax
jge 0x5fc1
movq -0x8(%rbp), %rdi
movzbl -0x9(%rbp), %eax
cltq
addq %rax, %rdi
callq 0x5f30
movb %al, %dl
movq -0x20(%rbp), %rax
movzbl -0x9(%rbp), %ecx
sarl %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movzbl -0x9(%rbp), %eax
addl $0x2, %eax
movb %al, -0x9(%rbp)
jmp 0x5f88
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonScanAccountLogs
static void jsonScanAccountLogs(const char **iter, logsEntry_t **prev) {
    logsEntry_t *accountLogs = calloc(1, sizeof(logsEntry_t));
    accountLogs->prev = *prev;
    *prev = accountLogs;

    const char *addressStr = jsonScanStr(iter);
    size_t addressLen = *iter - addressStr - 1;
    if (addressLen != 42) {
        fprintf(stderr, "Unexpected address len %zu\n", addressLen);
    }
    accountLogs->address = AddressFromHex42(addressStr);
    jsonScanChar(iter, ':');
    jsonScanChar(iter, '[');

    jsonScanWaste(iter);
    if (**iter != ']') do {
        jsonScanLog(iter, &accountLogs->logs);

        jsonScanWaste(iter);
        if (**iter == ',') {
            jsonSkipExpectedChar(iter, ',');
            jsonScanWaste(iter);
            continue;
        } else {
            break;
        }
    } while (1);
    jsonSkipExpectedChar(iter, ']');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
movl $0x28, %esi
callq 0x31c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x5dc0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x2a, -0x28(%rbp)
je 0x6053
movq 0x19fba(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0x142e9(%rip), %rsi     # 0x1a335
movb $0x0, %al
callq 0x31e0
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
leaq -0x3c(%rbp), %rdi
callq 0x5f70
movq -0x48(%rbp), %rax
movq -0x3c(%rbp), %rcx
movq %rcx, (%rax)
movq -0x34(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x2c(%rbp), %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movl $0x3a, %esi
callq 0x4070
movq -0x8(%rbp), %rdi
movl $0x5b, %esi
callq 0x4070
movq -0x8(%rbp), %rdi
callq 0x5890
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
je 0x6109
jmp 0x60bb
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
callq 0x6800
movq -0x8(%rbp), %rdi
callq 0x5890
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x60fd
movq -0x8(%rbp), %rdi
movl $0x2c, %esi
callq 0x58f0
movq -0x8(%rbp), %rdi
callq 0x5890
jmp 0x60ff
jmp 0x6107
movb $0x1, %al
testb $0x1, %al
jne 0x60bb
jmp 0x6107
jmp 0x6109
movq -0x8(%rbp), %rdi
movl $0x5d, %esi
callq 0x58f0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonReadAddress
static address_t *jsonReadAddress(const char **iter) {
    jsonSkipExpectedChar(iter, '0');
    jsonSkipExpectedChar(iter, 'x');
    address_t *address = malloc(sizeof(address_t));
    for (unsigned int i = 0; i < 20; i++) {
        address->address[i] = hexString16ToUint8(*iter);
        *iter += 2;
    }
    return address;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x30, %esi
callq 0x58f0
movq -0x8(%rbp), %rdi
movl $0x78, %esi
callq 0x58f0
movl $0x14, %edi
callq 0x3210
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x14, -0x14(%rbp)
jae 0x6194
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x5f30
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x615d
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/dio.c
// Function: jsonScanData
static void jsonScanData(const char **iter, data_t *result){
    const char *data = jsonScanStr(iter);
    jsonSkipExpectedChar(&data, '0');
    jsonSkipExpectedChar(&data, 'x');
    result->size = (*iter - data - 1) / 2;
    result->content = malloc(result->size);
    for (size_t i = 0; i < result->size; i++) {
        result->content[i] = hexString16ToUint8(data);
        data += 2;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5dc0
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
movl $0x30, %esi
callq 0x58f0
leaq -0x18(%rbp), %rdi
movl $0x78, %esi
callq 0x58f0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
subq $0x1, %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3210
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x6caf
movq -0x18(%rbp), %rdi
callq 0x5f30
movb %al, %dl
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6c6e
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/include/address.h
// Function: AddressEqual
static inline int AddressEqual(const address_t *expected, const address_t *actual) {
    for (int i = 0; i < 20; i ++) {
        if (expected->address[i] != actual->address[i]) {
            return 0;
        }
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x14, -0x1c(%rbp)
jge 0x7b2b
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x7b1e
movl $0x0, -0x4(%rbp)
jmp 0x7b32
jmp 0x7b20
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7af3
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/include/evm.h
// Function: LogsEqual
static int LogsEqual(const logChanges_t *expectedLog, const logChanges_t *actualLog) {
    while (expectedLog && actualLog) {
        if (!DataEqual(&expectedLog->data, &actualLog->data)) {
            return false;
        }
        if (expectedLog->topicCount != actualLog->topicCount) {
            return false;
        }
        for (uint16_t i = 0; i < expectedLog->topicCount; i++) {
            if (!equal256(expectedLog->topics + i, actualLog->topics + i)) {
                return false;
            }
        }
        expectedLog = expectedLog->prev;
        actualLog = actualLog->prev;
    }
    return expectedLog == NULL && actualLog == NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x1b(%rbp)
je 0x7b67
cmpq $0x0, -0x18(%rbp)
setne %al
movb %al, -0x1b(%rbp)
movb -0x1b(%rbp), %al
testb $0x1, %al
jne 0x7b73
jmp 0x7c36
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x7c70
cmpl $0x0, %eax
jne 0x7b99
movl $0x0, -0x4(%rbp)
jmp 0x7c58
movq -0x10(%rbp), %rax
movzbl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
cmpl %ecx, %eax
je 0x7bb9
movl $0x0, -0x4(%rbp)
jmp 0x7c58
movw $0x0, -0x1a(%rbp)
movzwl -0x1a(%rbp), %eax
movq -0x10(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jge 0x7c19
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movzwl -0x1a(%rbp), %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movzwl -0x1a(%rbp), %eax
cltq
shlq $0x5, %rax
addq %rax, %rsi
callq 0x10410
testb $0x1, %al
jne 0x7c09
movl $0x0, -0x4(%rbp)
jmp 0x7c58
jmp 0x7c0b
movw -0x1a(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x1a(%rbp)
jmp 0x7bbf
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x7b50
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x1c(%rbp)
jne 0x7c4d
cmpq $0x0, -0x18(%rbp)
sete %al
movb %al, -0x1c(%rbp)
movb -0x1c(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/evm.c
// Function: fprintLogs
uint16_t fprintLogs(FILE *file, const stateChanges_t *account, int showLogIndex) {
    fputs("{", file);
    uint16_t items = _fprintLogs(file, account, showLogIndex);
    fputs("}", file);
    return items;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x126bc(%rip), %rdi     # 0x1aaca
callq 0x3130
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x8450
movw %ax, -0x16(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x11e07(%rip), %rdi     # 0x1a239
callq 0x3130
movw -0x16(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/evm.c
// Function: getCurrentAccountStateChanges
stateChanges_t *getCurrentAccountStateChanges(result_t *result, context_t *context) {
    stateChanges_t **stateChanges = &result->stateChanges;
    while (*stateChanges != NULL) {
        if (AddressEqual(&(*stateChanges)->account, &context->account->address)) {
            return *stateChanges;
        }
        stateChanges = &(*stateChanges)->next;
    }
    // DNF
    *stateChanges = calloc(1, sizeof(stateChanges_t));
    AddressCopy(&(*stateChanges)->account, &context->account->address);
    return *stateChanges;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x86d0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8008(%rax), %rsi
callq 0x8730
cmpl $0x0, %eax
je 0x86bf
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x871a
movq -0x20(%rbp), %rax
movq (%rax), %rax
addq $0x28, %rax
movq %rax, -0x20(%rbp)
jmp 0x868c
movl $0x1, %edi
movl $0x30, %esi
callq 0x31c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x8008(%rcx), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/evm.c
// Function: evmMockBalance
void evmMockBalance(address_t from, const val_t balance) {
    account_t *account = getAccount(from);
    account->balance[0] = balance[0];
    account->balance[1] = balance[1];
    account->balance[2] = balance[2];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl 0x10(%rax), %eax
movl %eax, 0x10(%rsp)
callq 0x8ac0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/evm.c
// Function: getAccountStorage
static storage_t *getAccountStorage(account_t *account, const uint256_t *key) {
    storage_t **storage = &account->storage;
    while (*storage != NULL) {
        if (equal256(&(*storage)->key, key)) {
            return *storage;
        }
        storage = &(*storage)->next;
    }
    *storage = calloc(1, sizeof(storage_t));
    copy256(&(*storage)->key, key);
    return *storage;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x8f4a
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x10410
testb $0x1, %al
jne 0x8f2c
jmp 0x8f39
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x8f7e
movq -0x20(%rbp), %rax
movq (%rax), %rax
addq $0x68, %rax
movq %rax, -0x20(%rbp)
jmp 0x8f0c
movl $0x1, %edi
movl $0x70, %esi
callq 0x31c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xf820
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/evm.c
// Function: calldataGas
static inline uint64_t calldataGas(const data_t *calldata, bool isCreate) {
    uint64_t gas = 0;
    gas += G_CALLDATAZERO * calldata->size;
    if (isCreate) {
        gas += G_INITCODEWORD * ((calldata->size + 31) >> 5); // EIP 3860: 2 gas per word
    }
    for (size_t i = 0; i < calldata->size; i++) {
        if (calldata->content[i]) {
            gas += G_CALLDATANONZERO;
        }
    }
    return gas;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
shlq $0x2, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0x965b
movq -0x8(%rbp), %rax
movq (%rax), %rax
addq $0x1f, %rax
shrq $0x5, %rax
shlq %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x969e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x968e
movq -0x18(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x18(%rbp)
jmp 0x9690
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x9663
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)