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

/* Variables and functions */
int /*<<< orphan*/ munmap(int /*<<< orphan*/, int);
void mapfree(void *addr, int size) { munmap((caddr_t)addr, size); }


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

x86 assembly (clang, -O2):
<mapfree>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @mapfree(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 = ptrtoint i8* %5 to i32
%7 = load i32, i32* %4
%8 = call i32 @munmap(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @mapfree(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @munmap(i32 %4, i32 %1)
ret void
}
int sched_block() {}


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

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

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

LLVM IR (-O2):
define i32 @sched_block() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void term_underline() { printf("\033[4m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[4m\00"
define void @term_underline() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[4m\00"
define void @term_underline() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int reverseNum(int num) {
  int reverse = 0;
  while (num) {
    reverse = reverse * 10 + num % 10;
    num /= 10;
  }
  return reverse;
}


x86 assembly (clang, -O0):
<reverseNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <reverseNum+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverseNum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseNum>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverseNum+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverseNum+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverseNum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int strlen(char *);
char *rtrim(char *string, int num_chars) {
  int index;
  index = strlen(string) - num_chars;
  string[index] = '\0';
  return string;
}


x86 assembly (clang, -O0):
<rtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrim>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
sub    %ebp,%eax
cltq
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @rtrim(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @rtrim(i8* returned %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sub nsw i32 %3, %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ GL_FILL;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LINE;
int /*<<< orphan*/ glPolygonMode(int /*<<< orphan*/, int /*<<< orphan*/);
void togglewire(void) {
  static int toggle = 0;
  toggle ^= 1;
  glPolygonMode(GL_FRONT_AND_BACK, toggle ? GL_LINE : GL_FILL);
}


x86 assembly (clang, -O0):
<togglewire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f0e(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2f05(%rip)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,0x2ef2(%rip)
je     1151 <togglewire+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    115d <togglewire+0x4d>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glPolygonMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<togglewire>:
xorl   $0x1,0x2f15(%rip)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jne    1130 <togglewire+0x20>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <glPolygonMode@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <glPolygonMode@plt>

LLVM IR (-O0):
@togglewire.toggle = internal global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_FILL = global i32 0
define void @togglewire() {
%1 = load i32, i32* @togglewire.toggle
%2 = xor i32 %1, 1
store i32 %2, i32* @togglewire.toggle
%3 = load i32, i32* @GL_FRONT_AND_BACK
%4 = load i32, i32* @togglewire.toggle
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* @GL_LINE
br label %10
8: ; preds = %0
%9 = load i32, i32* @GL_FILL
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
%12 = call i32 @glPolygonMode(i32 %3, i32 %11)
ret void
}

LLVM IR (-O2):
@togglewire.toggle = internal unnamed_addr global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_FILL = global i32 0
define void @togglewire() {
%1 = load i32, i32* @togglewire.toggle
%2 = xor i32 %1, 1
store i32 %2, i32* @togglewire.toggle
%3 = load i32, i32* @GL_FRONT_AND_BACK
%4 = icmp eq i32 %2, 0
%5 = load i32, i32* @GL_LINE
%6 = load i32, i32* @GL_FILL
%7 = select i1 %4, i32 %6, i32 %5
%8 = tail call i32 @glPolygonMode(i32 %3, i32 %7)
ret void
}
/* Variables and functions */
int VP8BitCost(int, int);
int BranchCost(int nb, int total, int proba) {
  return nb * VP8BitCost(1, proba) + (total - nb) * VP8BitCost(0, proba);
}


x86 assembly (clang, -O0):
<BranchCost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <VP8BitCost@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1030 <VP8BitCost@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BranchCost>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%r15d
mov    $0x1,%edi
mov    %edx,%esi
call   1030 <VP8BitCost@plt>
mov    %eax,%ebx
imul   %r15d,%ebx
sub    %r15d,%ebp
xor    %edi,%edi
mov    %r14d,%esi
call   1030 <VP8BitCost@plt>
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @BranchCost(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = call i32 @VP8BitCost(i32 1, i32 %8)
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = call i32 @VP8BitCost(i32 0, i32 %14)
%16 = mul nsw i32 %13, %15
%17 = add nsw i32 %10, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @BranchCost(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @VP8BitCost(i32 1, i32 %2)
%5 = mul nsw i32 %4, %0
%6 = sub nsw i32 %1, %0
%7 = tail call i32 @VP8BitCost(i32 0, i32 %2)
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ copy_str(char *, size_t, char const *);
int /*<<< orphan*/ split_ext(char *, int *, char const **);
int apply_r_mod(const char *path, char *buf, size_t buf_len) {
  int root_len;
  const char *ext_pos;
  copy_str(buf, buf_len, path);
  split_ext(buf, &root_len, &ext_pos);
  return 0;
}


x86 assembly (clang, -O0):
<apply_r_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <copy_str@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <split_ext@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_r_mod>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <copy_str@plt>
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <split_ext@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @apply_r_mod(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %4
%12 = call i32 @copy_str(i8* %9, i64 %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @split_ext(i8* %13, i32* %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @apply_r_mod(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = bitcast i32* %4 to i8*
%7 = bitcast i8** %5 to i8*
%8 = tail call i32 @copy_str(i8* %1, i64 %2, i8* %0)
%9 = call i32 @split_ext(i8* %1, i32* %4, i8** %5)
ret i32 0
}
/* Type definitions */
struct stat {
  unsigned long st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
unsigned long get_file_size(const char *path) {
  unsigned long filesize = -1;
  struct stat statbuff;
  if (stat(path, &statbuff) < 0) {
    return filesize;
  } else {
    filesize = statbuff.st_size;
  }
  return filesize;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1148 <get_file_size+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <get_file_size+0x48>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rcx
js     112c <get_file_size+0x1c>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, -1
%8 = select i1 %7, i64 %6, i64 -1
ret i64 %8
}
int SQR(int x) { return x * x; }


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

x86 assembly (clang, -O2):
<SQR>:
mov    %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @SQR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @SQR(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int min(int x, int y) { return x >= y ? x : y; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void test_large(void) {}


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

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

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

LLVM IR (-O2):
define void @test_large() {
ret void
}
void g_strlcat() {}


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

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

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

LLVM IR (-O2):
define void @g_strlcat() {
ret void
}
int do_387() { return 387; }


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

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

LLVM IR (-O0):
define i32 @do_387() {
ret i32 387
}

LLVM IR (-O2):
define i32 @do_387() {
ret i32 387
}
unsigned long genrand_state_length() { return 624; }


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

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

LLVM IR (-O0):
define i64 @genrand_state_length() {
ret i64 624
}

LLVM IR (-O2):
define i64 @genrand_state_length() {
ret i64 624
}
void foo254() {}


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

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

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

LLVM IR (-O2):
define void @foo254() {
ret void
}
int Xprint(char t) {
  (void)t;
  return 0;
}


x86 assembly (clang, -O0):
<Xprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Xprint(i8 signext %0) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Set32(int, int);
void set_date_ms(uint64_t date_ms) {
  uint64_t date = date_ms * 250000;
  uint32_t date_lowbits = date & (0x0000FFFF);
  uint32_t date_highbits = date >> 32;
  Set32(0x20003004, date_lowbits);
  Set32(0x20003008, date_highbits);
}


x86 assembly (clang, -O0):
<set_date_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3d090,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x20003004,%edi
call   1030 <Set32@plt>
mov    -0x10(%rbp),%esi
mov    $0x20003008,%edi
call   1030 <Set32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_date_ms>:
push   %rax
imul   $0x3d090,%edi,%eax
movzwl %ax,%esi
mov    $0x20003004,%edi
call   1030 <Set32@plt>
mov    $0x20003008,%edi
pop    %rax
jmp    1030 <Set32@plt>

LLVM IR (-O0):
define void @set_date_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 250000
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, 65535
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 32
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = call i32 @Set32(i32 536883204, i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @Set32(i32 536883208, i32 %14)
ret void
}

LLVM IR (-O2):
define void @set_date_ms(i32 %0) {
%2 = mul nsw i32 %0, 250000
%3 = and i32 %2, 65520
%4 = tail call i32 @Set32(i32 536883204, i32 %3)
%5 = tail call i32 @Set32(i32 536883208, i32 poison)
ret void
}
/* Type definitions */
struct hash_struct {
  int dummy;
};
struct entry_list {
  int dummy;
};

/* Variables and functions */
int entry_list_remove(struct entry_list *, char const *);
struct entry_list *hash_entry(struct hash_struct *, char const *);
int hash_remove(struct hash_struct *table, char const *name) {
  struct entry_list *head = hash_entry(table, name);
  return entry_list_remove(head, name);
}


x86 assembly (clang, -O0):
<hash_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <hash_entry@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <entry_list_remove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_remove>:
push   %rbx
mov    %rsi,%rbx
call   1040 <hash_entry@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <entry_list_remove@plt>

LLVM IR (-O0):
%struct.hash_struct = type { i32 }
%struct.entry_list = type { i32 }
define i32 @hash_remove(%struct.hash_struct* %0, i8* %1) {
%3 = alloca %struct.hash_struct*
%4 = alloca i8*
%5 = alloca %struct.entry_list*
store %struct.hash_struct* %0, %struct.hash_struct** %3
store i8* %1, i8** %4
%6 = load %struct.hash_struct*, %struct.hash_struct** %3
%7 = load i8*, i8** %4
%8 = call %struct.entry_list* @hash_entry(%struct.hash_struct* %6, i8* %7)
store %struct.entry_list* %8, %struct.entry_list** %5
%9 = load %struct.entry_list*, %struct.entry_list** %5
%10 = load i8*, i8** %4
%11 = call i32 @entry_list_remove(%struct.entry_list* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.hash_struct = type { i32 }
%struct.entry_list = type { i32 }
define i32 @hash_remove(%struct.hash_struct* %0, i8* %1) {
%3 = tail call %struct.entry_list* @hash_entry(%struct.hash_struct* %0, i8* %1)
%4 = tail call i32 @entry_list_remove(%struct.entry_list* %3, i8* %1)
ret i32 %4
}
unsigned int get_file_date(const char *fn, unsigned int *time) {
  *time = 0;
  ui_print("IMPLEMENT ME FOR THIS OPERATING SYSTEM/PLATFORM: %s\n",
           __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<get_file_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
lea    0xecf(%rip),%rdi
lea    0xefd(%rip),%rsi
mov    $0x0,%al
call   1030 <ui_print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_date>:
push   %rax
movl   $0x0,(%rsi)
lea    0xee2(%rip),%rdi
lea    0xf10(%rip),%rsi
xor    %eax,%eax
call   1030 <ui_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"IMPLEMENT ME FOR THIS OPERATING SYSTEM/PLATFORM: %s\0A\00"
@__FUNCTION__.get_file_date = [14 x i8] c"get_file_date\00"
define i32 @get_file_date(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 0, i32* %5
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ui_print to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.get_file_date, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"IMPLEMENT ME FOR THIS OPERATING SYSTEM/PLATFORM: %s\0A\00"
@__FUNCTION__.get_file_date = [14 x i8] c"get_file_date\00"
define i32 @get_file_date(i8* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ui_print to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.get_file_date, i64 0, i64 0))
ret i32 0
}
int mb(double bytes) { return (int)(bytes / (1024.0 * 1024.0) + 0.5); }


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

x86 assembly (clang, -O2):
<mb>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @mb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x4130000000000000
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @mb(double %0) {
%2 = fmul double %0, 0x3EB0000000000000
%3 = fadd double %2, 5.000000e-01
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int rand();
void fill_random_buffer(char *buf, int size) {
  int i;
  for (i = 0; i < size; i++) {
    buf[i] = (char)(rand() % 256);
  }
}


x86 assembly (clang, -O0):
<fill_random_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <fill_random_buffer+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fill_random_buffer+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_random_buffer>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <fill_random_buffer+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fill_random_buffer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fill_random_buffer(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ the_hidden_function();
int /*<<< orphan*/ the_static_function();
int /*<<< orphan*/ the_used_function();
int /*<<< orphan*/ the_visible_function();
void the_function() {
  the_static_function();
  the_used_function();
  the_hidden_function();
  the_visible_function();
}


x86 assembly (clang, -O0):
<the_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <the_static_function@plt>
mov    $0x0,%al
call   1030 <the_used_function@plt>
mov    $0x0,%al
call   1040 <the_hidden_function@plt>
mov    $0x0,%al
call   1050 <the_visible_function@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<the_function>:
push   %rax
xor    %eax,%eax
call   1060 <the_static_function@plt>
xor    %eax,%eax
call   1030 <the_used_function@plt>
xor    %eax,%eax
call   1040 <the_hidden_function@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <the_visible_function@plt>

LLVM IR (-O0):
define void @the_function() {
%1 = call i32 (...) @the_static_function()
%2 = call i32 (...) @the_used_function()
%3 = call i32 (...) @the_hidden_function()
%4 = call i32 (...) @the_visible_function()
ret void
}

LLVM IR (-O2):
define void @the_function() {
%1 = tail call i32 (...) @the_static_function()
%2 = tail call i32 (...) @the_used_function()
%3 = tail call i32 (...) @the_hidden_function()
%4 = tail call i32 (...) @the_visible_function()
ret void
}
unsigned int lshift_u_u(unsigned int left, unsigned int right) {
  if ((right >= sizeof(unsigned int) * 8) || (left > (4294967295U >> right))) {
    return left;
  }
  return left << right;
}


x86 assembly (clang, -O0):
<lshift_u_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x20,%rax
jae    112e <lshift_u_u+0x2e>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shr    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jbe    1139 <lshift_u_u+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <lshift_u_u+0x44>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lshift_u_u>:
mov    %esi,%ecx
mov    %edi,%eax
mov    $0xffffffff,%edx
shr    %cl,%edx
xor    %esi,%esi
cmp    %edi,%edx
mov    %ecx,%edx
cmovb  %esi,%edx
cmp    $0x20,%ecx
cmovae %esi,%edx
mov    %edx,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @lshift_u_u(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
%8 = icmp uge i64 %7, 32
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = lshr i32 -1, %11
%13 = icmp ugt i32 %10, %12
br i1 %13, label %14, label %16
14: ; preds = %9, %2
%15 = load i32, i32* %4
store i32 %15, i32* %3
br label %20
16: ; preds = %9
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = shl i32 %17, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %14
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @lshift_u_u(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 31
%4 = lshr i32 -1, %1
%5 = icmp ult i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = select i1 %6, i32 0, i32 %1
%8 = shl i32 %0, %7
ret i32 %8
}
/* Variables and functions */
int FNM_NOESCAPE;
int octave_fnm_noescape_wrapper(void) { return FNM_NOESCAPE; }


x86 assembly (clang, -O0):
<octave_fnm_noescape_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_fnm_noescape_wrapper>:
mov    0x2ef1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FNM_NOESCAPE = global i32 0
define i32 @octave_fnm_noescape_wrapper() {
%1 = load i32, i32* @FNM_NOESCAPE
ret i32 %1
}

LLVM IR (-O2):
@FNM_NOESCAPE = global i32 0
define i32 @octave_fnm_noescape_wrapper() {
%1 = load i32, i32* @FNM_NOESCAPE
ret i32 %1
}
void jack_event_handler(char *name, int value) {}


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

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

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

LLVM IR (-O2):
define void @jack_event_handler(i8* nocapture %0, i32 %1) {
ret void
}
void *f(void *a) {
  unsigned int *x = (unsigned int *)a;
  unsigned int i, y = *x;
  for (i = 0; i < 1000000; ++i) {
    x[i] += x[1000000 - (i + 1)];
  }
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4240,-0x14(%rbp)
jae    115e <f+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edx
add    $0x1,%edx
mov    $0xf4240,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <f+0x20>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
lea    0x3d08fc(%rdi),%rcx
mov    $0x1,%edx
nop
mov    (%rcx),%esi
add    %esi,-0x4(%rax,%rdx,4)
mov    -0x4(%rcx),%esi
add    %esi,(%rax,%rdx,4)
add    $0xfffffffffffffff8,%rcx
add    $0x2,%rdx
cmp    $0xf4241,%rdx
jne    1110 <f+0x10>
ret

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

LLVM IR (-O2):
define i8* @f(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ 0, %1 ], [ %12, %3 ]
%5 = or i64 %4, 1
%6 = sub nuw nsw i64 999999, %4
%7 = getelementptr inbounds i32, i32* %2, i64 %6
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %2, i64 %4
%10 = load i32, i32* %9
%11 = add i32 %10, %8
store i32 %11, i32* %9
%12 = add nuw nsw i64 %4, 2
%13 = sub nuw nsw i64 999999, %5
%14 = getelementptr inbounds i32, i32* %2, i64 %13
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %2, i64 %5
%17 = load i32, i32* %16
%18 = add i32 %17, %15
store i32 %18, i32* %16
%19 = icmp eq i64 %12, 1000000
br i1 %19, label %20, label %3
20: ; preds = %3
ret i8* %0
}
/* Variables and functions */
__attribute__((visibility("default"))) void *
sd_bus_get_current_message(void *bus) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @sd_bus_get_current_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sd_bus_get_current_message(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "client: [-s server@port] [-P proxy@port] [-S] [-u]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"client: [-s server@port] [-P proxy@port] [-S] [-u]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"client: [-s server@port] [-P proxy@port] [-S] [-u]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
int descompacta(const char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @descompacta(i8* nocapture readnone %0) {
ret i32 0
}
void dna2rna(char *s) {
  for (; *s; s++) {
    if (*s == 't')
      *s = 'u';
    if (*s == 'T')
      *s = 'U';
  }
}


x86 assembly (clang, -O0):
<dna2rna>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <dna2rna+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
jne    112c <dna2rna+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x75,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x54,%eax
jne    1143 <dna2rna+0x43>
mov    -0x8(%rbp),%rax
movb   $0x55,(%rax)
jmp    1148 <dna2rna+0x48>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <dna2rna+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dna2rna>:
jmp    1118 <dna2rna+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x55,%cl
mov    %cl,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x54,%al
je     1110 <dna2rna+0x10>
mov    $0x75,%cl
cmp    $0x74,%al
je     1112 <dna2rna+0x12>
test   %al,%al
jne    1114 <dna2rna+0x14>
ret

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

LLVM IR (-O2):
define void @dna2rna(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %10
i8 116, label %6
i8 84, label %5
]
5: ; preds = %2
br label %6
6: ; preds = %2, %5
%7 = phi i8 [ 85, %5 ], [ 117, %2 ]
store i8 %7, i8* %3
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
void *mydlvsym(void *handle, const char *name, const char *version,
               void *dl_caller) {
  ;
  return NULL;
}


x86 assembly (clang, -O0):
<mydlvsym>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @mydlvsym(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mydlvsym(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ok(int Zustand) {
  printf("(Endzustand %i), Zeichenkette korrekt!\n", Zustand);
}


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

x86 assembly (clang, -O2):
<ok>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [40 x i8] c"(Endzustand %i), Zeichenkette korrekt!\0A\00"
define void @ok(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(int, int);
void ft_putn_fd(int n, int fd) {
  if (n > 9)
    ft_putn_fd(n / 10, fd);
  ft_putchar_fd((n % 10) + '0', fd);
}


x86 assembly (clang, -O0):
<ft_putn_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    114d <ft_putn_fd+0x2d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1030 <ft_putn_fd@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
mov    -0x8(%rbp),%esi
call   1040 <ft_putchar_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putn_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
cmp    $0xa,%edi
jl     1142 <ft_putn_fd+0x22>
mov    %ebx,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
mov    %ebp,%esi
call   1030 <ft_putn_fd@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x30,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_putchar_fd@plt>

LLVM IR (-O0):
define void @ft_putn_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 10
%10 = load i32, i32* %4
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* %3
%13 = srem i32 %12, 10
%14 = add nsw i32 %13, 48
%15 = load i32, i32* %4
%16 = call i32 @ft_putchar_fd(i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @ft_putn_fd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i32 %0, 10
tail call void @ft_putn_fd(i32 %5, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = srem i32 %0, 10
%8 = add nsw i32 %7, 48
%9 = tail call i32 @ft_putchar_fd(i32 %8, i32 %1)
ret void
}
void making_cmake_happy(void) {}


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

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

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

LLVM IR (-O2):
define void @making_cmake_happy() {
ret void
}
/* Variables and functions */
double M2y_z(double, double, double, double);
double M2z_y(double sign, double xi, double et, double qq) {
  return M2y_z(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<M2z_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <M2y_z@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M2z_y>:
jmp    1030 <M2y_z@plt>

LLVM IR (-O0):
define double @M2z_y(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @M2y_z(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @M2z_y(double %0, double %1, double %2, double %3) {
%5 = tail call double @M2y_z(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
char *dlerror();
int /*<<< orphan*/ k_mod_set_error(char const *);
void _k_mod_dl_set_error(void) {
  const char *err = dlerror();
  if (!err)
    err = "unknown dlerror";
  k_mod_set_error(err);
}


x86 assembly (clang, -O0):
<_k_mod_dl_set_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1149 <_k_mod_dl_set_error+0x29>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <k_mod_set_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_k_mod_dl_set_error>:
push   %rax
xor    %eax,%eax
call   1030 <dlerror@plt>
test   %rax,%rax
lea    0xece(%rip),%rdi
cmovne %rax,%rdi
pop    %rax
jmp    1040 <k_mod_set_error@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"unknown dlerror\00"
define void @_k_mod_dl_set_error() {
%1 = alloca i8*
%2 = call i8* (...) @dlerror()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i8*, i8** %1
%8 = call i32 @k_mod_set_error(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"unknown dlerror\00"
define void @_k_mod_dl_set_error() {
%1 = tail call i8* (...) @dlerror()
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1
%4 = tail call i32 @k_mod_set_error(i8* %3)
ret void
}
void rop3_7_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_7_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
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %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_7_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %sil,%cl
or     %dl,%sil
not    %sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_7_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 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_7_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %2, %1
%7 = xor i8 %6, -1
%8 = or i8 %5, %7
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
void ASN1_primitive_new(void) {}


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

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

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

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