xunge/DecIR huggingface dataset:
int isData(char ch) {
  if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') ||
      (ch >= '0' && ch <= '9'))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isData>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1124 <isData+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1158 <isData+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     113e <isData+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1158 <isData+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1164 <isData+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1164 <isData+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <isData+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isData>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isData(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 48
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 57
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @isData(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void cmc() { db(0xF5); }


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

x86 assembly (clang, -O2):
<cmc>:
mov    $0xf5,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @cmc() {
%1 = call i32 @db(i32 245)
ret void
}

LLVM IR (-O2):
define void @cmc() {
%1 = tail call i32 @db(i32 245)
ret void
}
/* Type definitions */
struct fcb {
  int dummy;
};

/* Variables and functions */
int kf_put_rec(struct fcb *, int /*<<< orphan*/, unsigned char *, unsigned int,
               char *, unsigned int);
int kf7_put_rec(struct fcb *f, unsigned char t[], unsigned key_lc, char r[],
                int rlc) {
  return (kf_put_rec(f, 0, t, key_lc, r, (unsigned)rlc));
}


x86 assembly (clang, -O0):
<kf7_put_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
xor    %esi,%esi
call   1030 <kf_put_rec@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kf7_put_rec>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <kf_put_rec@plt>

LLVM IR (-O0):
%struct.fcb = type { i32 }
define i32 @kf7_put_rec(%struct.fcb* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.fcb*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.fcb* %0, %struct.fcb** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load %struct.fcb*, %struct.fcb** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @kf_put_rec(%struct.fcb* %11, i32 0, i8* %12, i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.fcb = type { i32 }
define i32 @kf7_put_rec(%struct.fcb* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @kf_put_rec(%struct.fcb* %0, i32 0, i8* %1, i32 %2, i8* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t max_uint32(uint32_t a, uint32_t b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<max_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <max_uint32+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max_uint32+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_uint32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max_uint32(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void printHello(void *threadID) {
  long tid;
  tid = (long)threadID;
  printf("Hello there, it's me, thread #%ld\n", tid);
  pthread_exit(NULL);
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Hello there, it's me, thread #%ld\0A\00"
define void @printHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Hello there, it's me, thread #%ld\0A\00"
define void @printHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret void
}
void foo(int k) {
  volatile int *b = &k;
  b++;
  *b = 5;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i32 1
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store volatile i32 5, i32* %6
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vcard_parse(char *);
int main() {
  vcard_parse((char *)"BEGIN:VCARD\n"
                      "END:VCARD\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"BEGIN:VCARD\0AEND:VCARD\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @vcard_parse(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"BEGIN:VCARD\0AEND:VCARD\0A\00"
define i32 @main() {
%1 = tail call i32 @vcard_parse(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ndarray {
  int dummy;
};
typedef int int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ *stdlib_ndarray_iget_ptr(struct ndarray const *,
                                            int /*<<< orphan*/ const);
int stdlib_ndarray_set_ptr_bool(int /*<<< orphan*/ *, int const);
int8_t stdlib_ndarray_iset_bool(const struct ndarray *arr, const int64_t idx,
                                const bool v) {
  uint8_t *ind = stdlib_ndarray_iget_ptr(arr, idx);
  if (ind == NULL) {
    return -1;
  }
  return stdlib_ndarray_set_ptr_bool(ind, v);
}


x86 assembly (clang, -O0):
<stdlib_ndarray_iset_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <stdlib_ndarray_iget_ptr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <stdlib_ndarray_iset_bool+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <stdlib_ndarray_iset_bool+0x48>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <stdlib_ndarray_set_ptr_bool@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_ndarray_iset_bool>:
push   %rbx
mov    %edx,%ebx
call   1040 <stdlib_ndarray_iget_ptr@plt>
test   %rax,%rax
je     1138 <stdlib_ndarray_iset_bool+0x18>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <stdlib_ndarray_set_ptr_bool@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_iset_bool(%struct.ndarray* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.ndarray*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store %struct.ndarray* %0, %struct.ndarray** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load %struct.ndarray*, %struct.ndarray** %5
%10 = load i32, i32* %6
%11 = call i32* @stdlib_ndarray_iget_ptr(%struct.ndarray* %9, i32 %10)
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %19
15: ; preds = %3
%16 = load i32*, i32** %8
%17 = load i32, i32* %7
%18 = call i32 @stdlib_ndarray_set_ptr_bool(i32* %16, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_iset_bool(%struct.ndarray* %0, i32 %1, i32 %2) {
%4 = tail call i32* @stdlib_ndarray_iget_ptr(%struct.ndarray* %0, i32 %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @stdlib_ndarray_set_ptr_bool(i32* %4, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
int langdef_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @langdef_shutdown() {
ret i32 0
}
/* Variables and functions */
scalar_t__ INADDR_NONE;
scalar_t__ inet_addr(char const *);
int zis_ip(const char *ip) {
  if (INADDR_NONE != inet_addr(ip)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<zis_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     114f <zis_ip+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <zis_ip+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zis_ip>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%rbx
call   1030 <inet_addr@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@INADDR_NONE = global i64 0
define i32 @zis_ip(i8* %0) {
%2 = load i64, i64* @INADDR_NONE
%3 = tail call i64 @inet_addr(i8* %0)
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int EINVAL;
int __pt_do_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
  if (cond == NULL)
    return (EINVAL);
  if (mutex == NULL)
    return (EINVAL);
  return (__pt_do_cond_wait(cond, mutex));
}


x86 assembly (clang, -O0):
<pthread_cond_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113c <pthread_cond_wait+0x2c>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <pthread_cond_wait+0x58>
cmpq   $0x0,-0x18(%rbp)
jne    1158 <pthread_cond_wait+0x48>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <pthread_cond_wait+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <__pt_do_cond_wait@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_cond_wait>:
test   %rdi,%rdi
je     111f <pthread_cond_wait+0xf>
test   %rsi,%rsi
je     111f <pthread_cond_wait+0xf>
jmp    1030 <__pt_do_cond_wait@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pthread_cond_wait(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 = icmp eq i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @EINVAL
store i32 %9, i32* %3
br label %19
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* @EINVAL
store i32 %14, i32* %3
br label %19
15: ; preds = %10
%16 = load i32*, i32** %4
%17 = load i32*, i32** %5
%18 = call i32 @__pt_do_cond_wait(i32* %16, i32* %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %13, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_cond_wait(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EINVAL
br label %12
6: ; preds = %2
%7 = icmp eq i32* %1, null
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = load i32, i32* @EINVAL
br label %12
10: ; preds = %6
%11 = tail call i32 @__pt_do_cond_wait(i32* %0, i32* %1)
br label %12
12: ; preds = %10, %8, %4
%13 = phi i32 [ %5, %4 ], [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}
main() { return 256; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 256
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_to_be64(int /*<<< orphan*/);
uint64_t be64_to_cpu(uint64_t v) { return cpu_to_be64(v); }


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

x86 assembly (clang, -O2):
<be64_to_cpu>:
jmp    1030 <cpu_to_be64@plt>

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

LLVM IR (-O2):
define i32 @be64_to_cpu(i32 %0) {
%2 = tail call i32 @cpu_to_be64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, int const, int const, int const);
int integer_not_in_range_display_error(const int value, const int range_min,
                                       const int range_max) {
  if (value < range_min || value > range_max) {
    return 1;
  }
  print_error("%d is within the range %d-%d\n", value, range_min, range_max);
  return 0;
}


x86 assembly (clang, -O0):
<integer_not_in_range_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1139 <integer_not_in_range_display_error+0x29>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1145 <integer_not_in_range_display_error+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1161 <integer_not_in_range_display_error+0x51>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeab(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_not_in_range_display_error>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x1,%eax
cmp    %esi,%edi
jl     1136 <integer_not_in_range_display_error+0x26>
mov    %edi,%esi
cmp    %ecx,%edi
jg     1136 <integer_not_in_range_display_error+0x26>
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <print_error@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%d is within the range %d-%d\0A\00"
define i32 @integer_not_in_range_display_error(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11, %3
store i32 1, i32* %4
br label %21
16: ; preds = %11
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call i32 @print_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
store i32 0, i32* %4
br label %21
21: ; preds = %16, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [30 x i8] c"%d is within the range %d-%d\0A\00"
define i32 @integer_not_in_range_display_error(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = or i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @print_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %10
}
int security_sb_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.nameidata = type opaque
define i32 @security_sb_pivotroot(%struct.nameidata* nocapture readnone %0, %struct.nameidata* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_page(unsigned long addr) { free((void *)addr); }


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

x86 assembly (clang, -O2):
<free_page>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_page(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
void gtk_icon_theme_add_builtin_icon() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_add_builtin_icon() {
ret void
}
strcpy(s1, s2) char *s1, *s2;
{
  char *os1;
  os1 = s1;
  while (*s1++ = *s2++)
    ;
  return (os1);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strcpy(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = ptrtoint i8* %0 to i64
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ soar_cInitializeSoar();
void init_soar(void) { soar_cInitializeSoar(); }


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

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

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

LLVM IR (-O2):
define void @init_soar() {
%1 = tail call i32 (...) @soar_cInitializeSoar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
swap() { ol("XCHG"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"XCHG\00"
define i32 @swap() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Signature_Packet(int);
extern void embedded_signature(int len) { Signature_Packet(len); }


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

x86 assembly (clang, -O2):
<embedded_signature>:
jmp    1030 <Signature_Packet@plt>

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

LLVM IR (-O2):
define void @embedded_signature(i32 %0) {
%2 = tail call i32 @Signature_Packet(i32 %0)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ error(char *, long);
void *pen_calloc(size_t n, size_t s) {
  void *q = calloc(n, s);
  if (!q)
    error("Can't calloc %ld bytes", (long)n * s);
  return q;
}


x86 assembly (clang, -O0):
<pen_calloc>:
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 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <pen_calloc+0x41>
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pen_calloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <pen_calloc+0x2b>
imul   %r15,%r14
lea    0xebd(%rip),%rdi
mov    %r14,%rsi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Can't calloc %ld bytes\00"
define i8* @pen_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = mul i64 %12, %13
%15 = call i32 @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [23 x i8] c"Can't calloc %ld bytes\00"
define noalias i8* @pen_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = tail call i32 @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void __attribute__((noreturn)) __attribute__((__section__("mlocked_text")))
stress_munmap_sig_handler(int num) {
  (void)num;
  _exit(0);
}


x86 assembly (clang, -O0):
<stress_munmap_sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<stress_munmap_sig_handler>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @stress_munmap_sig_handler(i32 %0) section "mlocked_text" {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @stress_munmap_sig_handler(i32 %0) section "mlocked_text" {
%2 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
double fabs(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double ValorAbsoluto(double a) {
  printf("Enter a number (positive or negative): ");
  scanf("%lf", &a);
  return (fabs(a));
}


x86 assembly (clang, -O0):
<ValorAbsoluto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
movaps 0xeab(%rip),%xmm1
pand   %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValorAbsoluto>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
andps  0xeb3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Enter a number (positive or negative): \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @ValorAbsoluto(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @llvm.fabs.f64(double %5)
ret double %6
}

LLVM IR (-O2):
@.str = [40 x i8] c"Enter a number (positive or negative): \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @ValorAbsoluto(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @llvm.fabs.f64(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longlong_prod_to_all(long long *target, long long *source,
                                       int nreduce, int PE_start,
                                       int logPE_stride, int PE_size,
                                       long long *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longlong_prod_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_longlong_prod_to_all(i64* %0, i64* %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* %6, i64* %7) {
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64*
%16 = alloca i64*
store i64* %0, i64** %9
store i64* %1, i64** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i64* %6, i64** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longlong_prod_to_all(i64* nocapture readnone %0, i64* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char const *);
scalar_t__ strcmp(char const *, char *);
void tlog3a_xgcb_version(const char *args, const char **unused) {
  if (strcmp(args, "1") != 0)
    fatal("dmtlog"
          ": Unsupported file version '%s'!\n",
          args);
}


x86 assembly (clang, -O0):
<tlog3a_xgcb_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     115a <tlog3a_xgcb_version+0x3a>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlog3a_xgcb_version>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1145 <tlog3a_xgcb_version+0x25>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fatal@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [40 x i8] c"dmtlog: Unsupported file version '%s'!\0A\00"
define void @tlog3a_xgcb_version(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 i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @fatal(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [40 x i8] c"dmtlog: Unsupported file version '%s'!\0A\00"
define void @tlog3a_xgcb_version(i8* %0, i8** nocapture readnone %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ dvm_wcstombs_i(int /*<<< orphan*/ const *, char *);
int dvm_wcstombs_len(int /*<<< orphan*/ const *);
char *malloc(size_t);
char *dvm_wcstombs_alloc(const wchar_t *src) {
  size_t mb_len = dvm_wcstombs_len(src) + 1;
  char *mbs = malloc(mb_len);
  dvm_wcstombs_i(src, mbs);
  return mbs;
}


x86 assembly (clang, -O0):
<dvm_wcstombs_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dvm_wcstombs_len@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <dvm_wcstombs_i@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvm_wcstombs_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <dvm_wcstombs_len@plt>
add    $0x1,%eax
movslq %eax,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <dvm_wcstombs_i@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @dvm_wcstombs_alloc(i32* %0) {
%2 = tail call i32 @dvm_wcstombs_len(i32* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @dvm_wcstombs_i(i32* %0, i8* %5)
ret i8* %5
}
/* Variables and functions */
int getmaxx(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int nmstermio_get_cols(void) { return getmaxx(stdscr); }


x86 assembly (clang, -O0):
<nmstermio_get_cols>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getmaxx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmstermio_get_cols>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getmaxx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @nmstermio_get_cols() {
%1 = load i32, i32* @stdscr
%2 = call i32 @getmaxx(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @nmstermio_get_cols() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getmaxx(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int __m128i;

/* Variables and functions */
__m128i _mm_H(__m128i x, __m128i y, __m128i z) { return (((x) | ~(y)) ^ (z)); }


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

x86 assembly (clang, -O2):
<_mm_H>:
mov    %esi,%eax
not    %eax
or     %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_mm_H(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 = load i32, i32* %5
%9 = xor i32 %8, -1
%10 = or i32 %7, %9
%11 = load i32, i32* %6
%12 = xor i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mm_H(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ generateStandardAlphabet();
int /*<<< orphan*/ generateURLAndFilenameSafeAlphabet();
int /*<<< orphan*/ printf(char *);
int main() {
  generateStandardAlphabet();
  printf("\n");
  generateURLAndFilenameSafeAlphabet();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <generateStandardAlphabet@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <generateURLAndFilenameSafeAlphabet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <generateStandardAlphabet@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1030 <generateURLAndFilenameSafeAlphabet@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @generateStandardAlphabet()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (...) @generateURLAndFilenameSafeAlphabet()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_d2u64(double);
int /*<<< orphan*/ rgph_u64_xxh64s_u64(int /*<<< orphan*/, uintptr_t);
uint64_t rgph_u64_xxh64s_f64(double value, uintptr_t seed) {
  return rgph_u64_xxh64s_u64(rgph_d2u64(value), seed);
}


x86 assembly (clang, -O0):
<rgph_u64_xxh64s_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <rgph_u64_xxh64s_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u64_xxh64s_f64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <rgph_u64_xxh64s_u64@plt>

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

LLVM IR (-O2):
define i32 @rgph_u64_xxh64s_f64(double %0, i64 %1) {
%3 = tail call i32 @rgph_d2u64(double %0)
%4 = tail call i32 @rgph_u64_xxh64s_u64(i32 %3, i64 %1)
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t res = 0;
  for (; s[res]; res++)
    ;
  return res;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <strlen+0x38>
jmp    1127 <strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int xfer_upgrade_save_xfers(struct t_upgrade_file *upgrade_file) {
  (void)upgrade_file;
  return 1;
}


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

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

LLVM IR (-O0):
%struct.t_upgrade_file = type opaque
define i32 @xfer_upgrade_save_xfers(%struct.t_upgrade_file* %0) {
%2 = alloca %struct.t_upgrade_file*
store %struct.t_upgrade_file* %0, %struct.t_upgrade_file** %2
%3 = load %struct.t_upgrade_file*, %struct.t_upgrade_file** %2
ret i32 1
}

LLVM IR (-O2):
%struct.t_upgrade_file = type opaque
define i32 @xfer_upgrade_save_xfers(%struct.t_upgrade_file* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ unix_error(char *);
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t Write(int fd, const void *buf, size_t count) {
  ssize_t rc;
  if ((rc = write(fd, buf, count)) < 0)
    unix_error("Write error");
  return rc;
}


x86 assembly (clang, -O0):
<Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115b <Write+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <unix_error@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write>:
push   %rbx
call   1030 <write@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Write+0x18>
lea    0xecd(%rip),%rdi
call   1040 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Write error\00"
define i32 @Write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *to_endpoint(int i, char buffer[]) {
  sprintf(buffer, "%d", i);
  return buffer;
}


x86 assembly (clang, -O0):
<to_endpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_endpoint>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @to_endpoint(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 = load i32, i32* %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @to_endpoint(i32 %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %1
}
/* Type definitions */
struct vec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec_free(struct vec *, int /*<<< orphan*/ *);
void free_vec_pool(struct vec *v) { vec_free(v, NULL); }


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

x86 assembly (clang, -O2):
<free_vec_pool>:
xor    %esi,%esi
jmp    1030 <vec_free@plt>

LLVM IR (-O0):
%struct.vec = type { i32 }
define void @free_vec_pool(%struct.vec* %0) {
%2 = alloca %struct.vec*
store %struct.vec* %0, %struct.vec** %2
%3 = load %struct.vec*, %struct.vec** %2
%4 = call i32 @vec_free(%struct.vec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.vec = type { i32 }
define void @free_vec_pool(%struct.vec* %0) {
%2 = tail call i32 @vec_free(%struct.vec* %0, i32* null)
ret void
}
/* Variables and functions */
int doStatus();
int hypster_status() { return doStatus(); }


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

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

LLVM IR (-O0):
define i32 @hypster_status() {
%1 = call i32 (...) @doStatus()
ret i32 %1
}

LLVM IR (-O2):
define i32 @hypster_status() {
%1 = tail call i32 (...) @doStatus()
ret i32 %1
}
long double my_fabs(long double d) { return ((d < 0) ? (-d) : (d)); }


x86 assembly (clang, -O0):
<my_fabs>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    112b <my_fabs+0x2b>
jmp    111e <my_fabs+0x1e>
fldt   -0x10(%rbp)
fchs
fstpt  -0x1c(%rbp)
jmp    1131 <my_fabs+0x31>
fldt   -0x10(%rbp)
fstpt  -0x1c(%rbp)
fldt   -0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fabs>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @my_fabs(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 %3, 0xK00000000000000000000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load x86_fp80, x86_fp80* %2
%7 = fneg x86_fp80 %6
br label %10
8: ; preds = %1
%9 = load x86_fp80, x86_fp80* %2
br label %10
10: ; preds = %8, %5
%11 = phi x86_fp80 [ %7, %5 ], [ %9, %8 ]
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @my_fabs(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %3, x86_fp80 %0
ret x86_fp80 %4
}