xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265nal_set_type(uint8_t *p_h265nal, uint8_t i_type) {
  p_h265nal[3] &= ~0x7e;
  p_h265nal[3] |= (i_type << 1) & 0x7e;
}


x86 assembly (clang, -O0):
<h265nal_set_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xffffff81,%ecx
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
and    $0x7e,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265nal_set_type>:
mov    0xc(%rdi),%eax
and    $0xffffff81,%eax
and    $0x3f,%esi
lea    (%rax,%rsi,2),%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @h265nal_set_type(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 = getelementptr inbounds i32, i32* %5, i64 3
%7 = load i32, i32* %6
%8 = and i32 %7, -127
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 1
%11 = and i32 %10, 126
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @h265nal_set_type(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
%4 = load i32, i32* %3
%5 = and i32 %4, -127
%6 = shl i32 %1, 1
%7 = and i32 %6, 126
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_leaves(int);
int /*<<< orphan*/ my_trunk(int);
void sapin(int size) {
  my_leaves(size);
  my_trunk(size);
}


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

x86 assembly (clang, -O2):
<sapin>:
push   %rbx
mov    %edi,%ebx
call   1040 <my_leaves@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <my_trunk@plt>

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

LLVM IR (-O2):
define void @sapin(i32 %0) {
%2 = tail call i32 @my_leaves(i32 %0)
%3 = tail call i32 @my_trunk(i32 %0)
ret void
}
/* Variables and functions */
int left(int);
int right(int i) { return (left(i) + 1); }


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

x86 assembly (clang, -O2):
<right>:
push   %rax
call   1030 <left@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @left(i32 %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @right(i32 %0) {
%2 = tail call i32 @left(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void about() {
  printf("%s\n%s\n%s\n%s\n",
         "Developed by : ", "Abhishek Verma, Jashan Bhullar, Harshit Kashyapy",
         "Project is developed under the vision of Mr.Srikant",
         "University of Petroleum & Energy Studies - Dehradun\n");
}


x86 assembly (clang, -O0):
<about>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xef4(%rip),%rdx
lea    0xf1e(%rip),%rcx
lea    0xf4b(%rip),%r8
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<about>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xef8(%rip),%rdx
lea    0xf22(%rip),%rcx
lea    0xf4f(%rip),%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [16 x i8] c"Developed by : \00"
@.str.2 = [49 x i8] c"Abhishek Verma, Jashan Bhullar, Harshit Kashyapy\00"
@.str.3 = [52 x i8] c"Project is developed under the vision of Mr.Srikant\00"
@.str.4 = [53 x i8] c"University of Petroleum & Energy Studies - Dehradun\0A\00"
define void @about() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [16 x i8] c"Developed by : \00"
@.str.2 = [49 x i8] c"Abhishek Verma, Jashan Bhullar, Harshit Kashyapy\00"
@.str.3 = [52 x i8] c"Project is developed under the vision of Mr.Srikant\00"
@.str.4 = [53 x i8] c"University of Petroleum & Energy Studies - Dehradun\0A\00"
define void @about() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminal_putchar(char);
void putchar(char c) { terminal_putchar(c); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <terminal_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
jmp    1030 <terminal_putchar@plt>

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

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = tail call i32 @terminal_putchar(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_izpy();
int /*<<< orphan*/ e_sbc();
void e_sbc_izpy() {
  e_izpy();
  e_sbc();
}


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

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

LLVM IR (-O0):
define void @e_sbc_izpy() {
%1 = call i32 (...) @e_izpy()
%2 = call i32 (...) @e_sbc()
ret void
}

LLVM IR (-O2):
define void @e_sbc_izpy() {
%1 = tail call i32 (...) @e_izpy()
%2 = tail call i32 (...) @e_sbc()
ret void
}
void glBeginQuery(int target, int id) {}


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

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

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

LLVM IR (-O2):
define void @glBeginQuery(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main() { _exit(3); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 3)
unreachable
}
int get_tbh_size(char buf[]) { return (((int)buf[0]) << 8) + ((int)buf[1]); }


x86 assembly (clang, -O0):
<get_tbh_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tbh_size>:
movsbl (%rdi),%ecx
shl    $0x8,%ecx
movsbl 0x1(%rdi),%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_tbh_size(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %4, %7
ret i32 %8
}
unsigned long long int cshl(unsigned long long int x, unsigned long long int L,
                            unsigned long long int N) {
  L %= N;
  return (x << L) | (x >> (N - L));
}


x86 assembly (clang, -O0):
<cshl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    %cl,%rax
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
sub    -0x10(%rbp),%rcx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cshl>:
mov    %rdx,%r8
mov    %rsi,%rax
mov    %rsi,%rcx
or     %rdx,%rcx
shr    $0x20,%rcx
je     111c <cshl+0x1c>
xor    %edx,%edx
div    %r8
mov    %rdx,%rcx
jmp    1123 <cshl+0x23>
xor    %edx,%edx
div    %r8d
mov    %edx,%ecx
mov    %rdi,%rax
shl    %cl,%rax
sub    %ecx,%r8d
mov    %r8d,%ecx
shr    %cl,%rdi
or     %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cshl(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = urem i64 %8, %7
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = shl i64 %10, %11
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = load i64, i64* %5
%16 = sub i64 %14, %15
%17 = lshr i64 %13, %16
%18 = or i64 %12, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @cshl(i64 %0, i64 %1, i64 %2) {
%4 = urem i64 %1, %2
%5 = shl i64 %0, %4
%6 = sub i64 %2, %4
%7 = lshr i64 %0, %6
%8 = or i64 %7, %5
ret i64 %8
}
int PyThread_set_key_value(int key, void *value) { return -1; }


x86 assembly (clang, -O0):
<PyThread_set_key_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @PyThread_set_key_value(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
struct ebpt_node {
  int dummy;
};
struct eb_root {
  int dummy;
};
struct eb64_node {
  int dummy;
};
struct eb32_node {
  int dummy;
};

/* Variables and functions */
scalar_t__ __eb32_insert(struct eb_root *, struct eb32_node *);
scalar_t__ __eb64_insert(struct eb_root *, struct eb64_node *);
__attribute__((always_)) struct ebpt_node *
__ebpt_insert(struct eb_root *root, struct ebpt_node *new) {
  if (sizeof(void *) == 4)
    return (struct ebpt_node *)__eb32_insert(root, (struct eb32_node *)new);
  else
    return (struct ebpt_node *)__eb64_insert(root, (struct eb64_node *)new);
}


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

x86 assembly (clang, -O2):
<__ebpt_insert>:
jmp    1030 <__eb64_insert@plt>

LLVM IR (-O0):
%struct.eb_root = type { i32 }
%struct.ebpt_node = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.ebpt_node* @__ebpt_insert(%struct.eb_root* %0, %struct.ebpt_node* %1) {
%3 = alloca %struct.eb_root*
%4 = alloca %struct.ebpt_node*
store %struct.eb_root* %0, %struct.eb_root** %3
store %struct.ebpt_node* %1, %struct.ebpt_node** %4
%5 = load %struct.eb_root*, %struct.eb_root** %3
%6 = load %struct.ebpt_node*, %struct.ebpt_node** %4
%7 = bitcast %struct.ebpt_node* %6 to %struct.eb64_node*
%8 = call i64 @__eb64_insert(%struct.eb_root* %5, %struct.eb64_node* %7)
%9 = inttoptr i64 %8 to %struct.ebpt_node*
ret %struct.ebpt_node* %9
}

LLVM IR (-O2):
%struct.eb_root = type { i32 }
%struct.ebpt_node = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.ebpt_node* @__ebpt_insert(%struct.eb_root* %0, %struct.ebpt_node* %1) {
%3 = bitcast %struct.ebpt_node* %1 to %struct.eb64_node*
%4 = tail call i64 @__eb64_insert(%struct.eb_root* %0, %struct.eb64_node* %3)
%5 = inttoptr i64 %4 to %struct.ebpt_node*
ret %struct.ebpt_node* %5
}
int IsAlphaNum(int c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_') ||
          (c >= '0' && c <= '9'));
}


x86 assembly (clang, -O0):
<IsAlphaNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <IsAlphaNum+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1167 <IsAlphaNum+0x67>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <IsAlphaNum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1167 <IsAlphaNum+0x67>
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1167 <IsAlphaNum+0x67>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1161 <IsAlphaNum+0x61>
cmpl   $0x39,-0x4(%rbp)
setle  %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):
<IsAlphaNum>:
lea    -0x61(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1a,%ecx
jb     1125 <IsAlphaNum+0x25>
cmp    $0x5f,%edi
je     1125 <IsAlphaNum+0x25>
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%ecx
jb     1125 <IsAlphaNum+0x25>
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsAlphaNum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %25, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %25, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 95
br i1 %16, label %25, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 48
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 57
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ false, %17 ], [ %22, %20 ]
br label %25
25: ; preds = %23, %14, %11, %5
%26 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %5 ], [ %24, %23 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @IsAlphaNum(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 26
%7 = icmp eq i32 %0, 95
%8 = or i1 %7, %6
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = add i32 %0, -48
%11 = icmp ult i32 %10, 10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %4, %1, %9
%14 = phi i32 [ %12, %9 ], [ 1, %1 ], [ 1, %4 ]
ret i32 %14
}
/* Variables and functions */
int bswap_16(unsigned short);
unsigned long bswap_32(unsigned long val) {
  return bswap_16((unsigned short)val) << 16 |
         bswap_16((unsigned short)(val >> 16));
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl %ax,%edi
call   1030 <bswap_16@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
movzwl %ax,%edi
call   1030 <bswap_16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movzwl %bx,%edi
call   1030 <bswap_16@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
shr    $0x10,%ebx
mov    %ebx,%edi
call   1030 <bswap_16@plt>
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @bswap_32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
%5 = call i32 @bswap_16(i16 zeroext %4)
%6 = shl i32 %5, 16
%7 = load i64, i64* %2
%8 = lshr i64 %7, 16
%9 = trunc i64 %8 to i16
%10 = call i32 @bswap_16(i16 zeroext %9)
%11 = or i32 %6, %10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @bswap_32(i64 %0) {
%2 = trunc i64 %0 to i16
%3 = tail call i32 @bswap_16(i16 zeroext %2)
%4 = shl i32 %3, 16
%5 = lshr i64 %0, 16
%6 = trunc i64 %5 to i16
%7 = tail call i32 @bswap_16(i16 zeroext %6)
%8 = or i32 %4, %7
%9 = sext i32 %8 to i64
ret i64 %9
}
/* Variables and functions */
int computer_move_magic(char **, char, char);
int computer_move(char **board, char piece1, char piece2) {
  return computer_move_magic(board, piece1, piece2);
}


x86 assembly (clang, -O0):
<computer_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
movsbl %al,%esi
movsbl -0xa(%rbp),%edx
call   1030 <computer_move_magic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computer_move>:
jmp    1030 <computer_move_magic@plt>

LLVM IR (-O0):
define i32 @computer_move(i8** %0, i8 signext %1, i8 signext %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
%7 = load i8**, i8*** %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i32 @computer_move_magic(i8** %7, i8 signext %8, i8 signext %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @computer_move(i8** %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @computer_move_magic(i8** %0, i8 signext %1, i8 signext %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD5_Final(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Update(int /*<<< orphan*/ *, unsigned char *, int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int GetMD5Hash(unsigned char *pbData, int size, unsigned char *hashValue) {
  unsigned char digest[16];
  MD5_CTX ctx;
  MD5_Init(&ctx);
  MD5_Update(&ctx, pbData, 7);
  MD5_Final(digest, &ctx);
  memcpy(hashValue, digest, 16);
  return 1;
}


x86 assembly (clang, -O0):
<GetMD5Hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x34(%rbp),%rdi
call   1050 <MD5_Init@plt>
mov    -0x8(%rbp),%rsi
lea    -0x34(%rbp),%rdi
mov    $0x7,%edx
call   1060 <MD5_Update@plt>
lea    -0x30(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   1030 <MD5_Final@plt>
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMD5Hash>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   1050 <MD5_Init@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x7,%edx
call   1060 <MD5_Update@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <MD5_Final@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @GetMD5Hash(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [16 x i8]
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = call i32 @MD5_Init(i32* %8)
%10 = load i8*, i8** %4
%11 = call i32 @MD5_Update(i32* %8, i8* %10, i32 7)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = call i32 @MD5_Final(i8* %12, i32* %8)
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%16 = call i32 @memcpy(i8* %14, i8* %15, i32 16)
ret i32 1
}

LLVM IR (-O2):
define i32 @GetMD5Hash(i8* %0, i32 %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = alloca i32
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%7 = bitcast i32* %5 to i8*
%8 = call i32 @MD5_Init(i32* %5)
%9 = call i32 @MD5_Update(i32* %5, i8* %0, i32 7)
%10 = call i32 @MD5_Final(i8* %6, i32* %5)
%11 = call i32 @memcpy(i8* %2, i8* %6, i32 16)
ret i32 1
}
float __glsl_min(float x, float y) { return y < x ? y : x; }


x86 assembly (clang, -O0):
<__glsl_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <__glsl_min+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <__glsl_min+0x3a>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_min>:
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__glsl_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %4
br label %12
10: ; preds = %2
%11 = load float, float* %3
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @__glsl_min(float %0, float %1) {
%3 = fcmp olt float %1, %0
%4 = select i1 %3, float %1, float %0
ret float %4
}
__attribute__((always_)) unsigned int
cpumask_any_but(const struct cpumask *mask, unsigned int cpu) {
  return 1;
}


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

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

LLVM IR (-O0):
%struct.cpumask = type opaque
define i32 @cpumask_any_but(%struct.cpumask* %0, i32 %1) {
%3 = alloca %struct.cpumask*
%4 = alloca i32
store %struct.cpumask* %0, %struct.cpumask** %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @cpumask_any_but(%struct.cpumask* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
float logf(float const);
float dt_log2f(const float f) { return logf(f) / logf(2.0f); }


x86 assembly (clang, -O0):
<dt_log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_log2f>:
push   %rax
call   1030 <logf@plt>
divss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @dt_log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
%5 = call float @logf(float 2.000000e+00)
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @dt_log2f(float %0) {
%2 = tail call float @logf(float %0)
%3 = fdiv float %2, 0x3FE62E4300000000
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void LPTIM1_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @LPTIM1_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @LPTIM1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_window_refresh_windows();
void config_change_buffers(void *data, struct t_config_option *option) {
  (void)data;
  (void)option;
  gui_window_refresh_windows();
}


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

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

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_buffers(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 (...) @gui_window_refresh_windows()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n", a + b);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ get_uint32(int /*<<< orphan*/ *, int);
uint32_t read_defect_data_12_len(uint8_t *data) { return get_uint32(data, 4); }


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

x86 assembly (clang, -O2):
<read_defect_data_12_len>:
mov    $0x4,%esi
jmp    1030 <get_uint32@plt>

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

LLVM IR (-O2):
define i32 @read_defect_data_12_len(i32* %0) {
%2 = tail call i32 @get_uint32(i32* %0, i32 4)
ret i32 %2
}
/* Type definitions */
struct ecs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ecs_check_rw(struct ecs *, size_t, int);
scalar_t__ _ecs_cptr(struct ecs *, size_t);
float _ecs_read_f32(struct ecs *ecs, size_t off) {
  _ecs_check_rw(ecs, off, sizeof(float));
  return *((float *)_ecs_cptr(ecs, off));
}


x86 assembly (clang, -O0):
<_ecs_read_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <_ecs_check_rw@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_ecs_cptr@plt>
movss  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ecs_read_f32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x4,%edx
call   1030 <_ecs_check_rw@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_ecs_cptr@plt>
movss  (%rax),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ecs = type { i32 }
define float @_ecs_read_f32(%struct.ecs* %0, i64 %1) {
%3 = alloca %struct.ecs*
%4 = alloca i64
store %struct.ecs* %0, %struct.ecs** %3
store i64 %1, i64* %4
%5 = load %struct.ecs*, %struct.ecs** %3
%6 = load i64, i64* %4
%7 = call i32 @_ecs_check_rw(%struct.ecs* %5, i64 %6, i32 4)
%8 = load %struct.ecs*, %struct.ecs** %3
%9 = load i64, i64* %4
%10 = call i64 @_ecs_cptr(%struct.ecs* %8, i64 %9)
%11 = inttoptr i64 %10 to float*
%12 = load float, float* %11
ret float %12
}

LLVM IR (-O2):
%struct.ecs = type { i32 }
define float @_ecs_read_f32(%struct.ecs* %0, i64 %1) {
%3 = tail call i32 @_ecs_check_rw(%struct.ecs* %0, i64 %1, i32 4)
%4 = tail call i64 @_ecs_cptr(%struct.ecs* %0, i64 %1)
%5 = inttoptr i64 %4 to float*
%6 = load float, float* %5
ret float %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XVisibilityEvent;

/* Variables and functions */
void set_XVisibilityEvent_type(void *_p, int _v) {
  ((XVisibilityEvent *)_p)->type = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XVisibilityEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XVisibilityEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void p_setp(short nbits) {}


x86 assembly (clang, -O0):
<p_setp>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @p_setp(i16 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void school(void) { printf("Ass Hole\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Ass Hole\00"
define void @school() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int main(void) {
  void (*f)(void (*)(void)) = h();
  printf("%p\n", f);
  f(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <h@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   *-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <h@plt>
movslq %eax,%rbx
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   *%rbx
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @h()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to void (void ()*)*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), void (void ()*)* %3)
tail call void %3(void ()* null)
ret i32 0
}
void gdk_cursor_unref() {}


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

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

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

LLVM IR (-O2):
define void @gdk_cursor_unref() {
ret void
}
/* Variables and functions */
unsigned long get_ms();
unsigned long millis() { return get_ms(); }


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

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

LLVM IR (-O0):
define i64 @millis() {
%1 = call i64 (...) @get_ms()
ret i64 %1
}

LLVM IR (-O2):
define i64 @millis() {
%1 = tail call i64 (...) @get_ms()
ret i64 %1
}
unsigned char sd_raw_rec_byte(void) {
  (*(volatile unsigned long *)(0xE0020000 + 0x08)) = 0xff;
  while (!((*(volatile unsigned long *)(0xE0020000 + 0x04)) & 0x80))
    ;
  return (*(volatile unsigned long *)(0xE0020000 + 0x08));
}


x86 assembly (clang, -O0):
<sd_raw_rec_byte>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0020008,%eax
movq   $0xff,(%rax)
mov    $0xe0020004,%eax
mov    (%rax),%rax
and    $0x80,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <sd_raw_rec_byte+0x34>
jmp    1139 <sd_raw_rec_byte+0x39>
jmp    1110 <sd_raw_rec_byte+0x10>
mov    $0xe0020008,%eax
mov    (%rax),%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_raw_rec_byte>:
mov    $0xe0020008,%eax
movq   $0xff,(%rax)
nopl   0x0(%rax)
testq  $0x80,-0x4(%rax)
je     1110 <sd_raw_rec_byte+0x10>
mov    (%rax),%rax
ret

LLVM IR (-O0):
define zeroext i8 @sd_raw_rec_byte() {
store volatile i64 255, i64* inttoptr (i64 3758227464 to i64*)
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 3758227460 to i64*)
%3 = and i64 %2, 128
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 3758227464 to i64*)
%9 = trunc i64 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @sd_raw_rec_byte() {
store volatile i64 255, i64* inttoptr (i64 3758227464 to i64*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3758227460 to i64*)
%3 = and i64 %2, 128
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3758227464 to i64*)
%7 = trunc i64 %6 to i8
ret i8 %7
}
void __rcu_check_callbacks(int cpu, int user) {}


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

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

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

LLVM IR (-O2):
define void @__rcu_check_callbacks(i32 %0, i32 %1) {
ret void
}
int test_bit(int nr, volatile const unsigned long *addr) {
  return (*addr & (1 << nr)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
and    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
xor    %eax,%eax
and    (%rsi),%rcx
setne  %al
ret

LLVM IR (-O0):
define i32 @test_bit(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 = load volatile i64, i64* %5
%7 = load i32, i32* %3
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
%10 = and i64 %6, %9
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = load volatile i64, i64* %1
%4 = shl nuw i32 1, %0
%5 = sext i32 %4 to i64
%6 = and i64 %3, %5
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int ti_stoch_start(double const *options) {
  const int kperiod = (int)options[0];
  const int kslow = (int)options[1];
  const int dperiod = (int)options[2];
  return kperiod + kslow + dperiod - 3;
}


x86 assembly (clang, -O0):
<ti_stoch_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si 0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si 0x10(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
sub    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_stoch_start>:
cvttsd2si (%rdi),%eax
cvttsd2si 0x8(%rdi),%ecx
add    %eax,%ecx
cvttsd2si 0x10(%rdi),%eax
add    %ecx,%eax
add    $0xfffffffd,%eax
ret

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

LLVM IR (-O2):
define i32 @ti_stoch_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fptosi double %8 to i32
%10 = add i32 %3, -3
%11 = add i32 %10, %6
%12 = add i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ argb();
int /*<<< orphan*/ argw();
void rop_2wb() {
  argw();
  argb();
}


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

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

LLVM IR (-O0):
define void @rop_2wb() {
%1 = call i32 (...) @argw()
%2 = call i32 (...) @argb()
ret void
}

LLVM IR (-O2):
define void @rop_2wb() {
%1 = tail call i32 (...) @argw()
%2 = tail call i32 (...) @argb()
ret void
}
void RTUuidCompareStr(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUuidCompareStr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void SystemSettingsLogging() { UAVObjLogging(SystemSettingsHandle()); }


x86 assembly (clang, -O0):
<SystemSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SystemSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <SystemSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @SystemSettingsLogging() {
%1 = call i32 (...) @SystemSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SystemSettingsLogging() {
%1 = tail call i32 (...) @SystemSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int foo(int argc, char **argv) {
  int a;
  int b;
  int c;
  b = argc + 1;
  c = argc + 2;
  a = b + c;
  if (argc * 2) {
    c = argc + 3;
  }
  printf("%d, %d\n", a, b + c);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cmp    $0x0,%eax
je     1152 <foo+0x42>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    -0x1c(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x3(%rdi),%eax
test   %edi,%edi
mov    $0x2,%ecx
cmovne %eax,%ecx
lea    (%rdi,%rdi,1),%esi
add    $0x3,%esi
lea    (%rcx,%rdi,1),%edx
add    $0x1,%edx
lea    0xed0(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @foo(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, 1
%4 = add nsw i32 %0, 2
%5 = icmp eq i32 %0, 0
%6 = add nsw i32 %0, 3
%7 = select i1 %5, i32 2, i32 %6
%8 = add nsw i32 %4, %3
%9 = add nsw i32 %7, %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void cpp_overload3(int p1, int p2, int p3) {
  printf("CPP Three params: %c %d %d\n", p1, p2, p3);
}


x86 assembly (clang, -O0):
<cpp_overload3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpp_overload3>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"CPP Three params: %c %d %d\0A\00"
define void @cpp_overload3(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 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"CPP Three params: %c %d %d\0A\00"
define void @cpp_overload3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
double f(double x) { return 1.0 / x; }


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

x86 assembly (clang, -O2):
<f>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ suspend();
void cmd_suspend(const char *pf, char **args) { suspend(); }


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

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

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

LLVM IR (-O2):
define void @cmd_suspend(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @suspend()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void print_string(FILE *output, char *obj) {
  if (obj) {
    fprintf(output, "%s", obj);
  } else {
    fprintf(output, "<NULL>");
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <print_string+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1158 <print_string+0x48>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
mov    %rdi,%rcx
test   %rsi,%rsi
je     1133 <print_string+0x13>
mov    %rsi,%rdi
mov    %rcx,%rsi
jmp    1030 <fputs@plt>
lea    0xec6(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"<NULL>\00"
define void @print_string(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %14
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"<NULL>\00"
define void @print_string(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @fputs(i8* %1, i32* %0)
br label %8
6: ; preds = %2
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 6, i64 1, i32* %0)
br label %8
8: ; preds = %6, %4
ret void
}