xunge/DecIR huggingface dataset:
unsigned xrop3_183_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_183_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_183_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_183_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_183_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ fib(int);
scalar_t__ fib_wrapper(int);
int main() {
  if (fib(15) != fib_wrapper(15))
    abort();
  if (fib(25) != fib_wrapper(25))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1040 <fib@plt>
mov    %rax,-0x10(%rbp)
mov    $0xf,%edi
call   1050 <fib_wrapper@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116e <main+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x19,%edi
call   1040 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    $0x19,%edi
call   1050 <fib_wrapper@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     119d <main+0x6d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf,%edi
call   1040 <fib@plt>
mov    %rax,%rbx
mov    $0xf,%edi
call   1050 <fib_wrapper@plt>
cmp    %rax,%rbx
jne    116d <main+0x3d>
mov    $0x19,%edi
call   1040 <fib@plt>
mov    %rax,%rbx
mov    $0x19,%edi
call   1050 <fib_wrapper@plt>
cmp    %rax,%rbx
jne    116d <main+0x3d>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @fib(i32 15)
%2 = tail call i64 @fib_wrapper(i32 15)
%3 = icmp eq i64 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i64 @fib(i32 25)
%8 = tail call i64 @fib_wrapper(i32 25)
%9 = icmp eq i64 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %6
ret i32 0
}
/* Variables and functions */
char *memchr(char const *, int, unsigned int);
unsigned int byte_chr(const char *s, unsigned int n, int c) {
  const char *t = memchr(s, c, n);
  return (t == NULL) ? n : t - s;
}


x86 assembly (clang, -O0):
<byte_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114c <byte_chr+0x3c>
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
jmp    115b <byte_chr+0x4b>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_chr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%esi
mov    %ebp,%edx
call   1030 <memchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
test   %rax,%rax
cmove  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @byte_chr(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @memchr(i8* %0, i32 %2, i32 %1)
%5 = icmp eq i8* %4, null
%6 = zext i32 %1 to i64
%7 = ptrtoint i8* %4 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = select i1 %5, i64 %6, i64 %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
void *mp_realloc_fast(struct mempool *, void *, unsigned int);
void *mp_realloc(struct mempool *pool, void *ptr, unsigned size) {
  return mp_realloc_fast(pool, ptr, size);
}


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

x86 assembly (clang, -O2):
<mp_realloc>:
jmp    1030 <mp_realloc_fast@plt>

LLVM IR (-O0):
%struct.mempool = type { i32 }
define i8* @mp_realloc(%struct.mempool* %0, i8* %1, i32 %2) {
%4 = alloca %struct.mempool*
%5 = alloca i8*
%6 = alloca i32
store %struct.mempool* %0, %struct.mempool** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.mempool*, %struct.mempool** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @mp_realloc_fast(%struct.mempool* %7, i8* %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @mp_realloc(%struct.mempool* %0, i8* %1, i32 %2) {
%4 = tail call i8* @mp_realloc_fast(%struct.mempool* %0, i8* %1, i32 %2)
ret i8* %4
}
void change(int ns[]) {
  ns[0] = 111;
  ns[1] = 222;
  ns[2] = 333;
}


x86 assembly (clang, -O0):
<change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6f,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xde,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x14d,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change>:
movabs $0xde0000006f,%rax
mov    %rax,(%rdi)
movl   $0x14d,0x8(%rdi)
ret

LLVM IR (-O0):
define void @change(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 111, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 222, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 333, i32* %8
ret void
}

LLVM IR (-O2):
define void @change(i32* nocapture writeonly %0) {
store i32 111, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 222, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 2
store i32 333, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test85(__m64 a, __m64 b) { return _mm_cmpeq_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test85>:
jmp    1030 <_mm_cmpeq_pi16@plt>

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

LLVM IR (-O2):
define i32 @test85(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char num2ascii(int /*<<< orphan*/);
int /*<<< orphan*/ word2num(char *);
char word2ascii(char *word) { return num2ascii(word2num(word)); }


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

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

LLVM IR (-O0):
define signext i8 @word2ascii(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @word2num(i8* %3)
%5 = call signext i8 @num2ascii(i32 %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @word2ascii(i8* %0) {
%2 = tail call i32 @word2num(i8* %0)
%3 = tail call signext i8 @num2ascii(i32 %2)
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sem_wait(int /*<<< orphan*/ *);
int wait(int *);
void *clean(void *v) {
  sem_t *count = v;
  int pid, status;
  while (1) {
    sem_wait(count);
    pid = wait(&status);
    printf("server: connection of %d closed with status %d\n", pid, status);
  }
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sem_wait@plt>
lea    -0x18(%rbp),%rdi
call   1050 <wait@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
jmp    1144 <clean+0x14>

x86 assembly (clang, -O2):
<clean>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
lea    0xeb8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <sem_wait@plt>
mov    %r14,%rdi
call   1050 <wait@plt>
mov    0xc(%rsp),%edx
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1150 <clean+0x20>

LLVM IR (-O0):
@.str = [48 x i8] c"server: connection of %d closed with status %d\0A\00"
define i8* @clean(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
br label %8
8: ; preds = %1, %8
%9 = load i32*, i32** %3
%10 = call i32 @sem_wait(i32* %9)
%11 = call i32 @wait(i32* %5)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %8
}

LLVM IR (-O2):
@.str = [48 x i8] c"server: connection of %d closed with status %d\0A\00"
define noalias i8* @clean(i8* %0) {
%2 = alloca i32
%3 = bitcast i8* %0 to i32*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %1
%6 = call i32 @sem_wait(i32* %3)
%7 = call i32 @wait(i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %5
}
void prefetchw(const void *x) { ; }


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

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

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

LLVM IR (-O2):
define void @prefetchw(i8* nocapture %0) {
ret void
}
int p_wm_get_ids() { return -142; }


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

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

LLVM IR (-O0):
define i32 @p_wm_get_ids() {
ret i32 -142
}

LLVM IR (-O2):
define i32 @p_wm_get_ids() {
ret i32 -142
}
/* Variables and functions */
int *makeIndirection(int);
int /*<<< orphan*/ test(int);
void main() {
  int a = 42;
  int *p = 0;
  p = makeIndirection(a);
  test(p != 0);
  test(*p == a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <makeIndirection@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2a,%edi
call   1030 <makeIndirection@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <test@plt>
xor    %edi,%edi
cmpl   $0x2a,(%rbx)
sete   %dil
pop    %rbx
jmp    1040 <test@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 42, i32* %1
store i32* null, i32** %2
%3 = load i32, i32* %1
%4 = call i32* @makeIndirection(i32 %3)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @test(i32 %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = load i32, i32* %1
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @test(i32 %13)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32* @makeIndirection(i32 42)
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @test(i32 %3)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 42
%7 = zext i1 %6 to i32
%8 = tail call i32 @test(i32 %7)
ret void
}
void nullit(char *s) { s[0] = '\0'; }


x86 assembly (clang, -O0):
<nullit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullit>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @nullit(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
void cdb_pack(unsigned num, unsigned char buf[4]) {
  buf[0] = num & 255;
  num >>= 8;
  buf[1] = num & 255;
  num >>= 8;
  buf[2] = num & 255;
  buf[3] = num >> 8;
}


x86 assembly (clang, -O0):
<cdb_pack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdb_pack>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @cdb_pack(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
double jd2epb(int /*<<< orphan*/);
int /*<<< orphan*/ ut2jd();
double ut2epb() { return (jd2epb(ut2jd())); }


x86 assembly (clang, -O0):
<ut2epb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ut2jd@plt>
mov    %eax,%edi
call   1040 <jd2epb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut2epb>:
push   %rax
xor    %eax,%eax
call   1030 <ut2jd@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <jd2epb@plt>

LLVM IR (-O0):
define double @ut2epb() {
%1 = call i32 (...) @ut2jd()
%2 = call double @jd2epb(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @ut2epb() {
%1 = tail call i32 (...) @ut2jd()
%2 = tail call double @jd2epb(i32 %1)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_volume_func_init_arm() {
  printf("NOT IMPLEMENTED:"
         "pa_volume_func_init_arm"
         "\n");
}


x86 assembly (clang, -O0):
<pa_volume_func_init_arm>:
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_volume_func_init_arm>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_volume_func_init_arm\00"
define i32 @pa_volume_func_init_arm() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void _infix_operator_mult_u16_u16(unsigned short lhs, unsigned short rhs,
                                  unsigned short *__rval_1) {
  *__rval_1 = lhs * rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_mult_u16_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
imul   %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_mult_u16_u16>:
imul   %esi,%edi
mov    %di,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_mult_u16_u16(i16 zeroext %0, i16 zeroext %1, i16* %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16*
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16* %2, i16** %6
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = mul nsw i32 %8, %10
%12 = trunc i32 %11 to i16
%13 = load i16*, i16** %6
store i16 %12, i16* %13
ret void
}

LLVM IR (-O2):
define void @_infix_operator_mult_u16_u16(i16 zeroext %0, i16 zeroext %1, i16* nocapture writeonly %2) {
%4 = mul i16 %1, %0
store i16 %4, i16* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
int /*<<< orphan*/ kputs(char *);
void kmain(void) {
  clrscr();
  kputs("This is a stub C kernel!");
  return;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clrscr@plt>
lea    0xece(%rip),%rdi
call   1040 <kputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1030 <clrscr@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <kputs@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"This is a stub C kernel!\00"
define void @kmain() {
%1 = call i32 (...) @clrscr()
%2 = call i32 @kputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"This is a stub C kernel!\00"
define void @kmain() {
%1 = tail call i32 (...) @clrscr()
%2 = tail call i32 @kputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
void ironlake_debug_m_tu(char *result, int len, int reg, uint32_t val,
                         uint32_t devid) {
  snprintf(result, len, "TU %d, val 0x%x %d", (val >> 25) + 1, val & 0xffffff,
           val & 0xffffff);
}


x86 assembly (clang, -O0):
<ironlake_debug_m_tu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
sar    $0x19,%ecx
add    $0x1,%ecx
mov    -0x14(%rbp),%r8d
and    $0xffffff,%r8d
mov    -0x14(%rbp),%r9d
and    $0xffffff,%r9d
lea    0xeaa(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ironlake_debug_m_tu>:
mov    %ecx,%r8d
sar    $0x19,%ecx
add    $0x1,%ecx
and    $0xffffff,%r8d
lea    0xed9(%rip),%rdx
mov    %r8d,%r9d
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"TU %d, val 0x%x %d\00"
define void @ironlake_debug_m_tu(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = ashr i32 %13, 25
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %9
%17 = and i32 %16, 16777215
%18 = load i32, i32* %9
%19 = and i32 %18, 16777215
%20 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"TU %d, val 0x%x %d\00"
define void @ironlake_debug_m_tu(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = ashr i32 %3, 25
%7 = add nsw i32 %6, 1
%8 = and i32 %3, 16777215
%9 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_reg(int, int);
int ili9325_read_pixel(int x, int y) {
  int value;
  write_reg(0x0020, x);
  write_reg(0x0021, y);
  { *(unsigned short *)0x70000000 = 0x0022; };
  value = *(unsigned short *)0x78000000;
  { *(unsigned short *)0x70000000 = 0x0022; };
  value = *(unsigned short *)0x78000000;
  return value;
}


x86 assembly (clang, -O0):
<ili9325_read_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x20,%edi
call   1030 <write_reg@plt>
mov    -0x8(%rbp),%esi
mov    $0x21,%edi
call   1030 <write_reg@plt>
mov    $0x70000000,%eax
movw   $0x22,(%rax)
mov    $0x78000000,%eax
movzwl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x70000000,%eax
movw   $0x22,(%rax)
mov    $0x78000000,%eax
movzwl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ili9325_read_pixel>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x20,%edi
call   1030 <write_reg@plt>
mov    $0x21,%edi
mov    %ebx,%esi
call   1030 <write_reg@plt>
movw   $0x22,0x70000000
movzwl 0x78000000,%eax
78
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ili9325_read_pixel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @write_reg(i32 32, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @write_reg(i32 33, i32 %8)
store i16 34, i16* inttoptr (i64 1879048192 to i16*)
%10 = load i16, i16* inttoptr (i64 2013265920 to i16*)
%11 = zext i16 %10 to i32
store i32 %11, i32* %5
store i16 34, i16* inttoptr (i64 1879048192 to i16*)
%12 = load i16, i16* inttoptr (i64 2013265920 to i16*)
%13 = zext i16 %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @ili9325_read_pixel(i32 %0, i32 %1) {
%3 = tail call i32 @write_reg(i32 32, i32 %0)
%4 = tail call i32 @write_reg(i32 33, i32 %1)
store i16 34, i16* inttoptr (i64 1879048192 to i16*)
%5 = load i16, i16* inttoptr (i64 2013265920 to i16*)
%6 = zext i16 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int n, int m) {
  unsigned i;
  for (i = 0; i < n; ++i) {
    int x;
    if (m < 0)
      x = 1;
    else
      x = m;
    bar(x);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1163 <foo+0x53>
cmpl   $0x0,-0x8(%rbp)
jge    1147 <foo+0x37>
movl   $0x1,-0x10(%rbp)
jmp    114d <foo+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <bar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <foo+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     113c <foo+0x2c>
mov    %edi,%ebx
test   %esi,%esi
mov    $0x1,%ebp
cmovns %esi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
call   1030 <bar@plt>
add    $0xffffffff,%ebx
jne    1130 <foo+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @foo(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 0, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1, i32* %6
br label %17
15: ; preds = %11
%16 = load i32, i32* %4
store i32 %16, i32* %6
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %6
%19 = call i32 @bar(i32 %18)
br label %20
20: ; preds = %17
%21 = load i32, i32* %5
%22 = add i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp slt i32 %1, 0
%6 = select i1 %5, i32 1, i32 %1
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ 0, %4 ], [ %10, %7 ]
%9 = tail call i32 @bar(i32 %6)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
int sqlite3Fts5UnicodeIsdiacritic(int c) {
  unsigned int mask0 = 0x08029FDF;
  unsigned int mask1 = 0x000361F8;
  if (c < 768 || c > 817)
    return 0;
  return (c < 768 + 32) ? (mask0 & (1 << (c - 768)))
                        : (mask1 & (1 << (c - 768 - 32)));
}


x86 assembly (clang, -O0):
<sqlite3Fts5UnicodeIsdiacritic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x8029fdf,-0xc(%rbp)
movl   $0x361f8,-0x10(%rbp)
cmpl   $0x300,-0x8(%rbp)
jl     112f <sqlite3Fts5UnicodeIsdiacritic+0x2f>
cmpl   $0x331,-0x8(%rbp)
jle    113b <sqlite3Fts5UnicodeIsdiacritic+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    118a <sqlite3Fts5UnicodeIsdiacritic+0x8a>
cmpl   $0x320,-0x8(%rbp)
jge    1167 <sqlite3Fts5UnicodeIsdiacritic+0x67>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x300,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1184 <sqlite3Fts5UnicodeIsdiacritic+0x84>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x300,%ecx
sub    $0x20,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3Fts5UnicodeIsdiacritic>:
lea    -0x332(%rdi),%ecx
xor    %eax,%eax
cmp    $0xffffffce,%ecx
jb     1129 <sqlite3Fts5UnicodeIsdiacritic+0x29>
mov    $0x1,%eax
mov    %edi,%ecx
shl    %cl,%eax
cmp    $0x31f,%edi
ja     1124 <sqlite3Fts5UnicodeIsdiacritic+0x24>
and    $0x8029fdf,%eax
ret
and    $0x361f8,%eax
ret

LLVM IR (-O0):
define i32 @sqlite3Fts5UnicodeIsdiacritic(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 134389727, i32* %4
store i32 221688, i32* %5
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 768
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 817
br i1 %10, label %11, label %12
11: ; preds = %8, %1
store i32 0, i32* %2
br label %30
12: ; preds = %8
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 800
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 768
%19 = shl i32 1, %18
%20 = and i32 %16, %19
br label %28
21: ; preds = %12
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 768
%25 = sub nsw i32 %24, 32
%26 = shl i32 1, %25
%27 = and i32 %22, %26
br label %28
28: ; preds = %21, %15
%29 = phi i32 [ %20, %15 ], [ %27, %21 ]
store i32 %29, i32* %2
br label %30
30: ; preds = %28, %11
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @sqlite3Fts5UnicodeIsdiacritic(i32 %0) {
%2 = add i32 %0, -818
%3 = icmp ult i32 %2, -50
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = icmp ult i32 %0, 800
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = add nsw i32 %0, -768
%8 = shl nuw i32 1, %7
%9 = and i32 %8, 134389727
br label %14
10: ; preds = %4
%11 = add nsw i32 %0, -800
%12 = shl nuw nsw i32 1, %11
%13 = and i32 %12, 221688
br label %14
14: ; preds = %6, %10, %1
%15 = phi i32 [ 0, %1 ], [ %9, %6 ], [ %13, %10 ]
ret i32 %15
}
void mctop_dprint(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @mctop_dprint(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
unsigned char msg_send(int, unsigned char *, int);
unsigned char ANT_SetNetworkKey(unsigned char net, unsigned char *key) {
  unsigned char buf[9];
  buf[0] = net;
  memcpy(buf + 1, key, 8);
  return msg_send(0x46, buf, 9);
}


x86 assembly (clang, -O0):
<ANT_SetNetworkKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x19(%rbp)
lea    -0x19(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
lea    -0x19(%rbp),%rsi
mov    $0x46,%edi
mov    $0x9,%edx
call   1040 <msg_send@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANT_SetNetworkKey>:
sub    $0x18,%rsp
mov    %dil,0xf(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
lea    0xf(%rsp),%rsi
mov    $0x46,%edi
mov    $0x9,%edx
call   1040 <msg_send@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define zeroext i8 @ANT_SetNetworkKey(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca [9 x i8]
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8, i8* %3
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8*, i8** %4
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 8)
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%13 = call zeroext i8 @msg_send(i32 70, i8* %12, i32 9)
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @ANT_SetNetworkKey(i8 zeroext %0, i8* %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %4
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 1
%6 = call i32 @memcpy(i8* %5, i8* %1, i32 8)
%7 = call zeroext i8 @msg_send(i32 70, i8* %4, i32 9)
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ GenerateParserAndTest(char *, char *, char *);
int /*<<< orphan*/ getchar();
int main(int argc, char **argv) {
  int error = 0;
  GenerateParserAndTest("simple.cfg", "simple.txt", "output/simple_test");
  getchar();
  return error;
}


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)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    0xec0(%rip),%rsi
lea    0xec4(%rip),%rdx
call   1040 <GenerateParserAndTest@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    0xee0(%rip),%rdx
call   1040 <GenerateParserAndTest@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"simple.cfg\00"
@.str.1 = [11 x i8] c"simple.txt\00"
@.str.2 = [19 x i8] c"output/simple_test\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @GenerateParserAndTest(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (...) @getchar()
%9 = load i32, i32* %6
ret i32 %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"simple.cfg\00"
@.str.1 = [11 x i8] c"simple.txt\00"
@.str.2 = [19 x i8] c"output/simple_test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @GenerateParserAndTest(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *OPENSSL_VERSION_TEXT;
int /*<<< orphan*/ SSLEAY_VERSION;
char *SSLeay_version(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void tls_version_report(FILE *f) {
  fprintf(f, "OpenSSL compile-time version: %s\n", OPENSSL_VERSION_TEXT);
  fprintf(f, "OpenSSL runtime version: %s\n", SSLeay_version(SSLEAY_VERSION));
}


x86 assembly (clang, -O0):
<tls_version_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdx
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <SSLeay_version@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tls_version_report>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <SSLeay_version@plt>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"OpenSSL compile-time version: %s\0A\00"
@OPENSSL_VERSION_TEXT = global i8* null
@.str.1 = [29 x i8] c"OpenSSL runtime version: %s\0A\00"
@SSLEAY_VERSION = global i32 0
define void @tls_version_report(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i8*, i8** @OPENSSL_VERSION_TEXT
%5 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* @SSLEAY_VERSION
%8 = call i8* @SSLeay_version(i32 %7)
%9 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"OpenSSL compile-time version: %s\0A\00"
@OPENSSL_VERSION_TEXT = global i8* null
@.str.1 = [29 x i8] c"OpenSSL runtime version: %s\0A\00"
@SSLEAY_VERSION = global i32 0
define void @tls_version_report(i32* nocapture %0) {
%2 = load i8*, i8** @OPENSSL_VERSION_TEXT
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @SSLEAY_VERSION
%5 = tail call i8* @SSLeay_version(i32 %4)
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
void post_process() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ const *EVP_idea_cfb64();
const EVP_CIPHER *EVP_idea_cfb(void) { return EVP_idea_cfb64(); }


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

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

LLVM IR (-O0):
define i32* @EVP_idea_cfb() {
%1 = call i32* (...) @EVP_idea_cfb64()
ret i32* %1
}

LLVM IR (-O2):
define i32* @EVP_idea_cfb() {
%1 = tail call i32* (...) @EVP_idea_cfb64()
ret i32* %1
}
double AdjustLon(double lon) {
  while (lon < 0)
    lon += 360;
  while (lon > 360)
    lon -= 360;
  return lon;
}


x86 assembly (clang, -O0):
<AdjustLon>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112e <AdjustLon+0x2e>
movsd  0xee1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1109 <AdjustLon+0x9>
jmp    1133 <AdjustLon+0x33>
movsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <AdjustLon+0x65>
movsd  -0x8(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1133 <AdjustLon+0x33>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdjustLon>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    112a <AdjustLon+0x2a>
movsd  0xeee(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1120 <AdjustLon+0x20>
ucomisd 0xece(%rip),%xmm0
jbe    115a <AdjustLon+0x5a>
movsd  0xecc(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
ja     1150 <AdjustLon+0x50>
ret

LLVM IR (-O0):
define double @AdjustLon(double %0) {
%2 = alloca double
store double %0, double* %2
br label %3
3: ; preds = %6, %1
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* %2
%8 = fadd double %7, 3.600000e+02
store double %8, double* %2
br label %3
9: ; preds = %3
br label %10
10: ; preds = %13, %9
%11 = load double, double* %2
%12 = fcmp ogt double %11, 3.600000e+02
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %2
%15 = fsub double %14, 3.600000e+02
store double %15, double* %2
br label %10
16: ; preds = %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @AdjustLon(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi double [ %0, %1 ], [ %8, %6 ]
%5 = fcmp ogt double %4, 3.600000e+02
br i1 %5, label %10, label %14
6: ; preds = %1, %6
%7 = phi double [ %8, %6 ], [ %0, %1 ]
%8 = fadd double %7, 3.600000e+02
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %6, label %3
10: ; preds = %3, %10
%11 = phi double [ %12, %10 ], [ %4, %3 ]
%12 = fadd double %11, -3.600000e+02
%13 = fcmp ogt double %12, 3.600000e+02
br i1 %13, label %10, label %14
14: ; preds = %10, %3
%15 = phi double [ %4, %3 ], [ %12, %10 ]
ret double %15
}
/* Variables and functions */
int getOrigin(int);
int /*<<< orphan*/ initPersonOnFloor(int, int);
void bigMacCall(void) {
  int tmp;
  {
    {
      tmp = getOrigin(5);
      initPersonOnFloor(5, tmp);
    }
    return;
  }
}


x86 assembly (clang, -O0):
<bigMacCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <getOrigin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x5,%edi
call   1040 <initPersonOnFloor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigMacCall>:
push   %rax
mov    $0x5,%edi
call   1030 <getOrigin@plt>
mov    $0x5,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <initPersonOnFloor@plt>

LLVM IR (-O0):
define void @bigMacCall() {
%1 = alloca i32
%2 = call i32 @getOrigin(i32 5)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @initPersonOnFloor(i32 5, i32 %3)
ret void
}

LLVM IR (-O2):
define void @bigMacCall() {
%1 = tail call i32 @getOrigin(i32 5)
%2 = tail call i32 @initPersonOnFloor(i32 5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void ASSERT_TRUE(int x) {
  if (x)
    return;
  else
    exit(1);
}


x86 assembly (clang, -O0):
<ASSERT_TRUE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112b <ASSERT_TRUE+0x1b>
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<ASSERT_TRUE>:
test   %edi,%edi
je     1115 <ASSERT_TRUE+0x5>
ret
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @ASSERT_TRUE(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
ret void
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void stack_prefault(void) {
  unsigned char dummy[(100 * 1024)];
  memset(dummy, 0, (100 * 1024));
  return;
}


x86 assembly (clang, -O0):
<stack_prefault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x19000,%rsp
lea    -0x19000(%rbp),%rdi
xor    %esi,%esi
mov    $0x19000,%edx
call   1030 <memset@plt>
add    $0x19000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_prefault>:
sub    $0x19008,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x19000,%edx
call   1030 <memset@plt>
add    $0x19008,%rsp
ret

LLVM IR (-O0):
define void @stack_prefault() {
%1 = alloca [102400 x i8]
%2 = getelementptr inbounds [102400 x i8], [102400 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 102400)
ret void
}

LLVM IR (-O2):
define void @stack_prefault() {
%1 = alloca [102400 x i8]
%2 = getelementptr inbounds [102400 x i8], [102400 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 102400)
ret void
}
/* Variables and functions */
float log10f(float);
float decibel(float amp) { return 10.0f * log10f(amp * amp); }


x86 assembly (clang, -O0):
<decibel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <log10f@plt>
movaps %xmm0,%xmm1
movss  0xec9(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decibel>:
push   %rax
mulss  %xmm0,%xmm0
call   1030 <log10f@plt>
mulss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @decibel(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = call float @log10f(float %5)
%7 = fmul float 1.000000e+01, %6
ret float %7
}

LLVM IR (-O2):
define float @decibel(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @log10f(float %2)
%4 = fmul float %3, 1.000000e+01
ret float %4
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
__attribute__((always_)) void list_replace_init(struct list_head *old,
                                                struct list_head *new) {
  list_replace(old, new);
  INIT_LIST_HEAD(old);
}


x86 assembly (clang, -O0):
<list_replace_init>:
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   1040 <list_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}