xunge/DecIR huggingface dataset:
/* Variables and functions */
int strnatcmp0(char const *, char const *, int);
int strnatcasecmp(char const *a, char const *b) { return strnatcmp0(a, b, 1); }


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

x86 assembly (clang, -O2):
<strnatcasecmp>:
mov    $0x1,%edx
jmp    1030 <strnatcmp0@plt>

LLVM IR (-O0):
define i32 @strnatcasecmp(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 i32 @strnatcmp0(i8* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strnatcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @strnatcmp0(i8* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
double neg_f(int);
int /*<<< orphan*/ printf(char *, double);
main() { printf("%f\n", neg_f(5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <neg_f@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <neg_f@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double @neg_f(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main(void) {
  int a, b, c, d;
  scanf("%d %d %d %d", &a, &b, &c, &d);
  int e = a * b - c * d;
  printf("DIFERENCA = %d\n", e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
imul   0x14(%rsp),%esi
mov    0x8(%rsp),%eax
imul   0xc(%rsp),%eax
sub    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [16 x i8] c"DIFERENCA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = sub nsw i32 %10, %13
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [16 x i8] c"DIFERENCA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, %10
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, %13
%16 = sub nsw i32 %12, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
int /*<<< orphan*/ remove(char *);
scalar_t__ stat(char *, struct stat *);
void removeemptyfile(char *filenametoremove) {
  struct stat statinfo;
  if (filenametoremove == NULL) {
    return;
  }
  if (stat(filenametoremove, &statinfo) != 0) {
    return;
  }
  if (statinfo.st_size == 0) {
    remove(filenametoremove);
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<removeemptyfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <removeemptyfile+0x1c>
jmp    1176 <removeemptyfile+0x56>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     1158 <removeemptyfile+0x38>
jmp    1176 <removeemptyfile+0x56>
cmpq   $0x0,-0x10(%rbp)
jne    1171 <removeemptyfile+0x51>
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
jmp    1176 <removeemptyfile+0x56>
jmp    1176 <removeemptyfile+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeemptyfile>:
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
je     1146 <removeemptyfile+0x26>
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
or     0x8(%rsp),%rax
jne    1146 <removeemptyfile+0x26>
mov    %rbx,%rdi
call   1030 <remove@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define void @removeemptyfile(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i64 @stat(i8* %8, %struct.stat* %3)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %20
12: ; preds = %7
%13 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%14 = load i64, i64* %13
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i8*, i8** %2
%18 = call i32 @remove(i8* %17)
br label %20
19: ; preds = %12
br label %20
20: ; preds = %19, %16, %11, %6
ret void
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define void @removeemptyfile(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = call i64 @stat(i8* %0, %struct.stat* %2)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, 0
%11 = select i1 %7, i1 %10, i1 false
br i1 %11, label %12, label %14
12: ; preds = %5
%13 = call i32 @remove(i8* %0)
br label %14
14: ; preds = %5, %1, %12
ret void
}
int fun785() { return 785; }


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

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

LLVM IR (-O0):
define i32 @fun785() {
ret i32 785
}

LLVM IR (-O2):
define i32 @fun785() {
ret i32 785
}
/* Variables and functions */
scalar_t__ xisblank(int);
int xisspace(int c) {
  return (xisblank(c) || c == '\n' || c == '\r' || c == '\f' || c == '\v');
}


x86 assembly (clang, -O0):
<xisspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <xisblank@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116c <xisspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <xisspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <xisspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <xisspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisspace>:
push   %rbx
mov    %edi,%ebx
call   1030 <xisblank@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <xisspace+0x17>
pop    %rbx
ret
cmp    $0xd,%ebx
ja     1136 <xisspace+0x26>
mov    $0x3400,%ecx
bt     %ebx,%ecx
jb     1125 <xisspace+0x15>
xor    %eax,%eax
cmp    $0xb,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xisspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @xisblank(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 10
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 13
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 12
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 11
br label %18
18: ; preds = %15, %12, %9, %6, %1
%19 = phi i1 [ true, %12 ], [ true, %9 ], [ true, %6 ], [ true, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @xisspace(i32 %0) {
%2 = tail call i64 @xisblank(i32 %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 13, label %9
i32 12, label %9
i32 10, label %9
]
6: ; preds = %5
%7 = icmp eq i32 %0, 11
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [ -n increment ] utility [ argument ...]\n",
                getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: %s [ -n increment ] utility [ argument ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: %s [ -n increment ] utility [ argument ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void append_callback_(char c, void *param) {
  char **p = (char **)param;
  *((*p)++) = c;
}


x86 assembly (clang, -O0):
<append_callback_>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_callback_>:
mov    (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
mov    %dil,(%rax)
ret

LLVM IR (-O0):
define void @append_callback_(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8**
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i8**
store i8** %7, i8*** %5
%8 = load i8, i8* %3
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %9
store i8 %8, i8* %10
ret void
}

LLVM IR (-O2):
define void @append_callback_(i8 signext %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %3
store i8 %0, i8* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t be64_to_cpu(uint64_t be_val) { return be_val; }


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

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

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

LLVM IR (-O2):
define i32 @be64_to_cpu(i32 returned %0) {
ret i32 %0
}
int find(int x, int *parents) {
  if (parents[x] == x)
    return x;
  parents[x] = find(parents[x], parents);
  return parents[x];
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    113e <find+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <find+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
call   1030 <find@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%eax
movslq %edi,%rbx
mov    (%rsi,%rbx,4),%edi
cmp    %ebx,%edi
je     112c <find+0x1c>
mov    %rsi,%r14
call   1030 <find@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @find(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %7, label %9
7: ; preds = %2, %9
%8 = phi i32 [ %10, %9 ], [ %0, %2 ]
ret i32 %8
9: ; preds = %2
%10 = tail call i32 @find(i32 %5, i32* %1)
store i32 %10, i32* %4
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ nn_free(void *);
void nn_chunk_default_free(void *p) { nn_free(p); }


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

x86 assembly (clang, -O2):
<nn_chunk_default_free>:
jmp    1030 <nn_free@plt>

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

LLVM IR (-O2):
define void @nn_chunk_default_free(i8* %0) {
%2 = tail call i32 @nn_free(i8* %0)
ret void
}
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(struct in6_addr *, struct in6_addr const *, int);
void in6cpy(struct in6_addr *dest, const struct in6_addr *src) {
  memcpy(dest, src, sizeof(struct in6_addr));
}


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

x86 assembly (clang, -O2):
<in6cpy>:
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define void @in6cpy(%struct.in6_addr* %0, %struct.in6_addr* %1) {
%3 = tail call i32 @memcpy(%struct.in6_addr* %0, %struct.in6_addr* %1, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b(int);
void a(int i) { b(i); }


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

x86 assembly (clang, -O2):
<a>:
jmp    1030 <b@plt>

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

LLVM IR (-O2):
define void @a(i32 %0) {
%2 = tail call i32 @b(i32 %0)
ret void
}
float InverseSquareRoot(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759df - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<InverseSquareRoot>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<InverseSquareRoot>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @InverseSquareRoot(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463007, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @InverseSquareRoot(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Variables and functions */
int f20(int *);
int f21(int *p) { return f20(p); }


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

x86 assembly (clang, -O2):
<f21>:
jmp    1030 <f20@plt>

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

LLVM IR (-O2):
define i32 @f21(i32* %0) {
%2 = tail call i32 @f20(i32* %0)
ret i32 %2
}
/* Variables and functions */
int CFC_filter_consecutive_sn_ap();
int CFC_filter_consecutive_sn_client();
int /*<<< orphan*/ puts(char *);
int CFC_filter_consecutive_sn() {
  int nb_packets = 0;
  puts("Cloaking - Consecutive SN filtering");
  nb_packets =
      CFC_filter_consecutive_sn_ap() + CFC_filter_consecutive_sn_client();
  return nb_packets;
}


x86 assembly (clang, -O0):
<CFC_filter_consecutive_sn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <CFC_filter_consecutive_sn_ap@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <CFC_filter_consecutive_sn_client@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CFC_filter_consecutive_sn>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <CFC_filter_consecutive_sn_ap@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <CFC_filter_consecutive_sn_client@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Cloaking - Consecutive SN filtering\00"
define i32 @CFC_filter_consecutive_sn() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @CFC_filter_consecutive_sn_ap()
%4 = call i32 (...) @CFC_filter_consecutive_sn_client()
%5 = add nsw i32 %3, %4
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [36 x i8] c"Cloaking - Consecutive SN filtering\00"
define i32 @CFC_filter_consecutive_sn() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @CFC_filter_consecutive_sn_ap()
%3 = tail call i32 (...) @CFC_filter_consecutive_sn_client()
%4 = add nsw i32 %3, %2
ret i32 %4
}
void INT_Excep_AD3_ADI3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_AD3_ADI3() {
ret void
}
unsigned long bar(void) { return 32768; }


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

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

LLVM IR (-O0):
define i64 @bar() {
ret i64 32768
}

LLVM IR (-O2):
define i64 @bar() {
ret i64 32768
}
long int longint_ignoring_signedshortint(long int x, signed short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @longint_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
int get_bottom_width(int i) {
  if (i < 0)
    return (0);
  if (i == 0)
    return (5);
  return (get_bottom_width(i - 1) + 2 * ((i + 1) / 2 + 2) + (i + 2) * 2);
}


x86 assembly (clang, -O0):
<get_bottom_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <get_bottom_width+0x21>
movl   $0x0,-0x4(%rbp)
jmp    117e <get_bottom_width+0x6e>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <get_bottom_width+0x37>
movl   $0x5,-0x4(%rbp)
jmp    117e <get_bottom_width+0x6e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <get_bottom_width@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    $0x2,%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bottom_width>:
test   %edi,%edi
js     1131 <get_bottom_width+0x21>
je     1134 <get_bottom_width+0x24>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <get_bottom_width@plt>
lea    0x5(%rbx),%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rbx,2),%ecx
add    %ecx,%eax
add    $0x4,%eax
pop    %rbx
ret
xor    %eax,%eax
ret
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @get_bottom_width(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %25
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 5, i32* %2
br label %25
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @get_bottom_width(i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = sdiv i32 %16, 2
%18 = add nsw i32 %17, 2
%19 = mul nsw i32 2, %18
%20 = add nsw i32 %14, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 2
%23 = mul nsw i32 %22, 2
%24 = add nsw i32 %20, %23
store i32 %24, i32* %2
br label %25
25: ; preds = %11, %10, %6
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_bottom_width(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1, %3, %7
%6 = phi i32 [ %15, %7 ], [ 0, %1 ], [ 5, %3 ]
ret i32 %6
7: ; preds = %3
%8 = add nsw i32 %0, -1
%9 = tail call i32 @get_bottom_width(i32 %8)
%10 = add nuw i32 %0, 5
%11 = and i32 %10, -2
%12 = shl nuw i32 %0, 1
%13 = add i32 %12, 4
%14 = add i32 %13, %11
%15 = add i32 %14, %9
br label %5
}
/* Variables and functions */
double fabs(double);
double _sum_abs(double current, double new_value) {
  return current + fabs(new_value);
}


x86 assembly (clang, -O0):
<_sum_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sum_abs>:
andpd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @_sum_abs(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.fabs.f64(double %6)
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @_sum_abs(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %1)
%4 = fadd double %3, %0
ret double %4
}
int x2(int x) { return (x - 1) > x; }


x86 assembly (clang, -O0):
<x2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @x2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @x2(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void edge_passed(const uint8_t **str_ref, size_t *size, size_t i) {
  *str_ref += i;
  *size -= i;
}


x86 assembly (clang, -O0):
<edge_passed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
shl    $0x2,%rcx
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
sub    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<edge_passed>:
lea    0x0(,%rdx,4),%rax
add    %rax,(%rdi)
sub    %rdx,(%rsi)
ret

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

LLVM IR (-O2):
define void @edge_passed(i32** nocapture %0, i64* nocapture %1, i64 %2) {
%4 = load i32*, i32** %0
%5 = getelementptr inbounds i32, i32* %4, i64 %2
store i32* %5, i32** %0
%6 = load i64, i64* %1
%7 = sub i64 %6, %2
store i64 %7, i64* %1
ret void
}
int reverseNum(int num) {
  int n, rev, dig;
  n = num;
  rev = 0;
  while (num > 0) {
    dig = num % 10;
    rev = rev * 10 + dig;
    num = num / 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<reverseNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1149 <reverseNum+0x49>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1114 <reverseNum+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseNum>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <reverseNum+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reverseNum+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverseNum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = urem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %4, 10
%10 = icmp ult i32 %4, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float, float, float);
int /*<<< orphan*/ readpotential();
int /*<<< orphan*/ stdout;
main() {
  float rhohalo();
  float radius, drho, rho0;
  readpotential();
  radius = 1.0;
  rho0 = rhohalo(radius, &drho);
  fprintf(stdout, "%g %g %g\n", radius, rho0, drho);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <readpotential@plt>
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    -0x8(%rbp),%rdi
mov    $0x1,%al
call   1050 <rhohalo@plt>
movss  %xmm0,-0xc(%rbp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
lea    0xe80(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <readpotential@plt>
movsd  0xec0(%rip),%xmm0
lea    0x4(%rsp),%rdi
mov    $0x1,%al
call   1050 <rhohalo@plt>
movaps %xmm0,%xmm1
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
movss  0x4(%rsp),%xmm2
lea    0xea7(%rip),%rsi
movss  0xe9b(%rip),%xmm0
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"%g %g %g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call i32 (...) @readpotential()
store float 1.000000e+00, float* %1
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call float (double, float*, ...) bitcast (float (...)* @rhohalo to float (double, float*, ...)*)(double %6, float* %2)
store float %7, float* %3
%8 = load i32, i32* @stdout
%9 = load float, float* %1
%10 = load float, float* %3
%11 = load float, float* %2
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %9, float %10, float %11)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"%g %g %g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (...) @readpotential()
%4 = call float (double, float*, ...) bitcast (float (...)* @rhohalo to float (double, float*, ...)*)(double 1.000000e+00, float* %1)
%5 = load i32, i32* @stdout
%6 = load float, float* %1
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float 1.000000e+00, float %4, float %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  write(1, "hi\n", sizeof("hi\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xebe(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"hi\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"hi\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Usage:\n");
  printf("\t./UserModeMonitor ./ProgWantToTest\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [37 x i8] c"\09./UserModeMonitor ./ProgWantToTest\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [36 x i8] c"\09./UserModeMonitor ./ProgWantToTest\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xe8() {
  Assert_real((isxdigit(232) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              1165, ("isxdigit should be 0 for 0xe8"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0xe8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe8,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x48d,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x48d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe8\00"
define void @t_isxdigit_0xe8() {
%1 = call i64 @isxdigit(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe8\00"
define void @t_isxdigit_0xe8() {
%1 = tail call i64 @isxdigit(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ cal_angle(unsigned int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(unsigned int, int /*<<< orphan*/);
void backward_soft_right(unsigned int speed, unsigned int angle) {
  motion_direction(0b00000001);
  speed_control(speed, 0);
  cal_angle(angle * 2);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<backward_soft_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <motion_direction@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1060 <speed_control@plt>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
call   1050 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backward_soft_right>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
call   1040 <motion_direction@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <speed_control@plt>
add    %ebx,%ebx
mov    %ebx,%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_delay_us@plt>

LLVM IR (-O0):
define void @backward_soft_right(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 1)
%6 = load i32, i32* %3
%7 = call i32 @speed_control(i32 %6, i32 0)
%8 = load i32, i32* %4
%9 = mul i32 %8, 2
%10 = call i32 @cal_angle(i32 %9)
%11 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @backward_soft_right(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 1)
%4 = tail call i32 @speed_control(i32 %0, i32 0)
%5 = shl i32 %1, 1
%6 = tail call i32 @cal_angle(i32 %5)
%7 = tail call i32 @_delay_us(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xc4() {
  Assert_real((isspace(196) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              985, ("isspace should be 0 for 0xc4"));
}


x86 assembly (clang, -O0):
<t_isspace_0xc4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc4,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3d9,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xc4>:
push   %rax
mov    $0xc4,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc4\00"
define void @t_isspace_0xc4() {
%1 = call i64 @isspace(i32 196)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 985, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc4\00"
define void @t_isspace_0xc4() {
%1 = tail call i64 @isspace(i32 196)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 985, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_rc_property_parse_border() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_property_parse_border() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x02() {
  Assert_real((iscntrl(2)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              15, ("iscntrl should be 1 for 0x02"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x02>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xf,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x02>:
push   %rax
mov    $0x2,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xf,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x02\00"
define void @t_iscntrl_0x02() {
%1 = call i32 @iscntrl(i32 2)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x02\00"
define void @t_iscntrl_0x02() {
%1 = tail call i32 @iscntrl(i32 2)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double _linear_diff(double x) {
  double factor;
  if (x < 0) {
    factor = 1;
    x = -x;
  } else if (x > 0) {
    factor = -1;
  } else {
    factor = 0;
  }
  if (x < 1.0)
    return factor;
  return 0;
}


x86 assembly (clang, -O0):
<_linear_diff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114a <_linear_diff+0x4a>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    117b <_linear_diff+0x7b>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    116e <_linear_diff+0x6e>
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1176 <_linear_diff+0x76>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117b <_linear_diff+0x7b>
movsd  0xe85(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    119d <_linear_diff+0x9d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <_linear_diff+0xa5>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_linear_diff>:
movapd %xmm0,%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
movapd 0xeec(%rip),%xmm3
xorpd  %xmm0,%xmm3
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm1,%xmm0
orpd   %xmm3,%xmm0
movsd  0xee7(%rip),%xmm3
movapd %xmm3,%xmm4
ja     1148 <_linear_diff+0x48>
cmpltsd %xmm1,%xmm2
movsd  0xecc(%rip),%xmm4
andpd  %xmm2,%xmm4
cmpltsd %xmm3,%xmm0
andpd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @_linear_diff(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
store double 1.000000e+00, double* %4
%8 = load double, double* %3
%9 = fneg double %8
store double %9, double* %3
br label %16
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp ogt double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %10
store double -1.000000e+00, double* %4
br label %15
14: ; preds = %10
store double 0.000000e+00, double* %4
br label %15
15: ; preds = %14, %13
br label %16
16: ; preds = %15, %7
%17 = load double, double* %3
%18 = fcmp olt double %17, 1.000000e+00
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load double, double* %4
store double %20, double* %2
br label %22
21: ; preds = %16
store double 0.000000e+00, double* %2
br label %22
22: ; preds = %21, %19
%23 = load double, double* %2
ret double %23
}

LLVM IR (-O2):
define double @_linear_diff(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = fcmp ogt double %0, 0.000000e+00
%5 = select i1 %4, double -1.000000e+00, double 0.000000e+00
%6 = select i1 %2, double %3, double %0
%7 = select i1 %2, double 1.000000e+00, double %5
%8 = fcmp olt double %6, 1.000000e+00
%9 = select i1 %8, double %7, double 0.000000e+00
ret double %9
}