xunge/DecIR huggingface dataset:
int MapsWithMe_LatToInt(double lat, int maxValue) {
  double const x = (lat + 90.0) / 180.0 * maxValue;
  return (x < 0 ? 0 : (x > maxValue ? maxValue : (int)(x + 0.5)));
}


x86 assembly (clang, -O0):
<MapsWithMe_LatToInt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xef4(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    114b <MapsWithMe_LatToInt+0x4b>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1184 <MapsWithMe_LatToInt+0x84>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    116a <MapsWithMe_LatToInt+0x6a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    117e <MapsWithMe_LatToInt+0x7e>
movsd  0xe9e(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MapsWithMe_LatToInt>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
cvtsi2sd %edi,%xmm1
mulsd  %xmm1,%xmm0
ucomisd %xmm1,%xmm0
movsd  0xeec(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ecx
cmova  %edi,%ecx
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @MapsWithMe_LatToInt(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%6 = load double, double* %3
%7 = fadd double %6, 9.000000e+01
%8 = fdiv double %7, 1.800000e+02
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %2
br label %28
15: ; preds = %2
%16 = load double, double* %5
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = fcmp ogt double %16, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %4
br label %26
22: ; preds = %15
%23 = load double, double* %5
%24 = fadd double %23, 5.000000e-01
%25 = fptosi double %24 to i32
br label %26
26: ; preds = %22, %20
%27 = phi i32 [ %21, %20 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14
%29 = phi i32 [ 0, %14 ], [ %27, %26 ]
ret i32 %29
}

LLVM IR (-O2):
define i32 @MapsWithMe_LatToInt(double %0, i32 %1) {
%3 = fadd double %0, 9.000000e+01
%4 = fdiv double %3, 1.800000e+02
%5 = sitofp i32 %1 to double
%6 = fmul double %4, %5
%7 = fcmp olt double %6, 0.000000e+00
%8 = fcmp ogt double %6, %5
%9 = fadd double %6, 5.000000e-01
%10 = fptosi double %9 to i32
%11 = select i1 %8, i32 %1, i32 %10
%12 = select i1 %7, i32 0, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fail();
int featureModelValid();
int main() {
  int tmp;
  tmp = featureModelValid();
  if (!tmp)
  error:
    fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <featureModelValid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114f <main+0x2f>
jmp    1148 <main+0x28>
mov    $0x0,%al
call   1030 <fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <featureModelValid@plt>
test   %eax,%eax
jne    1133 <main+0x13>
xor    %eax,%eax
call   1030 <fail@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @featureModelValid()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @fail()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM1_TRG_COM_TIM17_IRQHandler() {
  default_handler();
}


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

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

LLVM IR (-O0):
define weak void @TIM1_TRG_COM_TIM17_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM1_TRG_COM_TIM17_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
__attribute__((__weak__)) int _execve(char *name __attribute__((unused)),
                                      char **argv __attribute__((unused)),
                                      char **env __attribute__((unused))) {
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define weak i32 @_execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @ENOMEM
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define weak i32 @_execve(i8* %0, i8** %1, i8** %2) {
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
ret i32 -1
}
int mylib3_fct1(void) {
  printf("%s\n", __FUNCTION__);
  return 0;
}


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

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

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

LLVM IR (-O2):
@__FUNCTION__.mylib3_fct1 = [12 x i8] c"mylib3_fct1\00"
define i32 @mylib3_fct1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.mylib3_fct1, i64 0, i64 0))
ret i32 0
}
void fb_ConsoleGetXY(int *col, int *row) {}


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

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

LLVM IR (-O0):
define void @fb_ConsoleGetXY(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 @fb_ConsoleGetXY(i32* nocapture %0, i32* nocapture %1) {
ret void
}
void ktsan_preempt_sub(int value) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_preempt_sub(i32 %0) {
ret void
}
void VMR3AtStateRegister(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3AtStateRegister() {
ret void
}
/* Variables and functions */
double *calloc(int, int);
int /*<<< orphan*/ free(double *);
int main(void) {
  double *a;
  a = calloc(100, sizeof *a);
  for (size_t i = 0; i < 100; ++i) {
    a[i] = a[i];
  }
  free(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x64,-0x18(%rbp)
jae    1180 <main+0x60>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114a <main+0x2a>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca i64
store i32 0, i32* %1
%4 = call double* @calloc(i32 100, i32 8)
store double* %4, double** %2
store i64 0, i64* %3
br label %5
5: ; preds = %16, %0
%6 = load i64, i64* %3
%7 = icmp ult i64 %6, 100
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load double*, double** %2
%10 = load i64, i64* %3
%11 = getelementptr inbounds double, double* %9, i64 %10
%12 = load double, double* %11
%13 = load double*, double** %2
%14 = load i64, i64* %3
%15 = getelementptr inbounds double, double* %13, i64 %14
store double %12, double* %15
br label %16
16: ; preds = %8
%17 = load i64, i64* %3
%18 = add i64 %17, 1
store i64 %18, i64* %3
br label %5
19: ; preds = %5
%20 = load double*, double** %2
%21 = call i32 @free(double* %20)
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double* @calloc(i32 100, i32 8)
%2 = tail call i32 @free(double* %1)
ret i32 0
}
int clz32(unsigned int a) { return __builtin_clz(a); }


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

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

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

LLVM IR (-O2):
define i32 @clz32(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
int A(int k) { return -1 << k; }


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @A(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 -1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @A(i32 %0) {
%2 = shl nsw i32 -1, %0
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ requestor;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
unsigned long get_XSelectionRequestEvent_requestor(void *_p) {
  return (unsigned long)((XSelectionRequestEvent *)_p)->requestor;
}


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

x86 assembly (clang, -O2):
<get_XSelectionRequestEvent_requestor>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XSelectionRequestEvent_requestor(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
unsigned bit_x(const unsigned cfgbit) { return (cfgbit >> 8); }


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

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

LLVM IR (-O0):
define i32 @bit_x(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
ret i32 %4
}

LLVM IR (-O2):
define i32 @bit_x(i32 %0) {
%2 = lshr i32 %0, 8
ret i32 %2
}
void getBytesInt32(unsigned long i, char *out) {
  unsigned char *ia = (unsigned char *)&i;
  out[0] = ia[0];
  out[1] = ia[1];
  out[2] = ia[2];
  out[3] = ia[3];
}


x86 assembly (clang, -O0):
<getBytesInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBytesInt32>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @getBytesInt32(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = bitcast i64* %3 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @getBytesInt32(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i8
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
%6 = lshr i64 %0, 16
%7 = trunc i64 %6 to i8
%8 = lshr i64 %0, 24
%9 = trunc i64 %8 to i8
store i8 %3, i8* %1
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %10
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %7, i8* %11
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %9, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int /*<<< orphan*/, char *, char *);
void func(char *name) {
  move(20, 0);
  clrtoeol();
  mvprintw(20, 0, "Item selected is : %s", name);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%edi
xor    %esi,%esi
call   1050 <move@plt>
mov    $0x0,%al
call   1030 <clrtoeol@plt>
mov    -0x8(%rbp),%rcx
mov    $0x14,%edi
xor    %esi,%esi
lea    0xe9f(%rip),%rdx
call   1040 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %rdi,%rbx
mov    $0x14,%edi
xor    %esi,%esi
call   1050 <move@plt>
xor    %eax,%eax
call   1030 <clrtoeol@plt>
lea    0xeb2(%rip),%rdx
mov    $0x14,%edi
xor    %esi,%esi
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <mvprintw@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Item selected is : %s\00"
define void @func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @move(i32 20, i32 0)
%4 = call i32 (...) @clrtoeol()
%5 = load i8*, i8** %2
%6 = call i32 @mvprintw(i32 20, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Item selected is : %s\00"
define void @func(i8* %0) {
%2 = tail call i32 @move(i32 20, i32 0)
%3 = tail call i32 (...) @clrtoeol()
%4 = tail call i32 @mvprintw(i32 20, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("a hellowrold ipk for openwrt !!! \n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"a hellowrold ipk for openwrt !!! \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"a hellowrold ipk for openwrt !!! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void do_nothing(int n) {
  if ((n & 3) == 0)
    system("df");
}


x86 assembly (clang, -O0):
<do_nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1136 <do_nothing+0x26>
lea    0xecf(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_nothing>:
test   $0x3,%dil
je     1117 <do_nothing+0x7>
ret
lea    0xee2(%rip),%rdi
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"df\00"
define void @do_nothing(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"df\00"
define void @do_nothing(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
unsigned int _uiCommKeepConnect(unsigned int uiCommType) { return (0x0000); }


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

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

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

LLVM IR (-O2):
define i32 @_uiCommKeepConnect(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *myname) {
  fprintf(stderr,
          "usage: %s [-v] [-h] [-c|-d] [-f] [-n initial_sequence_number]\n     "
          "                       [-s seed] [username]\n",
          myname);
  exit(1);
}


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    $0x1,%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    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [112 x i8] c"usage: %s [-v] [-h] [-c|-d] [-f] [-n initial_sequence_number]\0A [-s seed] [username]\0A\00"
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 ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [112 x i8] c"usage: %s [-v] [-h] [-c|-d] [-f] [-n initial_sequence_number]\0A [-s seed] [username]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
float scale_time(float value, int code) {
  switch (code) {
  default:
  case 0:
    return value;
  case 1:
    return 60.0f * value;
  case 2:
    return 60.0f * 60.0f * value;
  case 3:
    return 24.0f * 60.0f * 60.0f * value;
  }
}


x86 assembly (clang, -O0):
<scale_time>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     1131 <scale_time+0x31>
mov    -0x18(%rbp),%rax
lea    0xee4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1136 <scale_time+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1185 <scale_time+0x85>
movss  0xebb(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1185 <scale_time+0x85>
movss  0xea0(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1185 <scale_time+0x85>
movss  0xe85(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_time>:
cmp    $0x3,%edi
je     1118 <scale_time+0x18>
cmp    $0x2,%edi
je     1121 <scale_time+0x21>
cmp    $0x1,%edi
jne    1120 <scale_time+0x20>
mulss  0xeed(%rip),%xmm0
ret
mulss  0xee8(%rip),%xmm0
ret
mulss  0xed7(%rip),%xmm0
ret

LLVM IR (-O0):
define float @scale_time(float %0, i32 %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %7 [
i32 0, label %8
i32 1, label %10
i32 2, label %13
i32 3, label %16
]
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = load float, float* %4
store float %9, float* %3
br label %19
10: ; preds = %2
%11 = load float, float* %4
%12 = fmul float 6.000000e+01, %11
store float %12, float* %3
br label %19
13: ; preds = %2
%14 = load float, float* %4
%15 = fmul float 3.600000e+03, %14
store float %15, float* %3
br label %19
16: ; preds = %2
%17 = load float, float* %4
%18 = fmul float 8.640000e+04, %17
store float %18, float* %3
br label %19
19: ; preds = %16, %13, %10, %8
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @scale_time(float %0, i32 %1) {
switch i32 %1, label %9 [
i32 3, label %7
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = fmul float %0, 6.000000e+01
br label %9
5: ; preds = %2
%6 = fmul float %0, 3.600000e+03
br label %9
7: ; preds = %2
%8 = fmul float %0, 8.640000e+04
br label %9
9: ; preds = %2, %7, %5, %3
%10 = phi float [ %6, %5 ], [ %4, %3 ], [ %8, %7 ], [ %0, %2 ]
ret float %10
}
char *strcpy(char *dest, const char *s) {
  char *d = dest;
  while ((*d++ = *s++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int f_int() {
  int i, *ii;
  i = 12;
  ii = &i;
  return *ii;
}


x86 assembly (clang, -O0):
<f_int>:
push   %rbp
mov    %rsp,%rbp
movl   $0xc,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f_int() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("./../../../../Files/44.sh");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"./../../../../Files/44.sh\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"./../../../../Files/44.sh\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int main() {
  int cookie;
  char buf[80];
  printf("buf: %08x cookie: %08x\n", &buf, &cookie);
  gets(buf);
  if (cookie == 0x000a0d00)
    printf("you win!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1040 <gets@plt>
cmpl   $0xa0d00,-0x8(%rbp)
jne    116b <main+0x4b>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
cmpl   $0xa0d00,0xc(%rsp)
jne    1170 <main+0x40>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"buf: %08x cookie: %08x\0A\00"
@.str.1 = [10 x i8] c"you win!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), [80 x i8]* %3, i32* %2)
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %5)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 658688
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [24 x i8] c"buf: %08x cookie: %08x\0A\00"
@str = [9 x i8] c"you win!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), [80 x i8]* %2, i32* %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %4)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 658688
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int, int, int);
int main() {
  int a = 4;
  int b = 2;
  print("%d + %d = %d\n", a, b, a + b);
  print("%d - %d = %d\n", a, b, a - b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
lea    0xec0(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
lea    0xeb6(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    $0x6,%ecx
call   1030 <print@plt>
lea    0xedb(%rip),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [14 x i8] c"%d - %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [14 x i8] c"%d - %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 2, i32 6)
%2 = tail call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 2, i32 2)
ret i32 0
}
void SWI_Routine(void) {
  while (1)
    ;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @type_6_data_transfer() {
ret void
}
/* Variables and functions */
double swe_deg_midp(double, double);
double swe_rad_midp(double x1, double x0) {
  return (3.14159265358979323846 / 180.0) *
         swe_deg_midp(x1 * (180.0 / 3.14159265358979323846),
                      x0 * (180.0 / 3.14159265358979323846));
}


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

x86 assembly (clang, -O2):
<swe_rad_midp>:
push   %rax
movsd  0xee7(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm1
call   1030 <swe_deg_midp@plt>
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @swe_rad_midp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double %5, 0x404CA5DC1A63C1F8
%7 = load double, double* %4
%8 = fmul double %7, 0x404CA5DC1A63C1F8
%9 = call double @swe_deg_midp(double %6, double %8)
%10 = fmul double 0x3F91DF46A2529D39, %9
ret double %10
}

LLVM IR (-O2):
define double @swe_rad_midp(double %0, double %1) {
%3 = fmul double %0, 0x404CA5DC1A63C1F8
%4 = fmul double %1, 0x404CA5DC1A63C1F8
%5 = tail call double @swe_deg_midp(double %3, double %4)
%6 = fmul double %5, 0x3F91DF46A2529D39
ret double %6
}
int startNotifyThread() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startNotifyThread() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEC16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Direct(int);
void OpC6M0(void) { DEC16(SA1Direct(3), 0xFFFF); }


x86 assembly (clang, -O0):
<OpC6M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <DEC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpC6M0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <DEC16@plt>

LLVM IR (-O0):
define void @OpC6M0() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @DEC16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @OpC6M0() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @DEC16(i32 %1, i32 65535)
ret void
}
__attribute__((no, noclone)) int fn1(int x, unsigned int y) {
  int res;
  int ovf = __builtin_sub_overflow(x, y, &res);
  int res2 = res;
  int res3 = res2 - 2;
  (void)ovf;
  return res;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
mov    -0x8(%rbp),%eax
sub    %rax,%rcx
mov    %rcx,%rax
shl    $0x1f,%rax
sar    $0x1f,%rax
sub    %rcx,%rax
setne  %al
movabs $0x1ffffffff,%rdi
mov    %rcx,%rdx
and    %rdi,%rdx
movslq %ecx,%rsi
and    %rdi,%rsi
sub    %rsi,%rdx
setne  %dl
or     %dl,%al
mov    %ecx,-0xc(%rbp)
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sext i32 %9 to i33
%12 = zext i32 %10 to i33
%13 = call { i33, i1 } @llvm.ssub.with.overflow.i33(i33 %11, i33 %12)
%14 = extractvalue { i33, i1 } %13, 1
%15 = extractvalue { i33, i1 } %13, 0
%16 = trunc i33 %15 to i32
%17 = sext i32 %16 to i33
%18 = icmp ne i33 %15, %17
%19 = or i1 %14, %18
store i32 %16, i32* %5
%20 = zext i1 %19 to i32
store i32 %20, i32* %6
%21 = load i32, i32* %5
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = sub nsw i32 %22, 2
store i32 %23, i32* %8
%24 = load i32, i32* %6
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
ret i32 %3
}
int newcol(ch, col)
int ch, col;
{
  if (ch == '\t')
    return (col | 7) + 1;
  return col + char_len(ch);
}


x86 assembly (clang, -O0):
<newcol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    1139 <newcol+0x29>
mov    -0xc(%rbp),%eax
or     $0x7,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <newcol+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <char_len@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newcol>:
push   %rbx
mov    %esi,%ebx
cmp    $0x9,%edi
jne    1120 <newcol+0x10>
or     $0x7,%ebx
add    $0x1,%ebx
jmp    1129 <newcol+0x19>
xor    %eax,%eax
call   1030 <char_len@plt>
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @newcol(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 9
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = or i32 %1, 7
%6 = add nsw i32 %5, 1
br label %10
7: ; preds = %2
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @char_len to i32 (i32, ...)*)(i32 %0)
%9 = add nsw i32 %8, %1
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ %6, %4 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ funge_stack_pop(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ funge_thread_stack();
int32_t funge_discard_tos(int32_t funge_char __attribute__((unused))) {
  int32_t val;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &val);
  return 0;
}


x86 assembly (clang, -O0):
<funge_discard_tos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1040 <funge_stack_pop@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funge_discard_tos>:
push   %rax
xor    %eax,%eax
call   1030 <funge_thread_stack@plt>
lea    0x4(%rsp),%rsi
mov    %eax,%edi
call   1040 <funge_stack_pop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @funge_discard_tos(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @funge_thread_stack()
%6 = call i32 @funge_stack_pop(i32 %5, i32* %3)
store i32 %6, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @funge_discard_tos(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (...) @funge_thread_stack()
%5 = call i32 @funge_stack_pop(i32 %4, i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err_sigsetops(void) {
  fprintf(stderr, "error: Failed to initialize the signal set\n");
  fflush(stderr);
}


x86 assembly (clang, -O0):
<err_sigsetops>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_sigsetops>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"error: Failed to initialize the signal set\0A\00"
define void @err_sigsetops() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"error: Failed to initialize the signal set\0A\00"
define void @err_sigsetops() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int get_status();
int /*<<< orphan*/ set_status(int);
void set_interrupts(int yesOrNo) {
  int t = get_status();
  if (yesOrNo) {
    t |= 0x00000001;
    t |= 0x0000ff00;
  } else {
    t &= ~0x00000001;
    t &= ~0x0000ff00;
  }
  set_status(t);
}


x86 assembly (clang, -O0):
<set_interrupts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_status@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1158 <set_interrupts+0x38>
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0xff00,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <set_interrupts+0x4c>
mov    -0x8(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff00ff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <set_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_interrupts>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <get_status@plt>
and    $0xffff00fe,%eax
test   %ebx,%ebx
mov    $0xff01,%edi
cmove  %ebx,%edi
or     %eax,%edi
pop    %rbx
jmp    1030 <set_status@plt>

LLVM IR (-O0):
define void @set_interrupts(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @get_status()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = or i32 %10, 65280
store i32 %11, i32* %3
br label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = and i32 %13, -2
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = and i32 %15, -65281
store i32 %16, i32* %3
br label %17
17: ; preds = %12, %7
%18 = load i32, i32* %3
%19 = call i32 @set_status(i32 %18)
ret void
}

LLVM IR (-O2):
define void @set_interrupts(i32 %0) {
%2 = tail call i32 (...) @get_status()
%3 = icmp eq i32 %0, 0
%4 = and i32 %2, -65282
%5 = select i1 %3, i32 0, i32 65281
%6 = or i32 %4, %5
%7 = tail call i32 @set_status(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void nr_free_imatrix(int **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<nr_free_imatrix>:
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),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_free_imatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @nr_free_imatrix(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32** %0, i32*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i32**, i32*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i32*, i32** %11, i64 %12
%14 = load i32*, i32** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 -1
%18 = bitcast i32* %17 to i8*
%19 = call i32 @free(i8* %18)
%20 = load i32**, i32*** %6
%21 = load i64, i64* %7
%22 = getelementptr inbounds i32*, i32** %20, i64 %21
%23 = getelementptr inbounds i32*, i32** %22, i64 -1
%24 = bitcast i32** %23 to i8*
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @nr_free_imatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = bitcast i32* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds i32*, i32** %6, i64 -1
%13 = bitcast i32** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Type definitions */
struct xfs_inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __xfs_iflock(struct xfs_inode *);
int /*<<< orphan*/ xfs_iflock_nowait(struct xfs_inode *);
void xfs_iflock(struct xfs_inode *ip) {
  if (!xfs_iflock_nowait(ip))
    __xfs_iflock(ip);
}


x86 assembly (clang, -O0):
<xfs_iflock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xfs_iflock_nowait@plt>
cmp    $0x0,%eax
jne    1147 <xfs_iflock+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <__xfs_iflock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_iflock>:
push   %rbx
mov    %rdi,%rbx
call   1040 <xfs_iflock_nowait@plt>
test   %eax,%eax
je     112f <xfs_iflock+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__xfs_iflock@plt>

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

LLVM IR (-O2):
%struct.xfs_inode = type { i32 }
define void @xfs_iflock(%struct.xfs_inode* %0) {
%2 = tail call i32 @xfs_iflock_nowait(%struct.xfs_inode* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @__xfs_iflock(%struct.xfs_inode* %0)
br label %6
6: ; preds = %4, %1
ret void
}
float bar2(float x, float y, float z) { return x + (-y * z * z * 5.0f); }


x86 assembly (clang, -O0):
<bar2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xec4(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar2>:
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
mulss  0xef0(%rip),%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @bar2(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fneg float %8
%10 = load float, float* %6
%11 = fmul float %9, %10
%12 = load float, float* %6
%13 = fmul float %11, %12
%14 = call float @llvm.fmuladd.f32(float %13, float 5.000000e+00, float %7)
ret float %14
}

LLVM IR (-O2):
define float @bar2(float %0, float %1, float %2) {
%4 = fneg float %1
%5 = fmul float %4, %2
%6 = fmul float %5, %2
%7 = tail call float @llvm.fmuladd.f32(float %6, float 5.000000e+00, float %0)
ret float %7
}