xunge/DecIR huggingface dataset:
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *Requete_Casse_Bloc(int x, int y) {
  char *Requete;
  char *req = calloc(30, sizeof(char));
  sprintf(req, "2,%d,%d", x, y);
  Requete = calloc((strlen(req) + 1), sizeof(char));
  strcpy(Requete, req);
  return Requete;
}


x86 assembly (clang, -O0):
<Requete_Casse_Bloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1e,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe8e(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Requete_Casse_Bloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x1e,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0xe9e(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"2,%d,%d\00"
define i8* @Requete_Casse_Bloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i8* @calloc(i32 30, i32 1)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %13, 1
%15 = call i8* @calloc(i32 %14, i32 1)
store i8* %15, i8** %5
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"2,%d,%d\00"
define i8* @Requete_Casse_Bloc(i32 %0, i32 %1) {
%3 = tail call dereferenceable_or_null(30) i8* @calloc(i32 30, i32 1)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%5 = tail call i32 @strlen(i8* %3)
%6 = add nsw i32 %5, 1
%7 = tail call i8* @calloc(i32 %6, i32 1)
%8 = tail call i32 @strcpy(i8* %7, i8* %3)
ret i8* %7
}
int do_901() { return 901; }


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

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

LLVM IR (-O0):
define i32 @do_901() {
ret i32 901
}

LLVM IR (-O2):
define i32 @do_901() {
ret i32 901
}
int drm_read(struct cdev *kdev, struct uio *uio, int ioflag) { return 0; }


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

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

LLVM IR (-O0):
%struct.cdev = type opaque
%struct.uio = type opaque
define i32 @drm_read(%struct.cdev* %0, %struct.uio* %1, i32 %2) {
%4 = alloca %struct.cdev*
%5 = alloca %struct.uio*
%6 = alloca i32
store %struct.cdev* %0, %struct.cdev** %4
store %struct.uio* %1, %struct.uio** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.cdev = type opaque
%struct.uio = type opaque
define i32 @drm_read(%struct.cdev* nocapture readnone %0, %struct.uio* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int NEXT(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int j;
  printf("%d", (NEXT(j)));
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @NEXT(i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
void eiler_func(mpz_t p, mpz_t q, mpz_t result) {
  mpz_t tmp;
  mpz_init(tmp);
  mpz_sub_ui(result, p, 1);
  mpz_sub_ui(tmp, q, 1);
  mpz_mul(result, result, tmp);
  mpz_clear(tmp);
}


x86 assembly (clang, -O0):
<eiler_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <mpz_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <mpz_mul@plt>
mov    -0x10(%rbp),%edi
call   1060 <mpz_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eiler_func>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <mpz_init@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    %r14d,%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    %ebx,%edi
mov    %ebx,%esi
call   1040 <mpz_mul@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <mpz_clear@plt>

LLVM IR (-O0):
define void @eiler_func(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %7
%9 = call i32 @mpz_init(i32 %8)
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = call i32 @mpz_sub_ui(i32 %10, i32 %11, i32 1)
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = call i32 @mpz_sub_ui(i32 %13, i32 %14, i32 1)
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = call i32 @mpz_mul(i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %7
%21 = call i32 @mpz_clear(i32 %20)
ret void
}

LLVM IR (-O2):
define void @eiler_func(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_init(i32 undef)
%5 = tail call i32 @mpz_sub_ui(i32 %2, i32 %0, i32 1)
%6 = tail call i32 @mpz_sub_ui(i32 undef, i32 %1, i32 1)
%7 = tail call i32 @mpz_mul(i32 %2, i32 %2, i32 undef)
%8 = tail call i32 @mpz_clear(i32 undef)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_37(void) {
  if ((((*(uint32_t *)0xF0000FE0) & 0x000000FF) == 0x6) &&
      (((*(uint32_t *)0xF0000FE4) & 0x0000000F) == 0x0)) {
    if (((*(uint32_t *)0xF0000FE8) & 0x000000F0) == 0x30) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_37>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0000fe0,%eax
mov    (%rax),%eax
and    $0xff,%eax
cmp    $0x6,%eax
jne    1152 <errata_37+0x52>
mov    $0xf0000fe4,%eax
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    1152 <errata_37+0x52>
mov    $0xf0000fe8,%eax
mov    (%rax),%eax
and    $0xf0,%eax
cmp    $0x30,%eax
jne    114d <errata_37+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <errata_37+0x59>
jmp    1152 <errata_37+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_37>:
mov    $0xf0000fe0,%eax
cmpb   $0x6,(%rax)
jne    1122 <errata_37+0x22>
testb  $0xf,0x4(%rax)
jne    1122 <errata_37+0x22>
mov    $0xf0,%ecx
and    0x8(%rax),%ecx
mov    $0x1,%eax
cmp    $0x30,%ecx
je     1124 <errata_37+0x24>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @errata_37() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 4026535904 to i32*)
%3 = and i32 %2, 255
%4 = icmp eq i32 %3, 6
br i1 %4, label %5, label %15
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 4026535908 to i32*)
%7 = and i32 %6, 15
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* inttoptr (i64 4026535912 to i32*)
%11 = and i32 %10, 240
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %1
br label %16
14: ; preds = %9
br label %15
15: ; preds = %14, %5, %0
store i32 0, i32* %1
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @errata_37() {
%1 = load i32, i32* inttoptr (i64 4026535904 to i32*)
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %12
4: ; preds = %0
%5 = load i32, i32* inttoptr (i64 4026535908 to i32*)
%6 = and i32 %5, 15
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* inttoptr (i64 4026535912 to i32*)
%10 = and i32 %9, 240
%11 = icmp eq i32 %10, 48
br i1 %11, label %13, label %12
12: ; preds = %8, %4, %0
br label %13
13: ; preds = %8, %12
%14 = phi i32 [ 0, %12 ], [ 1, %8 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ host_get_clocks_per_second_profiling_timer();
__attribute__((always_)) uint32_t get_clocks_per_second_profiling_timer(void) {
  uint32_t cps;
  cps = host_get_clocks_per_second_profiling_timer();
  return cps;
}


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

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

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

LLVM IR (-O2):
define i32 @get_clocks_per_second_profiling_timer() {
%1 = tail call i32 (...) @host_get_clocks_per_second_profiling_timer()
ret i32 %1
}
void __l2_flush_purge_phys(unsigned long start, int size) {}


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

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

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

LLVM IR (-O2):
define void @__l2_flush_purge_phys(i64 %0, i32 %1) {
ret void
}
void plugin_exit_hddtemp(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_hddtemp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nPrimes(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int n;
  printf("Find primes of first N numbers\n");
  printf("N = ");
  scanf("%d", &n);
  nPrimes(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <nPrimes@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <nPrimes@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Find primes of first N numbers\0A\00"
@.str.1 = [5 x i8] c"N = \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%10 = load i32, i32* %6
%11 = call i32 @nPrimes(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"N = \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [31 x i8] c"Find primes of first N numbers\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @nPrimes(i32 %8)
ret i32 0
}
/* Variables and functions */
int PAPI_write(int, long long *);
void papif_write_(int *EventSet, long long *values, int *check) {
  *check = PAPI_write(*EventSet, values);
}


x86 assembly (clang, -O0):
<papif_write_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <PAPI_write@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @papif_write_(i32* %0, i64* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i32*
store i32* %0, i32** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i64*, i64** %5
%10 = call i32 @PAPI_write(i32 %8, i64* %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @papif_write_(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_write(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ test_power(int /*<<< orphan*/, int, int);
void test_powers_of_x(int64_t x, uint32_t n) {
  uint32_t d;
  for (d = 0; d < 8; d++) {
    test_power(x, n, d);
  }
}


x86 assembly (clang, -O0):
<test_powers_of_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    114b <test_powers_of_x+0x3b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <test_power@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <test_powers_of_x+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_powers_of_x>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edx,%edx
call   1030 <test_power@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <test_power@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x2,%edx
call   1030 <test_power@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <test_power@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x4,%edx
call   1030 <test_power@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x5,%edx
call   1030 <test_power@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x6,%edx
call   1030 <test_power@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x7,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <test_power@plt>

LLVM IR (-O0):
define void @test_powers_of_x(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 = %14, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @test_power(i32 %10, i32 %11, i32 %12)
br label %14
14: ; preds = %9
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @test_powers_of_x(i32 %0, i32 %1) {
%3 = tail call i32 @test_power(i32 %0, i32 %1, i32 0)
%4 = tail call i32 @test_power(i32 %0, i32 %1, i32 1)
%5 = tail call i32 @test_power(i32 %0, i32 %1, i32 2)
%6 = tail call i32 @test_power(i32 %0, i32 %1, i32 3)
%7 = tail call i32 @test_power(i32 %0, i32 %1, i32 4)
%8 = tail call i32 @test_power(i32 %0, i32 %1, i32 5)
%9 = tail call i32 @test_power(i32 %0, i32 %1, i32 6)
%10 = tail call i32 @test_power(i32 %0, i32 %1, i32 7)
ret void
}
void EVP_MD_CTX_create(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @M193Reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tool_search_string(int, char **, char *);
int options_check_min(int argc, char **argv) {
  if (!tool_search_string(argc, argv, "-l")) {
    fprintf(stderr, "Option '-l FILE' is required!\n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<options_check_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdx
call   1030 <tool_search_string@plt>
cmp    $0x0,%eax
jne    116c <options_check_min+0x4c>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <options_check_min+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_check_min>:
push   %rax
lea    0xed8(%rip),%rdx
call   1030 <tool_search_string@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     113a <options_check_min+0x1a>
pop    %rcx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"Option '-l FILE' is required!\0A\00"
define i32 @options_check_min(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @tool_search_string(i32 %6, i8** %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"Option '-l FILE' is required!\0A\00"
define i32 @options_check_min(i32 %0, i8** %1) {
%3 = tail call i32 @tool_search_string(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xa0() {
  Assert_real((isbdigit(160) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              805, ("isbdigit should be 0 for 0xa0"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xa0\00"
define void @t_isbdigit_0xa0() {
%1 = tail call i64 @isbdigit(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char tolower(char);
char *strlwr(char *str) {
  char *c;
  c = str;
  while (*c) {
    *c = tolower(*c);
    c++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ InitialiseSortedIndices(int);
int /*<<< orphan*/ SortedIndicesFromFile(char *);
void InitialActionsIndices(int startIndices, char *indicesPath) {
  if (startIndices <= -1) {
    SortedIndicesFromFile(indicesPath);
  } else {
    InitialiseSortedIndices(startIndices);
  }
}


x86 assembly (clang, -O0):
<InitialActionsIndices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jg     1147 <InitialActionsIndices+0x27>
mov    -0x10(%rbp),%rdi
call   1040 <SortedIndicesFromFile@plt>
jmp    114f <InitialActionsIndices+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <InitialiseSortedIndices@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitialActionsIndices>:
test   %edi,%edi
js     1129 <InitialActionsIndices+0x9>
jmp    1030 <InitialiseSortedIndices@plt>
mov    %rsi,%rdi
jmp    1040 <SortedIndicesFromFile@plt>

LLVM IR (-O0):
define void @InitialActionsIndices(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @SortedIndicesFromFile(i8* %8)
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 @InitialiseSortedIndices(i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @InitialActionsIndices(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @SortedIndicesFromFile(i8* %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @InitialiseSortedIndices(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debut();
int main(int argc, char *argv[]) {
  debut();
  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 <debut@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <debut@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 (...) @debut()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @debut()
ret i32 0
}
/* Type definitions */
struct ptspair {
  int dummy;
};
struct pts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLLIN;
int /*<<< orphan*/ EPOLL_CTL_ADD;
int pts_epoll_ctl(struct ptspair const *, struct pts *, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int register_pts_read(const struct ptspair *ptspair, struct pts *pts) {
  return pts_epoll_ctl(ptspair, pts, EPOLL_CTL_ADD, EPOLLIN);
}


x86 assembly (clang, -O0):
<register_pts_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
call   1030 <pts_epoll_ctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_pts_read>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <pts_epoll_ctl@plt>

LLVM IR (-O0):
%struct.ptspair = type { i32 }
%struct.pts = type { i32 }
@EPOLL_CTL_ADD = global i32 0
@EPOLLIN = global i32 0
define i32 @register_pts_read(%struct.ptspair* %0, %struct.pts* %1) {
%3 = alloca %struct.ptspair*
%4 = alloca %struct.pts*
store %struct.ptspair* %0, %struct.ptspair** %3
store %struct.pts* %1, %struct.pts** %4
%5 = load %struct.ptspair*, %struct.ptspair** %3
%6 = load %struct.pts*, %struct.pts** %4
%7 = load i32, i32* @EPOLL_CTL_ADD
%8 = load i32, i32* @EPOLLIN
%9 = call i32 @pts_epoll_ctl(%struct.ptspair* %5, %struct.pts* %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.ptspair = type { i32 }
%struct.pts = type { i32 }
@EPOLL_CTL_ADD = global i32 0
@EPOLLIN = global i32 0
define i32 @register_pts_read(%struct.ptspair* %0, %struct.pts* %1) {
%3 = load i32, i32* @EPOLL_CTL_ADD
%4 = load i32, i32* @EPOLLIN
%5 = tail call i32 @pts_epoll_ctl(%struct.ptspair* %0, %struct.pts* %1, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(int argc, char **argv) { foo(argc); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dump_mem(void *, int, uintptr_t, int);
void dump_u64(void *buf, int len, uintptr_t addr) {
  dump_mem(buf, len, addr, 8);
}


x86 assembly (clang, -O0):
<dump_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <dump_mem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_u64>:
mov    $0x8,%ecx
jmp    1030 <dump_mem@plt>

LLVM IR (-O0):
define void @dump_u64(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = call i32 @dump_mem(i8* %7, i32 %8, i64 %9, i32 8)
ret void
}

LLVM IR (-O2):
define void @dump_u64(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @dump_mem(i8* %0, i32 %1, i64 %2, i32 8)
ret void
}
/* Variables and functions */
float DotProduct(float *, float *);
float Magnitude(float *);
float acosf(float);
float AngleBetweenVectors(float *arA, float *arB) {
  float fMagA = Magnitude(arA);
  float fMagB = Magnitude(arB);
  float fDot = DotProduct(arA, arB);
  return acosf(fDot / (fMagA * fMagB)) * 57.2957795f;
}


x86 assembly (clang, -O0):
<AngleBetweenVectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Magnitude@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Magnitude@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <DotProduct@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1040 <acosf@plt>
movss  0xe72(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleBetweenVectors>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <Magnitude@plt>
movss  %xmm0,0x4(%rsp)
mov    %r14,%rdi
call   1030 <Magnitude@plt>
movss  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <DotProduct@plt>
movss  (%rsp),%xmm1
mulss  0x4(%rsp),%xmm1
divss  %xmm1,%xmm0
call   1040 <acosf@plt>
mulss  0xe87(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @AngleBetweenVectors(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%8 = load float*, float** %3
%9 = call float @Magnitude(float* %8)
store float %9, float* %5
%10 = load float*, float** %4
%11 = call float @Magnitude(float* %10)
store float %11, float* %6
%12 = load float*, float** %3
%13 = load float*, float** %4
%14 = call float @DotProduct(float* %12, float* %13)
store float %14, float* %7
%15 = load float, float* %7
%16 = load float, float* %5
%17 = load float, float* %6
%18 = fmul float %16, %17
%19 = fdiv float %15, %18
%20 = call float @acosf(float %19)
%21 = fmul float %20, 0x404CA5DC20000000
ret float %21
}

LLVM IR (-O2):
define float @AngleBetweenVectors(float* %0, float* %1) {
%3 = tail call float @Magnitude(float* %0)
%4 = tail call float @Magnitude(float* %1)
%5 = tail call float @DotProduct(float* %0, float* %1)
%6 = fmul float %3, %4
%7 = fdiv float %5, %6
%8 = tail call float @acosf(float %7)
%9 = fmul float %8, 0x404CA5DC20000000
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ ql_writebyte(unsigned long, unsigned char);
void SetMemB(unsigned long address, unsigned char value) {
  ql_writebyte(address, value);
}


x86 assembly (clang, -O0):
<SetMemB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <ql_writebyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetMemB>:
jmp    1030 <ql_writebyte@plt>

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

LLVM IR (-O2):
define void @SetMemB(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @ql_writebyte(i64 %0, i8 zeroext %1)
ret void
}
/* Variables and functions */
size_t _heap_alloc_usable_size(void *);
size_t heap_alloc_usable_size(void *a) { return _heap_alloc_usable_size(a); }


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

x86 assembly (clang, -O2):
<heap_alloc_usable_size>:
jmp    1030 <_heap_alloc_usable_size@plt>

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

LLVM IR (-O2):
define i64 @heap_alloc_usable_size(i8* %0) {
%2 = tail call i64 @_heap_alloc_usable_size(i8* %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ pow(int const, int const);
int base_n_bit(const int base, const int number, const int bit) {
  return (number / (int)pow(base, bit)) % base;
}


x86 assembly (clang, -O0):
<base_n_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_n_bit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebx,%eax
cltd
idiv   %ecx
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @base_n_bit(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = call i64 @pow(i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
%12 = sdiv i32 %7, %11
%13 = load i32, i32* %4
%14 = srem i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @base_n_bit(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @pow(i32 %0, i32 %2)
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %1, %5
%7 = srem i32 %6, %0
ret i32 %7
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void getDbPath(char *path) {
  char *envValue;
  if ((envValue = getenv("BITMETER_DB")) == NULL) {
    strcpy(path, "/var/lib/bitmeter/"
                 "bitmeter.db");
  } else {
    strcpy(path, envValue);
  }
}


x86 assembly (clang, -O0):
<getDbPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115b <getDbPath+0x3b>
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1168 <getDbPath+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDbPath>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1141 <getDbPath+0x21>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"BITMETER_DB\00"
@.str.1 = [30 x i8] c"/var/lib/bitmeter/bitmeter.db\00"
define void @getDbPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %10, i8* %11)
br label %13
13: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"BITMETER_DB\00"
@.str.1 = [30 x i8] c"/var/lib/bitmeter/bitmeter.db\00"
define void @getDbPath(i8* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %0, i8* %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *p) {
  char *s;
  if ((s = malloc(strlen(p) + 1)) != 0)
    strcpy(s, p);
  return (s);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116c <strdup+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
int test_imm_91int8_mem(signed char *val) {
  return ((*val) & (-0x91 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_91int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff6f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_91int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff6f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_91int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -145
%7 = icmp ne i32 %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_91int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -145
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
f2(ptr) int *ptr;
{
  int *locptr;
  locptr = ptr;
  return (*ptr | *locptr);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
or     (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rfc4175_set_line_length(uint8_t *buf, uint16_t length) {
  buf[0] = (length >> 8) & 0xff;
  buf[1] = length & 0xff;
}


x86 assembly (clang, -O0):
<rfc4175_set_line_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_set_line_length>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @rfc4175_set_line_length(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main(void) {
  char *x;
  char y[10] = "coucou";
  printf("sizeof y=%d\n", sizeof(NULL));
  printf("strlen y=%d\n", strlen(NULL));
  x = (char *)malloc(strlen(y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1a(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x756f63756f63,%rax
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
lea    0xeb9(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <strlen@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0x8(%rsp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.y = [10 x i8] c"coucou\00\00\00\00"
@.str = [13 x i8] c"sizeof y=%d\0A\00"
@.str.1 = [13 x i8] c"strlen y=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 8)
%6 = call i32 @strlen(i8* null)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %2
ret i32 0
}

LLVM IR (-O2):
@__const.main.y = [10 x i8] c"coucou\00\00\00\00"
@.str = [13 x i8] c"sizeof y=%d\0A\00"
@.str.1 = [13 x i8] c"strlen y=%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = tail call i32 @strlen(i8* null)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @strlen(i8* %2)
%7 = call i64 @malloc(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__28__IO__makeOutput();
void Msp430GpioC__12__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__28__IO__makeOutput();
}


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

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

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

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