xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int fls(unsigned int);
unsigned int atmci_convert_chksize(unsigned int maxburst) {
  if (maxburst > 1)
    return fls(maxburst) - 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<atmci_convert_chksize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jbe    1138 <atmci_convert_chksize+0x28>
mov    -0x8(%rbp),%edi
call   1030 <fls@plt>
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <atmci_convert_chksize+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmci_convert_chksize>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     1124 <atmci_convert_chksize+0x14>
push   %rax
call   1030 <fls@plt>
add    $0xfffffffe,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @atmci_convert_chksize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ugt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @fls(i32 %7)
%9 = sub i32 %8, 2
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @atmci_convert_chksize(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @fls(i32 %0)
%5 = add i32 %4, -2
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
void SteamAPI_ISteamMusic_PlayPrevious(void *self) {
  xlogf("%s(self = %p)", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamMusic_PlayPrevious>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s(self = %p)\00"
@__func__.SteamAPI_ISteamMusic_PlayPrevious = [34 x i8] c"SteamAPI_ISteamMusic_PlayPrevious\00"
define void @SteamAPI_ISteamMusic_PlayPrevious(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.SteamAPI_ISteamMusic_PlayPrevious, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s(self = %p)\00"
@__func__.SteamAPI_ISteamMusic_PlayPrevious = [34 x i8] c"SteamAPI_ISteamMusic_PlayPrevious\00"
define void @SteamAPI_ISteamMusic_PlayPrevious(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.SteamAPI_ISteamMusic_PlayPrevious, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearok(int /*<<< orphan*/, int);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void redraw() {
  clearok(stdscr, 1);
  refresh();
}


x86 assembly (clang, -O0):
<redraw>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <clearok@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <clearok@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @redraw() {
%1 = load i32, i32* @stdscr
%2 = call i32 @clearok(i32 %1, i32 1)
%3 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @redraw() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @clearok(i32 %1, i32 1)
%3 = tail call i32 (...) @refresh()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void gen6_rp_control(char *result, int len, int reg, uint32_t val,
                     uint32_t devid) {
  snprintf(result, len, "%s", (val & (1 << 7)) ? "enabled" : "disabled");
}


x86 assembly (clang, -O0):
<gen6_rp_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
and    $0x80,%edx
lea    0xecb(%rip),%rcx
lea    0xebc(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%rcx
lea    0xeab(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen6_rp_control>:
test   $0x80,%cl
lea    0xef1(%rip),%rax
lea    0xee2(%rip),%rcx
cmove  %rax,%rcx
lea    0xed4(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"enabled\00"
@.str.2 = [9 x i8] c"disabled\00"
define void @gen6_rp_control(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = and i32 %13, 128
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%18 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"enabled\00"
@.str.2 = [9 x i8] c"disabled\00"
define void @gen6_rp_control(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %3, 128
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}
int foo(int n) { return n + 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fn(unsigned long long *);
void f2(void) {
  unsigned long long a __attribute__((aligned(8)));
  fn(&a);
}


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

x86 assembly (clang, -O2):
<f2>:
push   %rax
mov    %rsp,%rdi
call   1030 <fn@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f2() {
%1 = alloca i64
%2 = call i32 @fn(i64* %1)
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @fn(i64* %1)
ret void
}
int capng_apply_caps_fd(int fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @capng_apply_caps_fd(i32 %0) {
ret i32 -1
}
int baz(void) { return 13; }


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

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

LLVM IR (-O0):
define i32 @baz() {
ret i32 13
}

LLVM IR (-O2):
define i32 @baz() {
ret i32 13
}
void msg0() { printf("I am in function %s\n", __func__); }


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

x86 assembly (clang, -O2):
<msg0>:
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"I am in function %s\0A\00"
@__func__.msg0 = [5 x i8] c"msg0\00"
define void @msg0() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.msg0, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"I am in function %s\0A\00"
@__func__.msg0 = [5 x i8] c"msg0\00"
define void @msg0() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.msg0, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sV() {
  dot();
  dot();
  dot();
  dash();
  cBreak();
}


x86 assembly (clang, -O0):
<sV>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sV>:
push   %rax
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sV() {
%1 = call i32 (...) @dot()
%2 = call i32 (...) @dot()
%3 = call i32 (...) @dot()
%4 = call i32 (...) @dash()
%5 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sV() {
%1 = tail call i32 (...) @dot()
%2 = tail call i32 (...) @dot()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @dash()
%5 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
char *nexttoksep(char **, char *);
char *nexttok(char **strp) { return nexttoksep(strp, " "); }


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

x86 assembly (clang, -O2):
<nexttok>:
lea    0xee9(%rip),%rsi
jmp    1030 <nexttoksep@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i8* @nexttok(i8** %0) {
%2 = tail call i8* @nexttoksep(i8** %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int32_t WriteUint16Le(uint16_t value, void *out) {
  assert(out != NULL);
  uint8_t *buf = (uint8_t *)out;
  buf[0] = (uint8_t)(value >> 0);
  buf[1] = (uint8_t)(value >> 8);
  return 2;
}


x86 assembly (clang, -O0):
<WriteUint16Le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteUint16Le>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
movslq %ebp,%rax
mov    %rax,(%rbx)
sar    $0x8,%eax
cltq
mov    %rax,0x8(%rbx)
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WriteUint16Le(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
store i64* %11, i64** %5
%12 = load i32, i32* %3
%13 = ashr i32 %12, 0
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %5
%16 = getelementptr inbounds i64, i64* %15, i64 0
store i64 %14, i64* %16
%17 = load i32, i32* %3
%18 = ashr i32 %17, 8
%19 = sext i32 %18 to i64
%20 = load i64*, i64** %5
%21 = getelementptr inbounds i64, i64* %20, i64 1
store i64 %19, i64* %21
ret i32 2
}

LLVM IR (-O2):
define i32 @WriteUint16Le(i32 %0, i8* writeonly %1) {
%3 = icmp ne i8* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast i8* %1 to i64*
%7 = sext i32 %0 to i64
store i64 %7, i64* %6
%8 = ashr i32 %0, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 8
%11 = bitcast i8* %10 to i64*
store i64 %9, i64* %11
ret i32 2
}
int mpc_eoi_anchor(char prev, char next) {
  (void)prev;
  return (next == '\0');
}


x86 assembly (clang, -O0):
<mpc_eoi_anchor>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpc_eoi_anchor>:
xor    %eax,%eax
test   %sil,%sil
sete   %al
ret

LLVM IR (-O0):
define i32 @mpc_eoi_anchor(i8 signext %0, i8 signext %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 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mpc_eoi_anchor(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ createChild(char **, int, int);
int /*<<< orphan*/ setupArg(char **, char *);
void doLsl(char *file, int s1, int s2) {
  char *arg[4];
  setupArg(arg, file);
  createChild(arg, s1, s2);
}


x86 assembly (clang, -O0):
<doLsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <setupArg@plt>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <createChild@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doLsl>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <setupArg@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <createChild@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @doLsl(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x i8*]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = call i32 @setupArg(i8** %8, i8* %9)
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %7, i64 0, i64 0
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @createChild(i8** %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @doLsl(i8* %0, i32 %1, i32 %2) {
%4 = alloca [4 x i8*]
%5 = bitcast [4 x i8*]* %4 to i8*
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 0
%7 = call i32 @setupArg(i8** %6, i8* %0)
%8 = call i32 @createChild(i8** %6, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] rpath-absolute.exe\n");
  printf("[PASS]  rpath-absolute.exe\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>
lea    0xeea(%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>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"[BEGIN] rpath-absolute.exe\0A\00"
@.str.1 = [28 x i8] c"[PASS] rpath-absolute.exe\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"[BEGIN] rpath-absolute.exe\00"
@str.2 = [27 x i8] c"[PASS] rpath-absolute.exe\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int compare_scores(const void *score_a, const void *score_b) {
  int a = *(int *)score_a;
  int b = *(int *)score_b;
  return a - b;
}


x86 assembly (clang, -O0):
<compare_scores>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare_scores(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_scores(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
float gamma_CCTF(float, double);
float AdobeRGB_EOTF(float value) { return gamma_CCTF(value, 1.0 / 2.19921875); }


x86 assembly (clang, -O0):
<AdobeRGB_EOTF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <gamma_CCTF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdobeRGB_EOTF>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <gamma_CCTF@plt>

LLVM IR (-O0):
define float @AdobeRGB_EOTF(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @gamma_CCTF(float %3, double 0x3FDD19EB155F08A4)
ret float %4
}

LLVM IR (-O2):
define float @AdobeRGB_EOTF(float %0) {
%2 = tail call float @gamma_CCTF(float %0, double 0x3FDD19EB155F08A4)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ tree(int);
int main() {
  int count;
  for (count = 1; count <= 11; count++) {
    switch (count) {
    case 4:
      tree(4);
      break;
    case 7:
      tree(7);
      break;
    case 11:
      tree(11);
      break;
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jg     11a1 <main+0x91>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4,%eax
je     1166 <main+0x56>
jmp    1144 <main+0x34>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     1175 <main+0x65>
jmp    1155 <main+0x45>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     1184 <main+0x74>
jmp    118e <main+0x7e>
mov    $0x4,%edi
call   1030 <tree@plt>
jmp    118e <main+0x7e>
mov    $0x7,%edi
call   1030 <tree@plt>
jmp    118e <main+0x7e>
mov    $0xb,%edi
call   1030 <tree@plt>
jmp    1193 <main+0x83>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @tree(i32 4)
%2 = tail call i32 @tree(i32 7)
%3 = tail call i32 @tree(i32 11)
ret i32 0
}
int iabs(int a) {
  if (a < 0)
    a = -a;
  return a;
}


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <iabs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iabs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_matrix(double *matrix) {
  if (matrix != NULL) {
    free(matrix);
  }
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_matrix+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
test   %rdi,%rdi
je     111a <free_matrix+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_matrix(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double*, double** %2
%7 = call i32 @free(double* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_matrix(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ fatal(char *);
void *xcalloc(size_t number, size_t size) {
  void *ptr = calloc(number, size);
  if (ptr == NULL)
    fatal("calloc: out of memory");
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
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   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xcalloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"calloc: out of memory\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_version() {
  printf("chmod %s\n", "0.01");
  printf("Written by Constantinos Georgiades\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [10 x i8] c"chmod %s\0A\00"
@.str.1 = [5 x i8] c"0.01\00"
@.str.2 = [36 x i8] c"Written by Constantinos Georgiades\0A\00"
@EXIT_SUCCESS = global i32 0
define void @print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"chmod %s\0A\00"
@.str.1 = [5 x i8] c"0.01\00"
@EXIT_SUCCESS = global i32 0
@str = [35 x i8] c"Written by Constantinos Georgiades\00"
define void @print_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ e_pla();
void e_pla_accu() { e_pla(); }


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

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

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

LLVM IR (-O2):
define void @e_pla_accu() {
%1 = tail call i32 (...) @e_pla()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__37__IO__set();
void Msp430GpioC__1__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__37__IO__set();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__1__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__37__IO__set()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lswapl(uint32_t x) {
  return ((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) |
         ((x >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<lswapl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lswapl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @lswapl(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int prefix(const char *pre, const char *str) {
  return strncmp(pre, str, strlen(pre)) == 0;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prefix(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 i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @prefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_help(const char *bin_name) {
  printf("Usage: %s -c|-f|-k <temperature>\n\n", bin_name);
  puts("  -c\tconvert <temperature> from Celsius\n"
       "  -f\tconvert <temperature> from Fahrenheit\n"
       "  -h\tshow this help\n"
       "  -k\tconvert <temperature> from Kelvins\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: %s -c|-f|-k <temperature>\0A\0A\00"
@.str.1 = [144 x i8] c" -c\09convert <temperature> from Celsius\0A -f\09convert <temperature> from Fahrenheit\0A -h\09show this help\0A -k\09convert <temperature> from Kelvins\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: %s -c|-f|-k <temperature>\0A\0A\00"
@.str.1 = [144 x i8] c" -c\09convert <temperature> from Celsius\0A -f\09convert <temperature> from Fahrenheit\0A -h\09show this help\0A -k\09convert <temperature> from Kelvins\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int _kill(int pid, int sig) {
  errno = EINVAL;
  return (-1);
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__5__IO__makeOutput();
void Msp430GpioC__12__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__5__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__12__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__5__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void usage(char *arg0) {
  printf(
      "Usage: %s -c\n"
      "       %s -a [libs...] \n"
      "       %s -d [libs...] \n"
      "       %s -l\n"
      "\n"
      "       This program manages the VMAdump in-kernel library list.\n"
      "       -h            Display this message and exit.\n"
      "       -v            Display version information and exit.\n"
      "       -c            Clear kernel library list.\n"
      "       -a [libs...]  Add to the kernel library list.\n"
      "       -d [libs...]  Delete from the kernel library list.\n"
      "       -l            Print the contents of the kernel library list.\n",
      arg0, arg0, arg0, arg0);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [478 x i8] c"Usage: %s -c\0A %s -a [libs...] \0A %s -d [libs...] \0A %s -l\0A\0A This program manages the VMAdump in-kernel library list.\0A -h Display this message and exit.\0A -v Display version information and exit.\0A -c Clear kernel library list.\0A -a [libs...] Add to the kernel library list.\0A -d [libs...] Delete from the kernel library list.\0A -l Print the contents of the kernel library list.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([478 x i8], [478 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [478 x i8] c"Usage: %s -c\0A %s -a [libs...] \0A %s -d [libs...] \0A %s -l\0A\0A This program manages the VMAdump in-kernel library list.\0A -h Display this message and exit.\0A -v Display version information and exit.\0A -c Clear kernel library list.\0A -a [libs...] Add to the kernel library list.\0A -d [libs...] Delete from the kernel library list.\0A -l Print the contents of the kernel library list.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([478 x i8], [478 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t ntohs(uint16_t n) {
  union {
    int i;
    char c;
  } u = {1};
  return u.c ? bswap_16(n) : n;
}


x86 assembly (clang, -O0):
<ntohs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1141 <ntohs+0x31>
mov    -0x4(%rbp),%edi
call   1030 <bswap_16@plt>
mov    %eax,-0xc(%rbp)
jmp    1147 <ntohs+0x37>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohs>:
jmp    1030 <bswap_16@plt>

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.ntohs.u = %union.anon { i32 1 }
define i32 @ntohs(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i8*
%5 = bitcast %union.anon* %3 to i8*
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @bswap_16(i32 %10)
br label %14
12: ; preds = %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @ntohs(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int i;
  float f;
  char c;
  i = 10;
  f = 20.1;
  c = 'a';
  printf("%d\n", i);
  printf("%f\n", f);
  printf("%c\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x41a0cccd,-0xc(%rbp)
movb   $0x61,-0xd(%rbp)
movsbl -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
lea    0xeb3(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i8
store i32 0, i32* %1
store i32 10, i32* %2
store float 0x40341999A0000000, float* %3
store i8 97, i8* %4
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = load float, float* %3
%9 = fptosi float %8 to i8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %9)
%11 = load i8, i8* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext 97)
ret i32 0
}
void c_pomp_workshare_enter_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_workshare_enter_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Variables and functions */
int japi_getselstart(int);
int j_getselstart(int arg0) { return (japi_getselstart(arg0)); }


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

x86 assembly (clang, -O2):
<j_getselstart>:
jmp    1030 <japi_getselstart@plt>

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

LLVM IR (-O2):
define i32 @j_getselstart(i32 %0) {
%2 = tail call i32 @japi_getselstart(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void three(int i) { printf("three %d\n", i); }


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

x86 assembly (clang, -O2):
<three>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"three %d\0A\00"
define void @three(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
long labs(long);
int main() {
  long *a = (long *)"empty";
  int i = 1441516387;
  a[i] = labs(a[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x55ebcb63,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <labs@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"empty\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64*
%3 = alloca i32
store i32 0, i32* %1
store i64* bitcast ([6 x i8]* @.str to i64*), i64** %2
store i32 1441516387, i32* %3
%4 = load i64*, i64** %2
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %4, i64 %6
%8 = load i64, i64* %7
%9 = call i64 @labs(i64 %8)
%10 = load i64*, i64** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
store i64 %9, i64* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_adc_disable() {
  mbus_remote_register_write(
      0x6, 0x3B,
      ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) |
       (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) | (1 << 10) | (0 << 11) |
       (0 << 12) | (0 << 13) | (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
       (1 << 18) | (1 << 19) | (1 << 20)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_adc_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0x1fc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_disable>:
push   %rax
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0x1fc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_adc_disable() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 59, i32 2082815)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_disable() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 59, i32 2082815)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int acos(int /*<<< orphan*/);
int computeInnerSquareRadius(int, double);
double getInnerCircleArea(int numSide, double regularPolygonArea) {
  return (2 * acos(0)) * computeInnerSquareRadius(numSide, regularPolygonArea);
}


x86 assembly (clang, -O0):
<getInnerCircleArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
xor    %edi,%edi
call   1040 <acos@plt>
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
call   1030 <computeInnerSquareRadius@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInnerCircleArea>:
push   %rbp
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <acos@plt>
mov    %eax,%ebp
mov    %ebx,%edi
movsd  (%rsp),%xmm0
call   1030 <computeInnerSquareRadius@plt>
imul   %ebp,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @getInnerCircleArea(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = call i32 @acos(i32 0)
%6 = mul nsw i32 2, %5
%7 = load i32, i32* %3
%8 = load double, double* %4
%9 = call i32 @computeInnerSquareRadius(i32 %7, double %8)
%10 = mul nsw i32 %6, %9
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @getInnerCircleArea(i32 %0, double %1) {
%3 = tail call i32 @acos(i32 0)
%4 = shl nsw i32 %3, 1
%5 = tail call i32 @computeInnerSquareRadius(i32 %0, double %1)
%6 = mul nsw i32 %4, %5
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
double DBETWEEN(double, double);
int /*<<< orphan*/ DSENSITIVITY(double);
int main(void) {
  double t, r;
  t = DBETWEEN(0.0, 999.0);
  r = t / (t + 1);
  DSENSITIVITY(r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
call   1030 <DBETWEEN@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <DSENSITIVITY@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm1
xorpd  %xmm0,%xmm0
call   1030 <DBETWEEN@plt>
movsd  0xece(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
call   1040 <DSENSITIVITY@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call double @DBETWEEN(double 0.000000e+00, double 9.990000e+02)
store double %3, double* %1
%4 = load double, double* %1
%5 = load double, double* %1
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
store double %7, double* %2
%8 = load double, double* %2
%9 = call i32 @DSENSITIVITY(double %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @DBETWEEN(double 0.000000e+00, double 9.990000e+02)
%2 = fadd double %1, 1.000000e+00
%3 = fdiv double %1, %2
%4 = tail call i32 @DSENSITIVITY(double %3)
ret i32 0
}