xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fwrite(char const *, int, int, int /*<<< orphan*/ *);
int write_dat(const char *filename, const char *data, int len) {
  FILE *pAMRFile = fopen(filename, "w+b");
  int size = 0;
  size = fwrite(data, 1, len, pAMRFile);
  fflush(pAMRFile);
  fclose(pAMRFile);
  return size;
}


x86 assembly (clang, -O0):
<write_dat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fwrite@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dat>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xeaf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <fflush@plt>
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"w+b\00"
define i32 @write_dat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %7
store i32 0, i32* %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = call i32 @fwrite(i8* %11, i32 1, i32 %12, i32* %13)
store i32 %14, i32* %8
%15 = load i32*, i32** %7
%16 = call i32 @fflush(i32* %15)
%17 = load i32*, i32** %7
%18 = call i32 @fclose(i32* %17)
%19 = load i32, i32* %8
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"w+b\00"
define i32 @write_dat(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32* %4)
%6 = tail call i32 @fflush(i32* %4)
%7 = tail call i32 @fclose(i32* %4)
ret i32 %5
}
void test_pass(const char *test) { (void)test; }


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

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

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

LLVM IR (-O2):
define void @test_pass(i8* nocapture %0) {
ret void
}
void free_morpheme(struct morpheme_t *morpheme) {}


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

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

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

LLVM IR (-O2):
%struct.morpheme_t = type opaque
define void @free_morpheme(%struct.morpheme_t* nocapture %0) {
ret void
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_whence;
  int /*<<< orphan*/ l_type;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_UNLCK;
int /*<<< orphan*/ SEEK_SET;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int unlock(int fd) {
  struct flock lock;
  lock.l_type = F_UNLCK;
  lock.l_whence = SEEK_SET;
  lock.l_start = 0;
  lock.l_len = 0;
  return fcntl(fd, F_SETLK, &lock);
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i64, i64, i32, i32 }
@F_UNLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @unlock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = load i32, i32* @F_UNLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETLK
%12 = call i32 @fcntl(i32 %10, i32 %11, %struct.flock* %3)
ret i32 %12
}

LLVM IR (-O2):
%struct.flock = type { i64, i64, i32, i32 }
@F_UNLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @unlock(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = load i32, i32* @F_UNLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 2
store i32 %6, i32* %7
%8 = bitcast %struct.flock* %2 to i8*
%9 = load i32, i32* @F_SETLK
%10 = call i32 @fcntl(i32 %0, i32 %9, %struct.flock* %2)
ret i32 %10
}
int init_data() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_data() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void handler3(int sig) {
  write(1, "Async action on sigquit (3)\n",
        sizeof("Async action on sigquit (3)\n") - 1);
}


x86 assembly (clang, -O0):
<handler3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed9(%rip),%rsi
mov    $0x1c,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler3>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1c,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Async action on sigquit (3)\0A\00"
define void @handler3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 28)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Async action on sigquit (3)\0A\00"
define void @handler3(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 28)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void ISC_util_assert_message(const char *mess) {
  printf(mess);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<ISC_util_assert_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
jmp    1125 <ISC_util_assert_message+0x15>

x86 assembly (clang, -O2):
<ISC_util_assert_message>:
push   %rax
call   1030 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <ISC_util_assert_message+0x10>

LLVM IR (-O0):
define void @ISC_util_assert_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
define void @ISC_util_assert_message(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
char *strchr(char const *, int);
const char *nexttoken(const char *q, int sep) {
  if (q) {
    q = strchr(q, sep);
  }
  if (q) {
    q++;
  }
  return q;
}


x86 assembly (clang, -O0):
<nexttoken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <nexttoken+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <nexttoken+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nexttoken>:
test   %rdi,%rdi
je     1121 <nexttoken+0x11>
push   %rax
call   1030 <strchr@plt>
add    $0x8,%rsp
jmp    1123 <nexttoken+0x13>
xor    %eax,%eax
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rax,%rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @nexttoken(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strchr(i8* %0, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* null, i8* %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ set_cooked();
void handle_abort(int x) {
  set_cooked();
  exit(3);
}


x86 assembly (clang, -O0):
<handle_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <set_cooked@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_abort>:
push   %rax
xor    %eax,%eax
call   1030 <set_cooked@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @handle_abort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @set_cooked()
%4 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
define void @handle_abort(i32 %0) {
%2 = tail call i32 (...) @set_cooked()
%3 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ deepsleepr();
int /*<<< orphan*/ printf(char *);
int main() {
  printf(" \n Calling Deep-Sleepr System Call \n");
  deepsleepr();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c" \0A Calling Deep-Sleepr System Call \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @deepsleepr()
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getnanotime(struct timespec *);
void ktime_get_ts(struct timespec *ts) { getnanotime(ts); }


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

x86 assembly (clang, -O2):
<ktime_get_ts>:
jmp    1030 <getnanotime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @ktime_get_ts(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = call i32 @getnanotime(%struct.timespec* %3)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @ktime_get_ts(%struct.timespec* %0) {
%2 = tail call i32 @getnanotime(%struct.timespec* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchp(int /*<<< orphan*/);
void put_str(const char *s) {
  for (; *s; putchp(*s++))
    ;
}


x86 assembly (clang, -O0):
<put_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <put_str+0x3a>
jmp    112e <put_str+0x1e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchp@plt>
jmp    111c <put_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <put_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchp@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <put_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @put_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchp(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int itex2MML_do_html_filter(char const *, unsigned long, int /*<<< orphan*/);
int itex2MML_html_filter(const char *buffer, unsigned long length) {
  return itex2MML_do_html_filter(buffer, length, 0);
}


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

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

LLVM IR (-O0):
define i32 @itex2MML_html_filter(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
%7 = call i32 @itex2MML_do_html_filter(i8* %5, i64 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @itex2MML_html_filter(i8* %0, i64 %1) {
%3 = tail call i32 @itex2MML_do_html_filter(i8* %0, i64 %1, i32 0)
ret i32 %3
}
int is_macro(char ch, int start) {
  return ch == '_' || (ch >= 'A' && ch <= 'Z') ||
         (!start && ch >= '0' && ch <= '9');
}


x86 assembly (clang, -O0):
<is_macro>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x9(%rbp)
je     1172 <is_macro+0x72>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     113e <is_macro+0x3e>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x9(%rbp)
jle    1172 <is_macro+0x72>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jne    116c <is_macro+0x6c>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xa(%rbp)
jl     116c <is_macro+0x6c>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_macro>:
mov    $0x1,%eax
cmp    $0x5f,%dil
je     1128 <is_macro+0x28>
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%cl
jb     1128 <is_macro+0x28>
xor    %eax,%eax
cmp    $0x30,%dil
jl     1128 <is_macro+0x28>
test   %esi,%esi
jne    1128 <is_macro+0x28>
xor    %eax,%eax
cmp    $0x3a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_macro(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 95
br i1 %7, label %29, label %8
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 90
br i1 %15, label %29, label %16
16: ; preds = %12, %8
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %27, label %19
19: ; preds = %16
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 48
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 57
br label %27
27: ; preds = %23, %19, %16
%28 = phi i1 [ false, %19 ], [ false, %16 ], [ %26, %23 ]
br label %29
29: ; preds = %27, %12, %2
%30 = phi i1 [ true, %12 ], [ true, %2 ], [ %28, %27 ]
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @is_macro(i8 signext %0, i32 %1) {
%3 = icmp eq i8 %0, 95
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 26
%6 = or i1 %3, %5
br i1 %6, label %14, label %7
7: ; preds = %2
%8 = icmp eq i32 %1, 0
%9 = icmp sgt i8 %0, 47
%10 = and i1 %9, %8
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = icmp ult i8 %0, 58
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %7, %11, %2
%15 = phi i32 [ 1, %2 ], [ 0, %7 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
int numa_num_task_cpus();
int getNumHardwareThreads() { return numa_num_task_cpus(); }


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

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

LLVM IR (-O0):
define i32 @getNumHardwareThreads() {
%1 = call i32 (...) @numa_num_task_cpus()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getNumHardwareThreads() {
%1 = tail call i32 (...) @numa_num_task_cpus()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void ctr_clex_emit_error(char *message) {
  printf(message);
  exit(1);
}


x86 assembly (clang, -O0):
<ctr_clex_emit_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ctr_clex_emit_error>:
push   %rax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @ctr_clex_emit_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @ctr_clex_emit_error(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
int access(char const *, int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
off_t flength(const char *filename) {
  struct stat st;
  if (access(filename, 0) == -1)
    return (-1);
  if (stat(filename, &st) != 0)
    return (-1);
  return (st.st_size);
}


x86 assembly (clang, -O0):
<flength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    114c <flength+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <flength+0x55>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     116f <flength+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <flength+0x55>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flength>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <access@plt>
mov    $0xffffffff,%ebp
cmp    $0xffffffff,%eax
je     114a <flength+0x2a>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <stat@plt>
test   %rax,%rax
jne    114a <flength+0x2a>
mov    (%rsp),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @flength(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @access(i8* %5, i32 0)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %17
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @stat(i8* %10, %struct.stat* %4)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 -1, i32* %2
br label %17
14: ; preds = %9
%15 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%16 = load i32, i32* %15
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %13, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @flength(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @access(i8* %0, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = call i64 @stat(i8* %0, %struct.stat* %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
br label %12
12: ; preds = %6, %1, %9
%13 = phi i32 [ %11, %9 ], [ -1, %1 ], [ -1, %6 ]
ret i32 %13
}
void foo553(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo553(i32 %0) {
ret void
}
/* Variables and functions */
int memcmp(char const *, char const *, size_t);
int schema_rt_key_eq(const char *key, const char *str, size_t klen,
                     size_t len) {
  return klen == 0 || klen != len ? -1 : memcmp(key, str, klen);
}


x86 assembly (clang, -O0):
<schema_rt_key_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1141 <schema_rt_key_eq+0x31>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     114e <schema_rt_key_eq+0x3e>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1162 <schema_rt_key_eq+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<schema_rt_key_eq>:
test   %rdx,%rdx
je     111f <schema_rt_key_eq+0xf>
cmp    %rcx,%rdx
jne    111f <schema_rt_key_eq+0xf>
jmp    1030 <memcmp@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @schema_rt_key_eq(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11, %4
br label %21
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call i32 @memcmp(i8* %17, i8* %18, i64 %19)
br label %21
21: ; preds = %16, %15
%22 = phi i32 [ -1, %15 ], [ %20, %16 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @schema_rt_key_eq(i8* nocapture %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = icmp ne i64 %2, 0
%6 = icmp eq i64 %2, %3
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
void shiftup(short int buffer[]) {
  int i;
  for (i = 102; i > 0; i--) {
    buffer[i] = buffer[i - 1];
  }
  buffer[0] = 0;
}


x86 assembly (clang, -O0):
<shiftup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x66,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1144 <shiftup+0x44>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <shiftup+0xf>
mov    -0x8(%rbp),%rax
movw   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftup>:
push   %rbx
mov    %rdi,%rbx
add    $0x2,%rdi
mov    $0xcc,%edx
mov    %rbx,%rsi
call   1030 <memmove@plt>
movw   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @shiftup(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = getelementptr i16, i16* %0, i64 1
%4 = bitcast i16* %3 to i8*
store i16 0, i16* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appuyezEntree(char *);
int /*<<< orphan*/ couleur(int);
int /*<<< orphan*/ lireEtAfficher(char *);
int /*<<< orphan*/ system(char *);
void afficherEcranTitre(void) {
  system("clear");
  couleur(32);
  lireEtAfficher("ASCII_Art/ASCII_Art_Ecran_Titre.txt");
  couleur(0);
  appuyezEntree("APPUYEZ SUR ENTREE POUR COMMENCER");
}


x86 assembly (clang, -O0):
<afficherEcranTitre>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <system@plt>
mov    $0x20,%edi
call   1060 <couleur@plt>
lea    0xea5(%rip),%rdi
call   1040 <lireEtAfficher@plt>
xor    %edi,%edi
call   1060 <couleur@plt>
lea    0xeb6(%rip),%rdi
call   1050 <appuyezEntree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherEcranTitre>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <system@plt>
mov    $0x20,%edi
call   1060 <couleur@plt>
lea    0xea8(%rip),%rdi
call   1040 <lireEtAfficher@plt>
xor    %edi,%edi
call   1060 <couleur@plt>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1050 <appuyezEntree@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [36 x i8] c"ASCII_Art/ASCII_Art_Ecran_Titre.txt\00"
@.str.2 = [34 x i8] c"APPUYEZ SUR ENTREE POUR COMMENCER\00"
define void @afficherEcranTitre() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @couleur(i32 32)
%3 = call i32 @lireEtAfficher(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @couleur(i32 0)
%5 = call i32 @appuyezEntree(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [36 x i8] c"ASCII_Art/ASCII_Art_Ecran_Titre.txt\00"
@.str.2 = [34 x i8] c"APPUYEZ SUR ENTREE POUR COMMENCER\00"
define void @afficherEcranTitre() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @couleur(i32 32)
%3 = tail call i32 @lireEtAfficher(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @couleur(i32 0)
%5 = tail call i32 @appuyezEntree(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fact(int);
int main() { return fact(8); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%edi
jmp    1030 <fact@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fact(i32 8)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fact(i32 8)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic1() { panic(2); }


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

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

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

LLVM IR (-O2):
define void @panic1() {
%1 = tail call i32 @panic(i32 2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
int strlen(char const *);
char *concat_strings(const char *str1, const char *str2) {
  char *concat = (char *)malloc(sizeof(char) * strlen(str1) + strlen(str2) + 1);
  sprintf(concat, "%s%s", str1, str2);
  return concat;
}


x86 assembly (clang, -O0):
<concat_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe76(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_strings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @concat_strings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = sext i32 %11 to i64
%13 = add i64 %9, %12
%14 = add i64 %13, 1
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @concat_strings(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ svga_readl_common(int /*<<< orphan*/, int /*<<< orphan*/,
                                     void *);
uint32_t svga_readl(uint32_t addr, void *p) {
  return svga_readl_common(addr, 0, p);
}


x86 assembly (clang, -O0):
<svga_readl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <svga_readl_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svga_readl>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <svga_readl_common@plt>

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

LLVM IR (-O2):
define i32 @svga_readl(i32 %0, i8* %1) {
%3 = tail call i32 @svga_readl_common(i32 %0, i32 0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int __sunriset__(int, int, int, double, double, double, int /*<<< orphan*/,
                 double *, double *);
int astronomical_twilight(int year, int month, int day, double lon, double lat,
                          double *start, double *end) {
  return __sunriset__(year, month, day, lon, lat, -18.0, 0, start, end);
}


x86 assembly (clang, -O0):
<astronomical_twilight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
movsd  0xeaa(%rip),%xmm2
xor    %ecx,%ecx
call   1030 <__sunriset__@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astronomical_twilight>:
mov    %r8,%r9
mov    %rcx,%r8
movsd  0xee2(%rip),%xmm2
xor    %ecx,%ecx
jmp    1030 <__sunriset__@plt>

LLVM IR (-O0):
define i32 @astronomical_twilight(i32 %0, i32 %1, i32 %2, double %3, double %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double*
%14 = alloca double*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double %3, double* %11
store double %4, double* %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load double, double* %11
%19 = load double, double* %12
%20 = load double*, double** %13
%21 = load double*, double** %14
%22 = call i32 @__sunriset__(i32 %15, i32 %16, i32 %17, double %18, double %19, double -1.800000e+01, i32 0, double* %20, double* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @astronomical_twilight(i32 %0, i32 %1, i32 %2, double %3, double %4, double* %5, double* %6) {
%8 = tail call i32 @__sunriset__(i32 %0, i32 %1, i32 %2, double %3, double %4, double -1.800000e+01, i32 0, double* %5, double* %6)
ret i32 %8
}
void foo221() {}


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

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

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

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

/* Variables and functions */
int gethostname(char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char *);
int getKey(char *key) {
  char name[33];
  int rc;
  memset(name, 0, sizeof(name));
  rc = gethostname(name, sizeof(name) - 1);
  if (rc)
    return rc;
  strcpy(key, name);
  return 0;
}


x86 assembly (clang, -O0):
<getKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x21,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
mov    $0x20,%esi
call   1050 <gethostname@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     1172 <getKey+0x42>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <getKey+0x56>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKey>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsp,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x21,%edx
call   1040 <memset@plt>
mov    %rbp,%rdi
mov    $0x20,%esi
call   1050 <gethostname@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1169 <getKey+0x39>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getKey(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [33 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 33)
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%9 = call i32 @gethostname(i8* %8, i32 32)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %5
store i32 %13, i32* %2
br label %18
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%17 = call i32 @strcpy(i8* %15, i8* %16)
store i32 0, i32* %2
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @getKey(i8* %0) {
%2 = alloca [33 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 33)
%5 = call i32 @gethostname(i8* %3, i32 32)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @strcpy(i8* %0, i8* %3)
br label %9
9: ; preds = %1, %7
ret i32 %5
}
int test_imm_4Cint64_lowword_reg(long long val) {
  return ((val) & (0x4C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Cint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 76
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ read_int_dec_or_hex(char *);
int /*<<< orphan*/ send_req(int, int, int /*<<< orphan*/, int);
int u_set_dly(int fd, char **argv) {
  uint32_t val;
  val = read_int_dec_or_hex(argv[0]);
  send_req(fd, 0x0c, val, 1);
  return 0;
}


x86 assembly (clang, -O0):
<u_set_dly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <read_int_dec_or_hex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    $0xc,%esi
mov    $0x1,%ecx
call   1030 <send_req@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_set_dly>:
push   %rbx
mov    %edi,%ebx
mov    (%rsi),%rdi
call   1040 <read_int_dec_or_hex@plt>
mov    %ebx,%edi
mov    $0xc,%esi
mov    %eax,%edx
mov    $0x1,%ecx
call   1030 <send_req@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @u_set_dly(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @read_int_dec_or_hex(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 @send_req(i32 %10, i32 12, i32 %11, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @u_set_dly(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @read_int_dec_or_hex(i8* %3)
%5 = tail call i32 @send_req(i32 %0, i32 12, i32 %4, i32 1)
ret i32 0
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IREAD;
scalar_t__ stat(char const *, struct stat *);
int exist_file(const char *local) {
  struct stat buff;
  if (stat(local, &buff))
    return 0;
  return buff.st_mode & S_IREAD;
}


x86 assembly (clang, -O0):
<exist_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <exist_file+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    114e <exist_file+0x3e>
mov    -0x18(%rbp),%eax
mov    0x2e97(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exist_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%edx
and    (%rsp),%edx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IREAD = global i32 0
define i32 @exist_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %14
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IREAD
%13 = and i32 %11, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IREAD = global i32 0
define i32 @exist_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IREAD
%9 = and i32 %8, %7
%10 = select i1 %5, i32 %9, i32 0
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ get_time();
uint64_t calibrate_timer() {
  uint64_t dtMin = 0xFFFFFFFFL;
  uint64_t t0, t1;
  int i;
  for (i = 0; i < 10000; ++i) {
    t0 = get_time();
    t1 = get_time();
    if (dtMin > t1 - t0) {
      dtMin = t1 - t0;
    }
  }
  return dtMin;
}


x86 assembly (clang, -O0):
<calibrate_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xffffffff,%eax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2710,-0x1c(%rbp)
jge    117f <calibrate_timer+0x6f>
mov    $0x0,%al
call   1030 <get_time@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_time@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
jle    116c <calibrate_timer+0x5c>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <calibrate_timer+0x61>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1128 <calibrate_timer+0x18>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calibrate_timer>:
push   %rbp
push   %r14
push   %rbx
mov    $0xffffffff,%eax
mov    $0x2710,%ebp
xchg   %ax,%ax
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <get_time@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <get_time@plt>
sub    %r14,%rax
cmp    %rax,%rbx
cmovle %rbx,%rax
add    $0xffffffff,%ebp
jne    1120 <calibrate_timer+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @calibrate_timer() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = phi i64 [ 4294967295, %0 ], [ %8, %1 ]
%4 = tail call i64 (...) @get_time()
%5 = tail call i64 (...) @get_time()
%6 = sub nsw i64 %5, %4
%7 = icmp sgt i64 %3, %6
%8 = select i1 %7, i64 %6, i64 %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 10000
br i1 %10, label %11, label %1
11: ; preds = %1
ret i64 %8
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
scalar_t__ iterate48(unsigned short *);
long jrand48(unsigned short subi[3]) {
  return ((int64_t)iterate48(subi)) >> 16;
}


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

x86 assembly (clang, -O2):
<jrand48>:
push   %rax
call   1030 <iterate48@plt>
sar    $0x10,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @jrand48(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i64 @iterate48(i16* %3)
%5 = trunc i64 %4 to i32
%6 = ashr i32 %5, 16
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @jrand48(i16* %0) {
%2 = tail call i64 @iterate48(i16* %0)
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 16
%5 = sext i32 %4 to i64
ret i64 %5
}