xunge/DecIR huggingface dataset:
/* Variables and functions */
int atoi(char const *);
int g_atoi(const char *str) {
  if (str == 0) {
    return 0;
  }
  return atoi(str);
}


x86 assembly (clang, -O0):
<g_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <g_atoi+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <g_atoi+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_atoi(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @atoi(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int amd_pmu_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @amd_pmu_init() {
ret i32 0
}
unsigned xrop3_4_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_4_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_4_0_0>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
shl    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_4_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_4_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = xor i32 %4, -1
%6 = and i32 %5, %3
%7 = shl nuw nsw i32 %6, 8
ret i32 %7
}
void enableGPIO1Block() {
  (*((volatile unsigned int *)(0x4804C000 + 0x130))) &= ~(0x1);
  (*((volatile unsigned int *)(0x4804C000 + 0x10))) |= 0x2;
  while (((*((volatile unsigned int *)(0x4804C000 + 0x114))) & 0x1) != 0x1)
    ;
}


x86 assembly (clang, -O0):
<enableGPIO1Block>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4804c130,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x4804c130,%eax
mov    %ecx,(%rax)
mov    $0x4804c010,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x4804c010,%eax
mov    %ecx,(%rax)
mov    $0x4804c114,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x1,%eax
je     113e <enableGPIO1Block+0x3e>
jmp    1126 <enableGPIO1Block+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableGPIO1Block>:
andl   $0xfffffffe,0x4804c130
fe
orl    $0x2,0x4804c010
02
testl  $0x1,0x4804c114
je     1110 <enableGPIO1Block+0x10>
ret

LLVM IR (-O0):
define void @enableGPIO1Block() {
%1 = load volatile i32, i32* inttoptr (i64 1208271152 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1208271152 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1208270864 to i32*)
%4 = or i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 1208270864 to i32*)
br label %5
5: ; preds = %9, %0
%6 = load volatile i32, i32* inttoptr (i64 1208271124 to i32*)
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @enableGPIO1Block() {
%1 = load volatile i32, i32* inttoptr (i64 1208271152 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1208271152 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1208270864 to i32*)
%4 = or i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 1208270864 to i32*)
br label %5
5: ; preds = %5, %0
%6 = load volatile i32, i32* inttoptr (i64 1208271124 to i32*)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ error_exit(char *);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_ts() {
  struct timeval ts;
  if (gettimeofday(&ts, NULL) == -1)
    error_exit("gettimeofday() failed");
  return (((double)ts.tv_sec) + ((double)ts.tv_usec) / 1000000.0);
}


x86 assembly (clang, -O0):
<get_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0xffffffff,%eax
jne    114a <get_ts+0x2a>
lea    0xec3(%rip),%rdi
call   1040 <error_exit@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xea2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ts>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0xffffffff,%eax
jne    1141 <get_ts+0x21>
lea    0xecc(%rip),%rdi
call   1040 <error_exit@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xea9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [22 x i8] c"gettimeofday() failed\00"
define double @get_ts() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @error_exit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fdiv double %12, 1.000000e+06
%14 = fadd double %9, %13
ret double %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [22 x i8] c"gettimeofday() failed\00"
define double @get_ts() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @error_exit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %14, %10
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void release_file(void *data, unsigned long size) { free(data); }


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

x86 assembly (clang, -O2):
<release_file>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @release_file(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
short real_lswap2(short i) {
  char *ii = (char *)&(i);
  char *jj = ii + 1;
  *ii ^= *jj;
  *jj ^= *ii;
  *ii ^= *jj;
  return i;
}


x86 assembly (clang, -O0):
<real_lswap2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_lswap2>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @real_lswap2(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8*
%4 = alloca i8*
store i16 %0, i16* %2
%5 = bitcast i16* %2 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = xor i32 %13, %10
%15 = trunc i32 %14 to i8
store i8 %15, i8* %11
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = xor i32 %21, %18
%23 = trunc i32 %22 to i8
store i8 %23, i8* %19
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = xor i32 %29, %26
%31 = trunc i32 %30 to i8
store i8 %31, i8* %27
%32 = load i16, i16* %2
ret i16 %32
}

LLVM IR (-O2):
define signext i16 @real_lswap2(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xselectionrequest_type(void *_p) {
  return (int)((XEvent *)_p)->xselectionrequest.type;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xselectionrequest_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
const char *a(void) { return "abc"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i8* @a() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int ptask_create_prio(void (*)(), int, int, int);
int ptask_create(void (*task)(void), int period, int prio, int aflag) {
  return ptask_create_prio(task, period, prio, aflag);
}


x86 assembly (clang, -O0):
<ptask_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <ptask_create_prio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptask_create>:
jmp    1030 <ptask_create_prio@plt>

LLVM IR (-O0):
define i32 @ptask_create(void ()* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca void ()*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store void ()* %0, void ()** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load void ()*, void ()** %5
%10 = bitcast void ()* %9 to void (...)*
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @ptask_create_prio(void (...)* %10, i32 %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @ptask_create(void ()* %0, i32 %1, i32 %2, i32 %3) {
%5 = bitcast void ()* %0 to void (...)*
%6 = tail call i32 @ptask_create_prio(void (...)* %5, i32 %1, i32 %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
double exp_inline(double, double, int);
double __exp_dd(double x, double xtail) { return exp_inline(x, xtail, 1); }


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

x86 assembly (clang, -O2):
<__exp_dd>:
mov    $0x1,%edi
jmp    1030 <exp_inline@plt>

LLVM IR (-O0):
define double @__exp_dd(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 = load double, double* %4
%7 = call double @exp_inline(double %5, double %6, i32 1)
ret double %7
}

LLVM IR (-O2):
define double @__exp_dd(double %0, double %1) {
%3 = tail call double @exp_inline(double %0, double %1, i32 1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int);
int write_int(char *out, int in, size_t n) {
  snprintf(out, n, "%d", in);
  return 0;
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rax
mov    %esi,%ecx
lea    0xee6(%rip),%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @write_int(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ utoa_dec(int /*<<< orphan*/, char *);
int itoa_dec(int32_t x, char *buffer) {
  int len = 0;
  if (x < 0) {
    x = -x;
    *buffer++ = '-';
    len++;
  }
  len += utoa_dec(x, buffer);
  return len;
}


x86 assembly (clang, -O0):
<itoa_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1153 <itoa_dec+0x43>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <utoa_dec@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa_dec>:
push   %rbx
test   %edi,%edi
js     1119 <itoa_dec+0x9>
xor    %ebx,%ebx
jmp    1127 <itoa_dec+0x17>
neg    %edi
movb   $0x2d,(%rsi)
add    $0x1,%rsi
mov    $0x1,%ebx
call   1030 <utoa_dec@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @itoa_dec(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
store i8 45, i8* %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
br label %15
15: ; preds = %8, %2
%16 = load i32, i32* %3
%17 = load i8*, i8** %4
%18 = call i64 @utoa_dec(i32 %16, i8* %17)
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = add nsw i64 %20, %18
%22 = trunc i64 %21 to i32
store i32 %22, i32* %5
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @itoa_dec(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %0
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %5, %4 ], [ %0, %2 ]
%9 = phi i8* [ %6, %4 ], [ %1, %2 ]
%10 = phi i64 [ 1, %4 ], [ 0, %2 ]
%11 = tail call i64 @utoa_dec(i32 %8, i8* %9)
%12 = add nsw i64 %11, %10
%13 = trunc i64 %12 to i32
ret i32 %13
}
/* Variables and functions */
int CyBtldr_ParseDefaultCmdResult(unsigned char *, unsigned long,
                                  unsigned char *);
int CyBtldr_ParseSendDataCmdResult(unsigned char *cmdBuf, unsigned long cmdSize,
                                   unsigned char *status) {
  return CyBtldr_ParseDefaultCmdResult(cmdBuf, cmdSize, status);
}


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

x86 assembly (clang, -O2):
<CyBtldr_ParseSendDataCmdResult>:
jmp    1030 <CyBtldr_ParseDefaultCmdResult@plt>

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

LLVM IR (-O2):
define i32 @CyBtldr_ParseSendDataCmdResult(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @CyBtldr_ParseDefaultCmdResult(i8* %0, i64 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
long shmctl(long, int /*<<< orphan*/, int /*<<< orphan*/ *);
long shmClose(long shm_id) { return shmctl(shm_id, IPC_RMID, NULL); }


x86 assembly (clang, -O0):
<shmClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmClose>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <shmctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i64 @shmClose(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i64 @shmctl(i64 %3, i32 %4, i32* null)
ret i64 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i64 @shmClose(i64 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i64 @shmctl(i64 %0, i32 %2, i32* null)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(char *, size_t);
scalar_t__ malloc(size_t);
char *ft_strnew(size_t size) {
  char *str;
  str = (char *)malloc(size + 1);
  if (str != NULL) {
    ft_bzero(str, size + 1);
    return (str);
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1166 <ft_strnew+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <ft_strnew+0x4e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1148 <ft_strnew+0x28>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <ft_bzero@plt>
jmp    114b <ft_strnew+0x2b>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @ft_bzero(i8* %4, i64 %2)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %4, %6 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvin_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvin_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvin_wch+0x2a>
jmp    1170 <cmd_mvin_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvin_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvin_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvin_wch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvin_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef size_t uint8_t;

/* Variables and functions */
uint8_t wave_func(uint8_t phase) {
  extern uint8_t wf_wf[256];
  return wf_wf[phase];
}


x86 assembly (clang, -O0):
<wave_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    0x2ed5(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_func>:
mov    0x2ee1(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
@wf_wf = external global [256 x i64]
define i64 @wave_func(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds [256 x i64], [256 x i64]* @wf_wf, i64 0, i64 %3
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
@wf_wf = external global [256 x i64]
define i64 @wave_func(i64 %0) {
%2 = getelementptr inbounds [256 x i64], [256 x i64]* @wf_wf, i64 0, i64 %0
%3 = load i64, i64* %2
ret i64 %3
}
unsigned setbits(unsigned x, unsigned p, unsigned n, unsigned y) {
  unsigned adjusted = (p + 1 - n);
  unsigned mask = ~(~(unsigned)0 << n);
  ;
  return (x & ~(mask << adjusted)) | (y & mask) << adjusted;
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%edx
and    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%ecx
sub    %edx,%esi
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
lea    0x1(%rsi),%ecx
mov    %eax,%edx
shl    %cl,%edx
not    %edx
and    %edi,%edx
and    %r8d,%eax
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = add i32 %11, 1
%13 = load i32, i32* %7
%14 = sub i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = shl i32 -1, %15
%17 = xor i32 %16, -1
store i32 %17, i32* %10
%18 = load i32, i32* %5
%19 = load i32, i32* %10
%20 = load i32, i32* %9
%21 = shl i32 %19, %20
%22 = xor i32 %21, -1
%23 = and i32 %18, %22
%24 = load i32, i32* %8
%25 = load i32, i32* %10
%26 = and i32 %24, %25
%27 = load i32, i32* %9
%28 = shl i32 %26, %27
%29 = or i32 %23, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %1, 1
%6 = sub i32 %5, %2
%7 = shl nsw i32 -1, %2
%8 = xor i32 %7, -1
%9 = shl i32 %8, %6
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = and i32 %8, %3
%13 = shl i32 %12, %6
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *str) {
  fprintf(stderr, "%s\n", str);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
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):
<die>:
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 = [4 x i8] c"%s\0A\00"
define void @die(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PlaySoundExt(int, int, int, int /*<<< orphan*/);
void PlaySoundStereo(int nr, int stereo_position) {
  PlaySoundExt(nr, 128, stereo_position, ((0)));
}


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

x86 assembly (clang, -O2):
<PlaySoundStereo>:
mov    %esi,%edx
mov    $0x80,%esi
xor    %ecx,%ecx
jmp    1030 <PlaySoundExt@plt>

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

LLVM IR (-O2):
define void @PlaySoundStereo(i32 %0, i32 %1) {
%3 = tail call i32 @PlaySoundExt(i32 %0, i32 128, i32 %1, i32 0)
ret void
}
void g_key_file_set_integer() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_set_integer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptr_set_to_zero(int **);
void call_by_arr_bad() {
  int arr[10];
  ptr_set_to_zero(&arr);
  arr[arr[0] - 1] = 123;
}


x86 assembly (clang, -O0):
<call_by_arr_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1030 <ptr_set_to_zero@plt>
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
cltq
movl   $0x7b,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_by_arr_bad>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <ptr_set_to_zero@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @call_by_arr_bad() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i32**
%3 = call i32 @ptr_set_to_zero(i32** %2)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %7
store i32 123, i32* %8
ret void
}

LLVM IR (-O2):
define void @call_by_arr_bad() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = bitcast [10 x i32]* %1 to i32**
%4 = call i32 @ptr_set_to_zero(i32** %3)
ret void
}
double ldexp(double value, int exp) {
  double temp, texp, temp2;
  texp = exp;
  asm("fscale " : "=u"(temp2), "=t"(temp) : "0"(texp), "1"(value));
  return (temp);
}


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
fldl   -0x30(%rbp)
fldl   -0x38(%rbp)
fscale
fstpl  -0x48(%rbp)
fstpl  -0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
cvtsi2sd %edi,%xmm1
movsd  %xmm0,-0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fldl   -0x8(%rsp)
fldl   -0x10(%rsp)
fxch   %st(1)
fscale
fstp   %st(1)
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
store double %9, double* %6
%10 = load double, double* %6
%11 = load double, double* %3
%12 = call { double, double } asm "fscale ", "={st(1)},={st},0,1,~{dirflag},~{fpsr},~{flags}"(double %10, double %11)
%13 = extractvalue { double, double } %12, 0
%14 = extractvalue { double, double } %12, 1
store double %13, double* %7
store double %14, double* %5
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = tail call { double, double } asm "fscale ", "={st(1)},={st},0,1,~{dirflag},~{fpsr},~{flags}"(double %3, double %0)
%5 = extractvalue { double, double } %4, 1
ret double %5
}
adrreg0indreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
mov    -0x20(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1145 <adrreg0indreg1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <adrreg0indreg1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0indreg1>:
movzwl 0x1312d00(%r8),%ecx
01
xor    %eax,%eax
cmp    (%r9),%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrreg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = zext i16 %18 to i32
%20 = load i16*, i16** %13
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = icmp sle i32 %19, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @adrreg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = load i16, i16* %5
%10 = icmp ule i16 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
signed long long f31(signed long long v_foo) {
  signed long long v_and = v_foo & 32766;
  signed long long v_shl = v_and << 50;
  return v_shl;
}


x86 assembly (clang, -O0):
<f31>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7ffe,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x32,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f31>:
mov    %rdi,%rax
and    $0x3ffe,%eax
shl    $0x32,%rax
ret

LLVM IR (-O0):
define i64 @f31(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = and i64 %5, 32766
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = shl i64 %7, 50
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @f31(i64 %0) {
%2 = shl i64 %0, 50
%3 = and i64 %2, -2251799813685248
ret i64 %3
}
/* Variables and functions */
int readSdmmcDevice(int, void *);
int readBlock(int blockNum, void *ptr) {
  return readSdmmcDevice(blockNum, ptr);
}


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

x86 assembly (clang, -O2):
<readBlock>:
jmp    1030 <readSdmmcDevice@plt>

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

LLVM IR (-O2):
define i32 @readBlock(i32 %0, i8* %1) {
%3 = tail call i32 @readSdmmcDevice(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
double cos(int);
double DCT_cosine(int spatial, int frequency) {
  double result;
  result = cos((((2 * spatial) + 1) * frequency *
                3.14159265358979323846264338327950288) /
               16);
  return result;
}


x86 assembly (clang, -O0):
<DCT_cosine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCT_cosine>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
imul   %esi,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @DCT_cosine(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 2, %6
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 0x400921FB54442D18
%13 = fdiv double %12, 1.600000e+01
%14 = fptosi double %13 to i32
%15 = call double @cos(i32 %14)
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @DCT_cosine(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = or i32 %3, 1
%5 = mul nsw i32 %4, %1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x400921FB54442D18
%8 = fmul double %7, 6.250000e-02
%9 = fptosi double %8 to i32
%10 = tail call double @cos(i32 %9)
ret double %10
}
int nand(int a, int b) { return not(and(a, b)); }


x86 assembly (clang, -O0):
<nand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <and@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <not@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand>:
push   %rax
xor    %eax,%eax
call   1030 <and@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <not@plt>

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

LLVM IR (-O2):
define i32 @nand(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @and to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @not to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
long eq(long a, long b) { return a == b; }


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

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

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

LLVM IR (-O2):
define i64 @eq(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
void Lut_Luv2Lut(double *out, double *in) {
  out[0] = in[0] * 1.0 / 100.0;
  out[1] = (in[1] + 128.0) * 256.0 / 65535.0;
  out[2] = (in[2] + 128.0) * 256.0 / 65535.0;
}


x86 assembly (clang, -O0):
<Lut_Luv2Lut>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xf08(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed4(%rip),%xmm0
addsd  0x8(%rax),%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xea2(%rip),%xmm0
addsd  0x10(%rax),%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lut_Luv2Lut>:
movsd  (%rsi),%xmm0
divsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rdi)
movsd  0xef0(%rip),%xmm0
movsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0xee7(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee3(%rip),%xmm3
divsd  %xmm3,%xmm1
movsd  %xmm1,0x8(%rdi)
addsd  0x10(%rsi),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @Lut_Luv2Lut(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fmul double %7, 1.000000e+00
%9 = fdiv double %8, 1.000000e+02
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fadd double %14, 1.280000e+02
%16 = fmul double %15, 2.560000e+02
%17 = fdiv double %16, 6.553500e+04
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = fadd double %22, 1.280000e+02
%24 = fmul double %23, 2.560000e+02
%25 = fdiv double %24, 6.553500e+04
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
ret void
}

LLVM IR (-O2):
define void @Lut_Luv2Lut(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fdiv double %3, 1.000000e+02
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fadd double %6, 1.280000e+02
%8 = fmul double %7, 2.560000e+02
%9 = fdiv double %8, 6.553500e+04
%10 = getelementptr inbounds double, double* %0, i64 1
store double %9, double* %10
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = fadd double %12, 1.280000e+02
%14 = fmul double %13, 2.560000e+02
%15 = fdiv double %14, 6.553500e+04
%16 = getelementptr inbounds double, double* %0, i64 2
store double %15, double* %16
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test1();
int main() {
  test1();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test1@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test1@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_isFailedNodeId(int id) {
  unsigned char buf[255];
  buf[0] = 0x00;
  buf[1] = 0x62;
  buf[2] = id;
  return SerialAPI_request(buf, 3);
}


x86 assembly (clang, -O0):
<ZW_isFailedNodeId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x110(%rbp)
movb   $0x62,-0x10f(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x10e(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x3,%esi
call   1030 <SerialAPI_request@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZW_isFailedNodeId>:
sub    $0x108,%rsp
movw   $0x6200,(%rsp)
mov    %dil,0x2(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <SerialAPI_request@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @ZW_isFailedNodeId(i32 %0) {
%2 = alloca i32
%3 = alloca [255 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 1
store i8 98, i8* %5
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 2
store i8 %7, i8* %8
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%10 = call i32 @SerialAPI_request(i8* %9, i32 3)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ZW_isFailedNodeId(i32 %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 1
store i8 98, i8* %4
%5 = trunc i32 %0 to i8
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 2
store i8 %5, i8* %6
%7 = call i32 @SerialAPI_request(i8* %3, i32 3)
ret i32 %7
}
int __attribute__((visibility("default"))) func2() { return 42; }


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

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

LLVM IR (-O0):
define i32 @func2() {
ret i32 42
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 42
}
void dummyaudio_SetSpeedFactor(int percent) { return; }


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

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

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

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