xunge/DecIR huggingface dataset:
__attribute__((no)) int foo(int j) {
  asm("");
  bar(j);
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @bar to i32 (i32, ...)*)(i32 %3)
ret i32 1
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @bar to i32 (i32, ...)*)(i32 %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_eof() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_eof"
         "\n");
}


x86 assembly (clang, -O0):
<pa_tagstruct_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_tagstruct_eof\00"
define i32 @pa_tagstruct_eof() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func(void) { printf("Something.\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Something.\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_powm(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
void gmpint_powmodz(mpz_t *rop, mpz_t *op, mpz_t *exp, mpz_t *mod) {
  mpz_powm(*rop, *op, *exp, *mod);
}


x86 assembly (clang, -O0):
<gmpint_powmodz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
call   1030 <mpz_powm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmpint_powmodz>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
jmp    1030 <mpz_powm@plt>

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

LLVM IR (-O2):
define void @gmpint_powmodz(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = tail call i32 @mpz_powm(i32 %5, i32 %6, i32 %7, i32 %8)
ret void
}
void mydown_donothing(void) {}


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

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

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

LLVM IR (-O2):
define void @mydown_donothing() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *get_int_pointer(int value, int start, int end) {
  int *result = (int *)malloc(sizeof(int) * 3);
  result[0] = value;
  result[1] = start;
  result[2] = end;
  return result;
}


x86 assembly (clang, -O0):
<get_int_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int_pointer>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
mov    %ebp,0x4(%rax)
mov    %r14d,0x8(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @get_int_pointer(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i64 @malloc(i32 12)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %7
%10 = load i32, i32* %4
%11 = load i32*, i32** %7
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %10, i32* %12
%13 = load i32, i32* %5
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
%19 = load i32*, i32** %7
ret i32* %19
}

LLVM IR (-O2):
define i32* @get_int_pointer(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @malloc(i32 12)
%5 = inttoptr i64 %4 to i32*
store i32 %0, i32* %5
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %1, i32* %6
%7 = getelementptr inbounds i32, i32* %5, i64 2
store i32 %2, i32* %7
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    eprintf("out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <emalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <emalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <eprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @eprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void g_hook_insert_before() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_insert_before() {
ret void
}
int msm_routing_put_dolby_dap_param_to_set_control(
    struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_kcontrol = type opaque
%struct.snd_ctl_elem_value = type opaque
define i32 @msm_routing_put_dolby_dap_param_to_set_control(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_value* %1) {
%3 = alloca %struct.snd_kcontrol*
%4 = alloca %struct.snd_ctl_elem_value*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %3
store %struct.snd_ctl_elem_value* %1, %struct.snd_ctl_elem_value** %4
ret i32 0
}

LLVM IR (-O2):
%struct.snd_kcontrol = type opaque
%struct.snd_ctl_elem_value = type opaque
define i32 @msm_routing_put_dolby_dap_param_to_set_control(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_value* nocapture readnone %1) {
ret i32 0
}
unsigned long long has_zero64(unsigned long long x) {
  unsigned long long y;
  y = x;
  y -= 0x0101010101010101ULL;
  y &= ~x;
  return y & 0x8080808080808080ULL;
}


x86 assembly (clang, -O0):
<has_zero64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movabs $0x101010101010101,%rcx
01 01 01
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movabs $0x8080808080808080,%rax
80 80 80
and    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_zero64>:
movabs $0xfefefefefefefeff,%rcx
fe fe fe
add    %rdi,%rcx
not    %rdi
movabs $0x8080808080808080,%rax
80 80 80
and    %rdi,%rax
and    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @has_zero64(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = sub i64 %5, 72340172838076673
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = xor i64 %7, -1
%9 = load i64, i64* %3
%10 = and i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = and i64 %11, -9187201950435737472
ret i64 %12
}

LLVM IR (-O2):
define i64 @has_zero64(i64 %0) {
%2 = add i64 %0, -72340172838076673
%3 = and i64 %0, -9187201950435737472
%4 = xor i64 %3, -9187201950435737472
%5 = and i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
void U_WMRSETTEXTCOLOR_swap(char *record, int torev) {
  U_WMRCORE_SIZE16_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSETTEXTCOLOR_swap>:
jmp    1030 <U_WMRCORE_SIZE16_swap@plt>

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

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

/* Variables and functions */
char *ipv4_htoa(unsigned int);
unsigned int ntohl(int /*<<< orphan*/);
char *ipv4_ntoa(uint32_t ip) {
  unsigned int lip = ntohl(ip);
  return ipv4_htoa(lip);
}


x86 assembly (clang, -O0):
<ipv4_ntoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ipv4_htoa@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @ipv4_ntoa(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = tail call i8* @ipv4_htoa(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void for_each(char *p) {
  for (int i = 0; i < 3; i++) {
    printf("%c\n", *p);
    p++;
  }
}


x86 assembly (clang, -O0):
<for_each>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    115a <for_each+0x4a>
mov    -0x8(%rbp),%rax
lea    0xec8(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <for_each+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<for_each>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%esi
lea    0xedf(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x1(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x2(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @for_each(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putwchar(int /*<<< orphan*/);
void putws(unsigned short *s) {
  while (*s)
    putwchar(*s++);
}


x86 assembly (clang, -O0):
<putws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpw   $0x0,(%rax)
je     1146 <putws+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
movzwl (%rax),%edi
call   1030 <putwchar@plt>
jmp    111c <putws+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putws>:
push   %rbx
movzwl (%rdi),%eax
test   %ax,%ax
je     1134 <putws+0x24>
mov    %rdi,%rbx
add    $0x2,%rbx
movzwl %ax,%edi
call   1030 <putwchar@plt>
movzwl (%rbx),%eax
add    $0x2,%rbx
test   %ax,%ax
jne    1120 <putws+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @putws(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
br label %3
3: ; preds = %7, %1
%4 = load i16*, i16** %2
%5 = load i16, i16* %4
%6 = icmp ne i16 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i16*, i16** %2
%9 = getelementptr inbounds i16, i16* %8, i32 1
store i16* %9, i16** %2
%10 = load i16, i16* %8
%11 = zext i16 %10 to i32
%12 = call i32 @putwchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @putws(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i16 [ %10, %4 ], [ %2, %1 ]
%6 = phi i16* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i16, i16* %6, i64 1
%8 = zext i16 %5 to i32
%9 = tail call i32 @putwchar(i32 %8)
%10 = load i16, i16* %7
%11 = icmp eq i16 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
struct internal_ibv_comp_channel *
ibv_comp_to_internal(struct ibv_comp_channel *comp) {
  return (struct internal_ibv_comp_channel *)comp;
}


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

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

LLVM IR (-O0):
%struct.internal_ibv_comp_channel = type opaque
%struct.ibv_comp_channel = type opaque
define %struct.internal_ibv_comp_channel* @ibv_comp_to_internal(%struct.ibv_comp_channel* %0) {
%2 = alloca %struct.ibv_comp_channel*
store %struct.ibv_comp_channel* %0, %struct.ibv_comp_channel** %2
%3 = load %struct.ibv_comp_channel*, %struct.ibv_comp_channel** %2
%4 = bitcast %struct.ibv_comp_channel* %3 to %struct.internal_ibv_comp_channel*
ret %struct.internal_ibv_comp_channel* %4
}

LLVM IR (-O2):
%struct.internal_ibv_comp_channel = type opaque
%struct.ibv_comp_channel = type opaque
define %struct.internal_ibv_comp_channel* @ibv_comp_to_internal(%struct.ibv_comp_channel* readnone %0) {
%2 = bitcast %struct.ibv_comp_channel* %0 to %struct.internal_ibv_comp_channel*
ret %struct.internal_ibv_comp_channel* %2
}
int test_imm_15uint16_mem(unsigned short *val) {
  return ((*val) & (0x15 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_15uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 21
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_15uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 21
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ Swizzled(void *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void MyFree(void *p) {
  if (Swizzled(p)) {
    fprintf(stderr, "Error MyFree got swizzled %x\n", p);
    fflush(stderr);
  }
}


x86 assembly (clang, -O0):
<MyFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <Swizzled@plt>
cmp    $0x0,%rax
je     1176 <MyFree+0x46>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyFree>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <Swizzled@plt>
test   %rax,%rax
je     1169 <MyFree+0x39>
mov    0x2e98(%rip),%r14
mov    (%r14),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fflush@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Error MyFree got swizzled %x\0A\00"
define void @MyFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @Swizzled(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fflush(i32 %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Error MyFree got swizzled %x\0A\00"
define void @MyFree(i8* %0) {
%2 = tail call i64 @Swizzled(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
br label %9
9: ; preds = %4, %1
ret void
}
int Operand_bs4_decode(unsigned int *valp) {
  *valp = *valp << 2;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_bs4_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bs4_decode>:
shll   $0x2,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_bs4_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 2
store i32 %3, i32* %0
ret i32 0
}
int min_value(int array[5]) {
  int index, min = array[0];
  for (index = 0; index < 5; index++) {
    if (array[index] < min)
      min = array[index];
  }
  return min;
}


x86 assembly (clang, -O0):
<min_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1157 <min_value+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jge    1144 <min_value+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <min_value+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <min_value+0x18>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_value>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
cmp    %eax,%ecx
cmovl  %ecx,%eax
mov    0x8(%rdi),%ecx
cmp    %eax,%ecx
cmovl  %ecx,%eax
mov    0xc(%rdi),%ecx
cmp    %eax,%ecx
cmovl  %ecx,%eax
mov    0x10(%rdi),%ecx
cmp    %eax,%ecx
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @min_value(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, %2
%6 = select i1 %5, i32 %4, i32 %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, %6
%10 = select i1 %9, i32 %8, i32 %6
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, %10
%14 = select i1 %13, i32 %12, i32 %10
%15 = getelementptr inbounds i32, i32* %0, i64 4
%16 = load i32, i32* %15
%17 = icmp slt i32 %16, %14
%18 = select i1 %17, i32 %16, i32 %14
ret i32 %18
}
int isalnum(int c) {
  return (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) ||
         ((c) >= '0' && (c) <= '9');
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalnum+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isalnum+0x52>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct trie_data {
  int dummy;
};
struct diff_addr_store {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_item(struct diff_addr_store *,
                            int /*<<< orphan*/ const *, size_t);
void replace_add(const uint8_t *key, size_t key_size, struct trie_data *data,
                 void *userdata) {
  struct diff_addr_store *store = userdata;
  if (data)
    add_item(store, key, key_size);
}


x86 assembly (clang, -O0):
<replace_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <replace_add+0x3c>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <add_item@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_add>:
test   %rdx,%rdx
je     1126 <replace_add+0x16>
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rcx,%rdi
mov    %rax,%rdx
jmp    1030 <add_item@plt>
ret

LLVM IR (-O0):
%struct.trie_data = type { i32 }
%struct.diff_addr_store = type { i32 }
define void @replace_add(i32* %0, i64 %1, %struct.trie_data* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca %struct.trie_data*
%8 = alloca i8*
%9 = alloca %struct.diff_addr_store*
store i32* %0, i32** %5
store i64 %1, i64* %6
store %struct.trie_data* %2, %struct.trie_data** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = bitcast i8* %10 to %struct.diff_addr_store*
store %struct.diff_addr_store* %11, %struct.diff_addr_store** %9
%12 = load %struct.trie_data*, %struct.trie_data** %7
%13 = icmp ne %struct.trie_data* %12, null
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load %struct.diff_addr_store*, %struct.diff_addr_store** %9
%16 = load i32*, i32** %5
%17 = load i64, i64* %6
%18 = call i32 @add_item(%struct.diff_addr_store* %15, i32* %16, i64 %17)
br label %19
19: ; preds = %14, %4
ret void
}

LLVM IR (-O2):
%struct.trie_data = type { i32 }
%struct.diff_addr_store = type { i32 }
define void @replace_add(i32* %0, i64 %1, %struct.trie_data* readnone %2, i8* %3) {
%5 = icmp eq %struct.trie_data* %2, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = bitcast i8* %3 to %struct.diff_addr_store*
%8 = tail call i32 @add_item(%struct.diff_addr_store* %7, i32* %0, i64 %1)
br label %9
9: ; preds = %6, %4
ret void
}
long int cast_short_long(short int x) { return (long int)x; }


x86 assembly (clang, -O0):
<cast_short_long>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_short_long>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @cast_short_long(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_short_long(i16 signext %0) {
%2 = sext i16 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_int();
int test_fun(int /*<<< orphan*/);
int main() { return test_fun(__VERIFIER_nondet_int()); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <test_fun@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @test_fun(i32 %1)
ret i32 %2
}
int b_edgeperm_pack(array_in)
int array_in[8];
{ return perm_n_pack(8, array_in); }


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

x86 assembly (clang, -O2):
<b_edgeperm_pack>:
mov    %rdi,%rsi
mov    $0x8,%edi
xor    %eax,%eax
jmp    1030 <perm_n_pack@plt>

LLVM IR (-O0):
define i32 @b_edgeperm_pack(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @perm_n_pack to i32 (i32, i32*, ...)*)(i32 8, i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @b_edgeperm_pack(i32* %0) {
%2 = tail call i32 (i32, i32*, ...) bitcast (i32 (...)* @perm_n_pack to i32 (i32, i32*, ...)*)(i32 8, i32* %0)
ret i32 %2
}
/* Variables and functions */
oldstyle2() { return 4; }


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

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

LLVM IR (-O0):
define i32 @oldstyle2() {
ret i32 4
}

LLVM IR (-O2):
define i32 @oldstyle2() {
ret i32 4
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_mask;
};

/* Variables and functions */
int /*<<< orphan*/ sigwait(int /*<<< orphan*/ *, int *);
void wait_for_signal(struct sigaction *signal_action) {
  int signal_number;
  sigwait(&(signal_action->sa_mask), &signal_number);
}


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

x86 assembly (clang, -O2):
<wait_for_signal>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <sigwait@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
define void @wait_for_signal(%struct.sigaction* %0) {
%2 = alloca %struct.sigaction*
%3 = alloca i32
store %struct.sigaction* %0, %struct.sigaction** %2
%4 = load %struct.sigaction*, %struct.sigaction** %2
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %4, i32 0, i32 0
%6 = call i32 @sigwait(i32* %5, i32* %3)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define void @wait_for_signal(%struct.sigaction* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %0, i64 0, i32 0
%5 = call i32 @sigwait(i32* %4, i32* %2)
ret void
}
const char *ccnxPortalClientAbout_MiniNotice(void) {
  return "Copyright (c) 2016, Xerox Corporation (Xerox)and Palo Alto Research "
         "Center (PARC)\nAll rights reserved.\n";
}


x86 assembly (clang, -O0):
<ccnxPortalClientAbout_MiniNotice>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnxPortalClientAbout_MiniNotice>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [104 x i8] c"Copyright (c) 2016, Xerox Corporation (Xerox)and Palo Alto Research Center (PARC)\0AAll rights reserved.\0A\00"
define i8* @ccnxPortalClientAbout_MiniNotice() {
ret i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [104 x i8] c"Copyright (c) 2016, Xerox Corporation (Xerox)and Palo Alto Research Center (PARC)\0AAll rights reserved.\0A\00"
define i8* @ccnxPortalClientAbout_MiniNotice() {
ret i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ accum();
int /*<<< orphan*/ accum_ref();
int /*<<< orphan*/ check(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ init();
int main() {
  init();
#pragma omp target update to(Q)
  check(accum(), accum_ref());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1040 <accum@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <accum_ref@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1060 <check@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1040 <accum@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <accum_ref@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <check@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 (...) @accum()
%4 = call i32 (...) @accum_ref()
%5 = call i32 @check(i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @accum()
%3 = tail call i32 (...) @accum_ref()
%4 = tail call i32 @check(i32 %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mavl_freeptr(void *ptr) { free(*((void **)ptr)); }


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

x86 assembly (clang, -O2):
<mavl_freeptr>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mavl_freeptr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
char *moji(int x) {
  if (x == 1)
    return "ok, from C language";
  else
    return "bad, from C language";
}


x86 assembly (clang, -O0):
<moji>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1121 <moji+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <moji+0x2c>
lea    0xeec(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<moji>:
cmp    $0x1,%edi
lea    0xef6(%rip),%rcx
lea    0xf03(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"ok, from C language\00"
@.str.1 = [21 x i8] c"bad, from C language\00"
define i8* @moji(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [20 x i8] c"ok, from C language\00"
@.str.1 = [21 x i8] c"bad, from C language\00"
define i8* @moji(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHello() {
  printf("Hello world!\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @printHello() {
%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 @printHello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
__int128 mem_read128(const void *addr) {
  __int128 r;
  r = (((__int128)mem_read((char *)addr + 8, 8)) << 64) | mem_read(addr, 8);
  return r;
}


x86 assembly (clang, -O0):
<mem_read128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
xor    %eax,%eax
mov    %al,-0x39(%rbp)
mov    $0x8,%esi
mov    %esi,-0x40(%rbp)
call   1030 <mem_read@plt>
mov    -0x40(%rbp),%esi
mov    %eax,%ecx
mov    -0x39(%rbp),%al
movslq %ecx,%rcx
mov    %rcx,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <mem_read@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
or     %rdx,%rax
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_read128>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x8,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <mem_read@plt>
movslq %eax,%r14
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <mem_read@plt>
cltq
mov    %rax,%rdx
sar    $0x3f,%rdx
or     %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @mem_read128(i8* %0) {
%2 = alloca i128
%3 = alloca i8*
%4 = alloca i128
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 8
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mem_read to i32 (i8*, i32, ...)*)(i8* %6, i32 8)
%8 = sext i32 %7 to i128
%9 = shl i128 %8, 64
%10 = load i8*, i8** %3
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mem_read to i32 (i8*, i32, ...)*)(i8* %10, i32 8)
%12 = sext i32 %11 to i128
%13 = or i128 %9, %12
store i128 %13, i128* %4
%14 = load i128, i128* %4
store i128 %14, i128* %2
%15 = bitcast i128* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @mem_read128(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mem_read to i32 (i8*, i32, ...)*)(i8* %2, i32 8)
%4 = sext i32 %3 to i128
%5 = shl nsw i128 %4, 64
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mem_read to i32 (i8*, i32, ...)*)(i8* %0, i32 8)
%7 = sext i32 %6 to i128
%8 = or i128 %5, %7
%9 = sext i32 %6 to i64
%10 = lshr i128 %8, 64
%11 = trunc i128 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
/* Variables and functions */
int /*<<< orphan*/ Sound31(unsigned long, double);
void sound(unsigned long hz, double t) { Sound31(hz, t); }


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

x86 assembly (clang, -O2):
<sound>:
jmp    1030 <Sound31@plt>

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

LLVM IR (-O2):
define void @sound(i64 %0, double %1) {
%3 = tail call i32 @Sound31(i64 %0, double %1)
ret void
}
int sim_toupper(int c) {
  return ((c >= 'a') && (c <= 'z')) ? ((c - 'a') + 'A') : c;
}


x86 assembly (clang, -O0):
<sim_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     112c <sim_toupper+0x2c>
cmpl   $0x7a,-0x4(%rbp)
jg     112c <sim_toupper+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <sim_toupper+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @sim_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 65
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @sim_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int syncsocket_result(int status) {
  if (status == 0) {
    status = -1;
  } else if (status > 0) {
    status = 0;
  }
  return status;
}


x86 assembly (clang, -O0):
<syncsocket_result>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111d <syncsocket_result+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1133 <syncsocket_result+0x33>
cmpl   $0x0,-0x4(%rbp)
jle    112e <syncsocket_result+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1133 <syncsocket_result+0x33>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syncsocket_result>:
mov    %edi,%ecx
sar    $0x1f,%ecx
and    %edi,%ecx
cmp    $0x1,%edi
sbb    %eax,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @syncsocket_result(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 %0, i32 0
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f_atexit(void) { puts("this msg from f_atexit()\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"this msg from f_atexit()\0A\00"
define void @f_atexit() {
%1 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"this msg from f_atexit()\0A\00"
define void @f_atexit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int const STDOUT_FILENO;
int /*<<< orphan*/ close(int const);
int dup2(int const, int const);
int /*<<< orphan*/ perror(char *);
void stdout_to_pipe(int const *pipe_fd) {
  close(pipe_fd[(0)]);
  close(STDOUT_FILENO);
  if (dup2(pipe_fd[(1)], STDOUT_FILENO) == -1)
    perror("dup2");
}


x86 assembly (clang, -O0):
<stdout_to_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
jne    117f <stdout_to_pipe+0x4f>
lea    0xe8a(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_to_pipe>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <close@plt>
xor    %edi,%edi
call   1040 <close@plt>
mov    0x4(%rbx),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
je     1153 <stdout_to_pipe+0x23>
pop    %rbx
ret
lea    0xeaa(%rip),%rdi
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
@STDOUT_FILENO = constant i32 0
@.str = [5 x i8] c"dup2\00"
define void @stdout_to_pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i32 @close(i32 %7)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32, i32* @STDOUT_FILENO
%13 = call i32 @dup2(i32 %11, i32 %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %1
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = constant i32 0
@.str = [5 x i8] c"dup2\00"
define void @stdout_to_pipe(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
%4 = tail call i32 @close(i32 0)
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @dup2(i32 %6, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}