xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
unsigned int odroid_xu_gpio_read_22() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 7;
  return (exynos_5410_gpio_read(bank_offset) >> bit_index) & 0x1;
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_read_22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exynos_5410_gpio_read@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_read_22>:
push   %rax
mov    $0xc40,%edi
call   1030 <exynos_5410_gpio_read@plt>
shr    $0x7,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @odroid_xu_gpio_read_22() {
%1 = alloca i32
%2 = alloca i32
store i32 3136, i32* %1
store i32 7, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @exynos_5410_gpio_read(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %4, %5
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @odroid_xu_gpio_read_22() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = lshr i32 %1, 7
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fd_get_offset(int fd) { return lseek(fd, 0, SEEK_CUR); }


x86 assembly (clang, -O0):
<fd_get_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_get_offset>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define i32 @fd_get_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SEEK_CUR
%5 = call i32 @lseek(i32 %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define i32 @fd_get_offset(i32 %0) {
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @lseek(i32 %0, i32 0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_header(FILE *f, const char *name) {
  fprintf(f,
          "SD %s "
          "5.0"
          "\n"
          "Copyright (C) 2014 Nate Stainton,\n"
          "Detects if a Flash Drive is using fake memory.\n"
          "Run with the path of a SD Card or Flash Drive to test.\n"
          "\n",
          name);
}


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

x86 assembly (clang, -O2):
<print_header>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [148 x i8] c"SD %s 5.0\0ACopyright (C) 2014 Nate Stainton,\0ADetects if a Flash Drive is using fake memory.\0ARun with the path of a SD Card or Flash Drive to test.\0A\0A\00"
define void @print_header(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 i32 @fprintf(i32* %5, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"SD %s 5.0\0ACopyright (C) 2014 Nate Stainton,\0ADetects if a Flash Drive is using fake memory.\0ARun with the path of a SD Card or Flash Drive to test.\0A\0A\00"
define void @print_header(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c += 0x20;
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void gtk_text_buffer_select_range() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_select_range() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addsuba(char *);
void i_suba(void) { addsuba("sub"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"sub\00"
define void @i_suba() {
%1 = call i32 @addsuba(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sub\00"
define void @i_suba() {
%1 = tail call i32 @addsuba(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int counter = 0;
  int prime = 2;
  while (1) {
    if (is_prime(prime))
      counter++;
    if (counter == 10001)
      break;
    prime++;
  }
  printf("10001st PRIME: %d\n", prime);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2711,-0x8(%rbp)
jne    116a <main+0x4a>
jmp    1178 <main+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <is_prime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
cmp    $0x2711,%ebp
jne    1130 <main+0x10>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"10001st PRIME: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %0, %15
%5 = load i32, i32* %3
%6 = call i64 @is_prime(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %4
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 10001
br i1 %13, label %14, label %15
14: ; preds = %11
br label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %14
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"10001st PRIME: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i32 [ 2, %0 ], [ %9, %1 ]
%4 = tail call i64 @is_prime(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %2, %6
%8 = icmp eq i32 %7, 10001
%9 = add nuw nsw i32 %3, 1
br i1 %8, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void Vec2F_Copy(float *a, float *b) {
  b[0] = a[0];
  b[1] = a[1];
}


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

x86 assembly (clang, -O2):
<Vec2F_Copy>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
ret

LLVM IR (-O0):
define void @Vec2F_Copy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %4
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
ret void
}

LLVM IR (-O2):
define void @Vec2F_Copy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
ret void
}
unsigned long GPIODirModeGet(unsigned long ulPort, unsigned char ucPin) {
  unsigned long ulDir;
  ;
  ;
  ucPin = 1 << ucPin;
  ulDir = (*((volatile unsigned long *)(ulPort + 0x00000400)));
  return (((ulDir & ucPin) ? 1 : 0));
}


x86 assembly (clang, -O0):
<GPIODirModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
movzbl -0x9(%rbp),%eax
and    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODirModeGet>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    0x400(%rdi),%rcx
xor    %eax,%eax
test   %cl,%dl
setne  %al
ret

LLVM IR (-O0):
define i64 @GPIODirModeGet(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i64
store i64 %0, i64* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = shl i32 1, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i64, i64* %3
%11 = add i64 %10, 1024
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = load i8, i8* %4
%16 = zext i8 %15 to i64
%17 = and i64 %14, %16
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 1, i32 0
%21 = sext i32 %20 to i64
ret i64 %21
}

LLVM IR (-O2):
define i64 @GPIODirModeGet(i64 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = shl nuw i32 1, %3
%5 = add i64 %0, 1024
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i32 %4, 255
%9 = zext i32 %8 to i64
%10 = and i64 %7, %9
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t wctomb(char *, int /*<<< orphan*/);
size_t wcrtomb(char *restrict s, wchar_t wc, mbstate_t *restrict ps) {
  ps;
  return (wctomb(s, wc));
}


x86 assembly (clang, -O0):
<wcrtomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <wctomb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcrtomb>:
jmp    1030 <wctomb@plt>

LLVM IR (-O0):
define i64 @wcrtomb(i8* noalias %0, i32 %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i64 @wctomb(i8* %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @wcrtomb(i8* noalias %0, i32 %1, i32* noalias nocapture readnone %2) {
%4 = tail call i64 @wctomb(i8* %0, i32 %1)
ret i64 %4
}
int test_imm_5Auint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x5A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Auint64_midword_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, 16
%6 = and i64 %5, 90
%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_5Auint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5898240
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned invariant_toupper(unsigned c) {
  return ('a' <= c && c <= 'z') ? c & ~0x20 : c;
}


x86 assembly (clang, -O0):
<invariant_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
ja     112d <invariant_toupper+0x2d>
cmpl   $0x7a,-0x4(%rbp)
ja     112d <invariant_toupper+0x2d>
mov    -0x4(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <invariant_toupper+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @invariant_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 97, %3
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, -33
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @invariant_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = and i32 %0, -33
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_mult_op();
int /*<<< orphan*/ arm_memio_stm_usr(int /*<<< orphan*/);
void arm_stm_usr() { arm_memio_stm_usr(arm_memio_mult_op()); }


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

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

LLVM IR (-O0):
define void @arm_stm_usr() {
%1 = call i32 (...) @arm_memio_mult_op()
%2 = call i32 @arm_memio_stm_usr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_stm_usr() {
%1 = tail call i32 (...) @arm_memio_mult_op()
%2 = tail call i32 @arm_memio_stm_usr(i32 %1)
ret void
}
/* Variables and functions */
double UINT32_MAX;
scalar_t__ ctss_rand();
float ctss_randf(const float min, const float max) {
  return min + (float)ctss_rand() * (float)(1.0 / UINT32_MAX) * (max - min);
}


x86 assembly (clang, -O0):
<ctss_randf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ctss_rand@plt>
movss  -0xc(%rbp),%xmm1
cvtsi2ss %rax,%xmm0
movsd  0xebb(%rip),%xmm2
mov    0x2eac(%rip),%rax
divsd  (%rax),%xmm2
cvtsd2ss %xmm2,%xmm2
mulss  %xmm2,%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctss_randf>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <ctss_rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2ec6(%rip),%rax
movsd  0xec6(%rip),%xmm1
divsd  (%rax),%xmm1
cvtsd2ss %xmm1,%xmm1
mulss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@UINT32_MAX = global double 0.000000e+00
define float @ctss_randf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call i64 (...) @ctss_rand()
%7 = sitofp i64 %6 to float
%8 = load double, double* @UINT32_MAX
%9 = fdiv double 1.000000e+00, %8
%10 = fptrunc double %9 to float
%11 = fmul float %7, %10
%12 = load float, float* %4
%13 = load float, float* %3
%14 = fsub float %12, %13
%15 = call float @llvm.fmuladd.f32(float %11, float %14, float %5)
ret float %15
}

LLVM IR (-O2):
@UINT32_MAX = global double 0.000000e+00
define float @ctss_randf(float %0, float %1) {
%3 = tail call i64 (...) @ctss_rand()
%4 = sitofp i64 %3 to float
%5 = load double, double* @UINT32_MAX
%6 = fdiv double 1.000000e+00, %5
%7 = fptrunc double %6 to float
%8 = fmul float %4, %7
%9 = fsub float %1, %0
%10 = tail call float @llvm.fmuladd.f32(float %8, float %9, float %0)
ret float %10
}
void foo102() {}


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

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

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

LLVM IR (-O2):
define void @foo102() {
ret void
}
int main(int argc, char *argv[]) {
  int a = argc;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
unsigned int bar();
void foo20x7f(void) {
  unsigned int a = bar();
  if (a > 0x7f)
    bar();
}


x86 assembly (clang, -O0):
<foo20x7f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
jbe    1133 <foo20x7f+0x23>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo20x7f>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x80,%eax
jb     1127 <foo20x7f+0x17>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @foo20x7f() {
%1 = tail call i32 (...) @bar()
%2 = icmp ugt i32 %1, 127
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int lower(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c = 'J';
  int d = lower(c);
  int e = 'X';
  int f = lower(e);
  printf("%c --> %c\n", c, d);
  printf("%c --> %c\n", e, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4a,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <lower@plt>
mov    %eax,-0xc(%rbp)
movl   $0x58,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <lower@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x4a,%edi
call   1040 <lower@plt>
mov    %eax,%ebx
mov    $0x58,%edi
call   1040 <lower@plt>
mov    %eax,%ebp
lea    0xebd(%rip),%r14
mov    %r14,%rdi
mov    $0x4a,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x58,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%c --> %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 74, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @lower(i32 %6)
store i32 %7, i32* %3
store i32 88, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @lower(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%c --> %c\0A\00"
define i32 @main() {
%1 = tail call i32 @lower(i32 74)
%2 = tail call i32 @lower(i32 88)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 74, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 88, i32 %2)
ret i32 0
}
int test_imm_CFint32_reg(int val) { return ((val) & (0xCF << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_CFint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xcf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_CFint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 207
%5 = icmp ne i32 %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_CFint32_reg(i32 %0) {
%2 = and i32 %0, 207
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *drvr) {}


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

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

LLVM IR (-O0):
%struct.brcmf_pub = type opaque
define void @MUTEX_LOCK_SOFTAP_SET(%struct.brcmf_pub* %0) {
%2 = alloca %struct.brcmf_pub*
store %struct.brcmf_pub* %0, %struct.brcmf_pub** %2
ret void
}

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @MUTEX_LOCK_SOFTAP_SET(%struct.brcmf_pub* nocapture %0) {
ret void
}
void mymalloc_done() {}


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

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

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

LLVM IR (-O2):
define void @mymalloc_done() {
ret void
}
void ab5500_remove_debugfs(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ab5500_remove_debugfs() {
ret void
}
int test_imm_EEuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xEE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EEuint64_highword_reg>:
movabs $0xee00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EEuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 238
%6 = icmp ne i64 %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_EEuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1022202216448
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int syscall(int, int);
int uv__inotify_init1(int flags) { return syscall(294, flags); }


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

x86 assembly (clang, -O2):
<uv__inotify_init1>:
mov    %edi,%esi
mov    $0x126,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @uv__inotify_init1(i32 %0) {
%2 = tail call i32 @syscall(i32 294, i32 %0)
ret i32 %2
}
void foo096() {}


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

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

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

LLVM IR (-O2):
define void @foo096() {
ret void
}
unsigned long sdbm(const unsigned char *str) {
  unsigned long hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <sdbm+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sdbm+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <sdbm+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbm+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @sdbm(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = zext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
char *xstrdup(str)
char *str;
{
  void *p;
  p = xmalloc(strlen(str) + 1);
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <xmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <xmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
double dbl_mul_sub(double a, double b, double c) { return (a * b) - c; }


x86 assembly (clang, -O0):
<dbl_mul_sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_mul_sub>:
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dbl_mul_sub(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %7, double %8, double %10)
ret double %11
}

LLVM IR (-O2):
define double @dbl_mul_sub(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
int /*<<< orphan*/ h_free(void *);
void component_player_free(void *handle) {
  if (!handle) {
    debug_warning("[component_player_free] handle cannot be NULL");
    return;
  }
  h_free(handle);
}


x86 assembly (clang, -O0):
<component_player_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <component_player_free+0x28>
lea    0xec2(%rip),%rdi
call   1040 <debug_warning@plt>
jmp    1151 <component_player_free+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <h_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_player_free>:
test   %rdi,%rdi
je     112a <component_player_free+0xa>
jmp    1030 <h_free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <debug_warning@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"[component_player_free] handle cannot be NULL\00"
define void @component_player_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @debug_warning(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @h_free(i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"[component_player_free] handle cannot be NULL\00"
define void @component_player_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @debug_warning(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @h_free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
extern void y() {}


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

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

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

LLVM IR (-O2):
define void @y() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t bswap_32(uint32_t x) {
  x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0x00FF00FF);
  x = (x >> 16) | (x << 16);
  return x;
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_32>:
bswap  %edi
ror    $0x10,%edi
mov    %edi,%eax
sar    $0x10,%eax
shl    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = load i32, i32* %2
%13 = shl i32 %12, 16
%14 = or i32 %11, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @bswap_32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
%7 = ashr i32 %6, 16
%8 = shl i32 %6, 16
%9 = or i32 %7, %8
ret i32 %9
}
int foo(unsigned long a, long b) { return (a & !a) | (b & (b == 0)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,-0x8(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,-0x10(%rbp)
sete   %dl
and    $0x1,%dl
movzbl %dl,%edx
movslq %edx,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
test   %rdi,%rdi
sete   %cl
and    %edi,%ecx
xor    %eax,%eax
test   %rsi,%rsi
sete   %al
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(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 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = sext i32 %9 to i64
%11 = and i64 %5, %10
%12 = load i64, i64* %4
%13 = load i64, i64* %4
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = sext i32 %15 to i64
%17 = and i64 %12, %16
%18 = or i64 %11, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = zext i1 %3 to i64
%5 = and i64 %4, %0
%6 = icmp eq i64 %1, 0
%7 = zext i1 %6 to i64
%8 = and i64 %7, %1
%9 = or i64 %8, %5
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int register_trace_kmem_cache_free(
    void (*probe)(unsigned long call_site, const void *ptr)) {
  return tracepoint_probe_register("kmem_cache_free", (void *)probe);
}


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

x86 assembly (clang, -O2):
<register_trace_kmem_cache_free>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tracepoint_probe_register@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"kmem_cache_free\00"
define i32 @register_trace_kmem_cache_free(void (i64, i8*)* %0) {
%2 = alloca void (i64, i8*)*
store void (i64, i8*)* %0, void (i64, i8*)** %2
%3 = load void (i64, i8*)*, void (i64, i8*)** %2
%4 = bitcast void (i64, i8*)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"kmem_cache_free\00"
define i32 @register_trace_kmem_cache_free(void (i64, i8*)* %0) {
%2 = bitcast void (i64, i8*)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Type definitions */
struct _tuple29 {
  int dummy;
};
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_spec_rec(struct Cyc_Lexing_lexbuf *, int);
struct _tuple29 *Cyc_spec(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_spec_rec(lexbuf, 13); });
}


x86 assembly (clang, -O0):
<Cyc_spec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <Cyc_spec_rec@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_spec>:
push   %rax
mov    $0xd,%esi
call   1030 <Cyc_spec_rec@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct._tuple29 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple29* @Cyc_spec(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_spec_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 13)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct._tuple29*
ret %struct._tuple29* %8
}

LLVM IR (-O2):
%struct._tuple29 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple29* @Cyc_spec(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_spec_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 13)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct._tuple29*
ret %struct._tuple29* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *do_malloc(size_t size) {
  void *new;
  if ((new = malloc(size)) == NULL) {
    (void)fprintf(stderr, "fortune: out of memory.\n");
    exit(1);
  }
  return new;
}


x86 assembly (clang, -O0):
<do_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1172 <do_malloc+0x42>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <do_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"fortune: out of memory.\0A\00"
define i8* @do_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"fortune: out of memory.\0A\00"
define noalias i8* @do_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
unsigned int ar_ni_status_get(int my_cid) {}


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

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

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

LLVM IR (-O2):
define i32 @ar_ni_status_get(i32 %0) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int parseSortKey(char *key) {
  if (strcmp(key, "packets") == 0)
    return 1;
  else if (strcmp(key, "bytes") == 0)
    return 2;
  else
    return -1;
}


x86 assembly (clang, -O0):
<parseSortKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <parseSortKey+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <parseSortKey+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <parseSortKey+0x58>
movl   $0x2,-0x4(%rbp)
jmp    116f <parseSortKey+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseSortKey>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     113e <parseSortKey+0x2e>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"packets\00"
@.str.1 = [6 x i8] c"bytes\00"
define i32 @parseSortKey(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %2
br label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"packets\00"
@.str.1 = [6 x i8] c"bytes\00"
define i32 @parseSortKey(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 2, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void sys_getversion(int *major, int *minor, int *bugfix) {
  if (major)
    *major = 0;
  if (minor)
    *minor = 47;
  if (bugfix)
    *bugfix = 0;
}


x86 assembly (clang, -O0):
<sys_getversion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <sys_getversion+0x25>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113a <sys_getversion+0x3a>
mov    -0x10(%rbp),%rax
movl   $0x2f,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     114f <sys_getversion+0x4f>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_getversion>:
test   %rdi,%rdi
je     110b <sys_getversion+0xb>
movl   $0x0,(%rdi)
test   %rsi,%rsi
je     1116 <sys_getversion+0x16>
movl   $0x2f,(%rsi)
test   %rdx,%rdx
je     1121 <sys_getversion+0x21>
movl   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @sys_getversion(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 0, i32* %0
br label %6
6: ; preds = %5, %3
%7 = icmp eq i32* %1, null
br i1 %7, label %9, label %8
8: ; preds = %6
store i32 47, i32* %1
br label %9
9: ; preds = %8, %6
%10 = icmp eq i32* %2, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
ret void
}
int get_msgid_set(int num) {
  static int nextnum = 0x10000000;
  int ret;
  if ((unsigned int)(nextnum) + (unsigned int)(num) >
      (unsigned int)(0xFFFFFFFF))
    return -1;
  ret = nextnum;
  nextnum += num;
  return ret;
}


x86 assembly (clang, -O0):
<get_msgid_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0x2f13(%rip),%eax
add    -0x8(%rbp),%eax
cmp    $0xffffffff,%eax
jbe    1125 <get_msgid_set+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <get_msgid_set+0x43>
mov    0x2ef5(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    0x2ee9(%rip),%eax
mov    %eax,0x2ee3(%rip)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msgid_set>:
mov    0x2f1a(%rip),%eax
add    %eax,%edi
mov    %edi,0x2f12(%rip)
ret

LLVM IR (-O0):
@get_msgid_set.nextnum = internal global i32 268435456
define i32 @get_msgid_set(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* @get_msgid_set.nextnum
%6 = load i32, i32* %3
%7 = add i32 %5, %6
%8 = icmp ugt i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %16
10: ; preds = %1
%11 = load i32, i32* @get_msgid_set.nextnum
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* @get_msgid_set.nextnum
%14 = add nsw i32 %13, %12
store i32 %14, i32* @get_msgid_set.nextnum
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@get_msgid_set.nextnum = internal unnamed_addr global i32 268435456
define i32 @get_msgid_set(i32 %0) {
%2 = load i32, i32* @get_msgid_set.nextnum
%3 = add i32 %2, %0
store i32 %3, i32* @get_msgid_set.nextnum
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void usage(void) { perror("Please specify the class file path"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Please specify the class file path\00"
define void @usage() {
%1 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Please specify the class file path\00"
define void @usage() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}