xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ cset82(unsigned char const *, int const, int /*<<< orphan*/, int,
                  int, int *, int *, char *);
int x1__50(const unsigned char *data, const int data_len, int *p_err_no,
           int *p_err_posn, char err_msg[50]) {
  return data_len >= 1 && data_len <= 50 &&
         cset82(data, data_len, 0, 1, 50, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<x1__50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jl     1181 <x1__50+0x71>
xor    %eax,%eax
cmpl   $0x32,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jg     1181 <x1__50+0x71>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x32,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <cset82@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1__50>:
mov    %rcx,%r10
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0x31,%ecx
ja     114d <x1__50+0x3d>
push   %rax
mov    %r8,%r11
mov    %rdx,%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x32,%r8d
push   %r11
push   %r10
call   1030 <cset82@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @x1__50(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp sle i32 %14, 50
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i32*, i32** %8
%20 = load i32*, i32** %9
%21 = load i8*, i8** %10
%22 = call i64 @cset82(i8* %17, i32 %18, i32 0, i32 1, i32 50, i32* %19, i32* %20, i8* %21)
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %16, %13, %5
%25 = phi i1 [ false, %13 ], [ false, %5 ], [ %23, %16 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @x1__50(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 50
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @cset82(i8* %0, i32 %1, i32 0, i32 1, i32 50, i32* %2, i32* %3, i8* %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int strlen(const char *str) {
  int n = 0;
  while (*str++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
void *malloc(size_t);
void *LibTomMalloc(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<LibTomMalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @LibTomMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ attr_t;

/* Variables and functions */
int PAIR_NUMBER(int /*<<< orphan*/);
int macro_PAIR_NUMBER(attr_t attrs) { return (PAIR_NUMBER(attrs)); }


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

x86 assembly (clang, -O2):
<macro_PAIR_NUMBER>:
jmp    1030 <PAIR_NUMBER@plt>

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

LLVM IR (-O2):
define i32 @macro_PAIR_NUMBER(i32 %0) {
%2 = tail call i32 @PAIR_NUMBER(i32 %0)
ret i32 %2
}
short int shortint_ignoring_shortint(short int x, short int y) { return x; }


x86 assembly (clang, -O0):
<shortint_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortint_ignoring_shortint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @shortint_ignoring_shortint(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_shortint(i16 returned signext %0, i16 signext %1) {
ret i16 %0
}
void updateSlavesWaitingBgsave(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               134, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<updateSlavesWaitingBgsave>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x86,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateSlavesWaitingBgsave>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x86,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.updateSlavesWaitingBgsave = [26 x i8] c"updateSlavesWaitingBgsave\00"
define void @updateSlavesWaitingBgsave() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 134, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.updateSlavesWaitingBgsave, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.updateSlavesWaitingBgsave = [26 x i8] c"updateSlavesWaitingBgsave\00"
define void @updateSlavesWaitingBgsave() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 134, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.updateSlavesWaitingBgsave, i64 0, i64 0))
ret void
}
/* Variables and functions */
intptr_t maxptr(intptr_t a, intptr_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<maxptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <maxptr+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <maxptr+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxptr>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @maxptr(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @maxptr(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ this_doesnt_exist();
main() { this_doesnt_exist(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @this_doesnt_exist()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @this_doesnt_exist()
ret i32 0
}
int main() {
  volatile unsigned int *address = 0x64100000;
  *address = 0xbbbbbbbb;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x64100000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xbbbbbbbb,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0xbbbbbbbb,0x64100000
bb bb bb bb
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* inttoptr (i64 1678770176 to i32*), i32** %2
%3 = load i32*, i32** %2
store volatile i32 -1145324613, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 -1145324613, i32* inttoptr (i64 1678770176 to i32*)
ret i32 0
}
/* Variables and functions */
double exp(double);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, double *);
int main(void) {
  double n;
  printf("n = ");
  if (scanf("%lf", &n) != 1) {
    return 1;
  }
  printf("exp(n) = %f\n", exp(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1172 <main+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1191 <main+0x61>
movsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
jne    1174 <main+0x44>
movsd  (%rsp),%xmm0
call   1040 <exp@plt>
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"n = \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"exp(n) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %11
7: ; preds = %0
%8 = load double, double* %2
%9 = call double @exp(double %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %9)
store i32 0, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"n = \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"exp(n) = %f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load double, double* %1
%8 = call double @exp(double %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %8)
br label %10
10: ; preds = %0, %6
%11 = phi i32 [ 0, %6 ], [ 1, %0 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void *child_thread(void *arg) {
  long num = (long)arg;
  long i = 0, sum = 0;
  while (++i <= num)
    sum += i;
  pthread_exit((void *)sum);
  return 0;
}


x86 assembly (clang, -O0):
<child_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x10(%rbp),%rax
jg     115b <child_thread+0x4b>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1134 <child_thread+0x24>
mov    -0x20(%rbp),%rdi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_thread>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
cmovle %rax,%rdi
lea    -0x1(%rdi),%rcx
mov    %rdi,%rax
mul    %rcx
shld   $0x3f,%rax,%rdx
add    %rdx,%rdi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @child_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %3
store i64 0, i64* %4
store i64 0, i64* %5
br label %8
8: ; preds = %13, %1
%9 = load i64, i64* %4
%10 = add nsw i64 %9, 1
store i64 %10, i64* %4
%11 = load i64, i64* %3
%12 = icmp sle i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = add nsw i64 %15, %14
store i64 %16, i64* %5
br label %8
17: ; preds = %8
%18 = load i64, i64* %5
%19 = inttoptr i64 %18 to i8*
%20 = call i32 @pthread_exit(i8* %19)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @child_thread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = call i64 @llvm.smax.i64(i64 %2, i64 0)
%4 = zext i64 %3 to i65
%5 = add nsw i64 %3, -1
%6 = zext i64 %5 to i65
%7 = mul i65 %4, %6
%8 = lshr i65 %7, 1
%9 = trunc i65 %8 to i64
%10 = add i64 %3, %9
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @pthread_exit(i8* %11)
ret i8* null
}
/* Type definitions */
struct file_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_dbppc_restart(char *, char *, int, char,
                                       struct file_header *);
void print_db_restart(int *tab, int action, char *cur_date, char *cur_time,
                      int utc, struct file_header *file_hdr) {
  if (action == 0x02) {
    print_dbppc_restart(cur_date, cur_time, utc, ';', file_hdr);
  }
}


x86 assembly (clang, -O0):
<print_db_restart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1152 <print_db_restart+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%r8
mov    $0x3b,%ecx
call   1030 <print_dbppc_restart@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_db_restart>:
cmp    $0x2,%esi
jne    112b <print_db_restart+0x1b>
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
mov    $0x3b,%ecx
mov    %r9,%r8
jmp    1030 <print_dbppc_restart@plt>
ret

LLVM IR (-O0):
%struct.file_header = type { i32 }
define void @print_db_restart(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, %struct.file_header* %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca %struct.file_header*
store i32* %0, i32** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store %struct.file_header* %5, %struct.file_header** %12
%13 = load i32, i32* %8
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %21
15: ; preds = %6
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load %struct.file_header*, %struct.file_header** %12
%20 = call i32 @print_dbppc_restart(i8* %16, i8* %17, i32 %18, i8 signext 59, %struct.file_header* %19)
br label %21
21: ; preds = %15, %6
ret void
}

LLVM IR (-O2):
%struct.file_header = type { i32 }
define void @print_db_restart(i32* nocapture readnone %0, i32 %1, i8* %2, i8* %3, i32 %4, %struct.file_header* %5) {
%7 = icmp eq i32 %1, 2
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @print_dbppc_restart(i8* %2, i8* %3, i32 %4, i8 signext 59, %struct.file_header* %5)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ demo_disconn();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void signal_handler(int sig) {
  (void)sig;
  printf("Shutting down...");
  demo_disconn();
  exit(sig);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <demo_disconn@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <demo_disconn@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Shutting down...\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @demo_disconn()
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Shutting down...\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @demo_disconn()
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ unset_bit(int, int);
int test_unset_bit() { return 0 == unset_bit(0b1000, 3); }


x86 assembly (clang, -O0):
<test_unset_bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x3,%esi
call   1030 <unset_bit@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unset_bit>:
push   %rax
mov    $0x8,%edi
mov    $0x3,%esi
call   1030 <unset_bit@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_unset_bit() {
%1 = call i64 @unset_bit(i32 8, i32 3)
%2 = icmp eq i64 0, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_unset_bit() {
%1 = tail call i64 @unset_bit(i32 8, i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ __builtin_inb(int);
void main(void) {
  if (__builtin_inb(0x1b)) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <__builtin_inb@plt>
cmp    $0x0,%rax
je     112d <main+0x1d>
jmp    112d <main+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1b,%edi
jmp    1030 <__builtin_inb@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i64 @__builtin_inb(i32 27)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %4
4: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 @__builtin_inb(i32 27)
ret void
}
unsigned char *sha512digest(bitstr, bitcnt)
unsigned char *bitstr;
unsigned long bitcnt;
{ return ((unsigned char *)shacomp(512, 1, bitstr, bitcnt)); }


x86 assembly (clang, -O0):
<sha512digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x200,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <shacomp@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha512digest>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x200,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <shacomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sha512digest(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 512, i32 1, i8* %5, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @sha512digest(i8* %0, i64 %1) {
%3 = tail call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 512, i32 1, i8* %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void mutex_lock(struct mutex *lock) { (void)lock; }


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

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

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

LLVM IR (-O2):
%struct.mutex = type opaque
define void @mutex_lock(%struct.mutex* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void iasnprintfFree(char *fChar) {
  free(fChar);
  fChar = 0;
}


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

x86 assembly (clang, -O2):
<iasnprintfFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @iasnprintfFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int write_to_database(char *, char *, int);
int write_weather_to_database(char *insert, int cycle) {
  return write_to_database("weather", insert, cycle);
}


x86 assembly (clang, -O0):
<write_weather_to_database>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <write_to_database@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_weather_to_database>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <write_to_database@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"weather\00"
define i32 @write_weather_to_database(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @write_to_database(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"weather\00"
define i32 @write_weather_to_database(i8* %0, i32 %1) {
%3 = tail call i32 @write_to_database(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_quaddobl_one_affinization(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(900, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_quaddobl_one_affinization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x384,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_quaddobl_one_affinization>:
mov    $0x384,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_quaddobl_one_affinization() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 900, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_quaddobl_one_affinization() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 900, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int64_t div_by_2_26(const int64_t v) {
  const uint32_t highword = (uint32_t)(((uint64_t)v) >> 32);
  const int32_t sign = ((int32_t)highword) >> 31;
  const int32_t roundoff = ((uint32_t)sign) >> 6;
  return (v + roundoff) >> 26;
}


x86 assembly (clang, -O0):
<div_by_2_26>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
sar    $0x1a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @div_by_2_26(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = ashr i32 %8, 31
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = ashr i32 %10, 6
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = ashr i32 %14, 26
ret i32 %15
}

LLVM IR (-O2):
define i32 @div_by_2_26(i32 %0) {
ret i32 poison
}
int get(int **board, int row, int col) { return board[row][col]; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @get(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32**, i32*** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32*, i32** %7, i64 %9
%11 = load i32*, i32** %10
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @get(i32** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32*, i32** %0, i64 %4
%6 = load i32*, i32** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
double _jaro_winkler(char const *, char const *, int /*<<< orphan*/,
                     int /*<<< orphan*/);
double jaro_distance(const char *ying, const char *yang) {
  return _jaro_winkler(ying, yang, 0, 0);
}


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

x86 assembly (clang, -O2):
<jaro_distance>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_jaro_winkler@plt>

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

LLVM IR (-O2):
define double @jaro_distance(i8* %0, i8* %1) {
%3 = tail call double @_jaro_winkler(i8* %0, i8* %1, i32 0, i32 0)
ret double %3
}
float avg(float a, float b) {
  if (a == 0.f)
    return b;
  if (b == 0.f)
    return a;
  return (a + b) * 0.5f;
}


x86 assembly (clang, -O0):
<avg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1134 <avg+0x34>
jp     1134 <avg+0x34>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1175 <avg+0x75>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    115a <avg+0x5a>
jp     115a <avg+0x5a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1175 <avg+0x75>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xe94(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    110e <avg+0xe>
jp     110e <avg+0xe>
movaps %xmm1,%xmm0
ret
ucomiss %xmm2,%xmm1
jne    1115 <avg+0x15>
jnp    1121 <avg+0x21>
addss  %xmm1,%xmm0
mulss  0xedf(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @avg(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %5
store float %9, float* %3
br label %20
10: ; preds = %2
%11 = load float, float* %5
%12 = fcmp oeq float %11, 0.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load float, float* %4
store float %14, float* %3
br label %20
15: ; preds = %10
%16 = load float, float* %4
%17 = load float, float* %5
%18 = fadd float %16, %17
%19 = fmul float %18, 5.000000e-01
store float %19, float* %3
br label %20
20: ; preds = %15, %13, %8
%21 = load float, float* %3
ret float %21
}

LLVM IR (-O2):
define float @avg(float %0, float %1) {
%3 = fcmp oeq float %0, 0.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fcmp oeq float %1, 0.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = fadd float %0, %1
%8 = fmul float %7, 5.000000e-01
br label %9
9: ; preds = %4, %2, %6
%10 = phi float [ %8, %6 ], [ %1, %2 ], [ %0, %4 ]
ret float %10
}
int hash(const char *str) {
  int h = 0;
  for (int i = 0; str[i]; i++) {
    h *= 31;
    h += str[i];
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114f <hash+0x4f>
imul   $0x1f,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %12, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %13, %6 ], [ 0, %1 ]
%8 = phi i8 [ %15, %6 ], [ %2, %1 ]
%9 = phi i32 [ %12, %6 ], [ 0, %1 ]
%10 = mul nsw i32 %9, 31
%11 = sext i8 %8 to i32
%12 = add nsw i32 %10, %11
%13 = add nuw nsw i64 %7, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %4, label %6
}
int c050(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c050() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ acc_free(void *);
void *acc_malloc(int const);
int /*<<< orphan*/ acc_map_data(int /*<<< orphan*/, void *, int const);
int /*<<< orphan*/ acc_unmap_data(unsigned char *);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(int const);
int main(int argc, char **argv) {
  const int N = 256;
  unsigned char *h;
  void *d;
  h = (unsigned char *)malloc(N);
  d = acc_malloc(N);
  acc_map_data(0, d, N);
  acc_unmap_data(h);
  acc_free(d);
  free(h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100,-0x14(%rbp)
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x100,%edi
call   1040 <acc_malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1060 <acc_map_data@plt>
mov    -0x20(%rbp),%rdi
call   1050 <acc_unmap_data@plt>
mov    -0x28(%rbp),%rdi
call   1080 <acc_free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x100,%edi
call   1040 <acc_malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %rax,%rsi
mov    $0x100,%edx
call   1060 <acc_map_data@plt>
mov    %r14,%rdi
call   1050 <acc_unmap_data@plt>
mov    %rbx,%rdi
call   1080 <acc_free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %6
%9 = call i64 @malloc(i32 256)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
%11 = call i8* @acc_malloc(i32 256)
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = call i32 @acc_map_data(i32 0, i8* %12, i32 256)
%14 = load i8*, i8** %7
%15 = call i32 @acc_unmap_data(i8* %14)
%16 = load i8*, i8** %8
%17 = call i32 @acc_free(i8* %16)
%18 = load i8*, i8** %7
%19 = call i32 @free(i8* %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 256)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i8* @acc_malloc(i32 256)
%6 = tail call i32 @acc_map_data(i32 0, i8* %5, i32 256)
%7 = tail call i32 @acc_unmap_data(i8* %4)
%8 = tail call i32 @acc_free(i8* %5)
%9 = tail call i32 @free(i8* %4)
ret i32 0
}
int cmp_uint_lt(const void *a, const void *b) {
  unsigned int a_ = *(unsigned int *)a;
  unsigned int b_ = *(unsigned int *)b;
  if (a_ < b_)
    return -1;
  if (a_ > b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_uint_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1136 <cmp_uint_lt+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp_uint_lt+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    114e <cmp_uint_lt+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <cmp_uint_lt+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uint_lt>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_uint_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int const uint32_t;

/* Variables and functions */
uint32_t functionF(const uint32_t b, const uint32_t c, const uint32_t d) {
  return (b & c) | (~b & d);
}


x86 assembly (clang, -O0):
<functionF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionF>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @functionF(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @functionF(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
int u_seq_len(unsigned int first_byte) {
  if (first_byte < 0x80)
    return 1;
  if (first_byte < 0xc0)
    return 0;
  if (first_byte < 0xe0)
    return 2;
  if (first_byte < 0xf0)
    return 3;
  if (first_byte < 0xf5)
    return 4;
  return -1;
}


x86 assembly (clang, -O0):
<u_seq_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jae    1120 <u_seq_len+0x20>
movl   $0x1,-0x4(%rbp)
jmp    118b <u_seq_len+0x8b>
cmpl   $0xc0,-0x8(%rbp)
jae    1139 <u_seq_len+0x39>
movl   $0x0,-0x4(%rbp)
jmp    118b <u_seq_len+0x8b>
cmpl   $0xe0,-0x8(%rbp)
jae    1152 <u_seq_len+0x52>
movl   $0x2,-0x4(%rbp)
jmp    118b <u_seq_len+0x8b>
cmpl   $0xf0,-0x8(%rbp)
jae    116b <u_seq_len+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    118b <u_seq_len+0x8b>
cmpl   $0xf5,-0x8(%rbp)
jae    1184 <u_seq_len+0x84>
movl   $0x4,-0x4(%rbp)
jmp    118b <u_seq_len+0x8b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_seq_len>:
mov    $0x1,%eax
cmp    $0x80,%edi
jb     1142 <u_seq_len+0x42>
xor    %eax,%eax
cmp    $0xc0,%edi
jb     1142 <u_seq_len+0x42>
mov    $0x2,%eax
cmp    $0xe0,%edi
jb     1142 <u_seq_len+0x42>
mov    $0x3,%eax
cmp    $0xf0,%edi
jb     1142 <u_seq_len+0x42>
xor    %eax,%eax
cmp    $0xf5,%edi
setb   %al
lea    (%rax,%rax,4),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @u_seq_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 192
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 0, i32* %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 224
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 2, i32* %2
br label %24
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp ult i32 %16, 240
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 3, i32* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp ult i32 %20, 245
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 4, i32* %2
br label %24
23: ; preds = %19
store i32 -1, i32* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @u_seq_len(i32 %0) {
%2 = icmp ult i32 %0, 128
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 192
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 224
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 240
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 245
%11 = select i1 %10, i32 4, i32 -1
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 2, %5 ], [ 3, %7 ], [ %11, %9 ]
ret i32 %13
}
int bar() { return 1; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bar() {
ret i32 1
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 1
}
void YUY2ToY() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToY() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int /*<<< orphan*/ rdfile(char *, int *, int);
int readw(char *file) {
  int value;
  if (!rdfile(file, &value, sizeof(value)))
    value = 0;
  return value;
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <rdfile@plt>
cmp    $0x0,%eax
jne    113e <readw+0x2e>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <rdfile@plt>
test   %eax,%eax
je     1128 <readw+0x18>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readw(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @rdfile(i8* %4, i32* %3, i32 4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @readw(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @rdfile(i8* %0, i32* %2, i32 4)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 0, i32 %6
ret i32 %7
}
unsigned int EIP93_ARM_DESCRIPTOR_SIZE(void) { return 8; }


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

x86 assembly (clang, -O2):
<EIP93_ARM_DESCRIPTOR_SIZE>:
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @EIP93_ARM_DESCRIPTOR_SIZE() {
ret i32 8
}

LLVM IR (-O2):
define i32 @EIP93_ARM_DESCRIPTOR_SIZE() {
ret i32 8
}
void foo31() {}


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

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

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

LLVM IR (-O2):
define void @foo31() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_configure();
int main(void) {
  read_configure();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read_configure()
ret i32 0
}
void gtk_tree_model_filter_set_modify_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_filter_set_modify_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_can(int);
void FDCAN2_IT1_IRQ_Handler(void) { process_can(1); }


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

x86 assembly (clang, -O2):
<FDCAN2_IT1_IRQ_Handler>:
mov    $0x1,%edi
jmp    1030 <process_can@plt>

LLVM IR (-O0):
define void @FDCAN2_IT1_IRQ_Handler() {
%1 = call i32 @process_can(i32 1)
ret void
}

LLVM IR (-O2):
define void @FDCAN2_IT1_IRQ_Handler() {
%1 = tail call i32 @process_can(i32 1)
ret void
}
void generic_delete_inode(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<generic_delete_inode>:
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):
<generic_delete_inode>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

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

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