xunge/DecIR huggingface dataset:
int INC_ML(int a) { return (++a == 1000 ? 0 : a); }


x86 assembly (clang, -O0):
<INC_ML>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x3e8,%eax
jne    1125 <INC_ML+0x25>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <INC_ML+0x2b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<INC_ML>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x3e8,%ecx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @INC_ML(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %9
9: ; preds = %7, %6
%10 = phi i32 [ 0, %6 ], [ %8, %7 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @INC_ML(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = icmp eq i32 %2, 1000
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
uint64_t timeval_to_ms(struct timeval tv) {
  return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<timeval_to_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_ms>:
imul   $0x3e8,%edi,%ecx
sar    $0x20,%rdi
imul   $0x10624dd3,%rdi,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timeval_to_ms(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i64*
store i64 %0, i64* %3
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @timeval_to_ms(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i64 %0, 32
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %2, 1000
%6 = sdiv i32 %4, 1000
%7 = add nsw i32 %6, %5
ret i32 %7
}
/* Type definitions */
struct timeval {
  long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void get_time(long *seconds, long *milliseconds) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  *seconds = tv.tv_sec;
  *milliseconds = tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
mov    %rax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define void @get_time(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca %struct.timeval
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @get_time(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
store i64 %11, i64* %1
ret void
}
int dummy(void) {
  int rc = 0;
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @dummy() {
ret i32 0
}
/* Variables and functions */
int numstrcmp(char *, char *);
int pnumstrcmp(const void *a, const void *b) {
  return numstrcmp(*(char **)a, *(char **)b);
}


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

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

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

LLVM IR (-O2):
define i32 @pnumstrcmp(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 @numstrcmp(i8* %4, i8* %6)
ret i32 %7
}
int invert(int x, int p, int n) { return (x ^ ((~(~0 << n)) << (p - n + 1))); }


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = shl i32 %10, %14
%16 = xor i32 %7, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = add i32 %1, 1
%7 = sub i32 %6, %2
%8 = shl i32 %5, %7
%9 = xor i32 %8, %0
ret i32 %9
}
int get_gtk_mimetype(const char *filename, char *buf) { return -1; }


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

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

LLVM IR (-O0):
define i32 @get_gtk_mimetype(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @get_gtk_mimetype(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
int fun689() { return 689; }


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

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

LLVM IR (-O0):
define i32 @fun689() {
ret i32 689
}

LLVM IR (-O2):
define i32 @fun689() {
ret i32 689
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void WatchdogStallEnable(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  (*((volatile unsigned long *)(ulBase + 0x00000418))) |= 0x00000100;
}


x86 assembly (clang, -O0):
<WatchdogStallEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <WatchdogStallEnable+0x2d>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x418(%rax),%rcx
or     $0x100,%rcx
mov    %rcx,0x418(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogStallEnable>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40000000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
orq    $0x100,0x418(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogStallEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 1048
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = or i64 %15, 256
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @WatchdogStallEnable(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 1048
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, 256
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute_speed_for_racer();
int main(void) {
  compute_speed_for_racer();
  compute_speed_for_racer();
  compute_speed_for_racer();
  compute_speed_for_racer();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @compute_speed_for_racer()
%2 = tail call i32 (...) @compute_speed_for_racer()
%3 = tail call i32 (...) @compute_speed_for_racer()
%4 = tail call i32 (...) @compute_speed_for_racer()
ret i32 0
}
char internal_sign_b(char value) {
  return (value >= 0 ? (value == 0 ? 0 : 1) : -1);
}


x86 assembly (clang, -O0):
<internal_sign_b>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     1130 <internal_sign_b+0x30>
movsbl -0x1(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <internal_sign_b+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <internal_sign_b+0x3d>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_sign_b>:
xor    %ecx,%ecx
test   %dil,%dil
setne  %cl
mov    $0xff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @internal_sign_b(i8 signext %0) {
%2 = icmp sgt i8 %0, -1
%3 = icmp ne i8 %0, 0
%4 = zext i1 %3 to i8
%5 = select i1 %2, i8 %4, i8 -1
ret i8 %5
}
/* Variables and functions */
unsigned int ClearN(unsigned int, int);
int /*<<< orphan*/ PrintBits(unsigned int);
unsigned int SetN(unsigned int, int);
unsigned int ToggleN(unsigned int, int);
int main() {
  unsigned int val = 27;
  PrintBits(val);
  val = SetN(val, 5);
  PrintBits(val);
  val = ClearN(val, 5);
  PrintBits(val);
  val = ToggleN(val, 5);
  PrintBits(val);
  PrintBits(val ^ 0x55555555);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <PrintBits@plt>
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1040 <SetN@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <PrintBits@plt>
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1030 <ClearN@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <PrintBits@plt>
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1060 <ToggleN@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <PrintBits@plt>
mov    -0x8(%rbp),%edi
xor    $0x55555555,%edi
call   1050 <PrintBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1b,%edi
call   1050 <PrintBits@plt>
mov    $0x1b,%edi
mov    $0x5,%esi
call   1040 <SetN@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <PrintBits@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <ClearN@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <PrintBits@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1060 <ToggleN@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <PrintBits@plt>
xor    $0x55555555,%ebx
mov    %ebx,%edi
call   1050 <PrintBits@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 27, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @PrintBits(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @SetN(i32 %5, i32 5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @PrintBits(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @ClearN(i32 %9, i32 5)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @PrintBits(i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @ToggleN(i32 %13, i32 5)
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = call i32 @PrintBits(i32 %15)
%17 = load i32, i32* %2
%18 = xor i32 %17, 1431655765
%19 = call i32 @PrintBits(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @PrintBits(i32 27)
%2 = tail call i32 @SetN(i32 27, i32 5)
%3 = tail call i32 @PrintBits(i32 %2)
%4 = tail call i32 @ClearN(i32 %2, i32 5)
%5 = tail call i32 @PrintBits(i32 %4)
%6 = tail call i32 @ToggleN(i32 %4, i32 5)
%7 = tail call i32 @PrintBits(i32 %6)
%8 = xor i32 %6, 1431655765
%9 = tail call i32 @PrintBits(i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t pack_get_32(uint8_t *buffer, int byteNr) {
  int32_t retVal;
  uint8_t *ptr;
  ptr = (uint8_t *)&retVal;
  *(ptr + 3) = *(buffer + byteNr + 3);
  *(ptr + 2) = *(buffer + byteNr + 2);
  *(ptr + 1) = *(buffer + byteNr + 1);
  *(ptr + 0) = *(buffer + byteNr + 0);
  return (retVal);
}


x86 assembly (clang, -O0):
<pack_get_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    0xc(%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    0x8(%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    0x4(%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_get_32>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pack_get_32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32* %5, i32** %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 3
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 3
store i32 %12, i32* %14
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 2
store i32 %20, i32* %22
%23 = load i32*, i32** %3
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = getelementptr inbounds i32, i32* %26, i64 1
%28 = load i32, i32* %27
%29 = load i32*, i32** %6
%30 = getelementptr inbounds i32, i32* %29, i64 1
store i32 %28, i32* %30
%31 = load i32*, i32** %3
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
%35 = getelementptr inbounds i32, i32* %34, i64 0
%36 = load i32, i32* %35
%37 = load i32*, i32** %6
%38 = getelementptr inbounds i32, i32* %37, i64 0
store i32 %36, i32* %38
%39 = load i32, i32* %5
ret i32 %39
}

LLVM IR (-O2):
define i32 @pack_get_32(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void) { return NULL; }


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

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

LLVM IR (-O0):
define i32* @EVP_aes_256_cbc_hmac_sha1() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @EVP_aes_256_cbc_hmac_sha1() {
ret i32* null
}
int rpgp_is_newline(char c) { return (c == 10) || (c == 13); }


x86 assembly (clang, -O0):
<rpgp_is_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1129 <rpgp_is_newline+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpgp_is_newline>:
cmp    $0xa,%dil
sete   %al
cmp    $0xd,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @rpgp_is_newline(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
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 @rpgp_is_newline(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 13
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void PEM_proc_type(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_proc_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ towers(int, char, char, char);
int main(void) {
  int n;
  printf("Enter the number of disks on Tower A: ");
  scanf("%d", &n);
  printf("The Tower of Hanoi involves the moves :\n");
  towers(n, 'A', 'B', 'C');
  printf("\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    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <towers@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1070 <towers@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Enter the number of disks on Tower A: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 x i8] c"The Tower of Hanoi involves the moves :\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 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 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @towers(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Enter the number of disks on Tower A: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [40 x i8] c"The Tower of Hanoi involves the moves :\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 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 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @towers(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
%8 = call i32 @putchar(i32 10)
ret i32 0
}
void edit_file(char *name, char *data) {}


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

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

LLVM IR (-O0):
define void @edit_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @edit_file(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *getxattr;
int main(int argc, char *argv[]) {
  void *p;
  (void)argc;
  (void)argv;
  p = getxattr;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@getxattr = global i8* null
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** @getxattr
store i8* %9, i8** %6
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@getxattr = global i8* null
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
int fun1083() { return 1083; }


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

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

LLVM IR (-O0):
define i32 @fun1083() {
ret i32 1083
}

LLVM IR (-O2):
define i32 @fun1083() {
ret i32 1083
}
/* Variables and functions */
scalar_t__ binary_reader_read_7bit_int(char *, int *, int *);
int binary_reader_read_string_buffer(char *buf, int pos, int *out_len,
                                     char **out_value) {
  if (binary_reader_read_7bit_int(buf, &pos, out_len) < 0) {
    return -1;
  }
  *out_value = (char *)(buf + pos);
  return 0;
}


x86 assembly (clang, -O0):
<binary_reader_read_string_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    -0x14(%rbp),%rsi
call   1030 <binary_reader_read_7bit_int@plt>
cmp    $0x0,%rax
jge    114e <binary_reader_read_string_buffer+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <binary_reader_read_string_buffer+0x57>
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_reader_read_string_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <binary_reader_read_7bit_int@plt>
test   %rax,%rax
js     113c <binary_reader_read_string_buffer+0x2c>
movslq 0x4(%rsp),%rax
add    %rax,%rbx
mov    %rbx,(%r14)
xor    %eax,%eax
jmp    1141 <binary_reader_read_string_buffer+0x31>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @binary_reader_read_string_buffer(i8* %0, i32 %1, i32* %2, i8** nocapture writeonly %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = call i64 @binary_reader_read_7bit_int(i8* %0, i32* %5, i32* %2)
%7 = icmp slt i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8* %11, i8** %3
br label %12
12: ; preds = %4, %8
%13 = phi i32 [ 0, %8 ], [ -1, %4 ]
ret i32 %13
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
__attribute__((always_)) uint8_t ror8(uint8_t data, unsigned int rotation) {
  return ((data >> rotation) | (data << (8 - rotation)));
}


x86 assembly (clang, -O0):
<ror8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror8>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
mov    $0x8,%dl
sub    %cl,%dl
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror8(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 8, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror8(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 8, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int fib(int n) {
  if (n <= 1)
    return 1;
  return fib(n - 2) + fib(n - 1);
}


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

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

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 3
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_36(void) {
  if (*(uint32_t *)0x10000130ul == 0x8ul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x1ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x2ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1175 <errata_36+0x75>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_36+0x34>
movl   $0x1,-0x4(%rbp)
jmp    117c <errata_36+0x7c>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1152 <errata_36+0x52>
movl   $0x1,-0x4(%rbp)
jmp    117c <errata_36+0x7c>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x2,%rax
jne    1170 <errata_36+0x70>
movl   $0x1,-0x4(%rbp)
jmp    117c <errata_36+0x7c>
jmp    1175 <errata_36+0x75>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @errata_36() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t timer_value(uint32_t *timer) { return timer[0x050 / 4]; }


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

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

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

LLVM IR (-O2):
define i32 @timer_value(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 20
%3 = load i32, i32* %2
ret i32 %3
}
int do_280() { return 280; }


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

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

LLVM IR (-O0):
define i32 @do_280() {
ret i32 280
}

LLVM IR (-O2):
define i32 @do_280() {
ret i32 280
}
/* Variables and functions */
int cgetc();
int cgetw();
int /*<<< orphan*/ cputs(char *);
int /*<<< orphan*/ cwait(int);
int /*<<< orphan*/ printf(char *, int, int, int);
void beep(void) {
  int a, b, c;
  cputs("$$$");
  cwait(('o' << 8) | 'k');
  a = cgetc();
  b = cgetc();
  c = cgetw();
  cwait(0x0a0d);
  printf("beep: Cnt=%d Alive=%d SelfTest=%d\n", a, b, c);
}


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1050 <cputs@plt>
mov    $0x6f6b,%edi
call   1030 <cwait@plt>
mov    $0x0,%al
call   1060 <cgetc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <cgetc@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <cgetw@plt>
mov    %eax,-0xc(%rbp)
mov    $0xa0d,%edi
call   1030 <cwait@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep>:
push   %rbp
push   %r14
push   %rbx
lea    0xea5(%rip),%rdi
call   1050 <cputs@plt>
mov    $0x6f6b,%edi
call   1030 <cwait@plt>
xor    %eax,%eax
call   1060 <cgetc@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <cgetc@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1070 <cgetw@plt>
mov    %eax,%ebx
mov    $0xa0d,%edi
call   1030 <cwait@plt>
lea    0xe6d(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"$$$\00"
@.str.1 = [35 x i8] c"beep: Cnt=%d Alive=%d SelfTest=%d\0A\00"
define void @beep() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @cputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @cwait(i32 28523)
%6 = call i32 (...) @cgetc()
store i32 %6, i32* %1
%7 = call i32 (...) @cgetc()
store i32 %7, i32* %2
%8 = call i32 (...) @cgetw()
store i32 %8, i32* %3
%9 = call i32 @cwait(i32 2573)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"$$$\00"
@.str.1 = [35 x i8] c"beep: Cnt=%d Alive=%d SelfTest=%d\0A\00"
define void @beep() {
%1 = tail call i32 @cputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cwait(i32 28523)
%3 = tail call i32 (...) @cgetc()
%4 = tail call i32 (...) @cgetc()
%5 = tail call i32 (...) @cgetw()
%6 = tail call i32 @cwait(i32 2573)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret void
}
void gtk_action_group_add_action() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_add_action() {
ret void
}
int test_imm_3Aint64_lowword_reg(long long val) {
  return ((val) & (0x3A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Aint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x3a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Aint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 58
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _writefsbase_u32(unsigned int);
void write_fs_base32(unsigned int base) { _writefsbase_u32(base); }


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

x86 assembly (clang, -O2):
<write_fs_base32>:
jmp    1030 <_writefsbase_u32@plt>

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

LLVM IR (-O2):
define void @write_fs_base32(i32 %0) {
%2 = tail call i32 @_writefsbase_u32(i32 %0)
ret void
}
float getADCValue() { return 0; }


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

x86 assembly (clang, -O2):
<getADCValue>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @getADCValue() {
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @getADCValue() {
ret float 0.000000e+00
}
int h(double i) { return i >= i + 2.0; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 2.000000e+00
%6 = fcmp oge double %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @h(double %0) {
%2 = fadd double %0, 2.000000e+00
%3 = fcmp ole double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
bool startsWith(const char *base, const char *str) {
  size_t blen = strlen(base);
  size_t slen = strlen(str);
  return (blen < slen) ? false : (strncmp(str, base, slen) == 0);
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1162 <startsWith+0x42>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1182 <startsWith+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rbx
jb     115b <startsWith+0x3b>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %1, i8* %0, i64 %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int *, int);
int rand();
int get_rand(void *data, int len) {
  int rv = 0;
  int fd;
  fd = rand();
  if (fd == 0)
    fd = 1;
  if (len > sizeof(int))
    len = sizeof(int);
  memcpy(data, &fd, len);
  return rv;
}


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1151 <get_rand+0x31>
movl   $0x1,-0x14(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x4,%rax
jbe    1166 <get_rand+0x46>
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    -0x14(%rbp),%rsi
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <rand@plt>
test   %eax,%eax
mov    $0x1,%ecx
cmovne %eax,%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x4,%ebx
mov    $0x4,%edx
cmovb  %ebx,%edx
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @get_rand(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @rand()
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 %5
store i32 %7, i32* %3
%8 = icmp ult i32 %1, 4
%9 = select i1 %8, i32 %1, i32 4
%10 = call i32 @memcpy(i8* %0, i32* %3, i32 %9)
ret i32 0
}
int ac_cpuinfo(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ac_cpuinfo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sat_oom(size_t, size_t);
void *sat_realloc(void *, size_t);
void *sat_realloc2(void *old, size_t num, size_t len) {
  if (len && (num * len) / len != num)
    sat_oom(num, len);
  return sat_realloc(old, num * len);
}


x86 assembly (clang, -O0):
<sat_realloc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1167 <sat_realloc2+0x47>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    -0x10(%rbp),%rax
je     1167 <sat_realloc2+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <sat_oom@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
call   1030 <sat_realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_realloc2>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
test   %rdx,%rdx
je     1146 <sat_realloc2+0x26>
mov    %rbx,%rax
mul    %r15
jno    1146 <sat_realloc2+0x26>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <sat_oom@plt>
imul   %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <sat_realloc@plt>

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

LLVM IR (-O2):
define i8* @sat_realloc2(i8* %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %2, i64 %1)
%7 = extractvalue { i64, i1 } %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @sat_oom(i64 %1, i64 %2)
br label %10
10: ; preds = %8, %5, %3
%11 = mul i64 %2, %1
%12 = tail call i8* @sat_realloc(i8* %0, i64 %11)
ret i8* %12
}
int floatformat_always_valid(fmt, from) const struct floatformat *fmt
    __attribute__((__unused__));
const char *from __attribute__((__unused__));
{ return 1; }


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

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

LLVM IR (-O0):
%struct.floatformat = type opaque
define i32 @floatformat_always_valid(%struct.floatformat* %0, i8* %1) {
%3 = alloca %struct.floatformat*
%4 = alloca i8*
store %struct.floatformat* %0, %struct.floatformat** %3
store i8* %1, i8** %4
ret i32 1
}

LLVM IR (-O2):
%struct.floatformat = type opaque
define i32 @floatformat_always_valid(%struct.floatformat* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}