xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ libglitch_biquad_test();
int /*<<< orphan*/ libglitch_byte_test();
int /*<<< orphan*/ libglitch_delay_test();
int /*<<< orphan*/ libglitch_env_test();
int /*<<< orphan*/ libglitch_hz_test();
int /*<<< orphan*/ libglitch_osc_test();
int /*<<< orphan*/ libglitch_pluck_test();
int /*<<< orphan*/ libglitch_rand_test();
void libglitch_test() {
  libglitch_rand_test();
  libglitch_byte_test();
  libglitch_hz_test();
  libglitch_osc_test();
  libglitch_biquad_test();
  libglitch_env_test();
  libglitch_delay_test();
  libglitch_pluck_test();
}


x86 assembly (clang, -O0):
<libglitch_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <libglitch_rand_test@plt>
mov    $0x0,%al
call   10a0 <libglitch_byte_test@plt>
mov    $0x0,%al
call   1040 <libglitch_hz_test@plt>
mov    $0x0,%al
call   1080 <libglitch_osc_test@plt>
mov    $0x0,%al
call   1030 <libglitch_biquad_test@plt>
mov    $0x0,%al
call   1050 <libglitch_env_test@plt>
mov    $0x0,%al
call   1090 <libglitch_delay_test@plt>
mov    $0x0,%al
call   1070 <libglitch_pluck_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<libglitch_test>:
push   %rax
xor    %eax,%eax
call   1060 <libglitch_rand_test@plt>
xor    %eax,%eax
call   10a0 <libglitch_byte_test@plt>
xor    %eax,%eax
call   1040 <libglitch_hz_test@plt>
xor    %eax,%eax
call   1080 <libglitch_osc_test@plt>
xor    %eax,%eax
call   1030 <libglitch_biquad_test@plt>
xor    %eax,%eax
call   1050 <libglitch_env_test@plt>
xor    %eax,%eax
call   1090 <libglitch_delay_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <libglitch_pluck_test@plt>

LLVM IR (-O0):
define void @libglitch_test() {
%1 = call i32 (...) @libglitch_rand_test()
%2 = call i32 (...) @libglitch_byte_test()
%3 = call i32 (...) @libglitch_hz_test()
%4 = call i32 (...) @libglitch_osc_test()
%5 = call i32 (...) @libglitch_biquad_test()
%6 = call i32 (...) @libglitch_env_test()
%7 = call i32 (...) @libglitch_delay_test()
%8 = call i32 (...) @libglitch_pluck_test()
ret void
}

LLVM IR (-O2):
define void @libglitch_test() {
%1 = tail call i32 (...) @libglitch_rand_test()
%2 = tail call i32 (...) @libglitch_byte_test()
%3 = tail call i32 (...) @libglitch_hz_test()
%4 = tail call i32 (...) @libglitch_osc_test()
%5 = tail call i32 (...) @libglitch_biquad_test()
%6 = tail call i32 (...) @libglitch_env_test()
%7 = tail call i32 (...) @libglitch_delay_test()
%8 = tail call i32 (...) @libglitch_pluck_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int bitwise_log2(unsigned long bf) {
  return (8 * sizeof(unsigned long)) - __builtin_clzl(bf);
}


x86 assembly (clang, -O0):
<bitwise_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
movslq %eax,%rcx
mov    $0x40,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwise_log2>:
bsr    %rdi,%rax
xor    $0xffffffc0,%eax
add    $0x41,%eax
ret

LLVM IR (-O0):
define i32 @bitwise_log2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
%7 = sub i64 64, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @bitwise_log2(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
%4 = sub nuw nsw i32 64, %3
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t RORuint64_t(uint64_t x, uint64_t y) {
  return (x >> y) | (x << (64 - y));
}


x86 assembly (clang, -O0):
<RORuint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RORuint64_t>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @RORuint64_t(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RORuint64_t(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void btc(unsigned int *v, unsigned int b) {
  asm("btc %1,%0" : "=m"(*v) : "Ir"(b));
}


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

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

LLVM IR (-O0):
define void @btc(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
ret void
}

LLVM IR (-O2):
define void @btc(i32* %0, i32 %1) {
tail call void asm "btc $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int errno;
void close_dir_keep_errno(DIR *dp) {
  int save = errno;
  if (dp)
    closedir(dp);
  errno = save;
}


x86 assembly (clang, -O0):
<close_dir_keep_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <close_dir_keep_errno+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <closedir@plt>
mov    -0xc(%rbp),%ecx
mov    0x2e9a(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_dir_keep_errno>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
test   %rdi,%rdi
je     1126 <close_dir_keep_errno+0x16>
call   1030 <closedir@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @close_dir_keep_errno(i32* %0) {
%2 = load i32, i32* @errno
%3 = icmp eq i32* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %0)
br label %6
6: ; preds = %4, %1
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core11_print(char *, char const *);
void U_EMRINVERTRGN_print(const char *contents) {
  core11_print("U_EMRINVERTRGN", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRINVERTRGN_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core11_print@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"U_EMRINVERTRGN\00"
define void @U_EMRINVERTRGN_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core11_print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"U_EMRINVERTRGN\00"
define void @U_EMRINVERTRGN_print(i8* %0) {
%2 = tail call i32 @core11_print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int lseek(int const, int const, int const);
off_t our_lseek(const int fd, const off_t offset, const int whence) {
  do {
    const off_t pos = lseek(fd, offset, whence);
    if (pos != -1) {
      return pos;
    }
  } while (errno == EINTR);
  return -1;
}


x86 assembly (clang, -O0):
<our_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <lseek@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1147 <our_lseek+0x37>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <our_lseek+0x5d>
jmp    114c <our_lseek+0x3c>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
je     1121 <our_lseek+0x11>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<our_lseek>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%r15
mov    0x2eab(%rip),%r12
nopl   (%rax)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <lseek@plt>
cmp    $0xffffffff,%eax
jne    114a <our_lseek+0x3a>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <our_lseek+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @our_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
br label %9
9: ; preds = %19, %3
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @lseek(i32 %10, i32 %11, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = load i32, i32* %8
store i32 %17, i32* %4
br label %24
18: ; preds = %9
br label %19
19: ; preds = %18
%20 = load i64, i64* @errno
%21 = load i64, i64* @EINTR
%22 = icmp eq i64 %20, %21
br i1 %22, label %9, label %23
23: ; preds = %19
store i32 -1, i32* %4
br label %24
24: ; preds = %23, %16
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @our_lseek(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
ret i32 %5
}
void unsigned_prune_zero1_Good(unsigned int x) {
  if (x != 0) {
    unsigned int y = x - 1;
  }
}


x86 assembly (clang, -O0):
<unsigned_prune_zero1_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111a <unsigned_prune_zero1_Good+0x1a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unsigned_prune_zero1_Good(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub i32 %7, 1
store i32 %8, i32* %3
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @unsigned_prune_zero1_Good(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xcirculate;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcirculate_send_event(void *_p) {
  return (int)((XEvent *)_p)->xcirculate.send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xcirculate_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
float tml_sr_vSum(float const *, int);
float tml_sr_vMean(const float *vec, int n) {
  return tml_sr_vSum(vec, n) / (float)n;
}


x86 assembly (clang, -O0):
<tml_sr_vMean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <tml_sr_vSum@plt>
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tml_sr_vMean>:
push   %rbx
mov    %esi,%ebx
call   1030 <tml_sr_vSum@plt>
cvtsi2ss %ebx,%xmm1
divss  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @tml_sr_vMean(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = call float @tml_sr_vSum(float* %5, i32 %6)
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fdiv float %7, %9
ret float %10
}

LLVM IR (-O2):
define float @tml_sr_vMean(float* %0, i32 %1) {
%3 = tail call float @tml_sr_vSum(float* %0, i32 %1)
%4 = sitofp i32 %1 to float
%5 = fdiv float %3, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ initSignals();
void tosThread_init() { initSignals(); }


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

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

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

LLVM IR (-O2):
define void @tosThread_init() {
%1 = tail call i32 (...) @initSignals()
ret void
}
int fun1067() { return 1067; }


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

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

LLVM IR (-O0):
define i32 @fun1067() {
ret i32 1067
}

LLVM IR (-O2):
define i32 @fun1067() {
ret i32 1067
}
/* Variables and functions */
int ceil(float);
int RoundUp(float x) { return (ceil(x)); }


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

x86 assembly (clang, -O2):
<RoundUp>:
jmp    1030 <ceil@plt>

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

LLVM IR (-O2):
define i32 @RoundUp(float %0) {
%2 = tail call i32 @ceil(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttRRTypeSelect(void) {
  ExtSelect(
      "tRRType",
      "tRRType.uRRType,tRRType.cLabel,tRRType.uParam1,tRRType.uParam2,tRRType."
      "cParam1Func,tRRType.cParam2Func,tRRType.cParam3Func,tRRType.cParam4Func,"
      "tRRType.cParam1Label,tRRType.cParam2Label,tRRType.cParam3Label,tRRType."
      "cParam4Label,tRRType.cParam1Tip,tRRType.cParam2Tip,tRRType.cParam3Tip,"
      "tRRType.cParam4Tip,tRRType.uParam3,tRRType.uParam4,tRRType.uName,"
      "tRRType.cNameFunc,tRRType.cNameLabel,tRRType.cNameTip,tRRType.uOwner,"
      "tRRType.uCreatedBy,tRRType.uCreatedDate,tRRType.uModBy,tRRType.uModDate",
      0);
}


x86 assembly (clang, -O0):
<ExttRRTypeSelect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %edx,%edx
call   1030 <ExtSelect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttRRTypeSelect>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"tRRType\00"
@.str.1 = [490 x i8] c"tRRType.uRRType,tRRType.cLabel,tRRType.uParam1,tRRType.uParam2,tRRType.cParam1Func,tRRType.cParam2Func,tRRType.cParam3Func,tRRType.cParam4Func,tRRType.cParam1Label,tRRType.cParam2Label,tRRType.cParam3Label,tRRType.cParam4Label,tRRType.cParam1Tip,tRRType.cParam2Tip,tRRType.cParam3Tip,tRRType.cParam4Tip,tRRType.uParam3,tRRType.uParam4,tRRType.uName,tRRType.cNameFunc,tRRType.cNameLabel,tRRType.cNameTip,tRRType.uOwner,tRRType.uCreatedBy,tRRType.uCreatedDate,tRRType.uModBy,tRRType.uModDate\00"
define void @ExttRRTypeSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([490 x i8], [490 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"tRRType\00"
@.str.1 = [490 x i8] c"tRRType.uRRType,tRRType.cLabel,tRRType.uParam1,tRRType.uParam2,tRRType.cParam1Func,tRRType.cParam2Func,tRRType.cParam3Func,tRRType.cParam4Func,tRRType.cParam1Label,tRRType.cParam2Label,tRRType.cParam3Label,tRRType.cParam4Label,tRRType.cParam1Tip,tRRType.cParam2Tip,tRRType.cParam3Tip,tRRType.cParam4Tip,tRRType.uParam3,tRRType.uParam4,tRRType.uName,tRRType.cNameFunc,tRRType.cNameLabel,tRRType.cNameTip,tRRType.uOwner,tRRType.uCreatedBy,tRRType.uCreatedDate,tRRType.uModBy,tRRType.uModDate\00"
define void @ExttRRTypeSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([490 x i8], [490 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
int __attribute__((no)) bar(int i, int j) { return (i + j) - (i & j); }


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

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

LLVM IR (-O0):
define i32 @bar(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = and i32 %8, %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
char *fnorm(char *str) {
  static char str2[100];
  char *str1;
  for (str1 = str2; *str; str++, str1++)
    if (*str == ',')
      *str1 = '.';
    else
      *str1 = *str;
  *str1 = *str;
  return (str2);
}


x86 assembly (clang, -O0):
<fnorm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0x2f21(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <fnorm+0x6a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    113c <fnorm+0x3c>
mov    -0x10(%rbp),%rax
movb   $0x2e,(%rax)
jmp    1148 <fnorm+0x48>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    114d <fnorm+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <fnorm+0x13>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
lea    0x2eb3(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnorm>:
xor    %ecx,%ecx
lea    0x2f27(%rip),%rax
jmp    1118 <fnorm+0x18>
nopl   0x0(%rax,%rax,1)
mov    %sil,(%rcx,%rax,1)
add    $0x1,%rcx
movzbl (%rdi,%rcx,1),%edx
mov    $0x2e,%sil
cmp    $0x2c,%dl
je     1110 <fnorm+0x10>
test   %dl,%dl
je     112c <fnorm+0x2c>
mov    %edx,%esi
jmp    1110 <fnorm+0x10>
movb   $0x0,(%rcx,%rax,1)
ret

LLVM IR (-O0):
@fnorm.str2 = internal global [100 x i8] zeroinitializer
define i8* @fnorm(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([100 x i8], [100 x i8]* @fnorm.str2, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 44
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %3
store i8 46, i8* %14
br label %19
15: ; preds = %8
%16 = load i8*, i8** %2
%17 = load i8, i8* %16
%18 = load i8*, i8** %3
store i8 %17, i8* %18
br label %19
19: ; preds = %15, %13
br label %20
20: ; preds = %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %4
25: ; preds = %4
%26 = load i8*, i8** %2
%27 = load i8, i8* %26
%28 = load i8*, i8** %3
store i8 %27, i8* %28
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @fnorm.str2, i64 0, i64 0)
}

LLVM IR (-O2):
@fnorm.str2 = internal global [100 x i8] zeroinitializer
define i8* @fnorm(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i8* [ getelementptr inbounds ([100 x i8], [100 x i8]* @fnorm.str2, i64 0, i64 0), %1 ], [ %10, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %11
i8 44, label %7
]
6: ; preds = %2
br label %7
7: ; preds = %2, %6
%8 = phi i8 [ %5, %6 ], [ 46, %2 ]
store i8 %8, i8* %4
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %4
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @fnorm.str2, i64 0, i64 0)
}
void rop3_55_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_55_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 -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%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_55_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
or     %dl,%cl
and    %sil,%cl
mov    %ecx,%eax
xor    %sil,%al
or     %dl,%cl
not    %cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_55_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %1
%8 = or i8 %6, %2
%9 = xor i8 %8, -1
%10 = xor i8 %1, -1
%11 = and i8 %10, %2
%12 = and i8 %11, %4
%13 = or i8 %12, %9
%14 = or i8 %13, %7
store i8 %14, i8* %0
ret void
}
char *hash_plugin_detailed(void) {
  return ("mscash - Domain cached credentials plugin\n"
          "------------------------\n"
          "Use this module to crack Domain cached credentials hashes\n"
          "Input should be in form: \'user:hash\''\n"
          "Known software that uses this password hashing method:\n"
          "Microsoft Windows\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [282 x i8] c"mscash - Domain cached credentials plugin\0A------------------------\0AUse this module to crack Domain cached credentials hashes\0AInput should be in form: 'user:hash''\0AKnown software that uses this password hashing method:\0AMicrosoft Windows\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [282 x i8] c"mscash - Domain cached credentials plugin\0A------------------------\0AUse this module to crack Domain cached credentials hashes\0AInput should be in form: 'user:hash''\0AKnown software that uses this password hashing method:\0AMicrosoft Windows\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo_s32(int, int);
int /*<<< orphan*/ foo_s64(int, int);
int main(void) {
  int a = 30;
  int b = 42;
  foo_s32(a, b);
  foo_s64(a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <foo_s32@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <foo_s64@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
mov    $0x2a,%esi
call   1040 <foo_s32@plt>
mov    $0x1e,%edi
mov    $0x2a,%esi
call   1030 <foo_s64@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 30, i32* %2
store i32 42, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @foo_s32(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @foo_s64(i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo_s32(i32 30, i32 42)
%2 = tail call i32 @foo_s64(i32 30, i32 42)
ret i32 0
}
int cast_uchar_int(unsigned char x) { return (int)x; }


x86 assembly (clang, -O0):
<cast_uchar_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cast_uchar_int(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @cast_uchar_int(i8 zeroext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void D2B(int dec, char *bin) {
  int end = 32 - 1;
  memset(bin, '0', 32);
  while (dec) {
    bin[end--] = dec & 1 ? '1' : '0';
    dec = (unsigned int)dec >> 1;
  }
}


x86 assembly (clang, -O0):
<D2B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1f,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x30,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
cmpl   $0x0,-0x4(%rbp)
je     117e <D2B+0x6e>
mov    -0x4(%rbp),%edx
and    $0x1,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <D2B+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<D2B>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    $0x30,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
test   %ebp,%ebp
je     1157 <D2B+0x47>
add    $0x1f,%rbx
mov    %ebp,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%ecx
and    $0x1,%cl
or     $0x30,%cl
mov    %cl,(%rbx)
shr    %eax
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%ebp
mov    %eax,%ebp
ja     1140 <D2B+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @D2B(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 31, i32* %5
%6 = load i8*, i8** %4
%7 = call i32 @memset(i8* %6, i32 48, i32 32)
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i32, i32* %3
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 49, i32 48
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8 %17, i8* %22
%23 = load i32, i32* %3
%24 = lshr i32 %23, 1
store i32 %24, i32* %3
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @D2B(i32 %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i32 48, i32 32)
%4 = icmp eq i32 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 31, %2 ]
%7 = phi i32 [ %13, %5 ], [ %0, %2 ]
%8 = trunc i32 %7 to i8
%9 = and i8 %8, 1
%10 = or i8 %9, 48
%11 = add nsw i64 %6, -1
%12 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %10, i8* %12
%13 = lshr i32 %7, 1
%14 = icmp ult i32 %7, 2
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}
void RTDbgAsSymbolByAddrA(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsSymbolByAddrA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test1() {
  static int f = 0;
  f++;
  printf("f = %d\n", f);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f09(%rip)
mov    0x2f03(%rip),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    0x2f16(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f0d(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@test1.f = internal global i32 0
@.str = [8 x i8] c"f = %d\0A\00"
define void @test1() {
%1 = load i32, i32* @test1.f
%2 = add nsw i32 %1, 1
store i32 %2, i32* @test1.f
%3 = load i32, i32* @test1.f
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@test1.f = internal unnamed_addr global i32 0
@.str = [8 x i8] c"f = %d\0A\00"
define void @test1() {
%1 = load i32, i32* @test1.f
%2 = add nsw i32 %1, 1
store i32 %2, i32* @test1.f
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int test_imm_C4int64_midword_reg(long long val) {
  return ((val >> 16) & (0xC4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C4int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xc4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4int64_midword_reg>:
test   $0xc40000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C4int64_midword_reg(i64 %0) {
%2 = and i64 %0, 12845056
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hash_free(void *p, void *arg) { free(p); }


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

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

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

LLVM IR (-O2):
define void @hash_free(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_it;
void X509_free(X509 *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_it); }


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

x86 assembly (clang, -O2):
<X509_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@X509_it = global i32 0
define void @X509_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @X509_it)
ret void
}

LLVM IR (-O2):
@X509_it = global i32 0
define void @X509_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_it)
ret void
}
main() {
  int a[5];
  a[5] = 3;
  a[5]++;
  int x;
  x = a[5];
  printf(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
movslq -0x24(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 5
store i32 3, i32* %3
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 5
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 5
%8 = load i32, i32* %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = call i32 (i8*, ...) @printf(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) poison)
ret i32 0
}
/* Variables and functions */
int printf(char *, int);
int main(void) {
  int x;
  x = 2.2f;
  return printf("%d\n", x);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 %1
}
/* Variables and functions */
int system(char const *);
extern int execcmd_to(const char *cmd) { return system(cmd); }


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

x86 assembly (clang, -O2):
<execcmd_to>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @execcmd_to(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *program) {
  printf(
      "USAGE: %s [options] [ethernet device]\n\n"
      "[options]\n"
      "   -l              Show the link status of the device\n"
      "   -a              Show the hardware address of the device\n"
      "   -q              Only show the relevant information\n"
      "   -h              Display this usage summary\n\n"
      "Ethlink is written and maintained by Greg Kurtzer <gmk@caosity.org>\n",
      program);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [332 x i8] c"USAGE: %s [options] [ethernet device]\0A\0A[options]\0A -l Show the link status of the device\0A -a Show the hardware address of the device\0A -q Only show the relevant information\0A -h Display this usage summary\0A\0AEthlink is written and maintained by Greg Kurtzer <gmk@caosity.org>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([332 x i8], [332 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [332 x i8] c"USAGE: %s [options] [ethernet device]\0A\0A[options]\0A -l Show the link status of the device\0A -a Show the hardware address of the device\0A -q Only show the relevant information\0A -h Display this usage summary\0A\0AEthlink is written and maintained by Greg Kurtzer <gmk@caosity.org>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([332 x i8], [332 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Eprintf(char *);
void PicBuf_to_Dummy() { Eprintf("Sorry - preview not supported here\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Sorry - preview not supported here\0A\00"
define void @PicBuf_to_Dummy() {
%1 = call i32 @Eprintf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Sorry - preview not supported here\0A\00"
define void @PicBuf_to_Dummy() {
%1 = tail call i32 @Eprintf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void revmoe_tap_interface(int fd) {
  if (fd > 0)
    close(fd);
}


x86 assembly (clang, -O0):
<revmoe_tap_interface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112d <revmoe_tap_interface+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revmoe_tap_interface>:
test   %edi,%edi
jle    1119 <revmoe_tap_interface+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @revmoe_tap_interface(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @revmoe_tap_interface(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
void CtpRoutingEngineP$0$Routing$routeFound(void) {
  CtpForwardingEngineP$0$UnicastNameFreeRouting$routeFound();
}


x86 assembly (clang, -O0):
<CtpRoutingEngineP$0$Routing$routeFound>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CtpForwardingEngineP$0$UnicastNameFreeRouting$routeFound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CtpRoutingEngineP$0$Routing$routeFound>:
xor    %eax,%eax
jmp    1030 <CtpForwardingEngineP$0$UnicastNameFreeRouting$routeFound@plt>

LLVM IR (-O0):
define void @"CtpRoutingEngineP$0$Routing$routeFound"() {
%1 = call i32 (...) @"CtpForwardingEngineP$0$UnicastNameFreeRouting$routeFound"()
ret void
}

LLVM IR (-O2):
define void @"CtpRoutingEngineP$0$Routing$routeFound"() {
%1 = tail call i32 (...) @"CtpForwardingEngineP$0$UnicastNameFreeRouting$routeFound"()
ret void
}
int get_atoi(const char **str) {
  int n;
  for (n = 0; (**str >= '0' && **str <= '9'); (*str)++)
    n = n * 10 + **str - '0';
  return n;
}


x86 assembly (clang, -O0):
<get_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     113a <get_atoi+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <get_atoi+0x4a>
jmp    1173 <get_atoi+0x73>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110f <get_atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_atoi>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113f <get_atoi+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
mov    %rcx,(%rdi)
movzbl (%rcx),%edx
lea    -0x30(%rdx),%esi
add    $0x1,%rcx
cmp    $0xa,%sil
jb     1120 <get_atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @get_atoi(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ Dfalse();
int /*<<< orphan*/ nest();
void Fdrop(void) {
  nest();
  Dfalse();
}


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

x86 assembly (clang, -O2):
<Fdrop>:
push   %rax
xor    %eax,%eax
call   1040 <nest@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Dfalse@plt>

LLVM IR (-O0):
define void @Fdrop() {
%1 = call i32 (...) @nest()
%2 = call i32 (...) @Dfalse()
ret void
}

LLVM IR (-O2):
define void @Fdrop() {
%1 = tail call i32 (...) @nest()
%2 = tail call i32 (...) @Dfalse()
ret void
}
/* Variables and functions */
int EOF;
int getch();
int is_strlit(void) {
  int c;
  while ((c = getch()) != EOF && c != '"')
    ;
  return c;
}


x86 assembly (clang, -O0):
<is_strlit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ebb(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1142 <is_strlit+0x32>
cmpl   $0x22,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1152 <is_strlit+0x42>
jmp    1157 <is_strlit+0x47>
jmp    1118 <is_strlit+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_strlit>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getch@plt>
cmp    $0x22,%eax
je     1130 <is_strlit+0x20>
cmp    (%rbx),%eax
jne    1120 <is_strlit+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @is_strlit() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 34
br label %9
9: ; preds = %6, %2
%10 = phi i1 [ false, %2 ], [ %8, %6 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @is_strlit() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getch()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = icmp ne i32 %2, 34
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 %2
}