#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int pid_t;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EVP_MD_CTX;
typedef int /*<<< orphan*/ EVP_MD;
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int CONF_modules_load_file(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ ENGINE_add_conf_module();
int /*<<< orphan*/ *ENGINE_by_id(char *);
int /*<<< orphan*/ ENGINE_ctrl_cmd(int /*<<< orphan*/ *, char *,
                                   int /*<<< orphan*/, char *,
                                   int /*<<< orphan*/ *, int);
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
scalar_t__ ENGINE_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_load_builtin_engines();
int /*<<< orphan*/ *ENGINE_load_private_key(int /*<<< orphan*/ *, char *,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/);
int /*<<< orphan*/ ERR_clear_error();
int /*<<< orphan*/ ERR_load_crypto_strings();
scalar_t__ EVP_DigestInit(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int /*<<< orphan*/ *EVP_MD_CTX_create();
int /*<<< orphan*/ EVP_MD_CTX_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_PKEY_free(int /*<<< orphan*/ *);
scalar_t__ EVP_SignFinal(int /*<<< orphan*/ *, unsigned char *, unsigned int *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_SignInit(int /*<<< orphan*/ *,
                                int /*<<< orphan*/ const *);
scalar_t__ EVP_SignUpdate(int /*<<< orphan*/ *, unsigned char *, int);
scalar_t__ EVP_VerifyFinal(int /*<<< orphan*/ *, unsigned char *, unsigned int,
                           int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_VerifyInit(int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ const *);
scalar_t__ EVP_VerifyUpdate(int /*<<< orphan*/ *, unsigned char *, int);
int /*<<< orphan*/ *EVP_get_digestbyname(char *);
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ RAND_bytes(unsigned char *, int);
int /*<<< orphan*/ error_queue(char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
scalar_t__ spawn_processes(int);
int /*<<< orphan*/ stderr;
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  const EVP_MD *digest_algo = NULL;
  EVP_PKEY *pkey = NULL;
  EVP_MD_CTX *md_ctx = NULL;
  ENGINE *engine = NULL;
  unsigned char random[20], signature[1024];
  unsigned int siglen = 1024;
  int ret, num_processes = 2;
  pid_t pid;
  int rv = 1;
  if (argc < 2) {
    fprintf(stderr, "Missing required arguments\n");
    usage(argv[0]);
    goto failed;
  }
  if (argc > 4) {
    fprintf(stderr, "Too many arguments\n");
    usage(argv[0]);
    goto failed;
  }
  if (strncmp(argv[1], "pkcs11:", 7)) {
    fprintf(stderr, "fatal: invalid PKCS#11 URL\n");
    usage(argv[0]);
    goto failed;
  }
  pid = getpid();
  printf("pid %d is the parent\n", pid);
  if (argc >= 3) {
    ret = CONF_modules_load_file(argv[2], "engines", 0);
    if (ret <= 0) {
      fprintf(stderr, "cannot load %s\n", argv[2]);
      error_queue("CONF_modules_load_file", pid);
      goto failed;
    }
    ENGINE_add_conf_module();
  }
  ENGINE_add_conf_module();
  OpenSSL_add_all_algorithms();
  ERR_load_crypto_strings();
  ERR_clear_error();
  ENGINE_load_builtin_engines();
  engine = ENGINE_by_id("pkcs11");
  if (engine == NULL) {
    fprintf(stderr, "fatal: engine \"pkcs11\" not available\n");
    error_queue("ENGINE_by_id", pid);
    goto failed;
  }
  if (argc >= 4) {
    ENGINE_ctrl_cmd(engine, "MODULE_PATH", 0, argv[3], NULL, 1);
  }
  if (ENGINE_init(engine)) {
    pkey = ENGINE_load_private_key(engine, argv[1], 0, 0);
    if (pkey == NULL) {
      error_queue("ENGINE_load_private_key", pid);
      goto failed;
    }
    ENGINE_free(engine);
    engine = NULL;
  } else {
    error_queue("ENGINE_init", pid);
    goto failed;
  }
  if (spawn_processes(num_processes)) {
    goto failed;
  }
  pid = getpid();
  if (!RAND_bytes(random, 20)) {
    error_queue("RAND_bytes", pid);
    goto failed;
  }
  digest_algo = EVP_get_digestbyname("sha256");
  md_ctx = EVP_MD_CTX_create();
  if (EVP_DigestInit(md_ctx, digest_algo) <= 0) {
    error_queue("EVP_DigestInit", pid);
    goto failed;
  }
  EVP_SignInit(md_ctx, digest_algo);
  if (EVP_SignUpdate(md_ctx, random, 20) <= 0) {
    error_queue("EVP_SignUpdate", pid);
    goto failed;
  }
  if (EVP_SignFinal(md_ctx, signature, &siglen, pkey) <= 0) {
    error_queue("EVP_SignFinal", pid);
    goto failed;
  }
  EVP_MD_CTX_destroy(md_ctx);
  printf("pid %d: %u-byte signature created\n", pid, siglen);
  md_ctx = EVP_MD_CTX_create();
  if (EVP_DigestInit(md_ctx, digest_algo) <= 0) {
    error_queue("EVP_DigestInit", pid);
    goto failed;
  }
  EVP_VerifyInit(md_ctx, digest_algo);
  if (EVP_VerifyUpdate(md_ctx, random, 20) <= 0) {
    error_queue("EVP_VerifyUpdate", pid);
    goto failed;
  }
  if (EVP_VerifyFinal(md_ctx, signature, siglen, pkey) <= 0) {
    error_queue("EVP_VerifyFinal", pid);
    goto failed;
  }
  printf("pid %d: Signature matched\n", pid);
  rv = 0;
failed:
  if (md_ctx != NULL)
    EVP_MD_CTX_destroy(md_ctx);
  if (pkey != NULL)
    EVP_PKEY_free(pkey);
  if (engine != NULL)
    ENGINE_free(engine);
  return rv;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x400,-0x454(%rbp)
movl   $0x2,-0x45c(%rbp)
movl   $0x1,-0x464(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1369 <main+0x89>
mov    0x2c98(%rip),%rax
mov    (%rax),%edi
lea    0xcaf(%rip),%rsi
mov    $0x0,%al
call   1120 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1170 <usage@plt>
jmp    179c <main+0x4bc>
cmpl   $0x4,-0x8(%rbp)
jle    139b <main+0xbb>
mov    0x2c66(%rip),%rax
mov    (%rax),%edi
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1120 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1170 <usage@plt>
jmp    179c <main+0x4bc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc86(%rip),%rsi
mov    $0x7,%edx
call   1060 <strncmp@plt>
cmp    $0x0,%rax
je     13e6 <main+0x106>
mov    0x2c1b(%rip),%rax
mov    (%rax),%edi
lea    0xc6a(%rip),%rsi
mov    $0x0,%al
call   1120 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1170 <usage@plt>
jmp    179c <main+0x4bc>
mov    $0x0,%al
call   1080 <getpid@plt>
mov    %eax,-0x460(%rbp)
mov    -0x460(%rbp),%esi
lea    0xc54(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
jl     1477 <main+0x197>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc4a(%rip),%rsi
xor    %edx,%edx
call   1040 <CONF_modules_load_file@plt>
mov    %eax,-0x458(%rbp)
cmpl   $0x0,-0x458(%rbp)
jg     1470 <main+0x190>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xc20(%rip),%rsi
mov    $0x0,%al
call   1120 <fprintf@plt>
mov    -0x460(%rbp),%esi
lea    0xc1c(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    $0x0,%al
call   1190 <ENGINE_add_conf_module@plt>
mov    $0x0,%al
call   1190 <ENGINE_add_conf_module@plt>
mov    $0x0,%al
call   1130 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   11b0 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1140 <ERR_clear_error@plt>
mov    $0x0,%al
call   11d0 <ENGINE_load_builtin_engines@plt>
lea    0xbf8(%rip),%rdi
call   1200 <ENGINE_by_id@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    14e3 <main+0x203>
mov    0x2b24(%rip),%rax
mov    (%rax),%edi
lea    0xbdb(%rip),%rsi
mov    $0x0,%al
call   1120 <fprintf@plt>
mov    -0x460(%rbp),%esi
lea    0xbed(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
cmpl   $0x4,-0x8(%rbp)
jl     1512 <main+0x232>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xbd3(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x1,%r9d
call   10c0 <ENGINE_ctrl_cmd@plt>
mov    -0x30(%rbp),%rdi
call   1070 <ENGINE_init@plt>
cmp    $0x0,%rax
je     1576 <main+0x296>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   11e0 <ENGINE_load_private_key@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1560 <main+0x280>
mov    -0x460(%rbp),%esi
lea    0xb89(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x30(%rbp),%rdi
call   1050 <ENGINE_free@plt>
movq   $0x0,-0x30(%rbp)
jmp    158d <main+0x2ad>
mov    -0x460(%rbp),%esi
lea    0xb74(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x45c(%rbp),%edi
call   10a0 <spawn_processes@plt>
cmp    $0x0,%rax
je     15a7 <main+0x2c7>
jmp    179c <main+0x4bc>
mov    $0x0,%al
call   1080 <getpid@plt>
mov    %eax,-0x460(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x14,%esi
call   10e0 <RAND_bytes@plt>
cmp    $0x0,%eax
jne    15e2 <main+0x302>
mov    -0x460(%rbp),%esi
lea    0xb2b(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
lea    0xb25(%rip),%rdi
call   1160 <EVP_get_digestbyname@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   11f0 <EVP_MD_CTX_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1110 <EVP_DigestInit@plt>
cmp    $0x0,%rax
jg     162b <main+0x34b>
mov    -0x460(%rbp),%esi
lea    0xaf4(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1180 <EVP_SignInit@plt>
mov    -0x28(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x14,%edx
call   11a0 <EVP_SignUpdate@plt>
cmp    $0x0,%rax
jg     166b <main+0x38b>
mov    -0x460(%rbp),%esi
lea    0xac3(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x28(%rbp),%rdi
lea    -0x450(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x454(%rbp),%rdx
call   1030 <EVP_SignFinal@plt>
cmp    $0x0,%rax
jg     16a7 <main+0x3c7>
mov    -0x460(%rbp),%esi
lea    0xa96(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x28(%rbp),%rdi
call   1150 <EVP_MD_CTX_destroy@plt>
mov    -0x460(%rbp),%esi
mov    -0x454(%rbp),%edx
lea    0xa7e(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
mov    $0x0,%al
call   11f0 <EVP_MD_CTX_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1110 <EVP_DigestInit@plt>
cmp    $0x0,%rax
jg     1703 <main+0x423>
mov    -0x460(%rbp),%esi
lea    0xa1c(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <EVP_VerifyInit@plt>
mov    -0x28(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x14,%edx
call   11c0 <EVP_VerifyUpdate@plt>
cmp    $0x0,%rax
jg     1743 <main+0x463>
mov    -0x460(%rbp),%esi
lea    0xa2b(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x28(%rbp),%rdi
lea    -0x450(%rbp),%rsi
mov    -0x454(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   10b0 <EVP_VerifyFinal@plt>
cmp    $0x0,%rax
jg     177e <main+0x49e>
mov    -0x460(%rbp),%esi
lea    0xa01(%rip),%rdi
call   10d0 <error_queue@plt>
jmp    179c <main+0x4bc>
mov    -0x460(%rbp),%esi
lea    0x9fa(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
movl   $0x0,-0x464(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     17b0 <main+0x4d0>
mov    -0x28(%rbp),%rdi
call   1150 <EVP_MD_CTX_destroy@plt>
cmpq   $0x0,-0x20(%rbp)
je     17c4 <main+0x4e4>
mov    -0x20(%rbp),%rdi
call   1100 <EVP_PKEY_free@plt>
cmpq   $0x0,-0x30(%rbp)
je     17d8 <main+0x4f8>
mov    -0x30(%rbp),%rdi
call   1050 <ENGINE_free@plt>
mov    -0x464(%rbp),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x438,%rsp
mov    %rsi,%rbx
movl   $0x400,0xc(%rsp)
cmp    $0x1,%edi
jg     130f <main+0x2f>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
lea    0xcf3(%rip),%rsi
jmp    1352 <main+0x72>
mov    %edi,%ebp
cmp    $0x5,%edi
jb     1328 <main+0x48>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
lea    0xcf6(%rip),%rsi
jmp    1352 <main+0x72>
mov    0x8(%rbx),%rdi
lea    0xcfd(%rip),%rsi
mov    $0x7,%edx
call   1060 <strncmp@plt>
test   %rax,%rax
je     1376 <main+0x96>
mov    0x2c97(%rip),%rax
mov    (%rax),%edi
lea    0xce6(%rip),%rsi
xor    %eax,%eax
call   1120 <fprintf@plt>
mov    (%rbx),%rdi
call   1170 <usage@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x438,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1080 <getpid@plt>
mov    %eax,%r14d
lea    0xccd(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10f0 <printf@plt>
cmp    $0x3,%ebp
jb     13b6 <main+0xd6>
mov    0x10(%rbx),%rdi
lea    0xcca(%rip),%rsi
xor    %edx,%edx
call   1040 <CONF_modules_load_file@plt>
test   %eax,%eax
jle    148f <main+0x1af>
xor    %eax,%eax
call   1190 <ENGINE_add_conf_module@plt>
xor    %eax,%eax
call   1190 <ENGINE_add_conf_module@plt>
xor    %eax,%eax
call   1130 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
call   11b0 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   1140 <ERR_clear_error@plt>
xor    %eax,%eax
call   11d0 <ENGINE_load_builtin_engines@plt>
lea    0xcb9(%rip),%rdi
call   1200 <ENGINE_by_id@plt>
test   %rax,%rax
je     1466 <main+0x186>
mov    %rax,%r15
cmp    $0x4,%ebp
jb     1410 <main+0x130>
mov    0x18(%rbx),%rcx
lea    0xcd6(%rip),%rsi
mov    %r15,%rdi
xor    %edx,%edx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   10c0 <ENGINE_ctrl_cmd@plt>
mov    %r15,%rdi
call   1070 <ENGINE_init@plt>
test   %rax,%rax
je     1486 <main+0x1a6>
mov    0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   11e0 <ENGINE_load_private_key@plt>
test   %rax,%rax
je     14be <main+0x1de>
mov    %rax,%rbx
mov    %r15,%rdi
call   1050 <ENGINE_free@plt>
mov    $0x2,%edi
call   10a0 <spawn_processes@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     14da <main+0x1fa>
mov    %rbx,%rdi
call   1100 <EVP_PKEY_free@plt>
jmp    1366 <main+0x86>
mov    0x2b73(%rip),%rax
mov    (%rax),%edi
lea    0xc2a(%rip),%rsi
xor    %eax,%eax
call   1120 <fprintf@plt>
lea    0xc42(%rip),%rdi
jmp    14b1 <main+0x1d1>
lea    0xc6a(%rip),%rdi
jmp    14c5 <main+0x1e5>
mov    0x2b4a(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbx),%rdx
lea    0xbcf(%rip),%rsi
xor    %eax,%eax
call   1120 <fprintf@plt>
lea    0xbd1(%rip),%rdi
mov    %r14d,%esi
call   10d0 <error_queue@plt>
jmp    1361 <main+0x81>
lea    0xc1a(%rip),%rdi
mov    %r14d,%esi
call   10d0 <error_queue@plt>
mov    %r15,%rdi
call   1050 <ENGINE_free@plt>
jmp    1361 <main+0x81>
xor    %eax,%eax
call   1080 <getpid@plt>
mov    %eax,%r15d
lea    0x10(%rsp),%rdi
mov    $0x14,%esi
call   10e0 <RAND_bytes@plt>
test   %eax,%eax
je     15f3 <main+0x313>
lea    0xc0c(%rip),%rdi
call   1160 <EVP_get_digestbyname@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   11f0 <EVP_MD_CTX_create@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbp,%rsi
call   1110 <EVP_DigestInit@plt>
test   %rax,%rax
jle    1607 <main+0x327>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1180 <EVP_SignInit@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
mov    $0x14,%edx
call   11a0 <EVP_SignUpdate@plt>
test   %rax,%rax
jle    1610 <main+0x330>
lea    0x30(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1030 <EVP_SignFinal@plt>
test   %rax,%rax
jle    1619 <main+0x339>
mov    %r14,%rdi
call   1150 <EVP_MD_CTX_destroy@plt>
mov    0xc(%rsp),%edx
lea    0xbc2(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   10f0 <printf@plt>
xor    %eax,%eax
call   11f0 <EVP_MD_CTX_create@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbp,%rsi
call   1110 <EVP_DigestInit@plt>
test   %rax,%rax
jle    1607 <main+0x327>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1090 <EVP_VerifyInit@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
mov    $0x14,%edx
call   11c0 <EVP_VerifyUpdate@plt>
test   %rax,%rax
jle    1622 <main+0x342>
mov    0xc(%rsp),%edx
lea    0x30(%rsp),%rsi
mov    %r14,%rdi
mov    %rbx,%rcx
call   10b0 <EVP_VerifyFinal@plt>
test   %rax,%rax
jle    162b <main+0x34b>
lea    0xba0(%rip),%rdi
xor    %ebp,%ebp
mov    %r15d,%esi
xor    %eax,%eax
call   10f0 <printf@plt>
jmp    163f <main+0x35f>
lea    0xb09(%rip),%rdi
mov    %r15d,%esi
call   10d0 <error_queue@plt>
jmp    1459 <main+0x179>
lea    0xb07(%rip),%rdi
jmp    1632 <main+0x352>
lea    0xb0d(%rip),%rdi
jmp    1632 <main+0x352>
lea    0xb13(%rip),%rdi
jmp    1632 <main+0x352>
lea    0xb3b(%rip),%rdi
jmp    1632 <main+0x352>
lea    0xb43(%rip),%rdi
mov    %r15d,%esi
call   10d0 <error_queue@plt>
mov    $0x1,%ebp
test   %r14,%r14
je     1459 <main+0x179>
mov    %r14,%rdi
call   1150 <EVP_MD_CTX_destroy@plt>
jmp    1459 <main+0x179>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Missing required arguments\0A\00"
@.str.1 = [20 x i8] c"Too many arguments\0A\00"
@.str.2 = [8 x i8] c"pkcs11:\00"
@.str.3 = [28 x i8] c"fatal: invalid PKCS URL\0A\00"
@.str.4 = [22 x i8] c"pid %d is the parent\0A\00"
@.str.5 = [8 x i8] c"engines\00"
@.str.6 = [16 x i8] c"cannot load %s\0A\00"
@.str.7 = [23 x i8] c"CONF_modules_load_file\00"
@.str.8 = [7 x i8] c"pkcs11\00"
@.str.9 = [38 x i8] c"fatal: engine \22pkcs11\22 not available\0A\00"
@.str.10 = [13 x i8] c"ENGINE_by_id\00"
@.str.11 = [12 x i8] c"MODULE_PATH\00"
@.str.12 = [24 x i8] c"ENGINE_load_private_key\00"
@.str.13 = [12 x i8] c"ENGINE_init\00"
@.str.14 = [11 x i8] c"RAND_bytes\00"
@.str.15 = [7 x i8] c"sha256\00"
@.str.16 = [15 x i8] c"EVP_DigestInit\00"
@.str.17 = [15 x i8] c"EVP_SignUpdate\00"
@.str.18 = [14 x i8] c"EVP_SignFinal\00"
@.str.19 = [35 x i8] c"pid %d: %u-byte signature created\0A\00"
@.str.20 = [17 x i8] c"EVP_VerifyUpdate\00"
@.str.21 = [16 x i8] c"EVP_VerifyFinal\00"
@.str.22 = [27 x i8] c"pid %d: Signature matched\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca [20 x i8]
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
store i32* null, i32** %8
store i32* null, i32** %9
store i32 1024, i32* %12
store i32 2, i32* %14
store i32 1, i32* %16
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %26
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @usage(i8* %24)
br label %197
26: ; preds = %2
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 4
br i1 %28, label %29, label %36
29: ; preds = %26
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i32 @usage(i8* %34)
br label %197
36: ; preds = %26
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i64 @strncmp(i8* %39, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %36
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = call i32 @usage(i8* %47)
br label %197
49: ; preds = %36
%50 = call i32 (...) @getpid()
store i32 %50, i32* %15
%51 = load i32, i32* %15
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %4
%54 = icmp sge i32 %53, 3
br i1 %54, label %55, label %72
55: ; preds = %49
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 2
%58 = load i8*, i8** %57
%59 = call i32 @CONF_modules_load_file(i8* %58, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 0)
store i32 %59, i32* %13
%60 = load i32, i32* %13
%61 = icmp sle i32 %60, 0
br i1 %61, label %62, label %70
62: ; preds = %55
%63 = load i32, i32* @stderr
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 2
%66 = load i8*, i8** %65
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %66)
%68 = load i32, i32* %15
%69 = call i32 @error_queue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %68)
br label %197
70: ; preds = %55
%71 = call i32 (...) @ENGINE_add_conf_module()
br label %72
72: ; preds = %70, %49
%73 = call i32 (...) @ENGINE_add_conf_module()
%74 = call i32 (...) @OpenSSL_add_all_algorithms()
%75 = call i32 (...) @ERR_load_crypto_strings()
%76 = call i32 (...) @ERR_clear_error()
%77 = call i32 (...) @ENGINE_load_builtin_engines()
%78 = call i32* @ENGINE_by_id(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
store i32* %78, i32** %9
%79 = load i32*, i32** %9
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %86
81: ; preds = %72
%82 = load i32, i32* @stderr
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0))
%84 = load i32, i32* %15
%85 = call i32 @error_queue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %84)
br label %197
86: ; preds = %72
%87 = load i32, i32* %4
%88 = icmp sge i32 %87, 4
br i1 %88, label %89, label %95
89: ; preds = %86
%90 = load i32*, i32** %9
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 3
%93 = load i8*, i8** %92
%94 = call i32 @ENGINE_ctrl_cmd(i32* %90, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 0, i8* %93, i32* null, i32 1)
br label %95
95: ; preds = %89, %86
%96 = load i32*, i32** %9
%97 = call i64 @ENGINE_init(i32* %96)
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %113
99: ; preds = %95
%100 = load i32*, i32** %9
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 1
%103 = load i8*, i8** %102
%104 = call i32* @ENGINE_load_private_key(i32* %100, i8* %103, i32 0, i32 0)
store i32* %104, i32** %7
%105 = load i32*, i32** %7
%106 = icmp eq i32* %105, null
br i1 %106, label %107, label %110
107: ; preds = %99
%108 = load i32, i32* %15
%109 = call i32 @error_queue(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i32 %108)
br label %197
110: ; preds = %99
%111 = load i32*, i32** %9
%112 = call i32 @ENGINE_free(i32* %111)
store i32* null, i32** %9
br label %116
113: ; preds = %95
%114 = load i32, i32* %15
%115 = call i32 @error_queue(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i32 %114)
br label %197
116: ; preds = %110
%117 = load i32, i32* %14
%118 = call i64 @spawn_processes(i32 %117)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %121
120: ; preds = %116
br label %197
121: ; preds = %116
%122 = call i32 (...) @getpid()
store i32 %122, i32* %15
%123 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%124 = call i32 @RAND_bytes(i8* %123, i32 20)
%125 = icmp ne i32 %124, 0
br i1 %125, label %129, label %126
126: ; preds = %121
%127 = load i32, i32* %15
%128 = call i32 @error_queue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 %127)
br label %197
129: ; preds = %121
%130 = call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
store i32* %130, i32** %6
%131 = call i32* (...) @EVP_MD_CTX_create()
store i32* %131, i32** %8
%132 = load i32*, i32** %8
%133 = load i32*, i32** %6
%134 = call i64 @EVP_DigestInit(i32* %132, i32* %133)
%135 = icmp sle i64 %134, 0
br i1 %135, label %136, label %139
136: ; preds = %129
%137 = load i32, i32* %15
%138 = call i32 @error_queue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i32 %137)
br label %197
139: ; preds = %129
%140 = load i32*, i32** %8
%141 = load i32*, i32** %6
%142 = call i32 @EVP_SignInit(i32* %140, i32* %141)
%143 = load i32*, i32** %8
%144 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%145 = call i64 @EVP_SignUpdate(i32* %143, i8* %144, i32 20)
%146 = icmp sle i64 %145, 0
br i1 %146, label %147, label %150
147: ; preds = %139
%148 = load i32, i32* %15
%149 = call i32 @error_queue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i32 %148)
br label %197
150: ; preds = %139
%151 = load i32*, i32** %8
%152 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%153 = load i32*, i32** %7
%154 = call i64 @EVP_SignFinal(i32* %151, i8* %152, i32* %12, i32* %153)
%155 = icmp sle i64 %154, 0
br i1 %155, label %156, label %159
156: ; preds = %150
%157 = load i32, i32* %15
%158 = call i32 @error_queue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i32 %157)
br label %197
159: ; preds = %150
%160 = load i32*, i32** %8
%161 = call i32 @EVP_MD_CTX_destroy(i32* %160)
%162 = load i32, i32* %15
%163 = load i32, i32* %12
%164 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0), i32 %162, i32 %163)
%165 = call i32* (...) @EVP_MD_CTX_create()
store i32* %165, i32** %8
%166 = load i32*, i32** %8
%167 = load i32*, i32** %6
%168 = call i64 @EVP_DigestInit(i32* %166, i32* %167)
%169 = icmp sle i64 %168, 0
br i1 %169, label %170, label %173
170: ; preds = %159
%171 = load i32, i32* %15
%172 = call i32 @error_queue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i32 %171)
br label %197
173: ; preds = %159
%174 = load i32*, i32** %8
%175 = load i32*, i32** %6
%176 = call i32 @EVP_VerifyInit(i32* %174, i32* %175)
%177 = load i32*, i32** %8
%178 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%179 = call i64 @EVP_VerifyUpdate(i32* %177, i8* %178, i32 20)
%180 = icmp sle i64 %179, 0
br i1 %180, label %181, label %184
181: ; preds = %173
%182 = load i32, i32* %15
%183 = call i32 @error_queue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), i32 %182)
br label %197
184: ; preds = %173
%185 = load i32*, i32** %8
%186 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%187 = load i32, i32* %12
%188 = load i32*, i32** %7
%189 = call i64 @EVP_VerifyFinal(i32* %185, i8* %186, i32 %187, i32* %188)
%190 = icmp sle i64 %189, 0
br i1 %190, label %191, label %194
191: ; preds = %184
%192 = load i32, i32* %15
%193 = call i32 @error_queue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i32 %192)
br label %197
194: ; preds = %184
%195 = load i32, i32* %15
%196 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.22, i64 0, i64 0), i32 %195)
store i32 0, i32* %16
br label %197
197: ; preds = %194, %191, %181, %170, %156, %147, %136, %126, %120, %113, %107, %81, %62, %42, %29, %19
%198 = load i32*, i32** %8
%199 = icmp ne i32* %198, null
br i1 %199, label %200, label %203
200: ; preds = %197
%201 = load i32*, i32** %8
%202 = call i32 @EVP_MD_CTX_destroy(i32* %201)
br label %203
203: ; preds = %200, %197
%204 = load i32*, i32** %7
%205 = icmp ne i32* %204, null
br i1 %205, label %206, label %209
206: ; preds = %203
%207 = load i32*, i32** %7
%208 = call i32 @EVP_PKEY_free(i32* %207)
br label %209
209: ; preds = %206, %203
%210 = load i32*, i32** %9
%211 = icmp ne i32* %210, null
br i1 %211, label %212, label %215
212: ; preds = %209
%213 = load i32*, i32** %9
%214 = call i32 @ENGINE_free(i32* %213)
br label %215
215: ; preds = %212, %209
%216 = load i32, i32* %16
ret i32 %216
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Missing required arguments\0A\00"
@.str.1 = [20 x i8] c"Too many arguments\0A\00"
@.str.2 = [8 x i8] c"pkcs11:\00"
@.str.3 = [28 x i8] c"fatal: invalid PKCS URL\0A\00"
@.str.4 = [22 x i8] c"pid %d is the parent\0A\00"
@.str.5 = [8 x i8] c"engines\00"
@.str.6 = [16 x i8] c"cannot load %s\0A\00"
@.str.7 = [23 x i8] c"CONF_modules_load_file\00"
@.str.8 = [7 x i8] c"pkcs11\00"
@.str.9 = [38 x i8] c"fatal: engine \22pkcs11\22 not available\0A\00"
@.str.10 = [13 x i8] c"ENGINE_by_id\00"
@.str.11 = [12 x i8] c"MODULE_PATH\00"
@.str.12 = [24 x i8] c"ENGINE_load_private_key\00"
@.str.13 = [12 x i8] c"ENGINE_init\00"
@.str.14 = [11 x i8] c"RAND_bytes\00"
@.str.15 = [7 x i8] c"sha256\00"
@.str.16 = [15 x i8] c"EVP_DigestInit\00"
@.str.17 = [15 x i8] c"EVP_SignUpdate\00"
@.str.18 = [14 x i8] c"EVP_SignFinal\00"
@.str.19 = [35 x i8] c"pid %d: %u-byte signature created\0A\00"
@.str.20 = [17 x i8] c"EVP_VerifyUpdate\00"
@.str.21 = [16 x i8] c"EVP_VerifyFinal\00"
@.str.22 = [27 x i8] c"pid %d: Signature matched\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [20 x i8]
%4 = alloca [1024 x i8]
%5 = alloca i32
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = bitcast i32* %5 to i8*
store i32 1024, i32* %5
%9 = icmp slt i32 %0, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
%14 = tail call i32 @usage(i8* %13)
br label %137
15: ; preds = %2
%16 = icmp ugt i32 %0, 4
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%20 = load i8*, i8** %1
%21 = tail call i32 @usage(i8* %20)
br label %137
22: ; preds = %15
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call i64 @strncmp(i8* %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%26 = icmp eq i64 %25, 0
br i1 %26, label %32, label %27
27: ; preds = %22
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%30 = load i8*, i8** %1
%31 = tail call i32 @usage(i8* %30)
br label %137
32: ; preds = %22
%33 = tail call i32 (...) @getpid()
%34 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %33)
%35 = icmp ugt i32 %0, 2
br i1 %35, label %36, label %48
36: ; preds = %32
%37 = getelementptr inbounds i8*, i8** %1, i64 2
%38 = load i8*, i8** %37
%39 = tail call i32 @CONF_modules_load_file(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 0)
%40 = icmp slt i32 %39, 1
br i1 %40, label %41, label %46
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = load i8*, i8** %37
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %43)
%45 = tail call i32 @error_queue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %33)
br label %137
46: ; preds = %36
%47 = tail call i32 (...) @ENGINE_add_conf_module()
br label %48
48: ; preds = %46, %32
%49 = tail call i32 (...) @ENGINE_add_conf_module()
%50 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%51 = tail call i32 (...) @ERR_load_crypto_strings()
%52 = tail call i32 (...) @ERR_clear_error()
%53 = tail call i32 (...) @ENGINE_load_builtin_engines()
%54 = tail call i32* @ENGINE_by_id(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %60
56: ; preds = %48
%57 = load i32, i32* @stderr
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0))
%59 = tail call i32 @error_queue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %33)
br label %137
60: ; preds = %48
%61 = icmp ugt i32 %0, 3
br i1 %61, label %62, label %66
62: ; preds = %60
%63 = getelementptr inbounds i8*, i8** %1, i64 3
%64 = load i8*, i8** %63
%65 = tail call i32 @ENGINE_ctrl_cmd(i32* %54, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 0, i8* %64, i32* null, i32 1)
br label %66
66: ; preds = %62, %60
%67 = tail call i64 @ENGINE_init(i32* %54)
%68 = icmp eq i64 %67, 0
br i1 %68, label %133, label %69
69: ; preds = %66
%70 = load i8*, i8** %23
%71 = tail call i32* @ENGINE_load_private_key(i32* %54, i8* %70, i32 0, i32 0)
%72 = icmp eq i32* %71, null
br i1 %72, label %133, label %73
73: ; preds = %69
%74 = tail call i32 @ENGINE_free(i32* %54)
%75 = tail call i64 @spawn_processes(i32 2)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %130
77: ; preds = %73
%78 = tail call i32 (...) @getpid()
%79 = call i32 @RAND_bytes(i8* %6, i32 20)
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = call i32 @error_queue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 %78)
br label %130
83: ; preds = %77
%84 = call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%85 = call i32* (...) @EVP_MD_CTX_create()
%86 = call i64 @EVP_DigestInit(i32* %85, i32* %84)
%87 = icmp slt i64 %86, 1
br i1 %87, label %88, label %90
88: ; preds = %83
%89 = call i32 @error_queue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i32 %78)
br label %124
90: ; preds = %83
%91 = call i32 @EVP_SignInit(i32* %85, i32* %84)
%92 = call i64 @EVP_SignUpdate(i32* %85, i8* %6, i32 20)
%93 = icmp slt i64 %92, 1
br i1 %93, label %94, label %96
94: ; preds = %90
%95 = call i32 @error_queue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i32 %78)
br label %124
96: ; preds = %90
%97 = call i64 @EVP_SignFinal(i32* %85, i8* %7, i32* %5, i32* %71)
%98 = icmp slt i64 %97, 1
br i1 %98, label %99, label %101
99: ; preds = %96
%100 = call i32 @error_queue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i32 %78)
br label %124
101: ; preds = %96
%102 = call i32 @EVP_MD_CTX_destroy(i32* %85)
%103 = load i32, i32* %5
%104 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0), i32 %78, i32 %103)
%105 = call i32* (...) @EVP_MD_CTX_create()
%106 = call i64 @EVP_DigestInit(i32* %105, i32* %84)
%107 = icmp slt i64 %106, 1
br i1 %107, label %108, label %110
108: ; preds = %101
%109 = call i32 @error_queue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i32 %78)
br label %124
110: ; preds = %101
%111 = call i32 @EVP_VerifyInit(i32* %105, i32* %84)
%112 = call i64 @EVP_VerifyUpdate(i32* %105, i8* %6, i32 20)
%113 = icmp slt i64 %112, 1
br i1 %113, label %114, label %116
114: ; preds = %110
%115 = call i32 @error_queue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), i32 %78)
br label %124
116: ; preds = %110
%117 = load i32, i32* %5
%118 = call i64 @EVP_VerifyFinal(i32* %105, i8* %7, i32 %117, i32* %71)
%119 = icmp slt i64 %118, 1
br i1 %119, label %120, label %122
120: ; preds = %116
%121 = call i32 @error_queue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i32 %78)
br label %124
122: ; preds = %116
%123 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.22, i64 0, i64 0), i32 %78)
br label %124
124: ; preds = %122, %120, %114, %108, %99, %94, %88
%125 = phi i32* [ %85, %88 ], [ %85, %94 ], [ %85, %99 ], [ %105, %108 ], [ %105, %114 ], [ %105, %120 ], [ %105, %122 ]
%126 = phi i32 [ 1, %88 ], [ 1, %94 ], [ 1, %99 ], [ 1, %108 ], [ 1, %114 ], [ 1, %120 ], [ 0, %122 ]
%127 = icmp eq i32* %125, null
br i1 %127, label %130, label %128
128: ; preds = %124
%129 = call i32 @EVP_MD_CTX_destroy(i32* %125)
br label %130
130: ; preds = %73, %81, %128, %124
%131 = phi i32 [ 1, %73 ], [ 1, %81 ], [ %126, %128 ], [ %126, %124 ]
%132 = call i32 @EVP_PKEY_free(i32* %71)
br label %137
133: ; preds = %66, %69
%134 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), %69 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), %66 ]
%135 = tail call i32 @error_queue(i8* %134, i32 %33)
%136 = tail call i32 @ENGINE_free(i32* %54)
br label %137
137: ; preds = %56, %41, %27, %17, %10, %130, %133
%138 = phi i32 [ %131, %130 ], [ 1, %133 ], [ 1, %10 ], [ 1, %17 ], [ 1, %27 ], [ 1, %41 ], [ 1, %56 ]
ret i32 %138
}