xunge/DecIR huggingface dataset:
/* Variables and functions */
double M_PI;
int cos(double);
double LSKeyframeAnimationFunctionEaseInOutSine(double t, double b, double c,
                                                double d) {
  return -c / 2 * (cos(M_PI * t / d) - 1) + b;
}


x86 assembly (clang, -O0):
<LSKeyframeAnimationFunctionEaseInOutSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e88(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <cos@plt>
movsd  -0x28(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSKeyframeAnimationFunctionEaseInOutSine>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mulsd  0xede(%rip),%xmm2
movsd  %xmm2,0x8(%rsp)
mov    0x2eb9(%rip),%rax
mulsd  (%rax),%xmm0
divsd  %xmm3,%xmm0
call   1030 <cos@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @LSKeyframeAnimationFunctionEaseInOutSine(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = fneg double %9
%11 = fdiv double %10, 2.000000e+00
%12 = load double, double* @M_PI
%13 = load double, double* %5
%14 = fmul double %12, %13
%15 = load double, double* %8
%16 = fdiv double %14, %15
%17 = call i32 @cos(double %16)
%18 = sub nsw i32 %17, 1
%19 = sitofp i32 %18 to double
%20 = load double, double* %6
%21 = call double @llvm.fmuladd.f64(double %11, double %19, double %20)
ret double %21
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @LSKeyframeAnimationFunctionEaseInOutSine(double %0, double %1, double %2, double %3) {
%5 = fmul double %2, -5.000000e-01
%6 = load double, double* @M_PI
%7 = fmul double %6, %0
%8 = fdiv double %7, %3
%9 = tail call i32 @cos(double %8)
%10 = add nsw i32 %9, -1
%11 = sitofp i32 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %5, double %11, double %1)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float real = 0;
  scanf("%f", &real);
  printf("real: %f\n", real);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [10 x i8] c"real: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [10 x i8] c"real: %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %4)
ret i32 0
}
int do_637() { return 637; }


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

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

LLVM IR (-O0):
define i32 @do_637() {
ret i32 637
}

LLVM IR (-O2):
define i32 @do_637() {
ret i32 637
}
/* Variables and functions */
int /*<<< orphan*/ KDSETMODE;
int /*<<< orphan*/ KD_TEXT;
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
void c_text_mode(char *tty_file) {
  int tty_fd = open(tty_file, O_RDWR);
  ioctl(tty_fd, KDSETMODE, KD_TEXT);
  close(tty_fd);
}


x86 assembly (clang, -O0):
<c_text_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
call   1030 <ioctl@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_text_mode>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@KDSETMODE = global i32 0
@KD_TEXT = global i32 0
define void @c_text_mode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* @KDSETMODE
%9 = load i32, i32* @KD_TEXT
%10 = call i32 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
ret void
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@KDSETMODE = global i32 0
@KD_TEXT = global i32 0
define void @c_text_mode(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = load i32, i32* @KDSETMODE
%5 = load i32, i32* @KD_TEXT
%6 = tail call i32 @ioctl(i32 %3, i32 %4, i32 %5)
%7 = tail call i32 @close(i32 %3)
ret void
}
/* Type definitions */
struct lldp_tlv {
  int dummy;
};
struct lldp_msap {
  int dummy;
};

/* Variables and functions */
struct lldp_msap *create_msap(struct lldp_tlv *tlv1, struct lldp_tlv *tlv2) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.lldp_msap = type { i32 }
%struct.lldp_tlv = type { i32 }
define %struct.lldp_msap* @create_msap(%struct.lldp_tlv* %0, %struct.lldp_tlv* %1) {
%3 = alloca %struct.lldp_tlv*
%4 = alloca %struct.lldp_tlv*
store %struct.lldp_tlv* %0, %struct.lldp_tlv** %3
store %struct.lldp_tlv* %1, %struct.lldp_tlv** %4
ret %struct.lldp_msap* null
}

LLVM IR (-O2):
%struct.lldp_msap = type { i32 }
%struct.lldp_tlv = type { i32 }
define noalias %struct.lldp_msap* @create_msap(%struct.lldp_tlv* nocapture readnone %0, %struct.lldp_tlv* nocapture readnone %1) {
ret %struct.lldp_msap* null
}
double pomeranceLpow(n, y)
double n;
double y;
{
  double lnN = log(n);
  double res = exp(y * sqrt(lnN * log(lnN)));
  return res;
}


x86 assembly (clang, -O0):
<pomeranceLpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pomeranceLpow>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1040 <log@plt>
movsd  %xmm0,0x8(%rsp)
call   1040 <log@plt>
mulsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1160 <pomeranceLpow+0x30>
sqrtsd %xmm0,%xmm0
jmp    1165 <pomeranceLpow+0x35>
call   1050 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @pomeranceLpow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = call double @log(double %7)
store double %8, double* %5
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %5
%12 = call double @log(double %11)
%13 = fmul double %10, %12
%14 = call double @sqrt(double %13)
%15 = fmul double %9, %14
%16 = call double @exp(double %15)
store double %16, double* %6
%17 = load double, double* %6
ret double %17
}

LLVM IR (-O2):
define double @pomeranceLpow(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = tail call double @log(double %3)
%5 = fmul double %3, %4
%6 = tail call double @sqrt(double %5)
%7 = fmul double %6, %1
%8 = tail call double @exp(double %7)
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int setx_read_buffer(int /*<<< orphan*/ *, void (*)(char *, size_t));
int cli_read_buffer(FILE *buf, void (*p)(char *, size_t)) {
  return (setx_read_buffer(buf, p) == 1);
}


x86 assembly (clang, -O0):
<cli_read_buffer>:
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 <setx_read_buffer@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_read_buffer>:
push   %rax
call   1030 <setx_read_buffer@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cli_read_buffer(i32* %0, void (i8*, i64)* %1) {
%3 = alloca i32*
%4 = alloca void (i8*, i64)*
store i32* %0, i32** %3
store void (i8*, i64)* %1, void (i8*, i64)** %4
%5 = load i32*, i32** %3
%6 = load void (i8*, i64)*, void (i8*, i64)** %4
%7 = call i32 @setx_read_buffer(i32* %5, void (i8*, i64)* %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @cli_read_buffer(i32* %0, void (i8*, i64)* %1) {
%3 = tail call i32 @setx_read_buffer(i32* %0, void (i8*, i64)* %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cm_cleanup();
void lspa_cleanup() { cm_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @lspa_cleanup() {
%1 = tail call i32 (...) @cm_cleanup()
ret void
}
/* Variables and functions */
char *getenv(char *);
char *environ__NativeString__get_environ(char *self) {
  char *var;
  char *var1;
  var1 = getenv(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<environ__NativeString__get_environ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<environ__NativeString__get_environ>:
jmp    1030 <getenv@plt>

LLVM IR (-O0):
define i8* @environ__NativeString__get_environ(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @getenv(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %3
br label %8
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @environ__NativeString__get_environ(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int shm_unlink(const char *name) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @shm_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_argv_string(int argc, char *argv[]) {
  int i;
  if (argc == 0)
    return;
  for (i = 0; i < argc; i++) {
    printf("%s ", argv[i]);
  }
}


x86 assembly (clang, -O0):
<print_argv_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112e <print_argv_string+0x1e>
jmp    1167 <print_argv_string+0x57>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1167 <print_argv_string+0x57>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <print_argv_string+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_argv_string>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <print_argv_string+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_argv_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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


x86 assembly (clang, -O0):
<invalid_acces_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xebf(%rip),%rdi
movsbl 0x4(%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_acces_function>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
movsbl 0x4(%rax),%esi
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @invalid_acces_function() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = load i8, i8* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @invalid_acces_function() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 4
%4 = load i8, i8* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret void
}
void vlistDecodeXyz(int xyz, int (*outDimorder)[3]) {
  (*outDimorder)[0] = xyz / 100, xyz -= (*outDimorder)[0] * 100;
  (*outDimorder)[1] = xyz / 10, xyz -= (*outDimorder)[1] * 10;
  (*outDimorder)[2] = xyz;
}


x86 assembly (clang, -O0):
<vlistDecodeXyz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
imul   $0x64,(%rax),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
imul   $0xa,0x4(%rax),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistDecodeXyz>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
mov    %ecx,(%rsi)
imul   $0xffffff9c,%ecx,%ecx
add    %ecx,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,0x4(%rsi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,0x8(%rsi)
ret

LLVM IR (-O0):
define void @vlistDecodeXyz(i32 %0, [3 x i32]* %1) {
%3 = alloca i32
%4 = alloca [3 x i32]*
store i32 %0, i32* %3
store [3 x i32]* %1, [3 x i32]** %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 100
%7 = load [3 x i32]*, [3 x i32]** %4
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 %6, i32* %8
%9 = load [3 x i32]*, [3 x i32]** %4
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%11 = load i32, i32* %10
%12 = mul nsw i32 %11, 100
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = sdiv i32 %15, 10
%17 = load [3 x i32]*, [3 x i32]** %4
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %17, i64 0, i64 1
store i32 %16, i32* %18
%19 = load [3 x i32]*, [3 x i32]** %4
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %19, i64 0, i64 1
%21 = load i32, i32* %20
%22 = mul nsw i32 %21, 10
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, %22
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = load [3 x i32]*, [3 x i32]** %4
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %26, i64 0, i64 2
store i32 %25, i32* %27
ret void
}

LLVM IR (-O2):
define void @vlistDecodeXyz(i32 %0, [3 x i32]* nocapture writeonly %1) {
%3 = sdiv i32 %0, 100
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32 %3, i32* %4
%5 = mul nsw i32 %3, -100
%6 = add i32 %5, %0
%7 = sdiv i32 %6, 10
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
store i32 %7, i32* %8
%9 = mul nsw i32 %7, -10
%10 = add i32 %9, %6
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
scalar_t__ rand();
unsigned long int randv(unsigned long int max) {
  return (((unsigned long int)rand()) % (max)) + 1;
}


x86 assembly (clang, -O0):
<randv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randv>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1131 <randv+0x21>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
jmp    1137 <randv+0x27>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @randv(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @rand()
%4 = load i64, i64* %2
%5 = urem i64 %3, %4
%6 = add i64 %5, 1
ret i64 %6
}

LLVM IR (-O2):
define i64 @randv(i64 %0) {
%2 = tail call i64 (...) @rand()
%3 = urem i64 %2, %0
%4 = add nuw i64 %3, 1
ret i64 %4
}
int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode,
                        int row, int col) {
  return 0;
}


x86 assembly (clang, -O0):
<dbg_check_lpt_nodes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.ubifs_cnode = type opaque
define i32 @dbg_check_lpt_nodes(%struct.ubifs_info* %0, %struct.ubifs_cnode* %1, i32 %2, i32 %3) {
%5 = alloca %struct.ubifs_info*
%6 = alloca %struct.ubifs_cnode*
%7 = alloca i32
%8 = alloca i32
store %struct.ubifs_info* %0, %struct.ubifs_info** %5
store %struct.ubifs_cnode* %1, %struct.ubifs_cnode** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.ubifs_cnode = type opaque
define i32 @dbg_check_lpt_nodes(%struct.ubifs_info* nocapture readnone %0, %struct.ubifs_cnode* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: svm-prob data_filename hist_filename\n");
  exit(1);
}


x86 assembly (clang, -O0):
<exit_with_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: svm-prob data_filename hist_filename\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [44 x i8] c"Usage: svm-prob data_filename hist_filename\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int special_format(fmt) const char *fmt;
{
  return (strchr(fmt, '*') != 0 || strchr(fmt, 'V') != 0 ||
          strchr(fmt, 'S') != 0 || strchr(fmt, 'n') != 0);
}


x86 assembly (clang, -O0):
<special_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1194 <special_format+0x84>
mov    -0x8(%rbp),%rdi
mov    $0x56,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1194 <special_format+0x84>
mov    -0x8(%rbp),%rdi
mov    $0x53,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1194 <special_format+0x84>
mov    -0x8(%rbp),%rdi
mov    $0x6e,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special_format>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2a,%esi
call   1030 <strchr@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1164 <special_format+0x54>
mov    %rbx,%rdi
mov    $0x56,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1164 <special_format+0x54>
mov    %rbx,%rdi
mov    $0x53,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1164 <special_format+0x54>
mov    %rbx,%rdi
mov    $0x6e,%esi
call   1030 <strchr@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @special_format(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strchr(i8* %3, i32 42)
%5 = icmp ne i8* %4, null
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i8* @strchr(i8* %7, i32 86)
%9 = icmp ne i8* %8, null
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i8* @strchr(i8* %11, i32 83)
%13 = icmp ne i8* %12, null
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8*, i8** %2
%16 = call i8* @strchr(i8* %15, i32 110)
%17 = icmp ne i8* %16, null
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @special_format(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 42)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 86)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 83)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 110)
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %7, %4, %1
%15 = phi i32 [ 1, %7 ], [ 1, %4 ], [ 1, %1 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int var_get_integer_value(char *);
int pager_is_active() { return var_get_integer_value("pager"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"pager\00"
define i32 @pager_is_active() {
%1 = tail call i32 @var_get_integer_value(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Enter a two-digit number: ");
  scanf("%d", &num);
  printf("The reversal is: %d%d\n", num % 10, num / 10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rsi
imul   $0x66666667,%rsi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a two-digit number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"The reversal is: %d%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 10
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a two-digit number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"The reversal is: %d%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 10
%7 = sdiv i32 %5, 10
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool streq(const char *s1, const char *s2) { return strcmp(s1, s2) == 0; }


x86 assembly (clang, -O0):
<streq>:
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>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_redir(void) {
  printf("Status: 303 See Other\r\n");
  printf("Location: ./\r\n");
  printf("\r\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Status: 303 See Other\0D\0A\00"
@.str.1 = [15 x i8] c"Location: ./\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @handle_redir() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Status: 303 See Other\0D\00"
@str.3 = [14 x i8] c"Location: ./\0D\00"
@str.4 = [2 x i8] c"\0D\00"
define void @handle_redir() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
ret void
}
int test6(char x) { return x / 100 >= 3; }


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test6(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp sge i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test6(i8 signext %0) {
ret i32 0
}
/* Variables and functions */
int spg_find_primitive(double **, double **, int *, int, double);
void spg_find_primitive_(double lattice[3][3], double position[][3],
                         int types[], int *num_atom, double *symprec) {
  *num_atom = spg_find_primitive(lattice, position, types, *num_atom, *symprec);
}


x86 assembly (clang, -O0):
<spg_find_primitive_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <spg_find_primitive@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_find_primitive_>:
push   %rbx
mov    %rcx,%rbx
mov    (%rcx),%ecx
movsd  (%r8),%xmm0
call   1030 <spg_find_primitive@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @spg_find_primitive_([3 x double]* %0, [3 x double]* %1, i32* %2, i32* %3, double* %4) {
%6 = alloca [3 x double]*
%7 = alloca [3 x double]*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
store [3 x double]* %0, [3 x double]** %6
store [3 x double]* %1, [3 x double]** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store double* %4, double** %10
%11 = load [3 x double]*, [3 x double]** %6
%12 = bitcast [3 x double]* %11 to double**
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load double*, double** %10
%19 = load double, double* %18
%20 = call i32 @spg_find_primitive(double** %12, double** %14, i32* %15, i32 %17, double %19)
%21 = load i32*, i32** %9
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @spg_find_primitive_([3 x double]* %0, [3 x double]* %1, i32* %2, i32* nocapture %3, double* nocapture %4) {
%6 = bitcast [3 x double]* %0 to double**
%7 = bitcast [3 x double]* %1 to double**
%8 = load i32, i32* %3
%9 = load double, double* %4
%10 = tail call i32 @spg_find_primitive(double** %6, double** %7, i32* %2, i32 %8, double %9)
store i32 %10, i32* %3
ret void
}
int main() {
  int a = 5;
  int *b = &a;
  char *c = (char *)b;
  return 0;
}


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

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 i8*
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
%6 = bitcast i32* %5 to i8*
store i8* %6, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int byte_swap_u32(unsigned int x) {
  return ((unsigned int)(((x & 0x000000ffU) << 24) | ((x & 0x0000ff00U) << 8) |
                         ((x & 0x00ff0000U) >> 8) | ((x & 0xff000000U) >> 24)));
}


x86 assembly (clang, -O0):
<byte_swap_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @byte_swap_u32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @byte_swap_u32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_query_sender_creds(void *call, uint64_t mask, void **creds) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_query_sender_creds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_query_sender_creds(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_query_sender_creds(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int test_imm_FBint8_mem(signed char *val) {
  return ((*val) & (-0xFB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FBint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff05,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FBint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -251
%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_FBint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -251
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ U000000c1();
void g(void) { \U000000c1(); }


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

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

LLVM IR (-O0):
define void @g() {
%1 = call i32 (...) @"\C3\81"()
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 (...) @"\C3\81"()
ret void
}
void stub() { return; }


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

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

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

LLVM IR (-O2):
define void @stub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float const);
int /*<<< orphan*/ puts(char *);
void print_f(const float *in_S) {
  puts("float:");
  printf("%f\n", *in_S);
}


x86 assembly (clang, -O0):
<print_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
movss  (%rbx),%xmm0
lea    0xecc(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"float:\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define void @print_f(float* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load float, float* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %3)
ret void
}
/* Variables and functions */
int SIGUSR2;
int /*<<< orphan*/ printf(char *);
void sigHandler_3(int signumber) {
  if (signumber == SIGUSR2) {
    printf("\n{SIGNAL}\n");
    if (1)
      printf("    [DEBUG] SIGUSR2 catched.\n");
    printf("    Pid not found.\n");
    printf("{/SIGNAL}\n");
  }
}


x86 assembly (clang, -O0):
<sigHandler_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <sigHandler_3+0x4d>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigHandler_3>:
push   %rax
mov    0x2ec8(%rip),%rax
cmp    %edi,(%rax)
jne    114d <sigHandler_3+0x3d>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGUSR2 = global i32 0
@.str = [11 x i8] c"\0A{SIGNAL}\0A\00"
@.str.1 = [30 x i8] c" [DEBUG] SIGUSR2 catched.\0A\00"
@.str.2 = [20 x i8] c" Pid not found.\0A\00"
@.str.3 = [11 x i8] c"{/SIGNAL}\0A\00"
define void @sigHandler_3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR2
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
@str = [10 x i8] c"\0A{SIGNAL}\00"
@str.4 = [29 x i8] c" [DEBUG] SIGUSR2 catched.\00"
@str.5 = [19 x i8] c" Pid not found.\00"
@str.6 = [10 x i8] c"{/SIGNAL}\00"
define void @sigHandler_3(i32 %0) {
%2 = load i32, i32* @SIGUSR2
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
br label %9
9: ; preds = %4, %1
ret void
}
double fastpow(double a, double b) {
  int tmp = (*(1 + (int *)&a));
  int tmp2 = (int)(b * (tmp - 1072632447) + 1072632447);
  double p = 0.0;
  union {
    double d;
    int x[2];
  } u = {p};
  u.x[1] = tmp2;
  return u.d;
}


x86 assembly (clang, -O0):
<fastpow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%eax
sub    $0x3fef127f,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastpow>:
movq   %xmm0,%rax
shr    $0x20,%rax
add    $0xc010ed81,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xedf(%rip),%xmm0
cvttsd2si %xmm0,%eax
shl    $0x20,%rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @fastpow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca %union.anon
store double %0, double* %3
store double %1, double* %4
%9 = bitcast double* %3 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
store i32 %11, i32* %5
%12 = load double, double* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1072632447
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %12, double %15, double 0x41CFF7893F800000)
%17 = fptosi double %16 to i32
store i32 %17, i32* %6
store double 0.000000e+00, double* %7
%18 = bitcast %union.anon* %8 to double*
%19 = load double, double* %7
store double %19, double* %18
%20 = load i32, i32* %6
%21 = bitcast %union.anon* %8 to [2 x i32]*
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 1
store i32 %20, i32* %22
%23 = bitcast %union.anon* %8 to double*
%24 = load double, double* %23
ret double %24
}

LLVM IR (-O2):
define double @fastpow(double %0, double %1) {
%3 = bitcast double %0 to i64
%4 = lshr i64 %3, 32
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, -1072632447
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %1, double %7, double 0x41CFF7893F800000)
%9 = fptosi double %8 to i32
%10 = zext i32 %9 to i64
%11 = shl nuw i64 %10, 32
%12 = bitcast i64 %11 to double
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSynchronize() {
  printf("XSynchronize called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"XSynchronize called\00"
define i32 @XSynchronize() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void clobber_args() {}


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

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

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

LLVM IR (-O2):
define void @clobber_args() {
ret void
}
/* Variables and functions */
void exec(const char *fn, const void *buf, size_t n) {
  (void)fn;
  (void)buf;
  (void)n;
}


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

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

LLVM IR (-O0):
define void @exec(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @exec(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}