xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *realloc(void *, size_t);
void *safe_realloc(void *ptr, size_t size) {
  void *mem = NULL;
  if ((mem = realloc(ptr, size)) != NULL)
    return mem;
  else {
    printf("Memory re-allocation error");
    return NULL;
  }
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1160 <safe_realloc+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <safe_realloc+0x54>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_realloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Memory re-allocation error\00"
define i8* @safe_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* null, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %6
store i8* %12, i8** %3
br label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %15
15: ; preds = %13, %11
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [27 x i8] c"Memory re-allocation error\00"
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void WatchdogEnable(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <WatchdogEnable+0x2d>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogEnable>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40000000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
orq    $0x1,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 8
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = or i64 %15, 1
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @WatchdogEnable(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, 1
store volatile i64 %9, i64* %7
ret void
}
void INT_Excep_ICU_IRQ6(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ6() {
ret void
}
long g1(long a, long b) { return a != b; }


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

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

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

LLVM IR (-O2):
define i64 @g1(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
int sqrt(int);
int isPrime(int num) {
  int i, temp;
  temp = sqrt(num);
  for (i = 2; i <= temp; i++) {
    if (num % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1168 <isPrime+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1155 <isPrime+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116f <isPrime+0x5f>
jmp    115a <isPrime+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <isPrime+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    $0x1,%ecx
cmp    $0x2,%eax
jl     114f <isPrime+0x3f>
mov    %eax,%esi
neg    %esi
mov    $0x2,%edi
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     114d <isPrime+0x3d>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
jne    1130 <isPrime+0x20>
jmp    114f <isPrime+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = add nuw i32 %8, 1
%6 = icmp eq i32 %8, %2
br i1 %6, label %11, label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 2, %1 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  fputs("\x1b[2J\x1b[H", stdout);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
float FormatAccelRange(float accelAngle, float accelZ) {
  if (accelZ < 0.0f) {
    accelAngle = 3.1415926f - accelAngle;
  } else if (accelZ > 0.0f && accelAngle < 0.0f) {
    accelAngle = 6.2831853f + accelAngle;
  }
  return accelAngle;
}


x86 assembly (clang, -O0):
<FormatAccelRange>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <FormatAccelRange+0x32>
movss  0xee1(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1167 <FormatAccelRange+0x67>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1162 <FormatAccelRange+0x62>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1162 <FormatAccelRange+0x62>
movss  0xea8(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1167 <FormatAccelRange+0x67>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FormatAccelRange>:
movaps %xmm0,%xmm2
xorps  %xmm3,%xmm3
ucomiss %xmm1,%xmm3
jbe    1118 <FormatAccelRange+0x18>
movss  0xef1(%rip),%xmm0
subss  %xmm2,%xmm0
ret
movss  0xee0(%rip),%xmm4
addss  %xmm2,%xmm4
movaps %xmm2,%xmm0
cmpltss %xmm3,%xmm0
cmpltss %xmm1,%xmm3
andps  %xmm3,%xmm4
andnps %xmm2,%xmm3
orps   %xmm4,%xmm3
andps  %xmm0,%xmm3
andnps %xmm2,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @FormatAccelRange(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load float, float* %3
%9 = fsub float 0x400921FB40000000, %8
store float %9, float* %3
br label %20
10: ; preds = %2
%11 = load float, float* %4
%12 = fcmp ogt float %11, 0.000000e+00
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load float, float* %3
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load float, float* %3
%18 = fadd float 0x401921FB60000000, %17
store float %18, float* %3
br label %19
19: ; preds = %16, %13, %10
br label %20
20: ; preds = %19, %7
%21 = load float, float* %3
ret float %21
}

LLVM IR (-O2):
define float @FormatAccelRange(float %0, float %1) {
%3 = fcmp olt float %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = fsub float 0x400921FB40000000, %0
br label %12
6: ; preds = %2
%7 = fcmp ogt float %1, 0.000000e+00
%8 = fcmp olt float %0, 0.000000e+00
%9 = and i1 %8, %7
%10 = fadd float %0, 0x401921FB60000000
%11 = select i1 %9, float %10, float %0
br label %12
12: ; preds = %6, %4
%13 = phi float [ %5, %4 ], [ %11, %6 ]
ret float %13
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ getcwd(char *, int);
char *get_cwd(void) {
  char *buf = calloc(1, 256);
  if (buf == NULL)
    return NULL;
  getcwd(buf, 256);
  return buf;
}


x86 assembly (clang, -O0):
<get_cwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x100,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <get_cwd+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1169 <get_cwd+0x49>
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
call   1030 <getcwd@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cwd>:
push   %rbx
mov    $0x1,%edi
mov    $0x100,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1145 <get_cwd+0x25>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <getcwd@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_cwd() {
%1 = tail call dereferenceable_or_null(256) i8* @calloc(i32 1, i32 256)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @getcwd(i8* %1, i32 256)
br label %5
5: ; preds = %0, %3
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ die_errno(char *, void *, char const *);
int vasprintf(char **, char const *, int /*<<< orphan*/);
int xvasprintf(char **strp, const char *fmt, va_list ap) {
  int ret;
  ret = vasprintf(strp, fmt, ap);
  if (ret == -1)
    die_errno("asprintf(%p, %s, ...)", (void *)strp, fmt);
  return ret;
}


x86 assembly (clang, -O0):
<xvasprintf>:
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 <vasprintf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1164 <xvasprintf+0x44>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea1(%rip),%rdi
call   1040 <die_errno@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xvasprintf>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <vasprintf@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1148 <xvasprintf+0x28>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <die_errno@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"asprintf(%p, %s, ...)\00"
define i32 @xvasprintf(i8** %0, i8* %1, i32 %2) {
%4 = tail call i32 @vasprintf(i8** %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = bitcast i8** %0 to i8*
%8 = tail call i32 @die_errno(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %1)
br label %9
9: ; preds = %6, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ xdrproc_t;
struct svc_req {
  int rq_proc;
};
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ svc_sendreply(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
scalar_t__ xdr_void;
void dispatch(struct svc_req *request, SVCXPRT *xprt) {
  svc_sendreply(xprt, (xdrproc_t)xdr_void, 0);
  if (request->rq_proc == 2)
    exit(0);
}


x86 assembly (clang, -O0):
<dispatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <svc_sendreply@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x2,(%rax)
jne    115b <dispatch+0x3b>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispatch>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
xor    %edx,%edx
call   1030 <svc_sendreply@plt>
cmpl   $0x2,(%rbx)
je     1141 <dispatch+0x21>
pop    %rbx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
@xdr_void = global i64 0
define void @dispatch(%struct.svc_req* %0, i32* %1) {
%3 = alloca %struct.svc_req*
%4 = alloca i32*
store %struct.svc_req* %0, %struct.svc_req** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i64, i64* @xdr_void
%7 = trunc i64 %6 to i32
%8 = call i32 @svc_sendreply(i32* %5, i32 %7, i32 0)
%9 = load %struct.svc_req*, %struct.svc_req** %3
%10 = getelementptr inbounds %struct.svc_req, %struct.svc_req* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
@xdr_void = global i64 0
define void @dispatch(%struct.svc_req* nocapture %0, i32* %1) {
%3 = load i64, i64* @xdr_void
%4 = trunc i64 %3 to i32
%5 = tail call i32 @svc_sendreply(i32* %1, i32 %4, i32 0)
%6 = getelementptr inbounds %struct.svc_req, %struct.svc_req* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DoWork() { printf("... Doing work in a loadable module!\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"... Doing work in a loadable module!\0A\00"
define void @DoWork() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"... Doing work in a loadable module!\00"
define void @DoWork() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct cstr_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cstr_appendm(struct cstr_t *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ cstr_count(struct cstr_t *);
int /*<<< orphan*/ cstr_getbufptr(struct cstr_t *);
void cstr_appendcstr(struct cstr_t *v, struct cstr_t *u) {
  ;
  cstr_appendm(v, cstr_count(u), cstr_getbufptr(u));
  { return; };
}


x86 assembly (clang, -O0):
<cstr_appendcstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <cstr_count@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cstr_getbufptr@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1040 <cstr_appendm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr_appendcstr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <cstr_count@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <cstr_getbufptr@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cstr_appendm@plt>

LLVM IR (-O0):
%struct.cstr_t = type { i32 }
define void @cstr_appendcstr(%struct.cstr_t* %0, %struct.cstr_t* %1) {
%3 = alloca %struct.cstr_t*
%4 = alloca %struct.cstr_t*
store %struct.cstr_t* %0, %struct.cstr_t** %3
store %struct.cstr_t* %1, %struct.cstr_t** %4
%5 = load %struct.cstr_t*, %struct.cstr_t** %3
%6 = load %struct.cstr_t*, %struct.cstr_t** %4
%7 = call i32 @cstr_count(%struct.cstr_t* %6)
%8 = load %struct.cstr_t*, %struct.cstr_t** %4
%9 = call i32 @cstr_getbufptr(%struct.cstr_t* %8)
%10 = call i32 @cstr_appendm(%struct.cstr_t* %5, i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.cstr_t = type { i32 }
define void @cstr_appendcstr(%struct.cstr_t* %0, %struct.cstr_t* %1) {
%3 = tail call i32 @cstr_count(%struct.cstr_t* %1)
%4 = tail call i32 @cstr_getbufptr(%struct.cstr_t* %1)
%5 = tail call i32 @cstr_appendm(%struct.cstr_t* %0, i32 %3, i32 %4)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void test_vorrimm_u16x4(uint16_t *__restrict__ dest, uint16_t *a) {
  int i;
  for (i = 0; i < 4; i++) {
    dest[i] = a[i] | 1;
  }
}


x86 assembly (clang, -O0):
<test_vorrimm_u16x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1144 <test_vorrimm_u16x4+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vorrimm_u16x4+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorrimm_u16x4>:
movups (%rsi),%xmm0
orps   0xef6(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @test_vorrimm_u16x4(i32* noalias %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 = %20, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = or i32 %14, 1
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @test_vorrimm_u16x4(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = or <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
ret void
}
void ff_hevc_put_hevc_bi_epel_v6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v6_12_sse4() {
ret void
}
/* Variables and functions */
scalar_t__ is_lower(unsigned char);
scalar_t__ is_upper(unsigned char);
unsigned int is_letter(unsigned char ch) {
  return (is_upper(ch) || is_lower(ch));
}


x86 assembly (clang, -O0):
<is_letter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <is_upper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <is_letter+0x3c>
movzbl -0x1(%rbp),%edi
call   1030 <is_lower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_letter>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_upper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_letter+0x17>
pop    %rbx
ret
movzbl %bl,%edi
call   1030 <is_lower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_letter(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_upper(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_lower(i8 zeroext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_letter(i8 zeroext %0) {
%2 = tail call i64 @is_upper(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_lower(i8 zeroext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
double atan2(double y, double x) {}


x86 assembly (clang, -O0):
<atan2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @atan2(double %0, double %1) {
ret double undef
}
/* Type definitions */
struct rlimit {
  int /*<<< orphan*/ rlim_max;
  int /*<<< orphan*/ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_MEMLOCK;
int /*<<< orphan*/ RLIM_INFINITY;
int errno;
scalar_t__ setrlimit(int /*<<< orphan*/, struct rlimit *);
int rlimit_fix(void) {
  struct rlimit limit = {.rlim_cur = RLIM_INFINITY, .rlim_max = RLIM_INFINITY};
  if (setrlimit(RLIMIT_MEMLOCK, &limit))
    return errno;
  return 0;
}


x86 assembly (clang, -O0):
<rlimit_fix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <setrlimit@plt>
cmp    $0x0,%rax
je     115d <rlimit_fix+0x4d>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <rlimit_fix+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlimit_fix>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %eax,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <setrlimit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1145 <rlimit_fix+0x35>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@RLIM_INFINITY = global i32 0
@RLIMIT_MEMLOCK = global i32 0
@errno = global i32 0
define i32 @rlimit_fix() {
%1 = alloca i32
%2 = alloca %struct.rlimit
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
%4 = load i32, i32* @RLIM_INFINITY
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 1
%6 = load i32, i32* @RLIM_INFINITY
store i32 %6, i32* %5
%7 = load i32, i32* @RLIMIT_MEMLOCK
%8 = call i64 @setrlimit(i32 %7, %struct.rlimit* %2)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* @errno
store i32 %11, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@RLIM_INFINITY = global i32 0
@RLIMIT_MEMLOCK = global i32 0
@errno = global i32 0
define i32 @rlimit_fix() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%4 = load i32, i32* @RLIM_INFINITY
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 1
store i32 %4, i32* %5
%6 = load i32, i32* @RLIMIT_MEMLOCK
%7 = call i64 @setrlimit(i32 %6, %struct.rlimit* %1)
%8 = icmp eq i64 %7, 0
%9 = load i32, i32* @errno
%10 = select i1 %8, i32 0, i32 %9
ret i32 %10
}
int foo(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LED_REG_RestoreConfig();
void LED_REG_Wakeup(void) { LED_REG_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @LED_REG_Wakeup() {
%1 = tail call i32 (...) @LED_REG_RestoreConfig()
ret void
}
/* Variables and functions */
int strlen(char *s) {
  int i = 0;
  while (*(s + i))
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _get_offset_byte(int);
char *capar_byte(int /*<<< orphan*/);
signed char *get_offset_byte(int m) {
  return (capar_byte(_get_offset_byte(m)));
}


x86 assembly (clang, -O0):
<get_offset_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_get_offset_byte@plt>
mov    %eax,%edi
call   1040 <capar_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_offset_byte>:
push   %rax
call   1030 <_get_offset_byte@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <capar_byte@plt>

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

LLVM IR (-O2):
define i8* @get_offset_byte(i32 %0) {
%2 = tail call i32 @_get_offset_byte(i32 %0)
%3 = tail call i8* @capar_byte(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void _assert_true(const unsigned long long result, const char *const expression,
                  const char *const file, const int line) {
  __coverity_panic__();
}


x86 assembly (clang, -O0):
<_assert_true>:
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    $0x0,%al
call   1030 <__coverity_panic__@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_assert_true(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @_assert_true(i64 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @__coverity_panic__()
ret void
}
void crc16ccitt_final(unsigned short *uCcitt16) { *uCcitt16 = ~(*uCcitt16); }


x86 assembly (clang, -O0):
<crc16ccitt_final>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
xor    $0xffffffff,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16ccitt_final>:
notw   (%rdi)
ret

LLVM IR (-O0):
define void @crc16ccitt_final(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i16
%8 = load i16*, i16** %2
store i16 %7, i16* %8
ret void
}

LLVM IR (-O2):
define void @crc16ccitt_final(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = xor i16 %2, -1
store i16 %3, i16* %0
ret void
}
int xmlUCSIsByzantineMusicalSymbols(int code) {
  return (((code >= 0x1D000) && (code <= 0x1D0FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsByzantineMusicalSymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1d000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsByzantineMusicalSymbols+0x26>
cmpl   $0x1d0ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsByzantineMusicalSymbols>:
and    $0xffffff00,%edi
xor    %eax,%eax
cmp    $0x1d000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsByzantineMusicalSymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 118784
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 119039
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsByzantineMusicalSymbols(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 118784
%4 = zext i1 %3 to i32
ret i32 %4
}
char *stpcpy(char *dest, const char *src) {
  int c;
  while ((c = *src++))
    *dest++ = c;
  *dest = 0;
  return dest;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1145 <stpcpy+0x45>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <stpcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <stpcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <stpcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
void dummy(int *x) {}


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

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

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

LLVM IR (-O2):
define void @dummy(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int compare_strings_2(const void *a, const void *b) {
  return strncmp(*(const char **)a, *(const char **)b, 2);
}


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

x86 assembly (clang, -O2):
<compare_strings_2>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    $0x2,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @compare_strings_2(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strncmp(i8* %7, i8* %10, i32 2)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_strings_2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strncmp(i8* %4, i8* %6, i32 2)
ret i32 %7
}
/* Variables and functions */
long _main(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long re = _main(NULL, NULL);
  printf("%ld\n", re);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @_main(i32* null, i32* null)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i64 @_main(i32* null, i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "chgrp"
        " [-hR] group file ...\n       "
        "chgrp"
        " -R [-H | -L | -P] group file ...\n  -h    Set the group IDs on "
        "symbolic links\n  -R    Recursively change file group IDs\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [167 x i8] c"Usage: chgrp [-hR] group file ...\0A chgrp -R [-H | -L | -P] group file ...\0A -h Set the group IDs on symbolic links\0A -R Recursively change file group IDs\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [167 x i8] c"Usage: chgrp [-hR] group file ...\0A chgrp -R [-H | -L | -P] group file ...\0A -h Set the group IDs on symbolic links\0A -R Recursively change file group IDs\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void co_write8(void const *ptr8, uint32_t value) { *(uint8_t *)ptr8 = value; }


x86 assembly (clang, -O0):
<co_write8>:
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):
<co_write8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @co_write8(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 i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @co_write8(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int SDL_imageFilterMeanMMX(unsigned char *Src1, unsigned char *Src2,
                           unsigned char *Dest, int length,
                           unsigned char *Mask) {
  return (0);
}


x86 assembly (clang, -O0):
<SDL_imageFilterMeanMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterMeanMMX(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @SDL_imageFilterMeanMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t smpte_fec_get_ts_recovery(const uint8_t *p_fec) {
  return (p_fec[8] << 24) | (p_fec[9] << 16) | (p_fec[10] << 8) | p_fec[11];
}


x86 assembly (clang, -O0):
<smpte_fec_get_ts_recovery>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x24(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x2c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_get_ts_recovery>:
mov    0x20(%rdi),%eax
mov    0x24(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x28(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x2c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @smpte_fec_get_ts_recovery(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 9
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 10
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 11
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @smpte_fec_get_ts_recovery(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 9
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 10
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 11
%14 = load i32, i32* %13
%15 = or i32 %12, %14
ret i32 %15
}
void avcodec_find_decoder_by_name() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_find_decoder_by_name() {
ret void
}
unsigned int f82(unsigned int x, unsigned long int y) {
  return (x << ((-y) & (8 * 4 - 1))) + (x >> y);
}


x86 assembly (clang, -O0):
<f82>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f82>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f82(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub i64 0, %6
%8 = and i64 %7, 31
%9 = trunc i64 %8 to i32
%10 = shl i32 %5, %9
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = lshr i32 %11, %13
%15 = add i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f82(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 0, %3
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = lshr i32 %0, %3
%8 = add i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ NSEEL_quit();
void JamesDSPGlobalMemoryDeallocation() { NSEEL_quit(); }


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

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

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

LLVM IR (-O2):
define void @JamesDSPGlobalMemoryDeallocation() {
%1 = tail call i32 (...) @NSEEL_quit()
ret void
}