xunge/DecIR huggingface dataset:
/* Variables and functions */
int tolower(unsigned char const);
int XX_httplib_lowercase(const char *s) {
  return tolower(*(const unsigned char *)s);
}


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

x86 assembly (clang, -O2):
<XX_httplib_lowercase>:
movzbl (%rdi),%edi
jmp    1030 <tolower@plt>

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

LLVM IR (-O2):
define i32 @XX_httplib_lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @tolower(i8 zeroext %2)
ret i32 %3
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
struct stat {
  int dummy;
};

/* Variables and functions */
struct timespec get_stat_birthtime(struct stat const *st) {
  struct timespec t;
  t.tv_sec = -1;
  t.tv_nsec = -1;
  (void)st;
  return t;
}


x86 assembly (clang, -O0):
<get_stat_birthtime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stat_birthtime>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.timespec = type { i32, i32 }
define i64 @get_stat_birthtime(%struct.stat* %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 -1, i32* %5
%6 = load %struct.stat*, %struct.stat** %3
%7 = bitcast %struct.timespec* %2 to i64*
%8 = load i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @get_stat_birthtime(%struct.stat* nocapture readnone %0) {
ret i64 -1
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  const char *last = NULL;
  do {
    if (*s == (char)c)
      last = s;
  } while (*s++);
  return (char *)last;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <strrchr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
movsbl %sil,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbl (%rdi),%edx
cmp    %edx,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %edx,%edx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %12, %5 ]
%7 = phi i8* [ null, %2 ], [ %11, %5 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %4, %9
%11 = select i1 %10, i8* %6, i8* %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5
ret i8* %11
}
/* Variables and functions */
char *smb_readline_replacement(char *, void (*)(),
                               char **(*)(char const *, int, int));
char *smb_readline(char *prompt, void (*callback)(void),
                   char **(completion_fn)(const char *text, int start,
                                          int end)) {
  return smb_readline_replacement(prompt, callback, completion_fn);
}


x86 assembly (clang, -O0):
<smb_readline>:
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 <smb_readline_replacement@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smb_readline>:
jmp    1030 <smb_readline_replacement@plt>

LLVM IR (-O0):
define i8* @smb_readline(i8* %0, void ()* %1, i8** (i8*, i32, i32)* %2) {
%4 = alloca i8*
%5 = alloca void ()*
%6 = alloca i8** (i8*, i32, i32)*
store i8* %0, i8** %4
store void ()* %1, void ()** %5
store i8** (i8*, i32, i32)* %2, i8** (i8*, i32, i32)** %6
%7 = load i8*, i8** %4
%8 = load void ()*, void ()** %5
%9 = bitcast void ()* %8 to void (...)*
%10 = load i8** (i8*, i32, i32)*, i8** (i8*, i32, i32)** %6
%11 = call i8* @smb_readline_replacement(i8* %7, void (...)* %9, i8** (i8*, i32, i32)* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @smb_readline(i8* %0, void ()* %1, i8** (i8*, i32, i32)* %2) {
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i8* @smb_readline_replacement(i8* %0, void (...)* %4, i8** (i8*, i32, i32)* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  freopen("input.txt", "r", stdin);
  printf("Hello world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0xec1(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1040 <freopen@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <freopen@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char x[0xFFFFFFFF / 16777216];
  printf("%lu\n", sizeof(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed7(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 255)
ret i32 0
}
/* Type definitions */
struct shmid_ds {
  int dummy;
};

/* Variables and functions */
int IPC_RMID;
int __infer_nondet_int();
int /*<<< orphan*/ free(void *);
int shmctl(int shmid, int cmd, struct shmid_ds *buf) {
  int n;
  void *shmaddr;
  n = __infer_nondet_int();
  shmaddr = (void *)(long)shmid;
  if (cmd == IPC_RMID)
    free(shmaddr);
  return n;
}


x86 assembly (clang, -O0):
<shmctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <__infer_nondet_int@plt>
mov    %eax,-0x14(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%eax
jne    115f <shmctl+0x3f>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmctl>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
xor    %eax,%eax
call   1040 <__infer_nondet_int@plt>
mov    %eax,%ebp
mov    0x2ea7(%rip),%rax
cmp    %ebx,(%rax)
jne    1145 <shmctl+0x25>
movslq %r14d,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
@IPC_RMID = global i32 0
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.shmid_ds*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.shmid_ds* %2, %struct.shmid_ds** %6
%9 = call i32 (...) @__infer_nondet_int()
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %8
%13 = load i32, i32* %5
%14 = load i32, i32* @IPC_RMID
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i8*, i8** %8
%18 = call i32 @free(i8* %17)
br label %19
19: ; preds = %16, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
@IPC_RMID = global i32 0
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* nocapture readnone %2) {
%4 = tail call i32 (...) @__infer_nondet_int()
%5 = load i32, i32* @IPC_RMID
%6 = icmp eq i32 %5, %1
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = sext i32 %0 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @free(i8* %9)
br label %11
11: ; preds = %7, %3
ret i32 %4
}
/* Variables and functions */
char *rindex(char *, char);
char *Basename(char *str) {
  char *cp = rindex(str, '/');
  return cp ? cp + 1 : str;
}


x86 assembly (clang, -O0):
<Basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <rindex@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <Basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <Basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <rindex@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @rindex(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @Basename(i8* %0) {
%2 = tail call i8* @rindex(i8* %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_161() {
  Assert_real((isqrt(161) == 12),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              810, ("Integer square root of 161 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_161>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa1,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x32a,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_161>:
push   %rax
mov    $0xa1,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x32a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 161 should be 12\00"
define void @t_sqrt_161() {
%1 = call i32 @isqrt(i32 161)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 161 should be 12\00"
define void @t_sqrt_161() {
%1 = tail call i32 @isqrt(i32 161)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t const);
int /*<<< orphan*/ memcpy(char *, char const *, size_t const);
size_t strlen(char const *);
char *symap_strdup(const char *str) {
  const size_t len = strlen(str);
  char *copy = (char *)malloc(len + 1);
  memcpy(copy, str, len + 1);
  return copy;
}


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

x86 assembly (clang, -O2):
<symap_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @symap_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = add i64 %13, 1
%15 = call i32 @memcpy(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @symap_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
char *gluErrorString(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void darerror(GLenum error) {
  printf("tesselation error: %s\n", gluErrorString(error));
}


x86 assembly (clang, -O0):
<darerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gluErrorString@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darerror>:
push   %rax
call   1040 <gluErrorString@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"tesselation error: %s\0A\00"
define void @darerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @gluErrorString(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"tesselation error: %s\0A\00"
define void @darerror(i32 %0) {
%2 = tail call i8* @gluErrorString(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int iswprint(int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int softboundcets_iswprint(wint_t wc) {
  return iswprint(wc);
}


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

x86 assembly (clang, -O2):
<softboundcets_iswprint>:
jmp    1030 <iswprint@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_iswprint(i32 %0) {
%2 = tail call i32 @iswprint(i32 %0)
ret i32 %2
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x > 1) {
    int old_x = x;
    x = __VERIFIER_nondet_int();
    if (2 * x > old_x) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    115c <main+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cmp    -0xc(%rbp),%eax
jle    1157 <main+0x47>
jmp    115c <main+0x4c>
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
cmp    $0x2,%ebx
jl     1136 <main+0x26>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
add    %eax,%ecx
cmp    %ebx,%ecx
mov    %eax,%ebx
jle    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
2: ; preds = %5, %0
%3 = phi i32 [ %1, %0 ], [ %6, %5 ]
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = shl nsw i32 %6, 1
%8 = icmp sgt i32 %7, %3
br i1 %8, label %9, label %2
9: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
double *dalloc_matrix(int n, int m) {
  double *mat = (double *)malloc(n * m * sizeof(double));
  return mat;
}


x86 assembly (clang, -O0):
<dalloc_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dalloc_matrix>:
imul   %esi,%edi
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define double* @dalloc_matrix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
ret double* %14
}

LLVM IR (-O2):
define double* @dalloc_matrix(i32 %0, i32 %1) {
%3 = shl i32 %0, 3
%4 = mul i32 %3, %1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to double*
ret double* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO;

/* Variables and functions */
int /*<<< orphan*/ NID_key_usage;
int PKCS8_pkey_add1_attr_by_NID(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, unsigned char *, int);
int /*<<< orphan*/ V_ASN1_BIT_STRING;
int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage) {
  unsigned char us_val = (unsigned char)usage;
  return PKCS8_pkey_add1_attr_by_NID(p8, NID_key_usage, V_ASN1_BIT_STRING,
                                     &us_val, 1);
}


x86 assembly (clang, -O0):
<PKCS8_add_keyusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    -0xd(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <PKCS8_pkey_add1_attr_by_NID@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS8_add_keyusage>:
push   %rax
mov    %sil,0x7(%rsp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%esi
mov    0x2ed2(%rip),%rax
mov    (%rax),%edx
lea    0x7(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <PKCS8_pkey_add1_attr_by_NID@plt>
pop    %rcx
ret

LLVM IR (-O0):
@NID_key_usage = global i32 0
@V_ASN1_BIT_STRING = global i32 0
define i32 @PKCS8_add_keyusage(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* @NID_key_usage
%10 = load i32, i32* @V_ASN1_BIT_STRING
%11 = call i32 @PKCS8_pkey_add1_attr_by_NID(i32* %8, i32 %9, i32 %10, i8* %5, i32 1)
ret i32 %11
}

LLVM IR (-O2):
@NID_key_usage = global i32 0
@V_ASN1_BIT_STRING = global i32 0
define i32 @PKCS8_add_keyusage(i32* %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = load i32, i32* @NID_key_usage
%6 = load i32, i32* @V_ASN1_BIT_STRING
%7 = call i32 @PKCS8_pkey_add1_attr_by_NID(i32* %0, i32 %5, i32 %6, i8* %3, i32 1)
ret i32 %7
}
void *thread2_run(void *arg) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @thread2_run(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread2_run(i8* nocapture readnone %0) {
ret i8* null
}
int test_imm_4Euint16_mem(unsigned short *val) {
  return ((*val) & (0x4E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 78
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ example_benchmark();
int /*<<< orphan*/ example_measure();
int main() {
  example_benchmark();
  example_measure();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <example_benchmark@plt>
mov    $0x0,%al
call   1040 <example_measure@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @example_benchmark()
%3 = call i32 (...) @example_measure()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @example_benchmark()
%2 = tail call i32 (...) @example_measure()
ret i32 0
}
double kmToMiles(double km) { return km * 0.62137; }


x86 assembly (clang, -O0):
<kmToMiles>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @kmToMiles(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3FE3E2435696E58A
ret double %4
}

LLVM IR (-O2):
define double @kmToMiles(double %0) {
%2 = fmul double %0, 0x3FE3E2435696E58A
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int *, int, int);
void print_average(int *list, int low, int high) {
  int total = 0, num_elements = 0, average = 0;
  total = sum(list, low, high);
  num_elements = high - low;
  average = total / num_elements;
  printf("%10.d\n", average);
}


x86 assembly (clang, -O0):
<print_average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <sum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_average>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1040 <sum@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
lea    0xec8(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%10.d\0A\00"
define void @print_average(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @sum(i32* %0, i32 %1, i32 %2)
%5 = sub nsw i32 %2, %1
%6 = sdiv i32 %4, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
float __nv_fmul_rn(float, float);
float __fmul_rn(float __a, float __b) { return __nv_fmul_rn(__a, __b); }


x86 assembly (clang, -O0):
<__fmul_rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__nv_fmul_rn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fmul_rn>:
jmp    1030 <__nv_fmul_rn@plt>

LLVM IR (-O0):
define float @__fmul_rn(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 = call float @__nv_fmul_rn(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fmul_rn(float %0, float %1) {
%3 = tail call float @__nv_fmul_rn(float %0, float %1)
ret float %3
}
unsigned short int f61(unsigned short int x, unsigned int y) {
  return (x << (8 * sizeof(unsigned short) - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f61>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
mov    $0x10,%ecx
sub    %rdx,%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f61>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f61(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = sub i64 16, %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i32, i32* %4
%15 = ashr i32 %13, %14
%16 = xor i32 %11, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f61(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub i32 16, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
void gtk_tree_view_set_cursor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_cursor() {
ret void
}
unsigned char get_userpart(unsigned char sio) { return sio & 0xf; }


x86 assembly (clang, -O0):
<get_userpart>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_userpart>:
mov    %edi,%eax
and    $0xf,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @get_userpart(i8 zeroext %0) {
%2 = and i8 %0, 15
ret i8 %2
}
/* Variables and functions */
unsigned int leadingZero(unsigned int const);
unsigned int ceilLog2(const unsigned int input) {
  if (input <= 1)
    return 0;
  return 32 - leadingZero(input - 1);
}


x86 assembly (clang, -O0):
<ceilLog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
ja     1131 <ceilLog2+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1148 <ceilLog2+0x38>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <leadingZero@plt>
mov    %eax,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilLog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     112d <ceilLog2+0x1d>
push   %rax
add    $0xffffffff,%edi
call   1030 <leadingZero@plt>
mov    %eax,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @ceilLog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ule i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub i32 %8, 1
%10 = call i32 @leadingZero(i32 %9)
%11 = sub i32 32, %10
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ceilLog2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = tail call i32 @leadingZero(i32 %4)
%6 = sub i32 32, %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
void glutHideOverlay(void) {}


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

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

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

LLVM IR (-O2):
define void @glutHideOverlay() {
ret void
}
void hrtimer_try_to_cancel(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<hrtimer_try_to_cancel>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hrtimer_try_to_cancel>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.hrtimer_try_to_cancel = [22 x i8] c"hrtimer_try_to_cancel\00"
define void @hrtimer_try_to_cancel() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.hrtimer_try_to_cancel, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.hrtimer_try_to_cancel = [22 x i8] c"hrtimer_try_to_cancel\00"
define void @hrtimer_try_to_cancel() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.hrtimer_try_to_cancel, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint64_t __SMLSLDX(uint32_t x, uint32_t y,
                                            uint64_t sum) {
  return ((uint64_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y) >> 16)) -
                     ((((int32_t)x) >> 16) * (((int32_t)y << 16) >> 16)) +
                     (((uint64_t)sum))));
}


x86 assembly (clang, -O0):
<__SMLSLDX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
shl    $0x10,%edx
sar    $0x10,%edx
imul   %edx,%ecx
sub    %ecx,%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMLSLDX>:
movswl %di,%r8d
movswl %si,%ecx
mov    %esi,%eax
sar    $0x10,%eax
imul   %r8d,%eax
sar    $0x10,%edi
imul   %edi,%ecx
add    %edx,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @__SMLSLDX(i64 %0, i64 %1, i32 %2) {
%4 = trunc i64 %0 to i32
%5 = shl i32 %4, 16
%6 = ashr exact i32 %5, 16
%7 = trunc i64 %1 to i32
%8 = ashr i32 %7, 16
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %4, 16
%11 = shl i32 %7, 16
%12 = ashr exact i32 %11, 16
%13 = mul nsw i32 %12, %10
%14 = add i32 %9, %2
%15 = sub i32 %14, %13
ret i32 %15
}
void foo_1_2_2_2_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_2_1_1_2_1() {
ret void
}
const char *CFilterName(void *arg) {
  (void)arg;
  return "foo";
}


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

x86 assembly (clang, -O2):
<CFilterName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i8* @CFilterName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @CFilterName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
float grad1(int hash, float x) {
  int h = hash & 15;
  float grad = 1.0f + (h & 7);
  if (h & 8)
    grad = -grad;
  return (grad * x);
}


x86 assembly (clang, -O0):
<grad1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm1
movss  0xed9(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1156 <grad1+0x56>
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grad1>:
mov    %edi,%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm1
addss  0xeef(%rip),%xmm1
test   $0x8,%dil
je     111e <grad1+0x1e>
xorps  0xef2(%rip),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @grad1(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%7 = load i32, i32* %3
%8 = and i32 %7, 15
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 7
%11 = sitofp i32 %10 to float
%12 = fadd float 1.000000e+00, %11
store float %12, float* %6
%13 = load i32, i32* %5
%14 = and i32 %13, 8
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load float, float* %6
%18 = fneg float %17
store float %18, float* %6
br label %19
19: ; preds = %16, %2
%20 = load float, float* %6
%21 = load float, float* %4
%22 = fmul float %20, %21
ret float %22
}

LLVM IR (-O2):
define float @grad1(i32 %0, float %1) {
%3 = and i32 %0, 7
%4 = sitofp i32 %3 to float
%5 = fadd float %4, 1.000000e+00
%6 = and i32 %0, 8
%7 = icmp eq i32 %6, 0
%8 = fneg float %5
%9 = select i1 %7, float %5, float %8
%10 = fmul float %9, %1
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
double **new_matrix2(int, int);
double **new_matrix2_data(int n, int m, double *data) {
  double **X = new_matrix2(n, m);
  memcpy(X[0], data, n * m * sizeof(double));
  return X;
}


x86 assembly (clang, -O0):
<new_matrix2_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <new_matrix2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_matrix2_data>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <new_matrix2@plt>
mov    %rax,%r15
mov    (%rax),%rdi
imul   %ebp,%ebx
shl    $0x3,%ebx
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double** @new_matrix2_data(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca double**
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call double** @new_matrix2(i32 %8, i32 %9)
store double** %10, double*** %7
%11 = load double**, double*** %7
%12 = getelementptr inbounds double*, double** %11, i64 0
%13 = load double*, double** %12
%14 = load double*, double** %6
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = mul nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 8
%20 = trunc i64 %19 to i32
%21 = call i32 @memcpy(double* %13, double* %14, i32 %20)
%22 = load double**, double*** %7
ret double** %22
}

LLVM IR (-O2):
define double** @new_matrix2_data(i32 %0, i32 %1, double* %2) {
%4 = tail call double** @new_matrix2(i32 %0, i32 %1)
%5 = load double*, double** %4
%6 = shl i32 %0, 3
%7 = mul i32 %6, %1
%8 = tail call i32 @memcpy(double* %5, double* %2, i32 %7)
ret double** %4
}
/* Variables and functions */
int compress(unsigned char *, unsigned long *, unsigned char const *,
             unsigned long);
int encode_zip(unsigned char *dest, unsigned long *destLen,
               const unsigned char *source, unsigned long sourceLen) {
  return compress(dest, destLen, source, sourceLen);
}


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

x86 assembly (clang, -O2):
<encode_zip>:
jmp    1030 <compress@plt>

LLVM IR (-O0):
define i32 @encode_zip(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64* %1, i64** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64*, i64** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @compress(i8* %9, i64* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @encode_zip(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = tail call i32 @compress(i8* %0, i64* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Type definitions */
struct ivtv_stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ivtv_use_pio(struct ivtv_stream *);
int ivtv_use_dma(struct ivtv_stream *s) { return !ivtv_use_pio(s); }


x86 assembly (clang, -O0):
<ivtv_use_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ivtv_use_pio@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivtv_use_dma>:
push   %rax
call   1030 <ivtv_use_pio@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.ivtv_stream = type { i32 }
define i32 @ivtv_use_dma(%struct.ivtv_stream* %0) {
%2 = tail call i32 @ivtv_use_pio(%struct.ivtv_stream* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
void br(void) {
  while (!getchar())
    ;
}


x86 assembly (clang, -O0):
<br>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <br+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <br+0x25>
jmp    113a <br+0x2a>
jmp    1119 <br+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<br>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
test   %eax,%eax
je     1120 <br+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @br() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @getchar()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @br() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
int is_white(char c) { return (c == 0x20 || c == 0x09); }


x86 assembly (clang, -O0):
<is_white>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_white+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_white(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_white(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void array_2(void) {
  int *primes[] = {2, 3, 5, 7, 9, 11, 13};
  showarray_2(primes);
}


x86 assembly (clang, -O0):
<array_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x38,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1040 <showarray_2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_2>:
sub    $0x38,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <showarray_2@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.array_2.primes = [7 x i32*] [i32* inttoptr (i64 2 to i32*), i32* inttoptr (i64 3 to i32*), i32* inttoptr (i64 5 to i32*), i32* inttoptr (i64 7 to i32*), i32* inttoptr (i64 9 to i32*), i32* inttoptr (i64 11 to i32*), i32* inttoptr (i64 13 to i32*)]
define void @array_2() {
%1 = alloca [7 x i32*]
%2 = bitcast [7 x i32*]* %1 to i8*
%3 = getelementptr inbounds [7 x i32*], [7 x i32*]* %1, i64 0, i64 0
%4 = call i32 (i32**, ...) bitcast (i32 (...)* @showarray_2 to i32 (i32**, ...)*)(i32** %3)
ret void
}

LLVM IR (-O2):
@__const.array_2.primes = [7 x i32*] [i32* inttoptr (i64 2 to i32*), i32* inttoptr (i64 3 to i32*), i32* inttoptr (i64 5 to i32*), i32* inttoptr (i64 7 to i32*), i32* inttoptr (i64 9 to i32*), i32* inttoptr (i64 11 to i32*), i32* inttoptr (i64 13 to i32*)]
define void @array_2() {
%1 = alloca [7 x i32*]
%2 = bitcast [7 x i32*]* %1 to i8*
%3 = getelementptr inbounds [7 x i32*], [7 x i32*]* %1, i64 0, i64 0
%4 = call i32 (i32**, ...) bitcast (i32 (...)* @showarray_2 to i32 (i32**, ...)*)(i32** %3)
ret void
}