xunge/DecIR huggingface dataset:
void illegal(void) {}


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

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

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

LLVM IR (-O2):
define void @illegal() {
ret void
}
void gdk_screen_get_default_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_default_colormap() {
ret void
}
/* Variables and functions */
char const *_mpw_getline(char const *, int);
const char *mpw_getpass(const char *prompt) {
  return _mpw_getline(prompt, true);
}


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

x86 assembly (clang, -O2):
<mpw_getpass>:
mov    $0x1,%esi
jmp    1030 <_mpw_getline@plt>

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

LLVM IR (-O2):
define i8* @mpw_getpass(i8* %0) {
%2 = tail call i8* @_mpw_getline(i8* %0, i32 1)
ret i8* %2
}
void g_rand_set_seed() {}


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

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

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

LLVM IR (-O2):
define void @g_rand_set_seed() {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void _quick_sort(int *pdata, int begin, int end) {
  int pos;
  if (begin < end) {
    pos = partition(pdata, begin, end);
    _quick_sort(pdata, begin, pos - 1);
    _quick_sort(pdata, pos + 1, end);
  }
}


x86 assembly (clang, -O0):
<_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <_quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <_quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <_quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @_quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fsync(int /*<<< orphan*/);
void flush_stream(FILE *fptr) {
  fflush(fptr);
  fsync(fileno(fptr));
}


x86 assembly (clang, -O0):
<flush_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
call   1050 <fsync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_stream>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fflush@plt>
mov    %rbx,%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <fsync@plt>

LLVM IR (-O0):
define void @flush_stream(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fflush(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fileno(i32* %5)
%7 = call i32 @fsync(i32 %6)
ret void
}

LLVM IR (-O2):
define void @flush_stream(i32* nocapture %0) {
%2 = tail call i32 @fflush(i32* %0)
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call i32 @fsync(i32 %3)
ret void
}
void exceptionHandler(int tt, unsigned long routine) {
  unsigned long *tb = (unsigned long *)0x40;
  tb[tt] = ((routine >> 2) | 0xff000000) - tt - (0x40 >> 2);
}


x86 assembly (clang, -O0):
<exceptionHandler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x40,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
shr    $0x2,%rdx
movabs $0xff000000,%rax
or     %rax,%rdx
movslq -0x4(%rbp),%rax
sub    %rax,%rdx
sub    $0x10,%rdx
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exceptionHandler>:
shr    $0x2,%rsi
mov    $0xff000000,%eax
or     %rsi,%rax
movslq %edi,%rcx
sub    %rcx,%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,0x40(,%rcx,8)
ret

LLVM IR (-O0):
define void @exceptionHandler(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i32 %0, i32* %3
store i64 %1, i64* %4
store i64* inttoptr (i64 64 to i64*), i64** %5
%6 = load i64, i64* %4
%7 = lshr i64 %6, 2
%8 = or i64 %7, 4278190080
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = sub i64 %8, %10
%12 = sub i64 %11, 16
%13 = load i64*, i64** %5
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %13, i64 %15
store i64 %12, i64* %16
ret void
}

LLVM IR (-O2):
define void @exceptionHandler(i32 %0, i64 %1) {
%3 = lshr i64 %1, 2
%4 = or i64 %3, 4278190080
%5 = sext i32 %0 to i64
%6 = sub nsw i64 -16, %5
%7 = add nsw i64 %6, %4
%8 = getelementptr inbounds i64, i64* inttoptr (i64 64 to i64*), i64 %5
store i64 %7, i64* %8
ret void
}
int fun1164() { return 1164; }


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

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

LLVM IR (-O0):
define i32 @fun1164() {
ret i32 1164
}

LLVM IR (-O2):
define i32 @fun1164() {
ret i32 1164
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
void memcmp1() {
  char a[] = {1, 2, 3, 4};
  char b[10] = {0};
  memcmp(a, b, 5);
}


x86 assembly (clang, -O0):
<memcmp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rdi
lea    -0xe(%rbp),%rsi
mov    $0x5,%edx
call   1040 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp1>:
sub    $0x18,%rsp
movl   $0x4030201,0x4(%rsp)
04
movw   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.memcmp1.a = [4 x i8] c"\01\02\03\04"
define void @memcmp1() {
%1 = alloca [4 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @memcmp(i8* %5, i8* %6, i32 5)
ret void
}

LLVM IR (-O2):
define void @memcmp1() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcmp(i8* %3, i8* %4, i32 5)
ret void
}
void LOG_TRACE(char *target, char *fmt, ...) {}


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

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

LLVM IR (-O0):
define void @LOG_TRACE(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 @LOG_TRACE(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ CopyToVRAM(int /*<<< orphan*/ volatile *,
                              int /*<<< orphan*/ const *, int);
void LoadTileData(int charblock, int first_tile, const void *data,
                  int data_bytes) {
  CopyToVRAM(((volatile uint16_t *)(0x6000000)) + (charblock * 8192) +
                 (first_tile * 32),
             (const uint16_t *)data, data_bytes / 2);
}


x86 assembly (clang, -O0):
<LoadTileData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
cltq
mov    $0x6000000,%edi
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <CopyToVRAM@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadTileData>:
shl    $0xd,%edi
movslq %edi,%rax
shl    $0x5,%esi
movslq %esi,%rsi
shl    $0x2,%rsi
lea    (%rsi,%rax,4),%rdi
add    $0x6000000,%rdi
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <CopyToVRAM@plt>

LLVM IR (-O0):
define void @LoadTileData(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 8192
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %11
%13 = load i32, i32* %6
%14 = mul nsw i32 %13, 32
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i8*, i8** %7
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %8
%20 = sdiv i32 %19, 2
%21 = call i32 @CopyToVRAM(i32* %16, i32* %18, i32 %20)
ret void
}

LLVM IR (-O2):
define void @LoadTileData(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = shl nsw i32 %0, 13
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %6
%8 = shl nsw i32 %1, 5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = bitcast i8* %2 to i32*
%12 = sdiv i32 %3, 2
%13 = tail call i32 @CopyToVRAM(i32* %10, i32* %11, i32 %12)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int between(uint32_t seq1, uint32_t seq2, uint32_t seq3) {
  return seq3 - seq2 > seq1 - seq2;
}


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<between>:
xor    %eax,%eax
cmp    %rdi,%rdx
setg   %al
ret

LLVM IR (-O0):
define i32 @between(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = sub nsw i64 %7, %8
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = sub nsw i64 %10, %11
%13 = icmp sgt i64 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @between(i64 %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %2, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *getvalue(int *argip, int argc, char *argv[]) {
  if (*argip >= argc) {
    fprintf(stderr, "Expected an option value\n");
    exit(1);
  }
  return argv[(*argip)++];
}


x86 assembly (clang, -O0):
<getvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jl     1161 <getvalue+0x41>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getvalue>:
push   %rax
movslq (%rdi),%rax
cmp    %esi,%eax
jge    1133 <getvalue+0x13>
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
mov    (%rdx,%rax,8),%rax
pop    %rcx
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Expected an option value\0A\00"
define i8* @getvalue(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
%16 = load i8**, i8*** %6
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
%20 = sext i32 %18 to i64
%21 = getelementptr inbounds i8*, i8** %16, i64 %20
%22 = load i8*, i8** %21
ret i8* %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Expected an option value\0A\00"
define i8* @getvalue(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, %1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
%11 = add nsw i32 %4, 1
store i32 %11, i32* %0
%12 = sext i32 %4 to i64
%13 = getelementptr inbounds i8*, i8** %2, i64 %12
%14 = load i8*, i8** %13
ret i8* %14
}
void termop_setmode(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      425, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_setmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1a9,%r8d
lea    0xf37(%rip),%r9
lea    0xf3f(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_setmode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf66(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1a9,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_setmode = [15 x i8] c"termop_setmode\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_setmode(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 425, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_setmode, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_setmode = [15 x i8] c"termop_setmode\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_setmode(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 425, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_setmode, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_andrr(int, int);
int /*<<< orphan*/ ra_mchange(int, int);
int ra_mgetv(int);
void co_and(int ra, int rb, int rc) {
  int mab, mc;
  mab = ra_mgetv(rb);
  mc = ra_mgetv(rc);
  ra_mchange(mab, ra);
  e_andrr(mab, mc);
}


x86 assembly (clang, -O0):
<co_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ra_mgetv@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ra_mgetv@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <ra_mchange@plt>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <e_andrr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_and>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
mov    %esi,%edi
call   1040 <ra_mgetv@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <ra_mgetv@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <ra_mchange@plt>
mov    %ebp,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <e_andrr@plt>

LLVM IR (-O0):
define void @co_and(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @ra_mgetv(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @ra_mgetv(i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %7
%14 = load i32, i32* %4
%15 = call i32 @ra_mchange(i32 %13, i32 %14)
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @e_andrr(i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @co_and(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ra_mgetv(i32 %1)
%5 = tail call i32 @ra_mgetv(i32 %2)
%6 = tail call i32 @ra_mchange(i32 %4, i32 %0)
%7 = tail call i32 @e_andrr(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int mywrite(int, char *, int, int /*<<< orphan*/);
int read(int, char *, int);
int echoSilently(int from, int to) {
  char buff[1024];
  int bytesIn = 0, bytesOut = 0;
  bytesIn = read(from, buff, 1024);
  if (bytesIn <= 0) {
    return bytesIn;
  }
  bytesOut = mywrite(to, buff, bytesIn, 0);
  return bytesOut;
}


x86 assembly (clang, -O0):
<echoSilently>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x414(%rbp)
movl   $0x0,-0x418(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0x414(%rbp)
cmpl   $0x0,-0x414(%rbp)
jg     117a <echoSilently+0x5a>
mov    -0x414(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11a0 <echoSilently+0x80>
mov    -0xc(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
xor    %ecx,%ecx
call   1030 <mywrite@plt>
mov    %eax,-0x418(%rbp)
mov    -0x418(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoSilently>:
push   %rbx
sub    $0x400,%rsp
mov    %esi,%ebx
mov    %rsp,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1149 <echoSilently+0x29>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <mywrite@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @echoSilently(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%11 = call i32 @read(i32 %9, i8* %10, i32 1024)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* %7
store i32 %15, i32* %3
br label %22
16: ; preds = %2
%17 = load i32, i32* %5
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%19 = load i32, i32* %7
%20 = call i32 @mywrite(i32 %17, i8* %18, i32 %19, i32 0)
store i32 %20, i32* %8
%21 = load i32, i32* %8
store i32 %21, i32* %3
br label %22
22: ; preds = %16, %14
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @echoSilently(i32 %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 1024)
%6 = icmp slt i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @mywrite(i32 %1, i8* %4, i32 %5, i32 0)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage: %s [-v] [-n] -h <heads> -s <sectors> -o <outputfile> [-a "
          "0..4] [-l <align kB>] [[-t <type>] -p <size>...] \n",
          prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
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>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [115 x i8] c"Usage: %s [-v] [-n] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [-l <align kB>] [[-t <type>] -p <size>...] \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [115 x i8] c"Usage: %s [-v] [-n] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [-l <align kB>] [[-t <type>] -p <size>...] \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(size_t);
size_t next_prime(size_t candidate) {
  if (candidate < 10)
    candidate = 10;
  candidate |= 1;
  while (!is_prime(candidate))
    candidate += 2;
  return candidate;
}


x86 assembly (clang, -O0):
<next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xa,-0x8(%rbp)
jae    112f <next_prime+0x1f>
movq   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1159 <next_prime+0x49>
jmp    116a <next_prime+0x5a>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    113b <next_prime+0x2b>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_prime>:
push   %rbx
cmp    $0xb,%rdi
mov    $0xa,%ebx
cmovae %rdi,%rbx
or     $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <is_prime@plt>
add    $0x2,%rbx
test   %eax,%eax
je     1130 <next_prime+0x20>
add    $0xfffffffffffffffe,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @next_prime(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 10, i64* %2
br label %6
6: ; preds = %5, %1
%7 = load i64, i64* %2
%8 = or i64 %7, 1
store i64 %8, i64* %2
br label %9
9: ; preds = %14, %6
%10 = load i64, i64* %2
%11 = call i32 @is_prime(i64 %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i64, i64* %2
%16 = add i64 %15, 2
store i64 %16, i64* %2
br label %9
17: ; preds = %9
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
define i64 @next_prime(i64 %0) {
%2 = icmp ugt i64 %0, 10
%3 = select i1 %2, i64 %0, i64 10
%4 = or i64 %3, 1
br label %5
5: ; preds = %5, %1
%6 = phi i64 [ %4, %1 ], [ %9, %5 ]
%7 = tail call i32 @is_prime(i64 %6)
%8 = icmp eq i32 %7, 0
%9 = add i64 %6, 2
br i1 %8, label %5, label %10
10: ; preds = %5
ret i64 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ROTR(int, int, int);
uint32_t BIGS1(uint32_t x) {
  return ROTR(x, 6, 32) ^ ROTR(x, 11, 32) ^ ROTR(x, 25, 32);
}


x86 assembly (clang, -O0):
<BIGS1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x19,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIGS1>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x6,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xb,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
mov    %ebx,%edi
mov    $0x19,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @BIGS1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ROTR(i32 %3, i32 6, i32 32)
%5 = load i32, i32* %2
%6 = call i32 @ROTR(i32 %5, i32 11, i32 32)
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @ROTR(i32 %8, i32 25, i32 32)
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @BIGS1(i32 %0) {
%2 = tail call i32 @ROTR(i32 %0, i32 6, i32 32)
%3 = tail call i32 @ROTR(i32 %0, i32 11, i32 32)
%4 = xor i32 %3, %2
%5 = tail call i32 @ROTR(i32 %0, i32 25, i32 32)
%6 = xor i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ longjmp(unsigned long, int);
void e7(long unsigned int gr) { longjmp(gr, 1); }


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

x86 assembly (clang, -O2):
<e7>:
mov    $0x1,%esi
jmp    1030 <longjmp@plt>

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

LLVM IR (-O2):
define void @e7(i64 %0) {
%2 = tail call i32 @longjmp(i64 %0, i32 1)
ret void
}
void stellaris_fault(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<stellaris_fault>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <stellaris_fault+0x9>
jmp    1109 <stellaris_fault+0x9>

x86 assembly (clang, -O2):
<stellaris_fault>:
jmp    1100 <stellaris_fault>

LLVM IR (-O0):
define void @stellaris_fault() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @stellaris_fault() {
br label %1
1: ; preds = %0, %1
br label %1
}
void nfs_fscache_reset_cookie(struct inode *inode) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @nfs_fscache_reset_cookie(%struct.inode* nocapture %0) {
ret void
}
/* Variables and functions */
double curr_time();
int /*<<< orphan*/ printf(char *, double);
void now() { printf("now %f\n", curr_time()); }


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <curr_time@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
push   %rax
xor    %eax,%eax
call   1040 <curr_time@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"now %f\0A\00"
define void @now() {
%1 = call double (...) @curr_time()
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"now %f\0A\00"
define void @now() {
%1 = tail call double (...) @curr_time()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
long long int Sanitize(long long int calc) {
  while (calc < 0)
    calc += (int)(1e9 + 7);
  calc %= (int)(1e9 + 7);
  return calc;
}


x86 assembly (clang, -O0):
<Sanitize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1126 <Sanitize+0x26>
mov    -0x8(%rbp),%rax
add    $0x3b9aca07,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <Sanitize+0x8>
mov    -0x8(%rbp),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sanitize>:
xor    %eax,%eax
test   %rdi,%rdi
cmovg  %rdi,%rax
xor    %ecx,%ecx
sub    %rdi,%rax
setne  %cl
sub    %rcx,%rax
movabs $0x89705f3112a28fe5,%rsi
5f 70 89
mul    %rsi
shr    $0x1d,%rdx
add    %rcx,%rdx
imul   $0x3b9aca07,%rdx,%rcx
add    %rdi,%rcx
mov    %rcx,%rax
mul    %rsi
shr    $0x1d,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @Sanitize(i64 %0) {
%2 = call i64 @llvm.smax.i64(i64 %0, i64 0)
%3 = sub i64 %2, %0
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = sub i64 %3, %5
%7 = udiv i64 %6, 1000000007
%8 = add nuw nsw i64 %7, %5
%9 = mul i64 %8, 1000000007
%10 = add i64 %9, %0
%11 = urem i64 %10, 1000000007
ret i64 %11
}
double to_rad(d)
double d;
{ return (2 * 3.14159 * (d / 180.0)); }


x86 assembly (clang, -O0):
<to_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xef2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_rad>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @to_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.800000e+02
%5 = fmul double 6.283180e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @to_rad(double %0) {
%2 = fdiv double %0, 1.800000e+02
%3 = fmul double %2, 6.283180e+00
ret double %3
}
void BusFault_Handler(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<BusFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BusFault_Handler+0x9>
jmp    1109 <BusFault_Handler+0x9>

x86 assembly (clang, -O2):
<BusFault_Handler>:
jmp    1100 <BusFault_Handler>

LLVM IR (-O0):
define void @BusFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @BusFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int getAnne();
int getApple();
int getBanana();
int getBob();
int /*<<< orphan*/ personEat(int, int);
int main() {
  int bob, anne;
  int fruit1, fruit2;
  bob = getBob();
  getApple();
  getApple();
  fruit1 = getApple();
  fruit2 = getBanana();
  personEat(bob, fruit1);
  anne = getAnne();
  personEat(anne, fruit2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getBob@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <getApple@plt>
mov    $0x0,%al
call   1070 <getApple@plt>
mov    $0x0,%al
call   1070 <getApple@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getBanana@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1060 <personEat@plt>
mov    $0x0,%al
call   1030 <getAnne@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <personEat@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <getBob@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1070 <getApple@plt>
xor    %eax,%eax
call   1070 <getApple@plt>
xor    %eax,%eax
call   1070 <getApple@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <getBanana@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    %ebp,%esi
call   1060 <personEat@plt>
xor    %eax,%eax
call   1030 <getAnne@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1060 <personEat@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @getBob()
store i32 %6, i32* %2
%7 = call i32 (...) @getApple()
%8 = call i32 (...) @getApple()
%9 = call i32 (...) @getApple()
store i32 %9, i32* %4
%10 = call i32 (...) @getBanana()
store i32 %10, i32* %5
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = call i32 @personEat(i32 %11, i32 %12)
%14 = call i32 (...) @getAnne()
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = call i32 @personEat(i32 %15, i32 %16)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getBob()
%2 = tail call i32 (...) @getApple()
%3 = tail call i32 (...) @getApple()
%4 = tail call i32 (...) @getApple()
%5 = tail call i32 (...) @getBanana()
%6 = tail call i32 @personEat(i32 %1, i32 %4)
%7 = tail call i32 (...) @getAnne()
%8 = tail call i32 @personEat(i32 %7, i32 %5)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
double add_doubles(double a, double b) {
  double result;
  result = a + b;
  return result;
}


x86 assembly (clang, -O0):
<add_doubles>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_doubles>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add_doubles(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @add_doubles(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ serial_out(unsigned int);
void print_dec(unsigned v) {
  if (v >= 10)
    print_dec(v / 10);
  serial_out((v % 10) + '0');
}


x86 assembly (clang, -O0):
<print_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jb     1148 <print_dec+0x28>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <print_dec@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1040 <serial_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dec>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%r14d
cmp    $0xa,%edi
jb     1140 <print_dec+0x20>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1030 <print_dec@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <serial_out@plt>

LLVM IR (-O0):
define void @print_dec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 10
%11 = add i32 %10, 48
%12 = call i32 @serial_out(i32 %11)
ret void
}

LLVM IR (-O2):
define void @print_dec(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = udiv i32 %0, 10
tail call void @print_dec(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = urem i32 %0, 10
%7 = or i32 %6, 48
%8 = tail call i32 @serial_out(i32 %7)
ret void
}
cmp(s1, s2) char *s1, *s2;
{ return (strcmp(s1, s2)); }


x86 assembly (clang, -O0):
<cmp>:
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):
<cmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp(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 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int test_imm_8Buint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x8B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Buint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 139
%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_8Buint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 139
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rop3_111_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_111_1_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %sil,%cl
mov    %edx,%eax
not    %al
or     %cl,%al
or     %sil,%dl
not    %dl
and    %al,%dl
or     %r8b,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_111_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %2, -1
%7 = or i8 %5, %6
%8 = or i8 %2, %1
%9 = xor i8 %8, -1
%10 = and i8 %7, %9
%11 = or i8 %4, %10
store i8 %11, i8* %0
ret void
}
void __attribute__((visibility("default"))) lib1_default(void) {}


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

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

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

LLVM IR (-O2):
define void @lib1_default() {
ret void
}
void peripheral_clocks_off() {
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x14) = (1 << (8));
}


x86 assembly (clang, -O0):
<peripheral_clocks_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffc00,%eax
movq   $0x100,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<peripheral_clocks_off>:
mov    $0xfffffc14,%eax
movq   $0x100,(%rax)
ret

LLVM IR (-O0):
define void @peripheral_clocks_off() {
store volatile i64 256, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 20) to i64*)
ret void
}

LLVM IR (-O2):
define void @peripheral_clocks_off() {
store volatile i64 256, i64* inttoptr (i64 4294966292 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char const *gettext(char *);
const char *PICK_STMT_ERR() {
  return gettext("Unable to pick stmt from array.");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Unable to pick stmt from array.\00"
define i8* @PICK_STMT_ERR() {
%1 = call i8* @gettext(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [32 x i8] c"Unable to pick stmt from array.\00"
define i8* @PICK_STMT_ERR() {
%1 = tail call i8* @gettext(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void HammingDistance_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @HammingDistance_SSSE3() {
ret void
}
main() { __asm("movl $3, %eax"); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "movl $$3, %eax", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
void *get_XSelectionEvent_display(void *_p) {
  return (void *)((XSelectionEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XSelectionEvent_display>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @get_XSelectionEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}