xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _link(char *old, char *new) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOTSUP
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOTSUP
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exitOnError() {
  cleanup();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exitOnError>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cleanup@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitOnError>:
push   %rax
xor    %eax,%eax
call   1030 <cleanup@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @exitOnError() {
%1 = call i32 (...) @cleanup()
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @exitOnError() {
%1 = tail call i32 (...) @cleanup()
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
double stellar_dust_limit(stellar_mass_ratio)
double stellar_mass_ratio;
{ return (200.0 * pow(stellar_mass_ratio, (1.0 / 3.0))); }


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

x86 assembly (clang, -O2):
<stellar_dust_limit>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @stellar_dust_limit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FD5555555555555)
%5 = fmul double 2.000000e+02, %4
ret double %5
}

LLVM IR (-O2):
define double @stellar_dust_limit(double %0) {
%2 = tail call double @pow(double %0, double 0x3FD5555555555555)
%3 = fmul double %2, 2.000000e+02
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int do_top(int fd, char *param) {
  send(fd, "+OK JChen\r\n", strlen("+OK JChen\r\n"), 0);
  return 0;
}


x86 assembly (clang, -O0):
<do_top>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xec4(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_top>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"+OK JChen\0D\0A\00"
define i32 @do_top(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @send(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"+OK JChen\0D\0A\00"
define i32 @do_top(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
ret i32 0
}
int main() {
  volatile long a = 0x0123456789ABCDEFL;
  if (__builtin_bswap64(a) != 0xEFCDAB8967452301L) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movabs $0x123456789abcdef,%rax
45 23 01
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
bswap  %rax
movabs $0xefcdab8967452301,%rcx
ab cd ef
cmp    %rcx,%rax
je     113f <main+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <main+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movabs $0x123456789abcdef,%rcx
45 23 01
mov    %rcx,-0x8(%rsp)
mov    -0x8(%rsp),%rdx
xor    %eax,%eax
cmp    %rcx,%rdx
setne  %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store volatile i64 81985529216486895, i64* %2
%3 = load volatile i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
%5 = icmp ne i64 %4, -1167088121787636991
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store volatile i64 81985529216486895, i64* %1
%3 = load volatile i64, i64* %1
%4 = icmp ne i64 %3, 81985529216486895
%5 = zext i1 %4 to i32
ret i32 %5
}
int main0() {
  int *localArr = (int *)0x00000000;
  *(localArr + 0) = 0;
  for (int i = 0; i < 20; i++) {
    *(localArr + 0) += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main0>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1140 <main0+0x40>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <main0+0x1d>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main0() {
%1 = alloca i32*
%2 = alloca i32
store i32* null, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 0, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
br label %13
13: ; preds = %8
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ abort();
f(void *a, void *b) {
  if (a != b)
    abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1135 <f+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    %rsi,%rdi
jne    1116 <f+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @f(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret i32 undef
}
double sin(double x) { return 0; }


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @sin(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
float fastererfc(float);
float fastererf(float x) { return 1.0f - fastererfc(x); }


x86 assembly (clang, -O0):
<fastererf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fastererfc@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastererf>:
push   %rax
call   1030 <fastererfc@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fastererf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fastererfc(float %3)
%5 = fsub float 1.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @fastererf(float %0) {
%2 = tail call float @fastererfc(float %0)
%3 = fsub float 1.000000e+00, %2
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int getCurrentDir(char *dir) {
  char cwd[1024];
  if (getcwd(cwd, sizeof(cwd)) != NULL) {
    strcpy(dir, cwd);
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<getCurrentDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
je     1166 <getCurrentDir+0x46>
mov    -0x10(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
jmp    116d <getCurrentDir+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentDir>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     114f <getCurrentDir+0x2f>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x1,%eax
jmp    1151 <getCurrentDir+0x31>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getCurrentDir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1024 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32* @getcwd(i8* %5, i32 1024)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = call i32 @strcpy(i8* %9, i8* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @getCurrentDir(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32* @getcwd(i8* %3, i32 1024)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @strcpy(i8* %0, i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 1, %6 ], [ 0, %1 ]
ret i32 %9
}
int livepatch_patch(const char *patch) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @livepatch_patch(i8* nocapture readnone %0) {
ret i32 0
}
void solo5_exit(int status) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<solo5_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <solo5_exit+0x7>

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

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

LLVM IR (-O2):
define void @solo5_exit(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ dlarnv_(int *, int *, int *, double *);
void aa_cla_dlarnv(int idist, int iseed[4], int n, double *X) {
  dlarnv_(&idist, iseed, &n, X);
}


x86 assembly (clang, -O0):
<aa_cla_dlarnv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
call   1030 <dlarnv_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dlarnv>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
call   1030 <dlarnv_@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @aa_cla_dlarnv(i32 %0, i32* %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca double*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store double* %3, double** %8
%9 = load i32*, i32** %6
%10 = load double*, double** %8
%11 = call i32 @dlarnv_(i32* %5, i32* %9, i32* %7, double* %10)
ret void
}

LLVM IR (-O2):
define void @aa_cla_dlarnv(i32 %0, i32* %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %5
store i32 %2, i32* %6
%7 = call i32 @dlarnv_(i32* %5, i32* %1, i32* %6, double* %3)
ret void
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int iam, np, i = 0;
#pragma omp parallel shared(i) private(iam, np)
  {
    iam = omp_get_thread_num();
    for (np = 0; np < 50; np++) {
#pragma omp atomic
      i++;
    }
  }
  printf("Valor de i: %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1168 <main+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <main+0x27>
mov    -0x10(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Valor de i: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 50)
ret i32 0
}
unsigned int fib(unsigned int n) {
  if (n < 2)
    return n;
  else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jae    1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fib+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fib+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add i32 %13, %12
ret i32 %14
}
int main() { return 4 >= 3; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
int test_imm_51int16_reg(short val) {
  return ((val) & (0x51 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_51int16_reg(i16 signext %0) {
%2 = and i16 %0, 81
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double HUGE_VAL;
double worstPossibleValue() { return (-1.0 * HUGE_VAL); }


x86 assembly (clang, -O0):
<worstPossibleValue>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
mov    0x2ed5(%rip),%rax
mulsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<worstPossibleValue>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
xorps  0xeee(%rip),%xmm0
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define double @worstPossibleValue() {
%1 = load double, double* @HUGE_VAL
%2 = fmul double -1.000000e+00, %1
ret double %2
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define double @worstPossibleValue() {
%1 = load double, double* @HUGE_VAL
%2 = fneg double %1
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpnge_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpnge_sd(__m128d __a, __m128d __b) {
  return _mm_cmpnge_sd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpnge_sd>:
jmp    1030 <_mm_cmpnge_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpnge_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpnge_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ insert(int /*<<< orphan*/);
void op_insert() { insert(0); }


x86 assembly (clang, -O0):
<op_insert>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <insert@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @op_insert() {
%1 = call i32 @insert(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_insert() {
%1 = tail call i32 @insert(i32 0)
ret void
}
int test_imm_84uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x84 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_84uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 132
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void g(int *p) {
  if (!p)
    *p = 0;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111d <g+0x1d>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i32*, i32** %2
store i32 0, i32* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @g(i32* readnone %0) {
%2 = icmp ne i32* %0, null
tail call void @llvm.assume(i1 %2)
ret void
}
char *usage(void) {
  return "--dumpcore (enable guest core dump on abort/trap)";
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"--dumpcore (enable guest core dump on abort/trap)\00"
define i8* @usage() {
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [50 x i8] c"--dumpcore (enable guest core dump on abort/trap)\00"
define i8* @usage() {
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0)
}
int cpu_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpu_init() {
ret i32 0
}
char *prog_name(s)
char *s;
{
  char *p = s + strlen(s);
  while (p >= s && *p != '/')
    p--;
  return (p + 1);
}


x86 assembly (clang, -O0):
<prog_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jb     115e <prog_name+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116e <prog_name+0x5e>
jmp    117f <prog_name+0x6f>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <prog_name+0x2b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%rcx
add    %rbx,%rax
test   %rcx,%rcx
js     113e <prog_name+0x2e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x2f,(%rax)
je     113e <prog_name+0x2e>
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <prog_name+0x20>
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @prog_name(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = icmp slt i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %3, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 -1
%11 = icmp ult i8* %10, %0
br i1 %11, label %12, label %5
12: ; preds = %5, %9, %1
%13 = phi i8* [ %3, %1 ], [ %10, %9 ], [ %6, %5 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ _pei386_runtime_relocator();
int DllStartup(void *module, int reason) {
  _pei386_runtime_relocator();
  return 1;
}


x86 assembly (clang, -O0):
<DllStartup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <_pei386_runtime_relocator@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DllStartup>:
push   %rax
xor    %eax,%eax
call   1030 <_pei386_runtime_relocator@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DllStartup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @_pei386_runtime_relocator()
ret i32 1
}

LLVM IR (-O2):
define i32 @DllStartup(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @_pei386_runtime_relocator()
ret i32 1
}
int zm_startup_pcre(int type, int module_number) {}


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

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

LLVM IR (-O0):
define i32 @zm_startup_pcre(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @zm_startup_pcre(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ remove_duplicates(char *);
scalar_t__ strcmp(char *, char *);
int test_no_duplicates() {
  char input[] = "abc";
  remove_duplicates(input);
  return strcmp(input, "abc") == 0;
}


x86 assembly (clang, -O0):
<test_no_duplicates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <remove_duplicates@plt>
lea    -0x4(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_duplicates>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <remove_duplicates@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_no_duplicates.input = [4 x i8] c"abc\00"
@.str = [4 x i8] c"abc\00"
define i32 @test_no_duplicates() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @remove_duplicates(i8* %3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @test_no_duplicates() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 @remove_duplicates(i8* %2)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ width;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_width(void *_p) { return (int)((XSizeHints *)_p)->width; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSizeHints_width(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_XSizeHints_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int sub3(int i) { return i - (5 + i); }


x86 assembly (clang, -O0):
<sub3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x5,%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sub3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 5, %4
%6 = sub nsw i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @sub3(i32 %0) {
ret i32 -5
}
void test_very_wide_line(void) {}


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

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

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

LLVM IR (-O2):
define void @test_very_wide_line() {
ret void
}
unsigned int clo(char c) {
  unsigned int t = 0;
  while ((c & (0x80 >> t)) != 0 && t < 8) {
    t++;
  }
  return t;
}


x86 assembly (clang, -O0):
<clo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    -0x10(%rbp),%ecx
and    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     113f <clo+0x3f>
cmpl   $0x8,-0x8(%rbp)
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114f <clo+0x4f>
jmp    115d <clo+0x5d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <clo+0x11>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clo>:
movzbl %dil,%eax
mov    $0xffffffff,%ecx
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %eax,%edx
shl    %cl,%edx
test   $0x80,%dl
je     1121 <clo+0x21>
cmp    $0x8,%ecx
jb     1110 <clo+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clo(i8 signext %0) {
%2 = zext i8 %0 to i32
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %10, %3 ]
%5 = lshr i32 128, %4
%6 = and i32 %5, %2
%7 = icmp ne i32 %6, 0
%8 = icmp ult i32 %4, 8
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw nsw i32 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void syntax(void) {
  puts("Syntax:");
  puts("  inverarity <work_dir> [address] [port]");
  puts("Address defaults to localhost; port defaults to 49494");
}


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

x86 assembly (clang, -O2):
<syntax>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Syntax:\00"
@.str.1 = [41 x i8] c" inverarity <work_dir> [address] [port]\00"
@.str.2 = [54 x i8] c"Address defaults to localhost; port defaults to 49494\00"
define void @syntax() {
%1 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Syntax:\00"
@.str.1 = [41 x i8] c" inverarity <work_dir> [address] [port]\00"
@.str.2 = [54 x i8] c"Address defaults to localhost; port defaults to 49494\00"
define void @syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void idle() {
  asm("sti");
  for (;;)
    asm("hlt");
}


x86 assembly (clang, -O0):
<idle>:
push   %rbp
mov    %rsp,%rbp
sti
hlt
jmp    1105 <idle+0x5>

x86 assembly (clang, -O2):
<idle>:
sti
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
hlt
jmp    1110 <idle+0x10>

LLVM IR (-O0):
define void @idle() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @idle() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
char *cuserid(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, const char *argv[]) {
  printf("%s\n", cuserid(NULL));
  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)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <cuserid@plt>
mov    %rax,%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <cuserid@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\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 = call i8* @cuserid(i32* null)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @cuserid(i32* null)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rcx;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_therm_status_enable_ThermalThresholds(void) {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 1;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rcx) &
        ((((uint64_t)1 << (((8)) - ((8)) + 1)) - 1) << ((8)))) >>
       (8)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_therm_status_enable_ThermalThresholds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x10(%rbp),%eax
and    $0x100,%eax
sar    $0x8,%eax
cmp    $0x1,%eax
jne    1157 <cpuid_therm_status_enable_ThermalThresholds+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <cpuid_therm_status_enable_ThermalThresholds+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cpuid_therm_status_enable_ThermalThresholds() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @cpuid(i32 %7, i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %4
%10 = and i32 %9, 256
%11 = ashr i32 %10, 8
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpuid_therm_status_enable_ThermalThresholds() {
%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 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = lshr i32 %10, 8
%12 = and i32 %11, 1
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int sh_error(char const *message, int ret) {
  fputs("sh: ", stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<sh_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"sh: \00"
@stderr = global i32 0
define i32 @sh_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"sh: \00"
@stderr = global i32 0
define i32 @sh_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, res;
  printf("\nEnter a number : ");
  scanf("%d", &num);
  res = fib(num);
  printf("\nfib(%d) = %d\n\n", num, res);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0Afib(%d) = %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @fib(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0Afib(%d) = %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fib(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Variables and functions */
bool IsFullbright(unsigned char index) { return index >= (256 - 32); }


x86 assembly (clang, -O0):
<IsFullbright>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xe0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsFullbright>:
xor    %eax,%eax
cmp    $0xe0,%dil
setae  %al
ret

LLVM IR (-O0):
define i32 @IsFullbright(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 224
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @IsFullbright(i8 zeroext %0) {
%2 = icmp ugt i8 %0, -33
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("digite o numero aqui: ");
  scanf("%d", &num);
  if (num % 2 == 0) {
    printf("esse numero e par");
  } else {
    printf("esse numero e impar");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xed0(%rip),%rax
lea    0xedb(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"digite o numero aqui: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"esse numero e par\00"
@.str.3 = [20 x i8] c"esse numero e impar\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [23 x i8] c"digite o numero aqui: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"esse numero e par\00"
@.str.3 = [20 x i8] c"esse numero e impar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CounterSPURun();
int /*<<< orphan*/ SPUendflush();
int /*<<< orphan*/ execI();
int /*<<< orphan*/ psxShutdown();
void upse_r3000_cpu_execute(void) {
  for (;;) {
    if (!CounterSPURun()) {
      psxShutdown();
      return;
    }
    SPUendflush();
    execI();
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
jmp    1149 <upse_r3000_cpu_execute+0x9>
mov    $0x0,%al
call   1040 <CounterSPURun@plt>
cmp    $0x0,%eax
jne    1162 <upse_r3000_cpu_execute+0x22>
mov    $0x0,%al
call   1060 <psxShutdown@plt>
pop    %rbp
ret
mov    $0x0,%al
call   1050 <SPUendflush@plt>
mov    $0x0,%al
call   1030 <execI@plt>
jmp    1149 <upse_r3000_cpu_execute+0x9>

x86 assembly (clang, -O2):
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <CounterSPURun@plt>
test   %eax,%eax
je     116b <upse_r3000_cpu_execute+0x2b>
xor    %eax,%eax
call   1050 <SPUendflush@plt>
xor    %eax,%eax
call   1030 <execI@plt>
jmp    1150 <upse_r3000_cpu_execute+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1060 <psxShutdown@plt>

LLVM IR (-O0):
define void @upse_r3000_cpu_execute() {
br label %1
1: ; preds = %6, %0
%2 = call i32 (...) @CounterSPURun()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = call i32 (...) @psxShutdown()
ret void
6: ; preds = %1
%7 = call i32 (...) @SPUendflush()
%8 = call i32 (...) @execI()
br label %1
}

LLVM IR (-O2):
define void @upse_r3000_cpu_execute() {
%1 = tail call i32 (...) @CounterSPURun()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %5, %0
%4 = tail call i32 (...) @psxShutdown()
ret void
5: ; preds = %0, %5
%6 = tail call i32 (...) @SPUendflush()
%7 = tail call i32 (...) @execI()
%8 = tail call i32 (...) @CounterSPURun()
%9 = icmp eq i32 %8, 0
br i1 %9, label %3, label %5
}