xunge/DecIR huggingface dataset:
/* Variables and functions */
int delaunay_reduce(double **, double **, double const);
int del_delaunay_reduce(double min_lattice[3][3], double lattice[3][3],
                        const double symprec) {
  ;
  return delaunay_reduce(min_lattice, lattice, symprec);
}


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

x86 assembly (clang, -O2):
<del_delaunay_reduce>:
jmp    1030 <delaunay_reduce@plt>

LLVM IR (-O0):
define i32 @del_delaunay_reduce([3 x double]* %0, [3 x double]* %1, double %2) {
%4 = alloca [3 x double]*
%5 = alloca [3 x double]*
%6 = alloca double
store [3 x double]* %0, [3 x double]** %4
store [3 x double]* %1, [3 x double]** %5
store double %2, double* %6
%7 = load [3 x double]*, [3 x double]** %4
%8 = bitcast [3 x double]* %7 to double**
%9 = load [3 x double]*, [3 x double]** %5
%10 = bitcast [3 x double]* %9 to double**
%11 = load double, double* %6
%12 = call i32 @delaunay_reduce(double** %8, double** %10, double %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @del_delaunay_reduce([3 x double]* %0, [3 x double]* %1, double %2) {
%4 = bitcast [3 x double]* %0 to double**
%5 = bitcast [3 x double]* %1 to double**
%6 = tail call i32 @delaunay_reduce(double** %4, double** %5, double %2)
ret i32 %6
}
void handle_GRANT(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_GRANT(i32 %0) {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strptrcmp(const void *ap, const void *bp) {
  const char *a = *(const char **)ap;
  const char *b = *(const char **)bp;
  return strcmp(a, b);
}


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

x86 assembly (clang, -O2):
<strptrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strptrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @strptrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int format;
};
typedef TYPE_1__ XTextProperty;

/* Variables and functions */
void set_XTextProperty_format(void *_p, int _v) {
  ((XTextProperty *)_p)->format = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XTextProperty_format(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XTextProperty_format(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int main() {
  goto end;
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main(int argc, char **argv) {
  char data[256];
  __builtin_prefetch(&data[0], 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rax
prefetchnta (%rax)
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
prefetchnta -0x80(%rsp)
xor    %eax,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
ret i32 0
}
/* Variables and functions */
int erfasse_ganze_zahl(char *, int, int);
int /*<<< orphan*/ schreibe_menue(int, int, char **);
int waehle_aus_menue(int menuelaenge, int textlaenge,
                     char menue[menuelaenge][textlaenge]) {
  schreibe_menue(menuelaenge, textlaenge, menue);
  char *zeichenkette = "\n\nIhre Wahl:  ";
  return erfasse_ganze_zahl(zeichenkette, 1, menuelaenge);
}


x86 assembly (clang, -O0):
<waehle_aus_menue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <schreibe_menue@plt>
lea    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
call   1040 <erfasse_ganze_zahl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waehle_aus_menue>:
push   %rbx
mov    %edi,%ebx
call   1030 <schreibe_menue@plt>
lea    0xed1(%rip),%rdi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <erfasse_ganze_zahl@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0A\0AIhre Wahl: \00"
define i32 @waehle_aus_menue(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = bitcast i8* %14 to i8**
%16 = call i32 @schreibe_menue(i32 %12, i32 %13, i8** %15)
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %7
%17 = load i8*, i8** %7
%18 = load i32, i32* %4
%19 = call i32 @erfasse_ganze_zahl(i8* %17, i32 1, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0A\0AIhre Wahl: \00"
define i32 @waehle_aus_menue(i32 %0, i32 %1, i8* %2) {
%4 = bitcast i8* %2 to i8**
%5 = tail call i32 @schreibe_menue(i32 %0, i32 %1, i8** %4)
%6 = tail call i32 @erfasse_ganze_zahl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1, i32 %0)
ret i32 %6
}
/* Variables and functions */
int tiaoxin_reference_decrypt(unsigned char *, unsigned long long *,
                              unsigned char *, unsigned char const *,
                              unsigned long long, unsigned char const *,
                              unsigned long long, unsigned char const *,
                              unsigned char const *);
int crypto_aead_decrypt(unsigned char *m, unsigned long long *mlen,
                        unsigned char *nsec, const unsigned char *c,
                        unsigned long long clen, const unsigned char *ad,
                        unsigned long long adlen, const unsigned char *npub,
                        const unsigned char *k) {
  return tiaoxin_reference_decrypt(m, mlen, nsec, c, clen, ad, adlen, npub, k);
}


x86 assembly (clang, -O0):
<crypto_aead_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <tiaoxin_reference_decrypt@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_aead_decrypt>:
jmp    1030 <tiaoxin_reference_decrypt@plt>

LLVM IR (-O0):
define i32 @crypto_aead_decrypt(i8* %0, i64* %1, i8* %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i64*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i8*
store i8* %0, i8** %10
store i64* %1, i64** %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i64 %4, i64* %14
store i8* %5, i8** %15
store i64 %6, i64* %16
store i8* %7, i8** %17
store i8* %8, i8** %18
%19 = load i8*, i8** %10
%20 = load i64*, i64** %11
%21 = load i8*, i8** %12
%22 = load i8*, i8** %13
%23 = load i64, i64* %14
%24 = load i8*, i8** %15
%25 = load i64, i64* %16
%26 = load i8*, i8** %17
%27 = load i8*, i8** %18
%28 = call i32 @tiaoxin_reference_decrypt(i8* %19, i64* %20, i8* %21, i8* %22, i64 %23, i8* %24, i64 %25, i8* %26, i8* %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @crypto_aead_decrypt(i8* %0, i64* %1, i8* %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8) {
%10 = tail call i32 @tiaoxin_reference_decrypt(i8* %0, i64* %1, i8* %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8)
ret i32 %10
}
int json_utf8_seq_length(unsigned char start_byte) {
  if ((start_byte & 0x80) == 0x00) {
    return 1;
  } else if ((start_byte & 0xe0) == 0xc0) {
    return 2;
  } else if ((start_byte & 0xf0) == 0xe0) {
    return 3;
  } else if ((start_byte & 0xf8) == 0xf0) {
    return 4;
  } else {
    return (-2);
  }
}


x86 assembly (clang, -O0):
<json_utf8_seq_length>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1128 <json_utf8_seq_length+0x28>
movl   $0x1,-0x4(%rbp)
jmp    118f <json_utf8_seq_length+0x8f>
movzbl -0x5(%rbp),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    1148 <json_utf8_seq_length+0x48>
movl   $0x2,-0x4(%rbp)
jmp    118f <json_utf8_seq_length+0x8f>
movzbl -0x5(%rbp),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    1168 <json_utf8_seq_length+0x68>
movl   $0x3,-0x4(%rbp)
jmp    118f <json_utf8_seq_length+0x8f>
movzbl -0x5(%rbp),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    1188 <json_utf8_seq_length+0x88>
movl   $0x4,-0x4(%rbp)
jmp    118f <json_utf8_seq_length+0x8f>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_utf8_seq_length>:
mov    $0x1,%eax
test   $0x80,%dil
je     1145 <json_utf8_seq_length+0x45>
mov    %edi,%ecx
and    $0xffffffe0,%ecx
mov    $0x2,%eax
cmp    $0xc0,%ecx
je     1145 <json_utf8_seq_length+0x45>
mov    %edi,%ecx
and    $0xfffffff0,%ecx
mov    $0x3,%eax
cmp    $0xe0,%ecx
je     1145 <json_utf8_seq_length+0x45>
and    $0xfffffff8,%edi
cmp    $0xf0,%edi
mov    $0x4,%ecx
mov    $0xfffffffe,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @json_utf8_seq_length(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %28
9: ; preds = %1
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %11, 224
%13 = icmp eq i32 %12, 192
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 2, i32* %2
br label %28
15: ; preds = %9
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = and i32 %17, 240
%19 = icmp eq i32 %18, 224
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 3, i32* %2
br label %28
21: ; preds = %15
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = and i32 %23, 248
%25 = icmp eq i32 %24, 240
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 4, i32* %2
br label %28
27: ; preds = %21
store i32 -2, i32* %2
br label %28
28: ; preds = %27, %26, %20, %14, %8
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @json_utf8_seq_length(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = and i32 %2, 224
%7 = icmp eq i32 %6, 192
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = and i32 %2, 240
%10 = icmp eq i32 %9, 224
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = and i32 %2, 248
%13 = icmp eq i32 %12, 240
%14 = select i1 %13, i32 4, i32 -2
br label %15
15: ; preds = %11, %8, %5, %1
%16 = phi i32 [ 1, %1 ], [ 2, %5 ], [ 3, %8 ], [ %14, %11 ]
ret i32 %16
}
void dijkstra() {}


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

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

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

LLVM IR (-O2):
define void @dijkstra() {
ret void
}
/* Variables and functions */
int labs(long);
long randm(int);
long expr_wpn_add_hit(long lev) { return (randm(labs(lev) / 20 + 1)); }


x86 assembly (clang, -O0):
<expr_wpn_add_hit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x1,%edi
call   1040 <randm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr_wpn_add_hit>:
push   %rax
call   1030 <labs@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x23,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%edi
add    $0x1,%edi
pop    %rax
jmp    1040 <randm@plt>

LLVM IR (-O0):
define i64 @expr_wpn_add_hit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @labs(i64 %3)
%5 = sdiv i32 %4, 20
%6 = add nsw i32 %5, 1
%7 = call i64 @randm(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @expr_wpn_add_hit(i64 %0) {
%2 = tail call i32 @labs(i64 %0)
%3 = sdiv i32 %2, 20
%4 = add nsw i32 %3, 1
%5 = tail call i64 @randm(i32 %4)
ret i64 %5
}
int input_map_c2(char c) {
  if (c == 'b')
    return 1;
  else if (c == 'c')
    return 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<input_map_c2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    1123 <input_map_c2+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1143 <input_map_c2+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
jne    113c <input_map_c2+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    1143 <input_map_c2+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_map_c2>:
xor    %ecx,%ecx
cmp    $0x63,%dil
sete   %cl
add    %ecx,%ecx
cmp    $0x62,%dil
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @input_map_c2(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 98
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 99
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @input_map_c2(i8 signext %0) {
%2 = icmp eq i8 %0, 99
%3 = select i1 %2, i32 2, i32 0
%4 = icmp eq i8 %0, 98
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
double dirac(double x, ...) { return 0.0; }


x86 assembly (clang, -O0):
<dirac>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirac>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dirac(double %0, ...) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @dirac(double %0, ...) {
ret double 0.000000e+00
}
double jacobi_1d_kernel(double *v) { return 0.5 * (v[-1] + v[1]); }


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

x86 assembly (clang, -O2):
<jacobi_1d_kernel>:
movsd  -0x8(%rdi),%xmm0
addsd  0x8(%rdi),%xmm0
mulsd  0xeee(%rip),%xmm0
ret

LLVM IR (-O0):
define double @jacobi_1d_kernel(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 -1
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = fadd double %5, %8
%10 = fmul double 5.000000e-01, %9
ret double %10
}

LLVM IR (-O2):
define double @jacobi_1d_kernel(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 -1
%3 = load double, double* %2
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = fadd double %3, %5
%7 = fmul double %6, 5.000000e-01
ret double %7
}
/* Type definitions */
struct stat {
  int st_ino;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stat(char *, struct stat *);
int main() {
  struct stat a;
  stat("file.test", &a);
  printf("st_ino is %d\n", a.st_ino);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [10 x i8] c"file.test\00"
@.str.1 = [14 x i8] c"st_ino is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
store i32 0, i32* %1
%3 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [10 x i8] c"file.test\00"
@.str.1 = [14 x i8] c"st_ino is %d\0A\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter = [62 x i8] c"SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter\00"
define void @SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter = [62 x i8] c"SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter\00"
define void @SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_CIN_RunCinematic(int);
void UI_RunCinematicFrame(int handle) { trap_CIN_RunCinematic(handle); }


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

x86 assembly (clang, -O2):
<UI_RunCinematicFrame>:
jmp    1030 <trap_CIN_RunCinematic@plt>

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

LLVM IR (-O2):
define void @UI_RunCinematicFrame(i32 %0) {
%2 = tail call i32 @trap_CIN_RunCinematic(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int disp_str(void *name_str) {
  if (name_str)
    printf("\t: %s\n", (char *)name_str);
  else
    printf("\t: No name Timer\n");
}


x86 assembly (clang, -O0):
<disp_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <disp_str+0x2e>
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114c <disp_str+0x3c>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_str>:
push   %rax
test   %rdi,%rdi
je     1139 <disp_str+0x19>
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\09: %s\0A\00"
@.str.1 = [18 x i8] c"\09: No name Timer\0A\00"
define i32 @disp_str(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"\09: %s\0A\00"
@str = [17 x i8] c"\09: No name Timer\00"
define i32 @disp_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i32 undef
}
/* Type definitions */
typedef char *off_t;

/* Variables and functions */
char *__syscall_ret(char *);
off_t __lseek(int fd, off_t offset, int whence) {
  off_t ret;
  __asm__ __volatile__("syscall"
                       : "=a"(ret)
                       : "a"(19), "D"(fd), "S"(offset), "d"(whence)
                       : "rcx", "r11", "memory");
  return ret < 0 ? __syscall_ret(ret) : ret;
}


x86 assembly (clang, -O0):
<__lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x13,%eax
syscall
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1154 <__lseek+0x44>
mov    -0x20(%rbp),%rdi
call   1030 <__syscall_ret@plt>
mov    %rax,-0x28(%rbp)
jmp    115c <__lseek+0x4c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lseek>:
mov    $0x13,%eax
syscall
ret

LLVM IR (-O0):
define i8* @__lseek(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 19, i32 %8, i8* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ult i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i8*, i8** %7
%16 = call i8* @__syscall_ret(i8* %15)
br label %19
17: ; preds = %3
%18 = load i8*, i8** %7
br label %19
19: ; preds = %17, %14
%20 = phi i8* [ %16, %14 ], [ %18, %17 ]
ret i8* %20
}

LLVM IR (-O2):
define i8* @__lseek(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 19, i32 %0, i8* %1, i32 %2)
ret i8* %4
}
void progExecuteEND(void *vp) {}


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

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

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

LLVM IR (-O2):
define void @progExecuteEND(i8* nocapture %0) {
ret void
}
void __attribute__((visibility("default"))) __gnu_mcount_nc(void) {}


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

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

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

LLVM IR (-O2):
define void @__gnu_mcount_nc() {
ret void
}
signed short int signedshortint_ignoring_signedint(signed short int x,
                                                   signed int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshortint_ignoring_signedint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @signedshortint_ignoring_signedint(i16 returned signext %0, i32 %1) {
ret i16 %0
}
char *module_description() { return "A dummy kernel module for Riku."; }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"A dummy kernel module for Riku.\00"
define i8* @module_description() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"A dummy kernel module for Riku.\00"
define i8* @module_description() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_mem2(void **mem, int xmax) {
  unsigned int x;
  for (x = 0; x < xmax; x++)
    free(mem[x]);
  free(mem);
}


x86 assembly (clang, -O0):
<free_mem2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <free_mem2+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_mem2+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mem2>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <free_mem2+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_mem2+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_mem2(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = bitcast i8** %8 to i8***
%10 = load i8**, i8*** %9
%11 = tail call i32 @free(i8** %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @free(i8** %0)
ret void
}
int test_imm_48int64_midword_reg(long long val) {
  return ((val >> 16) & (0x48 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_48int64_midword_reg(i64 %0) {
%2 = and i64 %0, 4718592
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *realloc(void *, size_t);
void *avro_allocator_system_realloc(void *ptr, size_t size) {
  return realloc(ptr, size);
}


x86 assembly (clang, -O0):
<avro_allocator_system_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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avro_allocator_system_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @avro_allocator_system_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* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @avro_allocator_system_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
int fun861() { return 861; }


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

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

LLVM IR (-O0):
define i32 @fun861() {
ret i32 861
}

LLVM IR (-O2):
define i32 @fun861() {
ret i32 861
}
/* Variables and functions */
char *fz_malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *fz_strdup(char *s) {
  int len = strlen(s) + 1;
  char *ns = fz_malloc(len);
  memcpy(ns, s, len);
  return ns;
}


x86 assembly (clang, -O0):
<fz_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <fz_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <fz_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @fz_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @fz_malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @fz_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @fz_malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
int parent(int x) { return (x - 1) / 2; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int EINVAL;
int is_between(int left, int right, int value) { return -EINVAL; }


x86 assembly (clang, -O0):
<is_between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2eca(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_between>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @is_between(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
bool drc_is_point_in(int x, int y, int x1, int y1, int w1, int h1) {
  if ((x >= x1) && (x <= x1 + w1) && (y >= y1) && (y <= y1 + h1)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<drc_is_point_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     115e <drc_is_point_in+0x5e>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jg     115e <drc_is_point_in+0x5e>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     115e <drc_is_point_in+0x5e>
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jg     115e <drc_is_point_in+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <drc_is_point_in+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<drc_is_point_in>:
cmp    %edx,%edi
setge  %r10b
add    %edx,%r8d
cmp    %edi,%r8d
setge  %dl
cmp    %ecx,%esi
setge  %al
add    %ecx,%r9d
cmp    %esi,%r9d
setge  %cl
and    %r10b,%al
and    %dl,%al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @drc_is_point_in(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load i32, i32* %8
%15 = load i32, i32* %10
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %34
17: ; preds = %6
%18 = load i32, i32* %8
%19 = load i32, i32* %10
%20 = load i32, i32* %12
%21 = add nsw i32 %19, %20
%22 = icmp sle i32 %18, %21
br i1 %22, label %23, label %34
23: ; preds = %17
%24 = load i32, i32* %9
%25 = load i32, i32* %11
%26 = icmp sge i32 %24, %25
br i1 %26, label %27, label %34
27: ; preds = %23
%28 = load i32, i32* %9
%29 = load i32, i32* %11
%30 = load i32, i32* %13
%31 = add nsw i32 %29, %30
%32 = icmp sle i32 %28, %31
br i1 %32, label %33, label %34
33: ; preds = %27
store i32 1, i32* %7
br label %35
34: ; preds = %27, %23, %17, %6
store i32 0, i32* %7
br label %35
35: ; preds = %34, %33
%36 = load i32, i32* %7
ret i32 %36
}

LLVM IR (-O2):
define i32 @drc_is_point_in(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp slt i32 %0, %2
%8 = add nsw i32 %4, %2
%9 = icmp slt i32 %8, %0
%10 = select i1 %7, i1 true, i1 %9
%11 = icmp slt i32 %1, %3
%12 = or i1 %11, %10
%13 = add nsw i32 %5, %3
%14 = icmp sge i32 %13, %1
%15 = xor i1 %12, true
%16 = select i1 %15, i1 %14, i1 false
%17 = zext i1 %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ change_indent(int /*<<< orphan*/);
int yywrap(void) {
  change_indent(0);
  return 1;
}


x86 assembly (clang, -O0):
<yywrap>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <change_indent@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @yywrap() {
%1 = call i32 @change_indent(i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @yywrap() {
%1 = tail call i32 @change_indent(i32 0)
ret i32 1
}
/* Variables and functions */
int listen(int, int);
int /*<<< orphan*/ log_unix_error(char *);
int Listen(int s, int backlog) {
  int rc;
  if ((rc = listen(s, backlog)) < 0)
    log_unix_error("Listen error");
  return rc;
}


x86 assembly (clang, -O0):
<Listen>:
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 <listen@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1151 <Listen+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rbx
call   1040 <listen@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Listen+0x18>
lea    0xecd(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Listen error\00"
define i32 @Listen(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* %3
%7 = load i32, i32* %4
%8 = call i32 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @log_unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"Listen error\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @log_unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ gzFile;

/* Variables and functions */
int /*<<< orphan*/ gzerror(int /*<<< orphan*/, int *);
int gzerror2(gzFile gz) {
  int e;
  gzerror(gz, &e);
  return (e < 0);
}


x86 assembly (clang, -O0):
<gzerror2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <gzerror@plt>
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gzerror2>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <gzerror@plt>
mov    0x4(%rsp),%eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gzerror2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @gzerror(i32 %4, i32* %3)
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gzerror2(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @gzerror(i32 %0, i32* %2)
%5 = load i32, i32* %2
%6 = lshr i32 %5, 31
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ vmptrst(int /*<<< orphan*/ *);
uint64_t vmptrstz(void) {
  uint64_t value = 0;
  vmptrst(&value);
  return value;
}


x86 assembly (clang, -O0):
<vmptrstz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <vmptrst@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmptrstz>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <vmptrst@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vmptrstz() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @vmptrst(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
int pl_on_destroy_workers(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pl_on_destroy_workers() {
ret i32 0
}
/* Variables and functions */
int mkdir(char const *, int);
int iposix_mkdir(const char *path, int mode) {
  if (mode < 0)
    mode = 0755;
  return mkdir(path, mode);
}


x86 assembly (clang, -O0):
<iposix_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1130 <iposix_mkdir+0x20>
movl   $0x1ed,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iposix_mkdir>:
test   %esi,%esi
mov    $0x1ed,%eax
cmovs  %eax,%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
define i32 @iposix_mkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 493, i32* %4
br label %8
8: ; preds = %7, %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @mkdir(i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @iposix_mkdir(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
%4 = select i1 %3, i32 493, i32 %1
%5 = tail call i32 @mkdir(i8* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nC you later\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"\0AC you later\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int syscall(int, int, unsigned int);
int inotify_rm_watch(int fd, unsigned int wd) { return syscall(255, fd, wd); }


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

x86 assembly (clang, -O2):
<inotify_rm_watch>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0xff,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @inotify_rm_watch(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 @syscall(i32 255, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @inotify_rm_watch(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 255, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kvm_hypercall(int, unsigned long);
void virtio_reset(void *dev) { kvm_hypercall(1, (unsigned long)dev); }


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

x86 assembly (clang, -O2):
<virtio_reset>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <kvm_hypercall@plt>

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

LLVM IR (-O2):
define void @virtio_reset(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @kvm_hypercall(i32 1, i64 %2)
ret void
}