#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*/ commit(int);
int /*<<< orphan*/ dbcheck();
int /*<<< orphan*/ dbload();
int /*<<< orphan*/ del(char *);
int /*<<< orphan*/ diff(char *, int, int);
int /*<<< orphan*/ flist(char *, int);
int /*<<< orphan*/ init(char *, char *);
char *mc_get(char *);
int /*<<< orphan*/ mc_init();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ restore(char *, char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ tlist(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char *cmd;
  mc_init();
  dbload();
  if (argc < 2)
    usage(argv[0]);
  cmd = argv[1];
  if (!strncmp(cmd, "init", 4)) {
    if (argc < 3)
      usage(argv[0]);
    init(argv[2], argc < 4 ? NULL : argv[3]);
  } else if (!strncmp(cmd, "tlist", 5)) {
    tlist(argc < 3 ? NULL : argv[2]);
  } else if (!strncmp(cmd, "flistx", 6)) {
    flist(argc < 3 ? NULL : argv[2], 1);
  } else if (!strncmp(cmd, "flist", 5)) {
    flist(argc < 3 ? NULL : argv[2], 0);
  } else if (!strncmp(cmd, "diffx", 5)) {
    if (argc >= 3 && !strncmp(argv[2], "-c", 2))
      diff(argc < 4 ? NULL : argv[3], 1, 1);
    else
      diff(argc < 3 ? NULL : argv[2], 0, 1);
  } else if (!strncmp(cmd, "diff", 4)) {
    if (argc >= 3 && !strncmp(argv[2], "-c", 2))
      diff(argc < 4 ? NULL : argv[3], 1, 0);
    else
      diff(argc < 3 ? NULL : argv[2], 0, 0);
  } else if (!strncmp(cmd, "commit", 6)) {
    commit(argc >= 3 && !strncmp(argv[2], "-c", 2));
  } else if (!strncmp(cmd, "restore", 7)) {
    restore(argc < 3 ? NULL : argv[2], argc < 4 ? NULL : argv[3],
            argc < 5 ? NULL : argv[4]);
  } else if (!strncmp(cmd, "del", 3)) {
    if (argc < 3)
      usage(argv[0]);
    del(argv[2]);
  } else if (!strncmp(cmd, "dbcheck", 7)) {
    dbcheck();
  } else if (!strncmp(cmd, "mctest", 7)) {
    if (argc >= 3)
      printf("mc: %s\n", mc_get(argv[2]));
  } else
    usage(argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <mc_init@plt>
mov    $0x0,%al
call   10b0 <dbload@plt>
cmpl   $0x2,-0x8(%rbp)
jge    121d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xdcc(%rip),%rsi
mov    $0x4,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    129c <main+0xbc>
cmpl   $0x3,-0x8(%rbp)
jge    125d <main+0x7d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    127e <main+0x9e>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    128a <main+0xaa>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10c0 <init@plt>
jmp    1703 <main+0x523>
mov    -0x18(%rbp),%rdi
lea    0xd5e(%rip),%rsi
mov    $0x5,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    12e9 <main+0x109>
cmpl   $0x3,-0x8(%rbp)
jge    12cf <main+0xef>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    12db <main+0xfb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1090 <tlist@plt>
jmp    16fe <main+0x51e>
mov    -0x18(%rbp),%rdi
lea    0xd17(%rip),%rsi
mov    $0x6,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    133b <main+0x15b>
cmpl   $0x3,-0x8(%rbp)
jge    131c <main+0x13c>
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
jmp    1328 <main+0x148>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    $0x1,%esi
call   1060 <flist@plt>
jmp    16f9 <main+0x519>
mov    -0x18(%rbp),%rdi
lea    0xccc(%rip),%rsi
mov    $0x5,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    138a <main+0x1aa>
cmpl   $0x3,-0x8(%rbp)
jge    136e <main+0x18e>
xor    %eax,%eax
mov    %rax,-0x40(%rbp)
jmp    137a <main+0x19a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
xor    %esi,%esi
call   1060 <flist@plt>
jmp    16f4 <main+0x514>
mov    -0x18(%rbp),%rdi
lea    0xc83(%rip),%rsi
mov    $0x5,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    1440 <main+0x260>
cmpl   $0x3,-0x8(%rbp)
jl     140a <main+0x22a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc5d(%rip),%rsi
mov    $0x2,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    140a <main+0x22a>
cmpl   $0x4,-0x8(%rbp)
jge    13e9 <main+0x209>
xor    %eax,%eax
mov    %rax,-0x48(%rbp)
jmp    13f5 <main+0x215>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1100 <diff@plt>
jmp    143b <main+0x25b>
cmpl   $0x3,-0x8(%rbp)
jge    141f <main+0x23f>
xor    %eax,%eax
mov    %rax,-0x50(%rbp)
jmp    142b <main+0x24b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1100 <diff@plt>
jmp    16ef <main+0x50f>
mov    -0x18(%rbp),%rdi
lea    0xbd6(%rip),%rsi
mov    $0x4,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    14f3 <main+0x313>
cmpl   $0x3,-0x8(%rbp)
jl     14c0 <main+0x2e0>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xba7(%rip),%rsi
mov    $0x2,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    14c0 <main+0x2e0>
cmpl   $0x4,-0x8(%rbp)
jge    149f <main+0x2bf>
xor    %eax,%eax
mov    %rax,-0x58(%rbp)
jmp    14ab <main+0x2cb>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1100 <diff@plt>
jmp    14ee <main+0x30e>
cmpl   $0x3,-0x8(%rbp)
jge    14d5 <main+0x2f5>
xor    %eax,%eax
mov    %rax,-0x60(%rbp)
jmp    14e1 <main+0x301>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1100 <diff@plt>
jmp    16ea <main+0x50a>
mov    -0x18(%rbp),%rdi
lea    0xb28(%rip),%rsi
mov    $0x6,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    1556 <main+0x376>
xor    %eax,%eax
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0x61(%rbp)
jl     1544 <main+0x364>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xaef(%rip),%rsi
mov    $0x2,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   10d0 <commit@plt>
jmp    16e5 <main+0x505>
mov    -0x18(%rbp),%rdi
lea    0xacc(%rip),%rsi
mov    $0x7,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    160c <main+0x42c>
cmpl   $0x3,-0x8(%rbp)
jge    1589 <main+0x3a9>
xor    %eax,%eax
mov    %rax,-0x70(%rbp)
jmp    1595 <main+0x3b5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    15b2 <main+0x3d2>
xor    %eax,%eax
mov    %rax,-0x80(%rbp)
jmp    15be <main+0x3de>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    15e1 <main+0x401>
xor    %eax,%eax
mov    %rax,-0x90(%rbp)
jmp    15f0 <main+0x410>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x90(%rbp)
mov    -0x88(%rbp),%rsi
mov    -0x78(%rbp),%rdi
mov    -0x90(%rbp),%rdx
call   1070 <restore@plt>
jmp    16e0 <main+0x500>
mov    -0x18(%rbp),%rdi
lea    0xa1e(%rip),%rsi
mov    $0x3,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    1652 <main+0x472>
cmpl   $0x3,-0x8(%rbp)
jge    1640 <main+0x460>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10f0 <del@plt>
jmp    16db <main+0x4fb>
mov    -0x18(%rbp),%rdi
lea    0x9dc(%rip),%rsi
mov    $0x7,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    167c <main+0x49c>
mov    $0x0,%al
call   1030 <dbcheck@plt>
jmp    16d6 <main+0x4f6>
mov    -0x18(%rbp),%rdi
lea    0x9ba(%rip),%rsi
mov    $0x7,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%eax
jne    16c5 <main+0x4e5>
cmpl   $0x3,-0x8(%rbp)
jl     16c0 <main+0x4e0>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <mc_get@plt>
mov    %rax,%rsi
lea    0x98d(%rip),%rdi
call   10a0 <printf@plt>
jmp    16d1 <main+0x4f1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <usage@plt>
jmp    16d6 <main+0x4f6>
jmp    16db <main+0x4fb>
jmp    16e0 <main+0x500>
jmp    16e5 <main+0x505>
jmp    16ea <main+0x50a>
jmp    16ef <main+0x50f>
jmp    16f4 <main+0x514>
jmp    16f9 <main+0x519>
jmp    16fe <main+0x51e>
jmp    1703 <main+0x523>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <mc_init@plt>
xor    %eax,%eax
call   10b0 <dbload@plt>
cmp    $0x1,%ebp
jg     1204 <main+0x24>
mov    (%r14),%rdi
call   10e0 <usage@plt>
mov    0x8(%r14),%rbx
lea    0xdf1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     1349 <main+0x169>
lea    0xdda(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     135c <main+0x17c>
lea    0xdc4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     1382 <main+0x1a2>
lea    0xdaf(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     13a7 <main+0x1c7>
lea    0xd99(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     13c3 <main+0x1e3>
lea    0xd86(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     1400 <main+0x220>
lea    0xd6f(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     1436 <main+0x256>
lea    0xd5a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     146d <main+0x28d>
lea    0xd46(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     1481 <main+0x2a1>
lea    0xd2e(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     14ac <main+0x2cc>
lea    0xd1a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     14d7 <main+0x2f7>
mov    (%r14),%rdi
call   10e0 <usage@plt>
jmp    1506 <main+0x326>
cmp    $0x2,%ebp
jg     136d <main+0x18d>
mov    (%r14),%rdi
call   10e0 <usage@plt>
mov    0x10(%r14),%rdi
jmp    1376 <main+0x196>
cmp    $0x3,%ebp
jge    138b <main+0x1ab>
xor    %edi,%edi
call   1090 <tlist@plt>
jmp    1506 <main+0x326>
mov    0x10(%r14),%rdi
cmp    $0x3,%ebp
jne    1399 <main+0x1b9>
xor    %esi,%esi
call   10c0 <init@plt>
jmp    1506 <main+0x326>
cmp    $0x3,%ebp
jge    13b0 <main+0x1d0>
xor    %edi,%edi
jmp    13b4 <main+0x1d4>
mov    0x10(%r14),%rdi
call   1090 <tlist@plt>
jmp    1506 <main+0x326>
mov    0x18(%r14),%rsi
call   10c0 <init@plt>
jmp    1506 <main+0x326>
cmp    $0x3,%ebp
jge    13f0 <main+0x210>
xor    %edi,%edi
jmp    13f4 <main+0x214>
mov    0x10(%r14),%rdi
mov    $0x1,%esi
call   1060 <flist@plt>
jmp    1506 <main+0x326>
cmp    $0x3,%ebp
jl     142d <main+0x24d>
mov    0x10(%r14),%rdi
lea    0xc4b(%rip),%rsi
mov    $0x2,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     1478 <main+0x298>
mov    0x10(%r14),%rdi
xor    %esi,%esi
jmp    14be <main+0x2de>
mov    0x10(%r14),%rdi
xor    %esi,%esi
call   1060 <flist@plt>
jmp    1506 <main+0x326>
cmp    $0x3,%ebp
jl     1464 <main+0x284>
mov    0x10(%r14),%rdi
lea    0xc0e(%rip),%rsi
mov    $0x2,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
je     14a3 <main+0x2c3>
mov    0x10(%r14),%rdi
xor    %esi,%esi
jmp    14ff <main+0x31f>
xor    %edi,%edi
xor    %esi,%esi
jmp    14be <main+0x2de>
xor    %edi,%edi
cmp    $0x3,%ebp
jl     145a <main+0x27a>
mov    0x10(%r14),%rdi
lea    0xbd6(%rip),%rsi
mov    $0x2,%edx
call   1050 <strncmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   10d0 <commit@plt>
jmp    1506 <main+0x326>
xor    %edi,%edi
xor    %esi,%esi
jmp    14ff <main+0x31f>
cmp    $0x3,%ebp
jge    1499 <main+0x2b9>
xor    %esi,%esi
xor    %edi,%edi
jmp    14ce <main+0x2ee>
cmp    $0x4,%ebp
jae    14b5 <main+0x2d5>
xor    %edi,%edi
jmp    14b9 <main+0x2d9>
cmp    $0x2,%ebp
jg     148e <main+0x2ae>
mov    (%r14),%rdi
call   10e0 <usage@plt>
mov    0x10(%r14),%rdi
call   10f0 <del@plt>
jmp    1506 <main+0x326>
mov    0x10(%r14),%rdi
jne    14c5 <main+0x2e5>
xor    %esi,%esi
jmp    14ce <main+0x2ee>
cmp    $0x4,%ebp
jae    14f6 <main+0x316>
xor    %edi,%edi
jmp    14fa <main+0x31a>
xor    %eax,%eax
call   1030 <dbcheck@plt>
jmp    1506 <main+0x326>
mov    0x18(%r14),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1501 <main+0x321>
mov    0x18(%r14),%rsi
cmp    $0x5,%ebp
jae    150d <main+0x32d>
xor    %edx,%edx
call   1070 <restore@plt>
jmp    1506 <main+0x326>
cmp    $0x3,%ebp
jl     1506 <main+0x326>
mov    0x10(%r14),%rdi
call   1080 <mc_get@plt>
lea    0xb5c(%rip),%rdi
mov    %rax,%rsi
call   10a0 <printf@plt>
jmp    1506 <main+0x326>
mov    0x18(%r14),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1100 <diff@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x20(%r14),%rdx
call   1070 <restore@plt>
jmp    1506 <main+0x326>

LLVM IR (-O0):
@.str = [5 x i8] c"init\00"
@.str.1 = [6 x i8] c"tlist\00"
@.str.2 = [7 x i8] c"flistx\00"
@.str.3 = [6 x i8] c"flist\00"
@.str.4 = [6 x i8] c"diffx\00"
@.str.5 = [3 x i8] c"-c\00"
@.str.6 = [5 x i8] c"diff\00"
@.str.7 = [7 x i8] c"commit\00"
@.str.8 = [8 x i8] c"restore\00"
@.str.9 = [4 x i8] c"del\00"
@.str.10 = [8 x i8] c"dbcheck\00"
@.str.11 = [7 x i8] c"mctest\00"
@.str.12 = [8 x i8] c"mc: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @mc_init()
%8 = call i32 (...) @dbload()
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @usage(i8* %14)
br label %16
16: ; preds = %11, %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
store i8* %19, i8** %6
%20 = load i8*, i8** %6
%21 = call i32 @strncmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%22 = icmp ne i32 %21, 0
br i1 %22, label %45, label %23
23: ; preds = %16
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 @usage(i8* %29)
br label %31
31: ; preds = %26, %23
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 4
br i1 %36, label %37, label %38
37: ; preds = %31
br label %42
38: ; preds = %31
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 3
%41 = load i8*, i8** %40
br label %42
42: ; preds = %38, %37
%43 = phi i8* [ null, %37 ], [ %41, %38 ]
%44 = call i32 @init(i8* %34, i8* %43)
br label %265
45: ; preds = %16
%46 = load i8*, i8** %6
%47 = call i32 @strncmp(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%48 = icmp ne i32 %47, 0
br i1 %48, label %60, label %49
49: ; preds = %45
%50 = load i32, i32* %4
%51 = icmp slt i32 %50, 3
br i1 %51, label %52, label %53
52: ; preds = %49
br label %57
53: ; preds = %49
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 2
%56 = load i8*, i8** %55
br label %57
57: ; preds = %53, %52
%58 = phi i8* [ null, %52 ], [ %56, %53 ]
%59 = call i32 @tlist(i8* %58)
br label %264
60: ; preds = %45
%61 = load i8*, i8** %6
%62 = call i32 @strncmp(i8* %61, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 6)
%63 = icmp ne i32 %62, 0
br i1 %63, label %75, label %64
64: ; preds = %60
%65 = load i32, i32* %4
%66 = icmp slt i32 %65, 3
br i1 %66, label %67, label %68
67: ; preds = %64
br label %72
68: ; preds = %64
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 2
%71 = load i8*, i8** %70
br label %72
72: ; preds = %68, %67
%73 = phi i8* [ null, %67 ], [ %71, %68 ]
%74 = call i32 @flist(i8* %73, i32 1)
br label %263
75: ; preds = %60
%76 = load i8*, i8** %6
%77 = call i32 @strncmp(i8* %76, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%78 = icmp ne i32 %77, 0
br i1 %78, label %90, label %79
79: ; preds = %75
%80 = load i32, i32* %4
%81 = icmp slt i32 %80, 3
br i1 %81, label %82, label %83
82: ; preds = %79
br label %87
83: ; preds = %79
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 2
%86 = load i8*, i8** %85
br label %87
87: ; preds = %83, %82
%88 = phi i8* [ null, %82 ], [ %86, %83 ]
%89 = call i32 @flist(i8* %88, i32 0)
br label %262
90: ; preds = %75
%91 = load i8*, i8** %6
%92 = call i32 @strncmp(i8* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%93 = icmp ne i32 %92, 0
br i1 %93, label %126, label %94
94: ; preds = %90
%95 = load i32, i32* %4
%96 = icmp sge i32 %95, 3
br i1 %96, label %97, label %114
97: ; preds = %94
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 2
%100 = load i8*, i8** %99
%101 = call i32 @strncmp(i8* %100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%102 = icmp ne i32 %101, 0
br i1 %102, label %114, label %103
103: ; preds = %97
%104 = load i32, i32* %4
%105 = icmp slt i32 %104, 4
br i1 %105, label %106, label %107
106: ; preds = %103
br label %111
107: ; preds = %103
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 3
%110 = load i8*, i8** %109
br label %111
111: ; preds = %107, %106
%112 = phi i8* [ null, %106 ], [ %110, %107 ]
%113 = call i32 @diff(i8* %112, i32 1, i32 1)
br label %125
114: ; preds = %97, %94
%115 = load i32, i32* %4
%116 = icmp slt i32 %115, 3
br i1 %116, label %117, label %118
117: ; preds = %114
br label %122
118: ; preds = %114
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 2
%121 = load i8*, i8** %120
br label %122
122: ; preds = %118, %117
%123 = phi i8* [ null, %117 ], [ %121, %118 ]
%124 = call i32 @diff(i8* %123, i32 0, i32 1)
br label %125
125: ; preds = %122, %111
br label %261
126: ; preds = %90
%127 = load i8*, i8** %6
%128 = call i32 @strncmp(i8* %127, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%129 = icmp ne i32 %128, 0
br i1 %129, label %162, label %130
130: ; preds = %126
%131 = load i32, i32* %4
%132 = icmp sge i32 %131, 3
br i1 %132, label %133, label %150
133: ; preds = %130
%134 = load i8**, i8*** %5
%135 = getelementptr inbounds i8*, i8** %134, i64 2
%136 = load i8*, i8** %135
%137 = call i32 @strncmp(i8* %136, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%138 = icmp ne i32 %137, 0
br i1 %138, label %150, label %139
139: ; preds = %133
%140 = load i32, i32* %4
%141 = icmp slt i32 %140, 4
br i1 %141, label %142, label %143
142: ; preds = %139
br label %147
143: ; preds = %139
%144 = load i8**, i8*** %5
%145 = getelementptr inbounds i8*, i8** %144, i64 3
%146 = load i8*, i8** %145
br label %147
147: ; preds = %143, %142
%148 = phi i8* [ null, %142 ], [ %146, %143 ]
%149 = call i32 @diff(i8* %148, i32 1, i32 0)
br label %161
150: ; preds = %133, %130
%151 = load i32, i32* %4
%152 = icmp slt i32 %151, 3
br i1 %152, label %153, label %154
153: ; preds = %150
br label %158
154: ; preds = %150
%155 = load i8**, i8*** %5
%156 = getelementptr inbounds i8*, i8** %155, i64 2
%157 = load i8*, i8** %156
br label %158
158: ; preds = %154, %153
%159 = phi i8* [ null, %153 ], [ %157, %154 ]
%160 = call i32 @diff(i8* %159, i32 0, i32 0)
br label %161
161: ; preds = %158, %147
br label %260
162: ; preds = %126
%163 = load i8*, i8** %6
%164 = call i32 @strncmp(i8* %163, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 6)
%165 = icmp ne i32 %164, 0
br i1 %165, label %180, label %166
166: ; preds = %162
%167 = load i32, i32* %4
%168 = icmp sge i32 %167, 3
br i1 %168, label %169, label %176
169: ; preds = %166
%170 = load i8**, i8*** %5
%171 = getelementptr inbounds i8*, i8** %170, i64 2
%172 = load i8*, i8** %171
%173 = call i32 @strncmp(i8* %172, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%174 = icmp ne i32 %173, 0
%175 = xor i1 %174, true
br label %176
176: ; preds = %169, %166
%177 = phi i1 [ false, %166 ], [ %175, %169 ]
%178 = zext i1 %177 to i32
%179 = call i32 @commit(i32 %178)
br label %259
180: ; preds = %162
%181 = load i8*, i8** %6
%182 = call i32 @strncmp(i8* %181, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%183 = icmp ne i32 %182, 0
br i1 %183, label %213, label %184
184: ; preds = %180
%185 = load i32, i32* %4
%186 = icmp slt i32 %185, 3
br i1 %186, label %187, label %188
187: ; preds = %184
br label %192
188: ; preds = %184
%189 = load i8**, i8*** %5
%190 = getelementptr inbounds i8*, i8** %189, i64 2
%191 = load i8*, i8** %190
br label %192
192: ; preds = %188, %187
%193 = phi i8* [ null, %187 ], [ %191, %188 ]
%194 = load i32, i32* %4
%195 = icmp slt i32 %194, 4
br i1 %195, label %196, label %197
196: ; preds = %192
br label %201
197: ; preds = %192
%198 = load i8**, i8*** %5
%199 = getelementptr inbounds i8*, i8** %198, i64 3
%200 = load i8*, i8** %199
br label %201
201: ; preds = %197, %196
%202 = phi i8* [ null, %196 ], [ %200, %197 ]
%203 = load i32, i32* %4
%204 = icmp slt i32 %203, 5
br i1 %204, label %205, label %206
205: ; preds = %201
br label %210
206: ; preds = %201
%207 = load i8**, i8*** %5
%208 = getelementptr inbounds i8*, i8** %207, i64 4
%209 = load i8*, i8** %208
br label %210
210: ; preds = %206, %205
%211 = phi i8* [ null, %205 ], [ %209, %206 ]
%212 = call i32 @restore(i8* %193, i8* %202, i8* %211)
br label %258
213: ; preds = %180
%214 = load i8*, i8** %6
%215 = call i32 @strncmp(i8* %214, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%216 = icmp ne i32 %215, 0
br i1 %216, label %230, label %217
217: ; preds = %213
%218 = load i32, i32* %4
%219 = icmp slt i32 %218, 3
br i1 %219, label %220, label %225
220: ; preds = %217
%221 = load i8**, i8*** %5
%222 = getelementptr inbounds i8*, i8** %221, i64 0
%223 = load i8*, i8** %222
%224 = call i32 @usage(i8* %223)
br label %225
225: ; preds = %220, %217
%226 = load i8**, i8*** %5
%227 = getelementptr inbounds i8*, i8** %226, i64 2
%228 = load i8*, i8** %227
%229 = call i32 @del(i8* %228)
br label %257
230: ; preds = %213
%231 = load i8*, i8** %6
%232 = call i32 @strncmp(i8* %231, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 7)
%233 = icmp ne i32 %232, 0
br i1 %233, label %236, label %234
234: ; preds = %230
%235 = call i32 (...) @dbcheck()
br label %256
236: ; preds = %230
%237 = load i8*, i8** %6
%238 = call i32 @strncmp(i8* %237, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 7)
%239 = icmp ne i32 %238, 0
br i1 %239, label %250, label %240
240: ; preds = %236
%241 = load i32, i32* %4
%242 = icmp sge i32 %241, 3
br i1 %242, label %243, label %249
243: ; preds = %240
%244 = load i8**, i8*** %5
%245 = getelementptr inbounds i8*, i8** %244, i64 2
%246 = load i8*, i8** %245
%247 = call i8* @mc_get(i8* %246)
%248 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %247)
br label %249
249: ; preds = %243, %240
br label %255
250: ; preds = %236
%251 = load i8**, i8*** %5
%252 = getelementptr inbounds i8*, i8** %251, i64 0
%253 = load i8*, i8** %252
%254 = call i32 @usage(i8* %253)
br label %255
255: ; preds = %250, %249
br label %256
256: ; preds = %255, %234
br label %257
257: ; preds = %256, %225
br label %258
258: ; preds = %257, %210
br label %259
259: ; preds = %258, %176
br label %260
260: ; preds = %259, %161
br label %261
261: ; preds = %260, %125
br label %262
262: ; preds = %261, %87
br label %263
263: ; preds = %262, %72
br label %264
264: ; preds = %263, %57
br label %265
265: ; preds = %264, %42
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"init\00"
@.str.1 = [6 x i8] c"tlist\00"
@.str.2 = [7 x i8] c"flistx\00"
@.str.3 = [6 x i8] c"flist\00"
@.str.4 = [6 x i8] c"diffx\00"
@.str.5 = [3 x i8] c"-c\00"
@.str.6 = [5 x i8] c"diff\00"
@.str.7 = [7 x i8] c"commit\00"
@.str.8 = [8 x i8] c"restore\00"
@.str.9 = [4 x i8] c"del\00"
@.str.10 = [8 x i8] c"dbcheck\00"
@.str.11 = [7 x i8] c"mctest\00"
@.str.12 = [8 x i8] c"mc: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @mc_init()
%4 = tail call i32 (...) @dbload()
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @usage(i8* %7)
br label %9
9: ; preds = %6, %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %32
14: ; preds = %9
%15 = icmp slt i32 %0, 3
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = load i8*, i8** %1
%18 = tail call i32 @usage(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
br label %28
21: ; preds = %14
%22 = getelementptr inbounds i8*, i8** %1, i64 2
%23 = load i8*, i8** %22
%24 = icmp eq i32 %0, 3
br i1 %24, label %28, label %25
25: ; preds = %21
%26 = getelementptr inbounds i8*, i8** %1, i64 3
%27 = load i8*, i8** %26
br label %28
28: ; preds = %16, %21, %25
%29 = phi i8* [ %23, %25 ], [ %23, %21 ], [ %20, %16 ]
%30 = phi i8* [ %27, %25 ], [ null, %21 ], [ null, %16 ]
%31 = tail call i32 @init(i8* %29, i8* %30)
br label %176
32: ; preds = %9
%33 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %43
35: ; preds = %32
%36 = icmp slt i32 %0, 3
br i1 %36, label %40, label %37
37: ; preds = %35
%38 = getelementptr inbounds i8*, i8** %1, i64 2
%39 = load i8*, i8** %38
br label %40
40: ; preds = %35, %37
%41 = phi i8* [ %39, %37 ], [ null, %35 ]
%42 = tail call i32 @tlist(i8* %41)
br label %176
43: ; preds = %32
%44 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 6)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %54
46: ; preds = %43
%47 = icmp slt i32 %0, 3
br i1 %47, label %51, label %48
48: ; preds = %46
%49 = getelementptr inbounds i8*, i8** %1, i64 2
%50 = load i8*, i8** %49
br label %51
51: ; preds = %46, %48
%52 = phi i8* [ %50, %48 ], [ null, %46 ]
%53 = tail call i32 @flist(i8* %52, i32 1)
br label %176
54: ; preds = %43
%55 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %65
57: ; preds = %54
%58 = icmp slt i32 %0, 3
br i1 %58, label %62, label %59
59: ; preds = %57
%60 = getelementptr inbounds i8*, i8** %1, i64 2
%61 = load i8*, i8** %60
br label %62
62: ; preds = %57, %59
%63 = phi i8* [ %61, %59 ], [ null, %57 ]
%64 = tail call i32 @flist(i8* %63, i32 0)
br label %176
65: ; preds = %54
%66 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %88
68: ; preds = %65
%69 = icmp sgt i32 %0, 2
br i1 %69, label %70, label %85
70: ; preds = %68
%71 = getelementptr inbounds i8*, i8** %1, i64 2
%72 = load i8*, i8** %71
%73 = tail call i32 @strncmp(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %83
75: ; preds = %70
%76 = icmp ult i32 %0, 4
br i1 %76, label %80, label %77
77: ; preds = %75
%78 = getelementptr inbounds i8*, i8** %1, i64 3
%79 = load i8*, i8** %78
br label %80
80: ; preds = %75, %77
%81 = phi i8* [ %79, %77 ], [ null, %75 ]
%82 = tail call i32 @diff(i8* %81, i32 1, i32 1)
br label %176
83: ; preds = %70
%84 = load i8*, i8** %71
br label %85
85: ; preds = %68, %83
%86 = phi i8* [ %84, %83 ], [ null, %68 ]
%87 = tail call i32 @diff(i8* %86, i32 0, i32 1)
br label %176
88: ; preds = %65
%89 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %111
91: ; preds = %88
%92 = icmp sgt i32 %0, 2
br i1 %92, label %93, label %108
93: ; preds = %91
%94 = getelementptr inbounds i8*, i8** %1, i64 2
%95 = load i8*, i8** %94
%96 = tail call i32 @strncmp(i8* %95, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %106
98: ; preds = %93
%99 = icmp ult i32 %0, 4
br i1 %99, label %103, label %100
100: ; preds = %98
%101 = getelementptr inbounds i8*, i8** %1, i64 3
%102 = load i8*, i8** %101
br label %103
103: ; preds = %98, %100
%104 = phi i8* [ %102, %100 ], [ null, %98 ]
%105 = tail call i32 @diff(i8* %104, i32 1, i32 0)
br label %176
106: ; preds = %93
%107 = load i8*, i8** %94
br label %108
108: ; preds = %91, %106
%109 = phi i8* [ %107, %106 ], [ null, %91 ]
%110 = tail call i32 @diff(i8* %109, i32 0, i32 0)
br label %176
111: ; preds = %88
%112 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 6)
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %125
114: ; preds = %111
%115 = icmp sgt i32 %0, 2
br i1 %115, label %116, label %122
116: ; preds = %114
%117 = getelementptr inbounds i8*, i8** %1, i64 2
%118 = load i8*, i8** %117
%119 = tail call i32 @strncmp(i8* %118, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%120 = icmp eq i32 %119, 0
%121 = zext i1 %120 to i32
br label %122
122: ; preds = %116, %114
%123 = phi i32 [ 0, %114 ], [ %121, %116 ]
%124 = tail call i32 @commit(i32 %123)
br label %176
125: ; preds = %111
%126 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%127 = icmp eq i32 %126, 0
br i1 %127, label %128, label %146
128: ; preds = %125
%129 = icmp slt i32 %0, 3
br i1 %129, label %141, label %130
130: ; preds = %128
%131 = getelementptr inbounds i8*, i8** %1, i64 2
%132 = load i8*, i8** %131
%133 = icmp eq i32 %0, 3
br i1 %133, label %141, label %134
134: ; preds = %130
%135 = getelementptr inbounds i8*, i8** %1, i64 3
%136 = load i8*, i8** %135
%137 = icmp ult i32 %0, 5
br i1 %137, label %141, label %138
138: ; preds = %134
%139 = getelementptr inbounds i8*, i8** %1, i64 4
%140 = load i8*, i8** %139
br label %141
141: ; preds = %128, %130, %134, %138
%142 = phi i8* [ %136, %138 ], [ %136, %134 ], [ null, %130 ], [ null, %128 ]
%143 = phi i8* [ %132, %138 ], [ %132, %134 ], [ %132, %130 ], [ null, %128 ]
%144 = phi i8* [ %140, %138 ], [ null, %134 ], [ null, %130 ], [ null, %128 ]
%145 = tail call i32 @restore(i8* %143, i8* %142, i8* %144)
br label %176
146: ; preds = %125
%147 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %158
149: ; preds = %146
%150 = icmp slt i32 %0, 3
br i1 %150, label %151, label %154
151: ; preds = %149
%152 = load i8*, i8** %1
%153 = tail call i32 @usage(i8* %152)
br label %154
154: ; preds = %151, %149
%155 = getelementptr inbounds i8*, i8** %1, i64 2
%156 = load i8*, i8** %155
%157 = tail call i32 @del(i8* %156)
br label %176
158: ; preds = %146
%159 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 7)
%160 = icmp eq i32 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %158
%162 = tail call i32 (...) @dbcheck()
br label %176
163: ; preds = %158
%164 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 7)
%165 = icmp eq i32 %164, 0
br i1 %165, label %166, label %173
166: ; preds = %163
%167 = icmp sgt i32 %0, 2
br i1 %167, label %168, label %176
168: ; preds = %166
%169 = getelementptr inbounds i8*, i8** %1, i64 2
%170 = load i8*, i8** %169
%171 = tail call i8* @mc_get(i8* %170)
%172 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %171)
br label %176
173: ; preds = %163
%174 = load i8*, i8** %1
%175 = tail call i32 @usage(i8* %174)
br label %176
176: ; preds = %40, %62, %108, %103, %141, %161, %166, %168, %173, %154, %122, %80, %85, %51, %28
ret i32 0
}