xunge/DecIR huggingface dataset:
int f_997x(void) { return 997; }


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

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

LLVM IR (-O0):
define i32 @f_997x() {
ret i32 997
}

LLVM IR (-O2):
define i32 @f_997x() {
ret i32 997
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ __syscall(scalar_t__ *, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/, int);
time_t time(time_t *time_ptr) {
  time_t result;
  result = (time_t)__syscall(time_ptr, 0, 0, 0, 0x300);
  if (time_ptr != NULL)
    *time_ptr = result;
  return result;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %ecx,%ecx
mov    $0x300,%r8d
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <__syscall@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <time+0x3b>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x300,%r8d
call   1030 <__syscall@plt>
test   %rbx,%rbx
je     112d <time+0x1d>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @time(i64* %0) {
%2 = tail call i64 @__syscall(i64* %0, i32 0, i32 0, i32 0, i32 768)
%3 = icmp eq i64* %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i64 %2, i64* %0
br label %5
5: ; preds = %4, %1
ret i64 %2
}
void gdk_synthesize_window_state() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
size_t file_size(FILE *file) {
  fseek(file, 0L, SEEK_END);
  size_t size = ftell(file);
  rewind(file);
  return size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @file_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i64 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @file_size(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i64 %4
}
/* Type definitions */
typedef int socklen_t;

/* Variables and functions */
int IPV6_RTHDR_TYPE_0;
socklen_t inet6_rth_space(int type, int segments) {
  if ((type != IPV6_RTHDR_TYPE_0) || (segments < 0) || (segments > 127))
    return 0;
  return 8 + (segments * 16);
}


x86 assembly (clang, -O0):
<inet6_rth_space>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed4(%rip),%rcx
cmp    (%rcx),%eax
jne    1130 <inet6_rth_space+0x30>
cmpl   $0x0,-0xc(%rbp)
jl     1130 <inet6_rth_space+0x30>
cmpl   $0x7f,-0xc(%rbp)
jle    113c <inet6_rth_space+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1148 <inet6_rth_space+0x48>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_rth_space>:
mov    0x2ee1(%rip),%rcx
mov    %esi,%eax
shl    $0x4,%eax
or     $0x8,%eax
xor    %edx,%edx
cmp    %edi,(%rcx)
cmovne %edx,%eax
cmp    $0x7f,%esi
cmova  %edx,%eax
ret

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

LLVM IR (-O2):
@IPV6_RTHDR_TYPE_0 = global i32 0
define i32 @inet6_rth_space(i32 %0, i32 %1) {
%3 = load i32, i32* @IPV6_RTHDR_TYPE_0
%4 = icmp ne i32 %3, %0
%5 = icmp ugt i32 %1, 127
%6 = or i1 %5, %4
%7 = shl nsw i32 %1, 4
%8 = or i32 %7, 8
%9 = select i1 %6, i32 0, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ h_td_end();
int /*<<< orphan*/ h_td_start(char const *, int);
int /*<<< orphan*/ printf(char *, int);
void h_td_int(int val, const char *class, int colspan) {
  h_td_start(class, colspan);
  printf("%d", val);
  h_td_end();
}


x86 assembly (clang, -O0):
<h_td_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <h_td_start@plt>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <h_td_end@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_td_int>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <h_td_start@plt>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <h_td_end@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @h_td_int(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @h_td_start(i8* %1, i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (...) @h_td_end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int dpseekwrite(int, int, int *, int);
int dpseekwritenum(int fd, int off, int num) {
  assert(fd >= 0);
  return dpseekwrite(fd, off, &num, ((int)sizeof(int)));
}


x86 assembly (clang, -O0):
<dpseekwritenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <dpseekwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpseekwritenum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,0x4(%rsp)
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
lea    0x4(%rsp),%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x4,%ecx
call   1040 <dpseekwrite@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dpseekwritenum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = xor i32 %0, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @assert(i32 %6)
%8 = call i32 @dpseekwrite(i32 %0, i32 %1, i32* %4, i32 4)
ret i32 %8
}
int iscntrl(int c) { return ((c >= 0x00 && c <= 0x1F) || c == 0x7F); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
char *hash_plugin_detailed(void) {
  return ("luks - LUKS encrypted block device plugin\n"
          "------------------------------------------------\n"
          "Use this module to crack LUKS encrypted partitions\n"
          "Input should be a LUKS device file specified with -f\n"
          "Warning: currently only aes256/cbc-essiv:sha256 images supported!\n"
          "Known software that uses this password hashing method:\n"
          "cryptsetup/LUKS\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [378 x i8] c"luks - LUKS encrypted block device plugin\0A------------------------------------------------\0AUse this module to crack LUKS encrypted partitions\0AInput should be a LUKS device file specified with -f\0AWarning: currently only aes256/cbc-essiv:sha256 images supported!\0AKnown software that uses this password hashing method:\0Acryptsetup/LUKS\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [378 x i8] c"luks - LUKS encrypted block device plugin\0A------------------------------------------------\0AUse this module to crack LUKS encrypted partitions\0AInput should be a LUKS device file specified with -f\0AWarning: currently only aes256/cbc-essiv:sha256 images supported!\0AKnown software that uses this password hashing method:\0Acryptsetup/LUKS\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double exp_rn(double);
double exp_ru(double x) { return exp_rn(x); }


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

x86 assembly (clang, -O2):
<exp_ru>:
jmp    1030 <exp_rn@plt>

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

LLVM IR (-O2):
define double @exp_ru(double %0) {
%2 = tail call double @exp_rn(double %0)
ret double %2
}
/* Variables and functions */
int do_send(int, char *, char const *, char const *);
int irc_allowspeak(int fd, const char *channel, const char *nick, char speak) {
  if (speak)
    return do_send(fd, "MODE %s +v %s", channel, nick);
  else
    return do_send(fd, "MODE %s -v %s", channel, nick);
}


x86 assembly (clang, -O0):
<irc_allowspeak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
cmpb   $0x0,-0x19(%rbp)
je     1151 <irc_allowspeak+0x41>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xebc(%rip),%rsi
call   1030 <do_send@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <irc_allowspeak+0x5b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1030 <do_send@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_allowspeak>:
mov    %rdx,%rax
mov    %rsi,%rdx
test   %cl,%cl
lea    0xeef(%rip),%rcx
lea    0xeda(%rip),%rsi
cmove  %rcx,%rsi
mov    %rax,%rcx
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"MODE %s +v %s\00"
@.str.1 = [14 x i8] c"MODE %s -v %s\00"
define i32 @irc_allowspeak(i32 %0, i8* %1, i8* %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8 %3, i8* %9
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @do_send(i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
store i32 %16, i32* %5
br label %22
17: ; preds = %4
%18 = load i32, i32* %6
%19 = load i8*, i8** %7
%20 = load i8*, i8** %8
%21 = call i32 @do_send(i32 %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %20)
store i32 %21, i32* %5
br label %22
22: ; preds = %17, %12
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@.str = [14 x i8] c"MODE %s +v %s\00"
@.str.1 = [14 x i8] c"MODE %s -v %s\00"
define i32 @irc_allowspeak(i32 %0, i8* %1, i8* %2, i8 signext %3) {
%5 = icmp eq i8 %3, 0
%6 = select i1 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @do_send(i32 %0, i8* %6, i8* %1, i8* %2)
ret i32 %7
}
int BITSET_SIZE(int bits) {
  return (bits + (sizeof(unsigned long) * 8) - 1) / (sizeof(unsigned long) * 8);
}


x86 assembly (clang, -O0):
<BITSET_SIZE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x40,%rax
sub    $0x1,%rax
shr    $0x6,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BITSET_SIZE>:
movslq %edi,%rax
add    $0x3f,%rax
shr    $0x6,%rax
ret

LLVM IR (-O0):
define i32 @BITSET_SIZE(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = add i64 %4, 64
%6 = sub i64 %5, 1
%7 = udiv i64 %6, 64
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @BITSET_SIZE(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 63
%4 = lshr i64 %3, 6
%5 = trunc i64 %4 to i32
ret i32 %5
}
int jac_chain_nm8_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 2;
  if (n_out)
    *n_out = 2;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm8_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm8_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm8_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm8_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm8_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm8_init>:
test   %rdi,%rdi
je     110b <jac_chain_nm8_init+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm8_init+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm8_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm8_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @jac_chain_nm8_init(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 2, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 0, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @jac_chain_nm8_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pic_acknowledge(int);
void interrupt_acknowledge(int i) {
  if (i < 32) {
  } else {
    pic_acknowledge(i - 32);
  }
}


x86 assembly (clang, -O0):
<interrupt_acknowledge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    112a <interrupt_acknowledge+0x1a>
jmp    1135 <interrupt_acknowledge+0x25>
mov    -0x4(%rbp),%edi
sub    $0x20,%edi
call   1030 <pic_acknowledge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_acknowledge>:
cmp    $0x20,%edi
jge    1116 <interrupt_acknowledge+0x6>
ret
add    $0xffffffe0,%edi
jmp    1030 <pic_acknowledge@plt>

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

LLVM IR (-O2):
define void @interrupt_acknowledge(i32 %0) {
%2 = icmp slt i32 %0, 32
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -32
%5 = tail call i32 @pic_acknowledge(i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
main() {
  int i = 1;
  int x = 5;
  while (i--) {
    int hello;
    if (x == 5) {
      int pad = 0;
      f();
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     115e <main+0x4e>
cmpl   $0x5,-0xc(%rbp)
jne    1159 <main+0x49>
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
int rapl_get_cpu_model();
char rapl_dram_available() {
  int cpu_id = rapl_get_cpu_model();
  if (cpu_id == 0x2a || cpu_id == 0x3a)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<rapl_dram_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rapl_get_cpu_model@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
je     1136 <rapl_dram_available+0x26>
cmpl   $0x3a,-0x8(%rbp)
jne    113f <rapl_dram_available+0x2f>
movb   $0x0,-0x1(%rbp)
jmp    1143 <rapl_dram_available+0x33>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_dram_available>:
push   %rax
xor    %eax,%eax
call   1030 <rapl_get_cpu_model@plt>
and    $0xffffffef,%eax
cmp    $0x2a,%eax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @rapl_dram_available() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 (...) @rapl_get_cpu_model()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 42
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 58
br i1 %8, label %9, label %10
9: ; preds = %6, %0
store i8 0, i8* %1
br label %11
10: ; preds = %6
store i8 1, i8* %1
br label %11
11: ; preds = %10, %9
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @rapl_dram_available() {
%1 = tail call i32 (...) @rapl_get_cpu_model()
%2 = and i32 %1, -17
%3 = icmp ne i32 %2, 42
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M408_f(char *s) {
  debug("M408_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M408_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M408_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M408_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M408_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M408_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M408_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int xor (int a, int b) { return a ? !b : b; }


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <xor+0x2a>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <xor+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
test   %edi,%edi
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @xor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
br label %14
12: ; preds = %2
%13 = load i32, i32* %4
br label %14
14: ; preds = %12, %7
%15 = phi i32 [ %11, %7 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @xor(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 %1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ len;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int calc_llen(size_t len) {
  int n = 0;
  do {
    n++;
  } while (len >>= 7);
  assert(n <= (int)sizeof(len));
  return n;
}


x86 assembly (clang, -O0):
<calc_llen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x7,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1123 <calc_llen+0x13>
cmpl   $0x8,-0xc(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_llen>:
push   %rbx
mov    $0xffffffff,%ebx
mov    %rdi,%rax
nopl   0x0(%rax)
shr    $0x7,%rax
add    $0x1,%ebx
cmp    $0x7f,%rdi
mov    %rax,%rdi
ja     1120 <calc_llen+0x10>
xor    %edi,%edi
cmp    $0x8,%ebx
setb   %dil
call   1030 <assert@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @calc_llen(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = lshr i64 %3, 7
%7 = icmp ult i64 %3, 128
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = icmp ult i32 %4, 8
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret i32 %5
}
int MUS_UnregisterSong(int handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MUS_UnregisterSong(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prgname) {
  fprintf(
      stderr,
      "usage: %s [OPTIONS]\n\n"
      "-c <config>  specify configuration file\n"
      "-f <input>   input image file\n"
      "-o <output>  output file\n"
      "-b           add barebox header to image. If used, barebox recognizes\n"
      "             the image as regular barebox image which can be used as\n"
      "             second stage image\n"
      "-h           this help\n",
      prgname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [311 x i8] c"usage: %s [OPTIONS]\0A\0A-c <config> specify configuration file\0A-f <input> input image file\0A-o <output> output file\0A-b add barebox header to image. If used, barebox recognizes\0A the image as regular barebox image which can be used as\0A second stage image\0A-h this help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([311 x i8], [311 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [311 x i8] c"usage: %s [OPTIONS]\0A\0A-c <config> specify configuration file\0A-f <input> input image file\0A-o <output> output file\0A-b add barebox header to image. If used, barebox recognizes\0A the image as regular barebox image which can be used as\0A second stage image\0A-h this help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([311 x i8], [311 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gui_delete_message();
int /*<<< orphan*/ gui_draw_message(char *);
int gui_wait_for_key(char *);
int gui_confirm(char *msg) {
  int c;
  gui_draw_message(msg);
  c = gui_wait_for_key("yYnN");
  gui_delete_message();
  return ((c == 'y') || (c == 'Y')) ? 1 : 0;
}


x86 assembly (clang, -O0):
<gui_confirm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gui_draw_message@plt>
lea    0xeb4(%rip),%rdi
call   1040 <gui_wait_for_key@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <gui_delete_message@plt>
mov    $0x1,%al
cmpl   $0x79,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1174 <gui_confirm+0x44>
cmpl   $0x59,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_confirm>:
push   %rbx
call   1030 <gui_draw_message@plt>
lea    0xec3(%rip),%rdi
call   1040 <gui_wait_for_key@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <gui_delete_message@plt>
and    $0xffffffdf,%ebx
xor    %eax,%eax
cmp    $0x59,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"yYnN\00"
define i32 @gui_confirm(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @gui_draw_message(i8* %4)
%6 = call i32 @gui_wait_for_key(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %3
%7 = call i32 (...) @gui_delete_message()
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 121
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 89
br label %13
13: ; preds = %10, %1
%14 = phi i1 [ true, %1 ], [ %12, %10 ]
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"yYnN\00"
define i32 @gui_confirm(i8* %0) {
%2 = tail call i32 @gui_draw_message(i8* %0)
%3 = tail call i32 @gui_wait_for_key(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @gui_delete_message()
%5 = and i32 %3, -33
%6 = icmp eq i32 %5, 89
%7 = zext i1 %6 to i32
ret i32 %7
}
char *strlwr(char *s) {
  char *str;
  str = s;
  while (*str != '\0') {
    if (*str >= 'A' && *str <= 'Z') {
      *str += 'a' - 'A';
    }
    str++;
  }
  return s;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <strlwr+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <strlwr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <strlwr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlwr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strlwr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strlwr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strlwr+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strlwr+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strlwr+0x10>
ret

LLVM IR (-O0):
define i8* @strlwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ generate_random_salt(char *, int);
char *make_des_salt(void) {
  static char salt[3];
  generate_random_salt(salt, 2);
  salt[2] = '\0';
  return salt;
}


x86 assembly (clang, -O0):
<make_des_salt>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
mov    $0x2,%esi
call   1030 <generate_random_salt@plt>
movb   $0x0,0x2eff(%rip)
lea    0x2ef6(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_des_salt>:
push   %rbx
lea    0x2f11(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <generate_random_salt@plt>
movb   $0x0,0x2eff(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@make_des_salt.salt = internal global [3 x i8] zeroinitializer
define i8* @make_des_salt() {
%1 = call i32 @generate_random_salt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0), i32 2)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0)
}

LLVM IR (-O2):
@make_des_salt.salt = internal global [3 x i8] zeroinitializer
define i8* @make_des_salt() {
%1 = tail call i32 @generate_random_salt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0), i32 2)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0)
}
yyerror(s) char *s;
{
  printf("\n%s \n", s);
  printf("\n-------------------------------------------------------------------"
         "--------------\n");
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%s \0A\00"
@str = [83 x i8] c"\0A---------------------------------------------------------------------------------\00"
define i32 @yyerror(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_DAint64_highword_reg(long long val) {
  return ((val >> 32) & (0xDA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DAint64_highword_reg>:
movabs $0xda00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DAint64_highword_reg(i64 %0) {
%2 = and i64 %0, 936302870528
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int variable = 0;
  int p = 1;
  while (1) {
    if (p)
      break;
    variable = variable + 1;
    if (variable == 10)
      break;
  }
  printf("%d\n", variable);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113c <main+0x2c>
jmp    1159 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1154 <main+0x44>
jmp    1159 <main+0x49>
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char **argv) {
  printf(
      "Usage: %s [options] [phoenix_image]\n"
      "	-v	verbose\n"
      "	-q	quiet\n"
      "	-p N	part number\n"
      "	-o X	destination directory, file or pattern (%%d for part number)\n"
      "	-s	save all parts\n",
      argv[0]);
}


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

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

LLVM IR (-O0):
@.str = [163 x i8] c"Usage: %s [options] [phoenix_image]\0A\09-v\09verbose\0A\09-q\09quiet\0A\09-p N\09part number\0A\09-o X\09destination directory, file or pattern (%%d for part number)\0A\09-s\09save all parts\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [163 x i8] c"Usage: %s [options] [phoenix_image]\0A\09-v\09verbose\0A\09-q\09quiet\0A\09-p N\09part number\0A\09-o X\09destination directory, file or pattern (%%d for part number)\0A\09-s\09save all parts\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
unsigned long get_ipb_clock();
unsigned long fsl_get_i2c_freq(void) { return get_ipb_clock(); }


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

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

LLVM IR (-O0):
define i64 @fsl_get_i2c_freq() {
%1 = call i64 (...) @get_ipb_clock()
ret i64 %1
}

LLVM IR (-O2):
define i64 @fsl_get_i2c_freq() {
%1 = tail call i64 (...) @get_ipb_clock()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *,
                           char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: tr [-Ccsu] string1 string2",
                "       tr [-Ccu] -d string1", "       tr [-Ccu] -s string1",
                "       tr [-Ccu] -ds string1 string2");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeed(%rip),%rcx
lea    0xf02(%rip),%r8
lea    0xf17(%rip),%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xed5(%rip),%rdx
lea    0xef0(%rip),%rcx
lea    0xf05(%rip),%r8
lea    0xf1a(%rip),%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [34 x i8] c"usage: tr [-Ccsu] string1 string2\00"
@.str.2 = [28 x i8] c" tr [-Ccu] -d string1\00"
@.str.3 = [28 x i8] c" tr [-Ccu] -s string1\00"
@.str.4 = [37 x i8] c" tr [-Ccu] -ds string1 string2\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [34 x i8] c"usage: tr [-Ccsu] string1 string2\00"
@.str.2 = [28 x i8] c" tr [-Ccu] -d string1\00"
@.str.3 = [28 x i8] c" tr [-Ccu] -s string1\00"
@.str.4 = [37 x i8] c" tr [-Ccu] -ds string1 string2\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned char getc();
int gets(unsigned char *buf) {
  int i = 0;
  unsigned char c;
  do {
    c = getc();
    if (c == '\n')
      c = '\0';
    buf[i++] = c;
  } while (c);
  return i - 1;
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getc@plt>
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
cmp    $0xa,%eax
jne    113e <gets+0x2e>
movb   $0x0,-0xd(%rbp)
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0xc(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
cmpb   $0x0,-0xd(%rbp)
jne    1123 <gets+0x13>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
xor    %r14d,%r14d
nop
xor    %eax,%eax
call   1030 <getc@plt>
cmp    $0xa,%al
movzbl %al,%eax
cmove  %r14d,%eax
mov    %al,(%rbx)
add    $0x1,%ebp
add    $0x1,%rbx
test   %al,%al
jne    1120 <gets+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gets(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = tail call zeroext i8 (...) @getc()
%5 = icmp eq i8 %4, 10
%6 = select i1 %5, i8 0, i8 %4
%7 = add nuw i64 %3, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %6, i8* %8
%9 = icmp eq i8 %6, 0
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = trunc i64 %3 to i32
ret i32 %11
}