xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int EINVAL;
int pthread_attr_getcputime(pthread_attr_t *attr, int *clock_allowed) {
  (void)attr;
  (void)clock_allowed;
  return EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_attr_getcputime(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *_eglstrdup(const char *s) {
  if (s) {
    int l = strlen(s);
    char *s2 = malloc(l + 1);
    if (s2)
      strcpy(s2, s);
    return s2;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<_eglstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1187 <_eglstrdup+0x57>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117a <_eglstrdup+0x4a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118f <_eglstrdup+0x5f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eglstrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115e <_eglstrdup+0x2e>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     115e <_eglstrdup+0x2e>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1160 <_eglstrdup+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_eglstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %22
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = call i8* @malloc(i32 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
br label %20
20: ; preds = %16, %8
%21 = load i8*, i8** %5
store i8* %21, i8** %2
br label %23
22: ; preds = %1
store i8* null, i8** %2
br label %23
23: ; preds = %22, %20
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @_eglstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %1, %3, %8
%11 = phi i8* [ %6, %8 ], [ null, %3 ], [ null, %1 ]
ret i8* %11
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long subwindow;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_subwindow(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcrossing.subwindow = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcrossing_subwindow>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcrossing_subwindow(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcrossing_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int atoi(char *);
int getValue(char *str) { return atoi(str); }


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

x86 assembly (clang, -O2):
<getValue>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @getValue(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
void g_idle_add() {}


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

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

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

LLVM IR (-O2):
define void @g_idle_add() {
ret void
}
void function(int array[]) {
  int i;
  for (i = 0; i < 5; i++)
    array[i] = 88;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1136 <function+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x58,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <function+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0x58,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @function(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 88, i32 88, i32 88, i32 88>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 88, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int main() {
  char znak;
  int j;
  for (j = 0; j < 255; j++) {
    znak = j;
    printf(" %d - %c ", j, znak);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jge    115a <main+0x4a>
mov    -0xc(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c" %d - %c \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 255
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
%10 = load i32, i32* %3
%11 = load i8, i8* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10, i8 signext %11)
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 i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c" %d - %c \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = trunc i32 %2 to i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i8 signext %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct zbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ __zbuf_push(struct zbuf *, int, int);
int /*<<< orphan*/ htobe16(int /*<<< orphan*/);
void zbuf_put_be16(struct zbuf *zb, uint16_t val) {
  struct unaligned16 {
    uint16_t value;
  } __attribute__((packed));
  struct unaligned16 *v =
      ((struct unaligned16 *)__zbuf_push(zb, sizeof(struct unaligned16), 1));
  if (v)
    v->value = htobe16(val);
}


x86 assembly (clang, -O0):
<zbuf_put_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <__zbuf_push@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <zbuf_put_be16+0x41>
mov    -0xc(%rbp),%edi
call   1040 <htobe16@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zbuf_put_be16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <__zbuf_push@plt>
test   %rax,%rax
je     1145 <zbuf_put_be16+0x25>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <htobe16@plt>
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.zbuf = type { i32 }
%struct.unaligned16 = type { i32 }
define void @zbuf_put_be16(%struct.zbuf* %0, i32 %1) {
%3 = alloca %struct.zbuf*
%4 = alloca i32
%5 = alloca %struct.unaligned16*
store %struct.zbuf* %0, %struct.zbuf** %3
store i32 %1, i32* %4
%6 = load %struct.zbuf*, %struct.zbuf** %3
%7 = call i64 @__zbuf_push(%struct.zbuf* %6, i32 4, i32 1)
%8 = inttoptr i64 %7 to %struct.unaligned16*
store %struct.unaligned16* %8, %struct.unaligned16** %5
%9 = load %struct.unaligned16*, %struct.unaligned16** %5
%10 = icmp ne %struct.unaligned16* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @htobe16(i32 %12)
%14 = load %struct.unaligned16*, %struct.unaligned16** %5
%15 = getelementptr inbounds %struct.unaligned16, %struct.unaligned16* %14, i32 0, i32 0
store i32 %13, i32* %15
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.zbuf = type { i32 }
%struct.unaligned16 = type { i32 }
define void @zbuf_put_be16(%struct.zbuf* %0, i32 %1) {
%3 = tail call i64 @__zbuf_push(%struct.zbuf* %0, i32 4, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = inttoptr i64 %3 to %struct.unaligned16*
%7 = tail call i32 @htobe16(i32 %1)
%8 = getelementptr inbounds %struct.unaligned16, %struct.unaligned16* %6, i64 0, i32 0
store i32 %7, i32* %8
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
short msdb_userPurge();
short user_deleteAllUserAccounts() { return msdb_userPurge(); }


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

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

LLVM IR (-O0):
define signext i16 @user_deleteAllUserAccounts() {
%1 = call signext i16 (...) @msdb_userPurge()
ret i16 %1
}

LLVM IR (-O2):
define signext i16 @user_deleteAllUserAccounts() {
%1 = tail call signext i16 (...) @msdb_userPurge()
ret i16 %1
}
void foo444() {}


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

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

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

LLVM IR (-O2):
define void @foo444() {
ret void
}
int sandbox_consume_fs_extension(const char *ext_token, char **path) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @sandbox_consume_fs_extension(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int remove(char const *);
int c_remove(const char *pathname) { return remove(pathname); }


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

x86 assembly (clang, -O2):
<c_remove>:
jmp    1030 <remove@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void reshape_1(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
}


x86 assembly (clang, -O0):
<reshape_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1050 <glViewport@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape_1>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <glViewport@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glLoadIdentity@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @reshape_1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @reshape_1(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
ret void
}
int checkDelimit(char ch) {
  if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||
      (ch >= '0' && ch <= '9') || ch == '_')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<checkDelimit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <checkDelimit+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1165 <checkDelimit+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     113e <checkDelimit+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1165 <checkDelimit+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1158 <checkDelimit+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1165 <checkDelimit+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    1171 <checkDelimit+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1178 <checkDelimit+0x78>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDelimit>:
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
xor    %eax,%eax
cmp    $0x1a,%cl
jb     1123 <checkDelimit+0x23>
lea    -0x3a(%rdi),%eax
cmp    $0xf6,%al
setb   %al
cmp    $0x5f,%dil
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @checkDelimit(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, 97
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, 122
br i1 %10, label %31, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
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, 90
br i1 %18, label %31, 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 %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 57
br i1 %26, label %31, label %27
27: ; preds = %23, %19
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 95
br i1 %30, label %31, label %32
31: ; preds = %27, %23, %15, %7
store i32 0, i32* %2
br label %33
32: ; preds = %27
store i32 1, i32* %2
br label %33
33: ; preds = %32, %31
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @checkDelimit(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = add i8 %0, -58
%7 = icmp ult i8 %6, -10
%8 = icmp ne i8 %0, 95
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double tan(double);
double Tangente(double a) {
  printf("Enter a number: ");
  scanf("%lf", &a);
  return (tan(a));
}


x86 assembly (clang, -O0):
<Tangente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tangente>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <tan@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Tangente(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 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 @tan(double %5)
ret double %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Tangente(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 @tan(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ SYSerror(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int ioctl(int, long, void *);
int BIO_socket_ioctl(int fd, long type, void *arg) {
  int ret;
  ret = ioctl(fd, type, arg);
  if (ret < 0)
    SYSerror(errno);
  return (ret);
}


x86 assembly (clang, -O0):
<BIO_socket_ioctl>:
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 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    115e <BIO_socket_ioctl+0x3e>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <SYSerror@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_socket_ioctl>:
push   %rbx
call   1030 <ioctl@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    113a <BIO_socket_ioctl+0x1a>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <SYSerror@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @BIO_socket_ioctl(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = call i32 @ioctl(i32 %8, i64 %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @errno
%16 = call i32 @SYSerror(i32 %15)
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @BIO_socket_ioctl(i32 %0, i64 %1, i8* %2) {
%4 = tail call i32 @ioctl(i32 %0, i64 %1, i8* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @SYSerror(i32 %7)
br label %9
9: ; preds = %6, %3
ret i32 %4
}
void yy_3_TableBody(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_3_TableBody(i8* nocapture %0, i32 %1) {
ret void
}
unsigned int explicit_unsigned_char_to_unsigned_int(unsigned char src) {
  return (unsigned int)src;
}


x86 assembly (clang, -O0):
<explicit_unsigned_char_to_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @explicit_unsigned_char_to_unsigned_int(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @explicit_unsigned_char_to_unsigned_int(i8 zeroext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
/* Variables and functions */
int pow(int, int);
void init_STRATA_IDX17(int *STRATA_IDX_prefix_bin) {
  for (int i = 0; i < pow(2, 17); i++) {
    STRATA_IDX_prefix_bin[i] = -1;
  };
}


x86 assembly (clang, -O0):
<init_STRATA_IDX17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x11,%esi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1162 <init_STRATA_IDX17+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <init_STRATA_IDX17+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_STRATA_IDX17>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2,%edi
mov    $0x11,%esi
call   1030 <pow@plt>
test   %eax,%eax
jle    1152 <init_STRATA_IDX17+0x42>
xor    %ebx,%ebx
nopl   0x0(%rax)
movl   $0xffffffff,(%r14,%rbx,4)
ff
add    $0x1,%rbx
mov    $0x2,%edi
mov    $0x11,%esi
call   1030 <pow@plt>
cltq
cmp    %rax,%rbx
jl     1130 <init_STRATA_IDX17+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @init_STRATA_IDX17(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = call i32 @pow(i32 2, i32 17)
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 -1, i32* %12
br label %13
13: ; preds = %8
%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):
define void @init_STRATA_IDX17(i32* nocapture writeonly %0) {
%2 = tail call i32 @pow(i32 2, i32 17)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %8, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 -1, i32* %7
%8 = add nuw nsw i64 %6, 1
%9 = tail call i32 @pow(i32 2, i32 17)
%10 = sext i32 %9 to i64
%11 = icmp slt i64 %8, %10
br i1 %11, label %5, label %4
}
int mem_allocated() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mem_allocated() {
ret i32 0
}
int leapYear(int year) {
  if (year % 400 == 0) {
    return 1;
  }
  if (year % 100 == 0) {
    return 0;
  }
  if (year % 4 == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<leapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <leapYear+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116e <leapYear+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <leapYear+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <leapYear+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <leapYear+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <leapYear+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapYear>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <leapYear+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <leapYear+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @leapYear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %19
18: ; preds = %13
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @leapYear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int strInArray(char *test, char **array, int len) {
  char **ar = array;
  while (*ar) {
    if (0 == strncmp(test, *ar, len))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strInArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     116b <strInArray+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1166 <strInArray+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1172 <strInArray+0x62>
jmp    112b <strInArray+0x1b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strInArray>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
nopl   (%rax)
mov    (%rbx),%rsi
test   %rsi,%rsi
je     113c <strInArray+0x2c>
mov    %rbp,%rdi
mov    %r14d,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1120 <strInArray+0x10>
xor    %eax,%eax
jmp    1141 <strInArray+0x31>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @strInArray(i8* %0, i8** nocapture %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i64 @strncmp(i8* %0, i8* %5, i32 %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %7
%11 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void show_help() {
  puts("\n\n"
       "===========================================\n"
       "  (O)NScripter Script Compiler\n"
       "===========================================\n"
       "\n"
       "USAGE:\n"
       "   nscrenc [in_dir] [out_file]\n"
       "\n"
       "By default, in_dir is the current directory and out_file is "
       "\"nscript.dat\".\n"
       "out_file can be \"-\" to specify stdout.\n");
}


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

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

LLVM IR (-O0):
@.str = [276 x i8] c"\0A\0A===========================================\0A (O)NScripter Script Compiler\0A===========================================\0A\0AUSAGE:\0A nscrenc [in_dir] [out_file]\0A\0ABy default, in_dir is the current directory and out_file is \22nscript.dat\22.\0Aout_file can be \22-\22 to specify stdout.\0A\00"
define void @show_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [276 x i8] c"\0A\0A===========================================\0A (O)NScripter Script Compiler\0A===========================================\0A\0AUSAGE:\0A nscrenc [in_dir] [out_file]\0A\0ABy default, in_dir is the current directory and out_file is \22nscript.dat\22.\0Aout_file can be \22-\22 to specify stdout.\0A\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float ldexpf(float, int);
float test5f(float x, int exp) { return ldexpf(x, exp); }


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

x86 assembly (clang, -O2):
<test5f>:
jmp    1030 <ldexpf@plt>

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

LLVM IR (-O2):
define float @test5f(float %0, i32 %1) {
%3 = tail call float @ldexpf(float %0, i32 %1)
ret float %3
}
int euca_template(int in, char *out, char **inout) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @euca_template(i32 %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 0
}
int test_imm_3Aint32_mem(int *val) {
  return ((*val) & (0x3A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Aint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 58
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int execute_fchmodat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_fchmodat() {
ret i32 0
}
void cam_inhibit_clear(const int c) {}


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

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

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

LLVM IR (-O2):
define void @cam_inhibit_clear(i32 %0) {
ret void
}
double simple_amb_measurement(double carrier, double code) {
  return carrier + code / ((299792458.0 / 1.0002926) / 1.57542e9);
}


x86 assembly (clang, -O0):
<simple_amb_measurement>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_amb_measurement>:
divsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @simple_amb_measurement(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %6, 0x3FC859B815E479F7
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @simple_amb_measurement(double %0, double %1) {
%3 = fdiv double %1, 0x3FC859B815E479F7
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i, j;
  if (i == 1) {
    i--;
    if (i == 0) {
    label:
      printf("1\n");
    }
  } else {
    printf("2\n");
    if (i == 2)
      goto label;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1152 <main+0x42>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114d <main+0x3d>
jmp    1141 <main+0x31>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <main+0x62>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    116d <main+0x5d>
jmp    1141 <main+0x31>
jmp    1172 <main+0x62>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cexpects(int /*<<< orphan*/ *, int *, int, char *);
void cexpect(FILE *fp, int code, char *msg) {
  int codes[1];
  codes[0] = code;
  (void)cexpects(fp, codes, 1, msg);
}


x86 assembly (clang, -O0):
<cexpect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <cexpects@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cexpect>:
push   %rax
mov    %rdx,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <cexpects@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @cexpect(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [1 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %7, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32*, i32** %4
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %7, i64 0, i64 0
%12 = load i8*, i8** %6
%13 = call i32 @cexpects(i32* %10, i32* %11, i32 1, i8* %12)
ret void
}

LLVM IR (-O2):
define void @cexpect(i32* %0, i32 %1, i8* %2) {
%4 = alloca [1 x i32]
%5 = bitcast [1 x i32]* %4 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 %1, i32* %6
%7 = call i32 @cexpects(i32* %0, i32* %6, i32 1, i8* %2)
ret void
}
int test_imm_14uint32_reg(unsigned int val) {
  return ((val) & (0x14 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_14uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x14,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_14uint32_reg>:
test   $0x14,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14uint32_reg(i32 %0) {
%2 = and i32 %0, 20
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void stacktracer_print(char *s) { printf("%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @stacktracer_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float gb_smoother_step(float a, float b, float t) {
  float x = (t - a) / (b - a);
  return x * x * x * (x * (6.0f * x - 15.0f) + 10.0f);
}


x86 assembly (clang, -O0):
<gb_smoother_step>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  0xeb3(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0xeab(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xe93(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_smoother_step>:
subss  %xmm0,%xmm2
subss  %xmm0,%xmm1
divss  %xmm1,%xmm2
movaps %xmm2,%xmm1
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
movss  0xee1(%rip),%xmm0
mulss  %xmm2,%xmm0
addss  0xed9(%rip),%xmm0
mulss  %xmm2,%xmm0
addss  0xed1(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @gb_smoother_step(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %5
%12 = load float, float* %4
%13 = fsub float %11, %12
%14 = fdiv float %10, %13
store float %14, float* %7
%15 = load float, float* %7
%16 = load float, float* %7
%17 = fmul float %15, %16
%18 = load float, float* %7
%19 = fmul float %17, %18
%20 = load float, float* %7
%21 = load float, float* %7
%22 = call float @llvm.fmuladd.f32(float 6.000000e+00, float %21, float -1.500000e+01)
%23 = call float @llvm.fmuladd.f32(float %20, float %22, float 1.000000e+01)
%24 = fmul float %19, %23
ret float %24
}

LLVM IR (-O2):
define float @gb_smoother_step(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
%7 = fmul float %6, %6
%8 = fmul float %6, %7
%9 = tail call float @llvm.fmuladd.f32(float %6, float 6.000000e+00, float -1.500000e+01)
%10 = tail call float @llvm.fmuladd.f32(float %6, float %9, float 1.000000e+01)
%11 = fmul float %8, %10
ret float %11
}
void gtk_hseparator_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_hseparator_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_binary(int);
int /*<<< orphan*/ printf(char *);
int main() {
  print_binary((1 << 6) | (1 << 7) | (1 << 9));
  printf("\n");
  print_binary(3);
  printf("\n");
  print_binary((3 << 6));
  printf("\n");
  print_binary((1 << 6));
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c0,%edi
call   1040 <print_binary@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <print_binary@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc0,%edi
call   1040 <print_binary@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x40,%edi
call   1040 <print_binary@plt>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2c0,%edi
call   1040 <print_binary@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1040 <print_binary@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xc0,%edi
call   1040 <print_binary@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x40,%edi
call   1040 <print_binary@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 @print_binary(i32 704)
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print_binary(i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @print_binary(i32 192)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @print_binary(i32 64)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_binary(i32 704)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @print_binary(i32 3)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @print_binary(i32 192)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @print_binary(i32 64)
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
int mem_safe(unsigned char *addr) {
  if (addr < ((unsigned char *)0x600000))
    return 1;
  if (addr < ((unsigned char *)0xa00000))
    return 0;
  if (addr < ((unsigned char *)0xff680000))
    return 1;
  if (addr < ((unsigned char *)0xff800000))
    return 0;
}


x86 assembly (clang, -O0):
<mem_safe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x600000,%eax
cmp    %rax,-0x10(%rbp)
jae    1123 <mem_safe+0x23>
movl   $0x1,-0x4(%rbp)
jmp    116f <mem_safe+0x6f>
mov    $0xa00000,%eax
cmp    %rax,-0x10(%rbp)
jae    113e <mem_safe+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116f <mem_safe+0x6f>
mov    $0xff680000,%eax
cmp    %rax,-0x10(%rbp)
jae    1159 <mem_safe+0x59>
movl   $0x1,-0x4(%rbp)
jmp    116f <mem_safe+0x6f>
mov    $0xff800000,%eax
cmp    %rax,-0x10(%rbp)
jae    116f <mem_safe+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_safe>:
mov    $0x1,%eax
cmp    $0x600000,%rdi
jb     1129 <mem_safe+0x29>
xor    %eax,%eax
cmp    $0xa00000,%rdi
jb     1129 <mem_safe+0x29>
shr    $0x13,%rdi
xor    %eax,%eax
cmp    $0x1fed,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @mem_safe(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ult i8* %4, inttoptr (i64 6291456 to i8*)
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %19
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = icmp ult i8* %8, inttoptr (i64 10485760 to i8*)
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 0, i32* %2
br label %19
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = icmp ult i8* %12, inttoptr (i64 4285005824 to i8*)
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1, i32* %2
br label %19
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = icmp ult i8* %16, inttoptr (i64 4286578688 to i8*)
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 0, i32* %2
br label %19
19: ; preds = %6, %10, %14, %18, %15
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @mem_safe(i8* readnone %0) {
%2 = icmp ult i8* %0, inttoptr (i64 6291456 to i8*)
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i8* %0, inttoptr (i64 10485760 to i8*)
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i8* %0, inttoptr (i64 4285005824 to i8*)
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %7, %5 ]
ret i32 %9
}