xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getAddress(uint32_t instruction) {
  uint32_t mask = 0x03ffffff;
  return mask & instruction;
}


x86 assembly (clang, -O0):
<getAddress>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3ffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAddress>:
mov    %edi,%eax
and    $0x3ffffff,%eax
ret

LLVM IR (-O0):
define i32 @getAddress(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 67108863, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = and i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @getAddress(i32 %0) {
%2 = and i32 %0, 67108863
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ redirLogMode(char *, char *);
void redirLogAppend(char *fileName) { redirLogMode(fileName, "a"); }


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

x86 assembly (clang, -O2):
<redirLogAppend>:
lea    0xee9(%rip),%rsi
jmp    1030 <redirLogMode@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @redirLogAppend(i8* %0) {
%2 = tail call i32 @redirLogMode(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int g();
int h(int);
int /*<<< orphan*/ i(int);
int main() {
  __attribute__((type_annotate("tainted"))) int x = 5;
  int y = 10;
  f(x);
  f(y);
  i(x);
  i(y);
  y = g();
  x = g();
  y = h(1);
  x = h(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    -0xc(%rbp),%edi
call   1040 <f@plt>
mov    -0x8(%rbp),%edi
call   1060 <i@plt>
mov    -0xc(%rbp),%edi
call   1060 <i@plt>
mov    $0x0,%al
call   1050 <g@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <g@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <h@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <h@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <f@plt>
mov    $0xa,%edi
call   1040 <f@plt>
mov    $0x5,%edi
call   1060 <i@plt>
mov    $0xa,%edi
call   1060 <i@plt>
xor    %eax,%eax
call   1050 <g@plt>
xor    %eax,%eax
call   1050 <g@plt>
mov    $0x1,%edi
call   1030 <h@plt>
mov    $0x1,%edi
call   1030 <h@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @f(i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @f(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @i(i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @i(i32 %10)
%12 = call i32 (...) @g()
store i32 %12, i32* %3
%13 = call i32 (...) @g()
store i32 %13, i32* %2
%14 = call i32 @h(i32 1)
store i32 %14, i32* %3
%15 = call i32 @h(i32 1)
store i32 %15, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
%2 = tail call i32 @f(i32 10)
%3 = tail call i32 @i(i32 5)
%4 = tail call i32 @i(i32 10)
%5 = tail call i32 (...) @g()
%6 = tail call i32 (...) @g()
%7 = tail call i32 @h(i32 1)
%8 = tail call i32 @h(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void V_readzipped(char c, FILE *fp) {}


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

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

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

LLVM IR (-O2):
define void @V_readzipped(i8 signext %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ perm_t2b(char *);
int strlen(char *);
int is_unix_file_entry(char *s) {
  if (strlen(s) < 10)
    return 0;
  if (s[10] != ' ')
    return 0;
  if (perm_t2b(s) == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_unix_file_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xa,%eax
jge    114a <is_unix_file_entry+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    118d <is_unix_file_entry+0x6d>
mov    -0x10(%rbp),%rax
movsbl 0xa(%rax),%eax
cmp    $0x20,%eax
je     1167 <is_unix_file_entry+0x47>
movl   $0x0,-0x4(%rbp)
jmp    118d <is_unix_file_entry+0x6d>
mov    -0x10(%rbp),%rdi
call   1040 <perm_t2b@plt>
cmp    $0x0,%rax
jne    1186 <is_unix_file_entry+0x66>
movl   $0x0,-0x4(%rbp)
jmp    118d <is_unix_file_entry+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unix_file_entry>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
jl     114b <is_unix_file_entry+0x2b>
cmpb   $0x20,0xa(%rbx)
jne    114b <is_unix_file_entry+0x2b>
mov    %rbx,%rdi
call   1040 <perm_t2b@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_unix_file_entry(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 10
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 10
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i64 @perm_t2b(i8* %0)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %4, %1
%13 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %11, %8 ]
ret i32 %13
}
OP(ed, ac) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
int align(int a, int n) { return (a / n) * n; }


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

x86 assembly (clang, -O2):
<align>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @align(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub i32 %0, %3
ret i32 %4
}
int test_imm_62uint8_mem(unsigned char *val) {
  return ((*val) & (0x62 << 0)) ? -20 : -40;
}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @fun451() {
ret i32 451
}

LLVM IR (-O2):
define i32 @fun451() {
ret i32 451
}
/* Variables and functions */
int init_reset();
int lll_df_reset(void) { return init_reset(); }


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

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

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

LLVM IR (-O2):
define i32 @lll_df_reset() {
%1 = tail call i32 (...) @init_reset()
ret i32 %1
}
unsigned char *sha256digest(bitstr, bitcnt)
unsigned char *bitstr;
unsigned long bitcnt;
{ return ((unsigned char *)shacomp(256, 1, bitstr, bitcnt)); }


x86 assembly (clang, -O0):
<sha256digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x100,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <shacomp@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha256digest>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x100,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <shacomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sha256digest(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 256, i32 1, i8* %5, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @sha256digest(i8* %0, i64 %1) {
%3 = tail call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 256, i32 1, i8* %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int y;
  foo(y);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 undef)
ret i32 0
}
void __attribute__((weak)) cryp_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<cryp_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cryp_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.cryp_isr = [9 x i8] c"cryp_isr\00"
define weak void @cryp_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.cryp_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.cryp_isr = [9 x i8] c"cryp_isr\00"
define weak void @cryp_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.cryp_isr, i64 0, i64 0))
ret void
}
void swap(struct feed **p1, struct feed **p2) {
  struct feed *p;
  p = *p1;
  *p1 = *p2;
  *p2 = p;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
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),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
%struct.feed = type opaque
define void @swap(%struct.feed** %0, %struct.feed** %1) {
%3 = alloca %struct.feed**
%4 = alloca %struct.feed**
%5 = alloca %struct.feed*
store %struct.feed** %0, %struct.feed*** %3
store %struct.feed** %1, %struct.feed*** %4
%6 = load %struct.feed**, %struct.feed*** %3
%7 = load %struct.feed*, %struct.feed** %6
store %struct.feed* %7, %struct.feed** %5
%8 = load %struct.feed**, %struct.feed*** %4
%9 = load %struct.feed*, %struct.feed** %8
%10 = load %struct.feed**, %struct.feed*** %3
store %struct.feed* %9, %struct.feed** %10
%11 = load %struct.feed*, %struct.feed** %5
%12 = load %struct.feed**, %struct.feed*** %4
store %struct.feed* %11, %struct.feed** %12
ret void
}

LLVM IR (-O2):
%struct.feed = type opaque
define void @swap(%struct.feed** nocapture %0, %struct.feed** nocapture %1) {
%3 = load %struct.feed*, %struct.feed** %0
%4 = load %struct.feed*, %struct.feed** %1
store %struct.feed* %4, %struct.feed** %0
store %struct.feed* %3, %struct.feed** %1
ret void
}
unsigned long hash_key(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_key+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_key+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_key+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_key+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_key(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void SWAP_int(int *val) {
  char *p = (char *)val;
  char t1, t2;
  t1 = p[0];
  t2 = p[1];
  p[0] = p[3];
  p[1] = p[2];
  p[3] = t1;
  p[2] = t2;
}


x86 assembly (clang, -O0):
<SWAP_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x12(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWAP_int>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
mov    0x3(%rdi),%dl
mov    %dl,(%rdi)
mov    0x2(%rdi),%dl
mov    %dl,0x1(%rdi)
mov    %al,0x3(%rdi)
mov    %cl,0x2(%rdi)
ret

LLVM IR (-O0):
define void @SWAP_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = bitcast i32* %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
store i8 %13, i8* %5
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 3
%16 = load i8, i8* %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 %16, i8* %18
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
%24 = load i8, i8* %4
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
%27 = load i8, i8* %5
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 2
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @SWAP_int(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %2, i64 3
%7 = load i8, i8* %6
store i8 %7, i8* %2
%8 = getelementptr inbounds i8, i8* %2, i64 2
%9 = load i8, i8* %8
store i8 %9, i8* %4
store i8 %3, i8* %6
store i8 %5, i8* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t apic_get_version(uint8_t *baseapic) {
  return (*((uint32_t *)&baseapic[0x30])) & 0xff;
}


x86 assembly (clang, -O0):
<apic_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc0(%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<apic_get_version>:
movzbl 0xc0(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @apic_get_version(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 48
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x5_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x5_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x5_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x5_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x5_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ test_sort(int *, int);
int main(int argc, char **argv) {
  int array[] = {1, 6, 3, 9, 11, 5, 4, 7, 2};
  int array2[] = {9, 1, 3, 8, 11, 5, 4, 7, 21};
  test_sort(array, (sizeof(array) / sizeof(array[0])));
  test_sort(array2, (sizeof(array) / sizeof(array[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1040 <test_sort@plt>
lea    -0x70(%rbp),%rdi
mov    $0x9,%esi
call   1040 <test_sort@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf14(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x9,%esi
call   1030 <test_sort@plt>
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <test_sort@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [9 x i32] [i32 1, i32 6, i32 3, i32 9, i32 11, i32 5, i32 4, i32 7, i32 2]
@__const.main.array2 = [9 x i32] [i32 9, i32 1, i32 3, i32 8, i32 11, i32 5, i32 4, i32 7, i32 21]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i32]
%7 = alloca [9 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [9 x i32]* %6 to i8*
%9 = bitcast [9 x i32]* %7 to i8*
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i64 0, i64 0
%11 = call i32 @test_sort(i32* %10, i32 9)
%12 = getelementptr inbounds [9 x i32], [9 x i32]* %7, i64 0, i64 0
%13 = call i32 @test_sort(i32* %12, i32 9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [9 x i32] [i32 1, i32 6, i32 3, i32 9, i32 11, i32 5, i32 4, i32 7, i32 2]
@__const.main.array2 = [9 x i32] [i32 9, i32 1, i32 3, i32 8, i32 11, i32 5, i32 4, i32 7, i32 21]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = alloca [9 x i32]
%5 = bitcast [9 x i32]* %3 to i8*
%6 = bitcast [9 x i32]* %4 to i8*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%8 = call i32 @test_sort(i32* %7, i32 9)
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 0
%10 = call i32 @test_sort(i32* %9, i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, ...);
int strlen(char *);
int set_length_encode_string(char *buf, char *string, int *length) {
  *length = strlen(string);
  memcpy(buf, length, 1);
  memcpy(buf + 1, string, *length);
  *length += 1;
  return *length;
}


x86 assembly (clang, -O0):
<set_length_encode_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
xor    %eax,%eax
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_length_encode_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <memcpy@plt>
add    $0x1,%rbx
mov    (%r15),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <memcpy@plt>
mov    (%r15),%eax
add    $0x1,%eax
mov    %eax,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @set_length_encode_string(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = call i32 @strlen(i8* %7)
%9 = load i32*, i32** %6
store i32 %8, i32* %9
%10 = load i8*, i8** %4
%11 = load i32*, i32** %6
%12 = call i32 (i8*, ...) @memcpy(i8* %10, i32* %11, i32 1)
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8*, i8** %5
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @memcpy(i8* %14, i8* %15, i32 %17)
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
store i32 %21, i32* %19
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @set_length_encode_string(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @strlen(i8* %1)
store i32 %4, i32* %2
%5 = tail call i32 (i8*, ...) @memcpy(i8* %0, i32* %2, i32 1)
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i32, i32* %2
%8 = tail call i32 (i8*, ...) @memcpy(i8* %6, i8* %1, i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
ret i32 %10
}
/* Variables and functions */
unsigned int __inb(unsigned long);
scalar_t__ __is_local(unsigned long);
unsigned int __local_inb(unsigned long);
extern unsigned int inb(unsigned long addr) {
  if (__is_local(addr))
    return __local_inb(addr);
  return __inb(addr);
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <__is_local@plt>
cmp    $0x0,%rax
je     1160 <inb+0x30>
mov    -0x10(%rbp),%rdi
call   1040 <__local_inb@plt>
mov    %eax,-0x4(%rbp)
jmp    116c <inb+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <__inb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
push   %rbx
mov    %rdi,%rbx
call   1050 <__is_local@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1147 <inb+0x17>
pop    %rbx
jmp    1040 <__local_inb@plt>
pop    %rbx
jmp    1030 <__inb@plt>

LLVM IR (-O0):
define i32 @inb(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i64 @__is_local(i64 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i32 @__local_inb(i64 %8)
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = call i32 @__inb(i64 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @inb(i64 %0) {
%2 = tail call i64 @__is_local(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__local_inb(i64 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @__inb(i64 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
double max3(double x1, double x2, double x3) {
  double x = x1 > x2 ? x1 : x2;
  return x > x3 ? x : x3;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1132 <max3+0x32>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    113c <max3+0x3c>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1165 <max3+0x65>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    116f <max3+0x6f>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
maxsd  %xmm1,%xmm0
maxsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @max3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %4
br label %15
13: ; preds = %3
%14 = load double, double* %5
br label %15
15: ; preds = %13, %11
%16 = phi double [ %12, %11 ], [ %14, %13 ]
store double %16, double* %7
%17 = load double, double* %7
%18 = load double, double* %6
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load double, double* %7
br label %24
22: ; preds = %15
%23 = load double, double* %6
br label %24
24: ; preds = %22, %20
%25 = phi double [ %21, %20 ], [ %23, %22 ]
ret double %25
}

LLVM IR (-O2):
define double @max3(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = select i1 %4, double %0, double %1
%6 = fcmp ogt double %5, %2
%7 = select i1 %6, double %5, double %2
ret double %7
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 1373777115U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[local1] = state[0UL] & state[local1];
      state[0UL] |= (state[0UL] & 63U) << 4UL;
      local1++;
    }
    output[0UL] = (state[0UL] - 29120926UL) | 105542227U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x51e22cdb,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    1159 <RandomFunc+0x59>
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
and    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
and    $0x3f,%eax
shl    $0x4,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
sub    $0x1bc599e,%rax
or     $0x64a7253,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x5025d33d,%eax
add    (%rdi),%eax
or     $0x64a7253,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 1344656189
%5 = or i32 %4, 105542227
store i32 %5, i32* %1
ret void
}
/* Type definitions */
struct evloop {
  int dummy;
};
struct ev {
  int dummy;
};

/* Variables and functions */
int _start_ev(struct evloop *, struct ev *);
int evtm_start(struct evloop *loop, struct ev *ev) {
  return _start_ev(loop, ev);
}


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

x86 assembly (clang, -O2):
<evtm_start>:
jmp    1030 <_start_ev@plt>

LLVM IR (-O0):
%struct.evloop = type { i32 }
%struct.ev = type { i32 }
define i32 @evtm_start(%struct.evloop* %0, %struct.ev* %1) {
%3 = alloca %struct.evloop*
%4 = alloca %struct.ev*
store %struct.evloop* %0, %struct.evloop** %3
store %struct.ev* %1, %struct.ev** %4
%5 = load %struct.evloop*, %struct.evloop** %3
%6 = load %struct.ev*, %struct.ev** %4
%7 = call i32 @_start_ev(%struct.evloop* %5, %struct.ev* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.evloop = type { i32 }
%struct.ev = type { i32 }
define i32 @evtm_start(%struct.evloop* %0, %struct.ev* %1) {
%3 = tail call i32 @_start_ev(%struct.evloop* %0, %struct.ev* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int foreach_cb(void *key, void *val, void *p) {
  printf("key:%d, val:%d\n", (int)key, (int)val);
  return 0;
}


x86 assembly (clang, -O0):
<foreach_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"key:%d, val:%d\0A\00"
define i32 @foreach_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"key:%d, val:%d\0A\00"
define i32 @foreach_cb(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = ptrtoint i8* %1 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __VERIFIER_atomic_end() {
  fprintf(stderr, "__VERIFIER_atomic_end() is a no-op\n");
}


x86 assembly (clang, -O0):
<__VERIFIER_atomic_end>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_atomic_end>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"__VERIFIER_atomic_end() is a no-op\0A\00"
define void @__VERIFIER_atomic_end() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"__VERIFIER_atomic_end() is a no-op\0A\00"
define void @__VERIFIER_atomic_end() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_close_pipe() {
  printf("NOT IMPLEMENTED:"
         "pa_close_pipe"
         "\n");
}


x86 assembly (clang, -O0):
<pa_close_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_close_pipe\0A\00"
define i32 @pa_close_pipe() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_close_pipe\00"
define i32 @pa_close_pipe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char tolower(int);
const char *strlwr(char *s) {
  const char *p = s;
  while (*s) {
    *s = tolower((int)*s);
    s++;
  }
  return p;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call signext i8 @tolower(i32 %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ _OS_Restore_TaskSP();
int /*<<< orphan*/ _OS_SET_FSR_CUR_TASK();
int /*<<< orphan*/ _OS_SET_PC();
int /*<<< orphan*/ _OS_STORE_SP();
void _OS_JumpToTask(void) {
  _OS_STORE_SP();
  _OS_Restore_TaskSP();
  _OS_SET_FSR_CUR_TASK();
  _OS_SET_PC();
}


x86 assembly (clang, -O0):
<_OS_JumpToTask>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_OS_STORE_SP@plt>
mov    $0x0,%al
call   1040 <_OS_Restore_TaskSP@plt>
mov    $0x0,%al
call   1050 <_OS_SET_FSR_CUR_TASK@plt>
mov    $0x0,%al
call   1060 <_OS_SET_PC@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_OS_JumpToTask>:
push   %rax
xor    %eax,%eax
call   1030 <_OS_STORE_SP@plt>
xor    %eax,%eax
call   1040 <_OS_Restore_TaskSP@plt>
xor    %eax,%eax
call   1050 <_OS_SET_FSR_CUR_TASK@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <_OS_SET_PC@plt>

LLVM IR (-O0):
define void @_OS_JumpToTask() {
%1 = call i32 (...) @_OS_STORE_SP()
%2 = call i32 (...) @_OS_Restore_TaskSP()
%3 = call i32 (...) @_OS_SET_FSR_CUR_TASK()
%4 = call i32 (...) @_OS_SET_PC()
ret void
}

LLVM IR (-O2):
define void @_OS_JumpToTask() {
%1 = tail call i32 (...) @_OS_STORE_SP()
%2 = tail call i32 (...) @_OS_Restore_TaskSP()
%3 = tail call i32 (...) @_OS_SET_FSR_CUR_TASK()
%4 = tail call i32 (...) @_OS_SET_PC()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
void *xcalloc(size_t nmemb, size_t size) {
  void *ret = calloc(nmemb, size);
  if (!ret)
    abort();
  return ret;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xcalloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     112d <xcalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias 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 %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void puglPrintTestUsage(const char *prog, const char *posHelp) {
  printf("Usage: %s [OPTION]... %s\n\n"
         "  -a  Enable anti-aliasing\n"
         "  -c  Continuously animate and draw\n"
         "  -d  Enable double-buffering\n"
         "  -e  Enable platform error-checking\n"
         "  -h  Display this help\n"
         "  -i  Ignore key repeat\n"
         "  -v  Print verbose output\n"
         "  -r  Resizable window\n",
         prog, posHelp);
}


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

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

LLVM IR (-O0):
@.str = [255 x i8] c"Usage: %s [OPTION]... %s\0A\0A -a Enable anti-aliasing\0A -c Continuously animate and draw\0A -d Enable double-buffering\0A -e Enable platform error-checking\0A -h Display this help\0A -i Ignore key repeat\0A -v Print verbose output\0A -r Resizable window\0A\00"
define void @puglPrintTestUsage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [255 x i8] c"Usage: %s [OPTION]... %s\0A\0A -a Enable anti-aliasing\0A -c Continuously animate and draw\0A -d Enable double-buffering\0A -e Enable platform error-checking\0A -h Display this help\0A -i Ignore key repeat\0A -v Print verbose output\0A -r Resizable window\0A\00"
define void @puglPrintTestUsage(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
char *basm_strtab_i(int);
char *blnk_strtab_i(int str) { return (basm_strtab_i(str)); }


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

x86 assembly (clang, -O2):
<blnk_strtab_i>:
jmp    1030 <basm_strtab_i@plt>

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

LLVM IR (-O2):
define i8* @blnk_strtab_i(i32 %0) {
%2 = tail call i8* @basm_strtab_i(i32 %0)
ret i8* %2
}
void pxa3xx_nand_select_chip(struct mtd_info *mtd, int chip) { return; }


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

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

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

LLVM IR (-O2):
%struct.mtd_info = type opaque
define void @pxa3xx_nand_select_chip(%struct.mtd_info* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_stack();
int /*<<< orphan*/ printf(char *);
int func_a() {
  printf("func a\n");
  print_stack();
  return 0;
}


x86 assembly (clang, -O0):
<func_a>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_stack@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_a>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <print_stack@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"func a\0A\00"
define i32 @func_a() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @print_stack()
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"func a\00"
define i32 @func_a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @print_stack()
ret i32 0
}