xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ chown(char const *, int, int);
int main(int argc, char **argv) {
  int uid = atoi(*++argv);
  int gid = atoi(*++argv);
  const char *path = *++argv;
  chown(path, uid, gid);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <chown@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    0x18(%rbx),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <chown@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %5
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %6
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %7
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %5
%19 = load i8*, i8** %18
store i8* %19, i8** %8
%20 = load i8*, i8** %8
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @chown(i8* %20, i32 %21, i32 %22)
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i32 @chown(i8* %10, i32 %5, i32 %8)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
void sched_yield() { asm("int %0" : : "i"(0x50)); }


x86 assembly (clang, -O0):
<sched_yield>:
push   %rbp
mov    %rsp,%rbp
int    $0x50
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_yield>:
int    $0x50
ret

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

LLVM IR (-O2):
define void @sched_yield() {
tail call void asm sideeffect "int $0", "i,~{dirflag},~{fpsr},~{flags}"(i32 80)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlink_delete_first();
void *dlink_get_first();
void *pop() {
  void *p = dlink_get_first();
  dlink_delete_first();
  return p;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <dlink_get_first@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dlink_delete_first@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
push   %rbx
xor    %eax,%eax
call   1040 <dlink_get_first@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <dlink_delete_first@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pop() {
%1 = alloca i8*
%2 = call i8* (...) @dlink_get_first()
store i8* %2, i8** %1
%3 = call i32 (...) @dlink_delete_first()
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
define i8* @pop() {
%1 = tail call i8* (...) @dlink_get_first()
%2 = tail call i32 (...) @dlink_delete_first()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeArray1D(void *v) { free((char *)v); }


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

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

LLVM IR (-O2):
define void @FreeArray1D(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
size_t serd_base64_get_length(const size_t size, const bool wrap_lines) {
  return (size + 2) / 3 * 4 + (wrap_lines * ((size - 1) / 57));
}


x86 assembly (clang, -O0):
<serd_base64_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    $0x39,%esi
xor    %edx,%edx
div    %rsi
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serd_base64_get_length>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rcx
and    $0xfffffffffffffffe,%rcx
lea    -0x1(%rdi),%rax
movabs $0x8fb823ee08fb823f,%rdx
23 b8 8f
mul    %rdx
movslq %esi,%rax
shr    $0x5,%rdx
imul   %rax,%rdx
lea    (%rdx,%rcx,2),%rax
ret

LLVM IR (-O0):
define i64 @serd_base64_get_length(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 2
%7 = udiv i64 %6, 3
%8 = mul i64 %7, 4
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = load i64, i64* %3
%12 = sub i64 %11, 1
%13 = udiv i64 %12, 57
%14 = mul i64 %10, %13
%15 = add i64 %8, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @serd_base64_get_length(i64 %0, i32 %1) {
%3 = add i64 %0, 2
%4 = udiv i64 %3, 3
%5 = shl i64 %4, 2
%6 = sext i32 %1 to i64
%7 = add i64 %0, -1
%8 = udiv i64 %7, 57
%9 = mul i64 %8, %6
%10 = add i64 %5, %9
ret i64 %10
}
long compare_pointers(void *data1, void *data2) {
  return (long)data1 - (long)data2;
}


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

x86 assembly (clang, -O2):
<compare_pointers>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @compare_pointers(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @compare_pointers(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ cfg_set_str(char *, char *, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void cfg_set_int(char *dname, char *sname, char *ename, int value) {
  char str[32];
  snprintf(str, sizeof(str), "%d", value);
  cfg_set_str(dname, sname, ename, str);
}


x86 assembly (clang, -O0):
<cfg_set_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
mov    $0x20,%esi
lea    0xeb6(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1040 <cfg_set_str@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_set_int>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec5(%rip),%rdx
mov    %rsp,%r12
mov    %r12,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1040 <cfg_set_str@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @cfg_set_int(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [32 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %8
%12 = call i32 @snprintf(i8* %10, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%17 = call i32 @cfg_set_str(i8* %13, i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @cfg_set_int(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = call i32 @cfg_set_str(i8* %0, i8* %1, i8* %2, i8* %6)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ xgetbv_ecx0(int *, int *);
int main() {
  uint32_t eax, edx;
  xgetbv_ecx0(&edx, &eax);
  printf("edx: 0x%08x\neax: 0x%08x\n", edx, eax);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <xgetbv_ecx0@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <xgetbv_ecx0@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"edx: 0x%08x\0Aeax: 0x%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @xgetbv_ecx0(i32* %2, i32* %1)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void adapt_vt_ext_vt_trace_on(uint32_t ignored0, uint8_t ignored1) {}


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

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

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

LLVM IR (-O2):
define void @adapt_vt_ext_vt_trace_on(i32 %0, i32 %1) {
ret void
}
int bitwise(int x, int y) { return (x & y) + (x | y) + (x ^ ~y); }


x86 assembly (clang, -O0):
<bitwise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
or     -0x8(%rbp),%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
xor    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwise>:
lea    (%rsi,%rdi,1),%eax
xor    %esi,%edi
not    %edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bitwise(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = or i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = xor i32 %13, -1
%15 = xor i32 %12, %14
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @bitwise(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = xor i32 %0, %1
%5 = xor i32 %4, -1
%6 = add nsw i32 %3, %5
ret i32 %6
}
int Ascii(char c) { return c; }


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

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

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

LLVM IR (-O2):
define i32 @Ascii(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
void do_helpdetail(void) {}


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

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

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

LLVM IR (-O2):
define void @do_helpdetail() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char s[] = "Hello, world!";
  reverse(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x12(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x21646c726f7720,%rax
mov    %rax,0x6(%rsp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [14 x i8] c"Hello, world!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
store i32 0, i32* %1
%3 = bitcast [14 x i8]* %2 to i8*
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%5 = call i32 @reverse(i8* %4)
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [14 x i8] c"Hello, world!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void capturing2capturingComment_rv_endCapturing() {}


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

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

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

LLVM IR (-O2):
define void @capturing2capturingComment_rv_endCapturing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char const *);
void perror(const char *err) { print(err); }


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

x86 assembly (clang, -O2):
<perror>:
jmp    1030 <print@plt>

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

LLVM IR (-O2):
define void @perror(i8* %0) {
%2 = tail call i32 @print(i8* %0)
ret void
}
unsigned swap32_f(unsigned in) {
  in = ((in & 0xff00ff00) >> 8) | ((in & 0x00ff00ff) << 8);
  in = ((in & 0xffff0000) >> 16) | ((in & 0x0000ffff) << 16);
  return in;
}


x86 assembly (clang, -O0):
<swap32_f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap32_f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16711936
%5 = lshr i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 16711935
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, -65536
%12 = lshr i32 %11, 16
%13 = load i32, i32* %2
%14 = and i32 %13, 65535
%15 = shl i32 %14, 16
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @swap32_f(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
__attribute__((always_)) unsigned int nr_free_highpages(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nr_free_highpages() {
ret i32 0
}
void ff_hevc_put_hevc_qpel_hv4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv4_12_sse4() {
ret void
}
/* Variables and functions */
void *malloc(int);
void *refmalloc(size_t size) {
  void *ptr = malloc(sizeof(size_t) + size);
  size_t *cnt = (size_t *)ptr;
  *cnt = 0;
  ptr += sizeof(size_t);
  return ptr;
}


x86 assembly (clang, -O0):
<refmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refmalloc>:
push   %rax
add    $0x8,%edi
call   1030 <malloc@plt>
movq   $0x0,(%rax)
add    $0x8,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @refmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64*
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = add i64 8, %5
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %4
%11 = load i64*, i64** %4
store i64 0, i64* %11
%12 = load i8*, i8** %3
%13 = getelementptr i8, i8* %12, i64 8
store i8* %13, i8** %3
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @refmalloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 8
%4 = tail call i8* @malloc(i32 %3)
%5 = bitcast i8* %4 to i64*
store i64 0, i64* %5
%6 = getelementptr i8, i8* %4, i64 8
ret i8* %6
}
void *bar(void) {
  __label__ lab;
lab:
  return &&lab;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <bar+0x9>
lea    -0x7(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @bar() {
br label %1
1: ; preds = %2, %0
ret i8* blockaddress(@bar, %1)
2: ; No predecessors!
indirectbr i8* undef, [label %1]
}

LLVM IR (-O2):
define i8* @bar() {
br label %1
1: ; preds = %0
ret i8* blockaddress(@bar, %1)
}
void foo_char(signed char x, unsigned char y) {
  char t = (((x) >= 0) ? (x) : -(x));
  if (t != y)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<foo_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     113d <foo_char+0x2d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <foo_char+0x38>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
je     1163 <foo_char+0x53>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_char>:
mov    %edi,%eax
sar    $0x7,%al
add    %al,%dil
xor    %al,%dil
movsbl %dil,%eax
cmp    %esi,%eax
jne    1124 <foo_char+0x14>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo_char(i8 signext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
br label %16
12: ; preds = %2
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 0, %14
br label %16
16: ; preds = %12, %9
%17 = phi i32 [ %11, %9 ], [ %15, %12 ]
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = icmp ne i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %16
unreachable
25: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @foo_char(i8 signext %0, i8 zeroext %1) {
%3 = tail call i8 @llvm.abs.i8(i8 %0, i1 false)
%4 = sext i8 %3 to i32
%5 = zext i8 %1 to i32
%6 = icmp eq i32 %4, %5
br i1 %6, label %8, label %7
7: ; preds = %2
tail call void @abort()
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
double calculoResistencia(int);
double calculoSuporte(int);
double calculoRegressaoFibonacci(double fatorDeRegressao, int quantidadeVelas) {
  double variacaoDePontos =
      calculoSuporte(quantidadeVelas) - calculoResistencia(quantidadeVelas);
  return variacaoDePontos * fatorDeRegressao;
}


x86 assembly (clang, -O0):
<calculoRegressaoFibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <calculoSuporte@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <calculoResistencia@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculoRegressaoFibonacci>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x8(%rsp)
call   1040 <calculoSuporte@plt>
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1030 <calculoResistencia@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @calculoRegressaoFibonacci(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call double @calculoSuporte(i32 %6)
%8 = load i32, i32* %4
%9 = call double @calculoResistencia(i32 %8)
%10 = fsub double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %3
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @calculoRegressaoFibonacci(double %0, i32 %1) {
%3 = tail call double @calculoSuporte(i32 %1)
%4 = tail call double @calculoResistencia(i32 %1)
%5 = fsub double %3, %4
%6 = fmul double %5, %0
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxpin(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x00));
}


x86 assembly (clang, -O0):
<write_pxpin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxpin>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010000,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxpin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 0
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxpin(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = tail call i32 @writel(i32 %1, i8* %5)
ret void
}
/* Variables and functions */
char **gettokens(char *, int *);
char **xrealloc(char **, int);
char **new_deliverargs(char *str) {
  char **ret;
  int retc;
  ret = gettokens(str, &retc);
  ret = xrealloc(ret, sizeof(char *) * (retc + 1));
  ret[retc] = NULL;
  return (ret);
}


x86 assembly (clang, -O0):
<new_deliverargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <gettokens@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <xrealloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_deliverargs>:
push   %rax
lea    0x4(%rsp),%rsi
call   1040 <gettokens@plt>
mov    0x4(%rsp),%ecx
lea    0x8(,%rcx,8),%esi
mov    %rax,%rdi
call   1030 <xrealloc@plt>
movslq 0x4(%rsp),%rcx
movq   $0x0,(%rax,%rcx,8)
pop    %rcx
ret

LLVM IR (-O0):
define i8** @new_deliverargs(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8** @gettokens(i8* %5, i32* %4)
store i8** %6, i8*** %3
%7 = load i8**, i8*** %3
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i8** @xrealloc(i8** %7, i32 %12)
store i8** %13, i8*** %3
%14 = load i8**, i8*** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
store i8* null, i8** %17
%18 = load i8**, i8*** %3
ret i8** %18
}

LLVM IR (-O2):
define i8** @new_deliverargs(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i8** @gettokens(i8* %0, i32* %2)
%5 = load i32, i32* %2
%6 = shl i32 %5, 3
%7 = add i32 %6, 8
%8 = call i8** @xrealloc(i8** %4, i32 %7)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
store i8* null, i8** %11
ret i8** %8
}
unsigned int compactaCaracteres(char char1, char char2) {
  unsigned int unit1 = 0;
  unit1 = char1 << 8;
  unit1 |= char2;
  return unit1;
}


x86 assembly (clang, -O0):
<compactaCaracteres>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compactaCaracteres(i8 signext %0, i8 signext %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
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 8
store i32 %8, i32* %5
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = load i32, i32* %5
%12 = or i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @compactaCaracteres(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = shl nsw i32 %3, 8
%5 = sext i8 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
void step_motor_on(void *stepmotor_address) {
  *((volatile int *)stepmotor_address + 5) = 1;
}


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

x86 assembly (clang, -O2):
<step_motor_on>:
movl   $0x1,0x14(%rdi)
ret

LLVM IR (-O0):
define void @step_motor_on(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 5
store volatile i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @step_motor_on(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 20
%3 = bitcast i8* %2 to i32*
store volatile i32 1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ task_stat(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                             char *);
char task_state(pid_t tgid, pid_t tid) {
  char state = 'Z';
  task_stat(tgid, tid, "%*d %*s %c", &state);
  return state;
}


x86 assembly (clang, -O0):
<task_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x5a,-0x9(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed1(%rip),%rdx
lea    -0x9(%rbp),%rcx
call   1030 <task_stat@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_state>:
push   %rax
movb   $0x5a,0x7(%rsp)
lea    0xee3(%rip),%rdx
lea    0x7(%rsp),%rcx
call   1030 <task_stat@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%*d %*s %c\00"
define signext i8 @task_state(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8 90, i8* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @task_stat(i32 %6, i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%9 = load i8, i8* %5
ret i8 %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"%*d %*s %c\00"
define signext i8 @task_state(i32 %0, i32 %1) {
%3 = alloca i8
store i8 90, i8* %3
%4 = call i32 @task_stat(i32 %0, i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8, i8* %3
ret i8 %5
}
double pdtrc(k, m)
int k;
double m;
{
  double v;
  if ((k < 0) || (m <= 0.0)) {
    mtherr("pdtrc", 1);
    return (0.0);
  }
  v = k + 1;
  return (igam(v, m));
}


x86 assembly (clang, -O0):
<pdtrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1148 <pdtrc+0x28>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1168 <pdtrc+0x48>
lea    0xeb1(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1191 <pdtrc+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    $0x2,%al
call   1030 <igam@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdtrc>:
push   %rax
test   %edi,%edi
js     114d <pdtrc+0x2d>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    114d <pdtrc+0x2d>
add    $0x1,%edi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mov    $0x2,%al
call   1030 <igam@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret
lea    0xeac(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pdtrc\00"
define double @pdtrc(i32 %0, double %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = fcmp ole double %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9, %2
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
store double 0.000000e+00, double* %3
br label %22
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
store double %17, double* %6
%18 = load double, double* %6
%19 = load double, double* %5
%20 = call i32 (double, double, ...) bitcast (i32 (...)* @igam to i32 (double, double, ...)*)(double %18, double %19)
%21 = sitofp i32 %20 to double
store double %21, double* %3
br label %22
22: ; preds = %14, %12
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
@.str = [6 x i8] c"pdtrc\00"
define double @pdtrc(i32 %0, double %1) {
%3 = icmp slt i32 %0, 0
%4 = fcmp ole double %1, 0.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
br label %13
8: ; preds = %2
%9 = add nuw nsw i32 %0, 1
%10 = sitofp i32 %9 to double
%11 = tail call i32 (double, double, ...) bitcast (i32 (...)* @igam to i32 (double, double, ...)*)(double %10, double %1)
%12 = sitofp i32 %11 to double
br label %13
13: ; preds = %8, %6
%14 = phi double [ 0.000000e+00, %6 ], [ %12, %8 ]
ret double %14
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double random_dist_flat() {
  double random_num;
  random_num = (double)rand() / RAND_MAX;
  return random_num;
}


x86 assembly (clang, -O0):
<random_dist_flat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebd(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_dist_flat>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @random_dist_flat() {
%1 = alloca double
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
store double %5, double* %1
%6 = load double, double* %1
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @random_dist_flat() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
int test_imm_C6uint16_mem(unsigned short *val) {
  return ((*val) & (-0xC6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C6uint16_mem>:
movzwl (%rdi),%eax
test   $0xff3a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C6uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -198
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
int lexicographic_sort(const char *a, const char *b) { return strcmp(a, b); }


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

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

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

LLVM IR (-O2):
define i32 @lexicographic_sort(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSEST(const char *the_title) { return any_decrqss(the_title, "-z"); }


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

x86 assembly (clang, -O2):
<rpt_DECSEST>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-z\00"
define i32 @rpt_DECSEST(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"-z\00"
define i32 @rpt_DECSEST(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_hx8(unsigned int);
void print_hx16(unsigned int u) {
  print_hx8(u >> 8);
  print_hx8(u);
}


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

x86 assembly (clang, -O2):
<print_hx16>:
push   %rbx
mov    %edi,%ebx
shr    $0x8,%edi
call   1030 <print_hx8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <print_hx8@plt>

LLVM IR (-O0):
define void @print_hx16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = call i32 @print_hx8(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @print_hx8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @print_hx16(i32 %0) {
%2 = lshr i32 %0, 8
%3 = tail call i32 @print_hx8(i32 %2)
%4 = tail call i32 @print_hx8(i32 %0)
ret void
}
/* Variables and functions */
unsigned int stb_hash(char *);
unsigned int stb__stb_sdict_hash(char *k) { return stb_hash(k); }


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

x86 assembly (clang, -O2):
<stb__stb_sdict_hash>:
jmp    1030 <stb_hash@plt>

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

LLVM IR (-O2):
define i32 @stb__stb_sdict_hash(i8* %0) {
%2 = tail call i32 @stb_hash(i8* %0)
ret i32 %2
}
void _set_ins(unsigned char *u) { u[2] |= (1 << 3); }


x86 assembly (clang, -O0):
<_set_ins>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
or     $0x8,%ecx
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_ins>:
orb    $0x8,0x2(%rdi)
ret

LLVM IR (-O0):
define void @_set_ins(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 8
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @_set_ins(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = or i8 %3, 8
store i8 %4, i8* %2
ret void
}
/* Variables and functions */
int usleep(int);
int __arch_udelay(int u) { return usleep(u); }


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

x86 assembly (clang, -O2):
<__arch_udelay>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define i32 @__arch_udelay(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t mbsrtowcs(int /*<<< orphan*/ *, char const **, size_t,
                 int /*<<< orphan*/ *);
size_t mbstowcs(wchar_t *dest, const char *src, size_t n) {
  const char **s = &src;
  return mbsrtowcs(dest, s, n, NULL);
}


x86 assembly (clang, -O0):
<mbstowcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <mbsrtowcs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbstowcs>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
xor    %ecx,%ecx
call   1030 <mbsrtowcs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @mbstowcs(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8**
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i8** %5, i8*** %7
%8 = load i32*, i32** %4
%9 = load i8**, i8*** %7
%10 = load i64, i64* %6
%11 = call i64 @mbsrtowcs(i32* %8, i8** %9, i64 %10, i32* null)
ret i64 %11
}

LLVM IR (-O2):
define i64 @mbstowcs(i32* %0, i8* %1, i64 %2) {
%4 = alloca i8*
store i8* %1, i8** %4
%5 = call i64 @mbsrtowcs(i32* %0, i8** %4, i64 %2, i32* null)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int get_int16(FILE *fp) { return (fgetc(fp) | (fgetc(fp) << 8)); }


x86 assembly (clang, -O0):
<get_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_int16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fgetc(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
%7 = shl i32 %6, 8
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_int16(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void version_string(char *dst) {
  snprintf(dst, (4 * 1024 - 32), "%s", "1.26.0");
}


x86 assembly (clang, -O0):
<version_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xfe0,%esi
lea    0xed4(%rip),%rdx
lea    0xed0(%rip),%rcx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_string>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
mov    $0xfe0,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"1.26.0\00"
define void @version_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @snprintf(i8* %3, i32 4064, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"1.26.0\00"
define void @version_string(i8* %0) {
%2 = tail call i32 @snprintf(i8* %0, i32 4064, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int STC3115_ReadByte(int);
int STC3115_WriteByte(int, int);
int STC3115_StopPowerSavingMode(void) {
  int res;
  res = STC3115_ReadByte(0x00);
  if (0 != 0)
    return (!0);
  res = STC3115_WriteByte(0x00, (res & ~0x01));
  if (res != 0)
    return (res);
  return (0);
}


x86 assembly (clang, -O0):
<STC3115_StopPowerSavingMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <STC3115_ReadByte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
and    $0xfffffffe,%esi
xor    %edi,%edi
call   1030 <STC3115_WriteByte@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1157 <STC3115_StopPowerSavingMode+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <STC3115_StopPowerSavingMode+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_StopPowerSavingMode>:
push   %rax
xor    %edi,%edi
call   1040 <STC3115_ReadByte@plt>
and    $0xfffffffe,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <STC3115_WriteByte@plt>

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

LLVM IR (-O2):
define i32 @STC3115_StopPowerSavingMode() {
%1 = tail call i32 @STC3115_ReadByte(i32 0)
%2 = and i32 %1, -2
%3 = tail call i32 @STC3115_WriteByte(i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_server_set_seq_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_server@%p::set_seq (rtpp_server_set_seq) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_server_set_seq_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_server_set_seq_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_server@%p::set_seq (rtpp_server_set_seq) is invoked after destruction\0A\00"
define void @rtpp_server_set_seq_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_server@%p::set_seq (rtpp_server_set_seq) is invoked after destruction\0A\00"
define void @rtpp_server_set_seq_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}