xunge/DecIR huggingface dataset:
int myEqualDefault(void *a, void *b) { return a == b; }


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

x86 assembly (clang, -O2):
<myEqualDefault>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @myEqualDefault(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 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @myEqualDefault(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef scalar_t__ B;

/* Variables and functions */
uint64_t integerify(const void *B, size_t r) {
  const uint32_t *X = (const void *)((uintptr_t)(B) + (2 * r - 1) * 64);
  return (((uint64_t)(X[1]) << 32) + X[0]);
}


x86 assembly (clang, -O0):
<integerify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
sub    $0x1,%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @integerify(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i64, i64* %4
%9 = mul i64 2, %8
%10 = sub i64 %9, 1
%11 = mul i64 %10, 64
%12 = add i64 %7, %11
%13 = inttoptr i64 %12 to i8*
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %5
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = shl i32 %17, 32
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = add nsw i32 %18, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @integerify(i8* nocapture readnone %0, i64 %1) {
ret i32 poison
}
int sarprintf_error(const char *format, ...) {
  format = format;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sarprintf_error(i8* nocapture readnone %0, ...) {
ret i32 0
}
void f(struct A *p) {}


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

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

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

LLVM IR (-O2):
%struct.A = type opaque
define void @f(%struct.A* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int32_t prv_lt_str_fn(const char *a, const char *b) {
  return strcmp(a, b) < 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<prv_lt_str_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_lt_str_fn>:
push   %rax
call   1030 <strcmp@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prv_lt_str_fn(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 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @prv_lt_str_fn(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, s, c;
  scanf("%d", &a);
  s = a * a;
  c = a * a * a;
  printf("%d \n %d", s, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"%d \0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %1
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %1
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"%d \0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ makechange(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/, double,
                              char);
int main() { makechange(0, 0, 0, 0, 0.75, 'q'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
movsd  0xee2(%rip),%xmm0
mov    $0x71,%r8d
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <makechange@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x71,%r8d
call   1030 <makechange@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @makechange(i32 0, i32 0, i32 0, i32 0, double 7.500000e-01, i8 signext 113)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @makechange(i32 0, i32 0, i32 0, i32 0, double 7.500000e-01, i8 signext 113)
ret i32 0
}
/* Variables and functions */
double tan(double);
double intr_wrap_079(double p1) { return tan(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_079>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @intr_wrap_079(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
void TEXT(char *charptr, char *str) {
  while (*(str - 1) != 0) {
    *charptr = *str;
    charptr++;
    str++;
  }
}


x86 assembly (clang, -O0):
<TEXT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x0,%eax
je     1146 <TEXT+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <TEXT+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEXT>:
cmpb   $0x0,-0x1(%rsi)
je     1121 <TEXT+0x21>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <TEXT+0x10>
ret

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

LLVM IR (-O2):
define void @TEXT(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %1, %2 ]
%8 = phi i8* [ %10, %6 ], [ %0, %2 ]
%9 = load i8, i8* %7
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %7
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int HadTu_decoding(void *);
int /*<<< orphan*/ HadTu_setDecoding(void *, int);
void SubEvt_setDecoding(void *my, uint32_t decoding) {
  uint32_t oldtriggertype = HadTu_decoding(my) & 0xF0;
  HadTu_setDecoding(my, (decoding | oldtriggertype));
}


x86 assembly (clang, -O0):
<SubEvt_setDecoding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <HadTu_decoding@plt>
and    $0xf0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
or     -0x10(%rbp),%esi
call   1030 <HadTu_setDecoding@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubEvt_setDecoding>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <HadTu_decoding@plt>
and    $0xf0,%eax
or     %eax,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <HadTu_setDecoding@plt>

LLVM IR (-O0):
define void @SubEvt_setDecoding(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @HadTu_decoding(i8* %6)
%8 = and i32 %7, 240
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = or i32 %10, %11
%13 = call i32 @HadTu_setDecoding(i8* %9, i32 %12)
ret void
}

LLVM IR (-O2):
define void @SubEvt_setDecoding(i8* %0, i32 %1) {
%3 = tail call i32 @HadTu_decoding(i8* %0)
%4 = and i32 %3, 240
%5 = or i32 %4, %1
%6 = tail call i32 @HadTu_setDecoding(i8* %0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc21(int status, void *arg) {
  printf("Executing exitfunc"
         "21"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc21>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Executing exitfunc21 (status=%d, arg=%lu)\0A\00"
define void @exitfunc21(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Executing exitfunc21 (status=%d, arg=%lu)\0A\00"
define void @exitfunc21(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void VisClearScreen(void) { printf("\033[2J"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @VisClearScreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @VisClearScreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long long rdtsc(void) {
  unsigned long lo, hi;
  asm volatile("rdtsc" : "=a"(lo), "=d"(hi)::"memory");
  return ((unsigned long long)hi << 32ULL | (unsigned long long)lo);
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{memory},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = load i64, i64* %1
%9 = or i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{memory},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void pause() { system("pause"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define void @pause() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void rop3_146_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = *D | T;
  stk3 = S & stk4;
  stk2 = T ^ stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

LLVM IR (-O0):
define void @rop3_146_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %10
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = and i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %8
%34 = zext i8 %33 to i32
%35 = xor i32 %32, %34
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8, i8* %6
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %5
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = load i8*, i8** %4
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = load i8, i8* %6
%58 = zext i8 %57 to i32
%59 = and i32 %56, %58
%60 = or i32 %53, %59
%61 = trunc i32 %60 to i8
%62 = load i8*, i8** %4
store i8 %61, i8* %62
ret void
}

LLVM IR (-O2):
define void @rop3_146_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free2DArr(double ***array, int sizeX) {
  int i;
  for (i = 0; i < sizeX; i++)
    free((void *)(*array)[i]);
  free((void *)(*array));
}


x86 assembly (clang, -O0):
<free2DArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <free2DArr+0x44>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2DArr+0x16>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2DArr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1145 <free2DArr+0x35>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free2DArr+0x20>
mov    (%r14),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free2DArr(double*** %0, i32 %1) {
%3 = alloca double***
%4 = alloca i32
%5 = alloca i32
store double*** %0, double**** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load double***, double**** %3
%12 = load double**, double*** %11
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double*, double** %12, i64 %14
%16 = load double*, double** %15
%17 = bitcast double* %16 to i8*
%18 = call i32 @free(i8* %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
%23 = load double***, double**** %3
%24 = load double**, double*** %23
%25 = bitcast double** %24 to i8*
%26 = call i32 @free(i8* %25)
ret void
}

LLVM IR (-O2):
define void @free2DArr(double*** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = load double**, double*** %0
%9 = getelementptr inbounds double*, double** %8, i64 %7
%10 = bitcast double** %9 to i8**
%11 = load i8*, i8** %10
%12 = tail call i32 @free(i8* %11)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = bitcast double*** %0 to i8**
%17 = load i8*, i8** %16
%18 = tail call i32 @free(i8* %17)
ret void
}
int ld_le_cr1(long double a1) { return (((100) <= (a1))); }


x86 assembly (clang, -O0):
<ld_le_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_le_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_le_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ole x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_le_cr1(x86_fp80 %0) {
%2 = fcmp oge x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_linux_list();
int main(int argc, char **argv) {
  test_linux_list();
  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    $0x0,%al
call   1030 <test_linux_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 (...) @test_linux_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_linux_list()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_footer(const char *title) {
  printf("========== Finished testing");
  if (title)
    printf(" of %s", title);
  printf(" ==========\n");
}


x86 assembly (clang, -O0):
<print_footer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1147 <print_footer+0x37>
mov    -0x8(%rbp),%rsi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_footer>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
je     1148 <print_footer+0x28>
lea    0xede(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c"========== Finished testing\00"
@.str.1 = [7 x i8] c" of %s\00"
@str = [12 x i8] c" ==========\00"
define void @print_footer(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mu_summary();
void my_shutdown(void) { mu_summary(); }


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

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

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

LLVM IR (-O2):
define void @my_shutdown() {
%1 = tail call i32 (...) @mu_summary()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int age;
  printf("Your age: ");
  scanf("%d", &age);
  printf("You will be %d years old next year\n", age + 1);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Your age: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"You will be %d years old next year\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Your age: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"You will be %d years old next year\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
double rint(double x) {
  double retval;
  __asm__("frndint;" : "=t"(retval) : "0"(x));
  return retval;
}


x86 assembly (clang, -O0):
<rint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
frndint
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rint>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
frndint
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @rint(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double asm "frndint;", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @rint(double %0) {
%2 = tail call double asm "frndint;", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
int c(int w) {
  int z = w;
  return z;
}


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

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

LLVM IR (-O0):
define i32 @c(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* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @c(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
float noise3_perlin(float *);
float orgPerlinNoiseU(float x, float y, float z) {
  float v[3];
  v[0] = x;
  v[1] = y;
  v[2] = z;
  return (0.5f + 0.5f * noise3_perlin(v));
}


x86 assembly (clang, -O0):
<orgPerlinNoiseU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <noise3_perlin@plt>
movss  0xeaa(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgPerlinNoiseU>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm2,0x14(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <noise3_perlin@plt>
movss  0xec8(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @orgPerlinNoiseU(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [3 x float]
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
store float %8, float* %9
%10 = load float, float* %5
%11 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
store float %10, float* %11
%12 = load float, float* %6
%13 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
store float %12, float* %13
%14 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%15 = call float @noise3_perlin(float* %14)
%16 = call float @llvm.fmuladd.f32(float 5.000000e-01, float %15, float 5.000000e-01)
ret float %16
}

LLVM IR (-O2):
define float @orgPerlinNoiseU(float %0, float %1, float %2) {
%4 = alloca [3 x float]
%5 = bitcast [3 x float]* %4 to i8*
%6 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
store float %0, float* %6
%7 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 1
store float %1, float* %7
%8 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 2
store float %2, float* %8
%9 = call float @noise3_perlin(float* %6)
%10 = call float @llvm.fmuladd.f32(float %9, float 5.000000e-01, float 5.000000e-01)
ret float %10
}
void serialize(void) {
  __asm__ __volatile__("xor %%eax, %%eax\n\tcpuid"
                       :
                       :
                       : "rax", "rbx", "rcx", "rdx");
}


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

x86 assembly (clang, -O2):
<serialize>:
push   %rbx
xor    %eax,%eax
cpuid
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serialize() {
tail call void asm sideeffect "xor %eax, %eax\0A\09cpuid", "~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned long long rdmsr(unsigned int addr) {
  unsigned long long res;
  asm volatile("rdmsr" : "=A"(res) : "c"(addr));
  return res;
}


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

x86 assembly (clang, -O2):
<rdmsr>:
mov    %edi,%ecx
rdmsr
ret

LLVM IR (-O0):
define i64 @rdmsr(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @rdmsr(i32 %0) {
%2 = tail call i64 asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i64 %2
}
extern unsigned char get_bit_6(const unsigned char c) { return (c & 0x40) > 0; }


x86 assembly (clang, -O0):
<get_bit_6>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_6>:
mov    %edi,%eax
shr    $0x6,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_bit_6(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 64
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @get_bit_6(i8 zeroext %0) {
%2 = lshr i8 %0, 6
%3 = and i8 %2, 1
ret i8 %3
}
/* Variables and functions */
int foo(int);
int main(void) { return !(foo(5) == 13); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <foo@plt>
cmp    $0xd,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <foo@plt>
xor    %ecx,%ecx
cmp    $0xd,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 5)
%3 = icmp eq i32 %2, 13
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
%2 = icmp ne i32 %1, 13
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ __mriCore_IsFirstException();
scalar_t__ __mriPlatform_CommShouldWaitForGdbConnect();
int __mriCore_IsWaitingForGdbToConnect(void) {
  return __mriCore_IsFirstException() &&
         __mriPlatform_CommShouldWaitForGdbConnect();
}


x86 assembly (clang, -O0):
<__mriCore_IsWaitingForGdbToConnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__mriCore_IsFirstException@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1152 <__mriCore_IsWaitingForGdbToConnect+0x32>
mov    $0x0,%al
call   1040 <__mriPlatform_CommShouldWaitForGdbConnect@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mriCore_IsWaitingForGdbToConnect>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__mriCore_IsFirstException@plt>
test   %rax,%rax
je     113e <__mriCore_IsWaitingForGdbToConnect+0x1e>
xor    %eax,%eax
call   1040 <__mriPlatform_CommShouldWaitForGdbConnect@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__mriCore_IsWaitingForGdbToConnect() {
%1 = call i64 (...) @__mriCore_IsFirstException()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 (...) @__mriPlatform_CommShouldWaitForGdbConnect()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__mriCore_IsWaitingForGdbToConnect() {
%1 = tail call i64 (...) @__mriCore_IsFirstException()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @__mriPlatform_CommShouldWaitForGdbConnect()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct xenDevice {
  int dummy;
};
struct device {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ writeDevice(int /*<<< orphan*/ *, struct device *);
void xenWriteDevice(FILE *file, struct xenDevice *dev) {
  writeDevice(file, (struct device *)dev);
}


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

x86 assembly (clang, -O2):
<xenWriteDevice>:
jmp    1030 <writeDevice@plt>

LLVM IR (-O0):
%struct.xenDevice = type { i32 }
%struct.device = type { i32 }
define void @xenWriteDevice(i32* %0, %struct.xenDevice* %1) {
%3 = alloca i32*
%4 = alloca %struct.xenDevice*
store i32* %0, i32** %3
store %struct.xenDevice* %1, %struct.xenDevice** %4
%5 = load i32*, i32** %3
%6 = load %struct.xenDevice*, %struct.xenDevice** %4
%7 = bitcast %struct.xenDevice* %6 to %struct.device*
%8 = call i32 @writeDevice(i32* %5, %struct.device* %7)
ret void
}

LLVM IR (-O2):
%struct.xenDevice = type { i32 }
%struct.device = type { i32 }
define void @xenWriteDevice(i32* %0, %struct.xenDevice* %1) {
%3 = bitcast %struct.xenDevice* %1 to %struct.device*
%4 = tail call i32 @writeDevice(i32* %0, %struct.device* %3)
ret void
}
/* Variables and functions */
scalar_t__ __builtin_j1l(long double);
int /*<<< orphan*/ link_failure_builtin_j1l();
void test_builtin_j1l(long double ld) {
  if (__builtin_j1l(ld) != __builtin_j1l(ld))
    link_failure_builtin_j1l();
}


x86 assembly (clang, -O0):
<test_builtin_j1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_j1l@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_j1l@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_j1l+0x43>
mov    $0x0,%al
call   1030 <link_failure_builtin_j1l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_j1l>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_j1l@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_j1l@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_j1l+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_j1l@plt>

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

LLVM IR (-O2):
define void @test_builtin_j1l(x86_fp80 %0) {
%2 = tail call i64 @__builtin_j1l(x86_fp80 %0)
%3 = tail call i64 @__builtin_j1l(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_j1l()
br label %7
7: ; preds = %5, %1
ret void
}
int get_link_utilization() { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_link_utilization() {
ret i32 0
}

LLVM IR (-O2):
define i32 @get_link_utilization() {
ret i32 0
}
/* Variables and functions */
char *my_strrchr(char const *str, int ch) {
  char *location = NULL;
  while (*str != '\0') {
    if (*str == ch)
      location = str;
    str++;
  }
  return location;
}


x86 assembly (clang, -O0):
<my_strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <my_strrchr+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    113b <my_strrchr+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <my_strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strrchr>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <my_strrchr+0x25>
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ null, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %8, i8* %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %16
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
bool between(int32_t n, int32_t low, int32_t high) {
  return (low <= n) && (n <= high);
}


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jg     1131 <between+0x31>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<between>:
cmp    %rdi,%rsi
setle  %al
cmp    %rdx,%rdi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @between(i64 %0, i64 %1, i64 %2) {
%4 = icmp sle i64 %1, %0
%5 = icmp sle i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Reserved173_DriverIRQHandler();
__attribute__((weak)) void Reserved173_IRQHandler(void) {
  Reserved173_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved173_IRQHandler() {
%1 = call i32 (...) @Reserved173_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved173_IRQHandler() {
%1 = tail call i32 (...) @Reserved173_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const uint8_t *hsp_subevent_hs_command_get_value(const uint8_t *event) {
  return &event[4];
}


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

x86 assembly (clang, -O2):
<hsp_subevent_hs_command_get_value>:
lea    0x10(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @hsp_subevent_hs_command_get_value(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
ret i32* %4
}

LLVM IR (-O2):
define i32* @hsp_subevent_hs_command_get_value(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %2
}
unsigned char b_input_wait_for_key(void) {
  unsigned char chr;
  asm volatile("call 0x00100038" : "=a"(chr));
  return chr;
}


x86 assembly (clang, -O0):
<b_input_wait_for_key>:
push   %rbp
mov    %rsp,%rbp
call   100038 <completed.0+0xfc018>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_input_wait_for_key>:
call   100038 <completed.0+0xfc018>
ret

LLVM IR (-O0):
define zeroext i8 @b_input_wait_for_key() {
%1 = alloca i8
%2 = call i8 asm sideeffect "call 0x00100038", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @b_input_wait_for_key() {
%1 = tail call i8 asm sideeffect "call 0x00100038", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i8 %1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_getppid;
scalar_t__ syscall_0(int /*<<< orphan*/);
pid_t getppid(void) {
  pid_t ppid;
  ppid = (pid_t)syscall_0(SYS_getppid);
  return ppid;
}


x86 assembly (clang, -O0):
<getppid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall_0@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getppid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_0@plt>

LLVM IR (-O0):
@SYS_getppid = global i32 0
define i64 @getppid() {
%1 = alloca i64
%2 = load i32, i32* @SYS_getppid
%3 = call i64 @syscall_0(i32 %2)
store i64 %3, i64* %1
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
@SYS_getppid = global i32 0
define i64 @getppid() {
%1 = load i32, i32* @SYS_getppid
%2 = tail call i64 @syscall_0(i32 %1)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int write_i2c_reg(int, int, int /*<<< orphan*/);
int piups_set_irailconv(int file_i2c, uint16_t irailconv) {
  return write_i2c_reg(file_i2c, 0x5C, irailconv);
}


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

x86 assembly (clang, -O2):
<piups_set_irailconv>:
mov    %esi,%edx
mov    $0x5c,%esi
jmp    1030 <write_i2c_reg@plt>

LLVM IR (-O0):
define i32 @piups_set_irailconv(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 @write_i2c_reg(i32 %5, i32 92, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @piups_set_irailconv(i32 %0, i32 %1) {
%3 = tail call i32 @write_i2c_reg(i32 %0, i32 92, i32 %1)
ret i32 %3
}
void EC_KEY_insert_key_method_data(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_insert_key_method_data() {
ret void
}