#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 */

/* Variables and functions */
int /*<<< orphan*/ CONFIG_delete();
char *CONFIG_key_get(char const *);
char *CONFIG_make_filename(char *, char *);
int /*<<< orphan*/ CONFIG_new();
int /*<<< orphan*/ CONFIG_read_file(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
scalar_t__ system(char *);
int main(int argc, char **argv) {
  char config_name[200];
  char libdir_name[200];
  static char buffer[8000], link_buffer[4000];
  int i;
  int opt_noconsole = 0, opt_gtk = 0;
  int have_resource = 0;
  const char *link_option = "LINK_OPTION";
  const char *keystone_lib = "keystone";
  if (argc < 2) {
    printf("Keystone Application Framework Link tool\n");
    printf("Copyright (C) Jacob Lister, Abbey Systems 2003.  All rights "
           "reserved.\n\n");
    printf("usage: keylink <-oappname> <modules>\n");
    exit(1);
  }
  CONFIG_new();
  sprintf(config_name, CONFIG_make_filename(argv[0], "keytools.cfg"));
  if (!CONFIG_read_file(config_name)) {
    printf("cannot open config file '%s'\n", config_name);
    exit(1);
  };
  if (!CONFIG_key_get("KEYSTONE_DIR")) {
    printf("'%s' environment variable not set\n", "KEYSTONE_DIR");
    exit(1);
  }
  if (!CONFIG_key_get("KEYSTONE_TARGET")) {
    printf("'%s' environment variable not set\n", "KEYSTONE_TARGET");
    exit(1);
  }
  sprintf(libdir_name, "%s/lib/%s", CONFIG_key_get("KEYSTONE_DIR"),
          CONFIG_key_get("KEYSTONE_TARGET"));
  sprintf(config_name, "%s/bin/%s/%s", CONFIG_key_get("KEYSTONE_DIR"),
          CONFIG_key_get("KEYSTONE_TARGET"), "keytools.cfg");
  if (!CONFIG_read_file(config_name)) {
    printf("cannot open config file '%s'\n", config_name);
    exit(1);
  };
  if (!CONFIG_key_get("LINK")) {
    printf("LINK (Link tool) not set in config");
    exit(1);
  }
  if (!CONFIG_key_get("EXEOUT")) {
    printf("EXEOUT environment variable not set");
    exit(1);
  }
  if (!CONFIG_key_get("SUFFIX_OBJ")) {
    printf("SUFFIX_OBJ environment variable not set");
    exit(1);
  }
  if (!CONFIG_key_get("SUFFIX_LIB")) {
    printf("SUFFIX_LIB environment variable not set");
    exit(1);
  }
  sprintf(buffer, "%s ", CONFIG_key_get("LINK"));
  if (argv[1][0] != '-' || argv[1][1] != 'o') {
    printf("first argument no -o output file");
    exit(1);
  }
  sprintf(buffer + strlen(buffer), "%s%s ", CONFIG_key_get("EXEOUT"),
          &argv[1][2]);
  sprintf(buffer + strlen(buffer), "%s/frame_begin.%s ", libdir_name,
          CONFIG_key_get("SUFFIX_OBJ"));
  for (i = 2; i < argc; i++) {
    if (strlen(argv[i]) >= 4 &&
        (strcmp(&argv[i][strlen(argv[i]) - 4], ".res") == 0 ||
         strcmp(&argv[i][strlen(argv[i]) - 4], ".RES") == 0)) {
      have_resource = 1;
    }
    if (argv[i][0] == '-' && argv[i][1] == '-') {
      if (strcmp(argv[i], "--noconsole") == 0) {
        link_option = "LINK_OPTION_NOCONSOLE";
        opt_noconsole = 1;
      } else if (strcmp(argv[i], "--gtk") == 0) {
        keystone_lib = "keystone_gtk";
        opt_gtk = 1;
      }
    } else {
      sprintf(buffer + strlen(buffer), "%s ", argv[i]);
    }
  }
  if (strcmp(CONFIG_key_get("KEYSTONE_TARGET"), "win32") == 0 &&
      !have_resource) {
    sprintf(buffer + strlen(buffer), "%s/frame_end.%s %s/keystone.res %s/%s.%s",
            libdir_name, CONFIG_key_get("SUFFIX_OBJ"), libdir_name, libdir_name,
            keystone_lib, CONFIG_key_get("SUFFIX_LIB"));
  } else {
    sprintf(buffer + strlen(buffer), "%s/frame_end.%s %s/%s.%s", libdir_name,
            CONFIG_key_get("SUFFIX_OBJ"), libdir_name, keystone_lib,
            CONFIG_key_get("SUFFIX_LIB"));
  }
  if (opt_gtk) {
    if (CONFIG_key_get("LINK_PREFIX")) {
      sprintf(link_buffer, "printf \"%s \" >link.rsp",
              CONFIG_key_get("LINK_PREFIX"));
      system(link_buffer);
    }
    if (CONFIG_key_get("LINK_GTK_RSP")) {
      sprintf(link_buffer, "%s >gtk.rsp", CONFIG_key_get("LINK_GTK_RSP"));
      system(link_buffer);
    }
    if (CONFIG_key_get(link_option)) {
      sprintf(link_buffer, "printf \"%s \" >option.rsp",
              CONFIG_key_get(link_option));
      system(link_buffer);
    }
    sprintf(link_buffer, "copy link.rsp+option.rsp+gtk.rsp response.rsp");
    system(link_buffer);
    sprintf(buffer + strlen(buffer), " @response.rsp");
  } else {
    if (CONFIG_key_get("LINK_PREFIX")) {
      sprintf(buffer + strlen(buffer), " %s", CONFIG_key_get("LINK_PREFIX"));
    }
    if (CONFIG_key_get(link_option)) {
      sprintf(buffer + strlen(buffer), " %s", CONFIG_key_get(link_option));
    }
  }
  printf("exec: %s\n", buffer);
  if (system(buffer)) {
    printf("keylink: error running\n");
    exit(1);
  }
  if (opt_gtk) {
    remove("link.rsp");
    remove("option.rsp");
    remove("gtk.rsp");
    remove("response.rsp");
  }
  CONFIG_delete();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1b8(%rbp)
movl   $0x0,-0x1bc(%rbp)
movl   $0x0,-0x1c0(%rbp)
lea    0xe02(%rip),%rax
mov    %rax,-0x1c8(%rbp)
lea    0xe00(%rip),%rax
mov    %rax,-0x1d0(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1251 <main+0x91>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    $0x0,%al
call   1040 <CONFIG_new@plt>
lea    -0xe0(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe39(%rip),%rsi
call   10c0 <CONFIG_make_filename@plt>
mov    -0x1d8(%rbp),%rdi
mov    %rax,%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
call   1080 <CONFIG_read_file@plt>
cmp    $0x0,%eax
jne    12be <main+0xfe>
lea    -0xe0(%rbp),%rsi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xe13(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
jne    12f3 <main+0x133>
lea    0xe0a(%rip),%rdi
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xe0e(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
jne    1328 <main+0x168>
lea    0xdd5(%rip),%rdi
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x1f8(%rbp)
lea    0xd9b(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,-0x1f0(%rbp)
lea    0xdb8(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x1f8(%rbp),%rdi
mov    -0x1f0(%rbp),%rdx
mov    %rax,%rcx
lea    0xdab(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0xe0(%rbp),%rax
mov    %rax,-0x1e8(%rbp)
lea    0xd4f(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,-0x1e0(%rbp)
lea    0xd6c(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x1e8(%rbp),%rdi
mov    -0x1e0(%rbp),%rdx
mov    %rax,%rcx
lea    0xd69(%rip),%rsi
lea    0xced(%rip),%r8
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
call   1080 <CONFIG_read_file@plt>
cmp    $0x0,%eax
jne    13fb <main+0x23b>
lea    -0xe0(%rbp),%rsi
lea    0xcd0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xd2d(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
jne    1429 <main+0x269>
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xd27(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
jne    1457 <main+0x297>
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xd24(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
jne    1485 <main+0x2c5>
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xd29(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
jne    14b3 <main+0x2f3>
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xc75(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,%rdx
lea    0x2bc7(%rip),%rdi
lea    0xd4e(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1500 <main+0x340>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6f,%eax
je     1518 <main+0x358>
lea    0xce1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0x2b71(%rip),%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
lea    0x2b62(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x210(%rbp)
lea    0xc18(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x210(%rbp),%rdi
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
add    $0x2,%rcx
lea    0xca8(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    0x2b21(%rip),%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
lea    0x2b12(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x208(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x200(%rbp)
lea    0xbe5(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x208(%rbp),%rdi
mov    -0x200(%rbp),%rdx
mov    %rax,%rcx
lea    0xc55(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
movl   $0x2,-0x1b4(%rbp)
mov    -0x1b4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    17ad <main+0x5ed>
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
cmp    $0x4,%eax
jl     169f <main+0x4df>
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x218(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
mov    -0x218(%rbp),%rdi
sub    $0x4,%eax
cltq
add    %rax,%rdi
lea    0xbeb(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1695 <main+0x4d5>
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x220(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
mov    -0x220(%rbp),%rdi
sub    $0x4,%eax
cltq
add    %rax,%rdi
lea    0xba1(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    169f <main+0x4df>
movl   $0x1,-0x1c0(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    175f <main+0x59f>
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    175f <main+0x59f>
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb40(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1718 <main+0x558>
lea    0xb36(%rip),%rax
mov    %rax,-0x1c8(%rbp)
movl   $0x1,-0x1b8(%rbp)
jmp    175a <main+0x59a>
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb20(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1755 <main+0x595>
lea    0xb10(%rip),%rax
mov    %rax,-0x1d0(%rbp)
movl   $0x1,-0x1bc(%rbp)
jmp    175a <main+0x59a>
jmp    1794 <main+0x5d4>
lea    0x292a(%rip),%rdi
call   1050 <strlen@plt>
cltq
lea    0x291c(%rip),%rdi
add    %rax,%rdi
mov    -0x10(%rbp),%rax
movslq -0x1b4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xa91(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    1799 <main+0x5d9>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    15cb <main+0x40b>
lea    0x954(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,%rdi
lea    0xa9e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    189c <main+0x6dc>
cmpl   $0x0,-0x1c0(%rbp)
jne    189c <main+0x6dc>
lea    0x28aa(%rip),%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
lea    0x289b(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x250(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x248(%rbp)
lea    0x96e(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,-0x240(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x238(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x230(%rbp)
mov    -0x1d0(%rbp),%rax
mov    %rax,-0x228(%rbp)
lea    0x964(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x250(%rbp),%rdi
mov    -0x248(%rbp),%rdx
mov    -0x240(%rbp),%rcx
mov    -0x238(%rbp),%r8
mov    -0x230(%rbp),%r9
mov    -0x228(%rbp),%r10
lea    0x9e0(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    193a <main+0x77a>
lea    0x27ed(%rip),%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
lea    0x27de(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x278(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x270(%rbp)
lea    0x8b1(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,-0x268(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x260(%rbp)
mov    -0x1d0(%rbp),%rax
mov    %rax,-0x258(%rbp)
lea    0x8b5(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x278(%rbp),%rdi
mov    -0x270(%rbp),%rdx
mov    -0x268(%rbp),%rcx
mov    -0x260(%rbp),%r8
mov    -0x258(%rbp),%r9
lea    0x961(%rip),%rsi
mov    %rax,(%rsp)
mov    $0x0,%al
call   10d0 <sprintf@plt>
cmpl   $0x0,-0x1bc(%rbp)
je     1a65 <main+0x8a5>
lea    0x95b(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
je     198d <main+0x7cd>
lea    0x945(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,%rdx
lea    0x465d(%rip),%rdi
lea    0x93b(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    0x4648(%rip),%rdi
call   1060 <system@plt>
lea    0x938(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
je     19d3 <main+0x813>
lea    0x922(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,%rdx
lea    0x4617(%rip),%rdi
lea    0x919(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    0x4602(%rip),%rdi
call   1060 <system@plt>
mov    -0x1c8(%rbp),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
je     1a19 <main+0x859>
mov    -0x1c8(%rbp),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    %rax,%rdx
lea    0x45d1(%rip),%rdi
lea    0x8df(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    0x45bc(%rip),%rdi
call   1060 <system@plt>
lea    0x45b0(%rip),%rdi
lea    0x8d7(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    0x459b(%rip),%rdi
call   1060 <system@plt>
lea    0x264f(%rip),%rdi
call   1050 <strlen@plt>
cltq
lea    0x2641(%rip),%rdi
add    %rax,%rdi
lea    0x8d3(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    1b1e <main+0x95e>
lea    0x83d(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
je     1abf <main+0x8ff>
lea    0x260e(%rip),%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
lea    0x25ff(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x280(%rbp)
lea    0x807(%rip),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x280(%rbp),%rdi
mov    %rax,%rdx
lea    0x883(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x1c8(%rbp),%rdi
call   10b0 <CONFIG_key_get@plt>
cmp    $0x0,%rax
je     1b19 <main+0x959>
lea    0x25b4(%rip),%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
lea    0x25a5(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x288(%rbp)
mov    -0x1c8(%rbp),%rdi
call   10b0 <CONFIG_key_get@plt>
mov    -0x288(%rbp),%rdi
mov    %rax,%rdx
lea    0x829(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    1b1e <main+0x95e>
lea    0x81a(%rip),%rdi
lea    0x2564(%rip),%rsi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0x2556(%rip),%rdi
call   1060 <system@plt>
cmp    $0x0,%rax
je     1b61 <main+0x9a1>
lea    0x7f9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
cmpl   $0x0,-0x1bc(%rbp)
je     1b9e <main+0x9de>
lea    0x74e(%rip),%rdi
call   1030 <remove@plt>
lea    0x772(%rip),%rdi
call   1030 <remove@plt>
lea    0x750(%rip),%rdi
call   1030 <remove@plt>
lea    0x786(%rip),%rdi
call   1030 <remove@plt>
mov    $0x0,%al
call   10a0 <CONFIG_delete@plt>
xor    %eax,%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
cmp    $0x1,%edi
jle    181b <main+0x64b>
mov    %rsi,%rbx
mov    %edi,%r15d
xor    %eax,%eax
call   1050 <CONFIG_new@plt>
mov    (%rbx),%rdi
lea    0xe14(%rip),%rsi
call   10d0 <CONFIG_make_filename@plt>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %rbp,%rdi
call   1090 <CONFIG_read_file@plt>
test   %eax,%eax
je     1801 <main+0x631>
lea    0xe0e(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     183c <main+0x66c>
lea    0xe29(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     184c <main+0x67c>
lea    0xde4(%rip),%r14
mov    %r14,%rdi
call   10c0 <CONFIG_key_get@plt>
mov    %rax,%rbp
lea    0xe02(%rip),%r12
mov    %r12,%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0xe03(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %r14,%rdi
call   10c0 <CONFIG_key_get@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0xde1(%rip),%rsi
lea    0xd65(%rip),%r8
lea    0xf0(%rsp),%r14
mov    %r14,%rdi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %r14,%rdi
call   1090 <CONFIG_read_file@plt>
test   %eax,%eax
je     1801 <main+0x631>
lea    0xdb8(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     186b <main+0x69b>
lea    0xdcb(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     1874 <main+0x6a4>
lea    0xde1(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     187d <main+0x6ad>
lea    0xdff(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     1886 <main+0x6b6>
lea    0xd64(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0x2d61(%rip),%r13
lea    0xe40(%rip),%rsi
mov    %r13,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    0x8(%rbx),%rax
cmpb   $0x2d,(%rax)
jne    1812 <main+0x642>
cmpb   $0x6f,0x1(%rax)
jne    1812 <main+0x642>
mov    %r13,%rdi
call   1060 <strlen@plt>
movslq %eax,%rbp
add    %r13,%rbp
lea    0xd40(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
mov    0x8(%rbx),%rcx
add    $0x2,%rcx
lea    0xdde(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %r13,%rdi
call   1060 <strlen@plt>
movslq %eax,%rbp
add    %r13,%rbp
lea    0xd35(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0xdb6(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %rbp,%rdi
mov    %rax,%rcx
xor    %eax,%eax
call   10e0 <sprintf@plt>
cmp    $0x3,%r15d
jb     1529 <main+0x359>
mov    %r15d,%r12d
lea    0xc19(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xc19(%rip),%rax
mov    %rax,0x10(%rsp)
mov    $0x2,%r14d
lea    0xd81(%rip),%r15
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
jmp    1449 <main+0x279>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1060 <strlen@plt>
movslq %eax,%rdi
add    %r13,%rdi
mov    (%rbx,%r14,8),%rdx
mov    %r15,%rsi
xor    %eax,%eax
call   10e0 <sprintf@plt>
add    $0x1,%r14
cmp    %r14,%r12
je     1551 <main+0x381>
mov    (%rbx,%r14,8),%rdi
call   1060 <strlen@plt>
cmp    $0x4,%eax
jl     14b3 <main+0x2e3>
mov    %r13,%rbp
mov    (%rbx,%r14,8),%r13
mov    %r13,%rdi
call   1060 <strlen@plt>
cltq
lea    (%rax,%r13,1),%rdi
add    $0xfffffffffffffffc,%rdi
mov    %rbp,%r13
lea    0xd10(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     14ab <main+0x2db>
mov    (%rbx,%r14,8),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
cltq
lea    (%rax,%rbp,1),%rdi
add    $0xfffffffffffffffc,%rdi
lea    0xcee(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    14b3 <main+0x2e3>
movl   $0x1,0xc(%rsp)
mov    (%rbx,%r14,8),%rdi
cmpb   $0x2d,(%rdi)
jne    1420 <main+0x250>
cmpb   $0x2d,0x1(%rdi)
jne    1420 <main+0x250>
lea    0xcc3(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1518 <main+0x348>
mov    (%rbx,%r14,8),%rdi
lea    0xcd0(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
mov    0x8(%rsp),%eax
mov    $0x1,%ecx
cmove  %ecx,%eax
mov    %eax,0x8(%rsp)
mov    0x10(%rsp),%rax
lea    0xcb2(%rip),%rcx
cmove  %rcx,%rax
mov    %rax,0x10(%rsp)
jmp    143c <main+0x26c>
lea    0xc81(%rip),%rax
mov    %rax,0x18(%rsp)
jmp    143c <main+0x26c>
movl   $0x0,0x8(%rsp)
lea    0xad4(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xabc(%rip),%rax
mov    %rax,0x18(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xb18(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0xc65(%rip),%rsi
mov    %rax,%rdi
call   10a0 <strcmp@plt>
mov    %rax,%rbp
mov    %r13,%rdi
call   1060 <strlen@plt>
movslq %eax,%rbx
add    %r13,%rbx
lea    0xb66(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
mov    %rax,%r15
lea    0xb8a(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
mov    %rax,%r10
test   %rbp,%rbp
jne    15c9 <main+0x3f9>
cmpl   $0x0,0xc(%rsp)
jne    15c9 <main+0x3f9>
lea    0xc21(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rcx
mov    %rdx,%r8
mov    %rdx,%r9
xor    %eax,%eax
push   %r10
push   0x18(%rsp)
jmp    15eb <main+0x41b>
sub    $0x8,%rsp
lea    0xc24(%rip),%rsi
lea    0x28(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rcx
mov    %rdx,%r8
mov    0x18(%rsp),%r9
xor    %eax,%eax
push   %r10
call   10e0 <sprintf@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%r14d
mov    0x18(%rsp),%rbp
lea    0xc0c(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %r14d,%r14d
je     171e <main+0x54e>
test   %rax,%rax
je     1647 <main+0x477>
lea    0xbf2(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0x49b5(%rip),%rbx
lea    0xbeb(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
lea    0xbe6(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     1687 <main+0x4b7>
lea    0xbd5(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0x4975(%rip),%rbx
lea    0xbcf(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
mov    %rbp,%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     16bf <main+0x4ef>
mov    %rbp,%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0x493d(%rip),%rbx
lea    0xba3(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
movups 0xbbe(%rip),%xmm0
movups %xmm0,0x4931(%rip)
movups 0xba2(%rip),%xmm0
movaps %xmm0,0x4915(%rip)
movups 0xb84(%rip),%xmm0
movaps %xmm0,0x48f7(%rip)
lea    0x48f0(%rip),%rdi
call   1070 <system@plt>
mov    %r13,%rdi
call   1060 <strlen@plt>
cltq
movabs $0x6e6f707365724020,%rcx
70 6f 6e
mov    %rcx,(%rax,%r13,1)
movabs $0x7073722e65736e,%rcx
mov    %rcx,0x7(%rax,%r13,1)
jmp    1788 <main+0x5b8>
test   %rax,%rax
je     1751 <main+0x581>
mov    %r13,%rdi
call   1060 <strlen@plt>
movslq %eax,%rbx
add    %r13,%rbx
lea    0xad9(%rip),%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0xb5f(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %rbp,%rdi
call   10c0 <CONFIG_key_get@plt>
test   %rax,%rax
je     1788 <main+0x5b8>
mov    %r13,%rdi
call   1060 <strlen@plt>
movslq %eax,%rbx
add    %r13,%rbx
mov    %rbp,%rdi
call   10c0 <CONFIG_key_get@plt>
lea    0xb28(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
lea    0xb18(%rip),%rdi
lea    0x290a(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
test   %rax,%rax
jne    189e <main+0x6ce>
test   %r14d,%r14d
je     17e6 <main+0x616>
lea    0xa6e(%rip),%rdi
call   1030 <remove@plt>
lea    0xa92(%rip),%rdi
call   1030 <remove@plt>
lea    0xa70(%rip),%rdi
call   1030 <remove@plt>
lea    0xaa6(%rip),%rdi
call   1030 <remove@plt>
xor    %eax,%eax
call   10b0 <CONFIG_delete@plt>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x81a(%rip),%rdi
lea    0xf0(%rsp),%rsi
jmp    185a <main+0x68a>
lea    0x937(%rip),%rdi
jmp    188d <main+0x6bd>
lea    0xaa6(%rip),%rdi
call   1040 <puts@plt>
lea    0xac3(%rip),%rdi
call   1040 <puts@plt>
lea    0xafe(%rip),%rdi
jmp    18a5 <main+0x6d5>
lea    0x80a(%rip),%rdi
lea    0x7f6(%rip),%rsi
jmp    185a <main+0x68a>
lea    0x7fa(%rip),%rdi
lea    0x816(%rip),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0x82a(%rip),%rdi
jmp    188d <main+0x6bd>
lea    0x84b(%rip),%rdi
jmp    188d <main+0x6bd>
lea    0x871(%rip),%rdi
jmp    188d <main+0x6bd>
lea    0x89b(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xa0c(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@main.buffer = internal global [8000 x i8] zeroinitializer
@main.link_buffer = internal global [4000 x i8] zeroinitializer
@.str = [12 x i8] c"LINK_OPTION\00"
@.str.1 = [9 x i8] c"keystone\00"
@.str.2 = [42 x i8] c"Keystone Application Framework Link tool\0A\00"
@.str.3 = [72 x i8] c"Copyright (C) Jacob Lister, Abbey Systems 2003. All rights reserved.\0A\0A\00"
@.str.4 = [38 x i8] c"usage: keylink <-oappname> <modules>\0A\00"
@.str.5 = [13 x i8] c"keytools.cfg\00"
@.str.6 = [30 x i8] c"cannot open config file '%s'\0A\00"
@.str.7 = [13 x i8] c"KEYSTONE_DIR\00"
@.str.8 = [35 x i8] c"'%s' environment variable not set\0A\00"
@.str.9 = [16 x i8] c"KEYSTONE_TARGET\00"
@.str.10 = [10 x i8] c"%s/lib/%s\00"
@.str.11 = [13 x i8] c"%s/bin/%s/%s\00"
@.str.12 = [5 x i8] c"LINK\00"
@.str.13 = [35 x i8] c"LINK (Link tool) not set in config\00"
@.str.14 = [7 x i8] c"EXEOUT\00"
@.str.15 = [36 x i8] c"EXEOUT environment variable not set\00"
@.str.16 = [11 x i8] c"SUFFIX_OBJ\00"
@.str.17 = [40 x i8] c"SUFFIX_OBJ environment variable not set\00"
@.str.18 = [11 x i8] c"SUFFIX_LIB\00"
@.str.19 = [40 x i8] c"SUFFIX_LIB environment variable not set\00"
@.str.20 = [4 x i8] c"%s \00"
@.str.21 = [33 x i8] c"first argument no -o output file\00"
@.str.22 = [6 x i8] c"%s%s \00"
@.str.23 = [19 x i8] c"%s/frame_begin.%s \00"
@.str.24 = [5 x i8] c".res\00"
@.str.25 = [5 x i8] c".RES\00"
@.str.26 = [12 x i8] c"--noconsole\00"
@.str.27 = [22 x i8] c"LINK_OPTION_NOCONSOLE\00"
@.str.28 = [6 x i8] c"--gtk\00"
@.str.29 = [13 x i8] c"keystone_gtk\00"
@.str.30 = [6 x i8] c"win32\00"
@.str.31 = [41 x i8] c"%s/frame_end.%s %s/keystone.res %s/%s.%s\00"
@.str.32 = [25 x i8] c"%s/frame_end.%s %s/%s.%s\00"
@.str.33 = [12 x i8] c"LINK_PREFIX\00"
@.str.34 = [23 x i8] c"printf \22%s \22 >link.rsp\00"
@.str.35 = [13 x i8] c"LINK_GTK_RSP\00"
@.str.36 = [12 x i8] c"%s >gtk.rsp\00"
@.str.37 = [25 x i8] c"printf \22%s \22 >option.rsp\00"
@.str.38 = [46 x i8] c"copy link.rsp+option.rsp+gtk.rsp response.rsp\00"
@.str.39 = [15 x i8] c" @response.rsp\00"
@.str.40 = [4 x i8] c" %s\00"
@.str.41 = [10 x i8] c"exec: %s\0A\00"
@.str.42 = [24 x i8] c"keylink: error running\0A\00"
@.str.43 = [9 x i8] c"link.rsp\00"
@.str.44 = [11 x i8] c"option.rsp\00"
@.str.45 = [8 x i8] c"gtk.rsp\00"
@.str.46 = [13 x i8] c"response.rsp\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i8]
%7 = alloca [200 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %12
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %13
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 2
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = call i32 (...) @CONFIG_new()
%23 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i8* @CONFIG_make_filename(i8* %26, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 (i8*, i8*, ...) @sprintf(i8* %23, i8* %27)
%29 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%30 = call i32 @CONFIG_read_file(i8* %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %21
%33 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %21
%37 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%38 = icmp ne i8* %37, null
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %36
%43 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%44 = icmp ne i8* %43, null
br i1 %44, label %48, label %45
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %42
%49 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%50 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%51 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%52 = call i32 (i8*, i8*, ...) @sprintf(i8* %49, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* %50, i8* %51)
%53 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%54 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%55 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%56 = call i32 (i8*, i8*, ...) @sprintf(i8* %53, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %54, i8* %55, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%57 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%58 = call i32 @CONFIG_read_file(i8* %57)
%59 = icmp ne i32 %58, 0
br i1 %59, label %64, label %60
60: ; preds = %48
%61 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %61)
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %48
%65 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%66 = icmp ne i8* %65, null
br i1 %66, label %70, label %67
67: ; preds = %64
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0))
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %64
%71 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%72 = icmp ne i8* %71, null
br i1 %72, label %76, label %73
73: ; preds = %70
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
%75 = call i32 @exit(i32 1)
unreachable
76: ; preds = %70
%77 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%78 = icmp ne i8* %77, null
br i1 %78, label %82, label %79
79: ; preds = %76
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.17, i64 0, i64 0))
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %76
%83 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%84 = icmp ne i8* %83, null
br i1 %84, label %88, label %85
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.19, i64 0, i64 0))
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %82
%89 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%90 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* %89)
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 1
%93 = load i8*, i8** %92
%94 = getelementptr inbounds i8, i8* %93, i64 0
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = icmp ne i32 %96, 45
br i1 %97, label %106, label %98
98: ; preds = %88
%99 = load i8**, i8*** %5
%100 = getelementptr inbounds i8*, i8** %99, i64 1
%101 = load i8*, i8** %100
%102 = getelementptr inbounds i8, i8* %101, i64 1
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = icmp ne i32 %104, 111
br i1 %105, label %106, label %109
106: ; preds = %98, %88
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %98
%110 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %111
%113 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 1
%116 = load i8*, i8** %115
%117 = getelementptr inbounds i8, i8* %116, i64 2
%118 = call i32 (i8*, i8*, ...) @sprintf(i8* %112, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i8* %113, i8* %117)
%119 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %120
%122 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%123 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%124 = call i32 (i8*, i8*, ...) @sprintf(i8* %121, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.23, i64 0, i64 0), i8* %122, i8* %123)
store i32 2, i32* %8
br label %125
125: ; preds = %223, %109
%126 = load i32, i32* %8
%127 = load i32, i32* %4
%128 = icmp slt i32 %126, %127
br i1 %128, label %129, label %226
129: ; preds = %125
%130 = load i8**, i8*** %5
%131 = load i32, i32* %8
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8*, i8** %130, i64 %132
%134 = load i8*, i8** %133
%135 = call i32 @strlen(i8* %134)
%136 = icmp sge i32 %135, 4
br i1 %136, label %137, label %172
137: ; preds = %129
%138 = load i8**, i8*** %5
%139 = load i32, i32* %8
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8*, i8** %138, i64 %140
%142 = load i8*, i8** %141
%143 = load i8**, i8*** %5
%144 = load i32, i32* %8
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8*, i8** %143, i64 %145
%147 = load i8*, i8** %146
%148 = call i32 @strlen(i8* %147)
%149 = sub nsw i32 %148, 4
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8, i8* %142, i64 %150
%152 = call i64 @strcmp(i8* %151, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0))
%153 = icmp eq i64 %152, 0
br i1 %153, label %171, label %154
154: ; preds = %137
%155 = load i8**, i8*** %5
%156 = load i32, i32* %8
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i8*, i8** %155, i64 %157
%159 = load i8*, i8** %158
%160 = load i8**, i8*** %5
%161 = load i32, i32* %8
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8*, i8** %160, i64 %162
%164 = load i8*, i8** %163
%165 = call i32 @strlen(i8* %164)
%166 = sub nsw i32 %165, 4
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i8, i8* %159, i64 %167
%169 = call i64 @strcmp(i8* %168, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
%170 = icmp eq i64 %169, 0
br i1 %170, label %171, label %172
171: ; preds = %154, %137
store i32 1, i32* %11
br label %172
172: ; preds = %171, %154, %129
%173 = load i8**, i8*** %5
%174 = load i32, i32* %8
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8*, i8** %173, i64 %175
%177 = load i8*, i8** %176
%178 = getelementptr inbounds i8, i8* %177, i64 0
%179 = load i8, i8* %178
%180 = sext i8 %179 to i32
%181 = icmp eq i32 %180, 45
br i1 %181, label %182, label %212
182: ; preds = %172
%183 = load i8**, i8*** %5
%184 = load i32, i32* %8
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds i8*, i8** %183, i64 %185
%187 = load i8*, i8** %186
%188 = getelementptr inbounds i8, i8* %187, i64 1
%189 = load i8, i8* %188
%190 = sext i8 %189 to i32
%191 = icmp eq i32 %190, 45
br i1 %191, label %192, label %212
192: ; preds = %182
%193 = load i8**, i8*** %5
%194 = load i32, i32* %8
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds i8*, i8** %193, i64 %195
%197 = load i8*, i8** %196
%198 = call i64 @strcmp(i8* %197, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.26, i64 0, i64 0))
%199 = icmp eq i64 %198, 0
br i1 %199, label %200, label %201
200: ; preds = %192
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.27, i64 0, i64 0), i8** %12
store i32 1, i32* %9
br label %211
201: ; preds = %192
%202 = load i8**, i8*** %5
%203 = load i32, i32* %8
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8*, i8** %202, i64 %204
%206 = load i8*, i8** %205
%207 = call i64 @strcmp(i8* %206, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i64 0, i64 0))
%208 = icmp eq i64 %207, 0
br i1 %208, label %209, label %210
209: ; preds = %201
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.29, i64 0, i64 0), i8** %13
store i32 1, i32* %10
br label %210
210: ; preds = %209, %201
br label %211
211: ; preds = %210, %200
br label %222
212: ; preds = %182, %172
%213 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %214
%216 = load i8**, i8*** %5
%217 = load i32, i32* %8
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds i8*, i8** %216, i64 %218
%220 = load i8*, i8** %219
%221 = call i32 (i8*, i8*, ...) @sprintf(i8* %215, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* %220)
br label %222
222: ; preds = %212, %211
br label %223
223: ; preds = %222
%224 = load i32, i32* %8
%225 = add nsw i32 %224, 1
store i32 %225, i32* %8
br label %125
226: ; preds = %125
%227 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%228 = call i64 @strcmp(i8* %227, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0))
%229 = icmp eq i64 %228, 0
br i1 %229, label %230, label %244
230: ; preds = %226
%231 = load i32, i32* %11
%232 = icmp ne i32 %231, 0
br i1 %232, label %244, label %233
233: ; preds = %230
%234 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %235
%237 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%238 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%239 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%240 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%241 = load i8*, i8** %13
%242 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%243 = call i32 (i8*, i8*, ...) @sprintf(i8* %236, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.31, i64 0, i64 0), i8* %237, i8* %238, i8* %239, i8* %240, i8* %241, i8* %242)
br label %254
244: ; preds = %230, %226
%245 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %246
%248 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%249 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%250 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%251 = load i8*, i8** %13
%252 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%253 = call i32 (i8*, i8*, ...) @sprintf(i8* %247, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.32, i64 0, i64 0), i8* %248, i8* %249, i8* %250, i8* %251, i8* %252)
br label %254
254: ; preds = %244, %233
%255 = load i32, i32* %10
%256 = icmp ne i32 %255, 0
br i1 %256, label %257, label %287
257: ; preds = %254
%258 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.33, i64 0, i64 0))
%259 = icmp ne i8* %258, null
br i1 %259, label %260, label %264
260: ; preds = %257
%261 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.33, i64 0, i64 0))
%262 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.34, i64 0, i64 0), i8* %261)
%263 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
br label %264
264: ; preds = %260, %257
%265 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.35, i64 0, i64 0))
%266 = icmp ne i8* %265, null
br i1 %266, label %267, label %271
267: ; preds = %264
%268 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.35, i64 0, i64 0))
%269 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.36, i64 0, i64 0), i8* %268)
%270 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
br label %271
271: ; preds = %267, %264
%272 = load i8*, i8** %12
%273 = call i8* @CONFIG_key_get(i8* %272)
%274 = icmp ne i8* %273, null
br i1 %274, label %275, label %280
275: ; preds = %271
%276 = load i8*, i8** %12
%277 = call i8* @CONFIG_key_get(i8* %276)
%278 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.37, i64 0, i64 0), i8* %277)
%279 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
br label %280
280: ; preds = %275, %271
%281 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.38, i64 0, i64 0))
%282 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
%283 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %284
%286 = call i32 (i8*, i8*, ...) @sprintf(i8* %285, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.39, i64 0, i64 0))
br label %308
287: ; preds = %254
%288 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.33, i64 0, i64 0))
%289 = icmp ne i8* %288, null
br i1 %289, label %290, label %296
290: ; preds = %287
%291 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %292
%294 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.33, i64 0, i64 0))
%295 = call i32 (i8*, i8*, ...) @sprintf(i8* %293, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.40, i64 0, i64 0), i8* %294)
br label %296
296: ; preds = %290, %287
%297 = load i8*, i8** %12
%298 = call i8* @CONFIG_key_get(i8* %297)
%299 = icmp ne i8* %298, null
br i1 %299, label %300, label %307
300: ; preds = %296
%301 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds i8, i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i64 %302
%304 = load i8*, i8** %12
%305 = call i8* @CONFIG_key_get(i8* %304)
%306 = call i32 (i8*, i8*, ...) @sprintf(i8* %303, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.40, i64 0, i64 0), i8* %305)
br label %307
307: ; preds = %300, %296
br label %308
308: ; preds = %307, %280
%309 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.41, i64 0, i64 0), i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%310 = call i64 @system(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%311 = icmp ne i64 %310, 0
br i1 %311, label %312, label %315
312: ; preds = %308
%313 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.42, i64 0, i64 0))
%314 = call i32 @exit(i32 1)
unreachable
315: ; preds = %308
%316 = load i32, i32* %10
%317 = icmp ne i32 %316, 0
br i1 %317, label %318, label %323
318: ; preds = %315
%319 = call i32 @remove(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.43, i64 0, i64 0))
%320 = call i32 @remove(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.44, i64 0, i64 0))
%321 = call i32 @remove(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.45, i64 0, i64 0))
%322 = call i32 @remove(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.46, i64 0, i64 0))
br label %323
323: ; preds = %318, %315
%324 = call i32 (...) @CONFIG_delete()
ret i32 0
}

LLVM IR (-O2):
@main.buffer = internal global [8000 x i8] zeroinitializer
@main.link_buffer = internal global [4000 x i8] zeroinitializer
@.str = [12 x i8] c"LINK_OPTION\00"
@.str.1 = [9 x i8] c"keystone\00"
@.str.5 = [13 x i8] c"keytools.cfg\00"
@.str.6 = [30 x i8] c"cannot open config file '%s'\0A\00"
@.str.7 = [13 x i8] c"KEYSTONE_DIR\00"
@.str.8 = [35 x i8] c"'%s' environment variable not set\0A\00"
@.str.9 = [16 x i8] c"KEYSTONE_TARGET\00"
@.str.10 = [10 x i8] c"%s/lib/%s\00"
@.str.11 = [13 x i8] c"%s/bin/%s/%s\00"
@.str.12 = [5 x i8] c"LINK\00"
@.str.13 = [35 x i8] c"LINK (Link tool) not set in config\00"
@.str.14 = [7 x i8] c"EXEOUT\00"
@.str.15 = [36 x i8] c"EXEOUT environment variable not set\00"
@.str.16 = [11 x i8] c"SUFFIX_OBJ\00"
@.str.17 = [40 x i8] c"SUFFIX_OBJ environment variable not set\00"
@.str.18 = [11 x i8] c"SUFFIX_LIB\00"
@.str.19 = [40 x i8] c"SUFFIX_LIB environment variable not set\00"
@.str.20 = [4 x i8] c"%s \00"
@.str.21 = [33 x i8] c"first argument no -o output file\00"
@.str.22 = [6 x i8] c"%s%s \00"
@.str.23 = [19 x i8] c"%s/frame_begin.%s \00"
@.str.24 = [5 x i8] c".res\00"
@.str.25 = [5 x i8] c".RES\00"
@.str.26 = [12 x i8] c"--noconsole\00"
@.str.27 = [22 x i8] c"LINK_OPTION_NOCONSOLE\00"
@.str.28 = [6 x i8] c"--gtk\00"
@.str.29 = [13 x i8] c"keystone_gtk\00"
@.str.30 = [6 x i8] c"win32\00"
@.str.31 = [41 x i8] c"%s/frame_end.%s %s/keystone.res %s/%s.%s\00"
@.str.32 = [25 x i8] c"%s/frame_end.%s %s/%s.%s\00"
@.str.33 = [12 x i8] c"LINK_PREFIX\00"
@.str.34 = [23 x i8] c"printf \22%s \22 >link.rsp\00"
@.str.35 = [13 x i8] c"LINK_GTK_RSP\00"
@.str.36 = [12 x i8] c"%s >gtk.rsp\00"
@.str.37 = [25 x i8] c"printf \22%s \22 >option.rsp\00"
@.str.38 = [46 x i8] c"copy link.rsp+option.rsp+gtk.rsp response.rsp\00"
@.str.39 = [15 x i8] c" @response.rsp\00"
@.str.40 = [4 x i8] c" %s\00"
@.str.41 = [10 x i8] c"exec: %s\0A\00"
@.str.43 = [9 x i8] c"link.rsp\00"
@.str.44 = [11 x i8] c"option.rsp\00"
@.str.45 = [8 x i8] c"gtk.rsp\00"
@.str.46 = [13 x i8] c"response.rsp\00"
@str = [23 x i8] c"keylink: error running\00"
@str.47 = [41 x i8] c"Keystone Application Framework Link tool\00"
@str.48 = [71 x i8] c"Copyright (C) Jacob Lister, Abbey Systems 2003. All rights reserved.\0A\00"
@str.49 = [37 x i8] c"usage: keylink <-oappname> <modules>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [200 x i8]
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.47, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.48, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.49, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = tail call i32 (...) @CONFIG_new()
%15 = load i8*, i8** %1
%16 = tail call i8* @CONFIG_make_filename(i8* %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) %16)
%18 = call i32 @CONFIG_read_file(i8* %5)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %13
%24 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %23
%30 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp eq i8* %30, null
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %29
%36 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%37 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%38 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* %36, i8* %37)
%39 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%40 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%41 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %39, i8* %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%42 = call i32 @CONFIG_read_file(i8* %5)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %35
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %35
%48 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0))
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %47
%54 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %53
%60 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%61 = icmp eq i8* %60, null
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.17, i64 0, i64 0))
%64 = call i32 @exit(i32 1)
unreachable
65: ; preds = %59
%66 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%67 = icmp eq i8* %66, null
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.19, i64 0, i64 0))
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %65
%72 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%73 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* %72)
%74 = getelementptr inbounds i8*, i8** %1, i64 1
%75 = load i8*, i8** %74
%76 = load i8, i8* %75
%77 = icmp eq i8 %76, 45
br i1 %77, label %78, label %82
78: ; preds = %71
%79 = getelementptr inbounds i8, i8* %75, i64 1
%80 = load i8, i8* %79
%81 = icmp eq i8 %80, 111
br i1 %81, label %85, label %82
82: ; preds = %78, %71
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %78
%86 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 %87
%89 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%90 = load i8*, i8** %74
%91 = getelementptr inbounds i8, i8* %90, i64 2
%92 = call i32 (i8*, i8*, ...) @sprintf(i8* %88, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i8* %89, i8* %91)
%93 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 %94
%96 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%97 = call i32 (i8*, i8*, ...) @sprintf(i8* %95, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.23, i64 0, i64 0), i8* %6, i8* %96)
%98 = icmp ugt i32 %0, 2
br i1 %98, label %99, label %158
99: ; preds = %85
%100 = zext i32 %0 to i64
br label %101
101: ; preds = %99, %152
%102 = phi i64 [ 2, %99 ], [ %156, %152 ]
%103 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %99 ], [ %155, %152 ]
%104 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %99 ], [ %154, %152 ]
%105 = phi i32 [ 0, %99 ], [ %129, %152 ]
%106 = phi i32 [ 0, %99 ], [ %153, %152 ]
%107 = getelementptr inbounds i8*, i8** %1, i64 %102
%108 = load i8*, i8** %107
%109 = call i32 @strlen(i8* %108)
%110 = icmp sgt i32 %109, 3
br i1 %110, label %111, label %128
111: ; preds = %101
%112 = load i8*, i8** %107
%113 = call i32 @strlen(i8* %112)
%114 = add nsw i32 %113, -4
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %112, i64 %115
%117 = call i64 @strcmp(i8* %116, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0))
%118 = icmp eq i64 %117, 0
br i1 %118, label %127, label %119
119: ; preds = %111
%120 = load i8*, i8** %107
%121 = call i32 @strlen(i8* %120)
%122 = add nsw i32 %121, -4
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %120, i64 %123
%125 = call i64 @strcmp(i8* %124, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
%126 = icmp eq i64 %125, 0
br i1 %126, label %127, label %128
127: ; preds = %119, %111
br label %128
128: ; preds = %127, %119, %101
%129 = phi i32 [ 1, %127 ], [ %105, %119 ], [ %105, %101 ]
%130 = load i8*, i8** %107
%131 = load i8, i8* %130
%132 = icmp eq i8 %131, 45
br i1 %132, label %133, label %146
133: ; preds = %128
%134 = getelementptr inbounds i8, i8* %130, i64 1
%135 = load i8, i8* %134
%136 = icmp eq i8 %135, 45
br i1 %136, label %137, label %146
137: ; preds = %133
%138 = call i64 @strcmp(i8* %130, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.26, i64 0, i64 0))
%139 = icmp eq i64 %138, 0
br i1 %139, label %152, label %140
140: ; preds = %137
%141 = load i8*, i8** %107
%142 = call i64 @strcmp(i8* %141, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i64 0, i64 0))
%143 = icmp eq i64 %142, 0
%144 = select i1 %143, i32 1, i32 %106
%145 = select i1 %143, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.29, i64 0, i64 0), i8* %103
br label %152
146: ; preds = %133, %128
%147 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 %148
%150 = load i8*, i8** %107
%151 = call i32 (i8*, i8*, ...) @sprintf(i8* %149, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* %150)
br label %152
152: ; preds = %140, %137, %146
%153 = phi i32 [ %106, %146 ], [ %106, %137 ], [ %144, %140 ]
%154 = phi i8* [ %104, %146 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.27, i64 0, i64 0), %137 ], [ %104, %140 ]
%155 = phi i8* [ %103, %146 ], [ %103, %137 ], [ %145, %140 ]
%156 = add nuw nsw i64 %102, 1
%157 = icmp eq i64 %156, %100
br i1 %157, label %158, label %101
158: ; preds = %152, %85
%159 = phi i32 [ 0, %85 ], [ %153, %152 ]
%160 = phi i32 [ 0, %85 ], [ %129, %152 ]
%161 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %85 ], [ %154, %152 ]
%162 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %85 ], [ %155, %152 ]
%163 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%164 = call i64 @strcmp(i8* %163, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0))
%165 = icmp ne i64 %164, 0
%166 = icmp ne i32 %160, 0
%167 = select i1 %165, i1 true, i1 %166
%168 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 %169
%171 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%172 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
br i1 %167, label %175, label %173
173: ; preds = %158
%174 = call i32 (i8*, i8*, ...) @sprintf(i8* %170, i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.31, i64 0, i64 0), i8* %6, i8* %171, i8* %6, i8* %6, i8* %162, i8* %172)
br label %177
175: ; preds = %158
%176 = call i32 (i8*, i8*, ...) @sprintf(i8* %170, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.32, i64 0, i64 0), i8* %6, i8* %171, i8* %6, i8* %162, i8* %172)
br label %177
177: ; preds = %175, %173
%178 = icmp eq i32 %159, 0
%179 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.33, i64 0, i64 0))
%180 = icmp eq i8* %179, null
br i1 %178, label %205, label %181
181: ; preds = %177
br i1 %180, label %186, label %182
182: ; preds = %181
%183 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.33, i64 0, i64 0))
%184 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.34, i64 0, i64 0), i8* %183)
%185 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
br label %186
186: ; preds = %182, %181
%187 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.35, i64 0, i64 0))
%188 = icmp eq i8* %187, null
br i1 %188, label %193, label %189
189: ; preds = %186
%190 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.35, i64 0, i64 0))
%191 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.36, i64 0, i64 0), i8* %190)
%192 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
br label %193
193: ; preds = %189, %186
%194 = call i8* @CONFIG_key_get(i8* %161)
%195 = icmp eq i8* %194, null
br i1 %195, label %200, label %196
196: ; preds = %193
%197 = call i8* @CONFIG_key_get(i8* %161)
%198 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.37, i64 0, i64 0), i8* %197)
%199 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
br label %200
200: ; preds = %196, %193
%201 = call i64 @system(i8* getelementptr inbounds ([4000 x i8], [4000 x i8]* @main.link_buffer, i64 0, i64 0))
%202 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds [8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 %203
br label %221
205: ; preds = %177
br i1 %180, label %212, label %206
206: ; preds = %205
%207 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 %208
%210 = call i8* @CONFIG_key_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.33, i64 0, i64 0))
%211 = call i32 (i8*, i8*, ...) @sprintf(i8* %209, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.40, i64 0, i64 0), i8* %210)
br label %212
212: ; preds = %206, %205
%213 = call i8* @CONFIG_key_get(i8* %161)
%214 = icmp eq i8* %213, null
br i1 %214, label %221, label %215
215: ; preds = %212
%216 = call i32 @strlen(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 %217
%219 = call i8* @CONFIG_key_get(i8* %161)
%220 = call i32 (i8*, i8*, ...) @sprintf(i8* %218, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.40, i64 0, i64 0), i8* %219)
br label %221
221: ; preds = %212, %215, %200
%222 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.41, i64 0, i64 0), i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%223 = call i64 @system(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @main.buffer, i64 0, i64 0))
%224 = icmp eq i64 %223, 0
br i1 %224, label %228, label %225
225: ; preds = %221
%226 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%227 = call i32 @exit(i32 1)
unreachable
228: ; preds = %221
br i1 %178, label %234, label %229
229: ; preds = %228
%230 = call i32 @remove(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.43, i64 0, i64 0))
%231 = call i32 @remove(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.44, i64 0, i64 0))
%232 = call i32 @remove(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.45, i64 0, i64 0))
%233 = call i32 @remove(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.46, i64 0, i64 0))
br label %234
234: ; preds = %229, %228
%235 = call i32 (...) @CONFIG_delete()
ret i32 0
}