LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: ExtensionIsSupported
EGLBoolean ExtensionIsSupported(const char *extensionString,
                                const char *extension)
{
    const char *endOfExtensionString;
    const char *currentExtension = extensionString;
    size_t extensionLength;

    if ((extensionString == NULL) || (extension == NULL)) {
        return EGL_FALSE;
    }

    extensionLength = strlen(extension);

    endOfExtensionString = extensionString + strlen(extensionString);

    while (currentExtension < endOfExtensionString) {
        const size_t currentExtensionLength = strcspn(currentExtension, " ");
        if ((extensionLength == currentExtensionLength) &&
            (strncmp(extension, currentExtension,
                     extensionLength) == 0)) {
            return EGL_TRUE;
        }
        currentExtension += (currentExtensionLength + 1);
    }
    return EGL_FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2d16
cmpq $0x0, -0x18(%rbp)
jne 0x2d22
movl $0x0, -0x4(%rbp)
jmp 0x2dae
movq -0x18(%rbp), %rdi
callq 0x2210
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2210
movq %rax, %rcx
movq -0x40(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x2da7
movq -0x28(%rbp), %rdi
leaq 0x43bf(%rip), %rsi      # 0x7122
callq 0x2370
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0x2d95
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x2110
cmpl $0x0, %eax
jne 0x2d95
movl $0x1, -0x4(%rbp)
jmp 0x2dae
movq -0x38(%rbp), %rax
addq $0x1, %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x2d4e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetEglExtensionFunctionPointers
void GetEglExtensionFunctionPointers(void)
{
    pEglQueryDevicesEXT = (PFNEGLQUERYDEVICESEXTPROC)
        GetProcAddress("eglQueryDevicesEXT");

    pEglQueryDeviceStringEXT = (PFNEGLQUERYDEVICESTRINGEXTPROC)
        GetProcAddress("eglQueryDeviceStringEXT");

    pEglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
        GetProcAddress("eglGetPlatformDisplayEXT");

    pEglGetOutputLayersEXT = (PFNEGLGETOUTPUTLAYERSEXTPROC)
        GetProcAddress("eglGetOutputLayersEXT");

    pEglCreateStreamKHR = (PFNEGLCREATESTREAMKHRPROC)
        GetProcAddress("eglCreateStreamKHR");

    pEglStreamConsumerOutputEXT = (PFNEGLSTREAMCONSUMEROUTPUTEXTPROC)
        GetProcAddress("eglStreamConsumerOutputEXT");

    pEglCreateStreamProducerSurfaceKHR = (PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)
        GetProcAddress("eglCreateStreamProducerSurfaceKHR");

    pEglQueryStreamKHR = (PFNEGLQUERYSTREAMKHRPROC)
        GetProcAddress("eglQueryStreamKHR");

    pEglStreamConsumerAcquireAttribNV = (PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC)
        GetProcAddress("eglStreamConsumerAcquireAttribNV");

    pEglStreamConsumerReleaseAttribNV = (PFNEGLSTREAMCONSUMERRELEASEATTRIBNVPROC)
        GetProcAddress("eglStreamConsumerReleaseAttribNV");

    pEglCreateStreamAttribNV = (PFNEGLCREATESTREAMATTRIBNVPROC)
        GetProcAddress("eglCreateStreamAttribNV");

    pEglOutputLayerAttribEXT = (PFNEGLOUTPUTLAYERATTRIBEXTPROC)
        GetProcAddress("eglOutputLayerAttribEXT");

    pEglQueryOutputLayerAttribEXT = (PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC)
        GetProcAddress("eglQueryOutputLayerAttribEXT");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x3345(%rip), %rdi      # 0x6110
callq 0x2ec0
movq %rax, 0x6451(%rip)      # 0x9228
leaq 0x3345(%rip), %rdi      # 0x6123
callq 0x2ec0
movq %rax, 0x6446(%rip)      # 0x9230
leaq 0x334a(%rip), %rdi      # 0x613b
callq 0x2ec0
movq %rax, 0x643b(%rip)      # 0x9238
leaq 0x3350(%rip), %rdi      # 0x6154
callq 0x2ec0
movq %rax, 0x6430(%rip)      # 0x9240
leaq 0x3353(%rip), %rdi      # 0x616a
callq 0x2ec0
movq %rax, 0x6425(%rip)      # 0x9248
leaq 0x3353(%rip), %rdi      # 0x617d
callq 0x2ec0
movq %rax, 0x641a(%rip)      # 0x9250
leaq 0x335b(%rip), %rdi      # 0x6198
callq 0x2ec0
movq %rax, 0x640f(%rip)      # 0x9258
leaq 0x336a(%rip), %rdi      # 0x61ba
callq 0x2ec0
movq %rax, 0x6404(%rip)      # 0x9260
leaq 0x3369(%rip), %rdi      # 0x61cc
callq 0x2ec0
movq %rax, 0x63f9(%rip)      # 0x9268
leaq 0x3377(%rip), %rdi      # 0x61ed
callq 0x2ec0
movq %rax, 0x63ee(%rip)      # 0x9270
leaq 0x3385(%rip), %rdi      # 0x620e
callq 0x2ec0
movq %rax, 0x63e3(%rip)      # 0x9278
leaq 0x338a(%rip), %rdi      # 0x6226
callq 0x2ec0
movq %rax, 0x63d8(%rip)      # 0x9280
leaq 0x338f(%rip), %rdi      # 0x623e
callq 0x2ec0
movq %rax, 0x63cd(%rip)      # 0x9288
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetProcAddress
static void *GetProcAddress(const char *functionName)
{
    void *ptr = (void *) eglGetProcAddress(functionName);

    if (ptr == NULL) {
        Fatal("eglGetProcAddress(%s) failed.\n", functionName);
    }

    return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x21b0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2ef2
movq -0x8(%rbp), %rsi
leaq 0x3e4e(%rip), %rdi      # 0x6d39
movb $0x0, %al
callq 0x4cf0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetDrmFd
int GetDrmFd(EGLDeviceEXT device)
{
    const char *deviceExtensionString =
        pEglQueryDeviceStringEXT(device, EGL_EXTENSIONS);

    const char *drmDeviceFile;
    int fd;

    if (!ExtensionIsSupported(deviceExtensionString, "EGL_EXT_device_drm")) {
        Fatal("EGL_EXT_device_drm extension not found.\n");
    }

    drmDeviceFile = pEglQueryDeviceStringEXT(device, EGL_DRM_DEVICE_FILE_EXT);

    if (drmDeviceFile == NULL) {
        Fatal("No DRM device file found for EGL device.\n");
    }
    printf("Device file: %s\n", drmDeviceFile);

    // Open with nonblock so we can query for vsync events
    // using drmHandleEvent without blocking
    fd = open(drmDeviceFile, O_RDWR | O_NONBLOCK, 0);

    if (fd < 0) {
        Fatal("Unable to open DRM device file.\n");
    }

    return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq 0x618d(%rip), %rax      # 0x9230
movq -0x8(%rbp), %rdi
movl $0x3055, %esi           # imm = 0x3055
callq *%rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x325e(%rip), %rsi      # 0x631b
callq 0x2cf0
cmpl $0x0, %eax
jne 0x30d5
leaq 0x3291(%rip), %rdi      # 0x635f
movb $0x0, %al
callq 0x4cf0
movq 0x6154(%rip), %rax      # 0x9230
movq -0x8(%rbp), %rdi
movl $0x3233, %esi           # imm = 0x3233
callq *%rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3100
leaq 0x328f(%rip), %rdi      # 0x6388
movb $0x0, %al
callq 0x4cf0
movq -0x18(%rbp), %rsi
leaq 0x32a7(%rip), %rdi      # 0x63b2
movb $0x0, %al
callq 0x2050
movq -0x18(%rbp), %rdi
movl $0x802, %esi            # imm = 0x802
xorl %edx, %edx
movb $0x0, %al
callq 0x23d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x313b
leaq 0x328f(%rip), %rdi      # 0x63c3
movb $0x0, %al
callq 0x4cf0
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetEglContext
EGLContext GetEglContext(EGLDisplay eglDpy, EGLConfig eglConfig) {
    /* Create an EGL context using the EGL config. */
    EGLint contextAttribs[] = { EGL_NONE };
    EGLContext eglContext =
        eglCreateContext(eglDpy, eglConfig, EGL_NO_CONTEXT, contextAttribs);

    if (eglContext == NULL) {
        Fatal("eglCreateContext() failed.\n");
    }
    return eglContext;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x2d56(%rip), %eax      # 0x610c
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x2180
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x33e7
leaq 0x322e(%rip), %rdi      # 0x660e
movb $0x0, %al
callq 0x4cf0
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: PrintDisplayLayerSwapInterval
void PrintDisplayLayerSwapInterval(egl_display* Display) {
    EGLAttrib SwapInterval;
    pEglQueryOutputLayerAttribEXT(Display->DisplayDevice, Display->Layer,
        EGL_SWAP_INTERVAL_EXT, &SwapInterval);
    printf("Swap interval for %s is %li\n",
        Display->MonitorName,
        SwapInterval);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5e75(%rip), %rax      # 0x9288
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rdi
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rsi
movl $0x322f, %edx           # imm = 0x322F
leaq -0x10(%rbp), %rcx
callq *%rax
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x31e9(%rip), %rdi      # 0x662a
movb $0x0, %al
callq 0x2050
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: EGLStreamAcquire
void EGLStreamAcquire(egl_display* Display) {
    // Ask the Display's EGLStream to acquire the new frame,
    // and pass a data pointer to pass along to drmHandleEvent
    EGLAttrib AcquireAttribs[] = {
        EGL_DRM_FLIP_EVENT_DATA_NV, (EGLAttrib)Display,
        EGL_NONE
    };

    EGLBoolean Result = pEglStreamConsumerAcquireAttribNV(
        Display->DisplayDevice,
        Display->Stream,
        AcquireAttribs);
    if (Result == EGL_FALSE) {
        EGLCheck("eglStreamConsumerAcquireAttribNV");
    }
    Display->PageFlipPending = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x333e, -0x20(%rbp)    # imm = 0x333E
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x3038, -0x10(%rbp)    # imm = 0x3038
movq 0x5dbd(%rip), %rax      # 0x9268
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rdi
movq -0x8(%rbp), %rcx
movq 0x40(%rcx), %rsi
leaq -0x20(%rbp), %rdx
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x34d6
leaq 0x2cfb(%rip), %rdi      # 0x61cc
callq 0x34f0
movq -0x8(%rbp), %rax
movb $0x1, 0x50(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: EGLSwapDisplay
void EGLSwapDisplay(egl_display* Display) {

    NEWTIME(eglSwapBuffers);
    eglSwapBuffers(Display->DisplayDevice, Display->Surface);
    ENDTIME(eglSwapBuffers);

    NEWTIME(StreamAcquire);
    EGLStreamAcquire(Display);
    ENDTIME(StreamAcquire);


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, %al
callq 0x4e00
movss %xmm0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x2250
movb $0x0, %al
callq 0x4e00
subss -0xc(%rbp), %xmm0
movss 0x2973(%rip), %xmm1     # 0x6004
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2990(%rip), %rdi      # 0x6030
leaq 0x29b4(%rip), %rsi      # 0x605b
movb $0x1, %al
callq 0x2050
movb $0x0, %al
callq 0x4e00
movss %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3480
movb $0x0, %al
callq 0x4e00
subss -0x10(%rbp), %xmm0
movss 0x292d(%rip), %xmm1     # 0x6004
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x294a(%rip), %rdi      # 0x6030
leaq 0x2956(%rip), %rsi      # 0x6043
movb $0x1, %al
callq 0x2050
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: InitGLEW
void InitGLEW() {
    // Initialize GLEW
    glewExperimental = GL_TRUE;
    if(glewInit() != GLEW_OK) {
        Fatal("Could not init glew.\n");
    }
    GLenum GLEWError = glGetError();
    if (GLEWError) {
        printf("GLEW returned error: %i\n", GLEWError);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x5529(%rip), %rax      # 0x8fc8
movb $0x1, (%rax)
callq 0x2270
cmpl $0x0, %eax
je 0x3aba
leaq 0x2c7f(%rip), %rdi      # 0x6732
movb $0x0, %al
callq 0x4cf0
callq 0x20f0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x3ad9
movl -0x4(%rbp), %esi
leaq 0x2c76(%rip), %rdi      # 0x6748
movb $0x0, %al
callq 0x2050
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: PageFlipEventHandler
static void PageFlipEventHandler(int fd, unsigned int frame,
                    unsigned int sec, unsigned int usec,
                    void *data)
{
    egl_display* Display = (egl_display*)data;
    (void)fd; (void)frame; (void)sec; (void)usec; (void)data;
    Display->PageFlipPending = false;

    float Now = GetTime();
    if (Display->LastPageFlip > 0) {
        printf("%20s page flip interval: %.2fms\n",
            Display->EDID->MonitorName,
            (Now - Display->LastPageFlip) * 1000);
    }

    Display->LastPageFlip = Now;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movq %r8, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, 0x50(%rax)
movb $0x0, %al
callq 0x4e00
movss %xmm0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movss 0x54(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x3d1b
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rsi
movss -0x24(%rbp), %xmm0
movq -0x20(%rbp), %rax
subss 0x54(%rax), %xmm0
movss 0x22ff(%rip), %xmm1     # 0x6004
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3044(%rip), %rdi      # 0x6d58
movb $0x1, %al
callq 0x2050
movss -0x24(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x54(%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: EGLQueryStreamState
EGLint EGLQueryStreamState(EGLDisplay eglDpy, EGLStreamKHR eglStream) {
     EGLint streamState;
     EGLBoolean r = pEglQueryStreamKHR(eglDpy, eglStream, EGL_STREAM_STATE_KHR, &streamState);
     if (r == EGL_FALSE) {
         EGLCheck("Query Stream");
     }

     return streamState;
 }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x5519(%rip), %rax      # 0x9260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x3214, %edx           # imm = 0x3214
leaq -0x14(%rbp), %rcx
callq *%rax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x3d6f
leaq 0x2a1b(%rip), %rdi      # 0x6785
callq 0x34f0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/egl.c
// Function: EGLStreamStateToString
const char* EGLStreamStateToString(EGLint StreamState) {
    switch (StreamState) {
        case EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR:
            return "EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR";
            break;
        case EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR:
            return "EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR";
            break;
        case EGL_STREAM_STATE_CREATED_KHR:
            return "EGL_STREAM_STATE_CREATED_KHR";
            break;
        case EGL_STREAM_STATE_CONNECTING_KHR:
            return "EGL_STREAM_STATE_CONNECTING_KHR";
            break;
        case EGL_STREAM_STATE_EMPTY_KHR:
            return "EGL_STREAM_STATE_EMPTY_KHR";
            break;
        case EGL_STREAM_STATE_DISCONNECTED_KHR:
            return "EGL_STREAM_STATE_DISCONNECTED_KHR";
            break;
    }
    return "Unrecognized EGL Stream State";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %eax
addl $0xffffcdeb, %eax       # imm = 0xFFFFCDEB
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x5, %eax
ja 0x3dfc
movq -0x18(%rbp), %rax
leaq 0x2313(%rip), %rcx      # 0x60b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x29dd(%rip), %rax      # 0x6792
movq %rax, -0x8(%rbp)
jmp 0x3e07
leaq 0x29f9(%rip), %rax      # 0x67bb
movq %rax, -0x8(%rbp)
jmp 0x3e07
leaq 0x2a15(%rip), %rax      # 0x67e4
movq %rax, -0x8(%rbp)
jmp 0x3e07
leaq 0x2a25(%rip), %rax      # 0x6801
movq %rax, -0x8(%rbp)
jmp 0x3e07
leaq 0x2a38(%rip), %rax      # 0x6821
movq %rax, -0x8(%rbp)
jmp 0x3e07
leaq 0x2a46(%rip), %rax      # 0x683c
movq %rax, -0x8(%rbp)
jmp 0x3e07
leaq 0x2a5b(%rip), %rax      # 0x685e
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/kms.c
// Function: PickConfig
static bool PickConfig(int drmFd, drmModeResPtr pModeRes, int connIndex, struct Config *pConfig)
{
    if (!PickConnector(drmFd, pModeRes, connIndex, pConfig)) {
        return false;
    }

    PickPlane(drmFd, pConfig);

    pConfig->width = pConfig->mode.hdisplay;
    pConfig->height = pConfig->mode.vdisplay;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x43f0
testb $0x1, %al
jne 0x4073
movb $0x0, -0x1(%rbp)
jmp 0x40a3
movl -0x8(%rbp), %edi
movq -0x20(%rbp), %rsi
callq 0x4640
movq -0x20(%rbp), %rax
movw 0x14(%rax), %cx
movq -0x20(%rbp), %rax
movw %cx, 0x60(%rax)
movq -0x20(%rbp), %rax
movw 0x1e(%rax), %cx
movq -0x20(%rbp), %rax
movw %cx, 0x62(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/kms.c
// Function: CreateModeID
static uint32_t CreateModeID(int drmFd, const struct Config *pConfig)
{
    uint32_t modeID = 0;
    int ret = drmModeCreatePropertyBlob(drmFd,
                                        &pConfig->mode, sizeof(pConfig->mode),
                                        &modeID);
    if (ret != 0) {
        Fatal("Failed to create mode property.\n");
    }

    return modeID;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movl $0x44, %edx
leaq -0x14(%rbp), %rcx
callq 0x20c0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x40f6
leaq 0x2edd(%rip), %rdi      # 0x6fcc
movb $0x0, %al
callq 0x4cf0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/kms.c
// Function: CreateFb
static uint32_t CreateFb(int drmFd, const struct Config *pConfig)
{
    struct drm_mode_create_dumb createRequest = { 0 };
    struct drm_mode_map_dumb mapRequest = { 0 };
    uint8_t *map;
    uint32_t fb = 0;
    int ret;

    createRequest.width = pConfig->width;
    createRequest.height = pConfig->height;
    createRequest.bpp = 32;

    ret = drmIoctl(drmFd, DRM_IOCTL_MODE_CREATE_DUMB, &createRequest);
    if (ret < 0) {
        Fatal("Unable to create dumb buffer.\n");
    }

    ret = drmModeAddFB(drmFd, pConfig->width, pConfig->height, 24, 32,
                       createRequest.pitch, createRequest.handle, &fb);
    if (ret) {
        Fatal("Unable to add fb.\n");
    }

    mapRequest.handle = createRequest.handle;

    ret = drmIoctl(drmFd, DRM_IOCTL_MODE_MAP_DUMB, &mapRequest);
    if (ret) {
        Fatal("Unable to map dumb buffer.\n");
    }

    map = mmap(0, createRequest.size, PROT_READ | PROT_WRITE, MAP_SHARED,
               drmFd, mapRequest.offset);
    if (map == MAP_FAILED) {
        Fatal("Failed to mmap(2) fb.\n");
    }

    memset(map, 0, createRequest.size);

    return fb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2080
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2080
movl $0x0, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x60(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x62(%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x20, -0x28(%rbp)
movl -0x4(%rbp), %edi
movl $0xc02064b2, %esi       # imm = 0xC02064B2
leaq -0x30(%rbp), %rdx
callq 0x2030
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
jge 0x417b
leaq 0x2e79(%rip), %rdi      # 0x6fed
movb $0x0, %al
callq 0x4cf0
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movzwl 0x60(%rax), %esi
movq -0x10(%rbp), %rax
movzwl 0x62(%rax), %edx
movl -0x1c(%rbp), %r9d
movl -0x20(%rbp), %r10d
movl $0x18, %ecx
movl $0x20, %r8d
leaq -0x4c(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2340
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x41ca
leaq 0x2e49(%rip), %rdi      # 0x700c
movb $0x0, %al
callq 0x4cf0
movl -0x20(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x4(%rbp), %edi
movl $0xc01064b3, %esi       # imm = 0xC01064B3
leaq -0x40(%rbp), %rdx
callq 0x2030
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x41f8
leaq 0x2e2e(%rip), %rdi      # 0x701f
movb $0x0, %al
callq 0x4cf0
movq -0x18(%rbp), %rsi
movl -0x4(%rbp), %r8d
movq -0x38(%rbp), %r9
xorl %eax, %eax
movl %eax, %edi
movl $0x3, %edx
movl $0x1, %ecx
callq 0x23e0
movq %rax, -0x48(%rbp)
movq $-0x1, %rax
cmpq %rax, -0x48(%rbp)
jne 0x4236
leaq 0x2e0c(%rip), %rdi      # 0x703b
movb $0x0, %al
callq 0x4cf0
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x2080
movl -0x4c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/kms.c
// Function: PickPlane
static void PickPlane(int drmFd, struct Config *pConfig)
{
    drmModePlaneResPtr pPlaneRes = drmModeGetPlaneResources(drmFd);
    uint32_t i;

    if (pPlaneRes == NULL) {
        Fatal("Unable to query DRM-KMS plane resources\n");
    }

    for (i = 0; i < pPlaneRes->count_planes; i++) {
        drmModePlanePtr pPlane = drmModeGetPlane(drmFd, pPlaneRes->planes[i]);
        uint32_t crtcs;
        uint64_t type;

        if (pPlane == NULL) {
            Fatal("Unable to query DRM-KMS plane %d\n", i);
        }

        crtcs = pPlane->possible_crtcs;

        drmModeFreePlane(pPlane);

        if ((crtcs & (1 << pConfig->crtcIndex)) == 0) {
            continue;
        }

        type = GetPropertyValue(drmFd, pPlaneRes->planes[i],
                                DRM_MODE_OBJECT_PLANE, "type");

        if (type == DRM_PLANE_TYPE_PRIMARY) {
            pConfig->planeID = pPlaneRes->planes[i];
            break;
        }
    }

    drmModeFreePlaneResources(pPlaneRes);

    printf("Plane ID: %i\n", pConfig->planeID);
    if (pConfig->planeID == 0) {
        Fatal("Could not find a suitable plane.\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %edi
callq 0x22d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4670
leaq 0x28e3(%rip), %rdi      # 0x6f4c
movb $0x0, %al
callq 0x4cf0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x473b
movl -0x4(%rbp), %edi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %esi
callq 0x2090
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x46b8
movl -0x1c(%rbp), %esi
leaq 0x28c4(%rip), %rdi      # 0x6f75
movb $0x0, %al
callq 0x4cf0
movq -0x28(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2200
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x46e7
jmp 0x472d
movl -0x4(%rbp), %edi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %esi
movl $0xeeeeeeee, %edx       # imm = 0xEEEEEEEE
leaq 0x2893(%rip), %rcx      # 0x6f97
callq 0x4890
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x38(%rbp)
jne 0x472b
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x473b
jmp 0x472d
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4677
movq -0x18(%rbp), %rdi
callq 0x2220
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0x284a(%rip), %rdi      # 0x6f9c
movb $0x0, %al
callq 0x2050
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x4771
leaq 0x2840(%rip), %rdi      # 0x6faa
movb $0x0, %al
callq 0x4cf0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/kms.c
// Function: GetPropertyBlobValue
static drmModePropertyBlobPtr GetPropertyBlobValue(
    int drmFd,
    uint32_t objectID,
    uint32_t objectType,
    const char *propName)
{
    uint32_t i;
    int found = 0;
    drmModePropertyBlobPtr value = 0;
    drmModeObjectPropertiesPtr pModeObjectProperties =
        drmModeObjectGetProperties(drmFd, objectID, objectType);

    for (i = 0; i < pModeObjectProperties->count_props; i++) {

        drmModePropertyPtr pProperty =
            drmModeGetProperty(drmFd, pModeObjectProperties->props[i]);

        if (pProperty == NULL) {
            Fatal("Unable to query property.\n");
        }

        if ((pProperty->flags & DRM_MODE_PROP_BLOB) &&
            strcmp(propName, pProperty->name) == 0) {
            value = drmModeGetPropertyBlob(
                drmFd,
                pModeObjectProperties->prop_values[i]);
            found = 1;
        }

        drmModeFreeProperty(pProperty);

        if (found) {
            break;
        }
    }

    drmModeFreeObjectProperties(pModeObjectProperties);

    if (!found) {
        Fatal("Unable to find value for property \'%s\'.\n", propName);
    }

    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x2170
movq %rax, -0x30(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x4865
movl -0x4(%rbp), %edi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %esi
callq 0x2150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x47fb
leaq 0x2714(%rip), %rdi      # 0x6f08
movb $0x0, %al
callq 0x4cf0
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x4844
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x8, %rsi
callq 0x2330
cmpl $0x0, %eax
jne 0x4844
movl -0x4(%rbp), %edi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
callq 0x22a0
movq %rax, -0x28(%rbp)
movl $0x1, -0x20(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2240
cmpl $0x0, -0x20(%rbp)
je 0x4855
jmp 0x4865
jmp 0x4857
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x47bd
movq -0x30(%rbp), %rdi
callq 0x2130
cmpl $0x0, -0x20(%rbp)
jne 0x4886
movq -0x18(%rbp), %rsi
leaq 0x26a4(%rip), %rdi      # 0x6f23
movb $0x0, %al
callq 0x4cf0
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/kms.c
// Function: GetPropertyValue
static uint64_t GetPropertyValue(
    int drmFd,
    uint32_t objectID,
    uint32_t objectType,
    const char *propName)
{
    uint32_t i;
    int found = 0;
    uint64_t value = 0;
    drmModeObjectPropertiesPtr pModeObjectProperties =
        drmModeObjectGetProperties(drmFd, objectID, objectType);

    for (i = 0; i < pModeObjectProperties->count_props; i++) {

        drmModePropertyPtr pProperty =
            drmModeGetProperty(drmFd, pModeObjectProperties->props[i]);

        if (pProperty == NULL) {
            Fatal("Unable to query property.\n");
        }

        if (strcmp(propName, pProperty->name) == 0) {
            value = pModeObjectProperties->prop_values[i];
            found = 1;
        }

        drmModeFreeProperty(pProperty);

        if (found) {
            break;
        }
    }

    drmModeFreeObjectProperties(pModeObjectProperties);

    if (!found) {
        Fatal("Unable to find value for property \'%s\'.\n", propName);
    }

    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x2170
movq %rax, -0x30(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x495c
movl -0x4(%rbp), %edi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %esi
callq 0x2150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x490b
leaq 0x2604(%rip), %rdi      # 0x6f08
movb $0x0, %al
callq 0x4cf0
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x8, %rsi
callq 0x2330
cmpl $0x0, %eax
jne 0x493b
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x20(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2240
cmpl $0x0, -0x20(%rbp)
je 0x494c
jmp 0x495c
jmp 0x494e
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x48cd
movq -0x30(%rbp), %rdi
callq 0x2130
cmpl $0x0, -0x20(%rbp)
jne 0x497d
movq -0x18(%rbp), %rsi
leaq 0x25ad(%rip), %rdi      # 0x6f23
movb $0x0, %al
callq 0x4cf0
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/utils.c
// Function: Fatal
void Fatal(const char *format, ...)
{
    va_list ap;

    fprintf(stderr, "ERROR: ");

    va_start(ap, format);
    vfprintf(stderr, format, ap);
    va_end(ap);

    exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x4d25
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
movq 0x429d(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x23bf(%rip), %rsi      # 0x711c
movb $0x0, %al
callq 0x23a0
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0x4261(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x21a0
leaq -0x20(%rbp), %rax
movl $0x1, %edi
callq 0x20d0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/utils.c
// Function: GetTime
float GetTime()
{
    static struct timeval InitialTime = {0, 0};
    if (InitialTime.tv_sec == 0)
    {
        gettimeofday(&InitialTime, NULL);
    }
    struct timeval Now;
    gettimeofday(&Now, NULL);

    struct timeval TimeSinceStart = { Now.tv_sec - InitialTime.tv_sec, Now.tv_usec - InitialTime.tv_usec };

    return (TimeSinceStart.tv_sec + (TimeSinceStart.tv_usec / 1000000.0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpq $0x0, 0x4480(%rip)      # 0x9290
jne 0x4e22
leaq 0x4477(%rip), %rdi      # 0x9290
xorl %eax, %eax
movl %eax, %esi
callq 0x20e0
leaq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20e0
movq -0x10(%rbp), %rax
subq 0x4456(%rip), %rax      # 0x9290
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
subq 0x444f(%rip), %rax      # 0x9298
movq %rax, -0x18(%rbp)
cvtsi2sdq -0x20(%rbp), %xmm0
cvtsi2sdq -0x18(%rbp), %xmm1
movsd 0x2297(%rip), %xmm2     # 0x70f8
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/utils.c
// Function: MakeFPS
fps MakeFPS(char* Name) {
    struct timeval Now;
    gettimeofday(&Now, NULL);
    return (fps){
        .Frames = 0,
        .CurrentSecond = (int)Now.tv_sec,
        .Name = Name
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x18(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x20e0
movl $0x0, -0x10(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/utils.c
// Function: TickFPS
void TickFPS(fps* FPS) {
    struct timeval Now;
    gettimeofday(&Now, NULL);

    FPS->Frames++;

    int NowSecond = Now.tv_sec;
    if (NowSecond > FPS->CurrentSecond) {
        printf("%40s: %i FPS\n", FPS->Name, FPS->Frames);
        FPS->Frames = 0;
        FPS->CurrentSecond = NowSecond;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20e0
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jle 0x4f27
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movl (%rax), %edx
leaq 0x221b(%rip), %rdi      # 0x7127
movb $0x0, %al
callq 0x2050
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/utils.c
// Function: GLCheck
void GLCheck(const char* name) {
    GLenum err = glGetError();
    if (err != GL_NO_ERROR) {
        printf("%s: ", name);
        switch (err) {
            case GL_INVALID_ENUM: printf("Invalid enum\n");
                break;
            case GL_INVALID_VALUE: printf("Invalid value\n");
                break;
            case GL_INVALID_OPERATION: printf("Invalid operation\n");
                break;
            case GL_INVALID_FRAMEBUFFER_OPERATION: printf("Invalid framebuffer op\n");
                break;
            case GL_OUT_OF_MEMORY: printf("GL Out of memory\n");
                break;
        }
        exit(1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x20f0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x4fdf
movq -0x8(%rbp), %rsi
leaq 0x1923(%rip), %rdi      # 0x687c
xorl %eax, %eax
callq 0x2050
movl -0xc(%rbp), %eax
addl $0xfffffb00, %eax       # imm = 0xFFFFFB00
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x6, %eax
ja 0x4fd5
movq -0x18(%rbp), %rax
leaq 0x2182(%rip), %rcx      # 0x7100
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x21a7(%rip), %rdi      # 0x7135
movb $0x0, %al
callq 0x2050
jmp 0x4fd5
leaq 0x21a5(%rip), %rdi      # 0x7143
movb $0x0, %al
callq 0x2050
jmp 0x4fd5
leaq 0x21a4(%rip), %rdi      # 0x7152
movb $0x0, %al
callq 0x2050
jmp 0x4fd5
leaq 0x21a7(%rip), %rdi      # 0x7165
movb $0x0, %al
callq 0x2050
jmp 0x4fd5
leaq 0x21af(%rip), %rdi      # 0x717d
movb $0x0, %al
callq 0x2050
movl $0x1, %edi
callq 0x20d0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/utils.c
// Function: EnableGLDebug
void EnableGLDebug() {
    glDebugMessageCallback(DebugCallback, NULL);
    glDebugMessageControl(GL_DONT_CARE,
        GL_DONT_CARE, GL_DONT_CARE, 0, 0, GL_TRUE);
    glEnable(GL_DEBUG_OUTPUT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq -0x4b(%rip), %rdi       # 0x4ff0
xorl %eax, %eax
movl %eax, %esi
movq 0x3fa2(%rip), %rax      # 0x8fe8
callq *(%rax)
movl $0x1100, %edx           # imm = 0x1100
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
movq 0x3f5f(%rip), %rax      # 0x8fc0
movl %edx, %edi
movl %edx, %esi
callq *(%rax)
movl $0x92e0, %edi           # imm = 0x92E0
callq 0x2040
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/utils.c
// Function: NextPowerOfTwo
int NextPowerOfTwo(int x) {
    x--;
    x |= x >> 1; // handle 2 bit numbers
    x |= x >> 2; // handle 4 bit numbers
    x |= x >> 4; // handle 8 bit numbers
    x |= x >> 8; // handle 16 bit numbers
    x |= x >> 16; // handle 32 bit numbers
    x++;
    return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
sarl %eax
orl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
sarl $0x2, %eax
orl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
sarl $0x4, %eax
orl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
sarl $0x8, %eax
orl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
sarl $0x10, %eax
orl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/hvm.c
// Function: core_dump
void core_dump (struct _vm * vm)
{
    FILE * fh;

    fh = fopen("core", "wb");
    if (fh == NULL)
        return;

    fwrite(vm->mem, 1, 65536, fh);

    fclose(fh);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x5c41(%rip), %rdi      # 0x7004
leaq 0x5c3f(%rip), %rsi      # 0x7009
callq 0x1270
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x13dc
jmp 0x13ff
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x1290
movq -0x10(%rbp), %rdi
callq 0x10e0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/hvm.c
// Function: main
int main (int argc, char * argv [])
{
    struct _vm * vm;
    int error;

    if (argc != 2) {
        fprintf(stderr, "Usage: %s <hvm program>\n", argv[0]);
        return 0;
    }

    signal(SIGINT, int_handler);

    vm = vm_load(argv[1]);
    main_loop = 1;

    while (main_loop) {
        //printf("%s\n", vm_ins_str(vm));
        error = vm_step(vm);
        if (error) {
            switch (error) {
            case VM_HALTED :
                break;
            case VM_BAD_INSTRUCTION :
                printf("VM Encountered Bad Instruction\n");
                printf("%s\n", vm_registers_str(vm));
                break;
            }
            break;
        }
    }

    core_dump(vm);
    vm_destroy(vm);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x1477
movq 0x8ba5(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x5ba8(%rip), %rsi      # 0x700c
movb $0x0, %al
callq 0x11b0
movl $0x0, -0x4(%rbp)
jmp 0x151c
movl $0x2, %edi
leaq -0x73(%rip), %rsi       # 0x1410
callq 0x11a0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5740
movq %rax, -0x18(%rbp)
movl $0x1, 0x8cf9(%rip)      # 0xa19c
cmpl $0x0, 0x8cf2(%rip)      # 0xa19c
je 0x1503
movq -0x18(%rbp), %rdi
callq 0x5c40
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1501
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
subl $0x1, %eax
je 0x14d5
jmp 0x14cb
movl -0x20(%rbp), %eax
subl $0x2, %eax
je 0x14d7
jmp 0x14ff
jmp 0x14ff
leaq 0x5b47(%rip), %rdi      # 0x7025
movb $0x0, %al
callq 0x1120
movq -0x18(%rbp), %rdi
callq 0x5ab0
movq %rax, %rsi
leaq 0x5b4d(%rip), %rdi      # 0x7045
movb $0x0, %al
callq 0x1120
jmp 0x1503
jmp 0x14a3
movq -0x18(%rbp), %rdi
callq 0x13b0
movq -0x18(%rbp), %rdi
callq 0x5820
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/iciamyplant[P]Cub3d-Linux/src/parsing.c
// Function: ft_parsing_map
int		ft_parsing_map(char *fichier, t_recup *recup)
{
	int			fd;
	int			ret;
	char		*str;

	ret = 1;
	str = NULL;
	fd = open(fichier, O_RDONLY);
	if (!(recup->map = malloc(sizeof(char*) * recup->nblines)))
		return (0);
	while (ret != 0)
	{
		ret = get_next_line(fd, &str, recup);
		if (recup->insidemap == 1 && ft_lignevide(str) == 0 &&
				recup->count < recup->nblines)
			recup->lignevide = 1;
		if ((recup->insidemap = ft_is_map(str, recup)) == 1)
		{
			recup->count++;
			ft_copy_map(str, recup);
		}
		free(str);
	}
	close(fd);
	ft_init_sprite(recup);
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x7410
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movslq 0x40(%rax), %rdi
shlq $0x3, %rdi
callq 0x7100
movq -0x18(%rbp), %rcx
movq %rax, 0x48(%rcx)
cmpq $0x0, %rax
jne 0x75ca
movl $0x0, -0x4(%rbp)
jmp 0x7684
jmp 0x75cc
cmpl $0x0, -0x20(%rbp)
je 0x766c
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rdx
leaq -0x28(%rbp), %rsi
callq 0xc020
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x80(%rax)
jne 0x7622
movq -0x28(%rbp), %rdi
callq 0xc910
cmpl $0x0, %eax
jne 0x7622
movq -0x18(%rbp), %rax
movl 0x84(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x40(%rcx), %eax
jge 0x7622
movq -0x18(%rbp), %rax
movl $0x1, 0x7c(%rax)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8580
movq -0x18(%rbp), %rcx
movl %eax, 0x80(%rcx)
cmpl $0x1, %eax
jne 0x765e
movq -0x18(%rbp), %rax
movl 0x84(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x84(%rax)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x83e0
movq -0x28(%rbp), %rdi
callq 0x7190
jmp 0x75cc
movl -0x1c(%rbp), %edi
callq 0x7040
movq -0x18(%rbp), %rdi
callq 0x9400
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/iciamyplant[P]Cub3d-Linux/src/parsing.c
// Function: ft_parsing
void	ft_parsing(char *fichier, t_recup *recup)
{
	int			fd;
	int			ret;
	char		*str;

	ret = 1;
	str = NULL;
	if ((fd = open(fichier, O_DIRECTORY)) != -1)
		ft_error(recup, "Invalide : is a directory\n");
	if ((fd = open(fichier, O_RDONLY)) == -1)
		ft_error(recup, "Fichier .cub invalide\n");
	recup->erreur = 0;
	while (ret != 0)
	{
		ret = get_next_line(fd, &str, recup);
		if (recup->erreur == 2)
			ft_error(recup, "La partie parsing detecte une erreur\n");
		ft_color_resolution(&str, recup);
		ft_texture(str, recup);
		ft_map(str, recup);
		free(str);
	}
	close(fd);
	if (recup->sizeline == 0 || recup->nblines == 0)
		ft_error(recup, "Map absente\n");
	ft_parsing_map(fichier, recup);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x10000, %esi          # imm = 0x10000
movb $0x0, %al
callq 0x7410
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x76d7
movq -0x10(%rbp), %rdi
leaq 0x8932(%rip), %rsi      # 0x10004
callq 0xb730
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x7410
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
jne 0x76fc
movq -0x10(%rbp), %rdi
leaq 0x8928(%rip), %rsi      # 0x1001f
callq 0xb730
movq -0x10(%rbp), %rax
movl $0x0, 0x74(%rax)
cmpl $0x0, -0x18(%rbp)
je 0x776c
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rdx
leaq -0x20(%rbp), %rsi
callq 0xc020
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, 0x74(%rax)
jne 0x773a
movq -0x10(%rbp), %rdi
leaq 0x8901(%rip), %rsi      # 0x10036
callq 0xb730
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x8110
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x7f00
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x86f0
movq -0x20(%rbp), %rdi
callq 0x7190
jmp 0x7707
movl -0x14(%rbp), %edi
callq 0x7040
movq -0x10(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0x7788
movq -0x10(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x7798
movq -0x10(%rbp), %rdi
leaq 0x88c9(%rip), %rsi      # 0x1005c
callq 0xb730
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x7570
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/iciamyplant[P]Cub3d-Linux/src/parsing.c
// Function: ft_cub
int		ft_cub(char *str, t_recup *recup)
{
	int			i;

	i = 0;
	while (str[i] != '\0')
		i++;
	while (str[i] != '.')
	{
		i--;
		if (i == 0)
		{
			ft_error(recup, "Nom de la map invalide\n");
			return (0);
		}
	}
	if (str[i + 1] == 'c' && str[i + 2] == 'u' && str[i + 3] == 'b')
		ft_parsing(str, recup);
	else
		ft_error(recup, "Nom de la map invalide\n");
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x77e3
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x77c7
jmp 0x77e5
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
je 0x7820
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x781e
movq -0x18(%rbp), %rdi
leaq 0x8859(%rip), %rsi      # 0x10069
callq 0xb730
movl $0x0, -0x4(%rbp)
jmp 0x7888
jmp 0x77e5
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x63, %eax
jne 0x7871
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x75, %eax
jne 0x7871
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x62, %eax
jne 0x7871
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x7690
jmp 0x7881
movq -0x18(%rbp), %rdi
leaq 0x87ed(%rip), %rsi      # 0x10069
callq 0xb730
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/iciamyplant[P]Cub3d-Linux/src/parsing.c
// Function: main
int		main(int argc, char **argv)
{
	t_recup recup;

	recup.save = 0;
	ft_initialisation(&recup);
	if (argc == 2 || (argc == 3 && ft_check_save(argv[2]) == 1))
	{
		if (argc == 3)
			recup.save = 1;
		ft_cub(argv[1], &recup);
	}
	else
		write(1, "Error\nArguments invalides\n", 30);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x3c8(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x8980
cmpl $0x2, -0x8(%rbp)
je 0x78ed
cmpl $0x3, -0x8(%rbp)
jne 0x7913
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xbcb0
cmpl $0x1, %eax
jne 0x7913
cmpl $0x3, -0x8(%rbp)
jne 0x78fd
movl $0x1, -0x3c8(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x430(%rbp), %rsi
callq 0x77b0
jmp 0x7929
movl $0x1, %edi
leaq 0x8762(%rip), %rsi      # 0x10081
movl $0x1e, %edx
callq 0x73d0
movl -0x4(%rbp), %eax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop