xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int int8_t;

/* Variables and functions */
int8_t le_to_i8(const uint8_t *buf) {
  return *buf < 0x80 ? (int8_t)*buf : -((int8_t)(0xff - *buf)) - 1;
}


x86 assembly (clang, -O0):
<le_to_i8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x80,(%rax)
jge    1126 <le_to_i8+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    113b <le_to_i8+0x3b>
mov    -0x8(%rbp),%rax
mov    $0xff,%ecx
sub    (%rax),%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_i8>:
mov    (%rdi),%ecx
lea    -0x100(%rcx),%eax
cmp    $0x80,%ecx
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le_to_i8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
br label %15
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = sub nsw i32 255, %11
%13 = sub nsw i32 0, %12
%14 = sub nsw i32 %13, 1
br label %15
15: ; preds = %9, %6
%16 = phi i32 [ %8, %6 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @le_to_i8(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, 128
%4 = add i32 %2, -256
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void p1_rot1(void) { printf("p1_rot1()\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"p1_rot1()\00"
define void @p1_rot1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct jbg85_dec_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, size_t);
int line_out(const struct jbg85_dec_state *s, unsigned char *start, size_t len,
             unsigned long y, void *bitmap) {
  memcpy((unsigned char *)bitmap + len * y, start, len);
  return 0;
}


x86 assembly (clang, -O0):
<line_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rax
imul   -0x20(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_out>:
push   %rax
imul   %rdx,%rcx
lea    (%rcx,%r8,1),%rdi
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.jbg85_dec_state = type { i32 }
define i32 @line_out(%struct.jbg85_dec_state* %0, i8* %1, i64 %2, i64 %3, i8* %4) {
%6 = alloca %struct.jbg85_dec_state*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
store %struct.jbg85_dec_state* %0, %struct.jbg85_dec_state** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %10
%12 = load i64, i64* %8
%13 = load i64, i64* %9
%14 = mul i64 %12, %13
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8*, i8** %7
%17 = load i64, i64* %8
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
ret i32 0
}

LLVM IR (-O2):
%struct.jbg85_dec_state = type { i32 }
define i32 @line_out(%struct.jbg85_dec_state* nocapture readnone %0, i8* %1, i64 %2, i64 %3, i8* %4) {
%6 = mul i64 %3, %2
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = tail call i32 @memcpy(i8* %7, i8* %1, i64 %2)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *cgm_strdup(const char *str) {
  if (str) {
    int size = strlen(str) + 1;
    char *newstr = malloc(size);
    if (newstr)
      memcpy(newstr, str, size);
    return newstr;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<cgm_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118a <cgm_strdup+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117d <cgm_strdup+0x4d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1192 <cgm_strdup+0x62>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgm_strdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1164 <cgm_strdup+0x34>
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1164 <cgm_strdup+0x34>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1166 <cgm_strdup+0x36>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @cgm_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %5)
br label %10
10: ; preds = %1, %3, %8
%11 = phi i8* [ %6, %8 ], [ null, %3 ], [ null, %1 ]
ret i8* %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
unsigned int convertValue(const uint8_t values[4]) {
  return (unsigned int)((values[0] << 24) | (values[1] << 16) |
                        (values[2] << 8) | values[3]);
}


x86 assembly (clang, -O0):
<convertValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertValue>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @convertValue(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @convertValue(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
void eul_angle_to_quat(float x, float y, float z, struct quat *qr) {}


x86 assembly (clang, -O0):
<eul_angle_to_quat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.quat = type opaque
define void @eul_angle_to_quat(float %0, float %1, float %2, %struct.quat* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca %struct.quat*
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store %struct.quat* %3, %struct.quat** %8
ret void
}

LLVM IR (-O2):
%struct.quat = type opaque
define void @eul_angle_to_quat(float %0, float %1, float %2, %struct.quat* nocapture %3) {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned char const *data;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x) {
  return (x->data);
}


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8* }
define i8* @ASN1_STRING_get0_data(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8* }
define i8* @ASN1_STRING_get0_data(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i8*, i8** %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ readline(char *, int);
int main() {
  char str[100];
  readline(str, 100);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1040 <readline@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <readline@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @readline(i8* %2, i32 100)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ mhash_add(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t hash_add(uint32_t hash, uint32_t data) {
  return mhash_add(hash, data);
}


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

x86 assembly (clang, -O2):
<hash_add>:
jmp    1030 <mhash_add@plt>

LLVM IR (-O0):
define i32 @hash_add(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 @mhash_add(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash_add(i32 %0, i32 %1) {
%3 = tail call i32 @mhash_add(i32 %0, i32 %1)
ret i32 %3
}
void DBGFR3AsSymbolByName(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3AsSymbolByName() {
ret void
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sched_setscheduler(pid_t pid, int policy,
                         const struct sched_param *param) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__sched_setscheduler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sched_setscheduler>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@ENOSYS = global i32 0
define i32 @__sched_setscheduler(i32 %0, i32 %1, %struct.sched_param* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sched_param*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.sched_param* %2, %struct.sched_param** %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@ENOSYS = global i32 0
define i32 @__sched_setscheduler(i32 %0, i32 %1, %struct.sched_param* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ log_debug(char *, char *);
int /*<<< orphan*/ readlink(char *, char *, int);
void get_exec_path(char *buf, int bufsize) {
  readlink("/proc/self/exe", buf, bufsize);
  log_debug("Exec path: %s", buf);
}


x86 assembly (clang, -O0):
<get_exec_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <readlink@plt>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1040 <log_debug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_exec_path>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <readlink@plt>
lea    0xed3(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <log_debug@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [14 x i8] c"Exec path: %s\00"
define void @get_exec_path(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @log_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [14 x i8] c"Exec path: %s\00"
define void @get_exec_path(i8* %0, i32 %1) {
%3 = tail call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @log_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ snprintf(char *, int /*<<< orphan*/, char *,
                            int /*<<< orphan*/, int, int /*<<< orphan*/);
char *get_sysinfo_version(char *version) {
  snprintf(version, BUFSIZ, "%i.%i.%i", 0, 3, 0);
  return version;
}


x86 assembly (clang, -O0):
<get_sysinfo_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdx
xor    %r9d,%r9d
mov    $0x3,%r8d
mov    %r9d,%ecx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sysinfo_version>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %r9d,%r9d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @get_sysinfo_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @BUFSIZ
%5 = call i32 @snprintf(i8* %3, i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i32 0)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @get_sysinfo_version(i8* returned %0) {
%2 = load i32, i32* @BUFSIZ
%3 = tail call i32 @snprintf(i8* %0, i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i32 0)
ret i8* %0
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fsm_compose(int /*<<< orphan*/, struct fsm *);
int /*<<< orphan*/ fsm_copy(struct fsm *);
int /*<<< orphan*/ fsm_extract_ambiguous_domain(int /*<<< orphan*/);
int /*<<< orphan*/ fsm_minimize(int /*<<< orphan*/);
struct fsm *fsm_topsort(int /*<<< orphan*/);
struct fsm *fsm_extract_ambiguous(struct fsm *net) {
  struct fsm *result;
  result = fsm_topsort(fsm_minimize(
      fsm_compose(fsm_extract_ambiguous_domain(fsm_copy(net)), net)));
  return (result);
}


x86 assembly (clang, -O0):
<fsm_extract_ambiguous>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_copy@plt>
mov    %eax,%edi
call   1050 <fsm_extract_ambiguous_domain@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1070 <fsm_compose@plt>
mov    %eax,%edi
call   1030 <fsm_minimize@plt>
mov    %eax,%edi
call   1060 <fsm_topsort@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_extract_ambiguous>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fsm_copy@plt>
mov    %eax,%edi
call   1050 <fsm_extract_ambiguous_domain@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1070 <fsm_compose@plt>
mov    %eax,%edi
call   1030 <fsm_minimize@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <fsm_topsort@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_extract_ambiguous(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
%3 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%4 = load %struct.fsm*, %struct.fsm** %2
%5 = call i32 @fsm_copy(%struct.fsm* %4)
%6 = call i32 @fsm_extract_ambiguous_domain(i32 %5)
%7 = load %struct.fsm*, %struct.fsm** %2
%8 = call i32 @fsm_compose(i32 %6, %struct.fsm* %7)
%9 = call i32 @fsm_minimize(i32 %8)
%10 = call %struct.fsm* @fsm_topsort(i32 %9)
store %struct.fsm* %10, %struct.fsm** %3
%11 = load %struct.fsm*, %struct.fsm** %3
ret %struct.fsm* %11
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_extract_ambiguous(%struct.fsm* %0) {
%2 = tail call i32 @fsm_copy(%struct.fsm* %0)
%3 = tail call i32 @fsm_extract_ambiguous_domain(i32 %2)
%4 = tail call i32 @fsm_compose(i32 %3, %struct.fsm* %0)
%5 = tail call i32 @fsm_minimize(i32 %4)
%6 = tail call %struct.fsm* @fsm_topsort(i32 %5)
ret %struct.fsm* %6
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("%ld", fun(20));
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <fun@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fun(i32 20)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
void ce(int *a, int *b) {
  int t;
  if (*a > *b) {
    t = *a;
    *a = *b;
    *b = t;
  }
}


x86 assembly (clang, -O0):
<ce>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    113c <ce+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ce>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
jle    110c <ce+0xc>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @ce(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = icmp sgt i32 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = load i32*, i32** %4
store i32 %17, i32* %18
br label %19
19: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @ce(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %4, i32* %0
store i32 %3, i32* %1
br label %7
7: ; preds = %6, %2
ret void
}
int test_imm_3Fuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x3F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Fuint64_highword_reg>:
movabs $0x3f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Fuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 270582939648
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myinit(int argc, char **argv) { printf("This is run before main()\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"This is run before main()\0A\00"
define void @myinit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"This is run before main()\00"
define void @myinit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void convert_to_unix_filename(char *filename) {
  char *p;
  while ((p = strchr(filename, '\\'))) {
    *p = '/';
  }
}


x86 assembly (clang, -O0):
<convert_to_unix_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <convert_to_unix_filename+0x34>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
jmp    111c <convert_to_unix_filename+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_unix_filename>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1137 <convert_to_unix_filename+0x27>
movb   $0x2f,(%rax)
mov    %rbx,%rdi
jmp    1120 <convert_to_unix_filename+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @convert_to_unix_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 92)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i8*, i8** %3
store i8 47, i8* %9
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @convert_to_unix_filename(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %2, %1 ]
store i8 47, i8* %5
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
float F_C(float n) {
  n -= 32;
  n /= 1.8;
  return n;
}


x86 assembly (clang, -O0):
<F_C>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_C>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @F_C(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
store float %4, float* %2
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %2
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @F_C(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fdiv double %3, 1.800000e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
scalar_t__ M_PI;
double absAngle(scalar_t__);
scalar_t__ calcGreatCircleCourse(double const, double const, double const,
                                 double const);
double calcGreatCircleFinalCourse(const double lat1, const double lon1,
                                  const double lat2, const double lon2) {
  return absAngle(calcGreatCircleCourse(lat2, lon2, lat1, lon1) + M_PI);
}


x86 assembly (clang, -O0):
<calcGreatCircleFinalCourse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
call   1040 <calcGreatCircleCourse@plt>
mov    %rax,%rdi
mov    0x2e89(%rip),%rax
add    (%rax),%rdi
call   1030 <absAngle@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcGreatCircleFinalCourse>:
push   %rax
movaps %xmm1,%xmm4
movaps %xmm0,%xmm5
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
movaps %xmm5,%xmm2
movaps %xmm4,%xmm3
call   1040 <calcGreatCircleCourse@plt>
mov    0x2ea9(%rip),%rcx
add    (%rcx),%rax
mov    %rax,%rdi
pop    %rax
jmp    1030 <absAngle@plt>

LLVM IR (-O0):
@M_PI = global i64 0
define double @calcGreatCircleFinalCourse(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call i64 @calcGreatCircleCourse(double %9, double %10, double %11, double %12)
%14 = load i64, i64* @M_PI
%15 = add nsw i64 %13, %14
%16 = call double @absAngle(i64 %15)
ret double %16
}

LLVM IR (-O2):
@M_PI = global i64 0
define double @calcGreatCircleFinalCourse(double %0, double %1, double %2, double %3) {
%5 = tail call i64 @calcGreatCircleCourse(double %2, double %3, double %0, double %1)
%6 = load i64, i64* @M_PI
%7 = add nsw i64 %6, %5
%8 = tail call double @absAngle(i64 %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA_Ofilm(int, unsigned char *);
unsigned char CmdRdChk_OFILM(void) {
  unsigned char UcTestRD_OFILM;
  unsigned char UcCount_OFILM;
  for (UcCount_OFILM = 0; UcCount_OFILM < 3; UcCount_OFILM++) {
    RegReadA_Ofilm(0x027F, &UcTestRD_OFILM);
    if (UcTestRD_OFILM == 0xAC) {
      return (0);
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<CmdRdChk_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x3,%eax
jge    1161 <CmdRdChk_OFILM+0x51>
mov    $0x27f,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA_Ofilm@plt>
movzbl -0x2(%rbp),%eax
cmp    $0xac,%eax
jne    114f <CmdRdChk_OFILM+0x3f>
movb   $0x0,-0x1(%rbp)
jmp    1165 <CmdRdChk_OFILM+0x55>
jmp    1154 <CmdRdChk_OFILM+0x44>
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    111c <CmdRdChk_OFILM+0xc>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdRdChk_OFILM>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x27f,%edi
call   1030 <RegReadA_Ofilm@plt>
cmpb   $0xac,0x7(%rsp)
je     113d <CmdRdChk_OFILM+0x2d>
lea    0x7(%rsp),%rsi
mov    $0x27f,%edi
call   1030 <RegReadA_Ofilm@plt>
cmpb   $0xac,0x7(%rsp)
jne    1141 <CmdRdChk_OFILM+0x31>
xor    %eax,%eax
pop    %rcx
ret
lea    0x7(%rsp),%rsi
mov    $0x27f,%edi
call   1030 <RegReadA_Ofilm@plt>
cmpb   $0xac,0x7(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CmdRdChk_OFILM() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
store i8 0, i8* %3
br label %4
4: ; preds = %15, %0
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = call i32 @RegReadA_Ofilm(i32 639, i8* %2)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 172
br i1 %12, label %13, label %14
13: ; preds = %8
store i8 0, i8* %1
br label %19
14: ; preds = %8
br label %15
15: ; preds = %14
%16 = load i8, i8* %3
%17 = add i8 %16, 1
store i8 %17, i8* %3
br label %4
18: ; preds = %4
store i8 1, i8* %1
br label %19
19: ; preds = %18, %13
%20 = load i8, i8* %1
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @CmdRdChk_OFILM() {
%1 = alloca i8
%2 = call i32 @RegReadA_Ofilm(i32 639, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, -84
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = call i32 @RegReadA_Ofilm(i32 639, i8* %1)
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, -84
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = call i32 @RegReadA_Ofilm(i32 639, i8* %1)
%11 = load i8, i8* %1
%12 = icmp ne i8 %11, -84
%13 = zext i1 %12 to i8
br label %14
14: ; preds = %9, %5, %0
%15 = phi i8 [ 0, %0 ], [ 0, %5 ], [ %13, %9 ]
ret i8 %15
}
/* Variables and functions */
int /*<<< orphan*/ checked_free(char *);
char *getStringCat2WithSeparator(char *, char *, char *);
char *getCacheTokenPrefix(char *prefix1, char *prefix2) {
  static char *prefix = NULL;
  checked_free(prefix);
  prefix = getStringCat2WithSeparator(prefix1, prefix2, ".");
  return prefix;
}


x86 assembly (clang, -O0):
<getCacheTokenPrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2f01(%rip),%rdi
call   1040 <checked_free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdx
call   1030 <getStringCat2WithSeparator@plt>
mov    %rax,0x2ee1(%rip)
mov    0x2eda(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCacheTokenPrefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2f07(%rip),%rdi
call   1040 <checked_free@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getStringCat2WithSeparator@plt>
mov    %rax,0x2ee9(%rip)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@getCacheTokenPrefix.prefix = internal global i8* null
@.str = [2 x i8] c".\00"
define i8* @getCacheTokenPrefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** @getCacheTokenPrefix.prefix
%6 = call i32 @checked_free(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @getStringCat2WithSeparator(i8* %7, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** @getCacheTokenPrefix.prefix
%10 = load i8*, i8** @getCacheTokenPrefix.prefix
ret i8* %10
}

LLVM IR (-O2):
@getCacheTokenPrefix.prefix = internal unnamed_addr global i8* null
@.str = [2 x i8] c".\00"
define i8* @getCacheTokenPrefix(i8* %0, i8* %1) {
%3 = load i8*, i8** @getCacheTokenPrefix.prefix
%4 = tail call i32 @checked_free(i8* %3)
%5 = tail call i8* @getStringCat2WithSeparator(i8* %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** @getCacheTokenPrefix.prefix
ret i8* %5
}
void vararg3_test() {
  vararg3(0);
  vararg3(1, (void *)0);
  vararg3(2, (void *)0, (void *)0);
}


x86 assembly (clang, -O0):
<vararg3_test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x0,%al
call   1030 <vararg3@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <vararg3@plt>
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <vararg3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vararg3_test>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <vararg3@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <vararg3@plt>
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <vararg3@plt>

LLVM IR (-O0):
define void @vararg3_test() {
%1 = call i32 (i32, ...) bitcast (i32 (...)* @vararg3 to i32 (i32, ...)*)(i32 0)
%2 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @vararg3 to i32 (i32, i8*, ...)*)(i32 1, i8* null)
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @vararg3 to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* null, i8* null)
ret void
}

LLVM IR (-O2):
define void @vararg3_test() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @vararg3 to i32 (i32, ...)*)(i32 0)
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @vararg3 to i32 (i32, i8*, ...)*)(i32 1, i8* null)
%3 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @vararg3 to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* null, i8* null)
ret void
}
int CT_FROM_XT(int adr, int up) { return adr; }


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

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

LLVM IR (-O0):
define i32 @CT_FROM_XT(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @CT_FROM_XT(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
double triple_prod_and_min_abs_sine(double **, double *);
int are_3_vect_in_one_plane(double at_coord[][3], double min_sine) {
  double actual_min_sine;
  double prod;
  prod = triple_prod_and_min_abs_sine(at_coord, &actual_min_sine);
  return actual_min_sine <= min_sine;
}


x86 assembly (clang, -O0):
<are_3_vect_in_one_plane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <triple_prod_and_min_abs_sine@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<are_3_vect_in_one_plane>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rsi
call   1030 <triple_prod_and_min_abs_sine@plt>
xor    %eax,%eax
movsd  0x8(%rsp),%xmm0
ucomisd 0x10(%rsp),%xmm0
setae  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @are_3_vect_in_one_plane([3 x double]* %0, double %1) {
%3 = alloca [3 x double]*
%4 = alloca double
%5 = alloca double
%6 = alloca double
store [3 x double]* %0, [3 x double]** %3
store double %1, double* %4
%7 = load [3 x double]*, [3 x double]** %3
%8 = bitcast [3 x double]* %7 to double**
%9 = call double @triple_prod_and_min_abs_sine(double** %8, double* %5)
store double %9, double* %6
%10 = load double, double* %5
%11 = load double, double* %4
%12 = fcmp ole double %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @are_3_vect_in_one_plane([3 x double]* %0, double %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = bitcast [3 x double]* %0 to double**
%6 = call double @triple_prod_and_min_abs_sine(double** %5, double* %3)
%7 = load double, double* %3
%8 = fcmp ole double %7, %1
%9 = zext i1 %8 to i32
ret i32 %9
}
void foo_with_internal_visibility() {}


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

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

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

LLVM IR (-O2):
define void @foo_with_internal_visibility() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void raint256() {
  printf("\nChanging Read Ahead Cache size for Internal sdcard to 256kb\n");
  char buf[256];
  sprintf(buf, "/system/bin/sh -c %s",
          "'echo 256 > /sys/block/mmcblk0/queue/read_ahead_kb'");
  system(buf);
}


x86 assembly (clang, -O0):
<raint256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xee9(%rip),%rsi
lea    0xef7(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raint256>:
push   %rbx
sub    $0x100,%rsp
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 256kb\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 256 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
define void @raint256() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 256 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
@str = [61 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 256kb\00"
define void @raint256() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void c_free_align(char *pA) { free(pA); }


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

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

LLVM IR (-O2):
define void @c_free_align(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_disconnect(int /*<<< orphan*/ *);
void cleanup(xcb_connection_t *c) { xcb_disconnect(c); }


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

x86 assembly (clang, -O2):
<cleanup>:
jmp    1030 <xcb_disconnect@plt>

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

LLVM IR (-O2):
define void @cleanup(i32* %0) {
%2 = tail call i32 @xcb_disconnect(i32* %0)
ret void
}
/* Type definitions */
typedef char uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t ece391_strlen(const uint8_t *s) {
  uint32_t len;
  for (len = 0; '\0' != *s; s++, len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<ece391_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1143 <ece391_strlen+0x43>
jmp    1126 <ece391_strlen+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ece391_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece391_strlen>:
cmpb   $0x0,(%rdi)
je     111f <ece391_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <ece391_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @ece391_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ createlinkedlist(int);
int main() {
  createlinkedlist(5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <createlinkedlist@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @createlinkedlist(i32 5)
ret i32 0
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __might_sleep(char *, int);
void *lowmem_page_address(struct page *);
void *(kmap)(struct page *page) {
  void *tmp;
  {
    while (1) {
      __might_sleep("include/linux/highmem.h", 23);
      while (1) {
        break;
      }
      break;
    }
    tmp = lowmem_page_address(page);
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<kmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x17,%esi
call   1030 <__might_sleep@plt>
jmp    1142 <kmap+0x22>
jmp    1147 <kmap+0x27>
mov    -0x8(%rbp),%rdi
call   1040 <lowmem_page_address@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmap>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x17,%esi
call   1030 <__might_sleep@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <lowmem_page_address@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
@.str = [24 x i8] c"include/linux/highmem.h\00"
define i8* @kmap(%struct.page* %0) {
%2 = alloca %struct.page*
%3 = alloca i8*
store %struct.page* %0, %struct.page** %2
br label %4
4: ; preds = %1
%5 = call i32 @__might_sleep(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
br label %6
6: ; preds = %4
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = load %struct.page*, %struct.page** %2
%10 = call i8* @lowmem_page_address(%struct.page* %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
%struct.page = type { i32 }
@.str = [24 x i8] c"include/linux/highmem.h\00"
define i8* @kmap(%struct.page* %0) {
%2 = tail call i32 @__might_sleep(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
%3 = tail call i8* @lowmem_page_address(%struct.page* %0)
ret i8* %3
}
/* Variables and functions */
int f95(int *);
int f96(int *p) { return f95(p); }


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

x86 assembly (clang, -O2):
<f96>:
jmp    1030 <f95@plt>

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

LLVM IR (-O2):
define i32 @f96(i32* %0) {
%2 = tail call i32 @f95(i32* %0)
ret i32 %2
}