xunge/DecIR huggingface dataset:
void rule_dgp_act_print(const struct XCSF *xcsf, const struct Cl *c) {
  (void)xcsf;
  (void)c;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_act_print(%struct.XCSF* %0, %struct.Cl* %1) {
%3 = alloca %struct.XCSF*
%4 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %3
store %struct.Cl* %1, %struct.Cl** %4
%5 = load %struct.XCSF*, %struct.XCSF** %3
%6 = load %struct.Cl*, %struct.Cl** %4
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_act_print(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1) {
ret void
}
int ZNK1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ZNK1() {
ret i32 0
}
double ho_recognize_font_1_two(const double *array_in) {
  double return_value = 0.0;
  return return_value;
}


x86 assembly (clang, -O0):
<ho_recognize_font_1_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_recognize_font_1_two>:
xorps  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @ho_recognize_font_1_two(double* nocapture readnone %0) {
ret double 0.000000e+00
}
void pdc_setbit_l2r(char *bitarr, int bit) {
  bitarr[bit / 8] |= (char)(0x80 >> (bit % 8));
}


x86 assembly (clang, -O0):
<pdc_setbit_l2r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x80,%eax
sar    %cl,%eax
movsbl %al,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdc_setbit_l2r>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x80,%eax
shr    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @pdc_setbit_l2r(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 8
%7 = ashr i32 128, %6
%8 = trunc i32 %7 to i8
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = or i32 %16, %9
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
ret void
}

LLVM IR (-O2):
define void @pdc_setbit_l2r(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = lshr i32 128, %3
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearError();
void *dlsym(void *, char const *);
int logError();
int findSharedSymbol(void *object, const char *symbol, void *pointerAddress) {
  void **address = pointerAddress;
  clearError();
  *address = dlsym(object, symbol);
  return logError();
}


x86 assembly (clang, -O0):
<findSharedSymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <clearError@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <dlsym@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1040 <logError@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findSharedSymbol>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clearError@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <dlsym@plt>
mov    %rax,(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <logError@plt>

LLVM IR (-O0):
define i32 @findSharedSymbol(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %7
%10 = call i32 (...) @clearError()
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i8* @dlsym(i8* %11, i8* %12)
%14 = load i8**, i8*** %7
store i8* %13, i8** %14
%15 = call i32 (...) @logError()
ret i32 %15
}

LLVM IR (-O2):
define i32 @findSharedSymbol(i8* %0, i8* %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i8**
%5 = tail call i32 (...) @clearError()
%6 = tail call i8* @dlsym(i8* %0, i8* %1)
store i8* %6, i8** %4
%7 = tail call i32 (...) @logError()
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doTick() { printf("Tick\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"Tick\00"
define void @doTick() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int close(int);
int CloseDriverHandle(int hObject) { return (close(hObject)); }


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

x86 assembly (clang, -O2):
<CloseDriverHandle>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @CloseDriverHandle(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int rand();
int throw_die(int sides) { return (1 + rand() % sides); }


x86 assembly (clang, -O0):
<throw_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<throw_die>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @throw_die(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int yyparse();
void checkparse() {
  int res = yyparse();
  if (res == 0)
    puts("Parse success.");
  else
    puts("ERROR: Parse failed.");
}


x86 assembly (clang, -O0):
<checkparse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <yyparse@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114d <checkparse+0x2d>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
jmp    1159 <checkparse+0x39>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkparse>:
push   %rax
xor    %eax,%eax
call   1040 <yyparse@plt>
test   %eax,%eax
lea    0xecf(%rip),%rax
lea    0xed7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Parse success.\00"
@.str.1 = [21 x i8] c"ERROR: Parse failed.\00"
define void @checkparse() {
%1 = alloca i32
%2 = call i32 (...) @yyparse()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Parse success.\00"
@.str.1 = [21 x i8] c"ERROR: Parse failed.\00"
define void @checkparse() {
%1 = tail call i32 (...) @yyparse()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
void lcdl_clear(void) {}


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

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

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

LLVM IR (-O2):
define void @lcdl_clear() {
ret void
}
void TransposeUVWx8_NEON() {}


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

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

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

LLVM IR (-O2):
define void @TransposeUVWx8_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void date(char *result, int length) {
  time_t t = time(NULL);
  struct tm tm = *localtime(&t);
  strftime(result, length, "%D", &tm);
}


x86 assembly (clang, -O0):
<date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rsp)
lea    0xea7(%rip),%rdx
mov    %rsp,%rcx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%D\00"
define void @date(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tm
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = call %struct.tm* @localtime(i32* %5)
%9 = bitcast %struct.tm* %6 to i8*
%10 = bitcast %struct.tm* %8 to i8*
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @strftime(i8* %11, i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%D\00"
define void @date(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.tm
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %3
%7 = bitcast %struct.tm* %4 to i8*
%8 = call %struct.tm* @localtime(i32* %3)
%9 = getelementptr %struct.tm, %struct.tm* %8, i64 0, i32 0
%10 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%11 = load i32, i32* %9
store i32 %11, i32* %10
%12 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
scalar_t__ getxattr(char const *, char *, char *, size_t);
ssize_t xgetxattr(const char *path, char *list, char *value, size_t size) {
  ssize_t ret = getxattr(path, list, value, size);
  if (ret < 0)
    err(1, "getxattr() failed");
  return ret;
}


x86 assembly (clang, -O0):
<xgetxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <getxattr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jge    116d <xgetxattr+0x4d>
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
call   1030 <err@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgetxattr>:
push   %rbx
call   1040 <getxattr@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    113f <xgetxattr+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"getxattr() failed\00"
define i64 @xgetxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i64 @getxattr(i8* %0, i8* %1, i8* %2, i64 %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i64 %5
}
int not_proc_info(int i) {}


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

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

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

LLVM IR (-O2):
define i32 @not_proc_info(i32 %0) {
ret i32 undef
}
/* Variables and functions */
double sqrt(scalar_t__);
scalar_t__ square(double);
double radius_from_totallength(double radius, double radius_cap,
                               double length) {
  const double h = -sqrt(square(radius_cap) - square(radius));
  const double half_length = 0.5 * length;
  return half_length + radius_cap - h;
}


x86 assembly (clang, -O0):
<radius_from_totallength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
mov    %rax,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
mov    -0x30(%rbp),%rdi
sub    %rax,%rdi
call   1040 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe81(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_from_totallength>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
call   1030 <square@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <square@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
call   1040 <sqrt@plt>
movsd  0x18(%rsp),%xmm1
mulsd  0xe9a(%rip),%xmm1
addsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @radius_from_totallength(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %5
%10 = call i64 @square(double %9)
%11 = load double, double* %4
%12 = call i64 @square(double %11)
%13 = sub nsw i64 %10, %12
%14 = call double @sqrt(i64 %13)
%15 = fneg double %14
store double %15, double* %7
%16 = load double, double* %6
%17 = fmul double 5.000000e-01, %16
store double %17, double* %8
%18 = load double, double* %8
%19 = load double, double* %5
%20 = fadd double %18, %19
%21 = load double, double* %7
%22 = fsub double %20, %21
ret double %22
}

LLVM IR (-O2):
define double @radius_from_totallength(double %0, double %1, double %2) {
%4 = tail call i64 @square(double %1)
%5 = tail call i64 @square(double %0)
%6 = sub nsw i64 %4, %5
%7 = tail call double @sqrt(i64 %6)
%8 = fmul double %2, 5.000000e-01
%9 = fadd double %8, %1
%10 = fadd double %9, %7
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tableDestroy(void **table, unsigned int *size) {
  if (!table || !size)
    return;
  if (*table) {
    free(*table);
    *table = 0;
  }
  *size = 0;
}


x86 assembly (clang, -O0):
<tableDestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <tableDestroy+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <tableDestroy+0x2b>
jmp    116a <tableDestroy+0x5a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1160 <tableDestroy+0x50>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableDestroy>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     113f <tableDestroy+0x2f>
mov    %rsi,%r14
test   %rsi,%rsi
je     113f <tableDestroy+0x2f>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1138 <tableDestroy+0x28>
call   1030 <free@plt>
movq   $0x0,(%rbx)
movl   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @tableDestroy(i8** %0, i32* writeonly %1) {
%3 = icmp ne i8** %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = load i8*, i8** %0
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @free(i8* %7)
store i8* null, i8** %0
br label %11
11: ; preds = %9, %6
store i32 0, i32* %1
br label %12
12: ; preds = %2, %11
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void stimer_gettime(struct timeval *tv) { gettimeofday(tv, NULL); }


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

x86 assembly (clang, -O2):
<stimer_gettime>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @stimer_gettime(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
void foo599() {}


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

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

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

LLVM IR (-O2):
define void @foo599() {
ret void
}
void buildat_mem_libc_disable() {}


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

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

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

LLVM IR (-O2):
define void @buildat_mem_libc_disable() {
ret void
}
void copy1(char *s1, char *s2) {
  int i;
  for (i = 0; (s1[i] = s2[i]) != '\0'; i++) {
  }
}


x86 assembly (clang, -O0):
<copy1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <copy1+0x48>
jmp    113a <copy1+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy1+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy1+0x10>
ret

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

LLVM IR (-O2):
define void @copy1(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int string_length(char *);
int main() {
  char string[100] = "TEST STRING";
  int length;
  length = string_length(string);
  printf("Length of the string is %d\n", length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
call   1050 <string_length@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%esi
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rdi
call   1040 <string_length@plt>
lea    0xee2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.string = [100 x i8] c"TEST STRING\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [28 x i8] c"Length of the string is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %2 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @string_length(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [100 x i8] c"TEST STRING\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [28 x i8] c"Length of the string is %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @string_length(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct bladerf {
  int dummy;
};

/* Variables and functions */
int nios_legacy_pio_read(struct bladerf *, int, int /*<<< orphan*/ *);
int nios_legacy_expansion_gpio_dir_read(struct bladerf *dev, uint32_t *val) {
  int status = nios_legacy_pio_read(dev, 44, val);
  if (status == 0) {
    do {
      do {
      } while (0);
    } while (0);
  }
  return status;
}


x86 assembly (clang, -O0):
<nios_legacy_expansion_gpio_dir_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2c,%esi
call   1030 <nios_legacy_pio_read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1158 <nios_legacy_expansion_gpio_dir_read+0x48>
jmp    1144 <nios_legacy_expansion_gpio_dir_read+0x34>
jmp    1149 <nios_legacy_expansion_gpio_dir_read+0x39>
jmp    114e <nios_legacy_expansion_gpio_dir_read+0x3e>
jmp    1153 <nios_legacy_expansion_gpio_dir_read+0x43>
jmp    1158 <nios_legacy_expansion_gpio_dir_read+0x48>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_legacy_expansion_gpio_dir_read>:
mov    %rsi,%rdx
mov    $0x2c,%esi
jmp    1030 <nios_legacy_pio_read@plt>

LLVM IR (-O0):
%struct.bladerf = type { i32 }
define i32 @nios_legacy_expansion_gpio_dir_read(%struct.bladerf* %0, i32* %1) {
%3 = alloca %struct.bladerf*
%4 = alloca i32*
%5 = alloca i32
store %struct.bladerf* %0, %struct.bladerf** %3
store i32* %1, i32** %4
%6 = load %struct.bladerf*, %struct.bladerf** %3
%7 = load i32*, i32** %4
%8 = call i32 @nios_legacy_pio_read(%struct.bladerf* %6, i32 44, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_legacy_expansion_gpio_dir_read(%struct.bladerf* %0, i32* %1) {
%3 = tail call i32 @nios_legacy_pio_read(%struct.bladerf* %0, i32 44, i32* %1)
ret i32 %3
}
int test_imm_5Duint32_mem(unsigned int *val) {
  return ((*val) & (0x5D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Duint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 93
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ f2(int /*<<< orphan*/, int);
void f1() { f2(0, 1); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <f2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <f2@plt>

LLVM IR (-O0):
define void @f1() {
%1 = call i32 @f2(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call i32 @f2(i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, float *);
float inputfloat(char *c) {
  float num;
  printf("%s\n", c);
  scanf("%f", &num);
  return num;
}


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

x86 assembly (clang, -O2):
<inputfloat>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define float @inputfloat(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
ret float %6
}
void RTAvlrooGCPtrInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrInsert() {
ret void
}
int rl_vi_insert_beg(count, key)
int count __attribute__((unused)), key;
{
  rl_beg_of_line(1, key);
  rl_vi_insertion_mode(1, key);
  return (0);
}


x86 assembly (clang, -O0):
<rl_vi_insert_beg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <rl_beg_of_line@plt>
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <rl_vi_insertion_mode@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_insert_beg>:
push   %rbx
mov    %esi,%ebx
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <rl_beg_of_line@plt>
mov    $0x1,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <rl_vi_insertion_mode@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rl_vi_insert_beg(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 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_beg_of_line to i32 (i32, i32, ...)*)(i32 1, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_vi_insertion_mode to i32 (i32, i32, ...)*)(i32 1, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @rl_vi_insert_beg(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_beg_of_line to i32 (i32, i32, ...)*)(i32 1, i32 %1)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_vi_insertion_mode to i32 (i32, i32, ...)*)(i32 1, i32 %1)
ret i32 0
}
unsigned char ScaleColor6to8(const unsigned int color) {
  return ((unsigned char)(((color) << 2) | ((color) >> 4)));
}


x86 assembly (clang, -O0):
<ScaleColor6to8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleColor6to8>:
lea    0x0(,%rdi,4),%eax
shr    $0x4,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @ScaleColor6to8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 4
%7 = or i32 %4, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @ScaleColor6to8(i32 %0) {
%2 = shl i32 %0, 2
%3 = lshr i32 %0, 4
%4 = or i32 %2, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Variables and functions */
double __infer_nondet_double();
double tanh(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int /*<<< orphan*/ mbstowcs(char *, char const *, size_t);
void mbswszcopy(wchar_t *dst, const char *src, size_t dst_size) {
  mbstowcs(dst, src, dst_size - 1);
  dst[dst_size - 1] = '\0';
}


x86 assembly (clang, -O0):
<mbswszcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <mbstowcs@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbswszcopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdx
call   1030 <mbstowcs@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mbswszcopy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = sub i64 %9, 1
%11 = call i32 @mbstowcs(i8* %7, i8* %8, i64 %10)
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = sub i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @mbswszcopy(i8* %0, i8* %1, i64 %2) {
%4 = add i64 %2, -1
%5 = tail call i32 @mbstowcs(i8* %0, i8* %1, i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ tty_mode(int);
void sigint_handler(int sig) {
  tty_mode(1);
  exit(1);
}


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

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <tty_mode@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @tty_mode(i32 1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int d_ge_mr2(double *a1, double a2) { return !(((*a1) >= (a2))); }


x86 assembly (clang, -O0):
<d_ge_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_mr2>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @d_ge_mr2(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* %5
%7 = load double, double* %4
%8 = fcmp oge double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_ge_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ult double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
long double longdouble_ignoring_unsignedshortint(long double x,
                                                 unsigned short int y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_unsignedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %ax,-0x12(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_unsignedshortint>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_unsignedshortint(x86_fp80 %0, i16 zeroext %1) {
%3 = alloca x86_fp80
%4 = alloca i16
store x86_fp80 %0, x86_fp80* %3
store i16 %1, i16* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_unsignedshortint(x86_fp80 returned %0, i16 zeroext %1) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ rand_seed(unsigned int);
void srand(unsigned int seed) { rand_seed(seed); }


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

x86 assembly (clang, -O2):
<srand>:
jmp    1030 <rand_seed@plt>

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

LLVM IR (-O2):
define void @srand(i32 %0) {
%2 = tail call i32 @rand_seed(i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerEnable(uint32_t ui32Base, uint32_t ui32Timer) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) |=
      ui32Timer & (0x00000001 | 0x00000100);
}


x86 assembly (clang, -O0):
<TimerEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0x101,%edx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerEnable>:
and    $0x101,%esi
movslq %edi,%rax
or     %esi,0xc(%rax)
ret

LLVM IR (-O0):
define void @TimerEnable(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 = and i32 %5, 257
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 12
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, %6
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @TimerEnable(i32 %0, i32 %1) {
%3 = and i32 %1, 257
%4 = add nsw i32 %0, 12
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, %3
store volatile i32 %8, i32* %6
ret void
}
void glmColorFromVectord(double color[3], const double vector[3]) {
  color[0] = (vector[0] + 1) / 2.0;
  color[1] = (vector[1] + 1) / 2.0;
  color[2] = (vector[2] + 1) / 2.0;
}


x86 assembly (clang, -O0):
<glmColorFromVectord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xef0(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xecc(%rip),%xmm0
addsd  0x8(%rax),%xmm0
movsd  0xeb7(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xea6(%rip),%xmm0
addsd  0x10(%rax),%xmm0
movsd  0xe91(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmColorFromVectord>:
movsd  0xef8(%rip),%xmm0
movsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rdi)
addsd  0x10(%rsi),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @glmColorFromVectord(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %8, 2.000000e+00
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fadd double %14, 1.000000e+00
%16 = fdiv double %15, 2.000000e+00
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = fadd double %21, 1.000000e+00
%23 = fdiv double %22, 2.000000e+00
%24 = load double*, double** %3
%25 = getelementptr inbounds double, double* %24, i64 2
store double %23, double* %25
ret void
}

LLVM IR (-O2):
define void @glmColorFromVectord(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fadd double %3, 1.000000e+00
%5 = fmul double %4, 5.000000e-01
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fadd double %7, 1.000000e+00
%9 = fmul double %8, 5.000000e-01
%10 = getelementptr inbounds double, double* %0, i64 1
store double %9, double* %10
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = fadd double %12, 1.000000e+00
%14 = fmul double %13, 5.000000e-01
%15 = getelementptr inbounds double, double* %0, i64 2
store double %14, double* %15
ret void
}
/* Variables and functions */
void *mz_ext_realloc(void *, size_t);
void *def_realloc_func(void *opaque, void *address, size_t items, size_t size) {
  (void)opaque, (void)address, (void)items, (void)size;
  return mz_ext_realloc(address, items * size);
}


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

x86 assembly (clang, -O2):
<def_realloc_func>:
mov    %rsi,%rdi
imul   %rcx,%rdx
mov    %rdx,%rsi
jmp    1030 <mz_ext_realloc@plt>

LLVM IR (-O0):
define i8* @def_realloc_func(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = mul i64 %14, %15
%17 = call i8* @mz_ext_realloc(i8* %13, i64 %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @def_realloc_func(i8* nocapture readnone %0, i8* %1, i64 %2, i64 %3) {
%5 = mul i64 %3, %2
%6 = tail call i8* @mz_ext_realloc(i8* %1, i64 %5)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void free_s8(int8_t *val) {}


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

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

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

LLVM IR (-O2):
define void @free_s8(i32* nocapture %0) {
ret void
}
unsigned xrop3_204_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  return (S & S) | (S & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_204_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_204_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_204_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
void sonic_print_port_info(struct sonic_port_info *info) {

  ;

  ;

  ;

  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
%struct.sonic_port_info = type opaque
define void @sonic_print_port_info(%struct.sonic_port_info* nocapture %0) {
ret void
}
void fpga_mgr_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @fpga_mgr_debugfs_init() {
ret void
}