xunge/DecIR huggingface dataset:
__attribute__((visibility("default"))) double trio_nzero(void) {
  volatile double zero = 0.0;
  return -zero;
}


x86 assembly (clang, -O0):
<trio_nzero>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_nzero>:
movq   $0x0,-0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
xorps  0xeea(%rip),%xmm0
ret

LLVM IR (-O0):
define double @trio_nzero() {
%1 = alloca double
store volatile double 0.000000e+00, double* %1
%2 = load volatile double, double* %1
%3 = fneg double %2
ret double %3
}

LLVM IR (-O2):
define double @trio_nzero() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double 0.000000e+00, double* %1
%3 = load volatile double, double* %1
%4 = fneg double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int _open(const char *pathname, int flags) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_open>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int rand();
int sc_randex(int bottom, int upper) {
  int value = rand() % upper;
  while (value < bottom) {
    value = rand() % upper;
  }
  return value;
}


x86 assembly (clang, -O0):
<sc_randex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114b <sc_randex+0x3b>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    112c <sc_randex+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_randex>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
cmp    %ebp,%edx
jl     1120 <sc_randex+0x10>
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sc_randex(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, %1
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %10
6: ; preds = %2, %6
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, %1
%9 = icmp slt i32 %8, %0
br i1 %9, label %6, label %10
10: ; preds = %6, %2
%11 = phi i32 [ %4, %2 ], [ %8, %6 ]
ret i32 %11
}
/* Variables and functions */
void __aeabi_memclr(void *dest, size_t n) {
  extern void __aeabi_memset(void *dest, size_t n, int c);
  __aeabi_memset(dest, n, 0);
}


x86 assembly (clang, -O0):
<__aeabi_memclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <__aeabi_memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memclr>:
xor    %edx,%edx
jmp    1030 <__aeabi_memset@plt>

LLVM IR (-O0):
define void @__aeabi_memclr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @__aeabi_memclr(i8* %0, i64 %1) {
tail call void @__aeabi_memset(i8* %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_ensemble_to_file(char *);
void save_ensemble(char *filename) { write_ensemble_to_file(filename); }


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

x86 assembly (clang, -O2):
<save_ensemble>:
jmp    1030 <write_ensemble_to_file@plt>

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

LLVM IR (-O2):
define void @save_ensemble(i8* %0) {
%2 = tail call i32 @write_ensemble_to_file(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getline(char *, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char line[1024];
  getline(line, 1024);
  puts(line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getline@plt>
lea    -0x410(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <getline@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1024)
%4 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_FREEZE;
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoFreeze(int fd) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_FREEZE)) < 0) {
    perror("VIDEO FREEZE: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoFreeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1160 <videoFreeze+0x40>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <videoFreeze+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoFreeze>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     1139 <videoFreeze+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_FREEZE = global i32 0
@.str = [15 x i8] c"VIDEO FREEZE: \00"
define i32 @videoFreeze(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @VIDEO_FREEZE
%7 = call i32 @ioctl(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@VIDEO_FREEZE = global i32 0
@.str = [15 x i8] c"VIDEO FREEZE: \00"
define i32 @videoFreeze(i32 %0) {
%2 = load i32, i32* @VIDEO_FREEZE
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
long hash(char *word) {
  int count = 0;
  long hash = 42;
  do {
    hash = hash + word[count] * (count + 1);
  } while (count++ < strlen(word));
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x2a,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jl     112b <hash+0x1b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x2a,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl -0x1(%r14,%rbx,1),%eax
imul   %ebx,%eax
cltq
add    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
lea    0x1(%rbx),%rcx
add    $0xffffffffffffffff,%rbx
cmp    %rax,%rbx
mov    %rcx,%rbx
jl     1130 <hash+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @hash(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = phi i64 [ %12, %2 ], [ 42, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = add nuw nsw i64 %3, 1
%9 = mul i64 %8, %7
%10 = shl i64 %9, 32
%11 = ashr exact i64 %10, 32
%12 = add nsw i64 %4, %11
%13 = tail call i32 @strlen(i8* %0)
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %3, %14
br i1 %15, label %2, label %16
16: ; preds = %2
ret i64 %12
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void assign_implicit_cast_ok() {
  bool *b = (bool *)malloc(sizeof(bool));
  uint16_t i = 1;
  if (b) {
    *b = true;
    *b = !i;
    if (*b) {
      int *p = 0;
      *p = 5;
    }
    free(b);
  }
}


x86 assembly (clang, -O0):
<assign_implicit_cast_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118e <assign_implicit_cast_ok+0x6e>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1185 <assign_implicit_cast_ok+0x65>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_implicit_cast_ok>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <assign_implicit_cast_ok+0x1f>
movl   $0x0,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @assign_implicit_cast_ok() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %0
store i32 0, i32* %2
%5 = tail call i32 @free(i32* %2)
br label %6
6: ; preds = %4, %0
ret void
}
int isnumeric(int c) { return (c >= '0' && c <= '9') ? 1 : 0; }


x86 assembly (clang, -O0):
<isnumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isnumeric+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumeric>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isnumeric(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @isnumeric(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ islower(int);
int isalpha(int c) { return (('A' <= c && c <= 'Z') || islower(c)); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1138 <isalpha+0x28>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    114a <isalpha+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
lea    -0x41(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1a,%ecx
jb     1132 <isalpha+0x22>
push   %rax
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %12, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i64 @islower(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ true, %5 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
int next_dn(int i) {
  int r = i - 1;
  if (r < 0)
    r = 16 - 1;
  return r;
}


x86 assembly (clang, -O0):
<next_dn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1121 <next_dn+0x21>
movl   $0xf,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_dn>:
lea    -0x1(%rdi),%ecx
test   %edi,%edi
mov    $0xf,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @next_dn(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 15, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ spin_rotor(char *);
void reset_rotor(char *rotor) {
  while (rotor[0] != '#') {
    spin_rotor(rotor);
  }
}


x86 assembly (clang, -O0):
<reset_rotor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     113a <reset_rotor+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <spin_rotor@plt>
jmp    111c <reset_rotor+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_rotor>:
push   %rbx
cmpb   $0x23,(%rdi)
je     112d <reset_rotor+0x1d>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <spin_rotor@plt>
cmpb   $0x23,(%rbx)
jne    1120 <reset_rotor+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @reset_rotor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 35
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = call i32 @spin_rotor(i8* %10)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @reset_rotor(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 @spin_rotor(i8* %0)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 35
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CPROVER_assume(int /*<<< orphan*/);
int /*<<< orphan*/ __CPROVER_isfinite(double);
int /*<<< orphan*/ assert(int);
int main() {
  double d, q, r;
  __CPROVER_assume(__CPROVER_isfinite(q));
  d = q;
  r = d + 0;
  assert(r == d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  -0x10(%rbp),%xmm0
call   1030 <__CPROVER_isfinite@plt>
mov    %eax,%edi
call   1040 <__CPROVER_assume@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <__CPROVER_isfinite@plt>
mov    %eax,%edi
call   1040 <__CPROVER_assume@plt>
xor    %edi,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = load double, double* %2
%5 = call i32 @__CPROVER_isfinite(double %4)
%6 = call i32 @__CPROVER_assume(i32 %5)
%7 = load double, double* %2
store double %7, double* %1
%8 = load double, double* %1
%9 = fadd double %8, 0.000000e+00
store double %9, double* %3
%10 = load double, double* %3
%11 = load double, double* %1
%12 = fcmp oeq double %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CPROVER_isfinite(double undef)
%2 = tail call i32 @__CPROVER_assume(i32 %1)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
struct mono_time {
  int dummy;
};

/* Variables and functions */
scalar_t__ mono_time_cmp(struct mono_time const *, struct mono_time const *);
int mono_time_after(const struct mono_time *t1, const struct mono_time *t2) {
  return mono_time_cmp(t1, t2) > 0;
}


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

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

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

LLVM IR (-O2):
%struct.mono_time = type { i32 }
define i32 @mono_time_after(%struct.mono_time* %0, %struct.mono_time* %1) {
%3 = tail call i64 @mono_time_cmp(%struct.mono_time* %0, %struct.mono_time* %1)
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void print_timestamp_ext(char *message, char *mode) {}


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

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

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

LLVM IR (-O2):
define void @print_timestamp_ext(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int write(int, char *, int);
void safewrite(int fd, char *buf, int n) {
  int i, j;
  i = 0;
  do {
    j = write(fd, &buf[i], n);
    i += j;
    n -= j;
  } while (n);
}


x86 assembly (clang, -O0):
<safewrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1129 <safewrite+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safewrite>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %ebp,%rbp
lea    (%r14,%rbp,1),%rsi
mov    %r15d,%edi
mov    %ebx,%edx
call   1030 <write@plt>
add    %eax,%ebp
sub    %eax,%ebx
jne    1130 <safewrite+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @safewrite(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ 0, %3 ], [ %10, %4 ]
%6 = phi i32 [ %2, %3 ], [ %11, %4 ]
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = tail call i32 @write(i32 %0, i8* %8, i32 %6)
%10 = add nsw i32 %9, %5
%11 = sub nsw i32 %6, %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ have_decent_term();
int /*<<< orphan*/ stderr;
void print_bold(const char *str) {
  if (have_decent_term())
    fprintf(stderr, "\n\033[1m%s\033[0m\n", str);
  else
    fprintf(stderr, "\n%s\n", str);
}


x86 assembly (clang, -O0):
<print_bold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <have_decent_term@plt>
cmp    $0x0,%rax
je     115b <print_bold+0x3b>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1174 <print_bold+0x54>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bold>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <have_decent_term@plt>
test   %rax,%rax
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rax
lea    0xebb(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"\0A\1B[1m%s\1B[0m\0A\00"
@.str.1 = [5 x i8] c"\0A%s\0A\00"
define void @print_bold(i8* %0) {
%2 = tail call i64 (...) @have_decent_term()
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @stderr
%5 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %4, i8* %5, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *, int *, int);
void mallocInt() {
  size_t size = sizeof(int);
  int *pi = (int *)malloc(size);
  printf("pi=%p, *pi=%d \n", pi, *pi);
  *pi = 9;
  printf("pi=%p, *pi=%d \n", pi, *pi);
  free(pi);
  pi = NULL;
}


x86 assembly (clang, -O0):
<mallocInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocInt>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    (%rax),%edx
lea    0xeb6(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
movl   $0x9,(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x9,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"pi=%p, *pi=%d \0A\00"
define void @mallocInt() {
%1 = alloca i64
%2 = alloca i32*
store i64 4, i64* %1
%3 = load i64, i64* %1
%4 = call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %6, i32 %8)
%10 = load i32*, i32** %2
store i32 9, i32* %10
%11 = load i32*, i32** %2
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %11, i32 %13)
%15 = load i32*, i32** %2
%16 = call i32 @free(i32* %15)
store i32* null, i32** %2
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"pi=%p, *pi=%d \0A\00"
define void @mallocInt() {
%1 = tail call i64 @malloc(i64 4)
%2 = inttoptr i64 %1 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %2, i32 %3)
store i32 9, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %2, i32 9)
%6 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTFIFOEnable(unsigned long ulBase) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          572);
    }
  };
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<UARTFIFOEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    114f <UARTFIFOEnable+0x2f>
lea    0xebb(%rip),%rdi
mov    $0x23c,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x2c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOEnable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    113e <UARTFIFOEnable+0x1e>
lea    0xecc(%rip),%rdi
mov    $0x23c,%esi
call   1030 <AssertFailure@plt>
orq    $0x10,0x2c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTFIFOEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 572)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = add i64 %9, 44
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, 16
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTFIFOEnable(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 572)
br label %6
6: ; preds = %4, %1
%7 = add i64 %0, 44
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 16
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHIFTREG_ENC_3_SetIntMode(unsigned int);
void SHIFTREG_ENC_3_Init(void) { SHIFTREG_ENC_3_SetIntMode((2u)); }


x86 assembly (clang, -O0):
<SHIFTREG_ENC_3_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SHIFTREG_ENC_3_SetIntMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHIFTREG_ENC_3_Init>:
mov    $0x2,%edi
jmp    1030 <SHIFTREG_ENC_3_SetIntMode@plt>

LLVM IR (-O0):
define void @SHIFTREG_ENC_3_Init() {
%1 = call i32 @SHIFTREG_ENC_3_SetIntMode(i32 2)
ret void
}

LLVM IR (-O2):
define void @SHIFTREG_ENC_3_Init() {
%1 = tail call i32 @SHIFTREG_ENC_3_SetIntMode(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ next_no_space();
int parse_num();
int skip_next_num() {
  int r;
  next_no_space();
  r = parse_num();
  next_no_space();
  return r;
}


x86 assembly (clang, -O0):
<skip_next_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <next_no_space@plt>
mov    $0x0,%al
call   1040 <parse_num@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <next_no_space@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_next_num>:
push   %rbx
xor    %eax,%eax
call   1030 <next_no_space@plt>
xor    %eax,%eax
call   1040 <parse_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <next_no_space@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @skip_next_num() {
%1 = alloca i32
%2 = call i32 (...) @next_no_space()
%3 = call i32 (...) @parse_num()
store i32 %3, i32* %1
%4 = call i32 (...) @next_no_space()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @skip_next_num() {
%1 = tail call i32 (...) @next_no_space()
%2 = tail call i32 (...) @parse_num()
%3 = tail call i32 (...) @next_no_space()
ret i32 %2
}
void nand_addr(unsigned long addr) {
  unsigned long row = addr / 2048;
  unsigned long column = addr % 2048;
  *((volatile unsigned long *)0x7020000C) = column & 0xFF;
  *((volatile unsigned long *)0x7020000C) = (column >> 8) & 0xFF;
  *((volatile unsigned long *)0x7020000C) = row & 0xFF;
  *((volatile unsigned long *)0x7020000C) = (row >> 8) & 0xFF;
  *((volatile unsigned long *)0x7020000C) = (row >> 16) & 0xFF;
}


x86 assembly (clang, -O0):
<nand_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xb,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7ff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
and    $0xff,%rcx
mov    $0x7020000c,%eax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
shr    $0x8,%rcx
and    $0xff,%rcx
mov    $0x7020000c,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
and    $0xff,%rcx
mov    $0x7020000c,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
shr    $0x8,%rcx
and    $0xff,%rcx
mov    $0x7020000c,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
shr    $0x10,%rcx
and    $0xff,%rcx
mov    $0x7020000c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_addr>:
mov    %edi,%eax
shr    $0xb,%eax
movzbl %al,%eax
movzbl %dil,%ecx
mov    %rcx,0x7020000c
70
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0x7,%ecx
mov    %rcx,0x7020000c
70
mov    %rax,0x7020000c
70
mov    %edi,%eax
shr    $0x13,%eax
movzbl %al,%eax
mov    %rax,0x7020000c
70
shr    $0x1b,%rdi
movzbl %dil,%eax
mov    %rax,0x7020000c
70
ret

LLVM IR (-O0):
define void @nand_addr(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = udiv i64 %5, 2048
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = urem i64 %7, 2048
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = and i64 %9, 255
store volatile i64 %10, i64* inttoptr (i64 1881145356 to i64*)
%11 = load i64, i64* %4
%12 = lshr i64 %11, 8
%13 = and i64 %12, 255
store volatile i64 %13, i64* inttoptr (i64 1881145356 to i64*)
%14 = load i64, i64* %3
%15 = and i64 %14, 255
store volatile i64 %15, i64* inttoptr (i64 1881145356 to i64*)
%16 = load i64, i64* %3
%17 = lshr i64 %16, 8
%18 = and i64 %17, 255
store volatile i64 %18, i64* inttoptr (i64 1881145356 to i64*)
%19 = load i64, i64* %3
%20 = lshr i64 %19, 16
%21 = and i64 %20, 255
store volatile i64 %21, i64* inttoptr (i64 1881145356 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_addr(i64 %0) {
%2 = lshr i64 %0, 11
%3 = and i64 %0, 255
store volatile i64 %3, i64* inttoptr (i64 1881145356 to i64*)
%4 = lshr i64 %0, 8
%5 = and i64 %4, 7
store volatile i64 %5, i64* inttoptr (i64 1881145356 to i64*)
%6 = and i64 %2, 255
store volatile i64 %6, i64* inttoptr (i64 1881145356 to i64*)
%7 = lshr i64 %0, 19
%8 = and i64 %7, 255
store volatile i64 %8, i64* inttoptr (i64 1881145356 to i64*)
%9 = lshr i64 %0, 27
%10 = and i64 %9, 255
store volatile i64 %10, i64* inttoptr (i64 1881145356 to i64*)
ret void
}
/* Type definitions */
struct timeb {
  int time;
  int millitm;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
unsigned int get_time(void) {
  struct timeb tb;
  unsigned int realNow;
  (void)ftime(&tb);
  realNow = (unsigned int)(((tb.time % 4290) * 1000000) + (tb.millitm * 1000));
  return (realNow);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <ftime@plt>
mov    -0x8(%rbp),%eax
mov    $0x10c2,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
imul   $0x3e8,-0x4(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
mov    %rsp,%rdi
call   1030 <ftime@plt>
movslq (%rsp),%rax
imul   $0x3d1b1783,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
imul   $0x10c2,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%ecx
imul   $0x3e8,0x4(%rsp),%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeb = type { i32, i32 }
define i32 @get_time() {
%1 = alloca %struct.timeb
%2 = alloca i32
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = srem i32 %5, 4290
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = add nsw i32 %7, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.timeb = type { i32, i32 }
define i32 @get_time() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = srem i32 %5, 4290
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void spacer(int n, int c) {
  int i;
  for (i = 0; i < n; i++)
    printf("%c", (char)c);
}


x86 assembly (clang, -O0):
<spacer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <spacer+0x41>
mov    -0x8(%rbp),%eax
lea    0xec5(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <spacer+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spacer>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    113f <spacer+0x2f>
mov    %edi,%ebx
movsbl %sil,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <spacer+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @spacer(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 = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %4
%12 = trunc i32 %11 to i8
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @spacer(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = trunc i32 %1 to i8
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %9, %6 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
int getLength(char str[]) {
  int count = 0;
  while (str[count] != '\0')
    count++;
  return count;
}


x86 assembly (clang, -O0):
<getLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <getLength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <getLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @getLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void hashmap_dump_stats(int pnum) {}


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

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

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

LLVM IR (-O2):
define void @hashmap_dump_stats(i32 %0) {
ret void
}
int test_imm_49uint8_reg(unsigned char val) {
  return ((val) & (0x49 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_49uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x49,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_49uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 73
%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_49uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 73
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_int(char);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x;
  char y;
  x = 123456;
  y = x;
  print_int(x);
  print_string("\n");
  print_int(y);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1e240,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1040 <print_int@plt>
lea    0xeb9(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x5(%rbp),%edi
call   1040 <print_int@plt>
lea    0xea4(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40,%edi
call   1040 <print_int@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    $0x40,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
store i32 123456, i32* %1
%3 = load i32, i32* %1
%4 = trunc i32 %3 to i8
store i8 %4, i8* %2
%5 = load i32, i32* %1
%6 = trunc i32 %5 to i8
%7 = call i32 @print_int(i8 signext %6)
%8 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i8, i8* %2
%10 = call i32 @print_int(i8 signext %9)
%11 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_int(i8 signext 64)
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_int(i8 signext 64)
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintRTF(char *);
void CmdTabjump(void) { fprintRTF("\\tab\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"\\tab\0A\00"
define void @CmdTabjump() {
%1 = call i32 @fprintRTF(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\\tab\0A\00"
define void @CmdTabjump() {
%1 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels48_10_avx2() {
ret void
}
XUngrabButton() {}


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

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

LLVM IR (-O0):
define i32 @XUngrabButton() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XUngrabButton() {
ret i32 undef
}