xunge/DecIR huggingface dataset:
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i1 = 3, i2 = 5;
  printf("i1 + i2 = %i\n", i1 + i2);
  printf("add(i1, i2) = %i\n", add(i1, i2));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <add@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"i1 + i2 = %i\0A\00"
@.str.1 = [18 x i8] c"add(i1, i2) = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @add(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"i1 + i2 = %i\0A\00"
@.str.1 = [18 x i8] c"add(i1, i2) = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @add(i32 3, i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ strlen(char const *);
void inc_it(int *a, int *b, unsigned char *key) {
  b[0]++;
  b[1] += strlen((const char *)key) + 1;
}


x86 assembly (clang, -O0):
<inc_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdx
add    $0x1,%rdx
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rcx
add    %rdx,%rcx
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_it>:
push   %rbx
mov    %rdx,%rdi
mov    %rsi,%rbx
addl   $0x1,(%rsi)
call   1030 <strlen@plt>
mov    0x4(%rbx),%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @inc_it(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
%11 = load i8*, i8** %6
%12 = call i64 @strlen(i8* %11)
%13 = add nsw i64 %12, 1
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = add nsw i64 %17, %13
%19 = trunc i64 %18 to i32
store i32 %19, i32* %15
ret void
}

LLVM IR (-O2):
define void @inc_it(i32* nocapture readnone %0, i32* nocapture %1, i8* nocapture %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = trunc i64 %6 to i32
%10 = add i32 %9, 1
%11 = add i32 %10, %8
store i32 %11, i32* %7
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a;
  int b;
  int r;
  a = __VERIFIER_nondet_int();
  b = __VERIFIER_nondet_int();
  while (b > 0) {
    r = __VERIFIER_nondet_int();
    b = a - 1 - r;
    a = a - 1 - r;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1164 <main+0x54>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    113f <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
not    %eax
add    %eax,%ebx
test   %ebx,%ebx
jg     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = xor i32 %6, -1
%8 = add i32 %5, %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ vfs_access(char const *, int /*<<< orphan*/);
int vfs_exists(char const *path) { return vfs_access(path, F_OK) ? 0 : 1; }


x86 assembly (clang, -O0):
<vfs_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <vfs_access@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfs_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <vfs_access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @vfs_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @vfs_access(i8* %3, i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @vfs_exists(i8* %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @vfs_access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int osd_open(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @osd_open() {
ret i32 0
}
int compute_index(int x, int y, int z, int *subdomain) {
  int idx =
      z * (subdomain[0] + 2) * (subdomain[1] + 2) + y * (subdomain[0] + 2) + x;
  return idx;
}


x86 assembly (clang, -O0):
<compute_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    0x4(%rcx),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rdx
mov    (%rdx),%edx
add    $0x2,%edx
imul   %edx,%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_index>:
mov    (%rcx),%r8d
mov    0x4(%rcx),%eax
add    $0x2,%r8d
add    $0x2,%eax
imul   %edx,%eax
add    %esi,%eax
imul   %r8d,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @compute_index(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 2
%7 = getelementptr inbounds i32, i32* %3, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 2
%10 = mul i32 %9, %2
%11 = add i32 %10, %1
%12 = mul i32 %11, %6
%13 = add i32 %12, %0
ret i32 %13
}
/* Variables and functions */
char *date_get_now_date_hhmm(int);
char *date_get_current_hhmm(int utc_offset) {
  return date_get_now_date_hhmm(utc_offset);
}


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

x86 assembly (clang, -O2):
<date_get_current_hhmm>:
jmp    1030 <date_get_now_date_hhmm@plt>

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

LLVM IR (-O2):
define i8* @date_get_current_hhmm(i32 %0) {
%2 = tail call i8* @date_get_now_date_hhmm(i32 %0)
ret i8* %2
}
void ath5k_debug_dump_modes(struct ath5k_softc *sc,
                            struct ieee80211_hw_mode *modes) {}


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

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

LLVM IR (-O0):
%struct.ath5k_softc = type opaque
%struct.ieee80211_hw_mode = type opaque
define void @ath5k_debug_dump_modes(%struct.ath5k_softc* %0, %struct.ieee80211_hw_mode* %1) {
%3 = alloca %struct.ath5k_softc*
%4 = alloca %struct.ieee80211_hw_mode*
store %struct.ath5k_softc* %0, %struct.ath5k_softc** %3
store %struct.ieee80211_hw_mode* %1, %struct.ieee80211_hw_mode** %4
ret void
}

LLVM IR (-O2):
%struct.ath5k_softc = type opaque
%struct.ieee80211_hw_mode = type opaque
define void @ath5k_debug_dump_modes(%struct.ath5k_softc* nocapture %0, %struct.ieee80211_hw_mode* nocapture %1) {
ret void
}
void fa135(int n) {
  {
    int b[n];
    {
      int c[n];
      0;
    }
    {
      int d[n];
      0;
    };
    int e[n];
    0;
  };
a:
  goto a;
  {
    int f[n];
    {
      int g[n];
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa135>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
jmp    1154 <fa135+0x54>

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

LLVM IR (-O0):
define void @fa135(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %5
%26 = alloca i32, i64 %24
store i64 %24, i64* %6
%27 = load i8*, i8** %5
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
%30 = call i8* @llvm.stacksave()
store i8* %30, i8** %7
%31 = alloca i32, i64 %29
store i64 %29, i64* %8
%32 = load i8*, i8** %7
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
%35 = alloca i32, i64 %34
store i64 %34, i64* %9
%36 = load i8*, i8** %3
br label %37
37: ; preds = %37, %1
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
%41 = call i8* @llvm.stacksave()
store i8* %41, i8** %10
%42 = alloca i32, i64 %40
store i64 %40, i64* %11
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
%45 = call i8* @llvm.stacksave()
store i8* %45, i8** %12
%46 = alloca i32, i64 %44
store i64 %44, i64* %13
%47 = load i8*, i8** %12
%48 = load i32, i32* %2
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
store i8* %50, i8** %14
%51 = alloca i32, i64 %49
store i64 %49, i64* %15
%52 = load i8*, i8** %14
%53 = load i32, i32* %2
%54 = zext i32 %53 to i64
%55 = alloca i32, i64 %54
store i64 %54, i64* %16
%56 = load i8*, i8** %10
%57 = load i32, i32* %2
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %17
%60 = alloca i32, i64 %58
store i64 %58, i64* %18
%61 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa135(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void rtc_sysfs_init(struct class *rtc) {}


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

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

LLVM IR (-O0):
%struct.class = type opaque
define void @rtc_sysfs_init(%struct.class* %0) {
%2 = alloca %struct.class*
store %struct.class* %0, %struct.class** %2
ret void
}

LLVM IR (-O2):
%struct.class = type opaque
define void @rtc_sysfs_init(%struct.class* nocapture %0) {
ret void
}
int main(int argc, char **argv) {
  int x;
  float r = argc;
  if (0 != r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x18(%rbp),%xmm0
jne    1134 <main+0x34>
jp     1134 <main+0x34>
jmp    1140 <main+0x40>
movl   $0x7,-0x14(%rbp)
jmp    1147 <main+0x47>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x2a,%ecx
mov    $0x7,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
store float %9, float* %7
%10 = load float, float* %7
%11 = fcmp une float 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 42, i32 7
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fprint_opcode(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void print_opcode(uint8_t *IR) { fprint_opcode(stdout, IR); }


x86 assembly (clang, -O0):
<print_opcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprint_opcode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_opcode>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprint_opcode@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_opcode(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stdout
%4 = load i32*, i32** %2
%5 = call i32 @fprint_opcode(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_opcode(i32* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprint_opcode(i32 %2, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_channel_destroy() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_channel_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_channel_destroy>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_destroy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_destroy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void INT_Excep_PERIB_INTB203(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB203() {
ret void
}
int isBigEndian() {
  int endianTest = 1;
  if (*((char *)&endianTest) == 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<isBigEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1124 <isBigEndian+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112b <isBigEndian+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isBigEndian() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @isBigEndian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void result_begin(void) { printf("    \"results\": [\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c" \22results\22: [\00"
define void @result_begin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
void DebugMon_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<DebugMon_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <DebugMon_Handler+0x9>
jmp    1109 <DebugMon_Handler+0x9>

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

LLVM IR (-O0):
define void @DebugMon_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @DebugMon_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int statfs(const char *path, struct statfs *buf) {
  StubBug("STUB:"
          "statfs");
  return -1;
}


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

x86 assembly (clang, -O2):
<statfs>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <StubBug@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [12 x i8] c"STUB:statfs\00"
define i32 @statfs(i8* %0, %struct.statfs* %1) {
%3 = alloca i8*
%4 = alloca %struct.statfs*
store i8* %0, i8** %3
store %struct.statfs* %1, %struct.statfs** %4
%5 = call i32 @StubBug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [12 x i8] c"STUB:statfs\00"
define i32 @statfs(i8* nocapture readnone %0, %struct.statfs* nocapture readnone %1) {
%3 = tail call i32 @StubBug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int floatlit_comp(const void *a, const void *b) {
  if (*(double *)a > *(double *)b)
    return 1;
  if (*(double *)a == *(double *)b)
    return 0;
  if (*(double *)a < *(double *)b)
    return -1;
}


x86 assembly (clang, -O0):
<floatlit_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <floatlit_comp+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1177 <floatlit_comp+0x77>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1156 <floatlit_comp+0x56>
jp     1156 <floatlit_comp+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1177 <floatlit_comp+0x77>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1177 <floatlit_comp+0x77>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatlit_comp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     111d <floatlit_comp+0x1d>
xor    %eax,%eax
ucomisd %xmm1,%xmm0
jne    111e <floatlit_comp+0x1e>
jp     111e <floatlit_comp+0x1e>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @floatlit_comp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ogt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %32
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp oeq double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %32
23: ; preds = %14
%24 = load i8*, i8** %4
%25 = bitcast i8* %24 to double*
%26 = load double, double* %25
%27 = load i8*, i8** %5
%28 = bitcast i8* %27 to double*
%29 = load double, double* %28
%30 = fcmp olt double %26, %29
br i1 %30, label %31, label %32
31: ; preds = %23
store i32 -1, i32* %3
br label %32
32: ; preds = %13, %22, %31, %23
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @floatlit_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = fcmp oeq double %4, %6
br i1 %9, label %11, label %10
10: ; preds = %8
br label %11
11: ; preds = %10, %8, %2
%12 = phi i32 [ 1, %2 ], [ 0, %8 ], [ -1, %10 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testC(int a, float b, float c) { printf("testC int\n"); }


x86 assembly (clang, -O0):
<testC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"testC int\0A\00"
define void @testC(i32 %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
store float %2, float* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"testC int\00"
define void @testC(i32 %0, float %1, float %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void rop3_76_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_76_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_76_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itemdb_read();
void itemdb_reload(void) { itemdb_read(); }


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

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

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

LLVM IR (-O2):
define void @itemdb_reload() {
%1 = tail call i32 (...) @itemdb_read()
ret void
}
int ast_cli_register_multiple(struct ast_cli_entry *e, int len) { return 0; }


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

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

LLVM IR (-O0):
%struct.ast_cli_entry = type opaque
define i32 @ast_cli_register_multiple(%struct.ast_cli_entry* %0, i32 %1) {
%3 = alloca %struct.ast_cli_entry*
%4 = alloca i32
store %struct.ast_cli_entry* %0, %struct.ast_cli_entry** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.ast_cli_entry = type opaque
define i32 @ast_cli_register_multiple(%struct.ast_cli_entry* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _ps_error(char const *message, int ret) {
  fputs("ps"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_ps_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ps_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ps: \00"
@stderr = global i32 0
define i32 @_ps_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"ps: \00"
@stderr = global i32 0
define i32 @_ps_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
unsigned char getCommand(unsigned short message) { return message & 0x3F; }


x86 assembly (clang, -O0):
<getCommand>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x3f,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCommand>:
mov    %edi,%eax
and    $0x3f,%al
ret

LLVM IR (-O0):
define zeroext i8 @getCommand(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 63
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @getCommand(i16 zeroext %0) {
%2 = trunc i16 %0 to i8
%3 = and i8 %2, 63
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print(const char *argv) { printf("Usage: %s [IP] [PORT] \n", argv); }


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: %s [IP] [PORT] \0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int Operand_simm4_decode(unsigned int *valp) {
  unsigned simm4_0, mn_0;
  mn_0 = *valp & 0xf;
  simm4_0 = ((int)mn_0 << 28) >> 28;
  *valp = simm4_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_simm4_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1c,%eax
sar    $0x1c,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_simm4_decode>:
mov    (%rdi),%eax
shl    $0x1c,%eax
sar    $0x1c,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_simm4_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 28
%10 = ashr i32 %9, 28
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_simm4_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 28
%4 = ashr exact i32 %3, 28
store i32 %4, i32* %0
ret i32 0
}
extern char *esa_device_str(int id) {
  switch (id) {
  case 0x002:
    return "ESA_LEON2";
  case 0x00f:
    return "ESA_MCTRL";
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<esa_device_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2,%eax
je     112c <esa_device_str+0x2c>
jmp    111b <esa_device_str+0x1b>
mov    -0x10(%rbp),%eax
sub    $0xf,%eax
je     113c <esa_device_str+0x3c>
jmp    114c <esa_device_str+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <esa_device_str+0x59>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <esa_device_str+0x59>
jmp    1151 <esa_device_str+0x51>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<esa_device_str>:
xor    %ecx,%ecx
cmp    $0xf,%edi
lea    0xefe(%rip),%rax
cmove  %rax,%rcx
cmp    $0x2,%edi
lea    0xee6(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"ESA_LEON2\00"
@.str.1 = [10 x i8] c"ESA_MCTRL\00"
define i8* @esa_device_str(i32 %0) {
%2 = icmp eq i32 %0, 15
%3 = select i1 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *reverseWords(int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char *);
int main() {
  printf("%s\n", reverseWords(strdup("I am a boy")));
  printf("%s\n", reverseWords(strdup("I  am a  boy")));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec9(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1040 <reverseWords@plt>
mov    %rax,%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1040 <reverseWords@plt>
mov    %rax,%rsi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xecc(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1040 <reverseWords@plt>
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1040 <reverseWords@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"I am a boy\00"
@.str.2 = [13 x i8] c"I am a boy\00"
define i32 @main() {
%1 = call i32 @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i8* @reverseWords(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = call i8* @reverseWords(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"I am a boy\00"
@.str.2 = [13 x i8] c"I am a boy\00"
define i32 @main() {
%1 = tail call i32 @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i8* @reverseWords(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i8* @reverseWords(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
void ft_striter(char *s, void (*f)(char *)) {
  if (s && f && *s) {
    (*f)(s);
    ft_striter(s + 1, f);
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1161 <ft_striter+0x51>
cmpq   $0x0,-0x10(%rbp)
je     1161 <ft_striter+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <ft_striter+0x51>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_striter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
cmpb   $0x0,(%rbx)
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne void (i8*)* %1, null
%4 = icmp ne i8* %0, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
tail call void %1(i8* %10)
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
int RC_COMM_BUFFER_SIZE() { return (1 << 13) * (2 * 48); }


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

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

LLVM IR (-O0):
define i32 @RC_COMM_BUFFER_SIZE() {
ret i32 786432
}

LLVM IR (-O2):
define i32 @RC_COMM_BUFFER_SIZE() {
ret i32 786432
}
/* Variables and functions */
char *getenv(char *);
scalar_t__ strcmp(char *, char *);
int use_xmgr() {
  char *env;
  int bXMGR;
  env = getenv("GMX_VIEW_XVG");
  return (env != NULL && strcmp(env, "xmgr") == 0);
}


x86 assembly (clang, -O0):
<use_xmgr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1162 <use_xmgr+0x42>
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_xmgr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     114e <use_xmgr+0x2e>
lea    0xed4(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"GMX_VIEW_XVG\00"
@.str.1 = [5 x i8] c"xmgr\00"
define i32 @use_xmgr() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"GMX_VIEW_XVG\00"
@.str.1 = [5 x i8] c"xmgr\00"
define i32 @use_xmgr() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ clean_exit_with_status(int /*<<< orphan*/);
int /*<<< orphan*/ mced_log(int /*<<< orphan*/, char *, int);
void clean_exit(int sig) {
  mced_log(LOG_NOTICE, "caught signal %d\n", sig);
  clean_exit_with_status(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<clean_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <mced_log@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <clean_exit_with_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_exit>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <mced_log@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <clean_exit_with_status@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [18 x i8] c"caught signal %d\0A\00"
@EXIT_SUCCESS = global i32 0
define void @clean_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_NOTICE
%4 = load i32, i32* %2
%5 = call i32 @mced_log(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @clean_exit_with_status(i32 %6)
ret void
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [18 x i8] c"caught signal %d\0A\00"
@EXIT_SUCCESS = global i32 0
define void @clean_exit(i32 %0) {
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @mced_log(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @clean_exit_with_status(i32 %4)
ret void
}
void resetDoNothingEffect(short ledNumber, short *data) { return; }


x86 assembly (clang, -O0):
<resetDoNothingEffect>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @resetDoNothingEffect(i16 signext %0, i16* %1) {
%3 = alloca i16
%4 = alloca i16*
store i16 %0, i16* %3
store i16* %1, i16** %4
ret void
}

LLVM IR (-O2):
define void @resetDoNothingEffect(i16 signext %0, i16* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adelanteTiempo(int, double, int /*<<< orphan*/);
int /*<<< orphan*/ orugaEscupe(int);
void autoAdelante(int lado) {
  adelanteTiempo(127, 1.5, 0);
  orugaEscupe(127);
}


x86 assembly (clang, -O0):
<autoAdelante>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7f,%edi
movsd  0xec8(%rip),%xmm0
xor    %esi,%esi
call   1030 <adelanteTiempo@plt>
mov    $0x7f,%edi
call   1040 <orugaEscupe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autoAdelante>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x7f,%edi
xor    %esi,%esi
call   1030 <adelanteTiempo@plt>
mov    $0x7f,%edi
pop    %rax
jmp    1040 <orugaEscupe@plt>

LLVM IR (-O0):
define void @autoAdelante(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @adelanteTiempo(i32 127, double 1.500000e+00, i32 0)
%4 = call i32 @orugaEscupe(i32 127)
ret void
}

LLVM IR (-O2):
define void @autoAdelante(i32 %0) {
%2 = tail call i32 @adelanteTiempo(i32 127, double 1.500000e+00, i32 0)
%3 = tail call i32 @orugaEscupe(i32 127)
ret void
}
void hmd_swap() {}


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

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

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

LLVM IR (-O2):
define void @hmd_swap() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int isReg(const uint16_t a) { return (a & 0177770) == 0170000; }


x86 assembly (clang, -O0):
<isReg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfff8,%eax
cmp    $0xf000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isReg>:
and    $0xfff8,%edi
xor    %eax,%eax
cmp    $0xf000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isReg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65528
%5 = icmp eq i32 %4, 61440
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isReg(i32 %0) {
%2 = and i32 %0, 65528
%3 = icmp eq i32 %2, 61440
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
uint64_t read64le(const uint64_t *p) { return *p; }


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

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

LLVM IR (-O0):
define i32 @read64le(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 @read64le(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}