xunge/DecIR huggingface dataset:
/* Variables and functions */
int arc4random();
int /*<<< orphan*/ printf(char *, int, char);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < 1024; ++i) {
    printf("%08x%c", arc4random(), (i & 15) == 15 ? '\n' : ' ');
  }
}


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)
cmpl   $0x400,-0x14(%rbp)
jge    1186 <main+0x66>
mov    $0x0,%al
call   1030 <arc4random@plt>
mov    %eax,%esi
mov    -0x14(%rbp),%edx
and    $0xf,%edx
mov    $0x20,%eax
mov    $0xa,%ecx
cmp    $0xf,%edx
cmove  %ecx,%eax
lea    0xe90(%rip),%rdi
movsbl %al,%edx
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0xa,%r14d
lea    0xecf(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <arc4random@plt>
mov    %ebp,%ecx
not    %ecx
test   $0xf,%cl
mov    $0x20,%edx
cmove  %r14d,%edx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x400,%ebp
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%08x%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 1024
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = call i32 (...) @arc4random()
%12 = load i32, i32* %6
%13 = and i32 %12, 15
%14 = icmp eq i32 %13, 15
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 10, i32 32
%17 = trunc i32 %16 to i8
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i8 signext %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"%08x%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %10, %3 ]
%5 = tail call i32 (...) @arc4random()
%6 = and i32 %4, 15
%7 = icmp eq i32 %6, 15
%8 = select i1 %7, i8 10, i8 32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i8 signext %8)
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 1024
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("not supported");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"not supported\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"not supported\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ expand_(int *, double *, double *, int *);
void mgh_expand(int n, const double *alin, double *amat, int lda) {
  int _n = n, _lda = lda;
  assert(sizeof(double) == sizeof(*alin));
  expand_(&_n, (double *)alin, (double *)amat, &_lda);
}


x86 assembly (clang, -O0):
<mgh_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rcx
call   1040 <expand_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgh_expand>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
mov    %ecx,(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rcx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <expand_@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mgh_expand(i32 %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
store i32 %11, i32* %9
%12 = load i32, i32* %8
store i32 %12, i32* %10
%13 = call i32 @assert(i32 1)
%14 = load double*, double** %6
%15 = load double*, double** %7
%16 = call i32 @expand_(i32* %9, double* %14, double* %15, i32* %10)
ret void
}

LLVM IR (-O2):
define void @mgh_expand(i32 %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
store i32 %0, i32* %5
%8 = bitcast i32* %6 to i8*
store i32 %3, i32* %6
%9 = tail call i32 @assert(i32 1)
%10 = call i32 @expand_(i32* %5, double* %1, double* %2, i32* %6)
ret void
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int n = 4;
  printf("\n Factorial of %d is %d.\n", n, fact(n));
  return;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <fact@plt>
lea    0xece(%rip),%rdi
mov    $0x4,%esi
mov    %eax,%edx
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0A Factorial of %d is %d.\0A\00"
define void @main() {
%1 = alloca i32
store i32 4, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @fact(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0A Factorial of %d is %d.\0A\00"
define void @main() {
%1 = tail call i32 @fact(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 4, i32 %1)
ret void
}
int rep_clz(unsigned a) { return __builtin_clz(a); }


x86 assembly (clang, -O0):
<rep_clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rep_clz>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @rep_clz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @rep_clz(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double doublenow() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (double)tv.tv_sec + (((double)tv.tv_usec) / 1000000.0);
}


x86 assembly (clang, -O0):
<doublenow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doublenow>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @doublenow() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @doublenow() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
int f1(int x, int y) { return (x + y); }


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

x86 assembly (clang, -O2):
<f1>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void foo314() {}


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

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

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

LLVM IR (-O2):
define void @foo314() {
ret void
}
int do_623() { return 623; }


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

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

LLVM IR (-O0):
define i32 @do_623() {
ret i32 623
}

LLVM IR (-O2):
define i32 @do_623() {
ret i32 623
}
char deactivate(void) { return -1; }


x86 assembly (clang, -O0):
<deactivate>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deactivate>:
mov    $0xff,%al
ret

LLVM IR (-O0):
define signext i8 @deactivate() {
ret i8 -1
}

LLVM IR (-O2):
define signext i8 @deactivate() {
ret i8 -1
}
void modify_label(label) char *label;
{ char *p; }


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

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

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

LLVM IR (-O2):
define void @modify_label(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eset(int);
void naf() { eset(24); }


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

x86 assembly (clang, -O2):
<naf>:
mov    $0x18,%edi
jmp    1030 <eset@plt>

LLVM IR (-O0):
define void @naf() {
%1 = call i32 @eset(i32 24)
ret void
}

LLVM IR (-O2):
define void @naf() {
%1 = tail call i32 @eset(i32 24)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blink8() {
  blinkdash();
  blinkdash();
  blinkdash();
  blinkdot();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blink8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xea1(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink8>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xea4(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blink8() {
%1 = call i32 (...) @blinkdash()
%2 = call i32 (...) @blinkdash()
%3 = call i32 (...) @blinkdash()
%4 = call i32 (...) @blinkdot()
%5 = call i32 (...) @blinkdot()
%6 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blink8() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 (...) @blinkdot()
%6 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
void RTSemRWDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWDestroy() {
ret void
}
int capture_presence_as_0(const char *carg, void *pvar) {
  int *pi = pvar;
  *pi = 0;
  return 0;
}


x86 assembly (clang, -O0):
<capture_presence_as_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_presence_as_0>:
movl   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @capture_presence_as_0(i8* nocapture readnone %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
store i32 0, i32* %3
ret i32 0
}
int sys$dclast(void (*astadr)(unsigned long), unsigned long astprm,
               unsigned int acmode) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(acmode);
    register long int _a2 asm("rsi") = (long)(astprm);
    register long int _a1 asm("rdi") = (long)(astadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(5), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$dclast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x5,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$dclast>:
mov    %edx,%edx
mov    $0x5,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$dclast"(void (i64)* %0, i64 %1, i32 %2) {
%4 = alloca void (i64)*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store void (i64)* %0, void (i64)** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
store i64 %13, i64* %8
%14 = load i64, i64* %5
store i64 %14, i64* %9
%15 = load void (i64)*, void (i64)** %4
%16 = ptrtoint void (i64)* %15 to i64
store i64 %16, i64* %10
%17 = load i64, i64* %10
%18 = load i64, i64* %9
%19 = load i64, i64* %8
%20 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 5, i64 %17, i64 %18, i64 %19)
store i64 %20, i64* %7
%21 = load i64, i64* %7
store i64 %21, i64* %11
%22 = load i64, i64* %11
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @"sys$dclast"(void (i64)* %0, i64 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = ptrtoint void (i64)* %0 to i64
%6 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 5, i64 %5, i64 %1, i64 %4)
%7 = trunc i64 %6 to i32
ret i32 %7
}
int test_imm_58uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x58 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_58uint64_highword_reg>:
movabs $0x5800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_58uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 88
%6 = icmp ne i64 %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_58uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 377957122048
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void f2(int *argp) {
  int j;
  j = *argp;
  j--;
  *argp = j;
}


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

x86 assembly (clang, -O2):
<f2>:
addl   $0xffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @f2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, -1
store i32 %3, i32* %0
ret void
}
void rte_io_wmb(void) {}


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

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

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

LLVM IR (-O2):
define void @rte_io_wmb() {
ret void
}
unsigned get_sign(unsigned uf) { return (uf >> (32 - 1)) & 0x1; }


x86 assembly (clang, -O0):
<get_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sign>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @get_sign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 31
%5 = and i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_sign(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float sqrt(int);
int main() {
  int num = 49;
  float raiz;
  raiz = sqrt(num);
  printf("\n Raiz Quadrada = %.2f", raiz);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x31,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"\0A Raiz Quadrada = %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 49, i32* %2
%4 = load i32, i32* %2
%5 = call float @sqrt(i32 %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A Raiz Quadrada = %.2f\00"
define i32 @main() {
%1 = tail call float @sqrt(i32 49)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  int z;
  if (!(x == y && y == 0 && z == 0))
    return 0;
  while (1) {
    x++;
    y++;
    z -= 2;
    assert(x == y && x >= 0 && x + y + z == 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    113f <main+0x2f>
cmpl   $0x0,-0xc(%rbp)
jne    113f <main+0x2f>
cmpl   $0x0,-0x10(%rbp)
je     1147 <main+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    114c <main+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    1199 <main+0x89>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     1199 <main+0x89>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    114c <main+0x3c>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11, %8, %0
ret i32 0
15: ; preds = %11
br label %16
16: ; preds = %15, %36
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 2
store i32 %22, i32* %4
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %36
26: ; preds = %16
%27 = load i32, i32* %2
%28 = icmp sge i32 %27, 0
br i1 %28, label %29, label %36
29: ; preds = %26
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = add nsw i32 %30, %31
%33 = load i32, i32* %4
%34 = add nsw i32 %32, %33
%35 = icmp eq i32 %34, 0
br label %36
36: ; preds = %29, %26, %16
%37 = phi i1 [ false, %26 ], [ false, %16 ], [ %35, %29 ]
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
br label %16
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void RTZipDecompDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTZipDecompDestroy() {
ret void
}
/* Type definitions */
struct gonc_entry {
  int dummy;
};
struct gonc_array_list {
  int dummy;
};

/* Variables and functions */
int gonc_array_list_insert(struct gonc_array_list *, int /*<<< orphan*/,
                           struct gonc_entry *);
int gonc_array_list_prepend(struct gonc_array_list *array_list,
                            struct gonc_entry *entry) {
  return gonc_array_list_insert(array_list, 0, entry);
}


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

x86 assembly (clang, -O2):
<gonc_array_list_prepend>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <gonc_array_list_insert@plt>

LLVM IR (-O0):
%struct.gonc_array_list = type { i32 }
%struct.gonc_entry = type { i32 }
define i32 @gonc_array_list_prepend(%struct.gonc_array_list* %0, %struct.gonc_entry* %1) {
%3 = alloca %struct.gonc_array_list*
%4 = alloca %struct.gonc_entry*
store %struct.gonc_array_list* %0, %struct.gonc_array_list** %3
store %struct.gonc_entry* %1, %struct.gonc_entry** %4
%5 = load %struct.gonc_array_list*, %struct.gonc_array_list** %3
%6 = load %struct.gonc_entry*, %struct.gonc_entry** %4
%7 = call i32 @gonc_array_list_insert(%struct.gonc_array_list* %5, i32 0, %struct.gonc_entry* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.gonc_array_list = type { i32 }
%struct.gonc_entry = type { i32 }
define i32 @gonc_array_list_prepend(%struct.gonc_array_list* %0, %struct.gonc_entry* %1) {
%3 = tail call i32 @gonc_array_list_insert(%struct.gonc_array_list* %0, i32 0, %struct.gonc_entry* %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ __wleu64(int *, int /*<<< orphan*/);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_leint64(int fd, int chip_addr, int reg, int64_t value) {
  uint8_t data[1 + sizeof(uint64_t)];
  data[0] = reg;
  __wleu64(&data[1], (uint64_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint64_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_leint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1040 <__wleu64@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x30(%rbp),%rdx
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_leint64>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %ecx,%esi
call   1040 <__wleu64@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i2c_write_leint64(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca [5 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 1
%13 = load i64, i64* %8
%14 = trunc i64 %13 to i32
%15 = call i32 @__wleu64(i32* %12, i32 %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%19 = call i32 @i2c_transact(i32 %16, i32 %17, i32* %18, i32 5, i32 0)
ret i32 %19
}

LLVM IR (-O2):
define i32 @i2c_write_leint64(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca [5 x i32]
%6 = bitcast [5 x i32]* %5 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
%9 = trunc i64 %3 to i32
%10 = call i32 @__wleu64(i32* %8, i32 %9)
%11 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 5, i32 0)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ execlp(char const *, char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) wait_and_exec(int delay, const char *path) {
  sleep(delay);
  execlp(path, path, NULL);
  do {
    fprintf(stderr,
            "Failed to exec() the file \"%s\": %m"
            "\n",
            path);
    exit(EXIT_FAILURE);
  } while (0);
}


x86 assembly (clang, -O0):
<wait_and_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <sleep@plt>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execlp@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<wait_and_exec>:
push   %rbx
mov    %rsi,%rbx
call   1060 <sleep@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1050 <execlp@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Failed to exec() the file \22%s\22: %m\0A\00"
@EXIT_FAILURE = global i32 0
define void @wait_and_exec(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 @sleep(i32 %5)
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @execlp(i8* %7, i8* %8, i32* null)
br label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; No predecessors!
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Failed to exec() the file \22%s\22: %m\0A\00"
@EXIT_FAILURE = global i32 0
define void @wait_and_exec(i32 %0, i8* %1) {
%3 = tail call i32 @sleep(i32 %0)
%4 = tail call i32 @execlp(i8* %1, i8* %1, i32* null)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
void set_perf_event_pending(void) {}


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

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

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

LLVM IR (-O2):
define void @set_perf_event_pending() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello_world() {
  printf("Hello World!\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @hello_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rdb_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rdb_client *);
void cliDestroy(struct rdb_client *ndp) {
  if (ndp)
    free(ndp);
}


x86 assembly (clang, -O0):
<cliDestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <cliDestroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cliDestroy>:
test   %rdi,%rdi
je     111a <cliDestroy+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.rdb_client = type { i32 }
define void @cliDestroy(%struct.rdb_client* %0) {
%2 = icmp eq %struct.rdb_client* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.rdb_client* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int rand1;
  printf("\nBeginning Random Number Generation from the numbers 1-6....\n");
  srand(time(NULL));
  rand1 = rand() % 6 + 1;
  printf("\nThe Random Number is: %d\n\n", rand1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb2(%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    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\0ABeginning Random Number Generation from the numbers 1-6....\0A\00"
@.str.1 = [28 x i8] c"\0AThe Random Number is: %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"\0AThe Random Number is: %d\0A\0A\00"
@str = [61 x i8] c"\0ABeginning Random Number Generation from the numbers 1-6....\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 %5, 1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int fn2(int x, int b[3]) { return x + sizeof b; }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
lea    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fn2(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 = sext i32 %5 to i64
%7 = add i64 %6, 8
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32* nocapture readnone %1) {
%3 = add i32 %0, 8
ret i32 %3
}
void clear(char *str) {
  int count = 0;
  for (count = 0; count < 16; count++) {
    str[count] = '\0';
  }
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    113a <clear+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clear(i8* nocapture writeonly %0) {
ret void
}
unsigned long bit_mask(unsigned long bit) {
  return 1UL << (bit & ((sizeof(unsigned long) * 8) - 1));
}


x86 assembly (clang, -O0):
<bit_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_mask>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @bit_mask(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 63
%5 = shl i64 1, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @bit_mask(i64 %0) {
%2 = and i64 %0, 63
%3 = shl nuw i64 1, %2
ret i64 %3
}
const char *Type_Brief(void) { return "Metadata Object"; }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Metadata Object\00"
define i8* @Type_Brief() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"Metadata Object\00"
define i8* @Type_Brief() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
int default_compare(const void *v1, const void *v2) {
  const int i1 = (const long)v1, i2 = (const long)v2;
  return i1 - i2;
}


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

x86 assembly (clang, -O2):
<default_compare>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @default_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i64
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @default_compare(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRB7_set(void) { return U_WMRCORENONE_set("U_WMRB7"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB7\00"
define i8* @U_WMRB7_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB7\00"
define i8* @U_WMRB7_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
scalar_t__ strlen(char *);
void intentional1(char *name) {
  char *new_name = (char *)malloc(strlen(name + 1) + 1);
}


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

x86 assembly (clang, -O2):
<intentional1>:
push   %rax
add    $0x1,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define void @intentional1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
ret void
}

LLVM IR (-O2):
define void @intentional1(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i64 @strlen(i8* %2)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @malloc(i64 %4)
ret void
}
void emit_type_family(struct processor_explicatory_state *process_state,
                      struct modern_stream *stream, void *stream_state,
                      struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_type_family>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_family(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_family(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void __aeabi_memclr(void *dest, size_t n) { memset(dest, 0, n); }


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

x86 assembly (clang, -O2):
<__aeabi_memclr>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @__aeabi_memclr(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Type definitions */
struct coprthr_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _printcl(char *, int, char *, char *);
void *copy_image(struct coprthr_device *dev, void *argp) {
  do {
    if ("<4>"
        "cmdcall_x86_64:copy_image: unsupported"[1] <= '0')
      _printcl("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/browndeer/coprthr/refs/heads/"
               "parallellocalypse/src/libcoprthr/arch/x86_64/devcmds_x86_64.c",
               411, "clmesg",
               "<4>"
               "cmdcall_x86_64:copy_image: unsupported");
  } while (0);
  return (0);
}


x86 assembly (clang, -O0):
<copy_image>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1111 <copy_image+0x11>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.coprthr_device = type { i32 }
define i8* @copy_image(%struct.coprthr_device* %0, i8* %1) {
%3 = alloca %struct.coprthr_device*
%4 = alloca i8*
store %struct.coprthr_device* %0, %struct.coprthr_device** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
ret i8* null
}

LLVM IR (-O2):
%struct.coprthr_device = type { i32 }
define noalias i8* @copy_image(%struct.coprthr_device* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int string_length(char *s) {
  int i;
  i = 0;
  if (s != NULL)
    while (*s++)
      i++;
  return (i);
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <string_length+0x4a>
jmp    111f <string_length+0x1f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1145 <string_length+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <string_length+0x1f>
jmp    114a <string_length+0x4a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <string_length+0x1b>
cmpb   $0x0,(%rdi)
je     111b <string_length+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <string_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @string_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add nuw nsw i32 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
int get_ncpu() {
  int ncpu = 1;
  return ncpu;
}


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

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

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

LLVM IR (-O2):
define i32 @get_ncpu() {
ret i32 1
}
void nestedIterFree(struct NestedIterator *iter) {}


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

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

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

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