xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int getInt(void *, int);
unsigned int getTCP_mode(void *pkg) {
  unsigned int ret = getInt(pkg, sizeof(int));
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @getTCP_mode(i8* %0) {
%2 = tail call i32 @getInt(i8* %0, i32 4)
ret i32 %2
}
char *slash(str)
register char *str;
{
  register char *result = str;
  while (*str)
    if (*str++ == '/')
      result = str;
  return result;
}


x86 assembly (clang, -O0):
<slash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <slash+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <slash+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <slash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slash>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <slash+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <slash+0x10>
ret

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

LLVM IR (-O2):
define i8* @slash(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
unsigned __VERIFIER_nondet_unsigned() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_unsigned() {
ret i32 0
}
/* Variables and functions */
scalar_t__ lookup_frec(unsigned short);
unsigned short rand16();
unsigned short get_id(void) {
  unsigned short ret = 0;
  while (ret == 0) {
    ret = rand16();
    if ((ret != 0) && lookup_frec(ret))
      ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1171 <get_id+0x51>
mov    $0x0,%al
call   1030 <rand16@plt>
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     116c <get_id+0x4c>
movzwl -0x2(%rbp),%edi
call   1040 <lookup_frec@plt>
cmp    $0x0,%rax
je     116c <get_id+0x4c>
movw   $0x0,-0x2(%rbp)
jmp    112e <get_id+0xe>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_id>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand16@plt>
test   %ax,%ax
je     1130 <get_id+0x10>
mov    %eax,%ebx
movzwl %ax,%edi
call   1040 <lookup_frec@plt>
test   %rax,%rax
jne    1130 <get_id+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @get_id() {
%1 = alloca i16
store i16 0, i16* %1
br label %2
2: ; preds = %16, %0
%3 = load i16, i16* %1
%4 = zext i16 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = call zeroext i16 (...) @rand16()
store i16 %7, i16* %1
%8 = load i16, i16* %1
%9 = zext i16 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i16, i16* %1
%13 = call i64 @lookup_frec(i16 zeroext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i16 0, i16* %1
br label %16
16: ; preds = %15, %11, %6
br label %2
17: ; preds = %2
%18 = load i16, i16* %1
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @get_id() {
br label %1
1: ; preds = %7, %0
%2 = tail call zeroext i16 (...) @rand16()
%3 = icmp eq i16 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @lookup_frec(i16 zeroext %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %1
8: ; preds = %4
ret i16 %2
}
/* Type definitions */
typedef int ushort;

/* Variables and functions */
unsigned char msg_send(int, unsigned char *, int);
unsigned char ANT_SetSearchWaveform(unsigned char chan, ushort waveform) {
  unsigned char buf[3];
  buf[0] = chan;
  buf[1] = waveform % 256;
  buf[2] = waveform / 256;
  return msg_send(0x49, buf, 3);
}


x86 assembly (clang, -O0):
<ANT_SetSearchWaveform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,-0x9(%rbp)
lea    -0xb(%rbp),%rsi
mov    $0x49,%edi
mov    $0x3,%edx
call   1030 <msg_send@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANT_SetSearchWaveform>:
push   %rax
mov    %dil,0x5(%rsp)
mov    %sil,0x6(%rsp)
lea    0xff(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %ah,0x7(%rsp)
lea    0x5(%rsp),%rsi
mov    $0x49,%edi
mov    $0x3,%edx
call   1030 <msg_send@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @ANT_SetSearchWaveform(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca [3 x i8]
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i8, i8* %3
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i32, i32* %4
%9 = srem i32 %8, 256
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 256
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 %14, i8* %15
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%17 = call zeroext i8 @msg_send(i32 73, i8* %16, i32 3)
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @ANT_SetSearchWaveform(i8 zeroext %0, i32 %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %4
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %5, i8* %6
%7 = sdiv i32 %1, 256
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 %8, i8* %9
%10 = call zeroext i8 @msg_send(i32 73, i8* %4, i32 3)
ret i8 %10
}
/* Variables and functions */
void *zrealloc(void *, size_t);
void *sds_realloc(void *ptr, size_t size) { return zrealloc(ptr, size); }


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

x86 assembly (clang, -O2):
<sds_realloc>:
jmp    1030 <zrealloc@plt>

LLVM IR (-O0):
define i8* @sds_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @zrealloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @sds_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @zrealloc(i8* %0, i64 %1)
ret i8* %3
}
int pwc_reg_write(unsigned char addr, unsigned char data) { return 0; }


x86 assembly (clang, -O0):
<pwc_reg_write>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pwc_reg_write(i8 zeroext %0, i8 zeroext %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ load_kernel(void *);
int /*<<< orphan*/ uart_puts(char *);
int main(void) {
  do {
    uart_puts("[D] ");
    uart_puts("Now running in C\n");
  } while (0);
  load_kernel((void *)0x04000000);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <uart_puts@plt>
lea    0xec3(%rip),%rdi
call   1040 <uart_puts@plt>
mov    $0x4000000,%edi
call   1030 <load_kernel@plt>
jmp    1151 <main+0x31>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <uart_puts@plt>
lea    0xed1(%rip),%rdi
call   1040 <uart_puts@plt>
mov    $0x4000000,%edi
call   1030 <load_kernel@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1150 <main+0x30>

LLVM IR (-O0):
@.str = [5 x i8] c"[D] \00"
@.str.1 = [18 x i8] c"Now running in C\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @uart_puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %2
%6 = call i32 @load_kernel(i8* inttoptr (i64 67108864 to i8*))
br label %7
7: ; preds = %5, %7
br label %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"[D] \00"
@.str.1 = [18 x i8] c"Now running in C\0A\00"
define i32 @main() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @load_kernel(i8* inttoptr (i64 67108864 to i8*))
br label %4
4: ; preds = %0, %4
br label %4
}
void foo701(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo701(i32 %0) {
ret void
}
int value_int(int *value) { return *value; }


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

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

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

LLVM IR (-O2):
define i32 @value_int(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ read_merc_db();
int /*<<< orphan*/ read_merc_skilldb();
void merc_reload(void) {
  read_merc_db();
  read_merc_skilldb();
}


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

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

LLVM IR (-O0):
define void @merc_reload() {
%1 = call i32 (...) @read_merc_db()
%2 = call i32 (...) @read_merc_skilldb()
ret void
}

LLVM IR (-O2):
define void @merc_reload() {
%1 = tail call i32 (...) @read_merc_db()
%2 = tail call i32 (...) @read_merc_skilldb()
ret void
}
/* Variables and functions */
int UINT_MAX;
unsigned MVector_maxSize(void) { return UINT_MAX; }


x86 assembly (clang, -O0):
<MVector_maxSize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MVector_maxSize>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @MVector_maxSize() {
%1 = load i32, i32* @UINT_MAX
ret i32 %1
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @MVector_maxSize() {
%1 = load i32, i32* @UINT_MAX
ret i32 %1
}
double ta_spechum2tvirtual(double tk, double spechum) {
  double tkv;
  tkv = (1.0 + 0.61 * spechum) * tkv;
  return (tkv);
}


x86 assembly (clang, -O0):
<ta_spechum2tvirtual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ta_spechum2tvirtual(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call double @llvm.fmuladd.f64(double 6.100000e-01, double %6, double 1.000000e+00)
%8 = load double, double* %5
%9 = fmul double %7, %8
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @ta_spechum2tvirtual(double %0, double %1) {
ret double 0x7FF8000000000000
}
/* Variables and functions */
int /*<<< orphan*/ lrint(int);
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void frame_delay() { usleep(lrint(60 / 1000000.0)); }


x86 assembly (clang, -O0):
<frame_delay>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <lrint@plt>
mov    %eax,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<frame_delay>:
push   %rax
xor    %edi,%edi
call   1030 <lrint@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @frame_delay() {
%1 = call i32 @lrint(i32 0)
%2 = call i32 @usleep(i32 %1)
ret void
}

LLVM IR (-O2):
define void @frame_delay() {
%1 = tail call i32 @lrint(i32 0)
%2 = tail call i32 @usleep(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int, int,
                           int);
int getpgid(int /*<<< orphan*/);
int getpid();
int getsid(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void debug_process_state(const char *hint) {
  fprintf(stderr, "%s: id: %d, session leader: %d, process group leader: %d\n",
          hint, getpid(), getsid(0), getpgid(0));
}


x86 assembly (clang, -O0):
<debug_process_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x10(%rbp)
xor    %edi,%edi
call   1040 <getsid@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1060 <getpgid@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    %eax,%r9d
lea    0xe6d(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_process_state>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%r15d
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <getsid@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1060 <getpgid@plt>
lea    0xe8c(%rip),%rsi
mov    %r15d,%edi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"%s: id: %d, session leader: %d, process group leader: %d\0A\00"
define void @debug_process_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (...) @getpid()
%6 = call i32 @getsid(i32 0)
%7 = call i32 @getpgid(i32 0)
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"%s: id: %d, session leader: %d, process group leader: %d\0A\00"
define void @debug_process_state(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @getsid(i32 0)
%5 = tail call i32 @getpgid(i32 0)
%6 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i32 %4, i32 %5)
ret void
}
__attribute__((always_)) unsigned char inb(int port) {
  unsigned char value;
  asm volatile("in"
               "b"
               " %w1, %"
               "b"
               "0"
               : "=a"(value)
               : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ baz();
int /*<<< orphan*/ foo(int);
int __attribute__((annotate("realtime"))) main() {
  int barbar;
  foo(barbar);
  baz();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpeoap6zzz/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (i32 ()* @main to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 18, i8* null }], section "llvm.metadata"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = call i32 @foo(i32 %3)
%5 = call i32 (...) @baz()
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpeoap6zzz/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (i32 ()* @main to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 18, i8* null }], section "llvm.metadata"
define i32 @main() {
%1 = tail call i32 @foo(i32 undef)
%2 = tail call i32 (...) @baz()
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int governor_lve_enter_pid(pid_t u1) {
  printf("%d, governor_lve_enter_pid\n", u1);
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"%d, governor_lve_enter_pid\0A\00"
define i32 @governor_lve_enter_pid(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
void keyboard_pcjr_reset() {}


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

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

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

LLVM IR (-O2):
define void @keyboard_pcjr_reset() {
ret void
}
/* Variables and functions */
int Pnl_GetPlatform();
void Pnl_SavePanelState(void) {
  int Platform;
  Platform = Pnl_GetPlatform();
}


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

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

LLVM IR (-O0):
define void @Pnl_SavePanelState() {
%1 = alloca i32
%2 = call i32 (...) @Pnl_GetPlatform()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @Pnl_SavePanelState() {
%1 = tail call i32 (...) @Pnl_GetPlatform()
ret void
}
void free_fiblist_matrix(m, nrl, nrh, ncl, nch) struct fiblist ***m;
long nch, ncl, nrh, nrl;
{
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_fiblist_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_fiblist_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.fiblist = type opaque
define void @free_fiblist_matrix(%struct.fiblist*** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca %struct.fiblist***
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store %struct.fiblist*** %0, %struct.fiblist**** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load %struct.fiblist***, %struct.fiblist**** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds %struct.fiblist**, %struct.fiblist*** %11, i64 %12
%14 = load %struct.fiblist**, %struct.fiblist*** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds %struct.fiblist*, %struct.fiblist** %14, i64 %15
%17 = getelementptr inbounds %struct.fiblist*, %struct.fiblist** %16, i64 -1
%18 = bitcast %struct.fiblist** %17 to i8*
%19 = load %struct.fiblist***, %struct.fiblist**** %6
%20 = load i64, i64* %7
%21 = getelementptr inbounds %struct.fiblist**, %struct.fiblist*** %19, i64 %20
%22 = getelementptr inbounds %struct.fiblist**, %struct.fiblist*** %21, i64 -1
%23 = bitcast %struct.fiblist*** %22 to i8*
ret void
}

LLVM IR (-O2):
%struct.fiblist = type opaque
define void @free_fiblist_matrix(%struct.fiblist*** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds %struct.fiblist**, %struct.fiblist*** %0, i64 %1
%7 = load %struct.fiblist**, %struct.fiblist*** %6
%8 = getelementptr inbounds %struct.fiblist*, %struct.fiblist** %7, i64 %3
%9 = getelementptr inbounds %struct.fiblist*, %struct.fiblist** %8, i64 -1
%10 = bitcast %struct.fiblist** %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds %struct.fiblist**, %struct.fiblist*** %6, i64 -1
%12 = bitcast %struct.fiblist*** %11 to i8*
tail call void @free(i8* %12)
ret void
}
int test_imm_30uint8_mem(unsigned char *val) {
  return ((*val) & (0x30 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_30uint8_mem>:
testb  $0x30,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_30uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 48
%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_30uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 48
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void V(int *s) { *s = 0; }


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

x86 assembly (clang, -O2):
<V>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @V(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
int convert(char *str) {
  __asm__ __volatile__("subl $1,%%ebx;"
                       "REPEAT:addl $1,%%ebx;"
                       "movl 0(%%ebx),%%edx;"
                       "movzbl  %%dl,%%ecx;"
                       "testl %%ecx,%%ecx;"
                       "je END;"
                       "cmpl $97,%%ecx;"
                       "jb REPEAT;"
                       "cmpl $122,%%ecx; "
                       "ja REPEAT;"
                       "subl $32,(%%ebx);"
                       "jmp REPEAT;"
                       "END:;"
                       :
                       : "b"(str)
                       : "ecx", "edx");
  printf("d = %s\n", str);
  return 1;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
sub    $0x1,%ebx

x86 assembly (clang, -O2):
<convert>:
push   %rbx
mov    %rdi,%rbx
sub    $0x1,%ebx

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

LLVM IR (-O2):
@.str = [8 x i8] c"d = %s\0A\00"
define i32 @convert(i8* %0) {
tail call void asm sideeffect "subl $$1,%ebx;REPEAT:addl $$1,%ebx;movl 0(%ebx),%edx;movzbl %dl,%ecx;testl %ecx,%ecx;je END;cmpl $$97,%ecx;jb REPEAT;cmpl $$122,%ecx; ja REPEAT;subl $$32,(%ebx);jmp REPEAT;END:;", "{bx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(FILE *stream, long offset, int origin) {
  int rc;
  return rc;
}


x86 assembly (clang, -O0):
<fseek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fseek(i32* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 undef
}
void psi_set_uint32_be(void *buf, unsigned idx, unsigned long val) {
  unsigned char *tmp;
  tmp = (unsigned char *)buf + idx;
  tmp[0] = (val >> 24) & 0xff;
  tmp[1] = (val >> 16) & 0xff;
  tmp[2] = (val >> 8) & 0xff;
  tmp[3] = val & 0xff;
}


x86 assembly (clang, -O0):
<psi_set_uint32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_set_uint32_be>:
mov    %esi,%eax
bswap  %edx
mov    %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @psi_set_uint32_be(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8* %11, i8** %7
%12 = load i64, i64* %6
%13 = lshr i64 %12, 24
%14 = and i64 %13, 255
%15 = trunc i64 %14 to i8
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
%18 = load i64, i64* %6
%19 = lshr i64 %18, 16
%20 = and i64 %19, 255
%21 = trunc i64 %20 to i8
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
%24 = load i64, i64* %6
%25 = lshr i64 %24, 8
%26 = and i64 %25, 255
%27 = trunc i64 %26 to i8
%28 = load i8*, i8** %7
%29 = getelementptr inbounds i8, i8* %28, i64 2
store i8 %27, i8* %29
%30 = load i64, i64* %6
%31 = and i64 %30, 255
%32 = trunc i64 %31 to i8
%33 = load i8*, i8** %7
%34 = getelementptr inbounds i8, i8* %33, i64 3
store i8 %32, i8* %34
ret void
}

LLVM IR (-O2):
define void @psi_set_uint32_be(i8* nocapture writeonly %0, i32 %1, i64 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = lshr i64 %2, 24
%7 = trunc i64 %6 to i8
store i8 %7, i8* %5
%8 = lshr i64 %2, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %2, 8
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds i8, i8* %5, i64 2
store i8 %12, i8* %13
%14 = trunc i64 %2 to i8
%15 = getelementptr inbounds i8, i8* %5, i64 3
store i8 %14, i8* %15
ret void
}
int cmd_3000(int fd[]) { return fd[0]; }


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

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

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

LLVM IR (-O2):
define i32 @cmd_3000(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ BUG();
void __flush_tlb_one(unsigned long addr) { BUG(); }


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

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

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

LLVM IR (-O2):
define void @__flush_tlb_one(i64 %0) {
%2 = tail call i32 (...) @BUG()
ret void
}
char to_upper(const char c) { return c - 32; }


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @to_upper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @to_upper(i8 signext %0) {
%2 = add i8 %0, -32
ret i8 %2
}
/* Variables and functions */
double fabs(double);
int cs_tol(int i, int j, double aij, void *tol) {
  return (fabs(aij) > *((double *)tol));
}


x86 assembly (clang, -O0):
<cs_tol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_tol>:
andpd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @cs_tol(i32 %0, i32 %1, double %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store i8* %3, i8** %8
%9 = load double, double* %7
%10 = call double @llvm.fabs.f64(double %9)
%11 = load i8*, i8** %8
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
%14 = fcmp ogt double %10, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @cs_tol(i32 %0, i32 %1, double %2, i8* nocapture %3) {
%5 = tail call double @llvm.fabs.f64(double %2)
%6 = bitcast i8* %3 to double*
%7 = load double, double* %6
%8 = fcmp ogt double %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
void joystick_standard_close(void *p) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_setzero_si128();
int /*<<< orphan*/ _mm_subs_epu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i _mm_cmple_epu16(__m128i x, __m128i y) {
  return _mm_cmpeq_epi16(_mm_subs_epu16(x, y), _mm_setzero_si128());
}


x86 assembly (clang, -O0):
<_mm_cmple_epu16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_subs_epu16@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_cmpeq_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_cmple_epu16>:
push   %rbx
call   1040 <_mm_subs_epu16@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <_mm_cmpeq_epi16@plt>

LLVM IR (-O0):
define i32 @_mm_cmple_epu16(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 = call i32 @_mm_subs_epu16(i32 %5, i32 %6)
%8 = call i32 (...) @_mm_setzero_si128()
%9 = call i32 @_mm_cmpeq_epi16(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_mm_cmple_epu16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_epu16(i32 %0, i32 %1)
%4 = tail call i32 (...) @_mm_setzero_si128()
%5 = tail call i32 @_mm_cmpeq_epi16(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int rc_setvar(char *, int, char **);
int cmd_set(int argc, char **argv) {
  if (argc < 3)
    return -1;
  return rc_setvar(argv[1], argc - 2, argv + 2);
}


x86 assembly (clang, -O0):
<cmd_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1135 <cmd_set+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cmd_set+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
mov    -0x10(%rbp),%rdx
add    $0x10,%rdx
call   1030 <rc_setvar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_set>:
cmp    $0x3,%edi
jge    111b <cmd_set+0xb>
mov    $0xffffffff,%eax
ret
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x8(%rdx),%rdi
add    $0xfffffffe,%esi
add    $0x10,%rdx
jmp    1030 <rc_setvar@plt>

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

LLVM IR (-O2):
define i32 @cmd_set(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = add nsw i32 %0, -2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = tail call i32 @rc_setvar(i8* %6, i32 %7, i8** %8)
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ -1, %2 ]
ret i32 %11
}
signed int set_bit(unsigned int current_byte, int position) {
  unsigned int mask = (1 << position);
  return (mask | current_byte);
}


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

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

LLVM IR (-O0):
define i32 @set_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = or i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ error;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
void file_error(const char *filename, const char *action) {
  char error[256];
  snprintf(error, sizeof(error), "Error while %s file \"%s\"", action,
           filename);
  perror(error);
  exit(1);
}


x86 assembly (clang, -O0):
<file_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x100,%esi
lea    0xea2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<file_error>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rcx
mov    %rdi,%r8
lea    0xebb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Error while %s file \22%s\22\00"
define void @file_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @perror(i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Error while %s file \22%s\22\00"
define void @file_error(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%6 = call i32 @perror(i8* %4)
%7 = call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
int unlink(char const *);
int t_unlink(const char *path) {
  int rc;
  rc = unlink(path);
  if (rc) {
    printf("unlink(%s) error: %s\n", path, strerror(errno));
    return (-1);
  }
  return rc;
}


x86 assembly (clang, -O0):
<t_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1187 <t_unlink+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <t_unlink+0x5d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_unlink>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
test   %eax,%eax
je     1164 <t_unlink+0x34>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"unlink(%s) error: %s\0A\00"
@errno = global i32 0
define i32 @t_unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @unlink(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
store i32 -1, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [22 x i8] c"unlink(%s) error: %s\0A\00"
@errno = global i32 0
define i32 @t_unlink(i8* %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
unsigned long gf2_matrix_times(unsigned long *, unsigned long);
void gf2_matrix_square(unsigned long *square, unsigned long *mat) {
  int n;
  for (n = 0; n < 32; n++)
    square[n] = gf2_matrix_times(mat, mat[n]);
}


x86 assembly (clang, -O0):
<gf2_matrix_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1163 <gf2_matrix_square+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <gf2_matrix_times@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <gf2_matrix_square+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf2_matrix_square>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r15,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <gf2_matrix_times@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1120 <gf2_matrix_square+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @gf2_matrix_square(i64* nocapture writeonly %0, i64* %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load i64, i64* %5
%7 = tail call i64 @gf2_matrix_times(i64* %1, i64 %6)
%8 = getelementptr inbounds i64, i64* %0, i64 %4
store i64 %7, i64* %8
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 32
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
char *monte_ovar_name(char *param, long pos) {
  switch (pos) {
  case 0:
    return ("out1");
    break;
  case 1:
    return ("out2");
    break;
  default:
    return ("empty");
  }
  return ("empty");
}


x86 assembly (clang, -O0):
<monte_ovar_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
test   %rax,%rax
je     1135 <monte_ovar_name+0x35>
jmp    1122 <monte_ovar_name+0x22>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
je     1145 <monte_ovar_name+0x45>
jmp    1155 <monte_ovar_name+0x55>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <monte_ovar_name+0x60>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <monte_ovar_name+0x60>
lea    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<monte_ovar_name>:
cmp    $0x1,%rsi
lea    0xefa(%rip),%rax
lea    0xef8(%rip),%rcx
cmove  %rax,%rcx
test   %rsi,%rsi
lea    0xee0(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"out1\00"
@.str.1 = [5 x i8] c"out2\00"
@.str.2 = [6 x i8] c"empty\00"
define i8* @monte_ovar_name(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
switch i64 %6, label %9 [
i64 0, label %7
i64 1, label %8
]
7: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
br label %10
8: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %10
9: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %10
10: ; preds = %9, %8, %7
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"out1\00"
@.str.1 = [5 x i8] c"out2\00"
@.str.2 = [6 x i8] c"empty\00"
define i8* @monte_ovar_name(i8* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, 1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%5 = icmp eq i64 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %6
}