xunge/DecIR huggingface dataset:
/* Variables and functions */
int add_4(int);
int get_number();
int /*<<< orphan*/ print_four();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = get_number();
  int y = add_4(n);
  printf("%i\n", y);
  print_four();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_number@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <add_4@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_four@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_number@plt>
mov    %eax,%edi
call   1060 <add_4@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <print_four@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_number()
%2 = tail call i32 @add_4(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @print_four()
ret i32 0
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *dll_readdir(int /*<<< orphan*/ *);
struct dirent *__wrap_readdir(DIR *dirp) {
  return dll_readdir(dirp);
}


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

x86 assembly (clang, -O2):
<__wrap_readdir>:
jmp    1030 <dll_readdir@plt>

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

LLVM IR (-O2):
%struct.dirent = type { i32 }
define %struct.dirent* @__wrap_readdir(i32* %0) {
%2 = tail call %struct.dirent* @dll_readdir(i32* %0)
ret %struct.dirent* %2
}
/* Variables and functions */
int /*<<< orphan*/ debug_captured();
int main(int argc, const char *argv[]) {
  debug_captured();
  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   1030 <debug_captured@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @debug_captured()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @debug_captured()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int, int /*<<< orphan*/,
                            int);
void jentrng_versionstring(char *buf, size_t buflen) {
  snprintf(buf, buflen, "jitterentropy-rngd %d.%d.%d", 1, 0, 8);
}


x86 assembly (clang, -O0):
<jentrng_versionstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x8,%r9d
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jentrng_versionstring>:
lea    0xee9(%rip),%rdx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x8,%r9d
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c"jitterentropy-rngd %d.%d.%d\00"
define void @jentrng_versionstring(i8* %0, i64 %1) {
%3 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 8)
ret void
}
int test_imm_9Duint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x9D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Duint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x9d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Duint64_highword_reg>:
movabs $0x9d00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Duint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 157
%6 = icmp ne i64 %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_9Duint64_highword_reg(i64 %0) {
%2 = and i64 %0, 674309865472
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  extern void dummy();
  dummy();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void (...) @dummy()
ret i32 0
}
int test_imm_DCint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xDC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DCint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xdc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DCint64_midword_mem>:
testb  $0xdc,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DCint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14417920
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_001(int a, int c, int b, int d) { return a + b + (c & 1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    (%rdi,%rdx,1),%eax
and    $0x1,%esi
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_001(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, %0
%6 = and i32 %1, 1
%7 = add nsw i32 %5, %6
ret i32 %7
}
void option_set_unit2MODIF_EXTENDED() {}


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

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

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

LLVM IR (-O2):
define void @option_set_unit2MODIF_EXTENDED() {
ret void
}
int pr_random(void) {
  static int state = 0;
  return (state = (1366 * state + 150889) % 714025);
}


x86 assembly (clang, -O0):
<pr_random>:
push   %rbp
mov    %rsp,%rbp
imul   $0x556,0x2f16(%rip),%eax
add    $0x24d69,%eax
mov    $0xae529,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,0x2f01(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_random>:
imul   $0x556,0x2f1a(%rip),%eax
add    $0x24d69,%eax
cltq
imul   $0x5dfc9957,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xae529,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x2ef1(%rip)
ret

LLVM IR (-O0):
@pr_random.state = internal global i32 0
define i32 @pr_random() {
%1 = load i32, i32* @pr_random.state
%2 = mul nsw i32 1366, %1
%3 = add nsw i32 %2, 150889
%4 = srem i32 %3, 714025
store i32 %4, i32* @pr_random.state
ret i32 %4
}

LLVM IR (-O2):
@pr_random.state = internal unnamed_addr global i32 0
define i32 @pr_random() {
%1 = load i32, i32* @pr_random.state
%2 = mul nsw i32 %1, 1366
%3 = add nsw i32 %2, 150889
%4 = srem i32 %3, 714025
store i32 %4, i32* @pr_random.state
ret i32 %4
}
int count_digit(unsigned long long n) {
  int i = 0;
  do {
    ++i;
    n /= 10;
  } while (n != 0);
  return i;
}


x86 assembly (clang, -O0):
<count_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    110f <count_digit+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digit>:
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1110 <count_digit+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @count_digit(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = udiv i64 %3, 10
%7 = icmp ult i64 %3, 10
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %5
}
/* Variables and functions */
long long unpacki64(unsigned char *);
extern long long int deserialize_int64(unsigned char *buf) {
  return (unpacki64(buf));
}


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

x86 assembly (clang, -O2):
<deserialize_int64>:
jmp    1030 <unpacki64@plt>

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

LLVM IR (-O2):
define i64 @deserialize_int64(i8* %0) {
%2 = tail call i64 @unpacki64(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
int main(void) {
  struct a {
    double a1;
    int *a2;
  } ai;
  struct b {
    int *b1;
    int b2;
  };
  struct b *bi;
  ai.a1 = 10;
  ai.a2 = NULL;
  bi = (void *)&ai;
  printf("%p %d\n", bi->b1, bi->b2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.a = type { double, i32* }
%struct.b = type { i32*, i32 }
@.str = [7 x i8] c"%p %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.a
%3 = alloca %struct.b*
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.a, %struct.a* %2, i32 0, i32 0
store double 1.000000e+01, double* %4
%5 = getelementptr inbounds %struct.a, %struct.a* %2, i32 0, i32 1
store i32* null, i32** %5
%6 = bitcast %struct.a* %2 to i8*
%7 = bitcast i8* %6 to %struct.b*
store %struct.b* %7, %struct.b** %3
%8 = load %struct.b*, %struct.b** %3
%9 = getelementptr inbounds %struct.b, %struct.b* %8, i32 0, i32 0
%10 = load i32*, i32** %9
%11 = load %struct.b*, %struct.b** %3
%12 = getelementptr inbounds %struct.b, %struct.b* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %10, i32 %13)
ret i32 0
}

LLVM IR (-O2):
%struct.b = type { i32*, i32 }
@.str = [7 x i8] c"%p %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* inttoptr (i64 4621819117588971520 to i32*), i32 0)
ret i32 0
}
/* Variables and functions */
char *trim(char *, char *);
char *trim_space(char *s) { return trim(s, " \r\n\t"); }


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

x86 assembly (clang, -O2):
<trim_space>:
lea    0xee9(%rip),%rsi
jmp    1030 <trim@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" \0D\0A\09\00"
define i8* @trim_space(i8* %0) {
%2 = tail call i8* @trim(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int PARENT(int i) { return i / 2; }


x86 assembly (clang, -O0):
<PARENT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<PARENT>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @PARENT(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *allocateFileLine(size_t size, char *file, int line) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "\nERROR on allocate. File: %s line: %d\n", file, line);
    exit(1);
  } else
    return ptr;
}


x86 assembly (clang, -O0):
<allocateFileLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1181 <allocateFileLine+0x51>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe8e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateFileLine>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1149 <allocateFileLine+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"\0AERROR on allocate. File: %s line: %d\0A\00"
define i8* @allocateFileLine(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %3
%19 = load i8*, i8** %7
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"\0AERROR on allocate. File: %s line: %d\0A\00"
define noalias i8* @allocateFileLine(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *);
char *sonos_location_string(char *ip) {
  char *temp;
  asprintf(&temp, "\r\nLOCATION: http://%s:1400/xml/device_description.xml\r\n",
           ip);
  return temp;
}


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

x86 assembly (clang, -O2):
<sonos_location_string>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"\0D\0ALOCATION: http://%s:1400/xml/device_description.xml\0D\0A\00"
define i8* @sonos_location_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
@.str = [56 x i8] c"\0D\0ALOCATION: http://%s:1400/xml/device_description.xml\0D\0A\00"
define i8* @sonos_location_string(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %2
ret i8* %5
}
char *strcpy(char *dest, const char *src) {
  char *p = dest;
  while ((*dest++ = *src++) != '\0')
    ;
  return p;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGPDFStringRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGPDFStringRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGPDFStringRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR9E_get(void) { return U_WMRCORENONE_get("U_WMR9E"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR9E\00"
define i32 @U_WMR9E_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR9E\00"
define i32 @U_WMR9E_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsmeanwd(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dsmeanwd(N, x, stride);
  printf("mean: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1030 <stdlib_strided_dsmeanwd@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_dsmeanwd@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsmeanwd(i32 %6, float* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsmeanwd(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FE_DIVBYZERO;
int main() { FE_DIVBYZERO; }


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

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

LLVM IR (-O0):
@FE_DIVBYZERO = global i32 0
define i32 @main() {
%1 = load i32, i32* @FE_DIVBYZERO
ret i32 0
}

LLVM IR (-O2):
@FE_DIVBYZERO = global i32 0
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *);
char *my_malloc(size_t len) {
  char *s;
  s = (char *)malloc(sizeof(char) * len);
  if (s == NULL) {
    printf("Out of memory.\n");
    exit(1);
  }
  memset(s, '\0', sizeof(s));
  return s;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1180 <my_malloc+0x40>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1162 <my_malloc+0x22>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 1, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = call i32 @memset(i8* %15, i8 signext 0, i32 8)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@str = [15 x i8] c"Out of memory.\00"
define i8* @my_malloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = tail call i32 @memset(i8* %4, i8 signext 0, i32 8)
ret i8* %4
}
void av_opt_query_ranges() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_query_ranges() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mpga_set_mpeg25(uint8_t *p_mpga) { p_mpga[1] &= ~0x10; }


x86 assembly (clang, -O0):
<mpga_set_mpeg25>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_set_mpeg25>:
andb   $0xef,0x4(%rdi)
ret

LLVM IR (-O0):
define void @mpga_set_mpeg25(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, -17
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mpga_set_mpeg25(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, -17
store i32 %4, i32* %2
ret void
}
int log_2(int n) {
  int c = 1, d = -1;
  while (c <= n) {
    c <<= 1;
    ++d;
  }
  return (d);
}


x86 assembly (clang, -O0):
<log_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <log_2+0x38>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <log_2+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_2>:
test   %edi,%edi
jle    111a <log_2+0x1a>
mov    $0x1,%ecx
mov    $0xffffffff,%eax
xchg   %ax,%ax
add    %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jle    1110 <log_2+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @log_2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = shl i32 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp sgt i32 %6, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
void __set_bit(int nr, volatile unsigned long *addr) {
  __asm__("btsl %1,%0" : "=m"(addr) : "Ir"(nr));
}


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

x86 assembly (clang, -O2):
<__set_bit>:
mov    %rsi,-0x8(%rsp)
bts    %edi,-0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* %1) {
%3 = alloca i64*
store i64* %1, i64** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Base64Encode(char *, char *, int);
int /*<<< orphan*/ printf(char *);
void EncodeBase64(char *str) {
  char buf[255] = "";
  int b = 0;
  Base64Encode(str, buf, 255);
  printf(buf);
  printf("\n");
}


x86 assembly (clang, -O0):
<EncodeBase64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1050 <memset@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0xff,%edx
call   1030 <Base64Encode@plt>
lea    -0x110(%rbp),%rdi
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EncodeBase64>:
push   %rbx
sub    $0x100,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0xef(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0xff,%edx
call   1030 <Base64Encode@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @EncodeBase64(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = bitcast [255 x i8]* %3 to i8*
store i32 0, i32* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @Base64Encode(i8* %6, i8* %7, i32 255)
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @EncodeBase64(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @Base64Encode(i8* %0, i8* %3, i32 255)
%5 = call i32 @printf(i8* %3)
%6 = call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int c, char **v) {
  printf("Hello World!\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)
lea    0xed3(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ klog_deinit();
void core_deinit(void) { klog_deinit(); }


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

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

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

LLVM IR (-O2):
define void @core_deinit() {
%1 = tail call i32 (...) @klog_deinit()
ret void
}
void RTPollSetDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPollSetDestroy() {
ret void
}
/* Variables and functions */
int PAPI_remove_events(int, int *, int);
void papif_remove_events_(int *EventSet, int *Events, int *number, int *check) {
  *check = PAPI_remove_events(*EventSet, Events, *number);
}


x86 assembly (clang, -O0):
<papif_remove_events_>:
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    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <PAPI_remove_events@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_remove_events_>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <PAPI_remove_events@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_remove_events_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call i32 @PAPI_remove_events(i32 %10, i32* %11, i32 %13)
%15 = load i32*, i32** %8
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @papif_remove_events_(i32* nocapture %0, i32* %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call i32 @PAPI_remove_events(i32 %5, i32* %1, i32 %6)
store i32 %7, i32* %3
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int settimeofday(struct timeval *, int /*<<< orphan*/ *);
int sntp_set_time_large(unsigned sec, unsigned msec) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  tv.tv_sec += sec;
  tv.tv_usec += msec;
  return settimeofday(&tv, NULL);
}


x86 assembly (clang, -O0):
<sntp_set_time_large>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <settimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sntp_set_time_large>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
add    %ebp,0xc(%rsp)
add    %ebx,0x8(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <settimeofday@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @sntp_set_time_large(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = load i32, i32* %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%9 = load i32, i32* %8
%10 = add i32 %9, %7
store i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%13 = load i32, i32* %12
%14 = add i32 %13, %11
store i32 %14, i32* %12
%15 = call i32 @settimeofday(%struct.timeval* %5, i32* null)
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @sntp_set_time_large(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%7 = load i32, i32* %6
%8 = add i32 %7, %0
store i32 %8, i32* %6
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add i32 %10, %1
store i32 %11, i32* %9
%12 = call i32 @settimeofday(%struct.timeval* %3, i32* null)
ret i32 %12
}
/* Variables and functions */
int lambda(int);
int lambda2(int body) { return lambda(lambda(body)); }


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

x86 assembly (clang, -O2):
<lambda2>:
push   %rax
call   1030 <lambda@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lambda@plt>

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

LLVM IR (-O2):
define i32 @lambda2(i32 %0) {
%2 = tail call i32 @lambda(i32 %0)
%3 = tail call i32 @lambda(i32 %2)
ret i32 %3
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
double ts_to_double(struct timespec time) {
  return time.tv_sec + time.tv_nsec / 10e9;
}


x86 assembly (clang, -O0):
<ts_to_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_to_double>:
cvtsi2sd %edi,%xmm1
divsd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
define double @ts_to_double(double %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { double, i32 }*
%5 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 1
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+10
%13 = fadd double %8, %12
ret double %13
}

LLVM IR (-O2):
define double @ts_to_double(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %3, 1.000000e+10
%5 = fadd double %4, %0
ret double %5
}
int f() {
  for (union { int j; } i; 0; 0)
    0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
test   $0x1,%al
jne    1113 <f+0x13>
jmp    111d <f+0x1d>
jmp    1118 <f+0x18>
jmp    1104 <f+0x4>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @f() {
%1 = alloca i32
%2 = alloca %union.anon
br label %3
3: ; preds = %5, %0
br i1 false, label %4, label %6
4: ; preds = %3
br label %5
5: ; preds = %4
br label %3
6: ; preds = %3
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
int estrito(int n, int v[]) {
  if (n == 1) {
    return v[0];
  } else {
    int x = estrito(n - 1, v);
    if (v[n - 1] > 0) {
      return x += v[n - 1];
    } else {
      return 0;
    }
  }
}


x86 assembly (clang, -O0):
<estrito>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1137 <estrito+0x27>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <estrito+0x75>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <estrito@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    117e <estrito+0x6e>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1185 <estrito+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrito>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x1,%edi
jne    1121 <estrito+0x11>
mov    (%r14),%eax
jmp    1141 <estrito+0x31>
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <estrito@plt>
mov    %eax,%ecx
movslq %ebx,%rax
mov    -0x4(%r14,%rax,4),%edx
add    %edx,%ecx
xor    %eax,%eax
test   %edx,%edx
cmovg  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @estrito(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
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
store i32 %12, i32* %3
br label %35
13: ; preds = %2
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = load i32*, i32** %5
%17 = call i32 @estrito(i32 %15, i32* %16)
store i32 %17, i32* %6
%18 = load i32*, i32** %5
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %22
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %13
%26 = load i32*, i32** %5
%27 = load i32, i32* %4
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, %31
store i32 %33, i32* %6
store i32 %33, i32* %3
br label %35
34: ; preds = %13
store i32 0, i32* %3
br label %35
35: ; preds = %34, %25, %9
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @estrito(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* %1
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %16, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = tail call i32 @estrito(i32 %9, i32* %1)
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i32, i32* %1, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %13, 0
%15 = add nsw i32 %13, %10
%16 = select i1 %14, i32 %15, i32 0
br label %6
}
int isFillColor(int fill) { return (fill & 4278190080U) != 0; }


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

x86 assembly (clang, -O2):
<isFillColor>:
xor    %eax,%eax
cmp    $0x1000000,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @isFillColor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isFillColor(i32 %0) {
%2 = icmp ugt i32 %0, 16777215
%3 = zext i1 %2 to i32
ret i32 %3
}
__attribute__((no)) short nondet_short() {}


x86 assembly (clang, -O0):
<nondet_short>:
push   %rbp
mov    %rsp,%rbp
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @nondet_short() {
%1 = alloca i16
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define signext i16 @nondet_short() {
ret i16 undef
}
void hostapd_ubus_free_iface(struct hostapd_iface *iface) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @hostapd_ubus_free_iface(%struct.hostapd_iface* nocapture %0) {
ret void
}