xunge/DecIR huggingface dataset:
int is_prime(int a) {
  int c;
  for (c = 2; c <= a - 1; c++) {
    if (a % c == 0)
      return 0;
  }
  if (c == a)
    return 1;
  return 404;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     114e <is_prime+0x4e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113b <is_prime+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_prime+0x6d>
jmp    1140 <is_prime+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1166 <is_prime+0x66>
movl   $0x1,-0x4(%rbp)
jmp    116d <is_prime+0x6d>
movl   $0x194,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%eax
cmp    $0x3,%edi
jl     1122 <is_prime+0x22>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1132 <is_prime+0x32>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <is_prime+0x10>
mov    %edi,%eax
cmp    %edi,%eax
mov    $0x1,%ecx
mov    $0x194,%eax
cmove  %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %1
%11 = phi i32 [ 2, %1 ], [ %0, %7 ]
%12 = icmp eq i32 %11, %0
%13 = select i1 %12, i32 1, i32 404
br label %14
14: ; preds = %3, %10
%15 = phi i32 [ %13, %10 ], [ 0, %3 ]
ret i32 %15
}
void packsplit(int *index, int *firstpart, int *rest, int bitno_firstpart,
               int bitno_total) {
  int bitno_rest = bitno_total - bitno_firstpart;
  *firstpart = *index >> (bitno_rest);
  *rest = *index - (*firstpart << (bitno_rest));
}


x86 assembly (clang, -O0):
<packsplit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x24(%rbp),%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x24(%rbp),%ecx
shl    %cl,%eax
mov    -0x28(%rbp),%ecx
sub    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<packsplit>:
sub    %ecx,%r8d
mov    (%rdi),%eax
mov    %r8d,%ecx
sar    %cl,%eax
mov    %eax,(%rsi)
shl    %cl,%eax
mov    (%rdi),%ecx
sub    %eax,%ecx
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @packsplit(i32* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %10
%13 = load i32, i32* %9
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %11
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = load i32, i32* %11
%18 = ashr i32 %16, %17
%19 = load i32*, i32** %7
store i32 %18, i32* %19
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = load i32*, i32** %7
%23 = load i32, i32* %22
%24 = load i32, i32* %11
%25 = shl i32 %23, %24
%26 = sub nsw i32 %21, %25
%27 = load i32*, i32** %8
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @packsplit(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %4, %3
%7 = load i32, i32* %0
%8 = ashr i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %0
%10 = shl i32 %8, %6
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %2
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double sinPLUScos(double x) {
  double s = sin(x), c = cos(x);
  return (s + c);
}


x86 assembly (clang, -O0):
<sinPLUScos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinPLUScos>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sinPLUScos(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @sin(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = call double @cos(double %7)
store double %8, double* %4
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @sinPLUScos(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = fadd double %2, %3
ret double %4
}
int omap_get_gpt_irq(int n) { return 37 + (n); }


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

x86 assembly (clang, -O2):
<omap_get_gpt_irq>:
lea    0x25(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @omap_get_gpt_irq(i32 %0) {
%2 = add nsw i32 %0, 37
ret i32 %2
}
/* Type definitions */
struct sysinfo {
  int freeram;
  scalar_t__ bufferram;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
size_t c_getMemAvail() {
  struct sysinfo si;
  sysinfo(&si);
  si.freeram += si.bufferram;
  return si.freeram >> 10;
}


x86 assembly (clang, -O0):
<c_getMemAvail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <sysinfo@plt>
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0xa,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_getMemAvail>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <sysinfo@plt>
mov    0x8(%rsp),%eax
add    0x10(%rsp),%eax
sar    $0xa,%eax
cltq
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sysinfo = type { i32, i64 }
define i64 @c_getMemAvail() {
%1 = alloca %struct.sysinfo
%2 = call i32 @sysinfo(%struct.sysinfo* %1)
%3 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %4
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%11 = load i32, i32* %10
%12 = ashr i32 %11, 10
%13 = sext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
%struct.sysinfo = type { i32, i64 }
define i64 @c_getMemAvail() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = trunc i64 %5 to i32
%9 = add i32 %7, %8
%10 = ashr i32 %9, 10
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void hrv_light_reset(void) {
  mbus_remote_register_write(0x3, 0x01, ((0 << 5) | (0 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<hrv_light_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x9,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hrv_light_reset>:
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x9,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @hrv_light_reset() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
define void @hrv_light_reset() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 1, i32 9)
ret void
}
void android_joypad_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @android_joypad_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
void __assert(const char *msg, const char *file, int line) {
  printf("Assertion failed: %s at %s, line %d\n", msg, file, line);
}


x86 assembly (clang, -O0):
<__assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__assert>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Assertion failed: %s at %s, line %d\0A\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Assertion failed: %s at %s, line %d\0A\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int mf_movi_unit_init();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("[mf_movidius_arduino_units] starting...\n");
  int ret = mf_movi_unit_init();
  if (ret != 1) {
    printf("[mf_movidius_arduino_units] units init failed.\n");
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <mf_movi_unit_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1167 <main+0x47>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <main+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <mf_movi_unit_init@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1151 <main+0x31>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"[mf_movidius_arduino_units] starting...\0A\00"
@.str.1 = [48 x i8] c"[mf_movidius_arduino_units] units init failed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @mf_movi_unit_init()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %10
9: ; preds = %0
store i32 1, i32* %1
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@str = [40 x i8] c"[mf_movidius_arduino_units] starting...\00"
@str.2 = [47 x i8] c"[mf_movidius_arduino_units] units init failed.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @mf_movi_unit_init()
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.2, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ -1, %4 ], [ 1, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ minprintf(char *, char *, int, double);
int main() {
  minprintf("name=%s, age=%d, salary=%f\n", "lan", 28, 12000.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    0xef7(%rip),%rsi
mov    $0x1c,%edx
movsd  0xec6(%rip),%xmm0
call   1030 <minprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0xf05(%rip),%rsi
movsd  0xed9(%rip),%xmm0
mov    $0x1c,%edx
call   1030 <minprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"name=%s, age=%d, salary=%f\0A\00"
@.str.1 = [4 x i8] c"lan\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @minprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 28, double 1.200000e+04)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"name=%s, age=%d, salary=%f\0A\00"
@.str.1 = [4 x i8] c"lan\00"
define i32 @main() {
%1 = tail call i32 @minprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 28, double 1.200000e+04)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *_name) {
  fprintf(stderr,
          "Usage: %s [options] -- [protocol options]\n"
          "  -l<port>        : Listen TCP port number\n"
          "  -s<unix-socket> : Listen Unix socket file\n"
          "  -P<protocol>    : Protocols (basic, textline, http, smtp, irc)\n"
          "  -h              : Show this help message\n",
          _name);
  return 0;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [238 x i8] c"Usage: %s [options] -- [protocol options]\0A -l<port> : Listen TCP port number\0A -s<unix-socket> : Listen Unix socket file\0A -P<protocol> : Protocols (basic, textline, http, smtp, irc)\0A -h : Show this help message\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [238 x i8] c"Usage: %s [options] -- [protocol options]\0A -l<port> : Listen TCP port number\0A -s<unix-socket> : Listen Unix socket file\0A -P<protocol> : Protocols (basic, textline, http, smtp, irc)\0A -h : Show this help message\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int ctox(char *);
int atox(char *p) {
  int a = ctox(p);
  a <<= 4;
  a |= ctox(p + 1);
  return a & 0xff;
}


x86 assembly (clang, -O0):
<atox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ctox@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <ctox@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atox>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <ctox@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <ctox@plt>
or     %ebp,%eax
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @atox(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ctox(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 4
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i32 @ctox(i8* %9)
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = and i32 %13, 255
ret i32 %14
}

LLVM IR (-O2):
define i32 @atox(i8* %0) {
%2 = tail call i32 @ctox(i8* %0)
%3 = shl i32 %2, 4
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call i32 @ctox(i8* %4)
%6 = or i32 %3, %5
%7 = and i32 %6, 255
ret i32 %7
}
int kvmppc_get_cap_large_decr(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @kvmppc_get_cap_large_decr() {
ret i32 0
}

LLVM IR (-O2):
define i32 @kvmppc_get_cap_large_decr() {
ret i32 0
}
/* Type definitions */
union bpf_attr {
  scalar_t__ key;
  int /*<<< orphan*/ map_fd;
};
typedef scalar_t__ __u64;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void bpf_attr_setup_map_elem_for_delete(union bpf_attr *attr, __u32 map_fd,
                                        void *pointer_to_key) {
  attr->map_fd = map_fd;
  attr->key = (__u64)(unsigned long)pointer_to_key;
}


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

x86 assembly (clang, -O2):
<bpf_attr_setup_map_elem_for_delete>:
mov    %rdx,(%rdi)
ret

LLVM IR (-O0):
%union.bpf_attr = type { i64 }
define void @bpf_attr_setup_map_elem_for_delete(%union.bpf_attr* %0, i32 %1, i8* %2) {
%4 = alloca %union.bpf_attr*
%5 = alloca i32
%6 = alloca i8*
store %union.bpf_attr* %0, %union.bpf_attr** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load %union.bpf_attr*, %union.bpf_attr** %4
%9 = bitcast %union.bpf_attr* %8 to i32*
store i32 %7, i32* %9
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = load %union.bpf_attr*, %union.bpf_attr** %4
%13 = bitcast %union.bpf_attr* %12 to i64*
store i64 %11, i64* %13
ret void
}

LLVM IR (-O2):
%union.bpf_attr = type { i64 }
define void @bpf_attr_setup_map_elem_for_delete(%union.bpf_attr* nocapture writeonly %0, i32 %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = getelementptr %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0
store i64 %4, i64* %5
ret void
}
/* Variables and functions */
unsigned char inb(unsigned short);
void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress) {
  unsigned char b_EepromBusy = 0;
  do {
    b_EepromBusy = inb(w_PCIBoardEepromAddress + 0x3F);
    b_EepromBusy = b_EepromBusy & 0x80;
  } while (b_EepromBusy == 0x80);
}


x86 assembly (clang, -O0):
<v_EepromWaitBusy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3f,%eax
movzwl %ax,%edi
call   1030 <inb@plt>
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
and    $0x80,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x80,%eax
je     1123 <v_EepromWaitBusy+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_EepromWaitBusy>:
push   %rbx
add    $0x3f,%edi
movzwl %di,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <inb@plt>
test   %al,%al
js     1120 <v_EepromWaitBusy+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @v_EepromWaitBusy(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
store i8 0, i8* %3
br label %4
4: ; preds = %14, %1
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 63
%8 = trunc i32 %7 to i16
%9 = call zeroext i8 @inb(i16 zeroext %8)
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %11, 128
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
br label %14
14: ; preds = %4
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 128
br i1 %17, label %4, label %18
18: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @v_EepromWaitBusy(i16 zeroext %0) {
%2 = add i16 %0, 63
br label %3
3: ; preds = %3, %1
%4 = tail call zeroext i8 @inb(i16 zeroext %2)
%5 = icmp slt i8 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RETURN_IF_FALSE(int /*<<< orphan*/);
int /*<<< orphan*/ assert_exit(char *);
int /*<<< orphan*/ config_token_verbose_p();
int /*<<< orphan*/ log_print(char *, char *);
void tk_lang_c_cnst_print(char *buf) {
  assert_exit(buf);
  RETURN_IF_FALSE(config_token_verbose_p());
  log_print("[TK] try constant on '%s'\n", buf);
}


x86 assembly (clang, -O0):
<tk_lang_c_cnst_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert_exit@plt>
mov    $0x0,%al
call   1060 <config_token_verbose_p@plt>
mov    %eax,%edi
call   1040 <RETURN_IF_FALSE@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <log_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tk_lang_c_cnst_print>:
push   %rbx
mov    %rdi,%rbx
call   1050 <assert_exit@plt>
xor    %eax,%eax
call   1060 <config_token_verbose_p@plt>
mov    %eax,%edi
call   1040 <RETURN_IF_FALSE@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <log_print@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"[TK] try constant on '%s'\0A\00"
define void @tk_lang_c_cnst_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert_exit(i8* %3)
%5 = call i32 (...) @config_token_verbose_p()
%6 = call i32 @RETURN_IF_FALSE(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @log_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"[TK] try constant on '%s'\0A\00"
define void @tk_lang_c_cnst_print(i8* %0) {
%2 = tail call i32 @assert_exit(i8* %0)
%3 = tail call i32 (...) @config_token_verbose_p()
%4 = tail call i32 @RETURN_IF_FALSE(i32 %3)
%5 = tail call i32 @log_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_alloc_strategy() { printf("UNKNOWN\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"UNKNOWN\00"
define void @print_alloc_strategy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_pga_function_list();
void pga_init() { register_pga_function_list(); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_tree_drag_source_drag_data_get() {
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int tcgetattr(int, struct termios *);
int main() {
  printf("hello eyu\n");
  struct termios info;
  int result = tcgetattr(1, &info);
  printf("%d\n", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    $0x1,%edi
call   1050 <tcgetattr@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.termios = type { i32 }
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [10 x i8] c"hello eyu\00"
define i32 @main() {
%1 = alloca %struct.termios
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = bitcast %struct.termios* %1 to i8*
%4 = call i32 @tcgetattr(i32 1, %struct.termios* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void(__attribute__((trapa_handler)) isr)() { foo(); }


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

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

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

LLVM IR (-O2):
define void @isr() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Type definitions */
struct memory {
  int dummy;
};

/* Variables and functions */
unsigned char memory_get_interrupt_flag(struct memory *);
int /*<<< orphan*/ memory_set_d8(struct memory *, unsigned short,
                                 unsigned char);
void memory_set_interrupt_flag(struct memory *mem, unsigned char mask) {
  unsigned char iflag = memory_get_interrupt_flag(mem);
  memory_set_d8(mem, ((unsigned short)0xFF0F), iflag | ((unsigned char)0x01));
}


x86 assembly (clang, -O0):
<memory_set_interrupt_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <memory_get_interrupt_flag@plt>
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xa(%rbp),%eax
or     $0x1,%eax
mov    $0xff0f,%esi
movzbl %al,%edx
call   1040 <memory_set_d8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_set_interrupt_flag>:
push   %rbx
mov    %rdi,%rbx
call   1030 <memory_get_interrupt_flag@plt>
or     $0x1,%al
movzbl %al,%edx
mov    %rbx,%rdi
mov    $0xff0f,%esi
pop    %rbx
jmp    1040 <memory_set_d8@plt>

LLVM IR (-O0):
%struct.memory = type { i32 }
define void @memory_set_interrupt_flag(%struct.memory* %0, i8 zeroext %1) {
%3 = alloca %struct.memory*
%4 = alloca i8
%5 = alloca i8
store %struct.memory* %0, %struct.memory** %3
store i8 %1, i8* %4
%6 = load %struct.memory*, %struct.memory** %3
%7 = call zeroext i8 @memory_get_interrupt_flag(%struct.memory* %6)
store i8 %7, i8* %5
%8 = load %struct.memory*, %struct.memory** %3
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = or i32 %10, 1
%12 = trunc i32 %11 to i8
%13 = call i32 @memory_set_d8(%struct.memory* %8, i16 zeroext -241, i8 zeroext %12)
ret void
}

LLVM IR (-O2):
%struct.memory = type { i32 }
define void @memory_set_interrupt_flag(%struct.memory* %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @memory_get_interrupt_flag(%struct.memory* %0)
%4 = or i8 %3, 1
%5 = tail call i32 @memory_set_d8(%struct.memory* %0, i16 zeroext -241, i8 zeroext %4)
ret void
}
/* Variables and functions */
double pow(double, double);
double mtof(double pitch) {
  return pow((1.0594630943592953), pitch + (36.37631656229583));
}


x86 assembly (clang, -O0):
<mtof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xece(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtof>:
movapd %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @mtof(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x4042302B2420007A
%5 = call double @pow(double 0x3FF0F38F92D97963, double %4)
ret double %5
}

LLVM IR (-O2):
define double @mtof(double %0) {
%2 = fadd double %0, 0x4042302B2420007A
%3 = tail call double @pow(double 0x3FF0F38F92D97963, double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *translateDate(char *);
int /*<<< orphan*/ write(char *, char *, char *);
void function_est_date_end(char *est_end) {
  char *new = translateDate(est_end);
  write("msproject.xml", "\t<Finish>%s</Finish>\n", new);
  free(new);
}


x86 assembly (clang, -O0):
<function_est_date_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <translateDate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <write@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_est_date_end>:
push   %rbx
call   1050 <translateDate@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [22 x i8] c"\09<Finish>%s</Finish>\0A\00"
define void @function_est_date_end(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @translateDate(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [22 x i8] c"\09<Finish>%s</Finish>\0A\00"
define void @function_est_date_end(i8* %0) {
%2 = tail call i8* @translateDate(i8* %0)
%3 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int getchar();
int ec_getch_raw(int unit) { return getchar(); }


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

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

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

LLVM IR (-O2):
define i32 @ec_getch_raw(i32 %0) {
%2 = tail call i32 (...) @getchar()
ret i32 %2
}
unsigned int in_framecount(void *p_user) { return 360; }


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

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

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

LLVM IR (-O2):
define i32 @in_framecount(i8* nocapture readnone %0) {
ret i32 360
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
__attribute__((always_)) uint16_t __LDREXH(volatile uint16_t *addr) {
  uint16_t result;
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @__LDREXH(i32* nocapture readnone %0) {
ret i32 undef
}
unsigned char mkhex(unsigned char ch) {
  ch &= 15;
  if (ch > 9)
    return ch + 'a' - 10;
  return ch + '0';
}


x86 assembly (clang, -O0):
<mkhex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jle    1133 <mkhex+0x33>
movzbl -0x2(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    113d <mkhex+0x3d>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkhex>:
and    $0xf,%dil
lea    0x57(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0xa,%dil
movzbl %al,%edx
movzbl %cl,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @mkhex(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sgt i32 %9, 9
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 97
%15 = sub nsw i32 %14, 10
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %22
17: ; preds = %1
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = add nsw i32 %19, 48
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %22
22: ; preds = %17, %11
%23 = load i8, i8* %2
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @mkhex(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp ugt i8 %2, 9
%4 = add nuw nsw i8 %2, 87
%5 = or i8 %2, 48
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
void RTTestFailureDetailsV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestFailureDetailsV() {
ret void
}
/* Type definitions */
struct dict_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dict_node *);
void dict_node_free(struct dict_node *node) {
  if (node != NULL)
    free(node);
}


x86 assembly (clang, -O0):
<dict_node_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <dict_node_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_node_free>:
test   %rdi,%rdi
je     111a <dict_node_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.dict_node = type { i32 }
define void @dict_node_free(%struct.dict_node* %0) {
%2 = alloca %struct.dict_node*
store %struct.dict_node* %0, %struct.dict_node** %2
%3 = load %struct.dict_node*, %struct.dict_node** %2
%4 = icmp ne %struct.dict_node* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.dict_node*, %struct.dict_node** %2
%7 = call i32 @free(%struct.dict_node* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.dict_node = type { i32 }
define void @dict_node_free(%struct.dict_node* %0) {
%2 = icmp eq %struct.dict_node* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.dict_node* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LookIP(char *, char **, char **);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stress(int);
main() {
  char *area, *location;
  LookIP("166.111.8.238", &area, &location);
  printf("166.111.8.238 is in %s at %s\n", area, location);
  stress(300000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <LookIP@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x493e0,%edi
call   1040 <stress@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <LookIP@plt>
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x493e0,%edi
call   1040 <stress@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"166.111.8.238\00"
@.str.1 = [30 x i8] c"166.111.8.238 is in %s at %s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i32 @LookIP(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %2)
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %5)
%7 = call i32 @stress(i32 300000)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"166.111.8.238\00"
@.str.1 = [30 x i8] c"166.111.8.238 is in %s at %s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
%4 = bitcast i8** %2 to i8*
%5 = call i32 @LookIP(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %2)
%6 = load i8*, i8** %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @stress(i32 300000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ test_rbtree();
int main(int argc, const char *argv[]) {
  int status = test_rbtree() ? 0 : 1;
  printf("RBTree test: %s\n", (status ? "failed" : "passed"));
  return status;
}


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   1030 <test_rbtree@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
lea    0xebd(%rip),%rsi
lea    0xeaf(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <test_rbtree@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xeda(%rip),%rax
lea    0xeda(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"RBTree test: %s\0A\00"
@.str.1 = [7 x i8] c"failed\00"
@.str.2 = [7 x i8] c"passed\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 (...) @test_rbtree()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"RBTree test: %s\0A\00"
@.str.1 = [7 x i8] c"failed\00"
@.str.2 = [7 x i8] c"passed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @test_rbtree()
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %5
}
int test_imm_85uint16_mem(unsigned short *val) {
  return ((*val) & (-0x85 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_85uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff7b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_85uint16_mem>:
movzwl (%rdi),%eax
test   $0xff7b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_85uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -133
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void jsoo_new() { exit(1); }


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

x86 assembly (clang, -O2):
<jsoo_new>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @jsoo_new() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @jsoo_new() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int scratchenv(const char *string) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @scratchenv(i8* nocapture readnone %0) {
ret i32 -1
}
int argcv_free(int argc, char **argv) {
  while (--argc >= 0)
    if (argv[argc])
      free(argv[argc]);
  free(argv);
  return 1;
}


x86 assembly (clang, -O0):
<argcv_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jl     115a <argcv_free+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <argcv_free+0x45>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <argcv_free+0xf>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argcv_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
jle    114d <argcv_free+0x3d>
mov    %edi,%ebx
add    $0x1,%rbx
jmp    113a <argcv_free+0x2a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
jbe    114d <argcv_free+0x3d>
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
test   %rdi,%rdi
je     1130 <argcv_free+0x20>
call   1030 <free@plt>
jmp    1130 <argcv_free+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @argcv_free(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %14
%7 = phi i64 [ %5, %4 ], [ %8, %14 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %6
tail call void @free(i8* %11)
br label %14
14: ; preds = %13, %6
%15 = icmp ugt i64 %7, 1
br i1 %15, label %6, label %16
16: ; preds = %14, %2
%17 = bitcast i8** %1 to i8*
tail call void @free(i8* %17)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int main(int argc, char *argv[]) {
  func(0xdeadbeef);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xdeadbeef,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @func(i32 -559038737)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @func(i32 -559038737)
ret i32 0
}