xunge/DecIR huggingface dataset:
int main(void) {
  int a = 1 + (2 - 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%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
store i32 0, i32* %1
store i32 0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int dcache_status(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dcache_status() {
ret i32 0
}
double ts2ets(tsec)
double tsec;
{
  double dj, dt;
  dj = ts2jd(tsec);
  dt = utdt(dj);
  return (tsec + dt);
}


x86 assembly (clang, -O0):
<ts2ets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <ts2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1040 <utdt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts2ets>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1030 <ts2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <utdt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ts2ets(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %8)
%10 = sitofp i32 %9 to double
store double %10, double* %4
%11 = load double, double* %2
%12 = load double, double* %4
%13 = fadd double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @ts2ets(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
%6 = fadd double %5, %0
ret double %6
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t block_of_index(uint32_t i) { return i >> 6u; }


x86 assembly (clang, -O0):
<block_of_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_of_index>:
mov    %edi,%eax
shr    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @block_of_index(i32 %0) {
%2 = lshr i32 %0, 6
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printnum(int begin) {
  printf("%d", begin);
  if (begin < 9) {
    printnum(begin + 1);
  }
  printf("%d", begin);
}


x86 assembly (clang, -O0):
<printnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x9,-0x4(%rbp)
jge    114f <printnum+0x2f>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <printnum@plt>
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printnum>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x8,%ebx
jg     113e <printnum+0x1e>
lea    0x1(%rbx),%edi
call   1040 <printnum@plt>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @printnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 9
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printnum(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp slt i32 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %0, 1
tail call void @printnum(i32 %5)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void foo(int x) {
bad1:
#pragma omp target
  goto bad1;
  goto bad2;
#pragma omp target
  {
  bad2:;
  }
#pragma omp target
  {
    int i;
    goto ok1;
    for (i = 0; i < 10; ++i) {
    ok1:
      break;
    }
  }
  switch (x) {
#pragma omp target
    { case 0:; }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <foo+0x7>

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %4, %1
br label %4
5: ; No predecessors!
br label %11
6: ; No predecessors!
store i32 0, i32* %3
br label %7
7: ; preds = %12, %6
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %15
10: ; preds = %7
br label %11
11: ; preds = %10, %5
br label %15
12: ; No predecessors!
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %7
15: ; preds = %11, %7
%16 = load i32, i32* %2
switch i32 %16, label %18 [
i32 0, label %17
]
17: ; preds = %15
br label %18
18: ; preds = %17, %15
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int mystrlen(char *s) {
  int i = 0;
  char *src = s;
  while (*src != '\0') {
    src++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <mystrlen+0x41>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <mystrlen+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
cmpb   $0x0,(%rdi)
je     111c <mystrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void strip(ptr) char **ptr;
{
  while (('0' <= **ptr) && (**ptr <= '9')) {
    (*ptr)++;
  }
  if (**ptr == '*') {
    (*ptr)++;
  }
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jg     1137 <strip+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1147 <strip+0x47>
jmp    115a <strip+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <strip+0x8>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    117b <strip+0x7b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
mov    (%rdi),%rax
mov    (%rax),%cl
lea    -0x30(%rcx),%edx
cmp    $0x9,%dl
jbe    1113 <strip+0x13>
cmp    $0x2a,%cl
je     113b <strip+0x3b>
ret
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rdi)
movzbl (%rax),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rax
cmp    $0xa,%dl
jb     1120 <strip+0x20>
add    $0xffffffffffffffff,%rax
cmp    $0x2a,%cl
jne    1112 <strip+0x12>
add    $0x1,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @strip(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %17, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sle i32 48, %7
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 57
br label %15
15: ; preds = %9, %3
%16 = phi i1 [ false, %3 ], [ %14, %9 ]
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
br label %3
21: ; preds = %15
%22 = load i8**, i8*** %2
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 42
br i1 %26, label %27, label %31
27: ; preds = %21
%28 = load i8**, i8*** %2
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %28
br label %31
31: ; preds = %27, %21
ret void
}

LLVM IR (-O2):
define void @strip(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = phi i8* [ %8, %6 ], [ %2, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = add i8 %9, -48
%11 = icmp ult i8 %10, 10
br i1 %11, label %6, label %12
12: ; preds = %6, %1
%13 = phi i8* [ %2, %1 ], [ %8, %6 ]
%14 = phi i8 [ %3, %1 ], [ %9, %6 ]
%15 = icmp eq i8 %14, 42
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %17, i8** %0
br label %18
18: ; preds = %16, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ARCH_GET_FS;
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ arch_prctl(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
unsigned long get_fs(void) {
  unsigned long fs_addr;
  if (arch_prctl(ARCH_GET_FS, (unsigned long)&fs_addr)) {
    perror("arch_prctl(ARCH_GET_GS)");
    exit(EXIT_FAILURE);
  }
  return fs_addr;
}


x86 assembly (clang, -O0):
<get_fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <arch_prctl@plt>
cmp    $0x0,%rax
je     116e <get_fs+0x3e>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <arch_prctl@plt>
test   %rax,%rax
jne    114d <get_fs+0x1d>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@ARCH_GET_FS = global i32 0
@.str = [24 x i8] c"arch_prctl(ARCH_GET_GS)\00"
@EXIT_FAILURE = global i32 0
define i64 @get_fs() {
%1 = alloca i64
%2 = load i32, i32* @ARCH_GET_FS
%3 = ptrtoint i64* %1 to i64
%4 = call i64 @arch_prctl(i32 %2, i64 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
%11 = load i64, i64* %1
ret i64 %11
}

LLVM IR (-O2):
@ARCH_GET_FS = global i32 0
@.str = [24 x i8] c"arch_prctl(ARCH_GET_GS)\00"
@EXIT_FAILURE = global i32 0
define i64 @get_fs() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i32, i32* @ARCH_GET_FS
%4 = ptrtoint i64* %1 to i64
%5 = call i64 @arch_prctl(i32 %3, i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %0
%12 = load i64, i64* %1
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ page_flag_name(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned long, int /*<<< orphan*/);
void show_page(unsigned long offset, uint64_t flags) {
  printf("%lu\t%s\n", offset, page_flag_name(flags));
}


x86 assembly (clang, -O0):
<show_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <page_flag_name@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_page>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <page_flag_name@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%lu\09%s\0A\00"
define void @show_page(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i32 @page_flag_name(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lu\09%s\0A\00"
define void @show_page(i64 %0, i32 %1) {
%3 = tail call i32 @page_flag_name(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %3)
ret void
}
void VP8InitClipTables(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8InitClipTables() {
ret void
}
/* Variables and functions */
char *strdupAdd(char const *, int /*<<< orphan*/);
char *myStrdup(const char *string) { return strdupAdd(string, 0); }


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

x86 assembly (clang, -O2):
<myStrdup>:
xor    %esi,%esi
jmp    1030 <strdupAdd@plt>

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

LLVM IR (-O2):
define i8* @myStrdup(i8* %0) {
%2 = tail call i8* @strdupAdd(i8* %0, i32 0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_subs_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i abs_diff(__m128i a, __m128i b) {
  return _mm_or_si128(_mm_subs_epu8(a, b), _mm_subs_epu8(b, a));
}


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

x86 assembly (clang, -O2):
<abs_diff>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_mm_subs_epu8@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <_mm_subs_epu8@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_mm_or_si128@plt>

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

LLVM IR (-O2):
define i32 @abs_diff(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_epu8(i32 %0, i32 %1)
%4 = tail call i32 @_mm_subs_epu8(i32 %1, i32 %0)
%5 = tail call i32 @_mm_or_si128(i32 %3, i32 %4)
ret i32 %5
}
int test_imm_C5int16_reg(short val) {
  return ((val) & (0xC5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C5int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 197
%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_C5int16_reg(i16 signext %0) {
%2 = and i16 %0, 197
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_eggs_who(int);
void nsblk_eggs_who7(void) { nsblk_eggs_who(7); }


x86 assembly (clang, -O0):
<nsblk_eggs_who7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <nsblk_eggs_who@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsblk_eggs_who7>:
mov    $0x7,%edi
jmp    1030 <nsblk_eggs_who@plt>

LLVM IR (-O0):
define void @nsblk_eggs_who7() {
%1 = call i32 @nsblk_eggs_who(i32 7)
ret void
}

LLVM IR (-O2):
define void @nsblk_eggs_who7() {
%1 = tail call i32 @nsblk_eggs_who(i32 7)
ret void
}
void freeList(struct list *list) {}


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

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

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

LLVM IR (-O2):
%struct.list = type opaque
define void @freeList(%struct.list* nocapture %0) {
ret void
}
void XtOpenApplication() {}


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

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

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

LLVM IR (-O2):
define void @XtOpenApplication() {
ret void
}
int areEqual(unsigned int *arr1, unsigned int *arr2, short arrlen) {
  int i;
  for (i = 0; i < arrlen; i++) {
    if (arr1[i] != arr2[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<areEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
movswl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    1164 <areEqual+0x64>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1151 <areEqual+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116b <areEqual+0x6b>
jmp    1156 <areEqual+0x56>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111a <areEqual+0x1a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<areEqual>:
mov    $0x1,%eax
test   %dx,%dx
jle    1121 <areEqual+0x21>
movzwl %dx,%r8d
xor    %edx,%edx
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <areEqual+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <areEqual+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @areEqual(i32* nocapture %0, i32* nocapture %1, i16 signext %2) {
%4 = icmp sgt i16 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i16 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ edie(char *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
scalar_t__ posix_memalign(void **, int, size_t);
void *xmalloc(unsigned int sz) {
  size_t s;
  void *r;
  s = ((sz - 1) + 64) & ~(64 - 1);
  if (posix_memalign(&r, 64, s))
    edie("posix_memalign");
  memset(r, 0, sz);
  return r;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
add    $0x40,%eax
and    $0xffffffc0,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
mov    $0x40,%esi
call   1050 <posix_memalign@plt>
cmp    $0x0,%rax
je     1175 <xmalloc+0x45>
lea    0xe90(%rip),%rdi
call   1040 <edie@plt>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x3f(%rbx),%edx
and    $0xffffffc0,%edx
lea    0x8(%rsp),%rdi
mov    $0x40,%esi
call   1050 <posix_memalign@plt>
test   %rax,%rax
je     115d <xmalloc+0x2d>
lea    0xea8(%rip),%rdi
call   1040 <edie@plt>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"posix_memalign\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sub i32 %5, 1
%7 = add i32 %6, 64
%8 = and i32 %7, -64
%9 = zext i32 %8 to i64
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = call i64 @posix_memalign(i8** %4, i32 64, i64 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @edie(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
%16 = load i8*, i8** %4
%17 = load i32, i32* %2
%18 = call i32 @memset(i8* %16, i32 0, i32 %17)
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
@.str = [15 x i8] c"posix_memalign\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = add i32 %0, 63
%5 = and i32 %4, -64
%6 = zext i32 %5 to i64
%7 = call i64 @posix_memalign(i8** %2, i32 64, i64 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @edie(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %2
%13 = call i32 @memset(i8* %12, i32 0, i32 %0)
%14 = load i8*, i8** %2
ret i8* %14
}
unsigned scale2x_align_size(unsigned size) {
  size += 16 - 1;
  size &= -(int)16;
  return size;
}


x86 assembly (clang, -O0):
<scale2x_align_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffff0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale2x_align_size>:
lea    0xf(%rdi),%eax
and    $0xfffffff0,%eax
ret

LLVM IR (-O0):
define i32 @scale2x_align_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -16
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @scale2x_align_size(i32 %0) {
%2 = add i32 %0, 15
%3 = and i32 %2, -16
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((destructor)) void dtor(void) {
  printf("Hello from the destructor!\n");
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Hello from the destructor!\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dtor, i8* null }]
define void @dtor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dtor, i8* null }]
@str = [27 x i8] c"Hello from the destructor!\00"
define void @dtor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double modf(double value, double *iptr) {
  *iptr = __infer_nondet_double();
  return __infer_nondet_double();
}


x86 assembly (clang, -O0):
<modf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__infer_nondet_double@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
jmp    1030 <__infer_nondet_double@plt>

LLVM IR (-O0):
define double @modf(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = call double (...) @__infer_nondet_double()
%6 = load double*, double** %4
store double %5, double* %6
%7 = call double (...) @__infer_nondet_double()
ret double %7
}

LLVM IR (-O2):
define double @modf(double %0, double* nocapture writeonly %1) {
%3 = tail call double (...) @__infer_nondet_double()
store double %3, double* %1
%4 = tail call double (...) @__infer_nondet_double()
ret double %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_five_decimals() {
  char *str = "1234.00001";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 10000);
}


x86 assembly (clang, -O0):
<test_five_decimals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1175 <test_five_decimals+0x55>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x2710,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_five_decimals>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"1234.00001\00"
define void @test_five_decimals() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 10000
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"1234.00001\00"
define void @test_five_decimals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ array_dump(int *, int);
int /*<<< orphan*/ bubble_sort(int *, int);
int main(void) {
  int array[] = {1, 3, 8, 2, 4, 9, 6, 5, 7, 0};
  array_dump(array, sizeof(array) / sizeof(int));
  bubble_sort(array, sizeof(array) / sizeof(int));
  array_dump(array, sizeof(array) / sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <array_dump@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <bubble_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <array_dump@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_dump@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <bubble_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_dump@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 1, i32 3, i32 8, i32 2, i32 4, i32 9, i32 6, i32 5, i32 7, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @array_dump(i32* %4, i32 10)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @bubble_sort(i32* %6, i32 10)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @array_dump(i32* %8, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 1, i32 3, i32 8, i32 2, i32 4, i32 9, i32 6, i32 5, i32 7, i32 0]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @array_dump(i32* %3, i32 10)
%5 = call i32 @bubble_sort(i32* %3, i32 10)
%6 = call i32 @array_dump(i32* %3, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ md5str(char *, unsigned char *, size_t);
int strcmp(char *, char const *);
int test(unsigned char *buf, size_t len, const char expected[16 * 2 + 1]) {
  char ascii[16 * 2 + 1];
  md5str(ascii, buf, len);
  return strcmp(ascii, expected);
}


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

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <md5str@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @test(i8* %0, i64 %1, i8* nocapture %2) {
%4 = alloca [33 x i8]
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%6 = call i32 @md5str(i8* %5, i8* %0, i64 %1)
%7 = call i32 @strcmp(i8* %5, i8* dereferenceable(1) %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ASL8(int /*<<< orphan*/);
int /*<<< orphan*/ AbsoluteIndexedXX1(int);
void Op1EM1X1(void) { ASL8(AbsoluteIndexedXX1(3)); }


x86 assembly (clang, -O0):
<Op1EM1X1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
call   1030 <ASL8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op1EM1X1>:
push   %rax
mov    $0x3,%edi
call   1040 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ASL8@plt>

LLVM IR (-O0):
define void @Op1EM1X1() {
%1 = call i32 @AbsoluteIndexedXX1(i32 3)
%2 = call i32 @ASL8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op1EM1X1() {
%1 = tail call i32 @AbsoluteIndexedXX1(i32 3)
%2 = tail call i32 @ASL8(i32 %1)
ret void
}
void raise_softirq_irqoff(unsigned int nr) { return; }


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

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

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

LLVM IR (-O2):
define void @raise_softirq_irqoff(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float height = 1.5, width = 2.3, area, around;
  area = height * width;
  around = (height + width) * 2.0;
  printf("The area of the rect is: %f\n", area);
  printf("The around of the rect is: %f\n", around);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"The area of the rect is: %f\0A\00"
@.str.1 = [31 x i8] c"The around of the rect is: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 1.500000e+00, float* %2
store float 0x4002666660000000, float* %3
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fmul float %6, %7
store float %8, float* %4
%9 = load float, float* %2
%10 = load float, float* %3
%11 = fadd float %9, %10
%12 = fpext float %11 to double
%13 = fmul double %12, 2.000000e+00
%14 = fptrunc double %13 to float
store float %14, float* %5
%15 = load float, float* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %15)
%17 = load float, float* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), float %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"The area of the rect is: %f\0A\00"
@.str.1 = [31 x i8] c"The around of the rect is: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x400B999980000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), float 0x401E666660000000)
ret i32 0
}
int foo4(float a, float b) { return !(a > b); }


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @foo4(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 = load float, float* %4
%7 = fcmp ogt float %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo4(float %0, float %1) {
%3 = fcmp ule float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void sigproc() {
  fputs("\x1b[0m", stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<sigproc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigproc>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @sigproc() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @sigproc() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned char command_check0123(unsigned char *command, int sequence) {
  int response;
  response = sequence * 16 + ((*command) - 0x82) / 4;
  return (unsigned char)response;
}


x86 assembly (clang, -O0):
<command_check0123>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sub    $0x82,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_check0123>:
shl    $0x4,%esi
movzbl (%rdi),%eax
lea    -0x82(%rax),%ecx
add    $0xffffff81,%eax
test   %cx,%cx
cmovns %ecx,%eax
shr    $0x2,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @command_check0123(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = sub nsw i32 %10, 130
%12 = sdiv i32 %11, 4
%13 = add nsw i32 %7, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @command_check0123(i8* nocapture %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = load i8, i8* %0
%5 = zext i8 %4 to i16
%6 = add nsw i16 %5, -130
%7 = sdiv i16 %6, 4
%8 = zext i16 %7 to i32
%9 = add i32 %3, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *getIndex_list_Aux(struct list *, int, int /*<<< orphan*/);
struct list *getIndex_list(struct list *l, int index) {
  return getIndex_list_Aux(l, index, 0);
}


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

x86 assembly (clang, -O2):
<getIndex_list>:
xor    %edx,%edx
jmp    1030 <getIndex_list_Aux@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @getIndex_list(%struct.list* %0, i32 %1) {
%3 = alloca %struct.list*
%4 = alloca i32
store %struct.list* %0, %struct.list** %3
store i32 %1, i32* %4
%5 = load %struct.list*, %struct.list** %3
%6 = load i32, i32* %4
%7 = call %struct.list* @getIndex_list_Aux(%struct.list* %5, i32 %6, i32 0)
ret %struct.list* %7
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @getIndex_list(%struct.list* %0, i32 %1) {
%3 = tail call %struct.list* @getIndex_list_Aux(%struct.list* %0, i32 %1, i32 0)
ret %struct.list* %3
}
const char *skip_leading_whitespace(const char *str) {
  while (*str) {
    const char c = *str;
    if (!(c == ' ' || c == '\t'))
      break;
    ++str;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_leading_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <skip_leading_whitespace+0x4e>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     113d <skip_leading_whitespace+0x3d>
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
je     113d <skip_leading_whitespace+0x3d>
jmp    114e <skip_leading_whitespace+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_leading_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_leading_whitespace>:
mov    %rdi,%rax
jmp    1114 <skip_leading_whitespace+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_leading_whitespace+0x10>
cmp    $0x9,%cl
je     1110 <skip_leading_whitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_leading_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int userfaultfd_unmap_prep(struct vm_area_struct *vma, unsigned long start,
                           unsigned long end, struct list_head *uf) {
  return 0;
}


x86 assembly (clang, -O0):
<userfaultfd_unmap_prep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
%struct.list_head = type opaque
define i32 @userfaultfd_unmap_prep(%struct.vm_area_struct* %0, i64 %1, i64 %2, %struct.list_head* %3) {
%5 = alloca %struct.vm_area_struct*
%6 = alloca i64
%7 = alloca i64
%8 = alloca %struct.list_head*
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store %struct.list_head* %3, %struct.list_head** %8
ret i32 0
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
%struct.list_head = type opaque
define i32 @userfaultfd_unmap_prep(%struct.vm_area_struct* nocapture readnone %0, i64 %1, i64 %2, %struct.list_head* nocapture readnone %3) {
ret i32 0
}
line(n) int n;
{
  while (n-- > 0)
    putchar('_');
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    1140 <line+0x30>
mov    $0x5f,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    111b <line+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
push   %rbx
test   %edi,%edi
jle    1134 <line+0x24>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x5f,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <line+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @line(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, -1
store i32 %6, i32* %3
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 95)
br label %4
10: ; preds = %4
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @line(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 95)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret i32 undef
}
int GetUserVAX(UserVAX)
int *UserVAX;
{
  *UserVAX = 0;
  return (1);
}


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

x86 assembly (clang, -O2):
<GetUserVAX>:
movl   $0x0,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @GetUserVAX(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret i32 1
}