xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ffesum(unsigned long, int, char *);
void Cffesum(double dsum, int complm, char *ascii) {
  unsigned long sum = (unsigned long)dsum;
  ffesum(sum, complm, ascii);
}


x86 assembly (clang, -O0):
<Cffesum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <ffesum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cffesum>:
cvttsd2si %xmm0,%rax
mov    %rsi,%rdx
mov    %edi,%esi
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xed7(%rip),%xmm0
cvttsd2si %xmm0,%rdi
and    %rcx,%rdi
or     %rax,%rdi
jmp    1030 <ffesum@plt>

LLVM IR (-O0):
define void @Cffesum(double %0, i32 %1, i8* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store double %0, double* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load double, double* %4
%9 = fptoui double %8 to i64
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = call i32 @ffesum(i64 %10, i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @Cffesum(double %0, i32 %1, i8* %2) {
%4 = fptoui double %0 to i64
%5 = tail call i32 @ffesum(i64 %4, i32 %1, i8* %2)
ret void
}
void g_unichar_isdigit() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_isdigit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(int /*<<< orphan*/);
void test() {
  int i, j, k;
  { hash(0); }
}


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

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @hash(i32 0)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @hash(i32 0)
ret void
}
/* Variables and functions */
int f(int);
int main(void) {
  int c;
  return f(c);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int write(int, char *, int);
void writeToDevice(int fd, int reg, int val) {
  char buf[2];
  buf[0] = reg;
  buf[1] = val;
  if (write(fd, buf, 2) != 2) {
    fprintf(stderr, "Can't write to device\n");
  }
}


x86 assembly (clang, -O0):
<writeToDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x2,%eax
je     116c <writeToDevice+0x4c>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeToDevice>:
push   %rax
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x2,%eax
jne    1140 <writeToDevice+0x20>
pop    %rax
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Can't write to device\0A\00"
define void @writeToDevice(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i32, i32* %6
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i32, i32* %4
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%16 = call i32 @write(i32 %14, i8* %15, i32 2)
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %21
18: ; preds = %3
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %18, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Can't write to device\0A\00"
define void @writeToDevice(i32 %0, i32 %1, i32 %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = trunc i32 %1 to i8
store i8 %6, i8* %5
%7 = trunc i32 %2 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @write(i32 %0, i8* %5, i32 2)
%10 = icmp eq i32 %9, 2
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %3
ret void
}
/* Variables and functions */
double mt_rand_32(int);
int rint(double);
char mt_rand_bit(int my_rank) {
  double full_value = mt_rand_32(my_rank) * (1.0 / 4294967295.0);
  int rounded = rint(full_value);
  return rounded + '0';
}


x86 assembly (clang, -O0):
<mt_rand_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <mt_rand_32@plt>
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <rint@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_bit>:
push   %rax
call   1040 <mt_rand_32@plt>
mulsd  0xed2(%rip),%xmm0
call   1030 <rint@plt>
add    $0x30,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @mt_rand_bit(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call double @mt_rand_32(i32 %5)
%7 = fmul double %6, 0x3DF0000000100000
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 @rint(double %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @mt_rand_bit(i32 %0) {
%2 = tail call double @mt_rand_32(i32 %0)
%3 = fmul double %2, 0x3DF0000000100000
%4 = tail call i32 @rint(double %3)
%5 = trunc i32 %4 to i8
%6 = add i8 %5, 48
ret i8 %6
}
int setTTySize(int fd, int width, int height) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @setTTySize(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int usleep(int);
int usec_sleep(int usec_delay) { return usleep(usec_delay); }


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

x86 assembly (clang, -O2):
<usec_sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define i32 @usec_sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ ERANGE;
scalar_t__ ULLONG_MAX;
int /*<<< orphan*/ errno;
scalar_t__ strtoumax(char const *, char **, int);
unsigned long long strtoull(const char *s, char **p, int base) {
  uintmax_t x = strtoumax(s, p, base);
  if (x > ULLONG_MAX) {
    errno = ERANGE;
    return ULLONG_MAX;
  }
  return x;
}


x86 assembly (clang, -O0):
<strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strtoumax@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
jle    1170 <strtoull+0x60>
mov    0x2e8e(%rip),%rax
mov    (%rax),%ecx
mov    0x2e75(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e84(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <strtoull+0x68>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoull>:
push   %rax
call   1030 <strtoumax@plt>
mov    0x2ecb(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rcx,%rax
jle    113a <strtoull+0x2a>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    0x2e9b(%rip),%rdx
mov    %eax,(%rdx)
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@ULLONG_MAX = global i64 0
@ERANGE = global i32 0
@errno = global i32 0
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i64
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = call i64 @strtoumax(i8* %9, i8** %10, i32 %11)
store i64 %12, i64* %8
%13 = load i64, i64* %8
%14 = load i64, i64* @ULLONG_MAX
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i32, i32* @ERANGE
store i32 %17, i32* @errno
%18 = load i64, i64* @ULLONG_MAX
store i64 %18, i64* %4
br label %21
19: ; preds = %3
%20 = load i64, i64* %8
store i64 %20, i64* %4
br label %21
21: ; preds = %19, %16
%22 = load i64, i64* %4
ret i64 %22
}

LLVM IR (-O2):
@ULLONG_MAX = global i64 0
@ERANGE = global i32 0
@errno = global i32 0
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strtoumax(i8* %0, i8** %1, i32 %2)
%5 = load i64, i64* @ULLONG_MAX
%6 = icmp sgt i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = load i32, i32* @ERANGE
store i32 %8, i32* @errno
br label %9
9: ; preds = %3, %7
%10 = phi i64 [ %5, %7 ], [ %4, %3 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getgroups(int gidsetsize __attribute__((unused)),
              gid_t grouplist[] __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @getgroups(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int divides(int, int);
bool is_evenly_divisible_by(int n, int m) { return divides(m, n); }


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

x86 assembly (clang, -O2):
<is_evenly_divisible_by>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <divides@plt>

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

LLVM IR (-O2):
define i32 @is_evenly_divisible_by(i32 %0, i32 %1) {
%3 = tail call i32 @divides(i32 %1, i32 %0)
ret i32 %3
}
int start_PC() { return 32; }


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

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

LLVM IR (-O0):
define i32 @start_PC() {
ret i32 32
}

LLVM IR (-O2):
define i32 @start_PC() {
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void zeromem_a(void *mem, int size) { memset(mem, 0, size); }


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

x86 assembly (clang, -O2):
<zeromem_a>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @zeromem_a(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
void fd_wait(fd_set *fds, int *maxfd, int fd) {
  if (fd > *maxfd)
    *maxfd = fd;
  FD_SET(fd, fds);
}


x86 assembly (clang, -O0):
<fd_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    113b <fd_wait+0x2b>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <FD_SET@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_wait>:
mov    %rdi,%rax
cmp    %edx,(%rsi)
jge    1119 <fd_wait+0x9>
mov    %edx,(%rsi)
mov    %edx,%edi
mov    %rax,%rsi
jmp    1030 <FD_SET@plt>

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

LLVM IR (-O2):
define void @fd_wait(i32* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 %2, i32* %1
br label %7
7: ; preds = %6, %3
%8 = tail call i32 @FD_SET(i32 %2, i32* %0)
ret void
}
void OS_playMusic(int id) {}


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

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

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

LLVM IR (-O2):
define void @OS_playMusic(i32 %0) {
ret void
}
int yesDialog(char *msg) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @yesDialog(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int RAND_MAX;
int rand();
char get_printable_rand_char() {
  char r;
  int R = 93;
  char c;
  r = R + rand() / (RAND_MAX / (2 - R) + 1);
  c = r + 33;
  return c;
}


x86 assembly (clang, -O0):
<get_printable_rand_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5d,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x21,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_printable_rand_char>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
movslq (%rcx),%rcx
imul   $0x4bf4bf4b,%rcx,%rdx
shr    $0x20,%rdx
sub    %ecx,%edx
mov    %edx,%ecx
sar    $0x6,%ecx
shr    $0x1f,%edx
add    %edx,%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    $0x7e,%al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define signext i8 @get_printable_rand_char() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i8
store i32 93, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (...) @rand()
%6 = load i32, i32* @RAND_MAX
%7 = load i32, i32* %2
%8 = sub nsw i32 2, %7
%9 = sdiv i32 %6, %8
%10 = add nsw i32 %9, 1
%11 = sdiv i32 %5, %10
%12 = add nsw i32 %4, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = sext i8 %14 to i32
%16 = add nsw i32 %15, 33
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
%18 = load i8, i8* %3
ret i8 %18
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define signext i8 @get_printable_rand_char() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, -91
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %1, %4
%6 = trunc i32 %5 to i8
%7 = add i8 %6, 126
ret i8 %7
}
char *strcpy(char *destination, const char *source) {
  char *dp = destination;
  do {
    *dp++ = *source++;
  } while (*source);
  return destination;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %3, %2 ], [ %10, %4 ]
%6 = phi i8* [ %1, %2 ], [ %8, %4 ]
%7 = phi i8* [ %0, %2 ], [ %9, %4 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %5, i8* %7
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4
ret i8* %0
}
int c046(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c046() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n  imv_policy_manager start|stop <tnc-session-id>\n");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"Usage:\0A imv_policy_manager start|stop <tnc-session-id>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"Usage:\0A imv_policy_manager start|stop <tnc-session-id>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
void RTP_set_extension_type(unsigned char *p, unsigned int v) {
  p[12] = (unsigned char)((unsigned int)(0xff & v >> 8));
  p[13] = (unsigned char)(0xff & v);
}


x86 assembly (clang, -O0):
<RTP_set_extension_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xc(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xd(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_set_extension_type>:
rol    $0x8,%si
mov    %si,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @RTP_set_extension_type(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %4, i8* %5
%6 = trunc i32 %1 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
scalar_t__ root(int);
int isConnected(int p, int q) {
  if (root(p) == root(q)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isConnected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <root@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <root@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jne    114e <isConnected+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <isConnected+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isConnected>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <root@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <root@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isConnected(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = call i64 @root(i32 %6)
%8 = load i32, i32* %5
%9 = call i64 @root(i32 %8)
%10 = icmp eq i64 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @isConnected(i32 %0, i32 %1) {
%3 = tail call i64 @root(i32 %0)
%4 = tail call i64 @root(i32 %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xstrdup(char *str) {
  char *t = (char *)malloc(strlen(str) + 1);
  strcpy(t, str);
  return (t);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stupify(char *);
int main(int argc, char **argv) {
  if (argc > 1)
    stupify(argv[1]);
  printf("\n");
  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)
cmpl   $0x1,-0x8(%rbp)
jle    114d <main+0x2d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <stupify@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1040 <stupify@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\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 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @stupify(i8* %11)
br label %13
13: ; preds = %8, %2
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @stupify(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ note(int, char *);
void noHt(void) { note(1, "No hyperthreading detected.\n"); }


x86 assembly (clang, -O0):
<noHt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <note@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<noHt>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <note@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"No hyperthreading detected.\0A\00"
define void @noHt() {
%1 = call i32 @note(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"No hyperthreading detected.\0A\00"
define void @noHt() {
%1 = tail call i32 @note(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ td_thrhandle_t;
typedef int /*<<< orphan*/ td_err_e;
typedef int /*<<< orphan*/ psaddr_t;

/* Variables and functions */
int /*<<< orphan*/ TD_NOAPLIC;
td_err_e td_thr_tls_get_addr(const td_thrhandle_t *th, psaddr_t map_address,
                             size_t offset, psaddr_t *address) {
  return TD_NOAPLIC;
}


x86 assembly (clang, -O0):
<td_thr_tls_get_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_thr_tls_get_addr>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TD_NOAPLIC = global i32 0
define i32 @td_thr_tls_get_addr(i32* %0, i32 %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i32, i32* @TD_NOAPLIC
ret i32 %9
}

LLVM IR (-O2):
@TD_NOAPLIC = global i32 0
define i32 @td_thr_tls_get_addr(i32* nocapture readnone %0, i32 %1, i64 %2, i32* nocapture readnone %3) {
%5 = load i32, i32* @TD_NOAPLIC
ret i32 %5
}
int _div(int a, int b) { return ((int)(a / b)); }


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

x86 assembly (clang, -O2):
<_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int CG_GetStatValue(void *);
int CG_GetRaceStatValue(void *parameter) { return CG_GetStatValue(parameter); }


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

x86 assembly (clang, -O2):
<CG_GetRaceStatValue>:
jmp    1030 <CG_GetStatValue@plt>

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

LLVM IR (-O2):
define i32 @CG_GetRaceStatValue(i8* %0) {
%2 = tail call i32 @CG_GetStatValue(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ *hybris_set_realrwlock(int /*<<< orphan*/ *);
int pthread_rwlock_tryrdlock(int /*<<< orphan*/ *);
int my_pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_tryrdlock(realrwlock);
}


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

x86 assembly (clang, -O2):
<my_pthread_rwlock_tryrdlock>:
push   %rax
call   1040 <hybris_set_realrwlock@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <pthread_rwlock_tryrdlock@plt>

LLVM IR (-O0):
define i32 @my_pthread_rwlock_tryrdlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32* @hybris_set_realrwlock(i32* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @pthread_rwlock_tryrdlock(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_pthread_rwlock_tryrdlock(i32* %0) {
%2 = tail call i32* @hybris_set_realrwlock(i32* %0)
%3 = tail call i32 @pthread_rwlock_tryrdlock(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(5);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
char *syck_xprivate(char *type_id, int type_len) {
  char *uri = (char *)malloc(sizeof(char) * (type_len + 14));
  uri[0] = '\0';
  strcat(uri, "x-private:");
  strncat(uri, type_id, type_len);
  return uri;
}


x86 assembly (clang, -O0):
<syck_xprivate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xe,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syck_xprivate>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0xe(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
lea    0xeaf(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"x-private:\00"
define i8* @syck_xprivate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 14
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 0, i8* %14
%15 = load i8*, i8** %5
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = call i32 @strncat(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [11 x i8] c"x-private:\00"
define i8* @syck_xprivate(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 14
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
store i8 0, i8* %5
%6 = tail call i32 @strcat(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strncat(i8* %5, i8* %0, i32 %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ box(int, int, int, int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basBox() {
  int x, y, x1, y1;
  y1 = popNumber();
  x1 = popNumber();
  y = popNumber();
  x = popNumber();
  pushNumber(box(x, y, x1, y1));
}


x86 assembly (clang, -O0):
<basBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <box@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basBox>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <box@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basBox() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @popNumber()
store i32 %5, i32* %4
%6 = call i32 (...) @popNumber()
store i32 %6, i32* %3
%7 = call i32 (...) @popNumber()
store i32 %7, i32* %2
%8 = call i32 (...) @popNumber()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @box(i32 %9, i32 %10, i32 %11, i32 %12)
%14 = call i32 @pushNumber(i32 %13)
ret void
}

LLVM IR (-O2):
define void @basBox() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 (...) @popNumber()
%4 = tail call i32 (...) @popNumber()
%5 = tail call i32 @box(i32 %4, i32 %3, i32 %2, i32 %1)
%6 = tail call i32 @pushNumber(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintUsage() {
  printf("usage: tga242arr -t tga -a arr -p pal [ -i ident ] [ --rgb565 ]\n");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"usage: tga242arr -t tga -a arr -p pal [ -i ident ] [ --rgb565 ]\0A\00"
define void @PrintUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"usage: tga242arr -t tga -a arr -p pal [ -i ident ] [ --rgb565 ]\00"
define void @PrintUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct jit_state {
  int dummy;
};
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ emit1(struct jit_state *, int /*<<< orphan*/);
int /*<<< orphan*/ emit_alu64(struct jit_state *, int, int, int);
void emit_alu64_imm8(struct jit_state *state, int op, int src, int dst,
                     int8_t imm) {
  emit_alu64(state, op, src, dst);
  emit1(state, imm);
}


x86 assembly (clang, -O0):
<emit_alu64_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <emit_alu64@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <emit1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_alu64_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rdi,%rbx
call   1040 <emit_alu64@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <emit1@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_alu64_imm8(%struct.jit_state* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.jit_state*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.jit_state*, %struct.jit_state** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = call i32 @emit_alu64(%struct.jit_state* %11, i32 %12, i32 %13, i32 %14)
%16 = load %struct.jit_state*, %struct.jit_state** %6
%17 = load i32, i32* %10
%18 = call i32 @emit1(%struct.jit_state* %16, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_alu64_imm8(%struct.jit_state* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @emit_alu64(%struct.jit_state* %0, i32 %1, i32 %2, i32 %3)
%7 = tail call i32 @emit1(%struct.jit_state* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blindcmd(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
void closeserial(int fd) {
  blindcmd(fd, "ATZ", 0);
  close(fd);
}


x86 assembly (clang, -O0):
<closeserial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
xor    %edx,%edx
call   1040 <blindcmd@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeserial>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
xor    %edx,%edx
call   1040 <blindcmd@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"ATZ\00"
define void @closeserial(i32 %0) {
%2 = tail call i32 @blindcmd(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @close(i32 %0)
ret void
}
void security_sb_post_addmount(struct vfsmount *mnt,
                               struct nameidata *mountpoint_nd) {}


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

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

LLVM IR (-O0):
%struct.vfsmount = type opaque
%struct.nameidata = type opaque
define void @security_sb_post_addmount(%struct.vfsmount* %0, %struct.nameidata* %1) {
%3 = alloca %struct.vfsmount*
%4 = alloca %struct.nameidata*
store %struct.vfsmount* %0, %struct.vfsmount** %3
store %struct.nameidata* %1, %struct.nameidata** %4
ret void
}

LLVM IR (-O2):
%struct.vfsmount = type opaque
%struct.nameidata = type opaque
define void @security_sb_post_addmount(%struct.vfsmount* nocapture %0, %struct.nameidata* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t present_sbox(uint8_t b) {
  static const uint8_t sb[] = {0xC, 0x5, 0x6, 0xB, 0x9, 0x0, 0xA, 0xD,
                               0x3, 0xE, 0xF, 0x8, 0x4, 0x7, 0x1, 0x2};
  return ((sb[b >> 4]) << 4) | (sb[b & 0xf]);
}


x86 assembly (clang, -O0):
<present_sbox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0xee9(%rip),%rax
mov    (%rax,%rcx,4),%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
movslq %ecx,%rdx
lea    0xed3(%rip),%rcx
or     (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<present_sbox>:
mov    %edi,%eax
sar    $0x4,%eax
cltq
lea    0xef2(%rip),%rcx
mov    (%rcx,%rax,4),%eax
shl    $0x4,%eax
and    $0xf,%edi
or     (%rcx,%rdi,4),%eax
ret

LLVM IR (-O0):
@present_sbox.sb = internal constant [16 x i32] [i32 12, i32 5, i32 6, i32 11, i32 9, i32 0, i32 10, i32 13, i32 3, i32 14, i32 15, i32 8, i32 4, i32 7, i32 1, i32 2]
define i32 @present_sbox(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [16 x i32], [16 x i32]* @present_sbox.sb, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = shl i32 %7, 4
%9 = load i32, i32* %2
%10 = and i32 %9, 15
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [16 x i32], [16 x i32]* @present_sbox.sb, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
@present_sbox.sb = internal unnamed_addr constant [16 x i32] [i32 12, i32 5, i32 6, i32 11, i32 9, i32 0, i32 10, i32 13, i32 3, i32 14, i32 15, i32 8, i32 4, i32 7, i32 1, i32 2]
define i32 @present_sbox(i32 %0) {
%2 = ashr i32 %0, 4
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [16 x i32], [16 x i32]* @present_sbox.sb, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = shl i32 %5, 4
%7 = and i32 %0, 15
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [16 x i32], [16 x i32]* @present_sbox.sb, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = or i32 %6, %10
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl32(uint32_t x, int b) { return (x << b) | (x >> (32 - b)); }


x86 assembly (clang, -O0):
<rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void FlashRX_LED(int FlashTime_ms) {}


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

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

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

LLVM IR (-O2):
define void @FlashRX_LED(i32 %0) {
ret void
}
double Sign(double a, double b) {
  double x;
  x = (a >= 0 ? a : -a);
  return (b >= 0 ? x : -x);
}


x86 assembly (clang, -O0):
<Sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112f <Sign+0x2f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1150 <Sign+0x50>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117b <Sign+0x7b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    119c <Sign+0x9c>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @Sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %13
10: ; preds = %2
%11 = load double, double* %3
%12 = fneg double %11
br label %13
13: ; preds = %10, %8
%14 = phi double [ %9, %8 ], [ %12, %10 ]
store double %14, double* %5
%15 = load double, double* %4
%16 = fcmp oge double %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %5
br label %22
19: ; preds = %13
%20 = load double, double* %5
%21 = fneg double %20
br label %22
22: ; preds = %19, %17
%23 = phi double [ %18, %17 ], [ %21, %19 ]
ret double %23
}

LLVM IR (-O2):
define double @Sign(double %0, double %1) {
%3 = fcmp oge double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %0, double %4
%6 = fcmp oge double %1, 0.000000e+00
%7 = fneg double %5
%8 = select i1 %6, double %5, double %7
ret double %8
}
void uds_on_error(struct DSClient *client) {}


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

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

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

LLVM IR (-O2):
%struct.DSClient = type opaque
define void @uds_on_error(%struct.DSClient* nocapture %0) {
ret void
}