xunge/DecIR huggingface dataset:
int ch_vector_cmp_voidp(void **lhs, void **rhs) {
  return (*lhs == *rhs ? 0 : *lhs < *rhs ? -1 : 1);
}


x86 assembly (clang, -O0):
<ch_vector_cmp_voidp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jne    112a <ch_vector_cmp_voidp+0x2a>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <ch_vector_cmp_voidp+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_vector_cmp_voidp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setae  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ch_vector_cmp_voidp(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = icmp eq i8* %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = icmp ult i8* %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 1
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ 0, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @ch_vector_cmp_voidp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = icmp eq i8* %3, %4
%6 = icmp ult i8* %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
void restore_state(vec, a, b, c, d, e) int vec[5];
int *a, *b, *c, *d, *e;
{
  *a = vec[0];
  *b = vec[1];
  *c = vec[2];
  *d = vec[3];
  *e = vec[4];
}


x86 assembly (clang, -O0):
<restore_state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_state>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    0x4(%rdi),%eax
mov    %eax,(%rdx)
mov    0x8(%rdi),%eax
mov    %eax,(%rcx)
mov    0xc(%rdi),%eax
mov    %eax,(%r8)
mov    0x10(%rdi),%eax
mov    %eax,(%r9)
ret

LLVM IR (-O0):
define void @restore_state(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = load i32*, i32** %8
store i32 %15, i32* %16
%17 = load i32*, i32** %7
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = load i32*, i32** %9
store i32 %19, i32* %20
%21 = load i32*, i32** %7
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = load i32*, i32** %10
store i32 %23, i32* %24
%25 = load i32*, i32** %7
%26 = getelementptr inbounds i32, i32* %25, i64 3
%27 = load i32, i32* %26
%28 = load i32*, i32** %11
store i32 %27, i32* %28
%29 = load i32*, i32** %7
%30 = getelementptr inbounds i32, i32* %29, i64 4
%31 = load i32, i32* %30
%32 = load i32*, i32** %12
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
define void @restore_state(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = load i32, i32* %0
store i32 %7, i32* %1
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
store i32 %9, i32* %2
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
store i32 %11, i32* %3
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
store i32 %13, i32* %4
%14 = getelementptr inbounds i32, i32* %0, i64 4
%15 = load i32, i32* %14
store i32 %15, i32* %5
ret void
}
void test_34_2(int *mem) { __atomic_xor_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_34_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_34_2+0x4b>
jmp    1122 <test_34_2+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_34_2>:
lock xorl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_34_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw xor i32* %5, i32 %6 acq_rel
%8 = xor i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_34_2(i32* nocapture %0) {
%2 = atomicrmw xor i32* %0, i32 1 acq_rel
ret void
}
double MAX(double a, double b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <MAX+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <MAX+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @MAX(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* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @MAX(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-AadfIis] [name-of-host]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s [-AadfIis] [name-of-host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s [-AadfIis] [name-of-host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void showTime(time_t startTime, time_t playTime, int Xtxt, int Ytxt) {
  mvprintw(Xtxt, Ytxt, "time: %.0lf sec", difftime(playTime, startTime));
  refresh();
}


x86 assembly (clang, -O0):
<showTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <difftime@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    %eax,%ecx
lea    0xe96(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showTime>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1030 <difftime@plt>
lea    0xeb7(%rip),%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%ecx
call   1050 <mvprintw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"time: %.0lf sec\00"
define void @showTime(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = call i32 @difftime(i32 %11, i32 %12)
%14 = call i32 @mvprintw(i32 %9, i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"time: %.0lf sec\00"
define void @showTime(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @difftime(i32 %1, i32 %0)
%6 = tail call i32 @mvprintw(i32 %2, i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @refresh()
ret void
}
/* Type definitions */
struct BufWin {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bufwin_close_buffer(struct BufWin *, int);
int bufwin_get_curbuf_index(struct BufWin *);
void bufwin_close_current_buffer(struct BufWin *bufwin) {
  register int index = bufwin_get_curbuf_index(bufwin);
  if (index > -1)
    bufwin_close_buffer(bufwin, index);
}


x86 assembly (clang, -O0):
<bufwin_close_current_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bufwin_get_curbuf_index@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jle    114e <bufwin_close_current_buffer+0x2e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <bufwin_close_buffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufwin_close_current_buffer>:
push   %rbx
mov    %rdi,%rbx
call   1030 <bufwin_get_curbuf_index@plt>
test   %eax,%eax
js     1138 <bufwin_close_current_buffer+0x18>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <bufwin_close_buffer@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.BufWin = type { i32 }
define void @bufwin_close_current_buffer(%struct.BufWin* %0) {
%2 = alloca %struct.BufWin*
%3 = alloca i32
store %struct.BufWin* %0, %struct.BufWin** %2
%4 = load %struct.BufWin*, %struct.BufWin** %2
%5 = call i32 @bufwin_get_curbuf_index(%struct.BufWin* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load %struct.BufWin*, %struct.BufWin** %2
%10 = load i32, i32* %3
%11 = call i32 @bufwin_close_buffer(%struct.BufWin* %9, i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.BufWin = type { i32 }
define void @bufwin_close_current_buffer(%struct.BufWin* %0) {
%2 = tail call i32 @bufwin_get_curbuf_index(%struct.BufWin* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @bufwin_close_buffer(%struct.BufWin* %0, i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
int jump_inside_loop_constant_linear(int p, int k) {
  int i = 0;
  if (p > 0) {
    goto Loop;
  } else {
    return p;
  }
  while (i < k) {
  Loop:
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<jump_inside_loop_constant_linear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1120 <jump_inside_loop_constant_linear+0x20>
jmp    113c <jump_inside_loop_constant_linear+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <jump_inside_loop_constant_linear+0x51>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114a <jump_inside_loop_constant_linear+0x4a>
jmp    113c <jump_inside_loop_constant_linear+0x3c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <jump_inside_loop_constant_linear+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_inside_loop_constant_linear>:
test   %edi,%edi
mov    $0x1,%eax
cmovle %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @jump_inside_loop_constant_linear(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %0, i32 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M85_f(char *s) {
  debug("M85_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M85_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M85_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M85_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M85_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M85_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M85_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int variable_expected(int stuff) {
  int res = 0;
  switch (__builtin_expect(stuff, stuff)) {
  case 0:
    res = 1;
    break;
  default:
    break;
  }
  return res;
}


x86 assembly (clang, -O0):
<variable_expected>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    112a <variable_expected+0x2a>
jmp    111e <variable_expected+0x1e>
movl   $0x1,-0x8(%rbp)
jmp    112f <variable_expected+0x2f>
jmp    112f <variable_expected+0x2f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<variable_expected>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @variable_expected(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
switch i64 %5, label %9 [
i64 0, label %8
]
8: ; preds = %1
store i32 1, i32* %3
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @variable_expected(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CSync();
int /*<<< orphan*/ PSync();
void Sync(void) {
  PSync();
  CSync();
}


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

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

LLVM IR (-O0):
define void @Sync() {
%1 = call i32 (...) @PSync()
%2 = call i32 (...) @CSync()
ret void
}

LLVM IR (-O2):
define void @Sync() {
%1 = tail call i32 (...) @PSync()
%2 = tail call i32 (...) @CSync()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
size_t list_meter_int32_t(const void *el) {
  if (el) {
  }
  return sizeof(int32_t);
}


x86 assembly (clang, -O0):
<list_meter_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <list_meter_int32_t+0x18>
jmp    1118 <list_meter_int32_t+0x18>
mov    $0x4,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @list_meter_int32_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i64 4
}

LLVM IR (-O2):
define i64 @list_meter_int32_t(i8* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
scalar_t__ exp2(double);
double rand();
int main(int argc, char **argv) {
  double x = rand();
  return (int)exp2(x);
}


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)
mov    $0x0,%al
call   1040 <rand@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
pop    %rax
jmp    1030 <exp2@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call double (...) @rand()
store double %7, double* %6
%8 = load double, double* %6
%9 = call i64 @exp2(double %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double (...) @rand()
%4 = tail call i64 @exp2(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}
char *lib_strrchr(const char *dest, int c) {
  char *ret = 0;
  while (*dest) {
    if (*dest == c)
      ret = (char *)dest;
    dest++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<lib_strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <lib_strrchr+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1138 <lib_strrchr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <lib_strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_strrchr>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <lib_strrchr+0x25>
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <lib_strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @lib_strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ null, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %8, i8* %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %16
}
int XT_FROM_CT(int ct, int up) { return ct; }


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

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

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

LLVM IR (-O2):
define i32 @XT_FROM_CT(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thread2Print(void *params __attribute__((unused))) {
  printf("I am thread 2\n");
  return NULL;
}


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

x86 assembly (clang, -O2):
<thread2Print>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"I am thread 2\0A\00"
define i8* @thread2Print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [14 x i8] c"I am thread 2\00"
define noalias i8* @thread2Print(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void outside_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @outside_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int a_twist_f_on_eloc(eloc)
int eloc;
{
  int temp_arr[12];
  a_eloc_unpack(eloc, temp_arr);
  four_cycle(temp_arr, 9, 4, 8, 0);
  return a_eloc_pack(temp_arr);
}


x86 assembly (clang, -O0):
<a_twist_f_on_eloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <a_eloc_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1030 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <a_eloc_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_twist_f_on_eloc>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <a_eloc_unpack@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <a_eloc_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a_twist_f_on_eloc(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eloc_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 9, i32 4, i32 8, i32 0)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eloc_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @a_twist_f_on_eloc(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eloc_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 9, i32 4, i32 8, i32 0)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eloc_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int sin(double);
short smoothHiliteGradient(const short currentXValue, const short maxXValue) {
  return (short)(100 * sin(3.14159265 * currentXValue / maxXValue));
}


x86 assembly (clang, -O0):
<smoothHiliteGradient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xeca(%rip),%xmm0
mulsd  %xmm1,%xmm0
movswl -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
imul   $0x64,%eax,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smoothHiliteGradient>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
imul   $0x64,%eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @smoothHiliteGradient(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = sitofp i32 %6 to double
%8 = fmul double 0x400921FB53C8D4F1, %7
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
%11 = sitofp i32 %10 to double
%12 = fdiv double %8, %11
%13 = call i32 @sin(double %12)
%14 = mul nsw i32 100, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @smoothHiliteGradient(i16 signext %0, i16 signext %1) {
%3 = sitofp i16 %0 to double
%4 = fmul double %3, 0x400921FB53C8D4F1
%5 = sitofp i16 %1 to double
%6 = fdiv double %4, %5
%7 = tail call i32 @sin(double %6)
%8 = trunc i32 %7 to i16
%9 = mul i16 %8, 100
ret i16 %9
}
/* Type definitions */
struct wl_seat {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_seat, user_data);
}


x86 assembly (clang, -O0):
<wl_seat_set_user_data>:
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 <wl_proxy_set_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_seat_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_seat_set_user_data(%struct.wl_seat* %0, i8* %1) {
%3 = alloca %struct.wl_seat*
%4 = alloca i8*
store %struct.wl_seat* %0, %struct.wl_seat** %3
store i8* %1, i8** %4
%5 = load %struct.wl_seat*, %struct.wl_seat** %3
%6 = bitcast %struct.wl_seat* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_seat_set_user_data(%struct.wl_seat* %0, i8* %1) {
%3 = bitcast %struct.wl_seat* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtp2435q_set_precision(uint8_t *header, uint8_t precision) {
  header[1] = precision;
}


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

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

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

LLVM IR (-O2):
define void @rtp2435q_set_precision(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ signbit(double);
int isnegzero(double x) { return (x * -0.0) == 0.0 && signbit(x); }


x86 assembly (clang, -O0):
<isnegzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    1156 <isnegzero+0x46>
jp     1156 <isnegzero+0x46>
movsd  -0x8(%rbp),%xmm0
call   1030 <signbit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnegzero>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    113b <isnegzero+0x2b>
jp     113b <isnegzero+0x2b>
call   1030 <signbit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isnegzero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, -0.000000e+00
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = call i64 @signbit(double %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isnegzero(double %0) {
%2 = fmul double %0, -0.000000e+00
%3 = fcmp oeq double %2, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @signbit(double %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
short const *GetDropFileW284();
const short int *getdropfilew() { return GetDropFileW284(); }


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

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

LLVM IR (-O0):
define i16* @getdropfilew() {
%1 = call i16* (...) @GetDropFileW284()
ret i16* %1
}

LLVM IR (-O2):
define i16* @getdropfilew() {
%1 = tail call i16* (...) @GetDropFileW284()
ret i16* %1
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, int);
int main() {
  test("default settings", 0);
  test("denormals are zero", 0x0040);
  test("flush to zero", 0x8000);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <test@plt>
lea    0xeeb(%rip),%rdi
mov    $0x40,%esi
call   1030 <test@plt>
lea    0xeed(%rip),%rdi
mov    $0x8000,%esi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"default settings\00"
@.str.1 = [19 x i8] c"denormals are zero\00"
@.str.2 = [14 x i8] c"flush to zero\00"
define i32 @main() {
%1 = call i32 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @test(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 64)
%3 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 32768)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"default settings\00"
@.str.1 = [19 x i8] c"denormals are zero\00"
@.str.2 = [14 x i8] c"flush to zero\00"
define i32 @main() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @test(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 64)
%3 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 32768)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vi2();
int /*<<< orphan*/ take_struct_vi2(int /*<<< orphan*/);
void test_struct_vi2() { take_struct_vi2(return_struct_vi2()); }


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

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

LLVM IR (-O0):
define void @test_struct_vi2() {
%1 = call i32 (...) @return_struct_vi2()
%2 = call i32 @take_struct_vi2(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vi2() {
%1 = tail call i32 (...) @return_struct_vi2()
%2 = tail call i32 @take_struct_vi2(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_REQINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_REQINFO_it;
int i2d_OCSP_REQINFO(OCSP_REQINFO *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &OCSP_REQINFO_it);
}


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

x86 assembly (clang, -O2):
<i2d_OCSP_REQINFO>:
mov    0x2ed9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@OCSP_REQINFO_it = global i32 0
define i32 @i2d_OCSP_REQINFO(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 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @OCSP_REQINFO_it)
ret i32 %7
}

LLVM IR (-O2):
@OCSP_REQINFO_it = global i32 0
define i32 @i2d_OCSP_REQINFO(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @OCSP_REQINFO_it)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_X509_TRUSTED;
scalar_t__ i2d_X509_AUX;
int PEM_write_bio_X509_AUX(BIO *bp, X509 *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_AUX,
                            PEM_STRING_X509_TRUSTED, bp, x, NULL, NULL, 0, NULL,
                            NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_X509_AUX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_X509_AUX>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_X509_AUX = global i64 0
@PEM_STRING_X509_TRUSTED = global i32 0
define i32 @PEM_write_bio_X509_AUX(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_X509_AUX
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509_TRUSTED
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_X509_AUX = global i64 0
@PEM_STRING_X509_TRUSTED = global i32 0
define i32 @PEM_write_bio_X509_AUX(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_X509_AUX
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_X509_TRUSTED
%6 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ascii_to_ebcdic_c(int /*<<< orphan*/);
char *ascii_to_ebcdic(char *ascii, char *ebcdic) {
  char *retval = ebcdic;
  do {
    *ebcdic++ = ascii_to_ebcdic_c(*ascii++);
  } while (*ascii);
  return retval;
}


x86 assembly (clang, -O0):
<ascii_to_ebcdic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ascii_to_ebcdic_c@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1128 <ascii_to_ebcdic+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_to_ebcdic>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%al
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <ascii_to_ebcdic_c@plt>
mov    %al,(%r14,%rbx,1)
movzbl 0x1(%r15,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ascii_to_ebcdic+0x10>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ascii_to_ebcdic(i8* nocapture %0, i8* returned writeonly %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %3, %2 ], [ %13, %4 ]
%6 = phi i8* [ %1, %2 ], [ %12, %4 ]
%7 = phi i8* [ %0, %2 ], [ %8, %4 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i32 @ascii_to_ebcdic_c(i32 %9)
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %11, i8* %6
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
ret i8* %1
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  int /*<<< orphan*/ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void md4_sem_lock(int semid, int semnum) {
  struct sembuf sops;
  sops.sem_num = semnum;
  sops.sem_op = -1;
  sops.sem_flg = SEM_UNDO;
  semop(semid, &sops, 1);
}


x86 assembly (clang, -O0):
<md4_sem_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md4_sem_lock>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @md4_sem_lock(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 -1, i32* %8
%9 = load i32, i32* @SEM_UNDO
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = call i32 @semop(i32 %11, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @md4_sem_lock(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 -1, i32* %6
%7 = load i32, i32* @SEM_UNDO
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i32 %7, i32* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
void handle_HUP(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_HUP(i32 %0) {
ret void
}
/* Variables and functions */
int get_value(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int epilogue(char *str) {
  printf("\nYou are about to enter the %s...\n", str);
  printf("If you want to continue press [0], skip the stage press [1]\n");
  printf("Use your keyboard.\n");
  return get_value("%u", 0, 2);
}


x86 assembly (clang, -O0):
<epilogue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <get_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epilogue>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
xor    %esi,%esi
mov    $0x2,%edx
pop    %rax
jmp    1050 <get_value@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"\0AYou are about to enter the %s...\0A\00"
@.str.1 = [61 x i8] c"If you want to continue press [0], skip the stage press [1]\0A\00"
@.str.2 = [20 x i8] c"Use your keyboard.\0A\00"
@.str.3 = [3 x i8] c"%u\00"
define i32 @epilogue(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @get_value(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 2)
ret i32 %7
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0AYou are about to enter the %s...\0A\00"
@.str.3 = [3 x i8] c"%u\00"
@str = [60 x i8] c"If you want to continue press [0], skip the stage press [1]\00"
@str.4 = [19 x i8] c"Use your keyboard.\00"
define i32 @epilogue(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @get_value(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 2)
ret i32 %5
}
void RTLinuxSysFsExistsV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLinuxSysFsExistsV() {
ret void
}
int emac1_amacid_set(unsigned int dev_id, union emac1_amacid_u *value) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%union.emac1_amacid_u = type opaque
define i32 @emac1_amacid_set(i32 %0, %union.emac1_amacid_u* nocapture readnone %1) {
ret i32 1
}