xunge/DecIR huggingface dataset:
int isord2(long *v, long n) {
  for (long i = 1; i < n; i++)
    if (v[i - 1] > v[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isord2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1166 <isord2+0x66>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jle    1150 <isord2+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116d <isord2+0x6d>
jmp    1155 <isord2+0x55>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <isord2+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isord2>:
mov    $0x1,%eax
cmp    $0x2,%rsi
jl     1140 <isord2+0x40>
mov    0x8(%rdi),%r8
xor    %eax,%eax
cmp    %r8,(%rdi)
jg     1140 <isord2+0x40>
mov    $0x2,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
cmp    %rax,%rsi
je     1138 <isord2+0x38>
mov    (%rdi,%rdx,8),%rcx
lea    0x1(%rdx),%rax
cmp    %rcx,%r8
mov    %rcx,%r8
jle    1120 <isord2+0x20>
xor    %eax,%eax
cmp    %rsi,%rdx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @isord2(i64* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = load i64, i64* %0
%6 = getelementptr inbounds i64, i64* %0, i64 1
%7 = load i64, i64* %6
%8 = icmp sgt i64 %5, %7
br i1 %8, label %21, label %9
9: ; preds = %4, %13
%10 = phi i64 [ %17, %13 ], [ 2, %4 ]
%11 = phi i64 [ %15, %13 ], [ %7, %4 ]
%12 = icmp eq i64 %10, %1
br i1 %12, label %18, label %13
13: ; preds = %9
%14 = getelementptr inbounds i64, i64* %0, i64 %10
%15 = load i64, i64* %14
%16 = icmp sgt i64 %11, %15
%17 = add nuw nsw i64 %10, 1
br i1 %16, label %18, label %9
18: ; preds = %9, %13
%19 = icmp sge i64 %10, %1
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %4, %2
%22 = phi i32 [ 1, %2 ], [ 0, %4 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(char **argv) {
  printf("Usage: %s OPTIONS patterns...\n\n"
         "   -b  --begin     STRING    Use STRING as result begin separator\n"
         "                             (' >' is default)\n"
         "   -d  --dot                 Dump scanner as graph for "
         "visualizations in\n"
         "                             Graphviz dot-format\n"
         "   -e  --end       STRING    Use STRING as result end separator\n"
         "                             ('<\\n' is default)\n"
         "   -f  --file      FILENAME  Read input from FILENAME\n"
         "   -h  --help                Show this help, and exit.\n"
         "   -i  --input     INPUT     Use string INPUT as input.\n"
         "   -V  --version             Show version info and exit.\n"
         "\n",
         *argv);
}


x86 assembly (clang, -O0):
<help>:
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):
<help>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [602 x i8] c"Usage: %s OPTIONS patterns...\0A\0A -b --begin STRING Use STRING as result begin separator\0A (' >' is default)\0A -d --dot Dump scanner as graph for visualizations in\0A Graphviz dot-format\0A -e --end STRING Use STRING as result end separator\0A ('<\\n' is default)\0A -f --file FILENAME Read input from FILENAME\0A -h --help Show this help, and exit.\0A -i --input INPUT Use string INPUT as input.\0A -V --version Show version info and exit.\0A\0A\00"
define void @help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([602 x i8], [602 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [602 x i8] c"Usage: %s OPTIONS patterns...\0A\0A -b --begin STRING Use STRING as result begin separator\0A (' >' is default)\0A -d --dot Dump scanner as graph for visualizations in\0A Graphviz dot-format\0A -e --end STRING Use STRING as result end separator\0A ('<\\n' is default)\0A -f --file FILENAME Read input from FILENAME\0A -h --help Show this help, and exit.\0A -i --input INPUT Use string INPUT as input.\0A -V --version Show version info and exit.\0A\0A\00"
define void @help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([602 x i8], [602 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int s) { printf("catch sig %d\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"catch sig %d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *_s2_f2cstr(char *, long);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ s2iden(char *);
void s2iden_(char *textra, long int textlen) {
  char *ttex = _s2_f2cstr(textra, textlen);
  s2iden(ttex);
  free(ttex);
}


x86 assembly (clang, -O0):
<s2iden_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <_s2_f2cstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <s2iden@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2iden_>:
push   %rbx
call   1050 <_s2_f2cstr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <s2iden@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @s2iden_(i8* %0, i64 %1) {
%3 = tail call i8* @_s2_f2cstr(i8* %0, i64 %1)
%4 = tail call i32 @s2iden(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}
int lostlink(char *namelink) { return 0x0; }


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

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

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

LLVM IR (-O2):
define i32 @lostlink(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_int2mulfunc(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_int2mulfunc() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_int2mulfunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long long f4(unsigned long long x,
                                                   unsigned long long y) {
  unsigned long long r = x - y;
  if (y >= r)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1141 <f4+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rbx
mov    %rdi,%rbx
sub    %rsi,%rbx
cmp    %rsi,%rbx
ja     1123 <f4+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f4(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = icmp ugt i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
const char *earth(void) { return "Earth"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Earth\00"
define i8* @earth() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Earth\00"
define i8* @earth() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ wcstoll(int /*<<< orphan*/ const *, int /*<<< orphan*/ **, int);
unsigned long wcstoul(const wchar_t *str, wchar_t **endptr, int base) {
  return (unsigned long)wcstoll(str, endptr, base);
}


x86 assembly (clang, -O0):
<wcstoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <wcstoll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstoul>:
jmp    1030 <wcstoll@plt>

LLVM IR (-O0):
define i64 @wcstoul(i32* %0, i32** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32
store i32* %0, i32** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32**, i32*** %5
%9 = load i32, i32* %6
%10 = call i64 @wcstoll(i32* %7, i32** %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @wcstoul(i32* %0, i32** %1, i32 %2) {
%4 = tail call i64 @wcstoll(i32* %0, i32** %1, i32 %2)
ret i64 %4
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
int /*<<< orphan*/ is_hash(struct item *);
void check_is_hash(struct item *item) {
  if (!is_hash(item))
    abort_crypto_lib("Presented item is not a hash");
}


x86 assembly (clang, -O0):
<check_is_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_hash@plt>
cmp    $0x0,%eax
jne    114a <check_is_hash+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_is_hash>:
push   %rax
call   1030 <is_hash@plt>
test   %eax,%eax
je     112c <check_is_hash+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <abort_crypto_lib@plt>

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [29 x i8] c"Presented item is not a hash\00"
define void @check_is_hash(%struct.item* %0) {
%2 = alloca %struct.item*
store %struct.item* %0, %struct.item** %2
%3 = load %struct.item*, %struct.item** %2
%4 = call i32 @is_hash(%struct.item* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [29 x i8] c"Presented item is not a hash\00"
define void @check_is_hash(%struct.item* %0) {
%2 = tail call i32 @is_hash(%struct.item* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
double mm_to_feet(int mm) { return mm * 0.00328084; }


x86 assembly (clang, -O0):
<mm_to_feet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_to_feet>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mm_to_feet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 3.280840e-03
ret double %5
}

LLVM IR (-O2):
define double @mm_to_feet(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 3.280840e-03
ret double %3
}
double pown(double power, double n) {
  double r = 1;
  while (power-- > 0)
    r *= n;
  return r;
}


x86 assembly (clang, -O0):
<pown>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm2
movaps %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1155 <pown+0x55>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    111b <pown+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pown>:
xorpd  %xmm3,%xmm3
movsd  0xef4(%rip),%xmm2
ucomisd %xmm3,%xmm0
jbe    112e <pown+0x2e>
movsd  0xeee(%rip),%xmm4
nopw   0x0(%rax,%rax,1)
addsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm2
ucomisd %xmm3,%xmm0
ja     1120 <pown+0x20>
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @pown(double %0, double %1) {
%3 = fcmp ogt double %0, 0.000000e+00
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi double [ %8, %4 ], [ 1.000000e+00, %2 ]
%6 = phi double [ %7, %4 ], [ %0, %2 ]
%7 = fadd double %6, -1.000000e+00
%8 = fmul double %5, %1
%9 = fcmp ogt double %7, 0.000000e+00
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi double [ 1.000000e+00, %2 ], [ %8, %4 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int LOGDebug_file_exists(void) {
  if (access("/tmp/gwlog", F_OK) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<LOGDebug_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1143 <LOGDebug_file_exists+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <LOGDebug_file_exists+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOGDebug_file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/tmp/gwlog\00"
@F_OK = global i32 0
define i32 @LOGDebug_file_exists() {
%1 = alloca i32
%2 = load i32, i32* @F_OK
%3 = call i64 @access(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"/tmp/gwlog\00"
@F_OK = global i32 0
define i32 @LOGDebug_file_exists() {
%1 = load i32, i32* @F_OK
%2 = tail call i64 @access(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void audio_deinit() {}


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

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

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

LLVM IR (-O2):
define void @audio_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void endgraphics(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @endgraphics() {
%1 = tail call i32 (...) @endwin()
ret void
}
void ARGBInterpolate() {}


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

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

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

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

/* Variables and functions */
int __get_unaligned_le32(int /*<<< orphan*/ const *);
u_int64_t __get_unaligned_le64(const u_char *p) {
  return (u_int64_t)__get_unaligned_le32(p + 4) << 32 | __get_unaligned_le32(p);
}


x86 assembly (clang, -O0):
<__get_unaligned_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <__get_unaligned_le32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__get_unaligned_le32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_unaligned_le64>:
push   %rbx
mov    %rdi,%rbx
add    $0x10,%rdi
call   1030 <__get_unaligned_le32@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__get_unaligned_le32@plt>

LLVM IR (-O0):
define i32 @__get_unaligned_le64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = call i32 @__get_unaligned_le32(i32* %4)
%6 = shl i32 %5, 32
%7 = load i32*, i32** %2
%8 = call i32 @__get_unaligned_le32(i32* %7)
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__get_unaligned_le64(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = tail call i32 @__get_unaligned_le32(i32* %2)
%4 = tail call i32 @__get_unaligned_le32(i32* %0)
ret i32 poison
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *p = s;
  while (*p != '\0')
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<strlen>:
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     1131 <strlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(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 = %10, %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 %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void IntTrigger(uint32_t ui32Interrupt) {
  ;
  (*((volatile uint32_t *)(0xE000EF00))) = ui32Interrupt - 16;
}


x86 assembly (clang, -O0):
<IntTrigger>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
sub    $0x10,%rcx
mov    $0xe000ef00,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntTrigger>:
add    $0xfffffffffffffff0,%rdi
mov    $0xe000ef00,%eax
mov    %rdi,(%rax)
ret

LLVM IR (-O0):
define void @IntTrigger(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 16
store volatile i64 %4, i64* inttoptr (i64 3758157568 to i64*)
ret void
}

LLVM IR (-O2):
define void @IntTrigger(i64 %0) {
%2 = add nsw i64 %0, -16
store volatile i64 %2, i64* inttoptr (i64 3758157568 to i64*)
ret void
}
int dup(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dup(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *timlib_get_in_clause(char *);
void output_in_clause_parameter(char *argv_1) {
  printf("in (%s)\n", timlib_get_in_clause(argv_1));
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"in (%s)\0A\00"
define void @output_in_clause_parameter(i8* %0) {
%2 = tail call i8* @timlib_get_in_clause(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
float raylevel() { return 0; }


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

x86 assembly (clang, -O2):
<raylevel>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @raylevel() {
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @raylevel() {
ret float 0.000000e+00
}
long int sysconf(int name) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @sysconf(i32 %0) {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ send_to_socket(int /*<<< orphan*/, void *,
                                  int /*<<< orphan*/);
int64_t send_msg(int64_t s, void *data, int64_t length) {
  return send_to_socket(s, data, length);
}


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

x86 assembly (clang, -O2):
<send_msg>:
jmp    1030 <send_to_socket@plt>

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

LLVM IR (-O2):
define i32 @send_msg(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send_to_socket(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct Cyc_Set_Set {
  int dummy;
};

/* Variables and functions */
int Cyc_Set_setcmp(struct Cyc_Set_Set *, struct Cyc_Set_Set *);
int Cyc_Set_equals(struct Cyc_Set_Set *s1, struct Cyc_Set_Set *s2) {
  int _T0;
  int _T1;
  _T0 = Cyc_Set_setcmp(s1, s2);
  _T1 = _T0 == 0;
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_Set_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_Set_setcmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Set_equals>:
push   %rax
call   1030 <Cyc_Set_setcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Set_Set = type { i32 }
define i32 @Cyc_Set_equals(%struct.Cyc_Set_Set* %0, %struct.Cyc_Set_Set* %1) {
%3 = alloca %struct.Cyc_Set_Set*
%4 = alloca %struct.Cyc_Set_Set*
%5 = alloca i32
%6 = alloca i32
store %struct.Cyc_Set_Set* %0, %struct.Cyc_Set_Set** %3
store %struct.Cyc_Set_Set* %1, %struct.Cyc_Set_Set** %4
%7 = load %struct.Cyc_Set_Set*, %struct.Cyc_Set_Set** %3
%8 = load %struct.Cyc_Set_Set*, %struct.Cyc_Set_Set** %4
%9 = call i32 @Cyc_Set_setcmp(%struct.Cyc_Set_Set* %7, %struct.Cyc_Set_Set* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
%struct.Cyc_Set_Set = type { i32 }
define i32 @Cyc_Set_equals(%struct.Cyc_Set_Set* %0, %struct.Cyc_Set_Set* %1) {
%3 = tail call i32 @Cyc_Set_setcmp(%struct.Cyc_Set_Set* %0, %struct.Cyc_Set_Set* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
bool character_within_range(char character, char start, char end) {
  if (character < start) {
    return false;
  }
  if (character > end) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<character_within_range>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    1131 <character_within_range+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1154 <character_within_range+0x54>
movsbl -0x5(%rbp),%eax
movsbl -0x7(%rbp),%ecx
cmp    %ecx,%eax
jle    114d <character_within_range+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1154 <character_within_range+0x54>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<character_within_range>:
cmp    %sil,%dil
setge  %al
cmp    %dl,%dil
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @character_within_range(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = icmp sge i8 %0, %1
%5 = icmp sle i8 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ capitalize(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char string[100], find, replace;
  printf("Enter 100 character string: ");
  gets(string);
  printf("%s\n", string);
  capitalize(string);
  printf("%s\n", string);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x70(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <capitalize@plt>
lea    -0x70(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <capitalize@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter 100 character string: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca i8
%3 = alloca i8
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%10 = call i32 @capitalize(i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter 100 character string: \00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @puts(i8* %2)
%6 = call i32 @capitalize(i8* %2)
%7 = call i32 @puts(i8* %2)
ret void
}
void debug_object_deactivate(void *addr, struct debug_obj_descr *descr) {}


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

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

LLVM IR (-O0):
%struct.debug_obj_descr = type opaque
define void @debug_object_deactivate(i8* %0, %struct.debug_obj_descr* %1) {
%3 = alloca i8*
%4 = alloca %struct.debug_obj_descr*
store i8* %0, i8** %3
store %struct.debug_obj_descr* %1, %struct.debug_obj_descr** %4
ret void
}

LLVM IR (-O2):
%struct.debug_obj_descr = type opaque
define void @debug_object_deactivate(i8* nocapture %0, %struct.debug_obj_descr* nocapture %1) {
ret void
}
int notend(const char c) { return c != '\0'; }


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

x86 assembly (clang, -O2):
<notend>:
xor    %eax,%eax
test   %dil,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @notend(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @notend(i8 signext %0) {
%2 = icmp ne i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int read(int, unsigned short *, int);
unsigned short wma_convert_short(unsigned char *);
int wma_file_read_short(int fd, unsigned short int *psi) {
  uint32_t len;
  int ret;
  len = sizeof(unsigned short int);
  ret = read(fd, psi, len);
  if ((ret < 0) || (ret != len)) {
    return 0;
  }
  *psi = wma_convert_short((unsigned char *)psi);
  return 1;
}


x86 assembly (clang, -O0):
<wma_file_read_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     115e <wma_file_read_short+0x3e>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     116a <wma_file_read_short+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1184 <wma_file_read_short+0x64>
mov    -0x10(%rbp),%rdi
call   1030 <wma_convert_short@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wma_file_read_short>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2,%edx
call   1040 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jne    1147 <wma_file_read_short+0x27>
mov    %rbx,%rdi
call   1030 <wma_convert_short@plt>
mov    %ax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wma_file_read_short(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i16* %1, i16** %5
store i32 2, i32* %6
%8 = load i32, i32* %4
%9 = load i16*, i16** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i16* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14, %2
store i32 0, i32* %3
br label %24
19: ; preds = %14
%20 = load i16*, i16** %5
%21 = bitcast i16* %20 to i8*
%22 = call zeroext i16 @wma_convert_short(i8* %21)
%23 = load i16*, i16** %5
store i16 %22, i16* %23
store i32 1, i32* %3
br label %24
24: ; preds = %19, %18
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @wma_file_read_short(i32 %0, i16* %1) {
%3 = tail call i32 @read(i32 %0, i16* %1, i32 2)
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = bitcast i16* %1 to i8*
%7 = tail call zeroext i16 @wma_convert_short(i8* %6)
store i16 %7, i16* %1
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
struct memory {
  int dummy;
};

/* Variables and functions */
unsigned char memory_get_interrupt_flag(struct memory *);
int /*<<< orphan*/ memory_set_d8(struct memory *, unsigned short,
                                 unsigned char);
void memory_clear_interrupt_flag(struct memory *mem, unsigned char mask) {
  unsigned char iflag = memory_get_interrupt_flag(mem);
  memory_set_d8(mem, ((unsigned short)0xFF0F), iflag & ~((unsigned char)0x01));
}


x86 assembly (clang, -O0):
<memory_clear_interrupt_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <memory_get_interrupt_flag@plt>
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xa(%rbp),%eax
and    $0xfffffffe,%eax
mov    $0xff0f,%esi
movzbl %al,%edx
call   1040 <memory_set_d8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_clear_interrupt_flag>:
push   %rbx
mov    %rdi,%rbx
call   1030 <memory_get_interrupt_flag@plt>
and    $0xfe,%al
movzbl %al,%edx
mov    %rbx,%rdi
mov    $0xff0f,%esi
pop    %rbx
jmp    1040 <memory_set_d8@plt>

LLVM IR (-O0):
%struct.memory = type { i32 }
define void @memory_clear_interrupt_flag(%struct.memory* %0, i8 zeroext %1) {
%3 = alloca %struct.memory*
%4 = alloca i8
%5 = alloca i8
store %struct.memory* %0, %struct.memory** %3
store i8 %1, i8* %4
%6 = load %struct.memory*, %struct.memory** %3
%7 = call zeroext i8 @memory_get_interrupt_flag(%struct.memory* %6)
store i8 %7, i8* %5
%8 = load %struct.memory*, %struct.memory** %3
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = and i32 %10, -2
%12 = trunc i32 %11 to i8
%13 = call i32 @memory_set_d8(%struct.memory* %8, i16 zeroext -241, i8 zeroext %12)
ret void
}

LLVM IR (-O2):
%struct.memory = type { i32 }
define void @memory_clear_interrupt_flag(%struct.memory* %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @memory_get_interrupt_flag(%struct.memory* %0)
%4 = and i8 %3, -2
%5 = tail call i32 @memory_set_d8(%struct.memory* %0, i16 zeroext -241, i8 zeroext %4)
ret void
}
/* Variables and functions */
int rdm(int);
void sample(int range, int k, int *out) {
  int i;
  i = rdm(range);
  for (int j = 0; j < k; j++) {
    out[j] = i;
    i = rdm(range);
  }
}


x86 assembly (clang, -O0):
<sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rdm@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1167 <sample+0x57>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%edi
call   1030 <rdm@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <sample+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r15
mov    %esi,%r14d
mov    %edi,%r12d
call   1030 <rdm@plt>
test   %r14d,%r14d
jle    1145 <sample+0x35>
mov    %r14d,%ebx
xor    %ebp,%ebp
mov    %eax,(%r15,%rbp,4)
mov    %r12d,%edi
call   1030 <rdm@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <sample+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sample(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @rdm(i32 %0)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = zext i32 %1 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %14, %9 ]
%11 = phi i32 [ %4, %6 ], [ %13, %9 ]
%12 = getelementptr inbounds i32, i32* %2, i64 %10
store i32 %11, i32* %12
%13 = tail call i32 @rdm(i32 %0)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %9
}
/* Variables and functions */
unsigned long hash_long32(unsigned long);
unsigned long hash_long64(unsigned long);
unsigned long hash_addr(void *p) {
  if (sizeof(long) == 8)
    return hash_long64((unsigned long)p);
  return hash_long32((unsigned long)p);
}


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

x86 assembly (clang, -O2):
<hash_addr>:
jmp    1030 <hash_long64@plt>

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

LLVM IR (-O2):
define i64 @hash_addr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 @hash_long64(i64 %2)
ret i64 %3
}
/* Variables and functions */
int isxdigit(int const);
int fisxdigit(const int c) { return isxdigit(c); }


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

x86 assembly (clang, -O2):
<fisxdigit>:
jmp    1030 <isxdigit@plt>

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

LLVM IR (-O2):
define i32 @fisxdigit(i32 %0) {
%2 = tail call i32 @isxdigit(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] "
          "[[-t <type>] -p <size>...] \n",
          prog);
  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 = [94 x i8] c"Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [[-t <type>] -p <size>...] \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 ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [[-t <type>] -p <size>...] \0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long hashfunction(char *key) {
  unsigned long hash = 5381;
  int c;
  while (c = *key++) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash % 10000;
}


x86 assembly (clang, -O0):
<hashfunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hashfunction+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashfunction+0x10>
mov    -0x10(%rbp),%rax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfunction>:
mov    (%rdi),%al
test   %al,%al
je     114e <hashfunction+0x4e>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
mov    %rcx,%rdx
shl    $0x5,%rdx
add    %rcx,%rdx
movsbq %al,%rcx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hashfunction+0x10>
movabs $0x346dc5d63886594b,%rdx
c5 6d 34
mov    %rcx,%rax
mul    %rdx
shr    $0xb,%rdx
imul   $0x2710,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashfunction(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %11, 10000
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 5381, %1 ], [ %15, %14 ]
ret i64 %17
}