xunge/DecIR huggingface dataset:
int bswap16(int x) {
  union {
    unsigned short number;
    char byte[2];
  } a, b;
  a.number = x;
  b.byte[1] = a.byte[0];
  b.byte[0] = a.byte[1];
  return b.number;
}


x86 assembly (clang, -O0):
<bswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0x8(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x10(%rbp)
movzwl -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
%union.anon = type { i16 }
define i32 @bswap16(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca %union.anon
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i16
%7 = bitcast %union.anon* %3 to i16*
store i16 %6, i16* %7
%8 = bitcast %union.anon* %3 to [2 x i8]*
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = load i8, i8* %9
%11 = bitcast %union.anon* %4 to [2 x i8]*
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 1
store i8 %10, i8* %12
%13 = bitcast %union.anon* %3 to [2 x i8]*
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 1
%15 = load i8, i8* %14
%16 = bitcast %union.anon* %4 to [2 x i8]*
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
store i8 %15, i8* %17
%18 = bitcast %union.anon* %4 to i16*
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @bswap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *mymalloc(scalar_t__);
scalar_t__ urlcount(char const *, char const *);
int /*<<< orphan*/ urlencode(char const *, char *, char const *);
char *CGI_encode_url(const char *p, const char *keep) {
  char *out;
  if (p == 0) {
    return 0;
  }
  out = mymalloc(urlcount(p, keep) + 1);
  urlencode(p, out, keep);
  return out;
}


x86 assembly (clang, -O0):
<CGI_encode_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <CGI_encode_url+0x28>
movq   $0x0,-0x8(%rbp)
jmp    118e <CGI_encode_url+0x5e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <urlcount@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <mymalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <urlencode@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CGI_encode_url>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1161 <CGI_encode_url+0x31>
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <urlcount@plt>
lea    0x1(%rax),%rdi
call   1040 <mymalloc@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1050 <urlencode@plt>
jmp    1164 <CGI_encode_url+0x34>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @CGI_encode_url(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i64 @urlcount(i8* %0, i8* %1)
%6 = add nsw i64 %5, 1
%7 = tail call i8* @mymalloc(i64 %6)
%8 = tail call i32 @urlencode(i8* %0, i8* %7, i8* %1)
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %10
}
int jep_socket_get_error() {
  int err = 0;
  return err;
}


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

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

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

LLVM IR (-O2):
define i32 @jep_socket_get_error() {
ret i32 0
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *,
                  char const *);
char *get_job_directory(const char *tt_root, const char *user,
                        const char *jobid) {
  return concatenate("%s/taskTracker/%s"
                     "/jobcache/%s",
                     "job_dir_path", 3, tt_root, user, jobid);
}


x86 assembly (clang, -O0):
<get_job_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xec9(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x3,%edx
call   1030 <concatenate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_job_directory>:
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
lea    0xef7(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%s/taskTracker/%s/jobcache/%s\00"
@.str.1 = [13 x i8] c"job_dir_path\00"
define i8* @get_job_directory(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @concatenate(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s/taskTracker/%s/jobcache/%s\00"
@.str.1 = [13 x i8] c"job_dir_path\00"
define i8* @get_job_directory(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @concatenate(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int keywordCode(char const *, int);
int sqlite3KeywordCode(const char *z, int n) { return keywordCode(z, n); }


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

x86 assembly (clang, -O2):
<sqlite3KeywordCode>:
jmp    1030 <keywordCode@plt>

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

LLVM IR (-O2):
define i32 @sqlite3KeywordCode(i8* %0, i32 %1) {
%3 = tail call i32 @keywordCode(i8* %0, i32 %1)
ret i32 %3
}
void umocktypes_free_unsignedlong(unsigned long *value) { (void)value; }


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_unsignedlong(i64* nocapture %0) {
ret void
}
void gtk_frame_set_shadow_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_frame_set_shadow_type() {
ret void
}
int test_imm_22int64_midword_reg(long long val) {
  return ((val >> 16) & (0x22 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_22int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x22,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_22int64_midword_reg>:
test   $0x220000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_22int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 34
%6 = icmp ne i64 %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_22int64_midword_reg(i64 %0) {
%2 = and i64 %0, 2228224
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int raise(int);
int octave_raise_wrapper(int signum) { return raise(signum); }


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

x86 assembly (clang, -O2):
<octave_raise_wrapper>:
jmp    1030 <raise@plt>

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

LLVM IR (-O2):
define i32 @octave_raise_wrapper(i32 %0) {
%2 = tail call i32 @raise(i32 %0)
ret i32 %2
}
void peerkey_deinit(struct wpa_sm *sm) {}


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

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

LLVM IR (-O0):
%struct.wpa_sm = type opaque
define void @peerkey_deinit(%struct.wpa_sm* %0) {
%2 = alloca %struct.wpa_sm*
store %struct.wpa_sm* %0, %struct.wpa_sm** %2
ret void
}

LLVM IR (-O2):
%struct.wpa_sm = type opaque
define void @peerkey_deinit(%struct.wpa_sm* nocapture %0) {
ret void
}
/* Type definitions */
struct mq_attr {
  int dummy;
};
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, struct mq_attr const *, struct mq_attr *);
int mq_setattr(mqd_t mqd, const struct mq_attr *new, struct mq_attr *old) {
  return syscall(245, mqd, new, old);
}


x86 assembly (clang, -O0):
<mq_setattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0xf5,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_setattr>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xf5,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.mq_attr = type { i32 }
define i32 @mq_setattr(i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2) {
%4 = alloca i32
%5 = alloca %struct.mq_attr*
%6 = alloca %struct.mq_attr*
store i32 %0, i32* %4
store %struct.mq_attr* %1, %struct.mq_attr** %5
store %struct.mq_attr* %2, %struct.mq_attr** %6
%7 = load i32, i32* %4
%8 = load %struct.mq_attr*, %struct.mq_attr** %5
%9 = load %struct.mq_attr*, %struct.mq_attr** %6
%10 = call i32 @syscall(i32 245, i32 %7, %struct.mq_attr* %8, %struct.mq_attr* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.mq_attr = type { i32 }
define i32 @mq_setattr(i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2) {
%4 = tail call i32 @syscall(i32 245, i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2)
ret i32 %4
}
unsigned int green(unsigned int x) { return (x >> 16) & 0xff; }


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

x86 assembly (clang, -O2):
<green>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @green(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @green(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
int main(int argc, char *argv[]) {
  char *greeting = "Hello World";
  char msg[12];
  unsigned sz = 0, i;
  for (i = 0; i < 12; i += 1) {
    sz += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0xc,-0x2c(%rbp)
jae    114c <main+0x4c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    112b <main+0x2b>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ uint_put(unsigned int const, int /*<<< orphan*/ *);
void std_uint_str(const void *restrict self, const char *restrict format,
                  FILE *restrict stream) {
  (void)format;
  if (self)
    uint_put(*(const unsigned int *)self, stream);
}


x86 assembly (clang, -O0):
<std_uint_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <std_uint_str+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1030 <uint_put@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_uint_str>:
test   %rdi,%rdi
je     111f <std_uint_str+0xf>
mov    (%rdi),%edi
mov    %rdx,%rsi
jmp    1030 <uint_put@plt>
ret

LLVM IR (-O0):
define void @std_uint_str(i8* noalias %0, i8* noalias %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = load i32*, i32** %6
%15 = call i32 @uint_put(i32 %13, i32* %14)
br label %16
16: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @std_uint_str(i8* noalias %0, i8* noalias nocapture readnone %1, i32* noalias %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @uint_put(i32 %7, i32* %2)
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_addl_ops();
int /*<<< orphan*/ get_addl_ops_len();
int /*<<< orphan*/ write_bytes(char *, unsigned char *, unsigned int,
                               unsigned int *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void output_add(unsigned char *buf, unsigned int buf_size,
                unsigned int *bytes_written) {
  write_bytes("add", buf, buf_size, bytes_written, get_addl_ops(),
              get_addl_ops_len());
}


x86 assembly (clang, -O0):
<output_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <get_addl_ops@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <get_addl_ops_len@plt>
mov    -0x38(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    %eax,%r9d
lea    0xe7d(%rip),%rdi
call   1040 <write_bytes@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_add>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_addl_ops@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <get_addl_ops_len@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
mov    %ebp,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <write_bytes@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"add\00"
define void @output_add(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 (...) @get_addl_ops()
%11 = call i32 (...) @get_addl_ops_len()
%12 = call i32 @write_bytes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i32* %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @output_add(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 (...) @get_addl_ops()
%5 = tail call i32 (...) @get_addl_ops_len()
%6 = tail call i32 @write_bytes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32* %2, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_socket() {
  int sockfd;
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0) {
    perror("create socket error");
    return (0);
  }
  return (sockfd);
}


x86 assembly (clang, -O0):
<create_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1166 <create_socket+0x46>
lea    0xeab(%rip),%rdi
call   1030 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <create_socket+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_socket>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
test   %eax,%eax
js     1140 <create_socket+0x20>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [20 x i8] c"create socket error\00"
define i32 @create_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ 0, %5 ], [ %3, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_sep(char sep) {
  int i;
  for (i = 0; i < 80; i++) {
    printf("%c", sep);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_sep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x50,-0x8(%rbp)
jge    114f <print_sep+0x3f>
movsbl -0x1(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <print_sep+0x15>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x50,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1120 <print_sep+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_sep(i8 signext %0) {
%2 = sext i8 %0 to i32
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @putchar(i32 %2)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 80
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_timestamp() {
  time_t now = time(NULL);
  return asctime(localtime(&now));
}


x86 assembly (clang, -O0):
<get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_timestamp() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i32 @localtime(i32* %1)
%4 = call i8* @asctime(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_timestamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(int /*<<< orphan*/ *, char *);
int main() { assert(fopen(NULL, "rb") == NULL); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
lea    0xed1(%rip),%rsi
call   1040 <fopen@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
xor    %edi,%edi
call   1040 <fopen@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32 @main() {
%1 = call i32* @fopen(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @main() {
%1 = tail call i32* @fopen(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ NS_PUT16(int /*<<< orphan*/, int /*<<< orphan*/ *);
void ns_put16(u_int src, u_char *dst) { NS_PUT16(src, dst); }


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

x86 assembly (clang, -O2):
<ns_put16>:
jmp    1030 <NS_PUT16@plt>

LLVM IR (-O0):
define void @ns_put16(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 @NS_PUT16(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @ns_put16(i32 %0, i32* %1) {
%3 = tail call i32 @NS_PUT16(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core6_print(char *, char const *);
void U_EMRPOLYGON16_print(const char *contents) {
  core6_print("U_EMRPOLYGON16", contents);
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"U_EMRPOLYGON16\00"
define void @U_EMRPOLYGON16_print(i8* %0) {
%2 = tail call i32 @core6_print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_indexed_optvars();
int /*<<< orphan*/ setup_indexed_params();
int /*<<< orphan*/ setup_pointers();
void setup_indexing(void) {
  setup_pointers();
  setup_indexed_params();
  setup_indexed_optvars();
}


x86 assembly (clang, -O0):
<setup_indexing>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <setup_pointers@plt>
mov    $0x0,%al
call   1040 <setup_indexed_params@plt>
mov    $0x0,%al
call   1030 <setup_indexed_optvars@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_indexing>:
push   %rax
xor    %eax,%eax
call   1050 <setup_pointers@plt>
xor    %eax,%eax
call   1040 <setup_indexed_params@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <setup_indexed_optvars@plt>

LLVM IR (-O0):
define void @setup_indexing() {
%1 = call i32 (...) @setup_pointers()
%2 = call i32 (...) @setup_indexed_params()
%3 = call i32 (...) @setup_indexed_optvars()
ret void
}

LLVM IR (-O2):
define void @setup_indexing() {
%1 = tail call i32 (...) @setup_pointers()
%2 = tail call i32 (...) @setup_indexed_params()
%3 = tail call i32 (...) @setup_indexed_optvars()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void KTError(char *msg, char *str) {
  fprintf(stderr, "keytouch-acpid: ");
  fprintf(stderr, msg, str);
  putc('\n', stderr);
}


x86 assembly (clang, -O0):
<KTError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KTError>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eae(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"keytouch-acpid: \00"
define void @KTError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 @putc(i8 signext 10, i32 %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"keytouch-acpid: \00"
define void @KTError(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %0, i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @putc(i8 signext 10, i32 %7)
ret void
}
double calculate_deviation(double number, double mean) {
  double value = number - mean;
  return value;
}


x86 assembly (clang, -O0):
<calculate_deviation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_deviation>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @calculate_deviation(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
void genmov_d() {}


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

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

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

LLVM IR (-O2):
define void @genmov_d() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test(int M) {
  int i, j;
  j = (((M + 1) < 0) ? -((-(M + 1) + (2) - 1) / (2)) : (M + 1) / (2));
  {
    hash(1);
    hash(1);
    hash(j);
  };
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jge    1150 <test+0x40>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x2,%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1161 <test+0x51>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
cmp    $0xfffffffe,%edi
jg     1125 <test+0x15>
mov    %edi,%ebx
neg    %ebx
shr    $0x1f,%ebx
sub    %edi,%ebx
sar    %ebx
neg    %ebx
jmp    112c <test+0x1c>
add    $0x1,%edi
shr    %edi
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
%11 = sub nsw i32 0, %10
%12 = add nsw i32 %11, 2
%13 = sub nsw i32 %12, 1
%14 = sdiv i32 %13, 2
%15 = sub nsw i32 0, %14
br label %20
16: ; preds = %1
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
%19 = sdiv i32 %18, 2
br label %20
20: ; preds = %16, %8
%21 = phi i32 [ %15, %8 ], [ %19, %16 ]
store i32 %21, i32* %4
%22 = call i32 @hash(i32 1)
%23 = call i32 @hash(i32 1)
%24 = load i32, i32* %4
%25 = call i32 @hash(i32 %24)
ret void
}

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = icmp slt i32 %0, -1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub i32 0, %0
%5 = sdiv i32 %4, -2
br label %9
6: ; preds = %1
%7 = add nsw i32 %0, 1
%8 = lshr i32 %7, 1
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %5, %3 ], [ %8, %6 ]
%11 = tail call i32 @hash(i32 1)
%12 = tail call i32 @hash(i32 1)
%13 = tail call i32 @hash(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_west_lever(int, int);
void w_west_lever_test(void **state) {
  assert_int_equal(0x0000000008000000ul,
                   w_west_lever(0x000000000C000000ul, 0x0000000400000000ul));
}


x86 assembly (clang, -O0):
<w_west_lever_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc000000,%edi
xor    %esi,%esi
call   1040 <w_west_lever@plt>
mov    %eax,%esi
mov    $0x8000000,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_west_lever_test>:
push   %rax
mov    $0xc000000,%edi
xor    %esi,%esi
call   1040 <w_west_lever@plt>
mov    $0x8000000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_west_lever_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_west_lever(i32 201326592, i32 0)
%4 = call i32 @assert_int_equal(i32 134217728, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_west_lever_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_west_lever(i32 201326592, i32 0)
%3 = tail call i32 @assert_int_equal(i32 134217728, i32 %2)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double getTimeMillis() {
  struct timespec spec;
  clock_gettime(CLOCK_REALTIME, &spec);
  return spec.tv_sec * 1000 + spec.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<getTimeMillis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeMillis>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,(%rsp),%eax
movslq 0x4(%rsp),%rcx
imul   $0x431bde83,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define double @getTimeMillis() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define double @getTimeMillis() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
%12 = sitofp i32 %11 to double
ret double %12
}
void CreatePlotBuf(int size) {}


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

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

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

LLVM IR (-O2):
define void @CreatePlotBuf(i32 %0) {
ret void
}
void dhcpcd_freev(char **argv) {
  char **v;
  if (argv) {
    for (v = argv; *v; v++)
      free(*v);
    free(argv);
  }
}


x86 assembly (clang, -O0):
<dhcpcd_freev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <dhcpcd_freev+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115a <dhcpcd_freev+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <dhcpcd_freev+0x1f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcpcd_freev>:
test   %rdi,%rdi
je     1150 <dhcpcd_freev+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <dhcpcd_freev+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <dhcpcd_freev+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @dhcpcd_freev(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %12, %1
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
char *test15(const char *a1, int a2) { return strchr(a1, a2); }


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

x86 assembly (clang, -O2):
<test15>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @test15(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
void test_PTHREAD_MUTEX_NORMAL(void) { int dummy = "PTHREAD_MUTEX_NORMAL"; }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"PTHREAD_MUTEX_NORMAL\00"
define void @test_PTHREAD_MUTEX_NORMAL() {
%1 = alloca i32
store i32 ptrtoint ([21 x i8]* @.str to i32), i32* %1
ret void
}

LLVM IR (-O2):
define void @test_PTHREAD_MUTEX_NORMAL() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
int get_XEnterWindowEvent_send_event(void *_p) {
  return (int)((XEnterWindowEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XEnterWindowEvent_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XEnterWindowEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_3(int x, int n) {
  x ^= (0x01 << n);
  return x;
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32, i32* %3
%8 = xor i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_3(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
char *_version();
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
char *mon_version(void) {
  char *ret;
  monLock();
  ret = _version();
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <monLock@plt>
mov    $0x0,%al
call   1050 <_version@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_version>:
push   %rbx
xor    %eax,%eax
call   1030 <monLock@plt>
xor    %eax,%eax
call   1050 <_version@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mon_version() {
%1 = alloca i8*
%2 = call i32 (...) @monLock()
%3 = call i8* (...) @_version()
store i8* %3, i8** %1
%4 = call i32 (...) @monUnlock()
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @mon_version() {
%1 = tail call i32 (...) @monLock()
%2 = tail call i8* (...) @_version()
%3 = tail call i32 (...) @monUnlock()
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ MD5Str(char *, char *);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void print_md5digest(char *data) {
  char md5sum[33];
  bzero(md5sum, 33);
  MD5Str(data, md5sum);
  printf("%s\n", md5sum);
}


x86 assembly (clang, -O0):
<print_md5digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x21,%esi
call   1050 <bzero@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <MD5Str@plt>
lea    -0x30(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_md5digest>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x21,%esi
call   1050 <bzero@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <MD5Str@plt>
lea    0xea4(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_md5digest(i8* %0) {
%2 = alloca i8*
%3 = alloca [33 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%5 = call i32 @bzero(i8* %4, i32 33)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%8 = call i32 @MD5Str(i8* %6, i8* %7)
%9 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_md5digest(i8* %0) {
%2 = alloca [33 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%4 = call i32 @bzero(i8* %3, i32 33)
%5 = call i32 @MD5Str(i8* %0, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("ERROR: Not compiled. Missing OpenSSL support.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"ERROR: Not compiled. Missing OpenSSL support.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [46 x i8] c"ERROR: Not compiled. Missing OpenSSL support.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}