xunge/DecIR huggingface dataset:
/* Variables and functions */
char *luaL_opt_string(int, int /*<<< orphan*/);
scalar_t__ lua_dofile(char *);
int /*<<< orphan*/ lua_pushusertag(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ passresults();
void lua_internaldofile(void) {
  char *fname = luaL_opt_string(1, 0);
  if (lua_dofile(fname) == 0)
    if (passresults() == 0)
      lua_pushusertag(0, 0);
}


x86 assembly (clang, -O0):
<lua_internaldofile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <luaL_opt_string@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <lua_dofile@plt>
cmp    $0x0,%rax
jne    118a <lua_internaldofile+0x4a>
mov    $0x0,%al
call   1030 <passresults@plt>
cmp    $0x0,%rax
jne    1185 <lua_internaldofile+0x45>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <lua_pushusertag@plt>
jmp    118a <lua_internaldofile+0x4a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_internaldofile>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <luaL_opt_string@plt>
mov    %rax,%rdi
call   1050 <lua_dofile@plt>
test   %rax,%rax
jne    1166 <lua_internaldofile+0x26>
xor    %eax,%eax
call   1030 <passresults@plt>
test   %rax,%rax
je     1168 <lua_internaldofile+0x28>
pop    %rax
ret
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <lua_pushusertag@plt>

LLVM IR (-O0):
define void @lua_internaldofile() {
%1 = alloca i8*
%2 = call i8* @luaL_opt_string(i32 1, i32 0)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i64 @lua_dofile(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i64 (...) @passresults()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @lua_pushusertag(i32 0, i32 0)
br label %11
11: ; preds = %9, %6
br label %12
12: ; preds = %11, %0
ret void
}

LLVM IR (-O2):
define void @lua_internaldofile() {
%1 = tail call i8* @luaL_opt_string(i32 1, i32 0)
%2 = tail call i64 @lua_dofile(i8* %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 (...) @passresults()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @lua_pushusertag(i32 0, i32 0)
br label %9
9: ; preds = %4, %7, %0
ret void
}
/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
double getCurrentTime() { return ((double)clock() / CLOCKS_PER_SEC) * 1000; }


x86 assembly (clang, -O0):
<getCurrentTime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xecd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentTime>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xed0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @getCurrentTime() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
%5 = fmul double %4, 1.000000e+03
ret double %5
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @getCurrentTime() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
%5 = fmul double %4, 1.000000e+03
ret double %5
}
const char *str_stmt_if() { return "if"; }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"if\00"
define i8* @str_stmt_if() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
int isNumber(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNumber+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isNumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int try_mfocrf(int x) {
  int res;
  res = 42;
  return res;
}


x86 assembly (clang, -O0):
<try_mfocrf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @try_mfocrf(i32 %0) {
ret i32 42
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int min_width;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_min_width(void *_p, int _v) {
  ((XSizeHints *)_p)->min_width = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XSizeHints_min_width>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSizeHints_min_width(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XSizeHints_min_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
size_t _fcgi_iwire_min(size_t a, size_t b) { return ((a < b) ? a : b); }


x86 assembly (clang, -O0):
<_fcgi_iwire_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <_fcgi_iwire_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <_fcgi_iwire_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fcgi_iwire_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @_fcgi_iwire_min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @_fcgi_iwire_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void barf(const char *msg) {
  fprintf(stderr, "%s (error: %s)\n", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<barf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<barf>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"%s (error: %s)\0A\00"
@errno = global i32 0
define void @barf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"%s (error: %s)\0A\00"
@errno = global i32 0
define void @barf(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int cmpFunc(void *my, void *nodeData) {
  assert(my != NULL && nodeData != NULL);
  return *((int *)my) - *((int *)nodeData);
}


x86 assembly (clang, -O0):
<cmpFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     113b <cmpFunc+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpFunc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    (%rbx),%eax
sub    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @cmpFunc(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = bitcast i8* %0 to i32*
%9 = load i32, i32* %8
%10 = bitcast i8* %1 to i32*
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
ret i32 %12
}
void defaultDestroy(void *data) {}


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

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

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

LLVM IR (-O2):
define void @defaultDestroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  char *msg = "usage: moduleparam_test [test=int] [btest[=bool]] [latest=int "
              "array] [strtest=string]\n";
  printf(msg);
}


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

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

LLVM IR (-O0):
@.str = [87 x i8] c"usage: moduleparam_test [test=int] [btest[=bool]] [latest=int array] [strtest=string]\0A\00"
define void @usage() {
%1 = alloca i8*
store i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* %2)
ret void
}

LLVM IR (-O2):
@str = [86 x i8] c"usage: moduleparam_test [test=int] [btest[=bool]] [latest=int array] [strtest=string]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct RNAaliduplex_args_info {
  int dummy;
};

/* Variables and functions */
int RNAaliduplex_cmdline_parser2(int, char **, struct RNAaliduplex_args_info *,
                                 int /*<<< orphan*/, int, int);
int RNAaliduplex_cmdline_parser(int argc, char **argv,
                                struct RNAaliduplex_args_info *args_info) {
  return RNAaliduplex_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<RNAaliduplex_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <RNAaliduplex_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAaliduplex_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <RNAaliduplex_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.RNAaliduplex_args_info = type { i32 }
define i32 @RNAaliduplex_cmdline_parser(i32 %0, i8** %1, %struct.RNAaliduplex_args_info* %2) {
%4 = tail call i32 @RNAaliduplex_cmdline_parser2(i32 %0, i8** %1, %struct.RNAaliduplex_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
unsigned char extractuchar(unsigned char *buffer, unsigned short *index) {
  unsigned char data;
  data = buffer[*index];
  *index += 1;
  return (data);
}


x86 assembly (clang, -O0):
<extractuchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movzwl (%rax),%ecx
add    $0x1,%ecx
mov    %cx,(%rax)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractuchar>:
movzwl (%rsi),%ecx
mov    (%rdi,%rcx,1),%al
add    $0x1,%ecx
mov    %cx,(%rsi)
ret

LLVM IR (-O0):
define zeroext i8 @extractuchar(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i8
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = load i8*, i8** %3
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = zext i16 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i16*, i16** %4
%13 = load i16, i16* %12
%14 = zext i16 %13 to i32
%15 = add nsw i32 %14, 1
%16 = trunc i32 %15 to i16
store i16 %16, i16* %12
%17 = load i8, i8* %5
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @extractuchar(i8* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %1
%4 = zext i16 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = add i16 %3, 1
store i16 %7, i16* %1
ret i8 %6
}
/* Type definitions */
struct statfs {
  int f_type;
};

/* Variables and functions */
int /*<<< orphan*/ statfs(char *, struct statfs *);
int tst_is_cwd_nfs(void) {
  struct statfs sf;
  statfs(".", &sf);
  return (sf.f_type == 0x6969);
}


x86 assembly (clang, -O0):
<tst_is_cwd_nfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <statfs@plt>
cmpl   $0x6969,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_is_cwd_nfs>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <statfs@plt>
xor    %eax,%eax
cmpl   $0x6969,(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @tst_is_cwd_nfs() {
%1 = alloca %struct.statfs
%2 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%3 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 26985
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @tst_is_cwd_nfs() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%4 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 26985
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ ArgItem();
scalar_t__ Me();
int Act_IsMe(void) { return (ArgItem() == Me()); }


x86 assembly (clang, -O0):
<Act_IsMe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ArgItem@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <Me@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_IsMe>:
push   %rbx
xor    %eax,%eax
call   1030 <ArgItem@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <Me@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Act_IsMe() {
%1 = call i64 (...) @ArgItem()
%2 = call i64 (...) @Me()
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @Act_IsMe() {
%1 = tail call i64 (...) @ArgItem()
%2 = tail call i64 (...) @Me()
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
int is_zero(const char *p) {
  for (; *p; ++p)
    if (*p != '0')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <is_zero+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
je     1131 <is_zero+0x31>
movl   $0x0,-0x4(%rbp)
jmp    114e <is_zero+0x4e>
jmp    1136 <is_zero+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <is_zero+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero>:
movzbl (%rdi),%eax
cmp    $0x30,%al
jne    110d <is_zero+0xd>
add    $0x1,%rdi
jmp    1100 <is_zero>
test   %al,%al
jne    1117 <is_zero+0x17>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_zero(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 48, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_file_name(char *path) {
  char *filename = strrchr(path, '/');
  if (!filename) {
    filename = strrchr(path, '\\');
  }
  if (filename) {
    filename++;
  } else {
    filename = path;
  }
  return filename;
}


x86 assembly (clang, -O0):
<get_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <get_file_name+0x3b>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1167 <get_file_name+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116f <get_file_name+0x5f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
jne    1130 <get_file_name+0x20>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_file_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i8* @strrchr(i8* %9, i8 signext 92)
store i8* %10, i8** %3
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %19
17: ; preds = %11
%18 = load i8*, i8** %2
store i8* %18, i8** %3
br label %19
19: ; preds = %17, %14
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @get_file_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %2, %1 ], [ %5, %4 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
int main() {}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
unsigned int hweight64(uint64_t w) {}


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

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

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

LLVM IR (-O2):
define i32 @hweight64(i32 %0) {
ret i32 undef
}
void GB_ISLE_f_FP64(double *z, const double *x, const double *y) {
  (*z) = ((*x) <= (*y));
}


x86 assembly (clang, -O0):
<GB_ISLE_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ISLE_f_FP64>:
movsd  (%rsi),%xmm0
cmplesd (%rdx),%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @GB_ISLE_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fcmp ole double %8, %10
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
%14 = load double*, double** %4
store double %13, double* %14
ret void
}

LLVM IR (-O2):
define void @GB_ISLE_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fcmp ole double %4, %5
%7 = uitofp i1 %6 to double
store double %7, double* %0
ret void
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructPPForm(void *, struct constructHeader *);
const char *EnvGetDefrulePPForm(void *theEnv, void *theDefrule) {
  return GetConstructPPForm(theEnv, (struct constructHeader *)theDefrule);
}


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

x86 assembly (clang, -O2):
<EnvGetDefrulePPForm>:
jmp    1030 <GetConstructPPForm@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefrulePPForm(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.constructHeader*
%8 = call i8* @GetConstructPPForm(i8* %5, %struct.constructHeader* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefrulePPForm(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructPPForm(i8* %0, %struct.constructHeader* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void routine(void) {
  printf("**** Hello World ****\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<routine>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"**** Hello World ****\0A\00"
@stdout = global i32 0
define void @routine() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [22 x i8] c"**** Hello World ****\00"
define void @routine() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print2(void *para) { printf("task3\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"task3\00"
define void @print2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float *malloc(int);
int main() {
  volatile float *f = malloc(sizeof(float));
  *f = 23423.23423;
  return (int)(*f * 1000) % 256;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0xecb(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  0xeb3(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x46b6fe78,(%rax)
movss  (%rax),%xmm0
mulss  0xed3(%rip),%xmm0
cvttss2si %xmm0,%eax
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
store i32 0, i32* %1
%3 = call float* @malloc(i32 4)
store float* %3, float** %2
%4 = load float*, float** %2
store volatile float 0x40D6DFCF00000000, float* %4
%5 = load float*, float** %2
%6 = load volatile float, float* %5
%7 = fmul float %6, 1.000000e+03
%8 = fptosi float %7 to i32
%9 = srem i32 %8, 256
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float* @malloc(i32 4)
store volatile float 0x40D6DFCF00000000, float* %1
%2 = load volatile float, float* %1
%3 = fmul float %2, 1.000000e+03
%4 = fptosi float %3 to i32
%5 = srem i32 %4, 256
ret i32 %5
}
void eprintf(int line, char *result, char *expected, int size) {
  if (size != 0)
    printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
           line, size, result, expected, size);
  else
    printf("Failure at line %d, result is <%s>, should be <%s>\n", line, result,
           expected);
}


x86 assembly (clang, -O0):
<eprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1155 <eprintf+0x45>
mov    -0x4(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116e <eprintf+0x5e>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eprintf>:
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %edi,%esi
test   %r9d,%r9d
je     1131 <eprintf+0x21>
lea    0xed9(%rip),%rdi
mov    %r9d,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Failure at line %d, result is <%.*s>, should be <%s> of size %d\0A\00"
@.str.1 = [52 x i8] c"Failure at line %d, result is <%s>, should be <%s>\0A\00"
define void @eprintf(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %8
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i32, i32* %8
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i8* %14, i8* %15, i32 %16)
br label %23
18: ; preds = %4
%19 = load i32, i32* %5
%20 = load i8*, i8** %6
%21 = load i8*, i8** %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %19, i8* %20, i8* %21)
br label %23
23: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"Failure at line %d, result is <%.*s>, should be <%s> of size %d\0A\00"
@.str.1 = [52 x i8] c"Failure at line %d, result is <%s>, should be <%s>\0A\00"
define void @eprintf(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i8* %1, i8* %2, i32 %3)
br label %10
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
br label %10
10: ; preds = %8, %6
ret void
}
int DRV_MNTN_GET_BATT_STATE(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_MNTN_GET_BATT_STATE() {
ret i32 0
}
/* Variables and functions */
double pow(int /*<<< orphan*/, int);
int /*<<< orphan*/ sin(double);
double f2(double x) { return pow(sin(x), 4); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
call   1030 <sin@plt>
mov    %eax,%edi
mov    $0x4,%esi
pop    %rax
jmp    1040 <pow@plt>

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

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = tail call double @pow(i32 %2, i32 4)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int mutex_lock(int /*<<< orphan*/ *);
int pthread_mutex_lock(pthread_mutex_t *mutex) {
  assert(mutex);
  return mutex_lock(mutex);
}


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

x86 assembly (clang, -O2):
<pthread_mutex_lock>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutex_lock(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i32 @mutex_lock(i32* %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bitw_lzcnt_64_plain(int /*<<< orphan*/);
__attribute__((always_)) uint8_t bitw_lzcnt_64(uint64_t bit_set) {
  return bitw_lzcnt_64_plain(bit_set);
}


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

x86 assembly (clang, -O2):
<bitw_lzcnt_64>:
jmp    1030 <bitw_lzcnt_64_plain@plt>

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

LLVM IR (-O2):
define i32 @bitw_lzcnt_64(i32 %0) {
%2 = tail call i32 @bitw_lzcnt_64_plain(i32 %0)
ret i32 %2
}
void GraphicsWaitVSync() {}


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

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

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

LLVM IR (-O2):
define void @GraphicsWaitVSync() {
ret void
}
/* Variables and functions */
int spec_compare(void const *, void const *);
int spec_compare_qsort_a(const void *a, const void *b) {
  return spec_compare(a, b);
}


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

x86 assembly (clang, -O2):
<spec_compare_qsort_a>:
jmp    1030 <spec_compare@plt>

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

LLVM IR (-O2):
define i32 @spec_compare_qsort_a(i8* %0, i8* %1) {
%3 = tail call i32 @spec_compare(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ cfag12864b_isset(unsigned char, unsigned char);
int /*<<< orphan*/ cfag12864b_set(unsigned char, unsigned char);
int /*<<< orphan*/ cfag12864b_unset(unsigned char, unsigned char);
void cfag12864b_not(unsigned char x, unsigned char y) {
  if (cfag12864b_isset(x, y))
    cfag12864b_unset(x, y);
  else
    cfag12864b_set(x, y);
}


x86 assembly (clang, -O0):
<cfag12864b_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1050 <cfag12864b_isset@plt>
cmp    $0x0,%rax
je     1171 <cfag12864b_not+0x41>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1030 <cfag12864b_unset@plt>
jmp    1180 <cfag12864b_not+0x50>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1040 <cfag12864b_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfag12864b_not>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <cfag12864b_isset@plt>
movzbl %bpl,%edi
movzbl %bl,%esi
add    $0x8,%rsp
test   %rax,%rax
je     1153 <cfag12864b_not+0x23>
pop    %rbx
pop    %rbp
jmp    1030 <cfag12864b_unset@plt>
pop    %rbx
pop    %rbp
jmp    1040 <cfag12864b_set@plt>

LLVM IR (-O0):
define void @cfag12864b_not(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i64 @cfag12864b_isset(i8 zeroext %5, i8 zeroext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8, i8* %3
%11 = load i8, i8* %4
%12 = call i32 @cfag12864b_unset(i8 zeroext %10, i8 zeroext %11)
br label %17
13: ; preds = %2
%14 = load i8, i8* %3
%15 = load i8, i8* %4
%16 = call i32 @cfag12864b_set(i8 zeroext %14, i8 zeroext %15)
br label %17
17: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
define void @cfag12864b_not(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i64 @cfag12864b_isset(i8 zeroext %0, i8 zeroext %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @cfag12864b_unset(i8 zeroext %0, i8 zeroext %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @cfag12864b_set(i8 zeroext %0, i8 zeroext %1)
br label %9
9: ; preds = %7, %5
ret void
}
void argCleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @argCleanup() {
ret void
}
double udeg_to_radians(int udeg) {
  return (udeg * 3.14159265358979323846) / (1000000.0 * 180.0);
}


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

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

LLVM IR (-O0):
define double @udeg_to_radians(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, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+08
ret double %6
}

LLVM IR (-O2):
define double @udeg_to_radians(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+08
ret double %4
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *memmove(void *dest, const void *src, size_t n) {
  return memcpy(dest, src, n);
}


x86 assembly (clang, -O0):
<memmove>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @memmove(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
extern int shmem_pe_accessible(int pe) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @shmem_pe_accessible(i32 %0) {
ret i32 1
}
/* Variables and functions */
bool is_power_of_2(unsigned long long v) { return v && ((v & (v - 1)) == 0); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1131 <is_power_of_2+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %rdi,%rdi
je     1112 <is_power_of_2+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ mempcpy(char *, void const *, size_t);
char *Mempcpy(char *d, const void *s, size_t n) {
  return (char *)mempcpy(d, s, n);
}


x86 assembly (clang, -O0):
<Mempcpy>:
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),%rdx
call   1030 <mempcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mempcpy>:
jmp    1030 <mempcpy@plt>

LLVM IR (-O0):
define i8* @Mempcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @mempcpy(i8* %7, i8* %8, i64 %9)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @Mempcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @mempcpy(i8* %0, i8* %1, i64 %2)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  const double PI = 3.1415;
  double r = 3;
  printf("area=%f\n", r * r * PI);
  printf("xidada\n");
  printf("%f\n", 10 * 20 * PI);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xec9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
movsd  0xe8d(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
movsd  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecb(%rip),%rdi
movsd  0xeb6(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"area=%f\0A\00"
@.str.1 = [8 x i8] c"xidada\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
store double 3.141500e+00, double* %1
store double 3.000000e+00, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fmul double %5, 3.141500e+00
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double 0x4083A26666666667)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"area=%f\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@str = [7 x i8] c"xidada\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x403C4604189374BD)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double 0x4083A26666666667)
ret i32 0
}
int func(int n) { return n == 0 ? 1 : func(n - 1) - n; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <func+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <func+0x33>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <func@plt>
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
test   %edi,%edi
je     1123 <func+0x13>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <func@plt>
sub    %ebx,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @func(i32 %6)
%8 = sub nsw i32 %7, %0
br label %3
}