xunge/DecIR huggingface dataset:
/* Variables and functions */
char toupper(char);
void upper(char seq[]) {
  int i;
  i = 0;
  while (seq[i] != '\0') {
    seq[i] = toupper(seq[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <upper+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <upper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <upper+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <upper+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @toupper(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int set_blocking(int, int);
int set_block_mode(int fd) { return set_blocking(fd, 1); }


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

x86 assembly (clang, -O2):
<set_block_mode>:
mov    $0x1,%esi
jmp    1030 <set_blocking@plt>

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

LLVM IR (-O2):
define i32 @set_block_mode(i32 %0) {
%2 = tail call i32 @set_blocking(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ troca(int *, int *);
int main(void) {
  int x = 100, y = 200;
  troca(&x, &y);
  printf("Na main: x = %d, y = %d\n", x, y);
  printf("\n\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x64,0x4(%rsp)
movl   $0xc8,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <troca@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Na main: x = %d, y = %d\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 200, i32* %3
%4 = call i32 @troca(i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Na main: x = %d, y = %d\0A\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 200, i32* %2
%5 = call i32 @troca(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
char *cgiServerPort() {
  char *port = getenv("SERVER_PORT");
  if (port)
    return port;
  else
    return "80";
}


x86 assembly (clang, -O0):
<cgiServerPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <cgiServerPort+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <cgiServerPort+0x3b>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiServerPort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee5(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"SERVER_PORT\00"
@.str.1 = [3 x i8] c"80\00"
define i8* @cgiServerPort() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
size_t round_to_next_power_of_2(size_t v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<round_to_next_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_next_power_of_2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x8,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x10,%rax
or     %rdx,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @round_to_next_power_of_2(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = add i64 %12, 1
ret i64 %13
}
double get55() { return 55.; }


x86 assembly (clang, -O0):
<get55>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get55>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get55() {
ret double 5.500000e+01
}

LLVM IR (-O2):
define double @get55() {
ret double 5.500000e+01
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ get_uid();
uid_t getuid() { return get_uid(); }


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

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

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

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 (...) @get_uid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("%lu\n", clock());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @clock()
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct bst {
  int dummy;
};

/* Variables and functions */
struct bst *bst_rightmost(struct bst *);
struct bst *bst_last(struct bst *t) {
  return bst_rightmost(t);
}


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

x86 assembly (clang, -O2):
<bst_last>:
jmp    1030 <bst_rightmost@plt>

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

LLVM IR (-O2):
%struct.bst = type { i32 }
define %struct.bst* @bst_last(%struct.bst* %0) {
%2 = tail call %struct.bst* @bst_rightmost(%struct.bst* %0)
ret %struct.bst* %2
}
double foo(double d) { return d + 2.0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fadd double %0, 2.000000e+00
ret double %2
}
int mDB_init() { return (1); }


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

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

LLVM IR (-O0):
define i32 @mDB_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @mDB_init() {
ret i32 1
}
int getFileSizePerSecond(int SR, int bitLength, int numberOfChannels) {
  return SR * (bitLength / 8) * numberOfChannels;
}


x86 assembly (clang, -O0):
<getFileSizePerSecond>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSizePerSecond>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
imul   %edx,%edi
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @getFileSizePerSecond(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sdiv i32 %8, 8
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getFileSizePerSecond(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 8
%5 = mul nsw i32 %4, %0
%6 = mul nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
unsigned char hs2i13(char const *);
unsigned char hs2i(const char *s) { return hs2i13(s); }


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

x86 assembly (clang, -O2):
<hs2i>:
jmp    1030 <hs2i13@plt>

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

LLVM IR (-O2):
define zeroext i8 @hs2i(i8* %0) {
%2 = tail call zeroext i8 @hs2i13(i8* %0)
ret i8 %2
}
void delays(int d) {
  while (d--)
    ;
}


x86 assembly (clang, -O0):
<delays>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1120 <delays+0x20>
jmp    1107 <delays+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delays(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
void func1() { a(); }


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

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

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

LLVM IR (-O2):
define void @func1() {
%1 = tail call i32 (...) @a()
ret void
}
int invert(int x, int p, int n) { return 2; }


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 2
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char const *const, char **);
void lace_compat_sh_exec(const char *const *argv) {
  execvp(argv[0], (char **)argv);
}


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

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

LLVM IR (-O0):
define void @lace_compat_sh_exec(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = call i32 @execvp(i8* %5, i8** %6)
ret void
}

LLVM IR (-O2):
define void @lace_compat_sh_exec(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
ret void
}
int test_imm_FCuint16_reg(unsigned short val) {
  return ((val) & (0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xfc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_FCuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 252
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_perl_comments() {
  test_parser_verify_parse(test_parser_sourcefile("perl", " #comment"), "perl",
                           "", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_perl_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_perl_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"perl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_perl_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"perl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_perl_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIFLUSH;
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ TCOFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void SetFlush(int PortFd, int selector) {
  switch (selector) {
  case ((unsigned char)1):
    tcflush(PortFd, TCIFLUSH);
    break;
  case ((unsigned char)2):
    tcflush(PortFd, TCOFLUSH);
    break;
  case ((unsigned char)3):
    tcflush(PortFd, TCIOFLUSH);
    break;
  }
}


x86 assembly (clang, -O0):
<SetFlush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1154 <SetFlush+0x44>
jmp    1132 <SetFlush+0x22>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116a <SetFlush+0x5a>
jmp    1143 <SetFlush+0x33>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1180 <SetFlush+0x70>
jmp    1191 <SetFlush+0x81>
mov    -0x4(%rbp),%edi
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
jmp    1191 <SetFlush+0x81>
mov    -0x4(%rbp),%edi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
jmp    1191 <SetFlush+0x81>
mov    -0x4(%rbp),%edi
mov    0x2e46(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetFlush>:
add    $0xffffffff,%esi
cmp    $0x2,%esi
ja     112d <SetFlush+0x1d>
movslq %esi,%rax
lea    0x2ce6(%rip),%rcx
mov    (%rcx,%rax,8),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>
ret

LLVM IR (-O0):
@TCIFLUSH = global i32 0
@TCOFLUSH = global i32 0
@TCIOFLUSH = global i32 0
define void @SetFlush(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %18 [
i32 1, label %6
i32 2, label %10
i32 3, label %14
]
6: ; preds = %2
%7 = load i32, i32* %3
%8 = load i32, i32* @TCIFLUSH
%9 = call i32 @tcflush(i32 %7, i32 %8)
br label %18
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* @TCOFLUSH
%13 = call i32 @tcflush(i32 %11, i32 %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i32, i32* @TCIOFLUSH
%17 = call i32 @tcflush(i32 %15, i32 %16)
br label %18
18: ; preds = %2, %14, %10, %6
ret void
}

LLVM IR (-O2):
@TCIFLUSH = global i32 0
@TCOFLUSH = global i32 0
@TCIOFLUSH = global i32 0
@switch.table.SetFlush = [3 x i32*] [i32* @TCIFLUSH, i32* @TCOFLUSH, i32* @TCIOFLUSH]
define void @SetFlush(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 3
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [3 x i32*], [3 x i32*]* @switch.table.SetFlush, i64 0, i64 %6
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = tail call i32 @tcflush(i32 %0, i32 %9)
br label %11
11: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wfree(void *x_arg) { free(x_arg); }


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

x86 assembly (clang, -O2):
<wfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @wfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void gsize_clear(void *g, unsigned int pos) { ((unsigned int *)g)[pos] = 0; }


x86 assembly (clang, -O0):
<gsize_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsize_clear>:
mov    %esi,%eax
movl   $0x0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @gsize_clear(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @gsize_clear(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
store i32 0, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello net world!\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hello net world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Hello net world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *strupr(sz)
char *sz;
{
  char *szRet = sz;
  while (*sz++ = toupper(*sz))
    ;
  return (szRet);
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114e <strupr+0x3e>
jmp    1124 <strupr+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupr+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strupr(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 = %14, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = call i32 @toupper(i32 %8)
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
store i8 %10, i8* %11
%13 = icmp ne i8 %10, 0
br i1 %13, label %14, label %15
14: ; preds = %5
br label %5
15: ; preds = %5
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i32 @toupper(i32 %5)
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %7, i8* %3
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %2
10: ; preds = %2
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigsuspend(const sigset_t *_set) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sigsuspend(i32* nocapture readnone %0) {
ret i32 0
}
void lsmPosixOsShmBarrier(void) {}


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

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

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

LLVM IR (-O2):
define void @lsmPosixOsShmBarrier() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "wc"
        " [-c|-m][-lw][file...]\n  -c	Write the number of bytes\n  -m	Write "
        "the number of characters\n  -l	Write the number of lines\n  -w	Write "
        "the number of words\n",
        stderr);
  return 1;
}


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

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [162 x i8] c"Usage: wc [-c|-m][-lw][file...]\0A -c\09Write the number of bytes\0A -m\09Write the number of characters\0A -l\09Write the number of lines\0A -w\09Write the number of words\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [162 x i8] c"Usage: wc [-c|-m][-lw][file...]\0A -c\09Write the number of bytes\0A -m\09Write the number of characters\0A -l\09Write the number of lines\0A -w\09Write the number of words\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
void _M2_wall_finish(__attribute__((unused)) int argc,
                     __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_wall_finish(i32 %0, i8** nocapture %1) {
ret void
}
char alignment_from_char(char align) {
  switch (align) {
  case 'l':
    return 1;
  case 'r':
    return 2;
  case 'c':
    return 0;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<alignment_from_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x63,%eax
je     1153 <alignment_from_char+0x53>
jmp    111f <alignment_from_char+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x6c,%eax
je     1141 <alignment_from_char+0x41>
jmp    1130 <alignment_from_char+0x30>
mov    -0x8(%rbp),%eax
sub    $0x72,%eax
je     114a <alignment_from_char+0x4a>
jmp    115c <alignment_from_char+0x5c>
movb   $0x1,-0x1(%rbp)
jmp    1160 <alignment_from_char+0x60>
movb   $0x2,-0x1(%rbp)
jmp    1160 <alignment_from_char+0x60>
movb   $0x0,-0x1(%rbp)
jmp    1160 <alignment_from_char+0x60>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignment_from_char>:
cmp    $0x63,%edi
je     1112 <alignment_from_char+0x12>
cmp    $0x6c,%edi
je     1115 <alignment_from_char+0x15>
cmp    $0x72,%edi
jne    1112 <alignment_from_char+0x12>
mov    $0x2,%al
ret
xor    %eax,%eax
ret
mov    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @alignment_from_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 108, label %6
i32 114, label %7
i32 99, label %8
]
6: ; preds = %1
store i8 1, i8* %2
br label %10
7: ; preds = %1
store i8 2, i8* %2
br label %10
8: ; preds = %1
store i8 0, i8* %2
br label %10
9: ; preds = %1
store i8 0, i8* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @alignment_from_char(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 108, label %6
i32 114, label %3
i32 99, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i8 [ 0, %5 ], [ 0, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i8 %7
}
long extract_spr(unsigned long insn, int *invalid) {
  return ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
}


x86 assembly (clang, -O0):
<extract_spr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0x1f,%rax
mov    -0x8(%rbp),%rcx
shr    $0x6,%rcx
and    $0x3e0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_spr>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x1f,%eax
shr    $0x6,%rdi
and    $0x3e0,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @extract_spr(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = lshr i64 %5, 16
%7 = and i64 %6, 31
%8 = load i64, i64* %3
%9 = lshr i64 %8, 6
%10 = and i64 %9, 992
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @extract_spr(i64 %0, i32* nocapture readnone %1) {
%3 = lshr i64 %0, 16
%4 = and i64 %3, 31
%5 = lshr i64 %0, 6
%6 = and i64 %5, 992
%7 = or i64 %4, %6
ret i64 %7
}
int Mini_AigLitConst0() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Mini_AigLitConst0() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint64_t GPIO_get_many(uint64_t pins) {
  ;
  return pins & ((((uint64_t)(*((volatile uint32_t *)(0x00200038)))) << 32) |
                 ((uint64_t)(*((volatile uint32_t *)(0x00200034)))));
}


x86 assembly (clang, -O0):
<GPIO_get_many>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x200038,%ecx
mov    (%rcx),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
mov    $0x200034,%edx
mov    (%rdx),%rdx
or     %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_get_many>:
mov    0x200038,%rax
mov    0x200034,%rax
ret

LLVM IR (-O0):
define i32 @GPIO_get_many(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load volatile i64, i64* inttoptr (i64 2097208 to i64*)
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 32
%7 = load volatile i64, i64* inttoptr (i64 2097204 to i64*)
%8 = trunc i64 %7 to i32
%9 = or i32 %6, %8
%10 = and i32 %3, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @GPIO_get_many(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 2097208 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2097204 to i64*)
ret i32 poison
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t a52e_get_frame_size(uint16_t i_frmsiz) { return (i_frmsiz + 1) * 2; }


x86 assembly (clang, -O0):
<a52e_get_frame_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_get_frame_size>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @a52e_get_frame_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = mul nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @a52e_get_frame_size(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, 2
ret i32 %3
}
int toupper(int c) {
  if ((c >= 'a') && (c <= 'z'))
    return (c - 'a' + 'A');
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <toupper+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_MediaRenderer_AVTransport_GetCurrentTransportActions(void *,
                                                                  char *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UpnpMediaRenderer_AVTransport_GetCurrentTransportActions(
    void *upnptoken, unsigned int InstanceID) {
  printf("Invoke: "
         "UpnpMediaRenderer_AVTransport_GetCurrentTransportActions(%u);\r\n",
         InstanceID);
  UpnpResponse_MediaRenderer_AVTransport_GetCurrentTransportActions(
      upnptoken, "Sample String");
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_AVTransport_GetCurrentTransportActions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeff(%rip),%rsi
call   1040 <UpnpResponse_MediaRenderer_AVTransport_GetCurrentTransportActions@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_AVTransport_GetCurrentTransportActions>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_AVTransport_GetCurrentTransportActions@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_GetCurrentTransportActions(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpMediaRenderer_AVTransport_GetCurrentTransportActions(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_MediaRenderer_AVTransport_GetCurrentTransportActions(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [72 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_GetCurrentTransportActions(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpMediaRenderer_AVTransport_GetCurrentTransportActions(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UpnpResponse_MediaRenderer_AVTransport_GetCurrentTransportActions(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned xrop3_31_0_1(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 | S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_31_0_1>:
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
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%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
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_31_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%edx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     $0xff,%ecx
and    %eax,%ecx
not    %ecx
and    %edx,%ecx
not    %eax
not    %edi
and    %esi,%edi
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_31_0_1(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* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%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 = and i32 %30, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = or i32 %32, %36
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = and i32 %41, %42
%44 = or i32 %37, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_31_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = xor i32 %9, -1
%11 = and i32 %5, %10
%12 = xor i32 %7, -1
%13 = xor i32 %3, -1
%14 = and i32 %13, %6
%15 = or i32 %14, %12
%16 = or i32 %15, %11
ret i32 %16
}
void ScaleARGBRowDown2Box_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDown2Box_Any_SSE2() {
ret void
}
void encrypt(char message[], int key) {}


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

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

LLVM IR (-O0):
define void @encrypt(i8* %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 @encrypt(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int u_int8_t;
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int readb_idx_reg(int /*<<< orphan*/, int);
int /*<<< orphan*/ writeb_idx_reg(int /*<<< orphan*/, int, int);
void writeb_idx_mask(u_int16_t reg, u_int8_t idx, u_int8_t val, u_int8_t mask) {
  u_int8_t tmp;
  tmp = readb_idx_reg(reg, idx);
  tmp &= ~mask;
  tmp |= (val & mask);
  writeb_idx_reg(reg, idx, tmp);
}


x86 assembly (clang, -O0):
<writeb_idx_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <readb_idx_reg@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <writeb_idx_reg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb_idx_mask>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%ebx
call   1030 <readb_idx_reg@plt>
xor    %eax,%ebp
and    %r14d,%ebp
xor    %eax,%ebp
mov    %ebx,%edi
mov    %r15d,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <writeb_idx_reg@plt>

LLVM IR (-O0):
define void @writeb_idx_mask(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @readb_idx_reg(i32 %10, i32 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %8
%14 = xor i32 %13, -1
%15 = load i32, i32* %9
%16 = and i32 %15, %14
store i32 %16, i32* %9
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = and i32 %17, %18
%20 = load i32, i32* %9
%21 = or i32 %20, %19
store i32 %21, i32* %9
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = load i32, i32* %9
%25 = call i32 @writeb_idx_reg(i32 %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @writeb_idx_mask(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @readb_idx_reg(i32 %0, i32 %1)
%6 = xor i32 %3, -1
%7 = and i32 %5, %6
%8 = and i32 %3, %2
%9 = or i32 %7, %8
%10 = tail call i32 @writeb_idx_reg(i32 %0, i32 %1, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ AES_128_Key_Expansion(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *);
int /*<<< orphan*/ AES_ECB_encrypt(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
void c_intel_benchmark(uint8_t *keys, uint8_t *data, uint8_t *dataOut) {
  uint8_t expandedKeys[176];
  AES_128_Key_Expansion(keys, expandedKeys);
  AES_ECB_encrypt(data, dataOut, expandedKeys);
}


x86 assembly (clang, -O0):
<c_intel_benchmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2e0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x2e0(%rbp),%rsi
call   1030 <AES_128_Key_Expansion@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x2e0(%rbp),%rdx
call   1040 <AES_ECB_encrypt@plt>
add    $0x2e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_intel_benchmark>:
push   %r15
push   %r14
push   %rbx
sub    $0x2c0,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <AES_128_Key_Expansion@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <AES_ECB_encrypt@plt>
add    $0x2c0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @c_intel_benchmark(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [176 x i32]
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds [176 x i32], [176 x i32]* %7, i64 0, i64 0
%10 = call i32 @AES_128_Key_Expansion(i32* %8, i32* %9)
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = getelementptr inbounds [176 x i32], [176 x i32]* %7, i64 0, i64 0
%14 = call i32 @AES_ECB_encrypt(i32* %11, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @c_intel_benchmark(i32* %0, i32* %1, i32* %2) {
%4 = alloca [176 x i32]
%5 = bitcast [176 x i32]* %4 to i8*
%6 = getelementptr inbounds [176 x i32], [176 x i32]* %4, i64 0, i64 0
%7 = call i32 @AES_128_Key_Expansion(i32* %0, i32* %6)
%8 = call i32 @AES_ECB_encrypt(i32* %1, i32* %2, i32* %6)
ret void
}