xunge/DecIR huggingface dataset:
int is_in(const int idx[], int size, int num) {
  for (int i = 0; i < size; i++) {
    if (idx[i] == num) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <is_in+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <is_in+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <is_in+0x5b>
jmp    1146 <is_in+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <is_in+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in>:
test   %esi,%esi
jle    113a <is_in+0x3a>
mov    $0x1,%eax
cmp    %edx,(%rdi)
je     1139 <is_in+0x39>
mov    %esi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rsi
cmp    %rax,%rcx
je     1131 <is_in+0x31>
lea    0x1(%rsi),%rax
cmp    %edx,(%rdi,%rsi,4)
jne    1120 <is_in+0x20>
xor    %eax,%eax
cmp    %rcx,%rsi
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = zext i32 %1 to i64
%7 = zext i32 %1 to i64
%8 = load i32, i32* %0
%9 = icmp eq i32 %8, %2
br i1 %9, label %21, label %10
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %0, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %2
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %3
%22 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
scalar_t__ keyword();
int /*<<< orphan*/ listGrammar();
int /*<<< orphan*/ match(char *);
void declarationGrammar() {
  if (keyword()) {
    listGrammar();
    match(";");
    declarationGrammar();
  } else
    return;
}


x86 assembly (clang, -O0):
<declarationGrammar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <keyword@plt>
cmp    $0x0,%rax
je     1172 <declarationGrammar+0x32>
mov    $0x0,%al
call   1030 <listGrammar@plt>
lea    0xe9d(%rip),%rdi
call   1060 <match@plt>
call   1040 <declarationGrammar@plt>
jmp    1177 <declarationGrammar+0x37>
jmp    1177 <declarationGrammar+0x37>
pop    %rbp
ret

x86 assembly (clang, -O2):
<declarationGrammar>:
push   %rbx
xor    %eax,%eax
call   1040 <keyword@plt>
test   %rax,%rax
je     116b <declarationGrammar+0x3b>
lea    0xebc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <listGrammar@plt>
mov    %rbx,%rdi
call   1050 <match@plt>
xor    %eax,%eax
call   1040 <keyword@plt>
test   %rax,%rax
jne    1150 <declarationGrammar+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
define void @declarationGrammar() {
%1 = call i64 (...) @keyword()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @listGrammar()
%5 = call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
6: ; preds = %0
br label %7
7: ; preds = %6, %3
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
define void @declarationGrammar() {
%1 = tail call i64 (...) @keyword()
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @listGrammar()
%5 = tail call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i64 (...) @keyword()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int isalnum(char);
int f_isalnum(char c) { return isalnum(c); }


x86 assembly (clang, -O0):
<f_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_isalnum>:
jmp    1030 <isalnum@plt>

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

LLVM IR (-O2):
define i32 @f_isalnum(i8 signext %0) {
%2 = tail call i32 @isalnum(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int oh_look_useful() { system("/bin/sh"); }


x86 assembly (clang, -O0):
<oh_look_useful>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @oh_look_useful() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @oh_look_useful() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
const char *__asan_default_options() {
  return ":halt_on_error=1"
         ":abort_on_error=1"
         ":print_stacktrace=1"
         ":report_objects=1"
         ":fast_unwind_on_malloc=0"
         ":detect_odr_violation=0";
}


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

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

LLVM IR (-O0):
@.str = [117 x i8] c":halt_on_error=1:abort_on_error=1:print_stacktrace=1:report_objects=1:fast_unwind_on_malloc=0:detect_odr_violation=0\00"
define i8* @__asan_default_options() {
ret i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [117 x i8] c":halt_on_error=1:abort_on_error=1:print_stacktrace=1:report_objects=1:fast_unwind_on_malloc=0:detect_odr_violation=0\00"
define i8* @__asan_default_options() {
ret i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
zret() { ol("ret"); }


x86 assembly (clang, -O0):
<zret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"ret\00"
define i32 @zret() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"ret\00"
define i32 @zret() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double M_LN10;
double log(double);
double log10(double x) { return (log(x) / M_LN10); }


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10>:
push   %rax
call   1030 <log@plt>
mov    0x2ec3(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LN10 = global double 0.000000e+00
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = load double, double* @M_LN10
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_LN10 = global double 0.000000e+00
define double @log10(double %0) {
%2 = tail call double @log(double %0)
%3 = load double, double* @M_LN10
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ CODESET;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_codeset() { return nl_langinfo(CODESET); }


x86 assembly (clang, -O0):
<langinfo_codeset>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_codeset>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@CODESET = global i32 0
define i8* @langinfo_codeset() {
%1 = load i32, i32* @CODESET
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@CODESET = global i32 0
define i8* @langinfo_codeset() {
%1 = load i32, i32* @CODESET
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void version() {
  fprintf(stderr, "sg_raw "
                  "0.4.0 (2009-08-17)"
                  "\n"
                  "Copyright (C) 2007-2008 Ingo van Lil <inguin@gmx.de>\n"
                  "This is free software.  You may redistribute copies of it "
                  "under the terms of\n"
                  "the GNU General Public License "
                  "<http://www.gnu.org/licenses/gpl.html>.\n"
                  "There is NO WARRANTY, to the extent permitted by law.\n");
}


x86 assembly (clang, -O0):
<version>:
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):
<version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [282 x i8] c"sg_raw 0.4.0 (2009-08-17)\0ACopyright (C) 2007-2008 Ingo van Lil <inguin@gmx.de>\0AThis is free software. You may redistribute copies of it under the terms of\0Athe GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [282 x i8] c"sg_raw 0.4.0 (2009-08-17)\0ACopyright (C) 2007-2008 Ingo van Lil <inguin@gmx.de>\0AThis is free software. You may redistribute copies of it under the terms of\0Athe GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_73int8_mem(signed char *val) {
  return ((*val) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_73int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 115
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int __wsum;

/* Variables and functions */
uint16_t csum_fold(__wsum csum) {
  uint32_t sum = csum;
  sum = (sum & 0xffff) + (sum >> 16);
  sum = (sum & 0xffff) + (sum >> 16);
  return (uint16_t)sum;
}


x86 assembly (clang, -O0):
<csum_fold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_fold>:
movzwl %di,%eax
sar    $0x10,%edi
add    %edi,%eax
movzwl %ax,%ecx
sar    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @csum_fold(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 65535
%7 = load i32, i32* %3
%8 = ashr i32 %7, 16
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 65535
%12 = load i32, i32* %3
%13 = ashr i32 %12, 16
%14 = add nsw i32 %11, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @csum_fold(i32 %0) {
%2 = and i32 %0, 65535
%3 = ashr i32 %0, 16
%4 = add nsw i32 %2, %3
%5 = and i32 %4, 65535
%6 = ashr i32 %4, 16
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ ulong;

/* Variables and functions */
ulong sub_ulong(ulong arg1, ulong arg2) { return arg1 - arg2; }


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

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

LLVM IR (-O0):
define i64 @sub_ulong(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 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @sub_ulong(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
int rk31sdk_get_sdio_wifi_voltage(void) {
  int voltage;
  voltage = 3300;
  return voltage;
}


x86 assembly (clang, -O0):
<rk31sdk_get_sdio_wifi_voltage>:
push   %rbp
mov    %rsp,%rbp
movl   $0xce4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rk31sdk_get_sdio_wifi_voltage() {
ret i32 3300
}
/* Variables and functions */
char **readdir_raw(char *, int, int /*<<< orphan*/ *);
char **stb_readdir_subdirs(char *dir) { return readdir_raw(dir, 1, NULL); }


x86 assembly (clang, -O0):
<stb_readdir_subdirs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <readdir_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_readdir_subdirs>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <readdir_raw@plt>

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

LLVM IR (-O2):
define i8** @stb_readdir_subdirs(i8* %0) {
%2 = tail call i8** @readdir_raw(i8* %0, i32 1, i32* null)
ret i8** %2
}
int opcode_is_jump(int opcode) {
  switch (opcode) {
  case 394:
  case 395:
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<opcode_is_jump>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffe76,%eax
sub    $0x1,%eax
ja     1129 <opcode_is_jump+0x29>
jmp    111d <opcode_is_jump+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1130 <opcode_is_jump+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcode_is_jump>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x18a,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @opcode_is_jump(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 394, label %5
i32 395, label %5
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @opcode_is_jump(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 394
%4 = zext i1 %3 to i32
ret i32 %4
}
char hash_is_prime(int number) {
  int d;
  for (d = 2; d * d <= number; d++) {
    if ((number % d) == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<hash_is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114a <hash_is_prime+0x4a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1137 <hash_is_prime+0x37>
movb   $0x0,-0x1(%rbp)
jmp    114e <hash_is_prime+0x4e>
jmp    113c <hash_is_prime+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <hash_is_prime+0xe>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_is_prime>:
mov    $0x1,%cl
cmp    $0x4,%edi
jl     1125 <hash_is_prime+0x25>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1128 <hash_is_prime+0x28>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1110 <hash_is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @hash_is_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp sgt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i8 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i8 %12
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int kswitch() {
  printf("proc %d enter Kernel to switch proc\n", getpid());
  syscall(4, 0, 0);
  printf("proc %d back from Kernel\n", getpid());
}


x86 assembly (clang, -O0):
<kswitch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <syscall@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kswitch>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x4,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <syscall@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"proc %d enter Kernel to switch proc\0A\00"
@.str.1 = [26 x i8] c"proc %d back from Kernel\0A\00"
define i32 @kswitch() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @syscall(i32 4, i32 0, i32 0)
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [37 x i8] c"proc %d enter Kernel to switch proc\0A\00"
@.str.1 = [26 x i8] c"proc %d back from Kernel\0A\00"
define i32 @kswitch() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @syscall(i32 4, i32 0, i32 0)
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ clear_stamps();
int /*<<< orphan*/ clear_update_buffer();
int /*<<< orphan*/ ppu_mask(int);
void init(void) {
  ppu_mask(0x00);
  clear_update_buffer();
  clear_stamps();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <ppu_mask@plt>
mov    $0x0,%al
call   1030 <clear_update_buffer@plt>
mov    $0x0,%al
call   1040 <clear_stamps@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %edi,%edi
call   1050 <ppu_mask@plt>
xor    %eax,%eax
call   1030 <clear_update_buffer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clear_stamps@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @ppu_mask(i32 0)
%2 = call i32 (...) @clear_update_buffer()
%3 = call i32 (...) @clear_stamps()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @ppu_mask(i32 0)
%2 = tail call i32 (...) @clear_update_buffer()
%3 = tail call i32 (...) @clear_stamps()
ret void
}
void h(void) { __builtin_realloc(0, 10); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0xa,%esi
call   1030 <realloc@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @h() {
%1 = call i8* @realloc(i8* null, i64 10)
ret void
}

LLVM IR (-O2):
define void @h() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, char);
void fb_move_cursor(unsigned short pos) {
  outb(0x3D4, 14);
  outb(0x3D5, (char)((pos >> 8) & 0x00FF));
  outb(0x3D4, 15);
  outb(0x3D5, (char)(pos & 0x00FF));
}


x86 assembly (clang, -O0):
<fb_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movsbl %al,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movsbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_move_cursor>:
push   %rbx
mov    %edi,%ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    %ebx,%eax
shr    $0x8,%eax
movsbl %al,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movsbl %bl,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @fb_move_cursor(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @outb(i32 980, i8 signext 14)
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = call i32 @outb(i32 981, i8 signext %8)
%10 = call i32 @outb(i32 980, i8 signext 15)
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = call i32 @outb(i32 981, i8 signext %14)
ret void
}

LLVM IR (-O2):
define void @fb_move_cursor(i16 zeroext %0) {
%2 = tail call i32 @outb(i32 980, i8 signext 14)
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
%5 = tail call i32 @outb(i32 981, i8 signext %4)
%6 = tail call i32 @outb(i32 980, i8 signext 15)
%7 = trunc i16 %0 to i8
%8 = tail call i32 @outb(i32 981, i8 signext %7)
ret void
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t __ntohs(uint16_t x) {
  __asm__("xchgb %b0,%h0" : "=q"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<__ntohs>:
mov    %rdi,%rax
xchg   %ah,%al
ret

LLVM IR (-O0):
define i8* @__ntohs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "xchgb ${0:b},${0:h}", "=q,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @__ntohs(i8* readnone %0) {
%2 = tail call i8* asm "xchgb ${0:b},${0:h}", "=q,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/buffer.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/buffer.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/buffer.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fillArray(int *, int);
float getTimeForBubbleSort(int *, int);
int /*<<< orphan*/ printf(char *, float);
void generateBubbleSort(int arrSize) {
  int arr[2500], i;
  float time;
  fillArray(arr, arrSize);
  time = getTimeForBubbleSort(arr, arrSize);
  printf("%-10.2f", time);
}


x86 assembly (clang, -O0):
<generateBubbleSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <fillArray@plt>
lea    -0x2720(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <getTimeForBubbleSort@plt>
movss  %xmm0,-0x2728(%rbp)
ff
movss  -0x2728(%rbp),%xmm0
ff
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateBubbleSort>:
push   %r14
push   %rbx
sub    $0x2718,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <fillArray@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <getTimeForBubbleSort@plt>
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
add    $0x2718,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%-10.2f\00"
define void @generateBubbleSort(i32 %0) {
%2 = alloca i32
%3 = alloca [2500 x i32]
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %2
%6 = getelementptr inbounds [2500 x i32], [2500 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @fillArray(i32* %6, i32 %7)
%9 = getelementptr inbounds [2500 x i32], [2500 x i32]* %3, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call float @getTimeForBubbleSort(i32* %9, i32 %10)
store float %11, float* %5
%12 = load float, float* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%-10.2f\00"
define void @generateBubbleSort(i32 %0) {
%2 = alloca [2500 x i32]
%3 = bitcast [2500 x i32]* %2 to i8*
%4 = getelementptr inbounds [2500 x i32], [2500 x i32]* %2, i64 0, i64 0
%5 = call i32 @fillArray(i32* %4, i32 %0)
%6 = call float @getTimeForBubbleSort(i32* %4, i32 %0)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %6)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
unsigned long long use_gtod() {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return (((unsigned long long)tv.tv_sec) * 1000) + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<use_gtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_gtod>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define i64 @use_gtod() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define i64 @use_gtod() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = sext i32 %11 to i64
%13 = add i64 %8, %12
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float a = 10.222;
  printf("%f\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x402471AA00000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  long long int res = 0;
  if (res < -2147483648LL) {
    printf("Error: 0 < -2147483648\n");
    return 1;
  } else if (2147483647LL < res) {
    printf("Error: 2147483647 < 0\n");
    return 2;
  } else
    printf("long long constant test ok.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xffffffff80000000,-0x10(%rbp)
80
jge    114d <main+0x3d>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    118c <main+0x7c>
mov    $0x7fffffff,%eax
cmp    -0x10(%rbp),%rax
jge    1174 <main+0x64>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    118c <main+0x7c>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1185 <main+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Error: 0 < -2147483648\0A\00"
@.str.1 = [23 x i8] c"Error: 2147483647 < 0\0A\00"
@.str.2 = [29 x i8] c"long long constant test ok.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, -2147483648
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %16
7: ; preds = %0
%8 = load i64, i64* %2
%9 = icmp slt i64 2147483647, %8
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %1
br label %16
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12
br label %15
15: ; preds = %14
store i32 0, i32* %1
br label %16
16: ; preds = %15, %10, %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@str = [28 x i8] c"long long constant test ok.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
void die(char *condition, char *file, int line) {
  fprintf(stderr, "Fatal error: %s at line %d of file %s\n", condition, line,
          file);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Fatal error: %s at line %d of file %s\0A\00"
define void @die(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Fatal error: %s at line %d of file %s\0A\00"
define void @die(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "This is a standard output info!\n");
  fprintf(stderr, "This is a standard error info\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [33 x i8] c"This is a standard output info!\0A\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"This is a standard error info\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [33 x i8] c"This is a standard output info!\0A\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"This is a standard error info\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void gdk_scroll_direction_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_scroll_direction_get_type() {
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct addrinfo *);
void proxy_freeaddrinfo(struct addrinfo *res) {
  do {
    do {
    } while (0);
  } while (0);
  free(res);
}


x86 assembly (clang, -O0):
<proxy_freeaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <proxy_freeaddrinfo+0x11>
jmp    1126 <proxy_freeaddrinfo+0x16>
jmp    112b <proxy_freeaddrinfo+0x1b>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proxy_freeaddrinfo>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define void @proxy_freeaddrinfo(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5
%7 = load %struct.addrinfo*, %struct.addrinfo** %2
%8 = call i32 @free(%struct.addrinfo* %7)
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @proxy_freeaddrinfo(%struct.addrinfo* nocapture %0) {
%2 = tail call i32 @free(%struct.addrinfo* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long property;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
void set_XSelectionRequestEvent_property(void *_p, unsigned long _v) {
  ((XSelectionRequestEvent *)_p)->property = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XSelectionRequestEvent_property>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSelectionRequestEvent_property(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSelectionRequestEvent_property(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void barf(char *s) {
  perror(s);
  exit(3);
}


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

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

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

LLVM IR (-O2):
define void @barf(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 3)
unreachable
}
void default_wake_function(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<default_wake_function>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_wake_function>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.default_wake_function = [22 x i8] c"default_wake_function\00"
define void @default_wake_function() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.default_wake_function, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.default_wake_function = [22 x i8] c"default_wake_function\00"
define void @default_wake_function() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.default_wake_function, i64 0, i64 0))
ret void
}
/* Variables and functions */
void VIDDummyVdp2DrawStart(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp2DrawStart() {
ret void
}
int test_imm_CEuint16_reg(unsigned short val) {
  return ((val) & (0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xce,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEuint16_reg>:
test   $0xce,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CEuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 206
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned int ic_parse_perm_is_valid_downgrade(unsigned int from,
                                              unsigned int to) {
  if ((from & to) == to) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ic_parse_perm_is_valid_downgrade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1125 <ic_parse_perm_is_valid_downgrade+0x25>
movl   $0x1,-0x4(%rbp)
jmp    112c <ic_parse_perm_is_valid_downgrade+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ic_parse_perm_is_valid_downgrade(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned char is_ascii_pchar(char c) {
  if (c >= 32 && c <= 126)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_ascii_pchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     112d <is_ascii_pchar+0x2d>
movsbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jg     112d <is_ascii_pchar+0x2d>
movb   $0x1,-0x1(%rbp)
jmp    1131 <is_ascii_pchar+0x31>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ascii_pchar>:
add    $0xe0,%dil
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @is_ascii_pchar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 126
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 1, i8* %2
br label %13
12: ; preds = %7, %1
store i8 0, i8* %2
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @is_ascii_pchar(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i8
ret i8 %4
}