xunge/DecIR huggingface dataset:
rnd(n) int n;
{
  long random();
  return ((unsigned)random() % (unsigned)n);
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @random()
%4 = trunc i64 %3 to i32
%5 = load i32, i32* %2
%6 = urem i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i64 (...) @random()
%3 = trunc i64 %2 to i32
%4 = urem i32 %3, %0
ret i32 %4
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list *);
int /*<<< orphan*/ list_reset(struct list *);
void list_free(struct list *list) {
  list_reset(list);
  free(list);
}


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

x86 assembly (clang, -O2):
<list_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_free(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = call i32 @list_reset(%struct.list* %3)
%5 = load %struct.list*, %struct.list** %2
%6 = call i32 @free(%struct.list* %5)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_free(%struct.list* %0) {
%2 = tail call i32 @list_reset(%struct.list* %0)
%3 = tail call i32 @free(%struct.list* %0)
ret void
}
void ARGBToUVRow_SSSE3() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTSgBufClone() {
ret void
}
/* Variables and functions */
int strcasecmp(char *, char *);
int strcasecmp_n(char *a, char *b) { return strcasecmp(a, b); }


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

x86 assembly (clang, -O2):
<strcasecmp_n>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp_n(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ sig_block(int /*<<< orphan*/);
extern void sig_quit_block(void) { sig_block(SIGQUIT); }


x86 assembly (clang, -O0):
<sig_quit_block>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_quit_block>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_block@plt>

LLVM IR (-O0):
@SIGQUIT = global i32 0
define void @sig_quit_block() {
%1 = load i32, i32* @SIGQUIT
%2 = call i32 @sig_block(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGQUIT = global i32 0
define void @sig_quit_block() {
%1 = load i32, i32* @SIGQUIT
%2 = tail call i32 @sig_block(i32 %1)
ret void
}
int VecDotProd3iv(const int a[3], const int b[3]) {
  return (a[0] * b[0] + a[1] * b[1] + a[2] * b[2]);
}


x86 assembly (clang, -O0):
<VecDotProd3iv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x4(%rdx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x8(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecDotProd3iv>:
mov    (%rsi),%eax
imul   (%rdi),%eax
mov    0x4(%rsi),%ecx
imul   0x4(%rdi),%ecx
add    %eax,%ecx
mov    0x8(%rsi),%eax
imul   0x8(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @VecDotProd3iv(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = add nsw i32 %11, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = mul nsw i32 %22, %25
%27 = add nsw i32 %19, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @VecDotProd3iv(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, %13
%17 = add nsw i32 %11, %16
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ sleep(int);
void writer(const char *message, int count, FILE *stream) {
  for (; count > 0; --count) {
    fprintf(stream, "%s\n", message);
    fflush(stream);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<writer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1182 <writer+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <writer+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1178 <writer+0x48>
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
add    $0x1,%ebp
lea    0xeb3(%rip),%r15
nopl   (%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1150 <writer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @writer(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
br label %7
7: ; preds = %17, %3
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32*, i32** %6
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %6
%15 = call i32 @fflush(i32* %14)
%16 = call i32 @sleep(i32 1)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writer(i8* %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %1, %3 ]
%7 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @fflush(i32* %2)
%9 = tail call i32 @sleep(i32 1)
%10 = add nsw i32 %6, -1
%11 = icmp ugt i32 %6, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
void arch_spin_lock_init(unsigned long *lock) { *lock = 0; }


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

x86 assembly (clang, -O2):
<arch_spin_lock_init>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @arch_spin_lock_init(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: fillerup [-h] [-q] filename");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: fillerup [-h] [-q] filename\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: fillerup [-h] [-q] filename\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void writeLines(char *lineptr[], int nLines) {
  while (nLines-- > 0) {
    printf("%s\n", *lineptr++);
  }
}


x86 assembly (clang, -O0):
<writeLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1158 <writeLines+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <writeLines+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeLines>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <writeLines+0x36>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x8,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <writeLines+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @writeLines(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8**, i8*** %3
%11 = getelementptr inbounds i8*, i8** %10, i32 1
store i8** %11, i8*** %3
%12 = load i8*, i8** %10
%13 = ptrtoint i8* %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writeLines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8** [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ugt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CloseCOM(int);
int /*<<< orphan*/ DS2480Detect(int);
int OpenCOMEx(char *);
int /*<<< orphan*/ owRaiseError(int);
int owAcquireEx(char *port_zstr) {
  int portnum;
  if ((portnum = OpenCOMEx(port_zstr)) < 0) {
    owRaiseError(8);
    return -1;
  }
  if (!DS2480Detect(portnum)) {
    CloseCOM(portnum);
    owRaiseError(5);
    return -1;
  }
  return portnum;
}


x86 assembly (clang, -O0):
<owAcquireEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <OpenCOMEx@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1177 <owAcquireEx+0x37>
mov    $0x8,%edi
call   1060 <owRaiseError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ac <owAcquireEx+0x6c>
mov    -0x14(%rbp),%edi
call   1030 <DS2480Detect@plt>
cmp    $0x0,%eax
jne    11a6 <owAcquireEx+0x66>
mov    -0x14(%rbp),%edi
call   1050 <CloseCOM@plt>
mov    $0x5,%edi
call   1060 <owRaiseError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ac <owAcquireEx+0x6c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owAcquireEx>:
push   %rbx
call   1040 <OpenCOMEx@plt>
test   %eax,%eax
js     1165 <owAcquireEx+0x25>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <DS2480Detect@plt>
test   %eax,%eax
jne    1174 <owAcquireEx+0x34>
mov    %ebx,%edi
call   1050 <CloseCOM@plt>
mov    $0x5,%edi
jmp    116a <owAcquireEx+0x2a>
mov    $0x8,%edi
call   1060 <owRaiseError@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @owAcquireEx(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @OpenCOMEx(i8* %5)
store i32 %6, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @owRaiseError(i32 8)
store i32 -1, i32* %2
br label %20
10: ; preds = %1
%11 = load i32, i32* %4
%12 = call i32 @DS2480Detect(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = call i32 @CloseCOM(i32 %15)
%17 = call i32 @owRaiseError(i32 5)
store i32 -1, i32* %2
br label %20
18: ; preds = %10
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %14, %8
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @owAcquireEx(i8* %0) {
%2 = tail call i32 @OpenCOMEx(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @DS2480Detect(i32 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = tail call i32 @CloseCOM(i32 %2)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 5, %7 ], [ 8, %1 ]
%11 = tail call i32 @owRaiseError(i32 %10)
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ %2, %4 ], [ -1, %9 ]
ret i32 %13
}
/* Variables and functions */
int *ecalloc(int, int);
int *cvt_alloc_chpos(int len) {
  int i;
  int *chpos = ecalloc(sizeof(int), len);
  for (i = 0; i < len; i++)
    chpos[i] = -1;
  return (chpos);
}


x86 assembly (clang, -O0):
<cvt_alloc_chpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
call   1030 <ecalloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <cvt_alloc_chpos+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <cvt_alloc_chpos+0x23>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_alloc_chpos>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
mov    %ebp,%esi
call   1030 <ecalloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    114b <cvt_alloc_chpos+0x2b>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @cvt_alloc_chpos(i32 %0) {
%2 = tail call i32* @ecalloc(i32 4, i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = bitcast i32* %2 to i8*
%6 = zext i32 %0 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %1
ret i32* %2
}
const char *arakoon_library_version_info(void) {
  return "CRAKOON_VERSION"
         "-"
         "CRAKOON_GIT_VERSION";
}


x86 assembly (clang, -O0):
<arakoon_library_version_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arakoon_library_version_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [36 x i8] c"CRAKOON_VERSION-CRAKOON_GIT_VERSION\00"
define i8* @arakoon_library_version_info() {
ret i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [36 x i8] c"CRAKOON_VERSION-CRAKOON_GIT_VERSION\00"
define i8* @arakoon_library_version_info() {
ret i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ end_dd();
int /*<<< orphan*/ paragraphen_ende();
void end_dl() {
  paragraphen_ende();
  end_dd();
}


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

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

LLVM IR (-O0):
define void @end_dl() {
%1 = call i32 (...) @paragraphen_ende()
%2 = call i32 (...) @end_dd()
ret void
}

LLVM IR (-O2):
define void @end_dl() {
%1 = tail call i32 (...) @paragraphen_ende()
%2 = tail call i32 (...) @end_dd()
ret void
}
int h(int x, int y) {
  if ((x >= 0 && x <= 1) && (y >= 0 && y <= 1))
    return x && y;
  else
    return -1;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115b <h+0x5b>
cmpl   $0x1,-0x8(%rbp)
jg     115b <h+0x5b>
cmpl   $0x0,-0xc(%rbp)
jl     115b <h+0x5b>
cmpl   $0x1,-0xc(%rbp)
jg     115b <h+0x5b>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     114b <h+0x4b>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <h+0x62>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    %esi,%eax
or     %edi,%eax
test   %edi,%edi
setne  %cl
test   %esi,%esi
setne  %dl
and    %cl,%dl
cmp    $0x2,%eax
movzbl %dl,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @h(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* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %26
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %5
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp sle i32 %15, 1
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ false, %17 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %3
br label %27
26: ; preds = %14, %11, %8, %2
store i32 -1, i32* %3
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @h(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 2
%5 = icmp ne i32 %0, 0
%6 = icmp ne i32 %1, 0
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
%9 = select i1 %4, i32 %8, i32 -1
ret i32 %9
}
void foo_1_1_1_1_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_2_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_bytes(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void string_eg() {
  char *s = "ABCDEF";
  show_bytes(s, strlen(s));
}


x86 assembly (clang, -O0):
<string_eg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <show_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_eg>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <show_bytes@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ABCDEF\00"
define void @string_eg() {
%1 = alloca i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @show_bytes(i8* %2, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ABCDEF\00"
define void @string_eg() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @show_bytes(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
CONSTRUCTOR() { printf("In forwarder constructor\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"In forwarder constructor\0A\00"
define i32 @CONSTRUCTOR() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [25 x i8] c"In forwarder constructor\00"
define i32 @CONSTRUCTOR() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void clear_bit(unsigned long int nr, unsigned long *bitmap) {
  unsigned long offset = nr / ((int)sizeof(long) * 8);
  unsigned long bit = nr & (((int)sizeof(long) * 8) - 1);
  bitmap[offset] &= ~(1UL << bit);
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3f,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
and    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %rdi,%rcx
mov    %rdi,%rax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
shr    $0x6,%rax
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @clear_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64* %1, i64** %4
%7 = load i64, i64* %3
%8 = udiv i64 %7, 64
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = and i64 %9, 63
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = shl i64 1, %11
%13 = xor i64 %12, -1
%14 = load i64*, i64** %4
%15 = load i64, i64* %5
%16 = getelementptr inbounds i64, i64* %14, i64 %15
%17 = load i64, i64* %16
%18 = and i64 %17, %13
store i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
define void @clear_bit(i64 %0, i64* nocapture %1) {
%3 = lshr i64 %0, 6
%4 = and i64 %0, 63
%5 = shl nuw i64 1, %4
%6 = xor i64 %5, -1
%7 = getelementptr inbounds i64, i64* %1, i64 %3
%8 = load i64, i64* %7
%9 = and i64 %8, %6
store i64 %9, i64* %7
ret void
}
char *tcp_canonical(char *name) { return name; }


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

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

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

LLVM IR (-O2):
define i8* @tcp_canonical(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char **);
int main(void) {
  char array[5];
  printf("    array = %p\n&array[0] = %p\n    &array = %p\n", array, &array[0],
         &array);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c" array = %p\0A&array[0] = %p\0A &array = %p\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = bitcast [5 x i8]* %1 to i8**
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2, i8** %3)
ret i32 0
}
void dd_pbl_ios_localytics_track_screen(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @dd_pbl_ios_localytics_track_screen(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int STDERR_FILENO;
int STDIN_FILENO;
int STDOUT_FILENO;
int /*<<< orphan*/ close(int);
void close_aux(int fd) {
  if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO) {
    close(fd);
  }
}


x86 assembly (clang, -O0):
<close_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     1159 <close_aux+0x49>
mov    -0x4(%rbp),%eax
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%eax
je     1159 <close_aux+0x49>
mov    -0x4(%rbp),%eax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
je     1159 <close_aux+0x49>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_aux>:
mov    0x2eb9(%rip),%rax
cmp    %edi,(%rax)
je     1136 <close_aux+0x26>
mov    0x2ece(%rip),%rax
cmp    %edi,(%rax)
je     1136 <close_aux+0x26>
mov    0x2eab(%rip),%rax
cmp    %edi,(%rax)
je     1136 <close_aux+0x26>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @close_aux(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @STDIN_FILENO
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @STDOUT_FILENO
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* @STDERR_FILENO
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %2
%16 = call i32 @close(i32 %15)
br label %17
17: ; preds = %14, %10, %6, %1
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @close_aux(i32 %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @STDOUT_FILENO
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32, i32* @STDERR_FILENO
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = tail call i32 @close(i32 %0)
br label %12
12: ; preds = %10, %1
ret void
}
float degrees_to_radians(float degrees) {
  float pi = 3.14159265358979323846f;
  return degrees * pi / 180.0f;
}


x86 assembly (clang, -O0):
<degrees_to_radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xed8(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees_to_radians>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @degrees_to_radians(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0x400921FB60000000, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fmul float %4, %5
%7 = fdiv float %6, 1.800000e+02
ret float %7
}

LLVM IR (-O2):
define float @degrees_to_radians(float %0) {
%2 = fmul float %0, 0x400921FB60000000
%3 = fdiv float %2, 1.800000e+02
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ Throw_serious_error(char const *);
int /*<<< orphan*/ Throw_warning(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void Bug_found(const char *message, int code) {
  Throw_warning("Bug in ACME, code follows");
  fprintf(stderr, "(0x%x:)", code);
  Throw_serious_error(message);
}


x86 assembly (clang, -O0):
<Bug_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <Throw_warning@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <Throw_serious_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bug_found>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xec0(%rip),%rdi
call   1050 <Throw_warning@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <Throw_serious_error@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Bug in ACME, code follows\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"(0x%x:)\00"
define void @Bug_found(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @Throw_warning(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = call i32 @Throw_serious_error(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Bug in ACME, code follows\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"(0x%x:)\00"
define void @Bug_found(i8* %0, i32 %1) {
%3 = tail call i32 @Throw_warning(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%6 = tail call i32 @Throw_serious_error(i8* %0)
ret void
}
void g_thread_create_full() {}


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

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

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

LLVM IR (-O2):
define void @g_thread_create_full() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_color_tab();
int /*<<< orphan*/ reset_potion_color();
int /*<<< orphan*/ reset_potion_tab();
void init_potion(void) {
  init_color_tab();
  reset_potion_tab();
  reset_potion_color();
}


x86 assembly (clang, -O0):
<init_potion>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_color_tab@plt>
mov    $0x0,%al
call   1040 <reset_potion_tab@plt>
mov    $0x0,%al
call   1030 <reset_potion_color@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_potion>:
push   %rax
xor    %eax,%eax
call   1050 <init_color_tab@plt>
xor    %eax,%eax
call   1040 <reset_potion_tab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reset_potion_color@plt>

LLVM IR (-O0):
define void @init_potion() {
%1 = call i32 (...) @init_color_tab()
%2 = call i32 (...) @reset_potion_tab()
%3 = call i32 (...) @reset_potion_color()
ret void
}

LLVM IR (-O2):
define void @init_potion() {
%1 = tail call i32 (...) @init_color_tab()
%2 = tail call i32 (...) @reset_potion_tab()
%3 = tail call i32 (...) @reset_potion_color()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("n+1 = %d\n", 0xe + 1); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"n+1 = %d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"n+1 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hkgc_wash_sstab(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void hkgc_wash() {
  while (1) {
    sleep(20);
    hkgc_wash_sstab(0);
  }
}


x86 assembly (clang, -O0):
<hkgc_wash>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <hkgc_wash+0x9>
mov    $0x14,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <hkgc_wash_sstab@plt>
jmp    1129 <hkgc_wash+0x9>

x86 assembly (clang, -O2):
<hkgc_wash>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x14,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <hkgc_wash_sstab@plt>
jmp    1130 <hkgc_wash+0x10>

LLVM IR (-O0):
define void @hkgc_wash() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 20)
%3 = call i32 @hkgc_wash_sstab(i32 0)
br label %1
}

LLVM IR (-O2):
define void @hkgc_wash() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 20)
%3 = tail call i32 @hkgc_wash_sstab(i32 0)
br label %1
}
void U_EMRCLOSEFIGURE_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_EMRCLOSEFIGURE_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ROL8(int /*<<< orphan*/);
int /*<<< orphan*/ SA1Absolute(int);
void Op2EM1(void) { ROL8(SA1Absolute(3)); }


x86 assembly (clang, -O0):
<Op2EM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
call   1040 <ROL8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op2EM1>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ROL8@plt>

LLVM IR (-O0):
define void @Op2EM1() {
%1 = call i32 @SA1Absolute(i32 3)
%2 = call i32 @ROL8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op2EM1() {
%1 = tail call i32 @SA1Absolute(i32 3)
%2 = tail call i32 @ROL8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void pre_assignment() { write("ganttproject.gan", "\t\t<allocation", NULL); }


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

x86 assembly (clang, -O2):
<pre_assignment>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [14 x i8] c"\09\09<allocation\00"
define void @pre_assignment() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [14 x i8] c"\09\09<allocation\00"
define void @pre_assignment() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
double geoDD2Rads(double dd) { return (dd * (3.14159265358979323846 / 180.0)); }


x86 assembly (clang, -O0):
<geoDD2Rads>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @geoDD2Rads(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F91DF46A2529D39
ret double %4
}

LLVM IR (-O2):
define double @geoDD2Rads(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
ret double %2
}
int next_line(char **line) {
  char *p = *line;
  while (*p != 0 && *p != '\n')
    p++;
  if (*p)
    *line = ++p;
  else
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<next_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1138 <next_line+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1148 <next_line+0x48>
jmp    1159 <next_line+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <next_line+0x13>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     117e <next_line+0x7e>
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    118a <next_line+0x8a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <next_line+0x91>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_line>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1127 <next_line+0x27>
cmp    $0xa,%cl
jne    1110 <next_line+0x10>
mov    %rax,(%rdi)
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @next_line(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %2, %1 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %10
i8 10, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %9, i8** %0
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ 0, %8 ], [ -1, %3 ]
ret i32 %11
}
void SHAREMIND_MAP_KEY_FREE_unsigned_short(unsigned short *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_unsigned_short(i16* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy_toio(void *, void *, unsigned int);
void lpfc_memcpy_to_slim(void *dest, void *src, unsigned int bytes) {
  memcpy_toio(dest, src, bytes);
}


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

x86 assembly (clang, -O2):
<lpfc_memcpy_to_slim>:
jmp    1030 <memcpy_toio@plt>

LLVM IR (-O0):
define void @lpfc_memcpy_to_slim(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @memcpy_toio(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @lpfc_memcpy_to_slim(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy_toio(i8* %0, i8* %1, i32 %2)
ret void
}
char *eatchars(char *str) {
  while (*++str != '\0') {
    if ((*str == '<') || (*str == '>'))
      break;
    if ((*str == ' ') || (*str == '\t'))
      break;
  }
  return (str);
}


x86 assembly (clang, -O0):
<eatchars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1173 <eatchars+0x73>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
je     1144 <eatchars+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
jne    1149 <eatchars+0x49>
jmp    1173 <eatchars+0x73>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1169 <eatchars+0x69>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    116e <eatchars+0x6e>
jmp    1173 <eatchars+0x73>
jmp    1108 <eatchars+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatchars>:
mov    %rdi,%rax
movabs $0x5000000100000201,%rcx
nopl   (%rax)
movzbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    $0x3e,%rdx
ja     1110 <eatchars+0x10>
bt     %rdx,%rcx
jae    1110 <eatchars+0x10>
ret

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

LLVM IR (-O2):
define i8* @eatchars(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
switch i8 %5, label %2 [
i8 0, label %6
i8 60, label %6
i8 62, label %6
i8 32, label %6
i8 9, label %6
]
6: ; preds = %2, %2, %2, %2, %2
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void w16be(uint8_t *buf, uint16_t v) {
  buf[0] = v >> 8;
  buf[1] = v;
}


x86 assembly (clang, -O0):
<w16be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w16be>:
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,(%rdi)
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @w16be(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @w16be(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %4
ret void
}