xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *message) {
  printf("%s", message);
  printf("usage: convert_text_to_bin -m in_modes.txt -o out_modes.bin -n "
         "number_of_modes -r rfile\n");
  exit(EXIT_FAILURE);
}


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
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [89 x i8] c"usage: convert_text_to_bin -m in_modes.txt -o out_modes.bin -n number_of_modes -r rfile\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EXIT_FAILURE = global i32 0
@str = [88 x i8] c"usage: convert_text_to_bin -m in_modes.txt -o out_modes.bin -n number_of_modes -r rfile\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
const char *logLevelStr(int level) {
  static const char *logLevelNames[] = {"debug", "info", "warning", "error",
                                        "fatal"};
  return logLevelNames[level - 1];
}


x86 assembly (clang, -O0):
<logLevelStr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2f19(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logLevelStr>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movslq -0x4(%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@logLevelStr.logLevelNames = internal global [5 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0)]
@.str = [6 x i8] c"debug\00"
@.str.1 = [5 x i8] c"info\00"
@.str.2 = [8 x i8] c"warning\00"
@.str.3 = [6 x i8] c"error\00"
@.str.4 = [6 x i8] c"fatal\00"
define i8* @logLevelStr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* @logLevelStr.logLevelNames, i64 0, i64 %5
%7 = load i8*, i8** %6
ret i8* %7
}

LLVM IR (-O2):
@reltable.logLevelStr = internal unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.logLevelStr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.logLevelStr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.logLevelStr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.logLevelStr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.logLevelStr to i64)) to i32)]
@.str = [6 x i8] c"debug\00"
@.str.1 = [5 x i8] c"info\00"
@.str.2 = [8 x i8] c"warning\00"
@.str.3 = [6 x i8] c"error\00"
@.str.4 = [6 x i8] c"fatal\00"
define i8* @logLevelStr(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sext i32 %2 to i64
%4 = shl i64 %3, 2
%5 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.logLevelStr to i8*), i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello World from {{ prefix }} !"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Hello World from {{ prefix }} !\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Hello World from {{ prefix }} !\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int mac(int a, int b, int c) { return a + b * c; }


x86 assembly (clang, -O0):
<mac>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @mac(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mac(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double fs_time() {
  struct timeval now;
  gettimeofday(&now, 0);
  return (double)now.tv_sec + (now.tv_usec * 0.000001);
}


x86 assembly (clang, -O0):
<fs_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @fs_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load double, double* %6
%8 = call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @fs_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %9
}
/* Variables and functions */
scalar_t__ memcmp(void const *, void const *, size_t);
bool binkey_eq(const void *key1, size_t key1_len, const void *key2,
               size_t key2_len) {
  return key1_len == key2_len && memcmp(key1, key2, key1_len) == 0;
}


x86 assembly (clang, -O0):
<binkey_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x20(%rbp),%rcx
mov    %al,-0x21(%rbp)
jne    1156 <binkey_eq+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binkey_eq>:
xor    %eax,%eax
cmp    %rcx,%rsi
jne    1135 <binkey_eq+0x25>
push   %rax
mov    %rsi,%r8
mov    %rdx,%rsi
mov    %r8,%rdx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @binkey_eq(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i64 @memcmp(i8* %0, i8* %2, i64 %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 0, %4 ], [ %9, %6 ]
ret i32 %11
}
void ds_log(int level, const char *file, int line, const char *func,
            const char *fmt, ...) {}


x86 assembly (clang, -O0):
<ds_log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ds_log(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4, ...) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @ds_log(i32 %0, i8* nocapture %1, i32 %2, i8* nocapture %3, i8* nocapture %4, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
int /*<<< orphan*/ tf1();
int /*<<< orphan*/ tf2();
void *workthread(void *param) {
  tf1();
  tf2();
  pthread_exit(param);
}


x86 assembly (clang, -O0):
<workthread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <tf1@plt>
mov    $0x0,%al
call   1050 <tf2@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workthread>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <tf1@plt>
xor    %eax,%eax
call   1050 <tf2@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @workthread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @tf1()
%5 = call i32 (...) @tf2()
%6 = load i8*, i8** %3
%7 = call i32 @pthread_exit(i8* %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @workthread(i8* %0) {
%2 = tail call i32 (...) @tf1()
%3 = tail call i32 (...) @tf2()
%4 = tail call i32 @pthread_exit(i8* %0)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
void g() { f(1, 2); }


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

x86 assembly (clang, -O2):
<g>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g() {
%1 = call i32 @f(i32 1, i32 2)
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 @f(i32 1, i32 2)
ret void
}
int test_imm_4Eint8_reg(signed char val) {
  return ((val) & (0x4E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Eint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x4e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Eint8_reg(i8 signext %0) {
%2 = and i8 %0, 78
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int fast_copy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 3) {
    printf("%s from to\n", argv[0]);
    return 1;
  }
  return -fast_copy(argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <fast_copy@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jg     113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <fast_copy@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s from to\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %14
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @fast_copy(i8* %9, i8* %11)
%13 = sub nsw i32 0, %12
br label %14
14: ; preds = %7, %4
%15 = phi i32 [ 1, %4 ], [ %13, %7 ]
ret i32 %15
}
void ASN1_TYPE_set1(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_TYPE_set1() {
ret void
}
/* Variables and functions */
float logf(float);
float BM25_idf(float df, float docN) {
  return logf((docN - df + 0.5f) / (df + 0.5f));
}


x86 assembly (clang, -O0):
<BM25_idf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xec0(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1030 <logf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BM25_idf>:
subss  %xmm0,%xmm1
movss  0xee4(%rip),%xmm2
addss  %xmm2,%xmm1
addss  %xmm2,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
jmp    1030 <logf@plt>

LLVM IR (-O0):
define float @BM25_idf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %5, %6
%8 = fadd float %7, 5.000000e-01
%9 = load float, float* %3
%10 = fadd float %9, 5.000000e-01
%11 = fdiv float %8, %10
%12 = call float @logf(float %11)
ret float %12
}

LLVM IR (-O2):
define float @BM25_idf(float %0, float %1) {
%3 = fsub float %1, %0
%4 = fadd float %3, 5.000000e-01
%5 = fadd float %0, 5.000000e-01
%6 = fdiv float %4, %5
%7 = tail call float @logf(float %6)
ret float %7
}
/* Variables and functions */
int diminuto_pin_port_generic(char const *, int, int /*<<< orphan*/);
int diminuto_pin_port(const char *format, int pin) {
  return diminuto_pin_port_generic(format, pin, 0);
}


x86 assembly (clang, -O0):
<diminuto_pin_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <diminuto_pin_port_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_pin_port>:
xor    %edx,%edx
jmp    1030 <diminuto_pin_port_generic@plt>

LLVM IR (-O0):
define i32 @diminuto_pin_port(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 @diminuto_pin_port_generic(i8* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @diminuto_pin_port(i8* %0, i32 %1) {
%3 = tail call i32 @diminuto_pin_port_generic(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
unsigned int iran32_r(unsigned int *, unsigned int *);
double fran32_r(unsigned *pstate0, unsigned *pstate1) {
  unsigned word = iran32_r(pstate0, pstate1);
  return (double)((double)word / (double)4294967296.0);
}


x86 assembly (clang, -O0):
<fran32_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <iran32_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fran32_r>:
push   %rax
call   1030 <iran32_r@plt>
mov    %eax,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fran32_r(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @iran32_r(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to double
%11 = fdiv double %10, 0x41F0000000000000
ret double %11
}

LLVM IR (-O2):
define double @fran32_r(i32* %0, i32* %1) {
%3 = tail call i32 @iran32_r(i32* %0, i32* %1)
%4 = uitofp i32 %3 to double
%5 = fmul double %4, 0x3DF0000000000000
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned short, int /*<<< orphan*/ *);
void fputw(unsigned short x, FILE *fp) {
  fputc(x & 0xff, fp);
  fputc((x >> 8) & 0xff, fp);
}


x86 assembly (clang, -O0):
<fputw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <fputc@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputw>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movzbl %bpl,%edi
call   1030 <fputc@plt>
shr    $0x8,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fputw(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i16
%9 = load i32*, i32** %4
%10 = call i32 @fputc(i16 zeroext %8, i32* %9)
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i16
%16 = load i32*, i32** %4
%17 = call i32 @fputc(i16 zeroext %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @fputw(i16 zeroext %0, i32* nocapture %1) {
%3 = and i16 %0, 255
%4 = tail call i32 @fputc(i16 zeroext %3, i32* %1)
%5 = lshr i16 %0, 8
%6 = tail call i32 @fputc(i16 zeroext %5, i32* %1)
ret void
}
void hostapd_update_wps(struct hostapd_data *hapd) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define void @hostapd_update_wps(%struct.hostapd_data* nocapture %0) {
ret void
}
const char *zlibVersion(void) { return "1.2.8.f-sortix-libz"; }


x86 assembly (clang, -O0):
<zlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"1.2.8.f-sortix-libz\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [20 x i8] c"1.2.8.f-sortix-libz\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int ASN1_item_i2d_bio(int /*<<< orphan*/, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPrivateKey;
int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa) {
  return ASN1_item_i2d_bio(ASN1_ITEM_rptr(RSAPrivateKey), bp, rsa);
}


x86 assembly (clang, -O0):
<i2d_RSAPrivateKey_bio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <ASN1_item_i2d_bio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_RSAPrivateKey_bio>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ASN1_item_i2d_bio@plt>

LLVM IR (-O0):
@RSAPrivateKey = global i32 0
define i32 @i2d_RSAPrivateKey_bio(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @RSAPrivateKey
%6 = call i32 @ASN1_ITEM_rptr(i32 %5)
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @ASN1_item_i2d_bio(i32 %6, i32* %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
@RSAPrivateKey = global i32 0
define i32 @i2d_RSAPrivateKey_bio(i32* %0, i32* %1) {
%3 = load i32, i32* @RSAPrivateKey
%4 = tail call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = tail call i32 @ASN1_item_i2d_bio(i32 %4, i32* %0, i32* %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DoFoo1(void) { printf("Foo1\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Foo1\0A\00"
define void @DoFoo1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"Foo1\00"
define void @DoFoo1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float AAS_Time();
float AAS_RoutingTime(void) { return AAS_Time(); }


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

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

LLVM IR (-O0):
define float @AAS_RoutingTime() {
%1 = call float (...) @AAS_Time()
ret float %1
}

LLVM IR (-O2):
define float @AAS_RoutingTime() {
%1 = tail call float (...) @AAS_Time()
ret float %1
}
const void *of_get_property(const struct device_node *np, const char *name,
                            int *lenp) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<of_get_property>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device_node = type opaque
define i8* @of_get_property(%struct.device_node* %0, i8* %1, i32* %2) {
%4 = alloca %struct.device_node*
%5 = alloca i8*
%6 = alloca i32*
store %struct.device_node* %0, %struct.device_node** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
ret i8* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias i8* @of_get_property(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
ret i8* null
}
/* Type definitions */
struct lexer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lexer_roll_back_one(struct lexer *);
void lexer_roll_back(struct lexer *lx, int offset) {
  while (offset > 0) {
    offset--;
    lexer_roll_back_one(lx);
  }
}


x86 assembly (clang, -O0):
<lexer_roll_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1140 <lexer_roll_back+0x30>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lexer_roll_back_one@plt>
jmp    111f <lexer_roll_back+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lexer_roll_back>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <lexer_roll_back+0x20>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <lexer_roll_back_one@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <lexer_roll_back+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.lexer = type { i32 }
define void @lexer_roll_back(%struct.lexer* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @lexer_roll_back_one(%struct.lexer* %0)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void err_pipe(int err) {
  fprintf(stderr, "PIPE FAILED: %d!\n", err);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<err_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_pipe>:
push   %rbx
mov    %edi,%edx
mov    0x2eb6(%rip),%rbx
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"PIPE FAILED: %d!\0A\00"
define void @err_pipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"PIPE FAILED: %d!\0A\00"
define void @err_pipe(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ position_set(char *);
void uci_new_game() {
  position_set("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1\00"
define void @uci_new_game() {
%1 = call i32 @position_set(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1\00"
define void @uci_new_game() {
%1 = tail call i32 @position_set(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}
int evt_free() {}


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

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

LLVM IR (-O0):
define i32 @evt_free() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @evt_free() {
ret i32 undef
}
void sub_s(float *source1, float *source2, float *target) {
  *target = (*source1) - (*source2);
}


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

x86 assembly (clang, -O2):
<sub_s>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
ret

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

LLVM IR (-O2):
define void @sub_s(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __hash32(uint32_t val, unsigned int bits) {
  uint32_t hash = val * 0x9e370001UL;
  return (hash >> (32 - bits));
}


x86 assembly (clang, -O0):
<__hash32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x9e370001,%rcx
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hash32>:
mov    %esi,%ecx
imul   $0x9e370001,%edi,%eax
neg    %cl
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @__hash32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 2654404609
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub i32 32, %11
%13 = ashr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @__hash32(i32 %0, i32 %1) {
%3 = mul i32 %0, -1640562687
%4 = sub i32 32, %1
%5 = ashr i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *reverseOnlyLetters(char *);
int main() {
  char *s = "a-bC-dEf-ghIj";
  char *rs = reverseOnlyLetters(s);
  printf("%s\n", rs);
  free(rs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <reverseOnlyLetters@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <reverseOnlyLetters@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"a-bC-dEf-ghIj\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @reverseOnlyLetters(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"a-bC-dEf-ghIj\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @reverseOnlyLetters(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
unsigned char unsignedchar_ignoring_unsignedlong(unsigned char x,
                                                 unsigned long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_unsignedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @unsignedchar_ignoring_unsignedlong(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_unsignedlong(i8 returned zeroext %0, i64 %1) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main() {
  execlp("cal", "cal", "2014", NULL);
  printf("This statement is not executed if execlp succeeds.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rsi
lea    0xec7(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execlp@plt>
lea    0xeb9(%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
lea    0xed5(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execlp@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cal\00"
@.str.1 = [5 x i8] c"2014\00"
@.str.2 = [52 x i8] c"This statement is not executed if execlp succeeds.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execlp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cal\00"
@.str.1 = [5 x i8] c"2014\00"
@str = [51 x i8] c"This statement is not executed if execlp succeeds.\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int i2c_read_reg(int);
int i2c_read_rx_data() { return i2c_read_reg(3); }


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

x86 assembly (clang, -O2):
<i2c_read_rx_data>:
mov    $0x3,%edi
jmp    1030 <i2c_read_reg@plt>

LLVM IR (-O0):
define i32 @i2c_read_rx_data() {
%1 = call i32 @i2c_read_reg(i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c_read_rx_data() {
%1 = tail call i32 @i2c_read_reg(i32 3)
ret i32 %1
}
int fib(int n) {
  if (n < 2) {
    return 1;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ I2C_WriteByte(int, int, void *);
void SHT20_reset(void) { I2C_WriteByte(0X40, 0XFE, (void *)0); }


x86 assembly (clang, -O0):
<SHT20_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0xfe,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <I2C_WriteByte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHT20_reset>:
mov    $0x40,%edi
mov    $0xfe,%esi
xor    %edx,%edx
jmp    1030 <I2C_WriteByte@plt>

LLVM IR (-O0):
define void @SHT20_reset() {
%1 = call i32 @I2C_WriteByte(i32 64, i32 254, i8* null)
ret void
}

LLVM IR (-O2):
define void @SHT20_reset() {
%1 = tail call i32 @I2C_WriteByte(i32 64, i32 254, i8* null)
ret void
}
/* Variables and functions */
int strnlen(char const *, int);
void strnlen_constant1() {
  const char *a = "123";
  if (strnlen(a, 10) != 3)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strnlen_constant1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strnlen@plt>
cmp    $0x3,%eax
je     113a <strnlen_constant1+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen_constant1>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
jmp    1030 <strnlen@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strnlen_constant1() {
%1 = tail call i32 @strnlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> (unsigned short)3;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      state[0UL] <<=
          ((state[0UL] >> (unsigned short)3) & (unsigned short)7) | 1UL;
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] | 28054104UL) | (unsigned short)7365;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
or     $0x30dd5ac,%rax
shr    $0x3,%rax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1160 <RandomFunc+0x60>
movzwl -0x12(%rbp),%eax
sar    $0x3,%eax
and    $0x7,%eax
movslq %eax,%rcx
or     $0x1,%rcx
movzwl -0x12(%rbp),%eax
shl    %cl,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1127 <RandomFunc+0x27>
movzwl -0x12(%rbp),%eax
or     $0x1ac1258,%rax
or     $0x1cc5,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
shr    $0x3,%eax
or     $0xbefd,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i64
%11 = or i64 %10, 51238316
%12 = lshr i64 %11, 3
%13 = trunc i64 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %6
br label %15
15: ; preds = %19, %2
%16 = load i16, i16* %6
%17 = zext i16 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = ashr i32 %22, 3
%24 = and i32 %23, 7
%25 = sext i32 %24 to i64
%26 = or i64 %25, 1
%27 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%28 = load i16, i16* %27
%29 = zext i16 %28 to i32
%30 = trunc i64 %26 to i32
%31 = shl i32 %29, %30
%32 = trunc i32 %31 to i16
store i16 %32, i16* %27
%33 = load i16, i16* %6
%34 = zext i16 %33 to i64
%35 = add i64 %34, 2
%36 = trunc i64 %35 to i16
store i16 %36, i16* %6
br label %15
37: ; preds = %15
%38 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%39 = load i16, i16* %38
%40 = zext i16 %39 to i64
%41 = or i64 %40, 28054104
%42 = or i64 %41, 7365
%43 = trunc i64 %42 to i16
%44 = load i16*, i16** %4
%45 = getelementptr inbounds i16, i16* %44, i64 0
store i16 %43, i16* %45
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = lshr i16 %3, 3
%5 = or i16 %4, -16643
store i16 %5, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_info(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strsignal(int);
void handler_default(int signo) {
  log_info("signal '%s' received", strsignal(signo));
}


x86 assembly (clang, -O0):
<handler_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strsignal@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <log_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler_default>:
push   %rax
call   1040 <strsignal@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <log_info@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"signal '%s' received\00"
define void @handler_default(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strsignal(i32 %3)
%5 = call i32 @log_info(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"signal '%s' received\00"
define void @handler_default(i32 %0) {
%2 = tail call i32 @strsignal(i32 %0)
%3 = tail call i32 @log_info(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *, char *);
int /*<<< orphan*/ inTable(char *);
int /*<<< orphan*/ undefined(char *);
void store(char *name) {
  if (!inTable(name)) {
    undefined(name);
  }
  emitln("mov\t%%eax,%s", name);
}


x86 assembly (clang, -O0):
<store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <inTable@plt>
cmp    $0x0,%eax
jne    1157 <store+0x27>
mov    -0x8(%rbp),%rdi
call   1050 <undefined@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <emitln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store>:
push   %rbx
mov    %rdi,%rbx
call   1040 <inTable@plt>
test   %eax,%eax
jne    1145 <store+0x15>
mov    %rbx,%rdi
call   1050 <undefined@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"mov\09%%eax,%s\00"
define void @store(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @inTable(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @undefined(i8* %7)
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
%11 = call i32 @emitln(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"mov\09%%eax,%s\00"
define void @store(i8* %0) {
%2 = tail call i32 @inTable(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @undefined(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @emitln(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}