xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XSelectionRequestEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XSelectionRequestEvent_display(void *_p, void *_v) {
  ((XSelectionRequestEvent *)_p)->display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XSelectionRequestEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XSelectionRequestEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int /*<<< orphan*/ memcpy(int *, int *, int);
void foo(void) {
  extern int x[8] __attribute__((aligned(128)));
  int y[8] __attribute__((aligned(128)));
  memcpy(y, x, sizeof(x));
  bar(y);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffff80,%rsp
sub    $0x80,%rsp
mov    %rsp,%rdi
mov    0x2ea7(%rip),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
and    $0xffffffffffffff80,%rsp
sub    $0x80,%rsp
mov    0x2ea9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@x = external global [8 x i32]
define void @foo() {
%1 = alloca [8 x i32]
%2 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%3 = call i32 @memcpy(i32* %2, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @x, i64 0, i64 0), i32 32)
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%5 = call i32 @bar(i32* %4)
ret void
}

LLVM IR (-O2):
@x = external global [8 x i32]
define void @foo() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @memcpy(i32* %3, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @x, i64 0, i64 0), i32 32)
%5 = call i32 @bar(i32* %3)
ret void
}
const char *crypto_get_header_version_string(void) {}


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

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

LLVM IR (-O0):
define i8* @crypto_get_header_version_string() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @crypto_get_header_version_string() {
ret i8* undef
}
/* Type definitions */
typedef int __sighandler_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
__sighandler_t sigset(int sig, __sighandler_t disp) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<sigset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigset>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sigset(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sigset(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/
__softboundcets_propagate_metadata_shadow_stack_from(int, int /*<<< orphan*/);
char *strncpy(char *, char *, size_t);
__attribute__((__weak__, __always___)) char *
softboundcets_strncpy(char *dest, char *src, size_t n) {
  char *ret_ptr = strncpy(dest, src, n);
  __softboundcets_propagate_metadata_shadow_stack_from(1, 0);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundcets_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x20(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <__softboundcets_propagate_metadata_shadow_stack_from@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_strncpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strncpy@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <__softboundcets_propagate_metadata_shadow_stack_from@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundcets_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @strncpy(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
%13 = load i8*, i8** %7
ret i8* %13
}

LLVM IR (-O2):
define weak i8* @softboundcets_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %2)
%5 = tail call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
ret i8* %0
}
/* Variables and functions */
double strtod(char *, char **);
bool convertToDouble(char *input, double *result) {
  char *strEnd = NULL;
  *result = strtod(input, &strEnd);
  if (input == strEnd || *strEnd != '\0') {
    return false;
  } else {
    return true;
  }
}


x86 assembly (clang, -O0):
<convertToDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     115b <convertToDouble+0x4b>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <convertToDouble+0x57>
movl   $0x0,-0x4(%rbp)
jmp    116e <convertToDouble+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertToDouble>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <strtod@plt>
movsd  %xmm0,(%r14)
mov    (%rsp),%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
je     1140 <convertToDouble+0x30>
cmpb   $0x0,(%rcx)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @convertToDouble(i8* %0, double* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call double @strtod(i8* %0, i8** %3)
store double %5, double* %1
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %2
%13 = phi i32 [ 0, %2 ], [ %11, %8 ]
ret i32 %13
}
void gendsll32() {}


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

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

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

LLVM IR (-O2):
define void @gendsll32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum = 0, number;
  for (number = 1; number <= 15; number += 2)
    sum += number;
  printf("Sum is %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 15
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 64)
ret i32 0
}
void test_builtin_conjf(_Complex float f) {
  if (__builtin_conjf(f) != __builtin_conjf(f))
    link_failure_builtin_conjf();
}


x86 assembly (clang, -O0):
<test_builtin_conjf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x8(%rbp),%xmm3
movss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
ucomiss %xmm3,%xmm2
setne  %al
setp   %cl
or     %cl,%al
ucomiss %xmm1,%xmm0
setne  %cl
setp   %dl
or     %dl,%cl
or     %cl,%al
test   $0x1,%al
jne    1170 <test_builtin_conjf+0x60>
jmp    1177 <test_builtin_conjf+0x67>
mov    $0x0,%al
call   1030 <link_failure_builtin_conjf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_conjf>:
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
ucomiss %xmm1,%xmm0
jp     111d <test_builtin_conjf+0xd>
ret
xor    %eax,%eax
jmp    1030 <link_failure_builtin_conjf@plt>

LLVM IR (-O0):
define void @test_builtin_conjf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%5 = load float, float* %4
%6 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%7 = load float, float* %6
%8 = fneg float %7
%9 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%12 = load float, float* %11
%13 = fneg float %12
%14 = fcmp une float %5, %10
%15 = fcmp une float %8, %13
%16 = or i1 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = call i32 (...) @link_failure_builtin_conjf()
br label %19
19: ; preds = %17, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_conjf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
%3 = extractelement <2 x float> %0, i64 1
%4 = fcmp uno float %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_conjf()
br label %7
7: ; preds = %5, %1
ret void
}
void gtk_combo_box_get_column_span_column() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @sem_timedwait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = x > 0 && x < 2;
  if (y)
    __VERIFIER_error();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    1152 <main+0x32>
cmpl   $0x2,-0x8(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116e <main+0x4e>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x1,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %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 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 2
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 (...) @__VERIFIER_error()
br label %17
17: ; preds = %15, %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
unsigned int rgb_to_pixel24bgr(unsigned int r, unsigned int g, unsigned int b) {
  return (b << 16) | (g << 8) | r;
}


x86 assembly (clang, -O0):
<rgb_to_pixel24bgr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rgb_to_pixel24bgr(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = or i32 %8, %10
%12 = load i32, i32* %4
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @rgb_to_pixel24bgr(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 16
%5 = shl i32 %1, 8
%6 = or i32 %5, %0
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cgpost2l(float *, float *, float, int, int, int, int);
void cgpost2l_(float *part, float *q, float *qm, int *nop, int *idimp, int *nxv,
               int *nyv) {
  cgpost2l(part, q, *qm, *nop, *idimp, *nxv, *nyv);
  return;
}


x86 assembly (clang, -O0):
<cgpost2l_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    (%rax),%r8d
mov    0x10(%rbp),%rax
mov    (%rax),%r9d
call   1030 <cgpost2l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgpost2l_>:
mov    0x8(%rsp),%rax
movss  (%rdx),%xmm0
mov    (%rcx),%edx
mov    (%r8),%ecx
mov    (%r9),%r8d
mov    (%rax),%r9d
jmp    1030 <cgpost2l@plt>

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

LLVM IR (-O2):
define void @cgpost2l_(float* %0, float* %1, float* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6) {
%8 = load float, float* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = tail call i32 @cgpost2l(float* %0, float* %1, float %8, i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printPlusRow() {
  int i;
  for (i = 0; i < 70; i++) {
    printf("+");
  }
}


x86 assembly (clang, -O0):
<printPlusRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x46,-0x4(%rbp)
jge    1143 <printPlusRow+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <printPlusRow+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPlusRow>:
push   %rbx
mov    $0x46,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2b,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printPlusRow+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printPlusRow() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @putchar(i32 43)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 70
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerRTCDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<TimerRTCDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerRTCDisable>:
movslq %edi,%rax
andl   $0xffffffef,0xc(%rax)
ret

LLVM IR (-O0):
define void @TimerRTCDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 12
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -17
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @TimerRTCDisable(i32 %0) {
%2 = add nsw i32 %0, 12
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -17
store volatile i32 %6, i32* %4
ret void
}
char *RCSid() {
  return RCSid("$Id: plot.c,v 1.128.2.17 2013/07/03 16:31:53 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"$Id: plot.c,v 1.128.2.17 2013/07/03 16:31:53 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_head(void) {
  fprintf(stderr,
          "---utilization--- -----------main area-------- ---------balancing "
          "async------- ---gc--- ---alloc--- -----memory-----\n");
  fprintf(stderr,
          "util  node   data   free  valid  dirty prefree node  dent meta  sit "
          "  nat fnid  cp   gc    ssr    lfs  total  node  meta\n");
}


x86 assembly (clang, -O0):
<print_head>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf3d(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_head>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf47(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [118 x i8] c"---utilization--- -----------main area-------- ---------balancing async------- ---gc--- ---alloc--- -----memory-----\0A\00"
@.str.1 = [122 x i8] c"util node data free valid dirty prefree node dent meta sit nat fnid cp gc ssr lfs total node meta\0A\00"
define void @print_head() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [118 x i8] c"---utilization--- -----------main area-------- ---------balancing async------- ---gc--- ---alloc--- -----memory-----\0A\00"
@.str.1 = [122 x i8] c"util node data free valid dirty prefree node dent meta sit nat fnid cp gc ssr lfs total node meta\0A\00"
define void @print_head() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_62(int /*<<< orphan*/);
int gen_62() { handle_62(0); }


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

x86 assembly (clang, -O2):
<gen_62>:
xor    %edi,%edi
jmp    1030 <handle_62@plt>

LLVM IR (-O0):
define i32 @gen_62() {
%1 = alloca i32
%2 = call i32 @handle_62(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_62() {
%1 = tail call i32 @handle_62(i32 0)
ret i32 undef
}
int my_showstr(char *str) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @my_showstr(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main(int na, char *argv[]) {
  int wflg = 0, tflg = 0;
  int dflg = 0;
  exit(0);
  while (1) {
    switch (argv[1][0]) {
    case 'w':
    case 'W':
      wflg = 1;
      break;
    case 't':
    case 'T':
      tflg = 1;
      break;
    case 'd':
      dflg = 1;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct fcb_ctx {
  int dummy;
};

/* Variables and functions */
int fcb_advance_wait(struct fcb_ctx *, int /*<<< orphan*/);
int fcb_advance(struct fcb_ctx *ctx) { return fcb_advance_wait(ctx, 0); }


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

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

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

LLVM IR (-O2):
%struct.fcb_ctx = type { i32 }
define i32 @fcb_advance(%struct.fcb_ctx* %0) {
%2 = tail call i32 @fcb_advance_wait(%struct.fcb_ctx* %0, i32 0)
ret i32 %2
}
void create_cover() {}


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

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

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

LLVM IR (-O2):
define void @create_cover() {
ret void
}
int test_imm_80uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x80 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_80uint64_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, 128
%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_80uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8388608
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_int12(void) { print("!! Stack exception "); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"!! Stack exception \00"
define void @idt_int12() {
%1 = call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"!! Stack exception \00"
define void @idt_int12() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *place_commas_in_number_string(char *);
int /*<<< orphan*/ sprintf(char *, char *, long);
char *place_commas_in_long(long n) {
  char s[64];
  sprintf(s, "%ld", n);
  return place_commas_in_number_string(s);
}


x86 assembly (clang, -O0):
<place_commas_in_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<place_commas_in_long>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i8* @place_commas_in_long(i64 %0) {
%2 = alloca i64
%3 = alloca [64 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i8* @place_commas_in_number_string(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i8* @place_commas_in_long(i64 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = call i8* @place_commas_in_number_string(i8* %3)
ret i8* %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *s1) {
  int len;
  char *copy;
  len = strlen(s1) + 1;
  if (!(copy = malloc(len)))
    return ((char *)NULL);
  strcpy(copy, s1);
  return (copy);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    116e <strdup+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1183 <strdup+0x53>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <strdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %1
store i8* null, i8** %2
br label %18
13: ; preds = %1
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
store i8* %17, i8** %2
br label %18
18: ; preds = %13, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
int test(int i, double d) {
  if (i >= 0 && d == 3.0) {
    return 41;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     113f <test+0x3f>
movsd  -0x10(%rbp),%xmm0
movsd  0xedd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    113f <test+0x3f>
jp     113f <test+0x3f>
movl   $0x29,-0x4(%rbp)
jmp    1146 <test+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %ecx,%ecx
ucomisd 0xef6(%rip),%xmm0
mov    $0x29,%eax
cmovne %ecx,%eax
cmovp  %ecx,%eax
test   %edi,%edi
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp oeq double %9, 3.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 41, i32* %3
br label %13
12: ; preds = %8, %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @test(i32 %0, double %1) {
%3 = icmp sgt i32 %0, -1
%4 = fcmp oeq double %1, 3.000000e+00
%5 = and i1 %3, %4
%6 = select i1 %5, i32 41, i32 0
ret i32 %6
}
struct pippo **pluto(void) {}


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

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

LLVM IR (-O0):
%struct.pippo = type opaque
define %struct.pippo** @pluto() {
%1 = alloca %struct.pippo**
%2 = load %struct.pippo**, %struct.pippo*** %1
ret %struct.pippo** %2
}

LLVM IR (-O2):
%struct.pippo = type opaque
define noalias %struct.pippo** @pluto() {
ret %struct.pippo** undef
}
/* Variables and functions */
scalar_t__ TOSH_run_next_task(int);
int /*<<< orphan*/ TOSH_sleep();
int /*<<< orphan*/ TOSH_wait();
void TOSH_run_task() {
  while (TOSH_run_next_task(3))
    ;
  TOSH_sleep();
  TOSH_wait();
}


x86 assembly (clang, -O0):
<TOSH_run_task>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <TOSH_run_task+0x9>
mov    $0x3,%edi
call   1040 <TOSH_run_next_task@plt>
cmp    $0x0,%rax
je     1152 <TOSH_run_task+0x22>
jmp    1139 <TOSH_run_task+0x9>
mov    $0x0,%al
call   1030 <TOSH_sleep@plt>
mov    $0x0,%al
call   1050 <TOSH_wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_run_task>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3,%edi
call   1040 <TOSH_run_next_task@plt>
test   %rax,%rax
jne    1140 <TOSH_run_task+0x10>
xor    %eax,%eax
call   1030 <TOSH_sleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <TOSH_wait@plt>

LLVM IR (-O0):
define void @TOSH_run_task() {
br label %1
1: ; preds = %4, %0
%2 = call i64 @TOSH_run_next_task(i32 3)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
%6 = call i32 (...) @TOSH_sleep()
%7 = call i32 (...) @TOSH_wait()
ret void
}

LLVM IR (-O2):
define void @TOSH_run_task() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @TOSH_run_next_task(i32 3)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 (...) @TOSH_sleep()
%6 = tail call i32 (...) @TOSH_wait()
ret void
}
/* Variables and functions */
int rand();
int aleaBorne(int min, int max) { return min + rand() % (max - min + 1); }


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

x86 assembly (clang, -O2):
<aleaBorne>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @aleaBorne(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @aleaBorne(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
bool AUXTDCCounterSet(uint32_t ui32Base, uint32_t ui32Events) {
  ;
  if (!(((*((volatile unsigned long *)(ui32Base + 0x00000004))) & 0x0000003F) ==
        0x00000006)) {
    return false;
  }
  (*((volatile unsigned long *)(ui32Base + 0x00000018))) = ui32Events;
  return true;
}


x86 assembly (clang, -O0):
<AUXTDCCounterSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%rax
and    $0x3f,%rax
cmp    $0x6,%rax
je     112e <AUXTDCCounterSet+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1141 <AUXTDCCounterSet+0x41>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUXTDCCounterSet>:
mov    0x4(%rdi),%rcx
and    $0x3f,%ecx
xor    %eax,%eax
cmp    $0x6,%ecx
jne    1117 <AUXTDCCounterSet+0x17>
mov    %rsi,0x18(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @AUXTDCCounterSet(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 63
%11 = icmp eq i64 %10, 6
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 0, i32* %3
br label %18
13: ; preds = %2
%14 = load i64, i64* %5
%15 = load i64, i64* %4
%16 = add i64 %15, 24
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
store i32 1, i32* %3
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @AUXTDCCounterSet(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, 63
%7 = icmp eq i64 %6, 6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = add i64 %0, 24
%10 = inttoptr i64 %9 to i64*
store volatile i64 %1, i64* %10
br label %11
11: ; preds = %2, %8
%12 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %12
}
/* Type definitions */
typedef int ulong;
typedef int u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char, int);
int /*<<< orphan*/ stderr;
u_int32_t rd_int32(char *buf, ulong offset) {
  u_int32_t n = 0;
  int i;
  for (i = 3; i >= 0; i--) {
    char b = buf[offset + i];
    n = (n << 8) + (b & 0xff);
    if (0 && 0)
      fprintf(stderr, "i: %d, b: %u -> n: %u\n", i, b & 0xff, n);
  }
  return n;
}


x86 assembly (clang, -O0):
<rd_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1159 <rd_int32+0x59>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
movsbl -0x15(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <rd_int32+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_int32>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @rd_int32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 3, i32* %6
br label %8
8: ; preds = %25, %2
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %28
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %12, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %7
%19 = load i32, i32* %5
%20 = shl i32 %19, 8
%21 = load i8, i8* %7
%22 = sext i8 %21 to i32
%23 = and i32 %22, 255
%24 = add nsw i32 %20, %23
store i32 %24, i32* %5
br label %25
25: ; preds = %11
%26 = load i32, i32* %6
%27 = add nsw i32 %26, -1
store i32 %27, i32* %6
br label %8
28: ; preds = %8
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @rd_int32(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add nsw i64 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = add nsw i64 %3, 2
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add nsw i64 %3, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = shl nuw nsw i32 %7, 16
%16 = shl nuw nsw i32 %11, 8
%17 = or i32 %15, %16
%18 = zext i8 %14 to i32
%19 = or i32 %17, %18
%20 = getelementptr inbounds i8, i8* %0, i64 %3
%21 = load i8, i8* %20
%22 = shl nuw i32 %19, 8
%23 = zext i8 %21 to i32
%24 = or i32 %22, %23
ret i32 %24
}
/* Variables and functions */
scalar_t__ pthread_self();
int get_current_tid() { return (int)pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @get_current_tid() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_current_tid() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}
double ldexp(double a, int b) { return a * (double)(1 << b); }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sitofp i32 %7 to double
%9 = fmul double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
ret double %5
}
/* Variables and functions */
float __ulong2fs(unsigned int);
float __uint2fs(unsigned int ui) { return __ulong2fs(ui); }


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

x86 assembly (clang, -O2):
<__uint2fs>:
jmp    1030 <__ulong2fs@plt>

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

LLVM IR (-O2):
define float @__uint2fs(i32 %0) {
%2 = tail call float @__ulong2fs(i32 %0)
ret float %2
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rdx;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int cpuid_num_fixed_counters(void) {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 10;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  return (((uint64_t)(rdx) &
           ((((uint64_t)1 << (((4)) - ((0)) + 1)) - 1) << ((0)))) >>
          (0));
}


x86 assembly (clang, -O0):
<cpuid_num_fixed_counters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x10(%rbp),%eax
and    $0x1f,%eax
sar    $0x0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_num_fixed_counters>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0xa,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
and    $0x1f,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_num_fixed_counters() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @cpuid(i32 %6, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %4
%9 = and i32 %8, 31
%10 = ashr i32 %9, 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @cpuid_num_fixed_counters() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 10, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %4
%11 = and i32 %10, 31
ret i32 %11
}
/* Variables and functions */
unsigned char mmio_read(int);
unsigned char uart_getc() {
  while (mmio_read((0x20201000 + 0x18)) & (1 << 4))
    ;
  return mmio_read((0x20201000 + 0x00));
}


x86 assembly (clang, -O0):
<uart_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_getc+0x9>
mov    $0x20201018,%edi
call   1030 <mmio_read@plt>
movzbl %al,%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1137 <uart_getc+0x27>
jmp    1119 <uart_getc+0x9>
mov    $0x20201000,%edi
call   1030 <mmio_read@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20201018,%edi
call   1030 <mmio_read@plt>
test   $0x10,%al
jne    1120 <uart_getc+0x10>
mov    $0x20201000,%edi
pop    %rax
jmp    1030 <mmio_read@plt>

LLVM IR (-O0):
define zeroext i8 @uart_getc() {
br label %1
1: ; preds = %6, %0
%2 = call zeroext i8 @mmio_read(i32 538972184)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 16
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = call zeroext i8 @mmio_read(i32 538972160)
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @uart_getc() {
br label %1
1: ; preds = %1, %0
%2 = tail call zeroext i8 @mmio_read(i32 538972184)
%3 = and i8 %2, 16
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call zeroext i8 @mmio_read(i32 538972160)
ret i8 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void set_XMotionEvent_send_event(void *_p, int _v) {
  ((XMotionEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XMotionEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XMotionEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}