xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
void STRAPPEND(char *S1, char *S2) {
  if ((int)strlen(S1) + (int)strlen(S2) <= 255)
    strcat(S1, S2);
}


x86 assembly (clang, -O0):
<STRAPPEND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cmp    $0xff,%eax
jg     1165 <STRAPPEND+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STRAPPEND>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %ebx,%eax
cmp    $0xff,%eax
jg     1154 <STRAPPEND+0x34>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcat@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @STRAPPEND(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
%12 = icmp sle i32 %11, 255
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @strcat(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
define void @STRAPPEND(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, %4
%8 = icmp slt i32 %7, 256
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @strcat(i8* %0, i8* %1)
br label %11
11: ; preds = %9, %2
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
int /*<<< orphan*/ clist_add(struct list_head *, struct list_head *);
void clist_move(struct list_head *list, struct list_head *head) {
  __list_del_entry(list);
  clist_add(list, head);
}


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

x86 assembly (clang, -O2):
<clist_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clist_add@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @clist_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @__list_del_entry(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @clist_add(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @clist_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%4 = tail call i32 @clist_add(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
const char *eat(const char *str, char c) {
  while (*str == c)
    str++;
  return str;
}


x86 assembly (clang, -O0):
<eat>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1132 <eat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <eat+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
cmp    %sil,0x1(%rcx)
je     1110 <eat+0x10>
ret

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

LLVM IR (-O2):
define i8* @eat(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret i8* %4
}
void free_int(int *val) {}


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

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

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

LLVM IR (-O2):
define void @free_int(i32* nocapture %0) {
ret void
}
void XkbAllocClientMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocClientMap() {
ret void
}
int contains(char *beseda, int c, int indeks) {
  int i;
  for (i = 0; i < indeks; i++) {
    if (beseda[i] - '0' == c) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1158 <contains+0x58>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
cmp    -0x14(%rbp),%eax
jne    1145 <contains+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115f <contains+0x5f>
jmp    114a <contains+0x4a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <contains+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
test   %edx,%edx
jle    1124 <contains+0x24>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movsbl (%rdi,%rcx,1),%edx
add    $0xffffffd0,%edx
cmp    %esi,%edx
je     1127 <contains+0x27>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <contains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, -48
%15 = icmp eq i32 %14, %1
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %17, label %7
17: ; preds = %9, %7, %3
%18 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex16(int, unsigned short);
void print_crit_hex16(unsigned short value) { __console_tx_hex16(2, value); }


x86 assembly (clang, -O0):
<print_crit_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x2,%edi
movzwl -0x2(%rbp),%esi
call   1030 <__console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_crit_hex16>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <__console_tx_hex16@plt>

LLVM IR (-O0):
define void @print_crit_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__console_tx_hex16(i32 2, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_crit_hex16(i16 zeroext %0) {
%2 = tail call i32 @__console_tx_hex16(i32 2, i16 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hp2();
void hp1(void) { hp2(); }


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

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

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

LLVM IR (-O2):
define void @hp1() {
%1 = tail call i32 (...) @hp2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void fuzzmethod_getopt3_usage() {
  printf("::fuzzmethod_getopt3_usage::\n");
  printf("\tifuzz 3 directory/ <-o optstring> [-e extra-args] [-f first_arg] "
         "[-l last_arg] [-s]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<fuzzmethod_getopt3_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fuzzmethod_getopt3_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"::fuzzmethod_getopt3_usage::\0A\00"
@.str.1 = [86 x i8] c"\09ifuzz 3 directory/ <-o optstring> [-e extra-args] [-f first_arg] [-l last_arg] [-s]\0A\00"
define void @fuzzmethod_getopt3_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [29 x i8] c"::fuzzmethod_getopt3_usage::\00"
@str.2 = [85 x i8] c"\09ifuzz 3 directory/ <-o optstring> [-e extra-args] [-f first_arg] [-l last_arg] [-s]\00"
define void @fuzzmethod_getopt3_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(size_t);
unsigned int *alloc_uivector(unsigned int nh) {
  return (unsigned int *)malloc((size_t)((nh + 1) * (sizeof(unsigned int))));
}


x86 assembly (clang, -O0):
<alloc_uivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
shl    $0x2,%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_uivector>:
add    $0x1,%edi
shl    $0x2,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @alloc_uivector(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1
%5 = zext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}

LLVM IR (-O2):
define i32* @alloc_uivector(i32 %0) {
%2 = add i32 %0, 1
%3 = zext i32 %2 to i64
%4 = shl nuw nsw i64 %3, 2
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int yil_exit(int argc, char **argv) {
  int retval = 0;
  if (argc > 1) {
    retval = atoi(argv[1]);
  }
  exit(retval);
  return retval;
}


x86 assembly (clang, -O0):
<yil_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1150 <yil_exit+0x30>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yil_exit>:
push   %rax
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x2,%eax
jl     1135 <yil_exit+0x15>
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @yil_exit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %5
br label %13
13: ; preds = %8, %2
%14 = load i32, i32* %5
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
define i32 @yil_exit(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char c = 'A';
  char *p, **q;
  p = &c;
  q = &p;
  **q = 'B';
  printf("Value of c : %c\n", c);
  printf("Value of c : %c\n", *p);
  printf("Value of c : %c\n", **q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movb   $0x42,(%rax)
lea    0xebc(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
lea    0xea8(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
lea    0xe92(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x42,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Value of c : %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8**
store i32 0, i32* %1
store i8 65, i8* %2
store i8* %2, i8** %3
store i8** %3, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
store i8 66, i8* %6
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Value of c : %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext 66)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext 66)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext 66)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ rb_test();
void main(void) {
  if (rb_test())
    printf("Pass\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rb_test@plt>
cmp    $0x0,%rax
je     1141 <main+0x21>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rb_test@plt>
test   %rax,%rax
je     113a <main+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Pass\0A\00"
define void @main() {
%1 = call i64 (...) @rb_test()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"Pass\00"
define void @main() {
%1 = tail call i64 (...) @rb_test()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int main(void) {
  int c;
  while ((c = getchar()) != EOF)
    if (c > 127)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%eax
je     1153 <main+0x43>
cmpl   $0x7f,-0x8(%rbp)
jle    114e <main+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    115a <main+0x4a>
jmp    111f <main+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%r14),%eax
je     1138 <main+0x28>
cmp    $0x80,%eax
jl     1120 <main+0x10>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 127
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %1
br label %13
11: ; preds = %7
br label %3
12: ; preds = %3
store i32 0, i32* %1
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = icmp sgt i32 %2, 127
br i1 %6, label %7, label %1
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
int main() {
  int i = 0;
  if (i++) {
    short a = 4;
  }
  short b = 999;
  return 20;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     112c <main+0x2c>
movw   $0x4,-0xa(%rbp)
movw   $0x3e7,-0xc(%rbp)
mov    $0x14,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i32 0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i16 4, i16* %3
br label %9
9: ; preds = %8, %0
store i16 999, i16* %4
ret i32 20
}

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

/* Variables and functions */
int /*<<< orphan*/ vt_write_str(char *);
int /*<<< orphan*/ vt_write_uint8(scalar_t__);
void _color_set(uint8_t type, uint8_t color) {
  vt_write_str("\x1B"
               "[");
  vt_write_uint8(type + color);
  vt_write_str("m");
}


x86 assembly (clang, -O0):
<_color_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
call   1030 <vt_write_uint8@plt>
lea    0xeb3(%rip),%rdi
call   1040 <vt_write_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_color_set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1040 <vt_write_str@plt>
add    %r14,%rbx
mov    %rbx,%rdi
call   1030 <vt_write_uint8@plt>
lea    0xebb(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vt_write_str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1B[\00"
@.str.1 = [2 x i8] c"m\00"
define void @_color_set(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add nsw i64 %6, %7
%9 = call i32 @vt_write_uint8(i64 %8)
%10 = call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1B[\00"
@.str.1 = [2 x i8] c"m\00"
define void @_color_set(i64 %0, i64 %1) {
%3 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i64 %1, %0
%5 = tail call i32 @vt_write_uint8(i64 %4)
%6 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pt3_decode();
int /*<<< orphan*/ pt3_play();
void play_music() {
  pt3_decode();
  pt3_play();
}


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

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

LLVM IR (-O0):
define void @play_music() {
%1 = call i32 (...) @pt3_decode()
%2 = call i32 (...) @pt3_play()
ret void
}

LLVM IR (-O2):
define void @play_music() {
%1 = tail call i32 (...) @pt3_decode()
%2 = tail call i32 (...) @pt3_play()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void printsafe(char *string) { write(0, string, strlen(string)); }


x86 assembly (clang, -O0):
<printsafe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
xor    %edi,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printsafe>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @printsafe(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 0, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @printsafe(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 0, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ prj_get_prelinkcommands();
int prj_getlistsize(void **);
int prj_get_numprelinkcommands() {
  return prj_getlistsize((void **)prj_get_prelinkcommands());
}


x86 assembly (clang, -O0):
<prj_get_numprelinkcommands>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <prj_get_prelinkcommands@plt>
mov    %rax,%rdi
call   1030 <prj_getlistsize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prj_get_numprelinkcommands>:
push   %rax
xor    %eax,%eax
call   1040 <prj_get_prelinkcommands@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <prj_getlistsize@plt>

LLVM IR (-O0):
define i32 @prj_get_numprelinkcommands() {
%1 = call i64 (...) @prj_get_prelinkcommands()
%2 = inttoptr i64 %1 to i8**
%3 = call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @prj_get_numprelinkcommands() {
%1 = tail call i64 (...) @prj_get_prelinkcommands()
%2 = inttoptr i64 %1 to i8**
%3 = tail call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, char *, char *, char *,
                          char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  execlp("xterm", "xterm", "-e", "./echocli", "127.0.0.1", "4", (char *)0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rsi
lea    0xec9(%rip),%rdx
lea    0xec5(%rip),%rcx
lea    0xec8(%rip),%r8
lea    0xecb(%rip),%r9
xor    %eax,%eax
mov    %rsi,%rdi
movq   $0x0,(%rsp)
call   1040 <execlp@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
lea    0xecf(%rip),%rdx
lea    0xecb(%rip),%rcx
lea    0xece(%rip),%r8
lea    0xed1(%rip),%r9
mov    %rdi,%rsi
call   1040 <execlp@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"xterm\00"
@.str.1 = [3 x i8] c"-e\00"
@.str.2 = [10 x i8] c"./echocli\00"
@.str.3 = [10 x i8] c"127.0.0.1\00"
@.str.4 = [2 x i8] c"4\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* null)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"xterm\00"
@.str.1 = [3 x i8] c"-e\00"
@.str.2 = [10 x i8] c"./echocli\00"
@.str.3 = [10 x i8] c"127.0.0.1\00"
@.str.4 = [2 x i8] c"4\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* null)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (!ptr)
    return;
  free(ptr);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <xfree+0x1c>
jmp    1135 <xfree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
struct Stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int fstat(int, struct Stat *);
int open(char const *, int);
int stat(const char *path, struct Stat *stat) {
  int fd, r;
  if ((fd = open(path, 0x0000)) < 0)
    return fd;
  r = fstat(fd, stat);
  close(fd);
  return r;
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1162 <stat+0x32>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <stat+0x4f>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1050 <fstat@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
js     115a <stat+0x2a>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <fstat@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%eax
jmp    115c <stat+0x2c>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.Stat = type { i32 }
define i32 @stat(i8* %0, %struct.Stat* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.Stat*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store %struct.Stat* %1, %struct.Stat** %5
%8 = load i8*, i8** %4
%9 = call i32 @open(i8* %8, i32 0)
store i32 %9, i32* %6
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %20
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load %struct.Stat*, %struct.Stat** %5
%16 = call i32 @fstat(i32 %14, %struct.Stat* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @close(i32 %17)
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.Stat = type { i32 }
define i32 @stat(i8* nocapture %0, %struct.Stat* nocapture %1) {
%3 = tail call i32 @open(i8* %0, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fstat(i32 %3, %struct.Stat* %1)
%7 = tail call i32 @close(i32 %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ analog_et(int);
int /*<<< orphan*/ msleep(int);
int et_avg(int port) {
  int totalcount = 100;
  int run = 0;
  int i;
  for (i = 0; i < totalcount; i++) {
    run += analog_et(port);
    msleep(2);
  }
  return run / totalcount;
}


x86 assembly (clang, -O0):
<et_avg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1179 <et_avg+0x59>
mov    -0x4(%rbp),%edi
call   1040 <analog_et@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <msleep@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <et_avg+0x20>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<et_avg>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %ebp,%ebp
mov    $0x64,%ebx
xchg   %ax,%ax
mov    %r14d,%edi
call   1040 <analog_et@plt>
add    %eax,%ebp
mov    $0x2,%edi
call   1030 <msleep@plt>
add    $0xffffffff,%ebx
jne    1130 <et_avg+0x10>
movslq %ebp,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @et_avg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 100, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i64 @analog_et(i32 %11)
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = add nsw i64 %14, %12
%16 = trunc i64 %15 to i32
store i32 %16, i32* %4
%17 = call i32 @msleep(i32 2)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = sdiv i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @et_avg(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = phi i32 [ 0, %1 ], [ %7, %2 ]
%5 = tail call i64 @analog_et(i32 %0)
%6 = trunc i64 %5 to i32
%7 = add i32 %4, %6
%8 = tail call i32 @msleep(i32 2)
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = sdiv i32 %7, 100
ret i32 %12
}
unsigned int ipmi_hash_pointer(void *ptr) {
  unsigned long val = (unsigned long)ptr;
  return val >> 5;
}


x86 assembly (clang, -O0):
<ipmi_hash_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x5,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipmi_hash_pointer>:
mov    %rdi,%rax
shr    $0x5,%rax
ret

LLVM IR (-O0):
define i32 @ipmi_hash_pointer(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = lshr i64 %6, 5
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ipmi_hash_pointer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 5
%4 = trunc i64 %3 to i32
ret i32 %4
}
int main() {
  int rv = 1;
  int value;
  int amount;
  rv = value >> amount;
  return rv;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
int fun188() { return 188; }


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

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

LLVM IR (-O0):
define i32 @fun188() {
ret i32 188
}

LLVM IR (-O2):
define i32 @fun188() {
ret i32 188
}
unsigned long long fib_recur(unsigned long long n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  }
  return fib_recur(n - 1) + fib_recur(n - 2);
}


x86 assembly (clang, -O0):
<fib_recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <fib_recur+0x24>
movq   $0x0,-0x8(%rbp)
jmp    117d <fib_recur+0x6d>
cmpq   $0x1,-0x10(%rbp)
jne    114c <fib_recur+0x3c>
movq   $0x1,-0x8(%rbp)
jmp    117d <fib_recur+0x6d>
jmp    1151 <fib_recur+0x41>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib_recur@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib_recur@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_recur>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
cmp    $0x2,%rbx
jb     1136 <fib_recur+0x26>
lea    -0x1(%rbx),%rdi
call   1030 <fib_recur@plt>
add    %rax,%r14
add    $0xfffffffffffffffe,%rbx
cmp    $0x2,%rbx
jae    1120 <fib_recur+0x10>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib_recur(i64 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ 0, %1 ], [ %10, %6 ]
%4 = phi i64 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i64 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add i64 %4, -1
%8 = tail call i64 @fib_recur(i64 %7)
%9 = add i64 %4, -2
%10 = add i64 %8, %3
br label %2
11: ; preds = %2
%12 = add i64 %4, %3
ret i64 %12
}
int compare(const void *a, const void *b) {
  return (*(double *)a > *(double *)b);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int re_match(char const *, char *);
int validate_hex32(const char *str) {
  if (!str)
    return 0;
  return re_match(str, "^[0-9a-fA-F]{8}$");
}


x86 assembly (clang, -O0):
<validate_hex32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <validate_hex32+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1146 <validate_hex32+0x36>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <re_match@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_hex32>:
test   %rdi,%rdi
je     1121 <validate_hex32+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <re_match@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"^[0-9a-fA-F]{8}$\00"
define i32 @validate_hex32(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @re_match(i8* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"^[0-9a-fA-F]{8}$\00"
define i32 @validate_hex32(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @re_match(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal_error(const char *msg) {
  fprintf(stderr, "command queue: %s\n", msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"command queue: %s\0A\00"
define void @fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"command queue: %s\0A\00"
define void @fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t lte_int32_t(int32_t a, int32_t b) { return a <= b; }


x86 assembly (clang, -O0):
<lte_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lte_int32_t>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @lte_int32_t(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lte_int32_t(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
long _block_size(long idx) { return (1 << idx); }


x86 assembly (clang, -O0):
<_block_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_block_size>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

LLVM IR (-O0):
define i64 @_block_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @_block_size(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int getMem2(char **p) {
  if (p == NULL) {
    return -1;
  }
  char *tmp = (char *)malloc(100);
  if (tmp == NULL) {
    return -2;
  }
  strcpy(tmp, "ALGKJDLSJGLKDSJ");
  *p = tmp;
  return 0;
}


x86 assembly (clang, -O0):
<getMem2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <getMem2+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <getMem2+0x6a>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <getMem2+0x48>
movl   $0xfffffffe,-0x4(%rbp)
jmp    118a <getMem2+0x6a>
mov    -0x18(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMem2>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1154 <getMem2+0x34>
mov    %rdi,%r14
mov    $0x64,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     115b <getMem2+0x3b>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,(%r14)
xor    %eax,%eax
jmp    1160 <getMem2+0x40>
mov    $0xffffffff,%eax
jmp    1160 <getMem2+0x40>
mov    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"ALGKJDLSJGLKDSJ\00"
define i32 @getMem2(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = icmp eq i8** %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %19
8: ; preds = %1
%9 = call i64 @malloc(i32 100)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 -2, i32* %2
br label %19
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %4
%18 = load i8**, i8*** %3
store i8* %17, i8** %18
store i32 0, i32* %2
br label %19
19: ; preds = %14, %13, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [16 x i8] c"ALGKJDLSJGLKDSJ\00"
define i32 @getMem2(i8** writeonly %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %0
br label %9
9: ; preds = %7, %3, %1
%10 = phi i32 [ -1, %1 ], [ 0, %7 ], [ -2, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int vain() {
  int my_var = 5;
  printf("Hello world\n");
  return 0;
}


x86 assembly (clang, -O0):
<vain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @vain() {
%1 = alloca i32
store i32 5, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @vain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}