xunge/DecIR huggingface dataset:
int test_imm_D2uint16_reg(unsigned short val) {
  return ((val) & (0xD2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D2uint16_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, 210
%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_D2uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 210
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int calculate(int);
int calculate1(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 999;
  printf("%d\n", calculate(n));
  printf("%d\n", calculate1(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e7,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <calculate@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <calculate1@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e7,%edi
call   1040 <calculate@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3e7,%edi
call   1050 <calculate1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @calculate(i32 999)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @calculate1(i32 999)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ jenkins_hash_array(int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/, int);
uint32_t jenkins_hash_intarray(const int32_t *d, uint32_t n) {
  return jenkins_hash_array((const uint32_t *)d, n, 0x17836abc);
}


x86 assembly (clang, -O0):
<jenkins_hash_intarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x17836abc,%edx
call   1030 <jenkins_hash_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jenkins_hash_intarray>:
mov    $0x17836abc,%edx
jmp    1030 <jenkins_hash_array@plt>

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

LLVM IR (-O2):
define i32 @jenkins_hash_intarray(i32* %0, i32 %1) {
%3 = tail call i32 @jenkins_hash_array(i32* %0, i32 %1, i32 394488508)
ret i32 %3
}
void removeNewlines(char *s) {
  char *i = s;
  char *j = s;
  while (*j != 0) {
    *i = *j++;
    if (*i != '\n') {
      i++;
    }
  }
  *i = 0;
}


x86 assembly (clang, -O0):
<removeNewlines>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <removeNewlines+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     115b <removeNewlines+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <removeNewlines+0x18>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeNewlines>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <removeNewlines+0x28>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    $0xa,%cl
setne  %dl
add    %rdx,%rdi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <removeNewlines+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @removeNewlines(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %2
store i8* %6, i8** %4
br label %7
7: ; preds = %24, %1
%8 = load i8*, i8** %4
%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 = %7
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
%15 = load i8, i8* %13
%16 = load i8*, i8** %3
store i8 %15, i8* %16
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 10
br i1 %20, label %21, label %24
21: ; preds = %12
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %24
24: ; preds = %21, %12
br label %7
25: ; preds = %7
%26 = load i8*, i8** %3
store i8 0, i8* %26
ret void
}

LLVM IR (-O2):
define void @removeNewlines(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %7
%9 = icmp ne i8 %5, 10
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %7, i64 %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i8* [ %0, %1 ], [ %11, %4 ]
store i8 0, i8* %15
ret void
}
/* Variables and functions */
char *mkdtemp(char *);
int rmdir(char *);
int main(void) {
  char dirname[] = "/tmp/temp.XXXXXX";
  if (mkdtemp(dirname) != dirname)
    return 1;
  return rmdir(dirname) == -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <mkdtemp@plt>
lea    -0x20(%rbp),%rcx
cmp    %rcx,%rax
je     1170 <main+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1187 <main+0x67>
lea    -0x20(%rbp),%rdi
call   1030 <rmdir@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <mkdtemp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    %rbx,%rcx
jne    115f <main+0x3f>
mov    %rsp,%rdi
call   1030 <rmdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.dirname = [17 x i8] c"/tmp/temp.XXXXXX\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
store i32 0, i32* %1
%3 = bitcast [17 x i8]* %2 to i8*
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%5 = call i8* @mkdtemp(i8* %4)
%6 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%7 = icmp ne i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %14
9: ; preds = %0
%10 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%11 = call i32 @rmdir(i8* %10)
%12 = icmp eq i32 %11, -1
%13 = zext i1 %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@__const.main.dirname = [17 x i8] c"/tmp/temp.XXXXXX\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = call i8* @mkdtemp(i8* %2)
%4 = icmp eq i8* %3, %2
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @rmdir(i8* %2)
%7 = icmp eq i32 %6, -1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %0, %5
%10 = phi i32 [ %8, %5 ], [ 1, %0 ]
ret i32 %10
}
int nla_get_flag(struct nlattr *nla) { return !!nla; }


x86 assembly (clang, -O0):
<nla_get_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_get_flag>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
%struct.nlattr = type opaque
define i32 @nla_get_flag(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = icmp ne %struct.nlattr* %3, null
%5 = xor i1 %4, true
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.nlattr = type opaque
define i32 @nla_get_flag(%struct.nlattr* readnone %0) {
%2 = icmp ne %struct.nlattr* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int other_func_a(int, int);
int other_func_b(int, int);
int test_02(int a, int b, int c, int d) {
  if ((a ^ b) < 0)
    return other_func_a(a, c);
  else
    return other_func_b(d, b);
}


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
cmp    $0x0,%eax
jge    1156 <test_02+0x36>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <other_func_a@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <test_02+0x44>
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <other_func_b@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
mov    %esi,%eax
xor    %edi,%eax
js     112d <test_02+0xd>
mov    %ecx,%edi
jmp    1040 <other_func_b@plt>
mov    %edx,%esi
jmp    1030 <other_func_a@plt>

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

LLVM IR (-O2):
define i32 @test_02(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = xor i32 %1, %0
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @other_func_a(i32 %0, i32 %2)
br label %11
9: ; preds = %4
%10 = tail call i32 @other_func_b(i32 %3, i32 %1)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printRow(int, int);
void printTriangle(int numRows) {
  for (int row = 1; row <= numRows; row++) {
    printRow(row, numRows);
  }
}


x86 assembly (clang, -O0):
<printTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1147 <printTriangle+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <printRow@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printTriangle+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTriangle>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    114c <printTriangle+0x3c>
mov    %edi,%r14d
mov    %edi,%ebp
neg    %ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <printRow@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <printTriangle+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printTriangle(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = tail call i32 @printRow(i32 %5, i32 %0)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_nop();
void main(void) {
  for (;;) {
    __builtin_nop();
    __builtin_nop();
    __builtin_nop();
    __builtin_nop();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <main+0x9>
mov    $0x0,%al
call   1030 <__builtin_nop@plt>
mov    $0x0,%al
call   1030 <__builtin_nop@plt>
mov    $0x0,%al
call   1030 <__builtin_nop@plt>
mov    $0x0,%al
call   1030 <__builtin_nop@plt>
jmp    1119 <main+0x9>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__builtin_nop@plt>
xor    %eax,%eax
call   1030 <__builtin_nop@plt>
xor    %eax,%eax
call   1030 <__builtin_nop@plt>
xor    %eax,%eax
call   1030 <__builtin_nop@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @__builtin_nop()
%3 = call i32 (...) @__builtin_nop()
%4 = call i32 (...) @__builtin_nop()
%5 = call i32 (...) @__builtin_nop()
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @__builtin_nop()
%3 = tail call i32 (...) @__builtin_nop()
%4 = tail call i32 (...) @__builtin_nop()
%5 = tail call i32 (...) @__builtin_nop()
br label %1
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, oldx;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x < 5) {
    oldx = x;
    x = oldx - y;
    y = oldx + y;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    115a <main+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void __attribute__((weak)) can2_rx1_isr() { debug_handler(__FUNCTION__); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XGetGeometry() {
ret void
}
/* Variables and functions */
void *MA_malloc(unsigned int, void *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void *MA_calloc(unsigned n, void *p) {
  p = MA_malloc(n, p);
  memset(p, 0, n);
  return p;
}


x86 assembly (clang, -O0):
<MA_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <MA_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MA_calloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <MA_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @MA_calloc(i32 %0, i8* %1) {
%3 = tail call i8* @MA_malloc(i32 %0, i8* %1)
%4 = tail call i32 @memset(i8* %3, i32 0, i32 %0)
ret i8* %3
}
struct BASE_CLASS_OBJECT *class(void *obj) {
  return (struct BASE_CLASS_OBJECT *)obj;
}


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

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

LLVM IR (-O0):
%struct.BASE_CLASS_OBJECT = type opaque
define %struct.BASE_CLASS_OBJECT* @class(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.BASE_CLASS_OBJECT*
ret %struct.BASE_CLASS_OBJECT* %4
}

LLVM IR (-O2):
%struct.BASE_CLASS_OBJECT = type opaque
define %struct.BASE_CLASS_OBJECT* @class(i8* readnone %0) {
%2 = bitcast i8* %0 to %struct.BASE_CLASS_OBJECT*
ret %struct.BASE_CLASS_OBJECT* %2
}
/* Variables and functions */
int /*<<< orphan*/ cgmod();
int /*<<< orphan*/ cgpop2();
int /*<<< orphan*/ cgswap();
int /*<<< orphan*/ gentext();
void genmod(int swap) {
  gentext();
  cgpop2();
  if (swap)
    cgswap();
  cgmod();
}


x86 assembly (clang, -O0):
<genmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <gentext@plt>
mov    $0x0,%al
call   1050 <cgpop2@plt>
cmpl   $0x0,-0x4(%rbp)
je     116a <genmod+0x2a>
mov    $0x0,%al
call   1040 <cgswap@plt>
mov    $0x0,%al
call   1030 <cgmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genmod>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <gentext@plt>
xor    %eax,%eax
call   1050 <cgpop2@plt>
test   %ebx,%ebx
je     115c <genmod+0x1c>
xor    %eax,%eax
call   1040 <cgswap@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <cgmod@plt>

LLVM IR (-O0):
define void @genmod(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gentext()
%4 = call i32 (...) @cgpop2()
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @cgswap()
br label %9
9: ; preds = %7, %1
%10 = call i32 (...) @cgmod()
ret void
}

LLVM IR (-O2):
define void @genmod(i32 %0) {
%2 = tail call i32 (...) @gentext()
%3 = tail call i32 (...) @cgpop2()
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @cgswap()
br label %7
7: ; preds = %5, %1
%8 = tail call i32 (...) @cgmod()
ret void
}
float ytetr(float v1) { return 4 * v1; }


x86 assembly (clang, -O0):
<ytetr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @ytetr(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 4.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @ytetr(float %0) {
%2 = fmul float %0, 4.000000e+00
ret float %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int UINT32_MAX;
int nlz32(int);
int nlz64(uint64_t x) {
  int s = nlz32(x >> 32);
  return (s == 32) ? (32 + nlz32(x & UINT32_MAX)) : s;
}


x86 assembly (clang, -O0):
<nlz64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <nlz32@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    1153 <nlz64+0x43>
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
and    (%rax),%edi
call   1030 <nlz32@plt>
add    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <nlz64+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlz64>:
push   %rbx
mov    %edi,%ebx
call   1030 <nlz32@plt>
cmp    $0x20,%eax
jne    1130 <nlz64+0x20>
mov    0x2ed4(%rip),%rax
and    (%rax),%ebx
mov    %ebx,%edi
call   1030 <nlz32@plt>
add    $0x20,%eax
pop    %rbx
ret

LLVM IR (-O0):
@UINT32_MAX = global i32 0
define i32 @nlz64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 32
%6 = call i32 @nlz32(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @UINT32_MAX
%12 = and i32 %10, %11
%13 = call i32 @nlz32(i32 %12)
%14 = add nsw i32 32, %13
br label %17
15: ; preds = %1
%16 = load i32, i32* %3
br label %17
17: ; preds = %15, %9
%18 = phi i32 [ %14, %9 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
@UINT32_MAX = global i32 0
define i32 @nlz64(i32 %0) {
%2 = tail call i32 @nlz32(i32 poison)
%3 = icmp eq i32 %2, 32
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @UINT32_MAX
%6 = and i32 %5, %0
%7 = tail call i32 @nlz32(i32 %6)
%8 = add nsw i32 %7, 32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ %2, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int my_hello2() { printf("Hello2 from mydll\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Hello2 from mydll\00"
define i32 @my_hello2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int f142(int *);
int f143(int *p) { return f142(p); }


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

x86 assembly (clang, -O2):
<f143>:
jmp    1030 <f142@plt>

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

LLVM IR (-O2):
define i32 @f143(i32* %0) {
%2 = tail call i32 @f142(i32* %0)
ret i32 %2
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int num;
  printf("Enter number: ");
  scanf(" %d", &num);
  printf("%d\n", fact(num));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xeac(%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    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fact@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int main(int argc, char **argv) {
  argv[0] = "[";
  execv("/vsta/bin/test", argv);
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xecf(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <execv@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rax
mov    %rax,(%rsi)
lea    0xee0(%rip),%rdi
call   1030 <execv@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
@.str.1 = [15 x i8] c"/vsta/bin/test\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8**, i8*** %5
%9 = call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [2 x i8] c"[\00"
@.str.1 = [15 x i8] c"/vsta/bin/test\00"
define i32 @main(i32 %0, i8** %1) {
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %1)
ret i32 1
}
/* Type definitions */
struct hipe_sdesc {
  int dummy;
};

/* Variables and functions */
unsigned int sdesc_arity(struct hipe_sdesc const *);
unsigned int sdesc_fsize(struct hipe_sdesc const *);
unsigned int nstack_walk_frame_size(const struct hipe_sdesc *sdesc) {
  return sdesc_fsize(sdesc) + 1 + sdesc_arity(sdesc);
}


x86 assembly (clang, -O0):
<nstack_walk_frame_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sdesc_fsize@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sdesc_arity@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nstack_walk_frame_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <sdesc_fsize@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1040 <sdesc_arity@plt>
add    %r14d,%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.hipe_sdesc = type { i32 }
define i32 @nstack_walk_frame_size(%struct.hipe_sdesc* %0) {
%2 = alloca %struct.hipe_sdesc*
store %struct.hipe_sdesc* %0, %struct.hipe_sdesc** %2
%3 = load %struct.hipe_sdesc*, %struct.hipe_sdesc** %2
%4 = call i32 @sdesc_fsize(%struct.hipe_sdesc* %3)
%5 = add i32 %4, 1
%6 = load %struct.hipe_sdesc*, %struct.hipe_sdesc** %2
%7 = call i32 @sdesc_arity(%struct.hipe_sdesc* %6)
%8 = add i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.hipe_sdesc = type { i32 }
define i32 @nstack_walk_frame_size(%struct.hipe_sdesc* %0) {
%2 = tail call i32 @sdesc_fsize(%struct.hipe_sdesc* %0)
%3 = add i32 %2, 1
%4 = tail call i32 @sdesc_arity(%struct.hipe_sdesc* %0)
%5 = add i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void CRCSeedSet(uint32_t ui32Base, uint32_t ui32Seed) {
  ASSERT(ui32Base == 0x44030000);
  (*((volatile uint32_t *)(ui32Base + 0x00000410))) = ui32Seed;
}


x86 assembly (clang, -O0):
<CRCSeedSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44030000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x410,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRCSeedSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44030000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x410(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @CRCSeedSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1141047296
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1040
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %9, i32* %13
ret void
}

LLVM IR (-O2):
define void @CRCSeedSet(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141047296
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 1040
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %1, i32* %8
ret void
}
int test_imm_FDuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xFD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FDuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 253
%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_FDuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1086626725888
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void m() {}


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

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

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

LLVM IR (-O2):
define void @m() {
ret void
}
void enterSysPatchGenfsk(void) {}


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

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

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

LLVM IR (-O2):
define void @enterSysPatchGenfsk() {
ret void
}
void clockPause(void) {
  unsigned int waiting_time = 0;
  while (waiting_time++ < 500)
    ;
}


x86 assembly (clang, -O0):
<clockPause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x1f4,%eax
jae    1126 <clockPause+0x26>
jmp    110b <clockPause+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @clockPause() {
ret void
}
int mywrite(void *arg, char const *buffer, int len) { return 0; }


x86 assembly (clang, -O0):
<mywrite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mywrite(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void pipe() {}


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

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

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

LLVM IR (-O2):
define void @pipe() {
ret void
}
int test_imm_97uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x97 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_97uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 151
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  int a;
  int b = 2;
  int c = 11;
  for (a = -123; a < 0; c += 12, b += 5) {
    a += b;
    a += c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0xb,-0x10(%rbp)
movl   $0xffffff85,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1153 <main+0x53>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    1120 <main+0x20>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_clone_tree(struct XorrisO *, int /*<<< orphan*/ *, char *, char *,
                       int /*<<< orphan*/);
int Xorriso_option_clone(struct XorrisO *xorriso, char *origin, char *dest,
                         int flag) {
  int ret;
  ret = Xorriso_clone_tree(xorriso, NULL, origin, dest, 0);
  return (ret);
}


x86 assembly (clang, -O0):
<Xorriso_option_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
xor    %r8d,%r8d
call   1030 <Xorriso_clone_tree@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xorriso_option_clone>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
xor    %r8d,%r8d
jmp    1030 <Xorriso_clone_tree@plt>

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_clone(%struct.XorrisO* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.XorrisO*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store %struct.XorrisO* %0, %struct.XorrisO** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load %struct.XorrisO*, %struct.XorrisO** %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = call i32 @Xorriso_clone_tree(%struct.XorrisO* %10, i32* null, i8* %11, i8* %12, i32 0)
store i32 %13, i32* %9
%14 = load i32, i32* %9
ret i32 %14
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_clone(%struct.XorrisO* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @Xorriso_clone_tree(%struct.XorrisO* %0, i32* null, i8* %1, i8* %2, i32 0)
ret i32 %5
}
void resetlogger() {
  volatile unsigned *iomem0 = (unsigned *)0xb0000000;
  *iomem0 = 0xffffffff;
}


x86 assembly (clang, -O0):
<resetlogger>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetlogger>:
mov    $0xb0000000,%eax
movl   $0xffffffff,(%rax)
ret

LLVM IR (-O0):
define void @resetlogger() {
%1 = alloca i32*
store i32* inttoptr (i64 2952790016 to i32*), i32** %1
%2 = load i32*, i32** %1
store volatile i32 -1, i32* %2
ret void
}

LLVM IR (-O2):
define void @resetlogger() {
store volatile i32 -1, i32* inttoptr (i64 2952790016 to i32*)
ret void
}
int digits_ceiling(unsigned int n) {
  int l = 0;
  while (n)
    n /= 10, ++l;
  return l + 1;
}


x86 assembly (clang, -O0):
<digits_ceiling>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1135 <digits_ceiling+0x35>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <digits_ceiling+0xe>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits_ceiling>:
mov    $0x1,%eax
test   %edi,%edi
je     1124 <digits_ceiling+0x24>
mov    $0xcccccccd,%ecx
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <digits_ceiling+0x10>
ret

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

LLVM IR (-O2):
define i32 @digits_ceiling(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add i32 %4, 1
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
int pow2_next(int n) {
  if (n <= 0) {
    return 1;
  }
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n++;
  return n;
}


x86 assembly (clang, -O0):
<pow2_next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <pow2_next+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1168 <pow2_next+0x68>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2_next>:
test   %edi,%edi
jle    112a <pow2_next+0x2a>
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
or     %ecx,%eax
add    $0x1,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pow2_next(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %31
7: ; preds = %1
%8 = load i32, i32* %3
%9 = ashr i32 %8, 1
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = ashr i32 %12, 2
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = ashr i32 %16, 4
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = ashr i32 %20, 8
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = ashr i32 %24, 16
%26 = load i32, i32* %3
%27 = or i32 %26, %25
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
%30 = load i32, i32* %3
store i32 %30, i32* %2
br label %31
31: ; preds = %7, %6
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @pow2_next(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
%5 = or i32 %4, %0
%6 = ashr i32 %5, 2
%7 = or i32 %6, %5
%8 = ashr i32 %7, 4
%9 = or i32 %8, %7
%10 = ashr i32 %9, 8
%11 = or i32 %10, %9
%12 = ashr i32 %11, 16
%13 = or i32 %12, %11
%14 = add nsw i32 %13, 1
br label %15
15: ; preds = %1, %3
%16 = phi i32 [ %14, %3 ], [ 1, %1 ]
ret i32 %16
}
void done_sockets() {}


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

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

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

LLVM IR (-O2):
define void @done_sockets() {
ret void
}
void handler(int unused) {}


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
/* Variables and functions */
double sqrt(int);
double CircularEaseOut(double p) { return sqrt((2 - p) * p); }


x86 assembly (clang, -O0):
<CircularEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CircularEaseOut>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @CircularEaseOut(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 2.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = fptosi double %6 to i32
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @CircularEaseOut(double %0) {
%2 = fsub double 2.000000e+00, %0
%3 = fmul double %2, %0
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
unsigned int pack_a(int a) { return (unsigned int)a << 24; }


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

x86 assembly (clang, -O2):
<pack_a>:
mov    %edi,%eax
shl    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @pack_a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
ret i32 %4
}

LLVM IR (-O2):
define i32 @pack_a(i32 %0) {
%2 = shl i32 %0, 24
ret i32 %2
}