xunge/DecIR huggingface dataset:
int f(int x) {
  const int i = x;
  if (x > 0) {
    x = x + i;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1120 <f+0x20>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
test   %edi,%edi
setg   %cl
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = shl nsw i32 %0, %3
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t clr_xtrail_1s(uint64_t u) { return ~(u + 1) & u; }


x86 assembly (clang, -O0):
<clr_xtrail_1s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_xtrail_1s>:
mov    $0xfffffffe,%eax
sub    %edi,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @clr_xtrail_1s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @clr_xtrail_1s(i32 %0) {
%2 = sub i32 -2, %0
%3 = and i32 %2, %0
ret i32 %3
}
int test_imm_C9uint8_mem(unsigned char *val) {
  return ((*val) & (-0xC9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C9uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff37,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C9uint8_mem>:
testb  $0x37,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 55
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun560() { return 560; }


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

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

LLVM IR (-O0):
define i32 @fun560() {
ret i32 560
}

LLVM IR (-O2):
define i32 @fun560() {
ret i32 560
}
void owRelease(int portnum) {}


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

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

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

LLVM IR (-O2):
define void @owRelease(i32 %0) {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
size_t strlen(char const *);
int strendcmp(const char *str, const char *end) {
  size_t slen;
  size_t elen;
  slen = strlen(str);
  elen = strlen(end);
  if (slen < elen)
    return -1;
  return strcmp(str + slen - elen, end);
}


x86 assembly (clang, -O0):
<strendcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1164 <strendcmp+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <strendcmp+0x61>
mov    -0x10(%rbp),%rdi
add    -0x20(%rbp),%rdi
xor    %eax,%eax
sub    -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strendcmp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %rax,%r15
jae    114b <strendcmp+0x2b>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
add    %r15,%rbx
sub    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
define i32 @strendcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %25
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = load i64, i64* %6
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = load i64, i64* %7
%21 = sub i64 0, %20
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8*, i8** %5
%24 = call i32 @strcmp(i8* %22, i8* %23)
store i32 %24, i32* %3
br label %25
25: ; preds = %16, %15
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @strendcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = sub i64 0, %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ -1, %2 ]
ret i32 %12
}
void arch_disable_interrupts(void) { __asm__ volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @arch_disable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int fn5(int x, int y) {
  int tem1 = ~x ^ y;
  int tem2 = x | y;
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn5(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = xor i32 %7, -1
%9 = load i32, i32* %4
%10 = xor i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = or i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn5(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
double floor(x)
double x;
{
  double i;
  i = _frndint(x);
  if (i > x)
    return i - 1.0;
  return i;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <_frndint@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115d <floor+0x4d>
movsd  -0x18(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <floor+0x57>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
mov    $0x1,%al
call   1030 <_frndint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd (%rsp),%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = call i32 (double, ...) bitcast (i32 (...)* @_frndint to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load double, double* %4
%13 = fsub double %12, 1.000000e+00
store double %13, double* %2
br label %16
14: ; preds = %1
%15 = load double, double* %4
store double %15, double* %2
br label %16
16: ; preds = %14, %11
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @_frndint to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = fcmp ogt double %3, %0
%5 = fadd double %3, -1.000000e+00
%6 = select i1 %4, double %5, double %3
ret double %6
}
/* Variables and functions */
long number_range(long, long);
long number_fuzzy(long num, int fuzziness) {
  return number_range(num - fuzziness, num + fuzziness);
}


x86 assembly (clang, -O0):
<number_fuzzy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
sub    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
call   1030 <number_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_fuzzy>:
movslq %esi,%rsi
mov    %rdi,%rax
sub    %rsi,%rax
add    %rdi,%rsi
mov    %rax,%rdi
jmp    1030 <number_range@plt>

LLVM IR (-O0):
define i64 @number_fuzzy(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = sub nsw i64 %5, %7
%9 = load i64, i64* %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = add nsw i64 %9, %11
%13 = call i64 @number_range(i64 %8, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @number_fuzzy(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i64 %0, %3
%5 = add nsw i64 %3, %0
%6 = tail call i64 @number_range(i64 %4, i64 %5)
ret i64 %6
}
int main() {
  int size = sizeof(int[]){1, 2};
  assert(size == 2 * sizeof(int));
  int a = ((int[]){1, 2})[1];
  assert(a == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x8,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 0, i32* %1
store i32 8, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = icmp eq i64 %6, 8
%8 = zext i1 %7 to i32
%9 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %8)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %10
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 2, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%13 = load i32, i32* %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 2
%16 = zext i1 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
int func();
int main(int argc, char **arg) { return func(); }


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)
mov    $0x0,%al
call   1030 <func@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = call i32 (...) @func()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _mondelay(long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
void mon_delay(long msec) {
  monLock();
  _mondelay(msec);
  monUnlock();
}


x86 assembly (clang, -O0):
<mon_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_mondelay@plt>
mov    $0x0,%al
call   1050 <monUnlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_delay>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %rbx,%rdi
call   1030 <_mondelay@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <monUnlock@plt>

LLVM IR (-O0):
define void @mon_delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @monLock()
%4 = load i64, i64* %2
%5 = call i32 @_mondelay(i64 %4)
%6 = call i32 (...) @monUnlock()
ret void
}

LLVM IR (-O2):
define void @mon_delay(i64 %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i32 @_mondelay(i64 %0)
%4 = tail call i32 (...) @monUnlock()
ret void
}
int doAddition(int v1, int v2) { return v1 + v2; }


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

x86 assembly (clang, -O2):
<doAddition>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @doAddition(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @doAddition(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
unsigned long bcctr(unsigned char bo, unsigned char bi, unsigned char lk) {
  return (19 << 26) | (bo << 21) | (bi << 16) | (528 << 1) | (lk << 0);
}


x86 assembly (clang, -O0):
<bcctr>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x15,%eax
or     $0x4c000000,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
or     $0x420,%eax
movzbl -0x3(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcctr>:
mov    %edi,%eax
shl    $0x15,%rax
mov    %esi,%ecx
shl    $0x10,%rcx
or     %rax,%rcx
mov    %edx,%eax
or     %rcx,%rax
or     $0x4c000420,%rax
ret

LLVM IR (-O0):
define i64 @bcctr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 21
%10 = or i32 1275068416, %9
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %10, %13
%15 = or i32 %14, 1056
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 0
%19 = or i32 %15, %18
%20 = sext i32 %19 to i64
ret i64 %20
}

LLVM IR (-O2):
define i64 @bcctr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i64
%5 = shl nuw nsw i64 %4, 21
%6 = zext i8 %1 to i64
%7 = shl nuw nsw i64 %6, 16
%8 = zext i8 %2 to i64
%9 = or i64 %5, %7
%10 = or i64 %9, %8
%11 = or i64 %10, 1275069472
ret i64 %11
}
unsigned int _count_positives(int *tab) {
  unsigned int count = 0;
  for (; tab[count] >= 0; ++count) {
  }
  return count;
}


x86 assembly (clang, -O0):
<_count_positives>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpl   $0x0,(%rax,%rcx,4)
jl     1133 <_count_positives+0x33>
jmp    1125 <_count_positives+0x25>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <_count_positives+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_count_positives>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpl   $0x0,(%rdi,%rax,4)
jns    1110 <_count_positives+0x10>
ret

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

LLVM IR (-O2):
define i32 @_count_positives(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, -1
%8 = add i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ bell_pitch;
};
typedef TYPE_1__ XKeyboardState;

/* Variables and functions */
unsigned get_XKeyboardState_bell_pitch(void *_p) {
  return (unsigned)((XKeyboardState *)_p)->bell_pitch;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XKeyboardState_bell_pitch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XKeyboardState_bell_pitch(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Atm128GpioInterruptC__4__Interrupt__default__fired();
void Atm128GpioInterruptC__4__Interrupt__fired(void) {
  Atm128GpioInterruptC__4__Interrupt__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @Atm128GpioInterruptC__4__Interrupt__fired() {
%1 = tail call i32 (...) @Atm128GpioInterruptC__4__Interrupt__default__fired()
ret void
}
int numDigits(long long int num) {
  long long int factor = 10;
  int count = 0;
  while (num % factor != num) {
    count++;
    factor = factor * 10;
  }
  return count + 1;
}


x86 assembly (clang, -O0):
<numDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0xa,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
cmp    -0x8(%rbp),%rdx
je     1142 <numDigits+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <numDigits+0x17>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numDigits>:
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    %rdx,%rdx
lea    (%rdx,%rdx,4),%rax
mov    $0x1,%ecx
test   %rax,%rax
jne    1132 <numDigits+0x32>
mov    %ecx,%eax
ret
mov    $0xa,%esi
jmp    1150 <numDigits+0x50>
nopl   0x0(%rax)
mov    %rdi,%rax
cqto
idiv   %rsi
add    $0x1,%ecx
cmp    %rdi,%rdx
je     112f <numDigits+0x2f>
add    %rsi,%rsi
lea    (%rsi,%rsi,4),%rsi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1140 <numDigits+0x40>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1148 <numDigits+0x48>

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

LLVM IR (-O2):
define i32 @numDigits(i64 %0) {
%2 = srem i64 %0, 10
%3 = icmp eq i64 %2, %0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i64 [ %7, %4 ], [ 10, %1 ]
%7 = mul nuw nsw i64 %6, 10
%8 = add i32 %5, 1
%9 = srem i64 %0, %7
%10 = icmp eq i64 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR3C_get(void) { return U_WMRCORENONE_get("U_WMR3C"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR3C\00"
define i32 @U_WMR3C_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR3C\00"
define i32 @U_WMR3C_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int u8isupperi(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8isupperc(char *c) { return u8isupperi(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8isupperc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8isupperi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isupperc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isupperi@plt>

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

LLVM IR (-O2):
define i32 @u8isupperc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8isupperi(i32 %2)
ret i32 %3
}
/* Variables and functions */
float logf(float);
float libm_logf(float x) { return logf(x); }


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

x86 assembly (clang, -O2):
<libm_logf>:
jmp    1030 <logf@plt>

LLVM IR (-O0):
define float @libm_logf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @libm_logf(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ event_mm_free_(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_cond_destroy(int /*<<< orphan*/ *);
void evthread_posix_cond_free(void *_cond) {
  pthread_cond_t *cond = _cond;
  pthread_cond_destroy(cond);
  event_mm_free_(cond);
}


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

x86 assembly (clang, -O2):
<evthread_posix_cond_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pthread_cond_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <event_mm_free_@plt>

LLVM IR (-O0):
define void @evthread_posix_cond_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @pthread_cond_destroy(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @event_mm_free_(i32* %8)
ret void
}

LLVM IR (-O2):
define void @evthread_posix_cond_free(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_cond_destroy(i32* %2)
%4 = tail call i32 @event_mm_free_(i32* %2)
ret void
}
/* Variables and functions */
int atoi(char *);
int main(int argc, char const *argv[]) {
  char str[] = "-12";
  if (atoi(str) != -12) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <atoi@plt>
cmp    $0xfffffff4,%eax
je     114d <main+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <main+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int test_imm_5Fint8_mem(signed char *val) {
  return ((*val) & (0x5F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Fint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x5f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Fint8_mem>:
testb  $0x5f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 95
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int net_connect(char *, char *, char, int /*<<< orphan*/);
int net_connect_tcp(char *addr, char *port, char serve) {
  return net_connect(addr, port, serve, 0);
}


x86 assembly (clang, -O0):
<net_connect_tcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
movsbl -0x11(%rbp),%edx
call   1030 <net_connect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_connect_tcp>:
xor    %ecx,%ecx
jmp    1030 <net_connect@plt>

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

LLVM IR (-O2):
define i32 @net_connect_tcp(i8* %0, i8* %1, i8 signext %2) {
%4 = tail call i32 @net_connect(i8* %0, i8* %1, i8 signext %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
void my_putstr(char *str) {
  while (*str) {
    write(1, str++, 1);
  }
  return;
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <my_putstr+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%esi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
jmp    111c <my_putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113e <my_putstr+0x2e>
mov    %rdi,%rbx
lea    0x1(%rdi),%r14
mov    $0x1,%edi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x1,%ebx
cmpb   $0x0,(%r14)
lea    0x1(%r14),%r14
jne    1120 <my_putstr+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @my_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = ptrtoint i8* %8 to i32
%11 = call i32 @write(i32 1, i32 %10, i32 1)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @my_putstr(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = ptrtoint i8* %5 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @write(i32 1, i32 %8, i32 1)
%10 = load i8, i8* %6
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UARTprintf(char *);
void IntDefaultHandler(void) {
  while (1) {
    UARTprintf("IntDefaultHandler\r\n");
  }
}


x86 assembly (clang, -O0):
<IntDefaultHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <IntDefaultHandler+0x9>
lea    0xee0(%rip),%rdi
call   1030 <UARTprintf@plt>
jmp    1119 <IntDefaultHandler+0x9>

x86 assembly (clang, -O2):
<IntDefaultHandler>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <UARTprintf@plt>
jmp    1120 <IntDefaultHandler+0x10>

LLVM IR (-O0):
@.str = [20 x i8] c"IntDefaultHandler\0D\0A\00"
define void @IntDefaultHandler() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @UARTprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [20 x i8] c"IntDefaultHandler\0D\0A\00"
define void @IntDefaultHandler() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @UARTprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ rapl_read_print_sockets(int, int, int);
void rapl_read_print_all_sockets(int detailed, int protected) {
  rapl_read_print_sockets(-1, detailed, protected);
}


x86 assembly (clang, -O0):
<rapl_read_print_all_sockets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0xffffffff,%edi
call   1030 <rapl_read_print_sockets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_read_print_all_sockets>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <rapl_read_print_sockets@plt>

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

LLVM IR (-O2):
define void @rapl_read_print_all_sockets(i32 %0, i32 %1) {
%3 = tail call i32 @rapl_read_print_sockets(i32 -1, i32 %0, i32 %1)
ret void
}
int test_imm_F4int8_reg(signed char val) {
  return ((val) & (0xF4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F4int8_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, 244
%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_F4int8_reg(i8 signext %0) {
%2 = and i8 %0, -12
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ build_and_perform(int, int /*<<< orphan*/);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char const *argv[]) {
  setvbuf(stdout, NULL, _IONBF, 0);
  build_and_perform(3, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <build_and_perform@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <build_and_perform@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = load i32, i32* @_IONBF
%8 = call i32 @setvbuf(i32 %6, i32* null, i32 %7, i32 0)
%9 = call i32 @build_and_perform(i32 3, i32 0)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = load i32, i32* @_IONBF
%5 = tail call i32 @setvbuf(i32 %3, i32* null, i32 %4, i32 0)
%6 = tail call i32 @build_and_perform(i32 3, i32 0)
ret i32 0
}
/* Variables and functions */
char *energymon_strencpy(char *, char *, size_t);
char *energymon_get_source_odroid(char *buffer, size_t n) {
  return energymon_strencpy(buffer, "ODROID INA231 Power Sensors", n);
}


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

x86 assembly (clang, -O2):
<energymon_get_source_odroid>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <energymon_strencpy@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"ODROID INA231 Power Sensors\00"
define i8* @energymon_get_source_odroid(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @energymon_strencpy(i8* %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [28 x i8] c"ODROID INA231 Power Sensors\00"
define i8* @energymon_get_source_odroid(i8* %0, i64 %1) {
%3 = tail call i8* @energymon_strencpy(i8* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ on_cc_exit(char *);
void handle_exit(int e) { on_cc_exit("Terminated by user."); }


x86 assembly (clang, -O0):
<handle_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <on_cc_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Terminated by user.\00"
define void @handle_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @on_cc_exit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Terminated by user.\00"
define void @handle_exit(i32 %0) {
%2 = tail call i32 @on_cc_exit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pluscconlyib(unsigned int a, unsigned int b) {
  unsigned int sum = a + b;
  if (sum < b)
    abort();
}


x86 assembly (clang, -O0):
<pluscconlyib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    113a <pluscconlyib+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscconlyib>:
add    %esi,%edi
jb     1115 <pluscconlyib+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pluscconlyib(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 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pluscconlyib(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = icmp ult i32 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ jhash_3words(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
__u32 jhash_1word(__u32 a, __u32 initval) {
  return jhash_3words(a, 0, 0, initval);
}


x86 assembly (clang, -O0):
<jhash_1word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1030 <jhash_3words@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jhash_1word>:
mov    %esi,%ecx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <jhash_3words@plt>

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

LLVM IR (-O2):
define i32 @jhash_1word(i32 %0, i32 %1) {
%3 = tail call i32 @jhash_3words(i32 %0, i32 0, i32 0, i32 %1)
ret i32 %3
}
int cmp(const void *a, const void *b) { return *(int *)a > *(int *)b; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *bsearch(void const *, void const *, unsigned int, unsigned int,
              int (*)(void const *, void const *));
void *my_bsearch(void const *key, void const *base, unsigned nel,
                 unsigned width, int (*compar)(void const *, void const *)) {
  return bsearch(key, base, nel, width, compar);
}


x86 assembly (clang, -O0):
<my_bsearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <bsearch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_bsearch>:
jmp    1030 <bsearch@plt>

LLVM IR (-O0):
define i8* @my_bsearch(i8* %0, i8* %1, i32 %2, i32 %3, i32 (i8*, i8*)* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 (i8*, i8*)* %4, i32 (i8*, i8*)** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%16 = call i8* @bsearch(i8* %11, i8* %12, i32 %13, i32 %14, i32 (i8*, i8*)* %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @my_bsearch(i8* %0, i8* %1, i32 %2, i32 %3, i32 (i8*, i8*)* %4) {
%6 = tail call i8* @bsearch(i8* %0, i8* %1, i32 %2, i32 %3, i32 (i8*, i8*)* %4)
ret i8* %6
}
void UAPP_Task3(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ geteuid();
uid_t atf_user_euid(void) { return geteuid(); }


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

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

LLVM IR (-O0):
define i32 @atf_user_euid() {
%1 = call i32 (...) @geteuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @atf_user_euid() {
%1 = tail call i32 (...) @geteuid()
ret i32 %1
}
__attribute__((always_)) int make_castling_right(int c, int s) {
  return c == 0 ? s == 1 ? 2 : 1 : s == 1 ? 8 : 4;
}


x86 assembly (clang, -O0):
<make_castling_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <make_castling_right+0x2f>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <make_castling_right+0x45>
mov    -0x8(%rbp),%edx
mov    $0x4,%eax
mov    $0x8,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_castling_right>:
xor    %eax,%eax
cmp    $0x1,%esi
sete   %al
lea    0x1(%rax),%ecx
test   %edi,%edi
lea    0x4(,%rax,4),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @make_castling_right(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 1
%5 = select i1 %4, i32 2, i32 1
%6 = select i1 %4, i32 8, i32 4
%7 = select i1 %3, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
char *strchr(char *, char);
char *get_arg(char **args) {
  char *ret;
  char *comma;
  ret = *args;
  comma = strchr(ret, ',');
  if (comma) {
    *comma = '\0';
    *args = comma + 1;
  } else
    *args = NULL;
  return ret;
}


x86 assembly (clang, -O0):
<get_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115f <get_arg+0x4f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    116a <get_arg+0x5a>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1135 <get_arg+0x25>
movb   $0x0,(%rax)
add    $0x1,%rax
jmp    1137 <get_arg+0x27>
xor    %eax,%eax
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @get_arg(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 44)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
store i8 0, i8* %3
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
store i8* %8, i8** %0
ret i8* %2
}