// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/demos/demo_destroy.c
// Function: use_high_level_api
int
use_high_level_api(const char *server_address,
                   const char *server_port,
                   const char *client_certificate,
                   const char *client_key,
                   const char *ca_certificate,
                   char *id)
{
    /* 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 file 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);
    }
    
    /* Send the request message. */
    int result = kmip_bio_destroy_symmetric_key(bio, id, kmip_strnlen_s(id, 50));
    
    BIO_free_all(bio);
    SSL_CTX_free(ctx);
    
    /* Handle the response results. */
    printf("\n");
    if(result < 0)
    {
        printf("An error occurred while deleting object: %s\n", id);
        printf("Error Code: %d\n", result);
    }
    else
    {
        printf("The KMIP operation was executed with no errors.\n");
        printf("Result: ");
        kmip_print_result_status_enum(stdout, result);
        printf(" (%d)\n", result);
    }
    
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x2120
callq 0x20b0
movq %rax, %rdi
callq 0x21c0
movq %rax, -0x40(%rbp)
leaq 0x279b2(%rip), %rdi     # 0x2a026
movb $0x0, %al
callq 0x2040
movq -0x20(%rbp), %rsi
leaq 0x27af7(%rip), %rdi     # 0x2a17d
movb $0x0, %al
callq 0x2040
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x21b0
cmpl $0x1, %eax
je 0x26e0
movq 0x31935(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
leaq 0x27aec(%rip), %rsi     # 0x2a1a1
movb $0x0, %al
callq 0x21d0
movq 0x3191d(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
callq 0x20d0
movq -0x40(%rbp), %rdi
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x297b
movq -0x28(%rbp), %rsi
leaq 0x27add(%rip), %rdi     # 0x2a1c8
movb $0x0, %al
callq 0x2040
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x1, %edx
callq 0x2030
cmpl $0x1, %eax
je 0x2745
movq 0x318d0(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
leaq 0x27aca(%rip), %rsi     # 0x2a1e4
movb $0x0, %al
callq 0x21d0
movq 0x318b8(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
callq 0x20d0
movq -0x40(%rbp), %rdi
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x297b
movq -0x30(%rbp), %rsi
leaq 0x27ab3(%rip), %rdi     # 0x2a203
movb $0x0, %al
callq 0x2040
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x21a0
cmpl $0x1, %eax
je 0x27a9
movq 0x3186c(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
leaq 0x27aa5(%rip), %rsi     # 0x2a223
movb $0x0, %al
callq 0x21d0
movq 0x31854(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
callq 0x20d0
movq -0x40(%rbp), %rdi
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x297b
movq $0x0, -0x50(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2160
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x2801
movq 0x31814(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
leaq 0x27a69(%rip), %rsi     # 0x2a23f
movb $0x0, %al
callq 0x21d0
movq 0x317fc(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
callq 0x20d0
movq -0x40(%rbp), %rdi
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x297b
movq -0x50(%rbp), %rdi
movl $0x6e, %esi
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rcx
callq 0x2060
movq -0x48(%rbp), %rdi
movl $0x21, %esi
movl $0x4, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x2070
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x64, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x64, %esi
movl $0x1, %edx
callq 0x2060
movq -0x50(%rbp), %rdi
movl $0x65, %esi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x2060
cmpq $0x1, %rax
je 0x28bb
movq 0x31763(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
leaq 0x279d4(%rip), %rsi     # 0x2a25b
movb $0x0, %al
callq 0x21d0
movq 0x3174b(%rip), %rax     # 0x33fe0
movq (%rax), %rdi
callq 0x20d0
movq -0x50(%rbp), %rdi
callq 0x2080
movq -0x40(%rbp), %rdi
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x297b
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
movl $0x32, %esi
callq 0x2a70
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl %eax, %edx
callq 0x263e0
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2080
movq -0x40(%rbp), %rdi
callq 0x2050
leaq 0x27722(%rip), %rdi     # 0x2a026
movb $0x0, %al
callq 0x2040
cmpl $0x0, -0x54(%rbp)
jge 0x2936
movq -0x38(%rbp), %rsi
leaq 0x27956(%rip), %rdi     # 0x2a272
movb $0x0, %al
callq 0x2040
movl -0x54(%rbp), %esi
leaq 0x27972(%rip), %rdi     # 0x2a29f
movb $0x0, %al
callq 0x2040
jmp 0x2975
leaq 0x27972(%rip), %rdi     # 0x2a2af
movb $0x0, %al
callq 0x2040
leaq 0x27995(%rip), %rdi     # 0x2a2e0
movb $0x0, %al
callq 0x2040
movq 0x3166f(%rip), %rax     # 0x33fc8
movq (%rax), %rdi
movl -0x54(%rbp), %esi
callq 0x201c0
movl -0x54(%rbp), %esi
leaq 0x2797b(%rip), %rdi     # 0x2a2e9
movb $0x0, %al
callq 0x2040
movl -0x54(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)