xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ write(int, void const *, size_t);
ssize_t write_nointr(int fd, const void *buf, size_t count) {
  ssize_t ret;
  do {
    ret = write(fd, buf, count);
  } while (ret < 0 && errno == EINTR);
  return ret;
}


x86 assembly (clang, -O0):
<write_nointr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jge    1161 <write_nointr+0x51>
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1123 <write_nointr+0x13>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_nointr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
test   %rax,%rax
jns    114b <write_nointr+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <write_nointr+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i64 @write_nointr(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i64 @write(i32 %9, i8* %10, i64 %11)
store i64 %12, i64* %7
br label %13
13: ; preds = %8
%14 = load i64, i64* %7
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i64 @write_nointr(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp slt i64 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i64 %5
}
unsigned short bswap_16(unsigned short x) { return (x >> 8) | (x << 8); }


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Type definitions */
struct ethhdr {
  int /*<<< orphan*/ h_proto;
  int /*<<< orphan*/ h_source;
  int /*<<< orphan*/ h_dest;
};

/* Variables and functions */
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, unsigned char *, int);
void make_ether2(struct ethhdr *eth2, unsigned char *h_dest,
                 unsigned char *h_source) {
  memcpy(&eth2->h_dest, h_dest, 6);
  memcpy(&eth2->h_source, h_source, 6);
  eth2->h_proto = htons(0x0800);
}


x86 assembly (clang, -O0):
<make_ether2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
mov    $0x800,%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ether2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0x8,%rdi
mov    $0x6,%edx
call   1040 <memcpy@plt>
lea    0x4(%rbx),%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
mov    $0x800,%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ethhdr = type { i32, i32, i32 }
define void @make_ether2(%struct.ethhdr* %0, i8* %1, i8* %2) {
%4 = alloca %struct.ethhdr*
%5 = alloca i8*
%6 = alloca i8*
store %struct.ethhdr* %0, %struct.ethhdr** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.ethhdr*, %struct.ethhdr** %4
%8 = getelementptr inbounds %struct.ethhdr, %struct.ethhdr* %7, i32 0, i32 2
%9 = load i8*, i8** %5
%10 = call i32 @memcpy(i32* %8, i8* %9, i32 6)
%11 = load %struct.ethhdr*, %struct.ethhdr** %4
%12 = getelementptr inbounds %struct.ethhdr, %struct.ethhdr* %11, i32 0, i32 1
%13 = load i8*, i8** %6
%14 = call i32 @memcpy(i32* %12, i8* %13, i32 6)
%15 = call i32 @htons(i32 2048)
%16 = load %struct.ethhdr*, %struct.ethhdr** %4
%17 = getelementptr inbounds %struct.ethhdr, %struct.ethhdr* %16, i32 0, i32 0
store i32 %15, i32* %17
ret void
}

LLVM IR (-O2):
%struct.ethhdr = type { i32, i32, i32 }
define void @make_ether2(%struct.ethhdr* %0, i8* %1, i8* %2) {
%4 = getelementptr inbounds %struct.ethhdr, %struct.ethhdr* %0, i64 0, i32 2
%5 = tail call i32 @memcpy(i32* %4, i8* %1, i32 6)
%6 = getelementptr inbounds %struct.ethhdr, %struct.ethhdr* %0, i64 0, i32 1
%7 = tail call i32 @memcpy(i32* %6, i8* %2, i32 6)
%8 = tail call i32 @htons(i32 2048)
%9 = getelementptr inbounds %struct.ethhdr, %struct.ethhdr* %0, i64 0, i32 0
store i32 %8, i32* %9
ret void
}
void INT_Excep_SCIFA10_RXIF10(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCIFA10_RXIF10() {
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
char bad_strncmp_one(char *str) {
  if (strncmp(str, "http", 5) == 0)
    return str[5];
}


x86 assembly (clang, -O0):
<bad_strncmp_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1145 <bad_strncmp_one+0x35>
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_strncmp_one>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
test   %rcx,%rcx
je     112f <bad_strncmp_one+0x1f>
pop    %rbx
ret
mov    0x5(%rbx),%al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"http\00"
define signext i8 @bad_strncmp_one(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 5
%6 = load i8, i8* %5
br label %7
7: ; preds = %4, %1
%8 = phi i8 [ %6, %4 ], [ undef, %1 ]
ret i8 %8
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ sendmsg(int, struct msghdr const *, int);
ssize_t txc_libc_sendmsg(int s, const struct msghdr *msg, int flags) {
  return sendmsg(s, msg, flags);
}


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

x86 assembly (clang, -O2):
<txc_libc_sendmsg>:
jmp    1030 <sendmsg@plt>

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

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @txc_libc_sendmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @sendmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ realloc(char *, unsigned int);
long *xrealloc(char *ptr, unsigned int size) {
  long *result = (long *)realloc(ptr, size);
  if (result == NULL) {
    fatal("virtual memory exhausted");
  }
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <xrealloc+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i64* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i64 @realloc(i8* %6, i32 %7)
%9 = inttoptr i64 %8 to i64*
store i64* %9, i64** %5
%10 = load i64*, i64** %5
%11 = icmp eq i64* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i64*, i64** %5
ret i64* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i64* @xrealloc(i8* %0, i32 %1) {
%3 = tail call i64 @realloc(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = inttoptr i64 %3 to i64*
ret i64* %8
}
void window_land_emptysub() {}


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

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

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

LLVM IR (-O2):
define void @window_land_emptysub() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t end_timing() {
  return 0x00FFFFFF - (*(volatile uint32_t *)(0x018 + 0xE000E000)) - 4;
}


x86 assembly (clang, -O0):
<end_timing>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e018,%eax
mov    (%rax),%ecx
mov    $0xffffff,%eax
sub    %ecx,%eax
sub    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_timing>:
mov    $0xe000e018,%ecx
mov    $0xfffffb,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @end_timing() {
%1 = load volatile i32, i32* inttoptr (i64 3758153752 to i32*)
%2 = sub nsw i32 16777215, %1
%3 = sub nsw i32 %2, 4
ret i32 %3
}

LLVM IR (-O2):
define i32 @end_timing() {
%1 = load volatile i32, i32* inttoptr (i64 3758153752 to i32*)
%2 = sub i32 16777211, %1
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ch(uint32_t x, uint32_t y, uint32_t z) {
  return ((x & y) ^ ((~x) & z));
}


x86 assembly (clang, -O0):
<ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ch(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 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ch(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long uptomult(long x, long y) {
  assert(x >= 0);
  return ((x + y - 1) / y) * y;
}


x86 assembly (clang, -O0):
<uptomult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
cqto
idivq  -0x10(%rbp)
imul   -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptomult>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
lea    (%rbx,%r14,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %r14,%rax
shr    $0x20,%rax
je     1144 <uptomult+0x34>
mov    %rcx,%rax
cqto
idiv   %r14
jmp    114b <uptomult+0x3b>
mov    %ecx,%eax
xor    %edx,%edx
div    %r14d
sub    %rdx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @uptomult(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp sge i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = add nsw i64 %9, %10
%12 = sub nsw i64 %11, 1
%13 = load i64, i64* %4
%14 = sdiv i64 %12, %13
%15 = load i64, i64* %4
%16 = mul nsw i64 %14, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @uptomult(i64 %0, i64 %1) {
%3 = lshr i64 %0, 63
%4 = trunc i64 %3 to i32
%5 = xor i32 %4, 1
%6 = tail call i32 @assert(i32 %5)
%7 = add i64 %0, -1
%8 = add i64 %7, %1
%9 = srem i64 %8, %1
%10 = sub i64 %8, %9
ret i64 %10
}
void d2i_RSA_PUBKEY(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_RSA_PUBKEY() {
ret void
}
int test_imm_0Bint32_reg(int val) { return ((val) & (0x0B << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Bint32_reg(i32 %0) {
%2 = and i32 %0, 11
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void XSetCommand() {}


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

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

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

LLVM IR (-O2):
define void @XSetCommand() {
ret void
}
unsigned short lSOne(unsigned short key) {
  unsigned short tempKeyRight = (key & 31);
  unsigned short tempKeyLeft = (key >> 5);
  tempKeyRight = tempKeyRight << 1;
  tempKeyLeft = tempKeyLeft << 1;
  if ((tempKeyRight & 32) == 32)
    tempKeyRight = tempKeyRight - 31;
  if ((tempKeyLeft & 32) == 32)
    tempKeyLeft = tempKeyLeft - 31;
  return (tempKeyRight + (tempKeyLeft << 5));
}


x86 assembly (clang, -O0):
<lSOne>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x1f,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x5,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x6(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x20,%eax
jne    1152 <lSOne+0x52>
movzwl -0x4(%rbp),%eax
sub    $0x1f,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x6(%rbp),%eax
and    $0x20,%eax
cmp    $0x20,%eax
jne    116d <lSOne+0x6d>
movzwl -0x6(%rbp),%eax
sub    $0x1f,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lSOne>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
and    $0x3e,%eax
lea    -0x1f(%rax),%edx
test   $0x10,%dil
cmove  %eax,%edx
and    $0xffffffc0,%ecx
lea    -0x3e0(%rcx),%eax
test   $0x200,%edi
cmove  %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @lSOne(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = and i32 %6, 31
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 5
%12 = trunc i32 %11 to i16
store i16 %12, i16* %4
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = shl i32 %14, 1
%16 = trunc i32 %15 to i16
store i16 %16, i16* %3
%17 = load i16, i16* %4
%18 = zext i16 %17 to i32
%19 = shl i32 %18, 1
%20 = trunc i32 %19 to i16
store i16 %20, i16* %4
%21 = load i16, i16* %3
%22 = zext i16 %21 to i32
%23 = and i32 %22, 32
%24 = icmp eq i32 %23, 32
br i1 %24, label %25, label %30
25: ; preds = %1
%26 = load i16, i16* %3
%27 = zext i16 %26 to i32
%28 = sub nsw i32 %27, 31
%29 = trunc i32 %28 to i16
store i16 %29, i16* %3
br label %30
30: ; preds = %25, %1
%31 = load i16, i16* %4
%32 = zext i16 %31 to i32
%33 = and i32 %32, 32
%34 = icmp eq i32 %33, 32
br i1 %34, label %35, label %40
35: ; preds = %30
%36 = load i16, i16* %4
%37 = zext i16 %36 to i32
%38 = sub nsw i32 %37, 31
%39 = trunc i32 %38 to i16
store i16 %39, i16* %4
br label %40
40: ; preds = %35, %30
%41 = load i16, i16* %3
%42 = zext i16 %41 to i32
%43 = load i16, i16* %4
%44 = zext i16 %43 to i32
%45 = shl i32 %44, 5
%46 = add nsw i32 %42, %45
%47 = trunc i32 %46 to i16
ret i16 %47
}

LLVM IR (-O2):
define zeroext i16 @lSOne(i16 zeroext %0) {
%2 = shl i16 %0, 1
%3 = and i16 %2, 62
%4 = and i16 %0, 16
%5 = icmp eq i16 %4, 0
%6 = add nsw i16 %3, -31
%7 = select i1 %5, i16 %3, i16 %6
%8 = and i16 %0, 512
%9 = icmp eq i16 %8, 0
%10 = and i16 %2, -64
%11 = add i16 %10, -992
%12 = select i1 %9, i16 %10, i16 %11
%13 = add i16 %12, %7
ret i16 %13
}
/* Variables and functions */
int /*<<< orphan*/ error();
void *malloc(size_t);
void *_malloc(size_t size) {
  void *ret = malloc(size);
  if (!ret)
    error();
  return ret;
}


x86 assembly (clang, -O0):
<_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <_malloc+0x2b>
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <_malloc+0x15>
xor    %eax,%eax
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_malloc(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 %10, label %8
8: ; preds = %1
%9 = call i32 (...) @error()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @error()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct clock_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ improve_maxE(struct clock_connection *);
int /*<<< orphan*/ improve_minE(struct clock_connection *);
void improve_bounds(struct clock_connection *clk) {
  improve_minE(clk);
  improve_maxE(clk);
}


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

x86 assembly (clang, -O2):
<improve_bounds>:
push   %rbx
mov    %rdi,%rbx
call   1030 <improve_minE@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <improve_maxE@plt>

LLVM IR (-O0):
%struct.clock_connection = type { i32 }
define void @improve_bounds(%struct.clock_connection* %0) {
%2 = alloca %struct.clock_connection*
store %struct.clock_connection* %0, %struct.clock_connection** %2
%3 = load %struct.clock_connection*, %struct.clock_connection** %2
%4 = call i32 @improve_minE(%struct.clock_connection* %3)
%5 = load %struct.clock_connection*, %struct.clock_connection** %2
%6 = call i32 @improve_maxE(%struct.clock_connection* %5)
ret void
}

LLVM IR (-O2):
%struct.clock_connection = type { i32 }
define void @improve_bounds(%struct.clock_connection* %0) {
%2 = tail call i32 @improve_minE(%struct.clock_connection* %0)
%3 = tail call i32 @improve_maxE(%struct.clock_connection* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
void *get_magic_number_addr();
void test_pointer_identity() {
  void *a = get_magic_number_addr();
  void *b = get_magic_number_addr();
  assertTrue("a == b", a == b);
}


x86 assembly (clang, -O0):
<test_pointer_identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_magic_number_addr@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_magic_number_addr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeab(%rip),%rdi
call   1040 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pointer_identity>:
push   %rbx
xor    %eax,%eax
call   1030 <get_magic_number_addr@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <get_magic_number_addr@plt>
xor    %esi,%esi
cmp    %rax,%rbx
sete   %sil
lea    0xebe(%rip),%rdi
pop    %rbx
jmp    1040 <assertTrue@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"a == b\00"
define void @test_pointer_identity() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @get_magic_number_addr()
store i8* %3, i8** %1
%4 = call i8* (...) @get_magic_number_addr()
store i8* %4, i8** %2
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assertTrue(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"a == b\00"
define void @test_pointer_identity() {
%1 = tail call i8* (...) @get_magic_number_addr()
%2 = tail call i8* (...) @get_magic_number_addr()
%3 = icmp eq i8* %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assertTrue(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pcibios_write_config_byte(int /*<<< orphan*/, scalar_t__,
                                             int, int);
void set_fdhc(void) {
  pcibios_write_config_byte(0, ((0x00 << 3) + 0), 0x68, 0x00);
}


x86 assembly (clang, -O0):
<set_fdhc>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%esi
mov    $0x68,%edx
mov    %ecx,%edi
call   1030 <pcibios_write_config_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_fdhc>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x68,%edx
xor    %ecx,%ecx
jmp    1030 <pcibios_write_config_byte@plt>

LLVM IR (-O0):
define void @set_fdhc() {
%1 = call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 104, i32 0)
ret void
}

LLVM IR (-O2):
define void @set_fdhc() {
%1 = tail call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 104, i32 0)
ret void
}
int func(char *str) {
  int variable_a;
  char buffer[12];
  printf("0x%x\n", &buffer);
  strcpy(buffer, str);
  return 1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [12 x i8]
store i8* %0, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [12 x i8]* %4)
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i8* %6, i8* %7)
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @func(i8* nocapture %0) {
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [12 x i8]* %2)
ret i32 1
}
int INT_MAX(int a, int b) { return a >= b ? a : b; }


x86 assembly (clang, -O0):
<INT_MAX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <INT_MAX+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <INT_MAX+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_MAX>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @INT_MAX(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 = icmp sge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @INT_MAX(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void codigoSentenciaEntrada(int parte, FILE *f) {}


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

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

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

LLVM IR (-O2):
define void @codigoSentenciaEntrada(i32 %0, i32* nocapture %1) {
ret void
}
void foo534() {}


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

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

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

LLVM IR (-O2):
define void @foo534() {
ret void
}
/* Variables and functions */
double lgamma(double);
double lbeta(double a, double b) {
  return lgamma(a) + lgamma(b) - lgamma(a + b);
}


x86 assembly (clang, -O0):
<lbeta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lgamma@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbeta>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <lgamma@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <lgamma@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <lgamma@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @lbeta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @lgamma(double %5)
%7 = load double, double* %4
%8 = call double @lgamma(double %7)
%9 = fadd double %6, %8
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fadd double %10, %11
%13 = call double @lgamma(double %12)
%14 = fsub double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @lbeta(double %0, double %1) {
%3 = tail call double @lgamma(double %0)
%4 = tail call double @lgamma(double %1)
%5 = fadd double %3, %4
%6 = fadd double %0, %1
%7 = tail call double @lgamma(double %6)
%8 = fsub double %5, %7
ret double %8
}
double slope_ratio_calc(double enrg_prev, double enrg_cur) {
  double slope_ratio;
  if (enrg_prev == 0.0)
    enrg_prev = 0.0001;
  slope_ratio = enrg_cur / enrg_prev;
  return slope_ratio;
}


x86 assembly (clang, -O0):
<slope_ratio_calc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1133 <slope_ratio_calc+0x33>
jp     1133 <slope_ratio_calc+0x33>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<slope_ratio_calc>:
xorpd  %xmm2,%xmm2
cmpeqsd %xmm0,%xmm2
movsd  0xeef(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @slope_ratio_calc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e-04, double* %3
br label %9
9: ; preds = %8, %2
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fdiv double %10, %11
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @slope_ratio_calc(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e-04, double %0
%5 = fdiv double %1, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void string_del(void *self, char *data, int length) {
  if (data) {
    if (!(--*(int *)((void *)(((int *)data) - 1))))
      free(((void *)(((int *)data) - 1)));
    ;
  }
}


x86 assembly (clang, -O0):
<string_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <string_del+0x46>
mov    -0x10(%rbp),%rcx
mov    -0x4(%rcx),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rcx)
cmp    $0x0,%eax
jne    1151 <string_del+0x41>
mov    -0x10(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
jmp    1156 <string_del+0x46>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_del>:
test   %rsi,%rsi
je     111b <string_del+0xb>
addl   $0xffffffff,-0x4(%rsi)
je     111c <string_del+0xc>
ret
add    $0xfffffffffffffffc,%rsi
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @string_del(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %1, i64 -4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = add nsw i32 %8, -1
store i32 %9, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = tail call i32 @free(i8* %6)
br label %13
13: ; preds = %5, %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main(void) {
  int a[4] = {0};
  f(a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @f(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ baseRuota(int, int);
int /*<<< orphan*/ braccioChiuso(int);
int /*<<< orphan*/ pinza(int);
int /*<<< orphan*/ sleep(int);
void pwmFinalPosition() {
  pinza(32);
  braccioChiuso(100);
  baseRuota(1, 90);
  sleep(1);
}


x86 assembly (clang, -O0):
<pwmFinalPosition>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1040 <pinza@plt>
mov    $0x64,%edi
call   1050 <braccioChiuso@plt>
mov    $0x1,%edi
mov    $0x5a,%esi
call   1030 <baseRuota@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwmFinalPosition>:
push   %rax
mov    $0x20,%edi
call   1040 <pinza@plt>
mov    $0x64,%edi
call   1050 <braccioChiuso@plt>
mov    $0x1,%edi
mov    $0x5a,%esi
call   1030 <baseRuota@plt>
mov    $0x1,%edi
pop    %rax
jmp    1060 <sleep@plt>

LLVM IR (-O0):
define void @pwmFinalPosition() {
%1 = call i32 @pinza(i32 32)
%2 = call i32 @braccioChiuso(i32 100)
%3 = call i32 @baseRuota(i32 1, i32 90)
%4 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @pwmFinalPosition() {
%1 = tail call i32 @pinza(i32 32)
%2 = tail call i32 @braccioChiuso(i32 100)
%3 = tail call i32 @baseRuota(i32 1, i32 90)
%4 = tail call i32 @sleep(i32 1)
ret void
}
int drv_text_recover(int p, char *s, int n) { return p; }


x86 assembly (clang, -O0):
<drv_text_recover>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @drv_text_recover(i32 returned %0, i8* nocapture readnone %1, i32 %2) {
ret i32 %0
}
int syscall0(int call) {
  int rc;
  asm volatile("movl %[call], %%eax	\n"
               "int  %[xnum]		\n"
               "movl %%eax,   %[rc]	\n"
               : [rc] "=g"(rc)
               : [call] "g"(call), [xnum] "i"(0x80)
               : "%eax", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<syscall0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
int    $0x80
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall0>:
mov    %edi,-0x8(%rsp)
mov    -0x8(%rsp),%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @syscall0(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %2
ret i32 %4
}
__attribute__((always_)) void early_boot_irqs_off(void) {}


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

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

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

LLVM IR (-O2):
define void @early_boot_irqs_off() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int foo(int num) {
  printf("%d\n", num);
  return num * 42;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
imul   $0x2a,-0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
imul   $0x2a,%ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = mul nsw i32 %0, 42
ret i32 %3
}
void gtk_toggle_button_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_button_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int, int);
int /*<<< orphan*/ max_heap(int *, int);
void heap_sort(int *arr, int len) {
  heapify(arr, len / 2 - 1, len);
  max_heap(arr, len);
  return;
}


x86 assembly (clang, -O0):
<heap_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
call   1040 <heapify@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <max_heap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_sort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
shr    $0x1f,%esi
add    %ebx,%esi
sar    %esi
add    $0xffffffff,%esi
mov    %ebx,%edx
call   1040 <heapify@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <max_heap@plt>

LLVM IR (-O0):
define void @heap_sort(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 = sdiv i32 %6, 2
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = call i32 @heapify(i32* %5, i32 %8, i32 %9)
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = call i32 @max_heap(i32* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @heap_sort(i32* %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = add nsw i32 %3, -1
%5 = tail call i32 @heapify(i32* %0, i32 %4, i32 %1)
%6 = tail call i32 @max_heap(i32* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void mem_write_nulll(uint32_t addr, uint32_t val, void *p) {}


x86 assembly (clang, -O0):
<mem_write_nulll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mem_write_nulll(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "No enough memory\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"No enough memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(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 eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"No enough memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *fname) {
  printf("Usage: %s val1 val2 ...\n", fname);
  printf("Values may be given in hex or decimal\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: %s val1 val2 ...\0A\00"
@.str.1 = [39 x i8] c"Values may be given in hex or decimal\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s val1 val2 ...\0A\00"
@str = [38 x i8] c"Values may be given in hex or decimal\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int i2c_bulkread(void *, unsigned char, unsigned short, unsigned char *, int);
int fc8300_i2c_wordread(void *handle, unsigned short devid, unsigned short addr,
                        unsigned short *data) {
  int res;
  OAL_OBTAIN_SEMAPHORE();
  res = i2c_bulkread(handle, (unsigned char)(devid >> 8) & 0xff, addr,
                     (unsigned char *)data, 2);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0xc(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    $0x2,%r8d
movzbl %dl,%esi
movzwl %ax,%edx
call   1030 <i2c_bulkread@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
shr    $0x8,%ebx
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14,%rcx
mov    $0x2,%r8d
call   1030 <i2c_bulkread@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8300_i2c_wordread(i8* %0, i16 zeroext %1, i16 zeroext %2, i16* %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16*
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16* %3, i16** %8
%10 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%11 = load i8*, i8** %5
%12 = load i16, i16* %6
%13 = zext i16 %12 to i32
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
%16 = zext i8 %15 to i32
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = load i16, i16* %7
%20 = load i16*, i16** %8
%21 = bitcast i16* %20 to i8*
%22 = call i32 @i2c_bulkread(i8* %11, i8 zeroext %18, i16 zeroext %19, i8* %21, i32 2)
store i32 %22, i32* %9
%23 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @fc8300_i2c_wordread(i8* %0, i16 zeroext %1, i16 zeroext %2, i16* %3) {
%5 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%6 = lshr i16 %1, 8
%7 = trunc i16 %6 to i8
%8 = bitcast i16* %3 to i8*
%9 = tail call i32 @i2c_bulkread(i8* %0, i8 zeroext %7, i16 zeroext %2, i8* %8, i32 2)
%10 = tail call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %9
}