xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t GET_BE64(const uint8_t *a) {
  return (uint64_t)(((uint64_t)a[0] << 56) | ((uint64_t)a[1] << 48) |
                    ((uint64_t)a[2] << 40) | ((uint64_t)a[3] << 32) |
                    (uint64_t)a[4] << 24) |
         ((uint64_t)a[5] << 16) | ((uint64_t)a[6] << 8) | a[7];
}


x86 assembly (clang, -O0):
<GET_BE64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x14(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x1c(%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GET_BE64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 56
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 48
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 40
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = shl i32 %19, 32
%21 = or i32 %16, %20
%22 = load i32*, i32** %2
%23 = getelementptr inbounds i32, i32* %22, i64 4
%24 = load i32, i32* %23
%25 = shl i32 %24, 24
%26 = or i32 %21, %25
%27 = load i32*, i32** %2
%28 = getelementptr inbounds i32, i32* %27, i64 5
%29 = load i32, i32* %28
%30 = shl i32 %29, 16
%31 = or i32 %26, %30
%32 = load i32*, i32** %2
%33 = getelementptr inbounds i32, i32* %32, i64 6
%34 = load i32, i32* %33
%35 = shl i32 %34, 8
%36 = or i32 %31, %35
%37 = load i32*, i32** %2
%38 = getelementptr inbounds i32, i32* %37, i64 7
%39 = load i32, i32* %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @GET_BE64(i32* nocapture readnone %0) {
ret i32 poison
}
/* Variables and functions */
unsigned int JSHash(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strlen(unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char *str = argv[1];
  unsigned int hash = JSHash(str, strlen(str));
  if (hash == 0x120bdadd)
    printf("You win!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <JSHash@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x120bdadd,-0x1c(%rbp)
jne    118a <main+0x5a>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <JSHash@plt>
cmp    $0x120bdadd,%eax
jne    115a <main+0x2a>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"You win!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @JSHash(i8* %4, i32 %5)
%7 = icmp eq i32 %6, 302766813
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}
/* Variables and functions */
int S_IROTH;
int S_IRWXG;
int S_IRWXU;
int S_IXOTH;
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  mkdir("./folderis", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
  puts("Buvo sukurta nauja direktorija.");
  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),%esi
mov    0x2e99(%rip),%rax
or     (%rax),%esi
mov    0x2e80(%rip),%rax
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
or     (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <mkdir@plt>
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e8e(%rip),%rax
or     (%rax),%esi
mov    0x2e9d(%rip),%rax
or     (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1030 <mkdir@plt>
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"./folderis\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@.str.1 = [32 x i8] c"Buvo sukurta nauja direktorija.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRWXG
%4 = or i32 %2, %3
%5 = load i32, i32* @S_IROTH
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IXOTH
%8 = or i32 %6, %7
%9 = call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"./folderis\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@.str.1 = [32 x i8] c"Buvo sukurta nauja direktorija.\00"
define i32 @main() {
%1 = load i32, i32* @S_IRWXU
%2 = load i32, i32* @S_IRWXG
%3 = or i32 %2, %1
%4 = load i32, i32* @S_IROTH
%5 = or i32 %3, %4
%6 = load i32, i32* @S_IXOTH
%7 = or i32 %5, %6
%8 = tail call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
double pLinear(double x) { return ((2.0) + (x / 12.0) * (1.0 - 2.0)); }


x86 assembly (clang, -O0):
<pLinear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xef2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pLinear>:
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @pLinear(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.200000e+01
%5 = call double @llvm.fmuladd.f64(double %4, double -1.000000e+00, double 2.000000e+00)
ret double %5
}

LLVM IR (-O2):
define double @pLinear(double %0) {
%2 = fdiv double %0, 1.200000e+01
%3 = tail call double @llvm.fmuladd.f64(double %2, double -1.000000e+00, double 2.000000e+00)
ret double %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ bar();
scalar_t__ foo();
uint32_t add() { return foo() + bar(); }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <foo@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <bar@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @add() {
%1 = call i64 (...) @foo()
%2 = call i64 (...) @bar()
%3 = add nsw i64 %1, %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @add() {
%1 = tail call i64 (...) @foo()
%2 = tail call i64 (...) @bar()
%3 = add nsw i64 %2, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidisplay_discovery_usage(void) {
  printf("\nUsage : wifidisplay_discovery_request/response [CONFIG_FILE]\n");
  printf("CONFIG_FILE contains WIFIDISPLAY service discovery payload.\n");
  return;
}


x86 assembly (clang, -O0):
<print_wifidisplay_discovery_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_wifidisplay_discovery_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"\0AUsage : wifidisplay_discovery_request/response [CONFIG_FILE]\0A\00"
@.str.1 = [61 x i8] c"CONFIG_FILE contains WIFIDISPLAY service discovery payload.\0A\00"
define void @print_wifidisplay_discovery_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"\0AUsage : wifidisplay_discovery_request/response [CONFIG_FILE]\00"
@str.2 = [60 x i8] c"CONFIG_FILE contains WIFIDISPLAY service discovery payload.\00"
define void @print_wifidisplay_discovery_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int aligned_main(int, char **);
int main(int argc, char *argv[]) { return aligned_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <aligned_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <aligned_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @aligned_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long, unsigned long);
char *util_print_time(unsigned long t) {
  static char s[40];
  (void)sprintf(s, "%ld.%02lu sec", t / 1000, (t % 1000) / 10);
  return s;
}


x86 assembly (clang, -O0):
<util_print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0x2ee9(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ed6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_print_time>:
push   %rbx
mov    %rdi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%rdx
imul   $0x3e8,%edx,%eax
sub    %eax,%edi
imul   $0xcccd,%edi,%ecx
shr    $0x13,%ecx
lea    0x2eff(%rip),%rbx
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@util_print_time.s = internal global [40 x i8] zeroinitializer
@.str = [14 x i8] c"%ld.%02lu sec\00"
define i8* @util_print_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 1000
%5 = load i64, i64* %2
%6 = urem i64 %5, 1000
%7 = udiv i64 %6, 10
%8 = call i32 @sprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %7)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0)
}

LLVM IR (-O2):
@util_print_time.s = internal global [40 x i8] zeroinitializer
@.str = [14 x i8] c"%ld.%02lu sec\00"
define i8* @util_print_time(i64 %0) {
%2 = udiv i64 %0, 1000
%3 = urem i64 %0, 1000
%4 = trunc i64 %3 to i16
%5 = udiv i16 %4, 10
%6 = zext i16 %5 to i64
%7 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %6)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0)
}
char lower(char x) { return x >= 'A' && x <= 'Z' ? 'a' + (x - 'A') : x; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <lower+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lower(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, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 65
%14 = add nsw i32 97, %13
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
scalar_t__ parse_XMLDecl(char **);
scalar_t__ parse_doctypedecl(char **);
int /*<<< orphan*/ parse_misc(char **);
int parse_prolog(char **xml) {
  if (parse_XMLDecl(xml))
    return 1;
  parse_misc(xml);
  if (parse_doctypedecl(xml))
    return 1;
  parse_misc(xml);
  return 0;
}


x86 assembly (clang, -O0):
<parse_prolog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <parse_XMLDecl@plt>
cmp    $0x0,%rax
je     115b <parse_prolog+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1193 <parse_prolog+0x63>
mov    -0x10(%rbp),%rdi
call   1030 <parse_misc@plt>
mov    -0x10(%rbp),%rdi
call   1040 <parse_doctypedecl@plt>
cmp    $0x0,%rax
je     1183 <parse_prolog+0x53>
movl   $0x1,-0x4(%rbp)
jmp    1193 <parse_prolog+0x63>
mov    -0x10(%rbp),%rdi
call   1030 <parse_misc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_prolog>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <parse_XMLDecl@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1164 <parse_prolog+0x34>
mov    %rbx,%rdi
call   1030 <parse_misc@plt>
mov    %rbx,%rdi
call   1040 <parse_doctypedecl@plt>
test   %rax,%rax
jne    1164 <parse_prolog+0x34>
mov    %rbx,%rdi
call   1030 <parse_misc@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_prolog(i8** %0) {
%2 = tail call i64 @parse_XMLDecl(i8** %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i32 @parse_misc(i8** %0)
%6 = tail call i64 @parse_doctypedecl(i8** %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @parse_misc(i8** %0)
br label %10
10: ; preds = %4, %1, %8
%11 = phi i32 [ 0, %8 ], [ 1, %1 ], [ 1, %4 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ string;

/* Variables and functions */
unsigned char stringHeight(char **string) {
  if (string == NULL) {
    return 0;
  }
  return sizeof(string) / sizeof(string[0]);
}


x86 assembly (clang, -O0):
<stringHeight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111c <stringHeight+0x1c>
movb   $0x0,-0x1(%rbp)
jmp    1120 <stringHeight+0x20>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringHeight>:
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @stringHeight(i8** %0) {
%2 = alloca i8
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = icmp eq i8** %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 0, i8* %2
br label %8
7: ; preds = %1
store i8 1, i8* %2
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @stringHeight(i8** readnone %0) {
%2 = icmp ne i8** %0, null
%3 = zext i1 %2 to i8
ret i8 %3
}
int main(void) {
  unsigned int a = 1;
  a <<= 31;
  a <<= 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 31
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
float sdot_sse(float *x, float *y, int n) {}


x86 assembly (clang, -O0):
<sdot_sse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @sdot_sse(float* %0, float* %1, i32 %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
store float* %0, float** %5
store float* %1, float** %6
store i32 %2, i32* %7
%8 = load float, float* %4
ret float %8
}

LLVM IR (-O2):
define float @sdot_sse(float* nocapture readnone %0, float* nocapture readnone %1, i32 %2) {
ret float undef
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_address_context(unsigned char const *, struct stream *);
int decode_address_context_64bit_is0(const unsigned char *pkt,
                                     struct stream *stream) {
  return decode_address_context(pkt, stream);
}


x86 assembly (clang, -O0):
<decode_address_context_64bit_is0>:
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 <decode_address_context@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_address_context_64bit_is0>:
jmp    1030 <decode_address_context@plt>

LLVM IR (-O0):
%struct.stream = type { i32 }
define i32 @decode_address_context_64bit_is0(i8* %0, %struct.stream* %1) {
%3 = alloca i8*
%4 = alloca %struct.stream*
store i8* %0, i8** %3
store %struct.stream* %1, %struct.stream** %4
%5 = load i8*, i8** %3
%6 = load %struct.stream*, %struct.stream** %4
%7 = call i32 @decode_address_context(i8* %5, %struct.stream* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_address_context_64bit_is0(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_address_context(i8* %0, %struct.stream* %1)
ret i32 %3
}
int test_imm_ABuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xAB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ABuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 734439407616
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, int /*<<< orphan*/);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void xgettimeofday(struct timeval *tv) {
  if (gettimeofday(tv, 0) != 0)
    fatal("mDaemon error message: gettimeofday failed: %s", strerror(errno));
}


x86 assembly (clang, -O0):
<xgettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     116d <xgettimeofday+0x3d>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1050 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgettimeofday>:
push   %rax
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     115a <xgettimeofday+0x2a>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1050 <fatal@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [47 x i8] c"mDaemon error message: gettimeofday failed: %s\00"
@errno = global i32 0
define void @xgettimeofday(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @strerror(i32 %7)
%9 = call i32 @fatal(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [47 x i8] c"mDaemon error message: gettimeofday failed: %s\00"
@errno = global i32 0
define void @xgettimeofday(%struct.timeval* %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret void
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
scalar_t__ nval_used(struct yaffs_dev *, char const *, int);
int nval_hasvalues(struct yaffs_dev *dev, const char *xb, int xb_size) {
  return nval_used(dev, xb, xb_size) > 0;
}


x86 assembly (clang, -O0):
<nval_hasvalues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <nval_used@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define i32 @nval_hasvalues(%struct.yaffs_dev* %0, i8* %1, i32 %2) {
%4 = alloca %struct.yaffs_dev*
%5 = alloca i8*
%6 = alloca i32
store %struct.yaffs_dev* %0, %struct.yaffs_dev** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.yaffs_dev*, %struct.yaffs_dev** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i64 @nval_used(%struct.yaffs_dev* %7, i8* %8, i32 %9)
%11 = icmp sgt i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i32 @nval_hasvalues(%struct.yaffs_dev* %0, i8* %1, i32 %2) {
%4 = tail call i64 @nval_used(%struct.yaffs_dev* %0, i8* %1, i32 %2)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void short2be(unsigned short val, unsigned char *addr) {
  addr[0] = (val >> 8) & 0xff;
  addr[1] = val & 0xFF;
}


x86 assembly (clang, -O0):
<short2be>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<short2be>:
rol    $0x8,%di
mov    %di,(%rsi)
ret

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

LLVM IR (-O2):
define void @short2be(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %1
%5 = trunc i16 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *xstrdup(const char *s) {
  if (s)
    return strdup(s);
  return NULL;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <xstrdup+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <xstrdup+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
test   %rdi,%rdi
je     111a <xstrdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
void EVP_DecodeFinal(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_DecodeFinal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvCaptureFrameEx(char byBoardNum, void **hEvent, char bContinuous,
                     char byInterruptMode, char byNumFrames, long dwPhysAddr,
                     long dwLinAddr) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvCaptureFrameEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    0x10(%rbp),%r8
mov    %dil,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %dl,-0x11(%rbp)
mov    %cl,-0x12(%rbp)
mov    %al,-0x13(%rbp)
mov    %r9,-0x20(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureFrameEx(i8 signext %0, i8** %1, i8 signext %2, i8 signext %3, i8 signext %4, i64 %5, i64 %6) {
%8 = alloca i8
%9 = alloca i8**
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i64
%14 = alloca i64
store i8 %0, i8* %8
store i8** %1, i8*** %9
store i8 %2, i8* %10
store i8 %3, i8* %11
store i8 %4, i8* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%15 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureFrameEx(i8 signext %0, i8** nocapture readnone %1, i8 signext %2, i8 signext %3, i8 signext %4, i64 %5, i64 %6) {
%8 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct S_ELEMENT {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destructors_ops_solver(struct S_ELEMENT *const);
void destructors_ops(struct S_ELEMENT *const ELEMENT) {
  destructors_ops_solver(ELEMENT);
}


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

x86 assembly (clang, -O2):
<destructors_ops>:
jmp    1030 <destructors_ops_solver@plt>

LLVM IR (-O0):
%struct.S_ELEMENT = type { i32 }
define void @destructors_ops(%struct.S_ELEMENT* %0) {
%2 = alloca %struct.S_ELEMENT*
store %struct.S_ELEMENT* %0, %struct.S_ELEMENT** %2
%3 = load %struct.S_ELEMENT*, %struct.S_ELEMENT** %2
%4 = call i32 @destructors_ops_solver(%struct.S_ELEMENT* %3)
ret void
}

LLVM IR (-O2):
%struct.S_ELEMENT = type { i32 }
define void @destructors_ops(%struct.S_ELEMENT* %0) {
%2 = tail call i32 @destructors_ops_solver(%struct.S_ELEMENT* %0)
ret void
}
/* Variables and functions */
long double cbrt(double);
__attribute__((weak)) long double cbrtl(long double x) {
  return cbrt((double)x);
}


x86 assembly (clang, -O0):
<cbrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cbrt@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <cbrt@plt>

LLVM IR (-O0):
define weak x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @cbrt(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @cbrt(double %2)
ret x86_fp80 %3
}
double cwirc_determine_signal_strength(int distance) {
  return (1 / (1 + ((double)distance / 200)));
}


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

x86 assembly (clang, -O2):
<cwirc_determine_signal_strength>:
cvtsi2sd %edi,%xmm1
divsd  0xef4(%rip),%xmm1
movsd  0xef4(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cwirc_determine_signal_strength(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 2.000000e+02
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @cwirc_determine_signal_strength(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 2.000000e+02
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
ret double %5
}
int lib1t21(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @lib1t21() {
ret i32 1
}

LLVM IR (-O2):
define i32 @lib1t21() {
ret i32 1
}
int is_contain_star_or_sharp(const char *str) {
  int flag = 0;
  char *p = (char *)str;
  while (*p != '\0') {
    if (*p == '*' || *p == '#') {
      flag = 1;
      break;
    }
    p++;
  }
  return flag;
}


x86 assembly (clang, -O0):
<is_contain_star_or_sharp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <is_contain_star_or_sharp+0x64>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
je     1147 <is_contain_star_or_sharp+0x47>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1153 <is_contain_star_or_sharp+0x53>
movl   $0x1,-0xc(%rbp)
jmp    1164 <is_contain_star_or_sharp+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <is_contain_star_or_sharp+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_contain_star_or_sharp>:
movzbl (%rdi),%eax
test   %al,%al
je     111b <is_contain_star_or_sharp+0x1b>
cmp    $0x23,%al
je     1115 <is_contain_star_or_sharp+0x15>
cmp    $0x2a,%al
je     1115 <is_contain_star_or_sharp+0x15>
add    $0x1,%rdi
jmp    1100 <is_contain_star_or_sharp>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_contain_star_or_sharp(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 %5 [
i8 0, label %7
i8 42, label %8
i8 35, label %8
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ], [ 1, %2 ]
ret i32 %9
}
void g_strcanon() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ zf_timer_off();
int zf_notify_sys(struct notifier_block *this, unsigned long code,
                  void *unused) {
  {
    if (code == 1UL) {
      { zf_timer_off(); }
    } else {
      if (code == 2UL) {
        { zf_timer_off(); }
      } else {
      }
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<zf_notify_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    113b <zf_notify_sys+0x2b>
mov    $0x0,%al
call   1030 <zf_timer_off@plt>
jmp    115c <zf_notify_sys+0x4c>
cmpq   $0x2,-0x10(%rbp)
jne    1152 <zf_notify_sys+0x42>
mov    $0x0,%al
call   1030 <zf_timer_off@plt>
jmp    1157 <zf_notify_sys+0x47>
jmp    1157 <zf_notify_sys+0x47>
jmp    115c <zf_notify_sys+0x4c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zf_notify_sys>:
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
ja     1126 <zf_notify_sys+0x16>
push   %rax
xor    %eax,%eax
call   1030 <zf_timer_off@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.notifier_block = type { i32 }
define i32 @zf_notify_sys(%struct.notifier_block* %0, i64 %1, i8* %2) {
%4 = alloca %struct.notifier_block*
%5 = alloca i64
%6 = alloca i8*
store %struct.notifier_block* %0, %struct.notifier_block** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (...) @zf_timer_off()
br label %18
11: ; preds = %3
%12 = load i64, i64* %5
%13 = icmp eq i64 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @zf_timer_off()
br label %17
16: ; preds = %11
br label %17
17: ; preds = %16, %14
br label %18
18: ; preds = %17, %9
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type { i32 }
define i32 @zf_notify_sys(%struct.notifier_block* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = add i64 %1, -1
%5 = icmp ult i64 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @zf_timer_off()
br label %8
8: ; preds = %3, %6
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int int8_t;

/* Variables and functions */
int8_t get_dval(uint8_t val) {
  if (val & 0x80)
    return -(val & 0x7F);
  return val;
}


x86 assembly (clang, -O0):
<get_dval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112a <get_dval+0x2a>
mov    -0x8(%rbp),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <get_dval+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dval>:
mov    %edi,%eax
and    $0x7f,%eax
neg    %eax
test   $0x80,%dil
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_dval(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 127
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_divstep_precomp(uintptr_t);
void fiat_p224_divstep_precomp(uint32_t out1[7]) {
  internal_fiat_p224_divstep_precomp((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p224_divstep_precomp>:
jmp    1030 <internal_fiat_p224_divstep_precomp@plt>

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

LLVM IR (-O2):
define void @fiat_p224_divstep_precomp(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p224_divstep_precomp(i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sll_si64(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_sll_si64(__m64 a, __m64 b) { return _mm_sll_si64(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_sll_si64>:
jmp    1030 <_mm_sll_si64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sll_si64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sll_si64(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ load(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int main(int argc, char const *argv[]) {
  FILE *in = (argc == 1) ? stdin : fopen("C-examp-practice.in", "r");
  load(in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1153 <main+0x33>
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    116a <main+0x4a>
lea    0xea6(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <load@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1132 <main+0x12>
mov    0x2ebb(%rip),%rax
mov    (%rax),%rdi
jmp    1148 <main+0x28>
lea    0xec7(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rdi
call   1040 <load@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [20 x i8] c"C-examp-practice.in\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32*, i32** @stdin
br label %13
11: ; preds = %2
%12 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = phi i32* [ %10, %9 ], [ %12, %11 ]
store i32* %14, i32** %6
%15 = load i32*, i32** %6
%16 = call i32 @load(i32* %15)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [20 x i8] c"C-examp-practice.in\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32*, i32** @stdin
br label %8
6: ; preds = %2
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32* [ %5, %4 ], [ %7, %6 ]
%10 = tail call i32 @load(i32* %9)
ret i32 0
}
int d2s(double d) { return (int)d; }


x86 assembly (clang, -O0):
<d2s>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2s>:
cvttsd2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @d2s(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void despedida() {
  printf(
      "\n\nObrigado por executar o informatica29PapaiNoel!! Boas festas!\n\n");
}


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

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

LLVM IR (-O0):
@.str = [66 x i8] c"\0A\0AObrigado por executar o informatica29PapaiNoel!! Boas festas!\0A\0A\00"
define void @despedida() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [65 x i8] c"\0A\0AObrigado por executar o informatica29PapaiNoel!! Boas festas!\0A\00"
define void @despedida() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
ret void
}
void str_sanitize_cc(char *str_in) {
  unsigned char *str = (unsigned char *)str_in;
  while (*str) {
    if (*str < 32)
      *str = ' ';
    str++;
  }
}


x86 assembly (clang, -O0):
<str_sanitize_cc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <str_sanitize_cc+0x45>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x20,%eax
jge    1134 <str_sanitize_cc+0x34>
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_sanitize_cc+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_sanitize_cc>:
mov    (%rdi),%al
test   %al,%al
je     1125 <str_sanitize_cc+0x25>
add    $0x1,%rdi
jmp    111b <str_sanitize_cc+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <str_sanitize_cc+0x25>
cmp    $0x1f,%al
ja     1110 <str_sanitize_cc+0x10>
movb   $0x20,-0x1(%rdi)
jmp    1110 <str_sanitize_cc+0x10>
ret

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

LLVM IR (-O2):
define void @str_sanitize_cc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = icmp ult i8 %5, 32
br i1 %7, label %8, label %9
8: ; preds = %4
store i8 32, i8* %6
br label %9
9: ; preds = %8, %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %1
ret void
}