xunge/DecIR huggingface dataset:
unsigned ZopfliGetDistExtraBits(unsigned dist) {
  if (dist < 5)
    return 0;
  return (31 ^ __builtin_clz(dist - 1)) - 1;
}


x86 assembly (clang, -O0):
<ZopfliGetDistExtraBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jae    111d <ZopfliGetDistExtraBits+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1132 <ZopfliGetDistExtraBits+0x32>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
xor    $0x1f,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZopfliGetDistExtraBits>:
xor    %eax,%eax
cmp    $0x5,%edi
jb     1113 <ZopfliGetDistExtraBits+0x13>
add    $0xffffffff,%edi
bsr    %edi,%eax
xor    $0xffffffe0,%eax
add    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @ZopfliGetDistExtraBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub i32 %8, 1
%10 = call i32 @llvm.ctlz.i32(i32 %9, i1 true)
%11 = xor i32 31, %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @ZopfliGetDistExtraBits(i32 %0) {
%2 = icmp ult i32 %0, 5
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = tail call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%6 = sub nsw i32 30, %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
void RTUtf16DupTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16DupTag() {
ret void
}
/* Variables and functions */
double __lgamma_r(double, int *);
double lgamma(double x) {
  int sign;
  return __lgamma_r(x, &sign);
}


x86 assembly (clang, -O0):
<lgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
call   1030 <__lgamma_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgamma>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <__lgamma_r@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @lgamma(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call double @__lgamma_r(double %0, i32* %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int builtin_exit(int argc, char *argv[]) {
  if (argc != 1) {
    fprintf(stderr, "%s: too many arguments\n", argv[0]);
    return 1;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<builtin_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1160 <builtin_exit+0x40>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<builtin_exit>:
push   %rax
cmp    $0x1,%edi
je     1145 <builtin_exit+0x25>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"%s: too many arguments\0A\00"
define i32 @builtin_exit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 1
13: ; preds = %2
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"%s: too many arguments\0A\00"
define i32 @builtin_exit(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 1
8: ; preds = %2
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *_mktemp(char *, int /*<<< orphan*/, int /*<<< orphan*/ *,
              int /*<<< orphan*/);
scalar_t__ mkdir(char *, int);
char *mkdtemp(char *template) {
  char *rtn = _mktemp(template, 0, NULL, 0);
  if (rtn == NULL)
    return NULL;
  if (mkdir(template, 0700) != 0)
    return NULL;
  return template;
}


x86 assembly (clang, -O0):
<mkdtemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%edx
mov    %ecx,%esi
call   1040 <_mktemp@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <mkdtemp+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1186 <mkdtemp+0x66>
mov    -0x10(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     117e <mkdtemp+0x5e>
movq   $0x0,-0x8(%rbp)
jmp    1186 <mkdtemp+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdtemp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <_mktemp@plt>
test   %rax,%rax
je     114f <mkdtemp+0x2f>
mov    %r14,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
xor    %ebx,%ebx
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mkdtemp(i8* %0) {
%2 = tail call i8* @_mktemp(i8* %0, i32 0, i32* null, i32 0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @mkdir(i8* %0, i32 448)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* %0, i8* null
br label %8
8: ; preds = %4, %1
%9 = phi i8* [ null, %1 ], [ %7, %4 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ init_nbits();
void init_tables(void) { init_nbits(); }


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

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

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

LLVM IR (-O2):
define void @init_tables() {
%1 = tail call i32 (...) @init_nbits()
ret void
}
signed short v_signed_short_func() { return (0); }


x86 assembly (clang, -O0):
<v_signed_short_func>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @v_signed_short_func() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @v_signed_short_func() {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ print_tacos();
int /*<<< orphan*/ print_water();
int /*<<< orphan*/ printf(char *);
int main() {
  print_water();
  printf("and\n");
  print_tacos();
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <print_water@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <print_tacos@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [4 x i8] c"and\00"
define i32 @main() {
%1 = tail call i32 (...) @print_water()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @print_tacos()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_environment();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n");
  printf("<html><body>\n");
  printf("Hello CGI!<BR>\n");
  print_environment();
  printf("</body></html>\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_environment@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <print_environment@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"HTTP/1.1 200 OK\0D\0AContent-Type: text/html\0D\0A\0D\0A\00"
@.str.1 = [14 x i8] c"<html><body>\0A\00"
@.str.2 = [16 x i8] c"Hello CGI!<BR>\0A\00"
@.str.3 = [17 x i8] c"</body></html>\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (...) @print_environment()
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"HTTP/1.1 200 OK\0D\0AContent-Type: text/html\0D\0A\0D\00"
@str.4 = [13 x i8] c"<html><body>\00"
@str.5 = [15 x i8] c"Hello CGI!<BR>\00"
@str.6 = [16 x i8] c"</body></html>\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 (...) @print_environment()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
int main(int argc, char *argv[]) {
  char strings[3][10] = {"one", "two", "three"};
  int index = atoi(argv[1]);
  printf("strings[%i] = %s\n", index, strings[index]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rdx
imul   $0xa,%rax,%rax
add    %rax,%rdx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee3(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
movslq %eax,%rsi
lea    (%rsi,%rsi,4),%rax
lea    (%rsp,%rax,2),%rdx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.strings = [3 x [10 x i8]] [[10 x i8] c"one\00\00\00\00\00\00\00", [10 x i8] c"two\00\00\00\00\00\00\00", [10 x i8] c"three\00\00\00\00\00"]
@.str = [18 x i8] c"strings[%i] = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x [10 x i8]]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [3 x [10 x i8]]* %6 to i8*
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %6, i64 0, i64 %15
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %16, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.strings = [3 x [10 x i8]] [[10 x i8] c"one\00\00\00\00\00\00\00", [10 x i8] c"two\00\00\00\00\00\00\00", [10 x i8] c"three\00\00\00\00\00"]
@.str = [18 x i8] c"strings[%i] = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3 x [10 x i8]]
%4 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %3, i64 0, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %3, i64 0, i64 %8, i64 0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA256_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA256_DIGEST_LENGTH;
int /*<<< orphan*/ SHA256_Final(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA256_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA256_Update(int /*<<< orphan*/ *, unsigned char *, size_t);
scalar_t__ calloc(int /*<<< orphan*/, int);
unsigned char *get_sha256(const unsigned char *input, size_t length) {
  SHA256_CTX context;
  unsigned char *md = (unsigned char *)calloc(SHA256_DIGEST_LENGTH, 1);
  SHA256_Init(&context);
  SHA256_Update(&context, (unsigned char *)input, length);
  SHA256_Final(md, &context);
  return md;
}


x86 assembly (clang, -O0):
<get_sha256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <SHA256_Init@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rdi
call   1060 <SHA256_Update@plt>
mov    -0x20(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <SHA256_Final@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sha256>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1030 <SHA256_Init@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1060 <SHA256_Update@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <SHA256_Final@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SHA256_DIGEST_LENGTH = global i32 0
define i8* @get_sha256(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i32, i32* @SHA256_DIGEST_LENGTH
%8 = call i64 @calloc(i32 %7, i32 1)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = call i32 @SHA256_Init(i32* %5)
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @SHA256_Update(i32* %5, i8* %11, i64 %12)
%14 = load i8*, i8** %6
%15 = call i32 @SHA256_Final(i8* %14, i32* %5)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
@SHA256_DIGEST_LENGTH = global i32 0
define i8* @get_sha256(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @SHA256_DIGEST_LENGTH
%6 = tail call i64 @calloc(i32 %5, i32 1)
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @SHA256_Init(i32* %3)
%9 = call i32 @SHA256_Update(i32* %3, i8* %0, i64 %1)
%10 = call i32 @SHA256_Final(i8* %7, i32* %3)
ret i8* %7
}
/* Type definitions */
struct ibv_mr {
  int dummy;
};

/* Variables and functions */
int ibv_dereg_mr(struct ibv_mr *);
int zillians_ibv_dereg_mr(struct ibv_mr *mr) { return ibv_dereg_mr(mr); }


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

x86 assembly (clang, -O2):
<zillians_ibv_dereg_mr>:
jmp    1030 <ibv_dereg_mr@plt>

LLVM IR (-O0):
%struct.ibv_mr = type { i32 }
define i32 @zillians_ibv_dereg_mr(%struct.ibv_mr* %0) {
%2 = alloca %struct.ibv_mr*
store %struct.ibv_mr* %0, %struct.ibv_mr** %2
%3 = load %struct.ibv_mr*, %struct.ibv_mr** %2
%4 = call i32 @ibv_dereg_mr(%struct.ibv_mr* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.ibv_mr = type { i32 }
define i32 @zillians_ibv_dereg_mr(%struct.ibv_mr* %0) {
%2 = tail call i32 @ibv_dereg_mr(%struct.ibv_mr* %0)
ret i32 %2
}
float float_max1(float a, float b) { return ((a) > (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<float_max1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <float_max1+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <float_max1+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_max1>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @float_max1(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 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @float_max1(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int no_arg() {
  printf("You have to enter as last argument the device (like "
         "/dev/hidraw1)\nOperation argument:\n\t-b -> for beep\n\t-t -> sets "
         "time to localtime\n\t-u -> set Temp Unit (<f> or <c>) and Time Mode "
         "(<h> or <H>)\n\tExample: -u c H /dev/hidraw1\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [224 x i8] c"You have to enter as last argument the device (like /dev/hidraw1)\0AOperation argument:\0A\09-b -> for beep\0A\09-t -> sets time to localtime\0A\09-u -> set Temp Unit (<f> or <c>) and Time Mode (<h> or <H>)\0A\09Example: -u c H /dev/hidraw1\0A\00"
define i32 @no_arg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [223 x i8] c"You have to enter as last argument the device (like /dev/hidraw1)\0AOperation argument:\0A\09-b -> for beep\0A\09-t -> sets time to localtime\0A\09-u -> set Temp Unit (<f> or <c>) and Time Mode (<h> or <H>)\0A\09Example: -u c H /dev/hidraw1\00"
define i32 @no_arg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([223 x i8], [223 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print(char *str) {
  printf(str);
  return 0;
}


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

x86 assembly (clang, -O2):
<print>:
push   %rax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @print(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret i32 0
}
/* Variables and functions */
int strtol(char *, char **, int);
int processStream(char *string) {
  char *err = NULL;
  char cStream[2] = {(string[0]), '\0'};
  int stream = strtol(cStream, &err, 10);
  if (*err != '\0') {
    stream = -1;
  }
  return stream;
}


x86 assembly (clang, -O0):
<processStream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
lea    -0x12(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <processStream+0x4d>
movl   $0xffffffff,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processStream>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    (%rdi),%al
mov    %al,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xe(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x10(%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %ecx,%ecx
or     %ecx,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @processStream(i8* nocapture %0) {
%2 = alloca i8*
%3 = alloca [2 x i8]
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%6 = load i8, i8* %0
store i8 %6, i8* %5
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %7
%8 = call i32 @strtol(i8* %5, i8** %2, i32 10)
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = select i1 %11, i32 %8, i32 -1
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main() {
  test(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lir_close_serport();
void users_close_devices(void) { lir_close_serport(); }


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

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

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

LLVM IR (-O2):
define void @users_close_devices() {
%1 = tail call i32 (...) @lir_close_serport()
ret void
}
int square(int value) { return value * value; }


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

x86 assembly (clang, -O2):
<square>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
extern void libvamphostsdk_v_2_3_1_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvamphostsdk_v_2_3_1_present() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(double *arr, int n) {
  for (int i = 0; i < n; i++)
    printf("%lf,", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <print_arr+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1159 <print_arr+0x39>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf,\00"
define void @print_arr(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, z;
  x = 12;
  y = 0;
  z = __VERIFIER_nondet_int();
  while (z > 0) {
    x = x + 1;
    y = y - 1;
    z = z - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1161 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <main+0x27>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int __real_foo();
int /*<<< orphan*/ printf(char *);
int __wrap_foo(void) {
  printf("__wrap_foo()\n");
  return 5 + __real_foo();
}


x86 assembly (clang, -O0):
<__wrap_foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <__real_foo@plt>
add    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_foo>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <__real_foo@plt>
add    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"__wrap_foo()\0A\00"
define i32 @__wrap_foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @__real_foo()
%3 = add nsw i32 5, %2
ret i32 %3
}

LLVM IR (-O2):
@str = [13 x i8] c"__wrap_foo()\00"
define i32 @__wrap_foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @__real_foo()
%3 = add nsw i32 %2, 5
ret i32 %3
}
int tstat_init(char *config_fname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tstat_init(i8* nocapture readnone %0) {
ret i32 0
}
unsigned int hfi_mask(const struct hfinfo *hfi) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hfinfo = type opaque
define i32 @hfi_mask(%struct.hfinfo* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Sys_OpenURLInBrowser(char const *);
void CL_OpenURLInBrowser(const char *url) { Sys_OpenURLInBrowser(url); }


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

x86 assembly (clang, -O2):
<CL_OpenURLInBrowser>:
jmp    1030 <Sys_OpenURLInBrowser@plt>

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

LLVM IR (-O2):
define void @CL_OpenURLInBrowser(i8* %0) {
%2 = tail call i32 @Sys_OpenURLInBrowser(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main() { sleep(120); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @sleep(i32 120)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 120)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ recurse(int);
int main() {
  recurse(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @recurse(i32 1)
ret i32 0
}
/* Variables and functions */
void *fopen(char *, char *);
void *pc_opensrc(char *filename) { return fopen(filename, "rt"); }


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

x86 assembly (clang, -O2):
<pc_opensrc>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
define noalias i8* @pc_opensrc(i8* nocapture %0) {
%2 = tail call i8* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int rand_norm();
double rand_unif(double h) { return h * (2 * rand_norm() - 1); }


x86 assembly (clang, -O0):
<rand_unif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand_norm@plt>
movsd  -0x10(%rbp),%xmm0
shl    $0x1,%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_unif>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand_norm@plt>
add    %eax,%eax
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_unif(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (...) @rand_norm()
%5 = mul nsw i32 2, %4
%6 = sub nsw i32 %5, 1
%7 = sitofp i32 %6 to double
%8 = fmul double %3, %7
ret double %8
}

LLVM IR (-O2):
define double @rand_unif(double %0) {
%2 = tail call i32 (...) @rand_norm()
%3 = shl nsw i32 %2, 1
%4 = add nsw i32 %3, -1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: eventcap <device>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: eventcap <device>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: eventcap <device>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void ScaleARGBRowDown2_C() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ do_FocusIn(int /*<<< orphan*/ *);
void do_FocusOut(XEvent *eventp) { do_FocusIn(eventp); }


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

x86 assembly (clang, -O2):
<do_FocusOut>:
jmp    1030 <do_FocusIn@plt>

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

LLVM IR (-O2):
define void @do_FocusOut(i32* %0) {
%2 = tail call i32 @do_FocusIn(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *fn) {
  printf("Usage: %s <IP> <channel>\nChannel can be 1-4.\n", fn);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: %s <IP> <channel>\0AChannel can be 1-4.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: %s <IP> <channel>\0AChannel can be 1-4.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void noop_render(const char *to_render, void *data) {
  (void)data;
  (void)to_render;
}


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

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

LLVM IR (-O0):
define void @noop_render(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
ret void
}

LLVM IR (-O2):
define void @noop_render(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void systemcall_unaddressable_bytes() {
  char *buf = (char *)sizeof(50 * sizeof(char));
  printf("Please type a bunch of characters and hit enter.\n");
  read(0, buf, 1000);
  write(1, buf, 1000);
}


x86 assembly (clang, -O0):
<systemcall_unaddressable_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%eax
mov    %rax,-0x8(%rbp)
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
mov    $0x3e8,%edx
call   1050 <read@plt>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
mov    $0x3e8,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<systemcall_unaddressable_bytes>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%esi
xor    %edi,%edi
mov    $0x3e8,%edx
call   1050 <read@plt>
mov    $0x8,%esi
mov    $0x1,%edi
mov    $0x3e8,%edx
pop    %rax
jmp    1040 <write@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Please type a bunch of characters and hit enter.\0A\00"
define void @systemcall_unaddressable_bytes() {
%1 = alloca i8*
store i8* inttoptr (i64 8 to i8*), i8** %1
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
%4 = call i32 @read(i32 0, i8* %3, i32 1000)
%5 = load i8*, i8** %1
%6 = call i32 @write(i32 1, i8* %5, i32 1000)
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"Please type a bunch of characters and hit enter.\00"
define void @systemcall_unaddressable_bytes() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @read(i32 0, i8* inttoptr (i64 8 to i8*), i32 1000)
%3 = tail call i32 @write(i32 1, i8* inttoptr (i64 8 to i8*), i32 1000)
ret void
}
unsigned char e1(unsigned char a) { return a >> 5 | a << 3; }


x86 assembly (clang, -O0):
<e1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x5,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x3,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e1>:
mov    %edi,%eax
rol    $0x3,%al
ret

LLVM IR (-O0):
define zeroext i8 @e1(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 5
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 3
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @e1(i8 zeroext %0) {
%2 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 3)
ret i8 %2
}
/* Variables and functions */
char *strchr(const char *str, int ch) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
  char *ptr = str;
#pragma GCC diagnostic pop
  do {
    if (*ptr == (char)ch) {
      return ptr;
    }
  } while (*(ptr++) != '\0');
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1135 <strchr+0x35>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <strchr+0x5d>
jmp    113a <strchr+0x3a>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1113 <strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %dl,%dl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %0, %2 ], [ %11, %10 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %4, %8
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %5
13: ; preds = %10, %5
%14 = phi i8* [ %6, %5 ], [ null, %10 ]
ret i8* %14
}
void __stub1(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__stub1() {
ret void
}
int f8(unsigned x) {
  switch (x) {
  default:
    return 3;
  case 0xFFFFFFFF ... 1:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
]
5: ; preds = %1
store i32 3, i32* %2
br label %7
6: ; No predecessors!
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f8(i32 %0) {
ret i32 3
}