xunge/DecIR huggingface dataset:
f(const int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("hello, world! i am %s\n", argv[0]);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"hello, world! i am %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int pxCmpStructStar(const void *pL, const void *pR) {
  if (*(const struct x **)pL < *(const struct x **)pR)
    return -1;
  if (*(const struct x **)pL > *(const struct x **)pR)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<pxCmpStructStar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    112c <pxCmpStructStar+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <pxCmpStructStar+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jbe    114c <pxCmpStructStar+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <pxCmpStructStar+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pxCmpStructStar>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
%struct.x = type opaque
%struct.x.0 = type opaque
define i32 @pxCmpStructStar(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.x**
%8 = load %struct.x*, %struct.x** %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to %struct.x**
%11 = load %struct.x*, %struct.x** %10
%12 = icmp ult %struct.x* %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to %struct.x.0**
%17 = load %struct.x.0*, %struct.x.0** %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to %struct.x.0**
%20 = load %struct.x.0*, %struct.x.0** %19
%21 = icmp ugt %struct.x.0* %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
%struct.x = type opaque
define i32 @pxCmpStructStar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.x**
%4 = load %struct.x*, %struct.x** %3
%5 = bitcast i8* %1 to %struct.x**
%6 = load %struct.x*, %struct.x** %5
%7 = icmp ult %struct.x* %4, %6
%8 = icmp ugt %struct.x* %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ rysuj_gwiazdki_1();
int /*<<< orphan*/ rysuj_gwiazdki_2();
int main() {
  int w = 0;
  while (w < 5) {
    rysuj_gwiazdki_1();
    rysuj_gwiazdki_2();
    ++w;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    115c <main+0x3c>
mov    $0x0,%al
call   1030 <rysuj_gwiazdki_1@plt>
mov    $0x0,%al
call   1040 <rysuj_gwiazdki_2@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rysuj_gwiazdki_1()
%2 = tail call i32 (...) @rysuj_gwiazdki_2()
%3 = tail call i32 (...) @rysuj_gwiazdki_1()
%4 = tail call i32 (...) @rysuj_gwiazdki_2()
%5 = tail call i32 (...) @rysuj_gwiazdki_1()
%6 = tail call i32 (...) @rysuj_gwiazdki_2()
%7 = tail call i32 (...) @rysuj_gwiazdki_1()
%8 = tail call i32 (...) @rysuj_gwiazdki_2()
%9 = tail call i32 (...) @rysuj_gwiazdki_1()
%10 = tail call i32 (...) @rysuj_gwiazdki_2()
ret i32 0
}
unsigned char _farpeekb(unsigned short selector, unsigned long offset) {
  unsigned char result;
  __asm__ __volatile__("movw %w1,%%fs \n"
                       "	.byte 0x64 \n"
                       "	movb (%k2),%b0"
                       : "=q"(result)
                       : "rm"(selector), "r"(offset));
  return result;
}


x86 assembly (clang, -O0):
<_farpeekb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,-0x14(%rbp)
mov    -0x14(%rbp),%fs
mov    %fs:(%eax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_farpeekb>:
mov    %di,-0x2(%rsp)
mov    -0x2(%rsp),%fs
mov    %fs:(%esi),%al
ret

LLVM IR (-O0):
define zeroext i8 @_farpeekb(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
%5 = alloca i8
store i16 %0, i16* %3
store i64 %1, i64* %4
%6 = load i16, i16* %3
%7 = load i64, i64* %4
%8 = call i8 asm sideeffect "movw ${1:w},%fs \0A\09.byte 0x64 \0A\09movb (${2:k}),${0:b}", "=q,rm,r,~{dirflag},~{fpsr},~{flags}"(i16 %6, i64 %7)
store i8 %8, i8* %5
%9 = load i8, i8* %5
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @_farpeekb(i16 zeroext %0, i64 %1) {
%3 = tail call i8 asm sideeffect "movw ${1:w},%fs \0A\09.byte 0x64 \0A\09movb (${2:k}),${0:b}", "=q,rm,r,~{dirflag},~{fpsr},~{flags}"(i16 %0, i64 %1)
ret i8 %3
}
void pthread_setschedprio() {}


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

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

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

LLVM IR (-O2):
define void @pthread_setschedprio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configureBt5Patch();
void refreshBt5Patch(void) { configureBt5Patch(); }


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

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

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

LLVM IR (-O2):
define void @refreshBt5Patch() {
%1 = tail call i32 (...) @configureBt5Patch()
ret void
}
void foo() {
  float f = 1.5f;
  double d = 1.5;
  long double l = 1.5l;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3fc00000,-0x4(%rbp)
movabs $0x3ff8000000000000,%rax
mov    %rax,-0x10(%rbp)
flds   0xee1(%rip)
fstpt  -0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
store float 1.500000e+00, float* %1
store double 1.500000e+00, double* %2
store x86_fp80 0xK3FFFC000000000000000, x86_fp80* %3
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int drand48();
void nAleatorios(double *nums) {
  int i;
  for (i = 0; i < 1000000; i++) {
    nums[i] = drand48() * 2 - 1;
  }
}


x86 assembly (clang, -O0):
<nAleatorios>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf4240,-0xc(%rbp)
jge    115c <nAleatorios+0x4c>
mov    $0x0,%al
call   1030 <drand48@plt>
shl    $0x1,%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <nAleatorios+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nAleatorios>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <drand48@plt>
add    %eax,%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0xf4240,%rbx
jne    1120 <nAleatorios+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nAleatorios(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1000000
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = call i32 (...) @drand48()
%9 = mul nsw i32 %8, 2
%10 = sub nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = load double*, double** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double %11, double* %15
br label %16
16: ; preds = %7
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @nAleatorios(double* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %9, %2 ]
%4 = tail call i32 (...) @drand48()
%5 = shl nsw i32 %4, 1
%6 = add nsw i32 %5, -1
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds double, double* %0, i64 %3
store double %7, double* %8
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 1000000
br i1 %10, label %11, label %2
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_asserv_off();
void motion_free() { set_asserv_off(); }


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

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

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

LLVM IR (-O2):
define void @motion_free() {
%1 = tail call i32 (...) @set_asserv_off()
ret void
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *__restrict s1, const char *__restrict s2) {
  static char *next_start;
  return strtok_r(s1, s2, &next_start);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.next_start = internal global i8* null
define i8* @strtok(i8* noalias %0, i8* noalias %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* @strtok_r(i8* %5, i8* %6, i8** @strtok.next_start)
ret i8* %7
}

LLVM IR (-O2):
@strtok.next_start = internal global i8* null
define i8* @strtok(i8* noalias %0, i8* noalias nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.next_start)
ret i8* %3
}
/* Variables and functions */
int isip_check(char const *, int /*<<< orphan*/);
int isipv4ip(const char *str) { return isip_check(str, 0); }


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

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

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

LLVM IR (-O2):
define i32 @isipv4ip(i8* %0) {
%2 = tail call i32 @isip_check(i8* %0, i32 0)
ret i32 %2
}
double d() { return (double)1.5; }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @d() {
ret double 1.500000e+00
}

LLVM IR (-O2):
define double @d() {
ret double 1.500000e+00
}
void McASPRxIntEnable(unsigned int baseAddr, unsigned int intMask) {
  (*((volatile unsigned int *)(baseAddr + (0x7C)))) |= intMask;
}


x86 assembly (clang, -O0):
<McASPRxIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x7c,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxIntEnable>:
add    $0x7c,%edi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPRxIntEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 124
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, %5
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @McASPRxIntEnable(i32 %0, i32 %1) {
%3 = add i32 %0, 124
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, %1
store volatile i32 %7, i32* %5
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
double mtimediff(struct timeval te, struct timeval ts) {
  return ((te.tv_sec - ts.tv_sec) * 1000000L + (te.tv_usec - ts.tv_usec)) /
         1000;
}


x86 assembly (clang, -O0):
<mtimediff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
imul   $0xf4240,%rax,%rax
mov    -0x8(%rbp),%rcx
sub    -0x18(%rbp),%rcx
add    %rcx,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtimediff>:
sub    %rdx,%rdi
imul   $0xf4240,%rdi,%rax
sub    %rcx,%rsi
add    %rsi,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
cvtsi2sd %rdx,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @mtimediff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%16 = load i64, i64* %15
%17 = sub nsw i64 %14, %16
%18 = mul nsw i64 %17, 1000000
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%22 = load i64, i64* %21
%23 = sub nsw i64 %20, %22
%24 = add nsw i64 %18, %23
%25 = sdiv i64 %24, 1000
%26 = sitofp i64 %25 to double
ret double %26
}

LLVM IR (-O2):
define double @mtimediff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %0, %2
%6 = mul nsw i64 %5, 1000000
%7 = sub i64 %1, %3
%8 = add nsw i64 %7, %6
%9 = sdiv i64 %8, 1000
%10 = sitofp i64 %9 to double
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
void fini(int dpy) {
  Display *display = (Display *)dpy;
  XCloseDisplay(display);
}


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <XCloseDisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
movslq %edi,%rdi
jmp    1030 <XCloseDisplay@plt>

LLVM IR (-O0):
define void @fini(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @XCloseDisplay(i32* %7)
ret void
}

LLVM IR (-O2):
define void @fini(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @XCloseDisplay(i32* %3)
ret void
}
double ll_to_double(unsigned long long x) {
  return 4294967296.0 * (unsigned long)(x >> 32) + (unsigned long)x;
}


x86 assembly (clang, -O0):
<ll_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
shr    $0x20,%rcx
cvtsi2sd %rcx,%xmm0
movq   %rax,%xmm1
movaps 0xeec(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xef0(%rip),%xmm2
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xeb9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_to_double>:
movq   %rdi,%xmm1
shr    $0x20,%rdi
cvtsi2sd %rdi,%xmm0
punpckldq 0xeea(%rip),%xmm1
subpd  0xef2(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  0xeee(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ll_to_double(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = uitofp i64 %4 to double
%6 = load i64, i64* %2
%7 = uitofp i64 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x41F0000000000000, double %5, double %7)
ret double %8
}

LLVM IR (-O2):
define double @ll_to_double(i64 %0) {
%2 = lshr i64 %0, 32
%3 = uitofp i64 %2 to double
%4 = uitofp i64 %0 to double
%5 = tail call double @llvm.fmuladd.f64(double %3, double 0x41F0000000000000, double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
long strtol(char const *, char **, int);
int parseInt(const char *str) {
  char *temp;
  long val = strtol(str, &temp, 10);
  if (temp == str || *temp != '\0') {
    printf("Could not convert '%s' to long.", str);
    exit(1);
  }
  return (int)val;
}


x86 assembly (clang, -O0):
<parseInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1170 <parseInt+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     118a <parseInt+0x5a>
mov    -0x8(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    0x8(%rsp),%rcx
cmp    %rbx,%rcx
je     115c <parseInt+0x2c>
cmpb   $0x0,(%rcx)
jne    115c <parseInt+0x2c>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Could not convert '%s' to long.\00"
define i32 @parseInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %3, i32 10)
store i64 %6, i64* %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = icmp eq i8* %7, %8
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %10, %1
%16 = load i8*, i8** %2
%17 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %10
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@.str = [32 x i8] c"Could not convert '%s' to long.\00"
define i32 @parseInt(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7, %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %7
%14 = trunc i64 %4 to i32
ret i32 %14
}
int main() {
  void *p;
  void **p1 = &p;
  void **p2;
  if (p1 == p2) {
    if (p1 != p2) {
      *p2 = (void *)0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    113f <main+0x3f>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     113a <main+0x3a>
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
jmp    113f <main+0x3f>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
CchCopySz(szSource, szDest) char *szSource, *szDest;
{
  strcpy(szDest, szSource);
  return strlen(szSource);
}


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

x86 assembly (clang, -O2):
<CchCopySz>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
define i32 @CchCopySz(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @CchCopySz(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_arp_entry(unsigned int mac[6], uint32_t ip_addr) { return; }


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

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

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

LLVM IR (-O2):
define void @set_arp_entry(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void OS_Windows_print() { printf("Windows - Microsoft\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Windows - Microsoft\00"
define void @OS_Windows_print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void register_bln_implementation(struct bln_implementation *imp) {}


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

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

LLVM IR (-O0):
%struct.bln_implementation = type opaque
define void @register_bln_implementation(%struct.bln_implementation* %0) {
%2 = alloca %struct.bln_implementation*
store %struct.bln_implementation* %0, %struct.bln_implementation** %2
ret void
}

LLVM IR (-O2):
%struct.bln_implementation = type opaque
define void @register_bln_implementation(%struct.bln_implementation* nocapture %0) {
ret void
}
void test8(int a[3]) {}


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

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

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

LLVM IR (-O2):
define void @test8(i32* nocapture %0) {
ret void
}
int add(int a, int b) { return (a - b); }


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

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

LLVM IR (-O0):
define i32 @add(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void scunit__Third_test(int *scunit__test_failed) {}


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

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

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

LLVM IR (-O2):
define void @scunit__Third_test(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inet_network(char const *);
uint32_t usys_atoh(const char *ip) { return inet_network(ip); }


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

x86 assembly (clang, -O2):
<usys_atoh>:
jmp    1030 <inet_network@plt>

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

LLVM IR (-O2):
define i32 @usys_atoh(i8* %0) {
%2 = tail call i32 @inet_network(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ chmod(int /*<<< orphan*/, int);
int /*<<< orphan*/ lmc_does_file_exist(int /*<<< orphan*/);
int /*<<< orphan*/ lmc_namespace_root_path();
int /*<<< orphan*/ mkdir(int /*<<< orphan*/, int);
void lmc_shm_ensure_root_path() {
  if (!lmc_does_file_exist(lmc_namespace_root_path())) {
    mkdir(lmc_namespace_root_path(), 01777);
    chmod(lmc_namespace_root_path(), 01777);
  }
}


x86 assembly (clang, -O0):
<lmc_shm_ensure_root_path>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <lmc_namespace_root_path@plt>
mov    %eax,%edi
call   1030 <lmc_does_file_exist@plt>
cmp    $0x0,%eax
jne    1181 <lmc_shm_ensure_root_path+0x41>
mov    $0x0,%al
call   1050 <lmc_namespace_root_path@plt>
mov    %eax,%edi
mov    $0x3ff,%esi
call   1040 <mkdir@plt>
mov    $0x0,%al
call   1050 <lmc_namespace_root_path@plt>
mov    %eax,%edi
mov    $0x3ff,%esi
call   1060 <chmod@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_shm_ensure_root_path>:
push   %rax
xor    %eax,%eax
call   1050 <lmc_namespace_root_path@plt>
mov    %eax,%edi
call   1030 <lmc_does_file_exist@plt>
test   %eax,%eax
je     1155 <lmc_shm_ensure_root_path+0x15>
pop    %rax
ret
xor    %eax,%eax
call   1050 <lmc_namespace_root_path@plt>
mov    %eax,%edi
mov    $0x3ff,%esi
call   1040 <mkdir@plt>
xor    %eax,%eax
call   1050 <lmc_namespace_root_path@plt>
mov    %eax,%edi
mov    $0x3ff,%esi
pop    %rax
jmp    1060 <chmod@plt>

LLVM IR (-O0):
define void @lmc_shm_ensure_root_path() {
%1 = call i32 (...) @lmc_namespace_root_path()
%2 = call i32 @lmc_does_file_exist(i32 %1)
%3 = icmp ne i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = call i32 (...) @lmc_namespace_root_path()
%6 = call i32 @mkdir(i32 %5, i32 1023)
%7 = call i32 (...) @lmc_namespace_root_path()
%8 = call i32 @chmod(i32 %7, i32 1023)
br label %9
9: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @lmc_shm_ensure_root_path() {
%1 = tail call i32 (...) @lmc_namespace_root_path()
%2 = tail call i32 @lmc_does_file_exist(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 (...) @lmc_namespace_root_path()
%6 = tail call i32 @mkdir(i32 %5, i32 1023)
%7 = tail call i32 (...) @lmc_namespace_root_path()
%8 = tail call i32 @chmod(i32 %7, i32 1023)
br label %9
9: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ two_symbolic_accesses(int);
void tsa_two_alarms_Bad() { two_symbolic_accesses(1); }


x86 assembly (clang, -O0):
<tsa_two_alarms_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <two_symbolic_accesses@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tsa_two_alarms_Bad() {
%1 = call i32 @two_symbolic_accesses(i32 1)
ret void
}

LLVM IR (-O2):
define void @tsa_two_alarms_Bad() {
%1 = tail call i32 @two_symbolic_accesses(i32 1)
ret void
}
int test_06(int a, int b) { return (a ^ b) < 0 ? -20 : -40; }


x86 assembly (clang, -O0):
<test_06>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
xor    -0x8(%rbp),%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_06>:
xor    %esi,%edi
mov    $0xffffffec,%ecx
mov    $0xffffffd8,%eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_06(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 = xor i32 %5, %6
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -20, i32 -40
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_06(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 -20, i32 -40
ret i32 %5
}
float test_acoshf(float x) { return __builtin_acoshf(x); }


x86 assembly (clang, -O0):
<test_acoshf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acoshf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_acoshf>:
jmp    1030 <acoshf@plt>

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

LLVM IR (-O2):
define float @test_acoshf(float %0) {
%2 = tail call float @acoshf(float %0)
ret float %2
}
unsigned int UARTModemStatusGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x18)))) &
          ((0x00000080u) | (0x00000040u) | (0x00000020u) | (0x00000010u)));
}


x86 assembly (clang, -O0):
<UARTModemStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0xf0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemStatusGet>:
add    $0x18,%edi
mov    $0xf0,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 24
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 240
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = add i32 %0, 24
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 240
ret i32 %6
}
__attribute__((noclone, no)) void *
cpy(void *restrict s1, const void *restrict s2, unsigned int n) {
  char *t1 = s1;
  const char *t2 = s2;
  while (n-- > 0)
    *t1++ = *t2++;
  return s1;
}


x86 assembly (clang, -O0):
<cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jbe    115a <cpy+0x5a>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    111f <cpy+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
je     1122 <cpy+0x12>
mov    %edx,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @cpy(i8* noalias returned writeonly %0, i8* noalias nocapture %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 %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ SA1Absolute(int);
int /*<<< orphan*/ STX16(int /*<<< orphan*/, int);
void Op8EX0(void) { STX16(SA1Absolute(2), 0xFFFF); }


x86 assembly (clang, -O0):
<Op8EX0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <STX16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op8EX0>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <STX16@plt>

LLVM IR (-O0):
define void @Op8EX0() {
%1 = call i32 @SA1Absolute(i32 2)
%2 = call i32 @STX16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op8EX0() {
%1 = tail call i32 @SA1Absolute(i32 2)
%2 = tail call i32 @STX16(i32 %1, i32 65535)
ret void
}
/* Variables and functions */
int __WORDSIZE;
int /*<<< orphan*/ __bitmap_andnot(unsigned long *, unsigned long const *,
                                   unsigned long const *, int);
void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
                   const unsigned long *src2, int nbits) {
  if (nbits <= __WORDSIZE)
    *dst = *src1 & ~(*src2);
  else
    __bitmap_andnot(dst, src1, src2, nbits);
}


x86 assembly (clang, -O0):
<bitmap_andnot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%eax
jg     115a <bitmap_andnot+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    116e <bitmap_andnot+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__bitmap_andnot@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_andnot>:
mov    0x2ed1(%rip),%rax
cmp    %ecx,(%rax)
jge    1120 <bitmap_andnot+0x10>
jmp    1030 <__bitmap_andnot@plt>
mov    (%rdx),%rax
not    %rax
and    (%rsi),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@__WORDSIZE = global i32 0
define void @bitmap_andnot(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* @__WORDSIZE
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %4
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = load i64*, i64** %7
%16 = load i64, i64* %15
%17 = xor i64 %16, -1
%18 = and i64 %14, %17
%19 = load i64*, i64** %5
store i64 %18, i64* %19
br label %26
20: ; preds = %4
%21 = load i64*, i64** %5
%22 = load i64*, i64** %6
%23 = load i64*, i64** %7
%24 = load i32, i32* %8
%25 = call i32 @__bitmap_andnot(i64* %21, i64* %22, i64* %23, i32 %24)
br label %26
26: ; preds = %20, %12
ret void
}

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define void @bitmap_andnot(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = load i32, i32* @__WORDSIZE
%6 = icmp slt i32 %5, %3
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = load i64, i64* %1
%9 = load i64, i64* %2
%10 = xor i64 %9, -1
%11 = and i64 %8, %10
store i64 %11, i64* %0
br label %14
12: ; preds = %4
%13 = tail call i32 @__bitmap_andnot(i64* %0, i64* %1, i64* %2, i32 %3)
br label %14
14: ; preds = %12, %7
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *calloc_or_die(size_t count, size_t size) {
  void *result = calloc(count, size);
  if (!result) {
    fprintf(stderr, "Callocation failure.");
    exit(1);
  };
  return result;
}


x86 assembly (clang, -O0):
<calloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <calloc_or_die+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_or_die>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <calloc_or_die+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Callocation failure.\00"
define i8* @calloc_or_die(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Callocation failure.\00"
define noalias i8* @calloc_or_die(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
int _my_max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<_my_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <_my_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <_my_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_my_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @_my_max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @_my_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR84_set(void) { return U_WMRCORENONE_set("U_WMR84"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR84\00"
define i8* @U_WMR84_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR84\00"
define i8* @U_WMR84_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ listen(int, int);
void listen_sock(int sock) { listen(sock, 5); }


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

x86 assembly (clang, -O2):
<listen_sock>:
mov    $0x5,%esi
jmp    1030 <listen@plt>

LLVM IR (-O0):
define void @listen_sock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @listen(i32 %3, i32 5)
ret void
}

LLVM IR (-O2):
define void @listen_sock(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 5)
ret void
}
/* Variables and functions */
char const *strong_s2();
const char *__attribute__((section(".test.b"))) sibcall_strong_s2(void) {
  return strong_s2();
}


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

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

LLVM IR (-O0):
define i8* @sibcall_strong_s2() section ".test.b" {
%1 = call i8* (...) @strong_s2()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_strong_s2() section ".test.b" {
%1 = tail call i8* (...) @strong_s2()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printPrime(int num) { printf("Prime: %i\n", num); }


x86 assembly (clang, -O0):
<printPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPrime>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Prime: %i\0A\00"
define void @printPrime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Prime: %i\0A\00"
define void @printPrime(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
uintptr_t rte_align_floor_int(uintptr_t ptr, uintptr_t align) {
  return (ptr & ~(align - 1));
}


x86 assembly (clang, -O0):
<rte_align_floor_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_align_floor_int>:
mov    %rsi,%rax
neg    %rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @rte_align_floor_int(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 = sub i64 %6, 1
%8 = xor i64 %7, -1
%9 = and i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rte_align_floor_int(i64 %0, i64 %1) {
%3 = sub i64 0, %1
%4 = and i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int Si1132_I2C_read16(int);
int /*<<< orphan*/ usleep(int);
float Si1132_readVisible() {
  usleep(10000);
  return ((Si1132_I2C_read16(0x22) - 256) / 0.282) * 14.5;
}


x86 assembly (clang, -O0):
<Si1132_readVisible>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    $0x22,%edi
call   1030 <Si1132_I2C_read16@plt>
sub    $0x100,%eax
cvtsi2sd %eax,%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Si1132_readVisible>:
push   %rax
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    $0x22,%edi
call   1030 <Si1132_I2C_read16@plt>
add    $0xffffff00,%eax
cvtsi2sd %eax,%xmm0
divsd  0xeba(%rip),%xmm0
mulsd  0xeba(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Si1132_readVisible() {
%1 = call i32 @usleep(i32 10000)
%2 = call i32 @Si1132_I2C_read16(i32 34)
%3 = sub nsw i32 %2, 256
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 2.820000e-01
%6 = fmul double %5, 1.450000e+01
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @Si1132_readVisible() {
%1 = tail call i32 @usleep(i32 10000)
%2 = tail call i32 @Si1132_I2C_read16(i32 34)
%3 = add nsw i32 %2, -256
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 2.820000e-01
%6 = fmul double %5, 1.450000e+01
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
void note_client_request(int purpose, int compressed, size_t bytes) {
  (void)purpose;
  (void)compressed;
  (void)bytes;
}


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

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

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

LLVM IR (-O2):
define void @note_client_request(i32 %0, i32 %1, i64 %2) {
ret void
}