xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ get_num(char *, char *);
char *long2str(char *, scalar_t__);
char *macsum(char *arg) {
  return long2str(arg, get_num("sum", arg) + get_num("sum", arg));
}


x86 assembly (clang, -O0):
<macsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <get_num@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdi
add    %rax,%rsi
call   1040 <long2str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macsum>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xed1(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <get_num@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <get_num@plt>
add    %rax,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <long2str@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sum\00"
define i8* @macsum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @get_num(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i64 @get_num(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = add nsw i64 %5, %7
%9 = call i8* @long2str(i8* %3, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"sum\00"
define i8* @macsum(i8* %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = add nsw i64 %3, %2
%5 = tail call i8* @long2str(i8* %0, i64 %4)
ret i8* %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
void set_XSelectionClearEvent_window(void *_p, unsigned long _v) {
  ((XSelectionClearEvent *)_p)->window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSelectionClearEvent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSelectionClearEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void nseel_asm_and(void) {
  __asm__("fistpll (%esi)\n"
          "fistpll 8(%esi)\n"
          "movl 8(%esi), %edi\n"
          "movl 12(%esi), %ecx\n"
          "andl %edi, (%esi)\n"
          "andl %ecx, 4(%esi)\n"
          "fildll (%esi)\n");
}


x86 assembly (clang, -O0):
<nseel_asm_and>:
push   %rbp
mov    %rsp,%rbp
fistpll (%esi)
fistpll 0x8(%esi)
mov    0x8(%esi),%edi
mov    0xc(%esi),%ecx
and    %edi,(%esi)
and    %ecx,0x4(%esi)
fildll (%esi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_and>:
fistpll (%esi)
fistpll 0x8(%esi)
mov    0x8(%esi),%edi
mov    0xc(%esi),%ecx
and    %edi,(%esi)
and    %ecx,0x4(%esi)
fildll (%esi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_and() {
tail call void asm sideeffect "fistpll (%esi)\0Afistpll 8(%esi)\0Amovl 8(%esi), %edi\0Amovl 12(%esi), %ecx\0Aandl %edi, (%esi)\0Aandl %ecx, 4(%esi)\0Afildll (%esi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_source_info_by_name() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_source_info_by_name"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"NOT IMPLEMENTED:pa_context_get_source_info_by_name\0A\00"
define i32 @pa_context_get_source_info_by_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [51 x i8] c"NOT IMPLEMENTED:pa_context_get_source_info_by_name\00"
define i32 @pa_context_get_source_info_by_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_9Bint64_highword_reg(long long val) {
  return ((val >> 32) & (0x9B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Bint64_highword_reg>:
movabs $0x9b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Bint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 155
%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_9Bint64_highword_reg(i64 %0) {
%2 = and i64 %0, 665719930880
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_73uint16_reg(unsigned short val) {
  return ((val) & (-0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff8d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_73uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -115
%6 = icmp ne i32 %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_73uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -115
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int num_digits(int n) {
  int digits = 0;
  if (n <= 0)
    return -1;
  do {
    digits++;
    n /= 10;
  } while (n > 0);
  return digits;
}


x86 assembly (clang, -O0):
<num_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1124 <num_digits+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <num_digits+0x50>
jmp    1129 <num_digits+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1129 <num_digits+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_digits>:
test   %edi,%edi
jle    1130 <num_digits+0x30>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
cmp    $0x9,%ecx
jg     1110 <num_digits+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @num_digits(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = sdiv i32 %4, 10
%8 = icmp sgt i32 %4, 9
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_SET_HUM_SCL_PIN();
void HUMIDITY_SET_CLOCK() { TOSH_SET_HUM_SCL_PIN(); }


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_SET_CLOCK() {
%1 = tail call i32 (...) @TOSH_SET_HUM_SCL_PIN()
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int addition(int, int);
int main() {
  int m = __VERIFIER_nondet_int();
  if (m <= 0) {
    return 0;
  }
  int n = __VERIFIER_nondet_int();
  if (n <= 0) {
    return 0;
  }
  int result = addition(m, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     114f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <addition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    1142 <main+0x22>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    1142 <main+0x22>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <addition@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 1
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp slt i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @addition(i32 %1, i32 %4)
br label %8
8: ; preds = %6, %3, %0
ret i32 0
}
int do_456() { return 456; }


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

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

LLVM IR (-O0):
define i32 @do_456() {
ret i32 456
}

LLVM IR (-O2):
define i32 @do_456() {
ret i32 456
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int rand();
int /*<<< orphan*/ stderr;
int dropper2(int probability) {
  if (rand() % 100 < probability) {
    return 1;
  } else {
    fprintf(stderr, "Oops I did it again!\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<dropper2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%edx
jge    114f <dropper2+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    116b <dropper2+0x4b>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropper2>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ecx
mov    $0x1,%eax
cmp    %ebx,%ecx
jl     1166 <dropper2+0x46>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Oops I did it again!\0A\00"
define i32 @dropper2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 100
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Oops I did it again!\0A\00"
define i32 @dropper2(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = icmp slt i32 %3, %0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ 0, %5 ], [ 1, %1 ]
ret i32 %9
}
int main(int arg, char **argv) { return sizeof(int) + sizeof arg; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 8
}
/* Variables and functions */
scalar_t__ isPrime(long long);
long long sumPrimes(long long n) {
  long long sum = 0;
  long long i;
  for (i = 2; i < n; i++) {
    if (isPrime(i)) {
      sum += i;
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<sumPrimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    116f <sumPrimes+0x5f>
mov    -0x18(%rbp),%rdi
call   1030 <isPrime@plt>
cmp    $0x0,%rax
je     1159 <sumPrimes+0x49>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    115e <sumPrimes+0x4e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <sumPrimes+0x1c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumPrimes>:
push   %r15
push   %r14
push   %rbx
cmp    $0x3,%rdi
jl     114d <sumPrimes+0x3d>
mov    %rdi,%r14
mov    $0x2,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <isPrime@plt>
test   %rax,%rax
cmovne %rbx,%rax
add    %rax,%r15
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <sumPrimes+0x20>
jmp    1150 <sumPrimes+0x40>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @sumPrimes(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 2, i64* %4
br label %5
5: ; preds = %18, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %2
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i64, i64* %4
%11 = call i64 @isPrime(i64 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = add nsw i64 %15, %14
store i64 %16, i64* %3
br label %17
17: ; preds = %13, %9
br label %18
18: ; preds = %17
%19 = load i64, i64* %4
%20 = add nsw i64 %19, 1
store i64 %20, i64* %4
br label %5
21: ; preds = %5
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @sumPrimes(i64 %0) {
%2 = icmp sgt i64 %0, 2
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i64 [ %10, %3 ], [ 2, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = tail call i64 @isPrime(i64 %4)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64 0, i64 %4
%9 = add nuw nsw i64 %8, %5
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %9, %3 ]
ret i64 %13
}
__float128 calc1(__float128 num) {
  __float128 num2 = ((power_of_two(60)) + (num));
  __float128 ret;
  ret = calc2(num2);
  return ret;
}


x86 assembly (clang, -O0):
<calc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movaps %xmm0,-0x10(%rbp)
xor    %eax,%eax
mov    $0x3c,%edi
call   1030 <power_of_two@plt>
mov    %eax,%edi
call   2550 <__floatsitf>
movaps -0x10(%rbp),%xmm1
call   1170 <__addtf3>
movaps %xmm0,-0x20(%rbp)
movaps -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1040 <calc2@plt>
mov    %eax,%edi
call   2550 <__floatsitf>
movaps %xmm0,-0x30(%rbp)
movaps -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<calc1>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
mov    $0x3c,%edi
xor    %eax,%eax
call   1030 <power_of_two@plt>
mov    %eax,%edi
call   2540 <__floatsitf>
movaps (%rsp),%xmm1
call   1160 <__addtf3>
mov    $0x1,%al
call   1040 <calc2@plt>
mov    %eax,%edi
call   2540 <__floatsitf>
add    $0x18,%rsp
ret
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define fp128 @calc1(fp128 %0) {
%2 = alloca fp128
%3 = alloca fp128
%4 = alloca fp128
store fp128 %0, fp128* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @power_of_two to i32 (i32, ...)*)(i32 60)
%6 = sitofp i32 %5 to fp128
%7 = load fp128, fp128* %2
%8 = fadd fp128 %6, %7
store fp128 %8, fp128* %3
%9 = load fp128, fp128* %3
%10 = call i32 (fp128, ...) bitcast (i32 (...)* @calc2 to i32 (fp128, ...)*)(fp128 %9)
%11 = sitofp i32 %10 to fp128
store fp128 %11, fp128* %4
%12 = load fp128, fp128* %4
ret fp128 %12
}

LLVM IR (-O2):
define fp128 @calc1(fp128 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @power_of_two to i32 (i32, ...)*)(i32 60)
%3 = sitofp i32 %2 to fp128
%4 = fadd fp128 %3, %0
%5 = tail call i32 (fp128, ...) bitcast (i32 (...)* @calc2 to i32 (fp128, ...)*)(fp128 %4)
%6 = sitofp i32 %5 to fp128
ret fp128 %6
}
unsigned int sqrt_v1(unsigned int num) {
  unsigned int sqrt;
  if (num == 0) {
    return (0);
  }
  sqrt = 1;
  while ((sqrt * sqrt) <= num) {
    ++sqrt;
  }
  if ((sqrt * sqrt) > num) {
    return (sqrt - 1);
  }
  return (sqrt);
}


x86 assembly (clang, -O0):
<sqrt_v1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <sqrt_v1+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1166 <sqrt_v1+0x66>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1142 <sqrt_v1+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <sqrt_v1+0x24>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1160 <sqrt_v1+0x60>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <sqrt_v1+0x66>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_v1>:
test   %edi,%edi
je     111e <sqrt_v1+0x1e>
mov    $0xffffffff,%eax
nopl   0x0(%rax)
lea    0x2(%rax),%ecx
imul   %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jbe    1110 <sqrt_v1+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sqrt_v1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = mul i32 %4, %4
%6 = icmp ugt i32 %5, %0
%7 = add i32 %4, 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = add i32 %4, -1
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ %9, %8 ], [ 0, %1 ]
ret i32 %11
}
int collatz(unsigned int n) {
  if (n == 1) {
    return 0;
  } else if (n % 2 == 0) {
    return 1 + collatz(n / 2);
  } else {
    return 1 + collatz((3 * n + 1));
  }
}


x86 assembly (clang, -O0):
<collatz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <collatz+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1168 <collatz+0x58>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1156 <collatz+0x46>
mov    -0x8(%rbp),%edi
shr    $0x1,%edi
call   1030 <collatz@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <collatz+0x58>
imul   $0x3,-0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <collatz@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collatz>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x1,%edi
je     1142 <collatz+0x32>
mov    $0x1,%ebx
nopl   (%rax)
test   $0x1,%dil
jne    1135 <collatz+0x25>
shr    %edi
add    $0x1,%ebx
cmp    $0x1,%edi
jne    1120 <collatz+0x10>
add    $0xffffffff,%ebx
jmp    1142 <collatz+0x32>
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
call   1030 <collatz@plt>
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @collatz(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %8
%4 = phi i32 [ %9, %8 ], [ %0, %1 ]
%5 = phi i32 [ %10, %8 ], [ 0, %1 ]
%6 = and i32 %4, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = lshr i32 %4, 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %9, 1
br i1 %11, label %12, label %3
12: ; preds = %8, %1, %14
%13 = phi i32 [ %19, %14 ], [ 0, %1 ], [ %10, %8 ]
ret i32 %13
14: ; preds = %3
%15 = mul i32 %4, 3
%16 = add i32 %15, 1
%17 = tail call i32 @collatz(i32 %16)
%18 = add nuw i32 %5, 1
%19 = add i32 %18, %17
br label %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int system(char *);
void hlp_clean_tst() {
  int i = system("make -C .. ctst > /dev/null");
  if (i != 0)
    printf("... the clean up command failed ...");
}


x86 assembly (clang, -O0):
<hlp_clean_tst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <hlp_clean_tst+0x2d>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_clean_tst>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
test   %eax,%eax
je     113e <hlp_clean_tst+0x1e>
lea    0xee4(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"make -C .. ctst > /dev/null\00"
@.str.1 = [36 x i8] c"... the clean up command failed ...\00"
define void @hlp_clean_tst() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"make -C .. ctst > /dev/null\00"
@.str.1 = [36 x i8] c"... the clean up command failed ...\00"
define void @hlp_clean_tst() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
size_t varchunk_body_size(size_t minimum) {
  size_t size = 1;
  while (size < minimum)
    size <<= 1;
  return size;
}


x86 assembly (clang, -O0):
<varchunk_body_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <varchunk_body_size+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <varchunk_body_size+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<varchunk_body_size>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <varchunk_body_size+0x10>
ret

LLVM IR (-O0):
define i64 @varchunk_body_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i64, i64* %3
%10 = shl i64 %9, 1
store i64 %10, i64* %3
br label %4
11: ; preds = %4
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @varchunk_body_size(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
void fork2() {
  printf("L0\n");
  fork();
  printf("L1\n");
  fork();
  printf("Bye\n");
}


x86 assembly (clang, -O0):
<fork2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xeb8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"L0\0A\00"
@.str.1 = [4 x i8] c"L1\0A\00"
@.str.2 = [5 x i8] c"Bye\0A\00"
define void @fork2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @fork()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @fork()
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"L0\00"
@str.3 = [3 x i8] c"L1\00"
@str.4 = [4 x i8] c"Bye\00"
define void @fork2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (...) @fork()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret void
}
void AddRoundKey(unsigned *state, unsigned *key) {
  int idx;
  for (idx = 0; idx < 4; idx++) {
    state[idx] ^= key[idx];
  }
}


x86 assembly (clang, -O0):
<AddRoundKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1144 <AddRoundKey+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <AddRoundKey+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddRoundKey>:
mov    (%rsi),%eax
xor    %eax,(%rdi)
mov    0x4(%rsi),%eax
xor    %eax,0x4(%rdi)
mov    0x8(%rsi),%eax
xor    %eax,0x8(%rdi)
mov    0xc(%rsi),%eax
xor    %eax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @AddRoundKey(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = xor i32 %9, %7
store i32 %10, i32* %8
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = xor i32 %14, %12
store i32 %15, i32* %13
%16 = getelementptr inbounds i32, i32* %1, i64 3
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %0, i64 3
%19 = load i32, i32* %18
%20 = xor i32 %19, %17
store i32 %20, i32* %18
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
bool hidrd_char_isword(char c) { return (isalnum(c) || c == '-' || c == '_'); }


x86 assembly (clang, -O0):
<hidrd_char_isword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <hidrd_char_isword+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1158 <hidrd_char_isword+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hidrd_char_isword>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%bl
sete   %cl
cmp    $0x5f,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hidrd_char_isword(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 95
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @hidrd_char_isword(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 45
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 95
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned char in8(unsigned long addr) {
  return *(volatile unsigned char *)addr;
}


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

x86 assembly (clang, -O2):
<in8>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @in8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
%5 = load volatile i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @in8(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = load volatile i8, i8* %2
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int waitpid(int /*<<< orphan*/, int *, int);
int sys_waitpid(pid_t pid, int *status, int options) {
  return waitpid(pid, status, options);
}


x86 assembly (clang, -O0):
<sys_waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
call   1030 <waitpid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_waitpid>:
jmp    1030 <waitpid@plt>

LLVM IR (-O0):
define i32 @sys_waitpid(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* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @waitpid(i32 %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @waitpid(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
int comparator(const void *a, const void *b) {
  int f = *(int *)a;
  int s = *(int *)b;
  return s - f;
}


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

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

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

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *argv[]) {
  fprintf(stderr, "usage: %s [SUBPATH]\n", argv[0] ? argv[0] : NULL);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1146 <print_usage+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <print_usage+0x41>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1151 <print_usage+0x41>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xedd(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s [SUBPATH]\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %8
%14 = phi i8* [ %11, %8 ], [ null, %12 ]
%15 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s [SUBPATH]\0A\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int absval(int val) { return (val < 0) ? -val : val; }


x86 assembly (clang, -O0):
<absval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <absval+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absval+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @absval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @absval(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
void *GetClearedMemory(int);
void *AAS_RoutingGetMemory(int size) { return GetClearedMemory(size); }


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

x86 assembly (clang, -O2):
<AAS_RoutingGetMemory>:
jmp    1030 <GetClearedMemory@plt>

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

LLVM IR (-O2):
define i8* @AAS_RoutingGetMemory(i32 %0) {
%2 = tail call i8* @GetClearedMemory(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_string(char *s) { printf("%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @show_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
long clock() { return 0; }


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

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

LLVM IR (-O0):
define i64 @clock() {
ret i64 0
}

LLVM IR (-O2):
define i64 @clock() {
ret i64 0
}
int f1(int x) {
  if (x & 1)
    return 1;
  return x;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1122 <f1+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1128 <f1+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
test   $0x1,%dil
mov    $0x1,%eax
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 %0, i32 1
ret i32 %4
}
int test_imm_A2int64_lowword_mem(long long *val) {
  return ((*val) & (0xA2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A2int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 162
%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_A2int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 162
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_dest_defaults_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_dest_defaults_get_type() {
ret void
}
int _int_wrap(int *src, int start) {
  int x;
  x = (*src)++;
  if (*src < start)
    *src = start;
  return x;
}


x86 assembly (clang, -O0):
<_int_wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jge    1133 <_int_wrap+0x33>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_int_wrap>:
mov    (%rdi),%eax
lea    0x1(%rax),%ecx
cmp    %esi,%ecx
cmovl  %esi,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @_int_wrap(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* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
store i32 %7, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32*, i32** %3
store i32 %14, i32* %15
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @_int_wrap(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
%5 = icmp slt i32 %4, %1
%6 = select i1 %5, i32 %1, i32 %4
store i32 %6, i32* %0
ret i32 %3
}
void VMMGetSvnRev(void) {}


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

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

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

LLVM IR (-O2):
define void @VMMGetSvnRev() {
ret void
}
int test_imm_F2uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F2uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15859712
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int digitValue(char d) {
  int val = 0;
  switch (d) {
  case '0':
    val = 0;
    break;
  case '1':
    val = 1;
    break;
  case '2':
    val = 2;
    break;
  case '3':
    val = 3;
    break;
  case '4':
    val = 4;
    break;
  case '5':
    val = 5;
    break;
  case '6':
    val = 6;
    break;
  case '7':
    val = 7;
    break;
  }
  return val;
}


x86 assembly (clang, -O0):
<digitValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1196 <digitValue+0x96>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    1196 <digitValue+0x96>
movl   $0x1,-0x8(%rbp)
jmp    1196 <digitValue+0x96>
movl   $0x2,-0x8(%rbp)
jmp    1196 <digitValue+0x96>
movl   $0x3,-0x8(%rbp)
jmp    1196 <digitValue+0x96>
movl   $0x4,-0x8(%rbp)
jmp    1196 <digitValue+0x96>
movl   $0x5,-0x8(%rbp)
jmp    1196 <digitValue+0x96>
movl   $0x6,-0x8(%rbp)
jmp    1196 <digitValue+0x96>
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitValue>:
lea    -0x31(%rdi),%ecx
lea    -0x30(%rdi),%edx
xor    %eax,%eax
cmp    $0x7,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @digitValue(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %14 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
]
6: ; preds = %1
store i32 0, i32* %3
br label %14
7: ; preds = %1
store i32 1, i32* %3
br label %14
8: ; preds = %1
store i32 2, i32* %3
br label %14
9: ; preds = %1
store i32 3, i32* %3
br label %14
10: ; preds = %1
store i32 4, i32* %3
br label %14
11: ; preds = %1
store i32 5, i32* %3
br label %14
12: ; preds = %1
store i32 6, i32* %3
br label %14
13: ; preds = %1
store i32 7, i32* %3
br label %14
14: ; preds = %1, %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @digitValue(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -49
%4 = icmp ult i32 %3, 7
%5 = add nsw i32 %2, -48
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}