xunge/DecIR huggingface dataset:
int yuiPercentOf(int value, int percent) { return value * percent / 100; }


x86 assembly (clang, -O0):
<yuiPercentOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuiPercentOf>:
imul   %esi,%edi
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @yuiPercentOf(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 = mul nsw i32 %5, %6
%8 = sdiv i32 %7, 100
ret i32 %8
}

LLVM IR (-O2):
define i32 @yuiPercentOf(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sdiv i32 %3, 100
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *time_str(time_t epoch) {
  static char str[100];
  struct tm ts = *localtime(&epoch);
  strftime(str, 100, "%d %b %d %H:%M %Y", &ts);
  return str;
}


x86 assembly (clang, -O0):
<time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    0x2f00(%rip),%rdi
mov    $0x64,%esi
lea    0xeb4(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <strftime@plt>
lea    0x2ee4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_str>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
lea    0x2f00(%rip),%rbx
lea    0xeb9(%rip),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@time_str.str = internal global [100 x i8] zeroinitializer
@.str = [18 x i8] c"%d %b %d %H:%M %Y\00"
define i8* @time_str(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
store i32 %0, i32* %2
%4 = call %struct.tm* @localtime(i32* %2)
%5 = bitcast %struct.tm* %3 to i8*
%6 = bitcast %struct.tm* %4 to i8*
%7 = call i32 @strftime(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @time_str.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @time_str.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@time_str.str = internal global [100 x i8] zeroinitializer
@.str = [18 x i8] c"%d %b %d %H:%M %Y\00"
define i8* @time_str(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
store i32 %0, i32* %2
%4 = bitcast %struct.tm* %3 to i8*
%5 = call %struct.tm* @localtime(i32* %2)
%6 = getelementptr %struct.tm, %struct.tm* %5, i64 0, i32 0
%7 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%8 = load i32, i32* %6
store i32 %8, i32* %7
%9 = call i32 @strftime(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @time_str.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @time_str.str, i64 0, i64 0)
}
void adis16204_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16204_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
void gtk_image_new_from_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_new_from_pixbuf() {
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=600 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD=release TARGET_PLATFORM=sc8830 "
         "MALI_PLATFORM=sc8830 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 "
         "USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= "
         "USING_GPU_UTILIZATION=1 USING_DVFS=y MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [299 x i8] c"malidrv: API_VERSION=600 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD=release TARGET_PLATFORM=sc8830 MALI_PLATFORM=sc8830 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_DVFS=y MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [299 x i8] c"malidrv: API_VERSION=600 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD=release TARGET_PLATFORM=sc8830 MALI_PLATFORM=sc8830 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_DVFS=y MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0)
}
char *BS2P_EatWhiteOnly(char *s) {
  while (*s && (*s <= ' '))
    s++;
  return (s);
}


x86 assembly (clang, -O0):
<BS2P_EatWhiteOnly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <BS2P_EatWhiteOnly+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <BS2P_EatWhiteOnly+0x3d>
jmp    114e <BS2P_EatWhiteOnly+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <BS2P_EatWhiteOnly+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BS2P_EatWhiteOnly>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <BS2P_EatWhiteOnly+0x21>
cmp    $0x21,%cl
jl     1110 <BS2P_EatWhiteOnly+0x10>
ret

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

LLVM IR (-O2):
define i8* @BS2P_EatWhiteOnly(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = icmp slt i8 %4, 33
%7 = and i1 %5, %6
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
void *malloc(size_t);
void *v_malloc(size_t length) { return malloc(length); }


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

x86 assembly (clang, -O2):
<v_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @v_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void local_mcu_Cpu_shutdown__E() { printf("Cpu.shutdown\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Cpu.shutdown\00"
define void @local_mcu_Cpu_shutdown__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
char *strcat(char *to, const char *from) {
  const char *src;
  char *dst;
  src = from;
  dst = to;
  while (*dst++)
    ;
  --dst;
  while ((*dst++ = *src++))
    ;
  return to;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strcat+0x39>
jmp    111c <strcat+0x1c>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1174 <strcat+0x74>
jmp    1145 <strcat+0x45>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int someNumber() { return 156; }


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

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

LLVM IR (-O0):
define i32 @someNumber() {
ret i32 156
}

LLVM IR (-O2):
define i32 @someNumber() {
ret i32 156
}
int FRGL_CodecVFW_Init() { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @FRGL_CodecVFW_Init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void kill_error() { perror("kill error"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"kill error\00"
define void @kill_error() {
%1 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"kill error\00"
define void @kill_error() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popup_notify(int, char *);
void commandline_help(void) {
  popup_notify(1,
               "The only command line parameter accepted is the file name of "
               "the\nconfiguration file. Leave empty to create a default one. "
               "Servers\ncan be configured from within f-irc (press F8).");
}


x86 assembly (clang, -O0):
<commandline_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <popup_notify@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandline_help>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <popup_notify@plt>

LLVM IR (-O0):
@.str = [178 x i8] c"The only command line parameter accepted is the file name of the\0Aconfiguration file. Leave empty to create a default one. Servers\0Acan be configured from within f-irc (press F8).\00"
define void @commandline_help() {
%1 = call i32 @popup_notify(i32 1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [178 x i8] c"The only command line parameter accepted is the file name of the\0Aconfiguration file. Leave empty to create a default one. Servers\0Acan be configured from within f-irc (press F8).\00"
define void @commandline_help() {
%1 = tail call i32 @popup_notify(i32 1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}
int e(float a, float b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @e(float %0, float %1) {
ret i32 0
}
int main() {
  while (1.0L)
    2;
  while (3.0) {
    return 4;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ gmx_tcaf(int, char **);
int main(int argc, char *argv[]) {
  gmx_tcaf(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_tcaf(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Debugger();
int /*<<< orphan*/ ShowErrorMessage(char *, char *);
int /*<<< orphan*/ error();
int /*<<< orphan*/ kWriteLog(char *);
void TemplateFault(char *msg) {
  Debugger();
  ShowErrorMessage("OTHER FAULT", msg);
  kWriteLog(msg);
  error();
}


x86 assembly (clang, -O0):
<TemplateFault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Debugger@plt>
mov    -0x8(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1060 <ShowErrorMessage@plt>
mov    -0x8(%rbp),%rdi
call   1040 <kWriteLog@plt>
mov    $0x0,%al
call   1050 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TemplateFault>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Debugger@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1060 <ShowErrorMessage@plt>
mov    %rbx,%rdi
call   1040 <kWriteLog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"OTHER FAULT\00"
define void @TemplateFault(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @Debugger()
%4 = load i8*, i8** %2
%5 = call i32 @ShowErrorMessage(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @kWriteLog(i8* %6)
%8 = call i32 (...) @error()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"OTHER FAULT\00"
define void @TemplateFault(i8* %0) {
%2 = tail call i32 (...) @Debugger()
%3 = tail call i32 @ShowErrorMessage(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @kWriteLog(i8* %0)
%5 = tail call i32 (...) @error()
ret void
}
void avio_rl64() {}


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

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

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

LLVM IR (-O2):
define void @avio_rl64() {
ret void
}
/* Variables and functions */
double MeanObliquity();
double NObliquity();
double TrueObliquity(void) {
  double eps, eps0, deps;
  eps0 = MeanObliquity();
  deps = NObliquity();
  eps = eps0 + deps;
  return (eps);
}


x86 assembly (clang, -O0):
<TrueObliquity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <MeanObliquity@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <NObliquity@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrueObliquity>:
push   %rax
xor    %eax,%eax
call   1030 <MeanObliquity@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <NObliquity@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @TrueObliquity() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call double (...) @MeanObliquity()
store double %4, double* %2
%5 = call double (...) @NObliquity()
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fadd double %6, %7
store double %8, double* %1
%9 = load double, double* %1
ret double %9
}

LLVM IR (-O2):
define double @TrueObliquity() {
%1 = tail call double (...) @MeanObliquity()
%2 = tail call double (...) @NObliquity()
%3 = fadd double %1, %2
ret double %3
}
void set_kernel_text_ro(void) {}


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

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

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

LLVM IR (-O2):
define void @set_kernel_text_ro() {
ret void
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s[] = "I am Michael";
  printf("%d\n", any(s, "l"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6c65616863694d,%rax
mov    %rax,0xd(%rsp)
movabs $0x63694d206d612049,%rax
4d 69 63
mov    %rax,0x8(%rsp)
lea    0xec2(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1040 <any@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [13 x i8] c"I am Michael\00"
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [2 x i8] c"l\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = bitcast [13 x i8]* %1 to i8*
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = call i32 @any(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [13 x i8] c"I am Michael\00"
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [2 x i8] c"l\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @any(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ oops(char);
void cmd_boot(void) { oops('boot'); }


x86 assembly (clang, -O0):
<cmd_boot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x74,%edi
call   1030 <oops@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_boot>:
mov    $0x74,%edi
jmp    1030 <oops@plt>

LLVM IR (-O0):
define void @cmd_boot() {
%1 = call i32 @oops(i8 signext 116)
ret void
}

LLVM IR (-O2):
define void @cmd_boot() {
%1 = tail call i32 @oops(i8 signext 116)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIO5_Combined_16_31_DriverIRQHandler();
__attribute__((weak)) void GPIO5_Combined_16_31_IRQHandler(void) {
  GPIO5_Combined_16_31_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO5_Combined_16_31_IRQHandler() {
%1 = call i32 (...) @GPIO5_Combined_16_31_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO5_Combined_16_31_IRQHandler() {
%1 = tail call i32 (...) @GPIO5_Combined_16_31_DriverIRQHandler()
ret void
}
void curvei_(n) int *n;
{ curveit((short)*n); }


x86 assembly (clang, -O0):
<curvei_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movswl %ax,%edi
mov    $0x0,%al
call   1030 <curveit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curvei_>:
movswl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <curveit@plt>

LLVM IR (-O0):
define void @curvei_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i16
%6 = sext i16 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @curveit to i32 (i32, ...)*)(i32 %6)
ret void
}

LLVM IR (-O2):
define void @curvei_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = ashr exact i32 %3, 16
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @curveit to i32 (i32, ...)*)(i32 %4)
ret void
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n;
  printf("n=");
  scanf("%d", &n);
  printf("f(n)=%d\n", f(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <f@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"n=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"f(n)=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @f(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_f3();
int /*<<< orphan*/ take_struct_f3(int /*<<< orphan*/);
void test_struct_f3() { take_struct_f3(return_struct_f3()); }


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

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

LLVM IR (-O0):
define void @test_struct_f3() {
%1 = call i32 (...) @return_struct_f3()
%2 = call i32 @take_struct_f3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_f3() {
%1 = tail call i32 (...) @return_struct_f3()
%2 = tail call i32 @take_struct_f3(i32 %1)
ret void
}
int get_inc(int mode) {
  int inc = (mode >> 11) & 7;
  if (inc != 0) {
    if (inc != 7)
      inc--;
    inc = 1 << inc;
    if (mode & 0x8000)
      inc = -inc;
  }
  return inc;
}


x86 assembly (clang, -O0):
<get_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xb,%eax
and    $0x7,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115b <get_inc+0x5b>
cmpl   $0x7,-0x8(%rbp)
je     1130 <get_inc+0x30>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1156 <get_inc+0x56>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    115b <get_inc+0x5b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_inc>:
mov    %edi,%eax
shr    $0xb,%eax
and    $0x7,%eax
je     1128 <get_inc+0x28>
cmp    $0x7,%eax
je     1112 <get_inc+0x12>
add    $0xffffffff,%eax
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
mov    %edx,%eax
neg    %eax
test   $0x8000,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_inc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 11
%6 = and i32 %5, 7
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 7
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = shl i32 1, %16
store i32 %17, i32* %3
%18 = load i32, i32* %2
%19 = and i32 %18, 32768
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = load i32, i32* %3
%23 = sub nsw i32 0, %22
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %15
br label %25
25: ; preds = %24, %1
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_inc(i32 %0) {
%2 = lshr i32 %0, 11
%3 = and i32 %2, 7
switch i32 %3, label %4 [
i32 0, label %13
i32 7, label %6
]
4: ; preds = %1
%5 = add nsw i32 %3, -1
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %3, %1 ]
%8 = shl nuw nsw i32 1, %7
%9 = and i32 %0, 32768
%10 = icmp eq i32 %9, 0
%11 = sub nsw i32 0, %8
%12 = select i1 %10, i32 %8, i32 %11
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ %3, %1 ], [ %12, %6 ]
ret i32 %14
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, struct perf_event_attr *, int /*<<< orphan*/, int, int,
            unsigned long);
int perf_event_open(struct perf_event_attr *hw_event_uptr, pid_t pid, int cpu,
                    int group_fd, unsigned long flags) {
  return syscall(298, hw_event_uptr, pid, cpu, group_fd, flags);
}


x86 assembly (clang, -O0):
<perf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    $0x12a,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x12a,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i64, i64* %10
%16 = call i32 @syscall(i32 298, %struct.perf_event_attr* %11, i32 %12, i32 %13, i32 %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = tail call i32 @syscall(i32 298, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %6
}
/* Variables and functions */
float noise3(float, float, float);
float lovrMathNoise3(float x, float y, float z) {
  return noise3(x, y, z) * .5f + .5f;
}


x86 assembly (clang, -O0):
<lovrMathNoise3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <noise3@plt>
movss  0xebd(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lovrMathNoise3>:
push   %rax
call   1030 <noise3@plt>
movss  0xee2(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @lovrMathNoise3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @noise3(float %7, float %8, float %9)
%11 = call float @llvm.fmuladd.f32(float %10, float 5.000000e-01, float 5.000000e-01)
ret float %11
}

LLVM IR (-O2):
define float @lovrMathNoise3(float %0, float %1, float %2) {
%4 = tail call float @noise3(float %0, float %1, float %2)
%5 = tail call float @llvm.fmuladd.f32(float %4, float 5.000000e-01, float 5.000000e-01)
ret float %5
}
/* Variables and functions */
void Sys_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_Init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_1_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_int8_be(const uint8_t *src, uint32_t offs,
                                    int8_t *dst) {
  uint8_t tmp = ivory_serialize_unpack_prim_1_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_int8_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <ivory_serialize_unpack_prim_1_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_int8_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1040 <ivory_serialize_unpack_prim_1_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_int8_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_1_be(i32* %11)
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = call i32 @memcpy(i32* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_int8_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_1_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
int ade7854_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @ade7854_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
int test_imm_E9uint16_reg(unsigned short val) {
  return ((val) & (0xE9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E9uint16_reg>:
test   $0xe9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E9uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 233
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ceilQuotient(int numerator, int denominator) {
  if (numerator % denominator == 0)
    return numerator / denominator;
  else
    return numerator / denominator + 1;
}


x86 assembly (clang, -O0):
<ceilQuotient>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1129 <ceilQuotient+0x29>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1136 <ceilQuotient+0x36>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilQuotient>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ceilQuotient(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = srem i32 %6, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
store i32 %13, i32* %3
br label %19
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sdiv i32 %15, %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %14, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ceilQuotient(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp ne i32 %3, 0
%5 = sdiv i32 %0, %1
%6 = zext i1 %4 to i32
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand_double(void) { return (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_double() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_double() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
int leftmost_one(unsigned x) {
  x |= x >> 16;
  x |= x >> 8;
  x |= x >> 4;
  x |= x >> 2;
  x |= x >> 1;
  return x ^ (x >> 1);
}


x86 assembly (clang, -O0):
<leftmost_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftmost_one>:
mov    %edi,%eax
shr    $0x10,%eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    %edx
or     %ecx,%edx
mov    %edx,%eax
shr    %eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @leftmost_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 2
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 1
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = lshr i32 %24, 1
%26 = xor i32 %23, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @leftmost_one(i32 %0) {
%2 = lshr i32 %0, 16
%3 = or i32 %2, %0
%4 = lshr i32 %3, 8
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 2
%9 = or i32 %8, %7
%10 = lshr i32 %9, 1
%11 = or i32 %10, %9
%12 = lshr i32 %11, 1
%13 = xor i32 %12, %11
ret i32 %13
}
/* Variables and functions */
double acos(double);
double dot(double const *, double const *);
double max(int, int /*<<< orphan*/);
int /*<<< orphan*/ min(double, int);
double norm(double const *);
double angle(const double *u, const double *v) {
  double r = dot(u, v) / norm(u) / norm(v);
  r = max(-1., min(r, 1.));
  return acos(r);
}


x86 assembly (clang, -O0):
<angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <dot@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <norm@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <norm@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%edi
call   1040 <min@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   1050 <max@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <acos@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <dot@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1070 <norm@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %r14,%rdi
call   1070 <norm@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    $0x1,%edi
call   1040 <min@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   1050 <max@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <acos@plt>

LLVM IR (-O0):
define double @angle(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = call double @dot(double* %6, double* %7)
%9 = load double*, double** %3
%10 = call double @norm(double* %9)
%11 = fdiv double %8, %10
%12 = load double*, double** %4
%13 = call double @norm(double* %12)
%14 = fdiv double %11, %13
store double %14, double* %5
%15 = load double, double* %5
%16 = call i32 @min(double %15, i32 1)
%17 = call double @max(i32 -1, i32 %16)
store double %17, double* %5
%18 = load double, double* %5
%19 = call double @acos(double %18)
ret double %19
}

LLVM IR (-O2):
define double @angle(double* %0, double* %1) {
%3 = tail call double @dot(double* %0, double* %1)
%4 = tail call double @norm(double* %0)
%5 = fdiv double %3, %4
%6 = tail call double @norm(double* %1)
%7 = fdiv double %5, %6
%8 = tail call i32 @min(double %7, i32 1)
%9 = tail call double @max(i32 -1, i32 %8)
%10 = tail call double @acos(double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ e_shxri(int, int, int);
void e_shrri(int r, int i) { e_shxri(r, i, 5); }


x86 assembly (clang, -O0):
<e_shrri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x5,%edx
call   1030 <e_shxri@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_shrri>:
mov    $0x5,%edx
jmp    1030 <e_shxri@plt>

LLVM IR (-O0):
define void @e_shrri(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 = call i32 @e_shxri(i32 %5, i32 %6, i32 5)
ret void
}

LLVM IR (-O2):
define void @e_shrri(i32 %0, i32 %1) {
%3 = tail call i32 @e_shxri(i32 %0, i32 %1, i32 5)
ret void
}
/* Variables and functions */
int port_byte_in(int);
int /*<<< orphan*/ port_byte_out(int, int);
int get_cursor_offset() {
  port_byte_out(0x3d4, 14);
  int offset = port_byte_in(0x3d5) << 8;
  port_byte_out(0x3d4, 15);
  offset += port_byte_in(0x3d5);
  return offset * 2;
}


x86 assembly (clang, -O0):
<get_cursor_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cursor_offset>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
add    %ebx,%eax
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_cursor_offset() {
%1 = alloca i32
%2 = call i32 @port_byte_out(i32 980, i32 14)
%3 = call i32 @port_byte_in(i32 981)
%4 = shl i32 %3, 8
store i32 %4, i32* %1
%5 = call i32 @port_byte_out(i32 980, i32 15)
%6 = call i32 @port_byte_in(i32 981)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_cursor_offset() {
%1 = tail call i32 @port_byte_out(i32 980, i32 14)
%2 = tail call i32 @port_byte_in(i32 981)
%3 = shl i32 %2, 8
%4 = tail call i32 @port_byte_out(i32 980, i32 15)
%5 = tail call i32 @port_byte_in(i32 981)
%6 = add nsw i32 %5, %3
%7 = shl nsw i32 %6, 1
ret i32 %7
}