xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ pause();
int /*<<< orphan*/ perror(char *);
int set_ticker(int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int main(int argc, char *argv[]) {
  void countdown(int);
  signal(SIGALRM, countdown);
  if (set_ticker(500) == -1)
    perror("set_ticker() failed");
  else {
    while (1)
      pause();
  }
  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    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e72(%rip),%rsi
call   1030 <signal@plt>
mov    $0x1f4,%edi
call   1040 <set_ticker@plt>
cmp    $0xffffffff,%eax
jne    118f <main+0x4f>
lea    0xe7b(%rip),%rdi
call   1060 <perror@plt>
jmp    11a0 <main+0x60>
jmp    1194 <main+0x54>
mov    $0x0,%al
call   1050 <pause@plt>
jmp    1194 <main+0x54>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2e87(%rip),%rsi
call   1030 <signal@plt>
mov    $0x1f4,%edi
call   1040 <set_ticker@plt>
cmp    $0xffffffff,%eax
je     1179 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <pause@plt>
jmp    1170 <main+0x30>
lea    0xe80(%rip),%rdi
call   1060 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
@.str = [20 x i8] c"set_ticker() failed\00"
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* @SIGALRM
%7 = call i32 @signal(i32 %6, void (i32)* @countdown)
%8 = call i32 @set_ticker(i32 500)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
12: ; preds = %2
br label %13
13: ; preds = %12, %13
%14 = call i32 (...) @pause()
br label %13
15: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@.str = [20 x i8] c"set_ticker() failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SIGALRM
%4 = tail call i32 @signal(i32 %3, void (i32)* @countdown)
%5 = tail call i32 @set_ticker(i32 500)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
9: ; preds = %2, %9
%10 = tail call i32 (...) @pause()
br label %9
}
/* Type definitions */
typedef scalar_t__ value;

/* Variables and functions */
bool mem_aligned(size_t value) { return (((value) & ((4) - 1)) == 0); }


x86 assembly (clang, -O0):
<mem_aligned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_aligned>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @mem_aligned(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 3
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @mem_aligned(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_equal() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_equal"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_cvolume_equal\00"
define i32 @pa_cvolume_equal() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned char *
observation_generating_process_identifier_location(unsigned char **);
int observation_generating_process_identifier(unsigned char **sec) {
  unsigned char *p;
  p = observation_generating_process_identifier_location(sec);
  if (p)
    return (int)*p;
  return -1;
}


x86 assembly (clang, -O0):
<observation_generating_process_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <observation_generating_process_identifier_location@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1143 <observation_generating_process_identifier+0x33>
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <observation_generating_process_identifier+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<observation_generating_process_identifier>:
push   %rax
call   1030 <observation_generating_process_identifier_location@plt>
test   %rax,%rax
je     1120 <observation_generating_process_identifier+0x10>
movzbl (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @observation_generating_process_identifier(i8** %0) {
%2 = tail call i8* @observation_generating_process_identifier_location(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int twenty_one();
int main(void) {
  int i = twenty_one(), j = i + i;
  return j;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @twenty_one()
%2 = shl nsw i32 %1, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ ccw_load_display(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned long);
void progress_print_disp(unsigned long addr) {
  char msg[24];
  if (addr % (1024 * 1024 * 16) != 0)
    return;
  snprintf(msg, sizeof(msg), "%08u", addr >> 20);
  ccw_load_display(msg);
}


x86 assembly (clang, -O0):
<progress_print_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffff,%rax
cmp    $0x0,%rax
je     1145 <progress_print_disp+0x25>
jmp    116b <progress_print_disp+0x4b>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rcx
shr    $0x14,%rcx
mov    $0x18,%esi
lea    0xea3(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <ccw_load_display@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress_print_disp>:
mov    %rdi,%rcx
test   $0xffffff,%ecx
je     112c <progress_print_disp+0xc>
ret
push   %rbx
sub    $0x20,%rsp
shr    $0x14,%rcx
lea    0xec4(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ccw_load_display@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%08u\00"
define void @progress_print_disp(i64 %0) {
%2 = alloca i64
%3 = alloca [24 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 16777216
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %15
8: ; preds = %1
%9 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%10 = load i64, i64* %2
%11 = lshr i64 %10, 20
%12 = call i32 @snprintf(i8* %9, i32 24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%14 = call i32 @ccw_load_display(i8* %13)
br label %15
15: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%08u\00"
define void @progress_print_disp(i64 %0) {
%2 = alloca [24 x i8]
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%4 = and i64 %0, 16777215
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = lshr i64 %0, 20
%8 = call i32 @snprintf(i8* %3, i32 24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @ccw_load_display(i8* %3)
br label %10
10: ; preds = %1, %6
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t return_int64_4() { return 1073741823; }


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

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

LLVM IR (-O0):
define i32 @return_int64_4() {
ret i32 1073741823
}

LLVM IR (-O2):
define i32 @return_int64_4() {
ret i32 1073741823
}
/* Variables and functions */
double pow(double, double);
double Double_pow(double x, double y) { return pow(x, y); }


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

x86 assembly (clang, -O2):
<Double_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @Double_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @Double_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
int max2(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}


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

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

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

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void timeout(int sig) {}


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

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

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

LLVM IR (-O2):
define void @timeout(i32 %0) {
ret void
}
void glDrawArrays(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDrawArrays() {
ret void
}
char *R2Settings_getHelpOption() {
  return "Use the identifier '--help' for getting information about the "
         "settings";
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"Use the identifier '--help' for getting information about the settings\00"
define i8* @R2Settings_getHelpOption() {
ret i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [71 x i8] c"Use the identifier '--help' for getting information about the settings\00"
define i8* @R2Settings_getHelpOption() {
ret i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void _CLog_timePrefix(char *tmp, size_t size) {
  time_t t = time(0);
  strftime(tmp, size, "%Y-%m-%d %X ", localtime(&t));
}


x86 assembly (clang, -O0):
<_CLog_timePrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%ecx
lea    0xe8c(%rip),%rdx
call   1050 <strftime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CLog_timePrefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeaa(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%ecx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%Y-%m-%d %X \00"
define void @_CLog_timePrefix(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @time(i32 0)
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @localtime(i32* %5)
%10 = call i32 @strftime(i8* %7, i64 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%Y-%m-%d %X \00"
define void @_CLog_timePrefix(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32 0)
store i32 %5, i32* %3
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
int read_active(unsigned int *heat_core) { return heat_core[1]; }


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

x86 assembly (clang, -O2):
<read_active>:
mov    0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_active(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
__attribute__((always_)) float drmp3_mix_f32_fast(float x, float y, float a) {
  float r0 = (y - x);
  float r1 = r0 * a;
  return x + r1;
}


x86 assembly (clang, -O0):
<drmp3_mix_f32_fast>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drmp3_mix_f32_fast>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @drmp3_mix_f32_fast(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
store float %11, float* %7
%12 = load float, float* %7
%13 = load float, float* %6
%14 = fmul float %12, %13
store float %14, float* %8
%15 = load float, float* %4
%16 = load float, float* %8
%17 = fadd float %15, %16
ret float %17
}

LLVM IR (-O2):
define float @drmp3_mix_f32_fast(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = fmul float %4, %2
%6 = fadd float %5, %0
ret float %6
}
int lm_rem_lockspace_sanlock(struct lockspace *ls, int free_vg) { return -1; }


x86 assembly (clang, -O0):
<lm_rem_lockspace_sanlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lockspace = type opaque
define i32 @lm_rem_lockspace_sanlock(%struct.lockspace* %0, i32 %1) {
%3 = alloca %struct.lockspace*
%4 = alloca i32
store %struct.lockspace* %0, %struct.lockspace** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
%struct.lockspace = type opaque
define i32 @lm_rem_lockspace_sanlock(%struct.lockspace* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_YELLOW;
int /*<<< orphan*/ ChangeColor(int /*<<< orphan*/);
void SetColorYellow() { ChangeColor(COLOR_YELLOW); }


x86 assembly (clang, -O0):
<SetColorYellow>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <ChangeColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetColorYellow>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ChangeColor@plt>

LLVM IR (-O0):
@COLOR_YELLOW = global i32 0
define void @SetColorYellow() {
%1 = load i32, i32* @COLOR_YELLOW
%2 = call i32 @ChangeColor(i32 %1)
ret void
}

LLVM IR (-O2):
@COLOR_YELLOW = global i32 0
define void @SetColorYellow() {
%1 = load i32, i32* @COLOR_YELLOW
%2 = tail call i32 @ChangeColor(i32 %1)
ret void
}
void numa_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @numa_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_lcs(char *, char *);
int /*<<< orphan*/ gets(char *);
int main() {
  char str1[2048], str2[2048];
  gets(str1);
  gets(str2);
  get_lcs(str1, str2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x810(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x1010(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x810(%rbp),%rdi
lea    -0x1010(%rbp),%rsi
call   1030 <get_lcs@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
lea    0x800(%rsp),%r14
mov    %r14,%rdi
call   1040 <gets@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_lcs@plt>
xor    %eax,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2048 x i8]
%3 = alloca [2048 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%10 = call i32 @get_lcs(i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2048 x i8]
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %3)
%6 = call i32 @gets(i8* %4)
%7 = call i32 @get_lcs(i8* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void f1() {
  int size = 10;
  char src[10];
  memset(src, 0, size);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 10, i32* %1
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* %1
%5 = call i32 @memset(i8* %3, i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 10)
ret void
}
void default_instr_hook_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @default_instr_hook_callback() {
ret void
}
long int getDefaultNbIterValue() { return 100000L; }


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

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

LLVM IR (-O0):
define i64 @getDefaultNbIterValue() {
ret i64 100000
}

LLVM IR (-O2):
define i64 @getDefaultNbIterValue() {
ret i64 100000
}
/* Variables and functions */
char *strchr(char *, char);
char *extractdomain(char *mailaddress) {
  char *start;
  if ((start = strchr(mailaddress, '@')) != NULL) {
    start++;
  }
  return start;
}


x86 assembly (clang, -O0):
<extractdomain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <extractdomain+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractdomain>:
push   %rax
mov    $0x40,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @extractdomain(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ checkNetworkEvents();
void checkAllEvents(void) { checkNetworkEvents(); }


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

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

LLVM IR (-O0):
define void @checkAllEvents() {
%1 = call i32 (...) @checkNetworkEvents()
ret void
}

LLVM IR (-O2):
define void @checkAllEvents() {
%1 = tail call i32 (...) @checkNetworkEvents()
ret void
}
/* Variables and functions */
char tolower(char);
void nameToLower(char name[]) {
  int n;
  for (n = 0; name[n] != '\0'; n++) {
    name[n] = tolower(name[n]);
  }
}


x86 assembly (clang, -O0):
<nameToLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <nameToLower+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <nameToLower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nameToLower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <nameToLower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <nameToLower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @nameToLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
short msg_bytes2S16(char *str) {
  return (short)((0xff & str[0]) | ((0xff & str[1]) << 8));
}


x86 assembly (clang, -O0):
<msg_bytes2S16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_bytes2S16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define signext i16 @msg_bytes2S16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 255, %6
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = and i32 255, %11
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @msg_bytes2S16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = or i16 %7, %3
ret i16 %8
}
void f(void) {
  int *p, *q;
  q = p + 1;
  q = p - 1;
  q++;
  ++q;
  q--;
  --q;
  int a;
  q = p + a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %2
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 -1
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %2
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %2
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i32 -1
store i32* %13, i32** %2
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i32 -1
store i32* %15, i32** %2
%16 = load i32*, i32** %1
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32* %19, i32** %2
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
sbresp(ioary) int *ioary;
{ return (childend()); }


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

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

LLVM IR (-O0):
define i32 @sbresp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @childend()
ret i32 %3
}

LLVM IR (-O2):
define i32 @sbresp(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @childend()
ret i32 %2
}
/* Variables and functions */
int handle_lock_level(int, int, int /*<<< orphan*/);
int handle_unlock(int devfd, int nodeid, char *arg) {
  return handle_lock_level(devfd, nodeid, 0);
}


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

x86 assembly (clang, -O2):
<handle_unlock>:
xor    %edx,%edx
jmp    1030 <handle_lock_level@plt>

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

LLVM IR (-O2):
define i32 @handle_unlock(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @handle_lock_level(i32 %0, i32 %1, i32 0)
ret i32 %4
}
void out_string(char *s, int l) {}


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

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

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

LLVM IR (-O2):
define void @out_string(i8* nocapture %0, i32 %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
int get_XCirculateEvent_send_event(void *_p) {
  return (int)((XCirculateEvent *)_p)->send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCirculateEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCirculateEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int fstat(int, struct stat *);
__attribute__((__weak__, __always___)) int
softboundmpx_fstat(int filedes, struct stat *buff) {
  return fstat(filedes, buff);
}


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

x86 assembly (clang, -O2):
<softboundmpx_fstat>:
jmp    1030 <fstat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define weak i32 @softboundmpx_fstat(i32 %0, %struct.stat* %1) {
%3 = tail call i32 @fstat(i32 %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(int x) {
  while (x > 0) {
    printf("hello, world!\n");
    x--;
  }
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <hello+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <hello+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <hello+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <hello+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @hello(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hello(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
double h_equation(double a, double b, double n) { return (b - a) / n; }


x86 assembly (clang, -O0):
<h_equation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_equation>:
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @h_equation(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* %5
%8 = load double, double* %4
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @h_equation(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fdiv double %4, %2
ret double %5
}
/* Variables and functions */
bool PRCMRfReady(void) {
  return (
      ((*((volatile unsigned long *)(0x40082000 + 0x0000019C))) & 0x00000001)
          ? true
          : false);
}


x86 assembly (clang, -O0):
<PRCMRfReady>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4008219c,%eax
mov    (%rax),%rdx
and    $0x1,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMRfReady>:
mov    0x4008219c,%rax
40
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @PRCMRfReady() {
%1 = load volatile i64, i64* inttoptr (i64 1074274716 to i64*)
%2 = and i64 %1, 1
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @PRCMRfReady() {
%1 = load volatile i64, i64* inttoptr (i64 1074274716 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 1
ret i32 %3
}
int ld_lt_rr1(long double a1, long double a2) { return (((a1) < (a2))); }


x86 assembly (clang, -O0):
<ld_lt_rr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_lt_rr1>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_lt_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp olt x86_fp80 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ld_lt_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int GLint;
typedef int GLenum;

/* Variables and functions */
#define GL_CONVOLUTION_BORDER_COLOR 131
#define GL_CONVOLUTION_BORDER_MODE 130
#define GL_CONVOLUTION_FILTER_BIAS 129
#define GL_CONVOLUTION_FILTER_SCALE 128
__attribute__((visibility("internal"))) __attribute__((pure)) GLint
__glConvolutionParameterfv_size(GLenum e) {
  switch (e) {
  case GL_CONVOLUTION_BORDER_MODE:
    return 1;
  case GL_CONVOLUTION_FILTER_SCALE:
  case GL_CONVOLUTION_FILTER_BIAS:
  case GL_CONVOLUTION_BORDER_COLOR:
    return 4;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<__glConvolutionParameterfv_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff80,%eax
sub    $0x2,%eax
jb     1150 <__glConvolutionParameterfv_size+0x50>
jmp    111e <__glConvolutionParameterfv_size+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x82,%eax
je     1144 <__glConvolutionParameterfv_size+0x44>
jmp    1131 <__glConvolutionParameterfv_size+0x31>
mov    -0xc(%rbp),%eax
sub    $0x83,%eax
je     1150 <__glConvolutionParameterfv_size+0x50>
jmp    115c <__glConvolutionParameterfv_size+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <__glConvolutionParameterfv_size+0x63>
movl   $0x4,-0x4(%rbp)
jmp    1163 <__glConvolutionParameterfv_size+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glConvolutionParameterfv_size>:
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x3,%edi
ja     1117 <__glConvolutionParameterfv_size+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define hidden i32 @__glConvolutionParameterfv_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 130, label %5
i32 128, label %6
i32 129, label %6
i32 131, label %6
]
5: ; preds = %1
store i32 1, i32* %2
br label %8
6: ; preds = %1, %1, %1
store i32 4, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.__glConvolutionParameterfv_size = [4 x i32] [i32 4, i32 4, i32 1, i32 4]
define hidden i32 @__glConvolutionParameterfv_size(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.__glConvolutionParameterfv_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ apic_write(int, int /*<<< orphan*/);
__attribute__((always_)) void ack_APIC_irq(void) { apic_write(0xB0, 0); }


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

x86 assembly (clang, -O2):
<ack_APIC_irq>:
mov    $0xb0,%edi
xor    %esi,%esi
jmp    1030 <apic_write@plt>

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

LLVM IR (-O2):
define void @ack_APIC_irq() {
%1 = tail call i32 @apic_write(i32 176, i32 0)
ret void
}
char hexdigit(int c) {
  if (c < 0)
    return '.';
  if (c < 10)
    return '0' + c;
  if (c < 16)
    return 'a' + (c - 10);
  return ',';
}


x86 assembly (clang, -O0):
<hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111a <hexdigit+0x1a>
movb   $0x2e,-0x1(%rbp)
jmp    1151 <hexdigit+0x51>
cmpl   $0xa,-0x8(%rbp)
jge    1132 <hexdigit+0x32>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1151 <hexdigit+0x51>
cmpl   $0x10,-0x8(%rbp)
jge    114d <hexdigit+0x4d>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1151 <hexdigit+0x51>
movb   $0x2c,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdigit>:
test   %edi,%edi
js     110f <hexdigit+0xf>
cmp    $0x9,%edi
ja     1112 <hexdigit+0x12>
add    $0x30,%dil
jmp    111d <hexdigit+0x1d>
mov    $0x2e,%al
ret
mov    $0x2c,%al
cmp    $0xf,%edi
ja     111f <hexdigit+0x1f>
add    $0x57,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @hexdigit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 46, i8* %2
br label %23
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 48, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %23
14: ; preds = %7
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 16
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 10
%20 = add nsw i32 97, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %23
22: ; preds = %14
store i8 44, i8* %2
br label %23
23: ; preds = %22, %17, %10, %6
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @hexdigit(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 10
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i32 %0 to i8
%7 = add nuw nsw i8 %6, 48
br label %13
8: ; preds = %3
%9 = icmp ult i32 %0, 16
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = trunc i32 %0 to i8
%12 = add nuw nsw i8 %11, 87
br label %13
13: ; preds = %8, %1, %10, %5
%14 = phi i8 [ %7, %5 ], [ %12, %10 ], [ 46, %1 ], [ 44, %8 ]
ret i8 %14
}
/* Variables and functions */
int errno;
int my_socket_errno() { return errno; }


x86 assembly (clang, -O0):
<my_socket_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_socket_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @my_socket_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @my_socket_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int usemem() {
  int MB = 0;
  while (malloc(1 << 20)) {
    ++MB;
  }
  printf("Alloced %d MB total\n", MB);
  return 0;
}


x86 assembly (clang, -O0):
<usemem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x100000,%edi
call   1040 <malloc@plt>
cmp    $0x0,%rax
je     1151 <usemem+0x31>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <usemem+0xf>
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usemem>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x100000,%edi
call   1040 <malloc@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <usemem+0x10>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Alloced %d MB total\0A\00"
define i32 @usemem() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = call i64 @malloc(i32 1048576)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %2
8: ; preds = %2
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Alloced %d MB total\0A\00"
define i32 @usemem() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i64 @malloc(i32 1048576)
%4 = icmp eq i64 %3, 0
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int test_imm_96uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x96,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_96uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9830400
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}