xunge/DecIR huggingface dataset:
/* Variables and functions */
double drand48();
double default_src(unsigned short *xi) { return (drand48()); }


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

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

LLVM IR (-O0):
define double @default_src(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = call double (...) @drand48()
ret double %3
}

LLVM IR (-O2):
define double @default_src(i16* nocapture readnone %0) {
%2 = tail call double (...) @drand48()
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char *);
scalar_t__ strlen(char *);
char *Abc_UtilStrsav(char *s) {
  return s ? strcpy(malloc(strlen(s) + 1), s) : NULL;
}


x86 assembly (clang, -O0):
<Abc_UtilStrsav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1170 <Abc_UtilStrsav+0x40>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x10(%rbp)
jmp    117b <Abc_UtilStrsav+0x4b>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    117b <Abc_UtilStrsav+0x4b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abc_UtilStrsav>:
test   %rdi,%rdi
je     1152 <Abc_UtilStrsav+0x22>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @Abc_UtilStrsav(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i32 @malloc(i64 %8)
%10 = load i8*, i8** %2
%11 = call i8* @strcpy(i32 %9, i8* %10)
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %5
%14 = phi i8* [ %11, %5 ], [ null, %12 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @Abc_UtilStrsav(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @malloc(i64 %5)
%7 = tail call i8* @strcpy(i32 %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]\n\n    Set "
         "each NAME to VALUE in the environment and run COMMAND.\n\nOptions:\n "
         "   -i, --ignore-environment   start with an empty environment\n    "
         "-u, --unset=NAME           remove variable from the environment\n    "
         "-h, --help\t\tdisplay this help\n    -V, --version\tdisplay version "
         "information\n\nReport bugs to <bulliver@gmail.com>\n",
         "env");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x105e(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [380 x i8] c"Usage: %s [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]\0A\0A Set each NAME to VALUE in the environment and run COMMAND.\0A\0AOptions:\0A -i, --ignore-environment start with an empty environment\0A -u, --unset=NAME remove variable from the environment\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"env\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([380 x i8], [380 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [380 x i8] c"Usage: %s [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]\0A\0A Set each NAME to VALUE in the environment and run COMMAND.\0A\0AOptions:\0A -i, --ignore-environment start with an empty environment\0A -u, --unset=NAME remove variable from the environment\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"env\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([380 x i8], [380 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; ++s)
    hashval = *s + 31 * hashval;
  return hashval % 101;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <hash+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @func1() {
ret void
}
const double deg_to_rad(const double angle) {
  return (double)angle * 3.14159265359 / 180.0;
}


x86 assembly (clang, -O0):
<deg_to_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @deg_to_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442EEA
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @deg_to_rad(double %0) {
%2 = fmul double %0, 0x400921FB54442EEA
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
unsigned dealloc(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    if (argv[i] != NULL)
      free(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<dealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1169 <dealloc+0x59>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <dealloc+0x46>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    115b <dealloc+0x4b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <dealloc+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealloc>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1149 <dealloc+0x39>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
jmp    1139 <dealloc+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1149 <dealloc+0x39>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <dealloc+0x20>
call   1030 <free@plt>
jmp    1130 <dealloc+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @dealloc(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ 0, %4 ], [ %14, %13 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 @free(i8* %9)
br label %13
13: ; preds = %6, %11
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %13, %2
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hammingWeight(uint32_t n) {
  int count = 0;
  while (n > 0) {
    n = n & (n - 1);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<hammingWeight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <hammingWeight+0x34>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <hammingWeight+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingWeight>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <hammingWeight+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <hammingWeight+0x10>
ret

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

LLVM IR (-O2):
define i32 @hammingWeight(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  write(1,
        "Echo!\n"
        "Type '~' to exit\n",
        sizeof("Echo!\n"
               "Type '~' to exit\n") -
            1);
  char c = '\0';
  while (c != '~') {
    c = getchar();
    write(1, &c, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xebe(%rip),%rsi
mov    $0x17,%edx
call   1030 <write@plt>
movb   $0x0,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x7e,%eax
je     117c <main+0x5c>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
mov    $0x1,%edx
lea    -0x11(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rsi
mov    $0x1,%edi
mov    $0x17,%edx
call   1030 <write@plt>
lea    0x7(%rsp),%r14
nop
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    %al,0x7(%rsp)
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x7e,%bl
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Echo!\0AType '~' to exit\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
store i8 0, i8* %6
br label %8
8: ; preds = %12, %2
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 126
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %6
%14 = call i32 @write(i32 1, i8* %6, i32 1)
br label %8
15: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Echo!\0AType '~' to exit\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
br label %5
5: ; preds = %2, %5
%6 = tail call signext i8 (...) @getchar()
store i8 %6, i8* %3
%7 = call i32 @write(i32 1, i8* %3, i32 1)
%8 = icmp eq i8 %6, 126
br i1 %8, label %9, label %5
9: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ prog(int);
void prog10(void) { prog(10); }


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

x86 assembly (clang, -O2):
<prog10>:
mov    $0xa,%edi
jmp    1030 <prog@plt>

LLVM IR (-O0):
define void @prog10() {
%1 = call i32 @prog(i32 10)
ret void
}

LLVM IR (-O2):
define void @prog10() {
%1 = tail call i32 @prog(i32 10)
ret void
}
void mdea_file_output_destroy(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @mdea_file_output_destroy(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct kmod_module_symbol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct kmod_module_symbol *);
void kmod_module_symbol_free(struct kmod_module_symbol *symbol) {
  free(symbol);
}


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

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

LLVM IR (-O0):
%struct.kmod_module_symbol = type { i32 }
define void @kmod_module_symbol_free(%struct.kmod_module_symbol* %0) {
%2 = alloca %struct.kmod_module_symbol*
store %struct.kmod_module_symbol* %0, %struct.kmod_module_symbol** %2
%3 = load %struct.kmod_module_symbol*, %struct.kmod_module_symbol** %2
%4 = call i32 @free(%struct.kmod_module_symbol* %3)
ret void
}

LLVM IR (-O2):
%struct.kmod_module_symbol = type { i32 }
define void @kmod_module_symbol_free(%struct.kmod_module_symbol* nocapture %0) {
%2 = tail call i32 @free(%struct.kmod_module_symbol* %0)
ret void
}
int getLinkStatus(struct ifreq *ifr) {
  int status = 0;
  return status;
}


x86 assembly (clang, -O0):
<getLinkStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ifreq = type opaque
define i32 @getLinkStatus(%struct.ifreq* %0) {
%2 = alloca %struct.ifreq*
%3 = alloca i32
store %struct.ifreq* %0, %struct.ifreq** %2
store i32 0, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.ifreq = type opaque
define i32 @getLinkStatus(%struct.ifreq* nocapture readnone %0) {
ret i32 0
}
int main() {
  printf("test");
  asm(".byte 0x0f, 0x0f, 0, 0x8b");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
(bad)
str    -0x7cb73fcf(%rbx)
(bad)
adc    %bl,-0x3d(%rbp)

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
(bad)
str    -0x3ca63fcf(%rbx)

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
tail call void asm sideeffect ".byte 0x0f, 0x0f, 0, 0x8b", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int teste = 1;
  char x = 1;
  teste = ++x;
  printf("%d", teste);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
unsigned xrop3_174_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = D | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_174_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_174_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %eax
and    %ecx,%eax
lea    0xff(%rax),%ecx
xor    %esi,%ecx
or     %edi,%esi
or     %esi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_174_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = or i32 %8, 255
%10 = xor i32 %9, %5
%11 = or i8 %1, %0
%12 = zext i8 %11 to i32
%13 = or i32 %8, %12
%14 = or i32 %13, %10
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int ASN1_item_digest(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, char *,
                     unsigned char *, unsigned int *);
int /*<<< orphan*/ X509_it;
int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md,
                unsigned int *len) {
  return (ASN1_item_digest(&X509_it, type, (char *)data, md, len));
}


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

x86 assembly (clang, -O2):
<X509_digest>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rdi,%rdx
mov    0x2ec8(%rip),%rdi
jmp    1030 <ASN1_item_digest@plt>

LLVM IR (-O0):
@X509_it = global i32 0
define i32 @X509_digest(i32* %0, i32* %1, i8* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = load i32*, i32** %5
%11 = bitcast i32* %10 to i8*
%12 = load i8*, i8** %7
%13 = load i32*, i32** %8
%14 = call i32 @ASN1_item_digest(i32* @X509_it, i32* %9, i8* %11, i8* %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
@X509_it = global i32 0
define i32 @X509_digest(i32* %0, i32* %1, i8* %2, i32* %3) {
%5 = bitcast i32* %0 to i8*
%6 = tail call i32 @ASN1_item_digest(i32* @X509_it, i32* %1, i8* %5, i8* %2, i32* %3)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int valadr(char *base, uint16_t size) { return (1); }


x86 assembly (clang, -O0):
<valadr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @valadr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @valadr(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
int _strlen(const char *s) {
  int i, count;
  count = 0;
  for (i = 0; s[i] != '\0'; i++) {
    count++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <_strlen+0x42>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <_strlen+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigwait(int /*<<< orphan*/ *, int *);
void *handlerthread(void *in) {
  sigset_t set;
  int sig;
  sigemptyset(&set);
  sigaddset(&set, SIGUSR1);
  while (1) {
    sigwait(&set, &sig);
    printf("We received a SIGUSR1!\n");
  }
  return ((void *)NULL);
}


x86 assembly (clang, -O0):
<handlerthread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1060 <sigaddset@plt>
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <sigwait@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    1167 <handlerthread+0x27>

x86 assembly (clang, -O2):
<handlerthread>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1060 <sigaddset@plt>
lea    0x8(%rsp),%r15
lea    0xe8d(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <sigwait@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1180 <handlerthread+0x40>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@.str = [24 x i8] c"We received a SIGUSR1!\0A\00"
define i8* @handlerthread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @sigaddset(i32* %3, i32 %6)
br label %8
8: ; preds = %1, %8
%9 = call i32 @sigwait(i32* %3, i32* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@str = [23 x i8] c"We received a SIGUSR1!\00"
define noalias i8* @handlerthread(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = load i32, i32* @SIGUSR1
%8 = call i32 @sigaddset(i32* %2, i32 %7)
br label %9
9: ; preds = %9, %1
%10 = call i32 @sigwait(i32* %2, i32* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %9
}
/* Variables and functions */
unsigned strlen(const char *s) {
  unsigned int result = 1;
  while (*s != 0) {
    s++;
    result++;
  }
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ gpio_make_input(int);
int /*<<< orphan*/ gpio_make_output(int, int /*<<< orphan*/);
void mode_init(void) {
  gpio_make_output((26), 0);
  gpio_make_input((21));
  gpio_make_input((20));
}


x86 assembly (clang, -O0):
<mode_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
xor    %esi,%esi
call   1030 <gpio_make_output@plt>
mov    $0x15,%edi
call   1040 <gpio_make_input@plt>
mov    $0x14,%edi
call   1040 <gpio_make_input@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_init>:
push   %rax
mov    $0x1a,%edi
xor    %esi,%esi
call   1030 <gpio_make_output@plt>
mov    $0x15,%edi
call   1040 <gpio_make_input@plt>
mov    $0x14,%edi
pop    %rax
jmp    1040 <gpio_make_input@plt>

LLVM IR (-O0):
define void @mode_init() {
%1 = call i32 @gpio_make_output(i32 26, i32 0)
%2 = call i32 @gpio_make_input(i32 21)
%3 = call i32 @gpio_make_input(i32 20)
ret void
}

LLVM IR (-O2):
define void @mode_init() {
%1 = tail call i32 @gpio_make_output(i32 26, i32 0)
%2 = tail call i32 @gpio_make_input(i32 21)
%3 = tail call i32 @gpio_make_input(i32 20)
ret void
}
float dist2(float x, float y, float z) { return x * x + y * y + z * z; }


x86 assembly (clang, -O0):
<dist2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist2>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @dist2(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = load float, float* %6
%14 = load float, float* %6
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
ret float %15
}

LLVM IR (-O2):
define float @dist2(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
ret float %6
}
compal(mrmcml) int *mrmcml;
{
  char *gridk, *gridl, *igrid;
  char *malloc();
  gridk = malloc(4 * (*mrmcml) + 256);
  gridl = malloc(4 * (*mrmcml) + 256);
  igrid = malloc(*mrmcml + 256);
  comprs(gridk, gridl, igrid);
}


x86 assembly (clang, -O0):
<compal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
shl    $0x2,%edi
add    $0x100,%edi
mov    $0x0,%al
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
shl    $0x2,%edi
add    $0x100,%edi
mov    $0x0,%al
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
add    $0x100,%edi
mov    $0x0,%al
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1030 <comprs@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compal>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%eax
lea    0x100(,%rax,4),%edi
xor    %eax,%eax
call   1040 <malloc@plt>
mov    %rax,%r14
mov    (%rbx),%eax
lea    0x100(,%rax,4),%edi
xor    %eax,%eax
call   1040 <malloc@plt>
mov    %rax,%r15
mov    $0x100,%edi
add    (%rbx),%edi
xor    %eax,%eax
call   1040 <malloc@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <comprs@plt>

LLVM IR (-O0):
define i32 @compal(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = mul nsw i32 4, %8
%10 = add nsw i32 %9, 256
%11 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %10)
store i8* %11, i8** %4
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = mul nsw i32 4, %13
%15 = add nsw i32 %14, 256
%16 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %15)
store i8* %16, i8** %5
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 256
%20 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %19)
store i8* %20, i8** %6
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = load i8*, i8** %6
%24 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @comprs to i32 (i8*, i8*, i8*, ...)*)(i8* %21, i8* %22, i8* %23)
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @compal(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 2
%4 = add nsw i32 %3, 256
%5 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %4)
%6 = load i32, i32* %0
%7 = shl nsw i32 %6, 2
%8 = add nsw i32 %7, 256
%9 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %8)
%10 = load i32, i32* %0
%11 = add nsw i32 %10, 256
%12 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %11)
%13 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @comprs to i32 (i8*, i8*, i8*, ...)*)(i8* %5, i8* %9, i8* %12)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int str2int(char *, char const **);
int main() {
  const char *p = NULL;
  int n = str2int("3423lfdslj", &p);
  printf("%d  %s \n", n, p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <str2int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <str2int@plt>
mov    (%rsp),%rdx
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"3423lfdslj\00"
@.str.1 = [9 x i8] c"%d %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* null, i8** %2
%4 = call i32 @str2int(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"3423lfdslj\00"
@.str.1 = [9 x i8] c"%d %s \0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @str2int(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = load i8*, i8** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3, i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ mainserv_bytesout(scalar_t__);
scalar_t__ tcptowrite(int, int /*<<< orphan*/ const *, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int32_t mainserv_towrite(int sock, const uint8_t *ptr, uint32_t leng,
                         uint32_t timeout) {
  int32_t r;
  r = tcptowrite(sock, ptr, leng, timeout);
  if (r > 0) {
    mainserv_bytesout(r);
  }
  return r;
}


x86 assembly (clang, -O0):
<mainserv_towrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <tcptowrite@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jle    115f <mainserv_towrite+0x3f>
mov    -0x20(%rbp),%rdi
call   1030 <mainserv_bytesout@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainserv_towrite>:
push   %rbx
call   1040 <tcptowrite@plt>
mov    %rax,%rbx
test   %rax,%rax
jle    1136 <mainserv_towrite+0x16>
mov    %rbx,%rdi
call   1030 <mainserv_bytesout@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @mainserv_towrite(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i64 @tcptowrite(i32 %0, i32* %1, i32 %2, i32 %3)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @mainserv_bytesout(i64 %5)
br label %9
9: ; preds = %7, %4
ret i64 %5
}
double heap_keycmp_less(double lhs, double rhs) { return rhs - lhs; }


x86 assembly (clang, -O0):
<heap_keycmp_less>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_keycmp_less>:
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @heap_keycmp_less(double %0, double %1) {
%3 = fsub double %1, %0
ret double %3
}
void g_arith_mult_f(void *s, void *d, void *o) {
  *((float *)o) = *((float *)s) * *((float *)d);
}


x86 assembly (clang, -O0):
<g_arith_mult_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_arith_mult_f>:
movss  (%rdi),%xmm0
mulss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @g_arith_mult_f(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
%13 = fmul float %9, %12
%14 = load i8*, i8** %6
%15 = bitcast i8* %14 to float*
store float %13, float* %15
ret void
}

LLVM IR (-O2):
define void @g_arith_mult_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %0 to float*
%5 = load float, float* %4
%6 = bitcast i8* %1 to float*
%7 = load float, float* %6
%8 = fmul float %5, %7
%9 = bitcast i8* %2 to float*
store float %8, float* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void abrirBloque(FILE *f) { fprintf(f, "{\n"); }


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

x86 assembly (clang, -O2):
<abrirBloque>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
define void @abrirBloque(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char buffer[1024];
  gets(buffer);
  printf(buffer);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ w5100_writeSn_byte(unsigned int, int, unsigned int);
void w5100_writeSnSR(unsigned sock, unsigned data) {
  w5100_writeSn_byte(sock, 0x0003, data);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edx
mov    $0x3,%esi
jmp    1030 <w5100_writeSn_byte@plt>

LLVM IR (-O0):
define void @w5100_writeSnSR(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 @w5100_writeSn_byte(i32 %5, i32 3, i32 %6)
ret void
}

LLVM IR (-O2):
define void @w5100_writeSnSR(i32 %0, i32 %1) {
%3 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 3, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int mctop_getticks();
unsigned long *seed_rand() {
  unsigned long *seeds;
  seeds = (unsigned long *)malloc(64);
  seeds[0] = mctop_getticks();
  seeds[1] = mctop_getticks() & 0x10101010EEF;
  seeds[2] = mctop_getticks() * 0xFAB0BAF0;
  return seeds;
}


x86 assembly (clang, -O0):
<seed_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <mctop_getticks@plt>
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1040 <mctop_getticks@plt>
movslq %eax,%rcx
movabs $0x10101010eef,%rax
and    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    $0x0,%al
call   1040 <mctop_getticks@plt>
imul   $0xfab0baf0,%eax,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_rand>:
push   %rbx
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <mctop_getticks@plt>
cltq
mov    %rax,(%rbx)
xor    %eax,%eax
call   1040 <mctop_getticks@plt>
cltq
movabs $0x10101010eef,%rcx
and    %rax,%rcx
mov    %rcx,0x8(%rbx)
xor    %eax,%eax
call   1040 <mctop_getticks@plt>
imul   $0xfab0baf0,%eax,%eax
mov    %rax,0x10(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64* @seed_rand() {
%1 = alloca i64*
%2 = call i64 @malloc(i32 64)
%3 = inttoptr i64 %2 to i64*
store i64* %3, i64** %1
%4 = call i32 (...) @mctop_getticks()
%5 = sext i32 %4 to i64
%6 = load i64*, i64** %1
%7 = getelementptr inbounds i64, i64* %6, i64 0
store i64 %5, i64* %7
%8 = call i32 (...) @mctop_getticks()
%9 = sext i32 %8 to i64
%10 = and i64 %9, 1103823441647
%11 = load i64*, i64** %1
%12 = getelementptr inbounds i64, i64* %11, i64 1
store i64 %10, i64* %12
%13 = call i32 (...) @mctop_getticks()
%14 = mul i32 %13, -89081104
%15 = zext i32 %14 to i64
%16 = load i64*, i64** %1
%17 = getelementptr inbounds i64, i64* %16, i64 2
store i64 %15, i64* %17
%18 = load i64*, i64** %1
ret i64* %18
}

LLVM IR (-O2):
define i64* @seed_rand() {
%1 = tail call i64 @malloc(i32 64)
%2 = inttoptr i64 %1 to i64*
%3 = tail call i32 (...) @mctop_getticks()
%4 = sext i32 %3 to i64
store i64 %4, i64* %2
%5 = tail call i32 (...) @mctop_getticks()
%6 = sext i32 %5 to i64
%7 = and i64 %6, 1103823441647
%8 = getelementptr inbounds i64, i64* %2, i64 1
store i64 %7, i64* %8
%9 = tail call i32 (...) @mctop_getticks()
%10 = mul i32 %9, -89081104
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %2, i64 2
store i64 %11, i64* %12
ret i64* %2
}
const int g() { return 3; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 3
}

LLVM IR (-O2):
define i32 @g() {
ret i32 3
}