xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int read(int, void *, int);
int urandom_read(void *buffer, int sz) {
  static int fd_urandom = -1;
  if (fd_urandom == -1)
    fd_urandom = open("/dev/urandom", O_RDONLY);
  return read(fd_urandom, buffer, sz);
}


x86 assembly (clang, -O0):
<urandom_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,0x2efa(%rip)
jne    1157 <urandom_read+0x37>
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1040 <open@plt>
mov    %eax,0x2ed9(%rip)
mov    0x2ed3(%rip),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<urandom_read>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2f02(%rip),%edi
cmp    $0xffffffff,%edi
jne    1150 <urandom_read+0x30>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
mov    %eax,0x2ee0(%rip)
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <read@plt>

LLVM IR (-O0):
@urandom_read.fd_urandom = internal global i32 -1
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @urandom_read(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @urandom_read.fd_urandom
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @O_RDONLY
%9 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* @urandom_read.fd_urandom
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* @urandom_read.fd_urandom
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @read(i32 %11, i8* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@urandom_read.fd_urandom = internal unnamed_addr global i32 -1
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @urandom_read(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @urandom_read.fd_urandom
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @O_RDONLY
%7 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* @urandom_read.fd_urandom
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ %7, %5 ], [ %3, %2 ]
%10 = tail call i32 @read(i32 %9, i8* %0, i32 %1)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ print_z();
int main(void) {
  print_z();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_z()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIZE_MAX;
char *strncpy(char *, char const *, int /*<<< orphan*/);
char *strcpy(char *dst, const char *src) { return strncpy(dst, src, SIZE_MAX); }


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@SIZE_MAX = global i32 0
define i8* @strcpy(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 = load i32, i32* @SIZE_MAX
%8 = call i8* @strncpy(i8* %5, i8* %6, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i8* @strcpy(i8* %0, i8* %1) {
%3 = load i32, i32* @SIZE_MAX
%4 = tail call i8* @strncpy(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
int f2(void) {
  const int x = sizeof(char) - 1;
  return 1 / x;
}


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

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

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

LLVM IR (-O2):
define i32 @f2() {
ret i32 poison
}
struct pthread *__pthread_self() {
  struct pthread *self;
  __asm__ __volatile__("movq %%fs:0,%0" : "=r"(self));
  return self;
}


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

x86 assembly (clang, -O2):
<__pthread_self>:
mov    %fs:0x0,%rax
ret

LLVM IR (-O0):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = alloca %struct.pthread*
%2 = call %struct.pthread* asm sideeffect "movq %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store %struct.pthread* %2, %struct.pthread** %1
%3 = load %struct.pthread*, %struct.pthread** %1
ret %struct.pthread* %3
}

LLVM IR (-O2):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = tail call %struct.pthread* asm sideeffect "movq %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret %struct.pthread* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ PROXY_CERT_INFO_EXTENSION;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ PROXY_CERT_INFO_EXTENSION_it;
PROXY_CERT_INFO_EXTENSION *
d2i_PROXY_CERT_INFO_EXTENSION(PROXY_CERT_INFO_EXTENSION **a,
                              const unsigned char **in, long len) {
  return (PROXY_CERT_INFO_EXTENSION *)ASN1_item_d2i(
      (ASN1_VALUE **)a, in, len, &PROXY_CERT_INFO_EXTENSION_it);
}


x86 assembly (clang, -O0):
<d2i_PROXY_CERT_INFO_EXTENSION>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_PROXY_CERT_INFO_EXTENSION>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@PROXY_CERT_INFO_EXTENSION_it = global i32 0
define i32* @d2i_PROXY_CERT_INFO_EXTENSION(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @PROXY_CERT_INFO_EXTENSION_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@PROXY_CERT_INFO_EXTENSION_it = global i32 0
define i32* @d2i_PROXY_CERT_INFO_EXTENSION(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @PROXY_CERT_INFO_EXTENSION_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ CMOS_WRITE(int /*<<< orphan*/, int);
int /*<<< orphan*/ flush_tlb_local();
scalar_t__ maddr_to_virt(int);
void smpboot_restore_warm_reset_vector(void) {
  flush_tlb_local();
  CMOS_WRITE(0, 0xf);
  *((volatile int *)maddr_to_virt(0x467)) = 0;
}


x86 assembly (clang, -O0):
<smpboot_restore_warm_reset_vector>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <flush_tlb_local@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1030 <CMOS_WRITE@plt>
mov    $0x467,%edi
call   1050 <maddr_to_virt@plt>
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpboot_restore_warm_reset_vector>:
push   %rax
xor    %eax,%eax
call   1040 <flush_tlb_local@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1030 <CMOS_WRITE@plt>
mov    $0x467,%edi
call   1050 <maddr_to_virt@plt>
movl   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @smpboot_restore_warm_reset_vector() {
%1 = call i32 (...) @flush_tlb_local()
%2 = call i32 @CMOS_WRITE(i32 0, i32 15)
%3 = call i64 @maddr_to_virt(i32 1127)
%4 = inttoptr i64 %3 to i32*
store volatile i32 0, i32* %4
ret void
}

LLVM IR (-O2):
define void @smpboot_restore_warm_reset_vector() {
%1 = tail call i32 (...) @flush_tlb_local()
%2 = tail call i32 @CMOS_WRITE(i32 0, i32 15)
%3 = tail call i64 @maddr_to_virt(i32 1127)
%4 = inttoptr i64 %3 to i32*
store volatile i32 0, i32* %4
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
int lastSpace(char *tocut) {
  char *lastSpace;
  lastSpace = strrchr(tocut, ' ');
  if (lastSpace) {
    return (int)(lastSpace - tocut);
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<lastSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <lastSpace+0x3c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1153 <lastSpace+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastSpace>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%esi
call   1030 <strrchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @lastSpace(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 32)
%3 = icmp eq i8* %2, null
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = select i1 %3, i32 -1, i32 %7
ret i32 %8
}
int nextMultiple(int i, unsigned m) { return (i + m - 1) / m * m; }


x86 assembly (clang, -O0):
<nextMultiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextMultiple>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nextMultiple(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 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @nextMultiple(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = urem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test();
int main() {
  test();
  puts("Hello World!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void PrintthoseInts(int vals[], int size) {
  for (int i = 0; i < size; ++i) {
    printf("%d\n", vals[i]);
  }
}


x86 assembly (clang, -O0):
<PrintthoseInts>:
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    1157 <PrintthoseInts+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <PrintthoseInts+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintthoseInts>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <PrintthoseInts+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <PrintthoseInts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @PrintthoseInts(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool eth_addr_is_broadcast(const uint8_t ea[6]) {
  return (ea[0] & ea[1] & ea[2] & ea[3] & ea[4] & ea[5]) == 0xff;
}


x86 assembly (clang, -O0):
<eth_addr_is_broadcast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
and    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0xc(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0x10(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0x14(%rcx),%eax
cmp    $0xff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_addr_is_broadcast>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
pand   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pand   %xmm1,%xmm0
movd   %xmm0,%ecx
and    0x10(%rdi),%ecx
and    0x14(%rdi),%ecx
xor    %eax,%eax
cmp    $0xff,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @eth_addr_is_broadcast(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 5
%7 = load i32, i32* %6
%8 = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> %3)
%9 = and i32 %8, %5
%10 = and i32 %9, %7
%11 = icmp eq i32 %10, 255
%12 = zext i1 %11 to i32
ret i32 %12
}
void sched_idle_loop(void) {
  while (1)
    asm("hlt");
}


x86 assembly (clang, -O0):
<sched_idle_loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <sched_idle_loop+0x9>
hlt
jmp    1109 <sched_idle_loop+0x9>

x86 assembly (clang, -O2):
<sched_idle_loop>:
hlt
jmp    1100 <sched_idle_loop>

LLVM IR (-O0):
define void @sched_idle_loop() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @sched_idle_loop() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
void genbgezall_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbgezall_idle() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t ld_i8_le(const void *x) { return ((int8_t *)x)[0]; }


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

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

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

LLVM IR (-O2):
define i32 @ld_i8_le(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_8Bint8_mem(signed char *val) {
  return ((*val) & (-0x8B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Bint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff75,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -139
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
struct Crypto1State {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Crypto1State *);
void crypto1_destroy(struct Crypto1State *state) { free(state); }


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

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

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

LLVM IR (-O2):
%struct.Crypto1State = type { i32 }
define void @crypto1_destroy(%struct.Crypto1State* nocapture %0) {
%2 = tail call i32 @free(%struct.Crypto1State* %0)
ret void
}
void pftrace(const char *msg, ...) {}


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

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

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

LLVM IR (-O2):
define void @pftrace(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ search(int, int /*<<< orphan*/);
doelse() { search(4, 0); }


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

x86 assembly (clang, -O2):
<doelse>:
mov    $0x4,%edi
xor    %esi,%esi
jmp    1030 <search@plt>

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

LLVM IR (-O2):
define i32 @doelse() {
%1 = tail call i32 @search(i32 4, i32 0)
ret i32 undef
}
unsigned int weather_get_int_humid() { return 88; }


x86 assembly (clang, -O0):
<weather_get_int_humid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @weather_get_int_humid() {
ret i32 88
}

LLVM IR (-O2):
define i32 @weather_get_int_humid() {
ret i32 88
}
/* Variables and functions */
int /*<<< orphan*/ rdtsc_markerClose();
void cere_markerClose() { rdtsc_markerClose(); }


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

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

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

LLVM IR (-O2):
define void @cere_markerClose() {
%1 = tail call i32 (...) @rdtsc_markerClose()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(int n) {
  for (int i = 0; i < n; ++i) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<indent>:
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    1148 <indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <indent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *GeraArquivoSaida() {
  FILE *arqSaida = fopen("SAIDA.txt", "w");
  return arqSaida;
}


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

x86 assembly (clang, -O2):
<GeraArquivoSaida>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"SAIDA.txt\00"
@.str.1 = [2 x i8] c"w\00"
define i32* @GeraArquivoSaida() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
ret i32* %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"SAIDA.txt\00"
@.str.1 = [2 x i8] c"w\00"
define noalias i32* @GeraArquivoSaida() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}
int roundInt(float number) {
  float ret = (number >= 0.0f) ? (number + 0.5f) : (number - 0.5f);
  return (int)ret;
}


x86 assembly (clang, -O0):
<roundInt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <roundInt+0x31>
movss  0xede(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1147 <roundInt+0x47>
movss  -0x4(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundInt>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
lea    0xeee(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @roundInt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = fadd float %7, 5.000000e-01
br label %12
9: ; preds = %1
%10 = load float, float* %2
%11 = fsub float %10, 5.000000e-01
br label %12
12: ; preds = %9, %6
%13 = phi float [ %8, %6 ], [ %11, %9 ]
store float %13, float* %3
%14 = load float, float* %3
%15 = fptosi float %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @roundInt(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 5.000000e-01, float -5.000000e-01
%4 = fadd float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
void gdk_free_compound_text() {}


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

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

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

LLVM IR (-O2):
define void @gdk_free_compound_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void xalloc_fail(void) {
  fprintf(stderr, "[ERROR] Memory exhausted");
  exit(-1);
}


x86 assembly (clang, -O0):
<xalloc_fail>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xalloc_fail>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"[ERROR] Memory exhausted\00"
define void @xalloc_fail() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"[ERROR] Memory exhausted\00"
define void @xalloc_fail() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ConvertString(char *);
char *ScanBbl(char *);
char *getBraceParam();
int /*<<< orphan*/ safe_free(char *);
void CmdBibEntry(int code) {
  char *key, *s;
  key = getBraceParam();
  s = ScanBbl(key);
  if (s) {
    ConvertString(s);
    safe_free(s);
  }
  safe_free(key);
}


x86 assembly (clang, -O0):
<CmdBibEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ScanBbl@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1180 <CmdBibEntry+0x40>
mov    -0x18(%rbp),%rdi
call   1050 <ConvertString@plt>
mov    -0x18(%rbp),%rdi
call   1060 <safe_free@plt>
mov    -0x10(%rbp),%rdi
call   1060 <safe_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdBibEntry>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <ScanBbl@plt>
test   %rax,%rax
je     116e <CmdBibEntry+0x2e>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <ConvertString@plt>
mov    %rbx,%rdi
call   1060 <safe_free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <safe_free@plt>

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

LLVM IR (-O2):
define void @CmdBibEntry(i32 %0) {
%2 = tail call i8* (...) @getBraceParam()
%3 = tail call i8* @ScanBbl(i8* %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @ConvertString(i8* %3)
%7 = tail call i32 @safe_free(i8* %3)
br label %8
8: ; preds = %5, %1
%9 = tail call i32 @safe_free(i8* %2)
ret void
}
void DAC_escribeTxRAM(int dato) {
  *((volatile unsigned short *)(0x10000000 + 0x00B0)) = 0x00;
  *((volatile unsigned short *)(0x10000000 + 0x00B4)) = dato << 1;
}


x86 assembly (clang, -O0):
<DAC_escribeTxRAM>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x100000b0,%eax
movw   $0x0,(%rax)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %ax,%cx
mov    $0x100000b4,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DAC_escribeTxRAM>:
movw   $0x0,0x100000b0
add    %edi,%edi
mov    %di,0x100000b4
10
ret

LLVM IR (-O0):
define void @DAC_escribeTxRAM(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i16 0, i16* inttoptr (i64 268435632 to i16*)
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = trunc i32 %4 to i16
store volatile i16 %5, i16* inttoptr (i64 268435636 to i16*)
ret void
}

LLVM IR (-O2):
define void @DAC_escribeTxRAM(i32 %0) {
store volatile i16 0, i16* inttoptr (i64 268435632 to i16*)
%2 = trunc i32 %0 to i16
%3 = shl i16 %2, 1
store volatile i16 %3, i16* inttoptr (i64 268435636 to i16*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello from pthreadpool!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"hello from pthreadpool!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *_s2_f2cstr(char *, long);
int /*<<< orphan*/ free(char *);
int s2opendo(char *);
int s2opend_(char *device, long int devlen) {
  char *tdev = _s2_f2cstr(device, devlen);
  int result = s2opendo(tdev);
  free(tdev);
  return (result);
}


x86 assembly (clang, -O0):
<s2opend_>:
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   1050 <_s2_f2cstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <s2opendo@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2opend_>:
push   %rbp
push   %rbx
push   %rax
call   1050 <_s2_f2cstr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <s2opendo@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @s2opend_(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i8* @_s2_f2cstr(i8* %7, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @s2opendo(i8* %10)
store i32 %11, i32* %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @s2opend_(i8* %0, i64 %1) {
%3 = tail call i8* @_s2_f2cstr(i8* %0, i64 %1)
%4 = tail call i32 @s2opendo(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int getSize(float *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  float array[20];
  printf("The number of bytes in the array is %d"
         "\nThe number of bytes returned by getSize is %d\n",
         sizeof(array), getSize(array));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1040 <getSize@plt>
lea    0xecd(%rip),%rdi
mov    $0x50,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [86 x i8] c"The number of bytes in the array is %d\0AThe number of bytes returned by getSize is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x float]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x float], [20 x float]* %2, i64 0, i64 0
%4 = call i32 @getSize(float* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 80, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [86 x i8] c"The number of bytes in the array is %d\0AThe number of bytes returned by getSize is %d\0A\00"
define i32 @main() {
%1 = alloca [20 x float]
%2 = bitcast [20 x float]* %1 to i8*
%3 = getelementptr inbounds [20 x float], [20 x float]* %1, i64 0, i64 0
%4 = call i32 @getSize(float* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 80, i32 %4)
ret i32 0
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Writestr(int, struct ship *, char const *);
void send_move(struct ship *ship, const char *astr) {
  Writestr(13, ship, astr);
}


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

x86 assembly (clang, -O2):
<send_move>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xd,%edi
jmp    1030 <Writestr@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_move(%struct.ship* %0, i8* %1) {
%3 = alloca %struct.ship*
%4 = alloca i8*
store %struct.ship* %0, %struct.ship** %3
store i8* %1, i8** %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i8*, i8** %4
%7 = call i32 @Writestr(i32 13, %struct.ship* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_move(%struct.ship* %0, i8* %1) {
%3 = tail call i32 @Writestr(i32 13, %struct.ship* %0, i8* %1)
ret void
}
int mc_xtea_enclen(int len) {
  int blocks = len >> 3;
  return (blocks << 3) + 8;
}


x86 assembly (clang, -O0):
<mc_xtea_enclen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
add    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_xtea_enclen>:
lea    0x8(%rdi),%eax
and    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @mc_xtea_enclen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 3
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = add nsw i32 %7, 8
ret i32 %8
}

LLVM IR (-O2):
define i32 @mc_xtea_enclen(i32 %0) {
%2 = add i32 %0, 8
%3 = and i32 %2, -8
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_get_str(char *, int, int /*<<< orphan*/);
size_t strlen(int /*<<< orphan*/);
size_t mpz_length(mpz_t a) {
  static char str[1000];
  return strlen(mpz_get_str(str, 10, a));
}


x86 assembly (clang, -O0):
<mpz_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f0b(%rip),%rdi
mov    $0xa,%esi
call   1040 <mpz_get_str@plt>
mov    %eax,%edi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_length>:
push   %rax
mov    %edi,%edx
lea    0x2f16(%rip),%rdi
mov    $0xa,%esi
call   1040 <mpz_get_str@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@mpz_length.str = internal global [1000 x i8] zeroinitializer
define i64 @mpz_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mpz_get_str(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @mpz_length.str, i64 0, i64 0), i32 10, i32 %3)
%5 = call i64 @strlen(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
@mpz_length.str = internal global [1000 x i8] zeroinitializer
define i64 @mpz_length(i32 %0) {
%2 = tail call i32 @mpz_get_str(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @mpz_length.str, i64 0, i64 0), i32 10, i32 %0)
%3 = tail call i64 @strlen(i32 %2)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t oscEndian_i(const int32_t x) {
  int32_t ret;
  int size = sizeof(int32_t);
  char *src = (char *)&x + sizeof(int32_t) - 1;
  char *dst = (char *)&ret;
  while (size-- > 0) {
    *dst++ = *src--;
  }
  return ret;
}


x86 assembly (clang, -O0):
<oscEndian_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
lea    -0x4(%rbp),%rax
add    $0x4,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1161 <oscEndian_i+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1126 <oscEndian_i+0x26>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @oscEndian_i(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void cycles_term() {}


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

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

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

LLVM IR (-O2):
define void @cycles_term() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sub_heapify(int *, int, int);
void heapify(int *ptr, int now, int last) {
  if (now >= last / 2 || now < 0)
    return;
  sub_heapify(ptr, now, last);
  heapify(ptr, now - 1, last);
  return;
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    115a <heapify+0x3a>
cmpl   $0x0,-0xc(%rbp)
jge    115f <heapify+0x3f>
jmp    1180 <heapify+0x60>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <sub_heapify@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <heapify@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%eax
shr    $0x1f,%eax
add    %edx,%eax
sar    %eax
cmp    %esi,%eax
jle    1141 <heapify+0x31>
mov    %esi,%ebp
test   %esi,%esi
js     1141 <heapify+0x31>
mov    %edx,%ebx
mov    %rdi,%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <sub_heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <heapify+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heapify(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* %5
%8 = load i32, i32* %6
%9 = sdiv i32 %8, 2
%10 = icmp sge i32 %7, %9
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11, %3
br label %24
15: ; preds = %11
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @sub_heapify(i32* %16, i32 %17, i32 %18)
%20 = load i32*, i32** %4
%21 = load i32, i32* %5
%22 = sub nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %15, %14
ret void
}

LLVM IR (-O2):
define void @heapify(i32* %0, i32 %1, i32 %2) {
%4 = sdiv i32 %2, 2
%5 = icmp sle i32 %4, %1
%6 = icmp slt i32 %1, 0
%7 = or i1 %5, %6
br i1 %7, label %13, label %8
8: ; preds = %3, %8
%9 = phi i32 [ %11, %8 ], [ %1, %3 ]
%10 = tail call i32 @sub_heapify(i32* %0, i32 %9, i32 %2)
%11 = add nsw i32 %9, -1
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_CC_VREN_PIN() { clear_io_bit(-4, 4); }


x86 assembly (clang, -O0):
<TOSH_CLR_CC_VREN_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffc,%edi
mov    $0x4,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_CC_VREN_PIN>:
mov    $0xfffffffc,%edi
mov    $0x4,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_CC_VREN_PIN() {
%1 = call i32 @clear_io_bit(i32 -4, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_CC_VREN_PIN() {
%1 = tail call i32 @clear_io_bit(i32 -4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: ip maddr [ add | del ] MULTIADDR dev STRING\n");
  fprintf(stderr, "       ip maddr show [ dev STRING ]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: ip maddr [ add | del ] MULTIADDR dev STRING\0A\00"
@.str.1 = [37 x i8] c" ip maddr show [ dev STRING ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: ip maddr [ add | del ] MULTIADDR dev STRING\0A\00"
@.str.1 = [37 x i8] c" ip maddr show [ dev STRING ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int WSTOPSIG(int);
int octave_wstopsig_wrapper(int status) { return WSTOPSIG(status); }


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

x86 assembly (clang, -O2):
<octave_wstopsig_wrapper>:
jmp    1030 <WSTOPSIG@plt>

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

LLVM IR (-O2):
define i32 @octave_wstopsig_wrapper(i32 %0) {
%2 = tail call i32 @WSTOPSIG(i32 %0)
ret i32 %2
}