LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/httpServer.c
// Function: printWithEscapeCharacters
void printWithEscapeCharacters(FILE *out, char *message) {
    unsigned int index = 0;
    char currentCharacter = message[index];

    while (currentCharacter != '\0') {
        switch (currentCharacter) {
        case '\r':
            fputc('\\', out);
            fputc('r', out);
            break;
        case '\n':
            fputc('\\', out);
            fputc('n', out);
            break;
        case '\t':
            fputc('\\', out);
            fputc('t', out);
            break;
        default :
            fputc(currentCharacter, out);
            break;
        }

    index += 1;
    currentCharacter = message[index];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %r12
pushq $0x5c
popq %r15
pushq $0x72
popq %r13
movq %rsi, %rax
movzbl (%rax), %eax
cmpl $0x9, %eax
je 0x13a3
cmpl $0xa, %eax
je 0x1394
cmpl $0xd, %eax
je 0x13b3
testl %eax, %eax
je 0x13d4
movsbl %al, %edi
jmp 0x13c1
movl %r15d, %edi
movq %r14, %rsi
callq 0x1100
pushq $0x6e
jmp 0x13b0
movl %r15d, %edi
movq %r14, %rsi
callq 0x1100
pushq $0x74
popq %rdi
jmp 0x13c1
movl %r15d, %edi
movq %r14, %rsi
callq 0x1100
movl %r13d, %edi
movq %r14, %rsi
callq 0x1100
movl %r12d, %eax
addq %rbx, %rax
incl %r12d
jmp 0x1379
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/httpServer.c
// Function: setupServer
int setupServer(ConfigurationRef config) {
    int socketNumber = 0;
    int status = 0;
    struct sockaddr_in configuration = (const struct sockaddr_in){0};

    socketNumber = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
    if (socketNumber < 0) {
        exitWithError("setupServer: unable to obtain socket for server",
            EC_SOCKET_FAILURE);
    }

    memset(&configuration, 0, sizeof(configuration));
    configuration.sin_family = AF_INET;
    configuration.sin_addr.s_addr = htonl(INADDR_ANY);
    configuration.sin_port = htons(configPort(config));

    status = bind(socketNumber, (struct sockaddr*)&configuration, sizeof(configuration));
    if (status < 0) {
        exitWithError("setupServer: socket could not be bound with configuration",
            EC_BIND_FAILURE);
    }

    status = listen(socketNumber, BACKLOG_SIZE);
    if (status < 0) {
        exitWithError("setupServer: unable to configure server listening",
            EC_LISTEN_FAILURE);
    }

    return socketNumber;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
callq 0x1200
testl %eax, %eax
js 0x1470
movl %eax, %ebx
leaq -0x28(%rbp), %r15
andq $0x0, 0x8(%r15)
movw $0x2, (%r15)
andl $0x0, 0x4(%r15)
movq %r14, %rdi
callq 0x1946
rolw $0x8, %ax
movw %ax, 0x2(%r15)
pushq $0x10
popq %rdx
movl %ebx, %edi
movq %r15, %rsi
callq 0x1180
testl %eax, %eax
js 0x147b
pushq $0x5
popq %rsi
movl %ebx, %edi
callq 0x1150
testl %eax, %eax
js 0x1486
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xec65(%rip), %rdi      # 0x100dc
pushq $0x2
jmp 0x148f
leaq 0xec8a(%rip), %rdi      # 0x1010c
pushq $0x3
jmp 0x148f
leaq 0xecb9(%rip), %rdi      # 0x10146
pushq $0x4
popq %rsi
callq 0x132c
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/httpServer.c
// Function: handleClientRequest
void handleClientRequest(int clientSocket, char* request) {
    printf("received message:\n");

    printWithEscapeCharacters(stdout, request);
    printf("\n");

    printf("\n");

    printf("sent message:\n");

    send(clientSocket, defaultHeader, strlen(defaultHeader), 0);
    printWithEscapeCharacters(stdout, defaultHeader);
    printf("\n");

    send(clientSocket, defaultBody, strlen(defaultBody), 0);
    printWithEscapeCharacters(stdout, defaultBody);
    printf("\n");

    printf("\n");

    CLOSESOCKET(clientSocket);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
leaq 0xeccc(%rip), %rdi      # 0x10178
callq 0x1070
movq 0x14b18(%rip), %r12     # 0x15fd0
movq (%r12), %rdi
movq %r14, %rsi
callq 0x1356
pushq $0xa
popq %r14
movl %r14d, %edi
callq 0x1050
movl %r14d, %edi
callq 0x1050
leaq 0xecab(%rip), %rdi      # 0x1018a
callq 0x1070
movq 0x14c2d(%rip), %r15     # 0x16118
movq %r15, %rdi
callq 0x10b0
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x10c0
movq (%r12), %rdi
movq 0x14c0b(%rip), %rsi     # 0x16118
callq 0x1356
movl %r14d, %edi
callq 0x1050
movq 0x14bff(%rip), %r15     # 0x16120
movq %r15, %rdi
callq 0x10b0
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x10c0
movq (%r12), %rdi
movq 0x14bdd(%rip), %rsi     # 0x16120
callq 0x1356
movl %r14d, %edi
callq 0x1050
movl %r14d, %edi
callq 0x1050
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/httpServer.c
// Function: main
int main(int argc, char **argv) {
    int serverSocket = 0;
    int clientSocket = 0;
    int receivedCharacters = 0;
    char messageBuffer[BUFFER_SIZE];
    ConfigurationRef config = configCreate();

    checkArguments(argc, argv, config);

    // conditional calls to winsock methods //
    #ifdef _WINDOWS_DETECTED_
      int status = WSAStartup(MAKEWORD(2, 0), &wsaData);
      if (status != 0) {
          exitWithError("main: could not perform startup on Windows",
              EC_WSASTARTUP_FAILURE);
      }
    #endif

    serverSocket = setupServer(config);

    printf("awaiting client connections...\n\n");

    while (1) {
        clientSocket = accept(serverSocket, NULL, NULL);
        printf("client connected!\n\n");

        receivedCharacters = recv(clientSocket, messageBuffer, BUFFER_SIZE, 0);
        if (receivedCharacters < 1) {
            printf("---ERROR RETRIEVING CLIENT REQUEST---\n");
            if (receivedCharacters == 0) printf(" -client already shutdown\n");
            if (receivedCharacters < 0) printf(" -socket error, check errno\n");
            //CLOSESOCKET(clientSocket);
            continue;
        }

        handleClientRequest(clientSocket, messageBuffer);
    }

    CLOSESOCKET(serverSocket);

    // conditional calls to winsock methods //
    #ifdef _WINDOWS_DETECTED_
      WSACleanup();
    #endif

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %rbx
movl %edi, %r14d
callq 0x1628
movq %rax, %r15
movl %r14d, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x13e3
movq %r15, %rdi
callq 0x13fb
movl %eax, %ebx
leaq 0xebf0(%rip), %rdi      # 0x10198
callq 0x1070
leaq 0xec04(%rip), %r14      # 0x101b8
leaq -0x1030(%rbp), %r15
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x11b0
movl %eax, %r13d
movq %r14, %rdi
callq 0x1070
movl $0x1000, %edx           # imm = 0x1000
movl %r13d, %edi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x1040
movq %rax, %r12
testl %r12d, %r12d
jle 0x15f8
movl %r13d, %edi
movq %r15, %rsi
callq 0x1495
jmp 0x15bb
leaq 0xebcc(%rip), %rdi      # 0x101cb
callq 0x1070
testl %r12d, %r12d
je 0x1617
leaq 0xebfb(%rip), %rdi      # 0x1020b
callq 0x1070
jmp 0x15bb
leaq 0xebd3(%rip), %rdi      # 0x101f1
callq 0x1070
jmp 0x15bb
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/config.c
// Function: configCreate
ConfigurationRef configCreate() {
    ConfigurationRef config = malloc(sizeof(struct Configuration));
    if (config != NULL) {
        config->port = 8080;
    }

    return config;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq $0x2
popq %rdi
callq 0x1140
testq %rax, %rax
je 0x163e
movw $0x1f90, (%rax)         # imm = 0x1F90
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/config.c
// Function: configLoadDocument
enum ConfigurationStatus _configLoadDocument(ConfigurationRef config, yaml_document_t *document) {
    enum ConfigurationStatus status = CONFIG_SUCCESS;

    yaml_node_t *rootNode =  yaml_document_get_root_node(document);
    if (rootNode->type == YAML_MAPPING_NODE) {

        yaml_node_pair_t *pair = rootNode->data.mapping.pairs.start;
        for (; pair != rootNode->data.mapping.pairs.top; pair++) {
            yaml_node_t *keyNode = yaml_document_get_node(document, pair->key);
            yaml_node_t *valueNode = yaml_document_get_node(document, pair->value);
            
            status = configSetOption(
                config,
                (const char *)keyNode->data.scalar.value,
                (const char *)valueNode->data.scalar.value);

            if (status != CONFIG_SUCCESS) {
                break;
            }
        }
    }
    else {
        status = CONFIG_INVALID_ROOT_ERROR;
    }

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3881
cmpl $0x3, (%rax)
jne 0x16ce
movq %rax, %r15
movq 0x10(%rax), %r13
cmpq 0x20(%r15), %r13
je 0x16d3
movl (%r13), %esi
movq %rbx, %rdi
callq 0x3838
movq %rax, %r12
movl 0x4(%r13), %esi
movq %rbx, %rdi
callq 0x3838
movq 0x10(%r12), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x16e4
addq $0x8, %r13
testl %eax, %eax
je 0x1692
jmp 0x16d5
pushq $0x3
popq %rax
jmp 0x16d5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/config.c
// Function: configSetOption
enum ConfigurationStatus configSetOption(ConfigurationRef config, const char *name, const char *value) {
    assert(config != NULL);
    assert(name != NULL);
    assert(value != NULL);

    // ideally should use some sort of mapping
    if (strcmp(name, "port") == 0) {
        
        errno = 0;
        unsigned short portNumber = (unsigned short)strtoul(value, NULL, 10);

        if (errno == EINVAL || errno == ERANGE) {
            return CONFIG_INVALID_VALUE_ERROR;
        }
        config->port = portNumber;

    } 
    else {
        return CONFIG_NO_SUCH_OPTION_ERROR;
    }

    return CONFIG_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x175d
testq %rsi, %rsi
je 0x1776
movq %rdx, %r14
testq %rdx, %rdx
je 0x178f
movq %rdi, %rbx
leaq 0xec7f(%rip), %rax      # 0x1038d
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1110
testl %eax, %eax
je 0x172b
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x1060
movq %rax, %r15
andl $0x0, (%rax)
pushq $0xa
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x11c0
movq %rax, %rcx
movl (%r15), %edx
pushq $0x2
popq %rax
cmpl $0x16, %edx
je 0x1720
cmpl $0x22, %edx
je 0x1720
movw %cx, (%rbx)
xorl %eax, %eax
jmp 0x1720
leaq 0xeac3(%rip), %rdi      # 0x10227
leaq 0xeacb(%rip), %rsi      # 0x10236
leaq 0xeba9(%rip), %rcx      # 0x1031b
pushq $0x73
jmp 0x17a6
leaq 0xebf5(%rip), %rdi      # 0x10372
leaq 0xeab2(%rip), %rsi      # 0x10236
leaq 0xeb90(%rip), %rcx      # 0x1031b
pushq $0x74
jmp 0x17a6
leaq 0xebe9(%rip), %rdi      # 0x1037f
leaq 0xea99(%rip), %rsi      # 0x10236
leaq 0xeb77(%rip), %rcx      # 0x1031b
pushq $0x75
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/config.c
// Function: configLoadString
enum ConfigurationStatus configLoadString(ConfigurationRef config, const char *inputString) {
    assert(config != NULL);
    assert(inputString != NULL);

    enum ConfigurationStatus status = CONFIG_SUCCESS;
    int inputLength = strlen(inputString);
    yaml_parser_t parser;
    yaml_document_t document;

    yaml_parser_initialize(&parser);
    yaml_parser_set_input_string(&parser, (const unsigned char *)inputString, inputLength);
    yaml_parser_load(&parser, &document);

    status = _configLoadDocument(config, &document);

    yaml_parser_delete(&parser);
    yaml_document_delete(&document);

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x250, %rsp            # imm = 0x250
testq %rdi, %rdi
je 0x183b
movq %rsi, %r14
testq %rsi, %rsi
je 0x1854
movq %rdi, %rbx
movq %r14, %rdi
callq 0x10b0
movq %rax, %r15
leaq -0x268(%rbp), %r12
movq %r12, %rdi
callq 0x1b83
movslq %r15d, %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x20c6
leaq -0x88(%rbp), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x3f10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x166a
movl %eax, %ebx
movq %r12, %rdi
callq 0x1ee0
movq %r14, %rdi
callq 0x374e
movl %ebx, %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe9e5(%rip), %rdi      # 0x10227
leaq 0xe9ed(%rip), %rsi      # 0x10236
leaq 0xea14(%rip), %rcx      # 0x10264
pushq $0x3f
jmp 0x186b
leaq 0xea53(%rip), %rdi      # 0x102ae
leaq 0xe9d4(%rip), %rsi      # 0x10236
leaq 0xe9fb(%rip), %rcx      # 0x10264
pushq $0x40
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/config.c
// Function: configLoadFile
enum ConfigurationStatus configLoadFile(ConfigurationRef config, const char *filepath) {
    assert(config != NULL);
    assert(filepath != NULL);

    enum ConfigurationStatus status = CONFIG_SUCCESS;
    yaml_parser_t parser;
    yaml_document_t document;

    FILE *file = fopen(filepath, "r");
    
    yaml_parser_initialize(&parser);
    yaml_parser_set_input_file(&parser, file);
    yaml_parser_load(&parser, &document);

    status = _configLoadDocument(config, &document);

    fclose(file);
    yaml_parser_delete(&parser);
    yaml_document_delete(&document);

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x250, %rsp            # imm = 0x250
testq %rdi, %rdi
je 0x1910
testq %rsi, %rsi
je 0x1929
movq %rdi, %rbx
leaq 0x10486(%rip), %rax     # 0x11d25
movq %rsi, %rdi
movq %rax, %rsi
callq 0x11a0
movq %rax, %r14
leaq -0x268(%rbp), %r15
movq %r15, %rdi
callq 0x1b83
movq %r15, %rdi
movq %r14, %rsi
callq 0x219a
leaq -0x88(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3f10
movq %rbx, %rdi
movq %r12, %rsi
callq 0x166a
movl %eax, %ebx
movq %r14, %rdi
callq 0x10a0
movq %r15, %rdi
callq 0x1ee0
movq %r12, %rdi
callq 0x374e
movl %ebx, %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe910(%rip), %rdi      # 0x10227
leaq 0xe918(%rip), %rsi      # 0x10236
leaq 0xe99d(%rip), %rcx      # 0x102c2
pushq $0x54
jmp 0x1940
leaq 0xe9da(%rip), %rdi      # 0x1030a
leaq 0xe8ff(%rip), %rsi      # 0x10236
leaq 0xe984(%rip), %rcx      # 0x102c2
pushq $0x55
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/openshmem-org[P]openshmem-examples/c/fadd.c
// Function: main
int
main()
{
    int me;
    int old;

    shmem_init();
    me = shmem_my_pe();

    old = -1;
    dst = 22;
    shmem_barrier_all();

    if (me == 1) {
        old = shmem_int_atomic_fetch_add(&dst, 44, 0);
    }
    shmem_barrier_all();

    printf("%d: old = %d, dst = %d\n", me, old, dst);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
callq 0x1070
callq 0x1050
movl %eax, %ebx
movl $0x16, 0x2eb7(%rip)     # 0x405c
callq 0x1060
cmpl $0x1, %ebx
jne 0x11c4
leaq 0x2ea6(%rip), %rdi      # 0x405c
pushq $0x2c
popq %rsi
xorl %edx, %edx
callq 0x1080
movl %eax, %ebp
jmp 0x11c7
pushq $-0x1
popq %rbp
callq 0x1060
movl 0x2e8a(%rip), %ecx      # 0x405c
leaq 0xe2b(%rip), %rdi       # 0x2004
movl %ebx, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1030
callq 0x1040
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/examples/noop.c
// Function: main
int main(GT_UNUSED int argc, GT_UNUSED char *argv[])
{
  gt_lib_init();
  if (gt_version_check(GT_MAJOR_VERSION, GT_MINOR_VERSION, GT_MICRO_VERSION)) {
    fprintf(stderr, "error: %s\n", gt_version_check(GT_MAJOR_VERSION,
                                                    GT_MINOR_VERSION,
                                                    GT_MICRO_VERSION));
    return EXIT_FAILURE;
  }

  if (gt_lib_clean())
    return GT_EXIT_PROGRAMMING_ERROR; /* programmer error */
  return EXIT_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x47f0
pushq $0x1
popq %rbx
pushq $0x6
popq %rdx
movl %ebx, %edi
movl %edx, %esi
callq 0xe654
testq %rax, %rax
jne 0x47c1
callq 0x4a37
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
addl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x49810(%rip), %rax     # 0x4dfd8
movq (%rax), %r14
pushq $0x6
popq %rdx
movl %ebx, %edi
movl %edx, %esi
callq 0xe654
leaq 0x30826(%rip), %rsi     # 0x35004
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4480
jmp 0x47b7
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/version.c
// Function: gt_version_check
const char* gt_version_check(unsigned int required_major,
                             unsigned int required_minor,
                             unsigned int required_micro)
{
  if (required_major > GT_MAJOR_VERSION)
    return "GenomeTools library version too old (major mismatch)";
  if (required_major < GT_MAJOR_VERSION)
    return "GenomeTools library version too new (major mismatch)";
  if (required_minor > GT_MINOR_VERSION)
    return "GenomeTools library version too old (minor mismatch)";
  if (required_micro > GT_MICRO_VERSION)
    return "GenomeTools library version too old (micro mismatch)";
  return NULL;
}

// Assembly:
cmpl $0x1, %edi
jbe 0xe661
leaq 0x2961b(%rip), %rax     # 0x37c7b
retq
testl %edi, %edi
je 0xe672
cmpl $0x6, %esi
jbe 0xe67a
leaq 0x29674(%rip), %rax     # 0x37ce5
retq
leaq 0x29637(%rip), %rax     # 0x37cb0
retq
xorl %eax, %eax
cmpl $0x7, %edx
leaq 0x29694(%rip), %rcx     # 0x37d1a
cmovaeq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/touch.c
// Function: main
int main(int argc, char **argv){
    if(argc == 1){
        fprintf(stderr, "%s: missing file operand\n", argv[0]);
        return 1;
    }
    for(int i = 1; argv[i] != NULL; i++){
        if(utime(argv[i], NULL) == -1){
            fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
            return 1;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x1, %edi
je 0x11cf
leaq 0x8(%rbx), %r15
xorl %r14d, %r14d
movq (%r15), %rdi
testq %rdi, %rdi
je 0x11ee
xorl %esi, %esi
callq 0x1030
addq $0x8, %r15
cmpl $-0x1, %eax
jne 0x1185
movq 0x2e54(%rip), %rax      # 0x3ff8
movq (%rax), %r14
movq (%rbx), %rbx
callq 0x1040
movl (%rax), %edi
callq 0x1060
leaq 0xe61(%rip), %rsi       # 0x201e
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
jmp 0x11ea
movq 0x2e22(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0xe21(%rip), %rsi       # 0x2004
xorl %eax, %eax
callq 0x1050
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/oreparaz[P]dudect/examples/simple/example.c
// Function: prepare_inputs
void prepare_inputs(dudect_config_t *c, uint8_t *input_data, uint8_t *classes) {
  randombytes(input_data, c->number_measurements * c->chunk_size);
  for (size_t i = 0; i < c->number_measurements; i++) {
    /* it is important to randomize the class sequence */
    classes[i] = randombit();
    if (classes[i] == 0) {
      memset(input_data + (size_t)i * c->chunk_size, 0x00, c->chunk_size);
    } else {
      // leave random
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rsi
imulq 0x8(%rdi), %rsi
movq %r14, %rdi
callq 0x11fc
xorl %r12d, %r12d
cmpq 0x8(%r15), %r12
jae 0x16cb
callq 0x12a5
movb %al, (%rbx,%r12)
testb %al, %al
jne 0x16c6
movq (%r15), %rdx
movq %rdx, %rdi
imulq %r12, %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x1090
incq %r12
jmp 0x169f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sguerrini97[P]ps3linux-ps3vuart-tools/ps3av/dev.c
// Function: dev_read
int
dev_read(void *buf, size_t len)
{
	char tmp[4096];
	struct ps3av_reply *reply;
	int ret;

	if (fd < 0)
		return (-1);

	reply = (struct ps3av_reply *) tmp;

	while (1) {
		ret = read(fd, &reply->hdr, sizeof(reply->hdr));
		if (ret < 0) {
			if (errno != EAGAIN)
				return (-1);
		} else if (ret > 0) {
			break;
		}
	}

	while (1) {
		ret = read(fd, &reply->cmd, reply->hdr.length);
		if (ret < 0) {
			if (errno != EAGAIN)
				return (-1);
		} else if (ret > 0) {
			break;
		}
	}

	if (len > (sizeof(reply->hdr) + reply->hdr.length))
		len = sizeof(reply->hdr) + reply->hdr.length;

	memcpy(buf, tmp, len);

	return (len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %r14
movl 0x2dae(%rip), %edi      # 0x4190
pushq $-0x1
popq %rbx
testl %edi, %edi
js 0x1461
movq %rsi, %r15
movq %rsp, %r12
pushq $0x4
popq %r13
movq %r12, %rsi
movq %r13, %rdx
callq 0x1070
testl %eax, %eax
js 0x1406
je 0x1410
jmp 0x1418
callq 0x1030
cmpl $0xb, (%rax)
jne 0x1461
movl 0x2d7a(%rip), %edi      # 0x4190
jmp 0x13f3
leaq 0x4(%rsp), %r12
movl 0x2d6d(%rip), %edi      # 0x4190
movzwl 0x2(%rsp), %edx
movq %r12, %rsi
callq 0x1070
testl %eax, %eax
js 0x1438
je 0x141d
jmp 0x1444
callq 0x1030
cmpl $0xb, (%rax)
je 0x141d
jmp 0x1461
movq %rsp, %rsi
movzwl 0x2(%rsi), %ebx
addq $0x4, %rbx
cmpq %r15, %rbx
cmovaeq %r15, %rbx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x10a0
movl %ebx, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sguerrini97[P]ps3linux-ps3vuart-tools/ps3av/cmd/cmd_av_get_hdcp_ksv.c
// Function: cmd_av_get_hdcp_ksv_exec
int
cmd_av_get_hdcp_ksv_exec(int cmdc, struct cmd **cmdv, int argc, char **argv)
{
	struct ps3av_request req;
	struct ps3av_av_get_hdcp_ksv_reply av_get_hdcp_ksv_reply;
	int ret;

	ps3av_init_request(&req, sizeof(req) - sizeof(struct ps3av_header),
	    PS3AV_CMD_AV_GET_HDCP_KSV);

	ret = dev_write(&req, sizeof(req));
	if (ret != sizeof(req))
		return (CMD_EIO);

	ret = dev_read(&av_get_hdcp_ksv_reply, sizeof(av_get_hdcp_ksv_reply));
	if (ret != sizeof(av_get_hdcp_ksv_reply))
		return (CMD_EIO);

	if (av_get_hdcp_ksv_reply.reply.status != PS3AV_STATUS_SUCCESS)
		return (CMD_EIO);

	fwrite(av_get_hdcp_ksv_reply.ksv, 1, av_get_hdcp_ksv_reply.ksv_length, stdout);

	return (CMD_EOK);
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movabsq $0xc00040205, %rax      # imm = 0xC00040205
leaq 0xc(%rsp), %rdi
movq %rax, (%rdi)
pushq $0x8
popq %rsi
callq 0x13aa
pushq $0x3
popq %rbx
cmpl $0x8, %eax
jne 0x14d0
leaq 0x14(%rsp), %rdi
pushq $0x1c
popq %rsi
callq 0x13c9
cmpl $0x1c, %eax
jne 0x14d0
cmpl $0x0, 0x1c(%rsp)
jne 0x14d0
leaq 0x24(%rsp), %rdi
movl -0x4(%rdi), %edx
movq 0x2b05(%rip), %rax      # 0x3fc8
movq (%rax), %rcx
pushq $0x1
popq %rsi
callq 0x10f0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/sguerrini97[P]ps3linux-ps3vuart-tools/ps3av/cmd/cmd_av_get_hw_conf.c
// Function: cmd_av_get_hw_conf_exec
int
cmd_av_get_hw_conf_exec(int cmdc, struct cmd **cmdv, int argc, char **argv)
{
	struct ps3av_request req;
	struct ps3av_av_get_hw_conf_reply av_get_hw_conf_reply;
	int ret;

	ps3av_init_request(&req, sizeof(req) - sizeof(struct ps3av_header),
	    PS3AV_CMD_AV_GET_HW_CONF);

	ret = dev_write(&req, sizeof(req));
	if (ret != sizeof(req))
		return (CMD_EIO);

	ret = dev_read(&av_get_hw_conf_reply, sizeof(av_get_hw_conf_reply));
	if (ret != sizeof(av_get_hw_conf_reply))
		return (CMD_EIO);

	if (av_get_hw_conf_reply.reply.status != PS3AV_STATUS_SUCCESS)
		return (CMD_EIO);

	fprintf(stdout, "%d %d %d\n", av_get_hw_conf_reply.nr_hdmi,
	    av_get_hw_conf_reply.nr_avmulti, av_get_hw_conf_reply.nr_spdif);

	return (CMD_EOK);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movabsq $0x300040205, %rax      # imm = 0x300040205
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
pushq $0x8
popq %rsi
callq 0x13aa
pushq $0x3
popq %rbx
cmpl $0x8, %eax
jne 0x1542
leaq 0x4(%rsp), %rdi
pushq $0x14
popq %rsi
callq 0x13c9
cmpl $0x14, %eax
jne 0x1542
cmpl $0x0, 0xc(%rsp)
jne 0x1542
movq 0x2aa9(%rip), %rax      # 0x3fc8
movq (%rax), %rdi
movzwl 0x10(%rsp), %edx
movzwl 0x12(%rsp), %ecx
movzwl 0x14(%rsp), %r8d
leaq 0xbec(%rip), %rsi       # 0x2125
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1090
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/sguerrini97[P]ps3linux-ps3vuart-tools/ps3av/cmd/cmd_av_video_mute.c
// Function: cmd_av_video_mute_exec
int
cmd_av_video_mute_exec(int cmdc, struct cmd **cmdv, int argc, char **argv)
{
	struct ps3av_av_video_mute av_video_mute_req;
	struct ps3av_reply reply;
	char *endptr;
	unsigned int port, mute;
	int ret;

	port = strtoul(argv[0], &endptr, 0);
	if (*endptr != '\0')
		return (CMD_EINVAL);

	mute = strtoul(argv[1], &endptr, 0);
	if (*endptr != '\0')
		return (CMD_EINVAL);

	ps3av_init_request(PS3AV_REQ(&av_video_mute_req),
	    sizeof(av_video_mute_req) - sizeof(struct ps3av_header),
	    PS3AV_CMD_AV_VIDEO_MUTE);

	av_video_mute_req.port = port;
	av_video_mute_req.mute = mute;

	ret = dev_write(&av_video_mute_req, sizeof(av_video_mute_req));
	if (ret != sizeof(av_video_mute_req))
		return (CMD_EIO);

	ret = dev_read(&reply, sizeof(reply));
	if (ret != sizeof(reply))
		return (CMD_EIO);

	if (reply.status != PS3AV_STATUS_SUCCESS)
		return (CMD_EIO);

	return (CMD_EOK);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movq (%rcx), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
xorl %edx, %edx
callq 0x10d0
movq %rax, %r14
movq (%rbx), %rax
pushq $0x2
popq %rbx
cmpb $0x0, (%rax)
jne 0x1731
movq 0x8(%r15), %rdi
movq %rsp, %r15
movq %r15, %rsi
xorl %edx, %edx
callq 0x10d0
movq (%r15), %rcx
cmpb $0x0, (%rcx)
jne 0x1731
movabsq $0x1000200080205, %rcx  # imm = 0x1000200080205
leaq 0x14(%rsp), %rdi
movq %rcx, (%rdi)
movw %r14w, 0x8(%rdi)
movw %ax, 0xa(%rdi)
pushq $0xc
popq %rsi
callq 0x13aa
pushq $0x3
popq %rbx
cmpl $0xc, %eax
jne 0x1731
leaq 0x8(%rsp), %rdi
pushq $0xc
popq %rsi
callq 0x13c9
cmpl $0xc, %eax
jne 0x1731
xorl %eax, %eax
cmpl $0x0, 0x10(%rsp)
setne %al
leal (%rax,%rax,2), %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/sguerrini97[P]ps3linux-ps3vuart-tools/ps3av/cmd/cmd_video_pitch.c
// Function: cmd_video_pitch_exec
int
cmd_video_pitch_exec(int cmdc, struct cmd **cmdv, int argc, char **argv)
{
	struct ps3av_video_pitch video_pitch_req;
	struct ps3av_reply reply;
	char *endptr;
	unsigned int head, pitch;
	int ret;

	head = strtoul(argv[0], &endptr, 0);
	if (*endptr != '\0')
		return (CMD_EINVAL);

	pitch = strtoul(argv[1], &endptr, 0);
	if (*endptr != '\0')
		return (CMD_EINVAL);

	ps3av_init_request(PS3AV_REQ(&video_pitch_req),
	    sizeof(video_pitch_req) - sizeof(struct ps3av_header),
	    PS3AV_CMD_VIDEO_PITCH);

	video_pitch_req.head = head;
	video_pitch_req.pitch = pitch;

	ret = dev_write(&video_pitch_req, sizeof(video_pitch_req));
	if (ret != sizeof(video_pitch_req))
		return (CMD_EIO);

	ret = dev_read(&reply, sizeof(reply));
	if (ret != sizeof(reply))
		return (CMD_EIO);

	if (reply.status != PS3AV_STATUS_SUCCESS)
		return (CMD_EIO);

	return (CMD_EOK);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r15
movq (%rcx), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
xorl %edx, %edx
callq 0x10d0
movq %rax, %r14
movq (%rbx), %rax
pushq $0x2
popq %rbx
cmpb $0x0, (%rax)
jne 0x17cf
movq 0x8(%r15), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
xorl %edx, %edx
callq 0x10d0
movq (%r15), %rcx
cmpb $0x0, (%rcx)
jne 0x17cf
movabsq $0x1000005000c0205, %rcx # imm = 0x1000005000C0205
leaq 0x20(%rsp), %rdi
movq %rcx, (%rdi)
movl %r14d, 0x8(%rdi)
movl %eax, 0xc(%rdi)
pushq $0x10
popq %rsi
callq 0x13aa
pushq $0x3
popq %rbx
cmpl $0x10, %eax
jne 0x17cf
leaq 0x14(%rsp), %rdi
pushq $0xc
popq %rsi
callq 0x13c9
cmpl $0xc, %eax
jne 0x17cf
xorl %eax, %eax
cmpl $0x0, 0x1c(%rsp)
setne %al
leal (%rax,%rax,2), %ebx
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/GRUPO1MM1INTRO-2020-1[P]1MM1INTRO/20190820_1MM1_INTRO/porvalor_porreferencia.c
// Function: intercambiar1
void intercambiar1(float *A,float *B)
{
  float tmp;
  tmp=*A;
  *A=*B;
  *B=tmp;
  mostrar1(*A,*B);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movss (%rdi), %xmm0
movss (%rsi), %xmm1
movss %xmm1, (%rdi)
movss %xmm0, (%rsi)
leaq 0xe1e(%rip), %r15       # 0x200c
leaq 0xe28(%rip), %rsi       # 0x201d
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
cvtss2sd (%r14), %xmm0
leaq 0xe06(%rip), %r14       # 0x2011
movq %r14, %rdi
movb $0x1, %al
callq 0x1050
leaq 0xe04(%rip), %rsi       # 0x2020
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
cvtss2sd (%rbx), %xmm0
movq %r14, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/GRUPO1MM1INTRO-2020-1[P]1MM1INTRO/20190820_1MM1_INTRO/porvalor_porreferencia.c
// Function: main
int main(int argc,char *argv[])
{
  float x,y;
  x=1.4142;
  y=3.1416;
  printf("Version: ");
  VERSION(X,Y,Z);
  printf("\nmain:\n");
  mostrar2(float,x,y);
  printf("\n/***********************************************/\n");
  printf("\n");
  printf("intercambiar:\n");
  intercambiar(x,y);/*paso de argumentos por valor*/
  printf("\nmain:\n");
  mostrar2(float,x,y);
  printf("\n/***********************************************/\n");
  printf("\n");
  printf("intercambiar1:\n");
  intercambiar1(&x,&y);/*paso de argumentos por referencia*/
  printf("\nmain:\n");
  mostrar2(float,x,y);
  printf("\n/***********************************************/\n");
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq -0x30(%rbp), %rax
movl $0x3fb50481, (%rax)     # imm = 0x3FB50481
leaq -0x2c(%rbp), %rax
movl $0x40490ff9, (%rax)     # imm = 0x40490FF9
leaq 0xdbc(%rip), %rdi       # 0x2023
xorl %eax, %eax
callq 0x1050
leaq 0xdb8(%rip), %rdi       # 0x202d
leaq 0x2dc4(%rip), %rsi      # 0x4040
leaq 0x2dc2(%rip), %rdx      # 0x4045
leaq 0x2dbe(%rip), %rcx      # 0x4048
xorl %eax, %eax
callq 0x1050
leaq 0xde6(%rip), %rdi       # 0x207e
callq 0x1040
leaq 0xd68(%rip), %r15       # 0x200c
leaq 0xd8b(%rip), %rbx       # 0x2036
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
movss 0xd44(%rip), %xmm0      # 0x2004
callq 0x13ea
leaq 0xd6c(%rip), %r14       # 0x2038
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movss 0xd27(%rip), %xmm0      # 0x2008
callq 0x13ea
leaq 0xd98(%rip), %r13       # 0x2085
movq %r13, %rdi
callq 0x1040
pushq $0xa
popq %r12
movl %r12d, %edi
callq 0x1030
leaq 0xd59(%rip), %rdi       # 0x2061
callq 0x1040
movss 0xcef(%rip), %xmm0      # 0x2004
movss 0xceb(%rip), %xmm1      # 0x2008
callq 0x115c
leaq 0xd55(%rip), %rdi       # 0x207e
callq 0x1040
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
movss 0xcc1(%rip), %xmm0      # 0x2004
callq 0x13ea
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movss 0xcab(%rip), %xmm0      # 0x2008
callq 0x13ea
movq %r13, %rdi
callq 0x1040
movl %r12d, %edi
callq 0x1030
leaq 0xcf6(%rip), %rdi       # 0x206f
callq 0x1040
leaq -0x30(%rbp), %r13
movq %r13, %rdi
leaq -0x2c(%rbp), %r12
movq %r12, %rsi
callq 0x11c7
leaq 0xce6(%rip), %rdi       # 0x207e
callq 0x1040
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
movss (%r13), %xmm0
callq 0x13ea
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movss (%r12), %xmm0
callq 0x13ea
leaq 0xcb1(%rip), %rdi       # 0x2085
callq 0x1040
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/snowcrash/snowcrash.c
// Function: main
int main(int argc, char *argv[])
{
  int x, y, maxy, maxx;

  srand(time(NULL));

  initscr();
  atexit((void *)endwin);
  noecho();
  timeout(0);

  while (1) {
    if (getch() != ERR)
      return 0; /* Stop on any key press. */

    getmaxyx(stdscr, maxy, maxx);
    for (y = 0; y < maxy; y++) {
      for (x = 0; x < maxx; x++) {
        mvaddch(y, x, (rand() % 0x5E) + 0x21); /* 0x21 -> 0x7E */
      }
    }
    refresh();
    usleep(40000); /* ~24 frames per second. */
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0x1090
movl %eax, %edi
callq 0x1070
callq 0x1050
movq 0x2ddf(%rip), %rdi      # 0x3ff0
callq 0x12e0
callq 0x1040
movq 0x2db6(%rip), %r15      # 0x3fd8
movq (%r15), %rdi
xorl %esi, %esi
callq 0x1080
pushq $0x5e
popq %r13
movq (%r15), %rdi
callq 0x1030
cmpl $-0x1, %eax
jne 0x12c6
movq (%r15), %rax
pushq $-0x1
popq %r12
movl %r12d, %ecx
testq %rax, %rax
je 0x125e
movswl 0x4(%rax), %ecx
incl %ecx
movswl 0x6(%rax), %r12d
incl %r12d
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
testl %ecx, %ecx
cmovlel %ebx, %ecx
movl %ecx, 0x4(%rsp)
cmpl %ecx, %ebx
je 0x12af
xorl %ebp, %ebp
cmpl %ebp, %r12d
je 0x12a7
movq (%r15), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x10a0
cmpl $-0x1, %eax
je 0x12a3
movq (%r15), %r14
callq 0x10d0
cltd
idivl %r13d
leal 0x21(%rdx), %esi
movq %r14, %rdi
callq 0x10c0
incl %ebp
jmp 0x1276
incl %ebx
movl 0x4(%rsp), %ecx
jmp 0x1270
movq (%r15), %rdi
callq 0x1060
movl $0x9c40, %edi           # imm = 0x9C40
callq 0x10e0
jmp 0x1230
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/hts_endian.c
// Function: to_hex
static char * to_hex(uint8_t *buf, int len) {
    static char str[64];
    int i, o;

    for (i = 0, o = 0; i < len; i++, o += 3) {
        snprintf(str + o, sizeof(str) - o, "%02x ", buf[i]);
    }
    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
leaq (%rsi,%rsi,2), %r13
pushq $0x40
popq %r14
leaq 0x3026(%rip), %r15      # 0x43b0
leaq 0xdb9(%rip), %r12       # 0x214a
leaq (%r14,%r13), %rax
cmpq $0x40, %rax
je 0x13bb
movzbl (%rbx), %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1040
addq $-0x3, %r14
addq $0x3, %r15
incq %rbx
jmp 0x1391
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/main.c
// Function: closeClientRequest
static void closeClientRequest(int i)
{
  ssize_t r;
  char    buf[4];

  logDebug("closeClientRequest: read i=%d\n", i);
  r = read(stream[i].fd, buf, sizeof(buf));

  logDebug("close-on-eof %s r=%d i=%d fd=%d %s\n", streamTypeName[stream[i].type], (int) r, i, stream[i].fd, strerror(errno));
  closeStream(i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x5c0c(%rip), %rdi      # 0x8c59
movl %ebx, %esi
xorl %eax, %eax
callq 0x6d78
movslq %ebx, %rbx
imulq $0x8038, %rbx, %r15     # imm = 0x8038
leaq 0xa4c9(%rip), %r12      # 0xd530
movl (%r15,%r12), %edi
leaq 0xc(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x21b0
movq %rax, %r14
movl (%r15,%r12), %ebp
movl 0x4(%r15,%r12), %eax
leaq 0xa185(%rip), %rcx      # 0xd210
movq (%rcx,%rax,8), %r15
callq 0x2050
movl (%rax), %edi
callq 0x2370
leaq 0x5bd6(%rip), %rdi      # 0x8c78
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movl %ebp, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x6d78
movl %ebx, %edi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3e5c
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/main.c
// Function: acceptClient
void acceptClient(SOCKET s, StreamType ct)
{
  SOCKET             r;
  struct sockaddr_in clientAddr;
  socklen_t          clientAddrLen;

  for (;;)
  {
    clientAddrLen = sizeof(clientAddr);
    r             = accept(s, (struct sockaddr *) &clientAddr, &clientAddrLen);
    if (r == INVALID_SOCKET)
    {
      /* No socket ready, just ignore */
      return;
    }

    /* New client found, mark it as such */
    if (setFdUsed(r, ct) < 0)
    {
      /* Too many open clients, ignore */
      return;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movl %edi, %ebp
leaq 0x8(%rsp), %r14
leaq 0x4(%rsp), %r15
movl $0x10, 0x4(%rsp)
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x22e0
cmpl $-0x1, %eax
je 0x31b1
movl %eax, %edi
movl %ebx, %esi
callq 0x31bc
testl %eax, %eax
jns 0x318a
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/main.c
// Function: parseUDPAddress
bool parseUDPAddress(char *target, char *port)
{
  int              r;
  struct addrinfo  hints;
  struct addrinfo *res, *res0;

  hints.ai_flags    = 0;
  hints.ai_family   = PF_INET;
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_protocol = IPPROTO_UDP;
  hints.ai_flags    = AI_NUMERICHOST;

  r = getaddrinfo(target, port, &hints, &res0);
  if (r)
  {
    return false;
  }
  for (res = res0; res; res = res->ai_next)
  {
    if (res->ai_addrlen == sizeof udpWildcardAddress)
    {
      memcpy(&udpWildcardAddress, res->ai_addr, sizeof udpWildcardAddress);
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movaps 0x4c86(%rip), %xmm0     # 0x8010
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
leaq 0x8(%rsp), %rbx
movq %rbx, %rcx
callq 0x2360
testl %eax, %eax
jne 0x33b7
jmp 0x33af
cmpl $0x10, 0x10(%rbx)
je 0x33bf
addq $0x28, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x33a5
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
retq
movq 0x18(%rbx), %rax
movups (%rax), %xmm0
movups %xmm0, 0x9fbf(%rip)     # 0xd38c
movb $0x1, %al
jmp 0x33b9
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/main.c
// Function: setHaveNMEA0183Client
static void setHaveNMEA0183Client(void)
{
  int i;

  haveNMEA0183Client = udp183;
  if (!haveNMEA0183Client)
  {
    for (i = 0; i <= socketIdxMax; i++)
    {
      if (stream[i].fd != INVALID_SOCKET
          && (stream[i].type == CLIENT_NMEA0183_STREAM || stream[i].type == SERVER_NMEA0183_DATAGRAM
              || stream[i].type == DATA_OUTPUT_NMEA0183_STREAM))
      {
        haveNMEA0183Client = true;
        return;
      }
    }
  }
}

// Assembly:
movb 0x970e(%rip), %al       # 0xd520
movb %al, 0x9570(%rip)       # 0xd388
testb %al, %al
jne 0x3e5b
movslq 0x955d(%rip), %rax      # 0xd380
leaq 0x970a(%rip), %rcx      # 0xd534
xorl %edx, %edx
movl $0x41020, %esi          # imm = 0x41020
cmpq %rax, %rdx
jg 0x3e5b
cmpl $-0x1, -0x4(%rcx)
je 0x3e48
movl (%rcx), %edi
cmpl $0x12, %edi
ja 0x3e48
btl %edi, %esi
jb 0x3e54
incq %rdx
addq $0x8038, %rcx           # imm = 0x8038
jmp 0x3e31
movb $0x1, 0x952d(%rip)      # 0xd388
retq
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/main.c
// Function: closeStream
static void closeStream(int i)
{
  int j;

  close(stream[i].fd);
  FD_CLR(stream[i].fd, &activeSet);
  FD_CLR(stream[i].fd, &readSet);
  FD_CLR(stream[i].fd, &writeSet);
  sbClean(&stream[i].writeBuffer);

  stream[i].fd = INVALID_SOCKET; /* Free for re-use */
  if (i == socketIdxMax)
  {
    socketIdxMax = 0;
    socketFdMax  = 0;
    for (j = i - 1; j >= 0; j--)
    {
      if (stream[j].fd != INVALID_SOCKET)
      {
        socketIdxMax = CB_MAX(socketIdxMax, j);
        socketFdMax  = CB_MAX(socketFdMax, stream[j].fd);
      }
    }
  }
  setHaveNMEA0183Client();
  logDebug("closeStream(%d) (%u..%u fdMax=%d)\n", i, socketIdxMin, socketIdxMax, socketFdMax);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movslq %edi, %rax
imulq $0x8038, %rax, %r12     # imm = 0x8038
leaq 0x96b9(%rip), %r14      # 0xd530
leaq (%r14,%r12), %r15
movl (%r12,%r14), %edi
callq 0x2190
movl (%r12,%r14), %eax
pushq $-0x2
popq %rsi
movl %eax, %ecx
rolq %cl, %rsi
pushq $0x40
popq %rcx
cltd
idivl %ecx
cltq
leaq 0x9501(%rip), %rcx      # 0xd3a0
andq %rsi, (%rcx,%rax,8)
leaq 0x9576(%rip), %rcx      # 0xd420
andq %rsi, (%rcx,%rax,8)
leaq 0x95eb(%rip), %rcx      # 0xd4a0
andq %rsi, (%rcx,%rax,8)
movq 0x8018(%r12,%r14), %rdi
testq %rdi, %rdi
je 0x3ed3
callq 0x2030
andq $0x0, 0x8018(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8020(%r15)
orl $-0x1, (%r15)
cmpl %ebx, 0x9498(%rip)      # 0xd380
jne 0x3f2f
andl $0x0, 0x948f(%rip)      # 0xd380
andl $0x0, 0x948c(%rip)      # 0xd384
movl %ebx, %eax
xorl %ecx, %ecx
xorl %edx, %edx
testl %eax, %eax
jle 0x3f2f
decq %rax
movl %eax, %esi
imulq $0x8038, %rsi, %rsi     # imm = 0x8038
movl (%rsi,%r14), %esi
cmpl $-0x1, %esi
je 0x3efe
cmpl %eax, %edx
cmovlel %eax, %edx
movl %edx, 0x945e(%rip)      # 0xd380
cmpl %esi, %ecx
cmovlel %esi, %ecx
movl %ecx, 0x9457(%rip)      # 0xd384
jmp 0x3efe
callq 0x3e0c
movl 0x9442(%rip), %edx      # 0xd37c
movl 0x9440(%rip), %ecx      # 0xd380
movl 0x943d(%rip), %r8d      # 0xd384
leaq 0x4a3d(%rip), %rdi      # 0x898b
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6d78
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/main.c
// Function: tcpServer
static void tcpServer(uint16_t port, StreamType st)
{
  struct sockaddr_in serverAddr;
  int                sockAddrSize = sizeof(serverAddr);
  int                r;
  int                on = 1;
  SOCKET             s;
  bool               udp = (st == SERVER_NMEA0183_DATAGRAM);

  s = socket(PF_INET, udp ? SOCK_DGRAM : SOCK_STREAM, 0);
  if (s == INVALID_SOCKET)
  {
    die("Unable to open server socket");
  }
  memset((char *) &serverAddr, 0, sockAddrSize);
  serverAddr.sin_family      = AF_INET;
  serverAddr.sin_port        = htons(port);
  serverAddr.sin_addr.s_addr = htonl(INADDR_ANY);

  setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *) &on, (socklen_t) sizeof(on));

  r = bind(s, (struct sockaddr *) &serverAddr, sockAddrSize);
  if (r == INVALID_SOCKET)
  {
    die("Unable to bind server socket");
  }

  if (!udp)
  {
    r = listen(s, 10);
    if (r == INVALID_SOCKET)
    {
      die("Unable to listen to server socket");
    }
  }
  else
  {
    setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *) &on, (socklen_t) sizeof(on));
  }

  setFdUsed(s, st);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movl %edi, %r14d
movl $0x1, 0x4(%rsp)
xorl %esi, %esi
cmpl $0xc, %ebx
sete %sil
incl %esi
pushq $0x2
popq %rdi
xorl %edx, %edx
callq 0x23c0
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x40df
leaq 0x4d7e(%rip), %rdi      # 0x8e58
callq 0x6f48
leaq 0x8(%rsp), %r15
andq $0x0, 0x8(%r15)
movw $0x2, (%r15)
rolw $0x8, %r14w
movw %r14w, 0x2(%r15)
andl $0x0, 0x4(%r15)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x20c0
pushq $0x10
popq %rdx
movl %ebp, %edi
movq %r15, %rsi
callq 0x2280
cmpl $-0x1, %eax
jne 0x4132
leaq 0x4d48(%rip), %rdi      # 0x8e75
callq 0x6f48
cmpl $0xc, %ebx
jne 0x414f
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
leaq 0x4(%rsp), %rcx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x20c0
jmp 0x416a
pushq $0xa
popq %rsi
movl %ebp, %edi
callq 0x2250
cmpl $-0x1, %eax
jne 0x416a
leaq 0x4d2d(%rip), %rdi      # 0x8e92
callq 0x6f48
movl %ebp, %edi
movl %ebx, %esi
callq 0x31bc
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/main.c
// Function: writeAndClose
static void writeAndClose(int idx, char *data, size_t len)
{
  int r;

#ifdef O_NONBLOCK
  int flags = fcntl(stream[idx].fd, F_GETFL, 0);
  fcntl(stream[idx].fd, F_SETFL, flags & ~O_NONBLOCK);
#else
  int ioctlOptionValue = 0;
  ioctl(stream[idx].fd, FIONBIO, &ioctlOptionValue);
#endif

  while (len > 0)
  {
    r = write(stream[idx].fd, data, len);
    if (r <= 0)
    {
      break;
    }
    len -= r;
    data += r;
  }
  closeStream(idx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movslq %edi, %rax
imulq $0x8038, %rax, %r12     # imm = 0x8038
leaq 0x912c(%rip), %r13      # 0xd530
leaq (%r12,%r13), %r15
movl (%r12,%r13), %edi
pushq $0x3
popq %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20d0
movl (%r12,%r13), %edi
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
pushq $0x4
popq %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x20d0
testq %rbx, %rbx
je 0x4451
movl (%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x20e0
testl %eax, %eax
jle 0x4451
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subq %rax, %rbx
addq %rax, %r14
jmp 0x442d
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3e5c
nop
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/gps_ais.c
// Function: nmea0183VTG
extern void nmea0183VTG(StringBuffer *msg183, int src, const char *msg)
{
  double sog;
  double cog;

  if (getJSONNumber(msg, "SOG", &sog, U_VELOCITY) && getJSONNumber(msg, "COG", &cog, U_ANGLE))
  {
    nmea0183CreateMessage(msg183, src, "VTG,%.1f,T,,M,%.2f,N,%.2f,K", cog, SPEED_M_S_TO_KNOTS(sog), SPEED_M_S_TO_KMH(sog));
    g_sog        = sog;
    g_cog        = cog;
    g_sog_cog_ts = getNow();
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
leaq 0x4cbc(%rip), %rsi      # 0x913c
leaq 0x8(%rsp), %rdx
pushq $0x2
popq %rcx
movq %r15, %rdi
callq 0x6b09
testb %al, %al
je 0x4505
leaq 0x4ca5(%rip), %rsi      # 0x9140
movq %rsp, %rdx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x6b09
testb %al, %al
je 0x4505
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
movsd 0x4ba1(%rip), %xmm1     # 0x9060
mulsd %xmm2, %xmm1
mulsd 0x4b9d(%rip), %xmm2     # 0x9068
leaq 0x4c72(%rip), %rdx      # 0x9144
movq %r14, %rdi
movl %ebx, %esi
movb $0x3, %al
callq 0x61b4
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20a4e84(%rip)  # 0x20a9370
movsd (%rsp), %xmm0
movsd %xmm0, 0x20a4e7f(%rip)  # 0x20a9378
callq 0x6b84
movq %rax, 0x20a4e7b(%rip)   # 0x20a9380
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/n2kd/gps_ais.c
// Function: nmea0183GSA
extern void nmea0183GSA(StringBuffer *msg183, int src, const char *msg)
{
  char modeString[OTHER_LENGTH] = "";
  char pdopString[OTHER_LENGTH] = "";
  char hdopString[OTHER_LENGTH] = "";
  char vdopString[OTHER_LENGTH] = "";

  getJSONValue(msg, "Actual Mode", modeString, sizeof(modeString));
  getJSONValue(msg, "PDOP", pdopString, sizeof(pdopString));
  getJSONValue(msg, "HDOP", hdopString, sizeof(hdopString));
  getJSONValue(msg, "VDOP", vdopString, sizeof(vdopString));

  modeString[1] = 0; // Abbreviate string, or still empty if not in N2K PGN

  nmea0183CreateMessage(msg183, src, "GSA,M,%s,,,,,,,,,,,,,%s,%s,%s", modeString, pdopString, hdopString, vdopString);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbp
movl %esi, 0x14(%rsp)
movq %rdi, 0x18(%rsp)
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %r14
andl $0x0, 0x10(%r14)
leaq 0x60(%rsp), %r12
andl $0x0, 0x10(%r12)
movaps %xmm0, (%r14)
movaps %xmm0, (%r12)
leaq 0x40(%rsp), %r13
movaps %xmm0, (%r13)
andl $0x0, 0x10(%r13)
leaq 0x20(%rsp), %rbx
movaps %xmm0, (%rbx)
andl $0x0, 0x10(%rbx)
leaq 0x4bee(%rip), %rsi      # 0x9160
pushq $0x14
popq %r15
movq %rdx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x7415
leaq 0x4be1(%rip), %rsi      # 0x916c
movq %rbp, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x7415
leaq 0x4bd1(%rip), %rsi      # 0x9171
movq %rbp, %rdi
movq %r13, %rdx
movq %r15, %rcx
callq 0x7415
leaq 0x4bc1(%rip), %rsi      # 0x9176
movq %rbp, %rdi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x7415
movb $0x0, 0x1(%r14)
movq %rbx, (%rsp)
leaq 0x4ba8(%rip), %rdx      # 0x917b
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movq %r14, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x61b4
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq