xunge/DecIR huggingface dataset:
void print_string(string) const char *string;
{
  while (*string != '\0')
    print_char(*string++);
  print_done();
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <print_string+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1040 <print_char@plt>
jmp    112c <print_string+0xc>
mov    $0x0,%al
call   1030 <print_done@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1145 <print_string+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1040 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_string+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1030 <print_done@plt>

LLVM IR (-O0):
define void @print_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %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 %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @print_char to i32 (i32, ...)*)(i32 %12)
br label %3
14: ; preds = %3
%15 = call i32 (...) @print_done()
ret void
}

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_char to i32 (i32, ...)*)(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 (...) @print_done()
ret void
}
void do_ulong_math(unsigned long int *x) {
  printf("%s: X before: %lu\n", __func__, *x);
  *x += 5;
  printf("%s: X after: %lu\n", __func__, *x);
}


x86 assembly (clang, -O0):
<do_ulong_math>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xed6(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x5,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ulong_math>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdx
lea    0xedf(%rip),%rdi
lea    0xeeb(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%rdx
add    $0x5,%rdx
mov    %rdx,(%rbx)
lea    0xede(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s: X before: %lu\0A\00"
@__func__.do_ulong_math = [14 x i8] c"do_ulong_math\00"
@.str.1 = [18 x i8] c"%s: X after: %lu\0A\00"
define void @do_ulong_math(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_ulong_math, i64 0, i64 0), i64 %4)
%6 = load i64*, i64** %2
%7 = load i64, i64* %6
%8 = add i64 %7, 5
store i64 %8, i64* %6
%9 = load i64*, i64** %2
%10 = load i64, i64* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_ulong_math, i64 0, i64 0), i64 %10)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s: X before: %lu\0A\00"
@__func__.do_ulong_math = [14 x i8] c"do_ulong_math\00"
@.str.1 = [18 x i8] c"%s: X after: %lu\0A\00"
define void @do_ulong_math(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_ulong_math, i64 0, i64 0), i64 %2)
%4 = load i64, i64* %0
%5 = add i64 %4, 5
store i64 %5, i64* %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_ulong_math, i64 0, i64 0), i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ lseek(int, int, int /*<<< orphan*/);
int write(int, char *, int);
int write_data(int fd, char *buff, int len) {
  if (lseek(fd, 0x6600, SEEK_SET) < 0)
    return -1;
  return write(fd, buff, len);
}


x86 assembly (clang, -O0):
<write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    $0x6600,%esi
call   1040 <lseek@plt>
cmp    $0x0,%rax
jge    115e <write_data+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <write_data+0x50>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    $0x6600,%esi
call   1040 <lseek@plt>
test   %rax,%rax
js     1155 <write_data+0x35>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @write_data(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* @SEEK_SET
%10 = call i64 @lseek(i32 %8, i32 26112, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 -1, i32* %4
br label %18
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = call i32 @write(i32 %14, i8* %15, i32 %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @write_data(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @lseek(i32 %0, i32 26112, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}
/* Variables and functions */
int ioCanListPathOfSize(char *, int);
int secCanListPathOfSize(char *pathName, int pathNameSize) {
  return ioCanListPathOfSize(pathName, pathNameSize);
}


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

x86 assembly (clang, -O2):
<secCanListPathOfSize>:
jmp    1030 <ioCanListPathOfSize@plt>

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

LLVM IR (-O2):
define i32 @secCanListPathOfSize(i8* %0, i32 %1) {
%3 = tail call i32 @ioCanListPathOfSize(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ vPortInitTickTimer();
int /*<<< orphan*/ vPortStopTickTimer();
void FRTOS1_Init(void) {
  vPortInitTickTimer();
  vPortStopTickTimer();
}


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

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

LLVM IR (-O0):
define void @FRTOS1_Init() {
%1 = call i32 (...) @vPortInitTickTimer()
%2 = call i32 (...) @vPortStopTickTimer()
ret void
}

LLVM IR (-O2):
define void @FRTOS1_Init() {
%1 = tail call i32 (...) @vPortInitTickTimer()
%2 = tail call i32 (...) @vPortStopTickTimer()
ret void
}
void av_image_fill_arrays() {}


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

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

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

LLVM IR (-O2):
define void @av_image_fill_arrays() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char const *, size_t const);
const char *unpack_mem(void *data, const size_t size, const char *buffer) {
  memcpy(data, buffer, size);
  return buffer + size;
}


x86 assembly (clang, -O0):
<unpack_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_mem>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @unpack_mem(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = load i64, i64* %5
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %6
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
ret i8* %13
}

LLVM IR (-O2):
define i8* @unpack_mem(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %1)
%5 = getelementptr inbounds i8, i8* %2, i64 %1
ret i8* %5
}
/* Variables and functions */
int rename(char const *, char const *);
int sysRename(const char *pszOldPath, const char *pszNewPath) {
  return rename(pszOldPath, pszNewPath);
}


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

x86 assembly (clang, -O2):
<sysRename>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @sysRename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
char *realloc(char *, size_t);
int _eml_realloc_buffer(char **bufp, size_t *bufsizep, size_t incr) {
  size_t newsize = *bufsizep + incr;
  char *newp = realloc(*bufp, newsize);
  if (newp == NULL)
    return 1;
  *bufp = newp;
  *bufsizep = newsize;
  return 0;
}


x86 assembly (clang, -O0):
<_eml_realloc_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    115e <_eml_realloc_buffer+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    117b <_eml_realloc_buffer+0x6b>
mov    -0x30(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eml_realloc_buffer>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
add    (%rsi),%rbx
mov    (%rdi),%rdi
mov    %rbx,%rsi
call   1030 <realloc@plt>
test   %rax,%rax
je     113b <_eml_realloc_buffer+0x2b>
mov    %rax,(%r15)
mov    %rbx,(%r14)
xor    %eax,%eax
jmp    1140 <_eml_realloc_buffer+0x30>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @_eml_realloc_buffer(i8** nocapture %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %1
%5 = add i64 %4, %2
%6 = load i8*, i8** %0
%7 = tail call i8* @realloc(i8* %6, i64 %5)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %3
store i8* %7, i8** %0
store i64 %5, i64* %1
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ 0, %9 ], [ 1, %3 ]
ret i32 %11
}
outerr(s) char *s;
{ write(2, s, strlen(s)); }


x86 assembly (clang, -O0):
<outerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outerr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @outerr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %4, i64 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @outerr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %0, i64 %2)
ret i32 undef
}
int f_103x(void) { return 103; }


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

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

LLVM IR (-O0):
define i32 @f_103x() {
ret i32 103
}

LLVM IR (-O2):
define i32 @f_103x() {
ret i32 103
}
void XWhitePixel() {}


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

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

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

LLVM IR (-O2):
define void @XWhitePixel() {
ret void
}
char *nullc(const char *s) { return (char *)s; }


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

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

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

LLVM IR (-O2):
define i8* @nullc(i8* readnone returned %0) {
ret i8* %0
}
int adbhid_kbd_event() {}


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

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

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

LLVM IR (-O2):
define i32 @adbhid_kbd_event() {
ret i32 undef
}
void I010Copy() {}


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

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

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

LLVM IR (-O2):
define void @I010Copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__26__IO__clr();
void Msp430GpioC__4__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__26__IO__clr();
}


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

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

LLVM IR (-O0):
define void @Msp430GpioC__4__HplGeneralIO__clr() {
%1 = call i32 (...) @HplMsp430GeneralIOP__26__IO__clr()
ret void
}

LLVM IR (-O2):
define void @Msp430GpioC__4__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__26__IO__clr()
ret void
}
void signed_char_mul_unsigned_char(signed char *LHS, unsigned char RHS) {
  (*LHS) *= RHS;
}


x86 assembly (clang, -O0):
<signed_char_mul_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
imul   %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_mul_unsigned_char>:
mov    (%rdi),%al
mul    %sil
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_mul_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = mul nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_mul_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = mul i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf(char *);
void TestB() {
  while (1) {
    printf("B");
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <TestB+0x9>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1129 <TestB+0x9>

x86 assembly (clang, -O2):
<TestB>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestB+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
define void @TestB() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @milli_delay(i32 200)
br label %1
}

LLVM IR (-O2):
define void @TestB() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @putchar(i32 66)
%3 = tail call i32 @milli_delay(i32 200)
br label %1
}
void SetDebuggerThreadName(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @SetDebuggerThreadName(i8* nocapture %0) {
ret void
}
/* Variables and functions */
long double acos(double);
__attribute__((weak)) long double acosl(long double x) {
  return acos((double)x);
}


x86 assembly (clang, -O0):
<acosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <acos@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <acos@plt>

LLVM IR (-O0):
define weak x86_fp80 @acosl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @acos(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @acosl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @acos(double %2)
ret x86_fp80 %3
}
prologue() {}


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

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

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

LLVM IR (-O2):
define i32 @prologue() {
ret i32 undef
}
int test_imm_E0int16_reg(short val) {
  return ((val) & (0xE0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E0int16_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, 224
%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_E0int16_reg(i16 signext %0) {
%2 = and i16 %0, 224
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_set_cache_inv(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_set_cache_inv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double now() {
  struct timeval t;
  gettimeofday(&t, (struct timezone *)0);
  return (((double)t.tv_sec) + (((double)t.tv_usec) / 1000000.0));
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t sbrk(int incr) { return (caddr_t)0; }


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

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

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

LLVM IR (-O2):
define i32 @sbrk(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int seq_random() {
  int i;
  i = rand() % 100 + 1;
  printf("the seq is :%d\n", i);
  return i;
}


x86 assembly (clang, -O0):
<seq_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_random>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"the seq is :%d\0A\00"
define i32 @seq_random() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [16 x i8] c"the seq is :%d\0A\00"
define i32 @seq_random() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
long __atomic_cas(volatile long *p, long test, long set) {
  asm volatile("lock; cmpxchg %3, %1"
               : "=a"(test), "=m"(*p)
               : "a"(test), "r"(set)
               : "memory");
  return test;
}


x86 assembly (clang, -O0):
<__atomic_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_cas>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i64 @__atomic_cas(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 asm sideeffect "lock; cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i64 %8, i64 %9)
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @__atomic_cas(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "lock; cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int check_cursor_pos(char *, char const *, int const *);
int /*<<< orphan*/ lou_free();
int main(int argc, char **argv) {
  const char *str2 = "greetings  ";
  const int expected_pos2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 8};
  int result =
      check_cursor_pos("compress.cti,en-us-g2.ctb", str2, expected_pos2);
  lou_free();
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xed4(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    0xe97(%rip),%rdi
call   1030 <check_cursor_pos@plt>
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1040 <lou_free@plt>
mov    -0x54(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movups 0xf20(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebd(%rip),%rdi
lea    0xeaa(%rip),%rsi
mov    %rsp,%rdx
call   1030 <check_cursor_pos@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <lou_free@plt>
mov    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"greetings \00"
@__const.main.expected_pos2 = [11 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 7, i32 8]
@.str.1 = [26 x i8] c"compress.cti,en-us-g2.ctb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [11 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %6
%9 = bitcast [11 x i32]* %7 to i8*
%10 = load i8*, i8** %6
%11 = getelementptr inbounds [11 x i32], [11 x i32]* %7, i64 0, i64 0
%12 = call i32 @check_cursor_pos(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32* %11)
store i32 %12, i32* %8
%13 = call i32 (...) @lou_free()
%14 = load i32, i32* %8
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"greetings \00"
@__const.main.expected_pos2 = [11 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 7, i32 8]
@.str.1 = [26 x i8] c"compress.cti,en-us-g2.ctb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [11 x i32]
%4 = bitcast [11 x i32]* %3 to i8*
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%6 = call i32 @check_cursor_pos(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = call i32 (...) @lou_free()
ret i32 %6
}
/* Variables and functions */
size_t strlen(char *);
void pad_spaces(char *str, size_t len) {
  size_t x;
  for (x = strlen(str); x < len - 1; x++) {
    str[x] = ' ';
  }
  str[len - 1] = 0;
}


x86 assembly (clang, -O0):
<pad_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    115f <pad_spaces+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112d <pad_spaces+0x1d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_spaces>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rdx
sub    %rax,%rdx
jbe    114b <pad_spaces+0x2b>
add    %r14,%rax
mov    %rax,%rdi
mov    $0x20,%esi
call   1040 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @pad_spaces(i8* nocapture %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %1, -1
%5 = icmp ugt i64 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = getelementptr i8, i8* %0, i64 %3
%8 = sub i64 %4, %3
br label %9
9: ; preds = %6, %2
%10 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %10
ret void
}
/* Type definitions */
struct spx_mpool {
  int dummy;
};

/* Variables and functions */
void *spx_mpool_malloc(struct spx_mpool *, size_t const, int *);
void *spx_mpool_alloc(struct spx_mpool *pool, const size_t numbs,
                      const size_t size, int *err) {
  return spx_mpool_malloc(pool, numbs * size, err);
}


x86 assembly (clang, -O0):
<spx_mpool_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <spx_mpool_malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spx_mpool_alloc>:
imul   %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <spx_mpool_malloc@plt>

LLVM IR (-O0):
%struct.spx_mpool = type { i32 }
define i8* @spx_mpool_alloc(%struct.spx_mpool* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca %struct.spx_mpool*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store %struct.spx_mpool* %0, %struct.spx_mpool** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load %struct.spx_mpool*, %struct.spx_mpool** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = mul i64 %10, %11
%13 = load i32*, i32** %8
%14 = call i8* @spx_mpool_malloc(%struct.spx_mpool* %9, i64 %12, i32* %13)
ret i8* %14
}

LLVM IR (-O2):
%struct.spx_mpool = type { i32 }
define i8* @spx_mpool_alloc(%struct.spx_mpool* %0, i64 %1, i64 %2, i32* %3) {
%5 = mul i64 %2, %1
%6 = tail call i8* @spx_mpool_malloc(%struct.spx_mpool* %0, i64 %5, i32* %3)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ RSA_PKCS1_PADDING;
int RSA_public_decrypt(int, unsigned char *, unsigned char *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *createRSA(char const *, int);
int public_decrypt(const char *data, int data_len, const char *key,
                   unsigned char *decrypted) {
  RSA *rsa = createRSA(key, 1);
  return RSA_public_decrypt(data_len, (unsigned char *)data, decrypted, rsa,
                            RSA_PKCS1_PADDING);
}


x86 assembly (clang, -O0):
<public_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1040 <createRSA@plt>
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    0x2e79(%rip),%rax
mov    (%rax),%r8d
call   1030 <RSA_public_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<public_decrypt>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
mov    $0x1,%esi
call   1040 <createRSA@plt>
mov    0x2e98(%rip),%rcx
mov    (%rcx),%r8d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %rax,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <RSA_public_decrypt@plt>

LLVM IR (-O0):
@RSA_PKCS1_PADDING = global i32 0
define i32 @public_decrypt(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %7
%11 = call i32* @createRSA(i8* %10, i32 1)
store i32* %11, i32** %9
%12 = load i32, i32* %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %8
%15 = load i32*, i32** %9
%16 = load i32, i32* @RSA_PKCS1_PADDING
%17 = call i32 @RSA_public_decrypt(i32 %12, i8* %13, i8* %14, i32* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@RSA_PKCS1_PADDING = global i32 0
define i32 @public_decrypt(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32* @createRSA(i8* %2, i32 1)
%6 = load i32, i32* @RSA_PKCS1_PADDING
%7 = tail call i32 @RSA_public_decrypt(i32 %1, i8* %0, i8* %3, i32* %5, i32 %6)
ret i32 %7
}
unsigned int bcm2835_version(void) { return 10060; }


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

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

LLVM IR (-O0):
define i32 @bcm2835_version() {
ret i32 10060
}

LLVM IR (-O2):
define i32 @bcm2835_version() {
ret i32 10060
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rotxr() {
  printf("tmp = srcb & 1;\n");
  printf("dst = srcb >> 1;\n");
  printf("if (c) dst|=0x80;\n");
  printf("c = tmp;\n");
}


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

x86 assembly (clang, -O2):
<rotxr>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"tmp = srcb & 1;\0A\00"
@.str.1 = [18 x i8] c"dst = srcb >> 1;\0A\00"
@.str.2 = [19 x i8] c"if (c) dst|=0x80;\0A\00"
@.str.3 = [10 x i8] c"c = tmp;\0A\00"
define void @rotxr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"tmp = srcb & 1;\00"
@str.4 = [17 x i8] c"dst = srcb >> 1;\00"
@str.5 = [18 x i8] c"if (c) dst|=0x80;\00"
@str.6 = [9 x i8] c"c = tmp;\00"
define void @rotxr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
ret void
}
void glk_set_interrupt_handler(void (*func)(void)) {}


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

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

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

LLVM IR (-O2):
define void @glk_set_interrupt_handler(void ()* nocapture %0) {
ret void
}
float clampf(float value, float low, float high) {
  if (value < low)
    value = low;
  else if (value > high)
    value = high;
  return value;
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clampf+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <clampf+0x53>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    114e <clampf+0x4e>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <clampf+0x53>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
ucomiss %xmm0,%xmm1
ja     1110 <clampf+0x10>
ucomiss %xmm2,%xmm0
movaps %xmm0,%xmm1
jbe    1110 <clampf+0x10>
movaps %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp ogt float %0, %2
br i1 %6, label %7, label %8
7: ; preds = %5
br label %8
8: ; preds = %3, %5, %7
%9 = phi float [ %2, %7 ], [ %0, %5 ], [ %1, %3 ]
ret float %9
}
void __attribute__((warning(
    "curl_easy_setopt expects a curl_conv_callback argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_conv_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_conv_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int uart_rename(const char *oldname __attribute__((unused)),
                const char *newname __attribute__((unused))) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<uart_rename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_rename>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @uart_rename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @uart_rename(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ thrd_exit(int /*<<< orphan*/);
int print_thread(void *s) {
  printf("%s\n", (char *)s);
  thrd_exit(0);
}


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

x86 assembly (clang, -O2):
<print_thread>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <thrd_exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @print_thread(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @thrd_exit(i32 0)
ret i32 undef
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int filepresent(char *run) {
  struct stat buf;
  if (!stat(run, &buf))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<filepresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
jne    113e <filepresent+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <filepresent+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filepresent>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @filepresent(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @filepresent(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int numlength(off_t num) {
  int x = 0;
  while (num) {
    num /= 10;
    ++x;
  }
  return x;
}


x86 assembly (clang, -O0):
<numlength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <numlength+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <numlength+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numlength>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <numlength+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <numlength+0x10>
ret

LLVM IR (-O0):
define i32 @numlength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @numlength(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}