xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Introduceti un numar intreg =");
  scanf("%i", &a);
  printf("NUmarul introdus este =%i \n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Introduceti un numar intreg =\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [28 x i8] c"NUmarul introdus este =%i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Introduceti un numar intreg =\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [28 x i8] c"NUmarul introdus este =%i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
int do_vars() {
  int j;
  int i = 9;
  float f = 1.234;
  char c = 'Q';
  int *p_i = &i;
  float *p_f = &f;
  char *p_c = "rubarb and fries";
  for (j = 0; j < 10; j++) {
    if (p_c[j] == c) {
      j++;
    } else {
      i++;
    }
  }
  return *p_i;
}


x86 assembly (clang, -O0):
<do_vars>:
push   %rbp
mov    %rsp,%rbp
movl   $0x9,-0x8(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movb   $0x51,-0xd(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xed1(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    118a <do_vars+0x8a>
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
jne    116e <do_vars+0x6e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <do_vars+0x77>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <do_vars+0x7c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113e <do_vars+0x3e>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"rubarb and fries\00"
define i32 @do_vars() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i8
%5 = alloca i32*
%6 = alloca float*
%7 = alloca i8*
store i32 9, i32* %2
store float 0x3FF3BE76C0000000, float* %3
store i8 81, i8* %4
store i32* %2, i32** %5
store float* %3, float** %6
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %7
store i32 0, i32* %1
br label %8
8: ; preds = %28, %0
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %31
11: ; preds = %8
%12 = load i8*, i8** %7
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %24
21: ; preds = %11
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %27
24: ; preds = %11
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %8
31: ; preds = %8
%32 = load i32*, i32** %5
%33 = load i32, i32* %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @do_vars() {
ret i32 19
}
/* Variables and functions */
int /*<<< orphan*/ urandom_close();
void mcfd_random_destroy(void) { urandom_close(); }


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

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

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

LLVM IR (-O2):
define void @mcfd_random_destroy() {
%1 = tail call i32 (...) @urandom_close()
ret void
}
/* Variables and functions */
scalar_t__ level_waterlevel();
float f_waterlevel() { return (float)level_waterlevel(); }


x86 assembly (clang, -O0):
<f_waterlevel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <level_waterlevel@plt>
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_waterlevel>:
push   %rax
xor    %eax,%eax
call   1030 <level_waterlevel@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f_waterlevel() {
%1 = call i64 (...) @level_waterlevel()
%2 = sitofp i64 %1 to float
ret float %2
}

LLVM IR (-O2):
define float @f_waterlevel() {
%1 = tail call i64 (...) @level_waterlevel()
%2 = sitofp i64 %1 to float
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int WNOHANG;
int WUNTRACED;
int /*<<< orphan*/ process_update_status(int /*<<< orphan*/, int);
int /*<<< orphan*/ waitpid(int, int *, int);
void job_update_status() {
  int status;
  pid_t pid;
  do {
    pid = waitpid(-1, &status, WUNTRACED | WNOHANG);
  } while (!process_update_status(pid, status));
}


x86 assembly (clang, -O0):
<job_update_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
or     (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x4(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <process_update_status@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <job_update_status+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<job_update_status>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2ea8(%rip),%r14
mov    0x2eb1(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    (%r15),%edx
or     (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
mov    0xc(%rsp),%esi
mov    %eax,%edi
call   1030 <process_update_status@plt>
test   %eax,%eax
je     1140 <job_update_status+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WUNTRACED = global i32 0
@WNOHANG = global i32 0
define void @job_update_status() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* @WUNTRACED
%5 = load i32, i32* @WNOHANG
%6 = or i32 %4, %5
%7 = call i32 @waitpid(i32 -1, i32* %1, i32 %6)
store i32 %7, i32* %2
br label %8
8: ; preds = %3
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = call i32 @process_update_status(i32 %9, i32 %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %3, label %14
14: ; preds = %8
ret void
}

LLVM IR (-O2):
@WUNTRACED = global i32 0
@WNOHANG = global i32 0
define void @job_update_status() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* @WUNTRACED
%5 = load i32, i32* @WNOHANG
%6 = or i32 %5, %4
%7 = call i32 @waitpid(i32 -1, i32* %1, i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @process_update_status(i32 %7, i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %3
ret void
}
/* Type definitions */
struct aes_encrypt_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ aes_ecb_encrypt_generic(struct aes_encrypt_ctx const *,
                                           void *, void const *, int);
void aes_ecb_encrypt256(const struct aes_encrypt_ctx *ctx, void *out,
                        const void *in) {
  aes_ecb_encrypt_generic(ctx, out, in, 32);
}


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

x86 assembly (clang, -O2):
<aes_ecb_encrypt256>:
mov    $0x20,%ecx
jmp    1030 <aes_ecb_encrypt_generic@plt>

LLVM IR (-O0):
%struct.aes_encrypt_ctx = type { i32 }
define void @aes_ecb_encrypt256(%struct.aes_encrypt_ctx* %0, i8* %1, i8* %2) {
%4 = alloca %struct.aes_encrypt_ctx*
%5 = alloca i8*
%6 = alloca i8*
store %struct.aes_encrypt_ctx* %0, %struct.aes_encrypt_ctx** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.aes_encrypt_ctx*, %struct.aes_encrypt_ctx** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @aes_ecb_encrypt_generic(%struct.aes_encrypt_ctx* %7, i8* %8, i8* %9, i32 32)
ret void
}

LLVM IR (-O2):
%struct.aes_encrypt_ctx = type { i32 }
define void @aes_ecb_encrypt256(%struct.aes_encrypt_ctx* %0, i8* %1, i8* %2) {
%4 = tail call i32 @aes_ecb_encrypt_generic(%struct.aes_encrypt_ctx* %0, i8* %1, i8* %2, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world!\n");
  return 1;
}


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>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(int argc, char **argv) {
  printf("usage: %s [-p port] [-h host] [-v(erbose)] [-b(roadcast)] [-?(this "
         "message)] message to send\n",
         argv[0]);
  printf(
      "	Defaults port=1024, host=127.0.0.1, verbose off, broadcast off\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rsi),%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [94 x i8] c"usage: %s [-p port] [-h host] [-v(erbose)] [-b(roadcast)] [-?(this message)] message to send\0A\00"
@.str.1 = [65 x i8] c"\09Defaults port=1024, host=127.0.0.1, verbose off, broadcast off\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [94 x i8] c"usage: %s [-p port] [-h host] [-v(erbose)] [-b(roadcast)] [-?(this message)] message to send\0A\00"
@str = [64 x i8] c"\09Defaults port=1024, host=127.0.0.1, verbose off, broadcast off\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
int min_heap_merge(int *first[], int *second[], int *result) {}


x86 assembly (clang, -O0):
<min_heap_merge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min_heap_merge(i32** nocapture readnone %0, i32** nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
int64_t chirp_client_ftruncate(struct chirp_client *c, int64_t fd,
                               int64_t length, time_t stoptime) {
  return simple_command(c, stoptime, "ftruncate %lld %lld\n", fd, length);
}


x86 assembly (clang, -O0):
<chirp_client_ftruncate>:
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    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec6(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_ftruncate>:
mov    %edx,%r8d
mov    %esi,%eax
lea    0xee4(%rip),%rdx
mov    %ecx,%esi
mov    %eax,%ecx
jmp    1030 <simple_command@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [21 x i8] c"ftruncate %lld %lld\0A\00"
define i32 @chirp_client_ftruncate(%struct.chirp_client* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.chirp_client*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.chirp_client*, %struct.chirp_client** %5
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @simple_command(%struct.chirp_client* %9, i32 %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [21 x i8] c"ftruncate %lld %lld\0A\00"
define i32 @chirp_client_ftruncate(%struct.chirp_client* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @simple_command(%struct.chirp_client* %0, i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 %5
}
void foo_2_1_2_1_2_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_2_1_1_2_2() {
ret void
}
/* Variables and functions */
double exp(double);
double dBtoG(double x) { return exp(0.1151292546498 * x); }


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

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

LLVM IR (-O0):
define double @dBtoG(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x3FBD791C5F88A3A4, %3
%5 = call double @exp(double %4)
ret double %5
}

LLVM IR (-O2):
define double @dBtoG(double %0) {
%2 = fmul double %0, 0x3FBD791C5F88A3A4
%3 = tail call double @exp(double %2)
ret double %3
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _setbit(struct bitmask *, unsigned int, int);
struct bitmask *numa_bitmask_setbit(struct bitmask *bmp, unsigned int i) {
  _setbit(bmp, i, 1);
  return bmp;
}


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

x86 assembly (clang, -O2):
<numa_bitmask_setbit>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edx
call   1030 <_setbit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define %struct.bitmask* @numa_bitmask_setbit(%struct.bitmask* returned %0, i32 %1) {
%3 = tail call i32 @_setbit(%struct.bitmask* %0, i32 %1, i32 1)
ret %struct.bitmask* %0
}
int isascii(int c) { return ((unsigned)(c) <= 0177); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 127
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *get_multi_table_name(char *, char *);
char *get_multiple_table_names(char *application_name,
                               char *folder_name_list_comma_string) {
  return get_multi_table_name(application_name, folder_name_list_comma_string);
}


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

x86 assembly (clang, -O2):
<get_multiple_table_names>:
jmp    1030 <get_multi_table_name@plt>

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

LLVM IR (-O2):
define i8* @get_multiple_table_names(i8* %0, i8* %1) {
%3 = tail call i8* @get_multi_table_name(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int read_value_from_fcd(int, unsigned char *);
int fcdppGetIFGain(unsigned char *value) {
  return read_value_from_fcd(157, value);
}


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

x86 assembly (clang, -O2):
<fcdppGetIFGain>:
mov    %rdi,%rsi
mov    $0x9d,%edi
jmp    1030 <read_value_from_fcd@plt>

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

LLVM IR (-O2):
define i32 @fcdppGetIFGain(i8* %0) {
%2 = tail call i32 @read_value_from_fcd(i32 157, i8* %0)
ret i32 %2
}
/* Type definitions */
struct ileaf {
  int dummy;
};
struct btree {
  int dummy;
};

/* Variables and functions */
scalar_t__ icount(struct ileaf *);
int ileaf_can_free(struct btree *btree, void *leaf) {
  struct ileaf *ileaf = leaf;
  return icount(ileaf) == 0;
}


x86 assembly (clang, -O0):
<ileaf_can_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <icount@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.btree = type { i32 }
%struct.ileaf = type { i32 }
define i32 @ileaf_can_free(%struct.btree* %0, i8* %1) {
%3 = alloca %struct.btree*
%4 = alloca i8*
%5 = alloca %struct.ileaf*
store %struct.btree* %0, %struct.btree** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.ileaf*
store %struct.ileaf* %7, %struct.ileaf** %5
%8 = load %struct.ileaf*, %struct.ileaf** %5
%9 = call i64 @icount(%struct.ileaf* %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.btree = type { i32 }
%struct.ileaf = type { i32 }
define i32 @ileaf_can_free(%struct.btree* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.ileaf*
%4 = tail call i64 @icount(%struct.ileaf* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int value = 1 > 2 ? 5 : 9;
  printf("%d", value);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%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
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_reg(int, int);
void ili9325_write_pixel(int x, int y, int c) {
  write_reg(0x0020, x);
  write_reg(0x0021, y);
  { *(unsigned short *)0x70000000 = 0x0022; };
  { *(unsigned short *)0x78000000 = c; };
}


x86 assembly (clang, -O0):
<ili9325_write_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x20,%edi
call   1030 <write_reg@plt>
mov    -0x8(%rbp),%esi
mov    $0x21,%edi
call   1030 <write_reg@plt>
mov    $0x70000000,%eax
movw   $0x22,(%rax)
mov    -0xc(%rbp),%eax
mov    %ax,%cx
mov    $0x78000000,%eax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ili9325_write_pixel>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%esi
mov    $0x20,%edi
call   1030 <write_reg@plt>
mov    $0x21,%edi
mov    %ebp,%esi
call   1030 <write_reg@plt>
movw   $0x22,0x70000000
mov    %bx,0x78000000
78
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ili9325_write_pixel(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* %4
%8 = call i32 @write_reg(i32 32, i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @write_reg(i32 33, i32 %9)
store i16 34, i16* inttoptr (i64 1879048192 to i16*)
%11 = load i32, i32* %6
%12 = trunc i32 %11 to i16
store i16 %12, i16* inttoptr (i64 2013265920 to i16*)
ret void
}

LLVM IR (-O2):
define void @ili9325_write_pixel(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @write_reg(i32 32, i32 %0)
%5 = tail call i32 @write_reg(i32 33, i32 %1)
store i16 34, i16* inttoptr (i64 1879048192 to i16*)
%6 = trunc i32 %2 to i16
store i16 %6, i16* inttoptr (i64 2013265920 to i16*)
ret void
}
int isModoApertura(int modo_client, int modo) {
  if ((modo_client & modo) == modo) {
    return !(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<isModoApertura>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1125 <isModoApertura+0x25>
movl   $0x1,-0x4(%rbp)
jmp    112c <isModoApertura+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isModoApertura>:
not    %edi
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @isModoApertura(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 = load i32, i32* %5
%8 = and i32 %6, %7
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %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 @isModoApertura(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ ctime(long *);
int strlen(char *);
long time(long *);
char *current_time(void) {
  long tm;
  char *dptr;
  tm = time((long *)NULL);
  dptr = (char *)ctime(&tm);
  *(dptr + strlen(dptr) - 1) = '\0';
  return (dptr);
}


x86 assembly (clang, -O0):
<current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @current_time() {
%1 = alloca i64
%2 = alloca i8*
%3 = call i64 @time(i64* null)
store i64 %3, i64* %1
%4 = call i64 @ctime(i64* %1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 -1
store i8 0, i8* %11
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @current_time() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 @time(i64* null)
store i64 %3, i64* %1
%4 = call i64 @ctime(i64* %1)
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8 0, i8* %9
ret i8* %5
}
/* Variables and functions */
scalar_t__ l8();
scalar_t__ malloc(int);
int /*<<< orphan*/ th(int *);
void bv(long unsigned int ny) {
  int ***mf;
  while (l8()) {
    *mf = 0;
    (*mf)[ny] = (int *)malloc(sizeof(int));
    th((*mf)[ny]);
  }
}


x86 assembly (clang, -O0):
<bv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <l8@plt>
cmp    $0x0,%rax
je     118d <bv+0x5d>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <th@plt>
jmp    113c <bv+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bv(i64 %0) {
%2 = alloca i64
%3 = alloca i32***
store i64 %0, i64* %2
br label %4
4: ; preds = %7, %1
%5 = call i64 (...) @l8()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32***, i32**** %3
store i32** null, i32*** %8
%9 = call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i32*
%11 = load i32***, i32**** %3
%12 = load i32**, i32*** %11
%13 = load i64, i64* %2
%14 = getelementptr inbounds i32*, i32** %12, i64 %13
store i32* %10, i32** %14
%15 = load i32***, i32**** %3
%16 = load i32**, i32*** %15
%17 = load i64, i64* %2
%18 = getelementptr inbounds i32*, i32** %16, i64 %17
%19 = load i32*, i32** %18
%20 = call i32 @th(i32* %19)
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @bv(i64 %0) {
%2 = tail call i64 (...) @l8()
%3 = icmp eq i64 %2, 0
tail call void @llvm.assume(i1 %3)
ret void
}
int main() {
  int a = 2;
  int b = 1;
  int c = a++ || 1;
  int d = b-- && (b = 10) && b-- && 0;
  return a + b + c + d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jne    113c <main+0x3c>
mov    $0x1,%al
mov    %al,-0x15(%rbp)
jmp    113c <main+0x3c>
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
je     119f <main+0x9f>
movl   $0xa,-0xc(%rbp)
xor    %eax,%eax
mov    $0x1,%cl
test   $0x1,%cl
mov    %al,-0x16(%rbp)
jne    117c <main+0x7c>
jmp    119f <main+0x9f>
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
je     119f <main+0x9f>
xor    %eax,%eax
mov    %al,-0x16(%rbp)
jmp    119f <main+0x9f>
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 13
}
/* Variables and functions */
int /*<<< orphan*/ cio_printc(char const);
void _puth(unsigned int n) {
  static const char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                               '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
  cio_printc(hex[n & 15]);
}


x86 assembly (clang, -O0):
<_puth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xed4(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <cio_printc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_puth>:
and    $0xf,%edi
lea    0xee6(%rip),%rax
movsbl (%rdi,%rax,1),%edi
jmp    1030 <cio_printc@plt>

LLVM IR (-O0):
@_puth.hex = internal constant [16 x i8] c"0123456789ABCDEF"
define void @_puth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @_puth.hex, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = call i32 @cio_printc(i8 signext %7)
ret void
}

LLVM IR (-O2):
@_puth.hex = internal unnamed_addr constant [16 x i8] c"0123456789ABCDEF"
define void @_puth(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [16 x i8], [16 x i8]* @_puth.hex, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @cio_printc(i8 signext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void testFixManipulatedPointerBeforeFree() {
  int *array = malloc(sizeof(int) * 2);
  array += 1;
  free(&array[-1]);
}


x86 assembly (clang, -O0):
<testFixManipulatedPointerBeforeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFixManipulatedPointerBeforeFree>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testFixManipulatedPointerBeforeFree() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 8)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = call i32 @free(i32* %6)
ret void
}

LLVM IR (-O2):
define void @testFixManipulatedPointerBeforeFree() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void RETF_() {
  ;
  _c_setbyte(0xcb);
  ;
}


x86 assembly (clang, -O0):
<RETF_>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcb,%edi
call   1030 <_c_setbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RETF_>:
mov    $0xcb,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @RETF_() {
%1 = call i32 @_c_setbyte(i32 203)
ret void
}

LLVM IR (-O2):
define void @RETF_() {
%1 = tail call i32 @_c_setbyte(i32 203)
ret void
}
void progress_pcg_v0(char *form, int in0, double in1, double in2, double in3,
                     double in4, double in5, int in6, double in7, int in8) {}


x86 assembly (clang, -O0):
<progress_pcg_v0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
movsd  %xmm5,-0x48(%rbp)
mov    %ecx,-0x4c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @progress_pcg_v0(i8* %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
%11 = alloca i8*
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca double
%20 = alloca i32
store i8* %0, i8** %11
store i32 %1, i32* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store i32 %7, i32* %18
store double %8, double* %19
store i32 %9, i32* %20
ret void
}

LLVM IR (-O2):
define void @progress_pcg_v0(i8* nocapture %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
ret void
}
/* Type definitions */
struct ptr_array {
  int dummy;
};

/* Variables and functions */
long ptr_array_idx(struct ptr_array *, void *);
int /*<<< orphan*/ ptr_array_remove_idx(struct ptr_array *, long);
void ptr_array_remove(struct ptr_array *array, void *ptr) {
  long pos = ptr_array_idx(array, ptr);
  ptr_array_remove_idx(array, pos);
}


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

x86 assembly (clang, -O2):
<ptr_array_remove>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ptr_array_idx@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <ptr_array_remove_idx@plt>

LLVM IR (-O0):
%struct.ptr_array = type { i32 }
define void @ptr_array_remove(%struct.ptr_array* %0, i8* %1) {
%3 = alloca %struct.ptr_array*
%4 = alloca i8*
%5 = alloca i64
store %struct.ptr_array* %0, %struct.ptr_array** %3
store i8* %1, i8** %4
%6 = load %struct.ptr_array*, %struct.ptr_array** %3
%7 = load i8*, i8** %4
%8 = call i64 @ptr_array_idx(%struct.ptr_array* %6, i8* %7)
store i64 %8, i64* %5
%9 = load %struct.ptr_array*, %struct.ptr_array** %3
%10 = load i64, i64* %5
%11 = call i32 @ptr_array_remove_idx(%struct.ptr_array* %9, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.ptr_array = type { i32 }
define void @ptr_array_remove(%struct.ptr_array* %0, i8* %1) {
%3 = tail call i64 @ptr_array_idx(%struct.ptr_array* %0, i8* %1)
%4 = tail call i32 @ptr_array_remove_idx(%struct.ptr_array* %0, i64 %3)
ret void
}
/* Variables and functions */
unsigned char rj_xtime(unsigned char);
unsigned char gf_alog(unsigned char x) {
  unsigned char y = 1, i;
  for (i = 0; i < x; i++)
    y ^= rj_xtime(y);
  return y;
}


x86 assembly (clang, -O0):
<gf_alog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jge    1158 <gf_alog+0x48>
movzbl -0x2(%rbp),%edi
call   1030 <rj_xtime@plt>
movzbl %al,%ecx
movzbl -0x2(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x2(%rbp)
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    1126 <gf_alog+0x16>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_alog>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1135 <gf_alog+0x25>
mov    %edi,%ebx
mov    $0x1,%bpl
nopl   0x0(%rax)
movzbl %bpl,%ebp
mov    %ebp,%edi
call   1030 <rj_xtime@plt>
xor    %al,%bpl
add    $0xff,%bl
jne    1120 <gf_alog+0x10>
jmp    1138 <gf_alog+0x28>
mov    $0x1,%bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i8 @gf_alog(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %8, %3 ], [ 0, %1 ]
%5 = phi i8 [ %7, %3 ], [ 1, %1 ]
%6 = tail call zeroext i8 @rj_xtime(i8 zeroext %5)
%7 = xor i8 %6, %5
%8 = add nuw i8 %4, 1
%9 = icmp eq i8 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i8 [ 1, %1 ], [ %7, %3 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
double log(int /*<<< orphan*/);
double GetAlphaLike(double a, double b, double c, double alpha) {
  return (-c * log(fabs(alpha * a + b)) - (alpha * alpha * a) / 2);
}


x86 assembly (clang, -O0):
<GetAlphaLike>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe61(%rip),%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetAlphaLike>:
sub    $0x18,%rsp
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x10(%rsp)
movapd %xmm0,%xmm2
movsd  %xmm0,0x8(%rsp)
movapd %xmm3,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <log@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  0xe98(%rip),%xmm1
mulsd  0x10(%rsp),%xmm0
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @GetAlphaLike(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = fneg double %9
%11 = load double, double* %8
%12 = load double, double* %5
%13 = load double, double* %6
%14 = call double @llvm.fmuladd.f64(double %11, double %12, double %13)
%15 = call i32 @fabs(double %14)
%16 = call double @log(i32 %15)
%17 = load double, double* %8
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = fdiv double %21, 2.000000e+00
%23 = fneg double %22
%24 = call double @llvm.fmuladd.f64(double %10, double %16, double %23)
ret double %24
}

LLVM IR (-O2):
define double @GetAlphaLike(double %0, double %1, double %2, double %3) {
%5 = fneg double %2
%6 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %1)
%7 = tail call i32 @fabs(double %6)
%8 = tail call double @log(i32 %7)
%9 = fmul double %3, %3
%10 = fmul double %9, %0
%11 = fmul double %10, -5.000000e-01
%12 = tail call double @llvm.fmuladd.f64(double %5, double %8, double %11)
ret double %12
}
/* Variables and functions */
char *clockperf_version_long();
int /*<<< orphan*/ printf(char *, char *);
void version(void) { printf("clockperf v%s\n\n", clockperf_version_long()); }


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clockperf_version_long@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
xor    %eax,%eax
call   1030 <clockperf_version_long@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"clockperf v%s\0A\0A\00"
define void @version() {
%1 = call i8* (...) @clockperf_version_long()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"clockperf v%s\0A\0A\00"
define void @version() {
%1 = tail call i8* (...) @clockperf_version_long()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void vline(int character, int len) {}


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

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

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

LLVM IR (-O2):
define void @vline(i32 %0, i32 %1) {
ret void
}
void test82_TestProg_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test82_TestProg_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_store_base_shadow_stack(void *,
                                                          int /*<<< orphan*/);
int /*<<< orphan*/ __softboundmpx_store_bound_shadow_stack(void *,
                                                           int /*<<< orphan*/);
__attribute__((__weak__, __always___)) void
__softboundmpx_store_return_metadata(void *base, void *bound) {
  __softboundmpx_store_base_shadow_stack(base, 0);
  __softboundmpx_store_bound_shadow_stack(bound, 0);
}


x86 assembly (clang, -O0):
<__softboundmpx_store_return_metadata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <__softboundmpx_store_base_shadow_stack@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <__softboundmpx_store_bound_shadow_stack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundmpx_store_return_metadata>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
call   1030 <__softboundmpx_store_base_shadow_stack@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <__softboundmpx_store_bound_shadow_stack@plt>

LLVM IR (-O0):
define weak void @__softboundmpx_store_return_metadata(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 = call i32 @__softboundmpx_store_base_shadow_stack(i8* %5, i32 0)
%7 = load i8*, i8** %4
%8 = call i32 @__softboundmpx_store_bound_shadow_stack(i8* %7, i32 0)
ret void
}

LLVM IR (-O2):
define weak void @__softboundmpx_store_return_metadata(i8* %0, i8* %1) {
%3 = tail call i32 @__softboundmpx_store_base_shadow_stack(i8* %0, i32 0)
%4 = tail call i32 @__softboundmpx_store_bound_shadow_stack(i8* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void displayMessageJNA() { printf("Hello world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define void @displayMessageJNA() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned upscale_1_5x_generic_output_fmts(unsigned input_fmts) {
  return input_fmts;
}


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

x86 assembly (clang, -O2):
<upscale_1_5x_generic_output_fmts>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @upscale_1_5x_generic_output_fmts(i32 returned %0) {
ret i32 %0
}