xunge/DecIR huggingface dataset:
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int sem_V(int sem) {
  struct sembuf sb;
  sb.sem_num = 0;
  sb.sem_op = 1;
  sb.sem_flg = 0;
  if (semop(sem, &sb, 1) == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sem_V>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    1158 <sem_V+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <sem_V+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_V>:
sub    $0x18,%rsp
movl   $0x1,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
define i32 @sem_V(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %6
%7 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_ceil(float *, float *);
__attribute__((always_)) struct vec2 *psvec2_ceil(struct vec2 *result,
                                                  struct vec2 *a) {
  vec2_ceil((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec2_ceil>:
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 <vec2_ceil@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2_ceil>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_ceil@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_ceil(%struct.vec2* returned %0, %struct.vec2* %1) {
%3 = bitcast %struct.vec2* %0 to float*
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call i32 @vec2_ceil(float* %3, float* %4)
ret %struct.vec2* %0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(struct timeval *, int /*<<< orphan*/, int);
void get_now_time(struct timeval *time) {
  memset(time, 0, sizeof(struct timeval));
  gettimeofday(time, NULL);
}


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

x86 assembly (clang, -O2):
<get_now_time>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @get_now_time(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @memset(%struct.timeval* %3, i32 0, i32 4)
%5 = load %struct.timeval*, %struct.timeval** %2
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @get_now_time(%struct.timeval* %0) {
%2 = tail call i32 @memset(%struct.timeval* %0, i32 0, i32 4)
%3 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test(void) {
  printf("Hello world, from The C Language.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Hello world, from The C Language.\0A\00"
define i32 @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"Hello world, from The C Language.\00"
define i32 @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("fit as a fiddle\n");
  printf("hello world\n");
  printf("only time will tell\n");
  printf("the early bird catches the worm\n");
  printf("the quick brown fox jumped over the lazy dogs\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"fit as a fiddle\0A\00"
@.str.1 = [13 x i8] c"hello world\0A\00"
@.str.2 = [21 x i8] c"only time will tell\0A\00"
@.str.3 = [33 x i8] c"the early bird catches the worm\0A\00"
@.str.4 = [47 x i8] c"the quick brown fox jumped over the lazy dogs\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"fit as a fiddle\00"
@str.5 = [12 x i8] c"hello world\00"
@str.6 = [20 x i8] c"only time will tell\00"
@str.7 = [32 x i8] c"the early bird catches the worm\00"
@str.8 = [46 x i8] c"the quick brown fox jumped over the lazy dogs\00"
define i32 @main() {
%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 ([12 x i8], [12 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  int o0;
  o0 = fib(10);
  printf("%i\n", o0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xa,%edi
call   1040 <fib@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = call i32 @fib(i32 10)
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @fib(i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abnormal();
int /*<<< orphan*/ normal();
int main(void) {
  normal();
  abnormal();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <normal@plt>
xor    %eax,%eax
call   1030 <abnormal@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @normal()
%2 = tail call i32 (...) @abnormal()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void fatalerror(char *msg) { printf("Fatal error: %s\n", msg); }


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

x86 assembly (clang, -O2):
<fatalerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"Fatal error: %s\0A\00"
define void @fatalerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((always_)) __attribute__((no_instrument_function)) void
rcu_read_unlock_sched_notrace(void) {
  (void)0;
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<rcu_read_unlock_sched_notrace>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <rcu_read_unlock_sched_notrace+0x9>
jmp    110e <rcu_read_unlock_sched_notrace+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rcu_read_unlock_sched_notrace() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @rcu_read_unlock_sched_notrace() {
ret void
}
int test_imm_43uint32_mem(unsigned int *val) {
  return ((*val) & (0x43 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_43uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 67
%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_43uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 67
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage_error(char *program_name) {
  fprintf(stderr,
          "Usage: %s -s server -f file [-p program-number] [-v version]\n",
          program_name);
  exit(2);
}


x86 assembly (clang, -O0):
<usage_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"Usage: %s -s server -f file [-p program-number] [-v version]\0A\00"
define void @usage_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"Usage: %s -s server -f file [-p program-number] [-v version]\0A\00"
define void @usage_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cough(int);
int main(void) { cough(3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <cough@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @cough(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @cough(i32 3)
ret i32 0
}
char *strchr(p, ch) const char *p;
int ch;
{
  for (;; ++p) {
    if (*p == (char)ch)
      return ((void *)(unsigned long)(const void *)(p));
    if (!*p)
      return 0;
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <strchr+0x5d>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <strchr+0x47>
movq   $0x0,-0x8(%rbp)
jmp    115d <strchr+0x5d>
jmp    114c <strchr+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_SIG;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **);
int /*<<< orphan*/ X509_SIG_it;
X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8) {
  return ASN1_item_d2i_fp(&X509_SIG_it, fp, p8);
}


x86 assembly (clang, -O0):
<d2i_PKCS8_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2eb9(%rip),%rdi
call   1030 <ASN1_item_d2i_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_PKCS8_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rdi
jmp    1030 <ASN1_item_d2i_fp@plt>

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

LLVM IR (-O2):
@X509_SIG_it = global i32 0
define i32* @d2i_PKCS8_fp(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_fp(i32* @X509_SIG_it, i32* %0, i32** %1)
ret i32* %3
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void msleep(unsigned int duration) {
  struct timespec ts;
  unsigned int sec = duration / 1000;
  unsigned int msec = duration % 1000;
  ts.tv_sec = sec;
  ts.tv_nsec = msec * 1000000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0xf4240,-0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
imul   $0x3e8,%eax,%ecx
sub    %ecx,%edi
mov    %eax,(%rsp)
imul   $0xf4240,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = udiv i32 %6, 1000
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = urem i32 %8, 1000
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = mul i32 %12, 1000000
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %13, i32* %14
%15 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = urem i32 %0, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %6
%7 = mul nuw nsw i32 %5, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
void reverse(const char *const sPtr) {
  if (sPtr[0] == '\0') {
    return;
  } else {
    reverse(&sPtr[1]);
    putchar(sPtr[0]);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1141 <reverse+0x21>
jmp    115a <reverse+0x3a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113b <reverse+0x1b>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <reverse@plt>
movsbl (%rbx),%edi
pop    %rbx
jmp    1040 <putchar@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @reverse(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @putchar(i8 signext %7)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int, int);
int /*<<< orphan*/ write(int, unsigned char *, int);
void dni_erase_for_mmc(int devfd) {
  int block = 0;
  unsigned char buf[512];
  memset(buf, 0xFF, 512);
  while (block <= 512) {
    write(devfd, buf, 512);
    block++;
  }
}


x86 assembly (clang, -O0):
<dni_erase_for_mmc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    $0xff,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
cmpl   $0x200,-0x8(%rbp)
jg     117a <dni_erase_for_mmc+0x5a>
mov    -0x4(%rbp),%edi
lea    -0x210(%rbp),%rsi
mov    $0x200,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <dni_erase_for_mmc+0x2b>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dni_erase_for_mmc>:
push   %rbp
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xff,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
mov    $0x201,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x200,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebp
jne    1150 <dni_erase_for_mmc+0x30>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @dni_erase_for_mmc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [512 x i8]
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 255, i32 512)
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 512
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %2
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%13 = call i32 @write(i32 %11, i8* %12, i32 512)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @dni_erase_for_mmc(i32 %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 255, i32 512)
br label %5
5: ; preds = %1, %5
%6 = phi i32 [ 0, %1 ], [ %8, %5 ]
%7 = call i32 @write(i32 %0, i8* %3, i32 512)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 513
br i1 %9, label %10, label %5
10: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, void *);
void __cyg_profile_func_exit(void *callee, void *callsite) {
  printf("Exite %p in %p\n", callee, callsite);
}


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

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Exite %p in %p\0A\00"
define void @__cyg_profile_func_exit(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 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Exite %p in %p\0A\00"
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int __builtin_ptx_read_ntid_w();
int __builtin_ptx_read_ntid_x();
int __builtin_ptx_read_ntid_y();
int __builtin_ptx_read_ntid_z();
__attribute__((device)) int read_ntid() {
  int x = __builtin_ptx_read_ntid_x();
  int y = __builtin_ptx_read_ntid_y();
  int z = __builtin_ptx_read_ntid_z();
  int w = __builtin_ptx_read_ntid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_ntid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_ptx_read_ntid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__builtin_ptx_read_ntid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_ntid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <__builtin_ptx_read_ntid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ntid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__builtin_ptx_read_ntid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__builtin_ptx_read_ntid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__builtin_ptx_read_ntid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <__builtin_ptx_read_ntid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_ntid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__builtin_ptx_read_ntid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__builtin_ptx_read_ntid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__builtin_ptx_read_ntid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__builtin_ptx_read_ntid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_ntid() {
%1 = tail call i32 (...) @__builtin_ptx_read_ntid_x()
%2 = tail call i32 (...) @__builtin_ptx_read_ntid_y()
%3 = tail call i32 (...) @__builtin_ptx_read_ntid_z()
%4 = tail call i32 (...) @__builtin_ptx_read_ntid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
void testing3() {
  int k = 4;
  k + 4 < k;
}


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

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

LLVM IR (-O0):
define void @testing3() {
%1 = alloca i32
store i32 4, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 4
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = zext i1 %5 to i32
ret void
}

LLVM IR (-O2):
define void @testing3() {
ret void
}
void pd_stack_preserve(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @pd_stack_preserve(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u64;
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(double *, unsigned long long *, int);
unsigned long long read_u64(unsigned char *);
double read_double_64(unsigned char *src) {
  unsigned long long u64 = read_u64(src);
  double d;
  assert(sizeof(u64) == sizeof(d));
  memcpy(&d, &u64, sizeof(d));
  return d;
}


x86 assembly (clang, -O0):
<read_double_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <read_u64@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_double_64>:
sub    $0x18,%rsp
call   1040 <read_u64@plt>
mov    %rax,0x10(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @read_double_64(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @read_u64(i8* %5)
store i64 %6, i64* %3
%7 = call i32 @assert(i32 1)
%8 = call i32 @memcpy(double* %4, i64* %3, i32 8)
%9 = load double, double* %4
ret double %9
}

LLVM IR (-O2):
define double @read_double_64(i8* %0) {
%2 = alloca i64
%3 = alloca double
%4 = bitcast i64* %2 to i8*
%5 = tail call i64 @read_u64(i8* %0)
store i64 %5, i64* %2
%6 = bitcast double* %3 to i8*
%7 = tail call i32 @assert(i32 1)
%8 = call i32 @memcpy(double* %3, i64* %2, i32 8)
%9 = load double, double* %3
ret double %9
}
int cairo_code_draw_pwrdecaytLabel_get_width() { return 110; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_pwrdecaytLabel_get_width() {
ret i32 110
}

LLVM IR (-O2):
define i32 @cairo_code_draw_pwrdecaytLabel_get_width() {
ret i32 110
}
/* Variables and functions */
void xmemset_lt16(void *dest, int c, size_t n) {
  size_t i;
  char *d = (char *)dest;
  for (i = 0; i < n; i++) {
    d[i] = (char)c;
  }
}


x86 assembly (clang, -O0):
<xmemset_lt16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114e <xmemset_lt16+0x4e>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111f <xmemset_lt16+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemset_lt16>:
test   %rdx,%rdx
je     111f <xmemset_lt16+0xf>
push   %rax
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @xmemset_lt16(i8* nocapture writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret void
}
int ILibWebRTC_DataChannelBucketizer(int index) { return (index & (16 - 1)); }


x86 assembly (clang, -O0):
<ILibWebRTC_DataChannelBucketizer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibWebRTC_DataChannelBucketizer>:
mov    %edi,%eax
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @ILibWebRTC_DataChannelBucketizer(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _SCOTCHintRandProc(int);
void SCOTCH_randomProc(int procnum) { _SCOTCHintRandProc(procnum); }


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

x86 assembly (clang, -O2):
<SCOTCH_randomProc>:
jmp    1030 <_SCOTCHintRandProc@plt>

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

LLVM IR (-O2):
define void @SCOTCH_randomProc(i32 %0) {
%2 = tail call i32 @_SCOTCHintRandProc(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __update_all();
void update_all() { __update_all(); }


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

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

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

LLVM IR (-O2):
define void @update_all() {
%1 = tail call i32 (...) @__update_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argcv[]) {
  printf("This is UTF-8 encoded é\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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"This is UTF-8 encoded \C3\A9\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 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"This is UTF-8 encoded \C3\A9\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timex {
  int freq;
  int /*<<< orphan*/ modes;
};

/* Variables and functions */
int /*<<< orphan*/ MOD_FREQUENCY;
int adjtimex(struct timex *);
int adj_freq(int adj) {
  struct timex t;
  t.modes = MOD_FREQUENCY;
  t.freq = adj * ((1 << 16) / 1000);
  return adjtimex(&t);
}


x86 assembly (clang, -O0):
<adj_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0x41,-0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <adjtimex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adj_freq>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %edi,%eax
shl    $0x6,%eax
add    %edi,%eax
mov    %eax,(%rsp)
mov    %rsp,%rdi
call   1030 <adjtimex@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timex = type { i32, i32 }
@MOD_FREQUENCY = global i32 0
define i32 @adj_freq(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timex
store i32 %0, i32* %2
%4 = load i32, i32* @MOD_FREQUENCY
%5 = getelementptr inbounds %struct.timex, %struct.timex* %3, i32 0, i32 1
store i32 %4, i32* %5
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 65
%8 = getelementptr inbounds %struct.timex, %struct.timex* %3, i32 0, i32 0
store i32 %7, i32* %8
%9 = call i32 @adjtimex(%struct.timex* %3)
ret i32 %9
}

LLVM IR (-O2):
%struct.timex = type { i32, i32 }
@MOD_FREQUENCY = global i32 0
define i32 @adj_freq(i32 %0) {
%2 = alloca %struct.timex
%3 = bitcast %struct.timex* %2 to i8*
%4 = load i32, i32* @MOD_FREQUENCY
%5 = getelementptr inbounds %struct.timex, %struct.timex* %2, i64 0, i32 1
store i32 %4, i32* %5
%6 = mul nsw i32 %0, 65
%7 = getelementptr inbounds %struct.timex, %struct.timex* %2, i64 0, i32 0
store i32 %6, i32* %7
%8 = call i32 @adjtimex(%struct.timex* %2)
ret i32 %8
}
/* Variables and functions */
float fabs(float);
float error_absoluto(float parm1, float parm2) {
  float tempo;
  tempo = fabs(parm1 - parm2);
  return tempo;
}


x86 assembly (clang, -O0):
<error_absoluto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_absoluto>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @error_absoluto(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
%9 = call float @fabs(float %8)
store float %9, float* %5
%10 = load float, float* %5
ret float %10
}

LLVM IR (-O2):
define float @error_absoluto(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
ret float %4
}
int ukvm_dumpcore_write_prstatus(int fd, struct ukvm_hv *hv, void *cookie) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.ukvm_hv = type opaque
define i32 @ukvm_dumpcore_write_prstatus(i32 %0, %struct.ukvm_hv* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.ukvm_hv*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.ukvm_hv* %1, %struct.ukvm_hv** %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.ukvm_hv = type opaque
define i32 @ukvm_dumpcore_write_prstatus(i32 %0, %struct.ukvm_hv* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int aleatorio() {
  srand(time(NULL));
  return rand() % 6 + 1;
}


x86 assembly (clang, -O0):
<aleatorio>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aleatorio>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @aleatorio() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @aleatorio() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
ret i32 %5
}
double __complex test(double X) { return ~-(X * 1.0iF); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeea(%rip),%xmm2
movaps %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define { double, double } @test(double %0) {
%2 = alloca { double, double }
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fmul double %4, 0.000000e+00
%6 = fmul double %4, 1.000000e+00
%7 = fneg double %5
%8 = fneg double %6
%9 = fneg double %8
%10 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
%11 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 1
store double %7, double* %10
store double %9, double* %11
%12 = load { double, double }, { double, double }* %2
ret { double, double } %12
}

LLVM IR (-O2):
define { double, double } @test(double %0) {
%2 = fmul double %0, -0.000000e+00
%3 = insertvalue { double, double } poison, double %2, 0
%4 = insertvalue { double, double } %3, double %0, 1
ret { double, double } %4
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int sc_clock_gettime(int /*<<< orphan*/, struct timespec *);
int __clock_gettime(clockid_t clk, struct timespec *ts) {
  return sc_clock_gettime(clk, ts);
}


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

x86 assembly (clang, -O2):
<__clock_gettime>:
jmp    1030 <sc_clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @__clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @sc_clock_gettime(i32 %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @__clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @sc_clock_gettime(i32 %0, %struct.timespec* %1)
ret i32 %3
}
vdstrv() {}


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

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

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

LLVM IR (-O2):
define i32 @vdstrv() {
ret i32 undef
}
void hwfunctions_invalidateCacheRegion(void *ptr, int size) {
  int i, cachelines;
  volatile char *cptr;
  cptr = (volatile char *)ptr;
  cachelines = (size / 64) + 1;
  for (i = 0; i < cachelines; i++) {
    cptr += 64;
    asm volatile("clflush %0" : "+m"(*cptr));
  }
}


x86 assembly (clang, -O0):
<hwfunctions_invalidateCacheRegion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1158 <hwfunctions_invalidateCacheRegion+0x58>
mov    -0x20(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
clflush (%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <hwfunctions_invalidateCacheRegion+0x2b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwfunctions_invalidateCacheRegion>:
cmp    $0xffffffc1,%esi
jl     112c <hwfunctions_invalidateCacheRegion+0x2c>
lea    0x3f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x6,%eax
add    $0x40,%rdi
add    $0x1,%eax
nopw   0x0(%rax,%rax,1)
clflush (%rdi)
add    $0x40,%rdi
add    $0xffffffff,%eax
jne    1120 <hwfunctions_invalidateCacheRegion+0x20>
ret

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

LLVM IR (-O2):
define void @hwfunctions_invalidateCacheRegion(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, -63
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = sdiv i32 %1, 64
br label %6
6: ; preds = %4, %6
%7 = phi i8* [ %9, %6 ], [ %0, %4 ]
%8 = phi i32 [ %10, %6 ], [ 0, %4 ]
%9 = getelementptr inbounds i8, i8* %7, i64 64
tail call void asm sideeffect "clflush $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %9, i8* elementtype(i8) %9)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %8, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}