LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/orempel[P]multiboot_tool/twiboot.c
// Function: twi_read_memory
static int twi_read_memory(struct twi_privdata *twi,
                           uint8_t *buffer, uint8_t size,
                           uint8_t memtype, uint16_t address)
{
    uint8_t cmd[] = { CMD_READ_MEMORY, memtype, (address >> 8) & 0xFF, (address & 0xFF) };

    if (twi_write_retries(twi->fd, cmd, sizeof(cmd)) != sizeof(cmd))
    {
        return -1;
    }

    return (read(twi->fd, buffer, size) != size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %r8w, %ax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %dl, -0x19(%rbp)
movb %cl, -0x1a(%rbp)
movw %ax, -0x1c(%rbp)
movb $0x2, -0x20(%rbp)
movb -0x1a(%rbp), %al
movb %al, -0x1f(%rbp)
movzwl -0x1c(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, -0x1e(%rbp)
movzwl -0x1c(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
leaq -0x20(%rbp), %rsi
movl $0x4, %edx
callq 0xaaf0
cltq
cmpq $0x4, %rax
je 0xaab9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaae1
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %eax
movl %eax, %edx
callq 0x2130
movzbl -0x19(%rbp), %ecx
cmpq %rcx, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/orempel[P]multiboot_tool/twiboot.c
// Function: twi_write_retries
static int twi_write_retries(int fd, const void *buf, size_t count)
{
    int result;
    int retries = WRITE_RETRY_COUNT;
    do {
        result = write(fd, buf, count);
        if (result >= 0)
        {
            break;
        }
        else
        {
            /*
             * slave device does not acknowledge (eg. not able to clockstretch)
             * actual error code may be driver specific
             */
            if ((errno == ENXIO) || (errno == EREMOTEIO) || (errno == EIO))
            {
                usleep(WRITE_RETRY_DELAY_US);
            }
            else
            {
                fprintf(stderr, "twi_write_retries(): %s\n",
                        strerror(errno));

                retries = 0;
            }
        }
    } while (retries--);

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x32, -0x20(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2070
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0xab25
jmp 0xab9d
callq 0x2050
cmpl $0x6, (%rax)
je 0xab43
callq 0x2050
cmpl $0x79, (%rax)
je 0xab43
callq 0x2050
cmpl $0x5, (%rax)
jne 0xab4f
movl $0x7d0, %edi            # imm = 0x7D0
callq 0x2280
jmp 0xab85
movq 0x54a2(%rip), %rax      # 0xfff8
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x2260
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0x1db7(%rip), %rsi      # 0xc92e
movb $0x0, %al
callq 0x2160
movl $0x0, -0x20(%rbp)
jmp 0xab87
jmp 0xab89
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x20(%rbp)
cmpl $0x0, %eax
jne 0xab0a
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/orempel[P]multiboot_tool/twiboot.c
// Function: twi_write_memory
static int twi_write_memory(struct twi_privdata *twi,
                            uint8_t *buffer, uint8_t size,
                            uint8_t memtype, uint16_t address)
{
    int bufsize;

    if (memtype == MEMTYPE_FLASH)
    {
        if ((address & (twi->pagesize -1)) != 0x00)
        {
            fprintf(stderr, "twi_write_memory(): address 0x%04x not aligned to pagesize 0x%02x\n",
                    address, twi->pagesize);

            return -1;
        }

        bufsize = 4 + twi->pagesize;
    }
    else
    {
        bufsize = 4 + size;
    }

    uint8_t *cmd = malloc(bufsize);
    if (cmd == NULL)
    {
        return -1;
    }

    cmd[0] = CMD_WRITE_MEMORY;
    cmd[1] = memtype;
    cmd[2] = (address >> 8) & 0xFF;
    cmd[3] = (address & 0xFF);
    memcpy(cmd +4, buffer, size);

    if (memtype == MEMTYPE_FLASH)
    {
        memset(cmd +4 +size, 0xFF, twi->pagesize - size);
    }

    int result = twi_write_retries(twi->fd, cmd, bufsize);
    free(cmd);

    return (result != bufsize);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %r8w, %ax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %dl, -0x19(%rbp)
movb %cl, -0x1a(%rbp)
movw %ax, -0x1c(%rbp)
movzbl -0x1a(%rbp), %eax
cmpl $0x1, %eax
jne 0xac6d
movzwl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movzbl 0x18(%rcx), %ecx
subl $0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xac5d
movq 0x53c4(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzwl -0x1c(%rbp), %edx
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %ecx
leaq 0x1cfd(%rip), %rsi      # 0xc947
movb $0x0, %al
callq 0x2160
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xad4c
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
addl $0x4, %eax
movl %eax, -0x20(%rbp)
jmp 0xac77
movzbl -0x19(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x20(%rbp)
movslq -0x20(%rbp), %rdi
callq 0x21b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xac97
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xad4c
movq -0x28(%rbp), %rax
movb $0x2, (%rax)
movb -0x1a(%rbp), %cl
movq -0x28(%rbp), %rax
movb %cl, 0x1(%rax)
movzwl -0x1c(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x2(%rax)
movzwl -0x1c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x28(%rbp), %rdi
addq $0x4, %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %eax
movl %eax, %edx
callq 0x2190
movzbl -0x1a(%rbp), %eax
cmpl $0x1, %eax
jne 0xad1b
movq -0x28(%rbp), %rdi
addq $0x4, %rdi
movzbl -0x19(%rbp), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
movzbl -0x19(%rbp), %ecx
subl %ecx, %eax
movslq %eax, %rdx
movl $0xff, %esi
callq 0x2100
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x28(%rbp), %rsi
movslq -0x20(%rbp), %rdx
callq 0xaaf0
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2030
movl -0x2c(%rbp), %eax
cmpl -0x20(%rbp), %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: caching_ringbuffer_create
Ringbuffer* caching_ringbuffer_create(
        size_t capacity,
        void (*free_item)(void* item, void* additional_arg),
        void* free_item_additional_arg) {

    InternalRingbuffer* internal = calloc(1, sizeof(InternalRingbuffer));
    internal->cache =
    ringbuffer_create(capacity, free_item, free_item_additional_arg);
    internal->buffer = ringbuffer_create(capacity, cache_free, internal->cache);

    internal->public = (Ringbuffer) {
        .capacity = capacity_func,
        .add = add_func,
        .pop = pop_func,
        .free = free_func,
    };

    return (Ringbuffer*) internal;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x1060
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2c30
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdx
leaq 0x6a(%rip), %rsi        # 0x1250
callq 0x2c30
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
leaq 0xbf(%rip), %rcx        # 0x12c0
movq %rcx, -0x40(%rbp)
leaq 0x104(%rip), %rcx       # 0x1310
movq %rcx, -0x38(%rbp)
leaq 0x159(%rip), %rcx       # 0x1370
movq %rcx, -0x30(%rbp)
leaq 0x1ae(%rip), %rcx       # 0x13d0
movq %rcx, -0x28(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: cache_free
static void cache_free(void* item, void* cache) {

    if(0 == cache) goto finish;
    if(0 == item) goto finish;

    Ringbuffer* ringbuffer_cache = cache;

    if(! ringbuffer_cache->add(ringbuffer_cache, item)) {

        fprintf(stderr, "Could not enqueue item into cache");

    }

finish:

    do{}while(0);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x126a
jmp 0x12ac
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
jne 0x1274
jmp 0x12ac
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x12aa
movq 0x4d5f(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x3072(%rip), %rsi      # 0x4315
movb $0x0, %al
callq 0x1070
jmp 0x12ac
jmp 0x12ae
jmp 0x12b0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: capacity_func
static size_t capacity_func(Ringbuffer* self) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;
    Ringbuffer* buffer = internal->buffer;

    return buffer->capacity(buffer);

error:

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x12d6
jmp 0x12fd
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
jmp 0x1305
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: add_func
static bool add_func(Ringbuffer* self, void* item) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;
    Ringbuffer* buffer = internal->buffer;

    if(0 == buffer) goto error;

    return buffer->add(buffer, item);

error:

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x132a
jmp 0x1361
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq -0x28(%rbp), %rax
jne 0x1348
jmp 0x1361
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x1365
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: pop_func
static void* pop_func(Ringbuffer* self) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;
    Ringbuffer* buffer = internal->buffer;

    if(0 == buffer) goto error;

    return buffer->pop(buffer);

error:

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x1386
jmp 0x13b8
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x13a4
jmp 0x13b8
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
jmp 0x13c0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: free_func
static Ringbuffer* free_func(Ringbuffer* self) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;
    Ringbuffer* buffer = internal->buffer;

    if(0 == buffer) goto error;

    internal->buffer = buffer->free(buffer);

    buffer = internal->cache;
    internal->cache = buffer->free(buffer);

    free(self);

    return 0;

error:

    return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x13e6
jmp 0x1455
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x1404
jmp 0x1455
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
callq 0x1030
movq $0x0, -0x8(%rbp)
jmp 0x145d
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: caching_ringbuffer_get_cached
void* caching_ringbuffer_get_cached(Ringbuffer* self) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;
    Ringbuffer* cache = internal->cache;

    return cache->pop(cache);

error:

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x1486
jmp 0x14ae
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
jmp 0x14b6
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/../src/caching_ringbuffer.c
// Function: caching_ringbuffer_release
bool caching_ringbuffer_release(Ringbuffer* self, void* item) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;
    Ringbuffer* cache = internal->cache;

    return cache->add(cache, item);

error:

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x14da
jmp 0x1507
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x150b
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/caching_ringbuffer_test.c
// Function: test_caching_ringbuffer_create
void test_caching_ringbuffer_create() {

    Ringbuffer* buffer = 0;

    buffer = caching_ringbuffer_create(1, 0, 0);
    assert(buffer);
    assert(capacity_func == buffer->capacity);
    assert(add_func == buffer->add);
    assert(pop_func == buffer->pop);
    assert(free_func == buffer->free);

    buffer = buffer->free(buffer);

    fprintf(stdout, "caching ringbuffer_create OK\n");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq $0x0, -0x8(%rbp)
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x1190
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x154e
jmp 0x156d
leaq 0x2aaf(%rip), %rdi      # 0x4004
leaq 0x2aaf(%rip), %rsi      # 0x400b
movl $0x43, %edx
leaq 0x2ac2(%rip), %rcx      # 0x402a
callq 0x1040
movq -0x8(%rbp), %rcx
leaq -0x2b8(%rip), %rax      # 0x12c0
cmpq (%rcx), %rax
jne 0x157f
jmp 0x159e
leaq 0x2aca(%rip), %rdi      # 0x4050
leaq 0x2a7e(%rip), %rsi      # 0x400b
movl $0x44, %edx
leaq 0x2a91(%rip), %rcx      # 0x402a
callq 0x1040
movq -0x8(%rbp), %rcx
leaq -0x299(%rip), %rax      # 0x1310
cmpq 0x8(%rcx), %rax
jne 0x15b1
jmp 0x15d0
leaq 0x2aba(%rip), %rdi      # 0x4072
leaq 0x2a4c(%rip), %rsi      # 0x400b
movl $0x45, %edx
leaq 0x2a5f(%rip), %rcx      # 0x402a
callq 0x1040
movq -0x8(%rbp), %rcx
leaq -0x26b(%rip), %rax      # 0x1370
cmpq 0x10(%rcx), %rax
jne 0x15e3
jmp 0x1602
leaq 0x2aa0(%rip), %rdi      # 0x408a
leaq 0x2a1a(%rip), %rsi      # 0x400b
movl $0x46, %edx
leaq 0x2a2d(%rip), %rcx      # 0x402a
callq 0x1040
movq -0x8(%rbp), %rcx
leaq -0x23d(%rip), %rax      # 0x13d0
cmpq 0x18(%rcx), %rax
jne 0x1615
jmp 0x1634
leaq 0x2a86(%rip), %rdi      # 0x40a2
leaq 0x29e8(%rip), %rsi      # 0x400b
movl $0x47, %edx
leaq 0x29fb(%rip), %rcx      # 0x402a
callq 0x1040
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
movq 0x498b(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0x2a65(%rip), %rsi      # 0x40bc
movb $0x0, %al
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/caching_ringbuffer_test.c
// Function: test_caching_ringbuffer_release
void test_caching_ringbuffer_release() {

    int a = 0;

    assert(! caching_ringbuffer_release(0, &a));

    Ringbuffer* buffer = caching_ringbuffer_create(1, 0, 0);
    assert(caching_ringbuffer_release(buffer, &a));
    assert(&a == caching_ringbuffer_get_cached(buffer));
    buffer = buffer->free(buffer);

    fprintf(stdout, "caching ringbuffer_release OK\n");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq -0x4(%rbp), %rsi
callq 0x14c0
testb $0x1, %al
jne 0x1992
jmp 0x19b1
leaq 0x285a(%rip), %rdi      # 0x41f3
leaq 0x266b(%rip), %rsi      # 0x400b
movl $0x72, %edx
leaq 0x286b(%rip), %rcx      # 0x4217
callq 0x1040
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x1190
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq 0x14c0
testb $0x1, %al
jne 0x19d9
jmp 0x19db
jmp 0x19fa
leaq 0x285c(%rip), %rdi      # 0x423e
leaq 0x2622(%rip), %rsi      # 0x400b
movl $0x75, %edx
leaq 0x2822(%rip), %rcx      # 0x4217
callq 0x1040
movq -0x10(%rbp), %rdi
callq 0x1470
movq %rax, %rcx
leaq -0x4(%rbp), %rax
cmpq %rcx, %rax
jne 0x1a11
jmp 0x1a30
leaq 0x284d(%rip), %rdi      # 0x4265
leaq 0x25ec(%rip), %rsi      # 0x400b
movl $0x76, %edx
leaq 0x27ec(%rip), %rcx      # 0x4217
callq 0x1040
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq %rax, -0x10(%rbp)
movq 0x458f(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0x283e(%rip), %rsi      # 0x4291
movb $0x0, %al
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/caching_ringbuffer_test.c
// Function: count_free
static void count_free(void* item, void* additional_arg) {

    if(0 == additional_arg) goto error;

    size_t* counter = additional_arg;
    ++(*counter);

error:

    return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x1c46
jmp 0x1c5c
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/caching_ringbuffer_test.c
// Function: main
int main(int argc, char** argv) {

    /* The interface tests */
    size_t free_count = 0;

    create = caching_ringbuffer_create;

    Ringbuffer* cache = ringbuffer_create(31, count_free, &free_count);
    free_item = cache_free;
    free_item_additional_arg = cache;

    test_ringbuffer_create();
    test_capacity();
    test_add();
    test_pop();
    cache->free(cache);
    cache = 0;

    /* Caching tests */
    test_caching_ringbuffer_create();
    test_caching_ringbuffer_get_cached();
    test_caching_ringbuffer_release();
    test_caching_free();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
leaq 0x43da(%rip), %rax      # 0x6058
leaq -0xaf5(%rip), %rcx      # 0x1190
movq %rcx, (%rax)
movl $0x1f, %edi
leaq -0x64(%rip), %rsi       # 0x1c30
leaq -0x18(%rbp), %rdx
callq 0x2c30
movq %rax, -0x20(%rbp)
leaq 0x43c0(%rip), %rax      # 0x6068
leaq -0xa5f(%rip), %rcx      # 0x1250
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
leaq 0x43b3(%rip), %rax      # 0x6070
movq %rcx, (%rax)
movb $0x0, %al
callq 0x1d10
movb $0x0, %al
callq 0x1dd0
movb $0x0, %al
callq 0x1ec0
movb $0x0, %al
callq 0x21a0
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
movq $0x0, -0x20(%rbp)
callq 0x1520
callq 0x1670
callq 0x1970
callq 0x1a60
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/test_helper.c
// Function: test_ringbuffer_create
void test_ringbuffer_create() {

    Ringbuffer* buffer = 0;

    assert(0 == ringbuffer_create(0, 0, 0));

    buffer = ringbuffer_create(1, 0, 0);
    assert(buffer);

    buffer = buffer->free(buffer);

    fprintf(stdout, "ringbuffer_create OK\n");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq $0x0, -0x8(%rbp)
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rdi
movq %rdx, %rsi
callq 0x2c30
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1d3b
jmp 0x1d5a
leaq 0x25f5(%rip), %rdi      # 0x4337
leaq 0x260e(%rip), %rsi      # 0x4357
movl $0x36, %edx
leaq 0x2615(%rip), %rcx      # 0x436a
callq 0x1040
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x2c30
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1d78
jmp 0x1d97
leaq 0x2285(%rip), %rdi      # 0x4004
leaq 0x25d1(%rip), %rsi      # 0x4357
movl $0x39, %edx
leaq 0x25d8(%rip), %rcx      # 0x436a
callq 0x1040
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
movq 0x4228(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0x230a(%rip), %rsi      # 0x40c4
movb $0x0, %al
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/test/test_helper.c
// Function: test_capacity
void test_capacity() {

    Ringbuffer* b = create(1, free_item, free_item_additional_arg);
    assert(1 == b->capacity(b));
    b = b->free(b);

    b = create(124, free_item, free_item_additional_arg);
    assert(124 == b->capacity(b));
    b = b->free(b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x4279(%rip), %rax      # 0x6058
movq 0x4282(%rip), %rsi      # 0x6068
movq 0x4283(%rip), %rdx      # 0x6070
movl $0x1, %edi
callq *%rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq %rax, %rcx
movl $0x1, %eax
cmpq %rcx, %rax
jne 0x1e14
jmp 0x1e33
leaq 0x256d(%rip), %rdi      # 0x4388
leaq 0x2535(%rip), %rsi      # 0x4357
movl $0x46, %edx
leaq 0x256e(%rip), %rcx      # 0x439c
callq 0x1040
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
movq 0x420c(%rip), %rax      # 0x6058
movq 0x4215(%rip), %rsi      # 0x6068
movq 0x4216(%rip), %rdx      # 0x6070
movl $0x7c, %edi
callq *%rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq %rax, %rcx
movl $0x7c, %eax
cmpq %rcx, %rax
jne 0x1e81
jmp 0x1ea0
leaq 0x2529(%rip), %rdi      # 0x43b1
leaq 0x24c8(%rip), %rsi      # 0x4357
movl $0x4a, %edx
leaq 0x2501(%rip), %rcx      # 0x439c
callq 0x1040
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/src/ringbuffer.c
// Function: ringbuffer_create
Ringbuffer* ringbuffer_create(
        size_t capacity,
        void (*free_item)(void* item, void* additional_arg),
        void* free_item_additional_arg) {

    if(0 >= capacity) {
        goto error;
    }

    Entry* list_start = calloc(1, sizeof(Entry));
    Entry* next = list_start;

    for(size_t i = 1; i < capacity; ++i) {

        next->next = calloc(1, sizeof(Entry));
        next = next->next;

    }

    next->next = list_start;

    InternalRingbuffer* buffer = calloc(1, sizeof(InternalRingbuffer));

    *buffer = (InternalRingbuffer) {
        .next_entry_to_write = list_start,
        .next_entry_to_read = list_start,
        .max_num_items = capacity,
        .free_item = free_item,
        .free_item_additional_arg = free_item_additional_arg,
    };

    buffer->public = (Ringbuffer) {
        .capacity = capacity_func,
        .add = add_func,
        .pop = pop_func,
        .free = free_func,
    };


    return (Ringbuffer*)buffer;

error:

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jb 0x2c54
jmp 0x2da3
movl $0x1, %edi
movl $0x10, %esi
callq 0x1060
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x1, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x2cb5
movl $0x1, %edi
movl $0x10, %esi
callq 0x1060
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2c77
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, %edi
movl $0x48, %esi
callq 0x1060
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x1050
movq -0xb0(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x88(%rbp), %rsi
movl $0x48, %edx
callq 0x1080
movq -0x40(%rbp), %rax
leaq 0x83(%rip), %rcx        # 0x2dc0
movq %rcx, -0xa8(%rbp)
leaq 0xb5(%rip), %rcx        # 0x2e00
movq %rcx, -0xa0(%rbp)
leaq 0x177(%rip), %rcx       # 0x2ed0
movq %rcx, -0x98(%rbp)
leaq 0x1e9(%rip), %rcx       # 0x2f50
movq %rcx, -0x90(%rbp)
movq -0xa8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xa0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x90(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2dab
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/src/ringbuffer.c
// Function: capacity_func
static size_t capacity_func(Ringbuffer* self) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;

    return internal->max_num_items;

error:

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x2dd2
jmp 0x2de8
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x2df0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/src/ringbuffer.c
// Function: add_func
static bool add_func(Ringbuffer* self, void* item) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;

    Entry* read = internal->next_entry_to_read;
    Entry* write = internal->next_entry_to_write;

    if((read == write) && (0 != read->next->item)) {
        internal->next_entry_to_read = read->next;
    }

    if((0 != write->item) && (0 != internal->free_item)) {
        internal->free_item(
                write->item,
                internal->free_item_additional_arg);
    }

    write->item = item;
    internal->next_entry_to_write = write->next;

    return true;

error:

    return false;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x2e1d
jmp 0x2eb7
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x2e66
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
je 0x2e66
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
je 0x2e96
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq 0x38(%rcx), %rax
je 0x2e96
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rcx), %rdi
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rsi
callq *%rax
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x2ebb
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/src/ringbuffer.c
// Function: pop_func
static void* pop_func(Ringbuffer* self) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;

    Entry* read = internal->next_entry_to_read;

    if(0 == read->item) {
        return 0;
    }

    void* retval = read->item;
    read->item = 0;
    internal->next_entry_to_read = read->next;

    return retval;

error:

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x2ee2
jmp 0x2f3b
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
jne 0x2f0b
movq $0x0, -0x8(%rbp)
jmp 0x2f43
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2f43
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/vidarr[P]ringbuffer/src/ringbuffer.c
// Function: free_func
static Ringbuffer* free_func(Ringbuffer* self) {

    if(0 == self) goto error;

    InternalRingbuffer* internal = (InternalRingbuffer*) self;

    Entry* current = internal->next_entry_to_write;
    Entry* start = current;

    do {

        Entry* next = current->next;

        if((0 != current->item) && (internal->free_item)) {

            internal->free_item(
                    current->item,
                    internal->free_item_additional_arg);

        }

        free(current);
        current = next;

    } while(current != start);

    free(self);
    self = 0;

error:

    return self;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
jne 0x2f69
jmp 0x2fec
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
je 0x2fc0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x2fc0
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rsi
callq *%rax
movq -0x18(%rbp), %rdi
callq 0x1030
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x2f85
movq -0x8(%rbp), %rdi
callq 0x1030
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_create_with_filename
plm_t *plm_create_with_filename(const char *filename) {
	plm_buffer_t *buffer = plm_buffer_create_with_filename(filename);
	if (!buffer) {
		return NULL;
	}
	return plm_create_with_buffer(buffer, TRUE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x23f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x23ca
movq $0x0, -0x8(%rbp)
jmp 0x23dc
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2440
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/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_create_with_filename
plm_buffer_t *plm_buffer_create_with_filename(const char *filename) {
	FILE *fh = fopen(filename, "rb");
	if (!fh) {
		return NULL;
	}
	return plm_buffer_create_with_file(fh, TRUE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xc159(%rip), %rsi      # 0xe560
callq 0x21a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2421
movq $0x0, -0x8(%rbp)
jmp 0x2433
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x24f0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_create_with_buffer
plm_t *plm_create_with_buffer(plm_buffer_t *buffer, int destroy_when_done) {
	plm_t *self = (plm_t *)PLM_MALLOC(sizeof(plm_t));
	memset(self, 0, sizeof(plm_t));

	self->demux = plm_demux_create(buffer, destroy_when_done);
	self->video_enabled = TRUE;
	self->audio_enabled = TRUE;
	plm_init_decoders(self);

	return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x80, %edi
callq 0x2200
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x20e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x2690
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x1c(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x38(%rax)
movq -0x18(%rbp), %rdi
callq 0x2720
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_create_with_file
plm_buffer_t *plm_buffer_create_with_file(FILE *fh, int close_when_done) {
	plm_buffer_t *self = plm_buffer_create_with_capacity(PLM_BUFFER_DEFAULT_SIZE);
	self->fh = fh;
	self->close_when_done = close_when_done;
	self->mode = PLM_BUFFER_MODE_FILE;
	self->discard_read_bytes = TRUE;
	
	fseek(self->fh, 0, SEEK_END);
	self->total_size = ftell(self->fh);
	fseek(self->fh, 0, SEEK_SET);

	self->load_callback = plm_buffer_load_file_callback;
	self->seek_callback = plm_buffer_seek_file_callback;
	self->tell_callback = plm_buffer_tell_file_callback;
	return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x20000, %edi          # imm = 0x20000
callq 0x2ad0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x60(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x2180
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2030
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x2180
movq -0x18(%rbp), %rax
leaq 0x286b(%rip), %rcx      # 0x4df0
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
leaq 0x28ec(%rip), %rcx      # 0x4e80
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
leaq 0x290d(%rip), %rcx      # 0x4eb0
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_create_with_memory
plm_buffer_t *plm_buffer_create_with_memory(uint8_t *bytes, size_t length, int free_when_done) {
	plm_buffer_t *self = (plm_buffer_t *)PLM_MALLOC(sizeof(plm_buffer_t));
	memset(self, 0, sizeof(plm_buffer_t));
	self->capacity = length;
	self->length = length;
	self->total_size = length;
	self->free_when_done = free_when_done;
	self->bytes = bytes;
	self->mode = PLM_BUFFER_MODE_FIXED_MEM;
	self->discard_read_bytes = FALSE;
	return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x68, %edi
callq 0x2200
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x20e0
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x60(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_demux_create
plm_demux_t *plm_demux_create(plm_buffer_t *buffer, int destroy_when_done) {
	plm_demux_t *self = (plm_demux_t *)PLM_MALLOC(sizeof(plm_demux_t));
	memset(self, 0, sizeof(plm_demux_t));

	self->buffer = buffer;
	self->destroy_buffer_when_done = destroy_when_done;

	self->start_time = PLM_PACKET_INVALID_TS;
	self->duration = PLM_PACKET_INVALID_TS;
	self->start_code = -1;

	plm_demux_has_headers(self);
	return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x90, %edi
callq 0x2200
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x90, %edx
callq 0x20e0
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movsd 0xa92a(%rip), %xmm0     # 0xd008
movsd %xmm0, 0x28(%rax)
movq -0x18(%rbp), %rax
movsd 0xa919(%rip), %xmm0     # 0xd008
movsd %xmm0, 0x30(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x38(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rdi
callq 0x2880
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_init_decoders
int plm_init_decoders(plm_t *self) {
	if (self->has_decoders) {
		return TRUE;
	}

	if (!plm_demux_has_headers(self->demux)) {
		return FALSE;
	}

	if (plm_demux_get_num_video_streams(self->demux) > 0) {
		if (self->video_enabled) {
			self->video_packet_type = PLM_DEMUX_PACKET_VIDEO_1;
		}
		if (!self->video_decoder) {
			self->video_buffer = plm_buffer_create_with_capacity(PLM_BUFFER_DEFAULT_SIZE);
			plm_buffer_set_load_callback(self->video_buffer, plm_read_video_packet, self);
			self->video_decoder = plm_video_create_with_buffer(self->video_buffer, TRUE);
		}
	}

	if (plm_demux_get_num_audio_streams(self->demux) > 0) {
		if (self->audio_enabled) {
			self->audio_packet_type = PLM_DEMUX_PACKET_AUDIO_1 + self->audio_stream_index;
		}
		if (!self->audio_decoder) {
			self->audio_buffer = plm_buffer_create_with_capacity(PLM_BUFFER_DEFAULT_SIZE);
			plm_buffer_set_load_callback(self->audio_buffer, plm_read_audio_packet, self);
			self->audio_decoder = plm_audio_create_with_buffer(self->audio_buffer, TRUE);
		}
	}

	self->has_decoders = TRUE;
	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x2742
movl $0x1, -0x4(%rbp)
jmp 0x2874
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2880
cmpl $0x0, %eax
jne 0x275f
movl $0x0, -0x4(%rbp)
jmp 0x2874
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2a90
cmpl $0x0, %eax
jle 0x27dc
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x2785
movq -0x10(%rbp), %rax
movl $0xe0, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x27da
movl $0x20000, %edi          # imm = 0x20000
callq 0x2ad0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3c8(%rip), %rsi       # 0x2b80
callq 0x2b50
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0x1, %esi
callq 0x2bb0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x27dc
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2c40
cmpl $0x0, %eax
jle 0x2862
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0x280b
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %ecx
addl $0xc0, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x2860
movl $0x20000, %edi          # imm = 0x20000
callq 0x2ad0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x442(%rip), %rsi       # 0x2c80
callq 0x2b50
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
movl $0x1, %esi
callq 0x2cb0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
jmp 0x2862
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_create_with_capacity
plm_buffer_t *plm_buffer_create_with_capacity(size_t capacity) {
	plm_buffer_t *self = (plm_buffer_t *)PLM_MALLOC(sizeof(plm_buffer_t));
	memset(self, 0, sizeof(plm_buffer_t));
	self->capacity = capacity;
	self->free_when_done = TRUE;
	self->bytes = (uint8_t *)PLM_MALLOC(capacity);
	self->mode = PLM_BUFFER_MODE_RING;
	self->discard_read_bytes = TRUE;
	return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x68, %edi
callq 0x2200
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x20e0
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x28(%rax)
movq -0x8(%rbp), %rdi
callq 0x2200
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x10(%rbp), %rax
movl $0x2, 0x60(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_create_with_buffer
plm_video_t * plm_video_create_with_buffer(plm_buffer_t *buffer, int destroy_when_done) {
	plm_video_t *self = (plm_video_t *)PLM_MALLOC(sizeof(plm_video_t));
	memset(self, 0, sizeof(plm_video_t));
	
	self->buffer = buffer;
	self->destroy_buffer_when_done = destroy_when_done;

	// Attempt to decode the sequence header
	self->start_code = plm_buffer_find_start_code(self->buffer, PLM_START_SEQUENCE);
	if (self->start_code != -1) {
		plm_video_decode_sequence_header(self);
	}
	return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x300, %edi            # imm = 0x300
callq 0x2200
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x300, %edx            # imm = 0x300
callq 0x20e0
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xa0(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xa8(%rax)
movq -0x18(%rbp), %rax
movq 0xa0(%rax), %rdi
movl $0xb3, %esi
callq 0x55f0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x40(%rax)
je 0x2c2a
movq -0x18(%rbp), %rdi
callq 0x5b40
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_audio_create_with_buffer
plm_audio_t *plm_audio_create_with_buffer(plm_buffer_t *buffer, int destroy_when_done) {
	plm_audio_t *self = (plm_audio_t *)PLM_MALLOC(sizeof(plm_audio_t));
	memset(self, 0, sizeof(plm_audio_t));

	self->samples.count = PLM_AUDIO_SAMPLES_PER_FRAME;
	self->buffer = buffer;
	self->destroy_buffer_when_done = destroy_when_done;
	self->samplerate_index = 3; // Indicates 0

	memcpy(self->D, PLM_AUDIO_SYNTHESIS_WINDOW, 512 * sizeof(float));
	memcpy(self->D + 512, PLM_AUDIO_SYNTHESIS_WINDOW, 512 * sizeof(float));

	// Attempt to decode first header
	self->next_frame_data_size = plm_audio_decode_header(self);

	return self;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x5d10, %edi           # imm = 0x5D10
callq 0x2200
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x5d10, %edx           # imm = 0x5D10
callq 0x20e0
movq -0x18(%rbp), %rax
movl $0x480, 0x888(%rax)     # imm = 0x480
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x18(%rbp), %rax
movl $0x3, 0xc(%rax)
movq -0x18(%rbp), %rdi
addq $0x2c90, %rdi           # imm = 0x2C90
leaq 0xace2(%rip), %rsi      # 0xda00
movl $0x800, %edx            # imm = 0x800
callq 0x2130
movq -0x18(%rbp), %rdi
addq $0x2c90, %rdi           # imm = 0x2C90
addq $0x800, %rdi            # imm = 0x800
leaq 0xacbf(%rip), %rsi      # 0xda00
movl $0x800, %edx            # imm = 0x800
callq 0x2130
movq -0x18(%rbp), %rdi
callq 0x9470
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_destroy
void plm_destroy(plm_t *self) {
	if (self->video_decoder) {
		plm_video_destroy(self->video_decoder);
	}
	if (self->audio_decoder) {
		plm_audio_destroy(self->audio_decoder);
	}

	plm_demux_destroy(self->demux);
	PLM_FREE(self);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x2d94
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2dd0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x2dac
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x2e30
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x2e70
movq -0x8(%rbp), %rdi
callq 0x21b0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_destroy
void plm_video_destroy(plm_video_t *self) {
	if (self->destroy_buffer_when_done) {
		plm_buffer_destroy(self->buffer);
	}

	if (self->has_sequence_header) {
		PLM_FREE(self->frames_data);
	}

	PLM_FREE(self);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0xa8(%rax)
je 0x2df9
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdi
callq 0x4fa0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x70(%rax)
je 0x2e13
movq -0x8(%rbp), %rax
movq 0x170(%rax), %rdi
callq 0x21b0
movq -0x8(%rbp), %rdi
callq 0x21b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_has_headers
int plm_has_headers(plm_t *self) {
	if (!plm_demux_has_headers(self->demux)) {
		return FALSE;
	}
	
	if (!plm_init_decoders(self)) {
		return FALSE;
	}

	if (
		(self->video_decoder && !plm_video_has_header(self->video_decoder)) ||
		(self->audio_decoder && !plm_audio_has_header(self->audio_decoder))
	) {
		return FALSE;
	}

	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2880
cmpl $0x0, %eax
jne 0x2ef6
movl $0x0, -0x4(%rbp)
jmp 0x2f57
movq -0x10(%rbp), %rdi
callq 0x2720
cmpl $0x0, %eax
jne 0x2f0d
movl $0x0, -0x4(%rbp)
jmp 0x2f57
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x2f2a
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2f60
cmpl $0x0, %eax
je 0x2f47
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x2f50
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x2ff0
cmpl $0x0, %eax
jne 0x2f50
movl $0x0, -0x4(%rbp)
jmp 0x2f57
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq