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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int rv = 0, i;
  FILE *fph, *fpc, *fpa;
  char *opt;
  fph = fpc = fpa = NULL;
  if (argc < 2) {
    fprintf(stdout, "Not enough arguments.\n");
    fprintf(stdout, "Usage: %s opt ...\n", argv[0]);
    fprintf(stdout,
            "opt can be drivers, mkauths, version, setproto or sslinit\n");
    exit(1);
  }
  opt = argv[1];
  if (!strcmp(opt, "drivers")) {
    fph = fopen("linkage.h", "w");
    fpc = fopen("linkage.c", "w");
    for (i = 2; i < argc; i++) {
      fprintf(fph, "extern DRIVER %sdriver;\n", argv[i]);
      fprintf(fpc, "  mail_link (&%sdriver);   /* link in the %s driver */\n",
              argv[i], argv[i]);
    }
  } else if (!strcmp(opt, "mkauths")) {
    fph = fopen("linkage.h", "a");
    fpc = fopen("linkage.c", "a");
    fpa = fopen("auths.c", "w");
    for (i = 2; i < argc; i++) {
      fprintf(fph, "extern AUTHENTICATOR auth_%s;\n", argv[i]);
      fprintf(fpc,
              "  auth_link (&auth_%s);   /* link in the %s authenticator */\n",
              argv[i], argv[i]);
      fprintf(fpa, "#include \"auth_%s.c\"\n", argv[i]);
    }
  } else if (!strcmp(opt, "setproto")) {
    if (argc != 4) {
      fprintf(stdout, "setproto requires two additional arguments\n");
      exit(1);
    }
    fph = fopen("linkage.h", "a");
    fprintf(fph, "#define CREATEPROTO %sproto\n", argv[2]);
    fprintf(fph, "#define APPENDPROTO %sproto\n", argv[3]);
  } else if (!strcmp(opt, "sslinit")) {
    fpc = fopen("linkage.c", "a");
    fprintf(fpc, "%s\n", "ssl_onceonlyinit();");
  } else if (!strcmp(opt, "version")) {
    fpc = fopen("linkage.c", "a");
    fprintf(fpc, "%s\n", "mail_versioncheck(CCLIENTVERSION);");
  } else {
    fprintf(stdout, "Try: \"drivers\", \"mkauths\", \"setproto\", \"sslinit\", "
                    "or \"version\".\n");
    exit(1);
  }
  if (fpa != NULL)
    fclose(fpa);
  if (fpc != NULL)
    fclose(fpc);
  if (fph != NULL)
    fclose(fph);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11e5 <main+0x95>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
lea    0xe61(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12aa <main+0x15a>
lea    0xe5c(%rip),%rdi
lea    0xe5f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xe51(%rip),%rdi
lea    0xe48(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12a5 <main+0x155>
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xe0c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    123f <main+0xef>
jmp    1507 <main+0x3b7>
mov    -0x38(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    139a <main+0x24a>
lea    0xda3(%rip),%rdi
lea    0xe0b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xd98(%rip),%rdi
lea    0xdf4(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
lea    0xde6(%rip),%rdi
lea    0xd78(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1395 <main+0x245>
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xdb2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xda5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    130f <main+0x1bf>
jmp    1502 <main+0x3b2>
mov    -0x38(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1432 <main+0x2e2>
cmpl   $0x4,-0x8(%rbp)
je     13de <main+0x28e>
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    0xc88(%rip),%rdi
lea    0xcf0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd84(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    14fd <main+0x3ad>
mov    -0x38(%rbp),%rdi
lea    0xd8b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1482 <main+0x332>
lea    0xc27(%rip),%rdi
lea    0xc83(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,%edi
lea    0xd61(%rip),%rsi
lea    0xd5e(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    14f8 <main+0x3a8>
mov    -0x38(%rbp),%rdi
lea    0xd5b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    14d2 <main+0x382>
lea    0xbd7(%rip),%rdi
lea    0xc33(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,%edi
lea    0xd11(%rip),%rsi
lea    0xd2a(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    14f3 <main+0x3a3>
mov    0x2b07(%rip),%rax
mov    (%rax),%edi
lea    0xd31(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    14f8 <main+0x3a8>
jmp    14fd <main+0x3ad>
jmp    1502 <main+0x3b2>
jmp    1507 <main+0x3b7>
cmpq   $0x0,-0x30(%rbp)
je     151b <main+0x3cb>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x28(%rbp)
je     152f <main+0x3df>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x20(%rbp)
je     1543 <main+0x3f3>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     11aa <main+0x5a>
mov    0x2e76(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe8c(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xe8f(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe91(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    %edi,%r12d
mov    0x8(%rbx),%rbp
lea    0xead(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1266 <main+0x116>
lea    0xe9e(%rip),%rdi
lea    0xea1(%rip),%rbp
mov    %rbp,%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xe91(%rip),%rdi
mov    %rbp,%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
cmp    $0x3,%r12d
jb     1327 <main+0x1d7>
mov    %r12d,%ebp
mov    %r15,%r12
mov    %r14,%r15
mov    $0x2,%r14d
lea    0xe89(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%r14,8),%rdx
mov    %r15d,%edi
lea    0xe55(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx,%r14,8),%rcx
mov    %r12d,%edi
mov    %r13,%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1220 <main+0xd0>
mov    %r15,%r14
mov    %r12,%r15
test   %r15,%r15
je     1330 <main+0x1e0>
jmp    1442 <main+0x2f2>
lea    0xe67(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1340 <main+0x1f0>
lea    0xde9(%rip),%rdi
lea    0xe51(%rip),%rbp
mov    %rbp,%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xddc(%rip),%rdi
mov    %rbp,%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xe2f(%rip),%rdi
lea    0xdc1(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbp
cmp    $0x3,%r12d
jb     131a <main+0x1ca>
mov    %r12d,%r13d
mov    $0x2,%r12d
nopl   (%rax)
mov    (%rbx,%r12,8),%rdx
mov    %r14d,%edi
lea    0xe08(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx,%r12,8),%rcx
mov    %r15d,%edi
lea    0xe12(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx,%r12,8),%rdx
mov    %ebp,%edi
lea    0xe39(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%r12
cmp    %r12,%r13
jne    12d0 <main+0x180>
test   %rbp,%rbp
je     1327 <main+0x1d7>
mov    %rbp,%rdi
call   1030 <fclose@plt>
test   %r15,%r15
jne    1442 <main+0x2f2>
test   %r14,%r14
jne    1453 <main+0x303>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe12(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    13a7 <main+0x257>
cmp    $0x4,%r12d
jne    13e0 <main+0x290>
lea    0xd09(%rip),%rdi
lea    0xd71(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdx
lea    0xe10(%rip),%rsi
mov    %r14d,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x18(%rbx),%rdx
lea    0xe18(%rip),%rsi
mov    %r14d,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %r14,%r14
je     1339 <main+0x1e9>
jmp    1453 <main+0x303>
lea    0xe1a(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    13f5 <main+0x2a5>
lea    0xcb8(%rip),%rdi
lea    0xd14(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xdf9(%rip),%rsi
lea    0xdf6(%rip),%rdx
jmp    142c <main+0x2dc>
mov    0x2bf9(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%rip),%rsi
jmp    1199 <main+0x49>
lea    0xdec(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1462 <main+0x312>
lea    0xc6a(%rip),%rdi
lea    0xcc6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xdab(%rip),%rsi
lea    0xdc4(%rip),%rdx
xor    %r14d,%r14d
mov    %r15d,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %r15,%r15
je     1330 <main+0x1e0>
mov    %r15,%rdi
call   1030 <fclose@plt>
test   %r14,%r14
je     1339 <main+0x1e9>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%edi
lea    0xda1(%rip),%rsi
jmp    1199 <main+0x49>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [23 x i8] c"Not enough arguments.\0A\00"
@.str.1 = [19 x i8] c"Usage: %s opt ...\0A\00"
@.str.2 = [59 x i8] c"opt can be drivers, mkauths, version, setproto or sslinit\0A\00"
@.str.3 = [8 x i8] c"drivers\00"
@.str.4 = [10 x i8] c"linkage.h\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [10 x i8] c"linkage.c\00"
@.str.7 = [25 x i8] c"extern DRIVER %sdriver;\0A\00"
@.str.8 = [56 x i8] c" mail_link (&%sdriver); /* link in the %s driver */\0A\00"
@.str.9 = [8 x i8] c"mkauths\00"
@.str.10 = [2 x i8] c"a\00"
@.str.11 = [8 x i8] c"auths.c\00"
@.str.12 = [31 x i8] c"extern AUTHENTICATOR auth_%s;\0A\00"
@.str.13 = [62 x i8] c" auth_link (&auth_%s); /* link in the %s authenticator */\0A\00"
@.str.14 = [22 x i8] c"#include \22auth_%s.c\22\0A\00"
@.str.15 = [9 x i8] c"setproto\00"
@.str.16 = [44 x i8] c"setproto requires two additional arguments\0A\00"
@.str.17 = [29 x i8] c"#define CREATEPROTO %sproto\0A\00"
@.str.18 = [29 x i8] c"#define APPENDPROTO %sproto\0A\00"
@.str.19 = [8 x i8] c"sslinit\00"
@.str.20 = [4 x i8] c"%s\0A\00"
@.str.21 = [20 x i8] c"ssl_onceonlyinit();\00"
@.str.22 = [8 x i8] c"version\00"
@.str.23 = [35 x i8] c"mail_versioncheck(CCLIENTVERSION);\00"
@.str.24 = [65 x i8] c"Try: \22drivers\22, \22mkauths\22, \22setproto\22, \22sslinit\22, or \22version\22.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32* null, i32** %10
store i32* null, i32** %9
store i32* null, i32** %8
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %25
14: ; preds = %2
%15 = load i32, i32* @stdout
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @stdout
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @stdout
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
store i8* %28, i8** %11
%29 = load i8*, i8** %11
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %65, label %32
32: ; preds = %25
%33 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %33, i32** %8
%34 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %34, i32** %9
store i32 2, i32* %7
br label %35
35: ; preds = %61, %32
%36 = load i32, i32* %7
%37 = load i32, i32* %4
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %64
39: ; preds = %35
%40 = load i32*, i32** %8
%41 = ptrtoint i32* %40 to i32
%42 = load i8**, i8*** %5
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %46)
%48 = load i32*, i32** %9
%49 = ptrtoint i32* %48 to i32
%50 = load i8**, i8*** %5
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = load i8**, i8*** %5
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i8* %54, i8* %59)
br label %61
61: ; preds = %39
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %35
64: ; preds = %35
br label %162
65: ; preds = %25
%66 = load i8*, i8** %11
%67 = call i32 @strcmp(i8* %66, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%68 = icmp ne i32 %67, 0
br i1 %68, label %111, label %69
69: ; preds = %65
%70 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %70, i32** %8
%71 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %71, i32** %9
%72 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %72, i32** %10
store i32 2, i32* %7
br label %73
73: ; preds = %107, %69
%74 = load i32, i32* %7
%75 = load i32, i32* %4
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %110
77: ; preds = %73
%78 = load i32*, i32** %8
%79 = ptrtoint i32* %78 to i32
%80 = load i8**, i8*** %5
%81 = load i32, i32* %7
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* %84)
%86 = load i32*, i32** %9
%87 = ptrtoint i32* %86 to i32
%88 = load i8**, i8*** %5
%89 = load i32, i32* %7
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %88, i64 %90
%92 = load i8*, i8** %91
%93 = load i8**, i8*** %5
%94 = load i32, i32* %7
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.13, i64 0, i64 0), i8* %92, i8* %97)
%99 = load i32*, i32** %10
%100 = ptrtoint i32* %99 to i32
%101 = load i8**, i8*** %5
%102 = load i32, i32* %7
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8*, i8** %101, i64 %103
%105 = load i8*, i8** %104
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8* %105)
br label %107
107: ; preds = %77
%108 = load i32, i32* %7
%109 = add nsw i32 %108, 1
store i32 %109, i32* %7
br label %73
110: ; preds = %73
br label %161
111: ; preds = %65
%112 = load i8*, i8** %11
%113 = call i32 @strcmp(i8* %112, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%114 = icmp ne i32 %113, 0
br i1 %114, label %136, label %115
115: ; preds = %111
%116 = load i32, i32* %4
%117 = icmp ne i32 %116, 4
br i1 %117, label %118, label %122
118: ; preds = %115
%119 = load i32, i32* @stdout
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.16, i64 0, i64 0))
%121 = call i32 @exit(i32 1)
unreachable
122: ; preds = %115
%123 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %123, i32** %8
%124 = load i32*, i32** %8
%125 = ptrtoint i32* %124 to i32
%126 = load i8**, i8*** %5
%127 = getelementptr inbounds i8*, i8** %126, i64 2
%128 = load i8*, i8** %127
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.17, i64 0, i64 0), i8* %128)
%130 = load i32*, i32** %8
%131 = ptrtoint i32* %130 to i32
%132 = load i8**, i8*** %5
%133 = getelementptr inbounds i8*, i8** %132, i64 3
%134 = load i8*, i8** %133
%135 = call i32 (i32, i8*, ...) @fprintf(i32 %131, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i8* %134)
br label %160
136: ; preds = %111
%137 = load i8*, i8** %11
%138 = call i32 @strcmp(i8* %137, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%139 = icmp ne i32 %138, 0
br i1 %139, label %145, label %140
140: ; preds = %136
%141 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %141, i32** %9
%142 = load i32*, i32** %9
%143 = ptrtoint i32* %142 to i32
%144 = call i32 (i32, i8*, ...) @fprintf(i32 %143, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
br label %159
145: ; preds = %136
%146 = load i8*, i8** %11
%147 = call i32 @strcmp(i8* %146, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%148 = icmp ne i32 %147, 0
br i1 %148, label %154, label %149
149: ; preds = %145
%150 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %150, i32** %9
%151 = load i32*, i32** %9
%152 = ptrtoint i32* %151 to i32
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %152, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.23, i64 0, i64 0))
br label %158
154: ; preds = %145
%155 = load i32, i32* @stdout
%156 = call i32 (i32, i8*, ...) @fprintf(i32 %155, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.24, i64 0, i64 0))
%157 = call i32 @exit(i32 1)
unreachable
158: ; preds = %149
br label %159
159: ; preds = %158, %140
br label %160
160: ; preds = %159, %122
br label %161
161: ; preds = %160, %110
br label %162
162: ; preds = %161, %64
%163 = load i32*, i32** %10
%164 = icmp ne i32* %163, null
br i1 %164, label %165, label %168
165: ; preds = %162
%166 = load i32*, i32** %10
%167 = call i32 @fclose(i32* %166)
br label %168
168: ; preds = %165, %162
%169 = load i32*, i32** %9
%170 = icmp ne i32* %169, null
br i1 %170, label %171, label %174
171: ; preds = %168
%172 = load i32*, i32** %9
%173 = call i32 @fclose(i32* %172)
br label %174
174: ; preds = %171, %168
%175 = load i32*, i32** %8
%176 = icmp ne i32* %175, null
br i1 %176, label %177, label %180
177: ; preds = %174
%178 = load i32*, i32** %8
%179 = call i32 @fclose(i32* %178)
br label %180
180: ; preds = %177, %174
%181 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [23 x i8] c"Not enough arguments.\0A\00"
@.str.1 = [19 x i8] c"Usage: %s opt ...\0A\00"
@.str.2 = [59 x i8] c"opt can be drivers, mkauths, version, setproto or sslinit\0A\00"
@.str.3 = [8 x i8] c"drivers\00"
@.str.4 = [10 x i8] c"linkage.h\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [10 x i8] c"linkage.c\00"
@.str.7 = [25 x i8] c"extern DRIVER %sdriver;\0A\00"
@.str.8 = [56 x i8] c" mail_link (&%sdriver); /* link in the %s driver */\0A\00"
@.str.9 = [8 x i8] c"mkauths\00"
@.str.10 = [2 x i8] c"a\00"
@.str.11 = [8 x i8] c"auths.c\00"
@.str.12 = [31 x i8] c"extern AUTHENTICATOR auth_%s;\0A\00"
@.str.13 = [62 x i8] c" auth_link (&auth_%s); /* link in the %s authenticator */\0A\00"
@.str.14 = [22 x i8] c"#include \22auth_%s.c\22\0A\00"
@.str.15 = [9 x i8] c"setproto\00"
@.str.16 = [44 x i8] c"setproto requires two additional arguments\0A\00"
@.str.17 = [29 x i8] c"#define CREATEPROTO %sproto\0A\00"
@.str.18 = [29 x i8] c"#define APPENDPROTO %sproto\0A\00"
@.str.19 = [8 x i8] c"sslinit\00"
@.str.20 = [4 x i8] c"%s\0A\00"
@.str.21 = [20 x i8] c"ssl_onceonlyinit();\00"
@.str.22 = [8 x i8] c"version\00"
@.str.23 = [35 x i8] c"mail_versioncheck(CCLIENTVERSION);\00"
@.str.24 = [65 x i8] c"Try: \22drivers\22, \22mkauths\22, \22setproto\22, \22sslinit\22, or \22version\22.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stdout
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %37
18: ; preds = %13
%19 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%20 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp ugt i32 %0, 2
br i1 %21, label %22, label %107
22: ; preds = %18
%23 = ptrtoint i32* %19 to i64
%24 = trunc i64 %23 to i32
%25 = ptrtoint i32* %20 to i64
%26 = trunc i64 %25 to i32
%27 = zext i32 %0 to i64
br label %28
28: ; preds = %22, %28
%29 = phi i64 [ 2, %22 ], [ %35, %28 ]
%30 = getelementptr inbounds i8*, i8** %1, i64 %29
%31 = load i8*, i8** %30
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %31)
%33 = load i8*, i8** %30
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i8* %33, i8* %33)
%35 = add nuw nsw i64 %29, 1
%36 = icmp eq i64 %35, %27
br i1 %36, label %107, label %28
37: ; preds = %13
%38 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %64
40: ; preds = %37
%41 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%42 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%43 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp ugt i32 %0, 2
br i1 %44, label %45, label %103
45: ; preds = %40
%46 = ptrtoint i32* %41 to i64
%47 = trunc i64 %46 to i32
%48 = ptrtoint i32* %42 to i64
%49 = trunc i64 %48 to i32
%50 = ptrtoint i32* %43 to i64
%51 = trunc i64 %50 to i32
%52 = zext i32 %0 to i64
br label %53
53: ; preds = %45, %53
%54 = phi i64 [ 2, %45 ], [ %62, %53 ]
%55 = getelementptr inbounds i8*, i8** %1, i64 %54
%56 = load i8*, i8** %55
%57 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* %56)
%58 = load i8*, i8** %55
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.13, i64 0, i64 0), i8* %58, i8* %58)
%60 = load i8*, i8** %55
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8* %60)
%62 = add nuw nsw i64 %54, 1
%63 = icmp eq i64 %62, %52
br i1 %63, label %103, label %53
64: ; preds = %37
%65 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %83
67: ; preds = %64
%68 = icmp eq i32 %0, 4
br i1 %68, label %73, label %69
69: ; preds = %67
%70 = load i32, i32* @stdout
%71 = tail call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.16, i64 0, i64 0))
%72 = tail call i32 @exit(i32 1)
unreachable
73: ; preds = %67
%74 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%75 = ptrtoint i32* %74 to i64
%76 = trunc i64 %75 to i32
%77 = getelementptr inbounds i8*, i8** %1, i64 2
%78 = load i8*, i8** %77
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.17, i64 0, i64 0), i8* %78)
%80 = getelementptr inbounds i8*, i8** %1, i64 3
%81 = load i8*, i8** %80
%82 = tail call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i8* %81)
br label %113
83: ; preds = %64
%84 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %91
86: ; preds = %83
%87 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%88 = ptrtoint i32* %87 to i64
%89 = trunc i64 %88 to i32
%90 = tail call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
br label %107
91: ; preds = %83
%92 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %99
94: ; preds = %91
%95 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%96 = ptrtoint i32* %95 to i64
%97 = trunc i64 %96 to i32
%98 = tail call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.23, i64 0, i64 0))
br label %107
99: ; preds = %91
%100 = load i32, i32* @stdout
%101 = tail call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.24, i64 0, i64 0))
%102 = tail call i32 @exit(i32 1)
unreachable
103: ; preds = %53, %40
%104 = icmp eq i32* %43, null
br i1 %104, label %107, label %105
105: ; preds = %103
%106 = tail call i32 @fclose(i32* %43)
br label %107
107: ; preds = %28, %18, %86, %94, %105, %103
%108 = phi i32* [ %42, %105 ], [ %42, %103 ], [ %87, %86 ], [ %95, %94 ], [ %20, %18 ], [ %20, %28 ]
%109 = phi i32* [ %41, %105 ], [ %41, %103 ], [ null, %86 ], [ null, %94 ], [ %19, %18 ], [ %19, %28 ]
%110 = icmp eq i32* %108, null
br i1 %110, label %113, label %111
111: ; preds = %107
%112 = tail call i32 @fclose(i32* %108)
br label %113
113: ; preds = %73, %111, %107
%114 = phi i32* [ %74, %73 ], [ %109, %111 ], [ %109, %107 ]
%115 = icmp eq i32* %114, null
br i1 %115, label %118, label %116
116: ; preds = %113
%117 = tail call i32 @fclose(i32* %114)
br label %118
118: ; preds = %116, %113
%119 = tail call i32 @exit(i32 0)
unreachable
}