xunge/DecIR huggingface dataset:
/* Variables and functions */
double fabs(double);
double pi_kernel(int, double);
int /*<<< orphan*/ printf(char *, double, double);
int main(void) {
  int n = 1000;
  double PI25DT = 3.141592653589793238462643;
  double pi, h, area;
  h = 1.0 / (double)n;
  area = pi_kernel(n, h);
  pi = h * area;
  printf("pi is approximately %.16f, Error is %.16f\n", pi, fabs(pi - PI25DT));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec0(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1040 <pi_kernel@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xe70(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x3e8,%edi
call   1040 <pi_kernel@plt>
mulsd  0xec5(%rip),%xmm0
movsd  0xec5(%rip),%xmm1
addsd  %xmm0,%xmm1
andpd  0xec1(%rip),%xmm1
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"pi is approximately %.16f, Error is %.16f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store i32 1000, i32* %2
store double 0x400921FB54442D18, double* %3
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
store double %9, double* %5
%10 = load i32, i32* %2
%11 = load double, double* %5
%12 = call double @pi_kernel(i32 %10, double %11)
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fmul double %13, %14
store double %15, double* %4
%16 = load double, double* %4
%17 = load double, double* %4
%18 = load double, double* %3
%19 = fsub double %17, %18
%20 = call double @llvm.fabs.f64(double %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %16, double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"pi is approximately %.16f, Error is %.16f\0A\00"
define i32 @main() {
%1 = tail call double @pi_kernel(i32 1000, double 1.000000e-03)
%2 = fmul double %1, 1.000000e-03
%3 = fadd double %2, 0xC00921FB54442D18
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %2, double %4)
ret i32 0
}
/* Variables and functions */
char *_sprintf_ptr(char *, void const *const);
char *sprintf_ptr(char *buffer, const void *const pointer) {
  return _sprintf_ptr(buffer, pointer);
}


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

x86 assembly (clang, -O2):
<sprintf_ptr>:
jmp    1030 <_sprintf_ptr@plt>

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

LLVM IR (-O2):
define i8* @sprintf_ptr(i8* %0, i8* %1) {
%3 = tail call i8* @_sprintf_ptr(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  union {
    long l;
    char c[sizeof(long)];
  } u;
  u.l = 1;
  if (u.c[sizeof(long) - 1] == 1) {
    printf("0\n");
  } else {
    printf("1\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    1145 <main+0x35>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x41>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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):
%union.anon = type { i64 }
@.str = [3 x i8] c"0\0A\00"
@.str.1 = [3 x i8] c"1\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to i64*
store i64 1, i64* %3
%4 = bitcast %union.anon* %2 to [8 x i8]*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 7
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int get_uint16le(unsigned char *buffer, int offset) {
  unsigned int val;
  val = buffer[offset];
  val = val + (buffer[offset + 1] << 8);
  return val;
}


x86 assembly (clang, -O0):
<get_uint16le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16le>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @get_uint16le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = add i32 %12, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_uint16le(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %12, %6
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ push(void *);
void __cyg_profile_func_enter(void *this_fn, void *call_site) { push(this_fn); }


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

x86 assembly (clang, -O2):
<__cyg_profile_func_enter>:
jmp    1030 <push@plt>

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

LLVM IR (-O2):
define void @__cyg_profile_func_enter(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @push(i8* %0)
ret void
}
/* Variables and functions */
int sin2048fps16_lookup(unsigned int);
int cos2048fps16_lookup(unsigned int a) {
  return sin2048fps16_lookup(a + 0x800u);
}


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

x86 assembly (clang, -O2):
<cos2048fps16_lookup>:
add    $0x800,%edi
jmp    1030 <sin2048fps16_lookup@plt>

LLVM IR (-O0):
define i32 @cos2048fps16_lookup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 2048
%5 = call i32 @sin2048fps16_lookup(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cos2048fps16_lookup(i32 %0) {
%2 = add i32 %0, 2048
%3 = tail call i32 @sin2048fps16_lookup(i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int atoi(const char *str) { return ((int)strtol(str, NULL, 10)); }


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i32* null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int icon_y;
};
typedef TYPE_1__ XWMHints;

/* Variables and functions */
void set_XWMHints_icon_y(void *_p, int _v) {
  ((XWMHints *)_p)->icon_y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWMHints_icon_y>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XWMHints_icon_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void PRCMDomainEnable(uint32_t ui32Domains) {

  ;
  if (ui32Domains & 0x00000001) {
    (*((volatile unsigned long *)(0x40082000 + 0x0000002C))) = 0x00000001;
  }
  if (ui32Domains & 0x00000010) {
    (*((volatile unsigned long *)(0x40082000 + 0x00000030))) = 0x00000003;
  }
}


x86 assembly (clang, -O0):
<PRCMDomainEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1122 <PRCMDomainEnable+0x22>
mov    $0x4008202c,%eax
movq   $0x1,(%rax)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     113d <PRCMDomainEnable+0x3d>
mov    $0x40082030,%eax
movq   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMDomainEnable>:
test   $0x1,%dil
jne    110d <PRCMDomainEnable+0xd>
test   $0x10,%dil
jne    111f <PRCMDomainEnable+0x1f>
ret
movq   $0x1,0x4008202c
test   $0x10,%dil
je     110c <PRCMDomainEnable+0xc>
movq   $0x3,0x40082030
ret

LLVM IR (-O0):
define void @PRCMDomainEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store volatile i64 1, i64* inttoptr (i64 1074274348 to i64*)
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = and i32 %8, 16
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store volatile i64 3, i64* inttoptr (i64 1074274352 to i64*)
br label %12
12: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
define void @PRCMDomainEnable(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store volatile i64 1, i64* inttoptr (i64 1074274348 to i64*)
br label %5
5: ; preds = %4, %1
%6 = and i32 %0, 16
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5
store volatile i64 3, i64* inttoptr (i64 1074274352 to i64*)
br label %9
9: ; preds = %8, %5
ret void
}
int COLOR_PAIRS() { return 256; }


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

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

LLVM IR (-O0):
define i32 @COLOR_PAIRS() {
ret i32 256
}

LLVM IR (-O2):
define i32 @COLOR_PAIRS() {
ret i32 256
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int setnonblock(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFL);
  flags |= O_NONBLOCK;
  return fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<setnonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setnonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setnonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %5)
ret i32 %7
}
void g27() { static void *x = &x; }


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

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

LLVM IR (-O0):
@g27.x = internal global i8* bitcast (i8** @g27.x to i8*)
define void @g27() {
ret void
}

LLVM IR (-O2):
define void @g27() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void cpy_it(char *dst, char *src, int len) { memcpy(dst, src, len); }


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

x86 assembly (clang, -O2):
<cpy_it>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @cpy_it(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_char();
int /*<<< orphan*/ test_wchar();
int main(void) {
  test_char();
  test_wchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_char@plt>
xor    %eax,%eax
call   1040 <test_wchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_char()
%2 = tail call i32 (...) @test_wchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int MB_LEN_MAX;
scalar_t__ wcstombs(char *, int /*<<< orphan*/ *, int);
char *xcalloc(int, int);
char *xwcstombs(wchar_t *wstr, int len) {
  char *result = xcalloc(1, MB_LEN_MAX * (len + 1));
  if ((int)wcstombs(result, wstr, MB_LEN_MAX * (len + 1)) < 0) {
    result[0] = '\0';
  }
  return result;
}


x86 assembly (clang, -O0):
<xwcstombs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
imul   %eax,%esi
mov    $0x1,%edi
call   1040 <xcalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%eax
add    $0x1,%eax
imul   %eax,%edx
call   1030 <wcstombs@plt>
cmp    $0x0,%eax
jge    117e <xwcstombs+0x5e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwcstombs>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2eaf(%rip),%r15
lea    0x1(%rsi),%ebp
mov    (%r15),%esi
imul   %ebp,%esi
mov    $0x1,%edi
call   1040 <xcalloc@plt>
mov    %rax,%rbx
imul   (%r15),%ebp
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <wcstombs@plt>
test   $0x80000000,%eax
je     1162 <xwcstombs+0x42>
movb   $0x0,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@MB_LEN_MAX = global i32 0
define i8* @xwcstombs(i32* %0, i32 %1) {
%3 = load i32, i32* @MB_LEN_MAX
%4 = add nsw i32 %1, 1
%5 = mul nsw i32 %3, %4
%6 = tail call i8* @xcalloc(i32 1, i32 %5)
%7 = load i32, i32* @MB_LEN_MAX
%8 = mul nsw i32 %7, %4
%9 = tail call i64 @wcstombs(i8* %6, i32* %0, i32 %8)
%10 = and i64 %9, 2147483648
%11 = icmp eq i64 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %2
store i8 0, i8* %6
br label %13
13: ; preds = %12, %2
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void multipla_2(int number) {
  if (number == 0)
    printf("fim\n");
  else {
    multipla_2(number - 1);
    multipla_2(number - 1);
    printf("%d\n", number);
  }
}


x86 assembly (clang, -O0):
<multipla_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <multipla_2+0x28>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116f <multipla_2+0x4f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <multipla_2@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <multipla_2@plt>
mov    -0x4(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multipla_2>:
test   %edi,%edi
je     1160 <multipla_2+0x30>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
mov    %ebp,%edi
call   1050 <multipla_2@plt>
mov    %ebp,%edi
call   1050 <multipla_2@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>
lea    0xe9d(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fim\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @multipla_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %14
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [4 x i8] c"fim\00"
define void @multipla_2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %6
ret void
6: ; preds = %1
%7 = add nsw i32 %0, -1
tail call void @multipla_2(i32 %7)
tail call void @multipla_2(i32 %7)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __atomic_exchange_2(int /*<<< orphan*/ volatile *,
                                       int /*<<< orphan*/, int);
uint16_t rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val) {
  return __atomic_exchange_2(dst, val, 5);
}


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

x86 assembly (clang, -O2):
<rte_atomic16_exchange>:
mov    $0x5,%edx
jmp    1030 <__atomic_exchange_2@plt>

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

LLVM IR (-O2):
define i32 @rte_atomic16_exchange(i32* %0, i32 %1) {
%3 = tail call i32 @__atomic_exchange_2(i32* %0, i32 %1, i32 5)
ret i32 %3
}
int string_find(char str[], char c) {
  int pos;
  for (pos = 0; str[pos]; ++pos)
    if (str[pos] == c)
      return pos;
  return -1;
}


x86 assembly (clang, -O0):
<string_find>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <string_find+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <string_find+0x4a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <string_find+0x64>
jmp    114f <string_find+0x4f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <string_find+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_find>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <string_find+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <string_find+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <string_find+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @string_find(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %30
14: ; preds = %7
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %20, %22
br i1 %23, label %24, label %26
24: ; preds = %14
%25 = load i32, i32* %6
store i32 %25, i32* %3
br label %31
26: ; preds = %14
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %7
store i32 -1, i32* %3
br label %31
31: ; preds = %30, %24
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @string_find(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ a();
int foo() {
  a();
  a();
  a();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <a@plt>
mov    $0x0,%al
call   1030 <a@plt>
mov    $0x0,%al
call   1030 <a@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <a@plt>

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i32 (...) @a()
%3 = call i32 (...) @a()
%4 = call i32 (...) @a()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @a()
%3 = tail call i32 (...) @a()
ret i32 undef
}
void av_murmur3_update() {}


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

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

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

LLVM IR (-O2):
define void @av_murmur3_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x33() {
  Assert_real((isgraph(51)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              260, ("isgraph should be 1 for 3"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x33>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x104,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x33>:
push   %rax
mov    $0x33,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x104,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 3\00"
define void @t_isgraph_0x33() {
%1 = call i32 @isgraph(i32 51)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 3\00"
define void @t_isgraph_0x33() {
%1 = tail call i32 @isgraph(i32 51)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_23int16_reg(short val) {
  return ((val) & (0x23 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_23int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x23,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_23int16_reg>:
test   $0x23,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_23int16_reg(i16 signext %0) {
%2 = and i16 %0, 35
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int iswhite(char chr) {
  if (chr == ' ')
    return (1);
  else if (chr == '\t')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1123 <iswhite+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1143 <iswhite+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    113c <iswhite+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <iswhite+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @iswhite(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
char *hash_plugin_summary(void) {
  return ("mssql-2005 \tMicrosoft SQL Server 2005 plugin");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"mssql-2005 \09Microsoft SQL Server 2005 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [45 x i8] c"mssql-2005 \09Microsoft SQL Server 2005 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}
double rad2deg(double radianval) {
  double degval;
  degval = radianval * 180.0 / 3.1415927;
  return (degval);
}


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rad2deg(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.800000e+02
%6 = fdiv double %5, 0x400921FB5A7ED197
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @rad2deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB5A7ED197
ret double %3
}
/* Variables and functions */
double pow(double const, double const);
int /*<<< orphan*/ printf(char *, double const, double const, double);
int main() {
  const double a = 2, b = 1024;
  double c;
  c = pow(a, b);
  printf("%f^%f=%f\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  0xeaf(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm2
lea    0xea1(%rip),%rdi
movsd  0xe89(%rip),%xmm0
movsd  0xe89(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <exp2@plt>
movaps %xmm0,%xmm2
lea    0xed8(%rip),%rdi
movsd  0xec8(%rip),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%f^%f=%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 2.000000e+00, double* %2
store double 1.024000e+03, double* %3
%5 = call double @pow(double 2.000000e+00, double 1.024000e+03)
store double %5, double* %4
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double 2.000000e+00, double 1.024000e+03, double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%f^%f=%f\0A\00"
define i32 @main() {
%1 = tail call double @exp2(double 1.024000e+03)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double 2.000000e+00, double 1.024000e+03, double %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int, int);
int main() {
  int m = 22, n = 44;
  printf("\nvalues before swap: m = %d and n = %d \n", m, n);
  swap(m, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x16,-0x4(%rbp)
movl   $0x2c,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <swap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x16,%esi
mov    $0x2c,%edx
call   1030 <printf@plt>
mov    $0x16,%edi
mov    $0x2c,%esi
call   1040 <swap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0Avalues before swap: m = %d and n = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 22, i32* %1
store i32 44, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @swap(i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"\0Avalues before swap: m = %d and n = %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 22, i32 44)
%2 = tail call i32 @swap(i32 22, i32 44)
ret i32 0
}
/* Variables and functions */
double M_PI;
double sin(double);
double fBC(double x, double y) { return sin(2.0 * M_PI * (x + y)); }


x86 assembly (clang, -O0):
<fBC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mov    0x2eb7(%rip),%rax
mulsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fBC>:
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @fBC(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* @M_PI
%6 = fmul double 2.000000e+00, %5
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fadd double %7, %8
%10 = fmul double %6, %9
%11 = call double @sin(double %10)
ret double %11
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @fBC(double %0, double %1) {
%3 = load double, double* @M_PI
%4 = fmul double %3, 2.000000e+00
%5 = fadd double %0, %1
%6 = fmul double %5, %4
%7 = tail call double @sin(double %6)
ret double %7
}
int get_dip_size(struct xhda_codec *codec, struct xhda_node *node,
                 unsigned int cmd) {
  if (cmd & 0x8)
    return 128;
  return 32;
}


x86 assembly (clang, -O0):
<get_dip_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     112a <get_dip_size+0x2a>
movl   $0x80,-0x4(%rbp)
jmp    1131 <get_dip_size+0x31>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dip_size>:
test   $0x8,%dl
mov    $0x20,%ecx
mov    $0x80,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
%struct.xhda_codec = type opaque
%struct.xhda_node = type opaque
define i32 @get_dip_size(%struct.xhda_codec* %0, %struct.xhda_node* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.xhda_codec*
%6 = alloca %struct.xhda_node*
%7 = alloca i32
store %struct.xhda_codec* %0, %struct.xhda_codec** %5
store %struct.xhda_node* %1, %struct.xhda_node** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = and i32 %8, 8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 128, i32* %4
br label %13
12: ; preds = %3
store i32 32, i32* %4
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
%struct.xhda_codec = type opaque
%struct.xhda_node = type opaque
define i32 @get_dip_size(%struct.xhda_codec* nocapture readnone %0, %struct.xhda_node* nocapture readnone %1, i32 %2) {
%4 = and i32 %2, 8
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 32, i32 128
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ gf256_mul(int /*<<< orphan*/, int /*<<< orphan*/);
void _gf256v_mul_scalar(uint8_t *a, uint8_t b, unsigned _num_byte) {
  for (unsigned i = 0; i < _num_byte; i++)
    a[i] = gf256_mul(a[i], b);
}


x86 assembly (clang, -O0):
<_gf256v_mul_scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1161 <_gf256v_mul_scalar+0x51>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0xc(%rbp),%esi
call   1030 <gf256_mul@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <_gf256v_mul_scalar+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gf256v_mul_scalar>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1147 <_gf256v_mul_scalar+0x37>
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %edx,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%rbp,4),%edi
mov    %r14d,%esi
call   1030 <gf256_mul@plt>
mov    %eax,(%rbx,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1130 <_gf256v_mul_scalar+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_gf256v_mul_scalar(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @gf256_mul(i32 %11, i32 %1)
store i32 %12, i32* %10
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
/* Variables and functions */
unsigned int add(unsigned int, unsigned int);
unsigned int mul(unsigned int i, unsigned int j) {
  unsigned int sum = 0;
  while (j) {
    if (j & 1)
      sum = add(sum, i);
    i <<= 1;
    j >>= 1;
  }
  return sum;
}


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1163 <mul+0x53>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114c <mul+0x3c>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <mul+0x15>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     113e <mul+0x2e>
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
jmp    112d <mul+0x1d>
nop
add    %ebx,%ebx
mov    %ebp,%ecx
shr    %ecx
cmp    $0x1,%ebp
mov    %ecx,%ebp
jbe    1140 <mul+0x30>
test   $0x1,%bpl
je     1120 <mul+0x10>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <add@plt>
jmp    1120 <mul+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %3
%16 = call i32 @add(i32 %14, i32 %15)
store i32 %16, i32* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %3
%19 = shl i32 %18, 1
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = lshr i32 %20, 1
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %17, label %4
4: ; preds = %2, %12
%5 = phi i32 [ %13, %12 ], [ 0, %2 ]
%6 = phi i32 [ %15, %12 ], [ %1, %2 ]
%7 = phi i32 [ %14, %12 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @add(i32 %5, i32 %7)
br label %12
12: ; preds = %10, %4
%13 = phi i32 [ %11, %10 ], [ %5, %4 ]
%14 = shl i32 %7, 1
%15 = lshr i32 %6, 1
%16 = icmp ult i32 %6, 2
br i1 %16, label %17, label %4
17: ; preds = %12, %2
%18 = phi i32 [ 0, %2 ], [ %13, %12 ]
ret i32 %18
}
double test_log(double x) { return __builtin_log(x); }


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

x86 assembly (clang, -O2):
<test_log>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @test_log(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
StrContainsNonWhiteSpace(str) char *str;
{
  while (*str) {
    if (!isspace(*str))
      return 1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<StrContainsNonWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <StrContainsNonWhiteSpace+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114a <StrContainsNonWhiteSpace+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1162 <StrContainsNonWhiteSpace+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <StrContainsNonWhiteSpace+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrContainsNonWhiteSpace>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114e <StrContainsNonWhiteSpace+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <StrContainsNonWhiteSpace+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <StrContainsNonWhiteSpace+0x20>
jmp    114e <StrContainsNonWhiteSpace+0x3e>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @StrContainsNonWhiteSpace(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = tail call i32 @isspace(i32 %10)
%12 = icmp eq i32 %11, 0
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %14, label %4
14: ; preds = %7, %4, %1
%15 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %7 ]
ret i32 %15
}
void anotherFunction6(int m) { m++; }


x86 assembly (clang, -O0):
<anotherFunction6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

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