xunge/DecIR huggingface dataset:
/* Variables and functions */
char tolower(char);
void strcpylow(char *in, char *out) {
  while (*in != '\0') {
    *out = tolower(*in);
    out++;
    in++;
  }
  *out = '\0';
}


x86 assembly (clang, -O0):
<strcpylow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <strcpylow+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <strcpylow+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpylow>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rdi),%al
test   %al,%al
je     114a <strcpylow+0x3a>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%r14)
add    $0x1,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strcpylow+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strcpylow(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = tail call signext i8 @tolower(i8 signext %6)
store i8 %9, i8* %7
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
void read_dongle(int fd, char *data, int len) {
  int n;
  n = read(fd, data, len);
  if (n < 0) {
    perror("read failed");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<read_dongle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1174 <read_dongle+0x44>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_dongle>:
push   %rax
call   1030 <read@plt>
test   %eax,%eax
js     113c <read_dongle+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"read failed\00"
define void @read_dongle(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"read failed\00"
define void @read_dongle(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dummyassert(int);
int /*<<< orphan*/ page_free(int, int *, int *);
int /*<<< orphan*/ validptr(int *);
void page_decref(int ppno, int pages[], int page_protected[]) {
  dummyassert(!page_free(ppno, pages, page_protected));
  validptr(pages + ppno);
  pages[ppno]--;
}


x86 assembly (clang, -O0):
<page_decref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <page_free@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <dummyassert@plt>
mov    -0x10(%rbp),%rdi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1050 <validptr@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_decref>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <page_free@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <dummyassert@plt>
movslq %ebp,%rbp
lea    (%rbx,%rbp,4),%rdi
call   1050 <validptr@plt>
addl   $0xffffffff,(%rbx,%rbp,4)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @page_decref(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 = load i32*, i32** %6
%10 = call i32 @page_free(i32 %7, i32* %8, i32* %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @dummyassert(i32 %13)
%15 = load i32*, i32** %5
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = call i32 @validptr(i32* %18)
%20 = load i32*, i32** %5
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %24, -1
store i32 %25, i32* %23
ret void
}

LLVM IR (-O2):
define void @page_decref(i32 %0, i32* %1, i32* %2) {
%4 = tail call i32 @page_free(i32 %0, i32* %1, i32* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @dummyassert(i32 %6)
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = tail call i32 @validptr(i32* %9)
%11 = load i32, i32* %9
%12 = add nsw i32 %11, -1
store i32 %12, i32* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int lang_callFunction_int(char *);
char *lang_eval_doCallPreliminary(int /*<<< orphan*/ *);
int lang_eval_doCall_int(FILE *lang_in) {
  int ret;
  char *name;
  name = lang_eval_doCallPreliminary(lang_in);
  ret = lang_callFunction_int(name);
  return ret;
}


x86 assembly (clang, -O0):
<lang_eval_doCall_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lang_eval_doCallPreliminary@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <lang_callFunction_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lang_eval_doCall_int>:
push   %rax
call   1030 <lang_eval_doCallPreliminary@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <lang_callFunction_int@plt>

LLVM IR (-O0):
define i32 @lang_eval_doCall_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i8* @lang_eval_doCallPreliminary(i32* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @lang_callFunction_int(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @lang_eval_doCall_int(i32* %0) {
%2 = tail call i8* @lang_eval_doCallPreliminary(i32* %0)
%3 = tail call i32 @lang_callFunction_int(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
scalar_t__ __syscall(int, int /*<<< orphan*/);
scalar_t__ __syscall_ret(int /*<<< orphan*/);
void *sbrk(intptr_t inc) {
  if (inc)
    return (void *)__syscall_ret(-ENOMEM);
  return (void *)__syscall(45, 0);
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <sbrk+0x30>
xor    %edi,%edi
mov    0x2ea0(%rip),%rax
sub    (%rax),%edi
call   1040 <__syscall_ret@plt>
mov    %rax,-0x8(%rbp)
jmp    1160 <sbrk+0x40>
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <__syscall@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
push   %rax
test   %rdi,%rdi
je     1138 <sbrk+0x18>
mov    0x2eb3(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
call   1040 <__syscall_ret@plt>
pop    %rcx
ret
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <__syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @sbrk(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @ENOMEM
%8 = sub nsw i32 0, %7
%9 = call i64 @__syscall_ret(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = call i64 @__syscall(i32 45, i32 0)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %6
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i8* @sbrk(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @ENOMEM
%5 = sub nsw i32 0, %4
%6 = tail call i64 @__syscall_ret(i32 %5)
br label %9
7: ; preds = %1
%8 = tail call i64 @__syscall(i32 45, i32 0)
br label %9
9: ; preds = %7, %3
%10 = phi i64 [ %6, %3 ], [ %8, %7 ]
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printData(void *data) { printf("%s\n", (char *)data); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printData(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int isnanl(x)
long double x;
{
  union {
    long double d;
    unsigned short s[6];
    unsigned int i[3];
  } u;
  u.d = x;
  if (sizeof(int) == 4) {
    if (((u.s[4] & 0x7fff) == 0x7fff) &&
        (((u.i[1] & 0x7fffffff) != 0) || (u.i[0] != 0)))
      return 1;
    return (0);
  } else {
    if ((u.s[4] & 0x7fff) == 0x7fff) {
      if ((u.s[3] & 0x7fff) | u.s[2] | u.s[1] | u.s[0])
        return (1);
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<isnanl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstpt  -0x30(%rbp)
movzwl -0x28(%rbp),%eax
and    $0x7fff,%eax
cmp    $0x7fff,%eax
jne    114b <isnanl+0x4b>
mov    -0x2c(%rbp),%eax
and    $0x7fffffff,%eax
cmp    $0x0,%eax
jne    113f <isnanl+0x3f>
cmpl   $0x0,-0x30(%rbp)
je     114b <isnanl+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <isnanl+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnanl>:
mov    0x10(%rsp),%eax
not    %eax
test   $0x7fff,%eax
jne    112a <isnanl+0x2a>
mov    0x8(%rsp),%rcx
movabs $0x7fffffff00000000,%rdx
ff ff 7f
mov    $0x1,%eax
test   %rdx,%rcx
jne    112c <isnanl+0x2c>
test   %ecx,%ecx
jne    112c <isnanl+0x2c>
xor    %eax,%eax
ret

LLVM IR (-O0):
%union.anon = type { x86_fp80 }
define i32 @isnanl(x86_fp80 %0) {
%2 = alloca i32
%3 = alloca x86_fp80
%4 = alloca %union.anon
store x86_fp80 %0, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = bitcast %union.anon* %4 to x86_fp80*
store x86_fp80 %5, x86_fp80* %6
%7 = bitcast %union.anon* %4 to [6 x i16]*
%8 = getelementptr inbounds [6 x i16], [6 x i16]* %7, i64 0, i64 4
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = and i32 %10, 32767
%12 = icmp eq i32 %11, 32767
br i1 %12, label %13, label %25
13: ; preds = %1
%14 = bitcast %union.anon* %4 to [3 x i32]*
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 1
%16 = load i32, i32* %15
%17 = and i32 %16, 2147483647
%18 = icmp ne i32 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %13
%20 = bitcast %union.anon* %4 to [3 x i32]*
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %20, i64 0, i64 0
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19, %13
store i32 1, i32* %2
br label %26
25: ; preds = %19, %1
store i32 0, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @isnanl(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = and i80 %2, 604444463063240877801472
%4 = icmp eq i80 %3, 604444463063240877801472
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = and i80 %2, 9223372032559808512
%7 = icmp ne i80 %6, 0
%8 = trunc i80 %2 to i32
%9 = icmp ne i32 %8, 0
%10 = or i1 %7, %9
br i1 %10, label %12, label %11
11: ; preds = %5, %1
br label %12
12: ; preds = %5, %11
%13 = phi i32 [ 0, %11 ], [ 1, %5 ]
ret i32 %13
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_detach_event(void *bus) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_detach_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_detach_event>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_detach_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_detach_event(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
void lookupKeyWriteOrReply(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",
               89, "Function '%s' is disabled.", __func__);
}


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

x86 assembly (clang, -O2):
<lookupKeyWriteOrReply>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x59,%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__.lookupKeyWriteOrReply = [22 x i8] c"lookupKeyWriteOrReply\00"
define void @lookupKeyWriteOrReply() {
%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 89, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.lookupKeyWriteOrReply, 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__.lookupKeyWriteOrReply = [22 x i8] c"lookupKeyWriteOrReply\00"
define void @lookupKeyWriteOrReply() {
%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 89, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.lookupKeyWriteOrReply, i64 0, i64 0))
ret void
}
void adis16060_unconfigure_ring(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16060_unconfigure_ring(%struct.iio_dev* nocapture %0) {
ret void
}
/* Type definitions */
struct progress {
  int dummy;
};

/* Variables and functions */
struct progress *start_progress_delay(char const *, unsigned int,
                                      int /*<<< orphan*/, int /*<<< orphan*/);
struct progress *start_progress(const char *title, unsigned total) {
  return start_progress_delay(title, total, 0, 0);
}


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

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

LLVM IR (-O0):
%struct.progress = type { i32 }
define %struct.progress* @start_progress(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 %struct.progress* @start_progress_delay(i8* %5, i32 %6, i32 0, i32 0)
ret %struct.progress* %7
}

LLVM IR (-O2):
%struct.progress = type { i32 }
define %struct.progress* @start_progress(i8* %0, i32 %1) {
%3 = tail call %struct.progress* @start_progress_delay(i8* %0, i32 %1, i32 0, i32 0)
ret %struct.progress* %3
}
int test_eol(char a) {
  if (a == '\n')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<test_eol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1123 <test_eol+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <test_eol+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eol>:
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @test_eol(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
void Troca(int *vet, int a, int b) {
  int aux;
  aux = vet[a];
  vet[a] = vet[b];
  vet[b] = aux;
}


x86 assembly (clang, -O0):
<Troca>:
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,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Troca>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @Troca(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @Troca(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* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void sortrating(char *s) {}


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

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

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

LLVM IR (-O2):
define void @sortrating(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void uint64Copy(uint64_t *dst, const uint64_t *src) {
  assert(dst != NULL);
  assert(src != NULL);
  *dst = *src;
}


x86 assembly (clang, -O0):
<uint64Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint64Copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @uint64Copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @uint64Copy(i32* writeonly %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
void clearbuff(char *buff) { memset(buff, '\0', 256); }


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

x86 assembly (clang, -O2):
<clearbuff>:
xor    %esi,%esi
mov    $0x100,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @clearbuff(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i8 signext 0, i32 256)
ret void
}

LLVM IR (-O2):
define void @clearbuff(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i8 signext 0, i32 256)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _tree_print(void *, int);
void _tree_print_cb2(void *p_void, void *p_indent) {
  _tree_print(p_void, (int)p_indent);
}


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

x86 assembly (clang, -O2):
<_tree_print_cb2>:
jmp    1030 <_tree_print@plt>

LLVM IR (-O0):
define void @_tree_print_cb2(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 = ptrtoint i8* %6 to i32
%8 = call i32 @_tree_print(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @_tree_print_cb2(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @_tree_print(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
size_t s_size_t_pct(size_t q, size_t pct) {
  return q > 10000 ? (q / 100) * pct : (q * pct) / 100;
}


x86 assembly (clang, -O0):
<s_size_t_pct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x2710,-0x8(%rbp)
jbe    1136 <s_size_t_pct+0x36>
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114d <s_size_t_pct+0x4d>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_size_t_pct>:
cmp    $0x2711,%rdi
jb     1129 <s_size_t_pct+0x29>
shr    $0x2,%rdi
movabs $0x28f5c28f5c28f5c3,%rcx
c2 f5 28
mov    %rdi,%rax
mul    %rcx
mov    %rdx,%rax
shr    $0x2,%rax
imul   %rsi,%rax
ret
imul   %rdi,%rsi
shr    $0x2,%rsi
movabs $0x28f5c28f5c28f5c3,%rcx
c2 f5 28
mov    %rsi,%rax
mul    %rcx
mov    %rdx,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @s_size_t_pct(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 = icmp ugt i64 %5, 10000
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i64, i64* %3
%9 = udiv i64 %8, 100
%10 = load i64, i64* %4
%11 = mul i64 %9, %10
br label %17
12: ; preds = %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = mul i64 %13, %14
%16 = udiv i64 %15, 100
br label %17
17: ; preds = %12, %7
%18 = phi i64 [ %11, %7 ], [ %16, %12 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @s_size_t_pct(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, 10000
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = udiv i64 %0, 100
%6 = mul i64 %5, %1
br label %10
7: ; preds = %2
%8 = mul i64 %1, %0
%9 = udiv i64 %8, 100
br label %10
10: ; preds = %7, %4
%11 = phi i64 [ %6, %4 ], [ %9, %7 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ response(int, char *, char *, char *);
void not_found(int client) {
  response(client, "HTTP/1.0 404 Not Found\r\n",
           "Content-Type: text/html\r\nContent-Length: %d\r\n\r\n",
           "<HTML><TITLE>Not Found</TITLE><BODY><P>The server could not "
           "fulfill your request because the resouce specified is unavailable "
           "or nonexistent.</BODY></HTML>\r\n");
}


x86 assembly (clang, -O0):
<not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
lea    0xeed(%rip),%rdx
lea    0xf16(%rip),%rcx
call   1030 <response@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found>:
lea    0xee9(%rip),%rsi
lea    0xefb(%rip),%rdx
lea    0xf24(%rip),%rcx
jmp    1030 <response@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"HTTP/1.0 404 Not Found\0D\0A\00"
@.str.1 = [48 x i8] c"Content-Type: text/html\0D\0AContent-Length: %d\0D\0A\0D\0A\00"
@.str.2 = [158 x i8] c"<HTML><TITLE>Not Found</TITLE><BODY><P>The server could not fulfill your request because the resouce specified is unavailable or nonexistent.</BODY></HTML>\0D\0A\00"
define void @not_found(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @response(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"HTTP/1.0 404 Not Found\0D\0A\00"
@.str.1 = [48 x i8] c"Content-Type: text/html\0D\0AContent-Length: %d\0D\0A\0D\0A\00"
@.str.2 = [158 x i8] c"<HTML><TITLE>Not Found</TITLE><BODY><P>The server could not fulfill your request because the resouce specified is unavailable or nonexistent.</BODY></HTML>\0D\0A\00"
define void @not_found(i32 %0) {
%2 = tail call i32 @response(i32 %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int getBit(unsigned short *bitStr, int bitPos) {
  return !!(bitStr[bitPos >> 4] & (0x8000 >> (bitPos & 15)));
}


x86 assembly (clang, -O0):
<getBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
movzwl (%rax,%rcx,2),%eax
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
mov    $0x8000,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x4,%eax
cltq
movzwl (%rdi,%rax,2),%eax
and    $0xf,%cl
shl    %cl,%eax
movzwl %ax,%eax
shr    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @getBit(i16* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i16, i16* %0, i64 %4
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = and i32 %1, 15
%9 = lshr i32 32768, %8
%10 = and i32 %9, %7
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
void abx500_pinctrl_ab8505_init(struct abx500_pinctrl_soc_data **soc) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.abx500_pinctrl_soc_data = type opaque
define void @abx500_pinctrl_ab8505_init(%struct.abx500_pinctrl_soc_data** nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t unpacki32(uint8_t *buf) {
  uint32_t i2 = ((uint32_t)buf[0] << 24) | ((uint32_t)buf[1] << 16) |
                ((uint32_t)buf[2] << 8) | buf[3];
  int32_t i;
  if (i2 <= 0x7fffffffu) {
    i = i2;
  } else {
    i = -1 - (int32_t)(0xffffffffu - i2);
  }
  return i;
}


x86 assembly (clang, -O0):
<unpacki32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7fffffff,-0xc(%rbp)
ja     114b <unpacki32+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115d <unpacki32+0x5d>
mov    $0xffffffff,%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpacki32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @unpacki32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int listen(int, int);
int /*<<< orphan*/ printf(char *);
int start_server(int serv_socket, int backlog) {
  int status = 0;
  if ((status = listen(serv_socket, backlog)) == -1) {
    printf("socket listen error\n");
  }
  return status;
}


x86 assembly (clang, -O0):
<start_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <listen@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1158 <start_server+0x38>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_server>:
push   %rbx
call   1040 <listen@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <start_server+0x19>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [20 x i8] c"socket listen error\00"
define i32 @start_server(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main(void) {
  int x[16];
  foo(x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret i32 0
}
unsigned long long rdtsc(void) {
  unsigned long long rax, rdx;
  __asm__ volatile("rdtsc" : "=a"(rax), "=d"(rdx));
  return rdx << 32 | rax;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = load i64, i64* %1
%9 = or i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
__attribute__((always_)) int kinetis_hsrun_disable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kinetis_hsrun_disable() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func1(int, int);
int /*<<< orphan*/ func2(int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  func1(0, 2);
  func1(1, 1);
  func2(0, 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <func1@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <func1@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @func1(i32 0, i32 2)
%4 = tail call i32 @func1(i32 1, i32 1)
%5 = tail call i32 @func2(i32 0, i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t rm_get_uint32be(uint8_t *buf) {
  return (uint32_t)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]);
}


x86 assembly (clang, -O0):
<rm_get_uint32be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_get_uint32be>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rm_get_uint32be(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @rm_get_uint32be(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int /*<<< orphan*/ *, int, int,
                               int /*<<< orphan*/ *, int /*<<< orphan*/);
void test_multiple_zeros(void) {
  int8_t input[] = {0, 0, 0};
  int8_t expected[] = {0};
  test_rebase(10, input, (sizeof(input) / sizeof(input[0])), 2, expected, 0);
}


x86 assembly (clang, -O0):
<test_multiple_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%r8
mov    $0xa,%edi
mov    $0x3,%edx
mov    $0x2,%ecx
xor    %r9d,%r9d
call   1040 <test_rebase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_multiple_zeros>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%r8
mov    $0xa,%edi
mov    $0x3,%edx
mov    $0x2,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test_multiple_zeros() {
%1 = alloca [3 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 10, i32* %5, i32 3, i32 2, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @test_multiple_zeros() {
%1 = alloca [3 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @test_rebase(i32 10, i32* %6, i32 3, i32 2, i32* %5, i32 0)
ret void
}
int procNumb() {
  int nprocs = -1, nprocs_max = -1;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @procNumb() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ R_raw(int *, int *, int /*<<< orphan*/);
void R(int *a, int *b) { R_raw(a, b, 0); }


x86 assembly (clang, -O0):
<R>:
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    %edx,%edx
call   1030 <R_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @R(i32* %0, i32* %1) {
%3 = tail call i32 @R_raw(i32* %0, i32* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TV_Init();
void SV_Init(void) { TV_Init(); }


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

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

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

LLVM IR (-O2):
define void @SV_Init() {
%1 = tail call i32 (...) @TV_Init()
ret void
}
/* Type definitions */
typedef int __m128d;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_div_pd(__m128d a, __m128d b) {
  return a / b;
}


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

x86 assembly (clang, -O2):
<_mm_div_pd>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @_mm_div_pd(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_size_t(size_t const k1, size_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_size_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_size_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_size_t(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 eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_size_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void daemon_main(void) {}


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

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

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

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