xunge/DecIR huggingface dataset:
/* Variables and functions */
long find_array(char *, int, char *, long, long);
long int msdos_check(char *buffer, long int buff_size, long int offset) {
  long int x;
  char label[48] = {0xfb, 0xbe, 0x00, 0x7c, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x02,
                    0xf3, 0xa4, 0xea, 0x21, 0x06, 0x00, 0x00, 0xbe, 0xbe, 0x07,
                    0x38, 0x04, 0x75, 0x0b, 0x83, 0xc6, 0x10, 0x81, 0xfe, 0xfe,
                    0x07, 0x75, 0xf3, 0xeb, 0x16, 0xb4, 0x02, 0xb0, 0x01, 0xbb,
                    0x00, 0x7c, 0xb2, 0x80, 0x8a, 0x74, 0x01, 0x8b};
  x = find_array(label, 48, buffer, buff_size, offset);
  return x;
}


x86 assembly (clang, -O0):
<msdos_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x30,%esi
call   1040 <find_array@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msdos_check>:
sub    $0x38,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
movaps 0xefc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x30,%esi
call   1030 <find_array@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.msdos_check.label = [48 x i8] c"\FB\BE\00|\BF\00\06\B9\00\02\F3\A4\EA!\06\00\00\BE\BE\078\04u\0B\83\C6\10\81\FE\FE\07u\F3\EB\16\B4\02\B0\01\BB\00|\B2\80\8At\01\8B"
define i64 @msdos_check(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca [48 x i8]
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = bitcast [48 x i8]* %8 to i8*
%10 = getelementptr inbounds [48 x i8], [48 x i8]* %8, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = load i64, i64* %6
%14 = call i64 @find_array(i8* %10, i32 48, i8* %11, i64 %12, i64 %13)
store i64 %14, i64* %7
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
@__const.msdos_check.label = [48 x i8] c"\FB\BE\00|\BF\00\06\B9\00\02\F3\A4\EA!\06\00\00\BE\BE\078\04u\0B\83\C6\10\81\FE\FE\07u\F3\EB\16\B4\02\B0\01\BB\00|\B2\80\8At\01\8B"
define i64 @msdos_check(i8* %0, i64 %1, i64 %2) {
%4 = alloca [48 x i8]
%5 = getelementptr inbounds [48 x i8], [48 x i8]* %4, i64 0, i64 0
%6 = call i64 @find_array(i8* %5, i32 48, i8* %0, i64 %1, i64 %2)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char str[] = "This is a test!";
  reverse(str);
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [16 x i8] c"This is a test!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = bitcast [16 x i8]* %2 to i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @reverse(i8* %4)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [16 x i8] c"This is a test!\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @puts(i8* %2)
ret i32 0
}
int RemoveCmd(pcmd, argv)
char **pcmd;
char *argv[];
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @RemoveCmd(i8** nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ t21();
int main(int argc, char *const argv[]) {
  t21();
  printf("completed successfully\n");
  return 0;
}


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    $0x0,%al
call   1040 <t21@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <t21@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"completed successfully\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 (...) @t21()
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"completed successfully\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @t21()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int foo(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", foo(0, 10));
  printf("%d\n", foo(30, 100));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0xa,%esi
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1e,%edi
mov    $0x64,%esi
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
mov    $0xa,%esi
call   1040 <foo@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1e,%edi
mov    $0x64,%esi
call   1040 <foo@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 0, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @foo(i32 30, i32 100)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
unsigned char read_max(int);
int /*<<< orphan*/ write_max(int, int);
unsigned char readdip() {
  write_max(0x4, 0x00);
  return read_max(0x2);
}


x86 assembly (clang, -O0):
<readdip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <write_max@plt>
mov    $0x2,%edi
call   1030 <read_max@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readdip>:
push   %rax
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <write_max@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <read_max@plt>

LLVM IR (-O0):
define zeroext i8 @readdip() {
%1 = call i32 @write_max(i32 4, i32 0)
%2 = call zeroext i8 @read_max(i32 2)
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @readdip() {
%1 = tail call i32 @write_max(i32 4, i32 0)
%2 = tail call zeroext i8 @read_max(i32 2)
ret i8 %2
}
double piemathE() { return 2.7182818284590452354; }


x86 assembly (clang, -O0):
<piemathE>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @piemathE() {
ret double 0x4005BF0A8B145769
}

LLVM IR (-O2):
define double @piemathE() {
ret double 0x4005BF0A8B145769
}
void tgt_reboot() {
  void (*longreach)(void);
  longreach = (void *)0xbfc00000;
  (*longreach)();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<tgt_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xbfc00000,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
jmp    1114 <tgt_reboot+0x14>

x86 assembly (clang, -O2):
<tgt_reboot>:
push   %rax
mov    $0xbfc00000,%eax
call   *%rax
nopl   0x0(%rax,%rax,1)
jmp    1110 <tgt_reboot+0x10>

LLVM IR (-O0):
define void @tgt_reboot() {
%1 = alloca void ()*
store void ()* inttoptr (i64 3217031168 to void ()*), void ()** %1
%2 = load void ()*, void ()** %1
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define void @tgt_reboot() {
tail call void inttoptr (i64 3217031168 to void ()*)()
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char *, int);
int main() {
  char *s = "#include<stdio.h>%cint "
            "main(){char*s=%c%s%c;printf(s,10,34,s,34);return 0;}";
  printf(s, 10, 34, s, 34);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0xa,%esi
mov    $0x22,%r8d
mov    %r8d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [76 x i8] c"#include<stdio.h>%cint main(){char*s=%c%s%c;printf(s,10,34,s,34);return 0;}\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %3, i32 10, i32 34, i8* %4, i32 34)
ret i32 0
}

LLVM IR (-O2):
@.str = [76 x i8] c"#include<stdio.h>%cint main(){char*s=%c%s%c;printf(s,10,34,s,34);return 0;}\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 10, i32 34, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 34)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void saudacaoInicial() { printf("\nSeja bem vindo usuário! "); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"\0ASeja bem vindo usu\C3\A1rio! \00"
define void @saudacaoInicial() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0ASeja bem vindo usu\C3\A1rio! \00"
define void @saudacaoInicial() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *strndup(const char *str, size_t n) {
  char *p;
  if ((p = (char *)malloc(n)) == NULL)
    return (NULL);
  memcpy(p, str, n);
  p[n] = '\0';
  return (p);
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1154 <strndup+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1179 <strndup+0x59>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1150 <strndup+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
jmp    1152 <strndup+0x32>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @malloc(i64 %1)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%8 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %8
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %4, %6 ], [ null, %2 ]
ret i8* %10
}
unsigned long interpret_uint32(unsigned char *buffer) {
  return ((unsigned long)(buffer[0]) << 24) |
         ((unsigned long)(buffer[1]) << 16) |
         ((unsigned long)(buffer[2]) << 8) | (unsigned long)(buffer[3]);
}


x86 assembly (clang, -O0):
<interpret_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpret_uint32>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @interpret_uint32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_BIO_strings();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_load_error_strings();
void init_ssl(void) {
  SSL_load_error_strings();
  ERR_load_BIO_strings();
  OpenSSL_add_all_algorithms();
}


x86 assembly (clang, -O0):
<init_ssl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1050 <ERR_load_BIO_strings@plt>
mov    $0x0,%al
call   1030 <OpenSSL_add_all_algorithms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ssl>:
push   %rax
xor    %eax,%eax
call   1040 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1050 <ERR_load_BIO_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <OpenSSL_add_all_algorithms@plt>

LLVM IR (-O0):
define void @init_ssl() {
%1 = call i32 (...) @SSL_load_error_strings()
%2 = call i32 (...) @ERR_load_BIO_strings()
%3 = call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}

LLVM IR (-O2):
define void @init_ssl() {
%1 = tail call i32 (...) @SSL_load_error_strings()
%2 = tail call i32 (...) @ERR_load_BIO_strings()
%3 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int printit() {
  printf("The program is now over\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<printit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The program is now over\0A\00"
define i32 @printit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"The program is now over\00"
define i32 @printit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t byteorder_bebuftohs(const uint8_t *buf) {
  return (uint16_t)((buf[0] << 8) | (buf[1] << 0));
}


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

x86 assembly (clang, -O2):
<byteorder_bebuftohs>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @byteorder_bebuftohs(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 0
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @byteorder_bebuftohs(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ HwAQ32Handle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HwAQ32RequestUpdate() { UAVObjRequestUpdate(HwAQ32Handle()); }


x86 assembly (clang, -O0):
<HwAQ32RequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HwAQ32Handle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwAQ32RequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <HwAQ32Handle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @HwAQ32RequestUpdate() {
%1 = call i32 (...) @HwAQ32Handle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwAQ32RequestUpdate() {
%1 = tail call i32 (...) @HwAQ32Handle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int main() {
  test1();
  test2();
  test3();
  test4();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1030 <test3@plt>
xor    %eax,%eax
call   1050 <test4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 (...) @test3()
%5 = call i32 (...) @test4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
ret i32 0
}
void iob_destroy() {}


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

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

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

LLVM IR (-O2):
define void @iob_destroy() {
ret void
}
void mus_set_little_endian_short(unsigned char *j, short x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[1];
  j[1] = ox[0];
}


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

x86 assembly (clang, -O2):
<mus_set_little_endian_short>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @mus_set_little_endian_short(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = bitcast i16* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @mus_set_little_endian_short(i8* nocapture writeonly %0, i16 signext %1) {
%3 = trunc i16 %1 to i8
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
store i8 %5, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, unsigned short, char *, unsigned long);
void hex2string(unsigned long val, char *buf, unsigned short len) {
  snprintf(buf, len, "%lX", val);
  buf[len] = '\0';
}


x86 assembly (clang, -O0):
<hex2string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x12(%rbp),%ax
mov    -0x8(%rbp),%rcx
lea    0xec6(%rip),%rdx
movzwl %ax,%esi
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
movzwl -0x12(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2string>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%rcx
lea    0xedd(%rip),%rdx
mov    %rsi,%rdi
mov    %ebx,%esi
call   1030 <snprintf@plt>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lX\00"
define void @hex2string(i64 %0, i8* %1, i16 zeroext %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i16
store i64 %0, i64* %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i8*, i8** %5
%8 = load i16, i16* %6
%9 = load i64, i64* %4
%10 = call i32 @snprintf(i8* %7, i16 zeroext %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %5
%12 = load i16, i16* %6
%13 = zext i16 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lX\00"
define void @hex2string(i64 %0, i8* %1, i16 zeroext %2) {
%4 = tail call i32 @snprintf(i8* %1, i16 zeroext %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = zext i16 %2 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 0, i8* %6
ret void
}
int defined_twice_c(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @defined_twice_c() {
ret i32 1
}
void free(p) char *p;
{}


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

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

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

LLVM IR (-O2):
define void @free(i8* nocapture %0) {
ret void
}
unsigned long hashDjb2(const char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hashDjb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hashDjb2+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashDjb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashDjb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hashDjb2+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashDjb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashDjb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int addr_add(int /*<<< orphan*/ const *, int /*<<< orphan*/, int);
scalar_t__ addr_index_find(int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                           int);
bool nrf_802154_ack_pending_bit_for_addr_set(const uint8_t *p_addr,
                                             bool extended) {
  uint8_t location = 0;
  if (addr_index_find(p_addr, &location, extended)) {
    return true;
  } else {
    return addr_add(p_addr, location, extended);
  }
}


x86 assembly (clang, -O0):
<nrf_802154_ack_pending_bit_for_addr_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   1040 <addr_index_find@plt>
cmp    $0x0,%rax
je     115c <nrf_802154_ack_pending_bit_for_addr_set+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    116e <nrf_802154_ack_pending_bit_for_addr_set+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <addr_add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_802154_ack_pending_bit_for_addr_set>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %ebp,%edx
call   1040 <addr_index_find@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1157 <nrf_802154_ack_pending_bit_for_addr_set+0x37>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1030 <addr_add@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @nrf_802154_ack_pending_bit_for_addr_set(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i64 @addr_index_find(i32* %0, i32* %3, i32 %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @addr_add(i32* %0, i32 %8, i32 %1)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ %9, %7 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int PnameRef();
PviewNameRef() {
  int b = -1;
  ;
  b = PnameRef();
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @PviewNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @PnameRef()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PviewNameRef() {
%1 = tail call i32 (...) @PnameRef()
ret i32 %1
}
void XtGrabKey() {}


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

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

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

LLVM IR (-O2):
define void @XtGrabKey() {
ret void
}
int test_imm_46uint16_reg(unsigned short val) {
  return ((val) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x46,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_46uint16_reg>:
test   $0x46,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_46uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 70
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void get_current_timeval(struct timeval *tv) {
  assert(gettimeofday(tv, NULL) == 0);
}


x86 assembly (clang, -O0):
<get_current_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_timeval>:
push   %rax
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @get_current_timeval(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @get_current_timeval(%struct.timeval* nocapture %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
int cornet_fini() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cornet_fini() {
ret i32 0
}
/* Type definitions */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ UNUSED(struct connection *);
void connection_free(struct connection *c) { UNUSED(c); }


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

x86 assembly (clang, -O2):
<connection_free>:
jmp    1030 <UNUSED@plt>

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

LLVM IR (-O2):
%struct.connection = type { i32 }
define void @connection_free(%struct.connection* %0) {
%2 = tail call i32 @UNUSED(%struct.connection* %0)
ret void
}
/* Variables and functions */
scalar_t__ strchr(char const *, int);
int has_extension(const char *str) {
  int dot = (int)'.';
  if (strchr(str, dot))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<has_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x2e,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1145 <has_extension+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <has_extension+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_extension>:
push   %rax
mov    $0x2e,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @has_extension(i8* %0) {
%2 = tail call i64 @strchr(i8* %0, i32 46)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int add_numbers_c(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<add_numbers_c>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_numbers_c(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_numbers_c(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned long);
int /*<<< orphan*/ tech_free(void *);
void *tech_malloc(unsigned long);
void *tech_realloc(void *ptr, unsigned long size) {
  void *new_ptr;
  new_ptr = tech_malloc(size);
  memcpy(new_ptr, ptr, size);
  tech_free(ptr);
  return new_ptr;
}


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

x86 assembly (clang, -O2):
<tech_realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <tech_malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   1050 <tech_free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @tech_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @tech_malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %3
%13 = call i32 @tech_free(i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @tech_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @tech_malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
%5 = tail call i32 @tech_free(i8* %0)
ret i8* %3
}
void vec3_copy(double *v1, const double *v2) {
  v1[0] = v2[0];
  v1[1] = v2[1];
  v1[2] = v2[2];
}


x86 assembly (clang, -O0):
<vec3_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_copy>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @vec3_copy(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
ret void
}

LLVM IR (-O2):
define void @vec3_copy(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 2
store double %8, double* %9
ret void
}
/* Type definitions */
struct rq_asset_irbond {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_asset_irbond_free(struct rq_asset_irbond *);
void rq_asset_irbond_freefunc(void *asset_data) {
  rq_asset_irbond_free((struct rq_asset_irbond *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_irbond_freefunc>:
jmp    1030 <rq_asset_irbond_free@plt>

LLVM IR (-O0):
%struct.rq_asset_irbond = type { i32 }
define void @rq_asset_irbond_freefunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_asset_irbond*
%5 = call i32 @rq_asset_irbond_free(%struct.rq_asset_irbond* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_asset_irbond = type { i32 }
define void @rq_asset_irbond_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_irbond*
%3 = tail call i32 @rq_asset_irbond_free(%struct.rq_asset_irbond* %2)
ret void
}
int num_digits(int i, int base) {
  int res = 0;
  do {
    i /= base;
    res++;
  } while (i);
  return res;
}


x86 assembly (clang, -O0):
<num_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1111 <num_digits+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_digits>:
mov    %edi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cltd
idiv   %esi
add    $0x1,%ecx
test   %eax,%eax
jne    1110 <num_digits+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @num_digits(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = phi i32 [ 0, %2 ], [ %7, %3 ]
%6 = sdiv i32 %4, %1
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
char *malloc(int);
void set_hostname(char **hostname) {
  *hostname = malloc(sizeof(char) * 100);
  gethostname(*hostname, 100);
}


x86 assembly (clang, -O0):
<set_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x64,%esi
call   1040 <gethostname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_hostname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
mov    $0x64,%esi
pop    %rbx
jmp    1040 <gethostname@plt>

LLVM IR (-O0):
define void @set_hostname(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* @malloc(i32 100)
%4 = load i8**, i8*** %2
store i8* %3, i8** %4
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = call i32 @gethostname(i8* %6, i32 100)
ret void
}

LLVM IR (-O2):
define void @set_hostname(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
store i8* %2, i8** %0
%3 = tail call i32 @gethostname(i8* %2, i32 100)
ret void
}
int hmul(a, b) { return (long)a * b >> 16; }


x86 assembly (clang, -O0):
<hmul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
sar    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmul>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
shr    $0x10,%rax
ret

LLVM IR (-O0):
define i32 @hmul(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 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %6, %8
%10 = ashr i64 %9, 16
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @hmul(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = lshr i64 %5, 16
%7 = trunc i64 %6 to i32
ret i32 %7
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) - 981234615UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] = state[local1] + state[0UL];
      local1++;
    }
    output[0UL] = (state[0UL] - 238420169UL) + 818149947UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x3686696a,%rax
sub    $0x3a7c73b7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1158 <RandomFunc+0x58>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
sub    $0xe3600c9,%rcx
add    $0x30c3fa3b,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
add    %rax,%rax
add    $0x1aa1e4d8,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 914778474
%11 = sub i64 %10, 981234615
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = add i64 %19, %21
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %22, i64* %23
%24 = load i64, i64* %6
%25 = add i64 %24, 1
store i64 %25, i64* %6
br label %13
26: ; preds = %13
%27 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%28 = load i64, i64* %27
%29 = sub i64 %28, 238420169
%30 = add i64 %29, 818149947
%31 = load i64*, i64** %4
%32 = getelementptr inbounds i64, i64* %31, i64 0
store i64 %30, i64* %32
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 446817496
store i64 %5, i64* %1
ret void
}