xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _quicksort1(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ insertion_sort(int *, int);
void quicksort1(int arr[], int n) {
  _quicksort1(arr, 0, n);
  insertion_sort(arr, n);
}


x86 assembly (clang, -O0):
<quicksort1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <_quicksort1@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <insertion_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <_quicksort1@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <insertion_sort@plt>

LLVM IR (-O0):
define void @quicksort1(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 = call i32 @_quicksort1(i32* %5, i32 0, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = call i32 @insertion_sort(i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @quicksort1(i32* %0, i32 %1) {
%3 = tail call i32 @_quicksort1(i32* %0, i32 0, i32 %1)
%4 = tail call i32 @insertion_sort(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strmreplace(char **, char *, char *);
void strmrreplace(char **string, char *replace_hint, char *insert_word) {
  while (strmreplace(string, replace_hint, insert_word) == 0)
    ;
}


x86 assembly (clang, -O0):
<strmrreplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strmreplace@plt>
cmp    $0x0,%rax
jne    1144 <strmrreplace+0x34>
jmp    1124 <strmrreplace+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmrreplace>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strmreplace@plt>
test   %rax,%rax
je     1120 <strmrreplace+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @strmrreplace(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %13, %3
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i64 @strmreplace(i8** %8, i8* %9, i8* %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %7
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @strmrreplace(i8** %0, i8* %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @strmreplace(i8** %0, i8* %1, i8* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int insert(int, int, int, int);
int insert2(int, int, int, int);
int test_non_overlap() {
  int n = 0b10000000;
  int m = 0b00000101;
  return 0b10010100 == insert(n, m, 4, 2) && 0b10010100 == insert2(n, m, 4, 2);
}


x86 assembly (clang, -O0):
<test_non_overlap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x80,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1040 <insert@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x94,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jne    1183 <test_non_overlap+0x63>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <insert2@plt>
mov    %eax,%ecx
mov    $0x94,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_non_overlap>:
push   %rax
mov    $0x80,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1040 <insert@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x94,%ecx
jne    116c <test_non_overlap+0x4c>
mov    $0x80,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <insert2@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x94,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_non_overlap() {
%1 = alloca i32
%2 = alloca i32
store i32 128, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @insert(i32 %3, i32 %4, i32 4, i32 2)
%6 = icmp eq i32 148, %5
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @insert2(i32 %8, i32 %9, i32 4, i32 2)
%11 = icmp eq i32 148, %10
br label %12
12: ; preds = %7, %0
%13 = phi i1 [ false, %0 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_non_overlap() {
%1 = tail call i32 @insert(i32 128, i32 5, i32 4, i32 2)
%2 = icmp eq i32 %1, 148
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @insert2(i32 128, i32 5, i32 4, i32 2)
%5 = icmp eq i32 %4, 148
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
int sdps_fill_dl_dcd(unsigned char *buf, unsigned dcd_addr, int length) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sdps_fill_dl_dcd(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @sdps_fill_dl_dcd(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int sorted_order(int a, int b) { return b - a; }


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

x86 assembly (clang, -O2):
<sorted_order>:
mov    %esi,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sorted_order(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool year_isleap(uint32_t year) {
  return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));
}


x86 assembly (clang, -O0):
<year_isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <year_isleap+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <year_isleap+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<year_isleap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <year_isleap+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <year_isleap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @year_isleap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @year_isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
unsigned char *_EncodeStr(unsigned char *, char const *, unsigned int);
unsigned char *SEGGER_SYSVIEW_EncodeString(unsigned char *pPayload,
                                           const char *s, unsigned int MaxLen) {
  return _EncodeStr(pPayload, s, MaxLen);
}


x86 assembly (clang, -O0):
<SEGGER_SYSVIEW_EncodeString>:
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
call   1030 <_EncodeStr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEGGER_SYSVIEW_EncodeString>:
jmp    1030 <_EncodeStr@plt>

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

LLVM IR (-O2):
define i8* @SEGGER_SYSVIEW_EncodeString(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @_EncodeStr(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ looper();
void game_start() { looper(); }


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

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

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

LLVM IR (-O2):
define void @game_start() {
%1 = tail call i32 (...) @looper()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void set_color(char *color) { printf(color); }


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

x86 assembly (clang, -O2):
<set_color>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @set_color(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __UNCONST(char const *);
int gzwrite(void *, int /*<<< orphan*/, int);
int xgzwrite(void *cookie, const char *data, int size) {
  return gzwrite(cookie, __UNCONST(data), size);
}


x86 assembly (clang, -O0):
<xgzwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__UNCONST@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1030 <gzwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgzwrite>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <__UNCONST@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <gzwrite@plt>

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

LLVM IR (-O2):
define i32 @xgzwrite(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @__UNCONST(i8* %1)
%5 = tail call i32 @gzwrite(i8* %0, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ end();
void endrotate(void) { end(); }


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

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

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

LLVM IR (-O2):
define void @endrotate() {
%1 = tail call i32 (...) @end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hijack_bar_intro();
int /*<<< orphan*/ hijack_bar_outro(int);
int orig_bar();
int bar() {
  hijack_bar_intro();
  int r = orig_bar();
  hijack_bar_outro(r);
  return r;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <hijack_bar_intro@plt>
mov    $0x0,%al
call   1050 <orig_bar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hijack_bar_outro@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
xor    %eax,%eax
call   1030 <hijack_bar_intro@plt>
xor    %eax,%eax
call   1050 <orig_bar@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <hijack_bar_outro@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = call i32 (...) @hijack_bar_intro()
%3 = call i32 (...) @orig_bar()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @hijack_bar_outro(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @hijack_bar_intro()
%2 = tail call i32 (...) @orig_bar()
%3 = tail call i32 @hijack_bar_outro(i32 %2)
ret i32 %2
}
int get_multiple_of_two(int m) {
  int i, value = 1;
  for (i = 0; i < m; i++) {
    value *= 2;
  }
  return value;
}


x86 assembly (clang, -O0):
<get_multiple_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <get_multiple_of_two+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <get_multiple_of_two+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_multiple_of_two>:
test   %edi,%edi
jle    1118 <get_multiple_of_two+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <get_multiple_of_two+0x1e>
mov    $0x1,%eax
jmp    1138 <get_multiple_of_two+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <get_multiple_of_two+0x30>
test   %ecx,%ecx
je     1147 <get_multiple_of_two+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <get_multiple_of_two+0x40>
ret

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

LLVM IR (-O2):
define i32 @get_multiple_of_two(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Variables and functions */
char *calloc(int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char const *);
char *strdup(const char *arg) {
  char *buffer = calloc(strlen(arg), sizeof(char));
  strcpy(buffer, arg);
  return buffer;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @calloc(i32 %5, i32 1)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @calloc(i32 %2, i32 1)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
ret i8* %3
}
void wifi_evt_sme_scan_sort_result(
    const struct wifi_msg_sme_scan_sort_result_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_scan_sort_result_evt_t = type opaque
define void @wifi_evt_sme_scan_sort_result(%struct.wifi_msg_sme_scan_sort_result_evt_t* nocapture %0) {
ret void
}
int int_plus(int x, int y, int index) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @int_plus(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* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @int_plus(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void Line_Buf(void) {
  int i;
  char a = 'a';
  for (i = 0; i < 1024; i++) {
    printf("%c", a);
  }
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Line_Buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x5(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x400,-0x4(%rbp)
jge    114e <Line_Buf+0x3e>
lea    0xec9(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <Line_Buf+0x13>
jmp    1153 <Line_Buf+0x43>
jmp    1153 <Line_Buf+0x43>

x86 assembly (clang, -O2):
<Line_Buf>:
push   %rbp
push   %rbx
push   %rax
mov    $0x400,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1120 <Line_Buf+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1140 <Line_Buf+0x30>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @Line_Buf() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 97)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1024
br i1 %5, label %6, label %1
6: ; preds = %1, %6
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ Vector_Max(void *const, void const *const,
                              void const *const);
int /*<<< orphan*/ Vector_Min(void *const, void const *const,
                              void const *const);
void Vector_Clamp(void *const vector, const void *const input,
                  const void *const min, const void *const max) {
  Vector_Max(vector, input, min);
  Vector_Min(vector, input, max);
}


x86 assembly (clang, -O0):
<Vector_Clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <Vector_Max@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <Vector_Min@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Clamp>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <Vector_Max@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <Vector_Min@plt>

LLVM IR (-O0):
define void @Vector_Clamp(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @Vector_Max(i8* %9, i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i8*, i8** %8
%16 = call i32 @Vector_Min(i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @Vector_Clamp(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @Vector_Max(i8* %0, i8* %1, i8* %2)
%6 = tail call i32 @Vector_Min(i8* %0, i8* %1, i8* %3)
ret void
}
int search(int arr[], int start, int end, int value) {
  int i;
  for (i = start; i <= end; i++) {
    if (arr[i] == value) {
      break;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     114f <search+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    113c <search+0x3c>
jmp    114f <search+0x4f>
jmp    1141 <search+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <search+0x17>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %esi,%eax
cmp    %edx,%esi
jg     1121 <search+0x21>
movslq %eax,%rsi
add    $0x1,%edx
lea    (%rdi,%rsi,4),%rsi
cmp    %ecx,(%rsi)
je     1121 <search+0x21>
add    $0x1,%eax
add    $0x4,%rsi
cmp    %eax,%edx
jne    1110 <search+0x10>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, %2
br i1 %5, label %20, label %6
6: ; preds = %4
%7 = sext i32 %1 to i64
%8 = add i32 %2, 1
br label %9
9: ; preds = %6, %14
%10 = phi i64 [ %7, %6 ], [ %15, %14 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %3
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = add nsw i64 %10, 1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %8, %16
br i1 %17, label %20, label %9
18: ; preds = %9
%19 = trunc i64 %10 to i32
br label %20
20: ; preds = %14, %18, %4
%21 = phi i32 [ %1, %4 ], [ %19, %18 ], [ %8, %14 ]
ret i32 %21
}
/* Variables and functions */
char *strdup(char *);
void *parser(char *buffer) {
  char *s = strdup(buffer);
  return (void *)s;
}


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

x86 assembly (clang, -O2):
<parser>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @parser(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @parser(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
void Mali_InitPerfCounters() {}


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

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

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

LLVM IR (-O2):
define void @Mali_InitPerfCounters() {
ret void
}
int parent(int *formula, int s) {
  if (formula[s] < 0)
    return s;
  int i;
  for (i = s; i > 0; --i)
    if (formula[i] < 0)
      break;
  return i;
}


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    1128 <parent+0x28>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <parent+0x68>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1162 <parent+0x62>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    114f <parent+0x4f>
jmp    1162 <parent+0x62>
jmp    1154 <parent+0x54>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    112e <parent+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %esi,%eax
movslq %esi,%rcx
cmpl   $0x0,(%rdi,%rcx,4)
js     1124 <parent+0x24>
test   %eax,%eax
jle    1124 <parent+0x24>
nop
mov    %eax,%ecx
cmpl   $0x0,(%rdi,%rcx,4)
js     1124 <parent+0x24>
lea    -0x1(%rax),%ecx
cmp    $0x1,%eax
mov    %ecx,%eax
jg     1110 <parent+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, -1
%7 = icmp sgt i32 %1, 0
%8 = and i1 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %2, %15
%10 = phi i32 [ %16, %15 ], [ %1, %2 ]
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp slt i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = add nsw i32 %10, -1
%17 = icmp sgt i32 %10, 1
br i1 %17, label %9, label %18
18: ; preds = %9, %15, %2
%19 = phi i32 [ %1, %2 ], [ %10, %9 ], [ 0, %15 ]
ret i32 %19
}
void foo_1_2_1_2_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_1_1_1_1() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int wpspinchecksum(int);
void writebssidwps(FILE *fhout, unsigned long long int macaddr) {
  static int pin;
  pin = (macaddr & 0xffffff) % 10000000;
  pin = ((pin * 10) + wpspinchecksum(pin));
  fprintf(fhout, "%08d\n", pin);
  return;
}


x86 assembly (clang, -O0):
<writebssidwps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffffff,%rax
mov    $0x989680,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,0x2ee8(%rip)
imul   $0xa,0x2ee1(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0x2ed8(%rip),%edi
call   1040 <wpspinchecksum@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,0x2ec6(%rip)
mov    -0x8(%rbp),%rdi
mov    0x2ebc(%rip),%edx
lea    0xe81(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writebssidwps>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
and    $0xffffff,%esi
imul   $0x6b5fca6b,%rsi,%rax
shr    $0x36,%rax
imul   $0x989680,%eax,%eax
sub    %eax,%esi
lea    (%rsi,%rsi,4),%ebx
mov    %esi,%edi
call   1040 <wpspinchecksum@plt>
lea    (%rax,%rbx,2),%edx
lea    0xeac(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@writebssidwps.pin = internal global i32 0
@.str = [6 x i8] c"%08d\0A\00"
define void @writebssidwps(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 16777215
%7 = urem i64 %6, 10000000
%8 = trunc i64 %7 to i32
store i32 %8, i32* @writebssidwps.pin
%9 = load i32, i32* @writebssidwps.pin
%10 = mul nsw i32 %9, 10
%11 = load i32, i32* @writebssidwps.pin
%12 = call i32 @wpspinchecksum(i32 %11)
%13 = add nsw i32 %10, %12
store i32 %13, i32* @writebssidwps.pin
%14 = load i32*, i32** %3
%15 = load i32, i32* @writebssidwps.pin
%16 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08d\0A\00"
define void @writebssidwps(i32* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 16777215
%5 = urem i32 %4, 10000000
%6 = mul nuw nsw i32 %5, 10
%7 = tail call i32 @wpspinchecksum(i32 %5)
%8 = add nsw i32 %7, %6
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
void UART9BitEnable(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x000000A4))) |= 0x00008000;
}


x86 assembly (clang, -O0):
<UART9BitEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xa4,%eax
cltq
mov    (%rax),%ecx
or     $0x8000,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitEnable>:
push   %rbx
mov    %edi,%ebx
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x8000,0xa4(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @UART9BitEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_UARTBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 164
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, 32768
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @UART9BitEnable(i32 %0) {
%2 = tail call i32 @_UARTBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 164
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 32768
store volatile i32 %8, i32* %6
ret void
}
void wifi_evt_endpoint_syntax_error(
    const struct wifi_msg_endpoint_syntax_error_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_endpoint_syntax_error_evt_t = type opaque
define void @wifi_evt_endpoint_syntax_error(%struct.wifi_msg_endpoint_syntax_error_evt_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pclose(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundmpx_pclose(FILE *stream) {
  return pclose(stream);
}


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

x86 assembly (clang, -O2):
<softboundmpx_pclose>:
jmp    1030 <pclose@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_pclose(i32* %0) {
%2 = tail call i32 @pclose(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assign_array_();
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ print_array_();
int /*<<< orphan*/ set_ptr_(double **, int *);
int main() {
  int n, i;
  double *concen;
  n = 5;
  concen = (double *)malloc(sizeof(double) * n * n);
  set_ptr_(&concen, &n);
  assign_array_();
  print_array_();
  free(concen);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <set_ptr_@plt>
mov    $0x0,%al
call   1060 <assign_array_@plt>
mov    $0x0,%al
call   1040 <print_array_@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x5,0xc(%rsp)
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1070 <set_ptr_@plt>
xor    %eax,%eax
call   1060 <assign_array_@plt>
xor    %eax,%eax
call   1040 <print_array_@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double*
store i32 0, i32* %1
store i32 5, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = mul i64 %7, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %4
%14 = call i32 @set_ptr_(double** %4, i32* %2)
%15 = call i32 (...) @assign_array_()
%16 = call i32 (...) @print_array_()
%17 = load double*, double** %4
%18 = call i32 @free(double* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = bitcast i32* %1 to i8*
%4 = bitcast double** %2 to i8*
store i32 5, i32* %1
%5 = tail call i64 @malloc(i32 200)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %2
%7 = call i32 @set_ptr_(double** %2, i32* %1)
%8 = call i32 (...) @assign_array_()
%9 = call i32 (...) @print_array_()
%10 = load double*, double** %2
%11 = call i32 @free(double* %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_double(char *msg1, char *msg2) { printf("%s%s\n", msg1, msg2); }


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

x86 assembly (clang, -O2):
<print_double>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
define void @print_double(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void mem_set(void *dst, int val, int cnt) {
  char *d = (char *)dst;
  while (cnt--)
    *d++ = (char)val;
}


x86 assembly (clang, -O0):
<mem_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1145 <mem_set+0x45>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1116 <mem_set+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_set>:
test   %edx,%edx
je     1120 <mem_set+0x10>
push   %rax
mov    %edx,%edx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @mem_set(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret void
}
double metresToMiles(double metres) { return metres * 0.00062137; }


x86 assembly (clang, -O0):
<metresToMiles>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @metresToMiles(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 6.213700e-04
ret double %4
}

LLVM IR (-O2):
define double @metresToMiles(double %0) {
%2 = fmul double %0, 6.213700e-04
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_QUIT(int /*<<< orphan*/);
int gen_QUIT(void) {
  handle_QUIT(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_QUIT>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_QUIT@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_QUIT>:
push   %rax
xor    %edi,%edi
call   1030 <handle_QUIT@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_QUIT() {
%1 = call i32 @handle_QUIT(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_QUIT() {
%1 = tail call i32 @handle_QUIT(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ operand(int, int);
load() { operand(2, (0x01 | 0x04 | 0x08 | 0x10)); }


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x1d,%esi
call   1030 <operand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @load() {
%1 = tail call i32 @operand(i32 2, i32 29)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_inner_str(void) { printf("print_inner_str\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"print_inner_str\00"
define void @print_inner_str() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ eb128_compose_264(int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
bool eb128_equal_264(const uint64_t alo, const uint64_t ahi, const uint64_t blo,
                     const uint64_t bhi) {
  return eb128_compose_264(alo, ahi) == eb128_compose_264(blo, bhi);
}


x86 assembly (clang, -O0):
<eb128_equal_264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb128_equal_264>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <eb128_compose_264@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <eb128_compose_264@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eb128_equal_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i64 @eb128_compose_264(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @eb128_compose_264(i32 %12, i32 %13)
%15 = icmp eq i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @eb128_equal_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @eb128_compose_264(i32 %0, i32 %1)
%6 = tail call i64 @eb128_compose_264(i32 %2, i32 %3)
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rand_uint32_range(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t rand_uint32_max(uint32_t max) { return rand_uint32_range(0, max); }


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

x86 assembly (clang, -O2):
<rand_uint32_max>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <rand_uint32_range@plt>

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

LLVM IR (-O2):
define i32 @rand_uint32_max(i32 %0) {
%2 = tail call i32 @rand_uint32_range(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
float fstep(float, float);
float fpulse(float _a, float _start, float _end) {
  return fstep(_a, _start) - fstep(_a, _end);
}


x86 assembly (clang, -O0):
<fpulse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fstep@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <fstep@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpulse>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm0,0xc(%rsp)
call   1030 <fstep@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
call   1030 <fstep@plt>
movss  0x10(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define float @fpulse(float %0, float %1, float %2) {
%4 = tail call float @fstep(float %0, float %1)
%5 = tail call float @fstep(float %0, float %2)
%6 = fsub float %4, %5
ret float %6
}