xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ alpha(char);
scalar_t__ numeric(char);
alphanumeric(char c) { return ((alpha(c)) || (numeric(c))); }


x86 assembly (clang, -O0):
<alphanumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <alphanumeric+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <numeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphanumeric>:
push   %rbx
mov    %edi,%ebx
call   1040 <alpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <alphanumeric+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <numeric@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alphanumeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @alpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @numeric(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @alphanumeric(i8 signext %0) {
%2 = tail call i64 @alpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @numeric(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
int f() {
  int seed;
  g(seed);
}


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
%4 = call i32 @g(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 @g(i32 undef)
ret i32 undef
}
int __attribute__((weak)) iR301SetTimeout(void) { return 0; }


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

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

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

LLVM IR (-O2):
define weak i32 @iR301SetTimeout() {
ret i32 0
}
int cpu_map__id_to_socket(int id) { return id >> 16; }


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

x86 assembly (clang, -O2):
<cpu_map__id_to_socket>:
mov    %edi,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @cpu_map__id_to_socket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
ret i32 %4
}

LLVM IR (-O2):
define i32 @cpu_map__id_to_socket(i32 %0) {
%2 = ashr i32 %0, 16
ret i32 %2
}
/* Type definitions */
struct VectorBase {
  int dummy;
};

/* Variables and functions */
char const **SegmentCut(struct VectorBase *);
const char **result(struct VectorBase *basev) { return SegmentCut(basev); }


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

x86 assembly (clang, -O2):
<result>:
jmp    1030 <SegmentCut@plt>

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

LLVM IR (-O2):
%struct.VectorBase = type { i32 }
define i8** @result(%struct.VectorBase* %0) {
%2 = tail call i8** @SegmentCut(%struct.VectorBase* %0)
ret i8** %2
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_scalarDiv_new(float *, float *, float const,
                                       int const);
void vecNf_scalarDiv(float v[], const float scalar, const int n) {
  vecNf_scalarDiv_new(v, v, scalar, n);
}


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

x86 assembly (clang, -O2):
<vecNf_scalarDiv>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <vecNf_scalarDiv_new@plt>

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

LLVM IR (-O2):
define void @vecNf_scalarDiv(float* %0, float %1, i32 %2) {
%4 = tail call i32 @vecNf_scalarDiv_new(float* %0, float* %0, float %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ magic_square(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Enter the lenght of the square: ");
  scanf("%d", &n);
  magic_square(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <magic_square@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"Enter the lenght of the square: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 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 = call i32 @magic_square(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter the lenght of the square: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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 = call i32 @magic_square(i32 %5)
ret i32 0
}
int all(char const *begin, char const *end, int (*fn)(int)) {
  for (; begin < end; ++begin) {
    if (!(*fn)(*begin)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115a <all+0x5a>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%edi
call   *%rax
cmp    $0x0,%eax
jne    1144 <all+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1161 <all+0x61>
jmp    1149 <all+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <all+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%r14d
cmp    %rsi,%rdi
jae    114a <all+0x4a>
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%r12
sub    %rdi,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r12,%rbx,1),%edi
call   *%r15
test   %eax,%eax
je     1147 <all+0x47>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <all+0x30>
jmp    114a <all+0x4a>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @all(i8* %0, i8* readnone %1, i32 (i32)* nocapture %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = ptrtoint i8* %1 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = getelementptr i8, i8* %0, i64 %8
br label %12
10: ; preds = %12
%11 = icmp eq i8* %18, %9
br i1 %11, label %19, label %12
12: ; preds = %5, %10
%13 = phi i8* [ %18, %10 ], [ %0, %5 ]
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = tail call i32 %2(i32 %15)
%17 = icmp eq i32 %16, 0
%18 = getelementptr inbounds i8, i8* %13, i64 1
br i1 %17, label %19, label %10
19: ; preds = %12, %10, %3
%20 = phi i32 [ 1, %3 ], [ 1, %10 ], [ 0, %12 ]
ret i32 %20
}
unsigned short complement(unsigned short x) { return ~x; }


x86 assembly (clang, -O0):
<complement>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
xor    $0xffffffff,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @complement(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = xor i32 %4, -1
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @complement(i16 zeroext %0) {
%2 = xor i16 %0, -1
ret i16 %2
}
/* Variables and functions */
char *strndup(char const *, int);
char *strrchr(char const *, char);
char *directory_from_filename(const char *filename) {
  const char *last_slash = strrchr(filename, '/');
  char *directory = NULL;
  if (last_slash)
    directory = strndup(filename, last_slash - filename);
  return directory;
}


x86 assembly (clang, -O0):
<directory_from_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <directory_from_filename+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1040 <strndup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<directory_from_filename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1140 <directory_from_filename+0x20>
sub    %ebx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <strndup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @directory_from_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %3
store i8* null, i8** %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
%17 = call i8* @strndup(i8* %10, i32 %16)
store i8* %17, i8** %4
br label %18
18: ; preds = %9, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @directory_from_filename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = tail call i8* @strndup(i8* %0, i32 %8)
br label %10
10: ; preds = %4, %1
%11 = phi i8* [ %9, %4 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void myexit(int n) { exit(n); }


x86 assembly (clang, -O0):
<myexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<myexit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @myexit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void Delay() {
  int c = 16384;
  while (c) {
    c--;
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4000,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <Delay+0x23>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <Delay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Delay() {
ret void
}
void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep,
                             struct prcmu_auto_pm_config *idle) {}


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

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

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

LLVM IR (-O2):
%struct.prcmu_auto_pm_config = type opaque
define void @prcmu_configure_auto_pm(%struct.prcmu_auto_pm_config* nocapture %0, %struct.prcmu_auto_pm_config* nocapture %1) {
ret void
}
unsigned int next_power_of_two4(unsigned int n) {
  n = n - 1;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  return n + 1;
}


x86 assembly (clang, -O0):
<next_power_of_two4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two4>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_power_of_two4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @next_power_of_two4(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ display_menu();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ process_choice();
int /*<<< orphan*/ stdscr;
int main() {
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, TRUE);
  int forever = 1;
  while (forever) {
    display_menu();
    process_choice();
  }
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11cf <main+0x5f>
mov    $0x0,%al
call   1030 <display_menu@plt>
mov    $0x0,%al
call   1050 <process_choice@plt>
jmp    11b2 <main+0x42>
mov    $0x0,%al
call   1080 <endwin@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    0x2e5a(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
nopl   (%rax)
xor    %eax,%eax
call   1030 <display_menu@plt>
xor    %eax,%eax
call   1050 <process_choice@plt>
jmp    1190 <main+0x30>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initscr()
%4 = call i32 (...) @cbreak()
%5 = call i32 (...) @noecho()
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @TRUE
%8 = call i32 @keypad(i32 %6, i32 %7)
store i32 1, i32* %2
br label %9
9: ; preds = %12, %0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = call i32 (...) @display_menu()
%14 = call i32 (...) @process_choice()
br label %9
15: ; preds = %9
%16 = call i32 (...) @endwin()
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
br label %7
7: ; preds = %7, %0
%8 = tail call i32 (...) @display_menu()
%9 = tail call i32 (...) @process_choice()
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkC() {
  blinkdash();
  blinkdot();
  blinkdash();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xea8(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkC>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkC() {
%1 = call i32 (...) @blinkdash()
%2 = call i32 (...) @blinkdot()
%3 = call i32 (...) @blinkdash()
%4 = call i32 (...) @blinkdot()
%5 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkC() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int f_normal() { return fputs("[0m", stdout); }


x86 assembly (clang, -O0):
<f_normal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_normal>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define i32 @f_normal() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define i32 @f_normal() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
signed int f1(signed int v_foo) {
  signed int v_shr = ((unsigned int)v_foo) >> 10;
  signed int v_and = v_shr & 1;
  return v_and;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = lshr i32 %0, 10
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
scalar_t__ roadmap_screen_show_screen_icons();
int roadmap_screen_touched_state();
int roadmap_screen_show_icons_only_when_touched(void) {
  if (roadmap_screen_show_screen_icons())
    return 0;
  return roadmap_screen_touched_state();
}


x86 assembly (clang, -O0):
<roadmap_screen_show_icons_only_when_touched>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <roadmap_screen_show_screen_icons@plt>
cmp    $0x0,%rax
je     1145 <roadmap_screen_show_icons_only_when_touched+0x25>
movl   $0x0,-0x4(%rbp)
jmp    114f <roadmap_screen_show_icons_only_when_touched+0x2f>
mov    $0x0,%al
call   1040 <roadmap_screen_touched_state@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_screen_show_icons_only_when_touched>:
push   %rax
xor    %eax,%eax
call   1030 <roadmap_screen_show_screen_icons@plt>
test   %rax,%rax
je     1131 <roadmap_screen_show_icons_only_when_touched+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <roadmap_screen_touched_state@plt>

LLVM IR (-O0):
define i32 @roadmap_screen_show_icons_only_when_touched() {
%1 = alloca i32
%2 = call i64 (...) @roadmap_screen_show_screen_icons()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @roadmap_screen_touched_state()
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @roadmap_screen_show_icons_only_when_touched() {
%1 = tail call i64 (...) @roadmap_screen_show_screen_icons()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @roadmap_screen_touched_state()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int lib_a(int);
int foo(void) { return lib_a(0xfff); }


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

x86 assembly (clang, -O2):
<foo>:
mov    $0xfff,%edi
jmp    1030 <lib_a@plt>

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 @lib_a(i32 4095)
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @lib_a(i32 4095)
ret i32 %1
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t lt_int8_t(int8_t a, int8_t b) { return a < b; }


x86 assembly (clang, -O0):
<lt_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_int8_t>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @lt_int8_t(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt_int8_t(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ lfix_current();
scalar_t__ lfix_longest();
int /*<<< orphan*/ lfix_set_longest();
void lfix_update_longest(void) {
  if (lfix_current() > lfix_longest()) {
    lfix_set_longest();
  }
}


x86 assembly (clang, -O0):
<lfix_update_longest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <lfix_current@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <lfix_longest@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
jle    1161 <lfix_update_longest+0x31>
mov    $0x0,%al
call   1030 <lfix_set_longest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfix_update_longest>:
push   %rbx
xor    %eax,%eax
call   1050 <lfix_current@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <lfix_longest@plt>
cmp    %rax,%rbx
jle    114f <lfix_update_longest+0x1f>
xor    %eax,%eax
pop    %rbx
jmp    1030 <lfix_set_longest@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @lfix_update_longest() {
%1 = call i64 (...) @lfix_current()
%2 = call i64 (...) @lfix_longest()
%3 = icmp sgt i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @lfix_set_longest()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @lfix_update_longest() {
%1 = tail call i64 (...) @lfix_current()
%2 = tail call i64 (...) @lfix_longest()
%3 = icmp sgt i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @lfix_set_longest()
br label %6
6: ; preds = %4, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;
typedef int int16_t;

/* Variables and functions */
int le_to_u16(int /*<<< orphan*/ const *);
int16_t le_to_i16(const uint8_t *buf) {
  uint16_t v = le_to_u16(buf);
  return v < 0x8000 ? v : -((int16_t)(0xffff - v)) - 1;
}


x86 assembly (clang, -O0):
<le_to_i16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <le_to_u16@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x8000,-0xc(%rbp)
jge    1140 <le_to_i16+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <le_to_i16+0x42>
mov    $0xffff,%ecx
sub    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_i16>:
push   %rax
call   1030 <le_to_u16@plt>
lea    -0x10000(%rax),%ecx
cmp    $0x8000,%eax
cmovge %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @le_to_i16(i32* %0) {
%2 = tail call i32 @le_to_u16(i32* %0)
%3 = icmp slt i32 %2, 32768
%4 = add i32 %2, -65536
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
int main() { return 'a'; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 97
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void simprim_p_0947159679_init() {
  xsi_register_didat(
      "simprim_p_0947159679",
      "isim/RPN_toplevel_isim_par.exe.sim/simprim/p_0947159679.didat");
}


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

x86 assembly (clang, -O2):
<simprim_p_0947159679_init>:
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
jmp    1030 <xsi_register_didat@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"simprim_p_0947159679\00"
@.str.1 = [62 x i8] c"isim/RPN_toplevel_isim_par.exe.sim/simprim/p_0947159679.didat\00"
define void @simprim_p_0947159679_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"simprim_p_0947159679\00"
@.str.1 = [62 x i8] c"isim/RPN_toplevel_isim_par.exe.sim/simprim/p_0947159679.didat\00"
define void @simprim_p_0947159679_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int isnotrule(char *word) {
  if (!strcmp(word, "<not>"))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isnotrule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <isnotrule+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isnotrule+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnotrule>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"<not>\00"
define i32 @isnotrule(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printusage(char *command) { printf(" Usage: %s ", command); }


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

x86 assembly (clang, -O2):
<printusage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c" Usage: %s \00"
define void @printusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" Usage: %s \00"
define void @printusage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int CHAR_BIT;
size_t SIZE_MAX;
size_t rotl_sz(size_t x, int n) {
  return ((x << n) | (x >> ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX;
}


x86 assembly (clang, -O0):
<rotl_sz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    %cl,%rax
mov    -0x8(%rbp),%rdx
mov    0x2ec0(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
movslq -0xc(%rbp),%rsi
sub    %rsi,%rcx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    0x2e92(%rip),%rcx
and    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl_sz>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    %cl,%rax
mov    0x2ed1(%rip),%rdx
mov    (%rdx),%edx
shl    $0x3,%edx
sub    %esi,%edx
mov    %edx,%ecx
shr    %cl,%rdi
or     %rdi,%rax
mov    0x2eab(%rip),%rcx
and    (%rcx),%rax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
@SIZE_MAX = global i64 0
define i64 @rotl_sz(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 = zext i32 %6 to i64
%8 = shl i64 %5, %7
%9 = load i64, i64* %3
%10 = load i32, i32* @CHAR_BIT
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = sub i64 %12, %14
%16 = lshr i64 %9, %15
%17 = or i64 %8, %16
%18 = load i64, i64* @SIZE_MAX
%19 = and i64 %17, %18
ret i64 %19
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
@SIZE_MAX = global i64 0
define i64 @rotl_sz(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 %0, %3
%5 = load i32, i32* @CHAR_BIT
%6 = sext i32 %5 to i64
%7 = shl nsw i64 %6, 3
%8 = sext i32 %1 to i64
%9 = sub nsw i64 %7, %8
%10 = lshr i64 %0, %9
%11 = or i64 %10, %4
%12 = load i64, i64* @SIZE_MAX
%13 = and i64 %11, %12
ret i64 %13
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *xmalloc_fatal(size_t);
void *xcalloc(size_t nmemb, size_t size) {
  void *ptr = calloc(nmemb, size);
  if (ptr == NULL) {
    return xmalloc_fatal(nmemb * size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1163 <xcalloc+0x43>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <xmalloc_fatal@plt>
mov    %rax,-0x8(%rbp)
jmp    116b <xcalloc+0x4b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <calloc@plt>
test   %rax,%rax
je     113c <xcalloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
imul   %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xmalloc_fatal@plt>

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

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = tail call i8* @xmalloc_fatal(i64 %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ %3, %2 ]
ret i8* %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mpga_set_original(uint8_t *p_mpga) { p_mpga[3] |= 0x40; }


x86 assembly (clang, -O0):
<mpga_set_original>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
or     $0x40,%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_set_original>:
orb    $0x40,0xc(%rdi)
ret

LLVM IR (-O0):
define void @mpga_set_original(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = or i32 %5, 64
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mpga_set_original(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = or i32 %3, 64
store i32 %4, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int);
pid_t setsid(void) { return syscall(66); }


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

x86 assembly (clang, -O2):
<setsid>:
mov    $0x42,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @setsid() {
%1 = call i32 @syscall(i32 66)
ret i32 %1
}

LLVM IR (-O2):
define i32 @setsid() {
%1 = tail call i32 @syscall(i32 66)
ret i32 %1
}
int fun745() { return 745; }


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

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

LLVM IR (-O0):
define i32 @fun745() {
ret i32 745
}

LLVM IR (-O2):
define i32 @fun745() {
ret i32 745
}
void rotr(int *a, int *b, int *c) {
  int helper1, helper2;
  helper1 = *a;
  helper2 = *b;
  *a = *c;
  *b = helper1;
  *c = helper2;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%r8d
mov    (%rsi),%ecx
mov    (%rdx),%eax
mov    %eax,(%rdi)
mov    %r8d,(%rsi)
mov    %ecx,(%rdx)
ret

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

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
store i32 %6, i32* %0
store i32 %4, i32* %1
store i32 %5, i32* %2
ret void
}
unsigned short int f62(unsigned short int x, long int y) {
  return (x << (8 * sizeof(unsigned short) - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f62>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f62>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 16, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = xor i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 16, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
int do_430() { return 430; }


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

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

LLVM IR (-O0):
define i32 @do_430() {
ret i32 430
}

LLVM IR (-O2):
define i32 @do_430() {
ret i32 430
}
/* Variables and functions */
int /*<<< orphan*/ at_init();
int /*<<< orphan*/ ide_init();
int /*<<< orphan*/ wd76c10_init();
void at_wd76c10_init() {
  at_init();
  ide_init();
  wd76c10_init();
}


x86 assembly (clang, -O0):
<at_wd76c10_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <at_init@plt>
mov    $0x0,%al
call   1050 <ide_init@plt>
mov    $0x0,%al
call   1040 <wd76c10_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_wd76c10_init>:
push   %rax
xor    %eax,%eax
call   1030 <at_init@plt>
xor    %eax,%eax
call   1050 <ide_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <wd76c10_init@plt>

LLVM IR (-O0):
define void @at_wd76c10_init() {
%1 = call i32 (...) @at_init()
%2 = call i32 (...) @ide_init()
%3 = call i32 (...) @wd76c10_init()
ret void
}

LLVM IR (-O2):
define void @at_wd76c10_init() {
%1 = tail call i32 (...) @at_init()
%2 = tail call i32 (...) @ide_init()
%3 = tail call i32 (...) @wd76c10_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateGPIORetentionDisable(void) {
  (*((volatile unsigned long *)(0x400FC010))) &= ~0x00000100;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateGPIORetentionDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffeff,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateGPIORetentionDisable>:
andq   $0xfffffffffffffeff,0x400fc010
40 ff fe ff ff
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateGPIORetentionDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -257
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateGPIORetentionDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -257
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Type definitions */
struct stat {
  unsigned int st_ino;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ perror(char *);
unsigned int get_inode_num(int fd) {
  struct stat st;
  if (fstat(fd, &st) < 0) {
    perror("fstat");
    return 0;
  }
  return st.st_ino;
}


x86 assembly (clang, -O0):
<get_inode_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jge    1159 <get_inode_num+0x39>
lea    0xeb8(%rip),%rdi
call   1030 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    115f <get_inode_num+0x3f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_inode_num>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
js     1133 <get_inode_num+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [6 x i8] c"fstat\00"
define i32 @get_inode_num(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 0, %6 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compstr(const void *m1, const void *m2) {
  const char *s1 = *((const char *const *)m1);
  const char *s2 = *((const char *const *)m2);
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<compstr>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compstr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}