#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 /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ CRYPTO_cleanup_all_ex_data();
int /*<<< orphan*/ CRYPTO_mem_leaks_fp(int /*<<< orphan*/);
scalar_t__ ENGINE_add(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_cleanup();
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_get_first();
char *ENGINE_get_id(int /*<<< orphan*/ *);
char *ENGINE_get_name(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_new();
scalar_t__ ENGINE_remove(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_set_id(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ ENGINE_set_name(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ ERR_clear_error();
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ ERR_remove_thread_state(int /*<<< orphan*/ *);
int /*<<< orphan*/ asprintf(char **, char *, int);
int /*<<< orphan*/ display_engine_list();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memset(int /*<<< orphan*/ **, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  ENGINE *block[512];
  char *id, *name;
  ENGINE *ptr;
  int loop;
  int to_return = 1;
  ENGINE *new_h1 = NULL;
  ENGINE *new_h2 = NULL;
  ENGINE *new_h3 = NULL;
  ENGINE *new_h4 = NULL;
  ERR_load_crypto_strings();
  memset(block, 0, 512 * sizeof(ENGINE *));
  if (((new_h1 = ENGINE_new()) == NULL) || !ENGINE_set_id(new_h1, "test_id0") ||
      !ENGINE_set_name(new_h1, "First test item") ||
      ((new_h2 = ENGINE_new()) == NULL) || !ENGINE_set_id(new_h2, "test_id1") ||
      !ENGINE_set_name(new_h2, "Second test item") ||
      ((new_h3 = ENGINE_new()) == NULL) || !ENGINE_set_id(new_h3, "test_id2") ||
      !ENGINE_set_name(new_h3, "Third test item") ||
      ((new_h4 = ENGINE_new()) == NULL) || !ENGINE_set_id(new_h4, "test_id3") ||
      !ENGINE_set_name(new_h4, "Fourth test item")) {
    printf("Couldn't set up test ENGINE structures\n");
    goto end;
  }
  printf("\nenginetest beginning\n\n");
  display_engine_list();
  if (!ENGINE_add(new_h1)) {
    printf("Add failed!\n");
    goto end;
  }
  display_engine_list();
  ptr = ENGINE_get_first();
  if (!ENGINE_remove(ptr)) {
    printf("Remove failed!\n");
    goto end;
  }
  if (ptr)
    ENGINE_free(ptr);
  display_engine_list();
  if (!ENGINE_add(new_h3) || !ENGINE_add(new_h2)) {
    printf("Add failed!\n");
    goto end;
  }
  display_engine_list();
  if (!ENGINE_remove(new_h2)) {
    printf("Remove failed!\n");
    goto end;
  }
  display_engine_list();
  if (!ENGINE_add(new_h4)) {
    printf("Add failed!\n");
    goto end;
  }
  display_engine_list();
  if (ENGINE_add(new_h3)) {
    printf("Add *should* have failed but didn't!\n");
    goto end;
  } else
    printf("Add that should fail did.\n");
  ERR_clear_error();
  if (ENGINE_remove(new_h2)) {
    printf("Remove *should* have failed but didn't!\n");
    goto end;
  } else
    printf("Remove that should fail did.\n");
  ERR_clear_error();
  if (!ENGINE_remove(new_h3)) {
    printf("Remove failed!\n");
    goto end;
  }
  display_engine_list();
  if (!ENGINE_remove(new_h4)) {
    printf("Remove failed!\n");
    goto end;
  }
  display_engine_list();
  ptr = ENGINE_get_first();
  if (ptr)
    if (!ENGINE_remove(ptr))
      printf("Remove failed!i - probably no hardware "
             "support present.\n");
  if (ptr)
    ENGINE_free(ptr);
  display_engine_list();
  if (!ENGINE_add(new_h1) || !ENGINE_remove(new_h1)) {
    printf("Couldn't add and remove to an empty list!\n");
    goto end;
  } else
    printf("Successfully added and removed to an empty list!\n");
  printf("About to beef up the engine-type list\n");
  for (loop = 0; loop < 512; loop++) {
    asprintf(&id, "id%i", loop);
    asprintf(&name, "Fake engine type %i", loop);
    if (((block[loop] = ENGINE_new()) == NULL) || !id ||
        !ENGINE_set_id(block[loop], id) || !name ||
        !ENGINE_set_name(block[loop], name)) {
      printf("Couldn't create block of ENGINE structures.\n"
             "I'll probably also core-dump now, damn.\n");
      goto end;
    }
  }
  for (loop = 0; loop < 512; loop++) {
    if (!ENGINE_add(block[loop])) {
      printf("\nAdding stopped at %i, (%s,%s)\n", loop,
             ENGINE_get_id(block[loop]), ENGINE_get_name(block[loop]));
      goto cleanup_loop;
    } else
      printf(".");
    fflush(stdout);
  }
cleanup_loop:
  printf("\nAbout to empty the engine-type list\n");
  while ((ptr = ENGINE_get_first()) != NULL) {
    if (!ENGINE_remove(ptr)) {
      printf("\nRemove failed!\n");
      goto end;
    }
    ENGINE_free(ptr);
    printf(".");
    fflush(stdout);
  }
  for (loop = 0; loop < 512; loop++) {
    free((void *)ENGINE_get_id(block[loop]));
    free((void *)ENGINE_get_name(block[loop]));
  }
  printf("\nTests completed happily\n");
  to_return = 0;
end:
  if (to_return)
    ERR_print_errors_fp(stderr);
  if (new_h1)
    ENGINE_free(new_h1);
  if (new_h2)
    ENGINE_free(new_h2);
  if (new_h3)
    ENGINE_free(new_h3);
  if (new_h4)
    ENGINE_free(new_h4);
  for (loop = 0; loop < 512; loop++)
    if (block[loop])
      ENGINE_free(block[loop]);
  ENGINE_cleanup();
  CRYPTO_cleanup_all_ex_data();
  ERR_free_strings();
  ERR_remove_thread_state(NULL);
  CRYPTO_mem_leaks_fp(stderr);
  return to_return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1030(%rbp)
movq   $0x0,-0x1038(%rbp)
movq   $0x0,-0x1040(%rbp)
movq   $0x0,-0x1048(%rbp)
movq   $0x0,-0x1050(%rbp)
mov    $0x0,%al
call   1170 <ERR_load_crypto_strings@plt>
lea    -0x1010(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   10c0 <memset@plt>
mov    $0x0,%al
call   10d0 <ENGINE_new@plt>
mov    %rax,-0x1038(%rbp)
cmp    $0x0,%rax
je     1419 <main+0x1a9>
mov    -0x1038(%rbp),%rdi
lea    0xd01(%rip),%rsi
call   1140 <ENGINE_set_id@plt>
cmp    $0x0,%eax
je     1419 <main+0x1a9>
mov    -0x1038(%rbp),%rdi
lea    0xcee(%rip),%rsi
call   1120 <ENGINE_set_name@plt>
cmp    $0x0,%eax
je     1419 <main+0x1a9>
mov    $0x0,%al
call   10d0 <ENGINE_new@plt>
mov    %rax,-0x1040(%rbp)
cmp    $0x0,%rax
je     1419 <main+0x1a9>
mov    -0x1040(%rbp),%rdi
lea    0xcca(%rip),%rsi
call   1140 <ENGINE_set_id@plt>
cmp    $0x0,%eax
je     1419 <main+0x1a9>
mov    -0x1040(%rbp),%rdi
lea    0xcb7(%rip),%rsi
call   1120 <ENGINE_set_name@plt>
cmp    $0x0,%eax
je     1419 <main+0x1a9>
mov    $0x0,%al
call   10d0 <ENGINE_new@plt>
mov    %rax,-0x1048(%rbp)
cmp    $0x0,%rax
je     1419 <main+0x1a9>
mov    -0x1048(%rbp),%rdi
lea    0xc94(%rip),%rsi
call   1140 <ENGINE_set_id@plt>
cmp    $0x0,%eax
je     1419 <main+0x1a9>
mov    -0x1048(%rbp),%rdi
lea    0xc81(%rip),%rsi
call   1120 <ENGINE_set_name@plt>
cmp    $0x0,%eax
je     1419 <main+0x1a9>
mov    $0x0,%al
call   10d0 <ENGINE_new@plt>
mov    %rax,-0x1050(%rbp)
cmp    $0x0,%rax
je     1419 <main+0x1a9>
mov    -0x1050(%rbp),%rdi
lea    0xc5d(%rip),%rsi
call   1140 <ENGINE_set_id@plt>
cmp    $0x0,%eax
je     1419 <main+0x1a9>
mov    -0x1050(%rbp),%rdi
lea    0xc4a(%rip),%rsi
call   1120 <ENGINE_set_name@plt>
cmp    $0x0,%eax
jne    142c <main+0x1bc>
lea    0xc46(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
lea    0xc5b(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    -0x1038(%rbp),%rdi
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
jne    146a <main+0x1fa>
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    $0x0,%al
call   1160 <ENGINE_get_first@plt>
mov    %rax,-0x1028(%rbp)
mov    -0x1028(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    14a8 <main+0x238>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
cmpq   $0x0,-0x1028(%rbp)
je     14c2 <main+0x252>
mov    -0x1028(%rbp),%rdi
call   1040 <ENGINE_free@plt>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    -0x1048(%rbp),%rdi
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
je     14f5 <main+0x285>
mov    -0x1040(%rbp),%rdi
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
jne    1508 <main+0x298>
lea    0xbaa(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    -0x1040(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    1538 <main+0x2c8>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    -0x1050(%rbp),%rdi
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
jne    1568 <main+0x2f8>
lea    0xb4a(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    -0x1048(%rbp),%rdi
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
je     1598 <main+0x328>
lea    0xb27(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
lea    0xb3a(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    $0x0,%al
call   10e0 <ERR_clear_error@plt>
mov    -0x1040(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
je     15d6 <main+0x366>
lea    0xb2a(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
lea    0xb40(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    $0x0,%al
call   10e0 <ERR_clear_error@plt>
mov    -0x1048(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    1614 <main+0x3a4>
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    -0x1050(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    1644 <main+0x3d4>
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    $0x0,%al
call   1160 <ENGINE_get_first@plt>
mov    %rax,-0x1028(%rbp)
cmpq   $0x0,-0x1028(%rbp)
je     1690 <main+0x420>
mov    -0x1028(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    168b <main+0x41b>
lea    0xab7(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    1690 <main+0x420>
cmpq   $0x0,-0x1028(%rbp)
je     16aa <main+0x43a>
mov    -0x1028(%rbp),%rdi
call   1040 <ENGINE_free@plt>
mov    $0x0,%al
call   1100 <display_engine_list@plt>
mov    -0x1038(%rbp),%rdi
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
je     16dd <main+0x46d>
mov    -0x1038(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    16f0 <main+0x480>
lea    0xa90(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
lea    0xaa8(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
lea    0xacc(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
movl   $0x0,-0x102c(%rbp)
cmpl   $0x200,-0x102c(%rbp)
jge    1808 <main+0x598>
mov    -0x102c(%rbp),%edx
lea    -0x1018(%rbp),%rdi
lea    0xabe(%rip),%rsi
call   1130 <asprintf@plt>
mov    -0x102c(%rbp),%edx
lea    -0x1020(%rbp),%rdi
lea    0xaaa(%rip),%rsi
call   1130 <asprintf@plt>
mov    $0x0,%al
call   10d0 <ENGINE_new@plt>
movslq -0x102c(%rbp),%rcx
mov    %rax,-0x1010(%rbp,%rcx,8)
ff
cmp    $0x0,%rax
je     17dc <main+0x56c>
cmpq   $0x0,-0x1018(%rbp)
je     17dc <main+0x56c>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
mov    -0x1018(%rbp),%rsi
call   1140 <ENGINE_set_id@plt>
cmp    $0x0,%eax
je     17dc <main+0x56c>
cmpq   $0x0,-0x1020(%rbp)
je     17dc <main+0x56c>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
mov    -0x1020(%rbp),%rsi
call   1120 <ENGINE_set_name@plt>
cmp    $0x0,%eax
jne    17ef <main+0x57f>
lea    0xa2e(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
jmp    17f4 <main+0x584>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    1716 <main+0x4a6>
movl   $0x0,-0x102c(%rbp)
cmpl   $0x200,-0x102c(%rbp)
jge    18ce <main+0x65e>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
jne    189e <main+0x62e>
mov    -0x102c(%rbp),%eax
mov    %eax,-0x105c(%rbp)
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   1190 <ENGINE_get_id@plt>
mov    %rax,-0x1058(%rbp)
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   1090 <ENGINE_get_name@plt>
mov    -0x105c(%rbp),%esi
mov    -0x1058(%rbp),%rdx
mov    %rax,%rcx
lea    0x9d4(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    18d3 <main+0x663>
lea    0x9e1(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    0x2725(%rip),%rax
mov    (%rax),%edi
call   1110 <fflush@plt>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    1812 <main+0x5a2>
jmp    18d3 <main+0x663>
lea    0x9ae(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    $0x0,%al
call   1160 <ENGINE_get_first@plt>
mov    %rax,-0x1028(%rbp)
cmp    $0x0,%rax
je     194f <main+0x6df>
mov    -0x1028(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    1922 <main+0x6b2>
lea    0x998(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19cd <main+0x75d>
mov    -0x1028(%rbp),%rdi
call   1040 <ENGINE_free@plt>
lea    0x951(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    0x2695(%rip),%rax
mov    (%rax),%edi
call   1110 <fflush@plt>
jmp    18e1 <main+0x671>
movl   $0x0,-0x102c(%rbp)
cmpl   $0x200,-0x102c(%rbp)
jge    19b5 <main+0x745>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   1190 <ENGINE_get_id@plt>
mov    %rax,%rdi
call   1030 <free@plt>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   1090 <ENGINE_get_name@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    1959 <main+0x6e9>
lea    0x903(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
movl   $0x0,-0x1030(%rbp)
cmpl   $0x0,-0x1030(%rbp)
je     19e8 <main+0x778>
mov    0x25ff(%rip),%rax
mov    (%rax),%edi
call   1180 <ERR_print_errors_fp@plt>
cmpq   $0x0,-0x1038(%rbp)
je     1a02 <main+0x792>
mov    -0x1038(%rbp),%rdi
call   1040 <ENGINE_free@plt>
cmpq   $0x0,-0x1040(%rbp)
je     1a1c <main+0x7ac>
mov    -0x1040(%rbp),%rdi
call   1040 <ENGINE_free@plt>
cmpq   $0x0,-0x1048(%rbp)
je     1a36 <main+0x7c6>
mov    -0x1048(%rbp),%rdi
call   1040 <ENGINE_free@plt>
cmpq   $0x0,-0x1050(%rbp)
je     1a50 <main+0x7e0>
mov    -0x1050(%rbp),%rdi
call   1040 <ENGINE_free@plt>
movl   $0x0,-0x102c(%rbp)
cmpl   $0x200,-0x102c(%rbp)
jge    1aad <main+0x83d>
movslq -0x102c(%rbp),%rax
cmpq   $0x0,-0x1010(%rbp,%rax,8)
je     1a94 <main+0x824>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   1040 <ENGINE_free@plt>
jmp    1a99 <main+0x829>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    1a5a <main+0x7ea>
mov    $0x0,%al
call   1080 <ENGINE_cleanup@plt>
mov    $0x0,%al
call   1070 <CRYPTO_cleanup_all_ex_data@plt>
mov    $0x0,%al
call   10f0 <ERR_free_strings@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <ERR_remove_thread_state@plt>
mov    0x250e(%rip),%rax
mov    (%rax),%edi
call   1060 <CRYPTO_mem_leaks_fp@plt>
mov    -0x1030(%rbp),%eax
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1018,%rsp
xor    %r14d,%r14d
xor    %eax,%eax
call   1190 <ERR_load_crypto_strings@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   10e0 <memset@plt>
xor    %eax,%eax
call   10f0 <ENGINE_new@plt>
mov    %rax,%rbx
lea    0xdd2(%rip),%r13
test   %rax,%rax
je     149f <main+0x20f>
lea    0xd23(%rip),%rsi
mov    %rbx,%rdi
call   1160 <ENGINE_set_id@plt>
test   %eax,%eax
je     149c <main+0x20c>
lea    0xd15(%rip),%rsi
mov    %rbx,%rdi
call   1140 <ENGINE_set_name@plt>
test   %eax,%eax
je     149c <main+0x20c>
xor    %r15d,%r15d
xor    %eax,%eax
call   10f0 <ENGINE_new@plt>
test   %rax,%rax
je     155c <main+0x2cc>
mov    %rax,%r14
lea    0xcf8(%rip),%rsi
mov    %rax,%rdi
call   1160 <ENGINE_set_id@plt>
test   %eax,%eax
je     149f <main+0x20f>
lea    0xcea(%rip),%rsi
mov    %r14,%rdi
call   1140 <ENGINE_set_name@plt>
test   %eax,%eax
je     149f <main+0x20f>
xor    %r12d,%r12d
xor    %eax,%eax
call   10f0 <ENGINE_new@plt>
test   %rax,%rax
je     1564 <main+0x2d4>
mov    %rax,%r15
lea    0xcce(%rip),%rsi
mov    %rax,%rdi
call   1160 <ENGINE_set_id@plt>
test   %eax,%eax
je     14a2 <main+0x212>
lea    0xcc0(%rip),%rsi
mov    %r15,%rdi
call   1140 <ENGINE_set_name@plt>
test   %eax,%eax
je     14a2 <main+0x212>
xor    %eax,%eax
call   10f0 <ENGINE_new@plt>
test   %rax,%rax
je     14a2 <main+0x212>
mov    %rax,%r12
lea    0xca6(%rip),%rsi
mov    %rax,%rdi
call   1160 <ENGINE_set_id@plt>
test   %eax,%eax
je     14a5 <main+0x215>
lea    0xc98(%rip),%rsi
mov    %r12,%rdi
call   1140 <ENGINE_set_name@plt>
test   %eax,%eax
je     14a5 <main+0x215>
lea    0xcf2(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %rbx,%rdi
call   10c0 <ENGINE_add@plt>
lea    0xcee(%rip),%r13
test   %rax,%rax
je     14a5 <main+0x215>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
xor    %eax,%eax
call   1180 <ENGINE_get_first@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1170 <ENGINE_remove@plt>
lea    0xdc8(%rip),%rcx
test   %rax,%rax
je     156c <main+0x2dc>
test   %rbp,%rbp
je     142e <main+0x19e>
mov    %rbp,%rdi
call   1040 <ENGINE_free@plt>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %r15,%rdi
call   10c0 <ENGINE_add@plt>
test   %rax,%rax
je     14a5 <main+0x215>
mov    %r14,%rdi
call   10c0 <ENGINE_add@plt>
test   %rax,%rax
je     14a5 <main+0x215>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %r14,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
je     1723 <main+0x493>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %r12,%rdi
call   10c0 <ENGINE_add@plt>
test   %rax,%rax
je     14a5 <main+0x215>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %r15,%rdi
call   10c0 <ENGINE_add@plt>
test   %rax,%rax
je     1574 <main+0x2e4>
lea    0xe09(%rip),%r13
jmp    14a5 <main+0x215>
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %r12d,%r12d
mov    %r13,%rdi
call   1060 <puts@plt>
mov    0x2b2c(%rip),%rax
mov    (%rax),%edi
call   11a0 <ERR_print_errors_fp@plt>
mov    $0x1,%ebp
test   %rbx,%rbx
je     14cd <main+0x23d>
mov    %rbx,%rdi
call   1040 <ENGINE_free@plt>
test   %r14,%r14
je     14da <main+0x24a>
mov    %r14,%rdi
call   1040 <ENGINE_free@plt>
test   %r15,%r15
je     14e7 <main+0x257>
mov    %r15,%rdi
call   1040 <ENGINE_free@plt>
test   %r12,%r12
je     14f4 <main+0x264>
mov    %r12,%rdi
call   1040 <ENGINE_free@plt>
xor    %ebx,%ebx
jmp    150d <main+0x27d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x200,%rbx
je     151e <main+0x28e>
mov    0x10(%rsp,%rbx,8),%rdi
test   %rdi,%rdi
je     1500 <main+0x270>
call   1040 <ENGINE_free@plt>
jmp    1500 <main+0x270>
xor    %eax,%eax
call   10a0 <ENGINE_cleanup@plt>
xor    %eax,%eax
call   1090 <CRYPTO_cleanup_all_ex_data@plt>
xor    %eax,%eax
call   1110 <ERR_free_strings@plt>
xor    %edi,%edi
call   1070 <ERR_remove_thread_state@plt>
mov    0x2a9f(%rip),%rax
mov    (%rax),%edi
call   1080 <CRYPTO_mem_leaks_fp@plt>
mov    %ebp,%eax
add    $0x1018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r14d,%r14d
jmp    14a2 <main+0x212>
xor    %r15d,%r15d
jmp    14a5 <main+0x215>
mov    %rcx,%r13
jmp    14a5 <main+0x215>
lea    0xb6e(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1100 <ERR_clear_error@plt>
mov    %r14,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
je     15a0 <main+0x310>
lea    0xce0(%rip),%r13
jmp    14a5 <main+0x215>
lea    0xb5c(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1100 <ERR_clear_error@plt>
mov    %r15,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
je     1723 <main+0x493>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %r12,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
je     1723 <main+0x493>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
xor    %eax,%eax
call   1180 <ENGINE_get_first@plt>
test   %rax,%rax
je     1613 <main+0x383>
mov    %rax,%rbp
mov    %rax,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
jne    160b <main+0x37b>
lea    0xc3d(%rip),%rdi
call   1060 <puts@plt>
mov    %rbp,%rdi
call   1040 <ENGINE_free@plt>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %rbx,%rdi
call   10c0 <ENGINE_add@plt>
lea    0xaf7(%rip),%r13
test   %rax,%rax
je     14a5 <main+0x215>
mov    %rbx,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
je     14a5 <main+0x215>
lea    0xb00(%rip),%rdi
call   1060 <puts@plt>
lea    0xb25(%rip),%rdi
call   1060 <puts@plt>
lea    0xb8d(%rip),%r13
xor    %ebp,%ebp
lea    0x8(%rsp),%rdi
lea    0x9f6(%rip),%rsi
mov    %ebp,%edx
call   1150 <asprintf@plt>
mov    %rsp,%rdi
lea    0x9ea(%rip),%rsi
mov    %ebp,%edx
call   1150 <asprintf@plt>
xor    %eax,%eax
call   10f0 <ENGINE_new@plt>
mov    %rax,0x10(%rsp,%rbp,8)
test   %rax,%rax
je     14a5 <main+0x215>
mov    0x8(%rsp),%rsi
test   %rsi,%rsi
je     14a5 <main+0x215>
mov    %rax,%rdi
call   1160 <ENGINE_set_id@plt>
test   %eax,%eax
je     14a5 <main+0x215>
mov    (%rsp),%rsi
test   %rsi,%rsi
je     14a5 <main+0x215>
mov    0x10(%rsp,%rbp,8),%rdi
call   1140 <ENGINE_set_name@plt>
test   %eax,%eax
je     14a5 <main+0x215>
add    $0x1,%rbp
cmp    $0x200,%rbp
jne    1664 <main+0x3d4>
xor    %ebp,%ebp
mov    0x10(%rsp,%rbp,8),%rdi
call   10c0 <ENGINE_add@plt>
test   %rax,%rax
je     172f <main+0x49f>
mov    $0x2e,%edi
call   1050 <putchar@plt>
mov    0x28cb(%rip),%rax
mov    (%rax),%edi
call   1130 <fflush@plt>
add    $0x1,%rbp
cmp    $0x200,%rbp
jne    16ed <main+0x45d>
jmp    175c <main+0x4cc>
lea    0xab6(%rip),%r13
jmp    14a5 <main+0x215>
mov    0x10(%rsp,%rbp,8),%rdi
call   11b0 <ENGINE_get_id@plt>
mov    %rax,%r13
mov    0x10(%rsp,%rbp,8),%rdi
call   10b0 <ENGINE_get_name@plt>
lea    0x932(%rip),%rdi
mov    %ebp,%esi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10d0 <printf@plt>
lea    0xa3e(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1180 <ENGINE_get_first@plt>
test   %rax,%rax
je     17be <main+0x52e>
mov    %rax,%rbp
lea    0xa61(%rip),%r13
mov    %rbp,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
je     14a5 <main+0x215>
mov    %rbp,%rdi
call   1040 <ENGINE_free@plt>
mov    $0x2e,%edi
call   1050 <putchar@plt>
mov    0x2830(%rip),%rax
mov    (%rax),%edi
call   1130 <fflush@plt>
xor    %eax,%eax
call   1180 <ENGINE_get_first@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    177e <main+0x4ee>
xor    %ebp,%ebp
mov    0x10(%rsp,%rbp,8),%rdi
call   11b0 <ENGINE_get_id@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    0x10(%rsp,%rbp,8),%rdi
call   10b0 <ENGINE_get_name@plt>
mov    %rax,%rdi
call   1030 <free@plt>
add    $0x1,%rbp
cmp    $0x200,%rbp
jne    17c0 <main+0x530>
lea    0x9ce(%rip),%rdi
call   1060 <puts@plt>
xor    %ebp,%ebp
test   %rbx,%rbx
jne    14c5 <main+0x235>
jmp    14cd <main+0x23d>

LLVM IR (-O0):
@.str = [9 x i8] c"test_id0\00"
@.str.1 = [16 x i8] c"First test item\00"
@.str.2 = [9 x i8] c"test_id1\00"
@.str.3 = [17 x i8] c"Second test item\00"
@.str.4 = [9 x i8] c"test_id2\00"
@.str.5 = [16 x i8] c"Third test item\00"
@.str.6 = [9 x i8] c"test_id3\00"
@.str.7 = [17 x i8] c"Fourth test item\00"
@.str.8 = [40 x i8] c"Couldn't set up test ENGINE structures\0A\00"
@.str.9 = [24 x i8] c"\0Aenginetest beginning\0A\0A\00"
@.str.10 = [13 x i8] c"Add failed!\0A\00"
@.str.11 = [16 x i8] c"Remove failed!\0A\00"
@.str.12 = [38 x i8] c"Add *should* have failed but didn't!\0A\00"
@.str.13 = [27 x i8] c"Add that should fail did.\0A\00"
@.str.14 = [41 x i8] c"Remove *should* have failed but didn't!\0A\00"
@.str.15 = [30 x i8] c"Remove that should fail did.\0A\00"
@.str.16 = [57 x i8] c"Remove failed!i - probably no hardware support present.\0A\00"
@.str.17 = [43 x i8] c"Couldn't add and remove to an empty list!\0A\00"
@.str.18 = [50 x i8] c"Successfully added and removed to an empty list!\0A\00"
@.str.19 = [39 x i8] c"About to beef up the engine-type list\0A\00"
@.str.20 = [5 x i8] c"id%i\00"
@.str.21 = [20 x i8] c"Fake engine type %i\00"
@.str.22 = [85 x i8] c"Couldn't create block of ENGINE structures.\0AI'll probably also core-dump now, damn.\0A\00"
@.str.23 = [32 x i8] c"\0AAdding stopped at %i, (%s,%s)\0A\00"
@.str.24 = [2 x i8] c".\00"
@stdout = global i32 0
@.str.25 = [38 x i8] c"\0AAbout to empty the engine-type list\0A\00"
@.str.26 = [17 x i8] c"\0ARemove failed!\0A\00"
@.str.27 = [26 x i8] c"\0ATests completed happily\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [512 x i32*]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %11
store i32* null, i32** %12
store i32* null, i32** %13
store i32* null, i32** %14
store i32* null, i32** %15
%16 = call i32 (...) @ERR_load_crypto_strings()
%17 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 0
%18 = call i32 @memset(i32** %17, i32 0, i32 4096)
%19 = call i32* (...) @ENGINE_new()
store i32* %19, i32** %12
%20 = icmp eq i32* %19, null
br i1 %20, label %62, label %21
21: ; preds = %2
%22 = load i32*, i32** %12
%23 = call i32 @ENGINE_set_id(i32* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %62
25: ; preds = %21
%26 = load i32*, i32** %12
%27 = call i32 @ENGINE_set_name(i32* %26, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %62
29: ; preds = %25
%30 = call i32* (...) @ENGINE_new()
store i32* %30, i32** %13
%31 = icmp eq i32* %30, null
br i1 %31, label %62, label %32
32: ; preds = %29
%33 = load i32*, i32** %13
%34 = call i32 @ENGINE_set_id(i32* %33, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %62
36: ; preds = %32
%37 = load i32*, i32** %13
%38 = call i32 @ENGINE_set_name(i32* %37, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %62
40: ; preds = %36
%41 = call i32* (...) @ENGINE_new()
store i32* %41, i32** %14
%42 = icmp eq i32* %41, null
br i1 %42, label %62, label %43
43: ; preds = %40
%44 = load i32*, i32** %14
%45 = call i32 @ENGINE_set_id(i32* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %62
47: ; preds = %43
%48 = load i32*, i32** %14
%49 = call i32 @ENGINE_set_name(i32* %48, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %62
51: ; preds = %47
%52 = call i32* (...) @ENGINE_new()
store i32* %52, i32** %15
%53 = icmp eq i32* %52, null
br i1 %53, label %62, label %54
54: ; preds = %51
%55 = load i32*, i32** %15
%56 = call i32 @ENGINE_set_id(i32* %55, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %54
%59 = load i32*, i32** %15
%60 = call i32 @ENGINE_set_name(i32* %59, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %58, %54, %51, %47, %43, %40, %36, %32, %29, %25, %21, %2
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
br label %289
64: ; preds = %58
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%66 = call i32 (...) @display_engine_list()
%67 = load i32*, i32** %12
%68 = call i64 @ENGINE_add(i32* %67)
%69 = icmp ne i64 %68, 0
br i1 %69, label %72, label %70
70: ; preds = %64
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %289
72: ; preds = %64
%73 = call i32 (...) @display_engine_list()
%74 = call i32* (...) @ENGINE_get_first()
store i32* %74, i32** %9
%75 = load i32*, i32** %9
%76 = call i64 @ENGINE_remove(i32* %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %80, label %78
78: ; preds = %72
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %289
80: ; preds = %72
%81 = load i32*, i32** %9
%82 = icmp ne i32* %81, null
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = load i32*, i32** %9
%85 = call i32 @ENGINE_free(i32* %84)
br label %86
86: ; preds = %83, %80
%87 = call i32 (...) @display_engine_list()
%88 = load i32*, i32** %14
%89 = call i64 @ENGINE_add(i32* %88)
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %86
%92 = load i32*, i32** %13
%93 = call i64 @ENGINE_add(i32* %92)
%94 = icmp ne i64 %93, 0
br i1 %94, label %97, label %95
95: ; preds = %91, %86
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %289
97: ; preds = %91
%98 = call i32 (...) @display_engine_list()
%99 = load i32*, i32** %13
%100 = call i64 @ENGINE_remove(i32* %99)
%101 = icmp ne i64 %100, 0
br i1 %101, label %104, label %102
102: ; preds = %97
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %289
104: ; preds = %97
%105 = call i32 (...) @display_engine_list()
%106 = load i32*, i32** %15
%107 = call i64 @ENGINE_add(i32* %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %111, label %109
109: ; preds = %104
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %289
111: ; preds = %104
%112 = call i32 (...) @display_engine_list()
%113 = load i32*, i32** %14
%114 = call i64 @ENGINE_add(i32* %113)
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %111
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0))
br label %289
118: ; preds = %111
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
br label %120
120: ; preds = %118
%121 = call i32 (...) @ERR_clear_error()
%122 = load i32*, i32** %13
%123 = call i64 @ENGINE_remove(i32* %122)
%124 = icmp ne i64 %123, 0
br i1 %124, label %125, label %127
125: ; preds = %120
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.14, i64 0, i64 0))
br label %289
127: ; preds = %120
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0))
br label %129
129: ; preds = %127
%130 = call i32 (...) @ERR_clear_error()
%131 = load i32*, i32** %14
%132 = call i64 @ENGINE_remove(i32* %131)
%133 = icmp ne i64 %132, 0
br i1 %133, label %136, label %134
134: ; preds = %129
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %289
136: ; preds = %129
%137 = call i32 (...) @display_engine_list()
%138 = load i32*, i32** %15
%139 = call i64 @ENGINE_remove(i32* %138)
%140 = icmp ne i64 %139, 0
br i1 %140, label %143, label %141
141: ; preds = %136
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %289
143: ; preds = %136
%144 = call i32 (...) @display_engine_list()
%145 = call i32* (...) @ENGINE_get_first()
store i32* %145, i32** %9
%146 = load i32*, i32** %9
%147 = icmp ne i32* %146, null
br i1 %147, label %148, label %155
148: ; preds = %143
%149 = load i32*, i32** %9
%150 = call i64 @ENGINE_remove(i32* %149)
%151 = icmp ne i64 %150, 0
br i1 %151, label %154, label %152
152: ; preds = %148
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.16, i64 0, i64 0))
br label %154
154: ; preds = %152, %148
br label %155
155: ; preds = %154, %143
%156 = load i32*, i32** %9
%157 = icmp ne i32* %156, null
br i1 %157, label %158, label %161
158: ; preds = %155
%159 = load i32*, i32** %9
%160 = call i32 @ENGINE_free(i32* %159)
br label %161
161: ; preds = %158, %155
%162 = call i32 (...) @display_engine_list()
%163 = load i32*, i32** %12
%164 = call i64 @ENGINE_add(i32* %163)
%165 = icmp ne i64 %164, 0
br i1 %165, label %166, label %170
166: ; preds = %161
%167 = load i32*, i32** %12
%168 = call i64 @ENGINE_remove(i32* %167)
%169 = icmp ne i64 %168, 0
br i1 %169, label %172, label %170
170: ; preds = %166, %161
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.17, i64 0, i64 0))
br label %289
172: ; preds = %166
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.18, i64 0, i64 0))
br label %174
174: ; preds = %172
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %10
br label %176
176: ; preds = %214, %174
%177 = load i32, i32* %10
%178 = icmp slt i32 %177, 512
br i1 %178, label %179, label %217
179: ; preds = %176
%180 = load i32, i32* %10
%181 = call i32 @asprintf(i8** %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i32 %180)
%182 = load i32, i32* %10
%183 = call i32 @asprintf(i8** %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i32 %182)
%184 = call i32* (...) @ENGINE_new()
%185 = load i32, i32* %10
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %186
store i32* %184, i32** %187
%188 = icmp eq i32* %184, null
br i1 %188, label %211, label %189
189: ; preds = %179
%190 = load i8*, i8** %7
%191 = icmp ne i8* %190, null
br i1 %191, label %192, label %211
192: ; preds = %189
%193 = load i32, i32* %10
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %194
%196 = load i32*, i32** %195
%197 = load i8*, i8** %7
%198 = call i32 @ENGINE_set_id(i32* %196, i8* %197)
%199 = icmp ne i32 %198, 0
br i1 %199, label %200, label %211
200: ; preds = %192
%201 = load i8*, i8** %8
%202 = icmp ne i8* %201, null
br i1 %202, label %203, label %211
203: ; preds = %200
%204 = load i32, i32* %10
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %205
%207 = load i32*, i32** %206
%208 = load i8*, i8** %8
%209 = call i32 @ENGINE_set_name(i32* %207, i8* %208)
%210 = icmp ne i32 %209, 0
br i1 %210, label %213, label %211
211: ; preds = %203, %200, %192, %189, %179
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.22, i64 0, i64 0))
br label %289
213: ; preds = %203
br label %214
214: ; preds = %213
%215 = load i32, i32* %10
%216 = add nsw i32 %215, 1
store i32 %216, i32* %10
br label %176
217: ; preds = %176
store i32 0, i32* %10
br label %218
218: ; preds = %246, %217
%219 = load i32, i32* %10
%220 = icmp slt i32 %219, 512
br i1 %220, label %221, label %249
221: ; preds = %218
%222 = load i32, i32* %10
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %223
%225 = load i32*, i32** %224
%226 = call i64 @ENGINE_add(i32* %225)
%227 = icmp ne i64 %226, 0
br i1 %227, label %241, label %228
228: ; preds = %221
%229 = load i32, i32* %10
%230 = load i32, i32* %10
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %231
%233 = load i32*, i32** %232
%234 = call i8* @ENGINE_get_id(i32* %233)
%235 = load i32, i32* %10
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %236
%238 = load i32*, i32** %237
%239 = call i8* @ENGINE_get_name(i32* %238)
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0), i32 %229, i8* %234, i8* %239)
br label %250
241: ; preds = %221
%242 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i64 0, i64 0))
br label %243
243: ; preds = %241
%244 = load i32, i32* @stdout
%245 = call i32 @fflush(i32 %244)
br label %246
246: ; preds = %243
%247 = load i32, i32* %10
%248 = add nsw i32 %247, 1
store i32 %248, i32* %10
br label %218
249: ; preds = %218
br label %250
250: ; preds = %249, %228
%251 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0))
br label %252
252: ; preds = %261, %250
%253 = call i32* (...) @ENGINE_get_first()
store i32* %253, i32** %9
%254 = icmp ne i32* %253, null
br i1 %254, label %255, label %267
255: ; preds = %252
%256 = load i32*, i32** %9
%257 = call i64 @ENGINE_remove(i32* %256)
%258 = icmp ne i64 %257, 0
br i1 %258, label %261, label %259
259: ; preds = %255
%260 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0))
br label %289
261: ; preds = %255
%262 = load i32*, i32** %9
%263 = call i32 @ENGINE_free(i32* %262)
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i64 0, i64 0))
%265 = load i32, i32* @stdout
%266 = call i32 @fflush(i32 %265)
br label %252
267: ; preds = %252
store i32 0, i32* %10
br label %268
268: ; preds = %284, %267
%269 = load i32, i32* %10
%270 = icmp slt i32 %269, 512
br i1 %270, label %271, label %287
271: ; preds = %268
%272 = load i32, i32* %10
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %273
%275 = load i32*, i32** %274
%276 = call i8* @ENGINE_get_id(i32* %275)
%277 = call i32 @free(i8* %276)
%278 = load i32, i32* %10
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %279
%281 = load i32*, i32** %280
%282 = call i8* @ENGINE_get_name(i32* %281)
%283 = call i32 @free(i8* %282)
br label %284
284: ; preds = %271
%285 = load i32, i32* %10
%286 = add nsw i32 %285, 1
store i32 %286, i32* %10
br label %268
287: ; preds = %268
%288 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.27, i64 0, i64 0))
store i32 0, i32* %11
br label %289
289: ; preds = %287, %259, %211, %170, %141, %134, %125, %116, %109, %102, %95, %78, %70, %62
%290 = load i32, i32* %11
%291 = icmp ne i32 %290, 0
br i1 %291, label %292, label %295
292: ; preds = %289
%293 = load i32, i32* @stderr
%294 = call i32 @ERR_print_errors_fp(i32 %293)
br label %295
295: ; preds = %292, %289
%296 = load i32*, i32** %12
%297 = icmp ne i32* %296, null
br i1 %297, label %298, label %301
298: ; preds = %295
%299 = load i32*, i32** %12
%300 = call i32 @ENGINE_free(i32* %299)
br label %301
301: ; preds = %298, %295
%302 = load i32*, i32** %13
%303 = icmp ne i32* %302, null
br i1 %303, label %304, label %307
304: ; preds = %301
%305 = load i32*, i32** %13
%306 = call i32 @ENGINE_free(i32* %305)
br label %307
307: ; preds = %304, %301
%308 = load i32*, i32** %14
%309 = icmp ne i32* %308, null
br i1 %309, label %310, label %313
310: ; preds = %307
%311 = load i32*, i32** %14
%312 = call i32 @ENGINE_free(i32* %311)
br label %313
313: ; preds = %310, %307
%314 = load i32*, i32** %15
%315 = icmp ne i32* %314, null
br i1 %315, label %316, label %319
316: ; preds = %313
%317 = load i32*, i32** %15
%318 = call i32 @ENGINE_free(i32* %317)
br label %319
319: ; preds = %316, %313
store i32 0, i32* %10
br label %320
320: ; preds = %336, %319
%321 = load i32, i32* %10
%322 = icmp slt i32 %321, 512
br i1 %322, label %323, label %339
323: ; preds = %320
%324 = load i32, i32* %10
%325 = sext i32 %324 to i64
%326 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %325
%327 = load i32*, i32** %326
%328 = icmp ne i32* %327, null
br i1 %328, label %329, label %335
329: ; preds = %323
%330 = load i32, i32* %10
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %331
%333 = load i32*, i32** %332
%334 = call i32 @ENGINE_free(i32* %333)
br label %335
335: ; preds = %329, %323
br label %336
336: ; preds = %335
%337 = load i32, i32* %10
%338 = add nsw i32 %337, 1
store i32 %338, i32* %10
br label %320
339: ; preds = %320
%340 = call i32 (...) @ENGINE_cleanup()
%341 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%342 = call i32 (...) @ERR_free_strings()
%343 = call i32 @ERR_remove_thread_state(i32* null)
%344 = load i32, i32* @stderr
%345 = call i32 @CRYPTO_mem_leaks_fp(i32 %344)
%346 = load i32, i32* %11
ret i32 %346
}

LLVM IR (-O2):
@.str = [9 x i8] c"test_id0\00"
@.str.1 = [16 x i8] c"First test item\00"
@.str.2 = [9 x i8] c"test_id1\00"
@.str.3 = [17 x i8] c"Second test item\00"
@.str.4 = [9 x i8] c"test_id2\00"
@.str.5 = [16 x i8] c"Third test item\00"
@.str.6 = [9 x i8] c"test_id3\00"
@.str.7 = [17 x i8] c"Fourth test item\00"
@.str.20 = [5 x i8] c"id%i\00"
@.str.21 = [20 x i8] c"Fake engine type %i\00"
@.str.23 = [32 x i8] c"\0AAdding stopped at %i, (%s,%s)\0A\00"
@stdout = global i32 0
@stderr = global i32 0
@str = [39 x i8] c"Couldn't set up test ENGINE structures\00"
@str.28 = [23 x i8] c"\0Aenginetest beginning\0A\00"
@str.33 = [12 x i8] c"Add failed!\00"
@str.34 = [26 x i8] c"Add that should fail did.\00"
@str.35 = [29 x i8] c"Remove that should fail did.\00"
@str.37 = [15 x i8] c"Remove failed!\00"
@str.38 = [42 x i8] c"Couldn't add and remove to an empty list!\00"
@str.39 = [49 x i8] c"Successfully added and removed to an empty list!\00"
@str.40 = [38 x i8] c"About to beef up the engine-type list\00"
@str.41 = [37 x i8] c"\0AAbout to empty the engine-type list\00"
@str.42 = [25 x i8] c"\0ATests completed happily\00"
@str.43 = [16 x i8] c"\0ARemove failed!\00"
@str.44 = [84 x i8] c"Couldn't create block of ENGINE structures.\0AI'll probably also core-dump now, damn.\00"
@str.45 = [56 x i8] c"Remove failed!i - probably no hardware support present.\00"
@str.46 = [40 x i8] c"Remove *should* have failed but didn't!\00"
@str.47 = [37 x i8] c"Add *should* have failed but didn't!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [512 x i32*]
%4 = alloca i8*
%5 = alloca i8*
%6 = bitcast [512 x i32*]* %3 to i8*
%7 = bitcast i8** %4 to i8*
%8 = bitcast i8** %5 to i8*
%9 = tail call i32 (...) @ERR_load_crypto_strings()
%10 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 0
%11 = call i32 @memset(i32** %10, i32 0, i32 4096)
%12 = call i32* (...) @ENGINE_new()
%13 = icmp eq i32* %12, null
br i1 %13, label %189, label %14
14: ; preds = %2
%15 = call i32 @ENGINE_set_id(i32* %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %189, label %17
17: ; preds = %14
%18 = call i32 @ENGINE_set_name(i32* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %189, label %20
20: ; preds = %17
%21 = call i32* (...) @ENGINE_new()
%22 = icmp eq i32* %21, null
br i1 %22, label %189, label %23
23: ; preds = %20
%24 = call i32 @ENGINE_set_id(i32* %21, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %189, label %26
26: ; preds = %23
%27 = call i32 @ENGINE_set_name(i32* %21, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %189, label %29
29: ; preds = %26
%30 = call i32* (...) @ENGINE_new()
%31 = icmp eq i32* %30, null
br i1 %31, label %189, label %32
32: ; preds = %29
%33 = call i32 @ENGINE_set_id(i32* %30, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %189, label %35
35: ; preds = %32
%36 = call i32 @ENGINE_set_name(i32* %30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %189, label %38
38: ; preds = %35
%39 = call i32* (...) @ENGINE_new()
%40 = icmp eq i32* %39, null
br i1 %40, label %189, label %41
41: ; preds = %38
%42 = call i32 @ENGINE_set_id(i32* %39, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %189, label %44
44: ; preds = %41
%45 = call i32 @ENGINE_set_name(i32* %39, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %189, label %47
47: ; preds = %44
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.28, i64 0, i64 0))
%49 = call i32 (...) @display_engine_list()
%50 = call i64 @ENGINE_add(i32* %12)
%51 = icmp eq i64 %50, 0
br i1 %51, label %189, label %52
52: ; preds = %47
%53 = call i32 (...) @display_engine_list()
%54 = call i32* (...) @ENGINE_get_first()
%55 = call i64 @ENGINE_remove(i32* %54)
%56 = icmp eq i64 %55, 0
br i1 %56, label %189, label %57
57: ; preds = %52
%58 = icmp eq i32* %54, null
br i1 %58, label %61, label %59
59: ; preds = %57
%60 = call i32 @ENGINE_free(i32* %54)
br label %61
61: ; preds = %59, %57
%62 = call i32 (...) @display_engine_list()
%63 = call i64 @ENGINE_add(i32* %30)
%64 = icmp eq i64 %63, 0
br i1 %64, label %189, label %65
65: ; preds = %61
%66 = call i64 @ENGINE_add(i32* %21)
%67 = icmp eq i64 %66, 0
br i1 %67, label %189, label %68
68: ; preds = %65
%69 = call i32 (...) @display_engine_list()
%70 = call i64 @ENGINE_remove(i32* %21)
%71 = icmp eq i64 %70, 0
br i1 %71, label %189, label %72
72: ; preds = %68
%73 = call i32 (...) @display_engine_list()
%74 = call i64 @ENGINE_add(i32* %39)
%75 = icmp eq i64 %74, 0
br i1 %75, label %189, label %76
76: ; preds = %72
%77 = call i32 (...) @display_engine_list()
%78 = call i64 @ENGINE_add(i32* %30)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %189
80: ; preds = %76
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.34, i64 0, i64 0))
%82 = call i32 (...) @ERR_clear_error()
%83 = call i64 @ENGINE_remove(i32* %21)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %189
85: ; preds = %80
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.35, i64 0, i64 0))
%87 = call i32 (...) @ERR_clear_error()
%88 = call i64 @ENGINE_remove(i32* %30)
%89 = icmp eq i64 %88, 0
br i1 %89, label %189, label %90
90: ; preds = %85
%91 = call i32 (...) @display_engine_list()
%92 = call i64 @ENGINE_remove(i32* %39)
%93 = icmp eq i64 %92, 0
br i1 %93, label %189, label %94
94: ; preds = %90
%95 = call i32 (...) @display_engine_list()
%96 = call i32* (...) @ENGINE_get_first()
%97 = icmp eq i32* %96, null
br i1 %97, label %105, label %98
98: ; preds = %94
%99 = call i64 @ENGINE_remove(i32* %96)
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %98
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.45, i64 0, i64 0))
br label %103
103: ; preds = %101, %98
%104 = call i32 @ENGINE_free(i32* %96)
br label %105
105: ; preds = %94, %103
%106 = call i32 (...) @display_engine_list()
%107 = call i64 @ENGINE_add(i32* %12)
%108 = icmp eq i64 %107, 0
br i1 %108, label %189, label %109
109: ; preds = %105
%110 = call i64 @ENGINE_remove(i32* %12)
%111 = icmp eq i64 %110, 0
br i1 %111, label %189, label %112
112: ; preds = %109
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.39, i64 0, i64 0))
%114 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.40, i64 0, i64 0))
br label %118
115: ; preds = %135
%116 = add nuw nsw i64 %119, 1
%117 = icmp eq i64 %116, 512
br i1 %117, label %139, label %118
118: ; preds = %112, %115
%119 = phi i64 [ 0, %112 ], [ %116, %115 ]
%120 = trunc i64 %119 to i32
%121 = call i32 @asprintf(i8** %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i32 %120)
%122 = call i32 @asprintf(i8** %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i32 %120)
%123 = call i32* (...) @ENGINE_new()
%124 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %119
store i32* %123, i32** %124
%125 = icmp ne i32* %123, null
%126 = load i8*, i8** %4
%127 = icmp ne i8* %126, null
%128 = select i1 %125, i1 %127, i1 false
br i1 %128, label %129, label %189
129: ; preds = %118
%130 = call i32 @ENGINE_set_id(i32* %123, i8* %126)
%131 = icmp ne i32 %130, 0
%132 = load i8*, i8** %5
%133 = icmp ne i8* %132, null
%134 = select i1 %131, i1 %133, i1 false
br i1 %134, label %135, label %189
135: ; preds = %129
%136 = load i32*, i32** %124
%137 = call i32 @ENGINE_set_name(i32* %136, i8* %132)
%138 = icmp eq i32 %137, 0
br i1 %138, label %189, label %115
139: ; preds = %115, %154
%140 = phi i64 [ %158, %154 ], [ 0, %115 ]
%141 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %140
%142 = load i32*, i32** %141
%143 = call i64 @ENGINE_add(i32* %142)
%144 = icmp eq i64 %143, 0
br i1 %144, label %145, label %154
145: ; preds = %139
%146 = trunc i64 %140 to i32
%147 = and i64 %140, 4294967295
%148 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %147
%149 = load i32*, i32** %148
%150 = call i8* @ENGINE_get_id(i32* %149)
%151 = load i32*, i32** %148
%152 = call i8* @ENGINE_get_name(i32* %151)
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0), i32 %146, i8* %150, i8* %152)
br label %160
154: ; preds = %139
%155 = call i32 @putchar(i32 46)
%156 = load i32, i32* @stdout
%157 = call i32 @fflush(i32 %156)
%158 = add nuw nsw i64 %140, 1
%159 = icmp eq i64 %158, 512
br i1 %159, label %160, label %139
160: ; preds = %154, %145
%161 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.41, i64 0, i64 0))
%162 = call i32* (...) @ENGINE_get_first()
%163 = icmp eq i32* %162, null
br i1 %163, label %175, label %164
164: ; preds = %160, %168
%165 = phi i32* [ %173, %168 ], [ %162, %160 ]
%166 = call i64 @ENGINE_remove(i32* %165)
%167 = icmp eq i64 %166, 0
br i1 %167, label %189, label %168
168: ; preds = %164
%169 = call i32 @ENGINE_free(i32* %165)
%170 = call i32 @putchar(i32 46)
%171 = load i32, i32* @stdout
%172 = call i32 @fflush(i32 %171)
%173 = call i32* (...) @ENGINE_get_first()
%174 = icmp eq i32* %173, null
br i1 %174, label %175, label %164
175: ; preds = %168, %160
br label %176
176: ; preds = %175, %176
%177 = phi i64 [ %185, %176 ], [ 0, %175 ]
%178 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %177
%179 = load i32*, i32** %178
%180 = call i8* @ENGINE_get_id(i32* %179)
%181 = call i32 @free(i8* %180)
%182 = load i32*, i32** %178
%183 = call i8* @ENGINE_get_name(i32* %182)
%184 = call i32 @free(i8* %183)
%185 = add nuw nsw i64 %177, 1
%186 = icmp eq i64 %185, 512
br i1 %186, label %187, label %176
187: ; preds = %176
%188 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.42, i64 0, i64 0))
br label %197
189: ; preds = %118, %129, %135, %164, %105, %109, %90, %85, %80, %76, %72, %68, %61, %65, %52, %47, %2, %14, %17, %20, %23, %26, %29, %32, %35, %38, %41, %44
%190 = phi i8* [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %44 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %41 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %38 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %35 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %32 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %29 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %26 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %23 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %20 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %17 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %14 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.33, i64 0, i64 0), %47 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.37, i64 0, i64 0), %52 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.33, i64 0, i64 0), %65 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.33, i64 0, i64 0), %61 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.37, i64 0, i64 0), %68 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.33, i64 0, i64 0), %72 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @str.47, i64 0, i64 0), %76 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @str.46, i64 0, i64 0), %80 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.37, i64 0, i64 0), %85 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.37, i64 0, i64 0), %90 ], [ getelementptr inbounds ([42 x i8], [42 x i8]* @str.38, i64 0, i64 0), %109 ], [ getelementptr inbounds ([42 x i8], [42 x i8]* @str.38, i64 0, i64 0), %105 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @str.43, i64 0, i64 0), %164 ], [ getelementptr inbounds ([84 x i8], [84 x i8]* @str.44, i64 0, i64 0), %135 ], [ getelementptr inbounds ([84 x i8], [84 x i8]* @str.44, i64 0, i64 0), %129 ], [ getelementptr inbounds ([84 x i8], [84 x i8]* @str.44, i64 0, i64 0), %118 ]
%191 = phi i32* [ %21, %44 ], [ %21, %41 ], [ %21, %38 ], [ %21, %35 ], [ %21, %32 ], [ %21, %29 ], [ %21, %26 ], [ %21, %23 ], [ null, %20 ], [ null, %17 ], [ null, %14 ], [ null, %2 ], [ %21, %47 ], [ %21, %52 ], [ %21, %65 ], [ %21, %61 ], [ %21, %68 ], [ %21, %72 ], [ %21, %76 ], [ %21, %80 ], [ %21, %85 ], [ %21, %90 ], [ %21, %109 ], [ %21, %105 ], [ %21, %164 ], [ %21, %135 ], [ %21, %129 ], [ %21, %118 ]
%192 = phi i32* [ %30, %44 ], [ %30, %41 ], [ %30, %38 ], [ %30, %35 ], [ %30, %32 ], [ null, %29 ], [ null, %26 ], [ null, %23 ], [ null, %20 ], [ null, %17 ], [ null, %14 ], [ null, %2 ], [ %30, %47 ], [ %30, %52 ], [ %30, %65 ], [ %30, %61 ], [ %30, %68 ], [ %30, %72 ], [ %30, %76 ], [ %30, %80 ], [ %30, %85 ], [ %30, %90 ], [ %30, %109 ], [ %30, %105 ], [ %30, %164 ], [ %30, %135 ], [ %30, %129 ], [ %30, %118 ]
%193 = phi i32* [ %39, %44 ], [ %39, %41 ], [ null, %38 ], [ null, %35 ], [ null, %32 ], [ null, %29 ], [ null, %26 ], [ null, %23 ], [ null, %20 ], [ null, %17 ], [ null, %14 ], [ null, %2 ], [ %39, %47 ], [ %39, %52 ], [ %39, %65 ], [ %39, %61 ], [ %39, %68 ], [ %39, %72 ], [ %39, %76 ], [ %39, %80 ], [ %39, %85 ], [ %39, %90 ], [ %39, %109 ], [ %39, %105 ], [ %39, %164 ], [ %39, %135 ], [ %39, %129 ], [ %39, %118 ]
%194 = call i32 @puts(i8* dereferenceable(1) %190)
%195 = load i32, i32* @stderr
%196 = call i32 @ERR_print_errors_fp(i32 %195)
br label %197
197: ; preds = %187, %189
%198 = phi i32* [ %193, %189 ], [ %39, %187 ]
%199 = phi i32* [ %192, %189 ], [ %30, %187 ]
%200 = phi i32* [ %191, %189 ], [ %21, %187 ]
%201 = phi i32 [ 1, %189 ], [ 0, %187 ]
br i1 %13, label %204, label %202
202: ; preds = %197
%203 = call i32 @ENGINE_free(i32* %12)
br label %204
204: ; preds = %202, %197
%205 = icmp eq i32* %200, null
br i1 %205, label %208, label %206
206: ; preds = %204
%207 = call i32 @ENGINE_free(i32* %200)
br label %208
208: ; preds = %206, %204
%209 = icmp eq i32* %199, null
br i1 %209, label %212, label %210
210: ; preds = %208
%211 = call i32 @ENGINE_free(i32* %199)
br label %212
212: ; preds = %210, %208
%213 = icmp eq i32* %198, null
br i1 %213, label %216, label %214
214: ; preds = %212
%215 = call i32 @ENGINE_free(i32* %198)
br label %216
216: ; preds = %214, %212
br label %217
217: ; preds = %216, %224
%218 = phi i64 [ %225, %224 ], [ 0, %216 ]
%219 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %218
%220 = load i32*, i32** %219
%221 = icmp eq i32* %220, null
br i1 %221, label %224, label %222
222: ; preds = %217
%223 = call i32 @ENGINE_free(i32* %220)
br label %224
224: ; preds = %217, %222
%225 = add nuw nsw i64 %218, 1
%226 = icmp eq i64 %225, 512
br i1 %226, label %227, label %217
227: ; preds = %224
%228 = call i32 (...) @ENGINE_cleanup()
%229 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%230 = call i32 (...) @ERR_free_strings()
%231 = call i32 @ERR_remove_thread_state(i32* null)
%232 = load i32, i32* @stderr
%233 = call i32 @CRYPTO_mem_leaks_fp(i32 %232)
ret i32 %201
}