xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ towerOfHanoi(int, char, char, char);
int main() {
  int n;
  printf("Enter no. of elements in Tower Of Hanoi");
  scanf("%d", &n);
  printf("\n");
  towerOfHanoi(n, 'A', 'B', 'C');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1040 <towerOfHanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <towerOfHanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Enter no. of elements in Tower Of Hanoi\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 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 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @towerOfHanoi(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Enter no. of elements in Tower Of Hanoi\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 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 = call i32 @putchar(i32 10)
%6 = load i32, i32* %1
%7 = call i32 @towerOfHanoi(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
float oprepeat3() { return -10000.0F; }


x86 assembly (clang, -O0):
<oprepeat3>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<oprepeat3>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @oprepeat3() {
ret float -1.000000e+04
}

LLVM IR (-O2):
define float @oprepeat3() {
ret float -1.000000e+04
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *pathname, mode_t mode) {
  return open(pathname, O_WRONLY | O_TRUNC | O_CREAT, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ebd(%rip),%rax
or     (%rax),%esi
mov    0x2ebc(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2eb1(%rip),%rcx
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ecd(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_WRONLY
%7 = load i32, i32* @O_TRUNC
%8 = or i32 %6, %7
%9 = load i32, i32* @O_CREAT
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_TRUNC
%5 = or i32 %4, %3
%6 = load i32, i32* @O_CREAT
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *getnext(void *);
void free_list(void *list) {
  void *next, *prev;
  next = list;
  while (next) {
    prev = next;
    next = getnext(prev);
    free(prev);
  }
}


x86 assembly (clang, -O0):
<free_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <free_list+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <getnext@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1134 <free_list+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_list>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114b <free_list+0x2b>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <getnext@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rbx
test   %r14,%r14
jne    1130 <free_list+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @free_list(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %5, %3 ], [ %0, %1 ]
%5 = tail call i8* @getnext(i8* %4)
%6 = tail call i32 @free(i8* %4)
%7 = icmp eq i8* %5, null
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct trace_s {
  int dummy;
};
struct t2ali_s {
  int dummy;
};
struct align_s {
  int dummy;
};

/* Variables and functions */
scalar_t__ Pop_t2ali(struct t2ali_s *, struct trace_s **, struct align_s **);
int /*<<< orphan*/ free(struct t2ali_s *);
void Free_t2ali(struct t2ali_s *stack) {
  while (Pop_t2ali(stack, (struct trace_s **)NULL, (struct align_s **)NULL))
    ;
  free(stack);
}


x86 assembly (clang, -O0):
<Free_t2ali>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1040 <Pop_t2ali@plt>
cmp    $0x0,%rax
je     114b <Free_t2ali+0x2b>
jmp    112c <Free_t2ali+0xc>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Free_t2ali>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <Pop_t2ali@plt>
test   %rax,%rax
jne    1130 <Free_t2ali+0x10>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.t2ali_s = type { i32 }
%struct.trace_s = type { i32 }
%struct.align_s = type { i32 }
define void @Free_t2ali(%struct.t2ali_s* %0) {
%2 = alloca %struct.t2ali_s*
store %struct.t2ali_s* %0, %struct.t2ali_s** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.t2ali_s*, %struct.t2ali_s** %2
%5 = call i64 @Pop_t2ali(%struct.t2ali_s* %4, %struct.trace_s** null, %struct.align_s** null)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load %struct.t2ali_s*, %struct.t2ali_s** %2
%10 = call i32 @free(%struct.t2ali_s* %9)
ret void
}

LLVM IR (-O2):
%struct.t2ali_s = type { i32 }
%struct.trace_s = type { i32 }
%struct.align_s = type { i32 }
define void @Free_t2ali(%struct.t2ali_s* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @Pop_t2ali(%struct.t2ali_s* %0, %struct.trace_s** null, %struct.align_s** null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 @free(%struct.t2ali_s* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ standard_command(int, int, int /*<<< orphan*/, char **);
void two_variables_command(int opcode_byte, char **arguments) {
  standard_command(opcode_byte, 2, 0, arguments);
}


x86 assembly (clang, -O0):
<two_variables_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <standard_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_variables_command>:
mov    %rsi,%rcx
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <standard_command@plt>

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

LLVM IR (-O2):
define void @two_variables_command(i32 %0, i8** %1) {
%3 = tail call i32 @standard_command(i32 %0, i32 2, i32 0, i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void task2_func(void) { printf("Hello from task - 2 !\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Hello from task - 2 !\0A\00"
define void @task2_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Hello from task - 2 !\00"
define void @task2_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_map_to_name() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_map_to_name"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_channel_map_to_name\0A\00"
define i32 @pa_channel_map_to_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_channel_map_to_name\00"
define i32 @pa_channel_map_to_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct dlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __dlist_del_entry(struct dlist_node *);
int /*<<< orphan*/ dlist_add_tail(struct dlist_node *, struct dlist_node *);
void dlist_move_tail(struct dlist_node *list, struct dlist_node *head) {
  __dlist_del_entry(list);
  dlist_add_tail(list, head);
}


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

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

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

LLVM IR (-O2):
%struct.dlist_node = type { i32 }
define void @dlist_move_tail(%struct.dlist_node* %0, %struct.dlist_node* %1) {
%3 = tail call i32 @__dlist_del_entry(%struct.dlist_node* %0)
%4 = tail call i32 @dlist_add_tail(%struct.dlist_node* %0, %struct.dlist_node* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int /*<<< orphan*/);
main() {
  f(0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 0)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ access(char const *, int /*<<< orphan*/);
int sqlite3UnixFileExists(const char *zFilename) {
  return access(zFilename, 0) == 0;
}


x86 assembly (clang, -O0):
<sqlite3UnixFileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3UnixFileExists>:
push   %rax
xor    %esi,%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sqlite3UnixFileExists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @access(i8* %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sqlite3UnixFileExists(i8* nocapture %0) {
%2 = tail call i64 @access(i8* %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int unicode_toupper(int);
int unicode_totitle(int code) {
  if ((unsigned int)(code - 0x1c4) < 9u || (unsigned int)(code - 0x1f1) < 3u) {
    return ((code * 685) >> 11) * 3;
  }
  return unicode_toupper(code);
}


x86 assembly (clang, -O0):
<unicode_totitle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1c4,%eax
cmp    $0x9,%eax
jb     113d <unicode_totitle+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x1f1,%eax
cmp    $0x3,%eax
jae    1152 <unicode_totitle+0x42>
imul   $0x2ad,-0x8(%rbp),%eax
sar    $0xb,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <unicode_totitle+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <unicode_toupper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_totitle>:
lea    -0x1c4(%rdi),%eax
cmp    $0x9,%eax
jb     112b <unicode_totitle+0x1b>
lea    -0x1f1(%rdi),%eax
cmp    $0x2,%eax
jbe    112b <unicode_totitle+0x1b>
jmp    1030 <unicode_toupper@plt>
imul   $0x2ad,%edi,%eax
shr    $0xb,%eax
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @unicode_totitle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sub nsw i32 %4, 452
%6 = icmp ult i32 %5, 9
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 497
%10 = icmp ult i32 %9, 3
br i1 %10, label %11, label %16
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 685
%14 = ashr i32 %13, 11
%15 = mul nsw i32 %14, 3
store i32 %15, i32* %2
br label %19
16: ; preds = %7
%17 = load i32, i32* %3
%18 = call i32 @unicode_toupper(i32 %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %11
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @unicode_totitle(i32 %0) {
%2 = add nsw i32 %0, -452
%3 = icmp ult i32 %2, 9
%4 = add nsw i32 %0, -497
%5 = icmp ult i32 %4, 3
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = mul nuw nsw i32 %0, 685
%9 = lshr i32 %8, 11
%10 = mul nuw nsw i32 %9, 3
br label %13
11: ; preds = %1
%12 = tail call i32 @unicode_toupper(i32 %0)
br label %13
13: ; preds = %11, %7
%14 = phi i32 [ %10, %7 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t read_uint4(const char *buf) { return *(uint32_t *)buf; }


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

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

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

LLVM IR (-O2):
define i32 @read_uint4(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
void *a11(int);
void *a10(int x) { return (((x >> 10) & 1) ? a11(x) : a11(x)); }


x86 assembly (clang, -O0):
<a10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xa,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a10+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a11@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a10+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a11@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a10>:
jmp    1030 <a11@plt>

LLVM IR (-O0):
define i8* @a10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 10
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a11(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a11(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a10(i32 %0) {
%2 = tail call i8* @a11(i32 %0)
ret i8* %2
}
/* Variables and functions */
int tracepoint_probe_unregister(char *, void *);
__attribute__((always_)) int unregister_trace_module_put(
    void (*probe)(struct module *mod, unsigned long ip, int refcnt)) {
  return tracepoint_probe_unregister("module_put", (void *)probe);
}


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

x86 assembly (clang, -O2):
<unregister_trace_module_put>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tracepoint_probe_unregister@plt>

LLVM IR (-O0):
%struct.module = type opaque
@.str = [11 x i8] c"module_put\00"
define i32 @unregister_trace_module_put(void (%struct.module*, i64, i32)* %0) {
%2 = alloca void (%struct.module*, i64, i32)*
store void (%struct.module*, i64, i32)* %0, void (%struct.module*, i64, i32)** %2
%3 = load void (%struct.module*, i64, i32)*, void (%struct.module*, i64, i32)** %2
%4 = bitcast void (%struct.module*, i64, i32)* %3 to i8*
%5 = call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.module = type opaque
@.str = [11 x i8] c"module_put\00"
define i32 @unregister_trace_module_put(void (%struct.module*, i64, i32)* %0) {
%2 = bitcast void (%struct.module*, i64, i32)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
int bound(int min, int x, int max) {
  return (x < min) ? min : (x > max) ? max : x;
}


x86 assembly (clang, -O0):
<bound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1124 <bound+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <bound+0x47>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <bound+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <bound+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound>:
mov    %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @bound(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %22
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %5
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @bound(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int my_str_length(const char *p) {
  int count = 0;
  while (*p) {
    count += 1;
    p++;
  }
  return count;
}


x86 assembly (clang, -O0):
<my_str_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <my_str_length+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <my_str_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_length>:
cmpb   $0x0,(%rdi)
je     111c <my_str_length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_str_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_str_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int asciiHexToInt(char *);
char *leerUnStringArbitrariamenteLargo();
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char binary[32], hex[8], strDouble[32];
  char *hexString;
  printf("Introduce un string hex:\n");
  hexString = leerUnStringArbitrariamenteLargo();
  printf("Este es el equivalente en decimal del hexadecimal %s: %d\n",
         hexString, asciiHexToInt(hexString));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <leerUnStringArbitrariamenteLargo@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
call   1040 <asciiHexToInt@plt>
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <leerUnStringArbitrariamenteLargo@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <asciiHexToInt@plt>
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Introduce un string hex:\0A\00"
@.str.1 = [58 x i8] c"Este es el equivalente en decimal del hexadecimal %s: %d\0A\00"
define void @main() {
%1 = alloca [32 x i8]
%2 = alloca [8 x i8]
%3 = alloca [32 x i8]
%4 = alloca i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call i8* (...) @leerUnStringArbitrariamenteLargo()
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @asciiHexToInt(i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [58 x i8] c"Este es el equivalente en decimal del hexadecimal %s: %d\0A\00"
@str = [25 x i8] c"Introduce un string hex:\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i8* (...) @leerUnStringArbitrariamenteLargo()
%3 = tail call i32 @asciiHexToInt(i8* %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ colle(int, int);
int main(void) {
  colle(12, 6);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @colle(i32 12, i32 6)
ret i32 0
}
/* Variables and functions */
int UART_write(char *, int, char);
int _write(int file, char *ptr, int len) {
  int data_len = UART_write(ptr, len, (char)0x0);
  return data_len;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1030 <UART_write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
mov    %rsi,%rdi
mov    %edx,%esi
xor    %edx,%edx
jmp    1030 <UART_write@plt>

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @UART_write(i8* %1, i32 %2, i8 signext 0)
ret i32 %4
}
int compare_ints(void *first, void *second) {
  int f = (int)first;
  int s = (int)second;
  if (f > s)
    return 1;
  else if (f == s)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1132 <compare_ints+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1151 <compare_ints+0x51>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114a <compare_ints+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <compare_ints+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints>:
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_ints(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i32
store i32 %9, i32* %6
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %10 to i32
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %22
16: ; preds = %2
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %22
21: ; preds = %16
store i32 -1, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @compare_ints(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void I010ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @I010ToABGR() {
ret void
}
/* Type definitions */
struct bloom {
  int dummy;
};

/* Variables and functions */
int bloom_check_add(struct bloom *, void const *, int, int /*<<< orphan*/);
int bloom_check(struct bloom *bloom, const void *buffer, int len) {
  return bloom_check_add(bloom, buffer, len, 0);
}


x86 assembly (clang, -O0):
<bloom_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <bloom_check_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bloom_check>:
xor    %ecx,%ecx
jmp    1030 <bloom_check_add@plt>

LLVM IR (-O0):
%struct.bloom = type { i32 }
define i32 @bloom_check(%struct.bloom* %0, i8* %1, i32 %2) {
%4 = alloca %struct.bloom*
%5 = alloca i8*
%6 = alloca i32
store %struct.bloom* %0, %struct.bloom** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.bloom*, %struct.bloom** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @bloom_check_add(%struct.bloom* %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.bloom = type { i32 }
define i32 @bloom_check(%struct.bloom* %0, i8* %1, i32 %2) {
%4 = tail call i32 @bloom_check_add(%struct.bloom* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
char *calloc(int, int);
int /*<<< orphan*/ error(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *input, *output;
  input = calloc(256, sizeof(char));
  if (!input)
    error("failed to allocate input buffer", ENOMEM);
  output = calloc(256, sizeof(char));
  if (!input)
    error("failed to allocate output buffer", ENOMEM);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x100,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <main+0x49>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1040 <error@plt>
mov    $0x100,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    119c <main+0x7c>
mov    0x2e52(%rip),%rax
mov    (%rax),%esi
lea    0xe89(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"failed to allocate input buffer\00"
@ENOMEM = global i32 0
@.str.1 = [33 x i8] c"failed to allocate output buffer\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* @calloc(i32 256, i32 1)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* @ENOMEM
%13 = call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %2
%15 = call i8* @calloc(i32 256, i32 1)
store i8* %15, i8** %7
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
br i1 %17, label %21, label %18
18: ; preds = %14
%19 = load i32, i32* @ENOMEM
%20 = call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %14
ret i32 0
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
unsigned long ilog2(unsigned int);
unsigned long pwm_tdiv_div_bits(unsigned int div) { return ilog2(div); }


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

x86 assembly (clang, -O2):
<pwm_tdiv_div_bits>:
jmp    1030 <ilog2@plt>

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

LLVM IR (-O2):
define i64 @pwm_tdiv_div_bits(i32 %0) {
%2 = tail call i64 @ilog2(i32 %0)
ret i64 %2
}
/* Type definitions */
struct NonceKey_cell {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ NonceKey_freeCell(struct NonceKey_cell *);
void NonceKey_deleteCell(struct NonceKey_cell *cell) {
  NonceKey_freeCell(cell);
}


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

x86 assembly (clang, -O2):
<NonceKey_deleteCell>:
jmp    1030 <NonceKey_freeCell@plt>

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

LLVM IR (-O2):
%struct.NonceKey_cell = type { i32 }
define void @NonceKey_deleteCell(%struct.NonceKey_cell* %0) {
%2 = tail call i32 @NonceKey_freeCell(%struct.NonceKey_cell* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("\E[1;11mUsage:\E[0;11m main -j number of processors\n");
  printf("--seed seed\n");
  printf("--count amount of data to generate.\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"\1B[1;11mUsage:\1B[0;11m main -j number of processors\0A\00"
@.str.1 = [13 x i8] c"--seed seed\0A\00"
@.str.2 = [37 x i8] c"--count amount of data to generate.\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [50 x i8] c"\1B[1;11mUsage:\1B[0;11m main -j number of processors\00"
@str.3 = [12 x i8] c"--seed seed\00"
@str.4 = [36 x i8] c"--count amount of data to generate.\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int /*<<< orphan*/);
extern struct SN_env *russian_UTF_8_create_env(void) {
  return SN_create_env(0, 2, 0);
}


x86 assembly (clang, -O0):
<russian_UTF_8_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x2,%esi
mov    %edx,%edi
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<russian_UTF_8_create_env>:
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @russian_UTF_8_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 0)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @russian_UTF_8_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 0)
ret %struct.SN_env* %1
}
/* Variables and functions */
char *mus_header_data_format2string(int);
char *sound_format_name(int format) {
  return (mus_header_data_format2string(format));
}


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

x86 assembly (clang, -O2):
<sound_format_name>:
jmp    1030 <mus_header_data_format2string@plt>

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

LLVM IR (-O2):
define i8* @sound_format_name(i32 %0) {
%2 = tail call i8* @mus_header_data_format2string(i32 %0)
ret i8* %2
}
void foo(void) { int i = 1; }


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
unsigned xrop3_138_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = D & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_138_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_138_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %sil
or     %dil,%sil
movzbl %sil,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_138_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_138_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %1, -1
%6 = or i8 %5, %0
%7 = zext i8 %6 to i32
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
void lgtd_lifx_gateway_handle_runtime_info(
    struct lgtd_lifx_gateway *gw, const struct lgtd_lifx_packet_header *hdr,
    const struct lgtd_lifx_packet_runtime_info *pkt) {
  (void)gw;
  (void)hdr;
  (void)pkt;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_runtime_info = type opaque
define void @lgtd_lifx_gateway_handle_runtime_info(%struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_runtime_info* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca %struct.lgtd_lifx_packet_header*
%6 = alloca %struct.lgtd_lifx_packet_runtime_info*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_header** %5
store %struct.lgtd_lifx_packet_runtime_info* %2, %struct.lgtd_lifx_packet_runtime_info** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load %struct.lgtd_lifx_packet_header*, %struct.lgtd_lifx_packet_header** %5
%9 = load %struct.lgtd_lifx_packet_runtime_info*, %struct.lgtd_lifx_packet_runtime_info** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_runtime_info = type opaque
define void @lgtd_lifx_gateway_handle_runtime_info(%struct.lgtd_lifx_gateway* nocapture %0, %struct.lgtd_lifx_packet_header* nocapture %1, %struct.lgtd_lifx_packet_runtime_info* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
int GLOB_NOSPACE;
int /*<<< orphan*/ puts(char *);
int glob(const char *restrict pattern, int flags,
         int (*errfunc)(const char *epath, int eerrno),
         glob_t *restrict pglob) {
  (void)pattern;
  (void)flags;
  (void)errfunc;
  (void)pglob;
  puts("glob: not implemented");
  return GLOB_NOSPACE;
}


x86 assembly (clang, -O0):
<glob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"glob: not implemented\00"
@GLOB_NOSPACE = global i32 0
define i32 @glob(i8* noalias %0, i32 %1, i32 (i8*, i32)* %2, i32* noalias %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32 (i8*, i32)*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 (i8*, i32)* %2, i32 (i8*, i32)** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32 (i8*, i32)*, i32 (i8*, i32)** %7
%12 = load i32*, i32** %8
%13 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @GLOB_NOSPACE
ret i32 %14
}

LLVM IR (-O2):
@.str = [22 x i8] c"glob: not implemented\00"
@GLOB_NOSPACE = global i32 0
define i32 @glob(i8* noalias nocapture readnone %0, i32 %1, i32 (i8*, i32)* nocapture readnone %2, i32* noalias nocapture readnone %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @GLOB_NOSPACE
ret i32 %6
}
void foo087(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo087(i32 %0) {
ret void
}
int Section3First(int *number) { return *number / 1000; }


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

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

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

LLVM IR (-O2):
define i32 @Section3First(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sdiv i32 %2, 1000
ret i32 %3
}
/* Variables and functions */
int backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void reel_trace(void) {
  static void *buf[64];
  int n;
  n = backtrace(buf, 64);
  backtrace_symbols_fd(buf, n, 2);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<reel_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f11(%rip),%rdi
mov    $0x40,%esi
call   1040 <backtrace@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0x2efa(%rip),%rdi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reel_trace>:
push   %rbx
lea    0x2f18(%rip),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <backtrace@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@reel_trace.buf = internal global [64 x i8*] zeroinitializer
@stderr = global i32 0
define void @reel_trace() {
%1 = alloca i32
%2 = call i32 @backtrace(i8** getelementptr inbounds ([64 x i8*], [64 x i8*]* @reel_trace.buf, i64 0, i64 0), i32 64)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @backtrace_symbols_fd(i8** getelementptr inbounds ([64 x i8*], [64 x i8*]* @reel_trace.buf, i64 0, i64 0), i32 %3, i32 2)
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@reel_trace.buf = internal global [64 x i8*] zeroinitializer
@stderr = global i32 0
define void @reel_trace() {
%1 = tail call i32 @backtrace(i8** getelementptr inbounds ([64 x i8*], [64 x i8*]* @reel_trace.buf, i64 0, i64 0), i32 64)
%2 = tail call i32 @backtrace_symbols_fd(i8** getelementptr inbounds ([64 x i8*], [64 x i8*]* @reel_trace.buf, i64 0, i64 0), i32 %1, i32 2)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
ret void
}
foobar() {}


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

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

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

LLVM IR (-O2):
define i32 @foobar() {
ret i32 undef
}