xunge/DecIR huggingface dataset:
void rop3_172_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_172_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_172_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %sil,%cl
and    %dl,%cl
xor    %sil,%cl
mov    %edx,%eax
not    %al
or     %cl,%al
and    %sil,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_172_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = or i32 %33, %39
%41 = load i8, i8* %6
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = and i32 %46, %49
%51 = or i32 %40, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
store i8 %52, i8* %53
ret void
}

LLVM IR (-O2):
define void @rop3_172_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %1
%8 = xor i8 %2, -1
%9 = or i8 %7, %8
%10 = and i8 %9, %1
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void syslog_fin(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @syslog_fin() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
struct timespec {
  long long tv_nsec;
  long long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long getTimestamp() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  return (ts.tv_nsec + ts.tv_sec * 1000000000LL) / 1000;
}


x86 assembly (clang, -O0):
<getTimestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
imul   $0x3b9aca00,-0x8(%rbp),%rcx
3b
add    %rcx,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimestamp>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%rax
9a 3b
add    0x8(%rsp),%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i64 @getTimestamp() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000000
%9 = add nsw i64 %5, %8
%10 = sdiv i64 %9, 1000
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i64 @getTimestamp() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC_RAW
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000000
%10 = add nsw i64 %9, %6
%11 = sdiv i64 %10, 1000
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t, float);
void utilPrintDeviceArray(float *array, unsigned int numelems) {
  for (size_t i = 0; i < numelems; i++) {
    printf("%lu, %f\n", i, array[i]);
  }
}


x86 assembly (clang, -O0):
<utilPrintDeviceArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmp    %rcx,%rax
jae    1165 <utilPrintDeviceArray+0x55>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <utilPrintDeviceArray+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilPrintDeviceArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     114a <utilPrintDeviceArray+0x3a>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movss  (%r14,%rbx,4),%xmm0
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <utilPrintDeviceArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%lu, %f\0A\00"
define void @utilPrintDeviceArray(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i64
store float* %0, float** %3
store i32 %1, i32* %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = icmp ult i64 %7, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i64, i64* %5
%13 = load float*, float** %3
%14 = load i64, i64* %5
%15 = getelementptr inbounds float, float* %13, i64 %14
%16 = load float, float* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %12, float %16)
br label %18
18: ; preds = %11
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%lu, %f\0A\00"
define void @utilPrintDeviceArray(float* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = load float, float* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %7, float %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %3
br i1 %12, label %5, label %6
}
int LZ4S_GetBlockSize_FromBlockId(int id) { return (1 << (8 + (2 * id))); }


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

x86 assembly (clang, -O2):
<LZ4S_GetBlockSize_FromBlockId>:
lea    (%rdi,%rdi,1),%ecx
add    $0x8,%cl
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @LZ4S_GetBlockSize_FromBlockId(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 8, %4
%6 = shl i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @LZ4S_GetBlockSize_FromBlockId(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 8
%4 = shl nuw i32 1, %3
ret i32 %4
}
char *langRomTypeMsxMidiExternal() { return "External MIDI"; }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"External MIDI\00"
define i8* @langRomTypeMsxMidiExternal() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t naive_ctz(uint32_t x) {
  uint32_t m, i;
  assert(x != 0);
  m = 0x1;
  i = 0;
  while ((x & m) == 0) {
    i++;
    m <<= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<naive_ctz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1160 <naive_ctz+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <naive_ctz+0x2a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naive_ctz>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1030 <assert@plt>
xor    %eax,%eax
test   $0x1,%bl
jne    1139 <naive_ctz+0x29>
mov    $0x1,%ecx
xor    %eax,%eax
xchg   %ax,%ax
add    $0x1,%eax
add    %ecx,%ecx
test   %ebx,%ecx
je     1130 <naive_ctz+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @naive_ctz(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ 0, %1 ]
%9 = phi i32 [ %11, %7 ], [ 1, %1 ]
%10 = add nuw nsw i32 %8, 1
%11 = shl i32 %9, 1
%12 = and i32 %11, %0
%13 = icmp eq i32 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %1
%15 = phi i32 [ 0, %1 ], [ %10, %7 ]
ret i32 %15
}
int ZopfliGetDistSymbol(int dist) {
  if (dist < 5) {
    return dist - 1;
  } else {
    int l = (31 ^ __builtin_clz(dist - 1));
    int r = ((dist - 1) >> (l - 1)) & 1;
    return l * 2 + r;
  }
}


x86 assembly (clang, -O0):
<ZopfliGetDistSymbol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    111f <ZopfliGetDistSymbol+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <ZopfliGetDistSymbol+0x51>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
xor    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZopfliGetDistSymbol>:
lea    -0x1(%rdi),%eax
cmp    $0x5,%edi
jl     111d <ZopfliGetDistSymbol+0x1d>
bsr    %eax,%edx
xor    $0x1f,%edx
mov    $0x1e,%cl
sub    %dl,%cl
shr    %cl,%eax
and    $0x1,%eax
lea    (%rax,%rdx,2),%eax
xor    $0x3e,%eax
ret

LLVM IR (-O0):
define i32 @ZopfliGetDistSymbol(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 = icmp slt i32 %6, 5
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %2
br label %26
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @llvm.ctlz.i32(i32 %13, i1 true)
%15 = xor i32 31, %14
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = ashr i32 %17, %19
%21 = and i32 %20, 1
store i32 %21, i32* %5
%22 = load i32, i32* %4
%23 = mul nsw i32 %22, 2
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
store i32 %25, i32* %2
br label %26
26: ; preds = %11, %8
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @ZopfliGetDistSymbol(i32 %0) {
%2 = icmp slt i32 %0, 5
%3 = add nsw i32 %0, -1
br i1 %2, label %12, label %4
4: ; preds = %1
%5 = tail call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%6 = sub nsw i32 30, %5
%7 = lshr i32 %3, %6
%8 = and i32 %7, 1
%9 = shl nuw nsw i32 %5, 1
%10 = or i32 %8, %9
%11 = xor i32 %10, 62
br label %12
12: ; preds = %1, %4
%13 = phi i32 [ %11, %4 ], [ %3, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main(void) {
  int sd = 48;
  while (sd < 58) {
    putchar(sd);
    sd++;
  }
  putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x30,-0x8(%rbp)
cmpl   $0x3a,-0x8(%rbp)
jge    1149 <main+0x39>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    $0x33,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
mov    $0x35,%edi
call   1030 <putchar@plt>
mov    $0x36,%edi
call   1030 <putchar@plt>
mov    $0x37,%edi
call   1030 <putchar@plt>
mov    $0x38,%edi
call   1030 <putchar@plt>
mov    $0x39,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@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 48, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 58
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i8
%9 = call i32 @putchar(i8 signext %8)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 48)
%2 = tail call i32 @putchar(i8 signext 49)
%3 = tail call i32 @putchar(i8 signext 50)
%4 = tail call i32 @putchar(i8 signext 51)
%5 = tail call i32 @putchar(i8 signext 52)
%6 = tail call i32 @putchar(i8 signext 53)
%7 = tail call i32 @putchar(i8 signext 54)
%8 = tail call i32 @putchar(i8 signext 55)
%9 = tail call i32 @putchar(i8 signext 56)
%10 = tail call i32 @putchar(i8 signext 57)
%11 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ param;

/* Variables and functions */
int fill_normal_config_req(unsigned char *, int, int, int, unsigned char *);
int fill_connection_params_req(unsigned char *buf) {
  unsigned char param[0x2] = {0x00, 0x00};
  return fill_normal_config_req(buf, 0x1, 0x9, sizeof(param), param);
}


x86 assembly (clang, -O0):
<fill_connection_params_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%r8
mov    $0x1,%esi
mov    $0x9,%edx
mov    $0x2,%ecx
call   1030 <fill_normal_config_req@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_connection_params_req>:
push   %rax
movw   $0x0,0x6(%rsp)
lea    0x6(%rsp),%r8
mov    $0x1,%esi
mov    $0x9,%edx
mov    $0x2,%ecx
call   1030 <fill_normal_config_req@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fill_connection_params_req(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x i8]
store i8* %0, i8** %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%7 = call i32 @fill_normal_config_req(i8* %5, i32 1, i32 9, i32 2, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fill_connection_params_req(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 0, i16* %2
%4 = call i32 @fill_normal_config_req(i8* %0, i32 1, i32 9, i32 2, i8* %3)
ret i32 %4
}
unsigned int dict_key2hash_int(void *key) { return (unsigned long)key; }


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

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

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

LLVM IR (-O2):
define i32 @dict_key2hash_int(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int templatestester_() { MAIN__(); }


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

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

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

LLVM IR (-O2):
define i32 @templatestester_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int8_t;

/* Variables and functions */
uint8_t Count1s(int8_t Byte) { return Count1s((uint8_t)Byte); }


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

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

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

LLVM IR (-O2):
define i64 @Count1s(i64 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ printf(char *);
int socketpair(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
int main(void) {
  int foo;
  int socket_vector[2];
  foo = socketpair(AF_INET, SOCK_STREAM, 0, socket_vector);
  printf("Hello World!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rcx
xor    %edx,%edx
call   1040 <socketpair@plt>
mov    %eax,-0x4(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1040 <socketpair@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = call i32 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
store i32 %6, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = call i32 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int cipxfaddr(int unit) {
  int result = 1;
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @cipxfaddr(i32 %0) {
ret i32 1
}
int foo(int a, int b) { return ((a && !b) || (!a && b)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <foo+0x23>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1142 <foo+0x42>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xa(%rbp)
jne    113c <foo+0x3c>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
xor    %al,%cl
movzbl %cl,%eax
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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7, %2
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %7
%19 = phi i1 [ true, %7 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = xor i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct sensor_network {
  int dummy;
};
struct grid {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ test_san_grid(struct sensor_network const *,
                                 struct grid const *, int /*<<< orphan*/,
                                 double);
void test_san_leaf_only(const struct sensor_network *sn, const struct grid *g,
                        double t) {
  test_san_grid(sn, g, 0, t);
}


x86 assembly (clang, -O0):
<test_san_leaf_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
xor    %edx,%edx
call   1030 <test_san_grid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_san_leaf_only>:
xor    %edx,%edx
jmp    1030 <test_san_grid@plt>

LLVM IR (-O0):
%struct.sensor_network = type { i32 }
%struct.grid = type { i32 }
define void @test_san_leaf_only(%struct.sensor_network* %0, %struct.grid* %1, double %2) {
%4 = alloca %struct.sensor_network*
%5 = alloca %struct.grid*
%6 = alloca double
store %struct.sensor_network* %0, %struct.sensor_network** %4
store %struct.grid* %1, %struct.grid** %5
store double %2, double* %6
%7 = load %struct.sensor_network*, %struct.sensor_network** %4
%8 = load %struct.grid*, %struct.grid** %5
%9 = load double, double* %6
%10 = call i32 @test_san_grid(%struct.sensor_network* %7, %struct.grid* %8, i32 0, double %9)
ret void
}

LLVM IR (-O2):
%struct.sensor_network = type { i32 }
%struct.grid = type { i32 }
define void @test_san_leaf_only(%struct.sensor_network* %0, %struct.grid* %1, double %2) {
%4 = tail call i32 @test_san_grid(%struct.sensor_network* %0, %struct.grid* %1, i32 0, double %2)
ret void
}
/* Type definitions */
struct cosmos {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cosmos_db_cleanup(struct cosmos *);
struct cosmos *cosmos_db_new();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  struct cosmos *cm;
  cm = cosmos_db_new();
  cosmos_db_cleanup(cm);
  printf("libcosmos OK\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.cosmos = type { i32 }
@.str = [14 x i8] c"libcosmos OK\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.cosmos*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.cosmos* (...) @cosmos_db_new()
store %struct.cosmos* %7, %struct.cosmos** %6
%8 = load %struct.cosmos*, %struct.cosmos** %6
%9 = call i32 @cosmos_db_cleanup(%struct.cosmos* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.cosmos = type { i32 }
@str = [13 x i8] c"libcosmos OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.cosmos* (...) @cosmos_db_new()
%4 = tail call i32 @cosmos_db_cleanup(%struct.cosmos* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned long _mm_extract_epi8(int /*<<< orphan*/, int);
unsigned long test_epi8(__m128i x) { return _mm_extract_epi8(x, 4); }


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

x86 assembly (clang, -O2):
<test_epi8>:
mov    $0x4,%esi
jmp    1030 <_mm_extract_epi8@plt>

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

LLVM IR (-O2):
define i64 @test_epi8(i32 %0) {
%2 = tail call i64 @_mm_extract_epi8(i32 %0, i32 4)
ret i64 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
double sfmt_to_real3(uint32_t v) {
  return (((double)v) + 0.5) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<sfmt_to_real3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfmt_to_real3>:
cvtsi2sd %rdi,%xmm0
addsd  0xef3(%rip),%xmm0
mulsd  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sfmt_to_real3(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fmul double %5, 0x3DF0000000000000
ret double %6
}

LLVM IR (-O2):
define double @sfmt_to_real3(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}
unsigned short buf_get_uint16_be(const void *buf, unsigned long addr) {
  const unsigned char *tmp = (const unsigned char *)buf + addr;
  unsigned short ret;
  ret = tmp[0];
  ret = (ret << 8) | tmp[1];
  return (ret);
}


x86 assembly (clang, -O0):
<buf_get_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_get_uint16_be>:
movzwl (%rdi,%rsi,1),%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @buf_get_uint16_be(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = or i16 %6, %9
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ show_double(double);
int /*<<< orphan*/ show_long(long);
int /*<<< orphan*/ show_short(short);
int main(void) {
  short int s_int = 7;
  long int l_int = 77;
  double d_flt = 777;
  show_short(s_int);
  show_long(l_int);
  show_double(d_flt);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x7,-0x6(%rbp)
movq   $0x4d,-0x10(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movswl -0x6(%rbp),%edi
call   1050 <show_short@plt>
mov    -0x10(%rbp),%rdi
call   1040 <show_long@plt>
movsd  -0x18(%rbp),%xmm0
call   1060 <show_double@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1050 <show_short@plt>
mov    $0x4d,%edi
call   1040 <show_long@plt>
movsd  0xea3(%rip),%xmm0
call   1060 <show_double@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i64
%4 = alloca double
store i32 0, i32* %1
store i16 7, i16* %2
store i64 77, i64* %3
store double 7.770000e+02, double* %4
%5 = load i16, i16* %2
%6 = call i32 @show_short(i16 signext %5)
%7 = load i64, i64* %3
%8 = call i32 @show_long(i64 %7)
%9 = load double, double* %4
%10 = call i32 @show_double(double %9)
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @show_short(i16 signext 7)
%2 = tail call i32 @show_long(i64 77)
%3 = tail call i32 @show_double(double 7.770000e+02)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
void foo163() {}


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

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

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

LLVM IR (-O2):
define void @foo163() {
ret void
}
/* Variables and functions */
char *realloc(char *, int);
char *append_buffer(char *buffer, const char append, int *bufferlen) {
  (*bufferlen)++;
  buffer = realloc(buffer, ((*bufferlen) + 1) * sizeof(char));
  buffer[*bufferlen - 1] = append;
  buffer[*bufferlen] = 0;
  return buffer;
}


x86 assembly (clang, -O0):
<append_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_buffer>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    (%rdx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rdx)
add    $0x2,%esi
call   1030 <realloc@plt>
movslq (%rbx),%rcx
mov    %bpl,-0x1(%rcx,%rax,1)
movslq (%rbx),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @append_buffer(i8* %0, i8 signext %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = add nsw i32 %4, 2
%7 = tail call i8* @realloc(i8* %0, i32 %6)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
store i8 %1, i8* %11
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %7, i64 %13
store i8 0, i8* %14
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ mask;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int bind_to_cpu(int cpu) {
  cpu_set_t mask;
  printf("Binding to cpu %d\n", cpu);
  CPU_ZERO(&mask);
  CPU_SET(cpu, &mask);
  return sched_setaffinity(0, sizeof(mask), &mask);
}


x86 assembly (clang, -O0):
<bind_to_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1050 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1040 <sched_setaffinity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_to_cpu>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1040 <sched_setaffinity@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Binding to cpu %d\0A\00"
define i32 @bind_to_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @CPU_ZERO(i32* %3)
%7 = load i32, i32* %2
%8 = call i32 @CPU_SET(i32 %7, i32* %3)
%9 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %3)
ret i32 %9
}

LLVM IR (-O2):
@.str = [19 x i8] c"Binding to cpu %d\0A\00"
define i32 @bind_to_cpu(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @CPU_ZERO(i32* %2)
%6 = call i32 @CPU_SET(i32 %0, i32* %2)
%7 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %2)
ret i32 %7
}
void psdraw_circle(int x, int y, int z, int rad, char r, char g, char b) {}


x86 assembly (clang, -O0):
<psdraw_circle>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x24(%rbp)
mov    %ecx,%eax
mov    -0x24(%rbp),%ecx
mov    %eax,-0x20(%rbp)
mov    %edx,%eax
mov    -0x20(%rbp),%edx
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    -0x1c(%rbp),%esi
mov    %eax,-0x18(%rbp)
mov    %edi,%r8d
mov    -0x18(%rbp),%edi
mov    %r9b,%al
mov    0x10(%rbp),%r9b
mov    %r8d,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @psdraw_circle(i32 %0, i32 %1, i32 %2, i32 %3, i8 signext %4, i8 signext %5, i8 signext %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8 %4, i8* %12
store i8 %5, i8* %13
store i8 %6, i8* %14
ret void
}

LLVM IR (-O2):
define void @psdraw_circle(i32 %0, i32 %1, i32 %2, i32 %3, i8 signext %4, i8 signext %5, i8 signext %6) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showMenu() {
  printf("Welcome\n");
  printf("1 - Index\n");
  printf("2 - Search\n");
  printf("0 - Exit\n");
  printf("\nEnter option: ");
}


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

x86 assembly (clang, -O2):
<showMenu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Welcome\0A\00"
@.str.1 = [11 x i8] c"1 - Index\0A\00"
@.str.2 = [12 x i8] c"2 - Search\0A\00"
@.str.3 = [10 x i8] c"0 - Exit\0A\00"
@.str.4 = [16 x i8] c"\0AEnter option: \00"
define void @showMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.4 = [16 x i8] c"\0AEnter option: \00"
@str = [8 x i8] c"Welcome\00"
@str.5 = [10 x i8] c"1 - Index\00"
@str.6 = [11 x i8] c"2 - Search\00"
@str.7 = [9 x i8] c"0 - Exit\00"
define void @showMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_67(void) {
  { a_0_55(((((39)))), "( ?"); }
}


x86 assembly (clang, -O0):
<a_0_67>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_67>:
lea    0xee9(%rip),%rsi
mov    $0x27,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"( ?\00"
define void @a_0_67() {
%1 = call i32 @a_0_55(i32 39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"( ?\00"
define void @a_0_67() {
%1 = tail call i32 @a_0_55(i32 39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__7__GeneralIO__set();
void CC2420ControlP__RSTN__set(void) { Msp430GpioC__7__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__RSTN__set() {
%1 = tail call i32 (...) @Msp430GpioC__7__GeneralIO__set()
ret void
}
/* Type definitions */
typedef int uLong;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int digest_bytestream(int);
int open(char const *, int /*<<< orphan*/);
uLong digest_file(const char *filename) {
  int fd;
  uLong crc;
  fd = open(filename, O_RDONLY);
  if (fd == -1)
    return 1;
  crc = digest_bytestream(fd);
  close(fd);
  return crc;
}


x86 assembly (clang, -O0):
<digest_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1167 <digest_file+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1180 <digest_file+0x50>
mov    -0x14(%rbp),%edi
call   1030 <digest_bytestream@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digest_file>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     115c <digest_file+0x2c>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <digest_bytestream@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
jmp    1161 <digest_file+0x31>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @digest_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %18
12: ; preds = %1
%13 = load i32, i32* %4
%14 = call i32 @digest_bytestream(i32 %13)
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @close(i32 %15)
%17 = load i32, i32* %5
store i32 %17, i32* %2
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @digest_file(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @digest_bytestream(i32 %3)
%7 = tail call i32 @close(i32 %3)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %6, %5 ], [ 1, %1 ]
ret i32 %9
}
int filtep(int rlt1, int al1, int rlt2, int al2) {
  long int pl, pl2;
  pl = 2 * rlt1;
  pl = (long)al1 * pl;
  pl2 = 2 * rlt2;
  pl += (long)al2 * pl2;
  return ((int)(pl >> 15));
}


x86 assembly (clang, -O0):
<filtep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
movslq -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
movslq -0x10(%rbp),%rax
imul   -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sar    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filtep>:
add    %edi,%edi
movslq %edi,%rax
movslq %esi,%rsi
imul   %rax,%rsi
add    %edx,%edx
movslq %edx,%rdx
movslq %ecx,%rax
imul   %rdx,%rax
add    %rsi,%rax
shr    $0xf,%rax
ret

LLVM IR (-O0):
define i32 @filtep(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = mul nsw i32 2, %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %9
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = load i64, i64* %9
%17 = mul nsw i64 %15, %16
store i64 %17, i64* %9
%18 = load i32, i32* %7
%19 = mul nsw i32 2, %18
%20 = sext i32 %19 to i64
store i64 %20, i64* %10
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = load i64, i64* %10
%24 = mul nsw i64 %22, %23
%25 = load i64, i64* %9
%26 = add nsw i64 %25, %24
store i64 %26, i64* %9
%27 = load i64, i64* %9
%28 = ashr i64 %27, 15
%29 = trunc i64 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @filtep(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %0, 1
%6 = sext i32 %5 to i64
%7 = sext i32 %1 to i64
%8 = mul nsw i64 %7, %6
%9 = shl nsw i32 %2, 1
%10 = sext i32 %9 to i64
%11 = sext i32 %3 to i64
%12 = mul nsw i64 %11, %10
%13 = add nsw i64 %12, %8
%14 = lshr i64 %13, 15
%15 = trunc i64 %14 to i32
ret i32 %15
}