xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dmb();
int /*<<< orphan*/ flush_range(void *, void *);
int /*<<< orphan*/ mailboxRecv();
int /*<<< orphan*/ mailboxSend(unsigned int);
void sendTagBuffer(volatile unsigned int *buffer) {
  flush_range((void *)buffer, (void *)buffer + buffer[0]);
  mailboxSend(((unsigned int)buffer & ~0xf) | 8);
  mailboxRecv();
  dmb();
}


x86 assembly (clang, -O0):
<sendTagBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,%eax
add    %rax,%rsi
call   1040 <flush_range@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
and    $0xfffffff0,%edi
or     $0x8,%edi
call   1050 <mailboxSend@plt>
mov    $0x0,%al
call   1030 <mailboxRecv@plt>
mov    $0x0,%al
call   1060 <dmb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendTagBuffer>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
add    %rdi,%rsi
call   1040 <flush_range@plt>
and    $0xfffffff0,%ebx
or     $0x8,%ebx
mov    %ebx,%edi
call   1050 <mailboxSend@plt>
xor    %eax,%eax
call   1030 <mailboxRecv@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <dmb@plt>

LLVM IR (-O0):
define void @sendTagBuffer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = load i32*, i32** %2
%6 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load volatile i32, i32* %8
%10 = zext i32 %9 to i64
%11 = getelementptr i8, i8* %6, i64 %10
%12 = call i32 @flush_range(i8* %4, i8* %11)
%13 = load i32*, i32** %2
%14 = ptrtoint i32* %13 to i32
%15 = and i32 %14, -16
%16 = or i32 %15, 8
%17 = call i32 @mailboxSend(i32 %16)
%18 = call i32 (...) @mailboxRecv()
%19 = call i32 (...) @dmb()
ret void
}

LLVM IR (-O2):
define void @sendTagBuffer(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = load volatile i32, i32* %0
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* %2, i64 %4
%6 = tail call i32 @flush_range(i8* %2, i8* %5)
%7 = ptrtoint i32* %0 to i64
%8 = trunc i64 %7 to i32
%9 = and i32 %8, -16
%10 = or i32 %9, 8
%11 = tail call i32 @mailboxSend(i32 %10)
%12 = tail call i32 (...) @mailboxRecv()
%13 = tail call i32 (...) @dmb()
ret void
}
void dv3o_sub(double *output, double *a, double *b) {
  output[0] = a[0] - b[0];
  output[1] = a[1] - b[1];
  output[2] = a[2] - b[2];
}


x86 assembly (clang, -O0):
<dv3o_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv3o_sub>:
movsd  (%rsi),%xmm0
subsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
subsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
subsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @dv3o_sub(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @dv3o_sub(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IdentityMatrix(float *);
int /*<<< orphan*/ MultiplyMatrix(float *, float *, float *);
int /*<<< orphan*/ TranslationMatrix(float *, float const, float const,
                                     float const);
void TranslationMatrixM(float *_matrix, const float x, const float y,
                        const float z) {
  float _m[16];
  IdentityMatrix(_m);
  TranslationMatrix(_m, x, y, z);
  MultiplyMatrix(_m, _matrix, _matrix);
}


x86 assembly (clang, -O0):
<TranslationMatrixM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <IdentityMatrix@plt>
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1050 <TranslationMatrix@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <MultiplyMatrix@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TranslationMatrixM>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
mov    %rdi,%rbx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <IdentityMatrix@plt>
mov    %r14,%rdi
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
call   1050 <TranslationMatrix@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1040 <MultiplyMatrix@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TranslationMatrixM(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [16 x float]
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%11 = call i32 @IdentityMatrix(float* %10)
%12 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%13 = load float, float* %6
%14 = load float, float* %7
%15 = load float, float* %8
%16 = call i32 @TranslationMatrix(float* %12, float %13, float %14, float %15)
%17 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%18 = load float*, float** %5
%19 = load float*, float** %5
%20 = call i32 @MultiplyMatrix(float* %17, float* %18, float* %19)
ret void
}

LLVM IR (-O2):
define void @TranslationMatrixM(float* %0, float %1, float %2, float %3) {
%5 = alloca [16 x float]
%6 = bitcast [16 x float]* %5 to i8*
%7 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%8 = call i32 @IdentityMatrix(float* %7)
%9 = call i32 @TranslationMatrix(float* %7, float %1, float %2, float %3)
%10 = call i32 @MultiplyMatrix(float* %7, float* %0, float* %0)
ret void
}
int f(_Bool x) { return (x == 1); }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i1 zeroext %0) {
%2 = zext i1 %0 to i32
ret i32 %2
}
void reloc_test_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @reloc_test_exit() {
ret void
}
int ptr_is_quad(const void *p) {
  return (((const char *)p - (const char *)0) & 3) == 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ptr_is_quad(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 3
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rotr(int, int);
uint32_t S1(uint32_t x) { return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); }


x86 assembly (clang, -O0):
<S1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
call   1030 <rotr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb,%esi
call   1030 <rotr@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x19,%esi
call   1030 <rotr@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S1>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x6,%esi
call   1030 <rotr@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xb,%esi
call   1030 <rotr@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
mov    %ebx,%edi
mov    $0x19,%esi
call   1030 <rotr@plt>
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @S1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rotr(i32 %3, i32 6)
%5 = load i32, i32* %2
%6 = call i32 @rotr(i32 %5, i32 11)
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @rotr(i32 %8, i32 25)
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @S1(i32 %0) {
%2 = tail call i32 @rotr(i32 %0, i32 6)
%3 = tail call i32 @rotr(i32 %0, i32 11)
%4 = xor i32 %3, %2
%5 = tail call i32 @rotr(i32 %0, i32 25)
%6 = xor i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ reach_error();
int main() {
  int a, b;
  int *p1 = &a;
  int *p2 = &a;
  if (p1 != p2) {
    goto ERROR;
  }
  return 0;
ERROR : {
  reach_error();
  abort();
}
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1152 <main+0x32>
jmp    115a <main+0x3a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1040 <reach_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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*
%5 = alloca i32*
store i32 0, i32* %1
store i32* %2, i32** %4
store i32* %2, i32** %5
%6 = load i32*, i32** %4
%7 = load i32*, i32** %5
%8 = icmp ne i32* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %0
br label %11
10: ; preds = %0
ret i32 0
11: ; preds = %9
%12 = call i32 (...) @reach_error()
%13 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add(char *, char *, int, int /*<<< orphan*/, int);
int atoi(char *);
scalar_t__ malloc(int);
int main(int argc, char *argv[]) {
  char *v;
  int max = 3;
  if (argc > 1)
    max = atoi(argv[1]);
  v = (char *)malloc((max + 1) * sizeof(char));
  add(v, "5678", 4, 0, max);
  return 0;
}


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   $0x3,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1167 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%r8d
lea    0xe73(%rip),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <add@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%ebx
cmp    $0x2,%edi
jl     1146 <main+0x16>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
call   1030 <add@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"5678\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %7
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 1
%20 = trunc i64 %19 to i32
%21 = call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %6
%23 = load i8*, i8** %6
%24 = load i32, i32* %7
%25 = call i32 @add(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i32 0, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"5678\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 3, %2 ]
%10 = add nsw i32 %9, 1
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
%13 = tail call i32 @add(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i32 0, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_size(int);
void size2(void) { set_size(2); }


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

x86 assembly (clang, -O2):
<size2>:
mov    $0x2,%edi
jmp    1030 <set_size@plt>

LLVM IR (-O0):
define void @size2() {
%1 = call i32 @set_size(i32 2)
ret void
}

LLVM IR (-O2):
define void @size2() {
%1 = tail call i32 @set_size(i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_sdsnansumpw(int /*<<< orphan*/ const, float const *,
                                 int /*<<< orphan*/ const);
float stdlib_strided_sdsnansum(const int64_t N, const float *X,
                               const int64_t stride) {
  return stdlib_strided_sdsnansumpw(N, X, stride);
}


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

x86 assembly (clang, -O2):
<stdlib_strided_sdsnansum>:
jmp    1030 <stdlib_strided_sdsnansumpw@plt>

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

LLVM IR (-O2):
define float @stdlib_strided_sdsnansum(i32 %0, float* %1, i32 %2) {
%4 = tail call float @stdlib_strided_sdsnansumpw(i32 %0, float* %1, i32 %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *);
void err(const char *msg) {
  printf(msg);
  printf("------- End MergeSort -------\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"------- End MergeSort -------\0A\00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [30 x i8] c"------- End MergeSort -------\00"
define void @err(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int test_imm_A0uint8_mem(unsigned char *val) {
  return ((*val) & (0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xa0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -96
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ff_hevc_put_hevc_bi_epel_h32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h32_8_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int socket_set(int, int, int, int *, int);
int socket_set_int(int fd, int level, int optname, int opt) {
  return socket_set(fd, level, optname, &opt, sizeof(opt));
}


x86 assembly (clang, -O0):
<socket_set_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <socket_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_set_int>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <socket_set@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @socket_set_int(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = call i32 @socket_set(i32 %0, i32 %1, i32 %2, i32* %5, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ log_allocation(char *, size_t, void *);
void *real_aligned_alloc(size_t, size_t);
void *aligned_alloc(size_t alignment, size_t size) {
  void *ptr = real_aligned_alloc(alignment, size);
  log_allocation("aligned_alloc", size, ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<aligned_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <real_aligned_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb0(%rip),%rdi
call   1030 <log_allocation@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <real_aligned_alloc@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <log_allocation@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"aligned_alloc\00"
define i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @real_aligned_alloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i64, i64* %4
%10 = load i8*, i8** %5
%11 = call i32 @log_allocation(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %9, i8* %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"aligned_alloc\00"
define i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = tail call i8* @real_aligned_alloc(i64 %0, i64 %1)
%4 = tail call i32 @log_allocation(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %1, i8* %3)
ret i8* %3
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf6(int f, int n) { return (cbuf(f, n, 6)); }


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

x86 assembly (clang, -O2):
<cbuf6>:
mov    $0x6,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf6(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 @cbuf(i32 %5, i32 %6, i32 6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf6(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 6)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gdata() { ol("data"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"data\00"
define i32 @gdata() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"data\00"
define i32 @gdata() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int test_imm_F6int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F6int64_highword_mem>:
testb  $0xf6,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F6int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1056561954816
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
scalar_t__ __toupper(int);
wint_t towupper(wint_t wc) {
  int c;
  c = (int)wc;
  return ((wint_t)__toupper(c));
}


x86 assembly (clang, -O0):
<towupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__toupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towupper>:
jmp    1030 <__toupper@plt>

LLVM IR (-O0):
define i64 @towupper(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @__toupper(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @towupper(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i64 @__toupper(i32 %2)
ret i64 %3
}
/* Variables and functions */
unsigned int constant_time_msb(unsigned int);
unsigned int constant_time_lt(unsigned int a, unsigned int b) {
  return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b)));
}


x86 assembly (clang, -O0):
<constant_time_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
xor    -0x8(%rbp),%ecx
or     %ecx,%eax
xor    %eax,%edi
call   1030 <constant_time_msb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_time_lt>:
mov    %edi,%eax
sub    %esi,%eax
xor    %esi,%eax
xor    %edi,%esi
or     %esi,%eax
xor    %eax,%edi
jmp    1030 <constant_time_msb@plt>

LLVM IR (-O0):
define i32 @constant_time_lt(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* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub i32 %9, %10
%12 = load i32, i32* %4
%13 = xor i32 %11, %12
%14 = or i32 %8, %13
%15 = xor i32 %5, %14
%16 = call i32 @constant_time_msb(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @constant_time_lt(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = sub i32 %0, %1
%5 = xor i32 %4, %1
%6 = or i32 %5, %3
%7 = xor i32 %6, %0
%8 = tail call i32 @constant_time_msb(i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void start_progress(void) { printf("\033[?25l"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @start_progress() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @start_progress() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int jump_inside_loop(int p) {
  int i = 0;
  if (p > 0) {
    goto Loop;
  } else {
    return p;
  }
  while (i < 500) {
  Loop:
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<jump_inside_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <jump_inside_loop+0x1d>
jmp    113a <jump_inside_loop+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <jump_inside_loop+0x4f>
cmpl   $0x1f4,-0xc(%rbp)
jge    1148 <jump_inside_loop+0x48>
jmp    113a <jump_inside_loop+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <jump_inside_loop+0x28>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_inside_loop>:
test   %edi,%edi
mov    $0x1,%eax
cmovle %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @jump_inside_loop(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = select i1 %2, i32 %0, i32 1
ret i32 %3
}
void ff_hevc_put_hevc_uni_w_epel_h32_8_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ send_IPI_mask_sequence(struct cpumask const *, int);
void send_IPI_mask(const struct cpumask *mask, int vector) {
  send_IPI_mask_sequence(mask, vector);
}


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

x86 assembly (clang, -O2):
<send_IPI_mask>:
jmp    1030 <send_IPI_mask_sequence@plt>

LLVM IR (-O0):
%struct.cpumask = type { i32 }
define void @send_IPI_mask(%struct.cpumask* %0, i32 %1) {
%3 = alloca %struct.cpumask*
%4 = alloca i32
store %struct.cpumask* %0, %struct.cpumask** %3
store i32 %1, i32* %4
%5 = load %struct.cpumask*, %struct.cpumask** %3
%6 = load i32, i32* %4
%7 = call i32 @send_IPI_mask_sequence(%struct.cpumask* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.cpumask = type { i32 }
define void @send_IPI_mask(%struct.cpumask* %0, i32 %1) {
%3 = tail call i32 @send_IPI_mask_sequence(%struct.cpumask* %0, i32 %1)
ret void
}
unsigned short __atomic_fetch_or_2(volatile void *atom, unsigned short value,
                                   int memorder) {
  unsigned short xchg;
  unsigned short cmp;
  __atomic_load((unsigned short *)atom, (unsigned short *)&cmp, 0);
  do {
    xchg = ((cmp | value));
  } while (
      !__atomic_compare_exchange((unsigned short *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_or_2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
movzwl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%ax
mov    -0x12(%rbp),%dx
lock cmpxchg %dx,(%rcx)
mov    %ax,%cx
sete   %al
mov    %al,-0x19(%rbp)
mov    %cx,-0x18(%rbp)
test   $0x1,%al
jne    1159 <__atomic_fetch_or_2+0x59>
mov    -0x18(%rbp),%ax
mov    %ax,-0x14(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111d <__atomic_fetch_or_2+0x1d>
movzwl -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_or_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
mov    %ecx,%edx
or     %esi,%edx
lock cmpxchg %dx,(%rdi)
jne    1110 <__atomic_fetch_or_2+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @__atomic_fetch_or_2(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i16*
%12 = load atomic i16, i16* %11 monotonic
store i16 %12, i16* %8
br label %13
13: ; preds = %29, %3
%14 = load i16, i16* %8
%15 = zext i16 %14 to i32
%16 = load i16, i16* %5
%17 = zext i16 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i16
store i16 %19, i16* %7
br label %20
20: ; preds = %13
%21 = load i8*, i8** %4
%22 = bitcast i8* %21 to i16*
%23 = load i16, i16* %8
%24 = load i16, i16* %7
%25 = cmpxchg weak i16* %22, i16 %23, i16 %24 seq_cst seq_cst
%26 = extractvalue { i16, i1 } %25, 0
%27 = extractvalue { i16, i1 } %25, 1
br i1 %27, label %29, label %28
28: ; preds = %20
store i16 %26, i16* %8
br label %29
29: ; preds = %28, %20
%30 = zext i1 %27 to i8
store i8 %30, i8* %9
%31 = load i8, i8* %9
%32 = trunc i8 %31 to i1
%33 = xor i1 %32, true
br i1 %33, label %13, label %34
34: ; preds = %29
%35 = load i16, i16* %8
ret i16 %35
}

LLVM IR (-O2):
define zeroext i16 @__atomic_fetch_or_2(i8* nocapture %0, i16 zeroext %1, i32 %2) {
%4 = bitcast i8* %0 to i16*
%5 = load atomic i16, i16* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i16 [ %5, %3 ], [ %11, %6 ]
%8 = or i16 %7, %1
%9 = cmpxchg weak i16* %4, i16 %7, i16 %8 seq_cst seq_cst
%10 = extractvalue { i16, i1 } %9, 1
%11 = extractvalue { i16, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i16 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
char *ptime();
void log_(char *str) {
  FILE *f = fopen("proolhttpd.log", "a");
  if (f) {
    fprintf(f, "%s %s\n", ptime(), str);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<log_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     119d <log_+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <ptime@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xe82(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeb2(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     118d <log_+0x4d>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <ptime@plt>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"proolhttpd.log\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [7 x i8] c"%s %s\0A\00"
define void @log_(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = call i8* (...) @ptime()
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"proolhttpd.log\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [7 x i8] c"%s %s\0A\00"
define void @log_(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* (...) @ptime()
%6 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %5, i8* %0)
%7 = tail call i32 @fclose(i32* %2)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int filenameStrcmp(const char *s1, const char *s2) { return strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<filenameStrcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @filenameStrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int _generate_random(char *buff, int len) {
  if (len == -1)
    return -1;
  int x = 0;
  x = *((int *)buff);
  return x;
}


x86 assembly (clang, -O0):
<_generate_random>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1121 <_generate_random+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1137 <_generate_random+0x37>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_generate_random>:
cmp    $0xffffffff,%esi
je     1108 <_generate_random+0x8>
mov    (%rdi),%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @_generate_random(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
unsigned long hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = hash * 33 + c;
  return hash % 100000;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1143 <hash+0x43>
imul   $0x21,-0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
mov    $0x186a0,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1152 <hash+0x52>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
mov    %rcx,%rdx
shl    $0x5,%rdx
add    %rcx,%rdx
movsbq %al,%rcx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
mov    %rcx,%rax
shr    $0x5,%rax
movabs $0xa7c5ac471b47843,%rdx
5a 7c 0a
mul    %rdx
shr    $0x7,%rdx
imul   $0x186a0,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 5381, i64* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %5
%12 = load i64, i64* %3
%13 = mul i64 %12, 33
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = add i64 %13, %15
store i64 %16, i64* %3
br label %5
17: ; preds = %5
%18 = load i64, i64* %3
%19 = urem i64 %18, 100000
ret i64 %19
}

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %11, 100000
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 5381, %1 ], [ %15, %14 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xe8() {
  Assert_real((isalpha(232) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1165, ("isalpha should be 0 for 0xe8"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xe8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe8,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x48d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x48d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xe8\00"
define void @t_isalpha_0xe8() {
%1 = call i64 @isalpha(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xe8\00"
define void @t_isalpha_0xe8() {
%1 = tail call i64 @isalpha(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pread(int, unsigned long long *, int, int);
char rapl_read_msr(int fd_msr, int offset, unsigned long long *buf) {
  if (pread(fd_msr, buf, sizeof(unsigned long long), offset) !=
      sizeof(unsigned long long))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<rapl_read_msr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x8,%edx
call   1030 <pread@plt>
cltq
cmp    $0x8,%rax
je     114b <rapl_read_msr+0x3b>
movb   $0x0,-0x1(%rbp)
jmp    114f <rapl_read_msr+0x3f>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_read_msr>:
push   %rax
mov    %esi,%ecx
mov    %rdx,%rsi
mov    $0x8,%edx
call   1030 <pread@plt>
cmp    $0x8,%eax
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @rapl_read_msr(i32 %0, i32 %1, i64* nocapture %2) {
%4 = tail call i32 @pread(i32 %0, i64* %2, i32 8, i32 %1)
%5 = icmp eq i32 %4, 8
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: clockdiff [-o] <host>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: clockdiff [-o] <host>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: clockdiff [-o] <host>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}