#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 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++) {
    if (asprintf(&id, "id%i", loop) == -1)
      goto end;
    if (asprintf(&name, "Fake engine type %i", loop) == -1)
      goto end;
    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");
      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]));
      break;
    }
    printf(".");
    fflush(stdout);
  }
  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    19e4 <main+0x774>
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    19e4 <main+0x774>
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    0xdeb(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19e4 <main+0x774>
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    19e4 <main+0x774>
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    0xd5b(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19e4 <main+0x774>
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    19e4 <main+0x774>
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    19e4 <main+0x774>
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    19e4 <main+0x774>
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    0xc7f(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19e4 <main+0x774>
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    0xc4f(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19e4 <main+0x774>
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    19e4 <main+0x774>
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    1824 <main+0x5b4>
mov    -0x102c(%rbp),%edx
lea    -0x1018(%rbp),%rdi
lea    0xabe(%rip),%rsi
call   1130 <asprintf@plt>
cmp    $0xffffffff,%eax
jne    174d <main+0x4dd>
jmp    19e4 <main+0x774>
mov    -0x102c(%rbp),%edx
lea    -0x1020(%rbp),%rdi
lea    0xa9c(%rip),%rsi
call   1130 <asprintf@plt>
cmp    $0xffffffff,%eax
jne    1774 <main+0x504>
jmp    19e4 <main+0x774>
mov    $0x0,%al
call   10d0 <ENGINE_new@plt>
movslq -0x102c(%rbp),%rcx
mov    %rax,-0x1010(%rbp,%rcx,8)
ff
cmp    $0x0,%rax
je     17f8 <main+0x588>
cmpq   $0x0,-0x1018(%rbp)
je     17f8 <main+0x588>
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     17f8 <main+0x588>
cmpq   $0x0,-0x1020(%rbp)
je     17f8 <main+0x588>
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    180b <main+0x59b>
lea    0xa12(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19e4 <main+0x774>
jmp    1810 <main+0x5a0>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    1716 <main+0x4a6>
movl   $0x0,-0x102c(%rbp)
cmpl   $0x200,-0x102c(%rbp)
jge    18ea <main+0x67a>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   10a0 <ENGINE_add@plt>
cmp    $0x0,%rax
jne    18ba <main+0x64a>
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    0x990(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    18ea <main+0x67a>
lea    0x99d(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    0x2709(%rip),%rax
mov    (%rax),%edi
call   1110 <fflush@plt>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    182e <main+0x5be>
lea    0x96f(%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     1966 <main+0x6f6>
mov    -0x1028(%rbp),%rdi
call   1150 <ENGINE_remove@plt>
cmp    $0x0,%rax
jne    1939 <main+0x6c9>
lea    0x959(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
jmp    19e4 <main+0x774>
mov    -0x1028(%rbp),%rdi
call   1040 <ENGINE_free@plt>
lea    0x912(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
mov    0x267e(%rip),%rax
mov    (%rax),%edi
call   1110 <fflush@plt>
jmp    18f8 <main+0x688>
movl   $0x0,-0x102c(%rbp)
cmpl   $0x200,-0x102c(%rbp)
jge    19cc <main+0x75c>
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    1970 <main+0x700>
lea    0x8c4(%rip),%rdi
mov    $0x0,%al
call   10b0 <printf@plt>
movl   $0x0,-0x1030(%rbp)
cmpl   $0x0,-0x1030(%rbp)
je     19ff <main+0x78f>
mov    0x25e8(%rip),%rax
mov    (%rax),%edi
call   1180 <ERR_print_errors_fp@plt>
cmpq   $0x0,-0x1038(%rbp)
je     1a19 <main+0x7a9>
mov    -0x1038(%rbp),%rdi
call   1040 <ENGINE_free@plt>
cmpq   $0x0,-0x1040(%rbp)
je     1a33 <main+0x7c3>
mov    -0x1040(%rbp),%rdi
call   1040 <ENGINE_free@plt>
cmpq   $0x0,-0x1048(%rbp)
je     1a4d <main+0x7dd>
mov    -0x1048(%rbp),%rdi
call   1040 <ENGINE_free@plt>
cmpq   $0x0,-0x1050(%rbp)
je     1a67 <main+0x7f7>
mov    -0x1050(%rbp),%rdi
call   1040 <ENGINE_free@plt>
movl   $0x0,-0x102c(%rbp)
cmpl   $0x200,-0x102c(%rbp)
jge    1ac4 <main+0x854>
movslq -0x102c(%rbp),%rax
cmpq   $0x0,-0x1010(%rbp,%rax,8)
je     1aab <main+0x83b>
movslq -0x102c(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%rdi
ff
call   1040 <ENGINE_free@plt>
jmp    1ab0 <main+0x840>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    1a71 <main+0x801>
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    0x24f7(%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     1735 <main+0x4a5>
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    0xde1(%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    0xcb8(%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     1735 <main+0x4a5>
xor    %eax,%eax
call   1120 <display_engine_list@plt>
mov    %r12,%rdi
call   1170 <ENGINE_remove@plt>
test   %rax,%rax
je     1735 <main+0x4a5>
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    0xc15(%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>
cmp    $0xffffffff,%eax
je     14ad <main+0x21d>
mov    %rsp,%rdi
lea    0x9e1(%rip),%rsi
mov    %ebp,%edx
call   1150 <asprintf@plt>
cmp    $0xffffffff,%eax
je     14ad <main+0x21d>
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     1741 <main+0x4b1>
mov    $0x2e,%edi
call   1050 <putchar@plt>
mov    0x28b9(%rip),%rax
mov    (%rax),%edi
call   1130 <fflush@plt>
add    $0x1,%rbp
cmp    $0x200,%rbp
jne    16ff <main+0x46f>
jmp    176e <main+0x4de>
lea    0xaa4(%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    0x920(%rip),%rdi
mov    %ebp,%esi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10d0 <printf@plt>
lea    0xa2c(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1180 <ENGINE_get_first@plt>
test   %rax,%rax
je     17d0 <main+0x540>
mov    %rax,%rbp
lea    0xa4f(%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    0x281e(%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    1790 <main+0x500>
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    17d2 <main+0x542>
lea    0x9bc(%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 = [45 x i8] c"Couldn't create block of ENGINE structures.\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 %293
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 %293
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 %293
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 %293
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 %293
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 %293
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 %293
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 %293
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 %293
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 %293
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 %293
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 = %220, %174
%177 = load i32, i32* %10
%178 = icmp slt i32 %177, 512
br i1 %178, label %179, label %223
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 = icmp eq i32 %181, -1
br i1 %182, label %183, label %184
183: ; preds = %179
br label %293
184: ; preds = %179
%185 = load i32, i32* %10
%186 = call i32 @asprintf(i8** %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i32 %185)
%187 = icmp eq i32 %186, -1
br i1 %187, label %188, label %189
188: ; preds = %184
br label %293
189: ; preds = %184
%190 = call i32* (...) @ENGINE_new()
%191 = load i32, i32* %10
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %192
store i32* %190, i32** %193
%194 = icmp eq i32* %190, null
br i1 %194, label %217, label %195
195: ; preds = %189
%196 = load i8*, i8** %7
%197 = icmp ne i8* %196, null
br i1 %197, label %198, label %217
198: ; preds = %195
%199 = load i32, i32* %10
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %200
%202 = load i32*, i32** %201
%203 = load i8*, i8** %7
%204 = call i32 @ENGINE_set_id(i32* %202, i8* %203)
%205 = icmp ne i32 %204, 0
br i1 %205, label %206, label %217
206: ; preds = %198
%207 = load i8*, i8** %8
%208 = icmp ne i8* %207, null
br i1 %208, label %209, label %217
209: ; preds = %206
%210 = load i32, i32* %10
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %211
%213 = load i32*, i32** %212
%214 = load i8*, i8** %8
%215 = call i32 @ENGINE_set_name(i32* %213, i8* %214)
%216 = icmp ne i32 %215, 0
br i1 %216, label %219, label %217
217: ; preds = %209, %206, %198, %195, %189
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.22, i64 0, i64 0))
br label %293
219: ; preds = %209
br label %220
220: ; preds = %219
%221 = load i32, i32* %10
%222 = add nsw i32 %221, 1
store i32 %222, i32* %10
br label %176
223: ; preds = %176
store i32 0, i32* %10
br label %224
224: ; preds = %251, %223
%225 = load i32, i32* %10
%226 = icmp slt i32 %225, 512
br i1 %226, label %227, label %254
227: ; preds = %224
%228 = load i32, i32* %10
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %229
%231 = load i32*, i32** %230
%232 = call i64 @ENGINE_add(i32* %231)
%233 = icmp ne i64 %232, 0
br i1 %233, label %247, label %234
234: ; preds = %227
%235 = load i32, i32* %10
%236 = load i32, i32* %10
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %237
%239 = load i32*, i32** %238
%240 = call i8* @ENGINE_get_id(i32* %239)
%241 = load i32, i32* %10
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %242
%244 = load i32*, i32** %243
%245 = call i8* @ENGINE_get_name(i32* %244)
%246 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0), i32 %235, i8* %240, i8* %245)
br label %254
247: ; preds = %227
%248 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i64 0, i64 0))
%249 = load i32, i32* @stdout
%250 = call i32 @fflush(i32 %249)
br label %251
251: ; preds = %247
%252 = load i32, i32* %10
%253 = add nsw i32 %252, 1
store i32 %253, i32* %10
br label %224
254: ; preds = %234, %224
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0))
br label %256
256: ; preds = %265, %254
%257 = call i32* (...) @ENGINE_get_first()
store i32* %257, i32** %9
%258 = icmp ne i32* %257, null
br i1 %258, label %259, label %271
259: ; preds = %256
%260 = load i32*, i32** %9
%261 = call i64 @ENGINE_remove(i32* %260)
%262 = icmp ne i64 %261, 0
br i1 %262, label %265, label %263
263: ; preds = %259
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0))
br label %293
265: ; preds = %259
%266 = load i32*, i32** %9
%267 = call i32 @ENGINE_free(i32* %266)
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i64 0, i64 0))
%269 = load i32, i32* @stdout
%270 = call i32 @fflush(i32 %269)
br label %256
271: ; preds = %256
store i32 0, i32* %10
br label %272
272: ; preds = %288, %271
%273 = load i32, i32* %10
%274 = icmp slt i32 %273, 512
br i1 %274, label %275, label %291
275: ; preds = %272
%276 = load i32, i32* %10
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %277
%279 = load i32*, i32** %278
%280 = call i8* @ENGINE_get_id(i32* %279)
%281 = call i32 @free(i8* %280)
%282 = load i32, i32* %10
%283 = sext i32 %282 to i64
%284 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %283
%285 = load i32*, i32** %284
%286 = call i8* @ENGINE_get_name(i32* %285)
%287 = call i32 @free(i8* %286)
br label %288
288: ; preds = %275
%289 = load i32, i32* %10
%290 = add nsw i32 %289, 1
store i32 %290, i32* %10
br label %272
291: ; preds = %272
%292 = 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 %293
293: ; preds = %291, %263, %217, %188, %183, %170, %141, %134, %125, %116, %109, %102, %95, %78, %70, %62
%294 = load i32, i32* %11
%295 = icmp ne i32 %294, 0
br i1 %295, label %296, label %299
296: ; preds = %293
%297 = load i32, i32* @stderr
%298 = call i32 @ERR_print_errors_fp(i32 %297)
br label %299
299: ; preds = %296, %293
%300 = load i32*, i32** %12
%301 = icmp ne i32* %300, null
br i1 %301, label %302, label %305
302: ; preds = %299
%303 = load i32*, i32** %12
%304 = call i32 @ENGINE_free(i32* %303)
br label %305
305: ; preds = %302, %299
%306 = load i32*, i32** %13
%307 = icmp ne i32* %306, null
br i1 %307, label %308, label %311
308: ; preds = %305
%309 = load i32*, i32** %13
%310 = call i32 @ENGINE_free(i32* %309)
br label %311
311: ; preds = %308, %305
%312 = load i32*, i32** %14
%313 = icmp ne i32* %312, null
br i1 %313, label %314, label %317
314: ; preds = %311
%315 = load i32*, i32** %14
%316 = call i32 @ENGINE_free(i32* %315)
br label %317
317: ; preds = %314, %311
%318 = load i32*, i32** %15
%319 = icmp ne i32* %318, null
br i1 %319, label %320, label %323
320: ; preds = %317
%321 = load i32*, i32** %15
%322 = call i32 @ENGINE_free(i32* %321)
br label %323
323: ; preds = %320, %317
store i32 0, i32* %10
br label %324
324: ; preds = %340, %323
%325 = load i32, i32* %10
%326 = icmp slt i32 %325, 512
br i1 %326, label %327, label %343
327: ; preds = %324
%328 = load i32, i32* %10
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %329
%331 = load i32*, i32** %330
%332 = icmp ne i32* %331, null
br i1 %332, label %333, label %339
333: ; preds = %327
%334 = load i32, i32* %10
%335 = sext i32 %334 to i64
%336 = getelementptr inbounds [512 x i32*], [512 x i32*]* %6, i64 0, i64 %335
%337 = load i32*, i32** %336
%338 = call i32 @ENGINE_free(i32* %337)
br label %339
339: ; preds = %333, %327
br label %340
340: ; preds = %339
%341 = load i32, i32* %10
%342 = add nsw i32 %341, 1
store i32 %342, i32* %10
br label %324
343: ; preds = %324
%344 = call i32 (...) @ENGINE_cleanup()
%345 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%346 = call i32 (...) @ERR_free_strings()
%347 = call i32 @ERR_remove_thread_state(i32* null)
%348 = load i32, i32* @stderr
%349 = call i32 @CRYPTO_mem_leaks_fp(i32 %348)
%350 = load i32, i32* %11
ret i32 %350
}

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 = [44 x i8] c"Couldn't create block of ENGINE structures.\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 %193, 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 %193, 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 %193, label %20
20: ; preds = %17
%21 = call i32* (...) @ENGINE_new()
%22 = icmp eq i32* %21, null
br i1 %22, label %193, 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 %193, 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 %193, label %29
29: ; preds = %26
%30 = call i32* (...) @ENGINE_new()
%31 = icmp eq i32* %30, null
br i1 %31, label %193, 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 %193, 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 %193, label %38
38: ; preds = %35
%39 = call i32* (...) @ENGINE_new()
%40 = icmp eq i32* %39, null
br i1 %40, label %193, 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 %193, 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 %193, 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 %193, 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 %193, 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 %193, label %65
65: ; preds = %61
%66 = call i64 @ENGINE_add(i32* %21)
%67 = icmp eq i64 %66, 0
br i1 %67, label %193, 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 %193, 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 %193, 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 %193
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 %193
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 %193, 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 %193, 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 %193, label %109
109: ; preds = %105
%110 = call i64 @ENGINE_remove(i32* %12)
%111 = icmp eq i64 %110, 0
br i1 %111, label %193, 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 = %139
%116 = add nuw nsw i64 %119, 1
%117 = icmp eq i64 %116, 512
br i1 %117, label %143, 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 = icmp eq i32 %121, -1
br i1 %122, label %199, label %123
123: ; preds = %118
%124 = call i32 @asprintf(i8** %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i32 %120)
%125 = icmp eq i32 %124, -1
br i1 %125, label %199, label %126
126: ; preds = %123
%127 = call i32* (...) @ENGINE_new()
%128 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %119
store i32* %127, i32** %128
%129 = icmp ne i32* %127, null
%130 = load i8*, i8** %4
%131 = icmp ne i8* %130, null
%132 = select i1 %129, i1 %131, i1 false
br i1 %132, label %133, label %193
133: ; preds = %126
%134 = call i32 @ENGINE_set_id(i32* %127, i8* %130)
%135 = icmp ne i32 %134, 0
%136 = load i8*, i8** %5
%137 = icmp ne i8* %136, null
%138 = select i1 %135, i1 %137, i1 false
br i1 %138, label %139, label %193
139: ; preds = %133
%140 = load i32*, i32** %128
%141 = call i32 @ENGINE_set_name(i32* %140, i8* %136)
%142 = icmp eq i32 %141, 0
br i1 %142, label %193, label %115
143: ; preds = %115, %158
%144 = phi i64 [ %162, %158 ], [ 0, %115 ]
%145 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %144
%146 = load i32*, i32** %145
%147 = call i64 @ENGINE_add(i32* %146)
%148 = icmp eq i64 %147, 0
br i1 %148, label %149, label %158
149: ; preds = %143
%150 = trunc i64 %144 to i32
%151 = and i64 %144, 4294967295
%152 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %151
%153 = load i32*, i32** %152
%154 = call i8* @ENGINE_get_id(i32* %153)
%155 = load i32*, i32** %152
%156 = call i8* @ENGINE_get_name(i32* %155)
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0), i32 %150, i8* %154, i8* %156)
br label %164
158: ; preds = %143
%159 = call i32 @putchar(i32 46)
%160 = load i32, i32* @stdout
%161 = call i32 @fflush(i32 %160)
%162 = add nuw nsw i64 %144, 1
%163 = icmp eq i64 %162, 512
br i1 %163, label %164, label %143
164: ; preds = %158, %149
%165 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.41, i64 0, i64 0))
%166 = call i32* (...) @ENGINE_get_first()
%167 = icmp eq i32* %166, null
br i1 %167, label %179, label %168
168: ; preds = %164, %172
%169 = phi i32* [ %177, %172 ], [ %166, %164 ]
%170 = call i64 @ENGINE_remove(i32* %169)
%171 = icmp eq i64 %170, 0
br i1 %171, label %193, label %172
172: ; preds = %168
%173 = call i32 @ENGINE_free(i32* %169)
%174 = call i32 @putchar(i32 46)
%175 = load i32, i32* @stdout
%176 = call i32 @fflush(i32 %175)
%177 = call i32* (...) @ENGINE_get_first()
%178 = icmp eq i32* %177, null
br i1 %178, label %179, label %168
179: ; preds = %172, %164
br label %180
180: ; preds = %179, %180
%181 = phi i64 [ %189, %180 ], [ 0, %179 ]
%182 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %181
%183 = load i32*, i32** %182
%184 = call i8* @ENGINE_get_id(i32* %183)
%185 = call i32 @free(i8* %184)
%186 = load i32*, i32** %182
%187 = call i8* @ENGINE_get_name(i32* %186)
%188 = call i32 @free(i8* %187)
%189 = add nuw nsw i64 %181, 1
%190 = icmp eq i64 %189, 512
br i1 %190, label %191, label %180
191: ; preds = %180
%192 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.42, i64 0, i64 0))
br label %205
193: ; preds = %126, %133, %139, %168, %105, %109, %90, %85, %80, %76, %72, %68, %61, %65, %52, %47, %2, %14, %17, %20, %23, %26, %29, %32, %35, %38, %41, %44
%194 = 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), %168 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @str.44, i64 0, i64 0), %139 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @str.44, i64 0, i64 0), %133 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @str.44, i64 0, i64 0), %126 ]
%195 = 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, %168 ], [ %21, %139 ], [ %21, %133 ], [ %21, %126 ]
%196 = 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, %168 ], [ %30, %139 ], [ %30, %133 ], [ %30, %126 ]
%197 = 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, %168 ], [ %39, %139 ], [ %39, %133 ], [ %39, %126 ]
%198 = call i32 @puts(i8* dereferenceable(1) %194)
br label %199
199: ; preds = %123, %118, %193
%200 = phi i32* [ %195, %193 ], [ %21, %118 ], [ %21, %123 ]
%201 = phi i32* [ %196, %193 ], [ %30, %118 ], [ %30, %123 ]
%202 = phi i32* [ %197, %193 ], [ %39, %118 ], [ %39, %123 ]
%203 = load i32, i32* @stderr
%204 = call i32 @ERR_print_errors_fp(i32 %203)
br label %205
205: ; preds = %191, %199
%206 = phi i32* [ %202, %199 ], [ %39, %191 ]
%207 = phi i32* [ %201, %199 ], [ %30, %191 ]
%208 = phi i32* [ %200, %199 ], [ %21, %191 ]
%209 = phi i32 [ 1, %199 ], [ 0, %191 ]
br i1 %13, label %212, label %210
210: ; preds = %205
%211 = call i32 @ENGINE_free(i32* %12)
br label %212
212: ; preds = %210, %205
%213 = icmp eq i32* %208, null
br i1 %213, label %216, label %214
214: ; preds = %212
%215 = call i32 @ENGINE_free(i32* %208)
br label %216
216: ; preds = %214, %212
%217 = icmp eq i32* %207, null
br i1 %217, label %220, label %218
218: ; preds = %216
%219 = call i32 @ENGINE_free(i32* %207)
br label %220
220: ; preds = %218, %216
%221 = icmp eq i32* %206, null
br i1 %221, label %224, label %222
222: ; preds = %220
%223 = call i32 @ENGINE_free(i32* %206)
br label %224
224: ; preds = %222, %220
br label %225
225: ; preds = %224, %232
%226 = phi i64 [ %233, %232 ], [ 0, %224 ]
%227 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 %226
%228 = load i32*, i32** %227
%229 = icmp eq i32* %228, null
br i1 %229, label %232, label %230
230: ; preds = %225
%231 = call i32 @ENGINE_free(i32* %228)
br label %232
232: ; preds = %225, %230
%233 = add nuw nsw i64 %226, 1
%234 = icmp eq i64 %233, 512
br i1 %234, label %235, label %225
235: ; preds = %232
%236 = call i32 (...) @ENGINE_cleanup()
%237 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%238 = call i32 (...) @ERR_free_strings()
%239 = call i32 @ERR_remove_thread_state(i32* null)
%240 = load i32, i32* @stderr
%241 = call i32 @CRYPTO_mem_leaks_fp(i32 %240)
ret i32 %209
}