xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ asyslogd_flog_exit(int /*<<< orphan*/, char *, int);
void asyslogd_signal_handler(int sig, short events, void *const ptr) {
  (void)events;
  (void)ptr;
  asyslogd_flog_exit(EXIT_SUCCESS, "received signal %d", sig);
}


x86 assembly (clang, -O0):
<asyslogd_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1030 <asyslogd_flog_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asyslogd_signal_handler>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <asyslogd_flog_exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@.str = [19 x i8] c"received signal %d\00"
define void @asyslogd_signal_handler(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load i16, i16* %5
%8 = load i8*, i8** %6
%9 = load i32, i32* @EXIT_SUCCESS
%10 = load i32, i32* %4
%11 = call i32 @asyslogd_flog_exit(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@.str = [19 x i8] c"received signal %d\00"
define void @asyslogd_signal_handler(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @asyslogd_flog_exit(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double cos(double);
double module_libc_cos(double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<module_libc_cos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @module_libc_cos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
int at_client_error() { return 0; }


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

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

LLVM IR (-O0):
define i32 @at_client_error() {
ret i32 0
}

LLVM IR (-O2):
define i32 @at_client_error() {
ret i32 0
}
unsigned long poly(int a, int b, int n) {
  long temp;
  temp = n * (n + a) + b;
  if (temp < 0)
    return 0UL;
  return (unsigned)temp;
}


x86 assembly (clang, -O0):
<poly>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    -0xc(%rbp),%ecx
imul   %ecx,%eax
add    -0x10(%rbp),%eax
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    113a <poly+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1144 <poly+0x44>
mov    -0x20(%rbp),%rax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly>:
lea    (%rdi,%rdx,1),%eax
imul   %edx,%eax
xor    %ecx,%ecx
add    %esi,%eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i64 @poly(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %0
%5 = mul nsw i32 %4, %2
%6 = add nsw i32 %5, %1
%7 = icmp sgt i32 %6, 0
%8 = select i1 %7, i32 %6, i32 0
%9 = zext i32 %8 to i64
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
               int /*<<< orphan*/ *);
size_t mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps) {
  static mbstate_t mbs;
  if (ps == NULL)
    ps = &mbs;
  return (mbrtowc(NULL, s, n, ps));
}


x86 assembly (clang, -O0):
<mbrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113a <mbrlen+0x2a>
lea    0x2ef6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mbrtowc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbrlen>:
mov    %rsi,%rax
mov    %rdi,%rsi
test   %rdx,%rdx
lea    0x2f0c(%rip),%rcx
cmovne %rdx,%rcx
xor    %edi,%edi
mov    %rax,%rdx
jmp    1030 <mbrtowc@plt>

LLVM IR (-O0):
@mbrlen.mbs = internal global i32 0
define i64 @mbrlen(i8* noalias %0, i64 %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %3
store i32* @mbrlen.mbs, i32** %6
br label %10
10: ; preds = %9, %3
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = load i32*, i32** %6
%14 = call i64 @mbrtowc(i32* null, i8* %11, i64 %12, i32* %13)
ret i64 %14
}

LLVM IR (-O2):
@mbrlen.mbs = internal global i32 0
define i64 @mbrlen(i8* noalias %0, i64 %1, i32* noalias %2) {
%4 = icmp eq i32* %2, null
%5 = select i1 %4, i32* @mbrlen.mbs, i32* %2
%6 = tail call i64 @mbrtowc(i32* null, i8* %0, i64 %1, i32* %5)
ret i64 %6
}
void gtk_icon_source_get_filename() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_get_filename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insert(int);
int /*<<< orphan*/ print();
int /*<<< orphan*/ reverse();
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < 10; i++) {
    insert(i);
  }
  print();
  reverse();
  print();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    116d <main+0x3d>
mov    -0x14(%rbp),%edi
call   1050 <insert@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
mov    $0x0,%al
call   1040 <print@plt>
mov    $0x0,%al
call   1030 <reverse@plt>
mov    $0x0,%al
call   1040 <print@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <insert@plt>
mov    $0x1,%edi
call   1050 <insert@plt>
mov    $0x2,%edi
call   1050 <insert@plt>
mov    $0x3,%edi
call   1050 <insert@plt>
mov    $0x4,%edi
call   1050 <insert@plt>
mov    $0x5,%edi
call   1050 <insert@plt>
mov    $0x6,%edi
call   1050 <insert@plt>
mov    $0x7,%edi
call   1050 <insert@plt>
mov    $0x8,%edi
call   1050 <insert@plt>
mov    $0x9,%edi
call   1050 <insert@plt>
xor    %eax,%eax
call   1040 <print@plt>
xor    %eax,%eax
call   1030 <reverse@plt>
xor    %eax,%eax
call   1040 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @insert(i32 0)
%4 = tail call i32 @insert(i32 1)
%5 = tail call i32 @insert(i32 2)
%6 = tail call i32 @insert(i32 3)
%7 = tail call i32 @insert(i32 4)
%8 = tail call i32 @insert(i32 5)
%9 = tail call i32 @insert(i32 6)
%10 = tail call i32 @insert(i32 7)
%11 = tail call i32 @insert(i32 8)
%12 = tail call i32 @insert(i32 9)
%13 = tail call i32 (...) @print()
%14 = tail call i32 (...) @reverse()
%15 = tail call i32 (...) @print()
ret i32 0
}
/* Variables and functions */
char *gg_inflate(const unsigned char *in, size_t length) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @gg_inflate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @gg_inflate(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
int getpw_r(char const *, int /*<<< orphan*/, struct passwd *, char *, size_t,
            struct passwd **);
int getpwnam_r(const char *name, struct passwd *pw, char *buf, size_t size,
               struct passwd **res) {
  return getpw_r(name, 0, pw, buf, size, res);
}


x86 assembly (clang, -O0):
<getpwnam_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %esi,%esi
call   1030 <getpw_r@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwnam_r>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <getpw_r@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @getpwnam_r(i8* %0, %struct.passwd* %1, i8* %2, i64 %3, %struct.passwd** %4) {
%6 = alloca i8*
%7 = alloca %struct.passwd*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.passwd**
store i8* %0, i8** %6
store %struct.passwd* %1, %struct.passwd** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.passwd** %4, %struct.passwd*** %10
%11 = load i8*, i8** %6
%12 = load %struct.passwd*, %struct.passwd** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load %struct.passwd**, %struct.passwd*** %10
%16 = call i32 @getpw_r(i8* %11, i32 0, %struct.passwd* %12, i8* %13, i64 %14, %struct.passwd** %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @getpwnam_r(i8* %0, %struct.passwd* %1, i8* %2, i64 %3, %struct.passwd** %4) {
%6 = tail call i32 @getpw_r(i8* %0, i32 0, %struct.passwd* %1, i8* %2, i64 %3, %struct.passwd** %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void errExit(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<errExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errExit>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @errExit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @errExit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  unsigned long imm = 0x17;
  unsigned imm_width = 32;
  unsigned long truncated = imm & ((1ULL << imm_width) - 1);
  assert(imm == truncated);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x17,-0x10(%rbp)
movl   $0x20,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
and    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
store i64 23, i64* %2
store i32 32, i32* %3
%5 = load i64, i64* %2
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = sub i64 %8, 1
%10 = and i64 %5, %9
store i64 %10, i64* %4
%11 = load i64, i64* %2
%12 = load i64, i64* %4
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int v5dSetLowLev(int *);
int v5dsetlowlev_(int *lowlev) { return v5dSetLowLev(lowlev); }


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

x86 assembly (clang, -O2):
<v5dsetlowlev_>:
jmp    1030 <v5dSetLowLev@plt>

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

LLVM IR (-O2):
define i32 @v5dsetlowlev_(i32* %0) {
%2 = tail call i32 @v5dSetLowLev(i32* %0)
ret i32 %2
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  size_t length = 0;
  while (length < maxlen && s[length] != '\0') {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    115d <strnlen+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ _cc3_delay_us_4(int);
void _cc3_camera_reset() {
  (*(volatile unsigned long *)((0xE002800C))) = 0x008000;
  _cc3_delay_us_4(1);
  (*(volatile unsigned long *)((0xE0028004))) = 0x008000;
  _cc3_delay_us_4(1);
  (*(volatile unsigned long *)((0xE002800C))) = 0x008000;
  _cc3_delay_us_4(1);
}


x86 assembly (clang, -O0):
<_cc3_camera_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe002800c,%eax
movq   $0x8000,(%rax)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
mov    $0xe0028004,%eax
movq   $0x8000,(%rax)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
mov    $0xe002800c,%eax
movq   $0x8000,(%rax)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_camera_reset>:
push   %rbx
mov    $0xe002800c,%ebx
movq   $0x8000,(%rbx)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
movq   $0x8000,-0x8(%rbx)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
movq   $0x8000,(%rbx)
mov    $0x1,%edi
pop    %rbx
jmp    1030 <_cc3_delay_us_4@plt>

LLVM IR (-O0):
define void @_cc3_camera_reset() {
store volatile i64 32768, i64* inttoptr (i64 3758260236 to i64*)
%1 = call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 32768, i64* inttoptr (i64 3758260228 to i64*)
%2 = call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 32768, i64* inttoptr (i64 3758260236 to i64*)
%3 = call i32 @_cc3_delay_us_4(i32 1)
ret void
}

LLVM IR (-O2):
define void @_cc3_camera_reset() {
store volatile i64 32768, i64* inttoptr (i64 3758260236 to i64*)
%1 = tail call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 32768, i64* inttoptr (i64 3758260228 to i64*)
%2 = tail call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 32768, i64* inttoptr (i64 3758260236 to i64*)
%3 = tail call i32 @_cc3_delay_us_4(i32 1)
ret void
}
void ssb_pcicore_init(struct ssb_pcicore *pc) {}


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

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

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

LLVM IR (-O2):
%struct.ssb_pcicore = type opaque
define void @ssb_pcicore_init(%struct.ssb_pcicore* nocapture %0) {
ret void
}
do_alpha_fill(argc, argv) int argc;
char **argv;
{}


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

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

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

LLVM IR (-O2):
define i32 @do_alpha_fill(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_11() { pic_send_EOI_normal(11); }


x86 assembly (clang, -O0):
<isr_irq_11>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1030 <pic_send_EOI_normal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isr_irq_11>:
mov    $0xb,%edi
jmp    1030 <pic_send_EOI_normal@plt>

LLVM IR (-O0):
define void @isr_irq_11() {
%1 = call i32 @pic_send_EOI_normal(i32 11)
ret void
}

LLVM IR (-O2):
define void @isr_irq_11() {
%1 = tail call i32 @pic_send_EOI_normal(i32 11)
ret void
}
__attribute__((always_)) void tracing_off_permanent(void) {}


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

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

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

LLVM IR (-O2):
define void @tracing_off_permanent() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *malloc_image(int w, int h) {
  char *img;
  img = (char *)malloc(w * h * sizeof(char));
  return img;
}


x86 assembly (clang, -O0):
<malloc_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_image>:
imul   %esi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define i8* @malloc_image(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int isakmp_validate_exchange(u_int8_t exch) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @isakmp_validate_exchange(i32 %0) {
ret i32 -1
}
int convert_to_hexa(int dec) {
  int result;
  int base;
  base = 1;
  result = 0;
  while (dec > 0) {
    result += (dec % 10) * base;
    dec /= 10;
    base *= 16;
  }
  return result;
}


x86 assembly (clang, -O0):
<convert_to_hexa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1152 <convert_to_hexa+0x52>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <convert_to_hexa+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_hexa>:
xor    %eax,%eax
test   %edi,%edi
jle    1145 <convert_to_hexa+0x45>
mov    $0x1,%ecx
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edi,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%edx
lea    (%rdx,%rdx,4),%r9d
mov    %edi,%edx
sub    %r9d,%edx
imul   %ecx,%edx
add    %edx,%eax
shl    $0x4,%ecx
cmp    $0x9,%edi
mov    %esi,%edi
ja     1120 <convert_to_hexa+0x20>
ret

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

LLVM IR (-O2):
define i32 @convert_to_hexa(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 1, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = urem i32 %6, 10
%8 = mul nsw i32 %4, %7
%9 = add nsw i32 %8, %5
%10 = udiv i32 %6, 10
%11 = shl nsw i32 %4, 4
%12 = icmp ult i32 %6, 10
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %14
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list_link {
  int dummy;
};
struct clause_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_tail(struct genlist const *);
struct clause_list_link *clause_list_tail(const struct clause_list *tthis) {
  return (struct clause_list_link *)genlist_tail((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<clause_list_tail>:
jmp    1030 <genlist_tail@plt>

LLVM IR (-O0):
%struct.clause_list_link = type { i32 }
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.clause_list_link* @clause_list_tail(%struct.clause_list* %0) {
%2 = alloca %struct.clause_list*
store %struct.clause_list* %0, %struct.clause_list** %2
%3 = load %struct.clause_list*, %struct.clause_list** %2
%4 = bitcast %struct.clause_list* %3 to %struct.genlist*
%5 = call i64 @genlist_tail(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.clause_list_link*
ret %struct.clause_list_link* %6
}

LLVM IR (-O2):
%struct.clause_list_link = type { i32 }
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.clause_list_link* @clause_list_tail(%struct.clause_list* %0) {
%2 = bitcast %struct.clause_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_tail(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.clause_list_link*
ret %struct.clause_list_link* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(void) {
  printf("\n%s %s\nby Fernando Mercês\n\n", "OpenVaccine", "0.91");
  printf("Usage: openvaccine [partition]\nExample: openvaccine /dev/sdc1\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xef0(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xede(%rip),%rsi
lea    0xee3(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0A%s %s\0Aby Fernando Merc\C3\AAs\0A\0A\00"
@.str.1 = [12 x i8] c"OpenVaccine\00"
@.str.2 = [5 x i8] c"0.91\00"
@.str.3 = [64 x i8] c"Usage: openvaccine [partition]\0AExample: openvaccine /dev/sdc1\0A\0A\00"
define void @usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0A%s %s\0Aby Fernando Merc\C3\AAs\0A\0A\00"
@.str.1 = [12 x i8] c"OpenVaccine\00"
@.str.2 = [5 x i8] c"0.91\00"
@str = [63 x i8] c"Usage: openvaccine [partition]\0AExample: openvaccine /dev/sdc1\0A\00"
define void @usage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() { printf("Version 1.1\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Version 1.1\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Version 1.1\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int jac_chain_nm2_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm2_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <jac_chain_nm2_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm2_alloc>:
test   %rdi,%rdi
je     110c <jac_chain_nm2_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm2_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
__attribute__((always_)) long PTR_ERR(const void *ptr) { return (long)ptr; }


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

x86 assembly (clang, -O2):
<PTR_ERR>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @PTR_ERR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @PTR_ERR(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
double *fct_3(double *a, double *b, double *c, double *d, double *e, double *f,
              double *g, double *h) {
  (void)a;
  (void)b;
  (void)c;
  (void)d;
  (void)e;
  (void)f;
  (void)g;
  (void)h;
  return d;
}


x86 assembly (clang, -O0):
<fct_3>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct_3>:
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define double* @fct_3(double* nocapture readnone %0, double* nocapture readnone %1, double* nocapture readnone %2, double* readnone returned %3, double* nocapture readnone %4, double* nocapture readnone %5, double* nocapture readnone %6, double* nocapture readnone %7) {
ret double* %3
}
void basicIntake(int power) {}


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

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

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

LLVM IR (-O2):
define void @basicIntake(i32 %0) {
ret void
}
/* Variables and functions */
int dup(int);
int duplicate_handle(int handle) { return dup(handle); }


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

x86 assembly (clang, -O2):
<duplicate_handle>:
jmp    1030 <dup@plt>

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

LLVM IR (-O2):
define i32 @duplicate_handle(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
ret i32 %2
}
/* Type definitions */
struct ReplayGainFilter {
  int dummy;
};

/* Variables and functions */
struct ReplayGainFilter *CreateGainFilter(long);
int /*<<< orphan*/ free(struct ReplayGainFilter *);
int ValidGainFrequency(long samplefreq) {
  struct ReplayGainFilter *gainfilter = CreateGainFilter(samplefreq);
  free(gainfilter);
  return gainfilter != 0;
}


x86 assembly (clang, -O0):
<ValidGainFrequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <CreateGainFilter@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValidGainFrequency>:
push   %rbx
call   1040 <CreateGainFilter@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.ReplayGainFilter = type { i32 }
define i32 @ValidGainFrequency(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.ReplayGainFilter*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call %struct.ReplayGainFilter* @CreateGainFilter(i64 %4)
store %struct.ReplayGainFilter* %5, %struct.ReplayGainFilter** %3
%6 = load %struct.ReplayGainFilter*, %struct.ReplayGainFilter** %3
%7 = call i32 @free(%struct.ReplayGainFilter* %6)
%8 = load %struct.ReplayGainFilter*, %struct.ReplayGainFilter** %3
%9 = icmp ne %struct.ReplayGainFilter* %8, null
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.ReplayGainFilter = type { i32 }
define i32 @ValidGainFrequency(i64 %0) {
%2 = tail call %struct.ReplayGainFilter* @CreateGainFilter(i64 %0)
%3 = tail call i32 @free(%struct.ReplayGainFilter* %2)
%4 = icmp ne %struct.ReplayGainFilter* %2, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double double_add_ulp(double, int /*<<< orphan*/);
int /*<<< orphan*/ sign(double);
double double_increment_minulp(double v0, double inc) {
  double v1;
  v1 = v0 + inc;
  if (v1 == v0)
    v1 = double_add_ulp(v0, sign(inc));
  return v1;
}


x86 assembly (clang, -O0):
<double_increment_minulp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    117c <double_increment_minulp+0x5c>
jp     117c <double_increment_minulp+0x5c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sign@plt>
movsd  -0x20(%rbp),%xmm0
mov    %eax,%edi
call   1040 <double_add_ulp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_increment_minulp>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jne    114c <double_increment_minulp+0x2c>
jp     114c <double_increment_minulp+0x2c>
push   %rax
movapd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
call   1030 <sign@plt>
movsd  (%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <double_add_ulp@plt>
ret

LLVM IR (-O0):
define double @double_increment_minulp(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 = load double, double* %4
%8 = fadd double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = load double, double* %3
%11 = fcmp oeq double %9, %10
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = call i32 @sign(double %14)
%16 = call double @double_add_ulp(double %13, i32 %15)
store double %16, double* %5
br label %17
17: ; preds = %12, %2
%18 = load double, double* %5
ret double %18
}

LLVM IR (-O2):
define double @double_increment_minulp(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fcmp oeq double %3, %0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @sign(double %1)
%7 = tail call double @double_add_ulp(double %0, i32 %6)
br label %8
8: ; preds = %5, %2
%9 = phi double [ %7, %5 ], [ %3, %2 ]
ret double %9
}
int test_imm_1Duint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Duint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x1d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Duint64_highword_mem>:
testb  $0x1d,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Duint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 124554051584
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ g(int *, int);
void f(int m, int *d) {
  int i;
  i = 2;
  while (m != 1) {
    g(&i, m);
    m = m / i;
    *d = *d + 1;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     115a <f+0x4a>
mov    -0x4(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1126 <f+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x2,0xc(%rsp)
cmp    $0x1,%edi
je     114b <f+0x3b>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xc(%rsp),%r14
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <g@plt>
mov    %ebp,%eax
cltd
idivl  0xc(%rsp)
addl   $0x1,(%rbx)
mov    %eax,%ebp
cmp    $0x1,%eax
jne    1130 <f+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%5 = icmp eq i32 %0, 1
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ %0, %2 ]
%8 = call i32 @g(i32* %3, i32 %7)
%9 = load i32, i32* %3
%10 = sdiv i32 %7, %9
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
%13 = icmp eq i32 %10, 1
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SBC_(int /*<<< orphan*/);
int /*<<< orphan*/ c64_memImm();
void SBC_imm(void) {
  c64_memImm();
  SBC_(0);
}


x86 assembly (clang, -O0):
<SBC_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c64_memImm@plt>
xor    %edi,%edi
call   1040 <SBC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SBC_imm>:
push   %rax
xor    %eax,%eax
call   1030 <c64_memImm@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <SBC_@plt>

LLVM IR (-O0):
define void @SBC_imm() {
%1 = call i32 (...) @c64_memImm()
%2 = call i32 @SBC_(i32 0)
ret void
}

LLVM IR (-O2):
define void @SBC_imm() {
%1 = tail call i32 (...) @c64_memImm()
%2 = tail call i32 @SBC_(i32 0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *osMemAlloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<osMemAlloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @osMemAlloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @osMemAlloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
unsigned int arithmetic_byte_add(unsigned char a, unsigned char b,
                                 unsigned char *p_result) {
  assert(p_result);
  unsigned int err_code = 0;
  if (!p_result) {
    err_code = 2;
    goto end;
  }
  *p_result = (a + b);
end:
  return err_code;
}


x86 assembly (clang, -O0):
<arithmetic_byte_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <arithmetic_byte_add+0x3f>
movl   $0x2,-0x14(%rbp)
jmp    1161 <arithmetic_byte_add+0x51>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithmetic_byte_add>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     1133 <arithmetic_byte_add+0x23>
add    %r14b,%bpl
mov    %bpl,(%rbx)
xor    %eax,%eax
jmp    1138 <arithmetic_byte_add+0x28>
mov    $0x2,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @arithmetic_byte_add(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @assert(i8* %8)
store i32 0, i32* %7
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 2, i32* %7
br label %21
13: ; preds = %3
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = add nsw i32 %15, %17
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %6
store i8 %19, i8* %20
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @arithmetic_byte_add(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @assert(i8* %2)
%5 = icmp eq i8* %2, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = add i8 %1, %0
store i8 %7, i8* %2
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 2, %3 ]
ret i32 %9
}
int *foo(int *(f)(void)) { return f(); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    *%rdi

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

LLVM IR (-O2):
define i32* @foo(i32* ()* nocapture %0) {
%2 = tail call i32* %0()
ret i32* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void stw_le_p(void *ptr, int v) {
  uint8_t *p = ptr;
  p[0] = v;
  p[1] = v >> 8;
}


x86 assembly (clang, -O0):
<stw_le_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stw_le_p>:
mov    %esi,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @stw_le_p(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @stw_le_p(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int routes_help(const char *device, int argc, char *argv[]) {
  printf("Access the virtual routing table.\n");
  printf("Commands supported: list, add, remove.\n");
  return 0;
}


x86 assembly (clang, -O0):
<routes_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"Access the virtual routing table.\0A\00"
@.str.1 = [40 x i8] c"Commands supported: list, add, remove.\0A\00"
define i32 @routes_help(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"Access the virtual routing table.\00"
@str.2 = [39 x i8] c"Commands supported: list, add, remove.\00"
define i32 @routes_help(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}