xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
main() {
  FILE *fp;
  fp = fopen("prog1.c", "r");
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"prog1.c\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"prog1.c\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
void authnone_destroy(AUTH *auth) {}


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

x86 assembly (clang, -O2):
<authnone_destroy>:
ret

LLVM IR (-O0):
define void @authnone_destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}

LLVM IR (-O2):
define void @authnone_destroy(i32* nocapture %0) {
ret void
}
/* Variables and functions */
char *alloca(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdupa(const char *s) {
  char *d = alloca(strlen(s) + 1);
  if (s && d)
    strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<strdupa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <alloca@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1178 <strdupa+0x48>
cmpq   $0x0,-0x10(%rbp)
je     1178 <strdupa+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupa>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <alloca@plt>
mov    %rax,%rbx
test   %r14,%r14
je     115d <strdupa+0x2d>
test   %rbx,%rbx
je     115d <strdupa+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdupa(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @alloca(i64 %3)
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %4, null
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %10
10: ; preds = %8, %1
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
void readrestofline(FILE **infile) {
  int c;
  while ((c = getc(*infile)) != '\n')
    ;
  return;
}


x86 assembly (clang, -O0):
<readrestofline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1139 <readrestofline+0x29>
jmp    111c <readrestofline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readrestofline>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
jne    1120 <readrestofline+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @readrestofline(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
br label %4
4: ; preds = %9, %1
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %3
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @readrestofline(i32** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32*, i32** %0
%4 = tail call i32 @getc(i32* %3)
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_ClearTXDone(int);
void i2c1_ClearTXDone(void) { i2c_ClearTXDone(1); }


x86 assembly (clang, -O0):
<i2c1_ClearTXDone>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <i2c_ClearTXDone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_ClearTXDone>:
mov    $0x1,%edi
jmp    1030 <i2c_ClearTXDone@plt>

LLVM IR (-O0):
define void @i2c1_ClearTXDone() {
%1 = call i32 @i2c_ClearTXDone(i32 1)
ret void
}

LLVM IR (-O2):
define void @i2c1_ClearTXDone() {
%1 = tail call i32 @i2c_ClearTXDone(i32 1)
ret void
}
/* Variables and functions */
unsigned int f18(unsigned int);
unsigned int f19(unsigned int a) { return f18(f18(a)); }


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

x86 assembly (clang, -O2):
<f19>:
push   %rax
call   1030 <f18@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f18@plt>

LLVM IR (-O0):
define i32 @f19(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f18(i32 %3)
%5 = call i32 @f18(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @f19(i32 %0) {
%2 = tail call i32 @f18(i32 %0)
%3 = tail call i32 @f18(i32 %2)
ret i32 %3
}
void XkbSetNamedIndicator() {}


x86 assembly (clang, -O0):
<XkbSetNamedIndicator>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XkbSetNamedIndicator>:
ret

LLVM IR (-O0):
define void @XkbSetNamedIndicator() {
ret void
}

LLVM IR (-O2):
define void @XkbSetNamedIndicator() {
ret void
}
unsigned long r_charlow(unsigned long c) {
  return (((c) >= 'A' && (c) <= 'Z') ? (c) + ('a' - 'A') : (c));
}


x86 assembly (clang, -O0):
<r_charlow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x41,-0x8(%rbp)
jb     112f <r_charlow+0x2f>
cmpq   $0x5a,-0x8(%rbp)
ja     112f <r_charlow+0x2f>
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <r_charlow+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_charlow>:
lea    -0x41(%rdi),%rcx
lea    0x20(%rdi),%rax
cmp    $0x1a,%rcx
cmovae %rdi,%rax
ret

LLVM IR (-O0):
define i64 @r_charlow(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ule i64 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i64, i64* %2
%10 = add i64 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i64, i64* %2
br label %13
13: ; preds = %11, %8
%14 = phi i64 [ %10, %8 ], [ %12, %11 ]
ret i64 %14
}

LLVM IR (-O2):
define i64 @r_charlow(i64 %0) {
%2 = add i64 %0, -65
%3 = icmp ult i64 %2, 26
%4 = add i64 %0, 32
%5 = select i1 %3, i64 %4, i64 %0
ret i64 %5
}
char *my_cutoff(char *dst, char *src, int begin, int end) { return dst; }


x86 assembly (clang, -O0):
<my_cutoff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_cutoff>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @my_cutoff(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @my_cutoff(i8* readnone returned %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i8* %0
}
unsigned int *reg_range(unsigned int *cmd, unsigned int start,
                        unsigned int end) {
  *cmd++ = ((0x4 << 16) | (((unsigned int)((start) - (0x2000)))));
  *cmd++ = end - start + 1;
  return cmd;
}


x86 assembly (clang, -O0):
<reg_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x2000,%ecx
or     $0x40000,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_range>:
lea    -0x2000(%rsi),%eax
or     $0x40000,%eax
mov    %eax,(%rdi)
sub    %esi,%edx
add    $0x1,%edx
mov    %edx,0x4(%rdi)
lea    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @reg_range(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = sub i32 %7, 8192
%9 = or i32 262144, %8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub i32 %12, %13
%15 = add i32 %14, 1
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %4
store i32 %15, i32* %16
%18 = load i32*, i32** %4
ret i32* %18
}

LLVM IR (-O2):
define i32* @reg_range(i32* writeonly %0, i32 %1, i32 %2) {
%4 = add i32 %1, -8192
%5 = or i32 %4, 262144
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %0
%7 = sub i32 1, %1
%8 = add i32 %7, %2
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %6
ret i32* %9
}
void quick3sort(long *array, int length) {}


x86 assembly (clang, -O0):
<quick3sort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick3sort>:
ret

LLVM IR (-O0):
define void @quick3sort(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @quick3sort(i64* nocapture %0, i32 %1) {
ret void
}
letter(c) register c;
{ return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_'); }


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <letter+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1143 <letter+0x43>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <letter+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1143 <letter+0x43>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @letter(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = icmp eq i32 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
void hash_delete(struct hash_s *table, const char *key) {}


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

x86 assembly (clang, -O2):
<hash_delete>:
ret

LLVM IR (-O0):
%struct.hash_s = type opaque
define void @hash_delete(%struct.hash_s* %0, i8* %1) {
%3 = alloca %struct.hash_s*
%4 = alloca i8*
store %struct.hash_s* %0, %struct.hash_s** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.hash_s = type opaque
define void @hash_delete(%struct.hash_s* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ get_stat_mtime_ns(struct stat const *);
struct timespec get_stat_mtime(struct stat const *st) {
  struct timespec t;
  t.tv_sec = st->st_mtime;
  t.tv_nsec = get_stat_mtime_ns(st);
  return t;
}


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

x86 assembly (clang, -O2):
<get_stat_mtime>:
push   %rbx
mov    (%rdi),%ebx
call   1030 <get_stat_mtime_ns@plt>
shl    $0x20,%rbx
mov    %eax,%eax
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.timespec = type { i32, i32 }
define i64 @get_stat_mtime(%struct.stat* %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %3
%4 = load %struct.stat*, %struct.stat** %3
%5 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %6, i32* %7
%8 = load %struct.stat*, %struct.stat** %3
%9 = call i32 @get_stat_mtime_ns(%struct.stat* %8)
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %9, i32* %10
%11 = bitcast %struct.timespec* %2 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @get_stat_mtime(%struct.stat* %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @get_stat_mtime_ns(%struct.stat* %0)
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %4 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Type definitions */
typedef char *uid_t;

/* Variables and functions */
uid_t getuid(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(24));
  do {
    return (uid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<getuid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuid>:
mov    $0x18,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @getuid() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 24)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @getuid() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 24)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
int WpeExpArrayGetSize(void *exp_array) {
  int *real_array;
  real_array = ((int *)exp_array) - 4;
  return (*(real_array + 3));
}


x86 assembly (clang, -O0):
<WpeExpArrayGetSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WpeExpArrayGetSize>:
mov    -0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @WpeExpArrayGetSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 -4
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @WpeExpArrayGetSize(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
void testaddd_(double *z, double *x, double *y) { *z = *x + *y; }


x86 assembly (clang, -O0):
<testaddd_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testaddd_>:
movsd  (%rsi),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @testaddd_(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @testaddd_(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read_FP_BE(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
size_t int16ReadFromFP(FILE *fp, int16_t *data) {
  return read_FP_BE(fp, data, sizeof(int16_t));
}


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

x86 assembly (clang, -O2):
<int16ReadFromFP>:
mov    $0x4,%edx
jmp    1030 <read_FP_BE@plt>

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

LLVM IR (-O2):
define i64 @int16ReadFromFP(i32* %0, i32* %1) {
%3 = tail call i64 @read_FP_BE(i32* %0, i32* %1, i32 4)
ret i64 %3
}
void rop3_166_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_166_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_166_0_0>:
not    %dl
and    %sil,%dl
xor    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_166_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_166_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = and i8 %4, %1
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
store i8 %7, i8* %0
ret void
}
int foo() { return 4 + 5 + 6; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 15
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 15
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int main_test() {
  int x = 0;
  int y = 0;
  int z = 0;
  int w = 0;
  while (__VERIFIER_nondet_int()) {
    if (0) {
      x++;
      y = y + 100;
    } else if (0) {
      if (x >= 4) {
        x = x + 1;
        y = y + 1;
      }
    } else if (y > 10 * w)
      if (z >= 100 * x) {
        y = -y;
      }
    w = w + 1;
    z = z + 10;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1187 <main_test+0x77>
mov    -0x8(%rbp),%eax
imul   $0xa,-0x10(%rbp),%ecx
cmp    %ecx,%eax
jle    1170 <main_test+0x60>
mov    -0xc(%rbp),%eax
imul   $0x64,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jl     116b <main_test+0x5b>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1170 <main_test+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main_test+0x24>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_test>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    1120 <main_test+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %22, %0
%6 = call i64 (...) @__VERIFIER_nondet_int()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = mul nsw i32 10, %10
%12 = icmp sgt i32 %9, %11
br i1 %12, label %13, label %22
13: ; preds = %8
%14 = load i32, i32* %3
%15 = load i32, i32* %1
%16 = mul nsw i32 100, %15
%17 = icmp sge i32 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %2
%20 = sub nsw i32 0, %19
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %13
br label %22
22: ; preds = %21, %8
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 10
store i32 %26, i32* %3
br label %5
27: ; preds = %5
ret i32 1
}

LLVM IR (-O2):
define i32 @main_test() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ report(int);
void fail(char *file, int line) {
  printf("Test failed in %s:%i\n", file, line);
  report(0xeeeeeeee);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Test failed in %s:%i\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @report(i32 -286331154)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Test failed in %s:%i\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @report(i32 -286331154)
%5 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  signed char a = 1;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
scalar_t__ ParentTerritoryOf(int);
int isSubdivision(int ccode) { return (ParentTerritoryOf(ccode) >= 0); }


x86 assembly (clang, -O0):
<isSubdivision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ParentTerritoryOf@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSubdivision>:
push   %rax
call   1030 <ParentTerritoryOf@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isSubdivision(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ParentTerritoryOf(i32 %3)
%5 = icmp sge i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isSubdivision(i32 %0) {
%2 = tail call i64 @ParentTerritoryOf(i32 %0)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
%5 = xor i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Hunk_Free(void *base) {
  if (base)
    free(base);
}


x86 assembly (clang, -O0):
<Hunk_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <Hunk_Free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hunk_Free>:
test   %rdi,%rdi
je     111a <Hunk_Free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @Hunk_Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @Hunk_Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void advertisingStartedCallback(void) {
  printf("\r\nAdv: M O D E");
  return;
}


x86 assembly (clang, -O0):
<advertisingStartedCallback>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<advertisingStartedCallback>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0D\0AAdv: M O D E\00"
define void @advertisingStartedCallback() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0D\0AAdv: M O D E\00"
define void @advertisingStartedCallback() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ADCProcessorTrigger(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000028))) |=
      ((ui32SequenceNum & 0xffff0000) | (1 << (ui32SequenceNum & 0xf)));
}


x86 assembly (clang, -O0):
<ADCProcessorTrigger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xffff0000,%edx
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%edx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCProcessorTrigger>:
mov    %esi,%eax
and    $0xffff0000,%eax
and    $0xf,%sil
bts    %esi,%eax
movslq %edi,%rcx
or     %eax,0x28(%rcx)
ret

LLVM IR (-O0):
define void @ADCProcessorTrigger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, -65536
%7 = load i32, i32* %4
%8 = and i32 %7, 15
%9 = shl i32 1, %8
%10 = or i32 %6, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 40
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = or i32 %15, %10
store volatile i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
define void @ADCProcessorTrigger(i32 %0, i32 %1) {
%3 = and i32 %1, -65536
%4 = and i32 %1, 15
%5 = shl nuw nsw i32 1, %4
%6 = or i32 %5, %3
%7 = add nsw i32 %0, 40
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, %6
store volatile i32 %11, i32* %9
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put32(uint8_t *buf, uint32_t val) {
  buf[0] = val >> 24;
  buf[1] = val >> 16;
  buf[2] = val >> 8;
  buf[3] = val;
}


x86 assembly (clang, -O0):
<put32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @put32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @put32(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
store i32 %3, i32* %0
%4 = ashr i32 %1, 16
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = ashr i32 %1, 8
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
#define STDIN_FILENO 128
int /*<<< orphan*/ errno;
int _read(int file, char *ptr, int len) {
  int num = 0;
  len = len;
  file = file;
  ptr = ptr;
  switch (file) {
  case STDIN_FILENO:
    break;
  default:
    errno = EBADF;
    return -1;
  }
  return num;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
jne    112d <_read+0x2d>
jmp    1128 <_read+0x28>
jmp    114b <_read+0x4b>
mov    0x2ea4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea3(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <_read+0x51>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
xor    %eax,%eax
cmp    $0x80,%edi
je     1121 <_read+0x21>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    0x2ec6(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %7
store i32 %9, i32* %7
%10 = load i32, i32* %5
store i32 %10, i32* %5
%11 = load i8*, i8** %6
store i8* %11, i8** %6
%12 = load i32, i32* %5
switch i32 %12, label %14 [
i32 128, label %13
]
13: ; preds = %3
br label %16
14: ; preds = %3
%15 = load i32, i32* @EBADF
store i32 %15, i32* @errno
store i32 -1, i32* %4
br label %18
16: ; preds = %13
%17 = load i32, i32* %8
store i32 %17, i32* %4
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 128
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = load i32, i32* @EBADF
store i32 %6, i32* @errno
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ -1, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
double exp(double);
int q3(int dbo) {
  double a = 102.6, b = -0.01101, q3;
  q3 = a * exp(b * dbo);
}


x86 assembly (clang, -O0):
<q3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q3>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
ucomisd 0xee3(%rip),%xmm0
ja     1137 <q3+0x27>
movsd  0xee1(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1137 <q3+0x27>
pop    %rcx
ret
call   1030 <exp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @q3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %3
store double 1.026000e+02, double* %4
store double -1.101000e-02, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
%12 = call double @exp(double %11)
%13 = fmul double %7, %12
store double %13, double* %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @q3(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, -1.101000e-02
%4 = fcmp olt double %3, -7.450000e+02
%5 = fcmp ogt double %3, 7.090000e+02
%6 = or i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call double @exp(double %3)
br label %9
9: ; preds = %1, %7
ret i32 undef
}
int tegra_irq_to_wake(int irq) { return 0; }


x86 assembly (clang, -O0):
<tegra_irq_to_wake>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tegra_irq_to_wake(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @tegra_irq_to_wake(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int isalpha(int);
int iswalpha(wint_t c) { return c <= 255 ? isalpha(c) : 0; }


x86 assembly (clang, -O0):
<iswalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1138 <iswalpha+0x28>
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %eax,-0x8(%rbp)
jmp    1142 <iswalpha+0x32>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <iswalpha+0x32>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswalpha>:
cmp    $0xff,%edi
jg     111d <iswalpha+0xd>
jmp    1030 <isalpha@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 255
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @isalpha(i32 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iswalpha(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @isalpha(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
__attribute__((const)) int av_clip(int a, int amin, int amax) {
  if (a < amin)
    return amin;
  else if (a > amax)
    return amax;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <av_clip+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <av_clip+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <av_clip+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <av_clip+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clip>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @av_clip(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %6
store i32 %12, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %21
19: ; preds = %13
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @av_clip(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
void set_a(int x) {
  int abc[3];
  abc[0] = x;
}


x86 assembly (clang, -O0):
<set_a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_a>:
ret

LLVM IR (-O0):
define void @set_a(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 %4, i32* %5
ret void
}

LLVM IR (-O2):
define void @set_a(i32 %0) {
ret void
}
/* Variables and functions */
int FP_Cmp(float, float);
int __lesf2(float a, float b) { return FP_Cmp(a, b); }


x86 assembly (clang, -O0):
<__lesf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <FP_Cmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lesf2>:
jmp    1030 <FP_Cmp@plt>

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

LLVM IR (-O2):
define i32 @__lesf2(float %0, float %1) {
%3 = tail call i32 @FP_Cmp(float %0, float %1)
ret i32 %3
}
int test_imm_9Euint32_reg(unsigned int val) {
  return ((val) & (0x9E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Euint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x9e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Euint32_reg>:
test   $0x9e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Euint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 158
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_9Euint32_reg(i32 %0) {
%2 = and i32 %0, 158
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void tbfreem(void) {}


x86 assembly (clang, -O0):
<tbfreem>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbfreem>:
ret

LLVM IR (-O0):
define void @tbfreem() {
ret void
}

LLVM IR (-O2):
define void @tbfreem() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_PEEKDATA;
scalar_t__ errno;
int /*<<< orphan*/ fatal(char *);
long ptrace(int /*<<< orphan*/, int /*<<< orphan*/, long, int /*<<< orphan*/ *);
long peek_data(pid_t pid, long offset) {
  long data;
  data = ptrace(PTRACE_PEEKDATA, pid, offset, NULL);
  if (data == -1 && errno)
    fatal("PTRACE_PEEKDATA failed");
  return (data);
}


x86 assembly (clang, -O0):
<peek_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <ptrace@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    1174 <peek_data+0x54>
mov    0x2e82(%rip),%rax
cmpq   $0x0,(%rax)
je     1174 <peek_data+0x54>
lea    0xe91(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek_data>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
call   1030 <ptrace@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    1158 <peek_data+0x38>
mov    0x2e9a(%rip),%rax
cmpq   $0x0,(%rax)
je     1158 <peek_data+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@PTRACE_PEEKDATA = global i32 0
@errno = global i64 0
@.str = [23 x i8] c"PTRACE_PEEKDATA failed\00"
define i64 @peek_data(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* @PTRACE_PEEKDATA
%7 = load i32, i32* %3
%8 = load i64, i64* %4
%9 = call i64 @ptrace(i32 %6, i32 %7, i64 %8, i32* null)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = icmp eq i64 %10, -1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i64, i64* @errno
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %12, %2
%18 = load i64, i64* %5
ret i64 %18
}

LLVM IR (-O2):
@PTRACE_PEEKDATA = global i32 0
@errno = global i64 0
@.str = [23 x i8] c"PTRACE_PEEKDATA failed\00"
define i64 @peek_data(i32 %0, i64 %1) {
%3 = load i32, i32* @PTRACE_PEEKDATA
%4 = tail call i64 @ptrace(i32 %3, i32 %0, i64 %1, i32* null)
%5 = icmp eq i64 %4, -1
%6 = load i64, i64* @errno
%7 = icmp ne i64 %6, 0
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i64 %4
}
int isPowerOf2(int n) {
  while (n) {
    if (n & 1)
      break;
    n >>= 1;
  }
  return (1 == n ? 1 : 0);
}


x86 assembly (clang, -O0):
<isPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1133 <isPowerOf2+0x33>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1125 <isPowerOf2+0x25>
jmp    1133 <isPowerOf2+0x33>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <isPowerOf2+0x7>
mov    -0x4(%rbp),%edx
mov    $0x1,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOf2>:
mov    %edi,%ecx
test   %edi,%edi
je     1113 <isPowerOf2+0x13>
mov    %ecx,%eax
and    $0x1,%eax
mov    %ecx,%edi
sar    %edi
test   %eax,%eax
je     1100 <isPowerOf2>
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @isPowerOf2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %11, %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %14
11: ; preds = %6
%12 = load i32, i32* %2
%13 = ashr i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %10, %3
%15 = load i32, i32* %2
%16 = icmp eq i32 1, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
ret i32 %18
}

LLVM IR (-O2):
define i32 @isPowerOf2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %8, %2 ]
%4 = icmp ne i32 %3, 0
%5 = and i32 %3, 1
%6 = icmp eq i32 %5, 0
%7 = and i1 %4, %6
%8 = ashr i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
%10 = icmp eq i32 %3, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *);
void usage() {
  errAbort("safeTester - tests for safe* functions\n"
           "usage:\n"
           "   safeTester\n"
           "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <errAbort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <errAbort@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"safeTester - tests for safe* functions\0Ausage:\0A safeTester\0A\0A\00"
define void @usage() {
%1 = call i32 @errAbort(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"safeTester - tests for safe* functions\0Ausage:\0A safeTester\0A\0A\00"
define void @usage() {
%1 = tail call i32 @errAbort(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}
int rootlib() { return 100; }


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

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

LLVM IR (-O0):
define i32 @rootlib() {
ret i32 100
}

LLVM IR (-O2):
define i32 @rootlib() {
ret i32 100
}
void memleak_not_leak(const void *ptr) {}


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

x86 assembly (clang, -O2):
<memleak_not_leak>:
ret

LLVM IR (-O0):
define void @memleak_not_leak(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @memleak_not_leak(i8* nocapture %0) {
ret void
}