xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ strchr(char *, int);
int isfname(int c) {
  if (isalnum(c))
    return (!0);
  return strchr(".,'+- ()[]!&", c) ? (!0) : 0;
}


x86 assembly (clang, -O0):
<isfname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%rax
je     1149 <isfname+0x29>
movl   $0x1,-0x4(%rbp)
jmp    116c <isfname+0x4c>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfname>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isfname+0x17>
pop    %rbx
ret
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c".,'+- ()[]!&\00"
define i32 @isfname(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isalnum(i32 %4)
%6 = icmp ne 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 i32, i32* %3
%10 = call i64 @strchr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [13 x i8] c".,'+- ()[]!&\00"
define i32 @isfname(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strchr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ g2(int /*<<< orphan*/, unsigned long);
void h2(void) { g2(0, (long unsigned int)(void *)0); }


x86 assembly (clang, -O0):
<h2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <g2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <g2@plt>

LLVM IR (-O0):
define void @h2() {
%1 = call i32 @g2(i32 0, i64 0)
ret void
}

LLVM IR (-O2):
define void @h2() {
%1 = tail call i32 @g2(i32 0, i64 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ braktpa_(double *, int *, double *, int *, int *);
void braktpa(double aa, int *ia, double a[], int n, int l) {
  braktpa_(&aa, ia, a, &n, &l);
}


x86 assembly (clang, -O0):
<braktpa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <braktpa_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<braktpa>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %rdi,%rsi
movsd  %xmm0,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %ecx,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rax,%rdx
call   1030 <braktpa_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @braktpa(double %0, i32* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca double
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
store double %0, double* %6
store i32* %1, i32** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %7
%12 = load double*, double** %8
%13 = call i32 @braktpa_(double* %6, i32* %11, double* %12, i32* %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @braktpa(double %0, i32* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %6
store i32 %3, i32* %7
store i32 %4, i32* %8
%9 = call i32 @braktpa_(double* %6, i32* %1, double* %2, i32* %7, i32* %8)
ret void
}
/* Variables and functions */
int auditwarnlog(char **);
int audit_warn_ebusy(void) {
  char *args[2];
  args[0] = "ebusy";
  args[1] = NULL;
  return (auditwarnlog(args));
}


x86 assembly (clang, -O0):
<audit_warn_ebusy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <auditwarnlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit_warn_ebusy>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <auditwarnlog@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ebusy\00"
define i32 @audit_warn_ebusy() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @auditwarnlog(i8** %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"ebusy\00"
define i32 @audit_warn_ebusy() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @auditwarnlog(i8** %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
int main() {
  int num;
  num = setbits(0b101010, 0b000011, 0b000011, 0b100010);
  printf("return: %d\n", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
mov    $0x3,%edx
mov    $0x22,%ecx
mov    %edx,%esi
call   1040 <setbits@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x22,%ecx
call   1040 <setbits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"return: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @setbits(i32 42, i32 3, i32 3, i32 34)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"return: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 42, i32 3, i32 3, i32 34)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ strlen(char *);
char *DelFinalChar(char *pszString, int iChar) {
  int iStrLength = (int)strlen(pszString);
  if (iStrLength > 0 && pszString[iStrLength - 1] == iChar)
    pszString[iStrLength - 1] = '\0';
  return pszString;
}


x86 assembly (clang, -O0):
<DelFinalChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1160 <DelFinalChar+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0xc(%rbp),%eax
jne    1160 <DelFinalChar+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DelFinalChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1130 <DelFinalChar+0x20>
add    $0xffffffff,%eax
movsbl (%rbx,%rax,1),%ecx
cmp    %ebp,%ecx
jne    1130 <DelFinalChar+0x20>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @DelFinalChar(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 i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %27
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %11
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
store i8 0, i8* %26
br label %27
27: ; preds = %21, %11, %2
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
define i8* @DelFinalChar(i8* returned %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = add i64 %3, 4294967295
%8 = and i64 %7, 4294967295
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %14
13: ; preds = %6
store i8 0, i8* %9
br label %14
14: ; preds = %13, %6, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ escape(void *);
void *malloc(int);
__attribute__((no)) void *leak() {
  void *ptr = malloc(2);
  escape(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <escape@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leak>:
push   %rbx
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <escape@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @leak() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 2)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @escape(i8* %3)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @leak() {
%1 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%2 = tail call i32 @escape(i8* %1)
ret i8* %1
}
int fibonacci(int term) {
  if (term < 2)
    return term;
  return fibonacci(term - 1) + fibonacci(term - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fibonacci+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibonacci+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fibonacci+0x10>
mov    %ebx,%ecx
jmp    1144 <fibonacci+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fibonacci+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int foo3b();
int foo2b(void) { return foo3b(); }


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

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

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

LLVM IR (-O2):
define i32 @foo2b() {
%1 = tail call i32 (...) @foo3b()
ret i32 %1
}
void foo_1_1_2_2_2_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_2_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "./thugetlb [-m memory] [-o offset] [-f file] [-xOeSAaFpch] "
      "hugetlbfs_directory\n"
      "            -m|--memory size(hugepage unit)    Size of hugetlbfs file\n"
      "            -o|--offset offset(page unit)      Position of error "
      "injection\n"
      "            -x|--inject                        Error injection switch\n"
      "            -O|--offline                       Soft offline switch\n"
      "            -e|--early-kill                    Set PR_MCE_KILL_EARLY\n"
      "            -S|--shm                           Use shmem with "
      "SHM_HUGETLB\n"
      "            -A|--anonymous                     Use MAP_ANONYMOUS\n"
      "            -a|--avoid-touch                   Avoid touching error "
      "page\n"
      "            -F|--fork\n"
      "            -p|--private\n"
      "            -c|--cow\n"
      "            -f|--filename string\n"
      "            -h|--help\n"
      "\n");
}


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

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

LLVM IR (-O0):
@.str = [767 x i8] c"./thugetlb [-m memory] [-o offset] [-f file] [-xOeSAaFpch] hugetlbfs_directory\0A -m|--memory size(hugepage unit) Size of hugetlbfs file\0A -o|--offset offset(page unit) Position of error injection\0A -x|--inject Error injection switch\0A -O|--offline Soft offline switch\0A -e|--early-kill Set PR_MCE_KILL_EARLY\0A -S|--shm Use shmem with SHM_HUGETLB\0A -A|--anonymous Use MAP_ANONYMOUS\0A -a|--avoid-touch Avoid touching error page\0A -F|--fork\0A -p|--private\0A -c|--cow\0A -f|--filename string\0A -h|--help\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([767 x i8], [767 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [766 x i8] c"./thugetlb [-m memory] [-o offset] [-f file] [-xOeSAaFpch] hugetlbfs_directory\0A -m|--memory size(hugepage unit) Size of hugetlbfs file\0A -o|--offset offset(page unit) Position of error injection\0A -x|--inject Error injection switch\0A -O|--offline Soft offline switch\0A -e|--early-kill Set PR_MCE_KILL_EARLY\0A -S|--shm Use shmem with SHM_HUGETLB\0A -A|--anonymous Use MAP_ANONYMOUS\0A -a|--avoid-touch Avoid touching error page\0A -F|--fork\0A -p|--private\0A -c|--cow\0A -f|--filename string\0A -h|--help\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([766 x i8], [766 x i8]* @str, i64 0, i64 0))
ret void
}
void mymemcpy(char *dst, char *src, long size) {
  __builtin_memcpy(dst, src, size);
}


x86 assembly (clang, -O0):
<mymemcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymemcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @mymemcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @mymemcpy(i8* nocapture writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_opp(uintptr_t, uintptr_t);
void fiat_secp256k1_opp(uint32_t out1[8], const uint32_t arg1[8]) {
  internal_fiat_secp256k1_opp((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_opp>:
jmp    1030 <internal_fiat_secp256k1_opp@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_opp(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_secp256k1_opp(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_opp(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_secp256k1_opp(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void explain(void) {
  fprintf(stderr, "Usage: ... [p|b]fifo [ limit NUMBER ]\n");
}


x86 assembly (clang, -O0):
<explain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<explain>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: ... [p|b]fifo [ limit NUMBER ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: ... [p|b]fifo [ limit NUMBER ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
void test_unaligned(void) {}


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

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

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

LLVM IR (-O2):
define void @test_unaligned() {
ret void
}
void reset_paddle() {
  int paddle_Xedge = 180;
  int paddle_Xedgeold = 180;
}


x86 assembly (clang, -O0):
<reset_paddle>:
push   %rbp
mov    %rsp,%rbp
movl   $0xb4,-0x4(%rbp)
movl   $0xb4,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @reset_paddle() {
ret void
}
void X509_REVOKED_get_ext_by_critical(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REVOKED_get_ext_by_critical() {
ret void
}
/* Type definitions */
struct mill_cr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *mill_getvalbuf(struct mill_cr *);
void *mill_valbuf(struct mill_cr *cr, size_t size) {
  assert(size <= 128);
  return mill_getvalbuf(cr);
}


x86 assembly (clang, -O0):
<mill_valbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x80,-0x10(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mill_getvalbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mill_valbuf>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x81,%rsi
setb   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mill_getvalbuf@plt>

LLVM IR (-O0):
%struct.mill_cr = type { i32 }
define i8* @mill_valbuf(%struct.mill_cr* %0, i64 %1) {
%3 = alloca %struct.mill_cr*
%4 = alloca i64
store %struct.mill_cr* %0, %struct.mill_cr** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ule i64 %5, 128
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.mill_cr*, %struct.mill_cr** %3
%10 = call i8* @mill_getvalbuf(%struct.mill_cr* %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.mill_cr = type { i32 }
define i8* @mill_valbuf(%struct.mill_cr* %0, i64 %1) {
%3 = icmp ult i64 %1, 129
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i8* @mill_getvalbuf(%struct.mill_cr* %0)
ret i8* %6
}
double et_pot_d(double rnetd, double tempk, double roh_w) {
  double latent = (2.501 - (0.02361 * (tempk - 273.15))) * 1000000.0;
  return ((rnetd * 86400 * 1000.0) / (latent * roh_w));
}


x86 assembly (clang, -O0):
<et_pot_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xf08(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<et_pot_d>:
addsd  0xef8(%rip),%xmm1
mulsd  0xef8(%rip),%xmm1
addsd  0xef8(%rip),%xmm1
unpcklpd %xmm1,%xmm0
mulpd  0xefc(%rip),%xmm0
movapd 0xf04(%rip),%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @et_pot_d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fsub double %8, 2.731500e+02
%10 = call double @llvm.fmuladd.f64(double -2.361000e-02, double %9, double 2.501000e+00)
%11 = fmul double %10, 1.000000e+06
store double %11, double* %7
%12 = load double, double* %4
%13 = fmul double %12, 8.640000e+04
%14 = fmul double %13, 1.000000e+03
%15 = load double, double* %7
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = fdiv double %14, %17
ret double %18
}

LLVM IR (-O2):
define double @et_pot_d(double %0, double %1, double %2) {
%4 = fadd double %1, -2.731500e+02
%5 = tail call double @llvm.fmuladd.f64(double %4, double -2.361000e-02, double 2.501000e+00)
%6 = insertelement <2 x double> poison, double %0, i64 0
%7 = insertelement <2 x double> %6, double %5, i64 1
%8 = fmul <2 x double> %7, <double 8.640000e+04, double 1.000000e+06>
%9 = insertelement <2 x double> <double 1.000000e+03, double poison>, double %2, i64 1
%10 = fmul <2 x double> %8, %9
%11 = extractelement <2 x double> %10, i64 0
%12 = extractelement <2 x double> %10, i64 1
%13 = fdiv double %11, %12
ret double %13
}
int test_and_set(void *_v) {
  int ret = 1;
  void **v = _v;
  __asm__("lock; xchgl %0, %1" : "=r"(ret) : "m"(*v), "0"(ret) : "memory");
  return ret == 0;
}


x86 assembly (clang, -O0):
<test_and_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%eax
lock xchg %eax,(%rcx)
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set>:
mov    $0x1,%ecx
lock xchg %ecx,(%rdi)
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @test_and_set(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8**
store i8* %0, i8** %2
store i32 1, i32* %3
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i8**
store i8** %6, i8*** %4
%7 = load i8**, i8*** %4
%8 = load i32, i32* %3
%9 = call i32 asm "lock; xchgl $0, $1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %7, i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_and_set(i8* %0) {
%2 = bitcast i8* %0 to i8**
%3 = tail call i32 asm "lock; xchgl $0, $1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void g_object_class_list_properties() {}


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

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

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

LLVM IR (-O2):
define void @g_object_class_list_properties() {
ret void
}
/* Variables and functions */
scalar_t__ q(int, int);
int main(void) { 1 + q(1, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <q@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <q@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i64 @q(i32 1, i32 3)
%2 = add nsw i64 1, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @q(i32 1, i32 3)
ret i32 0
}
int get_index(int i, int j) { return i * 100 + j; }


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x64,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
imul   $0x64,%edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @get_index(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 = mul nsw i32 %5, 100
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_index(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 100
%4 = add nsw i32 %3, %1
ret i32 %4
}
void S2Bits(start, place, value) unsigned char *start;
int place;
unsigned int value;
{ start[place / 2] |= value << (4 * (place % 2)); }


x86 assembly (clang, -O0):
<S2Bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
shl    $0x2,%ecx
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<S2Bits>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
mov    %eax,%ecx
and    $0x3e,%ecx
sub    %ecx,%esi
lea    0x0(,%rsi,4),%ecx
shl    %cl,%edx
sar    %eax
cltq
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @S2Bits(i8* %0, i32 %1, i32 %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 i32, i32* %5
%9 = srem i32 %8, 2
%10 = mul nsw i32 4, %9
%11 = shl i32 %7, %10
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sdiv i32 %13, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, %11
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @S2Bits(i8* nocapture %0, i32 %1, i32 %2) {
%4 = srem i32 %1, 2
%5 = shl nsw i32 %4, 2
%6 = shl i32 %2, %5
%7 = sdiv i32 %1, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = trunc i32 %6 to i8
%12 = or i8 %10, %11
store i8 %12, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iwas4g_end_session();
void free_device(void) { iwas4g_end_session(); }


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

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

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

LLVM IR (-O2):
define void @free_device() {
%1 = tail call i32 (...) @iwas4g_end_session()
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isCALL(const char *comm) { return strcmp(comm, "call") == 0; }


x86 assembly (clang, -O0):
<isCALL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCALL>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"call\00"
define i32 @isCALL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"call\00"
define i32 @isCALL(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int Power2RoundUp(int v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<Power2RoundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Power2RoundUp>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Power2RoundUp(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ptr_glPopName();
extern void glPopName(void) { ptr_glPopName(); }


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

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

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

LLVM IR (-O2):
define void @glPopName() {
%1 = tail call i32 (...) @ptr_glPopName()
ret void
}
int Q_log2(int val) {
  int answer = 0;
  while (val >>= 1) {
    answer++;
  }
  return answer;
}


x86 assembly (clang, -O0):
<Q_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <Q_log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Q_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <Q_log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <Q_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @Q_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ __vm_lock(int);
int /*<<< orphan*/ __vm_unlock();
int syscall(int, void *, size_t);
int __munmap(void *start, size_t len) {
  int ret;
  __vm_lock(-1);
  ret = syscall(91, start, len);
  __vm_unlock();
  return ret;
}


x86 assembly (clang, -O0):
<__munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1050 <__vm_lock@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x5b,%edi
call   1030 <syscall@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <__vm_unlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__munmap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xffffffff,%edi
call   1050 <__vm_lock@plt>
mov    $0x5b,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <syscall@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__vm_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @__munmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @__vm_lock(i32 -1)
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @syscall(i32 91, i8* %7, i64 %8)
store i32 %9, i32* %5
%10 = call i32 (...) @__vm_unlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @__munmap(i8* %0, i64 %1) {
%3 = tail call i32 @__vm_lock(i32 -1)
%4 = tail call i32 @syscall(i32 91, i8* %0, i64 %1)
%5 = tail call i32 (...) @__vm_unlock()
ret i32 %4
}
void rop3_46_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_46_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
or     %sil,%cl
xor    %dl,%cl
xor    %cl,%al
and    %sil,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_46_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %2
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %4, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
long st_gcd(long a, long b) {
  if (b == 0)
    return a;
  else
    return st_gcd(b, a % b);
}


x86 assembly (clang, -O0):
<st_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <st_gcd+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <st_gcd+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <st_gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <st_gcd+0x35>
mov    %rsi,%rdx
jmp    111d <st_gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <st_gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <st_gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <st_gcd+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @st_gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
store i64 %9, i64* %3
br label %16
10: ; preds = %2
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = srem i64 %12, %13
%15 = call i64 @st_gcd(i64 %11, i64 %14)
store i64 %15, i64* %3
br label %16
16: ; preds = %10, %8
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @st_gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
int test_imm_F8uint32_mem(unsigned int *val) {
  return ((*val) & (0xF8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F8uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 248
%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_F8uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 248
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long I2CMasterDataGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000008))));
}


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

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

LLVM IR (-O0):
define i64 @I2CMasterDataGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2CMasterDataGet(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char,
                          unsigned char, unsigned char, unsigned char);
void hwaddress(unsigned char *a) {
  printf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", a[0], a[1], a[2], a[3], a[4], a[5]);
}


x86 assembly (clang, -O0):
<hwaddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%sil
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%r8b
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r9b
mov    -0x8(%rbp),%rax
lea    0xeb4(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl 0x5(%rax),%eax
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwaddress>:
push   %rax
movzbl (%rdi),%esi
movzbl 0x1(%rdi),%edx
movzbl 0x2(%rdi),%ecx
movzbl 0x3(%rdi),%r8d
movzbl 0x4(%rdi),%r9d
movzbl 0x5(%rdi),%eax
mov    %eax,(%rsp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\00"
define void @hwaddress(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 4
%17 = load i8, i8* %16
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 5
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %8, i8 zeroext %11, i8 zeroext %14, i8 zeroext %17, i8 zeroext %20)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\00"
define void @hwaddress(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 4
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %0, i64 5
%12 = load i8, i8* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 zeroext %2, i8 zeroext %4, i8 zeroext %6, i8 zeroext %8, i8 zeroext %10, i8 zeroext %12)
ret void
}
unsigned __FLOAT_BITS(float __f) {
  union {
    float __f;
    unsigned __i;
  } __u;
  __u.__f = __f;
  return __u.__i;
}


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

x86 assembly (clang, -O2):
<__FLOAT_BITS>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @__FLOAT_BITS(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__FLOAT_BITS(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
double atan(int);
double math_acot(double x) { return atan(1 / x); }


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

x86 assembly (clang, -O2):
<math_acot>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <atan@plt>

LLVM IR (-O0):
define double @math_acot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @atan(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @math_acot(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @atan(i32 %3)
ret double %4
}
SORU_4_PROTOTYPE() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SORU_4_PROTOTYPE>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SORU_4_PROTOTYPE+0x9>
jmp    1109 <SORU_4_PROTOTYPE+0x9>

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

LLVM IR (-O0):
define i32 @SORU_4_PROTOTYPE() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i32 @SORU_4_PROTOTYPE() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void isAlreadyOpen(void) { printf("That is already open.\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"That is already open.\0A\00"
define void @isAlreadyOpen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"That is already open.\00"
define void @isAlreadyOpen() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}