xunge/DecIR huggingface dataset:
void test2(int *b) { *b = 3; }


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

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

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

LLVM IR (-O2):
define void @test2(i32* nocapture writeonly %0) {
store i32 3, i32* %0
ret void
}
/* Variables and functions */
double get_counter();
int /*<<< orphan*/ start_counter();
double ovhd() {
  int i;
  double result;
  for (i = 0; i < 2; i++) {
    start_counter();
    result = get_counter();
  }
  return result;
}


x86 assembly (clang, -O0):
<ovhd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    115a <ovhd+0x3a>
mov    $0x0,%al
call   1030 <start_counter@plt>
mov    $0x0,%al
call   1040 <get_counter@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ovhd+0xf>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ovhd() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 (...) @start_counter()
%8 = call double (...) @get_counter()
store double %8, double* %2
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @ovhd() {
%1 = tail call i32 (...) @start_counter()
%2 = tail call double (...) @get_counter()
%3 = tail call i32 (...) @start_counter()
%4 = tail call double (...) @get_counter()
ret double %4
}
/* Variables and functions */
bool HAL_EEPROM_Has_Pending_Erase() { return false; }


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

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

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

LLVM IR (-O2):
define i32 @HAL_EEPROM_Has_Pending_Erase() {
ret i32 0
}
void RTVfsFileToIoStream(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsFileToIoStream() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void PrintMessage(const char *prefix, const char *fmt, va_list ap) {
  fflush(stdout);
  fputs(prefix, stderr);
  vfprintf(stderr, fmt, ap);
  fputs("\e[0m", stderr);
}


x86 assembly (clang, -O0):
<PrintMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <vfprintf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
lea    0xe78(%rip),%rdi
call   1030 <fputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintMessage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e8b(%rip),%rbx
mov    (%rbx),%esi
mov    %rbp,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1050 <vfprintf@plt>
mov    (%rbx),%esi
lea    0xe8b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [5 x i8] c"\1B[0m\00"
define void @PrintMessage(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i8*, i8** %4
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @vfprintf(i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [5 x i8] c"\1B[0m\00"
define void @PrintMessage(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fputs(i8* %0, i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @vfprintf(i32 %8, i8* %1, i32 %2)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}
/* Variables and functions */
int fsize(char const *);
int file_size(const char *fname, int len) { return fsize(fname); }


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

x86 assembly (clang, -O2):
<file_size>:
jmp    1030 <fsize@plt>

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

LLVM IR (-O2):
define i32 @file_size(i8* %0, i32 %1) {
%3 = tail call i32 @fsize(i8* %0)
ret i32 %3
}
void initgetstring(void) {}


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

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

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

LLVM IR (-O2):
define void @initgetstring() {
ret void
}
/* Variables and functions */
char *getLine();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", getLine());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getLine()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int compareInt(const void *a, const void *b) {
  int c = *((int *)a);
  int d = *((int *)b);
  return (c > d) - (c < d);
}


x86 assembly (clang, -O0):
<compareInt>:
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    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareInt>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compareInt(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* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @compareInt(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 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Type definitions */
typedef uintptr_t uint64_t;

/* Variables and functions */
uintptr_t UINT64_C(int);
uint64_t himult64(void *p) {
  uintptr_t k = ((uintptr_t)(p));
  return k * UINT64_C(11400712997709160919);
}


x86 assembly (clang, -O0):
<himult64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x5ea221d7,%edi
call   1030 <UINT64_C@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<himult64>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5ea221d7,%edi
call   1030 <UINT64_C@plt>
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @himult64(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 = call i64 @UINT64_C(i32 1587683799)
%8 = mul i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @himult64(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 @UINT64_C(i32 1587683799)
%4 = mul i64 %3, %2
ret i64 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;
struct serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_wb32(struct serializer *, int /*<<< orphan*/);
void s_wb64(struct serializer *s, uint64_t u64) {
  s_wb32(s, (uint32_t)(u64 >> 32));
  s_wb32(s, (uint32_t)u64);
  return;
}


x86 assembly (clang, -O0):
<s_wb64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <s_wb32@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <s_wb32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_wb64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <s_wb32@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <s_wb32@plt>

LLVM IR (-O0):
%struct.serializer = type { i32 }
define void @s_wb64(%struct.serializer* %0, i32 %1) {
%3 = alloca %struct.serializer*
%4 = alloca i32
store %struct.serializer* %0, %struct.serializer** %3
store i32 %1, i32* %4
%5 = load %struct.serializer*, %struct.serializer** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 32
%8 = call i32 @s_wb32(%struct.serializer* %5, i32 %7)
%9 = load %struct.serializer*, %struct.serializer** %3
%10 = load i32, i32* %4
%11 = call i32 @s_wb32(%struct.serializer* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.serializer = type { i32 }
define void @s_wb64(%struct.serializer* %0, i32 %1) {
%3 = tail call i32 @s_wb32(%struct.serializer* %0, i32 poison)
%4 = tail call i32 @s_wb32(%struct.serializer* %0, i32 %1)
ret void
}
void movCU(char *src, unsigned *dst) { *dst = *src; }


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

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

LLVM IR (-O0):
define void @movCU(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @movCU(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
store i32 %4, i32* %1
ret void
}
int _gnix_notifier_open(struct gnix_mr_notifier *mrn) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.gnix_mr_notifier = type opaque
define i32 @_gnix_notifier_open(%struct.gnix_mr_notifier* nocapture readnone %0) {
ret i32 0
}
int test_01(const char *x, const char *y) {
  return __builtin_strcmp(__builtin_assume_aligned(x, 4), y);
}


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

x86 assembly (clang, -O2):
<test_01>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @test_01(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned int c_int_hash(const void *v1) { return *(unsigned int *)v1; }


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

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

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

LLVM IR (-O2):
define i32 @c_int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void ceal_logg_init() {}


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

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

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

LLVM IR (-O2):
define void @ceal_logg_init() {
ret void
}
int res_ownok(dn) const char *dn;
{
  if (((dn[0]) == 0x2a)) {
    if (((dn[1]) == 0x2e))
      return (res_hnok(dn + 2));
    if (dn[1] == '\0')
      return (1);
  }
  return (res_hnok(dn));
}


x86 assembly (clang, -O0):
<res_ownok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1176 <res_ownok+0x66>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    1154 <res_ownok+0x44>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
mov    $0x0,%al
call   1030 <res_hnok@plt>
mov    %eax,-0x4(%rbp)
jmp    1184 <res_ownok+0x74>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1171 <res_ownok+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1184 <res_ownok+0x74>
jmp    1176 <res_ownok+0x66>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <res_hnok@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_ownok>:
cmpb   $0x2a,(%rdi)
jne    1124 <res_ownok+0x14>
mov    0x1(%rdi),%al
test   %al,%al
je     112b <res_ownok+0x1b>
cmp    $0x2e,%al
jne    1124 <res_ownok+0x14>
add    $0x2,%rdi
xor    %eax,%eax
jmp    1030 <res_hnok@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @res_ownok(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 42
br i1 %8, label %9, label %27
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 46
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @res_hnok to i32 (i8*, ...)*)(i8* %17)
store i32 %18, i32* %2
br label %30
19: ; preds = %9
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 1, i32* %2
br label %30
26: ; preds = %19
br label %27
27: ; preds = %26, %1
%28 = load i8*, i8** %3
%29 = call i32 (i8*, ...) bitcast (i32 (...)* @res_hnok to i32 (i8*, ...)*)(i8* %28)
store i32 %29, i32* %2
br label %30
30: ; preds = %27, %25, %15
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @res_ownok(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 42
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 46, label %7
i8 0, label %12
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
br label %9
9: ; preds = %1, %4, %7
%10 = phi i8* [ %8, %7 ], [ %0, %4 ], [ %0, %1 ]
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @res_hnok to i32 (i8*, ...)*)(i8* %10)
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ 1, %4 ], [ %11, %9 ]
ret i32 %13
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int64_t;

/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int64_t parse_number(const char *str, uint32_t min_val, uint32_t max_val) {
  uint32_t num;
  char *end;
  num = strtol(str, &end, 10);
  if (end == str || (num > max_val) || (num < min_val))
    return -1;
  return num;
}


x86 assembly (clang, -O0):
<parse_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1164 <parse_number+0x54>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     1164 <parse_number+0x54>
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1170 <parse_number+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <parse_number+0x67>
mov    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_number>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    %r15,%rax
mov    $0xffffffff,%edx
mov    %eax,%ecx
cmovl  %edx,%ecx
cmp    %r14,%rax
cmovg  %edx,%ecx
cmp    %rbx,0x8(%rsp)
cmove  %edx,%ecx
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @parse_number(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i64 @strtol(i8* %0, i8** %4, i32 10)
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, %0
%9 = icmp sgt i64 %6, %2
%10 = select i1 %8, i1 true, i1 %9
%11 = icmp slt i64 %6, %1
%12 = select i1 %10, i1 true, i1 %11
%13 = trunc i64 %6 to i32
%14 = select i1 %12, i32 -1, i32 %13
ret i32 %14
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *get_filename(const char *path) {
  char *s = strrchr(path, '/');
  return (s) ? s + 1 : path;
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <get_filename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <get_filename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @get_filename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int __gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
__gid_t __getegid() {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getegid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getegid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__getegid() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__getegid() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
int test_imm_55int64_highword_reg(long long val) {
  return ((val >> 32) & (0x55 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_55int64_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, 85
%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_55int64_highword_reg(i64 %0) {
%2 = and i64 %0, 365072220160
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 0;
  while (1) {
    scanf("%d", &i);
    if (i % 2) {
      return 0;
    } else {
      printf("Thank you for no. %d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1162 <main+0x42>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   $0x1,%sil
jne    117d <main+0x5d>
lea    0xeb0(%rip),%r14
lea    0xea6(%rip),%r15
lea    0xc(%rsp),%rbx
nop
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   $0x1,%sil
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"Thank you for no. %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %12
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
ret i32 0
9: ; preds = %3
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"Thank you for no. %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %8, %0
ret i32 0
8: ; preds = %0, %8
%9 = phi i32 [ %12, %8 ], [ %4, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = and i32 %12, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %8, label %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DDI16SetValBit(uint32_t ui32Base, uint32_t ui32Reg, bool bWriteHigh,
                    uint32_t ui32Mask, uint32_t ui32Val) {
  uint32_t ui32RegOffset;
  ;
  ;
  ;
  ;
  ui32RegOffset = 0x00000400 + (ui32Reg << 1) + (bWriteHigh ? 4 : 0);
  (*((volatile unsigned long *)(ui32Base + ui32RegOffset))) =
      (ui32Mask << 16) | ui32Val;
}


x86 assembly (clang, -O0):
<DDI16SetValBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x400,%eax
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    $0x4,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DDI16SetValBit>:
xor    %eax,%eax
test   %edx,%edx
setne  %al
shl    $0x10,%ecx
or     %r8d,%ecx
movslq %ecx,%rcx
lea    (%rdi,%rsi,2),%edx
lea    (%rdx,%rax,4),%eax
add    $0x400,%eax
cltq
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @DDI16SetValBit(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %7
%13 = shl i32 %12, 1
%14 = add nsw i32 1024, %13
%15 = load i32, i32* %8
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 4, i32 0
%19 = add nsw i32 %14, %18
store i32 %19, i32* %11
%20 = load i32, i32* %9
%21 = shl i32 %20, 16
%22 = load i32, i32* %10
%23 = or i32 %21, %22
%24 = sext i32 %23 to i64
%25 = load i32, i32* %6
%26 = load i32, i32* %11
%27 = add nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i64*
store volatile i64 %24, i64* %29
ret void
}

LLVM IR (-O2):
define void @DDI16SetValBit(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = shl i32 %1, 1
%7 = icmp eq i32 %2, 0
%8 = select i1 %7, i32 0, i32 4
%9 = shl i32 %3, 16
%10 = or i32 %9, %4
%11 = sext i32 %10 to i64
%12 = add i32 %0, 1024
%13 = add i32 %12, %6
%14 = add i32 %13, %8
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i64*
store volatile i64 %11, i64* %16
ret void
}
int remove_whitespace(char *s) {
  char *p, *q;
  for (p = s, q = s; *p; p++) {
    if (!(*p == ' ' || *p == '\t')) {
      *q++ = *p;
    }
  }
  *q = '\0';
  return (0);
}


x86 assembly (clang, -O0):
<remove_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1172 <remove_whitespace+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115c <remove_whitespace+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     115c <remove_whitespace+0x5c>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1161 <remove_whitespace+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <remove_whitespace+0x18>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_whitespace>:
mov    %rdi,%rax
jmp    1114 <remove_whitespace+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x9,%cl
je     1110 <remove_whitespace+0x10>
cmp    $0x20,%cl
je     1110 <remove_whitespace+0x10>
test   %cl,%cl
je     112d <remove_whitespace+0x2d>
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1110 <remove_whitespace+0x10>
movb   $0x0,(%rax)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @remove_whitespace(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %11
i8 32, label %8
i8 9, label %8
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %5, i8* %4
br label %8
8: ; preds = %2, %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %4
ret i32 0
}
/* Variables and functions */
double floor(double);
double hl_math_fround(double d) { return floor(d + 0.5); }


x86 assembly (clang, -O0):
<hl_math_fround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hl_math_fround>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @hl_math_fround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @hl_math_fround(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
void arm(void) {}


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

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

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

LLVM IR (-O2):
define void @arm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void sysError(const char *err) {
  fprintf(stdout, "Error: %s\n\n", err);
  exit(0);
}


x86 assembly (clang, -O0):
<sysError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sysError>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"Error: %s\0A\0A\00"
define void @sysError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"Error: %s\0A\0A\00"
define void @sysError(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ (*dtor_fn_t)(void *);

/* Variables and functions */
int /*<<< orphan*/ NRT_Free(void *);
int /*<<< orphan*/ nrt_debug_print(char *, void *);
void nrt_varsize_dtor(void *ptr, size_t size, void *info) {
  if (0) {
    nrt_debug_print("nrt_varsize_dtor %p\n", ptr);
  };
  if (info) {
    typedef void dtor_fn_t(void *ptr);
    dtor_fn_t *dtor = info;
    dtor(ptr);
  }
  NRT_Free(ptr);
}


x86 assembly (clang, -O0):
<nrt_varsize_dtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1141 <nrt_varsize_dtor+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rdi
call   1030 <NRT_Free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrt_varsize_dtor>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     111e <nrt_varsize_dtor+0xe>
mov    %rbx,%rdi
call   *%rdx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <NRT_Free@plt>

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

LLVM IR (-O2):
define void @nrt_varsize_dtor(i8* %0, i64 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = bitcast i8* %2 to void (i8*)*
tail call void %6(i8* %0)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @NRT_Free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef size_t uint32_t;

/* Variables and functions */
uint64_t ten_to_exp_for_decimal_notation(uint32_t exponent) {
  static const uint64_t ten_to_the[17] = {0,
                                          10,
                                          100,
                                          1000,
                                          10000,
                                          100000,
                                          1000000,
                                          10000000,
                                          100000000,
                                          1000000000,
                                          10000000000,
                                          100000000000,
                                          1000000000000,
                                          10000000000000,
                                          100000000000000,
                                          1000000000000000ul,
                                          10000000000000000ul};
  return ten_to_the[exponent];
}


x86 assembly (clang, -O0):
<ten_to_exp_for_decimal_notation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xeed(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ten_to_exp_for_decimal_notation>:
lea    0xef9(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@ten_to_exp_for_decimal_notation.ten_to_the = internal constant [17 x i32] [i32 0, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000, i32 1410065408, i32 1215752192, i32 -727379968, i32 1316134912, i32 276447232, i32 -1530494976, i32 1874919424]
define i32 @ten_to_exp_for_decimal_notation(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds [17 x i32], [17 x i32]* @ten_to_exp_for_decimal_notation.ten_to_the, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
@ten_to_exp_for_decimal_notation.ten_to_the = internal unnamed_addr constant [17 x i32] [i32 0, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000, i32 1410065408, i32 1215752192, i32 -727379968, i32 1316134912, i32 276447232, i32 -1530494976, i32 1874919424]
define i32 @ten_to_exp_for_decimal_notation(i64 %0) {
%2 = getelementptr inbounds [17 x i32], [17 x i32]* @ten_to_exp_for_decimal_notation.ten_to_the, i64 0, i64 %0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ COND_LE();
int /*<<< orphan*/ EA_A7_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sle_8_pi7(void) {
  m68ki_write_8(EA_A7_PI_8(), COND_LE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sle_8_pi7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_LE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sle_8_pi7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_LE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sle_8_pi7() {
%1 = call i32 (...) @EA_A7_PI_8()
%2 = call i64 (...) @COND_LE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sle_8_pi7() {
%1 = tail call i32 (...) @EA_A7_PI_8()
%2 = tail call i64 (...) @COND_LE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int clean_screen() {
  endwin();
  return 0;
  return -1;
}


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

x86 assembly (clang, -O2):
<clean_screen>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clean_screen() {
%1 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @clean_screen() {
%1 = tail call i32 (...) @endwin()
ret i32 0
}
void csolve_fold_all() {}


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

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

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

LLVM IR (-O2):
define void @csolve_fold_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 5;
  int *y = &x;
  printf("%i\n", *y);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int test_imm_FFint16_reg(short val) {
  return ((val) & (0xFF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FFint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 255
%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_FFint16_reg(i16 signext %0) {
%2 = and i16 %0, 255
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ rand_next();
float randf_next(void) { return (float)rand_next() / (float)0xffffffff; }


x86 assembly (clang, -O0):
<randf_next>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand_next@plt>
cvtsi2ss %rax,%xmm0
movss  0xed8(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf_next>:
push   %rax
xor    %eax,%eax
call   1030 <rand_next@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @randf_next() {
%1 = call i64 (...) @rand_next()
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 0x41F0000000000000
ret float %3
}

LLVM IR (-O2):
define float @randf_next() {
%1 = tail call i64 (...) @rand_next()
%2 = sitofp i64 %1 to float
%3 = fmul float %2, 0x3DF0000000000000
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ growTree(int);
int main() {
  int size;
  for (size = 1; size <= 11; size++) {
    switch (size) {
    case 4:
      growTree(4);
      break;
    case 7:
      growTree(7);
      break;
    case 11:
      growTree(11);
      break;
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jg     11a1 <main+0x91>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4,%eax
je     1166 <main+0x56>
jmp    1144 <main+0x34>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     1175 <main+0x65>
jmp    1155 <main+0x45>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     1184 <main+0x74>
jmp    118e <main+0x7e>
mov    $0x4,%edi
call   1030 <growTree@plt>
jmp    118e <main+0x7e>
mov    $0x7,%edi
call   1030 <growTree@plt>
jmp    118e <main+0x7e>
mov    $0xb,%edi
call   1030 <growTree@plt>
jmp    1193 <main+0x83>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <growTree@plt>
mov    $0x7,%edi
call   1030 <growTree@plt>
mov    $0xb,%edi
call   1030 <growTree@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @growTree(i32 4)
%2 = tail call i32 @growTree(i32 7)
%3 = tail call i32 @growTree(i32 11)
ret i32 0
}
double atof(const char *__nptr) {
  double return_value_strtod$1;
  return_value_strtod$1 = strtod(__nptr, ((char **)((void *)0)));
  return return_value_strtod$1;
}


x86 assembly (clang, -O0):
<atof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call double @strtod(i8* %4, i8** null)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i8** null)
ret double %2
}
/* Type definitions */
typedef scalar_t__ gid_t;

/* Variables and functions */
int setgid(scalar_t__);
void test(void) {
  gid_t gid;
  int result;
  gid = 0;
  result = setgid(gid);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <setgid@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
jmp    1030 <setgid@plt>

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @setgid(i64 0)
ret void
}
void handle_signal(int signum) { (void)signum; }


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

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

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

LLVM IR (-O2):
define void @handle_signal(i32 %0) {
ret void
}