xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getdtablesize(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getdtablesize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdtablesize>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getdtablesize() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getdtablesize() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ stop_recording();
void sigusr2(int num) { stop_recording(); }


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

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

LLVM IR (-O0):
define void @sigusr2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @stop_recording()
ret void
}

LLVM IR (-O2):
define void @sigusr2(i32 %0) {
%2 = tail call i32 (...) @stop_recording()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ const *, int);
void store32(void *out, const uint32_t v) { memcpy(out, &v, sizeof v); }


x86 assembly (clang, -O0):
<store32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store32>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @store32(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 = call i32 @memcpy(i8* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @store32(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
int testfunc6(void) {
  int a;
  int b;
}


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

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

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

LLVM IR (-O2):
define i32 @testfunc6() {
ret i32 undef
}
const char *deviceAirConditioningGetName(void) {
  return "AirConditioningDevice";
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"AirConditioningDevice\00"
define i8* @deviceAirConditioningGetName() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *, int);
int main(void) {
  int line_len;
  char buffer[9001];
  while ((line_len = get_line(buffer, 9001)) != -1) {
    reverse(buffer, line_len);
    printf("%s\n", buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2340,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2340(%rbp),%rdi
mov    $0x2329,%esi
call   1040 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     1186 <main+0x56>
lea    -0x2340(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <reverse@plt>
lea    -0x2340(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1050 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x2340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x2338,%rsp
mov    %rsp,%rdi
mov    $0x2329,%esi
call   1040 <get_line@plt>
cmp    $0xffffffff,%eax
je     1187 <main+0x57>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2329,%esi
call   1040 <get_line@plt>
cmp    $0xffffffff,%eax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x2338,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [9001 x i8]
%2 = getelementptr inbounds [9001 x i8], [9001 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 9001)
%4 = icmp eq i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = call i32 @reverse(i8* %2, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = call i32 @get_line(i8* %2, i32 9001)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %5
11: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M573_f(char *s) {
  debug("M573_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M573_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M573_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M573_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M573_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M573_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M573_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
char *strdup(char *);
char *find_interface_slot(char *interface_name) {
  return strdup("Not Implemented");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Not Implemented\00"
define i8* @find_interface_slot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"Not Implemented\00"
define noalias i8* @find_interface_slot(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(16) i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
int /*<<< orphan*/ ossl_asn1_item_embed_free(int /*<<< orphan*/ **,
                                             int /*<<< orphan*/ const *,
                                             int /*<<< orphan*/);
void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it) {
  ossl_asn1_item_embed_free(&val, it, 0);
}


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

x86 assembly (clang, -O2):
<ASN1_item_free>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %edx,%edx
call   1030 <ossl_asn1_item_embed_free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ASN1_item_free(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @ossl_asn1_item_embed_free(i32** %3, i32* %5, i32 0)
ret void
}

LLVM IR (-O2):
define void @ASN1_item_free(i32* %0, i32* %1) {
%3 = alloca i32*
store i32* %0, i32** %3
%4 = call i32 @ossl_asn1_item_embed_free(i32** %3, i32* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sync();
void M186Restore(int version) { Sync(); }


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

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

LLVM IR (-O0):
define void @M186Restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Sync()
ret void
}

LLVM IR (-O2):
define void @M186Restore(i32 %0) {
%2 = tail call i32 (...) @Sync()
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int getpid();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void _po_assertAction(void) {
  pid_t pid;
  pid = getpid();
  int i = 1;
  fprintf(stdout,
          "  Consider running: \n\n  gdb -pid %u\n\n  "
          "pid=%u will now SLEEP ...\n",
          pid, pid);
  while (i) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<_po_assertAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x8(%rbp)
je     117d <_po_assertAction+0x4d>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1164 <_po_assertAction+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_po_assertAction>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb8(%rip),%rsi
mov    %eax,%edx
mov    %eax,%ecx
call   1040 <fprintf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1160 <_po_assertAction+0x30>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [66 x i8] c" Consider running: \0A\0A gdb -pid %u\0A\0A pid=%u will now SLEEP ...\0A\00"
define void @_po_assertAction() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* @stdout
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @sleep(i32 1)
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [66 x i8] c" Consider running: \0A\0A gdb -pid %u\0A\0A pid=%u will now SLEEP ...\0A\00"
define void @_po_assertAction() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 @sleep(i32 1)
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ find_alloc_symbol(int /*<<< orphan*/ *, int, char const *,
                                     int /*<<< orphan*/);
void insert_internal_symbol(const char *name, int seg, uint16_t val) {
  if (seg == -1)
    find_alloc_symbol(NULL, 0x0F | 0x80, name, 0);
  else
    find_alloc_symbol(NULL, seg | 0x40, name, val);
}


x86 assembly (clang, -O0):
<insert_internal_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1145 <insert_internal_symbol+0x35>
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x8f,%esi
xor    %ecx,%ecx
call   1030 <find_alloc_symbol@plt>
jmp    115b <insert_internal_symbol+0x4b>
mov    -0xc(%rbp),%esi
or     $0x40,%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <find_alloc_symbol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_internal_symbol>:
mov    %edx,%ecx
mov    %rdi,%rdx
cmp    $0xffffffff,%esi
je     1124 <insert_internal_symbol+0x14>
or     $0x40,%esi
xor    %edi,%edi
jmp    1030 <find_alloc_symbol@plt>
xor    %edi,%edi
mov    $0x8f,%esi
xor    %ecx,%ecx
jmp    1030 <find_alloc_symbol@plt>

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

LLVM IR (-O2):
define void @insert_internal_symbol(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, -1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @find_alloc_symbol(i32* null, i32 143, i8* %0, i32 0)
br label %10
7: ; preds = %3
%8 = or i32 %1, 64
%9 = tail call i32 @find_alloc_symbol(i32* null, i32 %8, i8* %0, i32 %2)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *mtest_realloc(void *pointer, size_t reallocation_size) {
  return realloc(pointer, reallocation_size);
}


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

x86 assembly (clang, -O2):
<mtest_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mtest_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void stb_p(void *ptr, int v) { *(uint8_t *)ptr = v; }


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

x86 assembly (clang, -O2):
<stb_p>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @stb_p(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *base64toText(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *parseHexString(char *, int);
char *stringyHexTo64(char *txtin, int txtinlen) {
  uint8_t *parsed = parseHexString(txtin, txtinlen);
  char *result = base64toText(parsed, txtinlen / 2);
  free(parsed);
  return result;
}


x86 assembly (clang, -O0):
<stringyHexTo64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <parseHexString@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1040 <base64toText@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringyHexTo64>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1050 <parseHexString@plt>
mov    %rax,%r14
mov    %ebx,%esi
shr    $0x1f,%esi
add    %ebx,%esi
sar    %esi
mov    %rax,%rdi
call   1040 <base64toText@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @stringyHexTo64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32* @parseHexString(i8* %7, i32 %8)
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 2
%13 = call i8* @base64toText(i32* %10, i32 %12)
store i8* %13, i8** %6
%14 = load i32*, i32** %5
%15 = call i32 @free(i32* %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @stringyHexTo64(i8* %0, i32 %1) {
%3 = tail call i32* @parseHexString(i8* %0, i32 %1)
%4 = sdiv i32 %1, 2
%5 = tail call i8* @base64toText(i32* %3, i32 %4)
%6 = tail call i32 @free(i32* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ action();
void func_if_with_function_call(int c) {
  int a = 0;
  if (c) {
    action();
  }
}


x86 assembly (clang, -O0):
<func_if_with_function_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1133 <func_if_with_function_call+0x23>
mov    $0x0,%al
call   1030 <action@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_if_with_function_call>:
test   %edi,%edi
je     111b <func_if_with_function_call+0xb>
xor    %eax,%eax
jmp    1030 <action@plt>
ret

LLVM IR (-O0):
define void @func_if_with_function_call(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @action()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @func_if_with_function_call(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @action()
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_B9int64_lowword_mem(long long *val) {
  return ((*val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 185
%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_B9int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 185
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo42() {}


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

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

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

LLVM IR (-O2):
define void @foo42() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x78() {
  Assert_real((isalpha(120)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              605, ("isalpha should be 1 for x"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x78>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x25d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x78>:
push   %rax
mov    $0x78,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x25d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for x\00"
define void @t_isalpha_0x78() {
%1 = call i32 @isalpha(i32 120)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for x\00"
define void @t_isalpha_0x78() {
%1 = tail call i32 @isalpha(i32 120)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fb_hSetTime(int h, int m, int s) { return 0; }


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

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

LLVM IR (-O0):
define i32 @fb_hSetTime(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @fb_hSetTime(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
void __mmu_cache_flush(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @smi_larb0_clock_on() {
ret void
}
/* Variables and functions */
int yywrap();
int cnswrap(void) { return yywrap(); }


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

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

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

LLVM IR (-O2):
define i32 @cnswrap() {
%1 = tail call i32 (...) @yywrap()
ret i32 %1
}
double quinticEaseInd(double p) { return p * p * p * p * p; }


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

x86 assembly (clang, -O2):
<quinticEaseInd>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @quinticEaseInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = load double, double* %2
%11 = fmul double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @quinticEaseInd(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
%5 = fmul double %4, %0
ret double %5
}
double fabs(double d) {
  if (d < 0.0) {
    return (-d);
  }
  return (d);
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int __sx25_read_config_parameters(int linkid, struct config_ident *ipt,
                                  struct LINK_config_data *lpt,
                                  struct X25_config_data *xpt,
                                  struct MLP_config_data *mpt,
                                  struct LAPB_config_data *lbp,
                                  struct LLC2_config_data *l2p,
                                  struct WAN_config_data *wpt, int *flags) {
  return (0);
}


x86 assembly (clang, -O0):
<__sx25_read_config_parameters>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.config_ident = type opaque
%struct.LINK_config_data = type opaque
%struct.X25_config_data = type opaque
%struct.MLP_config_data = type opaque
%struct.LAPB_config_data = type opaque
%struct.LLC2_config_data = type opaque
%struct.WAN_config_data = type opaque
define i32 @__sx25_read_config_parameters(i32 %0, %struct.config_ident* %1, %struct.LINK_config_data* %2, %struct.X25_config_data* %3, %struct.MLP_config_data* %4, %struct.LAPB_config_data* %5, %struct.LLC2_config_data* %6, %struct.WAN_config_data* %7, i32* %8) {
%10 = alloca i32
%11 = alloca %struct.config_ident*
%12 = alloca %struct.LINK_config_data*
%13 = alloca %struct.X25_config_data*
%14 = alloca %struct.MLP_config_data*
%15 = alloca %struct.LAPB_config_data*
%16 = alloca %struct.LLC2_config_data*
%17 = alloca %struct.WAN_config_data*
%18 = alloca i32*
store i32 %0, i32* %10
store %struct.config_ident* %1, %struct.config_ident** %11
store %struct.LINK_config_data* %2, %struct.LINK_config_data** %12
store %struct.X25_config_data* %3, %struct.X25_config_data** %13
store %struct.MLP_config_data* %4, %struct.MLP_config_data** %14
store %struct.LAPB_config_data* %5, %struct.LAPB_config_data** %15
store %struct.LLC2_config_data* %6, %struct.LLC2_config_data** %16
store %struct.WAN_config_data* %7, %struct.WAN_config_data** %17
store i32* %8, i32** %18
ret i32 0
}

LLVM IR (-O2):
%struct.config_ident = type opaque
%struct.LINK_config_data = type opaque
%struct.X25_config_data = type opaque
%struct.MLP_config_data = type opaque
%struct.LAPB_config_data = type opaque
%struct.LLC2_config_data = type opaque
%struct.WAN_config_data = type opaque
define i32 @__sx25_read_config_parameters(i32 %0, %struct.config_ident* nocapture readnone %1, %struct.LINK_config_data* nocapture readnone %2, %struct.X25_config_data* nocapture readnone %3, %struct.MLP_config_data* nocapture readnone %4, %struct.LAPB_config_data* nocapture readnone %5, %struct.LLC2_config_data* nocapture readnone %6, %struct.WAN_config_data* nocapture readnone %7, i32* nocapture readnone %8) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _s2_priv_qtxtab(float *, float *, float *, float *, float,
                                   float, float, int, int, int, int, char *,
                                   float);
void s2qtxtyz(float *y1, float *y2, float *z1, float *z2, float ix, float iy,
              float iz, char *itext, float ipad) {
  _s2_priv_qtxtab(y1, y2, z1, z2, ix, iy, iz, 1, 2, 1., 1., itext, ipad);
}


x86 assembly (clang, -O0):
<s2qtxtyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
movss  %xmm1,-0x28(%rbp)
movss  %xmm2,-0x2c(%rbp)
mov    %r8,-0x38(%rbp)
movss  %xmm3,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm2
mov    -0x38(%rbp),%rax
movss  -0x3c(%rbp),%xmm3
mov    $0x1,%r8d
mov    $0x2,%r9d
movl   $0x1,(%rsp)
movl   $0x1,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <_s2_priv_qtxtab@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2qtxtyz>:
push   %rax
mov    %r8,%rax
sub    $0x8,%rsp
mov    $0x1,%r8d
mov    $0x2,%r9d
push   %rax
push   $0x1
push   $0x1
call   1030 <_s2_priv_qtxtab@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @s2qtxtyz(float* %0, float* %1, float* %2, float* %3, float %4, float %5, float %6, i8* %7, float %8) {
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca i8*
%18 = alloca float
store float* %0, float** %10
store float* %1, float** %11
store float* %2, float** %12
store float* %3, float** %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store i8* %7, i8** %17
store float %8, float* %18
%19 = load float*, float** %10
%20 = load float*, float** %11
%21 = load float*, float** %12
%22 = load float*, float** %13
%23 = load float, float* %14
%24 = load float, float* %15
%25 = load float, float* %16
%26 = load i8*, i8** %17
%27 = load float, float* %18
%28 = call i32 @_s2_priv_qtxtab(float* %19, float* %20, float* %21, float* %22, float %23, float %24, float %25, i32 1, i32 2, i32 1, i32 1, i8* %26, float %27)
ret void
}

LLVM IR (-O2):
define void @s2qtxtyz(float* %0, float* %1, float* %2, float* %3, float %4, float %5, float %6, i8* %7, float %8) {
%10 = tail call i32 @_s2_priv_qtxtab(float* %0, float* %1, float* %2, float* %3, float %4, float %5, float %6, i32 1, i32 2, i32 1, i32 1, i8* %7, float %8)
ret void
}
unsigned xrop3_248_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk1 = T | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_248_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_248_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_248_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_248_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
int logicalAnd(int x, int y) { return !!x & !!y; }


x86 assembly (clang, -O0):
<logicalAnd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x8(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicalAnd>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @logicalAnd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = and i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @logicalAnd(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void test9() {
  enum { A = 3, C = 1 } a;
  switch (a) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 4:
    break;
  }
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
sub    $0x4,%eax
ja     111a <test9+0x1a>
jmp    1115 <test9+0x15>
jmp    111a <test9+0x1a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test9() {
%1 = alloca i32
%2 = load i32, i32* %1
switch i32 %2, label %4 [
i32 0, label %3
i32 1, label %3
i32 2, label %3
i32 3, label %3
i32 4, label %3
]
3: ; preds = %0, %0, %0, %0, %0
br label %4
4: ; preds = %0, %3
ret void
}

LLVM IR (-O2):
define void @test9() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void append(char *str, char *ending, int bufsize) {
  int str_len = strlen(str), ending_len = strlen(ending);
  if (str_len + ending_len + 1 > bufsize)
    return;
  strcpy(str + str_len, ending);
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x1,%eax
cmp    -0x14(%rbp),%eax
jle    1162 <append+0x42>
jmp    1176 <append+0x56>
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %ebp,%eax
cmp    %r15d,%eax
jge    1161 <append+0x41>
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @append(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = add nsw i32 %5, %4
%7 = icmp slt i32 %6, %2
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = tail call i32 @strcpy(i8* %10, i8* %1)
br label %12
12: ; preds = %3, %8
ret void
}
/* Variables and functions */
scalar_t__ isnan(float);
int tm_check_nan_(float *src) {
  int result = 0;
  if (isnan(*src))
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<tm_check_nan_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1141 <tm_check_nan_+0x31>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_check_nan_>:
push   %rax
movss  (%rdi),%xmm0
call   1030 <isnan@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tm_check_nan_(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
%4 = load float*, float** %2
%5 = load float, float* %4
%6 = call i64 @isnan(float %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @tm_check_nan_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i64 @isnan(float %2)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drawCSquare(int /*<<< orphan*/, int /*<<< orphan*/, int, int,
                               int);
int /*<<< orphan*/ setCursorPos(int /*<<< orphan*/);
void deleteInstructions() {
  setCursorPos(0);
  drawCSquare(0, 0, 150, 1000, 0x000000);
}


x86 assembly (clang, -O0):
<deleteInstructions>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <setCursorPos@plt>
xor    %r8d,%r8d
mov    $0x96,%edx
mov    $0x3e8,%ecx
mov    %r8d,%edi
mov    %r8d,%esi
call   1030 <drawCSquare@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteInstructions>:
push   %rax
xor    %edi,%edi
call   1040 <setCursorPos@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x96,%edx
mov    $0x3e8,%ecx
xor    %r8d,%r8d
pop    %rax
jmp    1030 <drawCSquare@plt>

LLVM IR (-O0):
define void @deleteInstructions() {
%1 = call i32 @setCursorPos(i32 0)
%2 = call i32 @drawCSquare(i32 0, i32 0, i32 150, i32 1000, i32 0)
ret void
}

LLVM IR (-O2):
define void @deleteInstructions() {
%1 = tail call i32 @setCursorPos(i32 0)
%2 = tail call i32 @drawCSquare(i32 0, i32 0, i32 150, i32 1000, i32 0)
ret void
}
int __mp_printf(char *s, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__mp_printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
int f2(long n) {
  int *b = n + (int *)1;
  n += (int *)1;
  return b == (int *)n;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f2(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds i32, i32* inttoptr (i64 1 to i32*), i64 %4
store i32* %5, i32** %3
%6 = load i64, i64* %2
%7 = getelementptr inbounds i32, i32* inttoptr (i64 1 to i32*), i64 %6
%8 = ptrtoint i32* %7 to i64
store i64 %8, i64* %2
%9 = load i32*, i32** %3
%10 = load i64, i64* %2
%11 = inttoptr i64 %10 to i32*
%12 = icmp eq i32* %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @f2(i64 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
struct pkt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ *pkt_put(struct pkt *, int);
void pkt_put_u16(struct pkt *p, uint16_t val) {
  uint8_t *data = pkt_put(p, sizeof(val));
  memcpy(data, &val, sizeof(uint16_t));
}


x86 assembly (clang, -O0):
<pkt_put_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <pkt_put@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkt_put_u16>:
push   %rax
mov    %esi,0x4(%rsp)
mov    $0x4,%esi
call   1040 <pkt_put@plt>
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.pkt = type { i32 }
define void @pkt_put_u16(%struct.pkt* %0, i32 %1) {
%3 = alloca %struct.pkt*
%4 = alloca i32
%5 = alloca i32*
store %struct.pkt* %0, %struct.pkt** %3
store i32 %1, i32* %4
%6 = load %struct.pkt*, %struct.pkt** %3
%7 = call i32* @pkt_put(%struct.pkt* %6, i32 4)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @memcpy(i32* %8, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
%struct.pkt = type { i32 }
define void @pkt_put_u16(%struct.pkt* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = tail call i32* @pkt_put(%struct.pkt* %0, i32 4)
%5 = call i32 @memcpy(i32* %4, i32* %3, i32 4)
ret void
}
int test_imm_0Cint16_reg(short val) {
  return ((val) & (0x0C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Cint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_0Cint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 12
%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_0Cint16_reg(i16 signext %0) {
%2 = and i16 %0, 12
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int f() {
  const int x;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
float quat_dot(float *, float *);
__attribute__((always_)) float psquat_dot(struct quat *a, struct quat *b) {
  return quat_dot((float *)a, (float *)b);
}


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

x86 assembly (clang, -O2):
<psquat_dot>:
jmp    1030 <quat_dot@plt>

LLVM IR (-O0):
%struct.quat = type { i32 }
define float @psquat_dot(%struct.quat* %0, %struct.quat* %1) {
%3 = alloca %struct.quat*
%4 = alloca %struct.quat*
store %struct.quat* %0, %struct.quat** %3
store %struct.quat* %1, %struct.quat** %4
%5 = load %struct.quat*, %struct.quat** %3
%6 = bitcast %struct.quat* %5 to float*
%7 = load %struct.quat*, %struct.quat** %4
%8 = bitcast %struct.quat* %7 to float*
%9 = call float @quat_dot(float* %6, float* %8)
ret float %9
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define float @psquat_dot(%struct.quat* %0, %struct.quat* %1) {
%3 = bitcast %struct.quat* %0 to float*
%4 = bitcast %struct.quat* %1 to float*
%5 = tail call float @quat_dot(float* %3, float* %4)
ret float %5
}