xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ problem(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void set_env(char *name, char *value) {
  if (name == NULL || value == NULL)
    return;
  problem("Cannot set environment", NULL, NULL);
}


x86 assembly (clang, -O0):
<set_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <set_env+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <set_env+0x2b>
jmp    114e <set_env+0x3e>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <problem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_env>:
test   %rdi,%rdi
je     112a <set_env+0x1a>
test   %rsi,%rsi
je     112a <set_env+0x1a>
lea    0xedf(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <problem@plt>
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Cannot set environment\00"
define void @set_env(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 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %13
11: ; preds = %7
%12 = call i32 @problem(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
br label %13
13: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Cannot set environment\00"
define void @set_env(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @problem(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
br label %8
8: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc13(int status, void *arg) {
  printf("Executing exitfunc"
         "13"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc13>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Executing exitfunc13 (status=%d, arg=%lu)\0A\00"
define void @exitfunc13(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 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Executing exitfunc13 (status=%d, arg=%lu)\0A\00"
define void @exitfunc13(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
/* Type definitions */
struct page_context {
  int dummy;
};

/* Variables and functions */
void *vmm_alloc_block(struct page_context *, int /*<<< orphan*/);
void *vmm_alloc_block_kernel(struct page_context *ctx) {
  return vmm_alloc_block(ctx, 0);
}


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

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

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

LLVM IR (-O2):
%struct.page_context = type { i32 }
define i8* @vmm_alloc_block_kernel(%struct.page_context* %0) {
%2 = tail call i8* @vmm_alloc_block(%struct.page_context* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int d, y, m;
  scanf("%i-%i-%i", &d, &m, &y);
  printf("%i/%i/%i\n", y, m, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%i-%i-%i\00"
@.str.1 = [10 x i8] c"%i/%i/%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %3, i32* %2)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glmMax3fs(float *, float *, float);
void glmMax3fs_(float x[3], float y) { glmMax3fs(x, x, y); }


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

x86 assembly (clang, -O2):
<glmMax3fs_>:
mov    %rdi,%rsi
jmp    1030 <glmMax3fs@plt>

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

LLVM IR (-O2):
define void @glmMax3fs_(float* %0, float %1) {
%3 = tail call i32 @glmMax3fs(float* %0, float* %0, float %1)
ret void
}
/* Variables and functions */
double dProbN(double, int /*<<< orphan*/);
double DProbNormal(double x) { return dProbN(x, 0); }


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

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

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

LLVM IR (-O2):
define double @DProbNormal(double %0) {
%2 = tail call double @dProbN(double %0, i32 0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("hello, i'm a shared library\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"hello, i'm a shared library\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"hello, i'm a shared library\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int print_usage() {
  printf(" Usage: lu_d2mce [options]\n");
  printf(" Option:\n");
  printf(" \t[ -s <vector size> ] (default: %d)\n", 1024);
  printf(" \t[ -n <number of nodes> ] (default: %d)\n", 1);
  return 1;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x400,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c" Usage: lu_d2mce [options]\0A\00"
@.str.1 = [10 x i8] c" Option:\0A\00"
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
@.str.3 = [42 x i8] c" \09[ -n <number of nodes> ] (default: %d)\0A\00"
define i32 @print_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 1
}

LLVM IR (-O2):
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
@.str.3 = [42 x i8] c" \09[ -n <number of nodes> ] (default: %d)\0A\00"
@str = [27 x i8] c" Usage: lu_d2mce [options]\00"
@str.4 = [9 x i8] c" Option:\00"
define i32 @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 1
}
int sumDigit(int n) {
  int sum = 0;
  while (n) {
    sum += n % 10;
    n /= 10;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<sumDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <sumDigit+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sumDigit+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumDigit>:
xor    %eax,%eax
test   %edi,%edi
je     113b <sumDigit+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <sumDigit+0x10>
ret

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

LLVM IR (-O2):
define i32 @sumDigit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vec3d_dot(double const *, double const *);
double vec3d_norm(const double A[3]) { return sqrt(vec3d_dot(A, A)); }


x86 assembly (clang, -O0):
<vec3d_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec3d_dot@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3d_norm>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec3d_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @vec3d_norm(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double*, double** %2
%5 = call i32 @vec3d_dot(double* %3, double* %4)
%6 = call double @sqrt(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @vec3d_norm(double* %0) {
%2 = tail call i32 @vec3d_dot(double* %0, double* %0)
%3 = tail call double @sqrt(i32 %2)
ret double %3
}
int __ltlong(long a, long b) { return a < b; }


x86 assembly (clang, -O0):
<__ltlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltlong>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @__ltlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__ltlong(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ border_width;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xconfigurerequest_border_width(void *_p) {
  return (int)((XEvent *)_p)->xconfigurerequest.border_width;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xconfigurerequest_border_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void ScaleARGBRowDownEvenBox_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDownEvenBox_NEON() {
ret void
}
int addDigits(int num) { return 1 + (num - 1) % 9; }


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
add    $0xffffffff,%edi
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = srem i32 %2, 9
%4 = add nsw i32 %3, 1
ret i32 %4
}
_Complex long double test_casinl(_Complex long double x) {
  return __builtin_casinl(x);
}


x86 assembly (clang, -O0):
<test_casinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1030 <casinl@plt>
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_casinl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fxch   %st(1)
fstpt  0x20(%rsp)
fstpt  0x30(%rsp)
movaps 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <casinl@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @test_casinl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = call { x86_fp80, x86_fp80 } @casinl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
%11 = extractvalue { x86_fp80, x86_fp80 } %10, 0
%12 = extractvalue { x86_fp80, x86_fp80 } %10, 1
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%14 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %11, x86_fp80* %13
store x86_fp80 %12, x86_fp80* %14
%15 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %15
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @test_casinl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %4, x86_fp80* %7
store x86_fp80 %6, x86_fp80* %8
%9 = tail call { x86_fp80, x86_fp80 } @casinl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
ret { x86_fp80, x86_fp80 } %9
}
/* Variables and functions */
int /*<<< orphan*/ cpropep();
void doit() { cpropep(); }


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

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

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

LLVM IR (-O2):
define void @doit() {
%1 = tail call i32 (...) @cpropep()
ret void
}
/* Variables and functions */
long double powl(long double, long double);
long double pow10l(long double x) { return powl(10.0L, x); }


x86 assembly (clang, -O0):
<pow10l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
flds   0xed3(%rip)
fstpt  (%rax)
call   1030 <powl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow10l>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fstpt  0x10(%rsp)
flds   0xede(%rip)
fstpt  (%rsp)
call   1030 <powl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @pow10l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @powl(x86_fp80 0xK4002A000000000000000, x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @pow10l(x86_fp80 %0) {
%2 = tail call x86_fp80 @powl(x86_fp80 0xK4002A000000000000000, x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t inet_checksum_fold(uint32_t sum) {
  sum = (sum >> 16) + (sum & 0xffff);
  return ~((sum >> 16) + sum);
}


x86 assembly (clang, -O0):
<inet_checksum_fold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
add    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_checksum_fold>:
movzwl %di,%ecx
sar    $0x10,%edi
add    %edi,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
add    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @inet_checksum_fold(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 16
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = xor i32 %11, -1
ret i32 %12
}

LLVM IR (-O2):
define i32 @inet_checksum_fold(i32 %0) {
%2 = ashr i32 %0, 16
%3 = and i32 %0, 65535
%4 = add nsw i32 %2, %3
%5 = ashr i32 %4, 16
%6 = add nsw i32 %5, %4
%7 = xor i32 %6, -1
ret i32 %7
}
/* Variables and functions */
int ENODEV;
int sandbox_sdl_sound_init(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<sandbox_sdl_sound_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sandbox_sdl_sound_init>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @sandbox_sdl_sound_init() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sandbox_sdl_sound_init() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_19_recursive(double *, int);
void helper_double_19(double *buf) { helper_double_19_recursive(buf, 19); }


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

x86 assembly (clang, -O2):
<helper_double_19>:
mov    $0x13,%esi
jmp    1030 <helper_double_19_recursive@plt>

LLVM IR (-O0):
define void @helper_double_19(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @helper_double_19_recursive(double* %3, i32 19)
ret void
}

LLVM IR (-O2):
define void @helper_double_19(double* %0) {
%2 = tail call i32 @helper_double_19_recursive(double* %0, i32 19)
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
int isidentifierchar(unsigned char c) { return isalnum((int)c) || (c == '_'); }


x86 assembly (clang, -O0):
<isidentifierchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <isidentifierchar+0x36>
movzbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isidentifierchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isidentifierchar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = call i64 @isalnum(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 95
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isidentifierchar(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i64 @isalnum(i32 %2)
%4 = icmp ne i64 %3, 0
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
void I420ToRGBA() {}


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

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

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

LLVM IR (-O2):
define void @I420ToRGBA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *exec) {
  fprintf(stderr, "Usage: %s chip_select channel value\n", exec);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s chip_select channel value\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s chip_select channel value\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
ttflush() { fflush(stdout); }


x86 assembly (clang, -O0):
<ttflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
define i32 @ttflush() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @ttflush() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret i32 undef
}
void __NOP() { __asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @__NOP() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void x6() { printf(" x6-2"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c" x6-2\00"
define void @x6() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" x6-2\00"
define void @x6() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int while_unique_def_FN(int p) {
  int j = 0;
  while (j < 10) {
    if (p > 0) {
      j = 500;
    } else {
      j = -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<while_unique_def_FN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    113a <while_unique_def_FN+0x3a>
cmpl   $0x0,-0x4(%rbp)
jle    112e <while_unique_def_FN+0x2e>
movl   $0x1f4,-0x8(%rbp)
jmp    1135 <while_unique_def_FN+0x35>
movl   $0xffffffff,-0x8(%rbp)
jmp    110e <while_unique_def_FN+0xe>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<while_unique_def_FN>:
test   %edi,%edi
jle    1100 <while_unique_def_FN>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @while_unique_def_FN(i32 %0) {
%2 = icmp slt i32 %0, 1
br label %3
3: ; preds = %3, %1
br i1 %2, label %3, label %4
4: ; preds = %3
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, float *, int);
void modbus_set_float(float real, uint16_t *dest) {
  uint32_t i = 0;
  memcpy(&i, &real, sizeof(i));
  dest[0] = (uint16_t)i;
  dest[1] = (uint16_t)(i >> 16);
}


x86 assembly (clang, -O0):
<modbus_set_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movslq -0x14(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbus_set_float>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movslq 0x8(%rsp),%rax
mov    %rax,(%rbx)
sar    $0x10,%eax
cltq
mov    %rax,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @modbus_set_float(float %0, i64* %1) {
%3 = alloca float
%4 = alloca i64*
%5 = alloca i32
store float %0, float* %3
store i64* %1, i64** %4
store i32 0, i32* %5
%6 = call i32 @memcpy(i32* %5, float* %3, i32 4)
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %4
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
%11 = load i32, i32* %5
%12 = ashr i32 %11, 16
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 1
store i64 %13, i64* %15
ret void
}

LLVM IR (-O2):
define void @modbus_set_float(float %0, i64* nocapture writeonly %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @memcpy(i32* %4, float* %3, i32 4)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
store i64 %8, i64* %1
%9 = ashr i32 %7, 16
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %10, i64* %11
ret void
}
char *hash_plugin_detailed(void) {
  return ("sha1sha1 - A sha1(sha1(pass)) plugin\n"
          "------------------------\n"
          "Use this module to crack sha1(sha1(pass)) hashes\n"
          "Input should be in form: \'user:hash\'\n"
          "Known software that uses this password hashing method:\n"
          "radiant\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [257 x i8] c"sha1sha1 - A sha1(sha1(pass)) plugin\0A------------------------\0AUse this module to crack sha1(sha1(pass)) hashes\0AInput should be in form: 'user:hash'\0AKnown software that uses this password hashing method:\0Aradiant\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [257 x i8] c"sha1sha1 - A sha1(sha1(pass)) plugin\0A------------------------\0AUse this module to crack sha1(sha1(pass)) hashes\0AInput should be in form: 'user:hash'\0AKnown software that uses this password hashing method:\0Aradiant\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0)
}
void pwmWritePiFace(int pin, int value) {}


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

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

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

LLVM IR (-O2):
define void @pwmWritePiFace(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main() {
  sigset_t m1, m2;
  sigfillset(&m1);
  int err = sigprocmask(SIG_BLOCK, &m1, &m2);
  assert(err == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <sigfillset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigfillset@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <sigprocmask@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @sigfillset(i32* %2)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32* %3)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigfillset(i32* %1)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %1, i32* %2)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
void swapstk(void) { ol("ex\t(sp),hl"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"ex\09(sp),hl\00"
define void @swapstk() {
%1 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"ex\09(sp),hl\00"
define void @swapstk() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ arr_display(int *, int);
int /*<<< orphan*/ shuffle(int *, int);
void main() {
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int len = sizeof(arr) / sizeof(arr[0]);
  shuffle(arr, len);
  arr_display(arr, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <shuffle@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <arr_display@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <arr_display@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
store i32 10, i32* %2
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @shuffle(i32* %4, i32 %5)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @arr_display(i32* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define void @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @shuffle(i32* %3, i32 10)
%5 = call i32 @arr_display(i32* %3, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ltrim(char *);
int /*<<< orphan*/ strcrop(char *);
char *trim(char *strin) {
  ltrim(strin);
  strcrop(strin);
  return strin;
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ltrim@plt>
mov    %rbx,%rdi
call   1040 <strcrop@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim(i8* returned %0) {
%2 = tail call i32 @ltrim(i8* %0)
%3 = tail call i32 @strcrop(i8* %0)
ret i8* %0
}
void f6(signed short x) {}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f6(i16 signext %0) {
ret void
}
int convert_nth_position(int number, int position) {
  return (number ^ (1 << position));
}


x86 assembly (clang, -O0):
<convert_nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @convert_nth_position(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @convert_nth_position(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
void isr_hardfault(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<isr_hardfault>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <isr_hardfault+0x9>
jmp    1109 <isr_hardfault+0x9>

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

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

LLVM IR (-O2):
define void @isr_hardfault() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ terminal_output_string(char *);
void ushell_prompt() {
  terminal_output_string("\x1b"
                         "[0m"
                         "\x1b"
                         "[36m"
                         "ushell"
                         "\x1b"
                         "[35m"
                         ":~$ "
                         "\x1b"
                         "[0m"
                         "\x1b"
                         "[K");
  ;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"\1B[0m\1B[36mushell\1B[35m:~$ \1B[0m\1B[K\00"
define void @ushell_prompt() {
%1 = call i32 @terminal_output_string(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\1B[0m\1B[36mushell\1B[35m:~$ \1B[0m\1B[K\00"
define void @ushell_prompt() {
%1 = tail call i32 @terminal_output_string(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int gbser_set_port(void *, unsigned int, int, int /*<<< orphan*/, int);
int gbser_set_speed(void *handle, unsigned speed) {
  return gbser_set_port(handle, speed, 8, 0, 1);
}


x86 assembly (clang, -O0):
<gbser_set_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x8,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <gbser_set_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbser_set_speed>:
mov    $0x8,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <gbser_set_port@plt>

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

LLVM IR (-O2):
define i32 @gbser_set_speed(i8* %0, i32 %1) {
%3 = tail call i32 @gbser_set_port(i8* %0, i32 %1, i32 8, i32 0, i32 1)
ret i32 %3
}
void init(int bucket[512 * 4]) {
  int i;
init_1:
  for (i = 0; i < 512 * 4; i++) {
    bucket[i] = 0;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x800,-0xc(%rbp)
jge    1139 <init+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    $0x2000,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
bool FileExistCheck(char *file_name) {
  if (access(file_name, F_OK) != -1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<FileExistCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1143 <FileExistCheck+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <FileExistCheck+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileExistCheck>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @FileExistCheck(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}