xunge/DecIR huggingface dataset:
void XSetWMNormalHints() {}


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

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

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

LLVM IR (-O2):
define void @XSetWMNormalHints() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int display_day_number(int month, int day, int year, int day_number) {
  printf("The Day # for %d/%d/%d is %d\n\n", month, day, year, day_number);
  return 0;
}


x86 assembly (clang, -O0):
<display_day_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_day_number>:
push   %rax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"The Day # for %d/%d/%d is %d\0A\0A\00"
define i32 @display_day_number(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* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"The Day # for %d/%d/%d is %d\0A\0A\00"
define i32 @display_day_number(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TestPLS1();
int main(void) {
  TestPLS1();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TestPLS1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestPLS1()
ret i32 0
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int runtime_rusage(int, struct rusage *);
int getrusage(int who, struct rusage *usage) {
  return runtime_rusage(who, usage);
}


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

x86 assembly (clang, -O2):
<getrusage>:
jmp    1030 <runtime_rusage@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @getrusage(i32 %0, %struct.rusage* %1) {
%3 = alloca i32
%4 = alloca %struct.rusage*
store i32 %0, i32* %3
store %struct.rusage* %1, %struct.rusage** %4
%5 = load i32, i32* %3
%6 = load %struct.rusage*, %struct.rusage** %4
%7 = call i32 @runtime_rusage(i32 %5, %struct.rusage* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @getrusage(i32 %0, %struct.rusage* %1) {
%3 = tail call i32 @runtime_rusage(i32 %0, %struct.rusage* %1)
ret i32 %3
}
/* Type definitions */
struct iucvtty_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct iucvtty_msg *);
void msg_free(struct iucvtty_msg *m) { free(m); }


x86 assembly (clang, -O0):
<msg_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):
<msg_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.iucvtty_msg = type { i32 }
define void @msg_free(%struct.iucvtty_msg* nocapture %0) {
%2 = tail call i32 @free(%struct.iucvtty_msg* %0)
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t EndianCvt64(uint64_t x) {
  return (((x >> 56ULL) & 0xffULL) | ((x << 56ULL) & 0xff00000000000000ULL) |
          ((x >> 40ULL) & 0xff00ULL) | ((x << 40ULL) & 0xff000000000000ULL) |
          ((x >> 24ULL) & 0xff0000ULL) | ((x << 24ULL) & 0xff0000000000ULL) |
          ((x >> 8ULL) & 0xff000000ULL) | ((x << 8ULL) & 0xff00000000ULL));
}


x86 assembly (clang, -O0):
<EndianCvt64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x38,%rax
and    $0xff,%rax
mov    -0x8(%rbp),%rcx
shl    $0x38,%rcx
movabs $0xff00000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x28,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x28,%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x18,%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndianCvt64>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @EndianCvt64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 56
%5 = and i64 %4, 255
%6 = load i64, i64* %2
%7 = shl i64 %6, 56
%8 = and i64 %7, -72057594037927936
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = lshr i64 %10, 40
%12 = and i64 %11, 65280
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = shl i64 %14, 40
%16 = and i64 %15, 71776119061217280
%17 = or i64 %13, %16
%18 = load i64, i64* %2
%19 = lshr i64 %18, 24
%20 = and i64 %19, 16711680
%21 = or i64 %17, %20
%22 = load i64, i64* %2
%23 = shl i64 %22, 24
%24 = and i64 %23, 280375465082880
%25 = or i64 %21, %24
%26 = load i64, i64* %2
%27 = lshr i64 %26, 8
%28 = and i64 %27, 4278190080
%29 = or i64 %25, %28
%30 = load i64, i64* %2
%31 = shl i64 %30, 8
%32 = and i64 %31, 1095216660480
%33 = or i64 %29, %32
ret i64 %33
}

LLVM IR (-O2):
define i64 @EndianCvt64(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int hex2int(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char hexademical[] = "0xAF3";
  int result;
  result = hex2int(hexademical);
  if (result > 0) {
    printf("hexademical value: %s converted to decimal: %d\n", hexademical,
           result);
  } else {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <hex2int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1171 <main+0x51>
lea    -0xa(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <main+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x33,0x4(%rsp)
movl   $0x46417830,(%rsp)
mov    %rsp,%rdi
call   1040 <hex2int@plt>
test   %eax,%eax
jle    1150 <main+0x30>
lea    0xec4(%rip),%rdi
mov    %rsp,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.hexademical = [6 x i8] c"0xAF3\00"
@.str = [48 x i8] c"hexademical value: %s converted to decimal: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = call i32 @hex2int(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %14
13: ; preds = %0
store i32 -1, i32* %1
br label %15
14: ; preds = %9
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@__const.main.hexademical = [6 x i8] c"0xAF3\00"
@.str = [48 x i8] c"hexademical value: %s converted to decimal: %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @hex2int(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ 0, %5 ], [ -1, %0 ]
ret i32 %8
}
const char *__attribute__((weak)) __attribute__((no)) weak_n1(void) {
  return "weak_n1";
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"weak_n1\00"
define weak i8* @weak_n1() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int foo(int /*<<< orphan*/, int, int, int, int);
int main(void) {
  int z = foo(0, 1, 2, 3, 4);
  return !(z == 191);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
call   1030 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xbf,-0x8(%rbp)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
call   1030 <foo@plt>
xor    %ecx,%ecx
cmp    $0xbf,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @foo(i32 0, i32 1, i32 2, i32 3, i32 4)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 191
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 1, i32 2, i32 3, i32 4)
%2 = icmp ne i32 %1, 191
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Welcome to our simple shell program! \r\n Available commands in this "
         "shell are: \r\n cd - change directory \r\n exit - exit the shell");
  printf("   \r\n help - list the commands \r\n dragon -  Creative little "
         "function for the shell intended for the extra credit portion \r\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf4c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"Welcome to our simple shell program! \0D\0A Available commands in this shell are: \0D\0A cd - change directory \0D\0A exit - exit the shell\00"
@.str.1 = [124 x i8] c" \0D\0A help - list the commands \0D\0A dragon - Creative little function for the shell intended for the extra credit portion \0D\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"Welcome to our simple shell program! \0D\0A Available commands in this shell are: \0D\0A cd - change directory \0D\0A exit - exit the shell\00"
@str = [123 x i8] c" \0D\0A help - list the commands \0D\0A dragon - Creative little function for the shell intended for the extra credit portion \0D\00"
define void @help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([123 x i8], [123 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ subset(int *, int);
int main() {
  int A[] = {1, 2, 3, 4, 5};
  subset(A, 5);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <subset@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <subset@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @subset(i32* %3, i32 5)
%5 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @subset(i32* %3, i32 5)
%5 = call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ timer_milliseconds(unsigned int);
bool timer_elapsed_milliseconds(unsigned index, uint32_t value) {
  return (timer_milliseconds(index) >= value);
}


x86 assembly (clang, -O0):
<timer_elapsed_milliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <timer_milliseconds@plt>
cmp    -0x10(%rbp),%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_elapsed_milliseconds>:
push   %rbx
mov    %rsi,%rbx
call   1030 <timer_milliseconds@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setge  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @timer_elapsed_milliseconds(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = call i64 @timer_milliseconds(i32 %5)
%7 = load i64, i64* %4
%8 = icmp sge i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @timer_elapsed_milliseconds(i32 %0, i64 %1) {
%3 = tail call i64 @timer_milliseconds(i32 %0)
%4 = icmp sge i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int sgs_tolower(int c) { return c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<sgs_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <sgs_tolower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <sgs_tolower+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <sgs_tolower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgs_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @sgs_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @sgs_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  float x = 2.55;
  printf("The result is %g\n", (3 * x * x * x) - (5 * x * x) + 6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xeec(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xec0(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe95(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %g\0A\00"
define i32 @main() {
%1 = alloca float
store float 0x4004666660000000, float* %1
%2 = load float, float* %1
%3 = fmul float 3.000000e+00, %2
%4 = load float, float* %1
%5 = fmul float %3, %4
%6 = load float, float* %1
%7 = load float, float* %1
%8 = fmul float 5.000000e+00, %7
%9 = load float, float* %1
%10 = fmul float %8, %9
%11 = fneg float %10
%12 = call float @llvm.fmuladd.f32(float %5, float %6, float %11)
%13 = fadd float %12, 6.000000e+00
%14 = fptosi float %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %g\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 23)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set(int *, int /*<<< orphan*/);
void clear(int *a) { set(a, 0); }


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

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

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

LLVM IR (-O2):
define void @clear(i32* %0) {
%2 = tail call i32 @set(i32* %0, i32 0)
ret void
}
void OBJ_nid2ln(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_nid2ln() {
ret void
}
int psync_fs_start() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @psync_fs_start() {
ret i32 -1
}
/* Variables and functions */
int *malloc(int);
int *intdup(int *src) {
  int *res = malloc(sizeof(int));
  if (res)
    *res = *src;
  return res;
}


x86 assembly (clang, -O0):
<intdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <intdup+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intdup>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1127 <intdup+0x17>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i32* @intdup(i32* nocapture %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load i32, i32* %0
store i32 %5, i32* %2
br label %6
6: ; preds = %4, %1
ret i32* %2
}
void ff_hevc_put_hevc_bi_qpel_hv4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_hv4_10_sse4() {
ret void
}
long __round(long double value) {
  long intpart;
  intpart = value;
  value = value - intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<__round>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x2a(%rbp)
movzwl -0x2a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x2c(%rbp)
fldcw  -0x2c(%rbp)
fistpll -0x28(%rbp)
fldcw  -0x2a(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
fsubrp %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeb6(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     1167 <__round+0x67>
jmp    115b <__round+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__round>:
fldt   0x8(%rsp)
fnstcw -0x14(%rsp)
movzwl -0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x12(%rsp)
fldcw  -0x12(%rsp)
fld    %st(0)
fistpll -0x10(%rsp)
fldcw  -0x14(%rsp)
mov    -0x10(%rsp),%rax
mov    %rax,-0x8(%rsp)
fildll -0x8(%rsp)
fsubrp %st,%st(1)
flds   0xec5(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @__round(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fptosi x86_fp80 %4 to i64
store i64 %5, i64* %3
%6 = load x86_fp80, x86_fp80* %2
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to x86_fp80
%9 = fsub x86_fp80 %6, %8
store x86_fp80 %9, x86_fp80* %2
%10 = load x86_fp80, x86_fp80* %2
%11 = fcmp oge x86_fp80 %10, 0xK3FFE8000000000000000
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @__round(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i64
%3 = sitofp i64 %2 to x86_fp80
%4 = fsub x86_fp80 %0, %3
%5 = fcmp oge x86_fp80 %4, 0xK3FFE8000000000000000
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
int test_imm_A0int16_reg(short val) {
  return ((val) & (-0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff60,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A0int16_reg>:
test   $0xff60,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A0int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -160
%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_A0int16_reg(i16 signext %0) {
%2 = and i16 %0, -160
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char tolower(char c) {
  if (c >= 'A' && c <= 'Z') {
    return (c - 'A') + 'a';
  } else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <tolower+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <tolower+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    113c <tolower+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @tolower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 97
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @tolower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void clear_string(char *string, int position) {
  for (; position; position--)
    string[position - 1] = 0;
}


x86 assembly (clang, -O0):
<clear_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1134 <clear_string+0x34>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <clear_string+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_string>:
test   %esi,%esi
je     112e <clear_string+0x1e>
push   %rax
lea    -0x1(%rsi),%eax
movslq %eax,%rcx
sub    %rax,%rcx
add    %rcx,%rdi
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_string(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = sext i32 %5 to i64
%7 = zext i32 %5 to i64
%8 = sub nsw i64 %6, %7
%9 = getelementptr i8, i8* %0, i64 %8
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %4, %2
ret void
}
extern void TBUF_RECORD_EVENT(char *str) {
  unsigned addr;
  asm volatile("movl	%%fs:0, %%esi	        \n"
               "addl	$32, %%esi		\n"
               "movl   %%esi, %%edi            \n"
               "andl   $0x1fffff, %%esi	\n"
               "movl	%%esi, %%fs:0     	\n"
               "rdtsc				\n"
               "movl 	%%eax, %%fs:0(%%edi)    \n"
               : "=D"(addr)
               :
               : "eax", "ecx", "edx", "esi");
  ;
  asm volatile("movl   %0, %%fs:("
               "0"
               "*4+12)(%%edi)\n"
               :
               : "r"((unsigned)str), "D"(addr));
  ;
}


x86 assembly (clang, -O0):
<TBUF_RECORD_EVENT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %fs:0x0,%esi
add    $0x20,%esi
mov    %esi,%edi
and    $0x1fffff,%esi
mov    %esi,%fs:0x0
rdtsc
mov    %eax,%fs:(%edi)
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    %eax,%fs:0xc(%edi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TBUF_RECORD_EVENT>:
mov    %rdi,%r8
mov    %fs:0x0,%esi
add    $0x20,%esi
mov    %esi,%edi
and    $0x1fffff,%esi
mov    %esi,%fs:0x0
rdtsc
mov    %eax,%fs:(%edi)
mov    %r8d,%fs:0xc(%edi)
ret

LLVM IR (-O0):
define void @TBUF_RECORD_EVENT(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 asm sideeffect "movl\09%fs:0, %esi\09 \0Aaddl\09$$32, %esi\09\09\0Amovl %esi, %edi \0Aandl $$0x1fffff, %esi\09\0Amovl\09%esi, %fs:0 \09\0Ardtsc\09\09\09\09\0Amovl \09%eax, %fs:0(%edi) \0A", "={di},~{eax},~{ecx},~{edx},~{esi},~{dirflag},~{fpsr},~{flags}"()
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i32
%7 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @TBUF_RECORD_EVENT(i8* %0) {
%2 = tail call i32 asm sideeffect "movl\09%fs:0, %esi\09 \0Aaddl\09$$32, %esi\09\09\0Amovl %esi, %edi \0Aandl $$0x1fffff, %esi\09\0Amovl\09%esi, %fs:0 \09\0Ardtsc\09\09\09\09\0Amovl \09%eax, %fs:0(%edi) \0A", "={di},~{eax},~{ecx},~{edx},~{esi},~{dirflag},~{fpsr},~{flags}"()
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
tail call void asm sideeffect "movl $0, %fs:(0*4+12)(%edi)\0A", "r,{di},~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_byte(int /*<<< orphan*/ *, int);
void eeconfig_update_keymap(uint16_t val) {
  eeprom_update_byte((uint8_t *)4, val & 0xFF);
  eeprom_update_byte((uint8_t *)33, (val >> 8) & 0xFF);
}


x86 assembly (clang, -O0):
<eeconfig_update_keymap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x4,%edi
call   1030 <eeprom_update_byte@plt>
mov    -0x4(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
mov    $0x21,%edi
call   1030 <eeprom_update_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_update_keymap>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%esi
mov    $0x4,%edi
call   1030 <eeprom_update_byte@plt>
movzbl %bh,%esi
mov    $0x21,%edi
pop    %rbx
jmp    1030 <eeprom_update_byte@plt>

LLVM IR (-O0):
define void @eeconfig_update_keymap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @eeprom_update_byte(i32* inttoptr (i64 4 to i32*), i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @eeprom_update_byte(i32* inttoptr (i64 33 to i32*), i32 %8)
ret void
}

LLVM IR (-O2):
define void @eeconfig_update_keymap(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @eeprom_update_byte(i32* inttoptr (i64 4 to i32*), i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @eeprom_update_byte(i32* inttoptr (i64 33 to i32*), i32 %5)
ret void
}
/* Variables and functions */
unsigned int _mm_getcsr();
unsigned int test_mm_getcsr() { return _mm_getcsr(); }


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

x86 assembly (clang, -O2):
<test_mm_getcsr>:
stmxcsr -0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @test_mm_getcsr() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_mm_getcsr() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
unsigned int float32ScaledToBitfield(float value, float min, float scaler) {
  if (value < min)
    return 0;
  value = (value - min) * scaler;
  return (unsigned int)(value + 0.5f);
}


x86 assembly (clang, -O0):
<float32ScaledToBitfield>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1132 <float32ScaledToBitfield+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1167 <float32ScaledToBitfield+0x67>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xea5(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float32ScaledToBitfield>:
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
addss  0xeeb(%rip),%xmm0
cvttss2si %xmm0,%rax
cmova  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @float32ScaledToBitfield(float %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %21
12: ; preds = %3
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fsub float %13, %14
%16 = load float, float* %7
%17 = fmul float %15, %16
store float %17, float* %5
%18 = load float, float* %5
%19 = fadd float %18, 5.000000e-01
%20 = fptoui float %19 to i32
store i32 %20, i32* %4
br label %21
21: ; preds = %12, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @float32ScaledToBitfield(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fsub float %0, %1
%6 = fmul float %5, %2
%7 = fadd float %6, 5.000000e-01
%8 = fptoui float %7 to i32
%9 = select i1 %4, i32 0, i32 %8
ret i32 %9
}
/* Type definitions */
struct protocol_state {
  int dummy;
};

/* Variables and functions */
int write_string(struct protocol_state *, char const *);
int write_msg_header(struct protocol_state *ps, const char *name) {
  return write_string(ps, name);
}


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

x86 assembly (clang, -O2):
<write_msg_header>:
jmp    1030 <write_string@plt>

LLVM IR (-O0):
%struct.protocol_state = type { i32 }
define i32 @write_msg_header(%struct.protocol_state* %0, i8* %1) {
%3 = alloca %struct.protocol_state*
%4 = alloca i8*
store %struct.protocol_state* %0, %struct.protocol_state** %3
store i8* %1, i8** %4
%5 = load %struct.protocol_state*, %struct.protocol_state** %3
%6 = load i8*, i8** %4
%7 = call i32 @write_string(%struct.protocol_state* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.protocol_state = type { i32 }
define i32 @write_msg_header(%struct.protocol_state* %0, i8* %1) {
%3 = tail call i32 @write_string(%struct.protocol_state* %0, i8* %1)
ret i32 %3
}
void BN_GF2m_mod_mul_arr(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_mod_mul_arr() {
ret void
}
void MEMRDTerminate(unsigned char Channel, unsigned short data) {}


x86 assembly (clang, -O0):
<MEMRDTerminate>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @MEMRDTerminate(i8 zeroext %0, i16 zeroext %1) {
ret void
}
int function1(int a, int b) {
  if (a > b)
    return a;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @function1(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void print_segment(long long unsigned int x) {
  volatile int *hex03_ptr = (int *)0xFF200020;
  volatile int *hex45_ptr = (int *)0xFF200030;
  *(hex03_ptr) = 0;
  *(hex45_ptr) = 0;
  *(hex03_ptr) = (int)x;
  if (x > 0xffffffff) {
    *(hex45_ptr) = x >> 32;
  }
}


x86 assembly (clang, -O0):
<print_segment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xff200020,%eax
mov    %rax,-0x10(%rbp)
mov    $0xff200030,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
cmp    %rax,-0x8(%rbp)
jbe    1159 <print_segment+0x59>
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_segment>:
mov    $0xff200020,%eax
movl   $0x0,(%rax)
movl   $0x0,0x10(%rax)
mov    %edi,(%rax)
shr    $0x20,%rdi
je     111d <print_segment+0x1d>
mov    %edi,0x10(%rax)
ret

LLVM IR (-O0):
define void @print_segment(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i32*
store i64 %0, i64* %2
store i32* inttoptr (i64 4280287264 to i32*), i32** %3
store i32* inttoptr (i64 4280287280 to i32*), i32** %4
%5 = load i32*, i32** %3
store volatile i32 0, i32* %5
%6 = load i32*, i32** %4
store volatile i32 0, i32* %6
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = load i32*, i32** %3
store volatile i32 %8, i32* %9
%10 = load i64, i64* %2
%11 = icmp ugt i64 %10, 4294967295
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i64, i64* %2
%14 = lshr i64 %13, 32
%15 = trunc i64 %14 to i32
%16 = load i32*, i32** %4
store volatile i32 %15, i32* %16
br label %17
17: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @print_segment(i64 %0) {
store volatile i32 0, i32* inttoptr (i64 4280287264 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280287280 to i32*)
%2 = trunc i64 %0 to i32
store volatile i32 %2, i32* inttoptr (i64 4280287264 to i32*)
%3 = icmp ugt i64 %0, 4294967295
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = lshr i64 %0, 32
%6 = trunc i64 %5 to i32
store volatile i32 %6, i32* inttoptr (i64 4280287280 to i32*)
br label %7
7: ; preds = %4, %1
ret void
}
int ph_unknown_udp_deinit(void *handler) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ph_unknown_udp_deinit(i8* nocapture readnone %0) {
ret i32 0
}
const char *Range_Definition(void) {
  return "struct Range {\n"
         "  var value;\n"
         "  int64_t start;\n"
         "  int64_t stop;\n"
         "  int64_t step;\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [81 x i8] c"struct Range {\0A var value;\0A int64_t start;\0A int64_t stop;\0A int64_t step;\0A};\0A\00"
define i8* @Range_Definition() {
ret i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [81 x i8] c"struct Range {\0A var value;\0A int64_t start;\0A int64_t stop;\0A int64_t step;\0A};\0A\00"
define i8* @Range_Definition() {
ret i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ut_string_free(char **str) {
  if (str == NULL || *str == NULL)
    return;
  free(*str);
  *str = NULL;
}


x86 assembly (clang, -O0):
<ut_string_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <ut_string_free+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <ut_string_free+0x2a>
jmp    1151 <ut_string_free+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_string_free>:
push   %rbx
test   %rdi,%rdi
je     112d <ut_string_free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ut_string_free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ut_string_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %1, %3, %6
ret void
}
void load_groupname_map(void) { ; }


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

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

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

LLVM IR (-O2):
define void @load_groupname_map() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printPlusRow();
int /*<<< orphan*/ printf(char *);
void printKontostand() {
  printPlusRow();
  printf("");
  printPlusRow();
}


x86 assembly (clang, -O0):
<printKontostand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <printPlusRow@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <printPlusRow@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printKontostand>:
push   %rax
xor    %eax,%eax
call   1030 <printPlusRow@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <printPlusRow@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @printKontostand() {
%1 = call i32 (...) @printPlusRow()
%2 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @printPlusRow()
ret void
}

LLVM IR (-O2):
define void @printKontostand() {
%1 = tail call i32 (...) @printPlusRow()
%2 = tail call i32 (...) @printPlusRow()
ret void
}
void setaffinity(void) {}


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

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

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

LLVM IR (-O2):
define void @setaffinity() {
ret void
}
int rounds(const float x) { return (int)(x + 0.5f); }


x86 assembly (clang, -O0):
<rounds>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounds>:
addss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @rounds(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 5.000000e-01
%5 = fptosi float %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @rounds(float %0) {
%2 = fadd float %0, 5.000000e-01
%3 = fptosi float %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_getgrgid_free() {
  printf("NOT IMPLEMENTED:"
         "pa_getgrgid_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_getgrgid_free\0A\00"
define i32 @pa_getgrgid_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_getgrgid_free\00"
define i32 @pa_getgrgid_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ iothub_client_sample_upload_to_blob_run();
int main(void) { iothub_client_sample_upload_to_blob_run(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <iothub_client_sample_upload_to_blob_run@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_client_sample_upload_to_blob_run()
ret i32 0
}
void f110(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    goto a;
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  0;
}


x86 assembly (clang, -O0):
<f110>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f110() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %1
store i32 0, i32* %2
%6 = load i32, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %3
br label %8
8: ; preds = %0
ret void
}

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