xunge/DecIR huggingface dataset:
void unsigned_char_mul_signed_char_unsigned_int(unsigned char *LHS,
                                                unsigned int RHS) {
  (*LHS) *= RHS;
}


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

x86 assembly (clang, -O2):
<unsigned_char_mul_signed_char_unsigned_int>:
mov    (%rdi),%al
mul    %sil
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_mul_signed_char_unsigned_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = mul i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @unsigned_char_mul_signed_char_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = mul i8 %3, %4
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enableirq();
void pic_setup(void) { enableirq(); }


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

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

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

LLVM IR (-O2):
define void @pic_setup() {
%1 = tail call i32 (...) @enableirq()
ret void
}
double timeElapsed() {
  double time = 0.0;
  return (time);
}


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

x86 assembly (clang, -O2):
<timeElapsed>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @timeElapsed() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @timeElapsed() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int ft_putchar(char c) {
  write(1, &c, 1);
  return 0;
}


x86 assembly (clang, -O0):
<ft_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ft_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @ft_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 0
}
int test1() {}


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

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

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

LLVM IR (-O2):
define i32 @test1() {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  long all_event_masks;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_all_event_masks(void *_p, long _v) {
  ((XWindowAttributes *)_p)->all_event_masks = (long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XWindowAttributes_all_event_masks(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotr32(uint32_t a, uint32_t n) { return ((a >> n) | (a << (32 - n))); }


x86 assembly (clang, -O0):
<rotr32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr32>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotr32(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotr32(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void clearDsp() {
  int y;
  for (y = 1; y <= 22; ++y) {
    printf("\x1B[%dK", y);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<clearDsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x16,-0x4(%rbp)
jg     1164 <clearDsp+0x44>
mov    -0x4(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <clearDsp+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearDsp>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xecf(%rip),%r14
mov    0x2ea8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    (%r15),%edi
call   1040 <fflush@plt>
add    $0x1,%ebx
cmp    $0x17,%ebx
jne    1140 <clearDsp+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dK\00"
@stdout = global i32 0
define void @clearDsp() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 22
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dK\00"
@stdout = global i32 0
define void @clearDsp() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 23
br i1 %7, label %8, label %1
8: ; preds = %1
ret void
}
void InitCommonControls() {}


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

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

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

LLVM IR (-O2):
define void @InitCommonControls() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mer(int *, int *, int, int);
void merge(int *arr, int n, int *dest, int bin_size) {
  int positions = n / (bin_size * 2);
  int position;
  for (position = 0; position < positions; position++) {
    mer(arr, dest, bin_size, position);
  }
}


x86 assembly (clang, -O0):
<merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1169 <merge+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1030 <mer@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113c <merge+0x2c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %esi,%eax
lea    (%r15,%r15,1),%ecx
cltd
idiv   %ecx
test   %eax,%eax
jle    1157 <merge+0x47>
mov    %rdi,%r12
mov    %eax,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
mov    %ebx,%ecx
call   1030 <mer@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <merge+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @merge(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %8
%13 = mul nsw i32 %12, 2
%14 = sdiv i32 %11, %13
store i32 %14, i32* %9
store i32 0, i32* %10
br label %15
15: ; preds = %25, %4
%16 = load i32, i32* %10
%17 = load i32, i32* %9
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i32*, i32** %5
%21 = load i32*, i32** %7
%22 = load i32, i32* %8
%23 = load i32, i32* %10
%24 = call i32 @mer(i32* %20, i32* %21, i32 %22, i32 %23)
br label %25
25: ; preds = %19
%26 = load i32, i32* %10
%27 = add nsw i32 %26, 1
store i32 %27, i32* %10
br label %15
28: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @merge(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = shl nsw i32 %3, 1
%6 = sdiv i32 %1, %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4, %8
%9 = phi i32 [ %11, %8 ], [ 0, %4 ]
%10 = tail call i32 @mer(i32* %0, i32* %2, i32 %3, i32 %9)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, %6
br i1 %12, label %13, label %8
13: ; preds = %8, %4
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
char const *ploy_pass_whitespace(char const *source_str) {
  while (*source_str && isspace(*source_str)) {
    source_str += 1;
  }
  return source_str;
}


x86 assembly (clang, -O0):
<ploy_pass_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <ploy_pass_whitespace+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <ploy_pass_whitespace+0x47>
jmp    1168 <ploy_pass_whitespace+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ploy_pass_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ploy_pass_whitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <ploy_pass_whitespace+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <ploy_pass_whitespace+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ploy_pass_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ploy_pass_whitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ heapify(char **, int, int);
void heapsort_n(char **array, int size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    heapify(array, size, i);
  }
}


x86 assembly (clang, -O0):
<heapsort_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <heapsort_n+0x46>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <heapify@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <heapsort_n+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapsort_n>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1133 <heapsort_n+0x23>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
nop
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <heapify@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <heapsort_n+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @heapsort_n(i8** %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @heapify(i8** %0, i32 %1, i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TaskScheduler_Init();
int /*<<< orphan*/ TemperatureFilter_Init();
void Model_Init(void) {
  TaskScheduler_Init();
  TemperatureFilter_Init();
}


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

x86 assembly (clang, -O2):
<Model_Init>:
push   %rax
xor    %eax,%eax
call   1030 <TaskScheduler_Init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <TemperatureFilter_Init@plt>

LLVM IR (-O0):
define void @Model_Init() {
%1 = call i32 (...) @TaskScheduler_Init()
%2 = call i32 (...) @TemperatureFilter_Init()
ret void
}

LLVM IR (-O2):
define void @Model_Init() {
%1 = tail call i32 (...) @TaskScheduler_Init()
%2 = tail call i32 (...) @TemperatureFilter_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vecNd_sub_new(double *, double const *, double const *, int);
void vec4d_sub_new(double result[4], const double a[4], const double b[4]) {
  vecNd_sub_new(result, a, b, 4);
}


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

x86 assembly (clang, -O2):
<vec4d_sub_new>:
mov    $0x4,%ecx
jmp    1030 <vecNd_sub_new@plt>

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

LLVM IR (-O2):
define void @vec4d_sub_new(double* %0, double* %1, double* %2) {
%4 = tail call i32 @vecNd_sub_new(double* %0, double* %1, double* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ refresh();
void gotoxy(int x, int y) {
  move(y - 1, x - 1);
  refresh();
}


x86 assembly (clang, -O0):
<gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
call   1040 <move@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoxy>:
push   %rax
lea    -0x1(%rsi),%eax
lea    -0x1(%rdi),%esi
mov    %eax,%edi
call   1040 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
define void @gotoxy(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = call i32 @move(i32 %6, i32 %8)
%10 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @gotoxy(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @move(i32 %3, i32 %4)
%6 = tail call i32 (...) @refresh()
ret void
}
void __DELETE_java_lang_Runtime(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_Runtime(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
void *PyThread_get_key_value(int key) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @PyThread_get_key_value(i32 %0) {
ret i8* null
}
int test_imm_20int8_reg(signed char val) {
  return ((val) & (0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_20int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 32
%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_20int8_reg(i8 signext %0) {
%2 = and i8 %0, 32
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *dest, const char *src) {
  strcpy((dest + strlen(dest)), src);
  return dest;
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
char foo();
int maxout_in(int paste, char **matrix) {
  char o = foo();
  return (int)matrix[1][2] * 5 - paste;
}


x86 assembly (clang, -O0):
<maxout_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
imul   $0x5,%eax,%eax
sub    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxout_in>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <foo@plt>
mov    0x8(%rbx),%rax
movsbl 0x2(%rax),%eax
lea    (%rax,%rax,4),%eax
sub    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @maxout_in(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call signext i8 (...) @foo()
store i8 %6, i8* %5
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = mul nsw i32 %12, 5
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @maxout_in(i32 %0, i8** nocapture %1) {
%3 = tail call signext i8 (...) @foo()
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = mul nsw i32 %8, 5
%10 = sub nsw i32 %9, %0
ret i32 %10
}
void foo597() {}


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

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

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

LLVM IR (-O2):
define void @foo597() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_history(char *);
void stop_completer() { write_history(".reference_client_history"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c".reference_client_history\00"
define void @stop_completer() {
%1 = call i32 @write_history(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c".reference_client_history\00"
define void @stop_completer() {
%1 = tail call i32 @write_history(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void interrupt() { write(2, "xyzzy\n", 6); }


x86 assembly (clang, -O0):
<interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0x6,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"xyzzy\0A\00"
define void @interrupt() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"xyzzy\0A\00"
define void @interrupt() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Variables and functions */
int check(char *, int /*<<< orphan*/);
int /*<<< orphan*/ mkfifo(char *, int);
int /*<<< orphan*/ open(char *, int);
char *path(char *);
int open_fifo(char *base, int oflag) {
  char *filename = path(base);
  check("mkfifo", mkfifo(filename, 0666));
  return check("open", open(filename, oflag));
}


x86 assembly (clang, -O0):
<open_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <path@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1b6,%esi
call   1030 <mkfifo@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1060 <check@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <open@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1060 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_fifo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <path@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1b6,%esi
call   1030 <mkfifo@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1060 <check@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <open@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <check@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"mkfifo\00"
@.str.1 = [5 x i8] c"open\00"
define i32 @open_fifo(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 = call i8* @path(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @mkfifo(i8* %8, i32 438)
%10 = call i32 @check(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i32 @open(i8* %11, i32 %12)
%14 = call i32 @check(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"mkfifo\00"
@.str.1 = [5 x i8] c"open\00"
define i32 @open_fifo(i8* %0, i32 %1) {
%3 = tail call i8* @path(i8* %0)
%4 = tail call i32 @mkfifo(i8* %3, i32 438)
%5 = tail call i32 @check(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @open(i8* %3, i32 %1)
%7 = tail call i32 @check(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 %7
}
/* Variables and functions */
bool dy_empty_impl(int top) { return top == (-1); }


x86 assembly (clang, -O0):
<dy_empty_impl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dy_empty_impl>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @dy_empty_impl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @dy_empty_impl(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double pow(int, double);
double sqr_wrapper(double *arg_list) { return pow(2, arg_list[0]); }


x86 assembly (clang, -O0):
<sqr_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqr_wrapper>:
movsd  (%rdi),%xmm0
mov    $0x2,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @sqr_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @pow(i32 2, double %5)
ret double %6
}

LLVM IR (-O2):
define double @sqr_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @pow(i32 2, double %2)
ret double %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double randNormalize(void) { return rand() / ((double)RAND_MAX + 1); }


x86 assembly (clang, -O0):
<randNormalize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xed1(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randNormalize>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randNormalize() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %1, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randNormalize() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %1, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void fetrans_deschook_free(void *hook) {
  if (hook) {
    sfree(hook);
  }
  return;
}


x86 assembly (clang, -O0):
<fetrans_deschook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <fetrans_deschook_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetrans_deschook_free>:
test   %rdi,%rdi
je     111a <fetrans_deschook_free+0xa>
jmp    1030 <sfree@plt>
ret

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

LLVM IR (-O2):
define void @fetrans_deschook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_C3uint8_mem(unsigned char *val) {
  return ((*val) & (-0xC3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C3uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -195
%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_C3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 61
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void equal(void *p1, void *p2, char *msg) {
  if (p1 != p2) {
    fprintf(stderr, "<%s> failed!\n", msg);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1165 <equal+0x45>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
cmp    %rsi,%rdi
jne    1126 <equal+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"<%s> failed!\0A\00"
define void @equal(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ne i8* %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"<%s> failed!\0A\00"
define void @equal(i8* readnone %0, i8* readnone %1, i8* %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void quitar_saltosU(char *cadena) {
  char *p;
  p = strchr(cadena, '\n');
  if (p)
    *p = '\0';
}


x86 assembly (clang, -O0):
<quitar_saltosU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <quitar_saltosU+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitar_saltosU>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <quitar_saltosU+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @quitar_saltosU(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
double milesToMinutes(double miles, double mph) { return miles * 60 / mph; }


x86 assembly (clang, -O0):
<milesToMinutes>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<milesToMinutes>:
mulsd  0xef8(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @milesToMinutes(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double %5, 6.000000e+01
%7 = load double, double* %4
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @milesToMinutes(double %0, double %1) {
%3 = fmul double %0, 6.000000e+01
%4 = fdiv double %3, %1
ret double %4
}
/* Variables and functions */
int INT_MIN;
int test5(int x) {
  int y = INT_MIN;
  return ~(x + y);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
add    (%rcx),%eax
not    %eax
ret

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

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test5(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = add nsw i32 %2, %0
%4 = xor i32 %3, -1
ret i32 %4
}
void troca(float *v1, float *v2) {
  float aux = *v2;
  *v2 = *v1;
  *v1 = aux;
}


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

x86 assembly (clang, -O2):
<troca>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
movss  %xmm1,(%rsi)
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @troca(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %4
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %3
%9 = load float, float* %8
%10 = load float*, float** %4
store float %9, float* %10
%11 = load float, float* %5
%12 = load float*, float** %3
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @troca(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
store float %4, float* %1
store float %3, float* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shellcodeCreator_windows86() { printf("Not yet implemented.\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Not yet implemented.\0A\00"
define void @shellcodeCreator_windows86() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Not yet implemented.\00"
define void @shellcodeCreator_windows86() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
void EC_KEY_copy(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_copy() {
ret void
}
/* Variables and functions */
int write_permission_p(char const *);
int fileutils___write_permission_p(const char *filename) {
  return (write_permission_p(filename));
}


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

x86 assembly (clang, -O2):
<fileutils___write_permission_p>:
jmp    1030 <write_permission_p@plt>

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

LLVM IR (-O2):
define i32 @fileutils___write_permission_p(i8* %0) {
%2 = tail call i32 @write_permission_p(i8* %0)
ret i32 %2
}
/* Variables and functions */
bool sp_invalid(int efd) { return efd == -1; }


x86 assembly (clang, -O0):
<sp_invalid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_invalid>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @sp_invalid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @sp_invalid(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clock();
void dosomething() {
  int i;
  for (i = 0; i < 900000; i++) {
    clock();
  }
}


x86 assembly (clang, -O0):
<dosomething>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xdbba0,-0x4(%rbp)
jge    1141 <dosomething+0x31>
mov    $0x0,%al
call   1030 <clock@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <dosomething+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dosomething>:
push   %rbx
mov    $0xdbba0,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
add    $0xffffffff,%ebx
jne    1120 <dosomething+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @dosomething() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 900000
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @clock()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @dosomething() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @clock()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 900000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int good(void) {
  const int a[2] = {1, 2};
  return a[0];
}


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

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

LLVM IR (-O0):
@__const.good.a = [2 x i32] [i32 1, i32 2]
define i32 @good() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @good() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M111_f(char *s) {
  debug("M111_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M111_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M111_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M111_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M111_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M111_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M111_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
float parallilogrammo(float x, float y) { return x * 2 + y * 2; }


x86 assembly (clang, -O0):
<parallilogrammo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallilogrammo>:
addss  %xmm1,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @parallilogrammo(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %6, 2.000000e+00
%8 = call float @llvm.fmuladd.f32(float %5, float 2.000000e+00, float %7)
ret float %8
}

LLVM IR (-O2):
define float @parallilogrammo(float %0, float %1) {
%3 = fmul float %1, 2.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float %3)
ret float %4
}
/* Variables and functions */
char *alloca(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int printf(char *, char *);
int foo(int n, const char *str) {
  char *data = alloca(n);
  memcpy(data, str, n);
  return printf("%s\n", data);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <alloca@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <alloca@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @foo(i32 %0, i8* %1) {
%3 = tail call i8* @alloca(i32 %0)
%4 = tail call i32 @memcpy(i8* %3, i8* %1, i32 %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %5
}
/* Variables and functions */
void DebugMon_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @DebugMon_Handler() {
ret void
}
void setPC(int *context, int pc) { *(context + 3) = pc; }


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

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

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

LLVM IR (-O2):
define void @setPC(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %3
ret void
}