xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void main(void) {
  char str[] = "Hello world...";
  fprintf(stdout, "str = %s\n", str);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x1(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0xf(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x2e2e2e646c726f,%rax
mov    %rax,0xf(%rsp)
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,0x8(%rsp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@__const.main.str = [15 x i8] c"Hello world...\00"
@stdout = global i32 0
@.str = [10 x i8] c"str = %s\0A\00"
define void @main() {
%1 = alloca [15 x i8]
%2 = bitcast [15 x i8]* %1 to i8*
%3 = load i32, i32* @stdout
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.str = [15 x i8] c"Hello world...\00"
@stdout = global i32 0
@.str = [10 x i8] c"str = %s\0A\00"
define void @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @exit(i32 0)
unreachable
}
void gtk_text_view_set_border_window_size() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_sub_sd(__m128d A, __m128d B) { return _mm_sub_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sub_sd>:
jmp    1030 <_mm_sub_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_sub_sd(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 @_mm_sub_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sub_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_sd(i32 %0, i32 %1)
ret i32 %3
}
const char *ft_ech_option_array(void) {
  static char backslash[128];
  *('b' + backslash) = 8;
  *('e' + backslash) = 27;
  *('f' + backslash) = 12;
  *('n' + backslash) = 10;
  *('r' + backslash) = 13;
  *('t' + backslash) = 9;
  *('v' + backslash) = 11;
  *('\\' + backslash) = 92;
  return ((const char *)backslash);
}


x86 assembly (clang, -O0):
<ft_ech_option_array>:
push   %rbp
mov    %rsp,%rbp
movb   $0x8,0x2f87(%rip)
movb   $0x1b,0x2f83(%rip)
movb   $0xc,0x2f7d(%rip)
movb   $0xa,0x2f7e(%rip)
movb   $0xd,0x2f7b(%rip)
movb   $0x9,0x2f76(%rip)
movb   $0xb,0x2f71(%rip)
movb   $0x5c,0x2f50(%rip)
lea    0x2eed(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ech_option_array>:
movb   $0x8,0x2f8b(%rip)
lea    0x2f22(%rip),%rax
movw   $0xc1b,0x2f7e(%rip)
1b 0c
movb   $0xa,0x2f80(%rip)
movb   $0xd,0x2f7d(%rip)
movb   $0x9,0x2f78(%rip)
movb   $0xb,0x2f73(%rip)
movb   $0x5c,0x2f52(%rip)
ret

LLVM IR (-O0):
@ft_ech_option_array.backslash = internal global [128 x i8] zeroinitializer
define i8* @ft_ech_option_array() {
store i8 8, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 98)
store i8 27, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 101)
store i8 12, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 102)
store i8 10, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 110)
store i8 13, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 114)
store i8 9, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 116)
store i8 11, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 118)
store i8 92, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 92)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 0)
}

LLVM IR (-O2):
@ft_ech_option_array.backslash = internal global [128 x i8] zeroinitializer
define i8* @ft_ech_option_array() {
store i8 8, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 98)
store i8 27, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 101)
store i8 12, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 102)
store i8 10, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 110)
store i8 13, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 114)
store i8 9, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 116)
store i8 11, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 118)
store i8 92, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 92)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ft_ech_option_array.backslash, i64 0, i64 0)
}
void rop3_7_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_7_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_7_1_0>:
mov    (%rdi),%al
and    %sil,%al
or     %esi,%edx
not    %dl
or     %al,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_7_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %2, %1
%7 = xor i8 %6, -1
%8 = or i8 %5, %7
store i8 %8, i8* %0
ret void
}
void metric_unregister_ptr(struct list_head *entry) {}


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

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

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

LLVM IR (-O2):
%struct.list_head = type opaque
define void @metric_unregister_ptr(%struct.list_head* nocapture %0) {
ret void
}
void ansi_c_ast_gen_placeholder(void) {}


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

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

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

LLVM IR (-O2):
define void @ansi_c_ast_gen_placeholder() {
ret void
}
int _close(int fd) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
int max(int aa, int bb) {
  if (aa > bb)
    return (aa);
  else
    return (bb);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int /*<<< orphan*/, int /*<<< orphan*/, ...);
void shellInit(void) {
  int flags = fcntl(0, F_GETFL);
  flags |= O_NONBLOCK;
  fcntl(0, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<shellInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shellInit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
xor    %edi,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @shellInit() {
%1 = alloca i32
%2 = load i32, i32* @F_GETFL
%3 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* @O_NONBLOCK
%5 = load i32, i32* %1
%6 = or i32 %5, %4
store i32 %6, i32* %1
%7 = load i32, i32* @F_SETFL
%8 = load i32, i32* %1
%9 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @shellInit() {
%1 = load i32, i32* @F_GETFL
%2 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %1)
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %3, %2
%5 = load i32, i32* @F_SETFL
%6 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %5, i32 %4)
ret void
}
/* Type definitions */
struct vnode {
  int dummy;
};

/* Variables and functions */
int is_bad_inode(int /*<<< orphan*/);
int /*<<< orphan*/ vn_to_inode(struct vnode *);
int VN_BAD(struct vnode *vp) { return is_bad_inode(vn_to_inode(vp)); }


x86 assembly (clang, -O0):
<VN_BAD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vn_to_inode@plt>
mov    %eax,%edi
call   1030 <is_bad_inode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VN_BAD>:
push   %rax
call   1040 <vn_to_inode@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <is_bad_inode@plt>

LLVM IR (-O0):
%struct.vnode = type { i32 }
define i32 @VN_BAD(%struct.vnode* %0) {
%2 = alloca %struct.vnode*
store %struct.vnode* %0, %struct.vnode** %2
%3 = load %struct.vnode*, %struct.vnode** %2
%4 = call i32 @vn_to_inode(%struct.vnode* %3)
%5 = call i32 @is_bad_inode(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.vnode = type { i32 }
define i32 @VN_BAD(%struct.vnode* %0) {
%2 = tail call i32 @vn_to_inode(%struct.vnode* %0)
%3 = tail call i32 @is_bad_inode(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func();
void f(void) { func(); }


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

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

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

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 (...) @func()
ret void
}
/* Variables and functions */
char *get_date() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @get_date() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @get_date() {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int LOG_DAEMON;
int LOG_NOTICE;
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void __syslog_vfprintf(const char *format, va_list ap) {
  vsyslog(LOG_DAEMON | LOG_NOTICE, format, ap);
}


x86 assembly (clang, -O0):
<__syslog_vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
or     (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syslog_vfprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
@LOG_DAEMON = global i32 0
@LOG_NOTICE = global i32 0
define void @__syslog_vfprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @LOG_DAEMON
%6 = load i32, i32* @LOG_NOTICE
%7 = or i32 %5, %6
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vsyslog(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@LOG_DAEMON = global i32 0
@LOG_NOTICE = global i32 0
define void @__syslog_vfprintf(i8* %0, i32 %1) {
%3 = load i32, i32* @LOG_DAEMON
%4 = load i32, i32* @LOG_NOTICE
%5 = or i32 %4, %3
%6 = tail call i32 @vsyslog(i32 %5, i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ror(int, int);
uint32_t decode_immediate_shifter_operand(uint32_t insn) {
  uint32_t inmed_8 = insn & 0xFF;
  uint32_t rotate_imm = (insn & 0xF00) >> 7;
  return ror(inmed_8, rotate_imm);
}


x86 assembly (clang, -O0):
<decode_immediate_shifter_operand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf00,%eax
sar    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <ror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_immediate_shifter_operand>:
mov    %edi,%esi
movzbl %sil,%edi
shr    $0x7,%esi
and    $0x1e,%esi
jmp    1030 <ror@plt>

LLVM IR (-O0):
define i32 @decode_immediate_shifter_operand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, 3840
%9 = ashr i32 %8, 7
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @ror(i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @decode_immediate_shifter_operand(i32 %0) {
%2 = and i32 %0, 255
%3 = lshr i32 %0, 7
%4 = and i32 %3, 30
%5 = tail call i32 @ror(i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintFromsolib() {
  printf("Hello from my solib\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello from my solib\00"
define void @PrintFromsolib() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int main() {
  int i = 0, j;
  while (i < 100000) {
    j = i;
    while (j < 100000) {
      j++;
    }
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    114e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    1140 <main+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void record_new_skb(struct sk_buff *skb, int type, int include_body) {}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define void @record_new_skb(%struct.sk_buff* %0, i32 %1, i32 %2) {
%4 = alloca %struct.sk_buff*
%5 = alloca i32
%6 = alloca i32
store %struct.sk_buff* %0, %struct.sk_buff** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define void @record_new_skb(%struct.sk_buff* nocapture %0, i32 %1, i32 %2) {
ret void
}
int isExpersion(char *input, int parms) {
  if (parms != 1)
    return 0;
  else {
    int i = 0;
    for (i = 0; input[i] != '\0'; i++) {
      if (input[i] == '=')
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isExpersion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1121 <isExpersion+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1184 <isExpersion+0x84>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1178 <isExpersion+0x78>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    1165 <isExpersion+0x65>
movl   $0x1,-0x4(%rbp)
jmp    1184 <isExpersion+0x84>
jmp    116a <isExpersion+0x6a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <isExpersion+0x2f>
jmp    117d <isExpersion+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isExpersion>:
xor    %eax,%eax
cmp    $0x1,%esi
jne    1129 <isExpersion+0x29>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1122 <isExpersion+0x22>
cmp    $0x3d,%cl
je     1122 <isExpersion+0x22>
add    $0x1,%rdi
jmp    1110 <isExpersion+0x10>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isExpersion(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %13
4: ; preds = %2, %8
%5 = phi i64 [ %9, %8 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %8 [
i8 61, label %10
i8 0, label %10
]
8: ; preds = %4
%9 = add nuw i64 %5, 1
br label %4
10: ; preds = %4, %4
%11 = icmp ne i8 %7, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %2
%14 = phi i32 [ 0, %2 ], [ %12, %10 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_vlan_vid_print(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_vlan_vid_to_string(uint32_t vid) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_vlan_vid_print(stream, vid);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_vlan_vid_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <ofl_vlan_vid_print@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_vlan_vid_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <ofl_vlan_vid_print@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_vlan_vid_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_vlan_vid_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_vlan_vid_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_vlan_vid_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char **);
void scanf_string() {
  char *string;
  scanf("%ms", &string);
  printf("%s\n", string);
}


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

x86 assembly (clang, -O2):
<scanf_string>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ms\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @scanf_string() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = load i8*, i8** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
void TimerInputTriggerSelect(unsigned long ulBase,
                             unsigned long ulInputTriggerSource) {
  unsigned long ulTempsmcr = 0;

  ;

  ;
  ulTempsmcr = (*((volatile unsigned long *)(ulBase + 0x00000008)));
  ulTempsmcr &= ~0x00000070;
  ulTempsmcr |= ulInputTriggerSource;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulTempsmcr;
}


x86 assembly (clang, -O0):
<TimerInputTriggerSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xffffffffffffff8f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerInputTriggerSelect>:
mov    0x8(%rdi),%rax
and    $0xffffffffffffff8f,%rax
or     %rsi,%rax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @TimerInputTriggerSelect(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -113
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = or i64 %13, %12
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %3
%17 = add i64 %16, 8
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @TimerInputTriggerSelect(i64 %0, i64 %1) {
%3 = add i64 %0, 8
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -113
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
/* Variables and functions */
scalar_t__ INT_MIN;
int main(void) { return (unsigned int)INT_MIN / -1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%rax
mov    $0xffffffff,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmpl   $0xffffffff,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = udiv i32 %3, -1
ret i32 %4
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @main() {
%1 = load i64, i64* @INT_MIN
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dev_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<dev_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dev_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", 4 - 4 * 2);
  printf("%d\n", ((4 - 4) * (2)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xfffffffc,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int get_position(void *sensor_address) {
  return *((volatile int *)sensor_address + 1);
}


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

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

LLVM IR (-O0):
define i32 @get_position(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load volatile i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_position(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = bitcast i8* %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t cichlid_rotate_left_32(uint32_t x, int n) {
  return (x << n) | (x >> (32 - n));
}


x86 assembly (clang, -O0):
<cichlid_rotate_left_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cichlid_rotate_left_32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cichlid_rotate_left_32(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @cichlid_rotate_left_32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
scalar_t__ execute();
int run(void) {
  while (1) {
    if (execute())
      break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <run+0x9>
mov    $0x0,%al
call   1030 <execute@plt>
cmp    $0x0,%rax
je     112f <run+0x1f>
jmp    1134 <run+0x24>
jmp    1119 <run+0x9>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <execute@plt>
test   %rax,%rax
je     1120 <run+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @run() {
br label %1
1: ; preds = %0, %5
%2 = call i64 (...) @execute()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %6
5: ; preds = %1
br label %1
6: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @run() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @execute()
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 0
}
/* Type definitions */
struct stack_client {
  int dummy;
};
struct stack {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct node *);
void release_node(struct stack *stack, struct stack_client *client,
                  struct node *node) {
  free(node);
}


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

x86 assembly (clang, -O2):
<release_node>:
mov    %rdx,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
%struct.stack_client = type { i32 }
%struct.node = type { i32 }
define void @release_node(%struct.stack* %0, %struct.stack_client* %1, %struct.node* %2) {
%4 = alloca %struct.stack*
%5 = alloca %struct.stack_client*
%6 = alloca %struct.node*
store %struct.stack* %0, %struct.stack** %4
store %struct.stack_client* %1, %struct.stack_client** %5
store %struct.node* %2, %struct.node** %6
%7 = load %struct.node*, %struct.node** %6
%8 = call i32 @free(%struct.node* %7)
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
%struct.stack_client = type { i32 }
%struct.node = type { i32 }
define void @release_node(%struct.stack* nocapture readnone %0, %struct.stack_client* nocapture readnone %1, %struct.node* nocapture %2) {
%4 = tail call i32 @free(%struct.node* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delay_note_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<delay_note_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @delay_note_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ChildProcess();
int /*<<< orphan*/ ParentProcess();
scalar_t__ fork();
int /*<<< orphan*/ printf(char *, int);
void main() {
  pid_t pid;
  int num = 20;
  pid = fork();
  if (pid == 0) {
    ChildProcess();
    printf("Value of num = %d\n", num);
  } else {
    ParentProcess();
    num += 5;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x14,-0xc(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1180 <main+0x40>
mov    $0x0,%al
call   1050 <ChildProcess@plt>
mov    -0xc(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <main+0x50>
mov    $0x0,%al
call   1040 <ParentProcess@plt>
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1155 <main+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ParentProcess@plt>
xor    %eax,%eax
call   1050 <ChildProcess@plt>
lea    0xe9d(%rip),%rdi
mov    $0x14,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Value of num = %d\0A\00"
define void @main() {
%1 = alloca i64
%2 = alloca i32
store i32 20, i32* %2
%3 = call i64 (...) @fork()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 (...) @ChildProcess()
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %14
10: ; preds = %0
%11 = call i32 (...) @ParentProcess()
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 5
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Value of num = %d\0A\00"
define void @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @ChildProcess()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 20)
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @ParentProcess()
br label %8
8: ; preds = %6, %3
ret void
}
void my_lock(int fd) { return; }


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

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

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

LLVM IR (-O2):
define void @my_lock(i32 %0) {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void file__print_mtime(struct stat *st) {
  struct tm *time = localtime(&st->st_mtime);
  char time_buffer[100];
  strftime(time_buffer, 100, "%b %2e %H:%M", time);
  printf("%s ", time_buffer);
}


x86 assembly (clang, -O0):
<file__print_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x64,%esi
lea    0xea0(%rip),%rdx
call   1050 <strftime@plt>
lea    -0x80(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file__print_mtime>:
push   %rbx
sub    $0x70,%rsp
call   1030 <localtime@plt>
lea    0xebf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.tm = type { i32 }
@.str = [13 x i8] c"%b %2e %H:%M\00"
@.str.1 = [4 x i8] c"%s \00"
define void @file__print_mtime(%struct.stat* %0) {
%2 = alloca %struct.stat*
%3 = alloca %struct.tm*
%4 = alloca [100 x i8]
store %struct.stat* %0, %struct.stat** %2
%5 = load %struct.stat*, %struct.stat** %2
%6 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%7 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %7, %struct.tm** %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = load %struct.tm*, %struct.tm** %3
%10 = call i32 @strftime(i8* %8, i32 100, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.tm = type { i32 }
@.str = [13 x i8] c"%b %2e %H:%M\00"
@.str.1 = [4 x i8] c"%s \00"
define void @file__print_mtime(%struct.stat* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%4 = tail call %struct.tm* @localtime(i32* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @strftime(i8* %5, i32 100, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_mulhi_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm256_mullo_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm256_sub_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m256i reduce_16(__m256i r, __m256i _w31, __m256i _w2114) {
  __m256i exp = _mm256_mulhi_epi16(r, _w2114);
  return _mm256_sub_epi16(r, _mm256_mullo_epi16(_w31, exp));
}


x86 assembly (clang, -O0):
<reduce_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <_mm256_mulhi_epi16@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm256_mullo_epi16@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm256_sub_epi16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce_16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%esi
call   1050 <_mm256_mulhi_epi16@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm256_mullo_epi16@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_mm256_sub_epi16@plt>

LLVM IR (-O0):
define i32 @reduce_16(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = call i32 @_mm256_mulhi_epi16(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = call i32 @_mm256_mullo_epi16(i32 %12, i32 %13)
%15 = call i32 @_mm256_sub_epi16(i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @reduce_16(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm256_mulhi_epi16(i32 %0, i32 %2)
%5 = tail call i32 @_mm256_mullo_epi16(i32 %1, i32 %4)
%6 = tail call i32 @_mm256_sub_epi16(i32 %0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void parse_error(const char *message) {
  if (message)
    fprintf(stderr, "getopt: %s\n", message);
  fputs(("Try `getopt --help' for more information.\n"), stderr);
  exit(2);
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <parse_error+0x30>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<parse_error>:
push   %rax
test   %rdi,%rdi
je     114e <parse_error+0x1e>
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xeae(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"getopt: %s\0A\00"
@.str.1 = [43 x i8] c"Try `getopt --help' for more information.\0A\00"
define void @parse_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"getopt: %s\0A\00"
@.str.1 = [43 x i8] c"Try `getopt --help' for more information.\0A\00"
define void @parse_error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 2)
unreachable
}
int test_imm_24int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x24 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_24int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x24,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_24int64_midword_mem>:
testb  $0x24,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_24int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 36
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_24int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2359296
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __fortify_fail(char *);
void __attribute__((noreturn)) __chk_fail(void) {
  __fortify_fail("buffer overflow detected");
}


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

x86 assembly (clang, -O2):
<__chk_fail>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <__fortify_fail@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"buffer overflow detected\00"
define void @__chk_fail() {
%1 = call i32 @__fortify_fail(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"buffer overflow detected\00"
define void @__chk_fail() {
%1 = tail call i32 @__fortify_fail(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
unreachable
}