xunge/DecIR huggingface dataset:
/* Variables and functions */
void *memset(void *s, int c, size_t n) {
  if (s != NULL) {
    for (int i = 0; i < n; i++) {
      *(char *)s = c;
    }
  }
  return s;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <memset+0x4d>
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1148 <memset+0x48>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1121 <memset+0x21>
jmp    114d <memset+0x4d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %rdi,%rax
test   %rdi,%rdi
je     1110 <memset+0x10>
test   %rdx,%rdx
je     1110 <memset+0x10>
mov    %sil,(%rax)
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i64 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = trunc i32 %1 to i8
store i8 %8, i8* %0
br label %9
9: ; preds = %7, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ realloc(char *, int);
char *remem_t(char *p, int i) {
  char *aux;
  aux = (char *)realloc(p, i * sizeof(char));
  if (aux == NULL) {
    printf("Erreur d'allocation de memoire'\n");
    exit(-1);
  }
  p = aux;
  return p;
}


x86 assembly (clang, -O0):
<remem_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <remem_t+0x47>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remem_t>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <remem_t+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Erreur d'allocation de memoire'\0A\00"
define i8* @remem_t(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 1
%10 = trunc i64 %9 to i32
%11 = call i64 @realloc(i8* %6, i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = load i8*, i8** %5
store i8* %19, i8** %3
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@str = [32 x i8] c"Erreur d'allocation de memoire'\00"
define i8* @remem_t(i8* %0, i32 %1) {
%3 = tail call i64 @realloc(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = inttoptr i64 %3 to i8*
ret i8* %9
}
void encrypt_data(char *buffer, const char *key, int length) {
  if (key) {
  }
}


x86 assembly (clang, -O0):
<encrypt_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     111f <encrypt_data+0x1f>
jmp    111f <encrypt_data+0x1f>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @encrypt_data(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** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %3
br label %10
10: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @encrypt_data(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
void Abort(s) char *s;
{
  c("(abort\")");
  place_string(s);
}


x86 assembly (clang, -O0):
<Abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <c@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <place_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abort>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <c@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <place_string@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"(abort\22)\00"
define void @Abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @c to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @place_string to i32 (i8*, ...)*)(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"(abort\22)\00"
define void @Abort(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @c to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @place_string to i32 (i8*, ...)*)(i8* %0)
ret void
}
int sectorNumber(char one, char two) {}


x86 assembly (clang, -O0):
<sectorNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sectorNumber(i8 signext %0, i8 signext %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int main() {
#pragma omp parallel
  {
    printf("\nhello world ");
    printf("hello from thread number %d \n", omp_get_thread_num());
    fflush(stdout);
  }
  printf("\ngoodbye world \n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_thread_num@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0Ahello world \00"
@.str.1 = [30 x i8] c"hello from thread number %d \0A\00"
@stdout = global i32 0
@.str.2 = [18 x i8] c"\0Agoodbye world \0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @omp_get_thread_num()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0Ahello world \00"
@.str.1 = [30 x i8] c"hello from thread number %d \0A\00"
@stdout = global i32 0
@str = [17 x i8] c"\0Agoodbye world \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @omp_get_thread_num()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int MFRC522_ReadRegister(int);
int /*<<< orphan*/ MFRC522_WriteRegister(int, int);
void MFRC522_ClearBitMask(uint8_t reg, uint8_t mask) {
  MFRC522_WriteRegister(reg, MFRC522_ReadRegister(reg) & (~mask));
}


x86 assembly (clang, -O0):
<MFRC522_ClearBitMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <MFRC522_ReadRegister@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1040 <MFRC522_WriteRegister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_ClearBitMask>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <MFRC522_ReadRegister@plt>
not    %ebx
and    %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <MFRC522_WriteRegister@plt>

LLVM IR (-O0):
define void @MFRC522_ClearBitMask(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* %3
%7 = call i32 @MFRC522_ReadRegister(i32 %6)
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = call i32 @MFRC522_WriteRegister(i32 %5, i32 %10)
ret void
}

LLVM IR (-O2):
define void @MFRC522_ClearBitMask(i32 %0, i32 %1) {
%3 = tail call i32 @MFRC522_ReadRegister(i32 %0)
%4 = xor i32 %1, -1
%5 = and i32 %3, %4
%6 = tail call i32 @MFRC522_WriteRegister(i32 %0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int xsleep(int n) {
  printf("sleep() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<xsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xsleep>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"sleep() not implemented\0A\00"
define i32 @xsleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"sleep() not implemented\00"
define i32 @xsleep(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
swap() { ol("exg\td,x"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"exg\09d,x\00"
define i32 @swap() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"exg\09d,x\00"
define i32 @swap() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int vsprintf_help(unsigned c, void **ptr) {
  char *dst;
  dst = *ptr;
  *dst++ = (char)c;
  *ptr = dst;
  return 0;
}


x86 assembly (clang, -O0):
<vsprintf_help>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf_help>:
mov    (%rsi),%rax
mov    %dil,(%rax)
add    $0x1,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vsprintf_help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
store i8 %9, i8* %10
%12 = load i8*, i8** %5
%13 = load i8**, i8*** %4
store i8* %12, i8** %13
ret i32 0
}

LLVM IR (-O2):
define i32 @vsprintf_help(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = trunc i32 %0 to i8
%5 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %4, i8* %3
store i8* %5, i8** %1
ret i32 0
}
void XtManageChild() {}


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

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

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

LLVM IR (-O2):
define void @XtManageChild() {
ret void
}
int compare_fn_default(const void *obj1, const void *obj2) {
  if (obj1 == obj2)
    return 0;
  return (obj1 < obj2 ? -1 : 1);
}


x86 assembly (clang, -O0):
<compare_fn_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <compare_fn_default+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1141 <compare_fn_default+0x41>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_fn_default>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
setae  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_fn_default(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = icmp ult i8* %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 1
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare_fn_default(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
struct string_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct string_table *);
void strtbl_free(struct string_table *tbl) { free(tbl); }


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

x86 assembly (clang, -O2):
<strtbl_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.string_table = type { i32 }
define void @strtbl_free(%struct.string_table* nocapture %0) {
%2 = tail call i32 @free(%struct.string_table* %0)
ret void
}
void vec2_subtract(float *dst, float *b) {
  dst[0] = dst[0] - b[0];
  dst[1] = dst[1] - b[1];
}


x86 assembly (clang, -O0):
<vec2_subtract>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_subtract>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
subss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
subss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @vec2_subtract(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = fsub float %7, %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fsub float %16, %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 1
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @vec2_subtract(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fsub float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fsub float %7, %9
store float %10, float* %6
ret void
}
int test_imm_61uint8_mem(unsigned char *val) {
  return ((*val) & (-0x61 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_61uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -97
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *argv0) {
  fprintf(stderr, "Usage: %s database\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s database\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s database\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int ftok(char *, int /*<<< orphan*/);
int shmman_create_handle(int handle) { return ftok("/tmp", 0); }


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

x86 assembly (clang, -O2):
<shmman_create_handle>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <ftok@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"/tmp\00"
define i32 @shmman_create_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
define i32 @shmman_create_handle(i32 %0) {
%2 = tail call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void SetDispNormal() { WRITETEST("\033[0m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define void @SetDispNormal() {
%1 = call i32 @WRITETEST(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[0m\00"
define void @SetDispNormal() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isSubstr(char *, char *);
int main(int argc, const char *argv[]) {
  isSubstr("RuchikRuchikARuchikSRuchikDRuchikM", "RuchikD");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    0xeef(%rip),%rsi
call   1030 <isSubstr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"RuchikRuchikARuchikSRuchikDRuchikM\00"
@.str.1 = [8 x i8] c"RuchikD\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @isSubstr(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"RuchikRuchikARuchikSRuchikDRuchikM\00"
@.str.1 = [8 x i8] c"RuchikD\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isSubstr(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
reg0reg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (r0 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     113b <reg0reg1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <reg0reg1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0reg1>:
shl    $0x10,%edi
shl    $0x10,%esi
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @reg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %8
%17 = sext i16 %16 to i32
%18 = load i16, i16* %9
%19 = sext i16 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @reg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = shl i32 %0, 16
%8 = shl i32 %1, 16
%9 = icmp sle i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void arthur_emc_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @arthur_emc_init() {
ret void
}
float fsqr(float f) { return f * f; }


x86 assembly (clang, -O0):
<fsqr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsqr>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @fsqr(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printc_err(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void pr_error(const char *prefix) {
  printc_err("%s: %s\n", prefix, strerror(errno));
}


x86 assembly (clang, -O0):
<pr_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
call   1030 <printc_err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printc_err@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @pr_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @printc_err(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @pr_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @printc_err(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
int main() {
  int a = 4;
  int b = 2;
  int c = 3;
  int d = 6;
  a = (b + c) * d - a;
  b = a - c + a * a + d / b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 4, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 6, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %1
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = load i32, i32* %1
%16 = load i32, i32* %1
%17 = mul nsw i32 %15, %16
%18 = add nsw i32 %14, %17
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = sdiv i32 %19, %20
%22 = add nsw i32 %18, %21
store i32 %22, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_conv();
int /*<<< orphan*/ test_psig();
int /*<<< orphan*/ test_siglist();
int /*<<< orphan*/ test_strsig();
int main() {
  test_siglist();
  test_psig();
  test_strsig();
  test_conv();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_siglist@plt>
mov    $0x0,%al
call   1030 <test_psig@plt>
mov    $0x0,%al
call   1040 <test_strsig@plt>
mov    $0x0,%al
call   1050 <test_conv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_siglist@plt>
xor    %eax,%eax
call   1030 <test_psig@plt>
xor    %eax,%eax
call   1040 <test_strsig@plt>
xor    %eax,%eax
call   1050 <test_conv@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_siglist()
%3 = call i32 (...) @test_psig()
%4 = call i32 (...) @test_strsig()
%5 = call i32 (...) @test_conv()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_siglist()
%2 = tail call i32 (...) @test_psig()
%3 = tail call i32 (...) @test_strsig()
%4 = tail call i32 (...) @test_conv()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putxy(char, int, int);
int strlen(char *);
void putsxy(char *text, int x, int y) {
  int i;
  for (i = 0; i < strlen(text); i++) {
    putxy(text[i], x + i, y);
  }
}


x86 assembly (clang, -O0):
<putsxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    117f <putsxy+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
movsbl %al,%edi
call   1040 <putxy@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <putsxy+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putsxy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1163 <putsxy+0x43>
mov    %r14d,%r14d
xor    %ebp,%ebp
xchg   %ax,%ax
movsbl (%rbx,%rbp,1),%edi
lea    (%r14,%rbp,1),%esi
mov    %r15d,%edx
call   1040 <putxy@plt>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1140 <putsxy+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @putsxy(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %3, %6
%7 = phi i64 [ %13, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i64 %7 to i32
%11 = add i32 %10, %1
%12 = tail call i32 @putxy(i8 signext %9, i32 %11, i32 %2)
%13 = add nuw nsw i64 %7, 1
%14 = tail call i32 @strlen(i8* %0)
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %3
ret void
}
int test_imm_D4uint8_reg(unsigned char val) {
  return ((val) & (-0xD4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 44
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MD5_String2binary(char const *, unsigned char *);
void MD5_Binary(const char *string, unsigned char *output) {
  MD5_String2binary(string, output);
}


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

x86 assembly (clang, -O2):
<MD5_Binary>:
jmp    1030 <MD5_String2binary@plt>

LLVM IR (-O0):
define void @MD5_Binary(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 @MD5_String2binary(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @MD5_Binary(i8* %0, i8* %1) {
%3 = tail call i32 @MD5_String2binary(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bswap(uint32_t x) {
  const uint32_t b0 = x & 0xff;
  const uint32_t b1 = (x >> 8) & 0xff;
  const uint32_t b2 = (x >> 16) & 0xff;
  const uint32_t b3 = (x >> 24) & 0xff;
  return (b0 << 24) | (b1 << 16) | (b2 << 8) | b3;
}


x86 assembly (clang, -O0):
<bswap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x18,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = and i32 %13, 255
store i32 %14, i32* %5
%15 = load i32, i32* %2
%16 = ashr i32 %15, 24
%17 = and i32 %16, 255
store i32 %17, i32* %6
%18 = load i32, i32* %3
%19 = shl i32 %18, 24
%20 = load i32, i32* %4
%21 = shl i32 %20, 16
%22 = or i32 %19, %21
%23 = load i32, i32* %5
%24 = shl i32 %23, 8
%25 = or i32 %22, %24
%26 = load i32, i32* %6
%27 = or i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @bswap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int crc32c_intel(unsigned int, unsigned char);
int /*<<< orphan*/ printf(char *, unsigned int);
main() {
  unsigned int crc = 1;
  unsigned char input = 100;
  unsigned int res = crc32c_intel(crc, input);
  printf("Result res: %u\n", res);
  assert(res == 1412925310);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movb   $0x64,-0x5(%rbp)
mov    -0x4(%rbp),%edi
movzbl -0x5(%rbp),%esi
call   1040 <crc32c_intel@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5437877e,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x64,%esi
call   1040 <crc32c_intel@plt>
mov    %eax,%ebx
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
cmp    $0x5437877e,%ebx
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Result res: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 1, i32* %1
store i8 100, i8* %2
%4 = load i32, i32* %1
%5 = load i8, i8* %2
%6 = call i32 @crc32c_intel(i32 %4, i8 zeroext %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1412925310
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Result res: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @crc32c_intel(i32 1, i8 zeroext 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 1412925310
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 0
}
int blah3_fcn(int (*(*fcn_ptrs)[4])(int)) {
  (*fcn_ptrs)[0]('g');
  (*fcn_ptrs)[1]('h');
  (*fcn_ptrs)[2]('i');
  (*fcn_ptrs)[3]('j');
  return 0;
}


x86 assembly (clang, -O0):
<blah3_fcn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x67,%edi
call   *(%rax)
mov    -0x8(%rbp),%rax
mov    $0x68,%edi
call   *0x8(%rax)
mov    -0x8(%rbp),%rax
mov    $0x69,%edi
call   *0x10(%rax)
mov    -0x8(%rbp),%rax
mov    $0x6a,%edi
call   *0x18(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blah3_fcn>:
push   %rbx
mov    %rdi,%rbx
mov    $0x67,%edi
call   *(%rbx)
mov    $0x68,%edi
call   *0x8(%rbx)
mov    $0x69,%edi
call   *0x10(%rbx)
mov    $0x6a,%edi
call   *0x18(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @blah3_fcn([4 x i32 (i32)*]* %0) {
%2 = alloca [4 x i32 (i32)*]*
store [4 x i32 (i32)*]* %0, [4 x i32 (i32)*]** %2
%3 = load [4 x i32 (i32)*]*, [4 x i32 (i32)*]** %2
%4 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %3, i64 0, i64 0
%5 = load i32 (i32)*, i32 (i32)** %4
%6 = call i32 %5(i32 103)
%7 = load [4 x i32 (i32)*]*, [4 x i32 (i32)*]** %2
%8 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %7, i64 0, i64 1
%9 = load i32 (i32)*, i32 (i32)** %8
%10 = call i32 %9(i32 104)
%11 = load [4 x i32 (i32)*]*, [4 x i32 (i32)*]** %2
%12 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %11, i64 0, i64 2
%13 = load i32 (i32)*, i32 (i32)** %12
%14 = call i32 %13(i32 105)
%15 = load [4 x i32 (i32)*]*, [4 x i32 (i32)*]** %2
%16 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %15, i64 0, i64 3
%17 = load i32 (i32)*, i32 (i32)** %16
%18 = call i32 %17(i32 106)
ret i32 0
}

LLVM IR (-O2):
define i32 @blah3_fcn([4 x i32 (i32)*]* nocapture %0) {
%2 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %0, i64 0, i64 0
%3 = load i32 (i32)*, i32 (i32)** %2
%4 = tail call i32 %3(i32 103)
%5 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %0, i64 0, i64 1
%6 = load i32 (i32)*, i32 (i32)** %5
%7 = tail call i32 %6(i32 104)
%8 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %0, i64 0, i64 2
%9 = load i32 (i32)*, i32 (i32)** %8
%10 = tail call i32 %9(i32 105)
%11 = getelementptr inbounds [4 x i32 (i32)*], [4 x i32 (i32)*]* %0, i64 0, i64 3
%12 = load i32 (i32)*, i32 (i32)** %11
%13 = tail call i32 %12(i32 106)
ret i32 0
}
void convCurrency(double inputDollars, double *convEuro, double *convDkk,
                  double *convRubles, double *convYen) {
  *convEuro = 0.89 * inputDollars;
  *convDkk = 6.66 * inputDollars;
  *convRubles = 66.43 * inputDollars;
  *convYen = 119.9 * inputDollars;
}


x86 assembly (clang, -O0):
<convCurrency>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xeda(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xebd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xea0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convCurrency>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
mulsd  0xee0(%rip),%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define void @convCurrency(double %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = fmul double 8.900000e-01, %11
%13 = load double*, double** %7
store double %12, double* %13
%14 = load double, double* %6
%15 = fmul double 6.660000e+00, %14
%16 = load double*, double** %8
store double %15, double* %16
%17 = load double, double* %6
%18 = fmul double 6.643000e+01, %17
%19 = load double*, double** %9
store double %18, double* %19
%20 = load double, double* %6
%21 = fmul double 1.199000e+02, %20
%22 = load double*, double** %10
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @convCurrency(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fmul double %0, 8.900000e-01
store double %6, double* %1
%7 = fmul double %0, 6.660000e+00
store double %7, double* %2
%8 = fmul double %0, 6.643000e+01
store double %8, double* %3
%9 = fmul double %0, 1.199000e+02
store double %9, double* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
void sys_select_FD_SET(int fd, fd_set *set) { FD_SET(fd, set); }


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

x86 assembly (clang, -O2):
<sys_select_FD_SET>:
jmp    1030 <FD_SET@plt>

LLVM IR (-O0):
define void @sys_select_FD_SET(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 = call i32 @FD_SET(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @sys_select_FD_SET(i32 %0, i32* %1) {
%3 = tail call i32 @FD_SET(i32 %0, i32* %1)
ret void
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
int netUrlHeadExt(char *, char *, struct hash *);
int netUrlHead(char *url, struct hash *hash) {
  return netUrlHeadExt(url, "HEAD", hash);
}


x86 assembly (clang, -O0):
<netUrlHead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <netUrlHeadExt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netUrlHead>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <netUrlHeadExt@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
@.str = [5 x i8] c"HEAD\00"
define i32 @netUrlHead(i8* %0, %struct.hash* %1) {
%3 = alloca i8*
%4 = alloca %struct.hash*
store i8* %0, i8** %3
store %struct.hash* %1, %struct.hash** %4
%5 = load i8*, i8** %3
%6 = load %struct.hash*, %struct.hash** %4
%7 = call i32 @netUrlHeadExt(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.hash* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.hash = type { i32 }
@.str = [5 x i8] c"HEAD\00"
define i32 @netUrlHead(i8* %0, %struct.hash* %1) {
%3 = tail call i32 @netUrlHeadExt(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.hash* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void msg(char *str) { printf("%s", str); }


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

x86 assembly (clang, -O2):
<msg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @msg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void metric_der_lapse(const double x[3], double da[4]) {
  int i;
  for (i = 0; i < 4; i++)
    da[i] = 0.0;
}


x86 assembly (clang, -O0):
<metric_der_lapse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    113b <metric_der_lapse+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <metric_der_lapse+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric_der_lapse>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rsi)
movups %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @metric_der_lapse(double* nocapture readnone %0, double* nocapture writeonly %1) {
%3 = bitcast double* %1 to i8*
ret void
}