xunge/DecIR huggingface dataset:
double f4_sum_cb_double(double (*cb)()) {
  double v = cb();
  return ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_cb_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_cb_double>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define double @f4_sum_cb_double(double (...)* nocapture %0) {
%2 = tail call double (...) %0()
ret double %2
}
int add_milestones(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @add_milestones() {
ret i32 1
}

LLVM IR (-O2):
define i32 @add_milestones() {
ret i32 1
}
/* Variables and functions */
int f(int);
int main(void) {
  int retval = 0;
  for (int i = 0; i < 10; i++) {
    retval = f(i);
  }
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1150 <main+0x40>
mov    -0xc(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <f@plt>
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x2,%edi
call   1030 <f@plt>
mov    $0x3,%edi
call   1030 <f@plt>
mov    $0x4,%edi
call   1030 <f@plt>
mov    $0x5,%edi
call   1030 <f@plt>
mov    $0x6,%edi
call   1030 <f@plt>
mov    $0x7,%edi
call   1030 <f@plt>
mov    $0x8,%edi
call   1030 <f@plt>
mov    $0x9,%edi
pop    %rax
jmp    1030 <f@plt>

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
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @f(i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
%2 = tail call i32 @f(i32 1)
%3 = tail call i32 @f(i32 2)
%4 = tail call i32 @f(i32 3)
%5 = tail call i32 @f(i32 4)
%6 = tail call i32 @f(i32 5)
%7 = tail call i32 @f(i32 6)
%8 = tail call i32 @f(i32 7)
%9 = tail call i32 @f(i32 8)
%10 = tail call i32 @f(i32 9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int /*<<< orphan*/ assert(int);
scalar_t__ fcntl(int, int /*<<< orphan*/, ...);
void SetNonBlock(int fd) {
  int val = fcntl(fd, F_GETFL);
  val |= O_NONBLOCK;
  assert(fcntl(fd, F_SETFL, val) == 0);
}


x86 assembly (clang, -O0):
<SetNonBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetNonBlock>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
or     (%rcx),%eax
mov    0x2e95(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fcntl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @SetNonBlock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i64 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* @O_NONBLOCK
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = call i64 (i32, i32, ...) @fcntl(i32 %11, i32 %12, i32 %13)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @SetNonBlock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i64 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = trunc i64 %3 to i32
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = load i32, i32* @F_SETFL
%8 = tail call i64 (i32, i32, ...) @fcntl(i32 %0, i32 %7, i32 %6)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ error(char *);
void goodbye() {
  error("This was fatal, goodbye!");
  abort();
}


x86 assembly (clang, -O0):
<goodbye>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <error@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<goodbye>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"This was fatal, goodbye!\00"
define void @goodbye() {
%1 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"This was fatal, goodbye!\00"
define void @goodbye() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *addANode(int);
int /*<<< orphan*/ display(struct node *);
int /*<<< orphan*/ insert(struct node *, int);
int main() {
  struct node *p, *temp;
  p = addANode(3);
  insert(p, 5);
  insert(p, 2);
  insert(p, 3);
  insert(p, 7);
  display(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <addANode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1050 <insert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <insert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <insert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1050 <insert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1040 <addANode@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5,%esi
call   1050 <insert@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <insert@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <insert@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store i32 0, i32* %1
%4 = call %struct.node* @addANode(i32 3)
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call i32 @insert(%struct.node* %5, i32 5)
%7 = load %struct.node*, %struct.node** %2
%8 = call i32 @insert(%struct.node* %7, i32 2)
%9 = load %struct.node*, %struct.node** %2
%10 = call i32 @insert(%struct.node* %9, i32 3)
%11 = load %struct.node*, %struct.node** %2
%12 = call i32 @insert(%struct.node* %11, i32 7)
%13 = load %struct.node*, %struct.node** %2
%14 = call i32 @display(%struct.node* %13)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.node* @addANode(i32 3)
%2 = tail call i32 @insert(%struct.node* %1, i32 5)
%3 = tail call i32 @insert(%struct.node* %1, i32 2)
%4 = tail call i32 @insert(%struct.node* %1, i32 3)
%5 = tail call i32 @insert(%struct.node* %1, i32 7)
%6 = tail call i32 @display(%struct.node* %1)
ret i32 0
}
const char *Mutex_Name(void) { return "Mutex"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Mutex\00"
define i8* @Mutex_Name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int digitval(int ch) {
  if (ch >= '0' && ch <= '9') {
    return ch - '0';
  } else if (ch >= 'A' && ch <= 'Z') {
    return ch - 'A' + 10;
  } else if (ch >= 'a' && ch <= 'z') {
    return ch - 'a' + 10;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<digitval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <digitval+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <digitval+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <digitval+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <digitval+0x4e>
cmpl   $0x5a,-0x8(%rbp)
jg     114e <digitval+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <digitval+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <digitval+0x73>
cmpl   $0x7a,-0x8(%rbp)
jg     1173 <digitval+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <digitval+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitval>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <digitval+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x19,%eax
ja     1116 <digitval+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x1a,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @digitval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 90
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 122
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @digitval(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 26
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 26
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Type definitions */
struct t_gui_window {
  int dummy;
};
struct t_gui_bar_item {
  int dummy;
};

/* Variables and functions */
char *gui_bar_item_default_input_prompt(void *data, struct t_gui_bar_item *item,
                                        struct t_gui_window *window) {
  (void)data;
  (void)item;
  (void)window;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.t_gui_bar_item = type { i32 }
%struct.t_gui_window = type { i32 }
define i8* @gui_bar_item_default_input_prompt(i8* %0, %struct.t_gui_bar_item* %1, %struct.t_gui_window* %2) {
%4 = alloca i8*
%5 = alloca %struct.t_gui_bar_item*
%6 = alloca %struct.t_gui_window*
store i8* %0, i8** %4
store %struct.t_gui_bar_item* %1, %struct.t_gui_bar_item** %5
store %struct.t_gui_window* %2, %struct.t_gui_window** %6
%7 = load i8*, i8** %4
%8 = load %struct.t_gui_bar_item*, %struct.t_gui_bar_item** %5
%9 = load %struct.t_gui_window*, %struct.t_gui_window** %6
ret i8* null
}

LLVM IR (-O2):
%struct.t_gui_bar_item = type { i32 }
%struct.t_gui_window = type { i32 }
define noalias i8* @gui_bar_item_default_input_prompt(i8* nocapture readnone %0, %struct.t_gui_bar_item* nocapture readnone %1, %struct.t_gui_window* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ preempt_enable();
void put_cpu(void) { preempt_enable(); }


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

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

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

LLVM IR (-O2):
define void @put_cpu() {
%1 = tail call i32 (...) @preempt_enable()
ret void
}
void GL_ClearGL_Link(struct GL_Info *link) {}


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

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

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

LLVM IR (-O2):
%struct.GL_Info = type opaque
define void @GL_ClearGL_Link(%struct.GL_Info* nocapture %0) {
ret void
}
int array_shift(char c) { return c - 'A'; }


x86 assembly (clang, -O0):
<array_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_shift>:
lea    -0x41(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @array_shift(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
ret i32 %5
}

LLVM IR (-O2):
define i32 @array_shift(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_impl(int status) { exit(status); }


x86 assembly (clang, -O0):
<exit_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_impl>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit_impl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit_impl(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void PRCMCacheRetentionDisable(void) {
  (*((volatile unsigned long *)(0x40082000 + 0x00000224))) &= ~0x00000003;
}


x86 assembly (clang, -O0):
<PRCMCacheRetentionDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40082224,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffc,%rcx
mov    $0x40082224,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMCacheRetentionDisable>:
andq   $0xfffffffffffffffc,0x40082224
40 fc
ret

LLVM IR (-O0):
define void @PRCMCacheRetentionDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074274852 to i64*)
%2 = and i64 %1, -4
store volatile i64 %2, i64* inttoptr (i64 1074274852 to i64*)
ret void
}

LLVM IR (-O2):
define void @PRCMCacheRetentionDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074274852 to i64*)
%2 = and i64 %1, -4
store volatile i64 %2, i64* inttoptr (i64 1074274852 to i64*)
ret void
}
int ft_ls_valid_flag(char c) {
  if (c == 'l' || c == 'R' || c == 'a' || c == 'r' || c == 't')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_ls_valid_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x6c,%eax
je     114b <ft_ls_valid_flag+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x52,%eax
je     114b <ft_ls_valid_flag+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
je     114b <ft_ls_valid_flag+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x72,%eax
je     114b <ft_ls_valid_flag+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x74,%eax
jne    1157 <ft_ls_valid_flag+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <ft_ls_valid_flag+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ls_valid_flag>:
add    $0xae,%dil
cmp    $0x22,%dil
ja     1124 <ft_ls_valid_flag+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x504008001,%rdx
bt     %rcx,%rdx
jae    1124 <ft_ls_valid_flag+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ft_ls_valid_flag(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 108
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 82
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 97
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 114
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 116
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @ft_ls_valid_flag(i8 signext %0) {
switch i8 %0, label %2 [
i8 116, label %3
i8 114, label %3
i8 108, label %3
i8 97, label %3
i8 82, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_am(int hour) {
  if ((hour < 10 && hour >= 0) || (hour < 23 && hour > 12)) {
    printf(".00 A.M. AND 0%d.00 A.M.", hour);
  } else {
    printf(".00 A.M. AND %d.00 A.M.", hour);
  }
}


x86 assembly (clang, -O0):
<print_am>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    112f <print_am+0x1f>
cmpl   $0x0,-0x4(%rbp)
jge    1143 <print_am+0x33>
cmpl   $0x17,-0x4(%rbp)
jge    1157 <print_am+0x47>
cmpl   $0xc,-0x4(%rbp)
jle    1157 <print_am+0x47>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <print_am+0x56>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_am>:
mov    %edi,%esi
lea    -0xd(%rsi),%eax
cmp    $0xa,%eax
lea    0xee1(%rip),%rax
lea    0xef3(%rip),%rdi
cmovb  %rax,%rdi
cmp    $0xa,%esi
cmovb  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c".00 A.M. AND 0%d.00 A.M.\00"
@.str.1 = [24 x i8] c".00 A.M. AND %d.00 A.M.\00"
define void @print_am(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 23
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 12
br i1 %13, label %14, label %17
14: ; preds = %11, %5
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %20
17: ; preds = %11, %8
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %14
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c".00 A.M. AND 0%d.00 A.M.\00"
@.str.1 = [24 x i8] c".00 A.M. AND %d.00 A.M.\00"
define void @print_am(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = add i32 %0, -13
%4 = icmp ult i32 %3, 10
%5 = or i1 %2, %4
%6 = select i1 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dfs(char *, int /*<<< orphan*/, char *, int /*<<< orphan*/,
                       char **, int *);
char **malloc(int);
char **restoreIpAddresses(char *s, int *returnSize) {
  int count = 0;
  char **results = malloc(100 * sizeof(char *));
  char addr[16] = {'\0'};
  dfs(s, 0, addr, 0, results, &count);
  *returnSize = count;
  return results;
}


x86 assembly (clang, -O0):
<restoreIpAddresses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x320,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    -0x20(%rbp),%r8
xor    %ecx,%ecx
lea    -0x14(%rbp),%r9
mov    %ecx,%esi
call   1050 <dfs@plt>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restoreIpAddresses>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movl   $0x0,0xc(%rsp)
mov    $0x320,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r9
mov    %r15,%rdi
xor    %esi,%esi
xor    %ecx,%ecx
mov    %rax,%r8
call   1040 <dfs@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%r14)
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8** @restoreIpAddresses(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca [16 x i8]
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%8 = call i8** @malloc(i32 800)
store i8** %8, i8*** %6
%9 = bitcast [16 x i8]* %7 to i8*
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%12 = load i8**, i8*** %6
%13 = call i32 @dfs(i8* %10, i32 0, i8* %11, i32 0, i8** %12, i32* %5)
%14 = load i32, i32* %5
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i8**, i8*** %6
ret i8** %16
}

LLVM IR (-O2):
define i8** @restoreIpAddresses(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca [16 x i8]
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = tail call i8** @malloc(i32 800)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%8 = call i32 @dfs(i8* %0, i32 0, i8* %7, i32 0, i8** %6, i32* %3)
%9 = load i32, i32* %3
store i32 %9, i32* %1
ret i8** %6
}
int isspace(int c) { return c == ' ' || (c >= '\t' && c <= '\r'); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1135 <isspace+0x35>
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     112f <isspace+0x2f>
cmpl   $0xd,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *str_dup(char *str) {
  char *ret = (char *)malloc(sizeof(char) * (strlen(str) + 1));
  strcpy(ret, str);
  return ret;
}


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

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

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
void log_crash(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @log_crash(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mali_WrReg(int, int /*<<< orphan*/, int, int);
void Mali_write_ASn_register(int ASn_reg, int n, int value_to_write) {
  int ASn_reg_final = 0x2000 | 0x400 | ASn_reg | (n * 64);
  Mali_WrReg(0x20, 0, ASn_reg_final, value_to_write);
}


x86 assembly (clang, -O0):
<Mali_write_ASn_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     $0x2400,%eax
mov    -0x8(%rbp),%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Mali_WrReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_write_ASn_register>:
mov    %edx,%ecx
mov    %esi,%edx
shl    $0x6,%edx
or     %edi,%edx
or     $0x2400,%edx
mov    $0x20,%edi
xor    %esi,%esi
jmp    1030 <Mali_WrReg@plt>

LLVM IR (-O0):
define void @Mali_write_ASn_register(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 = or i32 9216, %8
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 64
%12 = or i32 %9, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = call i32 @Mali_WrReg(i32 32, i32 0, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @Mali_write_ASn_register(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 6
%5 = or i32 %4, %0
%6 = or i32 %5, 9216
%7 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 %6, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itooa(int, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  char str[100];
  printf("Enter the number to be converted : \n");
  scanf("%d", &n);
  itooa(n, str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1040 <itooa@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rsi
call   1040 <itooa@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [36 x i8] c"Enter the number to be converted : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @itooa(i32 %7, i8* %4)
ret i32 0
}
int main(int arg, char *argv[]) {
  float a = 9;
  float b = 100;
  float result = 0.0;
  __asm__ volatile("movss %0, %%xmm0\n"
                   "movss %1, %%xmm1\n"
                   "divss %%xmm0, %%xmm1\n"
                   "movss %%xmm1, %2\n"
                   :
                   : "m"(a), "m"(b), "m"(result)
                   :);
  printf("result = %f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x41100000,0x14(%rsp)
41
movl   $0x42c80000,0x10(%rsp)
42
movl   $0x0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"result = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 9.000000e+00, float* %6
store float 1.000000e+02, float* %7
store float 0.000000e+00, float* %8
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"result = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %3 to i8*
store float 9.000000e+00, float* %3
%7 = bitcast float* %4 to i8*
store float 1.000000e+02, float* %4
%8 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265aud_set_pic_type(uint8_t *p_h265aud, uint8_t i_type) {
  p_h265aud[5] = i_type << 5;
}


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

x86 assembly (clang, -O2):
<h265aud_set_pic_type>:
shl    $0x5,%esi
mov    %esi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @h265aud_set_pic_type(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 5
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265aud_set_pic_type(i32* nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 5
%4 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ finitef(float);
float scalbnf(float, int);
float ldexpf(float value, int exp) {
  if (!finitef(value) || value == (float)0.0)
    return value;
  value = scalbnf(value, exp);
  return value;
}


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movaps 0xee4(%rip),%xmm1
pand   %xmm1,%xmm0
movss  0xec8(%rip),%xmm1
ucomiss %xmm1,%xmm0
je     1158 <ldexpf+0x48>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1167 <ldexpf+0x57>
jp     1167 <ldexpf+0x57>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1183 <ldexpf+0x73>
movss  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <scalbnf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    111a <ldexpf+0xa>
jnp    1132 <ldexpf+0x22>
movaps 0xedf(%rip),%xmm1
andps  %xmm0,%xmm1
ucomiss 0xee5(%rip),%xmm1
je     1132 <ldexpf+0x22>
jmp    1030 <scalbnf@plt>
ret

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
%6 = load float, float* %4
%7 = call float @llvm.fabs.f32(float %6)
%8 = fcmp one float %7, 0x7FF0000000000000
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load float, float* %4
%11 = fcmp oeq float %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9, %2
%13 = load float, float* %4
store float %13, float* %3
br label %19
14: ; preds = %9
%15 = load float, float* %4
%16 = load i32, i32* %5
%17 = call float @scalbnf(float %15, i32 %16)
store float %17, float* %4
%18 = load float, float* %4
store float %18, float* %3
br label %19
19: ; preds = %14, %12
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call float @llvm.fabs.f32(float %0)
%4 = fcmp ueq float %3, 0x7FF0000000000000
%5 = fcmp oeq float %0, 0.000000e+00
%6 = or i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call float @scalbnf(float %0, i32 %1)
br label %9
9: ; preds = %2, %7
%10 = phi float [ %8, %7 ], [ %0, %2 ]
ret float %10
}
void __DELETE_org_xmlvm_runtime_FinalizerNotifier_1(void *me,
                                                    void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_org_xmlvm_runtime_FinalizerNotifier_1(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct rmDsummary {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cctools_list_first_item(struct list *);
struct rmDsummary *cctools_list_next_item(struct list *);
int /*<<< orphan*/ normalize_summary(struct rmDsummary *);
void normalize_summaries(struct list *summaries) {
  struct rmDsummary *s;
  cctools_list_first_item(summaries);
  while ((s = cctools_list_next_item(summaries)))
    normalize_summary(s);
}


x86 assembly (clang, -O0):
<normalize_summaries>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <cctools_list_first_item@plt>
mov    -0x8(%rbp),%rdi
call   1030 <cctools_list_next_item@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116a <normalize_summaries+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <normalize_summary@plt>
jmp    1145 <normalize_summaries+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_summaries>:
push   %rbx
mov    %rdi,%rbx
call   1050 <cctools_list_first_item@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <cctools_list_next_item@plt>
test   %rax,%rax
je     1157 <normalize_summaries+0x27>
mov    %rax,%rdi
call   1040 <normalize_summary@plt>
jmp    1140 <normalize_summaries+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.rmDsummary = type { i32 }
define void @normalize_summaries(%struct.list* %0) {
%2 = alloca %struct.list*
%3 = alloca %struct.rmDsummary*
store %struct.list* %0, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call i32 @cctools_list_first_item(%struct.list* %4)
br label %6
6: ; preds = %10, %1
%7 = load %struct.list*, %struct.list** %2
%8 = call %struct.rmDsummary* @cctools_list_next_item(%struct.list* %7)
store %struct.rmDsummary* %8, %struct.rmDsummary** %3
%9 = icmp ne %struct.rmDsummary* %8, null
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load %struct.rmDsummary*, %struct.rmDsummary** %3
%12 = call i32 @normalize_summary(%struct.rmDsummary* %11)
br label %6
13: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.rmDsummary = type { i32 }
define void @normalize_summaries(%struct.list* %0) {
%2 = tail call i32 @cctools_list_first_item(%struct.list* %0)
%3 = tail call %struct.rmDsummary* @cctools_list_next_item(%struct.list* %0)
%4 = icmp eq %struct.rmDsummary* %3, null
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi %struct.rmDsummary* [ %8, %5 ], [ %3, %1 ]
%7 = tail call i32 @normalize_summary(%struct.rmDsummary* %6)
%8 = tail call %struct.rmDsummary* @cctools_list_next_item(%struct.list* %0)
%9 = icmp eq %struct.rmDsummary* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int mystrcmp(const void *__1, const void *__2) {
  return strcmp((const char *)__1, (const char *)__2);
}


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

x86 assembly (clang, -O2):
<mystrcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @mystrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int main() { bar(12 + 12); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @bar(i32 24)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 24)
ret i32 0
}
/* Variables and functions */
float hgetascender();
float hgetas_() { return (hgetascender()); }


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

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

LLVM IR (-O0):
define float @hgetas_() {
%1 = call float (...) @hgetascender()
ret float %1
}

LLVM IR (-O2):
define float @hgetas_() {
%1 = tail call float (...) @hgetascender()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double, int);
int main(void) {
  double d = 0.0;
  int i;
  for (i = 0; i < 30; i++) {
    printf("i = %d,  d = %f,  (int)d = %d\n", i, d, (int)d);
    d += 0.11;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    1171 <main+0x61>
mov    -0x14(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
cvttsd2si -0x10(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea7(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xorpd  %xmm0,%xmm0
xor    %ebx,%ebx
lea    0xee7(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
cvttsd2si %xmm0,%edx
mov    %r14,%rdi
mov    %ebx,%esi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xeab(%rip),%xmm0
add    $0x1,%ebx
cmp    $0x1e,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"i = %d, d = %f, (int)d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 30
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load double, double* %2
%10 = load double, double* %2
%11 = fptosi double %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %8, double %9, i32 %11)
%13 = load double, double* %2
%14 = fadd double %13, 1.100000e-01
store double %14, double* %2
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"i = %d, d = %f, (int)d = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi double [ 0.000000e+00, %0 ], [ %6, %1 ]
%4 = fptosi double %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2, double %3, i32 %4)
%6 = fadd double %3, 1.100000e-01
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 30
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
double exact0(double x, double y) {
  return (x * x - x * x * x * x) * (y * y * y * y - y * y);
}


x86 assembly (clang, -O0):
<exact0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact0>:
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @exact0(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = load double, double* %3
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %5, double %6, double %14)
%16 = load double, double* %4
%17 = load double, double* %4
%18 = fmul double %16, %17
%19 = load double, double* %4
%20 = fmul double %18, %19
%21 = load double, double* %4
%22 = load double, double* %4
%23 = load double, double* %4
%24 = fmul double %22, %23
%25 = fneg double %24
%26 = call double @llvm.fmuladd.f64(double %20, double %21, double %25)
%27 = fmul double %15, %26
ret double %27
}

LLVM IR (-O2):
define double @exact0(double %0, double %1) {
%3 = fneg double %0
%4 = fmul double %3, %0
%5 = fmul double %4, %0
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %6)
%8 = fmul double %1, %1
%9 = fmul double %8, %1
%10 = fneg double %8
%11 = tail call double @llvm.fmuladd.f64(double %9, double %1, double %10)
%12 = fmul double %7, %11
ret double %12
}
__attribute__((noipa)) void *return_alloca_plus_var(int n, int i) {
  char *p = (char *)__builtin_alloca(n);
  p += i;
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_alloca_plus_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <sink@plt>
mov    -0x10(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_alloca_plus_var>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
movslq %edi,%rax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
movslq %esi,%rbx
add    %rcx,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sink@plt>
mov    %rbx,%rax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @return_alloca_plus_var(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = alloca i8, i64 %7
store i8* %8, i8** %5
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @return_alloca_plus_var(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = alloca i8, i64 %3
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %6)
ret i8* %6
}