xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ msg_print(char *);
scalar_t__ target_set_interactive(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void do_cmd_look(void) {
  if (target_set_interactive(0x0002, 0, 0, 0, 0, 0)) {
    msg_print("Target Selected.");
  }
}


x86 assembly (clang, -O0):
<do_cmd_look>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <target_set_interactive@plt>
cmp    $0x0,%rax
je     1153 <do_cmd_look+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <msg_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_look>:
push   %rax
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <target_set_interactive@plt>
test   %rax,%rax
je     1149 <do_cmd_look+0x29>
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1040 <msg_print@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Target Selected.\00"
define void @do_cmd_look() {
%1 = call i64 @target_set_interactive(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Target Selected.\00"
define void @do_cmd_look() {
%1 = tail call i64 @target_set_interactive(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ two();
void one_three(void) {
  printf("one\n");
  two();
  printf("three\n");
}


x86 assembly (clang, -O0):
<one_three>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <two@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_three>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <two@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"one\0A\00"
@.str.1 = [7 x i8] c"three\0A\00"
define void @one_three() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @two()
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"one\00"
@str.2 = [6 x i8] c"three\00"
define void @one_three() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @two()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
int /*<<< orphan*/ printf(char *, double);
int main(void) { printf("%f\n", exp(1.0)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
call   1040 <exp@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = call double @exp(double 1.000000e+00)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x4005BF0A8B145769)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FOURCC(char, char, char, char);
int /*<<< orphan*/ NodeUnRegisterClass(int /*<<< orphan*/);
void NSV_Done() { NodeUnRegisterClass(FOURCC('R', 'N', 'S', 'V')); }


x86 assembly (clang, -O0):
<NSV_Done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x52,%edi
mov    $0x4e,%esi
mov    $0x53,%edx
mov    $0x56,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NSV_Done>:
push   %rax
mov    $0x52,%edi
mov    $0x4e,%esi
mov    $0x53,%edx
mov    $0x56,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <NodeUnRegisterClass@plt>

LLVM IR (-O0):
define void @NSV_Done() {
%1 = call i32 @FOURCC(i8 signext 82, i8 signext 78, i8 signext 83, i8 signext 86)
%2 = call i32 @NodeUnRegisterClass(i32 %1)
ret void
}

LLVM IR (-O2):
define void @NSV_Done() {
%1 = tail call i32 @FOURCC(i8 signext 82, i8 signext 78, i8 signext 83, i8 signext 86)
%2 = tail call i32 @NodeUnRegisterClass(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *normalize(char *);
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *, char *);
void serv_chat_invite(int id, char *message, char *name) {
  char buf[2048 * 2];
  snprintf(buf, sizeof(buf) / 2, "toc_chat_invite %d \"%s\" %s", id, message,
           normalize(name));
  sflap_send(buf, -1, 2);
}


x86 assembly (clang, -O0):
<serv_chat_invite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1020(%rbp),%rax
mov    %rax,-0x1038(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x102c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x1028(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <normalize@plt>
mov    -0x1038(%rbp),%rdi
mov    -0x102c(%rbp),%ecx
mov    -0x1028(%rbp),%r8
mov    %rax,%r9
mov    $0x800,%esi
lea    0xe6c(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x1020(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x1040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_chat_invite>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <normalize@plt>
lea    0xeb1(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x800,%esi
mov    %ebp,%ecx
mov    %rbx,%r8
mov    %rax,%r9
call   1030 <snprintf@plt>
mov    %r14,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"toc_chat_invite %d \22%s\22 %s\00"
define void @serv_chat_invite(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [4096 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i8* @normalize(i8* %11)
%13 = call i32 @snprintf(i8* %8, i32 2048, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8* %12)
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%15 = call i32 @sflap_send(i8* %14, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"toc_chat_invite %d \22%s\22 %s\00"
define void @serv_chat_invite(i32 %0, i8* %1, i8* %2) {
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%6 = tail call i8* @normalize(i8* %2)
%7 = call i32 @snprintf(i8* %5, i32 2048, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %6)
%8 = call i32 @sflap_send(i8* %5, i32 -1, i32 2)
ret void
}
/* Variables and functions */
unsigned int CLOCKS_PER_SEC;
unsigned int clock();
void delay(void) {
  unsigned int temp;
  temp = clock() + CLOCKS_PER_SEC;
  while (clock() <= temp)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    0x2ec2(%rip),%rcx
add    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cmp    -0x4(%rbp),%eax
ja     1140 <delay+0x30>
jmp    112b <delay+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebx
mov    0x2ec7(%rip),%rax
add    (%rax),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %ebx,%eax
jbe    1130 <delay+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @delay() {
%1 = tail call i32 (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = add i32 %2, %1
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @clock()
%6 = icmp ugt i32 %5, %3
br i1 %6, label %7, label %4
7: ; preds = %4
ret void
}
/* Type definitions */
struct iam_rec {
  int dummy;
};
struct iam_leaf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ e_rec(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, struct iam_rec const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ n_cur(struct iam_leaf *);
int /*<<< orphan*/ rec_size(struct iam_rec const *);
void __lvar_rec_set(struct iam_leaf *l, const struct iam_rec *r) {
  memcpy(e_rec(n_cur(l)), r, rec_size(r));
}


x86 assembly (clang, -O0):
<__lvar_rec_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <n_cur@plt>
mov    %eax,%edi
call   1060 <e_rec@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rec_size@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lvar_rec_set>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <n_cur@plt>
mov    %eax,%edi
call   1060 <e_rec@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <rec_size@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
%struct.iam_rec = type { i32 }
define void @__lvar_rec_set(%struct.iam_leaf* %0, %struct.iam_rec* %1) {
%3 = alloca %struct.iam_leaf*
%4 = alloca %struct.iam_rec*
store %struct.iam_leaf* %0, %struct.iam_leaf** %3
store %struct.iam_rec* %1, %struct.iam_rec** %4
%5 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%6 = call i32 @n_cur(%struct.iam_leaf* %5)
%7 = call i32 @e_rec(i32 %6)
%8 = load %struct.iam_rec*, %struct.iam_rec** %4
%9 = load %struct.iam_rec*, %struct.iam_rec** %4
%10 = call i32 @rec_size(%struct.iam_rec* %9)
%11 = call i32 @memcpy(i32 %7, %struct.iam_rec* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
%struct.iam_rec = type { i32 }
define void @__lvar_rec_set(%struct.iam_leaf* %0, %struct.iam_rec* %1) {
%3 = tail call i32 @n_cur(%struct.iam_leaf* %0)
%4 = tail call i32 @e_rec(i32 %3)
%5 = tail call i32 @rec_size(%struct.iam_rec* %1)
%6 = tail call i32 @memcpy(i32 %4, %struct.iam_rec* %1, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int raise(int sig) {
  puts("libgcc error. div by zero?\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
jmp    1127 <raise+0x17>

x86 assembly (clang, -O2):
<raise>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <raise+0x10>

LLVM IR (-O0):
@.str = [28 x i8] c"libgcc error. div by zero?\0A\00"
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [28 x i8] c"libgcc error. div by zero?\0A\00"
define i32 @raise(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char const *, int);
int readIntFromByteArray(const char *byteArray, const int offset) {
  int val;
  memcpy(&val, byteArray + offset, sizeof(int));
  return val;
}


x86 assembly (clang, -O0):
<readIntFromByteArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readIntFromByteArray>:
push   %rax
movslq %esi,%rsi
add    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @readIntFromByteArray(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = call i32 @memcpy(i32* %3, i8* %6, i32 4)
%8 = load i32, i32* %3
ret i32 %8
}
void baz(unsigned long x, unsigned long y, unsigned long z, unsigned long p,
         unsigned long q) {
  __asm__ __volatile__("" ::"r"(q << 2) : "memory");
  __asm__ __volatile__("" ::"r"(z) : "memory");
  if (x & 0x1)
    __asm__ __volatile__("" ::"r"(y), "r"(p) : "memory");
  if (x & 0x2)
    __asm__ __volatile__("" ::"r"(y), "r"(p) : "memory");
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x2,%rax
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     113e <baz+0x3e>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     1158 <baz+0x58>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
shl    $0x2,%r8
test   $0x1,%dil
jne    1111 <baz+0x11>
test   $0x2,%dil
jne    1117 <baz+0x17>
ret
test   $0x2,%dil
je     1110 <baz+0x10>
ret

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

LLVM IR (-O2):
define void @baz(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = shl i64 %4, 2
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %2)
%7 = and i64 %0, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %5
tail call void asm sideeffect "", "r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %3)
br label %10
10: ; preds = %9, %5
%11 = and i64 %0, 2
%12 = icmp eq i64 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10
tail call void asm sideeffect "", "r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %3)
br label %14
14: ; preds = %13, %10
ret void
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
void vector_unset(uint *bitvector, uint pos) {
  int word_num = (pos >> 5);
  int bit_num = (pos & (sizeof(uint) * 8 - 1));
  bitvector[word_num] &= ~(1 << bit_num);
}


x86 assembly (clang, -O0):
<vector_unset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
movslq -0xc(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_unset>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x5,%eax
mov    $0xfffffffe,%edx
rol    %cl,%edx
cltq
and    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @vector_unset(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 5
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = and i64 %10, 31
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = and i32 %20, %15
store i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @vector_unset(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = xor i32 %5, -1
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = and i32 %9, %6
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void displayUsage(void) {
  puts("tsp-ga - A genetic algorithm to solve TSP problems.\n");
  puts("usage: tsp-ga [-f <filename>]");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<displayUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<displayUsage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"tsp-ga - A genetic algorithm to solve TSP problems.\0A\00"
@.str.1 = [30 x i8] c"usage: tsp-ga [-f <filename>]\00"
@EXIT_FAILURE = global i32 0
define void @displayUsage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"tsp-ga - A genetic algorithm to solve TSP problems.\0A\00"
@.str.1 = [30 x i8] c"usage: tsp-ga [-f <filename>]\00"
@EXIT_FAILURE = global i32 0
define void @displayUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(FILE *_stream, const char *_format, ...) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @fprintf(i32* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
void smp_mb_global_init(void) {}


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

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

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

LLVM IR (-O2):
define void @smp_mb_global_init() {
ret void
}
/* Variables and functions */
float c_sasum(int, float *, int);
int /*<<< orphan*/ printf(char *, float);
int main() {
  float x[] = {1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0};
  int N = 8;
  int strideX = 1;
  float sum = c_sasum(N, x, strideX);
  printf("sum: %f\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x8,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <c_sasum@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edi
mov    $0x1,%edx
call   1040 <c_sasum@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float -2.000000e+00, float 3.000000e+00, float -4.000000e+00, float 5.000000e+00, float -6.000000e+00, float 7.000000e+00, float -8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 8, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @c_sasum(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float -2.000000e+00, float 3.000000e+00, float -4.000000e+00, float 5.000000e+00, float -6.000000e+00, float 7.000000e+00, float -8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @c_sasum(i32 8, float* %3, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
double log(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double x, ret;
  x = 2.7;
  ret = log(x);
  printf("log(%lf) = %lf\n", x, ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"log(%lf) = %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 2.700000e+00, double 0x3FEFC8B7F138BDEA)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void tyo_(char c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<tyo_>:
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>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tyo_(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_and_set(int *);
int *malloc(int);
int main(void) {
  int *p = malloc(sizeof(int));
  *p = 0;
  check_and_set(p);
  check_and_set(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,(%rax)
mov    %rax,%rdi
call   1030 <check_and_set@plt>
mov    %rbx,%rdi
call   1030 <check_and_set@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
store i32 0, i32* %1
%2 = tail call i32 @check_and_set(i32* %1)
%3 = tail call i32 @check_and_set(i32* %1)
ret i32 0
}
int Serve1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @Serve1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Serve1() {
ret i32 1
}
/* Type definitions */
struct hlist_node {
  int dummy;
};
struct hlist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _hlist_add_head(struct hlist_head *, struct hlist_node *);
void hlist_add_head(struct hlist_head *h, struct hlist_node *n) {
  _hlist_add_head(h, n);
}


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

x86 assembly (clang, -O2):
<hlist_add_head>:
jmp    1030 <_hlist_add_head@plt>

LLVM IR (-O0):
%struct.hlist_head = type { i32 }
%struct.hlist_node = type { i32 }
define void @hlist_add_head(%struct.hlist_head* %0, %struct.hlist_node* %1) {
%3 = alloca %struct.hlist_head*
%4 = alloca %struct.hlist_node*
store %struct.hlist_head* %0, %struct.hlist_head** %3
store %struct.hlist_node* %1, %struct.hlist_node** %4
%5 = load %struct.hlist_head*, %struct.hlist_head** %3
%6 = load %struct.hlist_node*, %struct.hlist_node** %4
%7 = call i32 @_hlist_add_head(%struct.hlist_head* %5, %struct.hlist_node* %6)
ret void
}

LLVM IR (-O2):
%struct.hlist_head = type { i32 }
%struct.hlist_node = type { i32 }
define void @hlist_add_head(%struct.hlist_head* %0, %struct.hlist_node* %1) {
%3 = tail call i32 @_hlist_add_head(%struct.hlist_head* %0, %struct.hlist_node* %1)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
__attribute__((__always___)) void *chpl_calloc(size_t n, size_t size) {
  return calloc(n, size);
}


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

x86 assembly (clang, -O2):
<chpl_calloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @chpl_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
int test_imm_EFint16_reg(short val) {
  return ((val) & (-0xEF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EFint16_reg>:
test   $0xff11,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EFint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -239
%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_EFint16_reg(i16 signext %0) {
%2 = and i16 %0, -239
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int bnxt_init_tc(struct bnxt *bp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.bnxt = type opaque
define i32 @bnxt_init_tc(%struct.bnxt* nocapture readnone %0) {
ret i32 0
}
int main(void) {
  int x = 100;
  char ch = 'A';
  float realNumber = 10.2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movb   $0x41,-0x9(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca float
store i32 0, i32* %1
store i32 100, i32* %2
store i8 65, i8* %3
store float 0x4024666660000000, float* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void set32le(uint8_t *bytes, uint32_t x) {
  bytes[0] = (uint8_t)x;
  bytes[1] = (uint8_t)(x >> 8);
  bytes[2] = (uint8_t)(x >> 16);
  bytes[3] = (uint8_t)(x >> 24);
}


x86 assembly (clang, -O0):
<set32le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set32le>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @set32le(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64 %6, i64* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = sext i32 %10 to i64
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 1
store i64 %11, i64* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = sext i32 %15 to i64
%17 = load i64*, i64** %3
%18 = getelementptr inbounds i64, i64* %17, i64 2
store i64 %16, i64* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = sext i32 %20 to i64
%22 = load i64*, i64** %3
%23 = getelementptr inbounds i64, i64* %22, i64 3
store i64 %21, i64* %23
ret void
}

LLVM IR (-O2):
define void @set32le(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = ashr i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
%7 = ashr i32 %1, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %8, i64* %9
%10 = ashr i32 %1, 24
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}
/* Variables and functions */
int primo(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Informe o numero: ");
  scanf("%d", &num);
  printf("O resultado é %d\n", primo(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <primo@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Informe o numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"O resultado \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @primo(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
struct gb_endo {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct gb_endo *);
struct gb_endo *to_gb_endo(struct device *);
void gb_endo_release(struct device *dev) {
  struct gb_endo *endo = to_gb_endo(dev);
  kfree(endo);
}


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

x86 assembly (clang, -O2):
<gb_endo_release>:
push   %rax
call   1040 <to_gb_endo@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.gb_endo = type { i32 }
define void @gb_endo_release(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca %struct.gb_endo*
store %struct.device* %0, %struct.device** %2
%4 = load %struct.device*, %struct.device** %2
%5 = call %struct.gb_endo* @to_gb_endo(%struct.device* %4)
store %struct.gb_endo* %5, %struct.gb_endo** %3
%6 = load %struct.gb_endo*, %struct.gb_endo** %3
%7 = call i32 @kfree(%struct.gb_endo* %6)
ret void
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.gb_endo = type { i32 }
define void @gb_endo_release(%struct.device* %0) {
%2 = tail call %struct.gb_endo* @to_gb_endo(%struct.device* %0)
%3 = tail call i32 @kfree(%struct.gb_endo* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function(int);
int main(void) {
  function(10);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @function(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @function(i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int sockutil_get_iface_hwaddr(int, int /*<<< orphan*/ *, size_t *);
scalar_t__ sockutil_get_sock_iface(int, int *);
int sockutil_get_sock_hwaddr(int sockfd, uint8_t *hwaddr, size_t *len) {
  int iface;
  if (sockutil_get_sock_iface(sockfd, &iface)) {
    return -1;
  }
  return sockutil_get_iface_hwaddr(iface, hwaddr, len);
}


x86 assembly (clang, -O0):
<sockutil_get_sock_hwaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <sockutil_get_sock_iface@plt>
cmp    $0x0,%rax
je     1155 <sockutil_get_sock_hwaddr+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <sockutil_get_sock_hwaddr+0x48>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sockutil_get_iface_hwaddr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockutil_get_sock_hwaddr>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0x4(%rsp),%rsi
call   1040 <sockutil_get_sock_iface@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1150 <sockutil_get_sock_hwaddr+0x30>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <sockutil_get_iface_hwaddr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sockutil_get_sock_hwaddr(i32 %0, i32* %1, i64* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64*
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i64* %2, i64** %7
%9 = load i32, i32* %5
%10 = call i64 @sockutil_get_sock_iface(i32 %9, i32* %8)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 -1, i32* %4
br label %18
13: ; preds = %3
%14 = load i32, i32* %8
%15 = load i32*, i32** %6
%16 = load i64*, i64** %7
%17 = call i32 @sockutil_get_iface_hwaddr(i32 %14, i32* %15, i64* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @sockutil_get_sock_hwaddr(i32 %0, i32* %1, i64* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i64 @sockutil_get_sock_iface(i32 %0, i32* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %4
%10 = call i32 @sockutil_get_iface_hwaddr(i32 %9, i32* %1, i64* %2)
br label %11
11: ; preds = %3, %8
%12 = phi i32 [ %10, %8 ], [ -1, %3 ]
ret i32 %12
}
void initdummy() {}


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

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

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

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

/* Type definitions */
struct TYPE_2__ {
  int bits_per_pixel;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_bits_per_pixel(void *_p, int _v) {
  ((XImage *)_p)->bits_per_pixel = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XImage_bits_per_pixel(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 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_bits_per_pixel(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void panic(const char *fmt, ...) {
  __asm__ __volatile__("cli");
  printf("KERNEL PANIC, SYSTEM HALTED\n");
  printf("Error message: ");
  printf(fmt);
  while (1) {
    __asm__ __volatile__("hlt" ::);
  }
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cli
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
hlt
jmp    1144 <panic+0x34>

x86 assembly (clang, -O2):
<panic>:
push   %rbx
mov    %rdi,%rbx
cli
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
nopl   0x0(%rax)
hlt
jmp    1150 <panic+0x30>

LLVM IR (-O0):
@.str = [29 x i8] c"KERNEL PANIC, SYSTEM HALTED\0A\00"
@.str.1 = [16 x i8] c"Error message: \00"
define void @panic(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* %5)
br label %7
7: ; preds = %1, %7
br label %7
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Error message: \00"
@str = [28 x i8] c"KERNEL PANIC, SYSTEM HALTED\00"
define void @panic(i8* nocapture %0, ...) {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0)
br label %5
5: ; preds = %1, %5
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ test_maior_valor_matriz();
int /*<<< orphan*/ test_matriz_simetrica();
int /*<<< orphan*/ test_preenche_matriz_diagonal_principal();
int /*<<< orphan*/ test_preenche_matriz_um_e_zero();
int /*<<< orphan*/ test_quadrado_magico();
int /*<<< orphan*/ test_somar_todos();
int /*<<< orphan*/ test_troca_valores();
int main() {
  test_preenche_matriz_um_e_zero();
  test_preenche_matriz_diagonal_principal();
  test_maior_valor_matriz();
  test_somar_todos();
  test_troca_valores();
  test_matriz_simetrica();
  test_quadrado_magico();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_preenche_matriz_um_e_zero@plt>
mov    $0x0,%al
call   1070 <test_preenche_matriz_diagonal_principal@plt>
mov    $0x0,%al
call   1060 <test_maior_valor_matriz@plt>
mov    $0x0,%al
call   1050 <test_somar_todos@plt>
mov    $0x0,%al
call   1080 <test_troca_valores@plt>
mov    $0x0,%al
call   1090 <test_matriz_simetrica@plt>
mov    $0x0,%al
call   1040 <test_quadrado_magico@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_preenche_matriz_um_e_zero@plt>
xor    %eax,%eax
call   1070 <test_preenche_matriz_diagonal_principal@plt>
xor    %eax,%eax
call   1060 <test_maior_valor_matriz@plt>
xor    %eax,%eax
call   1050 <test_somar_todos@plt>
xor    %eax,%eax
call   1080 <test_troca_valores@plt>
xor    %eax,%eax
call   1090 <test_matriz_simetrica@plt>
xor    %eax,%eax
call   1040 <test_quadrado_magico@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_preenche_matriz_um_e_zero()
%3 = call i32 (...) @test_preenche_matriz_diagonal_principal()
%4 = call i32 (...) @test_maior_valor_matriz()
%5 = call i32 (...) @test_somar_todos()
%6 = call i32 (...) @test_troca_valores()
%7 = call i32 (...) @test_matriz_simetrica()
%8 = call i32 (...) @test_quadrado_magico()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_preenche_matriz_um_e_zero()
%2 = tail call i32 (...) @test_preenche_matriz_diagonal_principal()
%3 = tail call i32 (...) @test_maior_valor_matriz()
%4 = tail call i32 (...) @test_somar_todos()
%5 = tail call i32 (...) @test_troca_valores()
%6 = tail call i32 (...) @test_matriz_simetrica()
%7 = tail call i32 (...) @test_quadrado_magico()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("It is expected to be empty\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"It is expected to be empty\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"It is expected to be empty\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}