xunge/DecIR huggingface dataset:
void open_softirq(int nr, void (*action)(struct softirq_action *), void *data) {
  return;
}


x86 assembly (clang, -O0):
<open_softirq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.softirq_action = type opaque
define void @open_softirq(i32 %0, void (%struct.softirq_action*)* nocapture %1, i8* nocapture %2) {
ret void
}
unsigned long insert_nb(unsigned long insn, long value, const char **errmsg) {
  if (value < 0 || value > 32)
    *errmsg = "value out of range";
  if (value == 32)
    value = 0;
  return insn | ((value & 0x1f) << 11);
}


x86 assembly (clang, -O0):
<insert_nb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1126 <insert_nb+0x26>
cmpq   $0x20,-0x10(%rbp)
jle    1134 <insert_nb+0x34>
mov    -0x18(%rbp),%rax
lea    0xecf(%rip),%rcx
mov    %rcx,(%rax)
cmpq   $0x20,-0x10(%rbp)
jne    1147 <insert_nb+0x47>
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0xb,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_nb>:
cmp    $0x21,%rsi
jb     1110 <insert_nb+0x10>
lea    0xef3(%rip),%rax
mov    %rax,(%rdx)
shl    $0xb,%esi
movzwl %si,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"value out of range\00"
define i64 @insert_nb(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %5
%8 = icmp slt i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i64, i64* %5
%11 = icmp sgt i64 %10, 32
br i1 %11, label %12, label %14
12: ; preds = %9, %3
%13 = load i8**, i8*** %6
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %13
br label %14
14: ; preds = %12, %9
%15 = load i64, i64* %5
%16 = icmp eq i64 %15, 32
br i1 %16, label %17, label %18
17: ; preds = %14
store i64 0, i64* %5
br label %18
18: ; preds = %17, %14
%19 = load i64, i64* %4
%20 = load i64, i64* %5
%21 = and i64 %20, 31
%22 = shl i64 %21, 11
%23 = or i64 %19, %22
ret i64 %23
}

LLVM IR (-O2):
@.str = [19 x i8] c"value out of range\00"
define i64 @insert_nb(i64 %0, i64 %1, i8** nocapture writeonly %2) {
%4 = icmp ugt i64 %1, 32
br i1 %4, label %5, label %6
5: ; preds = %3
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %3, %5
%7 = shl i64 %1, 11
%8 = and i64 %7, 63488
%9 = or i64 %8, %0
ret i64 %9
}
int ld_le_rm2(long double a1, long double *a2) { return !(((a1) <= (*a2))); }


x86 assembly (clang, -O0):
<ld_le_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_le_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_le_rm2(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp ole x86_fp80 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_le_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp ult x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gentables();
int /*<<< orphan*/ gkey(int, int, void *);
void aes_set_key(unsigned char *key) {
  gentables();
  gkey(4, 4, (void *)key);
}


x86 assembly (clang, -O0):
<aes_set_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gentables@plt>
mov    -0x8(%rbp),%rdx
mov    $0x4,%esi
mov    %esi,%edi
call   1040 <gkey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_set_key>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gentables@plt>
mov    $0x4,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <gkey@plt>

LLVM IR (-O0):
define void @aes_set_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @gentables()
%4 = load i8*, i8** %2
%5 = call i32 @gkey(i32 4, i32 4, i8* %4)
ret void
}

LLVM IR (-O2):
define void @aes_set_key(i8* %0) {
%2 = tail call i32 (...) @gentables()
%3 = tail call i32 @gkey(i32 4, i32 4, i8* %0)
ret void
}
long iso_731(c)
char *c;
{
  return ((long)(c[0] & 0xff) | ((long)(c[1] & 0xff) << 8) |
          ((long)(c[2] & 0xff) << 16) | ((long)(c[3] & 0xff) << 24));
}


x86 assembly (clang, -O0):
<iso_731>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
cltq
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @iso_731(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 255
%8 = sext i32 %7 to i64
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, 255
%14 = sext i32 %13 to i64
%15 = shl i64 %14, 8
%16 = or i64 %8, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = and i32 %20, 255
%22 = sext i32 %21 to i64
%23 = shl i64 %22, 16
%24 = or i64 %16, %23
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = and i32 %28, 255
%30 = sext i32 %29 to i64
%31 = shl i64 %30, 24
%32 = or i64 %24, %31
ret i64 %32
}

LLVM IR (-O2):
define i64 @iso_731(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void End(void) { exit(0); }


x86 assembly (clang, -O0):
<End>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<End>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @End() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @End() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int main(void) {
  void *alloc = malloc(1024000);
  free(alloc);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfa000,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024000)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(1024000) i8* @malloc(i32 1024000)
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int a_strlen(char const *);
char *xmemdup(char const *, int);
char *a_strdup(const char *s) {
  ssize_t len = a_strlen(s);
  return len ? xmemdup((s), sizeof(*(s)) * (len + 1)) : NULL;
}


x86 assembly (clang, -O0):
<a_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <a_strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1162 <a_strdup+0x42>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   1040 <xmemdup@plt>
mov    %rax,-0x18(%rbp)
jmp    116d <a_strdup+0x4d>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    116d <a_strdup+0x4d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <a_strlen@plt>
test   %eax,%eax
je     113b <a_strdup+0x1b>
add    $0x1,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <xmemdup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @a_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @a_strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 1, %12
%14 = trunc i64 %13 to i32
%15 = call i8* @xmemdup(i8* %9, i32 %14)
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %8
%18 = phi i8* [ %15, %8 ], [ null, %16 ]
ret i8* %18
}

LLVM IR (-O2):
define i8* @a_strdup(i8* %0) {
%2 = tail call i32 @a_strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nsw i32 %2, 1
%6 = tail call i8* @xmemdup(i8* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Type definitions */
struct user {
  int dummy;
};

/* Variables and functions */
struct user *fetch_alloc_user_uid(int);
int /*<<< orphan*/ prefetch_data(int *, int);
struct user *fetch_alloc_user(void) {
  int data[2];
  prefetch_data(data, 8);
  return fetch_alloc_user_uid(data[1]);
}


x86 assembly (clang, -O0):
<fetch_alloc_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1040 <prefetch_data@plt>
mov    -0x4(%rbp),%edi
call   1030 <fetch_alloc_user_uid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_alloc_user>:
push   %rax
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <prefetch_data@plt>
mov    0x4(%rsp),%edi
call   1030 <fetch_alloc_user_uid@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.user = type { i32 }
define %struct.user* @fetch_alloc_user() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = call i32 @prefetch_data(i32* %2, i32 8)
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%5 = load i32, i32* %4
%6 = call %struct.user* @fetch_alloc_user_uid(i32 %5)
ret %struct.user* %6
}

LLVM IR (-O2):
%struct.user = type { i32 }
define %struct.user* @fetch_alloc_user() {
%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 = call i32 @prefetch_data(i32* %3, i32 8)
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = call %struct.user* @fetch_alloc_user_uid(i32 %6)
ret %struct.user* %7
}
void RTMpIsCpuPresent(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpIsCpuPresent() {
ret void
}
int op_voi(char *operand, char **filename) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @op_voi(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long lsquare(long X) {
  printf("Squareing\n");
  return X * X;
}


x86 assembly (clang, -O0):
<lsquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsquare>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
imul   %rbx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [10 x i8] c"Squareing\00"
define i64 @lsquare(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = mul nsw i64 %0, %0
ret i64 %3
}
void put_char(char c, int x, int y, char *buffer) {
  if (x >= 0 && x < 80 && y >= 0 && y < 24)
    buffer[x + y * 80] = c;
}


x86 assembly (clang, -O0):
<put_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1152 <put_char+0x52>
cmpl   $0x50,-0x8(%rbp)
jge    1152 <put_char+0x52>
cmpl   $0x0,-0xc(%rbp)
jl     1152 <put_char+0x52>
cmpl   $0x18,-0xc(%rbp)
jge    1152 <put_char+0x52>
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   $0x50,-0xc(%rbp),%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_char>:
cmp    $0x4f,%esi
ja     1119 <put_char+0x19>
cmp    $0x17,%edx
ja     1119 <put_char+0x19>
shl    $0x4,%edx
lea    (%rdx,%rdx,4),%eax
mov    %esi,%edx
add    %rax,%rdx
mov    %dil,(%rcx,%rdx,1)
ret

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

LLVM IR (-O2):
define void @put_char(i8 signext %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = icmp ult i32 %1, 80
%6 = icmp ult i32 %2, 24
%7 = and i1 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = mul nuw nsw i32 %2, 80
%10 = add nuw nsw i32 %9, %1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %3, i64 %11
store i8 %0, i8* %12
br label %13
13: ; preds = %8, %4
ret void
}
int test1(int x) {
  static int thestatic;
  if (x < 0)
    thestatic = x;
  else
    thestatic = -x;
  return thestatic + x;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <test1+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,0x2f0a(%rip)
jmp    112a <test1+0x2a>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,0x2efa(%rip)
mov    0x2ef4(%rip),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    %edi,%eax
neg    %eax
cmovns %edi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
@test1.thestatic = internal global i32 0
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
store i32 %6, i32* @test1.thestatic
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
store i32 %9, i32* @test1.thestatic
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* @test1.thestatic
%12 = load i32, i32* %2
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%3 = sub i32 %0, %2
ret i32 %3
}
/* Variables and functions */
char *strrchr(char *, char);
char *mybasename(char *path) {
  char *s;
  if ((s = strrchr(path, '/')) != 0) {
    return (s + 1);
  }
  return (path);
}


x86 assembly (clang, -O0):
<mybasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1149 <mybasename+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <mybasename+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mybasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @mybasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xf9() {
  Assert_real((isxdigit(249) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              1250, ("isxdigit should be 0 for 0xf9"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xf9\00"
define void @t_isxdigit_0xf9() {
%1 = tail call i64 @isxdigit(i32 249)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1250, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x19() {
  Assert_real((islower(25) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              130, ("islower should be 0 for 0x19"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x19>:
push   %rax
mov    $0x19,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x82,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x19\00"
define void @t_islower_0x19() {
%1 = tail call i64 @islower(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int mdp4_dsi_video_splash_done(struct platform_device *pdev) {}


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

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

LLVM IR (-O0):
%struct.platform_device = type opaque
define i32 @mdp4_dsi_video_splash_done(%struct.platform_device* %0) {
%2 = alloca i32
%3 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mdp4_dsi_video_splash_done(%struct.platform_device* nocapture readnone %0) {
ret i32 undef
}
int main() {
  char a[20];
  for (int i = 0; i < 99; ++i) {
    i[a] = (char)i;
    printf("%d\t%c\n", i, i[a]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x63,-0x24(%rbp)
jge    1165 <main+0x55>
mov    -0x24(%rbp),%eax
mov    %al,%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x20(%rbp,%rax,1)
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%edx
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x63,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%c\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 99
br i1 %6, label %1, label %2
}
/* Type definitions */
struct GadgetInfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MapGadgetExt(struct GadgetInfo *, int);
void MapGadget(struct GadgetInfo *gi) { MapGadgetExt(gi, 1); }


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

x86 assembly (clang, -O2):
<MapGadget>:
mov    $0x1,%esi
jmp    1030 <MapGadgetExt@plt>

LLVM IR (-O0):
%struct.GadgetInfo = type { i32 }
define void @MapGadget(%struct.GadgetInfo* %0) {
%2 = alloca %struct.GadgetInfo*
store %struct.GadgetInfo* %0, %struct.GadgetInfo** %2
%3 = load %struct.GadgetInfo*, %struct.GadgetInfo** %2
%4 = call i32 @MapGadgetExt(%struct.GadgetInfo* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.GadgetInfo = type { i32 }
define void @MapGadget(%struct.GadgetInfo* %0) {
%2 = tail call i32 @MapGadgetExt(%struct.GadgetInfo* %0, i32 1)
ret void
}
void simpleMemorySummaryRelease(void) {}


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

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

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

LLVM IR (-O2):
define void @simpleMemorySummaryRelease() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_big(int);
int main() {
  int array[] = {1, 11, 2, 22, 3, 33};
  int i;
  for (i = 0; i < 6; i++) {
    print_big(array[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    116c <main+0x5c>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
call   1030 <print_big@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1147 <main+0x37>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <print_big@plt>
mov    $0xb,%edi
call   1030 <print_big@plt>
mov    $0x2,%edi
call   1030 <print_big@plt>
mov    $0x16,%edi
call   1030 <print_big@plt>
mov    $0x3,%edi
call   1030 <print_big@plt>
mov    $0x21,%edi
call   1030 <print_big@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.array = [6 x i32] [i32 1, i32 11, i32 2, i32 22, i32 3, i32 33]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @print_big(i32 %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_big(i32 1)
%2 = tail call i32 @print_big(i32 11)
%3 = tail call i32 @print_big(i32 2)
%4 = tail call i32 @print_big(i32 22)
%5 = tail call i32 @print_big(i32 3)
%6 = tail call i32 @print_big(i32 33)
ret i32 0
}
int eraVersionMinor(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @eraVersionMinor() {
ret i32 4
}

LLVM IR (-O2):
define i32 @eraVersionMinor() {
ret i32 4
}
void _lock(unsigned int *lock) {
  while (1) {
    int i;
    for (i = 0; i < 10000; i++) {
      __asm__ __volatile__("" ::: "memory");
      if (*lock == 0) {
        if (__sync_bool_compare_and_swap(lock, 0, 1)) {
          return;
        }
      }
    }
    sched_yield();
  }
}


x86 assembly (clang, -O0):
<_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    117c <_lock+0x6c>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1169 <_lock+0x59>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    $0x1,%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
test   $0x1,%al
jne    115e <_lock+0x4e>
jmp    1164 <_lock+0x54>
add    $0x10,%rsp
pop    %rbp
ret
jmp    1169 <_lock+0x59>
jmp    116e <_lock+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <_lock+0x13>
mov    $0x0,%al
call   1030 <sched_yield@plt>
jmp    111c <_lock+0xc>

x86 assembly (clang, -O2):
<_lock>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %ebp,%ebp
mov    $0x1,%r14d
jmp    113b <_lock+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0x2710,%ebp
je     1150 <_lock+0x40>
cmpl   $0x0,(%rbx)
jne    1130 <_lock+0x20>
xor    %eax,%eax
lock cmpxchg %r14d,(%rbx)
jne    1130 <_lock+0x20>
jmp    115b <_lock+0x4b>
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <sched_yield@plt>
jmp    113b <_lock+0x2b>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @_lock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %1, %22
store i32 0, i32* %3
br label %5
5: ; preds = %19, %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10000
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32*, i32** %2
%14 = cmpxchg i32* %13, i32 0, i32 1 seq_cst seq_cst
%15 = extractvalue { i32, i1 } %14, 1
br i1 %15, label %16, label %17
16: ; preds = %12
ret void
17: ; preds = %12
br label %18
18: ; preds = %17, %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
%23 = call i32 (...) @sched_yield()
br label %4
}

LLVM IR (-O2):
define void @_lock(i32* nocapture %0) {
br label %2
2: ; preds = %12, %1
%3 = phi i32 [ 0, %1 ], [ %13, %12 ]
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = cmpxchg i32* %0, i32 0, i32 1 seq_cst seq_cst
%8 = extractvalue { i32, i1 } %7, 1
br i1 %8, label %16, label %9
9: ; preds = %2, %6
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 10000
br i1 %11, label %14, label %12
12: ; preds = %9, %14
%13 = phi i32 [ %10, %9 ], [ 0, %14 ]
br label %2
14: ; preds = %9
%15 = tail call i32 (...) @sched_yield()
br label %12
16: ; preds = %6
ret void
}
void vectorMultiply(float *vxptr, float *vyptr, float f) {
  *vxptr *= f;
  *vyptr *= f;
}


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

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

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

LLVM IR (-O2):
define void @vectorMultiply(float* nocapture %0, float* nocapture %1, float %2) {
%4 = load float, float* %0
%5 = fmul float %4, %2
store float %5, float* %0
%6 = load float, float* %1
%7 = fmul float %6, %2
store float %7, float* %1
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void resetInvalidCharCodeToSafeDefault(int32_t *pCh) {
  if ((*pCh < 0) || (*pCh > 255))
    *pCh = ' ';
}


x86 assembly (clang, -O0):
<resetInvalidCharCodeToSafeDefault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1125 <resetInvalidCharCodeToSafeDefault+0x25>
mov    -0x8(%rbp),%rax
cmpl   $0xff,(%rax)
jle    112f <resetInvalidCharCodeToSafeDefault+0x2f>
mov    -0x8(%rbp),%rax
movl   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetInvalidCharCodeToSafeDefault>:
cmpl   $0x100,(%rdi)
jb     110e <resetInvalidCharCodeToSafeDefault+0xe>
movl   $0x20,(%rdi)
ret

LLVM IR (-O0):
define void @resetInvalidCharCodeToSafeDefault(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 255
br i1 %9, label %10, label %12
10: ; preds = %6, %1
%11 = load i32*, i32** %2
store i32 32, i32* %11
br label %12
12: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
define void @resetInvalidCharCodeToSafeDefault(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 255
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 32, i32* %0
br label %5
5: ; preds = %1, %4
ret void
}
/* Variables and functions */
float clampf(float);
int f2i(float);
int clamp8(float x) { return f2i(clampf(x) * 255.0f); }


x86 assembly (clang, -O0):
<clamp8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <clampf@plt>
movss  0xec1(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1040 <f2i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp8>:
push   %rax
call   1030 <clampf@plt>
mulss  0xed2(%rip),%xmm0
pop    %rax
jmp    1040 <f2i@plt>

LLVM IR (-O0):
define i32 @clamp8(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @clampf(float %3)
%5 = fmul float %4, 2.550000e+02
%6 = call i32 @f2i(float %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @clamp8(float %0) {
%2 = tail call float @clampf(float %0)
%3 = fmul float %2, 2.550000e+02
%4 = tail call i32 @f2i(float %3)
ret i32 %4
}
int test_imm_2Cuint8_mem(unsigned char *val) {
  return ((*val) & (0x2C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Cuint8_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, 44
%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_2Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 44
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void memset(char *adr, char val, int len) {
  __asm__("rep stosb " ::"D"(adr), "al"(val), "c"(len) :);
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%ecx
rep stos %al,%es:(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %edx,%ecx
rep stos %al,%es:(%rdi)
ret

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

LLVM IR (-O2):
define void @memset(i8* %0, i8 signext %1, i32 %2) {
tail call void asm sideeffect "rep stosb ", "{di},{ax}l,{cx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *thr_fn2(void *arg) {
  printf("in thr_fn2:\n");
  pthread_exit((void *)2);
}


x86 assembly (clang, -O0):
<thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"in thr_fn2:\0A\00"
define i8* @thr_fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [12 x i8] c"in thr_fn2:\00"
define noalias i8* @thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* undef
}
int idiv_ceil(int a, int b) {
  int d = a / b;
  if (d * b < a)
    d += 1;
  return d;
}


x86 assembly (clang, -O0):
<idiv_ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <idiv_ceil+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idiv_ceil>:
mov    %edi,%eax
cltd
idiv   %esi
imul   %eax,%esi
xor    %ecx,%ecx
cmp    %edi,%esi
setl   %cl
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @idiv_ceil(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = mul nsw i32 %3, %1
%5 = icmp slt i32 %4, %0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
double dotproduct(double x1, double y1, double x2, double y2) {
  return x1 * x2 + y1 * y2;
}


x86 assembly (clang, -O0):
<dotproduct>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotproduct>:
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dotproduct(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %6
%12 = load double, double* %8
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
ret double %14
}

LLVM IR (-O2):
define double @dotproduct(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, %3
%6 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int x, y;
  x = 10;
  y = 15;
  y = y + x;
  printf("The sum of x and y is %d ", y);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x19,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"The sum of x and y is %d \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 15, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %1
%5 = add nsw i32 %3, %4
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"The sum of x and y is %d \00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 25)
ret void
}
int addit(int a, int b) { return a + b; }


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

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

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

LLVM IR (-O2):
define i32 @addit(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int readl(unsigned int *);
int /*<<< orphan*/ writel(int, unsigned int *);
void u8500_prcmu_enable(unsigned int *reg) {
  writel(readl(reg) | (1 << 8), reg);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readl@plt>
mov    %eax,%edi
or     $0x100,%edi
mov    -0x8(%rbp),%rsi
call   1040 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
call   1030 <readl@plt>
or     $0x100,%eax
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <writel@plt>

LLVM IR (-O0):
define void @u8500_prcmu_enable(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @readl(i32* %3)
%5 = or i32 %4, 256
%6 = load i32*, i32** %2
%7 = call i32 @writel(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @u8500_prcmu_enable(i32* %0) {
%2 = tail call i32 @readl(i32* %0)
%3 = or i32 %2, 256
%4 = tail call i32 @writel(i32 %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ upcrt_clear_all_puts();
extern void upcrt_before_barrier(int barrierval, int flag) {
  upcrt_clear_all_puts();
}


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

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

LLVM IR (-O0):
define void @upcrt_before_barrier(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @upcrt_clear_all_puts()
ret void
}

LLVM IR (-O2):
define void @upcrt_before_barrier(i32 %0, i32 %1) {
%3 = tail call i32 (...) @upcrt_clear_all_puts()
ret void
}
int fibonacci(int k) {
  if (k < 3)
    return 1;
  return fibonacci(k - 1) + fibonacci(k - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1131 <fibonacci+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fibonacci+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fibonacci+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fibonacci+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}