// File: /workspace/github_c_makefile_star2_O2/OpenKMIP[P]libkmip/demos/demo_create.c
// Function: use_low_level_api
int
use_low_level_api(const char *server_address,
                  const char *server_port,
                  const char *client_certificate,
                  const char *client_key,
                  const char *ca_certificate)
{
    /* Set up the TLS connection to the KMIP server. */
    SSL_CTX *ctx = NULL;
    SSL *ssl = NULL;
    OPENSSL_init_ssl(0, NULL);
    ctx = SSL_CTX_new(TLS_client_method());
    
    printf("\n");
    printf("Loading the client certificate: %s\n", client_certificate);
    if(SSL_CTX_use_certificate_file(ctx, client_certificate, SSL_FILETYPE_PEM) != 1)
    {
        fprintf(stderr, "Loading the client certificate failed\n");
        ERR_print_errors_fp(stderr);
        SSL_CTX_free(ctx);
        return(-1);
    }
    
    printf("Loading the client key: %s\n", client_key);
    if(SSL_CTX_use_PrivateKey_file(ctx, client_key, SSL_FILETYPE_PEM) != 1)
    {
        fprintf(stderr, "Loading the client key failed\n");
        ERR_print_errors_fp(stderr);
        SSL_CTX_free(ctx);
        return(-1);
    }
    
    printf("Loading the CA certificate: %s\n", ca_certificate);
    if(SSL_CTX_load_verify_locations(ctx, ca_certificate, NULL) != 1)
    {
        fprintf(stderr, "Loading the CA certificate failed\n");
        ERR_print_errors_fp(stderr);
        SSL_CTX_free(ctx);
        return(-1);
    }
    
    BIO *bio = NULL;
    bio = BIO_new_ssl_connect(ctx);
    if(bio == NULL)
    {
        fprintf(stderr, "BIO_new_ssl_connect failed\n");
        ERR_print_errors_fp(stderr);
        SSL_CTX_free(ctx);
        return(-1);
    }
    
    BIO_get_ssl(bio, &ssl);
    SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
    BIO_set_conn_hostname(bio, server_address);
    BIO_set_conn_port(bio, server_port);
    if(BIO_do_connect(bio) != 1)
    {
        fprintf(stderr, "BIO_do_connect failed\n");
        ERR_print_errors_fp(stderr);
        BIO_free_all(bio);
        SSL_CTX_free(ctx);
        return(-1);
    }
    
    printf("\n");
    
    /* Set up the KMIP context and the initial encoding buffer. */
    KMIP kmip_context = {0};
    kmip_init(&kmip_context, NULL, 0, KMIP_1_0);
    
    size_t buffer_blocks = 1;
    size_t buffer_block_size = 1024;
    size_t buffer_total_size = buffer_blocks * buffer_block_size;
    
    uint8 *encoding = kmip_context.calloc_func(kmip_context.state, buffer_blocks, buffer_block_size);
    if(encoding == NULL)
    {
        kmip_destroy(&kmip_context);
        BIO_free_all(bio);
        SSL_CTX_free(ctx);
        return(KMIP_MEMORY_ALLOC_FAILED);
    }
    kmip_set_buffer(&kmip_context, encoding, buffer_total_size);
    
    /* Build the request message. */
    Attribute a[3] = {0};
    for(int i = 0; i < 3; i++)
        kmip_init_attribute(&a[i]);
    
    enum cryptographic_algorithm algorithm = KMIP_CRYPTOALG_AES;
    a[0].type = KMIP_ATTR_CRYPTOGRAPHIC_ALGORITHM;
    a[0].value = &algorithm;
    
    int32 length = 256;
    a[1].type = KMIP_ATTR_CRYPTOGRAPHIC_LENGTH;
    a[1].value = &length;
    
    int32 mask = KMIP_CRYPTOMASK_ENCRYPT | KMIP_CRYPTOMASK_DECRYPT;
    a[2].type = KMIP_ATTR_CRYPTOGRAPHIC_USAGE_MASK;
    a[2].value = &mask;
    
    TemplateAttribute ta = {0};
    ta.attributes = a;
    ta.attribute_count = ARRAY_LENGTH(a);
    
    ProtocolVersion pv = {0};
    kmip_init_protocol_version(&pv, kmip_context.version);
    
    RequestHeader rh = {0};
    kmip_init_request_header(&rh);
    
    rh.protocol_version = &pv;
    rh.maximum_response_size = kmip_context.max_message_size;
    rh.time_stamp = time(NULL);
    rh.batch_count = 1;
    
    CreateRequestPayload crp = {0};
    crp.object_type = KMIP_OBJTYPE_SYMMETRIC_KEY;
    crp.template_attribute = &ta;

    RequestBatchItem rbi = {0};
    kmip_init_request_batch_item(&rbi);
    rbi.operation = KMIP_OP_CREATE;
    rbi.request_payload = &crp;
    
    RequestMessage rm = {0};
    rm.request_header = &rh;
    rm.batch_items = &rbi;
    rm.batch_count = 1;

    /* Encode the request message. Dynamically resize the encoding buffer */
    /* if it's not big enough. Once encoding succeeds, send the request   */
    /* message.                                                           */
    int encode_result = kmip_encode_request_message(&kmip_context, &rm);
    while(encode_result == KMIP_ERROR_BUFFER_FULL)
    {
        kmip_reset(&kmip_context);
        kmip_context.free_func(kmip_context.state, encoding);
        
        buffer_blocks += 1;
        buffer_total_size = buffer_blocks * buffer_block_size;
        
        encoding = kmip_context.calloc_func(kmip_context.state, buffer_blocks, buffer_block_size);
        if(encoding == NULL)
        {
            printf("Failure: Could not automatically enlarge the encoding ");
            printf("buffer for the Create request.\n");

            kmip_destroy(&kmip_context);
            BIO_free_all(bio);
            SSL_CTX_free(ctx);
            return(KMIP_MEMORY_ALLOC_FAILED);
        }
        
        kmip_set_buffer(&kmip_context, encoding, buffer_total_size);
        encode_result = kmip_encode_request_message(&kmip_context, &rm);
    }
    
    if(encode_result != KMIP_OK)
    {
        printf("An error occurred while encoding the Create request.\n");
        printf("Error Code: %d\n", encode_result);
        printf("Error Name: ");
        kmip_print_error_string(stderr, encode_result);
        printf("\n");
        printf("Context Error: %s\n", kmip_context.error_message);
        printf("Stack trace:\n");
        kmip_print_stack_trace(stderr, &kmip_context);

        kmip_free_buffer(&kmip_context, encoding, buffer_total_size);
        encoding = NULL;
        kmip_set_buffer(&kmip_context, NULL, 0);
        kmip_destroy(&kmip_context);
        BIO_free_all(bio);
        SSL_CTX_free(ctx);
        return(encode_result);
    }
    
    kmip_print_request_message(stdout, &rm);
    printf("\n");
    
    char *response = NULL;
    int response_size = 0;
    
    int result = kmip_bio_send_request_encoding(&kmip_context, bio, (char *)encoding, kmip_context.index - kmip_context.buffer, &response, &response_size);
    
    BIO_free_all(bio);
    SSL_CTX_free(ctx);
    
    printf("\n");
    if(result < 0)
    {
        printf("An error occurred while creating the symmetric key.\n");
        printf("Error Code: %d\n", result);
        printf("Error Name: ");
        kmip_print_error_string(stderr, result);
        printf("\n");
        printf("Context Error: %s\n", kmip_context.error_message);
        printf("Stack trace:\n");
        kmip_print_stack_trace(stderr, &kmip_context);
        
        kmip_free_buffer(&kmip_context, encoding, buffer_total_size);
        kmip_free_buffer(&kmip_context, response, response_size);
        encoding = NULL;
        response = NULL;
        kmip_set_buffer(&kmip_context, NULL, 0);
        kmip_destroy(&kmip_context);
        return(result);
    }
    
    kmip_free_buffer(&kmip_context, encoding, buffer_total_size);
    encoding = NULL;
    kmip_set_buffer(&kmip_context, response, response_size);
    
    /* Decode the response message and retrieve the operation results. */
    ResponseMessage resp_m = {0};
    int decode_result = kmip_decode_response_message(&kmip_context, &resp_m);
    if(decode_result != KMIP_OK)
    {
        printf("An error occurred while decoding the Create response.\n");
        printf("Error Code: %d\n", decode_result);
        printf("Error Name: ");
        kmip_print_error_string(stderr, decode_result);
        printf("\n");
        printf("Context Error: %s\n", kmip_context.error_message);
        printf("Stack trace:\n");
        kmip_print_stack_trace(stderr, &kmip_context);

        kmip_free_response_message(&kmip_context, &resp_m);
        kmip_free_buffer(&kmip_context, response, response_size);
        response = NULL;
        kmip_set_buffer(&kmip_context, NULL, 0);
        kmip_destroy(&kmip_context);
        return(decode_result);
    }
    
    kmip_print_response_message(stdout, &resp_m);
    printf("\n");

    if(resp_m.batch_count != 1 || resp_m.batch_items == NULL)
    {
        printf("Expected to find one batch item in the Create response.\n");
        kmip_free_response_message(&kmip_context, &resp_m);
        kmip_free_buffer(&kmip_context, response, response_size);
        response = NULL;
        kmip_set_buffer(&kmip_context, NULL, 0);
        kmip_destroy(&kmip_context);
        return(KMIP_MALFORMED_RESPONSE);
    }
    
    ResponseBatchItem req = resp_m.batch_items[0];
    enum result_status result_status = req.result_status;
    
    printf("The KMIP operation was executed with no errors.\n");
    printf("Result: ");
    kmip_print_result_status_enum(stdout, result);
    printf(" (%d)\n\n", result);
    
    if(result == KMIP_STATUS_SUCCESS)
    {
        CreateResponsePayload *pld = (CreateResponsePayload *)req.response_payload;
        if(pld != NULL)
        {
            TextString *uuid = pld->unique_identifier;
            
            if(uuid != NULL)
                printf("Symmetric Key ID: %.*s\n", (int)uuid->size, uuid->value);
        }
    }
    
    /* Clean up the response message, the response buffer, and the KMIP */
    /* context.                                                         */
    kmip_free_response_message(&kmip_context, &resp_m);
    kmip_free_buffer(&kmip_context, response, response_size);
    response = NULL;
    kmip_set_buffer(&kmip_context, NULL, 0);
    kmip_destroy(&kmip_context);
    
    return(result_status);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9f8, %rsp            # imm = 0x9F8
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
andq $0x0, 0x28(%rsp)
xorl %edi, %edi
xorl %esi, %esi
callq 0x2120
callq 0x20b0
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbp
pushq $0xa
popq %rdi
callq 0x21e0
leaq 0x16b70(%rip), %rdi     # 0x1903e
movq %r13, %rsi
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x21d0
cmpl $0x1, %eax
jne 0x2a36
leaq 0x16b93(%rip), %rdi     # 0x19089
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rdx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2030
cmpl $0x1, %eax
jne 0x2afe
leaq 0x16ba6(%rip), %rdi     # 0x190c4
movq %r14, %rsi
xorl %eax, %eax
callq 0x2040
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x21c0
cmpl $0x1, %eax
jne 0x2b13
movq %rbp, %rdi
callq 0x2160
testq %rax, %rax
je 0x2b28
movq %rax, %r14
pushq $0x6e
popq %rsi
leaq 0x28(%rsp), %rbx
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x2060
movq (%rbx), %rdi
pushq $0x21
popq %rsi
pushq $0x4
popq %rdx
xorl %ecx, %ecx
callq 0x2070
pushq $0x64
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movq %r12, %rcx
callq 0x2060
pushq $0x1
popq %rdx
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rcx
callq 0x2060
pushq $0x65
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2060
cmpq $0x1, %rax
jne 0x2b6b
pushq $0xa
popq %rdi
callq 0x21e0
leaq 0x160(%rsp), %rbx
movl $0x898, %edx            # imm = 0x898
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20e0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x34a1
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
movl $0x400, %edx            # imm = 0x400
callq *0x868(%rbx)
testq %rax, %rax
je 0x2928
movq %rax, %r15
leaq 0x160(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0x3681
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
xorl %ebx, %ebx
cmpq $0x30, %rbx
je 0x2645
leaq (%rsp,%rbx), %rdi
addq $0x60, %rdi
callq 0x3a21
addq $0x10, %rbx
jmp 0x262c
movq %r14, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
pushq $0x3
popq %rax
leaq 0x3c(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x60(%rsp), %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
leaq 0x38(%rsp), %rax
movl $0x100, (%rax)          # imm = 0x100
movl $0x4, 0x10(%rdx)
movq %rax, 0x18(%rdx)
leaq 0x34(%rsp), %rax
movl $0xc, (%rax)
movl $0x6, 0x20(%rdx)
movq %rax, 0x28(%rdx)
xorps %xmm0, %xmm0
leaq 0xf0(%rsp), %r12
movaps %xmm0, (%r12)
leaq 0x58(%rsp), %rbx
andq $0x0, (%rbx)
movq %rdx, 0x10(%r12)
movq $0x3, 0x18(%r12)
leaq 0x160(%rsp), %r13
movl 0x18(%r13), %esi
movq %rbx, %rdi
callq 0x39f2
leaq 0x110(%rsp), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq %r14, %rdi
callq 0x3a7a
movq %rbx, (%r14)
movl 0x1c(%r13), %eax
movl %eax, 0x8(%r14)
xorl %edi, %edi
callq 0x2130
movq %rax, 0x20(%r14)
pushq $0x1
popq %rbp
movl %ebp, 0x28(%r14)
leaq 0xd0(%rsp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movaps %xmm0, 0x10(%rbx)
movl $0x2, (%rbx)
movq %r12, 0x8(%rbx)
leaq 0xb0(%rsp), %r12
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq %r12, %rdi
callq 0x3acd
movl %ebp, (%r12)
movq %rbx, 0x10(%r12)
leaq 0x98(%rsp), %rbx
movq %r14, (%rbx)
movq %r12, 0x8(%rbx)
movq $0x1, 0x10(%rbx)
movq %r13, %rdi
movq %rbx, %rsi
callq 0xa872
movl %eax, %ebp
movl $0x400, %r12d           # imm = 0x400
pushq $0x2
popq %r14
cmpl $-0x2, %ebp
jne 0x27ea
movq %r13, %rdi
callq 0x363e
movq 0x9f0(%rsp), %rdi
movq %r15, %rsi
callq *0x9d8(%rsp)
movq 0x9f0(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
callq *0x9c8(%rsp)
testq %rax, %rax
je 0x29f4
movq %rax, %r15
addq $0x400, %r12            # imm = 0x400
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x3681
movq %r13, %rdi
movq %rbx, %rsi
callq 0xa872
movl %eax, %ebp
incq %r14
jmp 0x2781
testl %ebp, %ebp
jne 0x2945
movq 0x247c7(%rip), %r14     # 0x26fc0
movq (%r14), %rdi
leaq 0x98(%rsp), %rsi
callq 0x15d1c
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x21e0
leaq 0x10(%rsp), %r8
andq $0x0, (%r8)
leaq 0xc(%rsp), %r9
andl $0x0, (%r9)
leaq 0x160(%rsp), %rdi
movl 0x8(%rdi), %ecx
subl (%rdi), %ecx
movq 0x18(%rsp), %r13
movq %r13, %rsi
movq %r15, %rdx
callq 0x17fcd
movl %eax, %ebp
movq %r13, %rdi
callq 0x2080
movq 0x20(%rsp), %rdi
callq 0x2050
movl %ebx, %edi
callq 0x21e0
testl %ebp, %ebp
js 0x2a4e
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3ae1
movq 0x10(%rsp), %rsi
movslq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x3681
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x11a14
testl %eax, %eax
je 0x2b99
movl %eax, %ebx
leaq 0x16a6d(%rip), %rdi     # 0x19323
callq 0x2210
leaq 0x168af(%rip), %rdi     # 0x19171
movl %ebx, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x168af(%rip), %rdi     # 0x19181
xorl %eax, %eax
callq 0x2040
movq 0x246f8(%rip), %r15     # 0x26fd8
movq (%r15), %rdi
movl %ebx, %esi
callq 0x125d8
pushq $0xa
popq %rdi
callq 0x21e0
leaq 0x160(%rsp), %r14
movq 0x28(%r14), %rsi
leaq 0x16889(%rip), %rdi     # 0x1918e
xorl %eax, %eax
callq 0x2040
leaq 0x16aaf(%rip), %rdi     # 0x193c2
callq 0x2210
movq (%r15), %rdi
movq %r14, %rsi
callq 0x12586
jmp 0x2c74
leaq 0x160(%rsp), %rdi
callq 0x3692
movq %r14, %rdi
callq 0x2080
movq %rbp, %rdi
jmp 0x2a2a
leaq 0x16a41(%rip), %rdi     # 0x1938d
callq 0x2210
leaq 0x16819(%rip), %rdi     # 0x19171
movl %ebp, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x16819(%rip), %rdi     # 0x19181
xorl %eax, %eax
callq 0x2040
movq 0x24662(%rip), %r14     # 0x26fd8
movq (%r14), %rdi
movl %ebp, %esi
callq 0x125d8
pushq $0xa
popq %rdi
callq 0x21e0
leaq 0x160(%rsp), %rbx
movq 0x28(%rbx), %rsi
leaq 0x167f3(%rip), %rdi     # 0x1918e
xorl %eax, %eax
callq 0x2040
leaq 0x16a19(%rip), %rdi     # 0x193c2
callq 0x2210
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x12586
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3ae1
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3681
movq %rbx, %rdi
callq 0x3692
movq 0x18(%rsp), %rdi
callq 0x2080
movq 0x20(%rsp), %rdi
callq 0x2050
jmp 0x2b57
leaq 0x1673f(%rip), %rdi     # 0x1913a
xorl %eax, %eax
callq 0x2040
leaq 0x169c6(%rip), %rdi     # 0x193cf
callq 0x2210
leaq 0x160(%rsp), %rdi
callq 0x3692
movq 0x18(%rsp), %rdi
callq 0x2080
movq 0x20(%rsp), %rdi
callq 0x2050
pushq $-0xc
jmp 0x2b56
movq 0x2459b(%rip), %rbx     # 0x26fd8
movq (%rbx), %rcx
leaq 0x1661b(%rip), %rdi     # 0x19062
pushq $0x26
jmp 0x2b3b
leaq 0x16904(%rip), %rdi     # 0x19359
callq 0x2210
leaq 0x16710(%rip), %rdi     # 0x19171
movl %ebp, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x16710(%rip), %rdi     # 0x19181
xorl %eax, %eax
callq 0x2040
movq 0x24559(%rip), %r14     # 0x26fd8
movq (%r14), %rdi
movl %ebp, %esi
callq 0x125d8
pushq $0xa
popq %rdi
callq 0x21e0
leaq 0x160(%rsp), %rbx
movq 0x28(%rbx), %rsi
leaq 0x166ea(%rip), %rdi     # 0x1918e
xorl %eax, %eax
callq 0x2040
leaq 0x16910(%rip), %rdi     # 0x193c2
callq 0x2210
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x12586
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3ae1
movq 0x10(%rsp), %rsi
movslq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x3ae1
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3681
movq %rbx, %rdi
callq 0x3692
jmp 0x2b57
movq 0x244d3(%rip), %rbx     # 0x26fd8
movq (%rbx), %rcx
leaq 0x16596(%rip), %rdi     # 0x190a5
pushq $0x1e
jmp 0x2b3b
movq 0x244be(%rip), %rbx     # 0x26fd8
movq (%rbx), %rcx
leaq 0x165c0(%rip), %rdi     # 0x190e4
pushq $0x22
jmp 0x2b3b
movq 0x244a9(%rip), %rbx     # 0x26fd8
movq (%rbx), %rcx
leaq 0x165ce(%rip), %rdi     # 0x19107
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x2240
movq (%rbx), %rdi
callq 0x20d0
movq %rbp, %rdi
callq 0x2050
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x9f8, %rsp            # imm = 0x9F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x24466(%rip), %rbx     # 0x26fd8
movq (%rbx), %rcx
leaq 0x165a7(%rip), %rdi     # 0x19123
pushq $0x16
popq %rsi
pushq $0x1
popq %rdx
callq 0x2240
movq (%rbx), %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2080
jmp 0x2b4c
movq (%r14), %rdi
leaq 0x40(%rsp), %rbx
movq %rbx, %rsi
callq 0x15da0
pushq $0xa
popq %rdi
callq 0x21e0
movq 0x8(%rbx), %rax
cmpq $0x1, 0x10(%rbx)
setne %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x2c0b
leaq 0x1671a(%rip), %rdi     # 0x192eb
callq 0x2210
leaq 0x160(%rsp), %rbx
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x4e32
movq 0x10(%rsp), %rsi
movslq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x3ae1
andq $0x0, 0x10(%rsp)
pushq $-0xf
popq %rbx
jmp 0x2c99
movl 0x10(%rax), %ebx
movq 0x28(%rax), %r15
leaq 0x166a2(%rip), %rdi     # 0x192bb
callq 0x2210
leaq 0x1657c(%rip), %rdi     # 0x191a1
xorl %eax, %eax
callq 0x2040
movq (%r14), %rdi
movl %ebp, %esi
callq 0x12a24
leaq 0x1656d(%rip), %rdi     # 0x191aa
movl %ebp, %esi
xorl %eax, %eax
callq 0x2040
testl %ebp, %ebp
jne 0x2c6c
testq %r15, %r15
je 0x2c6c
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x2c6c
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x1654d(%rip), %rdi     # 0x191b2
xorl %eax, %eax
callq 0x2040
leaq 0x160(%rsp), %r14
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x4e32
movq 0x10(%rsp), %rsi
movslq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x3ae1
andq $0x0, 0x10(%rsp)
leaq 0x160(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3681
movq %r14, %rdi
callq 0x3692
movl %ebx, %ebp
jmp 0x2b57