LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SysEx
static void _MIDI_SysEx
   (
   track *Track
   )

   {
   int length;

   length = _MIDI_ReadDelta( Track );
   
   if (_MIDI_Funcs->SysEx && _MIDI_SongLoaded)
      {
      unsigned char *msg;
      
      msg = (unsigned char *)alloca(length + 1);
      
      msg[0] = MIDI_SYSEX;
      memcpy(&msg[1], Track->pos, length);

      // only send a sysex if it's not a GS reset
      if (memcmp(msg, _GSResetSysex, sizeof(_GSResetSysex)))
         {
         _MIDI_Funcs->SysEx(msg, length + 1);
         }
      }

   Track->pos += length;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xcaf0
movl %eax, -0xc(%rbp)
movq 0x12519(%rip), %rax     # 0x1f0a8
cmpq $0x0, 0x58(%rax)
je 0xcc0b
cmpl $0x0, 0x1251b(%rip)     # 0x1f0b8
je 0xcc0b
movslq -0xc(%rbp), %rcx
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $-0x10, (%rax)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movslq -0xc(%rbp), %rdx
callq 0x2180
movq -0x18(%rbp), %rdi
leaq 0x2e9d(%rip), %rsi      # 0xfa80
movl $0xb, %edx
callq 0x20e0
cmpl $0x0, %eax
je 0xcc09
movq 0x124af(%rip), %rax     # 0x1f0a8
movq 0x58(%rax), %rax
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
addl $0x1, %esi
callq *%rax
jmp 0xcc0b
movl -0xc(%rbp), %edx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, 0x8(%rax)
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_AdvanceTick
static void _MIDI_AdvanceTick
   (
   void
   )

   {
   _MIDI_PositionInTicks++;
   _MIDI_Time += _MIDI_FPSecondsPerTick;

   _MIDI_Tick++;
   while( _MIDI_Tick > _MIDI_TicksPerBeat )
      {
      _MIDI_Tick -= _MIDI_TicksPerBeat;
      _MIDI_Beat++;
      }
   while( _MIDI_Beat > _MIDI_BeatsPerMeasure )
      {
      _MIDI_Beat -= _MIDI_BeatsPerMeasure;
      _MIDI_Measure++;
      }
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x11d6e(%rip), %eax     # 0x1f0e8
addl $0x1, %eax
movl %eax, 0x11d65(%rip)     # 0x1f0e8
movl 0x11d5b(%rip), %eax     # 0x1f0e4
addl 0x11d61(%rip), %eax     # 0x1f0f0
movl %eax, 0x11d5b(%rip)     # 0x1f0f0
movl 0x11d59(%rip), %eax     # 0x1f0f4
addl $0x1, %eax
movl %eax, 0x11d50(%rip)     # 0x1f0f4
movl 0x11d4a(%rip), %eax     # 0x1f0f4
cmpl 0x11dd4(%rip), %eax     # 0x1f184
jle 0xd3d7
movl 0x11dcc(%rip), %ecx     # 0x1f184
movl 0x11d36(%rip), %eax     # 0x1f0f4
subl %ecx, %eax
movl %eax, 0x11d2e(%rip)     # 0x1f0f4
movl 0x8898(%rip), %eax      # 0x15c64
addl $0x1, %eax
movl %eax, 0x888f(%rip)      # 0x15c64
jmp 0xd3a4
jmp 0xd3d9
movl 0x8885(%rip), %eax      # 0x15c64
cmpl 0x11d9b(%rip), %eax     # 0x1f180
jle 0xd40c
movl 0x11d93(%rip), %ecx     # 0x1f180
movl 0x8871(%rip), %eax      # 0x15c64
subl %ecx, %eax
movl %eax, 0x8869(%rip)      # 0x15c64
movl 0x8867(%rip), %eax      # 0x15c68
addl $0x1, %eax
movl %eax, 0x885e(%rip)      # 0x15c68
jmp 0xd3d9
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_sdl.c
// Function: SDLDrv_ErrorString
const char *SDLDrv_ErrorString( int ErrorNumber )
{
    const char *ErrorString;
	
    switch( ErrorNumber ) {
        case SDLErr_Warning :
        case SDLErr_Error :
            ErrorString = SDLDrv_ErrorString( ErrorCode );
            break;

        case SDLErr_Ok :
            ErrorString = "SDL Audio ok.";
            break;
			
        case SDLErr_Uninitialised:
            ErrorString = "SDL Audio uninitialised.";
            break;

        case SDLErr_InitSubSystem:
            ErrorString = "SDL Audio: error in Init or InitSubSystem.";
            break;

        case SDLErr_OpenAudio:
            ErrorString = "SDL Audio: error in OpenAudio.";
            break;
            
        case SDLErr_CDOpen:
            ErrorString = "SDL CD: error opening cd device.";
            break;
        
        case SDLErr_CDCannotPlayTrack:
            ErrorString = "SDL CD: cannot play the requested track.";
            break;
            
        case SDLErr_CDCreateSemaphore:
            ErrorString = "SDL CD: could not create looped CD playback semaphore.";
            break;
        
        case SDLErr_CDCreateThread:
            ErrorString = "SDL CD: could not create looped CD playback thread.";
            break;

        case SDLErr_CDNotSupported:
            ErrorString = "SDL CD is not supported";
            break;

        default:
            ErrorString = "Unknown SDL Audio error code.";
            break;
    }

    return ErrorString;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $0x2, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0xa, %eax
ja 0xd7ed
movq -0x18(%rbp), %rax
leaq 0x2341(%rip), %rcx      # 0xfa9c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x11a26(%rip), %edi     # 0x1f190
callq 0xd730
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x2349(%rip), %rax      # 0xfac8
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x234a(%rip), %rax      # 0xfad6
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x2356(%rip), %rax      # 0xfaef
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x2374(%rip), %rax      # 0xfb1a
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x2386(%rip), %rax      # 0xfb39
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x239a(%rip), %rax      # 0xfb5a
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x23b6(%rip), %rax      # 0xfb83
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x23e0(%rip), %rax      # 0xfbba
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x2407(%rip), %rax      # 0xfbee
movq %rax, -0x10(%rbp)
jmp 0xd7f8
leaq 0x2412(%rip), %rax      # 0xfc06
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_sdl.c
// Function: SDLDrv_PCM_Shutdown
void SDLDrv_PCM_Shutdown(void)
{
    if (!Initialised) {
        return;
    }

    if (StartedSDLInit & SDL_INIT_AUDIO) {
        SDL_QuitSubSystem(SDL_INIT_AUDIO);
        StartedSDLInit &= ~SDL_INIT_AUDIO;
    }

    if (StartedSDLInit == 0x80000000) {
        SDL_Quit();
        StartedSDLInit = 0;
    }

    StartedSDL &= ~SDL_INIT_AUDIO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x11609(%rip)     # 0x1f194
jne 0xdb8f
jmp 0xdbe0
movl 0x11603(%rip), %eax     # 0x1f198
andl $0x10, %eax
cmpl $0x0, %eax
je 0xdbb6
movl $0x10, %edi
callq 0x2240
movl 0x115eb(%rip), %eax     # 0x1f198
andl $-0x11, %eax
movl %eax, 0x115e2(%rip)     # 0x1f198
cmpl $0x80000000, 0x115d8(%rip) # imm = 0x80000000
jne 0xdbd1
callq 0x2060
movl $0x0, 0x115c7(%rip)     # 0x1f198
movl 0x115c5(%rip), %eax     # 0x1f19c
andl $-0x11, %eax
movl %eax, 0x115bc(%rip)     # 0x1f19c
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_sdl.c
// Function: fillData
static void fillData(void * userdata, Uint8 * ptr, int remaining)
{
    int len;
    char *sptr;

    (void)userdata;

    while (remaining > 0) {
        if (MixBufferUsed == MixBufferSize) {
            MixCallBack();
            
            MixBufferUsed = 0;
            MixBufferCurrent++;
            if (MixBufferCurrent >= MixBufferCount) {
                MixBufferCurrent -= MixBufferCount;
            }
        }
        
        while (remaining > 0 && MixBufferUsed < MixBufferSize) {
            sptr = MixBuffer + (MixBufferCurrent * MixBufferSize) + MixBufferUsed;
            
            len = MixBufferSize - MixBufferUsed;
            if (remaining < len) {
                len = remaining;
            }
            
            memcpy(ptr, sptr, len);
            
            ptr += len;
            MixBufferUsed += len;
            remaining -= len;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0xdd14
movl 0x115a9(%rip), %eax     # 0x1f1bc
cmpl 0x11597(%rip), %eax     # 0x1f1b0
jne 0xdc5e
callq *0x1159f(%rip)          # 0x1f1c0
movl $0x0, 0x11591(%rip)     # 0x1f1bc
movl 0x11587(%rip), %eax     # 0x1f1b8
addl $0x1, %eax
movl %eax, 0x1157e(%rip)     # 0x1f1b8
movl 0x11578(%rip), %eax     # 0x1f1b8
cmpl 0x1156e(%rip), %eax     # 0x1f1b4
jl 0xdc5c
movl 0x11566(%rip), %ecx     # 0x1f1b4
movl 0x11564(%rip), %eax     # 0x1f1b8
subl %ecx, %eax
movl %eax, 0x1155c(%rip)     # 0x1f1b8
jmp 0xdc5e
jmp 0xdc60
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x21(%rbp)
jle 0xdc7d
movl 0x1154b(%rip), %eax     # 0x1f1bc
cmpl 0x11539(%rip), %eax     # 0x1f1b0
setl %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xdc89
jmp 0xdd0f
movq 0x11518(%rip), %rax     # 0x1f1a8
movl 0x11522(%rip), %ecx     # 0x1f1b8
imull 0x11513(%rip), %ecx     # 0x1f1b0
movslq %ecx, %rcx
addq %rcx, %rax
movslq 0x11512(%rip), %rcx     # 0x1f1bc
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl 0x114f9(%rip), %eax     # 0x1f1b0
subl 0x114ff(%rip), %eax     # 0x1f1bc
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xdcce
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movslq -0x18(%rbp), %rdx
callq 0x2180
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x18(%rbp), %eax
addl 0x114c3(%rip), %eax     # 0x1f1bc
movl %eax, 0x114bd(%rip)     # 0x1f1bc
movl -0x18(%rbp), %ecx
movl -0x14(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x14(%rbp)
jmp 0xdc60
jmp 0xdc03
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_sdl.c
// Function: SDLDrv_PCM_BeginPlayback
int SDLDrv_PCM_BeginPlayback(char *BufferStart, int BufferSize,
						int NumDivisions, void ( *CallBackFunc )( void ) )
{
    if (!Initialised) {
        ErrorCode = SDLErr_Uninitialised;
        return SDLErr_Error;
    }
    
    if (Playing) {
        SDLDrv_PCM_StopPlayback();
    }

    MixBuffer = BufferStart;
    MixBufferSize = BufferSize;
    MixBufferCount = NumDivisions;
    MixBufferCurrent = 0;
    MixBufferUsed = 0;
    MixCallBack = CallBackFunc;
    
    // prime the buffer
    MixCallBack();

    SDL_PauseAudio(0);
    
    Playing = 1;
    
    return SDLErr_Ok;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpl $0x0, 0x11457(%rip)     # 0x1f194
jne 0xdd52
movl $0x1, 0x11447(%rip)     # 0x1f190
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xddba
cmpl $0x0, 0x11447(%rip)     # 0x1f1a0
je 0xdd60
callq 0xddd0
movq -0x10(%rbp), %rax
movq %rax, 0x1143d(%rip)     # 0x1f1a8
movl -0x14(%rbp), %eax
movl %eax, 0x1143c(%rip)     # 0x1f1b0
movl -0x18(%rbp), %eax
movl %eax, 0x11437(%rip)     # 0x1f1b4
movl $0x0, 0x11431(%rip)     # 0x1f1b8
movl $0x0, 0x1142b(%rip)     # 0x1f1bc
movq -0x20(%rbp), %rax
movq %rax, 0x11424(%rip)     # 0x1f1c0
callq *0x1141e(%rip)          # 0x1f1c0
xorl %edi, %edi
callq 0x2170
movl $0x1, 0x113ed(%rip)     # 0x1f1a0
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/jonof[P]jfaudiolib/src/driver_sdl.c
// Function: SDLDrv_PCM_StopPlayback
void SDLDrv_PCM_StopPlayback(void)
{
    if (!Initialised || !Playing) {
        return;
    }

    SDL_PauseAudio(1);
	
    Playing = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x113b9(%rip)     # 0x1f194
je 0xdde6
cmpl $0x0, 0x113bc(%rip)     # 0x1f1a0
jne 0xdde8
jmp 0xddfc
movl $0x1, %edi
callq 0x2170
movl $0x0, 0x113a4(%rip)     # 0x1f1a0
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: ALSADrv_ErrorString
const char *ALSADrv_ErrorString( int ErrorNumber )
{
	const char *ErrorString;
	
    switch( ErrorNumber )
	{
        case ALSAErr_Warning :
        case ALSAErr_Error :
            ErrorString = ALSADrv_ErrorString( ErrorCode );
            break;

        case ALSAErr_Ok :
            ErrorString = "ALSA ok.";
            break;
			
		case ALSAErr_Uninitialised:
			ErrorString = "ALSA uninitialised.";
			break;

        case ALSAErr_SeqOpen:
            ErrorString = "ALSA error: failed in snd_seq_open.\n";
            break;

        case ALSAErr_CreateSimplePort:
            ErrorString = "ALSA error: failed in snd_seq_create_simple_port.\n";
            break;

        case ALSAErr_AllocQueue:
            ErrorString = "ALSA error: failed in snd_seq_alloc_queue.\n";
            break;

        case ALSAErr_ConnectTo:
            ErrorString = "ALSA error: failed in snd_seq_connect_to.\n";
            break;

        default:
            ErrorString = "Unknown ALSA error.";
            break;
    }
        
	return ErrorString;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $0x2, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x7, %eax
ja 0xdf4f
movq -0x18(%rbp), %rax
leaq 0x1de1(%rip), %rcx      # 0xfcc8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x112d2(%rip), %edi     # 0x1f1c8
callq 0xdec0
movq %rax, -0x10(%rbp)
jmp 0xdf5a
leaq 0x1df0(%rip), %rax      # 0xfcf8
movq %rax, -0x10(%rbp)
jmp 0xdf5a
leaq 0x1dec(%rip), %rax      # 0xfd01
movq %rax, -0x10(%rbp)
jmp 0xdf5a
leaq 0x1df3(%rip), %rax      # 0xfd15
movq %rax, -0x10(%rbp)
jmp 0xdf5a
leaq 0x1e0b(%rip), %rax      # 0xfd3a
movq %rax, -0x10(%rbp)
jmp 0xdf5a
leaq 0x1e31(%rip), %rax      # 0xfd6d
movq %rax, -0x10(%rbp)
jmp 0xdf5a
leaq 0x1e50(%rip), %rax      # 0xfd99
movq %rax, -0x10(%rbp)
jmp 0xdf5a
leaq 0x1e6e(%rip), %rax      # 0xfdc4
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: ALSADrv_MIDI_Shutdown
void ALSADrv_MIDI_Shutdown(void)
{
    ALSADrv_MIDI_HaltPlayback();
    
    if (seq_queue >= 0) {
        snd_seq_free_queue(seq, seq_queue);
    }
    if (seq_port >= 0) {
        snd_seq_delete_simple_port(seq, seq_port);
    }
    if (seq) {
        snd_seq_close(seq);
    }
    seq_queue = -1;
    seq_port = -1;
    seq = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0xe490
cmpl $0x0, 0x7b0c(%rip)      # 0x15c7c
jl 0xe184
movq 0x11057(%rip), %rdi     # 0x1f1d0
movl 0x7afd(%rip), %esi      # 0x15c7c
callq 0x2150
cmpl $0x0, 0x7aed(%rip)      # 0x15c78
jl 0xe19f
movq 0x1103c(%rip), %rdi     # 0x1f1d0
movl 0x7ade(%rip), %esi      # 0x15c78
callq 0x2320
cmpq $0x0, 0x11029(%rip)     # 0x1f1d0
je 0xe1b5
movq 0x11020(%rip), %rdi     # 0x1f1d0
callq 0x22a0
movl $0xffffffff, 0x7abd(%rip) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x7aaf(%rip) # imm = 0xFFFFFFFF
movq $0x0, 0x10ffc(%rip) # 0x1f1d0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: ALSADrv_MIDI_HaltPlayback
void ALSADrv_MIDI_HaltPlayback(void)
{
    void * ret;
    
    if (!threadRunning) {
        return;
    }

    threadQuit = 1;

    if (pthread_join(thread, &ret)) {
        ASS_Message("ALSADrv: pthread_join returned error\n");
    }

    ALSADrv_MIDI_QueueStop();

    threadRunning = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x10d51(%rip)     # 0x1f1f0
jne 0xe4a3
jmp 0xe4df
movl $0x1, 0x10d33(%rip)     # 0x1f1e0
movq 0x10d34(%rip), %rdi     # 0x1f1e8
leaq -0x8(%rbp), %rsi
callq 0x2190
cmpl $0x0, %eax
je 0xe4d0
leaq 0x19f0(%rip), %rdi      # 0xfeb9
movb $0x0, %al
callq 0xd640
callq 0xe730
movl $0x0, 0x10d11(%rip)     # 0x1f1f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: ALSADrv_MIDI_StartPlayback
int ALSADrv_MIDI_StartPlayback(void (*service)(void))
{
    ALSADrv_MIDI_HaltPlayback();

    threadService = service;
    threadQuit = 0;

    ALSADrv_MIDI_QueueStart();

    if (pthread_create(&thread, NULL, threadProc, NULL)) {
        ASS_Message("ALSADrv: pthread_create returned error\n");

        ALSADrv_MIDI_HaltPlayback();
        
        return ALSAErr_PlayThread;
    }

    threadRunning = 1;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
callq 0xe490
movq -0x10(%rbp), %rax
movq %rax, 0x10ccc(%rip)     # 0x1f1d8
movl $0x0, 0x10cca(%rip)     # 0x1f1e0
callq 0xe570
leaq 0x10cc6(%rip), %rdi     # 0x1f1e8
xorl %eax, %eax
movl %eax, %ecx
leaq 0xe3(%rip), %rdx        # 0xe610
movq %rcx, %rsi
callq 0x2380
cmpl $0x0, %eax
je 0xe556
leaq 0x1950(%rip), %rdi      # 0xfe91
movb $0x0, %al
callq 0xd640
callq 0xe490
movl $0x8, -0x4(%rbp)
jmp 0xe567
movl $0x1, 0x10c90(%rip)     # 0x1f1f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: ALSADrv_MIDI_QueueStart
void ALSADrv_MIDI_QueueStart(void)
{
    int result;

    if (!queueRunning) {
        result = snd_seq_start_queue(seq, seq_queue, NULL);
        if (result < 0) {
            ASS_Message("ALSADrv: snd_seq_start_queue err %d\n", result);
        }

        while ((result = snd_seq_drain_output(seq)) > 0);
        if (result < 0) {
            ASS_Message("ALSADrv: could not drain output: err %d\n", result);
        }

        snd_seq_sync_output_queue(seq);

        queueRunning = 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x10c79(%rip)     # 0x1f1f8
jne 0xe5fe
movq 0x10c48(%rip), %rdi     # 0x1f1d0
movl 0x76ee(%rip), %esi      # 0x15c7c
movl $0x1e, %edx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x2210
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0xe5b9
movl -0x4(%rbp), %esi
leaq 0x192d(%rip), %rdi      # 0xfedf
movb $0x0, %al
callq 0xd640
jmp 0xe5bb
movq 0x10c0e(%rip), %rdi     # 0x1f1d0
callq 0x2370
movl %eax, -0x4(%rbp)
cmpl $0x0, %eax
jle 0xe5d1
jmp 0xe5bb
cmpl $0x0, -0x4(%rbp)
jge 0xe5e8
movl -0x4(%rbp), %esi
leaq 0x1923(%rip), %rdi      # 0xff04
movb $0x0, %al
callq 0xd640
movq 0x10be1(%rip), %rdi     # 0x1f1d0
callq 0x2070
movl $0x1, 0x10bfa(%rip)     # 0x1f1f8
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: threadProc
static void * threadProc(void * parm)
{
    struct timeval tv;
    int sleepAmount = 1000000 / THREAD_QUEUE_INTERVAL;
    unsigned int sequenceTime;

    (void)parm;

    // prime the pump
    threadTimer = get_tick();
    threadQueueTimer = threadTimer + threadQueueTicks;
    while (threadTimer < threadQueueTimer) {
        if (threadService) {
            threadService();
        }
        threadTimer++;
    }
    
    while (!threadQuit) {
        tv.tv_sec = 0;
        tv.tv_usec = sleepAmount;

        select(0, NULL, NULL, NULL, &tv);

        sequenceTime = get_tick();

        sleepAmount = 1000000 / THREAD_QUEUE_INTERVAL;
        if ((int)(threadTimer - sequenceTime) > threadQueueTicks) {
            // we're running ahead, so sleep for half the usual
            // amount and try again
            sleepAmount /= 2;
            continue;
        }

        threadQueueTimer = sequenceTime + threadQueueTicks;
        while (threadTimer < threadQueueTimer) {
            if (threadService) {
                threadService();
            }
            threadTimer++;
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0xc350, -0x1c(%rbp)    # imm = 0xC350
callq 0xe9b0
movl %eax, 0x10bce(%rip)     # 0x1f1fc
movl 0x10bc8(%rip), %eax     # 0x1f1fc
addl 0x10bba(%rip), %eax     # 0x1f1f4
movl %eax, 0x10bc0(%rip)     # 0x1f200
movl 0x10bb6(%rip), %eax     # 0x1f1fc
cmpl 0x10bb4(%rip), %eax     # 0x1f200
jae 0xe66f
cmpq $0x0, 0x10b82(%rip)     # 0x1f1d8
je 0xe65e
callq *0x10b7a(%rip)          # 0x1f1d8
movl 0x10b98(%rip), %eax     # 0x1f1fc
addl $0x1, %eax
movl %eax, 0x10b8f(%rip)     # 0x1f1fc
jmp 0xe640
jmp 0xe671
movl 0x10b69(%rip), %eax     # 0x1f1e0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe688
jmp 0xe720
movq $0x0, -0x18(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0x10(%rbp)
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x18(%rbp), %r8
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x21d0
callq 0xe9b0
movl %eax, -0x20(%rbp)
movl $0xc350, -0x1c(%rbp)    # imm = 0xC350
movl 0x10b3a(%rip), %eax     # 0x1f1fc
subl -0x20(%rbp), %eax
cmpl 0x10b29(%rip), %eax     # 0x1f1f4
jle 0xe6dd
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x1c(%rbp)
jmp 0xe671
movl -0x20(%rbp), %eax
addl 0x10b0e(%rip), %eax     # 0x1f1f4
movl %eax, 0x10b14(%rip)     # 0x1f200
movl 0x10b0a(%rip), %eax     # 0x1f1fc
cmpl 0x10b08(%rip), %eax     # 0x1f200
jae 0xe71b
cmpq $0x0, 0x10ad6(%rip)     # 0x1f1d8
je 0xe70a
callq *0x10ace(%rip)          # 0x1f1d8
movl 0x10aec(%rip), %eax     # 0x1f1fc
addl $0x1, %eax
movl %eax, 0x10ae3(%rip)     # 0x1f1fc
jmp 0xe6ec
jmp 0xe671
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: ALSADrv_MIDI_QueueStop
void ALSADrv_MIDI_QueueStop(void)
{
    int result;

    if (queueRunning) {
        result = snd_seq_stop_queue(seq, seq_queue, NULL);
        if (result < 0) {
            ASS_Message("ALSADrv: snd_seq_stop_queue err %d\n", result);
        }

        while ((result = snd_seq_drop_output(seq)) > 0);
        if (result < 0) {
            ASS_Message("ALSADrv: could not drop output: err %d\n", result);
        }

        snd_seq_sync_output_queue(seq);

        queueRunning = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x10ab9(%rip)     # 0x1f1f8
je 0xe7be
movq 0x10a88(%rip), %rdi     # 0x1f1d0
movl 0x752e(%rip), %esi      # 0x15c7c
movl $0x20, %edx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x2210
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0xe779
movl -0x4(%rbp), %esi
leaq 0x17bb(%rip), %rdi      # 0xff2d
movb $0x0, %al
callq 0xd640
jmp 0xe77b
movq 0x10a4e(%rip), %rdi     # 0x1f1d0
callq 0x20f0
movl %eax, -0x4(%rbp)
cmpl $0x0, %eax
jle 0xe791
jmp 0xe77b
cmpl $0x0, -0x4(%rbp)
jge 0xe7a8
movl -0x4(%rbp), %esi
leaq 0x17b0(%rip), %rdi      # 0xff51
movb $0x0, %al
callq 0xd640
movq 0x10a21(%rip), %rdi     # 0x1f1d0
callq 0x2070
movl $0x0, 0x10a3a(%rip)     # 0x1f1f8
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: ALSADrv_MIDI_SetTempo
void ALSADrv_MIDI_SetTempo(int tempo, int division)
{
    double tps;
    snd_seq_queue_tempo_t * t;

    ALSADrv_MIDI_QueueStop();

    snd_seq_queue_tempo_alloca(&t);
    snd_seq_queue_tempo_set_tempo(t, 60000000 / tempo);
    snd_seq_queue_tempo_set_ppq(t, division);
    snd_seq_set_queue_tempo(seq, seq_queue, t);

    tps = ( (double) tempo * (double) division ) / 60.0;
    threadQueueTicks = (int) ceil(tps / (double) THREAD_QUEUE_INTERVAL);

    ALSADrv_MIDI_QueueStart();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
callq 0xe730
callq 0x2160
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x2160
movq -0x20(%rbp), %rdi
movq %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x18(%rbp), %rdi
movl $0x3938700, %eax        # imm = 0x3938700
cltd
idivl -0x4(%rbp)
movl %eax, %esi
callq 0x21e0
movq -0x18(%rbp), %rdi
movl -0x8(%rbp), %esi
callq 0x22e0
movq 0x1098e(%rip), %rdi     # 0x1f1d0
movl 0x7434(%rip), %esi      # 0x15c7c
movq -0x18(%rbp), %rdx
callq 0x2390
cvtsi2sdl -0x4(%rbp), %xmm0
cvtsi2sdl -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x1489(%rip), %xmm1     # 0xfcf0
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x146b(%rip), %xmm1     # 0xfce8
divsd %xmm1, %xmm0
callq 0x20a0
cvttsd2si %xmm0, %eax
movl %eax, 0x10964(%rip)     # 0x1f1f4
callq 0xe570
movq %rbp, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: sequence_event
static inline void sequence_event(snd_seq_event_t * ev)
{
    int result = 0;
    
    snd_seq_ev_set_subs(ev);
    snd_seq_ev_set_source(ev, seq_port);
    snd_seq_ev_schedule_tick(ev, seq_queue, 0, threadTimer);
    result = snd_seq_event_output(seq, ev);
    if (result < 0) {
        ASS_Message("ALSADrv: could not queue event: err %d\n", result);
    } else {
        while ((result = snd_seq_drain_output(seq)) > 0) ;
        if (result < 0) {
            ASS_Message("ALSADrv: could not drain output: err %d\n", result);
        }

        snd_seq_sync_output_queue(seq);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb $-0x2, 0xe(%rax)
movq -0x8(%rbp), %rax
movb $-0x3, 0xf(%rax)
movl 0x738f(%rip), %eax      # 0x15c78
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xd(%rax)
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %ecx
andl $-0x4, %ecx
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %ecx
orl $0x0, %ecx
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %ecx
orl $0x0, %ecx
movb %cl, 0x1(%rax)
movl 0x108da(%rip), %ecx     # 0x1f1fc
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x734d(%rip), %eax      # 0x15c7c
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movq 0x10891(%rip), %rdi     # 0x1f1d0
movq -0x8(%rbp), %rsi
callq 0x2260
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0xe964
movl -0xc(%rbp), %esi
leaq 0x161e(%rip), %rdi      # 0xff79
movb $0x0, %al
callq 0xd640
jmp 0xe99f
jmp 0xe966
movq 0x10863(%rip), %rdi     # 0x1f1d0
callq 0x2370
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jle 0xe97c
jmp 0xe966
cmpl $0x0, -0xc(%rbp)
jge 0xe993
movl -0xc(%rbp), %esi
leaq 0x1578(%rip), %rdi      # 0xff04
movb $0x0, %al
callq 0xd640
movq 0x10836(%rip), %rdi     # 0x1f1d0
callq 0x2070
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/driver_alsa.c
// Function: get_tick
static unsigned int get_tick(void)
{
    snd_seq_queue_status_t * status;
    int result;

    snd_seq_queue_status_alloca(&status);
    
    result = snd_seq_get_queue_status(seq, seq_queue, status);
    if (result < 0) {
        ASS_Message("ALSADrv: snd_seq_get_queue_status err %d\n", result);
        return 0;
    }

    return (unsigned int) snd_seq_queue_status_get_tick_time(status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x20c0
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x20c0
movq -0x20(%rbp), %rdi
movq %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq 0x107d9(%rip), %rdi     # 0x1f1d0
movl 0x727f(%rip), %esi      # 0x15c7c
movq -0x10(%rbp), %rdx
callq 0x23a0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xea29
movl -0x14(%rbp), %esi
leaq 0x1588(%rip), %rdi      # 0xffa1
movb $0x0, %al
callq 0xd640
movl $0x0, -0x4(%rbp)
jmp 0xea35
movq -0x10(%rbp), %rdi
callq 0x2280
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/main.c
// Function: main
void main(void)
{
	setup_serial();
	setup_vga();
	setup_misc();
	setup_ints();
	setup_memory();
	setup_buddy();
	setup_paging();
	setup_alloc();
	setup_time();
	setup_threading();
	setup_vfs();

	/* start first real kernel thread */
	create_kthread(&start, 0);
	local_preempt_enable();
	idle();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0xffffffff8010f940
callq 0xffffffff80101490
callq 0xffffffff8010f220
callq 0xffffffff80104bb0
callq 0xffffffff80103970
callq 0xffffffff80103b20
callq 0xffffffff80106040
callq 0xffffffff80107600
callq 0xffffffff801090e0
callq 0xffffffff80108ab0
callq 0xffffffff8010aaf0
leaq 0x1e(%rip), %rdi        # 0xffffffff80100da0
xorl %eax, %eax
movl %eax, %esi
callq 0xffffffff80108320
callq 0xffffffff80100e00
callq 0xffffffff80107e90
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/main.c
// Function: start
static int start(void *dummy)
{
	(void) dummy;

	setup_ramfs();
	setup_initramfs();
	setup_ide(); // we aren't going to use it in near future
	test_threading();
	test_page_fault();
	test_exec();

	DBG_INFO("Jump to userspace!!!");
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
callq 0xffffffff8010bec0
callq 0xffffffff8010f4d0
callq 0xffffffff8010e4b0
callq 0xffffffff80100e10
callq 0xffffffff80100ed0
callq 0xffffffff801010e0
leaq 0x11373(%rip), %rdi     # 0xffffffff80112144
leaq 0x11370(%rip), %rsi     # 0xffffffff80112148
movl $0x59, %edx
leaq 0x1136b(%rip), %rcx     # 0xffffffff8011214f
movb $0x0, %al
callq 0xffffffff80101e60
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/main.c
// Function: test_threading
static void test_threading(void)
{
	DBG_INFO("start threading test");
	for (int i = 0; i != 10000; ++i) {
		const pid_t pid = create_kthread(&test_function, 0);

		DBG_ASSERT(pid >= 0);
		wait(pid);
	}
	DBG_INFO("finish threading test");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x11325(%rip), %rdi     # 0xffffffff80112144
leaq 0x11322(%rip), %rsi     # 0xffffffff80112148
movl $0x1a, %edx
leaq 0x11332(%rip), %rcx     # 0xffffffff80112164
movb $0x0, %al
callq 0xffffffff80101e60
movl $0x0, -0x4(%rbp)
cmpl $0x2710, -0x4(%rbp)     # imm = 0x2710
je 0xffffffff80100ea9
leaq 0x320(%rip), %rdi       # 0xffffffff80101170
xorl %eax, %eax
movl %eax, %esi
callq 0xffffffff80108320
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jge 0xffffffff80100e93
leaq 0x1130e(%rip), %rdi     # 0xffffffff80112179
leaq 0x112d6(%rip), %rsi     # 0xffffffff80112148
movl $0x1e, %edx
leaq 0x112ff(%rip), %rcx     # 0xffffffff8011217d
leaq 0x1130c(%rip), %r8      # 0xffffffff80112191
movb $0x0, %al
callq 0xffffffff80101e60
callq 0xffffffff80111cd0
jmp 0xffffffff80100e91
jmp 0xffffffff80100e95
movq -0x10(%rbp), %rdi
callq 0xffffffff80108790
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xffffffff80100e40
leaq 0x11294(%rip), %rdi     # 0xffffffff80112144
leaq 0x11291(%rip), %rsi     # 0xffffffff80112148
movl $0x21, %edx
leaq 0x112d7(%rip), %rcx     # 0xffffffff8011219a
movb $0x0, %al
callq 0xffffffff80101e60
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/main.c
// Function: test_exec
static void test_exec(void)
{
	static const char test[] = "/initramfs/test";
	const char *argv[] = { test, 0 };

	const int rc = exec(1, argv);

	if (rc)
		DBG_ERR("exec failed with error %s", errstr(rc));
	else
		DBG_INFO("exec finished successfully");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x16e81(%rip), %rax     # 0xffffffff80117f70
movq %rax, -0x10(%rbp)
movq 0x16e7e(%rip), %rax     # 0xffffffff80117f78
movq %rax, -0x8(%rbp)
leaq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0xffffffff80110f60
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xffffffff80101143
movl -0x14(%rbp), %edi
callq 0xffffffff8010d240
movq %rax, %r8
leaq 0x11052(%rip), %rdi     # 0xffffffff80112179
leaq 0x1101a(%rip), %rsi     # 0xffffffff80112148
movl $0x2c, %edx
leaq 0x110db(%rip), %rcx     # 0xffffffff80112215
movb $0x0, %al
callq 0xffffffff80101e60
jmp 0xffffffff80101164
leaq 0x10ffa(%rip), %rdi     # 0xffffffff80112144
leaq 0x10ff7(%rip), %rsi     # 0xffffffff80112148
movl $0x2e, %edx
leaq 0x110d2(%rip), %rcx     # 0xffffffff8011222f
movb $0x0, %al
callq 0xffffffff80101e60
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/list.c
// Function: list_size
size_t list_size(const struct list_head *head)
{
	size_t size = 0;

	for (const struct list_head *pos = head->next; pos != head;
		pos = pos->next)
		++size;
	return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x8(%rbp), %rax
je 0xffffffff801013ce
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xffffffff801013ab
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/console.c
// Function: console_write
void console_write(const char *str, unsigned long size)
{
	const struct list_head * const end = &consoles;
	struct list_head *pos = consoles.next;

	for (; pos != end; pos = pos->next) {
		struct console *console = LIST_ENTRY(pos, struct console, link);

		console->write(str, size);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x166d9(%rip), %rax     # 0xffffffff80117b20
movq %rax, -0x18(%rbp)
movq 0x166ce(%rip), %rax     # 0xffffffff80117b20
movq %rax, -0x20(%rbp)
leaq 0x166c3(%rip), %rax     # 0xffffffff80117b20
cmpq %rax, -0x20(%rbp)
je 0xffffffff8010148a
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xffffffff80101456
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/vga.c
// Function: vga_putchar
static void vga_putchar(int c)
{
	static const int TAB_WIDTH = 8;

	const unsigned pos = 2 * (row * COLS + col);

	switch (c) {
	default:
		*(VGAMEM + pos) = c;
		*(VGAMEM + pos + 1) = CATTR;

		if (++col != COLS)
			return;
	case '\n':
		row = (row + 1) % ROWS;
		vga_newline();
	case '\r':
		col = 0;
		break;
	case '\t':
		for (int i = 0; i != TAB_WIDTH; ++i)
			vga_putchar(' ');
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl 0x1eaa7(%rip), %ecx     # 0xffffffff80120018
movl %ecx, %eax
leal (%rax,%rax,4), %eax
shll $0x4, %eax
movl 0x1ea9d(%rip), %ecx     # 0xffffffff8012001c
addl %ecx, %eax
addl %eax, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x10(%rbp)
subl $0x9, %eax
je 0xffffffff80101616
jmp 0xffffffff80101597
movl -0x10(%rbp), %eax
subl $0xa, %eax
je 0xffffffff801015ee
jmp 0xffffffff801015a1
movl -0x10(%rbp), %eax
subl $0xd, %eax
je 0xffffffff8010160a
jmp 0xffffffff801015ab
movl -0x4(%rbp), %eax
movb %al, %dl
movl -0x8(%rbp), %eax
movl %eax, %ecx
movabsq $-0x7ffffff48000, %rax # imm = 0xFFFF8000000B8000
movb %dl, (%rax,%rcx)
movl -0x8(%rbp), %eax
movl %eax, %ecx
movabsq $-0x7ffffff48000, %rax # imm = 0xFFFF8000000B8000
movb $0x7, 0x1(%rax,%rcx)
movl 0x1ea40(%rip), %eax     # 0xffffffff8012001c
addl $0x1, %eax
movl %eax, 0x1ea37(%rip)     # 0xffffffff8012001c
cmpl $0x50, %eax
je 0xffffffff801015ec
jmp 0xffffffff8010163a
jmp 0xffffffff801015ee
movl 0x1ea24(%rip), %eax     # 0xffffffff80120018
addl $0x1, %eax
movl $0x19, %ecx
cltd
idivl %ecx
movl %edx, 0x1ea13(%rip)     # 0xffffffff80120018
callq 0xffffffff80101640
movl $0x0, 0x1ea08(%rip) # 0xffffffff8012001c
jmp 0xffffffff8010163a
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
je 0xffffffff80101638
movl $0x20, %edi
callq 0xffffffff80101560
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xffffffff8010161d
jmp 0xffffffff8010163a
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/vga.c
// Function: vga_newline
static void vga_newline(void)
{
	char * const ptr = VGAMEM + 2 * row * COLS;

	for (int i = 0; i != 2 * COLS; i += 2) {
		*(ptr + i) = ' ';
		*(ptr + i + 1) = CATTR;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x1e9ce(%rip), %eax     # 0xffffffff80120018
shll %eax
imull $0x50, %eax, %eax
movslq %eax, %rcx
movabsq $-0x7ffffff48000, %rax # imm = 0xFFFF8000000B8000
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0xa0, -0xc(%rbp)
je 0xffffffff80101697
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb $0x20, (%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb $0x7, 0x1(%rax,%rcx)
movl -0xc(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xc(%rbp)
jmp 0xffffffff8010166a
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/string.c
// Function: memcpy
void *memcpy(void *dst, const void *src, size_t size)
{
	char *d = dst;
	const char *s = src;

	while (size--)
		*d++ = *s++;
	return dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x18(%rbp)
cmpq $0x0, %rax
je 0xffffffff801016f9
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb (%rax), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0xffffffff801016c0
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/string.c
// Function: memcpy_r
static void *memcpy_r(void *dst, const void *src, size_t size)
{
	char *d = dst;
	const char *s = src;

	d += size;
	s += size;
	while (size--)
		*(--d) = *(--s);
	return dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x18(%rbp)
cmpq $0x0, %rax
je 0xffffffff801017d3
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x28(%rbp)
movb -0x1(%rax), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, -0x1(%rax)
jmp 0xffffffff80101798
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/string.c
// Function: memcmp
int memcmp(const void *lptr, const void *rptr, size_t size)
{
	const char *l = lptr;
	const char *r = rptr;

	while (size && *l == *r) {
		++l;
		++r;
		--size;
	}

	return size ? *l - *r : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x29(%rbp)
je 0xffffffff80101872
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0xffffffff8010187b
jmp 0xffffffff801018a1
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xffffffff80101850
cmpq $0x0, -0x18(%rbp)
je 0xffffffff801018bd
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x30(%rbp)
jmp 0xffffffff801018c4
xorl %eax, %eax
movl %eax, -0x30(%rbp)
jmp 0xffffffff801018c4
movl -0x30(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/string.c
// Function: strcmp
int strcmp(const char *l, const char *r)
{
	while (*l == *r && *l) {
		++l;
		++r;
	}
	return *l - *r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
movq -0x10(%rbp), %rax
movsbl (%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x11(%rbp)
jne 0xffffffff801019b3
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0xffffffff801019bc
jmp 0xffffffff801019d6
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xffffffff8010198c
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
subl %ecx, %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/string.c
// Function: strncpy
char *strncpy(char *dst, const char *src, size_t size)
{
	char *ret = dst;

	while (size-- && *src)
		*dst++ = *src++;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rcx
movq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x21(%rbp)
je 0xffffffff80101a32
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xffffffff80101a3b
jmp 0xffffffff80101a5f
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
jmp 0xffffffff80101a08
movq -0x20(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/string.c
// Function: strcpy
char *strcpy(char *dst, const char *src)
{
	char *ret = dst;

	while (*src)
		*dst++ = *src++;
	*dst = 0;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0xffffffff80101ab1
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
jmp 0xffffffff80101a84
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/stdio.c
// Function: vsinkprintf_console_write
static void vsinkprintf_console_write(struct vsinkprintf_sink *sink,
			const char *data, size_t size)
{
	struct vsinkprintf_console_sink *con =
		(struct vsinkprintf_console_sink *)sink;

	console_write(data, size);
	con->count += size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xffffffff80101430
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
movslq 0x8(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/stdio.c
// Function: vsnprintf
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
{
	struct vsinkprintf_buffer_sink sink = {
		{ &vsinkprintf_buffer_write },
		buf,
		size,
		0
	};
	vsinkprintf(&sink.sink, fmt, args);
	sink.data[MIN(sink.size - 1, sink.pos)] = 0;
	return sink.pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq 0x61(%rip), %rax        # 0xffffffff80101ce0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl %eax, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xffffffff80102300
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdi
movslq -0x24(%rbp), %rsi
callq 0xffffffff80101d80
movq %rax, %rcx
movq -0x40(%rbp), %rax
movb $0x0, (%rax,%rcx)
movl -0x24(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/stdio.c
// Function: vsinkprintf_buffer_write
static void vsinkprintf_buffer_write(struct vsinkprintf_sink *sink,
			const char *data, size_t size)
{
	struct vsinkprintf_buffer_sink *buf =
		(struct vsinkprintf_buffer_sink *)sink;

	const int remain = MAX(buf->size - 1 - buf->pos, 0);

	if (remain)
		memcpy(buf->data + buf->pos, data, MINU(remain, size));
	buf->pos += size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movq -0x20(%rbp), %rcx
subl 0x14(%rcx), %eax
movslq %eax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xffffffff80101fa0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xffffffff80101d5e
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x14(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movslq -0x24(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xffffffff80101fd0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
callq 0xffffffff801016a0
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
movslq 0x14(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x14(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/stdio.c
// Function: dbg_printf
void dbg_printf(const char *pref, const char *file, int line,
			const char *fmt, ...)
{
	static int cnt;
	va_list args;

	const bool enabled = local_preempt_save();

	va_start(args, fmt);
	printf("[%s:%d] %s:%d ", pref, cnt++, file, line);
	vprintf(fmt, args);
	putchar('\n');
	va_end(args);

	local_preempt_restore(enabled);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
testb %al, %al
je 0xffffffff80101e9e
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
movq %r9, -0xd8(%rbp)
movq %r8, -0xe0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
callq 0xffffffff80101f40
movb %al, -0x41(%rbp)
leaq -0x100(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x30, -0x3c(%rbp)
movl $0x20, -0x40(%rbp)
movq -0x8(%rbp), %rsi
movl 0x1e132(%rip), %edx     # 0xffffffff80120020
movl %edx, %eax
incl %eax
movl %eax, 0x1e128(%rip)     # 0xffffffff80120020
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %r8d
leaq 0x10343(%rip), %rdi     # 0xffffffff8011224a
xorl %eax, %eax
callq 0xffffffff80101bc0
movq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xffffffff80101b30
movl $0xa, %edi
callq 0xffffffff80101ac0
movzbl -0x41(%rbp), %edi
andl $0x1, %edi
callq 0xffffffff80101f70
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/ctype.c
// Function: isspace
int isspace(int c)
{
	switch (c) {
	case ' ':
	case '\t':
	case '\n':
	case '\v':
	case '\f':
	case '\r':
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
addl $-0x9, %eax
subl $0x5, %eax
jb 0xffffffff80102131
jmp 0xffffffff80102127
movl -0xc(%rbp), %eax
subl $0x20, %eax
jne 0xffffffff8010213a
jmp 0xffffffff80102131
movl $0x1, -0x4(%rbp)
jmp 0xffffffff80102141
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)