xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned int);
void delay(unsigned time) {
  unsigned delay;
  for (delay = 0; delay < time; ++delay)
    foo(delay);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1144 <delay+0x34>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <delay+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     112e <delay+0x1e>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <foo@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <delay+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @foo(i32 %4)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int fac(int);
int product_function(int acc, int x) {
  int f = fac(x);
  return acc * f;
}


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

x86 assembly (clang, -O2):
<product_function>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <fac@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @product_function(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* %4
%7 = call i32 @fac(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = mul nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @product_function(i32 %0, i32 %1) {
%3 = tail call i32 @fac(i32 %1)
%4 = mul nsw i32 %3, %0
ret i32 %4
}
long GPIOPinRead(unsigned long ulPort, unsigned long ulPins) {
  ;
  return ((*((volatile unsigned long *)(ulPort + 0x00000008))) & (ulPins));
}


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

x86 assembly (clang, -O2):
<GPIOPinRead>:
mov    %rsi,%rax
and    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @GPIOPinRead(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = load i64, i64* %4
%10 = and i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @GPIOPinRead(i64 %0, i64 %1) {
%3 = add i64 %0, 8
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, %1
ret i64 %6
}
/* Variables and functions */
char *SWIG_csharp_string_callback(char const *);
scalar_t__ qtValueTypeName(int);
__attribute__((visibility("default"))) char *CSharp_qtValueTypeName(int jarg1) {
  char *jresult;
  int arg1;
  char *result = 0;
  arg1 = (int)jarg1;
  result = (char *)qtValueTypeName(arg1);
  jresult = SWIG_csharp_string_callback((const char *)result);
  return jresult;
}


x86 assembly (clang, -O0):
<CSharp_qtValueTypeName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <qtValueTypeName@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <SWIG_csharp_string_callback@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSharp_qtValueTypeName>:
push   %rax
call   1040 <qtValueTypeName@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <SWIG_csharp_string_callback@plt>

LLVM IR (-O0):
define i8* @CSharp_qtValueTypeName(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %5
%6 = load i32, i32* %2
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i64 @qtValueTypeName(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i8* @SWIG_csharp_string_callback(i8* %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @CSharp_qtValueTypeName(i32 %0) {
%2 = tail call i64 @qtValueTypeName(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i8* @SWIG_csharp_string_callback(i8* %3)
ret i8* %4
}
int neiin42(int a) { return -(a != 42); }


x86 assembly (clang, -O0):
<neiin42>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neiin42>:
xor    %eax,%eax
cmp    $0x2a,%edi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @neiin42(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 42
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @neiin42(i32 %0) {
%2 = icmp ne i32 %0, 42
%3 = sext i1 %2 to i32
ret i32 %3
}
needbrack(str) char *str;
{
  if (match(str) == 0) {
    error("missing bracket");
    comment();
    outstr(str);
    nl();
  }
}


x86 assembly (clang, -O0):
<needbrack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <match@plt>
cmp    $0x0,%eax
jne    1197 <needbrack+0x47>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1070 <error@plt>
mov    $0x0,%al
call   1050 <comment@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<needbrack>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <match@plt>
test   %eax,%eax
je     1161 <needbrack+0x11>
pop    %rbx
ret
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1070 <error@plt>
xor    %eax,%eax
call   1050 <comment@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
call   1030 <nl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"missing bracket\00"
define i32 @needbrack(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, ...)*)(i8* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @comment()
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %10)
%12 = call i32 (...) @nl()
br label %13
13: ; preds = %7, %1
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"missing bracket\00"
define i32 @needbrack(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @comment()
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%8 = tail call i32 (...) @nl()
br label %9
9: ; preds = %4, %1
ret i32 undef
}
void test11(void) {
  _Bool b;
  asm volatile("movb %%gs:%P2,%b0" : "=q"(b) : "0"(0), "i"(5L));
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %gs:0x5,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
xor    %eax,%eax
mov    %gs:0x5,%al
ret

LLVM IR (-O0):
define void @test11() {
%1 = alloca i8
%2 = call i8 asm sideeffect "movb %gs:${2:P},${0:b}", "=q,0,i,~{dirflag},~{fpsr},~{flags}"(i1 false, i64 5)
store i8 %2, i8* %1
ret void
}

LLVM IR (-O2):
define void @test11() {
%1 = tail call i8 asm sideeffect "movb %gs:${2:P},${0:b}", "=q,0,i,~{dirflag},~{fpsr},~{flags}"(i1 false, i64 5)
ret void
}
void filter_uppercase(char *buffer) {
  for (buffer; *buffer; ++buffer) {
    *buffer = *buffer > 0x40 && *buffer < 0x5b ? *buffer | 0x60 : *buffer;
  }
}


x86 assembly (clang, -O0):
<filter_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <filter_uppercase+0x6d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jle    1147 <filter_uppercase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jge    1147 <filter_uppercase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
or     $0x60,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <filter_uppercase+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <filter_uppercase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_uppercase>:
mov    (%rdi),%al
test   %al,%al
je     112f <filter_uppercase+0x2f>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
lea    -0x41(%rax),%ecx
movzbl %al,%edx
or     $0x60,%al
cmp    $0x1a,%cl
movzbl %al,%eax
cmovae %edx,%eax
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <filter_uppercase+0x10>
ret

LLVM IR (-O0):
define void @filter_uppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
br label %4
4: ; preds = %31, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %34
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 64
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 91
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = or i32 %21, 96
br label %27
23: ; preds = %13, %8
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
br label %27
27: ; preds = %23, %18
%28 = phi i32 [ %22, %18 ], [ %26, %23 ]
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %2
store i8 %29, i8* %30
br label %31
31: ; preds = %27
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %2
br label %4
34: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @filter_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
%9 = or i8 %5, 96
%10 = select i1 %8, i8 %9, i8 %5
store i8 %10, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  printf("Enter an uppercase letter: ");
  scanf("%c", &c);
  printf("%c lowercase is: '%c'\n", c, c + ('a' - 'A'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
add    $0x20,%edx
lea    0xec0(%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
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    0x20(%rsi),%edx
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter an uppercase letter: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [23 x i8] c"%c lowercase is: '%c'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, 32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter an uppercase letter: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [23 x i8] c"%c lowercase is: '%c'\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int months_starting_in_day(int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int tmsd = months_starting_in_day(1960, 2000, 6);
  printf("\n");
  printf("total: %d\n", tmsd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7a8,%edi
mov    $0x7d0,%esi
mov    $0x6,%edx
call   1040 <months_starting_in_day@plt>
mov    %eax,-0x8(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7a8,%edi
mov    $0x7d0,%esi
mov    $0x6,%edx
call   1050 <months_starting_in_day@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [11 x i8] c"total: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @months_starting_in_day(i32 1960, i32 2000, i32 6)
store i32 %3, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"total: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @months_starting_in_day(i32 1960, i32 2000, i32 6)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
void RTPipeReadBlocking(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPipeReadBlocking() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void delete_assignment_variable(char *name) { free(name); }


x86 assembly (clang, -O0):
<delete_assignment_variable>:
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):
<delete_assignment_variable>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delete_assignment_variable(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 @delete_assignment_variable(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ num_stack_items();
int /*<<< orphan*/ stack_pop();
void stack_dropall() {
  while (num_stack_items() > 0)
    stack_pop();
}


x86 assembly (clang, -O0):
<stack_dropall>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <stack_dropall+0x9>
mov    $0x0,%al
call   1030 <num_stack_items@plt>
cmp    $0x0,%rax
jle    1146 <stack_dropall+0x26>
mov    $0x0,%al
call   1040 <stack_pop@plt>
jmp    1129 <stack_dropall+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_dropall>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <num_stack_items@plt>
test   %rax,%rax
jle    1145 <stack_dropall+0x25>
xor    %eax,%eax
call   1040 <stack_pop@plt>
jmp    1130 <stack_dropall+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @stack_dropall() {
%1 = tail call i64 (...) @num_stack_items()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @stack_pop()
%5 = tail call i64 (...) @num_stack_items()
%6 = icmp sgt i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret void
}
/* Type definitions */
struct menu_entry_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ menu_back(int);
int root_menu_cb(struct menu_entry_instance *instance) {
  (void)instance;
  menu_back(7);
  return 0;
}


x86 assembly (clang, -O0):
<root_menu_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
call   1030 <menu_back@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<root_menu_cb>:
push   %rax
mov    $0x7,%edi
call   1030 <menu_back@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.menu_entry_instance = type { i32 }
define i32 @root_menu_cb(%struct.menu_entry_instance* nocapture readnone %0) {
%2 = tail call i32 @menu_back(i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_file1() {
  printf("\nWhich file do you want to upload? ");
  return;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"\0AWhich file do you want to upload? \00"
define void @msg_file1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0AWhich file do you want to upload? \00"
define void @msg_file1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_1Fint16_mem(short *val) {
  return ((*val) & (-0x1F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Fint16_mem>:
movzwl (%rdi),%eax
test   $0xffe1,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -31
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int HashString(string)
register const char *string;
{
  register unsigned int result;
  register int c;
  result = 0;
  while (1) {
    c = *string;
    string++;
    if (c == 0) {
      break;
    }
    result += (result << 3) + c;
  }
  return result;
}


x86 assembly (clang, -O0):
<HashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1134 <HashString+0x34>
jmp    1148 <HashString+0x48>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <HashString+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <HashString+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,8),%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <HashString+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @HashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 9
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ init_frag();
int /*<<< orphan*/ init_framer();
int /*<<< orphan*/ init_lowPANcompression();
void init() {
  init_frag();
  init_framer();
  init_lowPANcompression();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_frag@plt>
mov    $0x0,%al
call   1030 <init_framer@plt>
mov    $0x0,%al
call   1040 <init_lowPANcompression@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1050 <init_frag@plt>
xor    %eax,%eax
call   1030 <init_framer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_lowPANcompression@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @init_frag()
%2 = call i32 (...) @init_framer()
%3 = call i32 (...) @init_lowPANcompression()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @init_frag()
%2 = tail call i32 (...) @init_framer()
%3 = tail call i32 (...) @init_lowPANcompression()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _nvram_commit();
int /*<<< orphan*/ nvram_close();
int /*<<< orphan*/ nvram_init(int /*<<< orphan*/ *);
int nvram_commit(void) {
  nvram_init(NULL);
  _nvram_commit();
  nvram_close();
  return 0;
}


x86 assembly (clang, -O0):
<nvram_commit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <nvram_init@plt>
mov    $0x0,%al
call   1030 <_nvram_commit@plt>
mov    $0x0,%al
call   1040 <nvram_close@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_commit>:
push   %rax
xor    %edi,%edi
call   1050 <nvram_init@plt>
xor    %eax,%eax
call   1030 <_nvram_commit@plt>
xor    %eax,%eax
call   1040 <nvram_close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nvram_commit() {
%1 = call i32 @nvram_init(i32* null)
%2 = call i32 (...) @_nvram_commit()
%3 = call i32 (...) @nvram_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @nvram_commit() {
%1 = tail call i32 @nvram_init(i32* null)
%2 = tail call i32 (...) @_nvram_commit()
%3 = tail call i32 (...) @nvram_close()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void psd_free(void *block) { free(block); }


x86 assembly (clang, -O0):
<psd_free>:
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):
<psd_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @psd_free(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 @psd_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
scalar_t__ sg_get_unaligned_le16(void const *);
uint32_t sg_get_unaligned_le24(const void *p) {
  return (uint32_t)sg_get_unaligned_le16(p) | ((const uint8_t *)p)[2] << 16;
}


x86 assembly (clang, -O0):
<sg_get_unaligned_le24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sg_get_unaligned_le16@plt>
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_get_unaligned_le24>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sg_get_unaligned_le16@plt>
mov    0x8(%rbx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sg_get_unaligned_le24(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @sg_get_unaligned_le16(i8* %3)
%5 = trunc i64 %4 to i32
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @sg_get_unaligned_le24(i8* %0) {
%2 = tail call i64 @sg_get_unaligned_le16(i8* %0)
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 8
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %3
ret i32 %8
}
/* 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_lisp_doc_string_blank() {
  test_parser_verify_parse(test_parser_sourcefile("lisp", " \"\"\"\"\"\""),
                           "lisp", "", "\"\"\"\"\"\"", 0);
}


x86 assembly (clang, -O0):
<test_lisp_doc_string_blank>:
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    0xec5(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lisp_doc_string_blank>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xece(%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"lisp\00"
@.str.1 = [8 x i8] c" \22\22\22\22\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"\22\22\22\22\22\22\00"
define void @test_lisp_doc_string_blank() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 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 ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [8 x i8] c" \22\22\22\22\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"\22\22\22\22\22\22\00"
define void @test_lisp_doc_string_blank() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 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 ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int not_a_proc_info_function(int i) { return i++; }


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

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

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

LLVM IR (-O2):
define i32 @not_a_proc_info_function(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t flip16(uint16_t v) {
  int i;
  uint16_t out = 0;
  for (i = 0; i < 16; i++)
    if (v & (1 << i))
      out |= (1 << (15 - i));
  return out;
}


x86 assembly (clang, -O0):
<flip16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1161 <flip16+0x61>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     114e <flip16+0x4e>
mov    $0xf,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <flip16+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <flip16+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip16>:
rol    $0x8,%di
mov    %edi,%eax
and    $0xf0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @flip16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = shl i32 1, %10
%12 = and i32 %9, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i32, i32* %3
%16 = sub nsw i32 15, %15
%17 = shl i32 1, %16
%18 = load i32, i32* %4
%19 = or i32 %18, %17
store i32 %19, i32* %4
br label %20
20: ; preds = %14, %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @flip16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = call i16 @llvm.bitreverse.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
int test_imm_17int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x17 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_17int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 98784247808
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int garbage(register int item, register char *garbage) {
  while (*garbage != 0)
    if (item == *garbage++)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<garbage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <garbage+0x49>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1144 <garbage+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1150 <garbage+0x50>
jmp    110b <garbage+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<garbage>:
movsbl (%rsi),%eax
test   %eax,%eax
je     1115 <garbage+0x15>
add    $0x1,%rsi
cmp    %edi,%eax
jne    1100 <garbage>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @garbage(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %9, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i32 %8, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
void my_getScreenResolution(int *out_width, int *out_height) {
  *out_width = 1024;
  *out_height = 768;
}


x86 assembly (clang, -O0):
<my_getScreenResolution>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x400,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x300,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getScreenResolution>:
movl   $0x400,(%rdi)
movl   $0x300,(%rsi)
ret

LLVM IR (-O0):
define void @my_getScreenResolution(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
store i32 1024, i32* %5
%6 = load i32*, i32** %4
store i32 768, i32* %6
ret void
}

LLVM IR (-O2):
define void @my_getScreenResolution(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 1024, i32* %0
store i32 768, i32* %1
ret void
}
char *rust_get_null_ptr() { return 0; }


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

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

LLVM IR (-O0):
define i8* @rust_get_null_ptr() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @rust_get_null_ptr() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int /*<<< orphan*/, unsigned char *);
unsigned char CheckId_HV7131RP(void) {
  unsigned char temp;
  VIM_SIF_I2cReadByte(0, &temp);
  if (temp == 0x42)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckId_HV7131RP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x42,%eax
jne    1139 <CheckId_HV7131RP+0x29>
movb   $0x1,-0x1(%rbp)
jmp    113d <CheckId_HV7131RP+0x2d>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_HV7131RP>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
cmpb   $0x42,0x7(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_HV7131RP() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 0, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 66
br i1 %6, label %7, label %8
7: ; preds = %0
store i8 1, i8* %1
br label %9
8: ; preds = %0
store i8 0, i8* %1
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @CheckId_HV7131RP() {
%1 = alloca i8
%2 = call i32 @VIM_SIF_I2cReadByte(i32 0, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 66
%5 = zext i1 %4 to i8
ret i8 %5
}
int test_imm_0Cint8_mem(signed char *val) {
  return ((*val) & (-0x0C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -12
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void XSetSubwindowMode() {}


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

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

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

LLVM IR (-O2):
define void @XSetSubwindowMode() {
ret void
}
void rop3_68_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = S & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_68_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_68_0_1>:
mov    %esi,%eax
not    %al
and    %dl,%al
xor    %sil,%al
and    (%rdi),%al
xor    %sil,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_68_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %1
%7 = xor i8 %1, -1
%8 = and i8 %7, %2
%9 = and i8 %8, %4
%10 = or i8 %6, %9
store i8 %10, i8* %0
ret void
}
int test_imm_17uint8_reg(unsigned char val) {
  return ((val) & (-0x17 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_17uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffe9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_17uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -23
%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_17uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -23
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float RAND_MAX;
float rand();
int helper_random_probability(float p) {
  if (rand() < (RAND_MAX * p)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<helper_random_probability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
mov    0x2eba(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114c <helper_random_probability+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <helper_random_probability+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_random_probability>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec3(%rip),%rax
movss  0x4(%rsp),%xmm1
mulss  (%rax),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define i32 @helper_random_probability(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = call float (...) @rand()
%5 = load float, float* @RAND_MAX
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = fcmp olt float %4, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define i32 @helper_random_probability(float %0) {
%2 = tail call float (...) @rand()
%3 = load float, float* @RAND_MAX
%4 = fmul float %3, %0
%5 = fcmp olt float %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int isonum_711(unsigned char *p) { return (*p & 0xff); }


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

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

LLVM IR (-O0):
define i32 @isonum_711(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 255
ret i32 %6
}

LLVM IR (-O2):
define i32 @isonum_711(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void RNDResponseSink_ConnectionManager_GetProtocolInfo(
    struct UPnPService *Service, int ErrorCode, void *User, char *Source,
    char *Sink) {
  printf("RND Invoke Response: "
         "ConnectionManager/GetProtocolInfo[ErrorCode:%d](%s,%s)\r\n",
         ErrorCode, Source, Sink);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ConnectionManager_GetProtocolInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_ConnectionManager_GetProtocolInfo>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: ConnectionManager/GetProtocolInfo[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @RNDResponseSink_ConnectionManager_GetProtocolInfo(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca %struct.UPnPService*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = load i8*, i8** %9
%13 = load i8*, i8** %10
%14 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: ConnectionManager/GetProtocolInfo[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @RNDResponseSink_ConnectionManager_GetProtocolInfo(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_accu();
int /*<<< orphan*/ e_ror();
int /*<<< orphan*/ e_writeback();
void e_ror_accu() {
  e_accu();
  e_ror();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_ror_accu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <e_accu@plt>
mov    $0x0,%al
call   1030 <e_ror@plt>
mov    $0x0,%al
call   1050 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_ror_accu>:
push   %rax
xor    %eax,%eax
call   1040 <e_accu@plt>
xor    %eax,%eax
call   1030 <e_ror@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <e_writeback@plt>

LLVM IR (-O0):
define void @e_ror_accu() {
%1 = call i32 (...) @e_accu()
%2 = call i32 (...) @e_ror()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_ror_accu() {
%1 = tail call i32 (...) @e_accu()
%2 = tail call i32 (...) @e_ror()
%3 = tail call i32 (...) @e_writeback()
ret void
}