xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ ff2arff(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Usage: %s model\n", argv[0]);
    return EXIT_FAILURE;
  }
  ff2arff(argv[1]);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1164 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ff2arff@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113e <main+0x1e>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ea4(%rip),%rax
jmp    114e <main+0x2e>
mov    0x8(%rsi),%rdi
call   1030 <ff2arff@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Usage: %s model\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
store i32 %13, i32* %3
br label %20
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @ff2arff(i8* %17)
%19 = load i32, i32* @EXIT_SUCCESS
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [17 x i8] c"Usage: %s model\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @ff2arff(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_SUCCESS, %7 ]
%13 = load i32, i32* %12
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int /*<<< orphan*/ do_newlocale(int, char const *, int /*<<< orphan*/);
locale_t __newlocale(int mask, const char *name, locale_t loc) {
  ((void)0);
  loc = do_newlocale(mask, name, loc);
  ((void)0);
  return loc;
}


x86 assembly (clang, -O0):
<__newlocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <do_newlocale@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__newlocale>:
jmp    1030 <do_newlocale@plt>

LLVM IR (-O0):
define i32 @__newlocale(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @do_newlocale(i32 %7, i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @__newlocale(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @do_newlocale(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
#define SIGALRM 130
#define SIGCHLD 129
#define SIGUSR1 128
scalar_t__ SIG_DFL;
int /*<<< orphan*/ exit(int);
void child_handler(int signum) {
  switch (signum) {
  case SIGALRM:
    exit(1);
    break;
  case SIGUSR1:
    exit(0);
    break;
  case SIGCHLD:
    exit(1);
    break;
  default:
    exit((int)SIG_DFL);
    break;
  }
}


x86 assembly (clang, -O0):
<child_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1161 <child_handler+0x51>
jmp    1131 <child_handler+0x21>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     1168 <child_handler+0x58>
jmp    1144 <child_handler+0x34>
mov    -0x8(%rbp),%eax
sub    $0x82,%eax
jne    1172 <child_handler+0x62>
jmp    1157 <child_handler+0x47>
mov    $0x1,%edi
call   1030 <exit@plt>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0x1,%edi
call   1030 <exit@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<child_handler>:
push   %rax
cmp    $0x80,%edi
je     1133 <child_handler+0x23>
cmp    $0x81,%edi
je     1129 <child_handler+0x19>
cmp    $0x82,%edi
jne    113a <child_handler+0x2a>
mov    $0x1,%edi
call   1030 <exit@plt>
xor    %edi,%edi
call   1030 <exit@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@SIG_DFL = global i64 0
define void @child_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 130, label %4
i32 128, label %6
i32 129, label %8
]
4: ; preds = %1
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %1
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i64, i64* @SIG_DFL
%12 = trunc i64 %11 to i32
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@SIG_DFL = global i64 0
define void @child_handler(i32 %0) {
switch i32 %0, label %8 [
i32 130, label %2
i32 128, label %4
i32 129, label %6
]
2: ; preds = %1
%3 = tail call i32 @exit(i32 1)
unreachable
4: ; preds = %1
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = load i64, i64* @SIG_DFL
%10 = trunc i64 %9 to i32
%11 = tail call i32 @exit(i32 %10)
unreachable
}
int cursor_handle_func(const struct cmd_info *ci) { return 0; }


x86 assembly (clang, -O0):
<cursor_handle_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cursor_handle_func>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.cmd_info = type opaque
define i32 @cursor_handle_func(%struct.cmd_info* %0) {
%2 = alloca %struct.cmd_info*
store %struct.cmd_info* %0, %struct.cmd_info** %2
ret i32 0
}

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @cursor_handle_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_cdr(char *st) { printf(st); }


x86 assembly (clang, -O0):
<print_cdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cdr>:
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @print_cdr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
ret void
}

LLVM IR (-O2):
define void @print_cdr(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
int cFunc() { return 10; }


x86 assembly (clang, -O0):
<cFunc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cFunc>:
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @cFunc() {
ret i32 10
}

LLVM IR (-O2):
define i32 @cFunc() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_mem(void const *p, void const *ctx) {
  (void)ctx;
  free((void *)p);
}


x86 assembly (clang, -O0):
<free_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mem>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_mem(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @free_mem(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *read_line(void) {
  char *line = NULL;
  size_t bufsize = 0;
  getline(&line, &bufsize, stdin);
  return line;
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <getline@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <getline@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @read_line() {
%1 = alloca i8*
%2 = alloca i64
store i8* null, i8** %1
store i64 0, i64* %2
%3 = load i32, i32* @stdin
%4 = call i32 @getline(i8** %1, i64* %2, i32 %3)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @read_line() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = load i32, i32* @stdin
%6 = call i32 @getline(i8** %1, i64* %2, i32 %5)
%7 = load i8*, i8** %1
ret i8* %7
}
/* Variables and functions */
float log10_poisson_cdf_P_large_lambda(unsigned int, float);
float log10_poisson_cdf_Q_large_lambda(unsigned int, float);
float log10_poisson_cdf(unsigned int n, float lam, short lower) {
  if (lower)
    return log10_poisson_cdf_P_large_lambda(n, lam);
  else
    return log10_poisson_cdf_Q_large_lambda(n, lam);
}


x86 assembly (clang, -O0):
<log10_poisson_cdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
cmpw   $0x0,-0xe(%rbp)
je     1159 <log10_poisson_cdf+0x39>
mov    -0x8(%rbp),%edi
movss  -0xc(%rbp),%xmm0
call   1040 <log10_poisson_cdf_P_large_lambda@plt>
movss  %xmm0,-0x4(%rbp)
jmp    116b <log10_poisson_cdf+0x4b>
mov    -0x8(%rbp),%edi
movss  -0xc(%rbp),%xmm0
call   1030 <log10_poisson_cdf_Q_large_lambda@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10_poisson_cdf>:
test   %si,%si
je     112a <log10_poisson_cdf+0xa>
jmp    1040 <log10_poisson_cdf_P_large_lambda@plt>
jmp    1030 <log10_poisson_cdf_Q_large_lambda@plt>

LLVM IR (-O0):
define float @log10_poisson_cdf(i32 %0, float %1, i16 signext %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca float
%7 = alloca i16
store i32 %0, i32* %5
store float %1, float* %6
store i16 %2, i16* %7
%8 = load i16, i16* %7
%9 = icmp ne i16 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load float, float* %6
%13 = call float @log10_poisson_cdf_P_large_lambda(i32 %11, float %12)
store float %13, float* %4
br label %18
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load float, float* %6
%17 = call float @log10_poisson_cdf_Q_large_lambda(i32 %15, float %16)
store float %17, float* %4
br label %18
18: ; preds = %14, %10
%19 = load float, float* %4
ret float %19
}

LLVM IR (-O2):
define float @log10_poisson_cdf(i32 %0, float %1, i16 signext %2) {
%4 = icmp eq i16 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call float @log10_poisson_cdf_P_large_lambda(i32 %0, float %1)
br label %9
7: ; preds = %3
%8 = tail call float @log10_poisson_cdf_Q_large_lambda(i32 %0, float %1)
br label %9
9: ; preds = %7, %5
%10 = phi float [ %6, %5 ], [ %8, %7 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
main() {
  int a;
  a = 30;
  fib(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1e,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
call   1030 <fib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 30, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @fib(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fib(i32 30)
ret i32 0
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructModuleName(struct constructHeader *);
const char *EnvDefinstancesModule(void *theEnv, void *theDefinstances) {
  return GetConstructModuleName((struct constructHeader *)theDefinstances);
}


x86 assembly (clang, -O0):
<EnvDefinstancesModule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <GetConstructModuleName@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnvDefinstancesModule>:
mov    %rsi,%rdi
jmp    1030 <GetConstructModuleName@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvDefinstancesModule(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.constructHeader*
%7 = call i8* @GetConstructModuleName(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvDefinstancesModule(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructModuleName(%struct.constructHeader* %3)
ret i8* %4
}
/* Variables and functions */
bool is_identifier_start(char c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_'));
}


x86 assembly (clang, -O0):
<is_identifier_start>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_identifier_start+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_identifier_start+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <is_identifier_start+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_identifier_start+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_identifier_start>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_identifier_start(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %6
%23 = phi i1 [ true, %14 ], [ true, %6 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_identifier_start(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int add(char *);
bool add_test_variable_length_delimiter() {
  if (add("//[zzap]\n3,5zzap1") == 9)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<add_test_variable_length_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <add@plt>
cmp    $0x9,%eax
jne    1139 <add_test_variable_length_delimiter+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <add_test_variable_length_delimiter+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_test_variable_length_delimiter>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x9,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"//[zzap]\0A3,5zzap1\00"
define i32 @add_test_variable_length_delimiter() {
%1 = alloca i32
%2 = call i32 @add(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 9
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [18 x i8] c"//[zzap]\0A3,5zzap1\00"
define i32 @add_test_variable_length_delimiter() {
%1 = tail call i32 @add(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int sum(int, int);
void main() {
  int a = 10;
  int b = 0;
  int result = sum(a, b);
  if (result == a + b) {
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    115c <main+0x3c>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
xor    %esi,%esi
call   1030 <sum@plt>
cmp    $0xa,%eax
jne    113a <main+0x1a>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__VERIFIER_error@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @sum(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (...) @__VERIFIER_error()
br label %14
14: ; preds = %12, %0
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @sum(i32 10, i32 0)
%2 = icmp eq i32 %1, 10
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(char **, char **);
int main() {
  char a[2][2];
  a[0][0] = 'a';
  a[0][1] = 'b';
  a[1][0] = 'g';
  a[1][1] = 'b';
  f(&a[0], &a[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x4(%rbp)
movb   $0x62,-0x3(%rbp)
movb   $0x67,-0x2(%rbp)
movb   $0x62,-0x1(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x4(%rbp),%rsi
add    $0x2,%rsi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x62676261,0x4(%rsp)
62
lea    0x6(%rsp),%rsi
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x [2 x i8]]
%2 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 98, i8* %5
%6 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
store i8 103, i8* %7
%8 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 1
store i8 98, i8* %9
%10 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0
%11 = bitcast [2 x i8]* %10 to i8**
%12 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%13 = bitcast [2 x i8]* %12 to i8**
%14 = call i32 @f(i8** %11, i8** %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x [2 x i8]]
%2 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0, i64 0
store i8 97, i8* %2
%3 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0, i64 1
store i8 98, i8* %3
%4 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 103, i8* %5
%6 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1, i64 1
store i8 98, i8* %6
%7 = bitcast [2 x [2 x i8]]* %1 to i8**
%8 = bitcast [2 x i8]* %4 to i8**
%9 = call i32 @f(i8** %7, i8** %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quociresto(int, int, int *, int *);
int soma(int n) {
  int sum = 0;
  while (n) {
    int resto;
    quociresto(n, 10, &n, &resto);
    sum += resto;
  }
  return sum;
}


x86 assembly (clang, -O0):
<soma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114f <soma+0x3f>
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
lea    -0x4(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <quociresto@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <soma+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x8(%rsp)
xor    %ebx,%ebx
test   %edi,%edi
je     114c <soma+0x3c>
lea    0x8(%rsp),%r14
lea    0xc(%rsp),%r15
nopl   (%rax)
mov    $0xa,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <quociresto@plt>
add    0xc(%rsp),%ebx
mov    0x8(%rsp),%edi
test   %edi,%edi
jne    1130 <soma+0x20>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @soma(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 @quociresto(i32 %9, i32 10, i32* %2, i32* %4)
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
br label %5
14: ; preds = %5
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @soma(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = icmp eq i32 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = bitcast i32* %3 to i8*
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ 0, %5 ], [ %12, %7 ]
%9 = phi i32 [ %0, %5 ], [ %13, %7 ]
%10 = call i32 @quociresto(i32 %9, i32 10, i32* %2, i32* %3)
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %8
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %1
%16 = phi i32 [ 0, %1 ], [ %12, %7 ]
ret i32 %16
}
int isContinuation(unsigned char c) { return c >= 128 && c < 192; }


x86 assembly (clang, -O0):
<isContinuation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x80,%ecx
mov    %al,-0x2(%rbp)
jl     112e <isContinuation+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0xc0,%eax
setl   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isContinuation>:
xor    %eax,%eax
cmp    $0xc0,%dil
setl   %al
ret

LLVM IR (-O0):
define i32 @isContinuation(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 128
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 192
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isContinuation(i8 zeroext %0) {
%2 = icmp slt i8 %0, -64
%3 = zext i1 %2 to i32
ret i32 %3
}
int null_getch(struct riku_devfs_node *self, char *c) {
  *c = 0x0;
  return 0;
}


x86 assembly (clang, -O0):
<null_getch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_getch>:
movb   $0x0,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.riku_devfs_node = type opaque
define i32 @null_getch(%struct.riku_devfs_node* %0, i8* %1) {
%3 = alloca %struct.riku_devfs_node*
%4 = alloca i8*
store %struct.riku_devfs_node* %0, %struct.riku_devfs_node** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8 0, i8* %5
ret i32 0
}

LLVM IR (-O2):
%struct.riku_devfs_node = type opaque
define i32 @null_getch(%struct.riku_devfs_node* nocapture readnone %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ popdev();
void popdev_() { popdev(); }


x86 assembly (clang, -O0):
<popdev_>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <popdev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<popdev_>:
xor    %eax,%eax
jmp    1030 <popdev@plt>

LLVM IR (-O0):
define void @popdev_() {
%1 = call i32 (...) @popdev()
ret void
}

LLVM IR (-O2):
define void @popdev_() {
%1 = tail call i32 (...) @popdev()
ret void
}
int udev_queue_export_device_queued(struct udev_queue *udev_queue,
                                    struct udev_device *udev_device) {
  return -1;
}


x86 assembly (clang, -O0):
<udev_queue_export_device_queued>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_queue_export_device_queued>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.udev_queue = type opaque
%struct.udev_device = type opaque
define i32 @udev_queue_export_device_queued(%struct.udev_queue* %0, %struct.udev_device* %1) {
%3 = alloca %struct.udev_queue*
%4 = alloca %struct.udev_device*
store %struct.udev_queue* %0, %struct.udev_queue** %3
store %struct.udev_device* %1, %struct.udev_device** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.udev_queue = type opaque
%struct.udev_device = type opaque
define i32 @udev_queue_export_device_queued(%struct.udev_queue* nocapture readnone %0, %struct.udev_device* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ screen_get_fullscreen();
int /*<<< orphan*/ screen_set_fullscreen(int);
void screen_toggle_fullscreen(void) {
  screen_set_fullscreen(!screen_get_fullscreen());
}


x86 assembly (clang, -O0):
<screen_toggle_fullscreen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <screen_get_fullscreen@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <screen_set_fullscreen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_toggle_fullscreen>:
push   %rax
xor    %eax,%eax
call   1040 <screen_get_fullscreen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <screen_set_fullscreen@plt>

LLVM IR (-O0):
define void @screen_toggle_fullscreen() {
%1 = call i32 (...) @screen_get_fullscreen()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
%5 = call i32 @screen_set_fullscreen(i32 %4)
ret void
}

LLVM IR (-O2):
define void @screen_toggle_fullscreen() {
%1 = tail call i32 (...) @screen_get_fullscreen()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @screen_set_fullscreen(i32 %3)
ret void
}
int hputi4(hstring, keyword, ival)
char *hstring;
char *keyword;
int ival;
{
  char value[30];
  sprintf(value, "%d", ival);
  return (hputc(hstring, keyword, value));
}


x86 assembly (clang, -O0):
<hputi4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1030 <hputc@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputi4>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <hputc@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @hputi4(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [30 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%14 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputc to i32 (i8*, i8*, i8*, ...)*)(i8* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @hputi4(i8* %0, i8* %1, i32 %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputc to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void a(char *s) { write(1, s, strlen(s)); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @a(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @a(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
int main() {
  int a = 0;
  int b = 0;
  if (a == 0) {
    b = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112a <main+0x2a>
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %3
br label %7
7: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct dbt {
  int dummy;
};

/* Variables and functions */
struct dbt *dbtgetnxt(struct dbt *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tlistt(struct dbt *);
void tlist() {
  struct dbt *dt = NULL;
  printf("[tlist]\n");
  while ((dt = dbtgetnxt(dt)))
    tlistt(dt);
}


x86 assembly (clang, -O0):
<tlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <dbtgetnxt@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1171 <tlist+0x41>
mov    -0x8(%rbp),%rdi
call   1050 <tlistt@plt>
jmp    114c <tlist+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlist>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <dbtgetnxt@plt>
test   %rax,%rax
je     1168 <tlist+0x38>
mov    %rax,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <tlistt@plt>
mov    %rbx,%rdi
call   1040 <dbtgetnxt@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <tlist+0x20>
pop    %rbx
ret

LLVM IR (-O0):
%struct.dbt = type { i32 }
@.str = [9 x i8] c"[tlist]\0A\00"
define void @tlist() {
%1 = alloca %struct.dbt*
store %struct.dbt* null, %struct.dbt** %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %7, %0
%4 = load %struct.dbt*, %struct.dbt** %1
%5 = call %struct.dbt* @dbtgetnxt(%struct.dbt* %4)
store %struct.dbt* %5, %struct.dbt** %1
%6 = icmp ne %struct.dbt* %5, null
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load %struct.dbt*, %struct.dbt** %1
%9 = call i32 @tlistt(%struct.dbt* %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.dbt = type { i32 }
@str = [8 x i8] c"[tlist]\00"
define void @tlist() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call %struct.dbt* @dbtgetnxt(%struct.dbt* null)
%3 = icmp eq %struct.dbt* %2, null
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = phi %struct.dbt* [ %7, %4 ], [ %2, %0 ]
%6 = tail call i32 @tlistt(%struct.dbt* %5)
%7 = tail call %struct.dbt* @dbtgetnxt(%struct.dbt* %5)
%8 = icmp eq %struct.dbt* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int titleToNumber(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "Usage: ./test ABC\n");
    exit(-1);
  }
  printf("%d\n", titleToNumber(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <titleToNumber@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1161 <main+0x21>
mov    0x8(%rsi),%rdi
call   1050 <titleToNumber@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Usage: ./test ABC\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @titleToNumber(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Usage: ./test ABC\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @titleToNumber(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int number = 0;
  printf(" The number is %d\n", number);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c" The number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c" The number is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ numeric(unsigned char const *, int const, int /*<<< orphan*/, int,
                   int, int *, int *, char *);
int n1__10(const unsigned char *data, const int data_len, int *p_err_no,
           int *p_err_posn, char err_msg[50]) {
  return data_len >= 1 && data_len <= 10 &&
         numeric(data, data_len, 0, 1, 10, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<n1__10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jl     1181 <n1__10+0x71>
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jg     1181 <n1__10+0x71>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <numeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n1__10>:
mov    %rcx,%r10
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
ja     114d <n1__10+0x3d>
push   %rax
mov    %r8,%r11
mov    %rdx,%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
push   %r11
push   %r10
call   1030 <numeric@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @n1__10(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp sle i32 %14, 10
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i32*, i32** %8
%20 = load i32*, i32** %9
%21 = load i8*, i8** %10
%22 = call i64 @numeric(i8* %17, i32 %18, i32 0, i32 1, i32 10, i32* %19, i32* %20, i8* %21)
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %16, %13, %5
%25 = phi i1 [ false, %13 ], [ false, %5 ], [ %23, %16 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @n1__10(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @numeric(i8* %0, i32 %1, i32 0, i32 1, i32 10, i32* %2, i32* %3, i8* %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
bool sancus_get_frzd(ssize_t v, ssize_t a, ssize_t b, double *out) {
  if ((v >= a) && (v <= b)) {
    if (out != NULL)
      *out = (double)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_frzd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1155 <sancus_get_frzd+0x55>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     1155 <sancus_get_frzd+0x55>
cmpq   $0x0,-0x28(%rbp)
je     1149 <sancus_get_frzd+0x49>
cvtsi2sdq -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115c <sancus_get_frzd+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_frzd>:
xor    %eax,%eax
cmp    %rsi,%rdi
jl     111f <sancus_get_frzd+0x1f>
cmp    %rdx,%rdi
jg     111f <sancus_get_frzd+0x1f>
mov    $0x1,%eax
test   %rcx,%rcx
je     111f <sancus_get_frzd+0x1f>
cvtsi2sd %rdi,%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define i32 @sancus_get_frzd(i64 %0, i64 %1, i64 %2, double* %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca double*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store double* %3, double** %9
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = icmp sge i64 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %4
%14 = load i64, i64* %6
%15 = load i64, i64* %8
%16 = icmp sle i64 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load double*, double** %9
%19 = icmp ne double* %18, null
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i64, i64* %6
%22 = sitofp i64 %21 to double
%23 = load double*, double** %9
store double %22, double* %23
br label %24
24: ; preds = %20, %17
store i32 1, i32* %5
br label %26
25: ; preds = %13, %4
store i32 0, i32* %5
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @sancus_get_frzd(i64 %0, i64 %1, i64 %2, double* writeonly %3) {
%5 = icmp slt i64 %0, %1
%6 = icmp sgt i64 %0, %2
%7 = or i1 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = icmp eq double* %3, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = sitofp i64 %0 to double
store double %11, double* %3
br label %12
12: ; preds = %4, %8, %10
%13 = phi i32 [ 1, %10 ], [ 1, %8 ], [ 0, %4 ]
ret i32 %13
}
dtlogin(argc, argv) int argc;
char *argv[];
{ main(argc, argv); }


x86 assembly (clang, -O0):
<dtlogin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <main@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtlogin>:
xor    %eax,%eax
jmp    1030 <main@plt>

LLVM IR (-O0):
define i32 @dtlogin(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %6, i8** %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dtlogin(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
ret i32 undef
}
/* Variables and functions */
size_t FAT_parse_directory_last(const char *directory, size_t dirlen) {
  while (directory[--dirlen] != '\\') {
    if (!dirlen)
      break;
  }
  return dirlen;
}


x86 assembly (clang, -O0):
<FAT_parse_directory_last>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
movsbl -0x1(%rax,%rcx,1),%eax
cmp    $0x5c,%eax
je     1142 <FAT_parse_directory_last+0x42>
cmpq   $0x0,-0x10(%rbp)
jne    113d <FAT_parse_directory_last+0x3d>
jmp    1142 <FAT_parse_directory_last+0x42>
jmp    110c <FAT_parse_directory_last+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FAT_parse_directory_last>:
lea    -0x1(%rsi),%rax
cmpb   $0x5c,-0x1(%rdi,%rsi,1)
je     1114 <FAT_parse_directory_last+0x14>
cmp    $0x1,%rsi
mov    %rax,%rsi
jne    1100 <FAT_parse_directory_last>
ret

LLVM IR (-O0):
define i64 @FAT_parse_directory_last(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %17, %2
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = add i64 %7, -1
store i64 %8, i64* %4
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 92
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i64, i64* %4
%15 = icmp ne i64 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %13
br label %18
17: ; preds = %13
br label %5
18: ; preds = %16, %5
%19 = load i64, i64* %4
ret i64 %19
}

LLVM IR (-O2):
define i64 @FAT_parse_directory_last(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %1, %2 ], [ %5, %3 ]
%5 = add i64 %4, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 92
%9 = icmp ne i64 %5, 0
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main() {
  int p;
  for (p = 1; p <= 10, --p; p = p + 2)
    puts("Hello");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1152 <main+0x42>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 10
%6 = zext i1 %5 to i32
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 2
store i32 %14, i32* %2
br label %3
15: ; preds = %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}