xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nReading a program\n");
  printf("is much easier\n");
  printf("if a standard form is used\n");
  printf("and each statement is written\n");
  printf("on a line by itself.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf09(%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
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0AReading a program\0A\00"
@.str.1 = [16 x i8] c"is much easier\0A\00"
@.str.2 = [28 x i8] c"if a standard form is used\0A\00"
@.str.3 = [31 x i8] c"and each statement is written\0A\00"
@.str.4 = [22 x i8] c"on a line by itself.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"\0AReading a program\00"
@str.5 = [15 x i8] c"is much easier\00"
@str.6 = [27 x i8] c"if a standard form is used\00"
@str.7 = [30 x i8] c"and each statement is written\00"
@str.8 = [21 x i8] c"on a line by itself.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef size_t uint64_t;
typedef int /*<<< orphan*/ record_size;

/* Variables and functions */
size_t SHA256_DIGEST_LENGTH;
size_t mi_sha256_encoded_size(size_t length, uint64_t record_size) {
  if (length == 0) {
    return 0u;
  } else {
    return sizeof(record_size) + length +
           SHA256_DIGEST_LENGTH *
               ((length + record_size - 1) / record_size - 1);
  }
}


x86 assembly (clang, -O0):
<mi_sha256_encoded_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <mi_sha256_encoded_size+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1162 <mi_sha256_encoded_size+0x62>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    $0x1,%rax
xor    %edx,%edx
divq   -0x18(%rbp)
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
sub    $0x1,%rdx
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_sha256_encoded_size>:
test   %rdi,%rdi
je     112e <mi_sha256_encoded_size+0x2e>
mov    0x2ed4(%rip),%rax
mov    (%rax),%rcx
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
add    $0x8,%rdi
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1134 <mi_sha256_encoded_size+0x34>
xor    %edx,%edx
div    %rsi
jmp    1138 <mi_sha256_encoded_size+0x38>
xor    %edi,%edi
mov    %rdi,%rax
ret
xor    %edx,%edx
div    %esi
add    $0xffffffffffffffff,%rax
imul   %rcx,%rax
add    %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
@SHA256_DIGEST_LENGTH = global i64 0
define i64 @mi_sha256_encoded_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 0, i64* %3
br label %22
9: ; preds = %2
%10 = load i64, i64* %4
%11 = add i64 8, %10
%12 = load i64, i64* @SHA256_DIGEST_LENGTH
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = add i64 %13, %14
%16 = sub i64 %15, 1
%17 = load i64, i64* %5
%18 = udiv i64 %16, %17
%19 = sub i64 %18, 1
%20 = mul i64 %12, %19
%21 = add i64 %11, %20
store i64 %21, i64* %3
br label %22
22: ; preds = %9, %8
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
@SHA256_DIGEST_LENGTH = global i64 0
define i64 @mi_sha256_encoded_size(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = add i64 %0, 8
%6 = load i64, i64* @SHA256_DIGEST_LENGTH
%7 = add i64 %0, -1
%8 = add i64 %7, %1
%9 = udiv i64 %8, %1
%10 = add i64 %9, -1
%11 = mul i64 %10, %6
%12 = add i64 %5, %11
br label %13
13: ; preds = %2, %4
%14 = phi i64 [ %12, %4 ], [ 0, %2 ]
ret i64 %14
}
int bar(void) {
  int a[16];
  __builtin_memset(a, 0, sizeof(a));
  return a[3];
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca [16 x i32]
%2 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 0
}
/* Variables and functions */
int pow(float, int);
float volume(float r) { return (4 / 3) * 3.141596 * pow(r, 3); }


x86 assembly (clang, -O0):
<volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume>:
push   %rax
mov    $0x3,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @volume(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @pow(float %3, i32 3)
%5 = sitofp i32 %4 to double
%6 = fmul double 0x400921FD1569F490, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @volume(float %0) {
%2 = tail call i32 @pow(float %0, i32 3)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x400921FD1569F490
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void puglPrintTestUsage(const char *prog, const char *posHelp) {
  printf("Usage: %s [OPTION]... %s\n\n"
         "  -a  Enable anti-aliasing\n"
         "  -c  Continuously animate and draw\n"
         "  -d  Directly draw to window (no double-buffering)\n"
         "  -e  Enable platform error-checking\n"
         "  -f  Fast drawing, explicitly disable vertical sync\n"
         "  -h  Display this help\n"
         "  -i  Ignore key repeat\n"
         "  -v  Print verbose output\n"
         "  -r  Resizable window\n"
         "  -s  Explicitly enable vertical sync\n",
         prog, posHelp);
}


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

x86 assembly (clang, -O2):
<puglPrintTestUsage>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [368 x i8] c"Usage: %s [OPTION]... %s\0A\0A -a Enable anti-aliasing\0A -c Continuously animate and draw\0A -d Directly draw to window (no double-buffering)\0A -e Enable platform error-checking\0A -f Fast drawing, explicitly disable vertical sync\0A -h Display this help\0A -i Ignore key repeat\0A -v Print verbose output\0A -r Resizable window\0A -s Explicitly enable vertical sync\0A\00"
define void @puglPrintTestUsage(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 @printf(i8* getelementptr inbounds ([368 x i8], [368 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [368 x i8] c"Usage: %s [OPTION]... %s\0A\0A -a Enable anti-aliasing\0A -c Continuously animate and draw\0A -d Directly draw to window (no double-buffering)\0A -e Enable platform error-checking\0A -f Fast drawing, explicitly disable vertical sync\0A -h Display this help\0A -i Ignore key repeat\0A -v Print verbose output\0A -r Resizable window\0A -s Explicitly enable vertical sync\0A\00"
define void @puglPrintTestUsage(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([368 x i8], [368 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nHello World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0AHello World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"\0AHello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void Swap(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @Swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @Swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
unsigned int swab32(unsigned int data) {
  unsigned int res = 0;
  res = (data & 0x000000ff) << 24 | (data & 0x0000ff00) << 8 |
        (data & 0x00ff0000) >> 8 | (data & 0xff000000) >> 24;
  return res;
}


x86 assembly (clang, -O0):
<swab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swab32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = shl i32 %5, 24
%7 = load i32, i32* %2
%8 = and i32 %7, 65280
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 16711680
%13 = lshr i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, -16777216
%17 = lshr i32 %16, 24
%18 = or i32 %14, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @swab32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int get_options(int, char *const *);
int /*<<< orphan*/ help();
int start_tasks();
int main(int argc, char *const *argv) {
  int ret;
  ret = get_options(argc, argv);
  if (ret < 0) {
    help();
    exit(-1);
  }
  ret = start_tasks();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <get_options@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1180 <main+0x40>
mov    $0x0,%al
call   1040 <help@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1030 <start_tasks@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <get_options@plt>
test   %eax,%eax
js     1155 <main+0x15>
xor    %eax,%eax
call   1030 <start_tasks@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <help@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @get_options(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 (...) @help()
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = call i32 (...) @start_tasks()
store i32 %16, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @get_options(i32 %0, i8** %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 (...) @help()
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = tail call i32 (...) @start_tasks()
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpgrp();
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
void print() {
  pid_t pid = getpid();
  pid_t grp = getpgrp();
  printf("child %u: %u\n", pid, grp);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getpgrp@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getpgrp@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"child %u: %u\0A\00"
define void @print() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %1
%4 = call i32 (...) @getpgrp()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"child %u: %u\0A\00"
define void @print() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getpgrp()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
BOOST_AUTO_TEST_CASE(exp) { TESTCASE1(exp, 0, 1); }


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

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1)
ret i32 undef
}
void cvt_s_l(long long *source, float *dest) { *dest = *source; }


x86 assembly (clang, -O0):
<cvt_s_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_s_l>:
cvtsi2ssq (%rdi),%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @cvt_s_l(i64* %0, float* %1) {
%3 = alloca i64*
%4 = alloca float*
store i64* %0, i64** %3
store float* %1, float** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = load float*, float** %4
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @cvt_s_l(i64* nocapture %0, float* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = sitofp i64 %3 to float
store float %4, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chronometer_init();
int /*<<< orphan*/ kernel_init();
int /*<<< orphan*/ network_init();
int /*<<< orphan*/ shell_interpreter_init();
int /*<<< orphan*/ shell_program_init();
int /*<<< orphan*/ thermometer_init();
int /*<<< orphan*/ touchmanager_init();
void sofware_init() {
  kernel_init();
  thermometer_init();
  chronometer_init();
  shell_interpreter_init();
  shell_program_init();
  touchmanager_init();
  network_init();
}


x86 assembly (clang, -O0):
<sofware_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <kernel_init@plt>
mov    $0x0,%al
call   1050 <thermometer_init@plt>
mov    $0x0,%al
call   1090 <chronometer_init@plt>
mov    $0x0,%al
call   1040 <shell_interpreter_init@plt>
mov    $0x0,%al
call   1060 <shell_program_init@plt>
mov    $0x0,%al
call   1080 <touchmanager_init@plt>
mov    $0x0,%al
call   1070 <network_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sofware_init>:
push   %rax
xor    %eax,%eax
call   1030 <kernel_init@plt>
xor    %eax,%eax
call   1050 <thermometer_init@plt>
xor    %eax,%eax
call   1090 <chronometer_init@plt>
xor    %eax,%eax
call   1040 <shell_interpreter_init@plt>
xor    %eax,%eax
call   1060 <shell_program_init@plt>
xor    %eax,%eax
call   1080 <touchmanager_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <network_init@plt>

LLVM IR (-O0):
define void @sofware_init() {
%1 = call i32 (...) @kernel_init()
%2 = call i32 (...) @thermometer_init()
%3 = call i32 (...) @chronometer_init()
%4 = call i32 (...) @shell_interpreter_init()
%5 = call i32 (...) @shell_program_init()
%6 = call i32 (...) @touchmanager_init()
%7 = call i32 (...) @network_init()
ret void
}

LLVM IR (-O2):
define void @sofware_init() {
%1 = tail call i32 (...) @kernel_init()
%2 = tail call i32 (...) @thermometer_init()
%3 = tail call i32 (...) @chronometer_init()
%4 = tail call i32 (...) @shell_interpreter_init()
%5 = tail call i32 (...) @shell_program_init()
%6 = tail call i32 (...) @touchmanager_init()
%7 = tail call i32 (...) @network_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int /*<<< orphan*/ replace();
int main(int x) {
  f();
  if (1) {
    replace();
  }
  g();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @f()
%4 = call i32 (...) @replace()
%5 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @replace()
%4 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int EtatRelai(int);
int /*<<< orphan*/ printf(char *);
void testEtatRelai() {
  int index;
  int result = EtatRelai(index);
  if (1) {
    printf("%%TEST_FAILED%% time=0 testname=testEtatRelai (Test_gestiongpio) "
           "message=error message sample\n");
  }
}


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

x86 assembly (clang, -O2):
<testEtatRelai>:
push   %rax
call   1040 <EtatRelai@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [95 x i8] c"%%TEST_FAILED%% time=0 testname=testEtatRelai (Test_gestiongpio) message=error message sample\0A\00"
define void @testEtatRelai() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = call i32 @EtatRelai(i32 %3)
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [95 x i8] c"%%TEST_FAILED%% time=0 testname=testEtatRelai (Test_gestiongpio) message=error message sample\0A\00"
define void @testEtatRelai() {
%1 = tail call i32 @EtatRelai(i32 undef)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned make_prime_bound(unsigned nr) {
  unsigned long long nr64 = nr;
  unsigned long long x = 1;
  nr = 1;
  while (x <= nr64) {
    x <<= 2;
    nr <<= 1;
  }
  return nr;
}


x86 assembly (clang, -O0):
<make_prime_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1145 <make_prime_bound+0x45>
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111d <make_prime_bound+0x1d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_prime_bound>:
test   %edi,%edi
je     111c <make_prime_bound+0x1c>
mov    %edi,%ecx
mov    $0x1,%eax
mov    $0x1,%edx
shl    $0x2,%rdx
add    %eax,%eax
cmp    %rcx,%rdx
jbe    1110 <make_prime_bound+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @make_prime_bound(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
store i64 %6, i64* %3
store i64 1, i64* %4
store i32 1, i32* %2
br label %7
7: ; preds = %11, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = icmp ule i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i64, i64* %4
%13 = shl i64 %12, 2
store i64 %13, i64* %4
%14 = load i32, i32* %2
%15 = shl i32 %14, 1
store i32 %15, i32* %2
br label %7
16: ; preds = %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @make_prime_bound(i32 %0) {
%2 = zext i32 %0 to i64
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 1, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = shl i64 %5, 2
%8 = shl i32 %6, 1
%9 = icmp ugt i64 %7, %2
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %11
}
void _Jv_AllocObjectNoFinalizer(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_AllocObjectNoFinalizer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assume(int);
int /*<<< orphan*/ static_assert(int);
void main() {
  int n;
  assume(n > 0);
  int j = n;
  int k = n;
  int l = 0;
  while (j > l) {
    j--;
    k--;
  }
  static_assert(k >= l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    116f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <main+0x2c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <static_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <static_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assume(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %2
%10 = load i32, i32* %1
store i32 %10, i32* %3
store i32 0, i32* %4
br label %11
11: ; preds = %15, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
br label %11
20: ; preds = %11
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = icmp sge i32 %21, %22
%24 = zext i1 %23 to i32
%25 = call i32 @static_assert(i32 %24)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @static_assert(i32 0)
ret void
}
void mlx5_vhca_event_start(struct mlx5_core_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.mlx5_core_dev = type opaque
define void @mlx5_vhca_event_start(%struct.mlx5_core_dev* nocapture %0) {
ret void
}
/* Variables and functions */
double _sin(double);
double cos(double);
void sincos(double x, double *s, double *c) {
  *s = _sin(x);
  *c = cos(x);
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <_sin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <_sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = call double @_sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @_sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
float powf(float x, float y) { return 0.0; }


x86 assembly (clang, -O0):
<powf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @powf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @powf(float %0, float %1) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void shutdownReset(void) { cPrintf("Resetting Shutdown Device...\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Resetting Shutdown Device...\0A\00"
define void @shutdownReset() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Resetting Shutdown Device...\0A\00"
define void @shutdownReset() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int check_login(char *user, char *pass, char *username, char *password) {
  if (strcmp(user, username) != 0 || strcmp(pass, password) != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1156 <check_login+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1162 <check_login+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <check_login+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_login>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    113f <check_login+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @check_login(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @strcmp(i8* %0, i8* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %1, i8* %3)
%9 = icmp ne i64 %8, 0
%10 = sext i1 %9 to i32
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ -1, %4 ], [ %10, %7 ]
ret i32 %12
}
unsigned char rrotbmap(unsigned char bmap) {
  return (((bmap & 0x01u) << 6) | ((bmap & 0x7fu) >> 1));
}


x86 assembly (clang, -O0):
<rrotbmap>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
shl    $0x6,%eax
movzbl -0x1(%rbp),%ecx
and    $0x7f,%ecx
shr    $0x1,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrotbmap>:
mov    %edi,%eax
shl    $0x6,%al
and    $0x40,%al
shr    %dil
and    $0x3f,%dil
or     %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @rrotbmap(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = shl i32 %5, 6
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 127
%10 = lshr i32 %9, 1
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @rrotbmap(i8 zeroext %0) {
%2 = shl i8 %0, 6
%3 = and i8 %2, 64
%4 = lshr i8 %0, 1
%5 = and i8 %4, 63
%6 = or i8 %3, %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ print_bits(int);
int main() {
  print_bits(16);
  print_bits(-16);
  print_bits(30);
  print_bits((30 & (-16)) + 16);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @print_bits(i32 16)
%2 = call i32 @print_bits(i32 -16)
%3 = call i32 @print_bits(i32 30)
%4 = call i32 @print_bits(i32 32)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_bits(i32 16)
%2 = tail call i32 @print_bits(i32 -16)
%3 = tail call i32 @print_bits(i32 30)
%4 = tail call i32 @print_bits(i32 32)
ret i32 0
}
int newline(char c) { return ((c == '\n') || (c == '\r')); }


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1129 <newline+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
cmp    $0xa,%dil
sete   %al
cmp    $0xd,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @newline(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 13
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void najeAddReference(char *name) {}


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

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

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

LLVM IR (-O2):
define void @najeAddReference(i8* nocapture %0) {
ret void
}
void divsBIL() {}


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

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

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

LLVM IR (-O2):
define void @divsBIL() {
ret void
}
int color_offset_f1(int x, int y) {
  return ((y << 10) - (((x << 10) * 447) / 413) + (22 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x1bf,%eax,%eax
mov    $0x19d,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
add    $0x5800,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f1>:
shl    $0xa,%esi
imul   $0x6fc00,%edi,%eax
cltq
imul   $0xffffffffb0a899b9,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0x5800,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 447
%10 = sdiv i32 %9, 413
%11 = sub nsw i32 %6, %10
%12 = add nsw i32 %11, 22528
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f1(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 457728
%5 = sdiv i32 %4, -413
%6 = add i32 %3, 22528
%7 = add i32 %6, %5
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ return_misaligned_int3();
int /*<<< orphan*/ take_misaligned_int3(int /*<<< orphan*/);
void test_misaligned_int3() { take_misaligned_int3(return_misaligned_int3()); }


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

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

LLVM IR (-O0):
define void @test_misaligned_int3() {
%1 = call i32 (...) @return_misaligned_int3()
%2 = call i32 @take_misaligned_int3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_misaligned_int3() {
%1 = tail call i32 (...) @return_misaligned_int3()
%2 = tail call i32 @take_misaligned_int3(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
void I2CMasterIntDisable(unsigned long ulBase) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = 0;
}


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

x86 assembly (clang, -O2):
<I2CMasterIntDisable>:
push   %rbx
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
movq   $0x0,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CMasterIntDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CMasterBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 16
%8 = inttoptr i64 %7 to i64*
store volatile i64 0, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntDisable(i64 %0) {
%2 = tail call i32 @I2CMasterBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MS_SYNC;
int /*<<< orphan*/ msync(void *, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, size_t);
void sgo_shmem_close(void *mem, size_t size) {
  size_t aligned = size & ~0xFFF + 0x1000;
  msync(mem, aligned, MS_SYNC);
  munmap(mem, size);
}


x86 assembly (clang, -O0):
<sgo_shmem_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
call   1030 <msync@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgo_shmem_close>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <msync@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <munmap@plt>

LLVM IR (-O0):
@MS_SYNC = global i32 0
define void @sgo_shmem_close(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = and i64 %6, 0
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = load i32, i32* @MS_SYNC
%11 = call i32 @msync(i8* %8, i64 %9, i32 %10)
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @munmap(i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
@MS_SYNC = global i32 0
define void @sgo_shmem_close(i8* %0, i64 %1) {
%3 = load i32, i32* @MS_SYNC
%4 = tail call i32 @msync(i8* %0, i64 0, i32 %3)
%5 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
void gmpint_unset(mpz_t *op) { mpz_clear(*op); }


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

x86 assembly (clang, -O2):
<gmpint_unset>:
mov    (%rdi),%edi
jmp    1030 <mpz_clear@plt>

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

LLVM IR (-O2):
define void @gmpint_unset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mpz_clear(i32 %2)
ret void
}
/* Variables and functions */
unsigned char *_EncodeStr(unsigned char *, char const *, unsigned int);
unsigned char *SEGGER_SYSVIEW_EncodeString(unsigned char *pPayload,
                                           const char *s, unsigned MaxLen) {
  return _EncodeStr(pPayload, s, MaxLen);
}


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

x86 assembly (clang, -O2):
<SEGGER_SYSVIEW_EncodeString>:
jmp    1030 <_EncodeStr@plt>

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

LLVM IR (-O2):
define i8* @SEGGER_SYSVIEW_EncodeString(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @_EncodeStr(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fnoret1();
int call_noret1(void) { fnoret1(); }


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

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

LLVM IR (-O0):
define i32 @call_noret1() {
%1 = alloca i32
%2 = call i32 (...) @fnoret1()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @call_noret1() {
%1 = tail call i32 (...) @fnoret1()
ret i32 undef
}
/* Variables and functions */
int libiso_msgs__text_to_sev(char *, int *, int /*<<< orphan*/);
int iso_text_to_sev(char *severity_name, int *sevno) {
  int ret;
  ret = libiso_msgs__text_to_sev(severity_name, sevno, 0);
  if (ret <= 0)
    *sevno = 0x70000000;
  return ret;
}


x86 assembly (clang, -O0):
<iso_text_to_sev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <libiso_msgs__text_to_sev@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1146 <iso_text_to_sev+0x36>
mov    -0x10(%rbp),%rax
movl   $0x70000000,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_text_to_sev>:
push   %rbx
mov    %rsi,%rbx
xor    %edx,%edx
call   1030 <libiso_msgs__text_to_sev@plt>
test   %eax,%eax
jle    1121 <iso_text_to_sev+0x11>
pop    %rbx
ret
movl   $0x70000000,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iso_text_to_sev(i8* %0, i32* %1) {
%3 = tail call i32 @libiso_msgs__text_to_sev(i8* %0, i32* %1, i32 0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 1879048192, i32* %1
br label %6
6: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int is_file(const char *name) {
  FILE *fp;
  if ((fp = fopen(name, "rb"))) {
    fclose(fp);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <is_file+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <is_file+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <is_file+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32 @is_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %4
%10 = call i32 @fclose(i32* %9)
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @is_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}