xunge/DecIR huggingface dataset:
int hash(char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash % 1009;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
mov    $0x3f1,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     114b <hash+0x4b>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
mov    %rcx,%rdx
shl    $0x5,%rdx
add    %rcx,%rdx
movsbq %al,%rcx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movabs $0x81e722c258cd00c3,%rdx
22 e7 81
mov    %rcx,%rax
mul    %rdx
shr    $0x9,%rdx
imul   $0x3f1,%edx,%eax
sub    %eax,%ecx
mov    %ecx,%eax
ret
mov    $0x150,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %11, 1009
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 336, %1 ], [ %16, %14 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fail() {
  printf("\\w");
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\\w\00"
define i32 @fail() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
struct rcstoken {
  int dummy;
};

/* Variables and functions */
scalar_t__ tokcmp(struct rcstoken *, struct rcstoken *);
int tokeqtok(struct rcstoken *tok1, struct rcstoken *tok2) {
  return tokcmp(tok1, tok2) == 0;
}


x86 assembly (clang, -O0):
<tokeqtok>:
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 <tokcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokeqtok>:
push   %rax
call   1030 <tokcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rcstoken = type { i32 }
define i32 @tokeqtok(%struct.rcstoken* %0, %struct.rcstoken* %1) {
%3 = alloca %struct.rcstoken*
%4 = alloca %struct.rcstoken*
store %struct.rcstoken* %0, %struct.rcstoken** %3
store %struct.rcstoken* %1, %struct.rcstoken** %4
%5 = load %struct.rcstoken*, %struct.rcstoken** %3
%6 = load %struct.rcstoken*, %struct.rcstoken** %4
%7 = call i64 @tokcmp(%struct.rcstoken* %5, %struct.rcstoken* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.rcstoken = type { i32 }
define i32 @tokeqtok(%struct.rcstoken* %0, %struct.rcstoken* %1) {
%3 = tail call i64 @tokcmp(%struct.rcstoken* %0, %struct.rcstoken* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ rint(double);
float rintf(float x) { return (float)rint((double)x); }


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

x86 assembly (clang, -O2):
<rintf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <rint@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @rint(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @rintf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @rint(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Type definitions */
typedef int n_bits;

/* Variables and functions */
int CHAR_BIT;
size_t bitmap_n_longs(size_t n_bits) {
  return (((n_bits) + (((sizeof(unsigned long) * CHAR_BIT)) - 1)) /
          ((sizeof(unsigned long) * CHAR_BIT)));
}


x86 assembly (clang, -O0):
<bitmap_n_longs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    0x2eb8(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_n_longs>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rcx
lea    (%rdi,%rcx,8),%rax
add    $0xffffffffffffffff,%rax
shl    $0x3,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1128 <bitmap_n_longs+0x28>
xor    %edx,%edx
div    %rcx
ret
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i64 @bitmap_n_longs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @CHAR_BIT
%5 = sext i32 %4 to i64
%6 = mul i64 8, %5
%7 = sub i64 %6, 1
%8 = add i64 %3, %7
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = udiv i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i64 @bitmap_n_longs(i64 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = sext i32 %2 to i64
%4 = shl nsw i64 %3, 3
%5 = add i64 %0, -1
%6 = add i64 %5, %4
%7 = udiv i64 %6, %4
ret i64 %7
}
/* Variables and functions */
char *realloc(char *, int);
int strlen(char *);
const char *AddCR(char *s) {
  int n = strlen(s);
  s = realloc(s, n + 2);
  s[n] = '\r';
  return (const char *)s;
}


x86 assembly (clang, -O0):
<AddCR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x2,%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0xd,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddCR>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%r14d
lea    0x2(%r14),%esi
mov    %rbx,%rdi
call   1040 <realloc@plt>
movslq %r14d,%rcx
movb   $0xd,(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @AddCR(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 2
%9 = call i8* @realloc(i8* %6, i32 %8)
store i8* %9, i8** %2
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 13, i8* %13
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @AddCR(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 2
%4 = tail call i8* @realloc(i8* %0, i32 %3)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 13, i8* %6
ret i8* %4
}
int main(void) {
  int a = 0;
  {
    __label__ testlabel;
  testlabel:
    if (a < 1) {
      a++;
      goto testlabel;
    }
  }
  {
    __label__ testlabel;
    int x = 2;
    if (x == 2) {
      x = 3;
      goto testlabel;
    }
  testlabel:
    if (a < 1) {
      a++;
      goto testlabel;
    }
  }
  {
    __label__ testlabel;
  testlabel:
    if (a < 1) {
      a++;
      goto testlabel;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
movl   $0x2,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1147 <main+0x47>
movl   $0x3,-0xc(%rbp)
jmp    114c <main+0x4c>
jmp    114c <main+0x4c>
cmpl   $0x1,-0x8(%rbp)
jge    1164 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x4c>
jmp    1169 <main+0x69>
cmpl   $0x1,-0x8(%rbp)
jge    1181 <main+0x81>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <main+0x69>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int cairo_code_draw_rgbLED_get_width() { return 19; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_rgbLED_get_width() {
ret i32 19
}

LLVM IR (-O2):
define i32 @cairo_code_draw_rgbLED_get_width() {
ret i32 19
}
void flip_bit(unsigned *x, unsigned n) { *x ^= (1 << n); }


x86 assembly (clang, -O0):
<flip_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @flip_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int *malloc(size_t);
int /*<<< orphan*/ memcpy(int *, int const *, size_t);
int *intdup(int const *src, size_t len) {
  int *p = malloc(len * sizeof(int));
  if (p == NULL)
    return NULL;
  memcpy(p, src, len * sizeof(int));
  return p;
}


x86 assembly (clang, -O0):
<intdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <intdup+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1176 <intdup+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shl    $0x2,%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
shl    $0x2,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     114d <intdup+0x2d>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @intdup(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32*
store i32* %0, i32** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = mul i64 %7, 4
%9 = call i32* @malloc(i64 %8)
store i32* %9, i32** %6
%10 = load i32*, i32** %6
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32* null, i32** %3
br label %20
13: ; preds = %2
%14 = load i32*, i32** %6
%15 = load i32*, i32** %4
%16 = load i64, i64* %5
%17 = mul i64 %16, 4
%18 = call i32 @memcpy(i32* %14, i32* %15, i64 %17)
%19 = load i32*, i32** %6
store i32* %19, i32** %3
br label %20
20: ; preds = %13, %12
%21 = load i32*, i32** %3
ret i32* %21
}

LLVM IR (-O2):
define i32* @intdup(i32* %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = tail call i32* @malloc(i64 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i32* %4, i32* %0, i64 %3)
br label %8
8: ; preds = %2, %6
ret i32* %4
}
int fun688() { return 688; }


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

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

LLVM IR (-O0):
define i32 @fun688() {
ret i32 688
}

LLVM IR (-O2):
define i32 @fun688() {
ret i32 688
}
/* Variables and functions */
double monotonic_clock_fallback();
double monotonic_clock(void) { return monotonic_clock_fallback(); }


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

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

LLVM IR (-O0):
define double @monotonic_clock() {
%1 = call double (...) @monotonic_clock_fallback()
ret double %1
}

LLVM IR (-O2):
define double @monotonic_clock() {
%1 = tail call double (...) @monotonic_clock_fallback()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void RotWord(unsigned char *word) {
  unsigned char head = word[0];
  memcpy(word, (word + 1), 1);
  memcpy((word + 1), (word + 2), 1);
  memcpy((word + 2), (word + 3), 1);
  memcpy((word + 3), &head, 1);
}


x86 assembly (clang, -O0):
<RotWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotWord>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%al
mov    %al,0xf(%rsp)
lea    0x1(%rdi),%r14
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
lea    0x2(%rbx),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x3,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @RotWord(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i32 @memcpy(i8* %7, i8* %9, i32 1)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = call i32 @memcpy(i8* %12, i8* %14, i32 1)
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = call i32 @memcpy(i8* %17, i8* %19, i32 1)
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = call i32 @memcpy(i8* %22, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @RotWord(i8* %0) {
%2 = alloca i8
%3 = load i8, i8* %0
store i8 %3, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 1)
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = tail call i32 @memcpy(i8* %4, i8* %6, i32 1)
%8 = getelementptr inbounds i8, i8* %0, i64 3
%9 = tail call i32 @memcpy(i8* %6, i8* %8, i32 1)
%10 = call i32 @memcpy(i8* %8, i8* %2, i32 1)
ret void
}
int test_imm_D4uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xD4 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D4uint64_lowword_reg>:
test   $0xd4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D4uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 212
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverseWords(char *);
int main(int argc, char const *argv[]) {
  char test3[] = "hello world fyliu";
  reverseWords(test3);
  printf("%s\n", test3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%ax
mov    %ax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <reverseWords@plt>
lea    -0x30(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x75,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <reverseWords@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.test3 = [18 x i8] c"hello world fyliu\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [18 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [18 x i8]* %6 to i8*
%8 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 0
%9 = call i32 @reverseWords(i8* %8)
%10 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test3 = [18 x i8] c"hello world fyliu\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [18 x i8]
%4 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%5 = call i32 @reverseWords(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t lp_read_u16_lep(void **p) {
  uint8_t *s = (uint8_t *)*p;
  uint16_t v = s[0] | s[1] << 8;
  *p = s + 2;
  return v;
}


x86 assembly (clang, -O0):
<lp_read_u16_lep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lp_read_u16_lep>:
mov    (%rdi),%rcx
mov    0x4(%rcx),%eax
shl    $0x8,%eax
or     (%rcx),%eax
add    $0x8,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @lp_read_u16_lep(i8** %0) {
%2 = alloca i8**
%3 = alloca i32*
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
store i32 %15, i32* %4
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = bitcast i32* %17 to i8*
%19 = load i8**, i8*** %2
store i8* %18, i8** %19
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @lp_read_u16_lep(i8** nocapture %0) {
%2 = bitcast i8** %0 to i32**
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %3, i64 1
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %3, i64 2
store i32* %9, i32** %2
ret i32 %8
}
void SSMR3PutGCPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutGCPtr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *routine(void *arg) {
  intptr_t thrd_id = (intptr_t)arg;
  printf("Hello from thread #%d\n", (int)thrd_id);
  return NULL;
}


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

x86 assembly (clang, -O2):
<routine>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Hello from thread #%d\0A\00"
define i8* @routine(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* null
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello from thread #%d\0A\00"
define noalias i8* @routine(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
int ununsed(const struct astruct *somestruct, const union aunion *someunion) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.astruct = type opaque
%union.aunion = type opaque
define i32 @ununsed(%struct.astruct* nocapture readnone %0, %union.aunion* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: "
                  "nescombine"
                  "[-o <f>] [-m <M>] [-x <X>] [-r <sz>] [file ...]\n");
  fprintf(stderr,
          "-o <f>      output file (default is basename of first file).\n"
          "-m <M>      mapper number (default is 0).\n"
          "-x <X>      extended mapper number (default is 0).\n"
          "-r <R>      RAM size (default is 0, rounded up in 8K chunks).\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf09(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf13(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"usage: nescombine[-o <f>] [-m <M>] [-x <X>] [-r <sz>] [file ...]\0A\00"
@.str.1 = [217 x i8] c"-o <f> output file (default is basename of first file).\0A-m <M> mapper number (default is 0).\0A-x <X> extended mapper number (default is 0).\0A-r <R> RAM size (default is 0, rounded up in 8K chunks).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"usage: nescombine[-o <f>] [-m <M>] [-x <X>] [-r <sz>] [file ...]\0A\00"
@.str.1 = [217 x i8] c"-o <f> output file (default is basename of first file).\0A-m <M> mapper number (default is 0).\0A-x <X> extended mapper number (default is 0).\0A-r <R> RAM size (default is 0, rounded up in 8K chunks).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void rop3_221_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = S | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_221_0_1>:
mov    (%rdi),%al
mov    %esi,%ecx
not    %cl
and    %dl,%cl
and    %al,%cl
not    %al
or     %sil,%al
not    %dl
and    %al,%dl
or     %sil,%cl
or     %dl,%cl
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_221_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %1
%7 = xor i8 %2, -1
%8 = and i8 %6, %7
%9 = xor i8 %1, -1
%10 = and i8 %9, %2
%11 = and i8 %10, %4
%12 = or i8 %11, %1
%13 = or i8 %12, %8
store i8 %13, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
void main() {
  char *name[2];
  name[0] = "/bin/sh";
  name[1] = NULL;
  execve(name[0], name, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define void @main() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = call i32 @execve(i8* %5, i8** %6, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define void @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret void
}
void print_modules(void) {}


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

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

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

LLVM IR (-O2):
define void @print_modules() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigchldhandler(int data) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
  signal(SIGCHLD, sigchldhandler);
}


x86 assembly (clang, -O0):
<sigchldhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0x0,%rax
jle    1151 <sigchldhandler+0x31>
jmp    112b <sigchldhandler+0xb>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchldhandler>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %rax,%rax
jg     1130 <sigchldhandler+0x10>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    0x2e85(%rip),%rsi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @sigchldhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* @SIGCHLD
%10 = call i32 @signal(i32 %9, void (i32)* @sigchldhandler)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @sigchldhandler(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = load i32, i32* @SIGCHLD
%8 = tail call i32 @signal(i32 %7, void (i32)* @sigchldhandler)
ret void
}
/* Variables and functions */
int strlen(char const *);
int write(int, char const *, int);
int puts(const char *str) {
  char n = '\n';
  int ret = write(1, str, strlen(str));
  ret += write(1, &n, 1);
  return ret;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0xa,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
mov    $0x1,%edx
lea    -0x9(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0xa,0xf(%rsp)
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,%ebx
lea    0xf(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = alloca i8
store i8 10, i8* %2
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 1, i8* %0, i32 %3)
%5 = call i32 @write(i32 1, i8* %2, i32 1)
%6 = add nsw i32 %5, %4
ret i32 %6
}
swap(int *x, int *y) {
  int tmp = *x;
  *y = *x;
  *x = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
store i32 %3, i32* %0
ret i32 undef
}
void replace(char *str) {}


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

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

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

LLVM IR (-O2):
define void @replace(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Log_SetProductInfo(int /*<<< orphan*/, int /*<<< orphan*/,
                                      int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ProductState_GetBuildNumberString();
int /*<<< orphan*/ ProductState_GetCompilationOption();
int /*<<< orphan*/ ProductState_GetName();
int /*<<< orphan*/ ProductState_GetVersion();
void Log_SetProductInfoSimple(void) {
  Log_SetProductInfo(ProductState_GetName(), ProductState_GetVersion(),
                     ProductState_GetBuildNumberString(),
                     ProductState_GetCompilationOption());
}


x86 assembly (clang, -O0):
<Log_SetProductInfoSimple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <ProductState_GetName@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <ProductState_GetVersion@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <ProductState_GetBuildNumberString@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ProductState_GetCompilationOption@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
call   1030 <Log_SetProductInfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log_SetProductInfoSimple>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <ProductState_GetName@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <ProductState_GetVersion@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1070 <ProductState_GetBuildNumberString@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ProductState_GetCompilationOption@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <Log_SetProductInfo@plt>

LLVM IR (-O0):
define void @Log_SetProductInfoSimple() {
%1 = call i32 (...) @ProductState_GetName()
%2 = call i32 (...) @ProductState_GetVersion()
%3 = call i32 (...) @ProductState_GetBuildNumberString()
%4 = call i32 (...) @ProductState_GetCompilationOption()
%5 = call i32 @Log_SetProductInfo(i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @Log_SetProductInfoSimple() {
%1 = tail call i32 (...) @ProductState_GetName()
%2 = tail call i32 (...) @ProductState_GetVersion()
%3 = tail call i32 (...) @ProductState_GetBuildNumberString()
%4 = tail call i32 (...) @ProductState_GetCompilationOption()
%5 = tail call i32 @Log_SetProductInfo(i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Type definitions */
struct wl_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
void wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x,
                              int32_t y, int32_t width, int32_t height) {
  wl_proxy_marshal((struct wl_proxy *)wl_surface, 9, x, y, width, height);
}


x86 assembly (clang, -O0):
<wl_surface_damage_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x9,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_surface_damage_buffer>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x9,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_damage_buffer(%struct.wl_surface* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.wl_surface*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.wl_surface* %0, %struct.wl_surface** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.wl_surface*, %struct.wl_surface** %6
%12 = bitcast %struct.wl_surface* %11 to %struct.wl_proxy*
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %12, i32 9, i32 %13, i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_damage_buffer(%struct.wl_surface* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = bitcast %struct.wl_surface* %0 to %struct.wl_proxy*
%7 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 9, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long id_function(void) { return ((unsigned long)pthread_self()); }


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

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

LLVM IR (-O0):
define i64 @id_function() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @id_function() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void QEIEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<QEIEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIEnable>:
movslq %edi,%rax
orl    $0x1,(%rax)
ret

LLVM IR (-O0):
define void @QEIEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @QEIEnable(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 1
store volatile i32 %5, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ keyorder_print_keyordertable(int /*<<< orphan*/ *);
edf_keyorder_print_table(FILE *out) { keyorder_print_keyordertable(out); }


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

x86 assembly (clang, -O2):
<edf_keyorder_print_table>:
jmp    1030 <keyorder_print_keyordertable@plt>

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

LLVM IR (-O2):
define i32 @edf_keyorder_print_table(i32* %0) {
%2 = tail call i32 @keyorder_print_keyordertable(i32* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ outOfMemory();
int posix_memalign(void **, int, size_t);
void *rax_malloc(size_t size) {
  void *ptr = (void *)NULL;
  int res = posix_memalign(&ptr, 16, size);
  if (res != 0) {
    outOfMemory();
    assert(0);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<rax_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1050 <posix_memalign@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1171 <rax_malloc+0x41>
mov    $0x0,%al
call   1040 <outOfMemory@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rax_malloc>:
push   %rax
mov    %rdi,%rdx
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1050 <posix_memalign@plt>
test   %eax,%eax
je     115b <rax_malloc+0x2b>
xor    %eax,%eax
call   1040 <outOfMemory@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @rax_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32
store i64 %0, i64* %2
store i8* null, i8** %3
%5 = load i64, i64* %2
%6 = call i32 @posix_memalign(i8** %3, i32 16, i64 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 (...) @outOfMemory()
%11 = call i32 @assert(i32 0)
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @rax_malloc(i64 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @posix_memalign(i8** %2, i32 16, i64 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 (...) @outOfMemory()
%8 = call i32 @assert(i32 0)
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
ret i8* %10
}