LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_write
ssize_t simple_uart_write(struct simple_uart *sc, const void *buffer, size_t len)
{
    if (!sc || !buffer)
        return -EINVAL;
    if (len == 0)
        return 0; // Nothing to write, but not an error

#ifdef _WIN32
    ssize_t r = 0;
    DWORD bytes_written = 0;
    /* TODO: Support char_delay_us */
    if (len > ULONG_MAX)
        len = ULONG_MAX; // avoid overflow at typecast
    if (!WriteFile(sc->port, buffer, (DWORD)len, &bytes_written, NULL))
        return win32_errno();
    r = (ssize_t)bytes_written;
#else
    ssize_t r;
    if (len > SSIZE_MAX)
        len = SSIZE_MAX; // avoid overflow at cast to signed type
    if (sc->char_delay_us > 0) {
        const uint8_t *buf8 = buffer;
        for (size_t i = 0; i < len; i++) {
            ssize_t e = write(sc->fd, &buf8[i], 1);
            if (e < 0)
                return e;
            if (e == 0)
                return (ssize_t)i;
            usleep(sc->char_delay_us);
        }
        r = (ssize_t)len;
    } else {
        r = write(sc->fd, buffer, len);
        if (r < 0)
            r = -errno;
    }
#endif

    if (r > 0 && sc->logfile) {
        fwrite(buffer, (size_t)r, 1, sc->logfile);
        fflush(sc->logfile);
    }

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x68d2
cmpq $0x0, -0x18(%rbp)
jne 0x68df
movq $-0x16, -0x8(%rbp)
jmp 0x6a14
cmpq $0x0, -0x20(%rbp)
jne 0x68f3
movq $0x0, -0x8(%rbp)
jmp 0x6a14
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0x20(%rbp)
jbe 0x6911
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jbe 0x69a1
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x6997
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x30(%rbp), %rsi
addq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0x20f0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jge 0x6969
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6a14
cmpq $0x0, -0x40(%rbp)
jne 0x697d
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6a14
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x23e0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x692f
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x69d3
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x20f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x69d1
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
cltq
movq %rax, -0x28(%rbp)
jmp 0x69d3
cmpq $0x0, -0x28(%rbp)
jle 0x6a0c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x6a0c
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movl $0x1, %edx
callq 0x2370
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2290
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_close
int simple_uart_close(struct simple_uart *sc)
{
    if (!sc)
        return -EINVAL;

    /* Close logfile if open to prevent file handle leak */
    if (sc->logfile) {
        fclose(sc->logfile);
        sc->logfile = NULL;
    }

#if defined(__linux__) || defined(__APPLE__)
    close(sc->fd);
#else
    CloseHandle(sc->port);
#endif
    free(sc);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x6a3c
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x6a7b
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x6a60
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2110
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x21b0
movq -0x10(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_open
struct simple_uart *simple_uart_open(const char *device, int speed, const char *mode_string)
{
    struct simple_uart *retval;

#ifdef _WIN32
    HANDLE port;
    DWORD mode = GENERIC_READ | GENERIC_WRITE;
    char full_port_name[32];

    snprintf(full_port_name, sizeof(full_port_name), "\\\\.\\%s", device);
    full_port_name[sizeof(full_port_name) - 1] = '\0';

    port = CreateFile(full_port_name, mode, 0, NULL, OPEN_EXISTING, 0, NULL);
    if (port == INVALID_HANDLE_VALUE)
        return NULL;
    retval = calloc(1, sizeof(struct simple_uart));
    if (!retval) {
        CloseHandle(port);
        return NULL;
    }
    retval->port = port;
#else
    int fd;
    int mode = O_RDWR | O_NDELAY | O_NOCTTY;

    fd = open(device, mode);

    if (fd == -1)
        return NULL;

    signal(SIGIO, SIG_IGN); // so we don't get those 'I/O possible' lines

    fcntl(fd, F_SETFL, 0);
    retval = calloc(1, sizeof(struct simple_uart));
    if (!retval) {
        close(fd);
        return NULL;
    }
    retval->fd = fd;
#endif
    int r = simple_uart_set_config(retval, speed, mode_string);
    if (r < 0 && r != -ENOTTY) {
        simple_uart_close(retval);
        return NULL;
    }
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x902, -0x30(%rbp)     # imm = 0x902
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %esi
movb $0x0, %al
callq 0x2300
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0x6ace
movq $0x0, -0x8(%rbp)
jmp 0x6b5d
movl $0x1d, %edi
movl $0x1, %esi
callq 0x2220
movl -0x2c(%rbp), %edi
movl $0x4, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x20d0
movl $0x1, %edi
movl $0x10, %esi
callq 0x21f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x6b1a
movl -0x2c(%rbp), %edi
callq 0x21b0
movq $0x0, -0x8(%rbp)
jmp 0x6b5d
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x6b70
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x6b55
cmpl $-0x19, -0x34(%rbp)
je 0x6b55
movq -0x28(%rbp), %rdi
callq 0x6a20
movq $0x0, -0x8(%rbp)
jmp 0x6b5d
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_has_data
int simple_uart_has_data(struct simple_uart *sc)
{
    if (!sc)
        return 0;

#ifdef _WIN32
    COMSTAT cs;
    DWORD r;
    if (!ClearCommError(sc->port, NULL, &cs)) {
        return 0;
    }
    r = cs.cbInQue;
    if (r > INT_MAX)
        r = INT_MAX;
    return (int)r;
#else
    int bytes_available;
    if (ioctl(sc->fd, FIONREAD, &bytes_available) < 0)
        return -errno;
    return bytes_available;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x734c
movl $0x0, -0x4(%rbp)
jmp 0x737e
movq -0x10(%rbp), %rax
movl (%rax), %edi
movl $0x541b, %esi           # imm = 0x541B
leaq -0x14(%rbp), %rdx
movb $0x0, %al
callq 0x21a0
cmpl $0x0, %eax
jge 0x7378
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x737e
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_set_character_delay
unsigned int simple_uart_set_character_delay(struct simple_uart *sc, unsigned int delay_us)
{
    if (!sc)
        return 0;
    unsigned int old_delay = sc->char_delay_us;
    sc->char_delay_us = delay_us;
    return old_delay;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x73ab
movl $0x0, -0x4(%rbp)
jmp 0x73c5
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: readfile
static bool readfile(const char *dir, const char *filename, char *result, size_t max_result_len)
{
    FILE *fp;
    size_t len = 0;
    char path[PATH_MAX];
    snprintf(path, sizeof(path), "%s/%s", dir, filename);
    result[0] = '\0';
    if ((fp = fopen(path, "rb")) != NULL) {
        len = fread(result, 1, max_result_len - 1, fp);
        if (len) {
            result[len - 1] = '\0';
        }
        fclose(fp);
    }
    return len != 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1030, %rsp           # imm = 0x1030
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x1030(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %r8
movl $0x1000, %esi           # imm = 0x1000
leaq 0x27df(%rip), %rdx      # 0xa3cd
movb $0x0, %al
callq 0x2170
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
leaq -0x1030(%rbp), %rdi
leaq 0x27c9(%rip), %rsi      # 0xa3d3
callq 0x2310
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x7c57
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq -0x28(%rbp), %rcx
movl $0x1, %esi
callq 0x20a0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x7c4e
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rdi
callq 0x2110
cmpq $0x0, -0x30(%rbp)
setne %al
andb $0x1, %al
addq $0x1030, %rsp           # imm = 0x1030
popq %rbp
retq
nopw (%rax,%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_set_logfile
int simple_uart_set_logfile(struct simple_uart *uart, const char *logfile, ...)
{
    va_list ap;
    char *buffer;
    int len;

    if (!uart || !logfile)
        return -EINVAL;

    va_start(ap, logfile);
    len = vasprintf(&buffer, logfile, ap);
    va_end(ap);
    if (len < 0)
        return -errno;
    if (uart->logfile) {
        fclose(uart->logfile);
        uart->logfile = NULL;
    }
    uart->logfile = fopen(buffer, "a");
    if (!uart->logfile) {
        int e = -errno;
        free(buffer);
        return e;
    }
    free(buffer);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
testb %al, %al
je 0x7cab
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdx, -0xe0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7cdd
cmpq $0x0, -0x18(%rbp)
jne 0x7ce9
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x7db6
leaq -0x30(%rbp), %rax
leaq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x2100
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rax
cmpl $0x0, -0x3c(%rbp)
jge 0x7d3c
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x7db6
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7d60
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2110
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x38(%rbp), %rdi
leaq 0x1796(%rip), %rsi      # 0x9501
callq 0x2310
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x7da6
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2040
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7db6
movq -0x38(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_send_break
int simple_uart_send_break(struct simple_uart *uart)
{
    if (!uart)
        return -EINVAL;

#if defined(__linux__) || defined(__APPLE__)
    tcsendbreak(uart->fd, 1);
    return 0;
#else
    SetCommBreak(uart->port);
    // Linux doesn't support durations, it is always 4/10 of a second.
    // Replicate that here.
    Sleep(400);
    ClearCommBreak(uart->port);
    return 0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x80cc
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x80e3
movq -0x10(%rbp), %rax
movl (%rax), %edi
movl $0x1, %esi
callq 0x2210
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_get_pin
int simple_uart_get_pin(struct simple_uart *uart, int pin)
{
    if (!uart)
        return -EINVAL;

#if defined(__linux__) || defined(__APPLE__)
    int status;

    if (ioctl(uart->fd, TIOCMGET, &status) < 0)
        return -errno;

    switch (pin) {
    case SIMPLE_UART_CTS: return (status & TIOCM_CTS) ? 1 : 0;
    case SIMPLE_UART_DSR: return (status & TIOCM_DSR) ? 1 : 0;
    case SIMPLE_UART_DCD: return (status & TIOCM_CAR) ? 1 : 0;
    case SIMPLE_UART_RI: return (status & TIOCM_RI) ? 1 : 0;
    default: return -EINVAL;
    }
#else
    DWORD status;
    if (!GetCommModemStatus(uart->port, &status))
        return win32_errno();
    switch (pin) {
    case SIMPLE_UART_CTS: return (status & MS_CTS_ON) ? 1 : 0;
    case SIMPLE_UART_DSR: return (status & MS_DSR_ON) ? 1 : 0;
    case SIMPLE_UART_DCD: return (status & MS_RLSD_ON) ? 1 : 0;
    case SIMPLE_UART_RI: return (status & MS_RING_ON) ? 1 : 0;
    default: return -EINVAL;
    }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8142
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x8202
movq -0x10(%rbp), %rax
movl (%rax), %edi
movl $0x5415, %esi           # imm = 0x5415
leaq -0x18(%rbp), %rdx
movb $0x0, %al
callq 0x21a0
cmpl $0x0, %eax
jge 0x8171
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x8202
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x4, %eax
ja 0x81fb
movq -0x20(%rbp), %rax
leaq 0x216c(%rip), %rcx      # 0xa2f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x18(%rbp), %edx
andl $0x20, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x8202
movl -0x18(%rbp), %edx
andl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x8202
movl -0x18(%rbp), %edx
andl $0x40, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x8202
movl -0x18(%rbp), %edx
andl $0x80, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x8202
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_set_pin
int simple_uart_set_pin(struct simple_uart *uart, int pin, bool high)
{
    if (!uart)
        return -EINVAL;

#if defined(__linux__) || defined(__APPLE__)
    int bits;

    if (uart->fd < 0)
        return -EINVAL;

    switch (pin) {
    case SIMPLE_UART_RTS: bits = TIOCM_RTS; break;
    case SIMPLE_UART_DTR: bits = TIOCM_DTR; break;
    default: return -EINVAL;
    }
    if (ioctl(uart->fd, high ? TIOCMBIS : TIOCMBIC, &bits) < 0)
        return -errno;

    return 0;
#else
    bool res;
    switch (pin) {
    case SIMPLE_UART_RTS: res = EscapeCommFunction(uart->port, high ? SETRTS : CLRRTS); break;
    case SIMPLE_UART_DTR: res = EscapeCommFunction(uart->port, high ? SETDTR : CLRDTR); break;
    default: return -EINVAL;
    }
    if (!res)
        return win32_errno();
    return 0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8239
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x82c0
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jge 0x824b
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x82c0
movl -0x14(%rbp), %eax
movl %eax, -0x20(%rbp)
testl %eax, %eax
je 0x8261
jmp 0x8257
movl -0x20(%rbp), %eax
subl $0x4, %eax
je 0x826a
jmp 0x8273
movl $0x4, -0x1c(%rbp)
jmp 0x827c
movl $0x2, -0x1c(%rbp)
jmp 0x827c
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x82c0
movq -0x10(%rbp), %rax
movl (%rax), %edi
movb -0x15(%rbp), %dl
movl $0x5417, %eax           # imm = 0x5417
movl $0x5416, %ecx           # imm = 0x5416
testb $0x1, %dl
cmovnel %ecx, %eax
movslq %eax, %rsi
leaq -0x1c(%rbp), %rdx
movb $0x0, %al
callq 0x21a0
cmpl $0x0, %eax
jge 0x82b9
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x82c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: AndreRenaud[P]simple_uart/simple_uart.c
// Function: simple_uart_flush
int simple_uart_flush(struct simple_uart *uart)
{
    if (!uart)
        return -EINVAL;

#if defined(__linux__) || defined(__APPLE__)
    if (tcdrain(uart->fd) < 0)
        return -errno;
#else
    if (!FlushFileBuffers(uart->port))
        return win32_errno();
#endif
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x82ec
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x8314
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x20c0
cmpl $0x0, %eax
jge 0x830d
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x8314
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: michalfapso[P]enum_strings/main.cpp
// Function: main
int main ()
{
	A a(Animals::COW);

	std::cout << "size:" << EnumManager<Day>::size() << std::endl;

	for (int DAY = 0; DAY < EnumManager<Day>::size(); DAY++)
		std::cout << static_cast<Day> (DAY) << std::endl;

	Day e = Day::Friday;
	std::string s = EnumManager<Day>::toString(e);
	std::cout << "to string: '" << s << "'" << std::endl;
	e = EnumManager<Day>::toEnum(s);
	std::cout << "from string: " << e << " = " << (int)e << std::endl;

	std::cout << "Name a day: ";
	while (true)
	{
		std::cin >> e;
		std::cout << "day = " << e << std::endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x7070
movq 0xda39(%rip), %rdi      # 0xffd0
leaq 0x7ab1(%rip), %rsi      # 0xa04f
callq 0x21a0
movq %rax, -0x48(%rbp)
callq 0x2790
movq -0x48(%rbp), %rdi
movl %eax, %esi
callq 0x22d0
movq %rax, %rdi
movq 0xd9ff(%rip), %rsi      # 0xffc0
callq 0x21f0
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x4c(%rbp)
callq 0x2790
movl %eax, %ecx
movl -0x4c(%rbp), %eax
cmpl %ecx, %eax
jge 0x260a
movl -0xc(%rbp), %esi
movq 0xd9e5(%rip), %rdi      # 0xffd0
callq 0x27b0
movq %rax, %rdi
movq 0xd9c6(%rip), %rsi      # 0xffc0
callq 0x21f0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x25cd
movl $0x4, -0x10(%rbp)
movl -0x10(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x2820
movq 0xd9ac(%rip), %rdi      # 0xffd0
leaq 0x7a2a(%rip), %rsi      # 0xa055
callq 0x21a0
movq %rax, -0x58(%rbp)
jmp 0x2636
movq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2180
movq %rax, -0x60(%rbp)
jmp 0x2649
movq -0x60(%rbp), %rdi
leaq 0x7a0c(%rip), %rsi      # 0xa060
callq 0x21a0
movq %rax, -0x68(%rbp)
jmp 0x265f
movq -0x68(%rbp), %rdi
movq 0xd956(%rip), %rsi      # 0xffc0
callq 0x21f0
jmp 0x2671
leaq -0x30(%rbp), %rdi
callq 0x28f0
movl %eax, -0x6c(%rbp)
jmp 0x267f
movl -0x6c(%rbp), %eax
movl %eax, -0x10(%rbp)
movq 0xd944(%rip), %rdi      # 0xffd0
leaq 0x79cf(%rip), %rsi      # 0xa062
callq 0x21a0
movq %rax, -0x78(%rbp)
jmp 0x269e
movq -0x78(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0x27b0
movq %rax, -0x80(%rbp)
jmp 0x26b0
movq -0x80(%rbp), %rdi
leaq 0x79c5(%rip), %rsi      # 0xa080
callq 0x21a0
movq %rax, -0x88(%rbp)
jmp 0x26c9
movq -0x88(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0x22d0
movq %rax, -0x90(%rbp)
jmp 0x26e1
movq -0x90(%rbp), %rdi
movq 0xd8d1(%rip), %rsi      # 0xffc0
callq 0x21f0
jmp 0x26f6
movq 0xd8d3(%rip), %rdi      # 0xffd0
leaq 0x796c(%rip), %rsi      # 0xa070
callq 0x21a0
jmp 0x270b
jmp 0x270d
jmp 0x270f
movq 0xd8ca(%rip), %rdi      # 0xffe0
leaq -0x10(%rbp), %rsi
callq 0x2960
jmp 0x2721
movq 0xd8a8(%rip), %rdi      # 0xffd0
leaq 0x794e(%rip), %rsi      # 0xa07d
callq 0x21a0
movq %rax, -0x98(%rbp)
jmp 0x273d
movq -0x98(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0x27b0
movq %rax, -0xa0(%rbp)
jmp 0x2755
movq -0xa0(%rbp), %rdi
movq 0xd85d(%rip), %rsi      # 0xffc0
callq 0x21f0
jmp 0x276a
jmp 0x270d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x20e0
movq -0x38(%rbp), %rdi
callq 0x22e0
nopw (%rax,%rax)
// File: michalfapso[P]enum_strings/./enum_conversions.h
// Function: EnumManager<Day>::toString[abi:cxx11](Day)
std::string EnumManager<Enum>::toString (const Enum en) {
    auto it = EnumManager<Enum>::enumToStringMap.find (en);  // std::map::find is the fastest lookup method
    if (it != EnumManager<Enum>::enumToStringMap.end())
        return it->second;
    return "[[[Enum to string not found. Programmer made an error]]]";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0xd977(%rip), %rdi      # 0x101b8
leaq -0xc(%rbp), %rsi
callq 0x5640
movq %rax, -0x18(%rbp)
leaq 0xd963(%rip), %rdi      # 0x101b8
callq 0x56a0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5670
testb $0x1, %al
jne 0x2871
jmp 0x288c
leaq -0x18(%rbp), %rdi
callq 0x56d0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x20a0
jmp 0x28d1
leaq -0x21(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x22f0
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x7820(%rip), %rsi      # 0xa0c8
callq 0x2fc0
jmp 0x28af
leaq -0x21(%rbp), %rdi
callq 0x2210
jmp 0x28d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x21(%rbp), %rdi
callq 0x2210
jmp 0x28db
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x22e0
nopw %cs:(%rax,%rax)
nop
// File: michalfapso[P]enum_strings/./enum_conversions.h
// Function: EnumManager<Day>::toEnum(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Enum EnumManager<Enum>::toEnum (const std::string& str) {
    auto it = EnumManager<Enum>::stringToEnumMap.find (str);
    if (it != EnumManager<Enum>::stringToEnumMap.end())
        return it->second;
    return static_cast<Enum> (ENUM_NOT_FOUND);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq 0xd8e9(%rip), %rdi      # 0x101f0
callq 0x5930
movq %rax, -0x18(%rbp)
leaq 0xd8d9(%rip), %rdi      # 0x101f0
callq 0x5990
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5960
testb $0x1, %al
jne 0x2933
jmp 0x2944
leaq -0x18(%rbp), %rdi
callq 0x59c0
movl 0x20(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x294b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: michalfapso[P]enum_strings/./enum_conversions.h
// Function: std::enable_if<enum_serializable<Day>::value, std::istream&>::type operator>><Day>(std::istream&, Day&)
typename std::enable_if<enum_serializable<Enum>::value, std::istream&>::type operator>>(std::istream& is, Enum& e)
{
    std::string buf;
    is >> buf;
	e = EnumManager<Enum>::toEnum(buf);
    return is;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x2270
movq -0x48(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x2260
jmp 0x298c
leaq -0x30(%rbp), %rdi
callq 0x28f0
movl %eax, -0x4c(%rbp)
jmp 0x299a
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x20e0
movq -0x58(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x20e0
movq -0x38(%rbp), %rdi
callq 0x22e0
nopl (%rax)
// File: michalfapso[P]enum_strings/./enum_conversions.h
// Function: EnumManager<Day>::initializeEnumToStringMap[abi:cxx11]()
std::map<Enum, std::string> EnumManager<Enum>::initializeEnumToStringMap() {
    std::map<Enum, std::string> m;
    //for (const auto& x: EnumConversions<Enum>::enumToStringVector)
	for (const auto& x: splitStringToVector(EnumConversions<Enum>::enumToStringStr))
		m[x.first] = x.second;
    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
callq 0x2d80
leaq -0x51(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x22f0
movq -0x88(%rbp), %rdx
leaq 0x75e9(%rip), %rsi      # 0xa010
leaq -0x50(%rbp), %rdi
callq 0x2fc0
jmp 0x2a32
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2da0
jmp 0x2a41
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x51(%rbp), %rdi
callq 0x2210
leaq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3070
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x30a0
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x30d0
testb $0x1, %al
jne 0x2ac5
leaq -0x30(%rbp), %rdi
callq 0x3230
jmp 0x2b35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2ab7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x51(%rbp), %rdi
callq 0x2210
jmp 0x2b5b
leaq -0x70(%rbp), %rdi
callq 0x3110
movq -0x98(%rbp), %rdi
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rsi
movq %rsi, %rax
addq $0x8, %rax
movq %rax, -0xa8(%rbp)
callq 0x3130
movq %rax, -0xa0(%rbp)
jmp 0x2af9
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdi
callq 0x2040
jmp 0x2b0e
jmp 0x2b10
leaq -0x70(%rbp), %rdi
callq 0x3210
jmp 0x2a75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3230
jmp 0x2b5b
movb $0x1, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x2b4b
movq -0x98(%rbp), %rdi
callq 0x2b70
movq -0x90(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x2b70
movq -0x60(%rbp), %rdi
callq 0x22e0
// File: michalfapso[P]enum_strings/./enum_conversions.h
// Function: EnumManager<Day>::initializeStringToEnumMap[abi:cxx11]()
std::map<std::string, Enum> EnumManager<Enum>::initializeStringToEnumMap() {
    std::map<std::string, Enum> m;
    //for (const auto& x: EnumConversions<Enum>::enumToStringVector)
	for (const auto& x: splitStringToVector(EnumConversions<Enum>::enumToStringStr))
		m[x.second] = x.first;
    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
callq 0x5d50
leaq -0x51(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x22f0
movq -0x88(%rbp), %rdx
leaq 0x7439(%rip), %rsi      # 0xa010
leaq -0x50(%rbp), %rdi
callq 0x2fc0
jmp 0x2be2
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2da0
jmp 0x2bf1
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x51(%rbp), %rdi
callq 0x2210
leaq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3070
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x30a0
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x30d0
testb $0x1, %al
jne 0x2c75
leaq -0x30(%rbp), %rdi
callq 0x3230
jmp 0x2cdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2c67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x51(%rbp), %rdi
callq 0x2210
jmp 0x2d01
leaq -0x70(%rbp), %rdi
callq 0x3110
movq -0x98(%rbp), %rdi
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rsi
movl (%rsi), %eax
movl %eax, -0xa4(%rbp)
addq $0x8, %rsi
callq 0x5d70
movq %rax, -0xa0(%rbp)
jmp 0x2ca7
movq -0xa0(%rbp), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x70(%rbp), %rdi
callq 0x3210
jmp 0x2c25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3230
jmp 0x2d01
movb $0x1, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x2cf1
movq -0x98(%rbp), %rdi
callq 0x2d20
movq -0x90(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x2d20
movq -0x60(%rbp), %rdi
callq 0x22e0
nopw %cs:(%rax,%rax)
// File: michalfapso[P]enum_strings/./enum_conversions.h
// Function: EnumManager<Day>::splitStringToVector(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static EnumToStringVector splitStringToVector(const std::string& str) {
		const char delim = ',';
		EnumToStringVector tokens;
		std::stringstream ss(str);
		std::string item;
		while (std::getline(ss, item, delim)) {
			tokens.push_back(std::make_pair(static_cast<Enum>(tokens.size()), trim(item)));
		}
		return tokens;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x240(%rbp)
movq %rdi, %rax
movq %rax, -0x238(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x2c, -0x11(%rbp)
movb $0x0, -0x12(%rbp)
callq 0x33a0
movq -0x10(%rbp), %rax
movq %rax, -0x230(%rbp)
movl $0x10, %edi
movl $0x8, %esi
callq 0x33c0
movl %eax, -0x224(%rbp)
jmp 0x2df3
movl -0x224(%rbp), %edx
movq -0x230(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x22a0
jmp 0x2e0e
leaq -0x1d0(%rbp), %rdi
callq 0x2270
leaq -0x1a0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
movl $0x2c, %edx
callq 0x2310
movq %rax, -0x248(%rbp)
jmp 0x2e3b
movq -0x248(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2250
movb %al, -0x249(%rbp)
jmp 0x2e59
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x2e68
jmp 0x2f48
movq -0x240(%rbp), %rdi
callq 0x3450
movl %eax, -0x1fc(%rbp)
leaq -0x220(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x3480
jmp 0x2e8f
leaq -0x1f8(%rbp), %rdi
leaq -0x1fc(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x3410
jmp 0x2eab
movq -0x240(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x33e0
jmp 0x2ec0
leaq -0x1f8(%rbp), %rdi
callq 0x3510
leaq -0x220(%rbp), %rdi
callq 0x20e0
jmp 0x2e1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x2fa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x2f6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x2f3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x3510
leaq -0x220(%rbp), %rdi
callq 0x20e0
jmp 0x2f6c
movb $0x1, -0x12(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x20e0
leaq -0x1a0(%rbp), %rdi
callq 0x2130
testb $0x1, -0x12(%rbp)
jne 0x2f92
jmp 0x2f86
leaq -0x1d0(%rbp), %rdi
callq 0x20e0
leaq -0x1a0(%rbp), %rdi
callq 0x2130
jmp 0x2fa2
movq -0x240(%rbp), %rdi
callq 0x3230
movq -0x238(%rbp), %rax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x240(%rbp), %rdi
callq 0x3230
movq -0x1a8(%rbp), %rdi
callq 0x22e0
nopw (%rax,%rax)
// File: michalfapso[P]enum_strings/./enum_conversions.h
// Function: EnumManager<Day>::trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static std::string trim(std::string const& str)
	{
		if(str.empty())
			return str;

		std::size_t first = str.find_first_not_of(' ');
		std::size_t last  = str.find_last_not_of(' ');
		return str.substr(first, last-first+1);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, %rax
movq %rax, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22c0
testb $0x1, %al
jne 0x34aa
jmp 0x34b9
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x20a0
jmp 0x3505
movq -0x10(%rbp), %rdi
movl $0x20, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2190
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movq $-0x1, %rdx
callq 0x20f0
movq -0x30(%rbp), %rdi
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
subq -0x18(%rbp), %rcx
addq $0x1, %rcx
callq 0x21d0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: tobias93[P]piano/rtaudio/tests/record.cpp
// Function: usage()
void usage( void ) {
  // Error function in case of incorrect command-line
  // argument specifications
  std::cout << "\nuseage: record N fs <duration> <device> <channelOffset>\n";
  std::cout << "    where N = number of channels,\n";
  std::cout << "    fs = the sample rate,\n";
  std::cout << "    duration = optional time in seconds to record (default = 2.0),\n";
  std::cout << "    device = optional device to use (default = 0),\n";
  std::cout << "    and channelOffset = an optional channel offset on the device (default = 0).\n\n";
  exit( 0 );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xf915(%rip), %rdi      # 0x17fd0
leaq 0xa956(%rip), %rsi      # 0x13018
callq 0x8220
movq 0xf902(%rip), %rdi      # 0x17fd0
leaq 0xa97d(%rip), %rsi      # 0x13052
callq 0x8220
movq 0xf8ef(%rip), %rdi      # 0x17fd0
leaq 0xa98d(%rip), %rsi      # 0x13075
callq 0x8220
movq 0xf8dc(%rip), %rdi      # 0x17fd0
leaq 0xa995(%rip), %rsi      # 0x13090
callq 0x8220
movq 0xf8c9(%rip), %rdi      # 0x17fd0
leaq 0xa9c6(%rip), %rsi      # 0x130d4
callq 0x8220
movq 0xf8b6(%rip), %rdi      # 0x17fd0
leaq 0xa9e7(%rip), %rsi      # 0x13108
callq 0x8220
xorl %edi, %edi
callq 0x8310
nopl (%rax)
// File: tobias93[P]piano/rtaudio/tests/record.cpp
// Function: input(void*, void*, unsigned int, double, unsigned int, void*)
int input( void * /*outputBuffer*/, void *inputBuffer, unsigned int nBufferFrames,
           double /*streamTime*/, RtAudioStreamStatus /*status*/, void *data )
{
  InputData *iData = (InputData *) data;

  // Simply copy the data to our allocated buffer.
  unsigned int frames = nBufferFrames;
  if ( iData->frameCounter + nBufferFrames > iData->totalFrames ) {
    frames = iData->totalFrames - iData->frameCounter;
    iData->bufferBytes = frames * iData->channels * sizeof( MY_TYPE );
  }

  unsigned long offset = iData->frameCounter * iData->channels;
  memcpy( iData->buffer+offset, inputBuffer, iData->bufferBytes );
  iData->frameCounter += frames;

  if ( iData->frameCounter >= iData->totalFrames ) return 2;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movsd %xmm0, -0x28(%rbp)
movl %ecx, -0x2c(%rbp)
movq %r8, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x1c(%rbp), %ecx
addq %rcx, %rax
movq -0x40(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x87a2
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
subq 0x18(%rcx), %rax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x40(%rbp), %rcx
imull 0x20(%rcx), %eax
movl %eax, %eax
movl %eax, %ecx
shlq %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x40(%rbp), %rcx
movl 0x20(%rcx), %ecx
imulq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x50(%rbp), %rax
shlq %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x81c0
movl -0x44(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x8807
movl $0x2, -0x4(%rbp)
jmp 0x880e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::operator>>(std::istream&, primitive::config_t&)
istream & operator >> (istream & in, config_t & a) {
        int w, h, t, s, n; in >> w >> h >> t >> s >> n;
        assert (w == width);
        assert (h == height);
        assert (t == pack_size);
        assert (s == erasing_sum);
        assert (n == turn_number);
        a.packs.resize(turn_number);
        repeat (i,n) in >> a.packs[i];
        return in;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x2110
movq %rax, %rdi
leaq -0x18(%rbp), %rsi
callq 0x2110
movq %rax, %rdi
leaq -0x1c(%rbp), %rsi
callq 0x2110
movq %rax, %rdi
leaq -0x20(%rbp), %rsi
callq 0x2110
movq %rax, %rdi
leaq -0x24(%rbp), %rsi
callq 0x2110
movq -0x10(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x6380
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2856
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x64e0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x6410
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2822
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::operator>>(std::istream&, primitive::input_t&)
istream & operator >> (istream & in, input_t & a) {
        in >> a.turn >> a.remaining_time;
        in >>     a.self_obstacles >>     a.self_field;
        in >> a.opponent_obstacles >> a.opponent_field;
        assert (a.self_obstacles == 0 or a.opponent_obstacles == 0);
        return in;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2110
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
callq 0x2110
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x2110
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x6500
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0xac, %rsi
callq 0x2110
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xb0, %rsi
callq 0x6500
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::fill_obstacles(primitive::blocks_t<3ul, 3ul>, int)
pack_t fill_obstacles(pack_t a, int obstacles) {
        repeat_reverse (y, pack_size) { // yが先
            repeat (x, pack_size) {
                if (obstacles and a.at[x][y] == empty_block) {
                    a.at[x][y] = obstacle_block;
                    obstacles -= 1;
                }
            }
        }
        return a;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %sil, %al
movq %rdi, -0x29(%rbp)
movb %al, -0x21(%rbp)
movq -0x29(%rbp), %rax
movq %rax, -0x19(%rbp)
movb -0x21(%rbp), %al
movb %al, -0x11(%rbp)
movl %edx, -0x30(%rbp)
movl $0x2, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x2cf3
movl $0x0, -0x38(%rbp)
cmpl $0x3, -0x38(%rbp)
jge 0x2ce6
cmpl $0x0, -0x30(%rbp)
je 0x2cd9
leaq -0x19(%rbp), %rdi
movslq -0x38(%rbp), %rsi
callq 0x6600
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x6630
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2cd9
leaq -0x19(%rbp), %rdi
movslq -0x38(%rbp), %rsi
callq 0x6600
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x6630
movb $0xb, (%rax)
movl -0x30(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2cdb
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2c87
jmp 0x2ce8
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2c7a
movb -0x11(%rbp), %al
movb %al, -0x8(%rbp)
movq -0x19(%rbp), %rax
movq %rax, -0x10(%rbp)
movb -0x8(%rbp), %al
movb %al, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movb -0x40(%rbp), %dl
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::is_valid_output(primitive::blocks_t<16ul, 10ul> const&, primitive::blocks_t<3ul, 3ul> const&, primitive::output_t const&)
bool is_valid_output(field_t const & field, pack_t const & a_pack, output_t const & output) {
        if (0 <= output.x and output.x + pack_size <= width) return true;
        pack_t pack = rotate(a_pack, output.rotate); // お邪魔ブロックは既に置かれているとする
        repeat (dy, pack_size) repeat (dx, pack_size) if (pack.at[dx][dy] != empty_block) {
            int x = output.x + dx;
            if (x < 0 or width <= x) return false;
        }
        return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpl (%rcx), %eax
jg 0x2e25
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x3, %eax
cmpl $0xa, %eax
jg 0x2e25
movb $0x1, -0x1(%rbp)
jmp 0x2eea
movq -0x18(%rbp), %rax
movb 0x8(%rax), %cl
movb %cl, -0x30(%rbp)
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
movb -0x30(%rbp), %al
movb %al, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movzbl -0x40(%rbp), %esi
callq 0x2a40
movb %dl, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x29(%rbp)
movb -0x50(%rbp), %al
movb %al, -0x21(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x3, -0x5c(%rbp)
jge 0x2ee6
movl $0x0, -0x60(%rbp)
cmpl $0x3, -0x60(%rbp)
jge 0x2ed9
leaq -0x29(%rbp), %rdi
movslq -0x60(%rbp), %rsi
callq 0x6600
movq %rax, %rdi
movslq -0x5c(%rbp), %rsi
callq 0x6630
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2ecc
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jl 0x2ec4
movl $0xa, %eax
cmpl -0x64(%rbp), %eax
jg 0x2eca
movb $0x0, -0x1(%rbp)
jmp 0x2eea
jmp 0x2ecc
jmp 0x2ece
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x2e81
jmp 0x2edb
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x2e74
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: simulation::estimate_with_erasing(primitive::blocks_t<16ul, 10ul> const&)
result_t estimate_with_erasing(field_t const & field) {
        vector<pair<result_t, int> > acc = estimate_with_erasing_all(field);
        return whole(max_element, acc, [&](pair<result_t, int> const & a, pair<result_t, int> const & b) {
            return make_tuple(a.first.chain, - a.second, a.first.score) < make_tuple(b.first.chain, - b.second, b.first.score);
        })->first;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x36e0
movq -0x58(%rbp), %rsi
leaq -0x31(%rbp), %rdi
callq 0x3c10
movq %rax, -0x50(%rbp)
jmp 0x3bc0
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x7420
movq (%rax), %rax
movq %rax, -0x8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x73c0
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x73c0
movq -0x40(%rbp), %rdi
callq 0x22f0
nopl (%rax)
// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: step_photon(std::shared_ptr<photon_t> const&, primitive::blocks_t<3ul, 3ul> const&, primitive::output_t)
shared_ptr<photon_t> step_photon(shared_ptr<photon_t> const & pho, pack_t const & pack, output_t output) {
    if (not pho->cached[output.x+pack_size-1][output.rotate]) {
        int numbers = count_number_blocks(pack);
        int consumed = count_consumed_obstacles(pack, pho->obstacles);
        pack_t filled_pack = fill_obstacles(pack, consumed);
        step_photon_inner(pho, numbers, consumed, filled_pack, output.x, output.rotate);
    }
    return pho->next[output.x+pack_size-1][output.rotate];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x70(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rcx, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x76d0
movq %rax, %rdi
addq $0x104, %rdi            # imm = 0x104
movl -0x10(%rbp), %eax
addl $0x3, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x7a20
movq %rax, %rdi
movslq -0xc(%rbp), %rsi
callq 0x7a50
testb $0x1, (%rax)
jne 0x4bca
movq -0x20(%rbp), %rdi
callq 0x7bc0
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
callq 0x76d0
movq -0x78(%rbp), %rdi
movl 0x8(%rax), %esi
callq 0x2d40
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movb 0x8(%rax), %cl
movb %cl, -0x38(%rbp)
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %edx
movb -0x38(%rbp), %al
movb %al, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movzbl -0x48(%rbp), %esi
callq 0x2c50
movb %dl, -0x58(%rbp)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x31(%rbp)
movb -0x58(%rbp), %al
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
movl -0x10(%rbp), %r8d
movl -0xc(%rbp), %r9d
leaq -0x31(%rbp), %rcx
callq 0x46e0
movq -0x18(%rbp), %rdi
callq 0x76d0
movq %rax, %rdi
addq $0x138, %rdi            # imm = 0x138
movl -0x10(%rbp), %eax
addl $0x3, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x7b30
movq %rax, %rdi
movslq -0xc(%rbp), %rsi
callq 0x7b60
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x7c70
movq -0x68(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: step_photon_all(std::shared_ptr<photon_t> const&, primitive::blocks_t<3ul, 3ul> const&)
void step_photon_all(shared_ptr<photon_t> const & pho, pack_t const & pack) {
    int numbers = count_number_blocks(pack);
    int consumed = count_consumed_obstacles(pack, pho->obstacles);
    pack_t filled_pack = fill_obstacles(pack, consumed);
    repeat_from (x, - pack_size + 1, width) repeat (r, 4) {
        step_photon_inner(pho, numbers, consumed, filled_pack, x, r);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7bc0
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x76d0
movq -0x60(%rbp), %rdi
movl 0x8(%rax), %esi
callq 0x2d40
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movb 0x8(%rax), %cl
movb %cl, -0x28(%rbp)
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %edx
movb -0x28(%rbp), %al
movb %al, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movzbl -0x38(%rbp), %esi
callq 0x2c50
movb %dl, -0x48(%rbp)
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x21(%rbp)
movb -0x48(%rbp), %al
movb %al, -0x19(%rbp)
movl $0xfffffffe, -0x54(%rbp) # imm = 0xFFFFFFFE
cmpl $0xa, -0x54(%rbp)
jge 0x4ced
movl $0x0, -0x58(%rbp)
cmpl $0x4, -0x58(%rbp)
jge 0x4ce0
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x54(%rbp), %r8d
movl -0x58(%rbp), %r9d
leaq -0x21(%rbp), %rcx
callq 0x46e0
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x4cb4
jmp 0x4ce2
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x4ca7
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)