xunge/DecIR huggingface dataset:
int _swapdirtybits(int x) { return ((x & 0x02) >> 1) | ((x & 0x01) << 1); }


x86 assembly (clang, -O0):
<_swapdirtybits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swapdirtybits>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
shr    %al
and    $0x40,%dil
add    %dil,%dil
or     %al,%dil
shr    $0x6,%dil
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @_swapdirtybits(i32 %0) {
%2 = trunc i32 %0 to i2
%3 = tail call i2 @llvm.bitreverse.i2(i2 %2)
%4 = zext i2 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void hDpMatrixFree(double *arr, int len) {
  int i;
  free(arr);
}


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

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

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

LLVM IR (-O2):
define void @hDpMatrixFree(double* nocapture %0, i32 %1) {
%3 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p(int);
void foo(int n) {
  int i;
  if (n) {
    p(0);
    for (i = 0; i < 3; i++) {
      p(1);
    }
    foo(0);
  } else {
    p(2);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1171 <foo+0x51>
xor    %edi,%edi
call   1030 <p@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1165 <foo+0x45>
mov    $0x1,%edi
call   1030 <p@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <foo+0x23>
xor    %edi,%edi
call   1040 <foo@plt>
jmp    117b <foo+0x5b>
mov    $0x2,%edi
call   1030 <p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     113e <foo+0x2e>
push   %rax
xor    %edi,%edi
call   1030 <p@plt>
mov    $0x1,%edi
call   1030 <p@plt>
mov    $0x1,%edi
call   1030 <p@plt>
mov    $0x1,%edi
call   1030 <p@plt>
add    $0x8,%rsp
mov    $0x2,%edi
jmp    1030 <p@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = call i32 @p(i32 0)
store i32 0, i32* %3
br label %8
8: ; preds = %13, %6
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call i32 @p(i32 1)
br label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %8
16: ; preds = %8
br label %19
17: ; preds = %1
%18 = call i32 @p(i32 2)
br label %19
19: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @p(i32 0)
%5 = tail call i32 @p(i32 1)
%6 = tail call i32 @p(i32 1)
%7 = tail call i32 @p(i32 1)
br label %8
8: ; preds = %1, %3
%9 = tail call i32 @p(i32 2)
ret void
}
int next_pow2(int n) {
  n--;
  n |= (n >> 1);
  n |= (n >> 2);
  n |= (n >> 4);
  n |= (n >> 8);
  n |= (n >> 16);
  n++;
  return n;
}


x86 assembly (clang, -O0):
<next_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_pow2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @next_pow2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *xmalloc(int);
extern char *xstrdup(const char *s) {
  char *dummy;
  size_t length;
  if (s == NULL)
    return NULL;
  length = strlen(s) + 1;
  dummy = xmalloc(sizeof(char) * length);
  memcpy(dummy, s, length);
  return dummy;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1192 <xstrdup+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1163 <xstrdup+0x33>
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15d,%edi
call   1040 <xmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
jmp    1166 <xstrdup+0x36>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = tail call i8* @xmalloc(i32 %5)
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %6)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
void SSMR3HandleMaxDowntime(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleMaxDowntime() {
ret void
}
/* Variables and functions */
int remove(char const *);
int file_unlink(const char *file) { return remove(file); }


x86 assembly (clang, -O0):
<file_unlink>:
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):
<file_unlink>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
define i32 @file_unlink(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 @file_unlink(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CreateDalWDSThreadRead();
int /*<<< orphan*/ CreateDalWDSThreadWrite();
int /*<<< orphan*/ Wds_Thead_Init(int);
void Wds_Run(int fd) {
  Wds_Thead_Init(fd);
  CreateDalWDSThreadRead();
  CreateDalWDSThreadWrite();
}


x86 assembly (clang, -O0):
<Wds_Run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <Wds_Thead_Init@plt>
mov    $0x0,%al
call   1040 <CreateDalWDSThreadRead@plt>
mov    $0x0,%al
call   1030 <CreateDalWDSThreadWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wds_Run>:
push   %rax
call   1050 <Wds_Thead_Init@plt>
xor    %eax,%eax
call   1040 <CreateDalWDSThreadRead@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CreateDalWDSThreadWrite@plt>

LLVM IR (-O0):
define void @Wds_Run(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Wds_Thead_Init(i32 %3)
%5 = call i32 (...) @CreateDalWDSThreadRead()
%6 = call i32 (...) @CreateDalWDSThreadWrite()
ret void
}

LLVM IR (-O2):
define void @Wds_Run(i32 %0) {
%2 = tail call i32 @Wds_Thead_Init(i32 %0)
%3 = tail call i32 (...) @CreateDalWDSThreadRead()
%4 = tail call i32 (...) @CreateDalWDSThreadWrite()
ret void
}
/* Variables and functions */
scalar_t__ memcpy(char *, char const *, size_t);
scalar_t__ psync_malloc(int);
int strlen(char const *);
char *psync_strdup(const char *str) {
  size_t len;
  len = strlen(str) + 1;
  return (char *)memcpy((char *)psync_malloc(sizeof(char) * (len)), str, len);
}


x86 assembly (clang, -O0):
<psync_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <psync_malloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psync_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %ebx,%edi
call   1040 <psync_malloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
define i8* @psync_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @psync_malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = call i64 @memcpy(i8* %12, i8* %13, i64 %14)
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
define i8* @psync_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @psync_malloc(i32 %3)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @memcpy(i8* %6, i8* %0, i64 %4)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Type definitions */
struct event_engine {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_engine_init(struct event_engine *, int);
int main(int argc, char *argv[]) {
  struct event_engine *ee;
  event_engine_init(ee, 1000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <event_engine_init@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%esi
call   1030 <event_engine_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.event_engine = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.event_engine*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load %struct.event_engine*, %struct.event_engine** %5
%7 = call i32 @event_engine_init(%struct.event_engine* %6, i32 1000)
ret i32 0
}

LLVM IR (-O2):
%struct.event_engine = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @event_engine_init(%struct.event_engine* undef, i32 1000)
ret i32 0
}
/* Variables and functions */
int shell(int, char **);
int main(int argc, char *argv[]) { return shell(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <shell@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @shell(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void removelockfile() { remove("/var/run/zimrd.pid"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"/var/run/zimrd.pid\00"
define void @removelockfile() {
%1 = call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"/var/run/zimrd.pid\00"
define void @removelockfile() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
float _Complex mul_float_cr(float _Complex a, float b) { return a * b; }


x86 assembly (clang, -O0):
<mul_float_cr>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_float_cr>:
shufps $0x0,%xmm1,%xmm1
mulps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @mul_float_cr(<2 x float> %0, float %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca float
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
store float %1, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%10 = load float, float* %9
%11 = load float, float* %5
%12 = fmul float %8, %11
%13 = fmul float %10, %11
%14 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%15 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %12, float* %14
store float %13, float* %15
%16 = bitcast { float, float }* %3 to <2 x float>*
%17 = load <2 x float>, <2 x float>* %16
ret <2 x float> %17
}

LLVM IR (-O2):
define <2 x float> @mul_float_cr(<2 x float> %0, float %1) {
%3 = insertelement <2 x float> poison, float %1, i64 0
%4 = shufflevector <2 x float> %3, <2 x float> poison, <2 x i32> zeroinitializer
%5 = fmul <2 x float> %4, %0
ret <2 x float> %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ eb128_compose_264(int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
bool eb128_less_or_equal_264(const uint64_t alo, const uint64_t ahi,
                             const uint64_t blo, const uint64_t bhi) {
  return eb128_compose_264(alo, ahi) <= eb128_compose_264(blo, bhi);
}


x86 assembly (clang, -O0):
<eb128_less_or_equal_264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb128_less_or_equal_264>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <eb128_compose_264@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <eb128_compose_264@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setle  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eb128_less_or_equal_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i64 @eb128_compose_264(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @eb128_compose_264(i32 %12, i32 %13)
%15 = icmp sle i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @eb128_less_or_equal_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @eb128_compose_264(i32 %0, i32 %1)
%6 = tail call i64 @eb128_compose_264(i32 %2, i32 %3)
%7 = icmp sle i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ printf(char *, char *);
int usage(char **argv) {
  printf("\nUsage:\t%s -q -f config_file program_name [arguments]\n"
         "\t-q makes proxychains quiet - this overrides the config setting\n"
         "\t-f allows to manually specify a configfile to use\n"
         "\tfor example : proxychains telnet somehost.com\n"
         "More help in README file\n\n",
         argv[0]);
  return EXIT_FAILURE;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [243 x i8] c"\0AUsage:\09%s -q -f config_file program_name [arguments]\0A\09-q makes proxychains quiet - this overrides the config setting\0A\09-f allows to manually specify a configfile to use\0A\09for example : proxychains telnet somehost.com\0AMore help in README file\0A\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
ret i32 %7
}

LLVM IR (-O2):
@.str = [243 x i8] c"\0AUsage:\09%s -q -f config_file program_name [arguments]\0A\09-q makes proxychains quiet - this overrides the config setting\0A\09-f allows to manually specify a configfile to use\0A\09for example : proxychains telnet somehost.com\0AMore help in README file\0A\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_init(pthread_mutex_t *__mutex,
                       __const pthread_mutexattr_t *__mutexattr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_init(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void doSleep(int microseconds) { usleep(microseconds); }


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

x86 assembly (clang, -O2):
<doSleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @doSleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _aligned_free(void *);
void vecfree(void *memblock) { _aligned_free(memblock); }


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

x86 assembly (clang, -O2):
<vecfree>:
jmp    1030 <_aligned_free@plt>

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

LLVM IR (-O2):
define void @vecfree(i8* %0) {
%2 = tail call i32 @_aligned_free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t bitScan_fun_uint8_t(uint8_t x) {
  uint32_t r = 8;
  while (x) {
    --r;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bitScan_fun_uint8_t+0x2f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitScan_fun_uint8_t+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_uint8_t>:
mov    $0x8,%eax
test   %edi,%edi
je     111c <bitScan_fun_uint8_t+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitScan_fun_uint8_t+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_uint8_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 8, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, -1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 8, %1 ], [ %6, %3 ]
ret i32 %10
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 1373777115U;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      state[local1] = state[0UL] & state[local1];
      local1++;
    }
    output[0UL] = (state[0UL] << 13U) | (state[0UL] >> 19U);
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x51e22cdb,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jae    1150 <RandomFunc+0x50>
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
and    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
shl    $0xd,%ecx
mov    -0x14(%rbp),%eax
shr    $0x13,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x51e22cdb,%eax
add    (%rdi),%eax
rol    $0xd,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, 1373777115
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %18, %2
%13 = load i32, i32* %6
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = icmp ult i32 %13, %16
br i1 %17, label %18, label %31
18: ; preds = %12
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = and i32 %20, %24
%26 = load i32, i32* %6
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %27
store i32 %25, i32* %28
%29 = load i32, i32* %6
%30 = add i32 %29, 1
store i32 %30, i32* %6
br label %12
31: ; preds = %12
%32 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%33 = load i32, i32* %32
%34 = shl i32 %33, 13
%35 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%36 = load i32, i32* %35
%37 = lshr i32 %36, 19
%38 = or i32 %34, %37
%39 = load i32*, i32** %4
%40 = getelementptr inbounds i32, i32* %39, i64 0
store i32 %38, i32* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 1373777115
%5 = tail call i32 @llvm.fshl.i32(i32 %4, i32 %4, i32 13)
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int do_syscall(int, unsigned int, int, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
int strlen(char const *);
int system(const char *string) {
  int status;
  int error;
  int len = strlen(string) + 1;
  status = do_syscall(14, (unsigned)string, len, 0, 0, &error);
  return status;
}


x86 assembly (clang, -O0):
<system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x14(%rbp),%edx
mov    $0xe,%edi
xor    %r8d,%r8d
lea    -0x10(%rbp),%r9
mov    %r8d,%ecx
call   1040 <do_syscall@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
lea    0xc(%rsp),%r9
mov    $0xe,%edi
mov    %ebx,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <do_syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @system(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = ptrtoint i8* %0 to i64
%7 = trunc i64 %6 to i32
%8 = call i32 @do_syscall(i32 14, i32 %7, i32 %5, i32 0, i32 0, i32* %2)
ret i32 %8
}
/* Variables and functions */
char *memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char string1[15] = "BBBBBBBBBBBBBB";
  printf("string1 = %s\n", string1);
  printf("string1 after memset = %s\n", memset(string1, 'b', 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
lea    -0x13(%rbp),%rdi
mov    $0x62,%esi
mov    $0x7,%edx
call   1040 <memset@plt>
mov    %rax,%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x42424242424242,%rax
mov    %rax,0x7(%rsp)
movabs $0x4242424242424242,%rax
42 42 42
mov    %rax,(%rsp)
lea    0xec6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x7,%edx
call   1040 <memset@plt>
lea    0xeb0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.string1 = [15 x i8] c"BBBBBBBBBBBBBB\00"
@.str = [14 x i8] c"string1 = %s\0A\00"
@.str.1 = [27 x i8] c"string1 after memset = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = bitcast [15 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%7 = call i8* @memset(i8* %6, i8 signext 98, i32 7)
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string1 = [15 x i8] c"BBBBBBBBBBBBBB\00"
@.str = [14 x i8] c"string1 = %s\0A\00"
@.str.1 = [27 x i8] c"string1 after memset = %s\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @memset(i8* %2, i8 signext 98, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ func1();
int main() {
  func1();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
%2 = tail call i32 @exit(i32 0)
unreachable
}
cud(pn) int pn;
{ brc(pn, 'B'); }


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

x86 assembly (clang, -O2):
<cud>:
mov    $0x42,%esi
xor    %eax,%eax
jmp    1030 <brc@plt>

LLVM IR (-O0):
define i32 @cud(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %4, i32 66)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @cud(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %0, i32 66)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lightcount_help() {
  printf("Usage: lightcount IFACE CONFIGFILE\n"
         "Captures IP traffic on the specified interface and stores the "
         "average packet\n"
         "and length counts.\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [133 x i8] c"Usage: lightcount IFACE CONFIGFILE\0ACaptures IP traffic on the specified interface and stores the average packet\0Aand length counts.\0A\0A\00"
define void @lightcount_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [132 x i8] c"Usage: lightcount IFACE CONFIGFILE\0ACaptures IP traffic on the specified interface and stores the average packet\0Aand length counts.\0A\00"
define void @lightcount_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t ft_nbrlen(long nbr, long base) {
  size_t len;
  len = 1;
  if (nbr < 0)
    len++;
  while ((nbr / base) != 0) {
    nbr = nbr / base;
    len++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_nbrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    112b <ft_nbrlen+0x2b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <ft_nbrlen+0x30>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
cmp    $0x0,%rax
je     1163 <ft_nbrlen+0x63>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <ft_nbrlen+0x30>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrlen>:
mov    %rdi,%rax
mov    %rdi,%rcx
shr    $0x3f,%rcx
jmp    111e <ft_nbrlen+0x1e>
nopl   0x0(%rax)
cqto
idiv   %rsi
add    $0x1,%rcx
test   %rax,%rax
je     1130 <ft_nbrlen+0x30>
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
jne    1110 <ft_nbrlen+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <ft_nbrlen+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @ft_nbrlen(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 0
%4 = select i1 %3, i64 2, i64 1
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ %0, %2 ], [ %8, %5 ]
%7 = phi i64 [ %4, %2 ], [ %10, %5 ]
%8 = sdiv i64 %6, %1
%9 = icmp eq i64 %8, 0
%10 = add i64 %7, 1
br i1 %9, label %11, label %5
11: ; preds = %5
ret i64 %7
}
/* Variables and functions */
int GPending();
int MPending() { return GPending(); }


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

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

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

LLVM IR (-O2):
define i32 @MPending() {
%1 = tail call i32 (...) @GPending()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int res;
  printf("val returned by syscall %d\n", res);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"val returned by syscall %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Car_Set(int);
int /*<<< orphan*/ Car_SetAcceleration(int /*<<< orphan*/, int);
void Car_SetCarAcceleration(int carnum, int Acceleration) {
  Car_SetAcceleration(Car_Set(carnum), Acceleration);
}


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

x86 assembly (clang, -O2):
<Car_SetCarAcceleration>:
push   %rbx
mov    %esi,%ebx
call   1030 <Car_Set@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <Car_SetAcceleration@plt>

LLVM IR (-O0):
define void @Car_SetCarAcceleration(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 = call i32 @Car_Set(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @Car_SetAcceleration(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @Car_SetCarAcceleration(i32 %0, i32 %1) {
%3 = tail call i32 @Car_Set(i32 %0)
%4 = tail call i32 @Car_SetAcceleration(i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex16array(void *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 16));
}


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

x86 assembly (clang, -O2):
<popcomplex16array>:
shl    $0x4,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popcomplex16array(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 = mul nsw i32 %6, 16
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popcomplex16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
void *alloca(size_t);
int /*<<< orphan*/ handle_error(char *);
void *Alloca(size_t size) {
  if (size == 0) {
    handle_error("Cannot Alloc a size of 0!");
  }
  void *ptr = alloca(size);
  if (ptr == NULL) {
    handle_error("Error while allocaing");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<Alloca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <Alloca+0x23>
lea    0xed2(%rip),%rdi
call   1030 <handle_error@plt>
mov    -0x8(%rbp),%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <Alloca+0x53>
lea    0xebc(%rip),%rdi
call   1030 <handle_error@plt>
mov    -0x10(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Alloca>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
jne    112a <Alloca+0x1a>
lea    0xedb(%rip),%rdi
call   1030 <handle_error@plt>
mov    %rsp,%rax
add    $0xf,%rbx
and    $0xfffffffffffffff0,%rbx
sub    %rbx,%rax
mov    %rax,%rsp
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Cannot Alloc a size of 0!\00"
@.str.1 = [22 x i8] c"Error while allocaing\00"
define i8* @Alloca(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @handle_error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = alloca i8, i64 %9
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @handle_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [26 x i8] c"Cannot Alloc a size of 0!\00"
define noalias i8* @Alloca(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @handle_error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = alloca i8, i64 %0
ret i8* %6
}
void sk_find_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_find_ex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ perror(char *);
void *qd_calloc(size_t nmemb, size_t size) {
  void *ptr = calloc(nmemb, size);
  if (!ptr && nmemb && size) {
    perror("qd_calloc");
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<qd_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1185 <qd_calloc+0x55>
cmpq   $0x0,-0x8(%rbp)
je     1185 <qd_calloc+0x55>
cmpq   $0x0,-0x10(%rbp)
je     1185 <qd_calloc+0x55>
lea    0xe87(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <calloc@plt>
test   %rbx,%rbx
je     114e <qd_calloc+0x1e>
test   %r14,%r14
je     114e <qd_calloc+0x1e>
test   %rax,%rax
je     1156 <qd_calloc+0x26>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xea3(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"qd_calloc\00"
define noalias i8* @qd_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = and i1 %5, %4
%7 = icmp ne i64 %1, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %2
ret i8* %3
}
char *alloc(n)
unsigned int n;
{
  char *p;
  p = (char *)xcalloc(n, 1);
  return (p);
}


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

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

LLVM IR (-O0):
define i8* @alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @xcalloc to i32 (i32, i32, ...)*)(i32 %4, i32 1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @alloc(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @xcalloc to i32 (i32, i32, ...)*)(i32 %0, i32 1)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void endpoints(i, j) int *i;
int *j;
{
  *i = trist_org(alf_ml_face());
  *j = trist_dest(alf_ml_face());
}


x86 assembly (clang, -O0):
<endpoints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <alf_ml_face@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1050 <trist_org@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <alf_ml_face@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <trist_dest@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endpoints>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <alf_ml_face@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1050 <trist_org@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <alf_ml_face@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <trist_dest@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @endpoints(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 (...) @alf_ml_face()
%6 = call i32 (i32, ...) bitcast (i32 (...)* @trist_org to i32 (i32, ...)*)(i32 %5)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = call i32 (...) @alf_ml_face()
%9 = call i32 (i32, ...) bitcast (i32 (...)* @trist_dest to i32 (i32, ...)*)(i32 %8)
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @endpoints(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 (...) @alf_ml_face()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @trist_org to i32 (i32, ...)*)(i32 %3)
store i32 %4, i32* %0
%5 = tail call i32 (...) @alf_ml_face()
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @trist_dest to i32 (i32, ...)*)(i32 %5)
store i32 %6, i32* %1
ret void
}