xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int main(int argc, char *argv[]) {
  char *pointer = 0;
  pointer = malloc(64);
  do {
    char *pointer2 = 0;
    pointer2 = malloc(32);
  } while (0);
  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)
movq   $0x0,-0x18(%rbp)
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%8 = call i8* @malloc(i32 64)
store i8* %8, i8** %6
br label %9
9: ; preds = %2
store i8* null, i8** %7
%10 = call i8* @malloc(i32 32)
store i8* %10, i8** %7
br label %11
11: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct pico_queue {
  int dummy;
};
struct pico_frame {
  int dummy;
};

/* Variables and functions */
struct pico_frame *pico_dequeue(struct pico_queue *);
int /*<<< orphan*/ pico_frame_discard(struct pico_frame *);
void pico_queue_empty(struct pico_queue *q) {
  struct pico_frame *p = pico_dequeue(q);
  while (p) {
    pico_frame_discard(p);
    p = pico_dequeue(q);
  }
}


x86 assembly (clang, -O0):
<pico_queue_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pico_dequeue@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115f <pico_queue_empty+0x3f>
mov    -0x10(%rbp),%rdi
call   1040 <pico_frame_discard@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pico_dequeue@plt>
mov    %rax,-0x10(%rbp)
jmp    1139 <pico_queue_empty+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pico_queue_empty>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <pico_dequeue@plt>
test   %rax,%rax
je     1147 <pico_queue_empty+0x27>
mov    %rax,%rdi
call   1040 <pico_frame_discard@plt>
mov    %rbx,%rdi
jmp    1130 <pico_queue_empty+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.pico_queue = type { i32 }
%struct.pico_frame = type { i32 }
define void @pico_queue_empty(%struct.pico_queue* %0) {
%2 = alloca %struct.pico_queue*
%3 = alloca %struct.pico_frame*
store %struct.pico_queue* %0, %struct.pico_queue** %2
%4 = load %struct.pico_queue*, %struct.pico_queue** %2
%5 = call %struct.pico_frame* @pico_dequeue(%struct.pico_queue* %4)
store %struct.pico_frame* %5, %struct.pico_frame** %3
br label %6
6: ; preds = %9, %1
%7 = load %struct.pico_frame*, %struct.pico_frame** %3
%8 = icmp ne %struct.pico_frame* %7, null
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load %struct.pico_frame*, %struct.pico_frame** %3
%11 = call i32 @pico_frame_discard(%struct.pico_frame* %10)
%12 = load %struct.pico_queue*, %struct.pico_queue** %2
%13 = call %struct.pico_frame* @pico_dequeue(%struct.pico_queue* %12)
store %struct.pico_frame* %13, %struct.pico_frame** %3
br label %6
14: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.pico_queue = type { i32 }
%struct.pico_frame = type { i32 }
define void @pico_queue_empty(%struct.pico_queue* %0) {
%2 = tail call %struct.pico_frame* @pico_dequeue(%struct.pico_queue* %0)
%3 = icmp eq %struct.pico_frame* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi %struct.pico_frame* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @pico_frame_discard(%struct.pico_frame* %5)
%7 = tail call %struct.pico_frame* @pico_dequeue(%struct.pico_queue* %0)
%8 = icmp eq %struct.pico_frame* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
int mov_func(int src, int dest, int is_word) {
  (void)dest;
  (void)is_word;
  return src;
}


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

x86 assembly (clang, -O2):
<mov_func>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mov_func(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* %6
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @mov_func(i32 returned %0, i32 %1, i32 %2) {
ret i32 %0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_read_solution_dimensions(int *len, int *dim) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(133, len, dim, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_read_solution_dimensions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x85,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_read_solution_dimensions>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x85,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_read_solution_dimensions(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc(i32 133, i32* %7, i32* %8, double* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @solcon_read_solution_dimensions(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc(i32 133, i32* %0, i32* %1, double* undef)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
uint32_t timeval_toMsecs(struct timeval *a) {
  return a->tv_sec * 1000 + a->tv_usec / 1000;
}


x86 assembly (clang, -O0):
<timeval_toMsecs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_toMsecs>:
imul   $0x3e8,(%rdi),%ecx
movslq 0x4(%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timeval_toMsecs(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @timeval_toMsecs(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = add nsw i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int add(int x, int y) {
  assert(x == 0);
  assert(y == 1);
  return x + y;
}


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

x86 assembly (clang, -O2):
<add>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
test   %ebp,%ebp
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x1,%ebx
sete   %dil
call   1030 <assert@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @add(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 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = add nsw i32 %1, %0
ret i32 %9
}
void put_device(int i) {}


x86 assembly (clang, -O0):
<put_device>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @put_device(i32 %0) {
ret void
}
/* Variables and functions */
size_t count_variables(const char *const user_variables[]) {
  size_t count = 0;
  const char *const *iter;
  for (iter = user_variables; *iter != NULL; ++iter)
    count++;
  return count;
}


x86 assembly (clang, -O0):
<count_variables>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1143 <count_variables+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <count_variables+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_variables>:
cmpq   $0x0,(%rdi)
je     1120 <count_variables+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <count_variables+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @count_variables(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8** [ %8, %4 ], [ %0, %1 ]
%6 = phi i64 [ %7, %4 ], [ 0, %1 ]
%7 = add i64 %6, 1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
/* Variables and functions */
float fast_sin(double);
float fast_cos(float radians) {
  return fast_sin(((3.14159265359) / 2) - radians);
}


x86 assembly (clang, -O0):
<fast_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <fast_sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_cos>:
cvtss2sd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
subsd  %xmm1,%xmm0
jmp    1030 <fast_sin@plt>

LLVM IR (-O0):
define float @fast_cos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double 0x3FF921FB54442EEA, %4
%6 = call float @fast_sin(double %5)
ret float %6
}

LLVM IR (-O2):
define float @fast_cos(float %0) {
%2 = fpext float %0 to double
%3 = fsub double 0x3FF921FB54442EEA, %2
%4 = tail call float @fast_sin(double %3)
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ do_FocusIn(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void do_FocusOut(FILE *out_f, XEvent *eventp) { do_FocusIn(out_f, eventp); }


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

x86 assembly (clang, -O2):
<do_FocusOut>:
jmp    1030 <do_FocusIn@plt>

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

LLVM IR (-O2):
define void @do_FocusOut(i32* %0, i32* %1) {
%3 = tail call i32 @do_FocusIn(i32* %0, i32* %1)
ret void
}
int null_portcheck(a1)
struct sockaddr *a1;
{
  return (0);
}


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

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

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

LLVM IR (-O2):
%struct.sockaddr = type opaque
define i32 @null_portcheck(%struct.sockaddr* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double conj(const double _z) { return _z; }


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

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

LLVM IR (-O0):
define double @conj(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @conj(double returned %0) {
ret double %0
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, int /*<<< orphan*/ *, int);
void pack(unsigned char *b, uint16_t c, int32_t v) {
  c = htons(c);
  memcpy(&b[(0x00)], &c, sizeof(c));
  v = htonl(v);
  memcpy(&b[(0x02)], &v, sizeof(v));
}


x86 assembly (clang, -O0):
<pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    %ebp,%edi
call   1040 <htonl@plt>
mov    %eax,(%rsp)
add    $0x2,%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @pack(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = call i32 @htons(i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = call i32 @memcpy(i8* %10, i32* %5, i32 4)
%12 = load i32, i32* %6
%13 = call i32 @htonl(i32 %12)
store i32 %13, i32* %6
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = call i32 @memcpy(i8* %15, i32* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @pack(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = tail call i32 @htons(i32 %1)
store i32 %6, i32* %4
%7 = call i32 @memcpy(i8* %0, i32* %4, i32 4)
%8 = call i32 @htonl(i32 %2)
store i32 %8, i32* %5
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = call i32 @memcpy(i8* %9, i32* %5, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int unblock_signal(int signum) {
  sigset_t set, oset;
  sigemptyset(&set);
  sigaddset(&set, signum);
  return sigprocmask(SIG_UNBLOCK, &set, &oset);
}


x86 assembly (clang, -O0):
<unblock_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unblock_signal>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define i32 @unblock_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIG_UNBLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %3, i32* %4)
ret i32 %9
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define i32 @unblock_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = call i32 @sigaddset(i32* %2, i32 %0)
%8 = load i32, i32* @SIG_UNBLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* %3)
ret i32 %9
}
/* Type definitions */
struct linked_mem_pool_chain {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct linked_mem_pool_chain *);
int linked_mem_pool_chain_destroy(struct linked_mem_pool_chain *chain) {
  free(chain);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.linked_mem_pool_chain = type { i32 }
define i32 @linked_mem_pool_chain_destroy(%struct.linked_mem_pool_chain* nocapture %0) {
%2 = tail call i32 @free(%struct.linked_mem_pool_chain* %0)
ret i32 0
}
__attribute__((no_sanitize_undefined)) void float_cast(void) {
  volatile double d = 300;
  volatile signed char c;
  c = d;
}


x86 assembly (clang, -O0):
<float_cast>:
push   %rbp
mov    %rsp,%rbp
movabs $0x4072c00000000000,%rax
c0 72 40
mov    %rax,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %al,-0x9(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_cast>:
movabs $0x4072c00000000000,%rax
c0 72 40
mov    %rax,-0x8(%rsp)
cvttsd2si -0x8(%rsp),%eax
mov    %al,-0x9(%rsp)
ret

LLVM IR (-O0):
define void @float_cast() {
%1 = alloca double
%2 = alloca i8
store volatile double 3.000000e+02, double* %1
%3 = load volatile double, double* %1
%4 = fptosi double %3 to i8
store volatile i8 %4, i8* %2
ret void
}

LLVM IR (-O2):
define void @float_cast() {
%1 = alloca double
%2 = alloca i8
%3 = bitcast double* %1 to i8*
store volatile double 3.000000e+02, double* %1
%4 = load volatile double, double* %1
%5 = fptosi double %4 to i8
store volatile i8 %5, i8* %2
ret void
}
/* Variables and functions */
int genrand_int32();
double genrand_res53(void) {
  unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6;
  return (a * 67108864.0 + b) * (1.0 / 4503599627370496.0) - 1.0;
}


x86 assembly (clang, -O0):
<genrand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <genrand_int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeda(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xed9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe8a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe66(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_res53>:
push   %rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  0xeac(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
addsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @genrand_res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @genrand_int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @genrand_int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = call double @llvm.fmuladd.f64(double %13, double 0x3CB0000000000000, double -1.000000e+00)
ret double %14
}

LLVM IR (-O2):
define double @genrand_res53() {
%1 = tail call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @genrand_int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3CB0000000000000, double -1.000000e+00)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ shift_down(void *, size_t, size_t, size_t,
                              int (*)(void const *, void const *));
void heapify(void *elems, size_t elem_count, size_t elem_size,
             int (*cmp)(const void *, const void *)) {
  size_t i = elem_count >> 1;
  while (i != 0) {
    i--;
    shift_down(elems, elem_count, i, elem_size, cmp);
  }
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1169 <heapify+0x59>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <shift_down@plt>
jmp    1134 <heapify+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x2,%rsi
jb     115a <heapify+0x4a>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r13
mov    %rdi,%r12
mov    %rsi,%rbx
shr    %rbx
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <shift_down@plt>
add    $0xffffffffffffffff,%rbx
jb     1140 <heapify+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @heapify(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = icmp ult i64 %1, 2
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = lshr i64 %1, 1
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %10, %8 ], [ %7, %6 ]
%10 = add nsw i64 %9, -1
%11 = tail call i32 @shift_down(i8* %0, i64 %1, i64 %10, i64 %2, i32 (i8*, i8*)* %3)
%12 = icmp eq i64 %10, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  int *p;
  p = &x;
  scanf("%d", &x);
  printf("%d\n", *p);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int *carga_numero() {
  int *a = (int *)malloc(sizeof(int));
  printf("Ingrese numero: ");
  scanf("%d", a);
  return a;
}


x86 assembly (clang, -O0):
<carga_numero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carga_numero>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Ingrese numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32* @carga_numero() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
ret i32* %2
}
/* Variables and functions */
int rand();
int random_int(void) {
  int int_bits = sizeof(int) * 8;
  int i;
  int random = 0;
  for (i = 0; i < int_bits; i++) {
    random |= rand() % 2;
    random <<= 1;
  }
  return random;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x20,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <random_int+0x55>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
or     -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <random_int+0x1d>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rbp
push   %rbx
push   %rax
mov    $0x20,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0x7ffffffe,%ecx
sub    %ecx,%eax
or     %eax,%ebx
add    %ebx,%ebx
add    $0xffffffff,%ebp
jne    1120 <random_int+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_int() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 32, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = call i32 (...) @rand()
%10 = srem i32 %9, 2
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
store i32 %14, i32* %3
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @random_int() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i32 [ 0, %0 ], [ %8, %1 ]
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 2
%6 = or i32 %5, %2
%7 = shl i32 %6, 1
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %1
10: ; preds = %1
ret i32 %7
}
unsigned int JSHash(char *str) {
  unsigned int hash = 1315423911;
  while (*str)
    hash = hash ^ ((hash << 5) + (*str++) + (hash >> 2));
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<JSHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x4e67c6a7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <JSHash+0x4b>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
mov    -0x8(%rbp),%rdx
mov    %rdx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x8(%rbp)
movsbl (%rdx),%edx
add    %edx,%ecx
mov    -0xc(%rbp),%edx
shr    $0x2,%edx
add    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <JSHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JSHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <JSHash+0x34>
add    $0x1,%rdi
mov    $0x4e67c6a7,%eax
nop
mov    %eax,%edx
mov    %eax,%esi
shl    $0x5,%esi
movsbl %cl,%ecx
shr    $0x2,%eax
add    %esi,%eax
add    %ecx,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <JSHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x4e67c6a7,%eax
ret

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

LLVM IR (-O2):
define i32 @JSHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %14, %4 ], [ 1315423911, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 5
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = lshr i32 %6, 2
%12 = add i32 %11, %8
%13 = add i32 %12, %10
%14 = xor i32 %13, %6
%15 = load i8, i8* %9
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = and i32 %14, 2147483647
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 1315423911, %1 ], [ %18, %17 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void hex_print(const char *data, int length) {
  int ptr = 0;
  for (; ptr < length; ptr++) {
    printf("0x%02x ", (unsigned char)*(data + ptr));
  }
}


x86 assembly (clang, -O0):
<hex_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <hex_print+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <hex_print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <hex_print+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <hex_print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"0x%02x \00"
define void @hex_print(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x%02x \00"
define void @hex_print(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void proc_imprime(char *mensagem) {
  printf("%s", mensagem);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<proc_imprime>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @proc_imprime(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @putchar(i32 10)
ret void
}
int test_imm_E9int16_reg(short val) {
  return ((val) & (0xE9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E9int16_reg(i16 signext %0) {
%2 = and i16 %0, 233
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
__attribute__((always_)) uint16_t uvisor_read16(uint16_t volatile *addr) {
  return *(addr);
}


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

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

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

LLVM IR (-O2):
define i32 @uvisor_read16(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
void *th_func(void *t) {
  long id = (long)t;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @th_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @th_func(i8* nocapture readnone %0) {
ret i8* null
}
int lis(int *arr) {}


x86 assembly (clang, -O0):
<lis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lis(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memtr_init();
int /*<<< orphan*/ memtr_print(char *, int /*<<< orphan*/, void *);
int /*<<< orphan*/ orig_free(void *);
void free(void *ptr) {
  memtr_init();
  memtr_print("f<", 0, ptr);
  orig_free(ptr);
  memtr_print("f>", 0, ptr);
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <memtr_init@plt>
mov    -0x8(%rbp),%rdx
lea    0xeb2(%rip),%rdi
xor    %esi,%esi
call   1030 <memtr_print@plt>
mov    -0x8(%rbp),%rdi
call   1050 <orig_free@plt>
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rdi
xor    %esi,%esi
call   1030 <memtr_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <memtr_init@plt>
lea    0xebe(%rip),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memtr_print@plt>
mov    %rbx,%rdi
call   1050 <orig_free@plt>
lea    0xea8(%rip),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memtr_print@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"f<\00"
@.str.1 = [3 x i8] c"f>\00"
define void @free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @memtr_init()
%4 = load i8*, i8** %2
%5 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @orig_free(i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"f<\00"
@.str.1 = [3 x i8] c"f>\00"
define void @free(i8* %0) {
%2 = tail call i32 (...) @memtr_init()
%3 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i8* %0)
%4 = tail call i32 @orig_free(i8* %0)
%5 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadh_pi(int /*<<< orphan*/, int /*<<< orphan*/ *);
__m128 test_mm_loadh_pi(__m128 x, __m64 *y) { return _mm_loadh_pi(x, y); }


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

x86 assembly (clang, -O2):
<test_mm_loadh_pi>:
jmp    1030 <_mm_loadh_pi@plt>

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

LLVM IR (-O2):
define i32 @test_mm_loadh_pi(i32 %0, i32* %1) {
%3 = tail call i32 @_mm_loadh_pi(i32 %0, i32* %1)
ret i32 %3
}
void chkr_check_exec(void *p) {}


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

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

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

LLVM IR (-O2):
define void @chkr_check_exec(i8* nocapture %0) {
ret void
}
/* Variables and functions */
bool nrf52_errata_195(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_195() {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int raw_to_temp(uint16_t raw) {
  int v = raw;
  v *= 17572;
  v /= 65536;
  v -= 4685;
  return v;
}


x86 assembly (clang, -O0):
<raw_to_temp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x44a4,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x124d,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_to_temp>:
imul   $0x44a4,%edi,%ecx
lea    0xffff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x10,%eax
add    $0xffffedb3,%eax
ret

LLVM IR (-O0):
define i32 @raw_to_temp(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* %3
%6 = mul nsw i32 %5, 17572
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 65536
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 4685
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @raw_to_temp(i32 %0) {
%2 = mul nsw i32 %0, 17572
%3 = sdiv i32 %2, 65536
%4 = add nsw i32 %3, -4685
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eputc(unsigned int);
void write16bit(int data) {
  eputc((unsigned)((data & 0xff00) >> 8));
  eputc((unsigned)(data & 0xff));
}


x86 assembly (clang, -O0):
<write16bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff00,%edi
sar    $0x8,%edi
call   1030 <eputc@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <eputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write16bit>:
push   %rbx
mov    %edi,%ebx
movzbl %bh,%edi
call   1030 <eputc@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <eputc@plt>

LLVM IR (-O0):
define void @write16bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = call i32 @eputc(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = call i32 @eputc(i32 %8)
ret void
}

LLVM IR (-O2):
define void @write16bit(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
%4 = tail call i32 @eputc(i32 %3)
%5 = and i32 %0, 255
%6 = tail call i32 @eputc(i32 %5)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *platform_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<platform_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @platform_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}