xunge/DecIR huggingface dataset:
/* Variables and functions */
int sscanf(char *, char *, unsigned int *, unsigned int *);
int extract_major_minor_from_cmdline(char *argv[], unsigned int *major,
                                     unsigned int *minor) {
  if (sscanf(argv[1], "%u:%u", major, minor) != 2) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<extract_major_minor_from_cmdline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x2,%eax
je     1155 <extract_major_minor_from_cmdline+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <extract_major_minor_from_cmdline+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_major_minor_from_cmdline>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x8(%rdi),%rdi
lea    0xede(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%u:%u\00"
define i32 @extract_major_minor_from_cmdline(i8** %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
store i8** %0, i8*** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %11, i32* %12)
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %17
16: ; preds = %3
store i32 0, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"%u:%u\00"
define i32 @extract_major_minor_from_cmdline(i8** nocapture %0, i32* %1, i32* %2) {
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = icmp ne i32 %6, 2
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x_root;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xbutton_x_root(void *_p) {
  return (int)((XEvent *)_p)->xbutton.x_root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xbutton_x_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xbutton_x_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int Cyc_Character_isprint(unsigned char c) {
  return c == ' ' ? 1 : (c >= '!' ? c <= '~' : 0);
}


x86 assembly (clang, -O0):
<Cyc_Character_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jne    1124 <Cyc_Character_isprint+0x24>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <Cyc_Character_isprint+0x58>
movzbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jl     1148 <Cyc_Character_isprint+0x48>
movzbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <Cyc_Character_isprint+0x52>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <Cyc_Character_isprint+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Character_isprint>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @Cyc_Character_isprint(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
br label %19
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 33
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = icmp sle i32 %13, 126
%15 = zext i1 %14 to i32
br label %17
16: ; preds = %7
br label %17
17: ; preds = %16, %11
%18 = phi i32 [ %15, %11 ], [ 0, %16 ]
br label %19
19: ; preds = %17, %6
%20 = phi i32 [ 1, %6 ], [ %18, %17 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @Cyc_Character_isprint(i8 zeroext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vgop_get_brokenlink(const uint8_t *p_mp2vgop) {
  return !!(p_mp2vgop[7] & 0x20);
}


x86 assembly (clang, -O0):
<mp2vgop_get_brokenlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vgop_get_brokenlink>:
mov    0x1c(%rdi),%eax
shr    $0x5,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vgop_get_brokenlink(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vgop_get_brokenlink(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 1
ret i32 %5
}
void foo_1_1_2_2_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_2_2_1_1() {
ret void
}
long long ssuu() { return 0xffffffff7fff7fffLL; }


x86 assembly (clang, -O0):
<ssuu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffffffff7fff7fff,%rax
ff ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssuu>:
movabs $0xffffffff7fff7fff,%rax
ff ff ff
ret

LLVM IR (-O0):
define i64 @ssuu() {
ret i64 -2147516417
}

LLVM IR (-O2):
define i64 @ssuu() {
ret i64 -2147516417
}
void d2i_OCSP_REQINFO(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_OCSP_REQINFO() {
ret void
}
char *get_path(void) { return "/vmlinuz"; }


x86 assembly (clang, -O0):
<get_path>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_path>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/vmlinuz\00"
define i8* @get_path() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"/vmlinuz\00"
define i8* @get_path() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
void foo799(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo799(i32 %0) {
ret void
}
/* Variables and functions */
int ssds_get_gen_name(int, char *, char *, char *, char *, int);
int ssds_get_item_value(int pcfd, char *full_def, char *res, int len) {
  return ssds_get_gen_name(pcfd, full_def, "gvf", "value", res, len);
}


x86 assembly (clang, -O0):
<ssds_get_item_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xec4(%rip),%rdx
lea    0xec1(%rip),%rcx
call   1030 <ssds_get_gen_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_item_value>:
mov    %ecx,%r9d
mov    %rdx,%r8
lea    0xee3(%rip),%rdx
lea    0xee0(%rip),%rcx
jmp    1030 <ssds_get_gen_name@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"gvf\00"
@.str.1 = [6 x i8] c"value\00"
define i32 @ssds_get_item_value(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ssds_get_gen_name(i32 %9, i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"gvf\00"
@.str.1 = [6 x i8] c"value\00"
define i32 @ssds_get_item_value(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @ssds_get_gen_name(i32 %0, i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
bool startsWith(const char *str, const char *pre) {
  size_t max = strlen(pre);
  return strlen(str) < max ? false : strncmp(str, pre, max) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    -0x18(%rbp),%rax
jae    115a <startsWith+0x3a>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    117a <startsWith+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jb     1161 <startsWith+0x41>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
br label %20
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = call i64 @strncmp(i8* %14, i8* %15, i64 %16)
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %13, %12
%21 = phi i32 [ 0, %12 ], [ %19, %13 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
int condition_plus(char c) { return c == '+'; }


x86 assembly (clang, -O0):
<condition_plus>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_plus>:
xor    %eax,%eax
cmp    $0x2b,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @condition_plus(i8 signext %0) {
%2 = icmp eq i8 %0, 43
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *ctermid(char *name_space) {
  static char termid[9];
  if (name_space == (char *)NULL)
    name_space = termid;
  strcpy(name_space, "/dev/tty");
  return (name_space);
}


x86 assembly (clang, -O0):
<ctermid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <ctermid+0x22>
lea    0x2efb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctermid>:
push   %rbx
test   %rdi,%rdi
lea    0x2f0e(%rip),%rbx
cmovne %rdi,%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ctermid.termid = internal global [9 x i8] zeroinitializer
@.str = [9 x i8] c"/dev/tty\00"
define i8* @ctermid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @ctermid.termid, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@ctermid.termid = internal global [9 x i8] zeroinitializer
@.str = [9 x i8] c"/dev/tty\00"
define i8* @ctermid(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @ctermid.termid, i64 0, i64 0), i8* %0
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
void st_relayfs_freeindex(unsigned int source, unsigned int index) {}


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

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

LLVM IR (-O0):
define void @st_relayfs_freeindex(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 @st_relayfs_freeindex(i32 %0, i32 %1) {
ret void
}
__attribute__((always_)) int
module_get_iter_tracepoints(struct tracepoint_iter *iter) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tracepoint_iter = type opaque
define i32 @module_get_iter_tracepoints(%struct.tracepoint_iter* nocapture readnone %0) {
ret i32 0
}
int test1() {
  int x;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @test1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, long);
void onexit_func(int exitStatus, void *arg) {
  printf("on_exit function called: status=%d, arg=%ld\n", exitStatus,
         (long)arg);
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"on_exit function called: status=%d, arg=%ld\0A\00"
define void @onexit_func(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"on_exit function called: status=%d, arg=%ld\0A\00"
define void @onexit_func(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
ret void
}
double d2phicaley(const double x) {
  double x4 = (x * x * x * x);
  return 2 * (x4 - 4 * x + 3) / x4;
}


x86 assembly (clang, -O0):
<d2phicaley>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xedc(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2phicaley>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xee8(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @d2phicaley(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = load double, double* %2
%10 = fmul double %8, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = load double, double* %2
%13 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %12, double %11)
%14 = fadd double %13, 3.000000e+00
%15 = fmul double 2.000000e+00, %14
%16 = load double, double* %3
%17 = fdiv double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @d2phicaley(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
%5 = tail call double @llvm.fmuladd.f64(double %0, double -4.000000e+00, double %4)
%6 = fadd double %5, 3.000000e+00
%7 = fmul double %6, 2.000000e+00
%8 = fdiv double %7, %4
ret double %8
}
char getCardByValue(char value, unsigned char *cards, int count) {
  int i;
  for (i = 0; i < count; i++) {
    if (((unsigned char)cards[i] / 4) == value) {
      return cards[i];
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<getCardByValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116a <getCardByValue+0x6a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    1157 <getCardByValue+0x57>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    116e <getCardByValue+0x6e>
jmp    115c <getCardByValue+0x5c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <getCardByValue+0x18>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCardByValue>:
mov    $0xff,%al
test   %edx,%edx
jle    1127 <getCardByValue+0x27>
movsbl %dil,%r9d
mov    %edx,%r8d
xor    %edi,%edi
nop
movzbl (%rsi,%rdi,1),%ecx
mov    %ecx,%edx
shr    $0x2,%edx
cmp    %r9d,%edx
je     1128 <getCardByValue+0x28>
add    $0x1,%rdi
cmp    %rdi,%r8
jne    1110 <getCardByValue+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @getCardByValue(i8 signext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i8 %0 to i32
%7 = zext i32 %2 to i64
br label %10
8: ; preds = %10
%9 = icmp eq i64 %17, %7
br i1 %9, label %18, label %10
10: ; preds = %5, %8
%11 = phi i64 [ 0, %5 ], [ %17, %8 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = lshr i8 %13, 2
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, %6
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %8
18: ; preds = %10, %8, %3
%19 = phi i8 [ -1, %3 ], [ -1, %8 ], [ %13, %10 ]
ret i8 %19
}
long int vl_floor_f(float x) {
  long int xi = (long int)x;
  if (x >= 0 || (float)xi == x)
    return xi;
  else
    return xi - 1;
}


x86 assembly (clang, -O0):
<vl_floor_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    113a <vl_floor_f+0x3a>
cvtsi2ssq -0x18(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    1147 <vl_floor_f+0x47>
jp     1147 <vl_floor_f+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <vl_floor_f+0x53>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vl_floor_f>:
cvttss2si %xmm0,%rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setb   %sil
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
ucomiss %xmm0,%xmm1
setp   %dl
setne  %cl
or     %dl,%cl
and    %sil,%cl
movzbl %cl,%ecx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @vl_floor_f(float %0) {
%2 = alloca i64
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
%5 = load float, float* %3
%6 = fptosi float %5 to i64
store i64 %6, i64* %4
%7 = load float, float* %3
%8 = fcmp oge float %7, 0.000000e+00
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i64, i64* %4
%11 = sitofp i64 %10 to float
%12 = load float, float* %3
%13 = fcmp oeq float %11, %12
br i1 %13, label %14, label %16
14: ; preds = %9, %1
%15 = load i64, i64* %4
store i64 %15, i64* %2
br label %19
16: ; preds = %9
%17 = load i64, i64* %4
%18 = sub nsw i64 %17, 1
store i64 %18, i64* %2
br label %19
19: ; preds = %16, %14
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @vl_floor_f(float %0) {
%2 = fptosi float %0 to i64
%3 = fcmp ult float %0, 0.000000e+00
%4 = sitofp i64 %2 to float
%5 = fcmp une float %4, %0
%6 = select i1 %3, i1 %5, i1 false
%7 = sext i1 %6 to i64
%8 = add nsw i64 %7, %2
ret i64 %8
}
unsigned int __attribute__((no)) test_01(unsigned a, unsigned b) {
  return a / b;
}


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

x86 assembly (clang, -O2):
<test_01>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i32 @test_01(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func5();
void DummyMain() { func5(); }


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

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

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

LLVM IR (-O2):
define void @DummyMain() {
%1 = tail call i32 (...) @func5()
ret void
}
/* Variables and functions */
int japi_choicebox3(int, char *, char *, char *, char *, char *);
int j_choicebox3(int arg0, char *arg1, char *arg2, char *arg3, char *arg4,
                 char *arg5) {
  return (japi_choicebox3(arg0, arg1, arg2, arg3, arg4, arg5));
}


x86 assembly (clang, -O0):
<j_choicebox3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <japi_choicebox3@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_choicebox3>:
jmp    1030 <japi_choicebox3@plt>

LLVM IR (-O0):
define i32 @j_choicebox3(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i32 @japi_choicebox3(i32 %13, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @j_choicebox3(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @japi_choicebox3(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret i32 %7
}
int strcrchr(s, c)
char *s;
char c;
{
  int i;
  for (i = strlen(s) - 1; i > 0; i--)
    if (s[i] != c)
      return (i);
  return (0);
}


x86 assembly (clang, -O0):
<strcrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%rax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1172 <strcrchr+0x62>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     115f <strcrchr+0x4f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <strcrchr+0x69>
jmp    1164 <strcrchr+0x54>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1132 <strcrchr+0x22>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcrchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movsbl %bpl,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%eax
test   %eax,%eax
jle    1143 <strcrchr+0x33>
mov    %eax,%edx
movsbl (%rbx,%rdx,1),%edx
cmp    %edx,%ecx
je     1130 <strcrchr+0x20>
jmp    1145 <strcrchr+0x35>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @strcrchr(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = shl i32 %1, 24
%6 = ashr exact i32 %5, 24
br label %7
7: ; preds = %11, %2
%8 = phi i32 [ %4, %2 ], [ %9, %11 ]
%9 = add i32 %8, -1
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = zext i32 %9 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %6, %15
br i1 %16, label %7, label %17
17: ; preds = %7, %11
%18 = phi i32 [ %9, %11 ], [ 0, %7 ]
ret i32 %18
}
void busy() {}


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

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

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

LLVM IR (-O2):
define void @busy() {
ret void
}
int test_imm_1Cuint16_mem(unsigned short *val) {
  return ((*val) & (0x1C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Cuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x1c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_1Cuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 28
%7 = icmp ne i32 %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_1Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 28
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int __builtin_wasm_atomic_wait_i64(long long *, long long, long long);
int atomic_wait_i64(long long *addr, long long expected, long long timeout) {
  return __builtin_wasm_atomic_wait_i64(addr, expected, timeout);
}


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

x86 assembly (clang, -O2):
<atomic_wait_i64>:
jmp    1030 <__builtin_wasm_atomic_wait_i64@plt>

LLVM IR (-O0):
define i32 @atomic_wait_i64(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** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @__builtin_wasm_atomic_wait_i64(i64* %7, i64 %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @atomic_wait_i64(i64* %0, i64 %1, i64 %2) {
%4 = tail call i32 @__builtin_wasm_atomic_wait_i64(i64* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t bmin_int64(int64_t a, int64_t b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<bmin_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <bmin_int64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bmin_int64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmin_int64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @bmin_int64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t get_ticks(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_ticks() {
ret i32 0
}

LLVM IR (-O2):
define i32 @get_ticks() {
ret i32 0
}
/* Type definitions */
struct packit_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmdline_packit_parser_release(struct packit_args_info *);
void cmdline_packit_parser_free(struct packit_args_info *args_info) {
  cmdline_packit_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<cmdline_packit_parser_free>:
jmp    1030 <cmdline_packit_parser_release@plt>

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

LLVM IR (-O2):
%struct.packit_args_info = type { i32 }
define void @cmdline_packit_parser_free(%struct.packit_args_info* %0) {
%2 = tail call i32 @cmdline_packit_parser_release(%struct.packit_args_info* %0)
ret void
}
float radians2degree(const float *radians) {
  return *radians * 180 / 3.14159265;
}


x86 assembly (clang, -O0):
<radians2degree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xef4(%rip),%xmm0
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radians2degree>:
movss  (%rdi),%xmm0
mulss  0xef4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @radians2degree(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fmul float %4, 1.800000e+02
%6 = fpext float %5 to double
%7 = fdiv double %6, 0x400921FB53C8D4F1
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @radians2degree(float* nocapture %0) {
%2 = load float, float* %0
%3 = fmul float %2, 1.800000e+02
%4 = fpext float %3 to double
%5 = fdiv double %4, 0x400921FB53C8D4F1
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ server(int);
main() {
  server(8021);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @server(i32 8021)
ret i32 0
}
double BasicLikeArrayAccess(double *x, int i) { return x[i - 1]; }


x86 assembly (clang, -O0):
<BasicLikeArrayAccess>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BasicLikeArrayAccess>:
movslq %esi,%rax
movsd  -0x8(%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @BasicLikeArrayAccess(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %5, i64 %8
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @BasicLikeArrayAccess(double* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
ret double %6
}
void alrm_handler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @alrm_handler(i32 %0) {
ret void
}
int test_imm_0Dint64_highword_reg(long long val) {
  return ((val >> 32) & (0x0D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Dint64_highword_reg>:
movabs $0xd00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Dint64_highword_reg(i64 %0) {
%2 = and i64 %0, 55834574848
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo_1_2_2_2_1_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_1_1_2_1_2() {
ret void
}
void of_delete_property(struct property *pp) {}


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

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

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

LLVM IR (-O2):
%struct.property = type opaque
define void @of_delete_property(%struct.property* nocapture %0) {
ret void
}
long get_marked_ref(long w) { return w | 0x1L; }


x86 assembly (clang, -O0):
<get_marked_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_marked_ref>:
mov    %rdi,%rax
or     $0x1,%rax
ret

LLVM IR (-O0):
define i64 @get_marked_ref(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_marked_ref(i64 %0) {
%2 = or i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ HookAlloc(int, int, char **);
extern void HookMain(int argvId, char **argv, int envpId, char **envp) {
  HookAlloc(1, argvId, argv);
  if (envp != NULL && envpId != 0)
    HookAlloc(1, envpId, envp);
}


x86 assembly (clang, -O0):
<HookMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <HookAlloc@plt>
cmpq   $0x0,-0x20(%rbp)
je     115d <HookMain+0x4d>
cmpl   $0x0,-0x14(%rbp)
je     115d <HookMain+0x4d>
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    $0x1,%edi
call   1030 <HookAlloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HookMain>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <HookAlloc@plt>
test   %ebp,%ebp
je     1145 <HookMain+0x35>
test   %rbx,%rbx
je     1145 <HookMain+0x35>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <HookAlloc@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @HookMain(i32 %0, i8** %1, i32 %2, i8** %3) {
%5 = tail call i32 @HookAlloc(i32 1, i32 %0, i8** %1)
%6 = icmp ne i8** %3, null
%7 = icmp ne i32 %2, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @HookAlloc(i32 1, i32 %2, i8** %3)
br label %11
11: ; preds = %9, %4
ret void
}
int gcd(int a, int b) {
  while (1) {
    if (a == 0)
      return b;
    b %= a;
    if (b == 0)
      return a;
    a %= b;
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <gcd+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <gcd+0x51>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1140 <gcd+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <gcd+0x51>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %edi,%edi
je     1126 <gcd+0x26>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%eax
cltd
idiv   %edi
test   %edx,%edx
je     1129 <gcd+0x29>
mov    %edx,%esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %esi,%eax
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i32 [ %7, %9 ], [ %1, %2 ]
%6 = phi i32 [ %10, %9 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = srem i32 %6, %7
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %9, %4, %2
%13 = phi i32 [ %1, %2 ], [ %6, %4 ], [ %7, %9 ]
ret i32 %13
}
/* Variables and functions */
double __nv_rsqrt(double);
double rsqrt(double __a) { return __nv_rsqrt(__a); }


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

x86 assembly (clang, -O2):
<rsqrt>:
jmp    1030 <__nv_rsqrt@plt>

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

LLVM IR (-O2):
define double @rsqrt(double %0) {
%2 = tail call double @__nv_rsqrt(double %0)
ret double %2
}
double to_radians(double degrees) {
  return degrees * 2 * (3.141592653589793) / 360;
}


x86 assembly (clang, -O0):
<to_radians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_radians>:
addsd  %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @to_radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.000000e+00
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 3.600000e+02
ret double %6
}

LLVM IR (-O2):
define double @to_radians(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 3.600000e+02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ evaluate(double);
int main() {
  evaluate(0.25);
  evaluate(1.96);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeec(%rip),%xmm0
call   1030 <evaluate@plt>
movsd  0xed7(%rip),%xmm0
call   1030 <evaluate@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <evaluate@plt>
movsd  0xee2(%rip),%xmm0
call   1030 <evaluate@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @evaluate(double 2.500000e-01)
%2 = call i32 @evaluate(double 1.960000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @evaluate(double 2.500000e-01)
%2 = tail call i32 @evaluate(double 1.960000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bf_print(char *);
int /*<<< orphan*/ bf_putln();
int bf_println(char *msg) {
  bf_print(msg);
  bf_putln();
  return 0;
}


x86 assembly (clang, -O0):
<bf_println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bf_print@plt>
mov    $0x0,%al
call   1030 <bf_putln@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_println>:
push   %rax
call   1040 <bf_print@plt>
xor    %eax,%eax
call   1030 <bf_putln@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bf_println(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @bf_print(i8* %3)
%5 = call i32 (...) @bf_putln()
ret i32 0
}

LLVM IR (-O2):
define i32 @bf_println(i8* %0) {
%2 = tail call i32 @bf_print(i8* %0)
%3 = tail call i32 (...) @bf_putln()
ret i32 0
}