xunge/DecIR huggingface dataset:
int compare(int *p, int *q) { return *p - *q; }


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

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

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

LLVM IR (-O2):
define i32 @compare(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
void *set_exception_table_vec(unsigned int, void *);
void *set_exception_table_evt(unsigned int evt, void *handler) {
  return set_exception_table_vec(evt >> 5, handler);
}


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

x86 assembly (clang, -O2):
<set_exception_table_evt>:
shr    $0x5,%edi
jmp    1030 <set_exception_table_vec@plt>

LLVM IR (-O0):
define i8* @set_exception_table_evt(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 = lshr i32 %5, 5
%7 = load i8*, i8** %4
%8 = call i8* @set_exception_table_vec(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @set_exception_table_evt(i32 %0, i8* %1) {
%3 = lshr i32 %0, 5
%4 = tail call i8* @set_exception_table_vec(i32 %3, i8* %1)
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ count;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmapping_count(void *_p) {
  return (int)((XEvent *)_p)->xmapping.count;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmapping_count(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xmapping_count(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ move();
void n_ptlead(void) { move(); }


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

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

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

LLVM IR (-O2):
define void @n_ptlead() {
%1 = tail call i32 (...) @move()
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int);
int _random_int_range(int _min, int _max, int _seed) {
  int res = 0;
  srand(_seed);
  res = rand() % _max + _min;
  return res;
}


x86 assembly (clang, -O0):
<_random_int_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x8(%rbp)
add    -0x4(%rbp),%edx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_random_int_range(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
store i32 0, i32* %7
%8 = load i32, i32* %6
%9 = call i32 @srand(i32 %8)
%10 = call i32 (...) @rand()
%11 = load i32, i32* %5
%12 = srem i32 %10, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @_random_int_range(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @srand(i32 %2)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %1
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t u64_b3(uint64_t value) {
  return (uint8_t)((value & 0x00000000FF000000) >> 24);
}


x86 assembly (clang, -O0):
<u64_b3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u64_b3>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @u64_b3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
ret i32 %5
}

LLVM IR (-O2):
define i32 @u64_b3(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
void do_readmsgfrom(char *user) {}


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

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

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

LLVM IR (-O2):
define void @do_readmsgfrom(i8* nocapture %0) {
ret void
}
unsigned getval_311() { return 3674788233U; }


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

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

LLVM IR (-O0):
define i32 @getval_311() {
ret i32 -620179063
}

LLVM IR (-O2):
define i32 @getval_311() {
ret i32 -620179063
}
/* Variables and functions */
int /*<<< orphan*/ foo4(int, int, int, long double);
void foo3(int a0, long double a1) { foo4(1, 2, a0, a1); }


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
fstpt  -0x20(%rbp)
mov    -0x4(%rbp),%edx
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <foo4@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
mov    %edi,%edx
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <foo4@plt>

LLVM IR (-O0):
define void @foo3(i32 %0, x86_fp80 %1) {
%3 = alloca i32
%4 = alloca x86_fp80
store i32 %0, i32* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i32, i32* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i32 @foo4(i32 1, i32 2, i32 %5, x86_fp80 %6)
ret void
}

LLVM IR (-O2):
define void @foo3(i32 %0, x86_fp80 %1) {
%3 = tail call i32 @foo4(i32 1, i32 2, i32 %0, x86_fp80 %1)
ret void
}
/* Variables and functions */
int send(int, char const *, int, int /*<<< orphan*/);
int socket_send(int sock, const char *buff, int buff_len) {
  int rv = send(sock, buff, buff_len, 0);
  return rv;
}


x86 assembly (clang, -O0):
<socket_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_send>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @socket_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cr(struct terminal *);
int /*<<< orphan*/ nl(struct terminal *);
void crnl(struct terminal *term) {
  cr(term);
  nl(term);
}


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

x86 assembly (clang, -O2):
<crnl>:
push   %rbx
mov    %rdi,%rbx
call   1040 <cr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @crnl(%struct.terminal* %0) {
%2 = alloca %struct.terminal*
store %struct.terminal* %0, %struct.terminal** %2
%3 = load %struct.terminal*, %struct.terminal** %2
%4 = call i32 @cr(%struct.terminal* %3)
%5 = load %struct.terminal*, %struct.terminal** %2
%6 = call i32 @nl(%struct.terminal* %5)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @crnl(%struct.terminal* %0) {
%2 = tail call i32 @cr(%struct.terminal* %0)
%3 = tail call i32 @nl(%struct.terminal* %0)
ret void
}
/* Variables and functions */
scalar_t__ nativeInvert(int);
int main() {
  if (nativeInvert(false)) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <nativeInvert@plt>
cmp    $0x0,%rax
je     113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <main+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <nativeInvert@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @nativeInvert(i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @nativeInvert(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned int _ht_hash_int(void *, int *);
unsigned int _ht_hash_ptr(void *ht, void *d) {
  union {
    int i;
    void *p;
  } u;
  u.p = d;
  return _ht_hash_int(ht, &u.i);
}


x86 assembly (clang, -O0):
<_ht_hash_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <_ht_hash_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ht_hash_ptr>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <_ht_hash_int@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i8* }
define i32 @_ht_hash_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %union.anon
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast %union.anon* %5 to i8**
store i8* %6, i8** %7
%8 = load i8*, i8** %3
%9 = bitcast %union.anon* %5 to i32*
%10 = call i32 @_ht_hash_int(i8* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%union.anon = type { i8* }
define i32 @_ht_hash_ptr(i8* %0, i8* %1) {
%3 = alloca %union.anon
%4 = bitcast %union.anon* %3 to i8*
%5 = getelementptr inbounds %union.anon, %union.anon* %3, i64 0, i32 0
store i8* %1, i8** %5
%6 = bitcast %union.anon* %3 to i32*
%7 = call i32 @_ht_hash_int(i8* %0, i32* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char **argv) {
  printf("usage: %s <application> {start,restart,stop,deploy,worker,status}\n",
         argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"usage: %s <application> {start,restart,stop,deploy,worker,status}\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [67 x i8] c"usage: %s <application> {start,restart,stop,deploy,worker,status}\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float radius = 10;
  float volume = 4.00f / 3.00f * 3.14f * (radius * radius * radius);
  printf("Sphere volume: %.2f\n", volume);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xebd(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Sphere volume: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 1.000000e+01, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = fmul float 0x4010BF25A0000000, %8
store float %9, float* %3
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Sphere volume: %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float 0x40B05AAAC0000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void poke32(uint32_t *address, uint32_t value) { (*address) = value; }


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

x86 assembly (clang, -O2):
<poke32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @poke32(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 = load i32*, i32** %3
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @poke32(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
scalar_t__ recv(int, void *, size_t, int /*<<< orphan*/);
void receivestuff(int conn, void *stuff, size_t size) {
  if (recv(conn, stuff, size, 0) < 0) {
    puts("Communication Error");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<receivestuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x0,%rax
jge    1175 <receivestuff+0x45>
lea    0xe9a(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receivestuff>:
push   %rax
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
js     113f <receivestuff+0xf>
pop    %rax
ret
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Communication Error\00"
define void @receivestuff(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @recv(i32 %7, i8* %8, i64 %9, i32 0)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Communication Error\00"
define void @receivestuff(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @recv(i32 %0, i8* %1, i64 %2, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %3
ret void
}
/* Type definitions */
typedef float uint32_t;

/* Variables and functions */
float fasterlog(float x) {
  union {
    float f;
    uint32_t i;
  } vx = {x};
  float y = vx.i;
  y *= 8.2629582881927490e-8f;
  return y - 87.989971088f;
}


x86 assembly (clang, -O0):
<fasterlog>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xedf(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xec4(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterlog>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @fasterlog(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca float
store float %0, float* %2
%5 = bitcast %union.anon* %3 to float*
%6 = load float, float* %2
store float %6, float* %5
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
store float %8, float* %4
%9 = load float, float* %4
%10 = fmul float %9, 0x3E762E4300000000
store float %10, float* %4
%11 = load float, float* %4
%12 = fsub float %11, 0x4055FF5BA0000000
ret float %12
}

LLVM IR (-O2):
define float @fasterlog(float %0) {
%2 = fmul float %0, 0x3E762E4300000000
%3 = fadd float %2, 0xC055FF5BA0000000
ret float %3
}
const char *db_get_entity_name_from_id_sql(void) {
  static const char *query = "SELECT name FROM entities"
                             "  WHERE id = %s";
  return query;
}


x86 assembly (clang, -O0):
<db_get_entity_name_from_id_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_get_entity_name_from_id_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_get_entity_name_from_id_sql.query = internal global i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i32 0, i32 0)
@.str = [41 x i8] c"SELECT name FROM entities WHERE id = %s\00"
define i8* @db_get_entity_name_from_id_sql() {
%1 = load i8*, i8** @db_get_entity_name_from_id_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [41 x i8] c"SELECT name FROM entities WHERE id = %s\00"
define i8* @db_get_entity_name_from_id_sql() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
int sumsq(unsigned long long int n) {
  int m = 0, rem = 0;
  while (n != 0) {
    rem = n % 10;
    m += (rem * rem);
    n = n / 10;
  }
  return m;
}


x86 assembly (clang, -O0):
<sumsq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <sumsq+0x58>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    1116 <sumsq+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumsq>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1142 <sumsq+0x42>
movabs $0xcccccccccccccccd,%r8
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edi,%esi
sub    %eax,%esi
imul   %esi,%esi
add    %esi,%ecx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <sumsq+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sumsq(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i64 [ %10, %3 ], [ %0, %1 ]
%6 = urem i64 %5, 10
%7 = trunc i64 %6 to i32
%8 = mul nuw nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %4
%10 = udiv i64 %5, 10
%11 = icmp ult i64 %5, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello, World\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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() {
%1 = 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() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int __unordsf2(float a __attribute__((unused)),
               float b __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<__unordsf2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__unordsf2(float %0, float %1) {
ret i32 0
}
/* Variables and functions */
int *leak_pointer();
int /*<<< orphan*/ puts(char *);
scalar_t__ test_lt(int *, int *);
int lt_after_stack_free() {
  int *x = leak_pointer();
  int *y = leak_pointer();
  if (test_lt(x, y)) {
    puts("LT!");
  }
  return 1;
}


x86 assembly (clang, -O0):
<lt_after_stack_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <leak_pointer@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <leak_pointer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <test_lt@plt>
cmp    $0x0,%rax
je     1171 <lt_after_stack_free+0x41>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_after_stack_free>:
push   %rbx
xor    %eax,%eax
call   1050 <leak_pointer@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <leak_pointer@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <test_lt@plt>
test   %rax,%rax
je     115e <lt_after_stack_free+0x2e>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"LT!\00"
define i32 @lt_after_stack_free() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @leak_pointer()
store i32* %3, i32** %1
%4 = call i32* (...) @leak_pointer()
store i32* %4, i32** %2
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = call i64 @test_lt(i32* %5, i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"LT!\00"
define i32 @lt_after_stack_free() {
%1 = tail call i32* (...) @leak_pointer()
%2 = tail call i32* (...) @leak_pointer()
%3 = tail call i64 @test_lt(i32* %1, i32* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 1
}
int make_sum(int a, int b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @make_sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @make_sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_64(void) {
  { a_0_55(((((30)))), "identifier?"); }
}


x86 assembly (clang, -O0):
<a_0_64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_64>:
lea    0xee9(%rip),%rsi
mov    $0x1e,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"identifier?\00"
define void @a_0_64() {
%1 = call i32 @a_0_55(i32 30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"identifier?\00"
define void @a_0_64() {
%1 = tail call i32 @a_0_55(i32 30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned short LDT3(int idx) { return (idx << 3) | 7; }


x86 assembly (clang, -O0):
<LDT3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
or     $0x7,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LDT3>:
lea    0x7(,%rdi,8),%eax
ret

LLVM IR (-O0):
define zeroext i16 @LDT3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
%5 = or i32 %4, 7
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @LDT3(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = shl i16 %2, 3
%4 = or i16 %3, 7
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
void border_set_mask(volatile uint32_t reg, uint32_t mask) {
  *(&reg) |= mask;
  *(&reg) |= mask;
}


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

x86 assembly (clang, -O2):
<border_set_mask>:
mov    %edi,-0x4(%rsp)
mov    %esi,-0x8(%rsp)
mov    -0x8(%rsp),%eax
or     %eax,-0x4(%rsp)
mov    -0x8(%rsp),%eax
or     %eax,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @border_set_mask(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store volatile i32 %0, i32* %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = load volatile i32, i32* %3
%7 = or i32 %6, %5
store volatile i32 %7, i32* %3
%8 = load volatile i32, i32* %4
%9 = load volatile i32, i32* %3
%10 = or i32 %9, %8
store volatile i32 %10, i32* %3
ret void
}
int test_imm_32uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x32 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_32uint64_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, 50
%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_32uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 214748364800
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Prexit(char *, int);
void *realloc(void *, int);
void Reallocp(void *pp, int b) {
  void *p;
  if (!(p = realloc((*(void **)pp), b)))
    Prexit("%d", b);
  (*(void **)pp) = p;
}


x86 assembly (clang, -O0):
<Reallocp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115b <Reallocp+0x3b>
mov    -0xc(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <Prexit@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reallocp>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <realloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1149 <Reallocp+0x29>
lea    0xebf(%rip),%rdi
mov    %r14d,%esi
call   1030 <Prexit@plt>
mov    %rbp,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @Reallocp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = load i32, i32* %4
%10 = call i8* @realloc(i8* %8, i32 %9)
store i8* %10, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @Prexit(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %2
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = bitcast i8* %17 to i8**
store i8* %16, i8** %18
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @Reallocp(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = tail call i8* @realloc(i8* %4, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @Prexit(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %9
9: ; preds = %7, %2
store i8* %5, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void pseudo_fermat(int pf_prod_pot2, int pf_primo) {
  int pf_resultado;
  pf_resultado = (pf_prod_pot2 - 2) / pf_primo;
  if ((pf_prod_pot2 - 2) % pf_primo == 0) {
    printf("\nSe encontro un n° de fermat: %d\n(Se hizo 2^%d)\n", pf_resultado,
           pf_primo);
  }
}


x86 assembly (clang, -O0):
<pseudo_fermat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1150 <pseudo_fermat+0x40>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pseudo_fermat>:
lea    -0x2(%rdi),%eax
cltd
idiv   %esi
test   %edx,%edx
je     111b <pseudo_fermat+0xb>
ret
mov    %esi,%ecx
lea    0xedc(%rip),%rdi
mov    %eax,%esi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"\0ASe encontro un n\C2\B0 de fermat: %d\0A(Se hizo 2^%d)\0A\00"
define void @pseudo_fermat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 2
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 2
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
br label %19
19: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"\0ASe encontro un n\C2\B0 de fermat: %d\0A(Se hizo 2^%d)\0A\00"
define void @pseudo_fermat(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -2
%4 = srem i32 %3, %1
%5 = sdiv i32 %3, %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1)
br label %9
9: ; preds = %7, %2
ret void
}
long dt_hms_to_time(long h, long m, long s) { return ((h * 60) + m) * 60 + s; }


x86 assembly (clang, -O0):
<dt_hms_to_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
imul   $0x3c,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
imul   $0x3c,%rax,%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_hms_to_time>:
imul   $0x3c,%rdi,%rax
add    %rsi,%rax
imul   $0x3c,%rax,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @dt_hms_to_time(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = mul nsw i64 %7, 60
%9 = load i64, i64* %5
%10 = add nsw i64 %8, %9
%11 = mul nsw i64 %10, 60
%12 = load i64, i64* %6
%13 = add nsw i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @dt_hms_to_time(i64 %0, i64 %1, i64 %2) {
%4 = mul nsw i64 %0, 60
%5 = add nsw i64 %4, %1
%6 = mul nsw i64 %5, 60
%7 = add nsw i64 %6, %2
ret i64 %7
}
int ft_eleisval(char fs[], char c) {
  if (c != fs[0] && c != fs[1])
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<ft_eleisval>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1141 <ft_eleisval+0x41>
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
je     1141 <ft_eleisval+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1148 <ft_eleisval+0x48>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_eleisval>:
cmp    %sil,(%rdi)
je     110d <ft_eleisval+0xd>
xor    %eax,%eax
cmp    %sil,0x1(%rdi)
jne    1112 <ft_eleisval+0x12>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_eleisval(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %1
br i1 %8, label %9, label %10
9: ; preds = %5, %2
br label %10
10: ; preds = %5, %9
%11 = phi i32 [ 1, %9 ], [ 0, %5 ]
ret i32 %11
}
void EC_POINT_get_Jprojective_coordinates_GFp(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_get_Jprojective_coordinates_GFp() {
ret void
}
/* Variables and functions */
long getFactorPrimo(long);
int /*<<< orphan*/ printf(char *, long);
void factorizacionPrimo(long n) {
  n = getFactorPrimo(n);
  if (n > 1)
    printf("%ld\n", n);
}


x86 assembly (clang, -O0):
<factorizacionPrimo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getFactorPrimo@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jle    1154 <factorizacionPrimo+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorizacionPrimo>:
push   %rax
call   1040 <getFactorPrimo@plt>
cmp    $0x2,%rax
jl     113c <factorizacionPrimo+0x1c>
lea    0xecd(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define void @factorizacionPrimo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @getFactorPrimo(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define void @factorizacionPrimo(i64 %0) {
%2 = tail call i64 @getFactorPrimo(i64 %0)
%3 = icmp sgt i64 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %6
6: ; preds = %4, %1
ret void
}
int test_imm_4Auint16_mem(unsigned short *val) {
  return ((*val) & (-0x4A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Auint16_mem>:
movzwl (%rdi),%eax
test   $0xffb6,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Auint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -74
%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_4Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -74
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_setcanceltype(int a, int *b) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_setcanceltype>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_setcanceltype(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ cliente();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ printf(char *);
void criar_novo_consumidor() {
  int numero_novo_processo;
  numero_novo_processo = fork();
  if (numero_novo_processo == -1) {
    printf("Erro na criacao do processo consumidor\n");
  } else {
    cliente();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<criar_novo_consumidor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    116d <criar_novo_consumidor+0x2d>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <criar_novo_consumidor+0x3b>
mov    $0x0,%al
call   1040 <cliente@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<criar_novo_consumidor>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
cmp    $0xffffffff,%eax
jne    115a <criar_novo_consumidor+0x1a>
lea    0xeac(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
xor    %eax,%eax
call   1040 <cliente@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Erro na criacao do processo consumidor\0A\00"
define void @criar_novo_consumidor() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = call i32 (...) @cliente()
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Erro na criacao do processo consumidor\00"
define void @criar_novo_consumidor() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
5: ; preds = %0
%6 = tail call i32 (...) @cliente()
%7 = tail call i32 @exit(i32 0)
unreachable
}
int trailingZeroes(int n) {
  if (n < 5)
    return 0;
  int c;
  c = 0;
  while (n > 0) {
    n /= 5;
    c += n;
  }
  return c;
}


x86 assembly (clang, -O0):
<trailingZeroes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    111d <trailingZeroes+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1150 <trailingZeroes+0x50>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114a <trailingZeroes+0x4a>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <trailingZeroes+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailingZeroes>:
xor    %eax,%eax
cmp    $0x5,%edi
jl     1123 <trailingZeroes+0x23>
xor    %eax,%eax
mov    $0xcccccccd,%ecx
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x22,%rdx
add    %edx,%eax
cmp    $0x4,%edi
mov    %edx,%edi
ja     1110 <trailingZeroes+0x10>
ret

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

LLVM IR (-O2):
define i32 @trailingZeroes(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 5
%7 = add nuw nsw i32 %4, %6
%8 = icmp ult i32 %5, 5
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ stderr;
FILE *epopen(char *com, char *mode) {
  FILE *fp;
  if ((fp = popen(com, mode)) != NULL)
    return fp;
  fprintf(stderr, "couldn't open stream %s mode %s\n", com, mode);
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<epopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1165 <epopen+0x35>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<epopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <popen@plt>
test   %rax,%rax
je     114c <epopen+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"couldn't open stream %s mode %s\0A\00"
define i32* @epopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @popen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** %5
ret i32* %11
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"couldn't open stream %s mode %s\0A\00"
define noalias i32* @epopen(i8* %0, i8* %1) {
%3 = tail call i32* @popen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i32* %3
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
}