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

/* Variables and functions */
int /*<<< orphan*/ SIGIO;
int /*<<< orphan*/ SIG_BLOCK;
int sigismember(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int CheckBlocked() {
  sigset_t mask;
  sigprocmask(SIG_BLOCK, NULL, &mask);
  return sigismember(&mask, SIGIO);
}


x86 assembly (clang, -O0):
<CheckBlocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x4(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1040 <sigismember@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckBlocked>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rbx
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <sigprocmask@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <sigismember@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@SIGIO = global i32 0
define i32 @CheckBlocked() {
%1 = alloca i32
%2 = load i32, i32* @SIG_BLOCK
%3 = call i32 @sigprocmask(i32 %2, i32* null, i32* %1)
%4 = load i32, i32* @SIGIO
%5 = call i32 @sigismember(i32* %1, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@SIGIO = global i32 0
define i32 @CheckBlocked() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @SIG_BLOCK
%4 = call i32 @sigprocmask(i32 %3, i32* null, i32* %1)
%5 = load i32, i32* @SIGIO
%6 = call i32 @sigismember(i32* %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test7();
int main(void) { test7(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test7@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test7()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test7()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_kernel_heap();
int mem_heap_free(int /*<<< orphan*/, void *, int);
int kheap_free(void *addr, int count) {
  return mem_heap_free(get_kernel_heap(), addr, count);
}


x86 assembly (clang, -O0):
<kheap_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <get_kernel_heap@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <mem_heap_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kheap_free>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_kernel_heap@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mem_heap_free@plt>

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

LLVM IR (-O2):
define i32 @kheap_free(i8* %0, i32 %1) {
%3 = tail call i32 (...) @get_kernel_heap()
%4 = tail call i32 @mem_heap_free(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ write(int, char *, int /*<<< orphan*/);
int FXPrint(int sock, char *string) {
  signed short returnVal;
  if (write(sock, string, strlen(string)) < 0) {
    returnVal = 0;
  } else {
    returnVal = -1;
  }
  return returnVal;
}


x86 assembly (clang, -O0):
<FXPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1169 <FXPrint+0x49>
movw   $0x0,-0x12(%rbp)
jmp    116f <FXPrint+0x4f>
movw   $0xffff,-0x12(%rbp)
movswl -0x12(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FXPrint>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
sar    $0x3f,%rax
not    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @FXPrint(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i16
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @write(i32 %6, i8* %7, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i16 0, i16* %5
br label %14
13: ; preds = %2
store i16 -1, i16* %5
br label %14
14: ; preds = %13, %12
%15 = load i16, i16* %5
%16 = sext i16 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @FXPrint(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @write(i32 %0, i8* %1, i32 %3)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, -1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int get_key(int /*<<< orphan*/ *, int, int, int, unsigned char *);
int get_RSA2048_D(FILE *fp, int *key_off, int *key_name_off,
                  unsigned char *RSA2048_D) {
  return get_key(fp, key_off[2] + 5, key_name_off[3], 256, RSA2048_D);
}


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

x86 assembly (clang, -O2):
<get_RSA2048_D>:
mov    %rcx,%r8
mov    0x8(%rsi),%esi
add    $0x5,%esi
mov    0xc(%rdx),%edx
mov    $0x100,%ecx
jmp    1030 <get_key@plt>

LLVM IR (-O0):
define i32 @get_RSA2048_D(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 5
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = load i32, i32* %15
%17 = load i8*, i8** %8
%18 = call i32 @get_key(i32* %9, i32 %13, i32 %16, i32 256, i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_RSA2048_D(i32* %0, i32* nocapture %1, i32* nocapture %2, i8* %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 5
%8 = getelementptr inbounds i32, i32* %2, i64 3
%9 = load i32, i32* %8
%10 = tail call i32 @get_key(i32* %0, i32 %7, i32 %9, i32 256, i8* %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ test2(int);
int main(int argc, char *argv[]) { test2(1); }


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

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

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

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

/* Variables and functions */
void write32bitLE(int32_t value, unsigned char *buf) {
  int i;
  uint32_t v = (uint32_t)value;
  for (i = 0; i < 4; i++) {
    buf[i] = v & 0xff;
    v >>= 8;
  }
}


x86 assembly (clang, -O0):
<write32bitLE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    114e <write32bitLE+0x4e>
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <write32bitLE+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32bitLE>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @write32bitLE(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ opal_output(int /*<<< orphan*/, char *, char *);
char *get_local_hostname() {
  char *host = (char *)malloc(1024);
  host[1023] = '\0';
  gethostname(host, 1023);
  opal_output(0, "get host name: %s.\n", host);
  return host;
}


x86 assembly (clang, -O0):
<get_local_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3ff(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x3ff,%esi
call   1050 <gethostname@plt>
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
lea    0xe94(%rip),%rsi
call   1030 <opal_output@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_local_hostname>:
push   %rbx
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,0x3ff(%rax)
mov    %rax,%rdi
mov    $0x3ff,%esi
call   1050 <gethostname@plt>
lea    0xea7(%rip),%rsi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <opal_output@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"get host name: %s.\0A\00"
define i8* @get_local_hostname() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 1024)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1023
store i8 0, i8* %5
%6 = load i8*, i8** %1
%7 = call i32 @gethostname(i8* %6, i32 1023)
%8 = load i8*, i8** %1
%9 = call i32 @opal_output(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"get host name: %s.\0A\00"
define i8* @get_local_hostname() {
%1 = tail call i64 @malloc(i32 1024)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1023
store i8 0, i8* %3
%4 = tail call i32 @gethostname(i8* %2, i32 1023)
%5 = tail call i32 @opal_output(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int errno;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fd = open("/dev/xxx", O_RDONLY);
  printf("%d\n", errno);
  return fd;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ebx
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/xxx\00"
@O_RDONLY = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* @errno
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/xxx\00"
@O_RDONLY = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @errno
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void func4() { print("func4 "); }


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

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

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

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

/* Variables and functions */
scalar_t__ lseek64(int, int /*<<< orphan*/, int);
int mt_lseek(int fd, off_t where, int whence) {
  return lseek64(fd, where, whence) >= 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<mt_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <lseek64@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovge %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_lseek>:
push   %rax
call   1030 <lseek64@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mt_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @lseek64(i32 %7, i32 %8, i32 %9)
%11 = icmp sge i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @mt_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @lseek64(i32 %0, i32 %1, i32 %2)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
const unsigned long long clock_tic__() {
  unsigned int a, d;
  asm volatile("rdtsc" : "=a"(a), "=d"(d));
  return ((unsigned long long)a) | (((unsigned long long)d) << 32);
}


x86 assembly (clang, -O0):
<clock_tic__>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_tic__>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @clock_tic__() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @clock_tic__() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
void chaz_ConfWriterPerl_add_typedef(const char *type, const char *alias) {
  (void)type;
  (void)alias;
}


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

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

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

LLVM IR (-O2):
define void @chaz_ConfWriterPerl_add_typedef(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void hw_enable_backlight(void) {}


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

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

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

LLVM IR (-O2):
define void @hw_enable_backlight() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sdsfree(void *);
void sdsDictKeyDestructor(void *privdata, void *val) {
  ((void)privdata);
  sdsfree(val);
}


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

x86 assembly (clang, -O2):
<sdsDictKeyDestructor>:
mov    %rsi,%rdi
jmp    1030 <sdsfree@plt>

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

LLVM IR (-O2):
define void @sdsDictKeyDestructor(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @sdsfree(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_msg(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xalloc(size_t size) {
  void *result = malloc(size);
  if (!result) {
    log_msg(LOG_ERR, "malloc failed: %s", strerror(errno));
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<xalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1199 <xalloc+0x59>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe76(%rip),%rsi
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc>:
push   %rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     114d <xalloc+0xd>
pop    %rbx
ret
mov    0x2e7c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [18 x i8] c"malloc failed: %s\00"
@errno = global i32 0
define i8* @xalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @LOG_ERR
%10 = load i32, i32* @errno
%11 = call i32 @strerror(i32 %10)
%12 = call i32 @log_msg(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [18 x i8] c"malloc failed: %s\00"
@errno = global i32 0
define noalias i8* @xalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @LOG_ERR
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @log_msg(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int bar_ptr(int);
int foo(int n) {
  int i, x;
  for (i = 0; i < n; i++)
    x = bar_ptr(i);
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1147 <foo+0x37>
mov    -0x8(%rbp),%edi
call   1030 <bar_ptr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <foo+0x12>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
jle    1135 <foo+0x25>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <bar_ptr@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @bar_ptr(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = phi i32 [ undef, %1 ], [ %5, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_si128(int /*<<< orphan*/ *, int /*<<< orphan*/);
extern __attribute__((__gnu___, __always___, __artificial__)) int64_t
_MM_EXTRACT_EPI64_32(__m128i val, const int LANE) {
  __attribute__((aligned(16))) int64_t tmp[2];
  _mm_store_si128((__m128i *)tmp, val);
  return tmp[LANE];
}


x86 assembly (clang, -O0):
<_MM_EXTRACT_EPI64_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <_mm_store_si128@plt>
movslq -0x8(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MM_EXTRACT_EPI64_32>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%esi
mov    %rsp,%rdi
call   1030 <_mm_store_si128@plt>
movslq %ebx,%rax
mov    (%rsp,%rax,4),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_MM_EXTRACT_EPI64_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @_mm_store_si128(i32* %6, i32 %7)
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %10
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_MM_EXTRACT_EPI64_32(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @_mm_store_si128(i32* %5, i32 %0)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
int search_index(int *filtered_indel_pos, int num, int pos) {
  int i;
  int ret = 0;
  for (i = 0; i < num; i++) {
    if (filtered_indel_pos[i] == pos) {
      ret = 1;
      break;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<search_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <search_index+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    1148 <search_index+0x48>
movl   $0x1,-0x18(%rbp)
jmp    115b <search_index+0x5b>
jmp    114d <search_index+0x4d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <search_index+0x1c>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_index>:
test   %esi,%esi
jle    111e <search_index+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <search_index+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <search_index+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @search_index(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %7, %9, %3
%16 = phi i32 [ 0, %3 ], [ 1, %9 ], [ 0, %7 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void __byte_memcpy(uint8_t *restrict dest, const uint8_t *restrict src,
                   size_t n) {
  while (n--)
    *dest++ = *src++;
}


x86 assembly (clang, -O0):
<__byte_memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1150 <__byte_memcpy+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    1110 <__byte_memcpy+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_memcpy>:
test   %rdx,%rdx
je     1123 <__byte_memcpy+0x13>
push   %rax
shl    $0x2,%rdx
call   1030 <memcpy@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @__byte_memcpy(i32* noalias nocapture writeonly %0, i32* noalias nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %0 to i8*
%8 = shl nuw i64 %2, 2
br label %9
9: ; preds = %5, %3
ret void
}
int computePosition(int xCoordinate, int yCoordinate) {
  return ((xCoordinate) + (80 * yCoordinate)) * 2;
}


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

x86 assembly (clang, -O2):
<computePosition>:
lea    (%rsi,%rsi,4),%eax
shl    $0x4,%eax
add    %edi,%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @computePosition(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 = mul nsw i32 80, %6
%8 = add nsw i32 %5, %7
%9 = mul nsw i32 %8, 2
ret i32 %9
}

LLVM IR (-O2):
define i32 @computePosition(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 80
%4 = add nsw i32 %3, %0
%5 = shl nsw i32 %4, 1
ret i32 %5
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
uint16_t GET_LIBRARY_ORDINAL(uint16_t n_desc) {
  return (((n_desc) >> 8u) & 0xffu);
}


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

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

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

LLVM IR (-O2):
define i32 @GET_LIBRARY_ORDINAL(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DelayUs(char const);
void i2cdelay(const char delay) { DelayUs(delay); }


x86 assembly (clang, -O0):
<i2cdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <DelayUs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cdelay>:
jmp    1030 <DelayUs@plt>

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

LLVM IR (-O2):
define void @i2cdelay(i8 signext %0) {
%2 = tail call i32 @DelayUs(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checaNumero();
main() { checaNumero(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <checaNumero@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @checaNumero()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @checaNumero()
ret i32 0
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_epoll_ctl;
int syscall(int /*<<< orphan*/, int, int, int, struct epoll_event *);
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) {
  return (syscall(__NR_epoll_ctl, epfd, op, fd, event));
}


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

x86 assembly (clang, -O2):
<epoll_ctl>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
@__NR_epoll_ctl = global i32 0
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.epoll_event*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.epoll_event* %3, %struct.epoll_event** %8
%9 = load i32, i32* @__NR_epoll_ctl
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load %struct.epoll_event*, %struct.epoll_event** %8
%14 = call i32 @syscall(i32 %9, i32 %10, i32 %11, i32 %12, %struct.epoll_event* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
@__NR_epoll_ctl = global i32 0
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = load i32, i32* @__NR_epoll_ctl
%6 = tail call i32 @syscall(i32 %5, i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3)
ret i32 %6
}
/* Variables and functions */
unsigned int get_nprocs();
unsigned int get_cpu_num(void) { return get_nprocs(); }


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

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

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

LLVM IR (-O2):
define i32 @get_cpu_num() {
%1 = tail call i32 (...) @get_nprocs()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ symmetrize_piece(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void symmetrize_piece_ncp(uint8_t *piece) { symmetrize_piece(piece, piece); }


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

x86 assembly (clang, -O2):
<symmetrize_piece_ncp>:
mov    %rdi,%rsi
jmp    1030 <symmetrize_piece@plt>

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

LLVM IR (-O2):
define void @symmetrize_piece_ncp(i32* %0) {
%2 = tail call i32 @symmetrize_piece(i32* %0, i32* %0)
ret void
}
unsigned xrop3_228_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_228_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_228_1_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %eax,%ecx
mov    %esi,%eax
xor    %dil,%al
movzbl %al,%eax
not    %ecx
and    %eax,%ecx
or     %dil,%sil
movzbl %sil,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_228_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_228_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i8 %1, %0
%8 = zext i8 %7 to i32
%9 = or i32 %6, %4
%10 = xor i32 %9, -1
%11 = and i32 %10, %8
%12 = or i8 %1, %0
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}
unsigned int _pack2(unsigned int src1, unsigned int src2) {
  short s1[2], s2[2], r[2];
  int result;
  *((int *)s1) = src1;
  *((int *)s2) = src2;
  r[0] = s2[0];
  r[1] = s1[0];
  result = *(int *)r;
  return result;
}


x86 assembly (clang, -O0):
<_pack2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ax
mov    %ax,-0x14(%rbp)
mov    -0xc(%rbp),%ax
mov    %ax,-0x12(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pack2>:
shl    $0x10,%edi
movzwl %si,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_pack2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i16]
%6 = alloca [2 x i16]
%7 = alloca [2 x i16]
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%11 = bitcast i16* %10 to i32*
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%14 = bitcast i16* %13 to i32*
store i32 %12, i32* %14
%15 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%16 = load i16, i16* %15
%17 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 0
store i16 %16, i16* %17
%18 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%19 = load i16, i16* %18
%20 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 1
store i16 %19, i16* %20
%21 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 0
%22 = bitcast i16* %21 to i32*
%23 = load i32, i32* %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
ret i32 %24
}

LLVM IR (-O2):
define i32 @_pack2(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = and i32 %1, 65535
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert((1, 2) * 2 == 4);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rotate(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char str[100];
  scanf("%s", str);
  int n;
  scanf("%d", &n);
  rotate(str, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
call   1030 <rotate@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xed1(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <rotate@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @rotate(i8* %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = bitcast i32* %2 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @rotate(i8* %3, i32 %7)
ret i32 0
}
void do_fldl2t(void *p) {
  asm __volatile__("fninit");
  asm __volatile__("fldl2t");
  asm __volatile__("fstpl (%0)" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<do_fldl2t>:
fninit
fldl2t
fstpl  (%rdi)
ret

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

LLVM IR (-O2):
define void @do_fldl2t(i8* %0) {
tail call void asm sideeffect "fninit", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fldl2t", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fstpl ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
char decode_char(char);
void decode_str(char *s, int sn) {
  int i;
  for (i = 0; i < sn; i++) {
    s[i] = decode_char(s[i]);
  }
}


x86 assembly (clang, -O0):
<decode_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <decode_str+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <decode_char@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <decode_str+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_str>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <decode_str+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <decode_char@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <decode_str+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @decode_str(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @decode_char(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void sp_end_contour_out() {}


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

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

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

LLVM IR (-O2):
define void @sp_end_contour_out() {
ret void
}
int strlen2(char *s) {
  char *p = s;
  while (*p != '\0')
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen2+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen2+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen2>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen2+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen2(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}