xunge/DecIR huggingface dataset:
char *_jsonTrimSpace(char *ptr) {
  while ((*ptr != '\0') && ((*ptr == ' ') || (*ptr == '\t') || (*ptr == '\r') ||
                            (*ptr == '\n'))) {
    ptr += 1;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<_jsonTrimSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1172 <_jsonTrimSpace+0x72>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     116c <_jsonTrimSpace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xa(%rbp)
je     116c <_jsonTrimSpace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0xa(%rbp)
je     116c <_jsonTrimSpace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1182 <_jsonTrimSpace+0x82>
jmp    1193 <_jsonTrimSpace+0x93>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <_jsonTrimSpace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jsonTrimSpace>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <_jsonTrimSpace+0x25>
bt     %rdx,%rcx
jae    1125 <_jsonTrimSpace+0x25>
add    $0x1,%rax
jmp    1110 <_jsonTrimSpace+0x10>
ret

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

LLVM IR (-O2):
define i8* @_jsonTrimSpace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 10, label %5
i8 32, label %5
i8 9, label %5
i8 13, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int HelpItem76(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem76() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem76() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
scalar_t__ strlen(char *);
int main() {
  char *s = "this is a test";
  printf("%s has %d chars\n", s, (int)strlen(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef7(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0xe,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"this is a test\00"
@.str.1 = [17 x i8] c"%s has %d chars\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"this is a test\00"
@.str.1 = [17 x i8] c"%s has %d chars\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
void *__util_malloc(char const *, char const *, int, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *__util_zalloc(const char *func, const char *file, int line, size_t size) {
  void *buf = __util_malloc(func, file, line, size);
  memset(buf, 0, size);
  return buf;
}


x86 assembly (clang, -O0):
<__util_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <__util_malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__util_zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
call   1040 <__util_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @__util_zalloc(i8* %0, i8* %1, i32 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i64, i64* %8
%14 = call i8* @__util_malloc(i8* %10, i8* %11, i32 %12, i64 %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
%16 = load i64, i64* %8
%17 = call i32 @memset(i8* %15, i32 0, i64 %16)
%18 = load i8*, i8** %9
ret i8* %18
}

LLVM IR (-O2):
define i8* @__util_zalloc(i8* %0, i8* %1, i32 %2, i64 %3) {
%5 = tail call i8* @__util_malloc(i8* %0, i8* %1, i32 %2, i64 %3)
%6 = tail call i32 @memset(i8* %5, i32 0, i64 %3)
ret i8* %5
}
void glCompressedTexSubImage2D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glCompressedTexSubImage2D() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void exit_with_usage() {
  do {
    fputs("Usage:\n"
          "  Development mode:\n"
          "    pickler -Sr HID  # Run programmer.\n"
          "    pickler -S[p] HID HEXFILE  # Program programmer.\n"
          "    pickler -Spr HID HEXFILE  # Program and run programmer.\n"
          "    pickler -Sc HID  # Print programmer's configuration memory.\n"
          "    pickler -D HID  # Change programmer to production mode.\n"
          "  Production mode:\n"
          "    pickler [-p] TTY HEXFILE  # Program target.\n"
          "    pickler -c TTY  # Print target's configuration memory.\n",
          stderr);
  } while (0);
  exit(127);
}


x86 assembly (clang, -O0):
<exit_with_usage>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <exit_with_usage+0x9>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [430 x i8] c"Usage:\0A Development mode:\0A pickler -Sr HID # Run programmer.\0A pickler -S[p] HID HEXFILE # Program programmer.\0A pickler -Spr HID HEXFILE # Program and run programmer.\0A pickler -Sc HID # Print programmer's configuration memory.\0A pickler -D HID # Change programmer to production mode.\0A Production mode:\0A pickler [-p] TTY HEXFILE # Program target.\0A pickler -c TTY # Print target's configuration memory.\0A\00"
@stderr = global i32 0
define void @exit_with_usage() {
br label %1
1: ; preds = %0
%2 = load i32, i32* @stderr
%3 = call i32 @fputs(i8* getelementptr inbounds ([430 x i8], [430 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %4
4: ; preds = %1
%5 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
@.str = [430 x i8] c"Usage:\0A Development mode:\0A pickler -Sr HID # Run programmer.\0A pickler -S[p] HID HEXFILE # Program programmer.\0A pickler -Spr HID HEXFILE # Program and run programmer.\0A pickler -Sc HID # Print programmer's configuration memory.\0A pickler -D HID # Change programmer to production mode.\0A Production mode:\0A pickler [-p] TTY HEXFILE # Program target.\0A pickler -c TTY # Print target's configuration memory.\0A\00"
@stderr = global i32 0
define void @exit_with_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([430 x i8], [430 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 127)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
void I2CMasterIntEnable(unsigned long ulBase) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = 1;
}


x86 assembly (clang, -O0):
<I2CMasterIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntEnable>:
push   %rbx
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
movq   $0x1,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CMasterIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CMasterBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 16
%8 = inttoptr i64 %7 to i64*
store volatile i64 1, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntEnable(i64 %0) {
%2 = tail call i32 @I2CMasterBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}
void page_reset_bad_cgroup(struct page *page) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @page_reset_bad_cgroup(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @page_reset_bad_cgroup(%struct.page* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printd(int);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int i = 0;
  i = 123;
  printd(i);
  printf("\n");
  printf("1 \% 10 = %d;\n", 1 % 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printd@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
call   1040 <printd@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [14 x i8] c"1 % 10 = %d;\0A\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printd(i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"1 % 10 = %d;\0A\00"
define void @main() {
%1 = tail call i32 @printd(i32 123)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *fw_malloc(size_t size) {
  void *p;
  if ((p = malloc(size)) == NULL) {
    perror("ipchains: malloc failed");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<fw_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1169 <fw_malloc+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"ipchains: malloc failed\00"
define i8* @fw_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"ipchains: malloc failed\00"
define noalias i8* @fw_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
void hmd_step() {}


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

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

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

LLVM IR (-O2):
define void @hmd_step() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_append_empty();
int /*<<< orphan*/ test_append_one_item();
void test_append() {
  test_append_empty();
  test_append_one_item();
}


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

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

LLVM IR (-O0):
define void @test_append() {
%1 = call i32 (...) @test_append_empty()
%2 = call i32 (...) @test_append_one_item()
ret void
}

LLVM IR (-O2):
define void @test_append() {
%1 = tail call i32 (...) @test_append_empty()
%2 = tail call i32 (...) @test_append_one_item()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_join(pthread_t thread, void **retval) { return 1; }


x86 assembly (clang, -O0):
<pthread_join>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_join(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
float runningAverage(float newSample, int count, float oldAverage) {
  if (count == 0)
    count = 1;
  return oldAverage + (newSample - oldAverage) / count;
}


x86 assembly (clang, -O0):
<runningAverage>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1122 <runningAverage+0x22>
movl   $0x1,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<runningAverage>:
test   %edi,%edi
mov    $0x1,%eax
cmovne %edi,%eax
cvtsi2ss %eax,%xmm2
subss  %xmm1,%xmm0
divss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @runningAverage(float %0, i32 %1, float %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
store i32 1, i32* %5
br label %10
10: ; preds = %9, %3
%11 = load float, float* %6
%12 = load float, float* %4
%13 = load float, float* %6
%14 = fsub float %12, %13
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to float
%17 = fdiv float %14, %16
%18 = fadd float %11, %17
ret float %18
}

LLVM IR (-O2):
define float @runningAverage(float %0, i32 %1, float %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 1, i32 %1
%6 = fsub float %0, %2
%7 = sitofp i32 %5 to float
%8 = fdiv float %6, %7
%9 = fadd float %8, %2
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x3d() {
  Assert_real((iscntrl(61) == 0),
              "/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_iscntrl.c",
              310, ("iscntrl should be 0 for ="));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x3d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x136,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x3d>:
push   %rax
mov    $0x3d,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x136,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for =\00"
define void @t_iscntrl_0x3d() {
%1 = call i64 @iscntrl(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for =\00"
define void @t_iscntrl_0x3d() {
%1 = tail call i64 @iscntrl(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_int(int *l, int tam) {
  int i;
  for (i = 0; i < tam; i++)
    printf("%d, ", l[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_int+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_int+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_int+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_int+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @print_int(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_isr_handler();
__attribute__((weak)) void ssi0_isr_handler(void) { default_isr_handler(); }


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

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

LLVM IR (-O0):
define weak void @ssi0_isr_handler() {
%1 = call i32 (...) @default_isr_handler()
ret void
}

LLVM IR (-O2):
define weak void @ssi0_isr_handler() {
%1 = tail call i32 (...) @default_isr_handler()
ret void
}
int test_imm_A5uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xA5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A5uint64_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, 165
%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_A5uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 708669603840
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  int i = 4;
  switch (i) {
  case 3:
    return 3;
  case 5:
    return 2;
  default:
    return 5;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3,%eax
je     1137 <main+0x37>
jmp    1126 <main+0x26>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     1143 <main+0x43>
jmp    114f <main+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    1156 <main+0x56>
movl   $0x2,-0x4(%rbp)
jmp    1156 <main+0x56>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 3, label %4
i32 5, label %5
]
4: ; preds = %0
store i32 3, i32* %1
br label %7
5: ; preds = %0
store i32 2, i32* %1
br label %7
6: ; preds = %0
store i32 5, i32* %1
br label %7
7: ; preds = %6, %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
void rop3_168_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_168_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_168_0_0>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_168_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_168_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
int main() { return sizeof(unsigned long long int); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
char *strdup(char *);
char *emptystring(void) { return strdup(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @emptystring() {
%1 = call i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define noalias i8* @emptystring() {
%1 = tail call dereferenceable_or_null(1) i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, char *, int);
int main(int argc, char **argv) {
  test_init(argc, argv);
  test_msg("SKIP: %s:%d: "
           "Inotify not supported."
           "\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/zdtm/"
           "live/static/inotify_system.c",
           388);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
lea    0xeb7(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x184,%edx
call   1040 <test_msg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_init@plt>
lea    0xed3(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0x184,%edx
call   1040 <test_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"SKIP: %s:%d: Inotify not supported.\0A\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/zdtm/live/static/inotify_system.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
%9 = call i32 @test_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 388)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"SKIP: %s:%d: Inotify not supported.\0A\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OSLL/pmover/refs/heads/master/test/zdtm/live/static/inotify_system.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 @test_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 388)
ret i32 0
}
/* Variables and functions */
int find_cpu_freq();
int /*<<< orphan*/ find_cpu_model(char **);
int /*<<< orphan*/ find_system_model(char **);
void find_system_info(char **system_model, char **cpu_model,
                      int *cpu_frequency) {
  find_system_model(system_model);
  find_cpu_model(cpu_model);
  *cpu_frequency = find_cpu_freq();
}


x86 assembly (clang, -O0):
<find_system_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <find_system_model@plt>
mov    -0x10(%rbp),%rdi
call   1050 <find_cpu_model@plt>
mov    $0x0,%al
call   1030 <find_cpu_freq@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_system_info>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <find_system_model@plt>
mov    %rbx,%rdi
call   1050 <find_cpu_model@plt>
xor    %eax,%eax
call   1030 <find_cpu_freq@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @find_system_info(i8** %0, i8** %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i32*
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i8**, i8*** %4
%8 = call i32 @find_system_model(i8** %7)
%9 = load i8**, i8*** %5
%10 = call i32 @find_cpu_model(i8** %9)
%11 = call i32 (...) @find_cpu_freq()
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @find_system_info(i8** %0, i8** %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @find_system_model(i8** %0)
%5 = tail call i32 @find_cpu_model(i8** %1)
%6 = tail call i32 (...) @find_cpu_freq()
store i32 %6, i32* %2
ret void
}
/* Variables and functions */
char *memset(char *s, int c, size_t n) {
  for (unsigned int i = 0; i < n; i++) {
    *(s + i) = c;
  }
  return s;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1140 <memset+0x40>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <memset+0x16>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111c <memset+0x1c>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %sil,(%rax,%rcx,1)
add    $0x1,%ecx
cmp    %rdx,%rcx
jb     1110 <memset+0x10>
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %8
7: ; preds = %8, %3
ret i8* %0
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %6, i8* %10
%11 = add nuw nsw i64 %9, 1
%12 = and i64 %11, 4294967295
%13 = icmp ult i64 %12, %2
br i1 %13, label %8, label %7
}
int chr_to_jst(int chr) {
  if (chr == 'd' || chr == 'D')
    return 0;
  if (chr == 'l' || chr == 'L')
    return 1;
  if (chr == 'r' || chr == 'R')
    return 2;
  if (chr == 'c' || chr == 'C')
    return 3;
  return -1;
}


x86 assembly (clang, -O0):
<chr_to_jst>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
je     111b <chr_to_jst+0x1b>
cmpl   $0x44,-0x8(%rbp)
jne    1127 <chr_to_jst+0x27>
movl   $0x0,-0x4(%rbp)
jmp    118e <chr_to_jst+0x8e>
cmpl   $0x6c,-0x8(%rbp)
je     113b <chr_to_jst+0x3b>
cmpl   $0x4c,-0x8(%rbp)
jne    1147 <chr_to_jst+0x47>
movl   $0x1,-0x4(%rbp)
jmp    118e <chr_to_jst+0x8e>
cmpl   $0x72,-0x8(%rbp)
je     115b <chr_to_jst+0x5b>
cmpl   $0x52,-0x8(%rbp)
jne    1167 <chr_to_jst+0x67>
movl   $0x2,-0x4(%rbp)
jmp    118e <chr_to_jst+0x8e>
cmpl   $0x63,-0x8(%rbp)
je     117b <chr_to_jst+0x7b>
cmpl   $0x43,-0x8(%rbp)
jne    1187 <chr_to_jst+0x87>
movl   $0x3,-0x4(%rbp)
jmp    118e <chr_to_jst+0x8e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr_to_jst>:
and    $0xffffffdf,%edi
cmp    $0x44,%edi
je     1118 <chr_to_jst+0x18>
cmp    $0x4c,%edi
je     111b <chr_to_jst+0x1b>
cmp    $0x52,%edi
jne    1121 <chr_to_jst+0x21>
mov    $0x2,%eax
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
cmp    $0x43,%edi
sete   %al
lea    -0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @chr_to_jst(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 100
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 68
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %32
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 108
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 76
br i1 %15, label %16, label %17
16: ; preds = %13, %10
store i32 1, i32* %2
br label %32
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 114
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 82
br i1 %22, label %23, label %24
23: ; preds = %20, %17
store i32 2, i32* %2
br label %32
24: ; preds = %20
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 99
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 67
br i1 %29, label %30, label %31
30: ; preds = %27, %24
store i32 3, i32* %2
br label %32
31: ; preds = %27
store i32 -1, i32* %2
br label %32
32: ; preds = %31, %30, %23, %16, %9
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @chr_to_jst(i32 %0) {
%2 = and i32 %0, -33
switch i32 %2, label %3 [
i32 68, label %8
i32 76, label %6
i32 82, label %7
]
3: ; preds = %1
%4 = icmp eq i32 %2, 67
%5 = select i1 %4, i32 3, i32 -1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %3
%9 = phi i32 [ 0, %1 ], [ %5, %3 ], [ 1, %6 ], [ 2, %7 ]
ret i32 %9
}
int get_asn1c_environment_version() { return 923; }


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

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

LLVM IR (-O0):
define i32 @get_asn1c_environment_version() {
ret i32 923
}

LLVM IR (-O2):
define i32 @get_asn1c_environment_version() {
ret i32 923
}
/* Variables and functions */
double exp(double);
double fabs(double);
double df_exp(double x) { return exp(-16.0 * fabs(x)); }


x86 assembly (clang, -O0):
<df_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xee7(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xecb(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<df_exp>:
andpd  0xee8(%rip),%xmm0
mulsd  0xef0(%rip),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @df_exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fmul double -1.600000e+01, %4
%6 = call double @exp(double %5)
ret double %6
}

LLVM IR (-O2):
define double @df_exp(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fmul double %2, -1.600000e+01
%4 = tail call double @exp(double %3)
ret double %4
}
unsigned char getVelocity(sensNum) {
  unsigned int analogReadValue = 0;
  switch (sensNum) {
  case (1):
    analogReadValue = AnalogRead_PC0();
    break;
  case (2):
    analogReadValue = AnalogRead_PC1();
    break;
  case (3):
    analogReadValue = AnalogRead_PC2();
    break;
  }
  return (analogReadValue >> 3);
}


x86 assembly (clang, -O0):
<getVelocity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1178 <getVelocity+0x48>
jmp    1156 <getVelocity+0x26>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1187 <getVelocity+0x57>
jmp    1167 <getVelocity+0x37>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1196 <getVelocity+0x66>
jmp    11a0 <getVelocity+0x70>
mov    $0x0,%al
call   1030 <AnalogRead_PC0@plt>
mov    %eax,-0x8(%rbp)
jmp    11a0 <getVelocity+0x70>
mov    $0x0,%al
call   1050 <AnalogRead_PC1@plt>
mov    %eax,-0x8(%rbp)
jmp    11a0 <getVelocity+0x70>
mov    $0x0,%al
call   1040 <AnalogRead_PC2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x3,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVelocity>:
push   %rax
cmp    $0x3,%edi
je     114b <getVelocity+0x1b>
cmp    $0x2,%edi
je     1154 <getVelocity+0x24>
xor    %eax,%eax
cmp    $0x1,%edi
jne    115b <getVelocity+0x2b>
xor    %eax,%eax
call   1030 <AnalogRead_PC0@plt>
jmp    115b <getVelocity+0x2b>
xor    %eax,%eax
call   1040 <AnalogRead_PC2@plt>
jmp    115b <getVelocity+0x2b>
xor    %eax,%eax
call   1050 <AnalogRead_PC1@plt>
shr    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @getVelocity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
]
5: ; preds = %1
%6 = call i32 (...) @AnalogRead_PC0()
store i32 %6, i32* %3
br label %11
7: ; preds = %1
%8 = call i32 (...) @AnalogRead_PC1()
store i32 %8, i32* %3
br label %11
9: ; preds = %1
%10 = call i32 (...) @AnalogRead_PC2()
store i32 %10, i32* %3
br label %11
11: ; preds = %1, %9, %7, %5
%12 = load i32, i32* %3
%13 = lshr i32 %12, 3
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @getVelocity(i32 %0) {
switch i32 %0, label %8 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
]
2: ; preds = %1
%3 = tail call i32 (...) @AnalogRead_PC0()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @AnalogRead_PC1()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @AnalogRead_PC2()
br label %8
8: ; preds = %1, %6, %4, %2
%9 = phi i32 [ 0, %1 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ]
%10 = lshr i32 %9, 3
%11 = trunc i32 %10 to i8
ret i8 %11
}
/* Type definitions */
struct net_interface_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
net_interface_const_obus_event(struct net_interface_event const *);
int obus_event_is_empty(int /*<<< orphan*/);
int net_interface_event_is_empty(const struct net_interface_event *event) {
  return obus_event_is_empty(net_interface_const_obus_event(event));
}


x86 assembly (clang, -O0):
<net_interface_event_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <net_interface_const_obus_event@plt>
mov    %eax,%edi
call   1040 <obus_event_is_empty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_interface_event_is_empty>:
push   %rax
call   1030 <net_interface_const_obus_event@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <obus_event_is_empty@plt>

LLVM IR (-O0):
%struct.net_interface_event = type { i32 }
define i32 @net_interface_event_is_empty(%struct.net_interface_event* %0) {
%2 = alloca %struct.net_interface_event*
store %struct.net_interface_event* %0, %struct.net_interface_event** %2
%3 = load %struct.net_interface_event*, %struct.net_interface_event** %2
%4 = call i32 @net_interface_const_obus_event(%struct.net_interface_event* %3)
%5 = call i32 @obus_event_is_empty(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.net_interface_event = type { i32 }
define i32 @net_interface_event_is_empty(%struct.net_interface_event* %0) {
%2 = tail call i32 @net_interface_const_obus_event(%struct.net_interface_event* %0)
%3 = tail call i32 @obus_event_is_empty(i32 %2)
ret i32 %3
}
void traps(void) {}


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

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

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

LLVM IR (-O2):
define void @traps() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int gen_posix_mutex_init(pthread_mutex_t *mut) {
  return (pthread_mutex_init(mut, NULL));
}


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

x86 assembly (clang, -O2):
<gen_posix_mutex_init>:
xor    %esi,%esi
jmp    1030 <pthread_mutex_init@plt>

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

LLVM IR (-O2):
define i32 @gen_posix_mutex_init(i32* %0) {
%2 = tail call i32 @pthread_mutex_init(i32* %0, i32* null)
ret i32 %2
}
void *foo2(void *data) {
  int *x = data;
  *x = 8;
  return 0;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x8,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
movl   $0x8,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @foo2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 8, i32* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @foo2(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 8, i32* %2
ret i8* null
}
/* Variables and functions */
scalar_t__ have_decent_term();
const char *argconfig_usage_text(void) {
  if (have_decent_term())
    return "\033[1mUsage:\033[0m";
  else
    return "Usage:";
}


x86 assembly (clang, -O0):
<argconfig_usage_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <have_decent_term@plt>
cmp    $0x0,%rax
je     1139 <argconfig_usage_text+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <argconfig_usage_text+0x34>
lea    0xecf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argconfig_usage_text>:
push   %rax
xor    %eax,%eax
call   1030 <have_decent_term@plt>
test   %rax,%rax
lea    0xeed(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\1B[1mUsage:\1B[0m\00"
@.str.1 = [7 x i8] c"Usage:\00"
define i8* @argconfig_usage_text() {
%1 = alloca i8*
%2 = call i64 (...) @have_decent_term()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
br label %6
5: ; preds = %0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"\1B[1mUsage:\1B[0m\00"
@.str.1 = [7 x i8] c"Usage:\00"
define i8* @argconfig_usage_text() {
%1 = tail call i64 (...) @have_decent_term()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int strcmp(char *, char *);
int os_strcmp(char *s1, char *s2) { return strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<os_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @os_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}