xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *int_to_string(int value) {
  static char str[5];
  sprintf(str, "%d", value);
  return str;
}


x86 assembly (clang, -O0):
<int_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f04(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_string>:
push   %rbx
mov    %edi,%edx
lea    0x2f0f(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@int_to_string.str = internal global [5 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @int_to_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @int_to_string.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @int_to_string.str, i64 0, i64 0)
}

LLVM IR (-O2):
@int_to_string.str = internal global [5 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @int_to_string(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @int_to_string.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @int_to_string.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ indirectly();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
void sbcIndirectLongy16(void) { sbc16(readmemw65816(indirectly())); }


x86 assembly (clang, -O0):
<sbcIndirectLongy16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectly@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirectLongy16>:
push   %rax
xor    %eax,%eax
call   1040 <indirectly@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcIndirectLongy16() {
%1 = call i32 (...) @indirectly()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirectLongy16() {
%1 = tail call i32 (...) @indirectly()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ putchar(char);
int main(void) {
  char *a = "dr. Howle\n";
  long b = 0x9207156357784;
  while (putchar(a[b & 0xF]) >= 0 && (b >>= 4))
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movabs $0x9207156357784,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
and    $0xf,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jl     1175 <main+0x65>
mov    -0x18(%rbp),%rax
sar    $0x4,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1185 <main+0x75>
jmp    118a <main+0x7a>
jmp    1138 <main+0x28>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movabs $0x9207156357784,%rbx
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%eax
and    $0xf,%eax
movsbl (%rax,%r14,1),%edi
call   1030 <putchar@plt>
test   %rax,%rax
js     1154 <main+0x44>
mov    %rbx,%rax
shr    $0x4,%rax
cmp    $0xf,%rbx
mov    %rax,%rbx
ja     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"dr. Howle\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
store i64 2568945940133764, i64* %3
br label %4
4: ; preds = %18, %0
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = and i64 %6, 15
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = call i64 @putchar(i8 signext %9)
%11 = icmp sge i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i64, i64* %3
%14 = ashr i64 %13, 4
store i64 %14, i64* %3
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %12, %4
%17 = phi i1 [ false, %4 ], [ %15, %12 ]
br i1 %17, label %18, label %19
18: ; preds = %16
br label %4
19: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"dr. Howle\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 2568945940133764, %0 ], [ %8, %1 ]
%3 = and i64 %2, 15
%4 = getelementptr inbounds [11 x i8], [11 x i8]* @.str, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @putchar(i8 signext %5)
%7 = icmp slt i64 %6, 0
%8 = lshr i64 %2, 4
%9 = icmp ult i64 %2, 16
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %11, label %1
11: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ checked_free(char *);
int /*<<< orphan*/ getCurrentLevelDir();
char *getPath2(int /*<<< orphan*/, char *);
char *getHelpAnimFilename() {
  static char *filename = NULL;
  checked_free(filename);
  filename = getPath2(getCurrentLevelDir(), "helpanim.conf");
  return filename;
}


x86 assembly (clang, -O0):
<getHelpAnimFilename>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f05(%rip),%rdi
call   1040 <checked_free@plt>
mov    $0x0,%al
call   1050 <getCurrentLevelDir@plt>
mov    %eax,%edi
lea    0xeb0(%rip),%rsi
call   1030 <getPath2@plt>
mov    %rax,0x2ee4(%rip)
mov    0x2edd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHelpAnimFilename>:
push   %rax
mov    0x2f08(%rip),%rdi
call   1040 <checked_free@plt>
xor    %eax,%eax
call   1050 <getCurrentLevelDir@plt>
lea    0xeb5(%rip),%rsi
mov    %eax,%edi
call   1030 <getPath2@plt>
mov    %rax,0x2ee7(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@getHelpAnimFilename.filename = internal global i8* null
@.str = [14 x i8] c"helpanim.conf\00"
define i8* @getHelpAnimFilename() {
%1 = load i8*, i8** @getHelpAnimFilename.filename
%2 = call i32 @checked_free(i8* %1)
%3 = call i32 (...) @getCurrentLevelDir()
%4 = call i8* @getPath2(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @getHelpAnimFilename.filename
%5 = load i8*, i8** @getHelpAnimFilename.filename
ret i8* %5
}

LLVM IR (-O2):
@getHelpAnimFilename.filename = internal unnamed_addr global i8* null
@.str = [14 x i8] c"helpanim.conf\00"
define i8* @getHelpAnimFilename() {
%1 = load i8*, i8** @getHelpAnimFilename.filename
%2 = tail call i32 @checked_free(i8* %1)
%3 = tail call i32 (...) @getCurrentLevelDir()
%4 = tail call i8* @getPath2(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @getHelpAnimFilename.filename
ret i8* %4
}
void CursorPrevLine(HowMuch) int HowMuch;
{
  char Str[10];
  if (HowMuch == 0)
    return;
  sprintf(Str, "\033[%dF", HowMuch);
  WRITETEST(Str);
}


x86 assembly (clang, -O0):
<CursorPrevLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <CursorPrevLine+0x1a>
jmp    115a <CursorPrevLine+0x3a>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CursorPrevLine>:
test   %edi,%edi
je     1150 <CursorPrevLine+0x30>
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xece(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dF\00"
define void @CursorPrevLine(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %3)
br label %8
8: ; preds = %1, %5
ret void
}
void execRun(char **options, int argc) {}


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

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

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

LLVM IR (-O2):
define void @execRun(i8** nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write_buffer(char *, int /*<<< orphan*/);
void write_string(char *s) {
  assert(s);
  write_buffer(s, strlen(s));
}


x86 assembly (clang, -O0):
<write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <write_buffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string>:
push   %rbx
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <write_buffer@plt>

LLVM IR (-O0):
define void @write_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write_buffer(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @write_string(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write_buffer(i8* %0, i32 %3)
ret void
}
void XcmsVisualOfCCC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsVisualOfCCC() {
ret void
}
int Cyc_CfFlowInfo_nprefix(int *n, void *unused) {
  if (*n > 0) {
    *n = *n - 1;
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<Cyc_CfFlowInfo_nprefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1134 <Cyc_CfFlowInfo_nprefix+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    113b <Cyc_CfFlowInfo_nprefix+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_CfFlowInfo_nprefix>:
mov    (%rdi),%eax
test   %eax,%eax
jle    1111 <Cyc_CfFlowInfo_nprefix+0x11>
add    $0xffffffff,%eax
mov    %eax,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Cyc_CfFlowInfo_nprefix(i32* nocapture %0, i8* nocapture readnone %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = add nsw i32 %3, -1
store i32 %6, i32* %0
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ addscore(int, int);
void scoregold(int n) { addscore(n, 500); }


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

x86 assembly (clang, -O2):
<scoregold>:
mov    $0x1f4,%esi
jmp    1030 <addscore@plt>

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

LLVM IR (-O2):
define void @scoregold(i32 %0) {
%2 = tail call i32 @addscore(i32 %0, i32 500)
ret void
}
/* Variables and functions */
scalar_t__ roundl(long double);
long long llroundl(long double x) { return (long long)roundl(x); }


x86 assembly (clang, -O0):
<llroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <roundl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llroundl>:
jmp    1030 <roundl@plt>

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

LLVM IR (-O2):
define i64 @llroundl(x86_fp80 %0) {
%2 = tail call i64 @roundl(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_smatrix(short **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 0));
  free((char *)(m + nrl - 0));
}


x86 assembly (clang, -O0):
<free_smatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_smatrix>:
push   %rbx
lea    (%rdi,%rsi,8),%rbx
lea    (%rcx,%rcx,1),%rax
add    (%rdi,%rsi,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_smatrix(i16** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i16**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i16** %0, i16*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i16**, i16*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i16*, i16** %11, i64 %12
%14 = load i16*, i16** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds i16, i16* %14, i64 %15
%17 = getelementptr inbounds i16, i16* %16, i64 0
%18 = bitcast i16* %17 to i8*
%19 = call i32 @free(i8* %18)
%20 = load i16**, i16*** %6
%21 = load i64, i64* %7
%22 = getelementptr inbounds i16*, i16** %20, i64 %21
%23 = getelementptr inbounds i16*, i16** %22, i64 0
%24 = bitcast i16** %23 to i8*
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @free_smatrix(i16** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i16*, i16** %0, i64 %1
%7 = load i16*, i16** %6
%8 = getelementptr inbounds i16, i16* %7, i64 %3
%9 = bitcast i16* %8 to i8*
%10 = tail call i32 @free(i8* %9)
%11 = bitcast i16** %6 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
uint64_t usec(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int cfg_processor_get_addr(char *, char *);
int cfg_basic_timer_get_btctl(void) {
  return cfg_processor_get_addr("basictimer", "btctl");
}


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

x86 assembly (clang, -O2):
<cfg_basic_timer_get_btctl>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <cfg_processor_get_addr@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [6 x i8] c"btctl\00"
define i32 @cfg_basic_timer_get_btctl() {
%1 = call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [6 x i8] c"btctl\00"
define i32 @cfg_basic_timer_get_btctl() {
%1 = tail call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE;
int /*<<< orphan*/ I2C_SMBUS_WRITE;
int i2c_smbus_access(int, int /*<<< orphan*/, int, int /*<<< orphan*/,
                     int /*<<< orphan*/ *);
int wiringPiI2CWrite(int fd, int data) {
  return i2c_smbus_access(fd, I2C_SMBUS_WRITE, data, I2C_SMBUS_BYTE, NULL);
}


x86 assembly (clang, -O0):
<wiringPiI2CWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <i2c_smbus_access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiI2CWrite>:
mov    %esi,%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
xor    %r8d,%r8d
jmp    1030 <i2c_smbus_access@plt>

LLVM IR (-O0):
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @wiringPiI2CWrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_SMBUS_WRITE
%7 = load i32, i32* %4
%8 = load i32, i32* @I2C_SMBUS_BYTE
%9 = call i32 @i2c_smbus_access(i32 %5, i32 %6, i32 %7, i32 %8, i32* null)
ret i32 %9
}

LLVM IR (-O2):
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @wiringPiI2CWrite(i32 %0, i32 %1) {
%3 = load i32, i32* @I2C_SMBUS_WRITE
%4 = load i32, i32* @I2C_SMBUS_BYTE
%5 = tail call i32 @i2c_smbus_access(i32 %0, i32 %3, i32 %1, i32 %4, i32* null)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sound_init(int);
void system_sound_chipreset(void) { sound_init(44100); }


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

x86 assembly (clang, -O2):
<system_sound_chipreset>:
mov    $0xac44,%edi
jmp    1030 <sound_init@plt>

LLVM IR (-O0):
define void @system_sound_chipreset() {
%1 = call i32 @sound_init(i32 44100)
ret void
}

LLVM IR (-O2):
define void @system_sound_chipreset() {
%1 = tail call i32 @sound_init(i32 44100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void cpuinfo_print_info(void) {
  fprintf(stderr, "cpuinfo: Unknown architecture (non-x86).\n");
}


x86 assembly (clang, -O0):
<cpuinfo_print_info>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuinfo_print_info>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"cpuinfo: Unknown architecture (non-x86).\0A\00"
define void @cpuinfo_print_info() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"cpuinfo: Unknown architecture (non-x86).\0A\00"
define void @cpuinfo_print_info() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((always_)) int pci_iov_bus_range(struct pci_bus *bus) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.pci_bus = type opaque
define i32 @pci_iov_bus_range(%struct.pci_bus* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t chunks_data_hash_fn(uint32_t inode, uint32_t chindx) {
  return ((((inode * 0x72B5F387U) + chindx) * 0x56BF7623U) & (524288 - 1));
}


x86 assembly (clang, -O0):
<chunks_data_hash_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x72b5f387,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
imul   $0x56bf7623,%eax,%eax
and    $0x7ffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunks_data_hash_fn>:
imul   $0x72b5f387,%edi,%eax
add    %esi,%eax
imul   $0x56bf7623,%eax,%eax
and    $0x7ffff,%eax
ret

LLVM IR (-O0):
define i32 @chunks_data_hash_fn(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 = mul i32 %5, 1924526983
%7 = load i32, i32* %4
%8 = add i32 %6, %7
%9 = mul i32 %8, 1455388195
%10 = and i32 %9, 524287
ret i32 %10
}

LLVM IR (-O2):
define i32 @chunks_data_hash_fn(i32 %0, i32 %1) {
%3 = mul i32 %0, 1924526983
%4 = add i32 %3, %1
%5 = mul i32 %4, 1455388195
%6 = and i32 %5, 524287
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void graph_header(long nr_regions) {
  int j;
  printf(" ------");
  for (j = 0; j < nr_regions; ++j) {
    printf("-");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<graph_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1157 <graph_header+0x47>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <graph_header+0x1f>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph_header>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
test   %rbx,%rbx
jle    1150 <graph_header+0x30>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <graph_header+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c" ------\00"
define void @graph_header(i64 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 45)
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_command(int);
void set_page_address() {
  send_command(0x22);
  send_command(0x00);
  send_command(7);
}


x86 assembly (clang, -O0):
<set_page_address>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1030 <send_command@plt>
xor    %edi,%edi
call   1030 <send_command@plt>
mov    $0x7,%edi
call   1030 <send_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_page_address>:
push   %rax
mov    $0x22,%edi
call   1030 <send_command@plt>
xor    %edi,%edi
call   1030 <send_command@plt>
mov    $0x7,%edi
pop    %rax
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @set_page_address() {
%1 = call i32 @send_command(i32 34)
%2 = call i32 @send_command(i32 0)
%3 = call i32 @send_command(i32 7)
ret void
}

LLVM IR (-O2):
define void @set_page_address() {
%1 = tail call i32 @send_command(i32 34)
%2 = tail call i32 @send_command(i32 0)
%3 = tail call i32 @send_command(i32 7)
ret void
}
int xbyte(unsigned word, int bytenum) {
  return (int)(word << (32 - 8 - bytenum * 8)) >> (32 - 8);
}


x86 assembly (clang, -O0):
<xbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x3,%edx
mov    $0x18,%ecx
sub    %edx,%ecx
shl    %cl,%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbyte>:
mov    %edi,%eax
shl    $0x3,%sil
mov    $0x18,%cl
sub    %sil,%cl
shl    %cl,%eax
sar    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @xbyte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 8
%8 = sub nsw i32 24, %7
%9 = shl i32 %5, %8
%10 = ashr i32 %9, 24
ret i32 %10
}

LLVM IR (-O2):
define i32 @xbyte(i32 %0, i32 %1) {
%3 = mul i32 %1, -8
%4 = add i32 %3, 24
%5 = shl i32 %0, %4
%6 = ashr i32 %5, 24
ret i32 %6
}
/* Variables and functions */
void *_malloc(size_t, char const *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *_calloc(size_t items, size_t itemSize, const char *function) {
  size_t totalSize = 0;
  void *memoryPointer = NULL;
  totalSize = (items * itemSize);
  memoryPointer = _malloc(totalSize, function);
  if (memoryPointer)
    memset(memoryPointer, 0, totalSize);
  return (memoryPointer);
}


x86 assembly (clang, -O0):
<_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     117c <_calloc+0x5c>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114b <_calloc+0x2b>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_calloc(i64 %0, i64 %1, i8* %2) {
%4 = mul i64 %1, %0
%5 = tail call i8* @_malloc(i64 %4, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @memset(i8* %5, i32 0, i64 %4)
br label %9
9: ; preds = %7, %3
ret i8* %5
}
add_two(i1, i2) { return i1 + i2; }


x86 assembly (clang, -O0):
<add_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_two>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add_two(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
char *grab_stripped_cmd_name_of_pid(int /*<<< orphan*/, int *);
char *grab_my_stripped_cmd_name(int *sz) {
  return grab_stripped_cmd_name_of_pid(getpid(), sz);
}


x86 assembly (clang, -O0):
<grab_my_stripped_cmd_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <grab_stripped_cmd_name_of_pid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grab_my_stripped_cmd_name>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <grab_stripped_cmd_name_of_pid@plt>

LLVM IR (-O0):
define i8* @grab_my_stripped_cmd_name(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @getpid()
%4 = load i32*, i32** %2
%5 = call i8* @grab_stripped_cmd_name_of_pid(i32 %3, i32* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @grab_my_stripped_cmd_name(i32* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i8* @grab_stripped_cmd_name_of_pid(i32 %2, i32* %0)
ret i8* %3
}
/* Variables and functions */
bool SquareIsOK(unsigned int sq) {
  if (sq <= 63) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<SquareIsOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3f,-0x8(%rbp)
ja     111d <SquareIsOK+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <SquareIsOK+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SquareIsOK>:
xor    %eax,%eax
cmp    $0x40,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @SquareIsOK(i32 %0) {
%2 = icmp ult i32 %0, 64
%3 = zext i1 %2 to i32
ret i32 %3
}
adrx0adr1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <=
      (*((short *)(11111111 & ~(__alignof__(short) - 1)))))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
mov    $0xa98ac6,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1148 <adrx0adr1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <adrx0adr1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    0xa98ac6,%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i16, i16* inttoptr (i64 11111110 to i16*)
%22 = sext i16 %21 to i32
%23 = icmp sle i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = load i16, i16* inttoptr (i64 11111110 to i16*)
%11 = icmp sle i16 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void cpu_unboost(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_unboost() {
ret void
}
__attribute__((always_)) int lock_lock(volatile int *l) {
  while (__sync_val_compare_and_swap(l, 0, 1) != 0)
    while (*l)
      ;
  return 0;
}


x86 assembly (clang, -O0):
<lock_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    $0x1,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
cmp    $0x0,%eax
je     1141 <lock_lock+0x41>
jmp    1128 <lock_lock+0x28>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
je     113c <lock_lock+0x3c>
jmp    1128 <lock_lock+0x28>
jmp    1108 <lock_lock+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_lock>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
lock cmpxchg %ecx,(%rdi)
je     111f <lock_lock+0x1f>
cmpl   $0x0,(%rdi)
jne    1118 <lock_lock+0x18>
jmp    1110 <lock_lock+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @lock_lock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %14, %1
%4 = load i32*, i32** %2
%5 = cmpxchg i32* %4, i32 0, i32 1 seq_cst seq_cst
%6 = extractvalue { i32, i1 } %5, 0
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
br label %9
9: ; preds = %13, %8
%10 = load i32*, i32** %2
%11 = load volatile i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
br label %3
15: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @lock_lock(i32* %0) {
%2 = cmpxchg i32* %0, i32 0, i32 1 seq_cst seq_cst
%3 = extractvalue { i32, i1 } %2, 1
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = cmpxchg i32* %0, i32 0, i32 1 seq_cst seq_cst
%6 = extractvalue { i32, i1 } %5, 1
br i1 %6, label %11, label %10
7: ; preds = %1, %10
%8 = load volatile i32, i32* %0
%9 = icmp eq i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %7, %4
br label %7
11: ; preds = %4, %1
ret i32 0
}
int ctz(unsigned int x) { return (x & -x) - 1; }


x86 assembly (clang, -O0):
<ctz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctz>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @ctz(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
%4 = add i32 %3, -1
ret i32 %4
}
unsigned int mus_little_endian_unsigned_int(unsigned char *inp) {
  unsigned int o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[3];
  outp[1] = inp[2];
  outp[2] = inp[1];
  outp[3] = inp[0];
  return (o);
}


x86 assembly (clang, -O0):
<mus_little_endian_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mus_little_endian_unsigned_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @mus_little_endian_unsigned_int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = load i8, i8* %0
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %7 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %5 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %3 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
short atualiza_hdr() { return (0); }


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

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

LLVM IR (-O0):
define signext i16 @atualiza_hdr() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @atualiza_hdr() {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(long);
int /*<<< orphan*/ printf(char *, ...);
void *Malloc(long size) {
  void *result;
  result = (void *)malloc(size);
  if (!result) {
    printf("\n");
    printf("Error while allocating memory in Malloc( %ld ), aborting program.",
           size);
    printf("\n");
    exit(0);
  }
  return (result);
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1189 <Malloc+0x59>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1150 <Malloc+0x10>
pop    %rbx
ret
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [66 x i8] c"Error while allocating memory in Malloc( %ld ), aborting program.\00"
define i8* @Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i64, i64* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str.1 = [66 x i8] c"Error while allocating memory in Malloc( %ld ), aborting program.\00"
define i8* @Malloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i64 %0)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %2 to i8*
ret i8* %10
}
/* Variables and functions */
int _getpwent(char *);
int _getpwnam(char *);
int main(int argc, char *argv[]) {
  int res;
  (void)argc;
  res = _getpwnam(argv[0]);
  res |= _getpwent(argv[0]);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_getpwnam@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <_getpwent@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rdi
call   1030 <_getpwnam@plt>
mov    %eax,%ebp
mov    (%rbx),%rdi
call   1040 <_getpwent@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @_getpwnam(i8* %10)
store i32 %11, i32* %6
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @_getpwent(i8* %14)
%16 = load i32, i32* %6
%17 = or i32 %16, %15
store i32 %17, i32* %6
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @_getpwnam(i8* %3)
%5 = load i8*, i8** %1
%6 = tail call i32 @_getpwent(i8* %5)
%7 = or i32 %6, %4
ret i32 %7
}
void UYVYToARGBRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToARGBRow_SSSE3() {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ ex_int_iisort64(scalar_t__ *, scalar_t__ *, scalar_t__);
int /*<<< orphan*/ ex_int_iqsort64(scalar_t__ *, scalar_t__ *,
                                   int /*<<< orphan*/, scalar_t__);
void ex_iqsort64(int64_t v[], int64_t iv[], int64_t N) {
  ex_int_iqsort64(v, iv, 0, N - 1);
  ex_int_iisort64(v, iv, N);
}


x86 assembly (clang, -O0):
<ex_iqsort64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
xor    %edx,%edx
call   1030 <ex_int_iqsort64@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <ex_int_iisort64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_iqsort64>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    -0x1(%rdx),%rcx
xor    %edx,%edx
call   1030 <ex_int_iqsort64@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <ex_int_iisort64@plt>

LLVM IR (-O0):
define void @ex_iqsort64(i64* %0, i64* %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64*, i64** %5
%9 = load i64, i64* %6
%10 = sub nsw i64 %9, 1
%11 = call i32 @ex_int_iqsort64(i64* %7, i64* %8, i32 0, i64 %10)
%12 = load i64*, i64** %4
%13 = load i64*, i64** %5
%14 = load i64, i64* %6
%15 = call i32 @ex_int_iisort64(i64* %12, i64* %13, i64 %14)
ret void
}

LLVM IR (-O2):
define void @ex_iqsort64(i64* %0, i64* %1, i64 %2) {
%4 = add nsw i64 %2, -1
%5 = tail call i32 @ex_int_iqsort64(i64* %0, i64* %1, i32 0, i64 %4)
%6 = tail call i32 @ex_int_iisort64(i64* %0, i64* %1, i64 %2)
ret void
}
const char *_glapi_get_version(void) { return "20010116"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"20010116\00"
define i8* @_glapi_get_version() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}