xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t, num, N;
  for (int i = 2; i <= (num / 2); i = i + 1) {
    if (num % i == 0) {
      t = 1;
      break;
    } else
      t = 0;
  }
  if (t == 1) {
    return 1;
  } else {
    return 0;
  }
  scanf("%d", &N);
  int count = 0;
  int p;
  for (p = 3; p <= N - 2; p = p + 2) {
    if (check_prime(p) == 0 && check_prime(p + 2) == 0) {
      count = count + 1;
    }
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jg     1166 <main+0x66>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    114c <main+0x4c>
movl   $0x1,-0x8(%rbp)
jmp    1166 <main+0x66>
movl   $0x0,-0x8(%rbp)
jmp    1158 <main+0x58>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <main+0x12>
cmpl   $0x1,-0x8(%rbp)
jne    117c <main+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%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
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %5
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = sdiv i32 %10, 2
%12 = icmp sle i32 %9, %11
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %2
br label %24
19: ; preds = %13
store i32 0, i32* %2
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %8
24: ; preds = %18, %8
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %1
br label %29
28: ; preds = %24
store i32 0, i32* %1
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int UINT_MAX;
int /*<<< orphan*/ printf(char *, int);
int hlp_uint_max(void) {
  printf("%u\n", UINT_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<hlp_uint_max>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_uint_max>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
@UINT_MAX = global i32 0
define i32 @hlp_uint_max() {
%1 = load i32, i32* @UINT_MAX
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
@UINT_MAX = global i32 0
define i32 @hlp_uint_max() {
%1 = load i32, i32* @UINT_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int flood_lessthan(float a, int npar, void *par) {
  double thres;
  thres = ((double *)par)[0];
  return (a < thres);
}


x86 assembly (clang, -O0):
<flood_lessthan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flood_lessthan>:
movsd  (%rsi),%xmm1
cvtss2sd %xmm0,%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @flood_lessthan(float %0, i32 %1, i8* %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i8*
%7 = alloca double
store float %0, float* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to double*
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
store double %11, double* %7
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = load double, double* %7
%15 = fcmp olt double %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @flood_lessthan(float %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to double*
%5 = load double, double* %4
%6 = fpext float %0 to double
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int main() {
  f();
  g();
  f();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <g@plt>
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f()
%2 = call i32 (...) @g()
%3 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
%3 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
const char *envGet(const char *name) {
  const char *s = getenv(name);
  return s;
}


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

x86 assembly (clang, -O2):
<envGet>:
jmp    1030 <getenv@plt>

LLVM IR (-O0):
define i8* @envGet(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @envGet(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
void RTManifestVerifyFilesBuf(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ed_swap_4(int /*<<< orphan*/);
void *ed_swap_4p(void *x) {
  *(uint32_t *)x = ed_swap_4(*(uint32_t *)x);
  return x;
}


x86 assembly (clang, -O0):
<ed_swap_4p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ed_swap_4@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ed_swap_4p>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <ed_swap_4@plt>
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ed_swap_4p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @ed_swap_4(i32 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @ed_swap_4p(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @ed_swap_4(i32 %3)
store i32 %4, i32* %2
ret i8* %0
}
void strlwr(str) char *str;
{
  for (; *str; str++)
    *str = tolower(*str);
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strlwr+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strlwr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strlwr+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strlwr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strlwr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @tolower(i32 %7)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
%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 = %4, %1
ret void
}
/* Variables and functions */
double sinh(double);
double ECsinh(double x) {
  double y;
  double r;
  y = x;
  r = sinh(y);
  return (r);
}


x86 assembly (clang, -O0):
<ECsinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECsinh>:
jmp    1030 <sinh@plt>

LLVM IR (-O0):
define double @ECsinh(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @sinh(double %6)
store double %7, double* %4
%8 = load double, double* %4
ret double %8
}

LLVM IR (-O2):
define double @ECsinh(double %0) {
%2 = tail call double @sinh(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ memcmp(void *, void *, size_t);
scalar_t__ strcmp(void *, void *);
int compare(void *a, void *b, size_t size) {
  if (size == 0) {
    return strcmp(a, b) == 0;
  } else {
    return memcmp(a, b, size) == 0;
  }
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1160 <compare+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <compare+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %rax
test   %rdx,%rdx
je     112d <compare+0xd>
call   1030 <memcmp@plt>
jmp    1132 <compare+0x12>
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @compare(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i64 @strcmp(i8* %0, i8* %1)
br label %9
7: ; preds = %3
%8 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i64 [ %6, %5 ], [ %8, %7 ]
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
void homekit_mdns_configure_finalize() {}


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

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

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

LLVM IR (-O2):
define void @homekit_mdns_configure_finalize() {
ret void
}
int LprintStatement(char *Text) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @LprintStatement(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void finit() {
  db(0x9B);
  db(0xDB);
  db(0xE3);
}


x86 assembly (clang, -O0):
<finit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9b,%edi
call   1030 <db@plt>
mov    $0xdb,%edi
call   1030 <db@plt>
mov    $0xe3,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<finit>:
push   %rax
mov    $0x9b,%edi
call   1030 <db@plt>
mov    $0xdb,%edi
call   1030 <db@plt>
mov    $0xe3,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @finit() {
%1 = call i32 @db(i32 155)
%2 = call i32 @db(i32 219)
%3 = call i32 @db(i32 227)
ret void
}

LLVM IR (-O2):
define void @finit() {
%1 = tail call i32 @db(i32 155)
%2 = tail call i32 @db(i32 219)
%3 = tail call i32 @db(i32 227)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int Listen(int des, int backlog) {
  int temp;
  temp = listen(des, backlog);
  if (temp < 0) {
    perror("Error listening");
    exit(1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<Listen>:
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 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116c <Listen+0x3c>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1030 <listen@plt>
test   %eax,%eax
js     113c <Listen+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Error listening\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error listening\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32 %3
}
const char *SkipUntilEOL(const char *pSrc) {
  while (pSrc && (*pSrc)) {
    if ((*pSrc == '\x0D') || (*pSrc == '\x0A')) {
      break;
    }
    pSrc++;
  }
  return pSrc;
}


x86 assembly (clang, -O0):
<SkipUntilEOL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <SkipUntilEOL+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1138 <SkipUntilEOL+0x38>
jmp    116e <SkipUntilEOL+0x6e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1158 <SkipUntilEOL+0x58>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    115d <SkipUntilEOL+0x5d>
jmp    116e <SkipUntilEOL+0x6e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <SkipUntilEOL+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipUntilEOL>:
test   %rdi,%rdi
je     1124 <SkipUntilEOL+0x24>
mov    %rdi,%rax
mov    $0x2401,%ecx
jmp    1114 <SkipUntilEOL+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0xd,%rdx
ja     1110 <SkipUntilEOL+0x10>
bt     %rdx,%rcx
jae    1110 <SkipUntilEOL+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @SkipUntilEOL(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 13, label %8
i8 10, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3, %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ], [ %4, %3 ], [ %4, %3 ]
ret i8* %9
}
/* Type definitions */
struct timex {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_clock_adjtime;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, struct timex *);
int clock_adjtime(clockid_t id, struct timex *tx) {
  return syscall(__NR_clock_adjtime, id, tx);
}


x86 assembly (clang, -O0):
<clock_adjtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_adjtime>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timex = type { i32 }
@__NR_clock_adjtime = global i32 0
define i32 @clock_adjtime(i32 %0, %struct.timex* %1) {
%3 = alloca i32
%4 = alloca %struct.timex*
store i32 %0, i32* %3
store %struct.timex* %1, %struct.timex** %4
%5 = load i32, i32* @__NR_clock_adjtime
%6 = load i32, i32* %3
%7 = load %struct.timex*, %struct.timex** %4
%8 = call i32 @syscall(i32 %5, i32 %6, %struct.timex* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timex = type { i32 }
@__NR_clock_adjtime = global i32 0
define i32 @clock_adjtime(i32 %0, %struct.timex* %1) {
%3 = load i32, i32* @__NR_clock_adjtime
%4 = tail call i32 @syscall(i32 %3, i32 %0, %struct.timex* %1)
ret i32 %4
}
int test_imm_E7int32_reg(int val) { return ((val) & (0xE7 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_E7int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E7int32_reg(i32 %0) {
%2 = and i32 %0, 231
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
work1(i, n) int i, n;
{
  int j;
#pragma omp for
  for (j = 0; j < n; j++) {
    work2(i, j);
  }
}


x86 assembly (clang, -O0):
<work1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114c <work1+0x3c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <work2@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <work1+0x15>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work1>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1133 <work1+0x23>
mov    %esi,%ebx
mov    %edi,%r14d
xor    %ebp,%ebp
nop
mov    %r14d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <work2@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <work1+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @work1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @work2 to i32 (i32, i32, ...)*)(i32 %12, i32 %13)
br label %15
15: ; preds = %11
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %7
18: ; preds = %7
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @work1(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @work2 to i32 (i32, i32, ...)*)(i32 %0, i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 undef
}
/* Variables and functions */
const void *align_to(size_t tz, const void *p) {
  uintptr_t x = (uintptr_t)p;
  if (x % tz) {
    x -= x % tz;
  }
  return (const void *)x;
}


x86 assembly (clang, -O0):
<align_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
cmp    $0x0,%rdx
je     1141 <align_to+0x41>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_to>:
mov    %rsi,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1116 <align_to+0x16>
mov    %rsi,%rax
xor    %edx,%edx
div    %rdi
jmp    111c <align_to+0x1c>
mov    %esi,%eax
xor    %edx,%edx
div    %edi
sub    %rdx,%rsi
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @align_to(i64 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = urem i64 %3, %0
%5 = sub i64 %3, %4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
float s3d_clamp(float val, float min, float max) {
  return (val < min ? min : val > max ? max : val);
}


x86 assembly (clang, -O0):
<s3d_clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <s3d_clamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <s3d_clamp+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <s3d_clamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <s3d_clamp+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3d_clamp>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @s3d_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @s3d_clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int __sunriset__(int, int, int, double, double, double, int, double *,
                 double *);
int sun_rise_set(int year, int month, int day, double lon, double lat,
                 double *rise, double *set) {
  return __sunriset__(year, month, day, lon, lat, -35.0 / 60.0, 1, rise, set);
}


x86 assembly (clang, -O0):
<sun_rise_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
movsd  0xeaa(%rip),%xmm2
mov    $0x1,%ecx
call   1030 <__sunriset__@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_rise_set>:
mov    %r8,%r9
mov    %rcx,%r8
movsd  0xee2(%rip),%xmm2
mov    $0x1,%ecx
jmp    1030 <__sunriset__@plt>

LLVM IR (-O0):
define i32 @sun_rise_set(i32 %0, i32 %1, i32 %2, double %3, double %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double*
%14 = alloca double*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double %3, double* %11
store double %4, double* %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load double, double* %11
%19 = load double, double* %12
%20 = load double*, double** %13
%21 = load double*, double** %14
%22 = call i32 @__sunriset__(i32 %15, i32 %16, i32 %17, double %18, double %19, double 0xBFE2AAAAAAAAAAAB, i32 1, double* %20, double* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @sun_rise_set(i32 %0, i32 %1, i32 %2, double %3, double %4, double* %5, double* %6) {
%8 = tail call i32 @__sunriset__(i32 %0, i32 %1, i32 %2, double %3, double %4, double 0xBFE2AAAAAAAAAAAB, i32 1, double* %5, double* %6)
ret i32 %8
}
/* Variables and functions */
int dq_count_impl();
int dq_count() { return dq_count_impl(); }


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

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

LLVM IR (-O0):
define i32 @dq_count() {
%1 = call i32 (...) @dq_count_impl()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dq_count() {
%1 = tail call i32 (...) @dq_count_impl()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
void freeString(char **const pString) {
  if (*pString != NULL) {
    eFree(*pString);
    *pString = NULL;
  }
}


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

x86 assembly (clang, -O2):
<freeString>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <freeString+0x18>
call   1030 <eFree@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @freeString(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @eFree(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *, char *);
void _opencl_generate_build_opts(char *build_opts, size_t build_opts_len) {
  snprintf(build_opts, build_opts_len, "%s %s", "-cl-no-signed-zeros", "");
}


x86 assembly (clang, -O0):
<_opencl_generate_build_opts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
lea    0xed0(%rip),%rcx
lea    0xec8(%rip),%r8
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_opencl_generate_build_opts>:
lea    0xee9(%rip),%rdx
lea    0xee8(%rip),%rcx
lea    0xee0(%rip),%r8
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [20 x i8] c"-cl-no-signed-zeros\00"
@.str.2 = [1 x i8] zeroinitializer
define void @_opencl_generate_build_opts(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @snprintf(i8* %5, i64 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [20 x i8] c"-cl-no-signed-zeros\00"
@.str.2 = [1 x i8] zeroinitializer
define void @_opencl_generate_build_opts(i8* %0, i64 %1) {
%3 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(int, int, int, int, int, int, int, double, double,
                         double, double, double, double, double, double, double,
                         int, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  debug(1, 2, 3, 4, 5, 6, 7, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 8, 9,
        10);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movsd  0xea9(%rip),%xmm0
movsd  0xea9(%rip),%xmm1
movsd  0xea9(%rip),%xmm2
movsd  0xea9(%rip),%xmm3
movsd  0xea9(%rip),%xmm4
movsd  0xea9(%rip),%xmm5
movsd  0xea9(%rip),%xmm6
movsd  0xea9(%rip),%xmm7
movsd  0xea8(%rip),%xmm8
movl   $0x7,(%rsp)
movsd  %xmm8,0x8(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x9,0x18(%rsp)
movl   $0xa,0x20(%rsp)
call   1030 <debug@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
movabs $0x4022000000000000,%rax
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
movsd  0xec9(%rip),%xmm2
movsd  0xec9(%rip),%xmm3
movsd  0xec9(%rip),%xmm4
movsd  0xec9(%rip),%xmm5
movsd  0xec9(%rip),%xmm6
movsd  0xec9(%rip),%xmm7
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0xa
push   $0x9
push   $0x8
push   %rax
push   $0x7
call   1030 <debug@plt>
add    $0x30,%rsp
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @debug(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00, i32 8, i32 9, i32 10)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @debug(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00, i32 8, i32 9, i32 10)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ *SSL_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_set_fd(int /*<<< orphan*/ *, int);
SSL *zopenssl_SSL_create(SSL_CTX *ctx, int fd) {
  SSL *ssl;
  ssl = SSL_new(ctx);
  SSL_set_fd(ssl, fd);
  return ssl;
}


x86 assembly (clang, -O0):
<zopenssl_SSL_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSL_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <SSL_set_fd@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopenssl_SSL_create>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <SSL_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <SSL_set_fd@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @zopenssl_SSL_create(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32* @SSL_new(i32* %6)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = call i32 @SSL_set_fd(i32* %8, i32 %9)
%11 = load i32*, i32** %5
ret i32* %11
}

LLVM IR (-O2):
define i32* @zopenssl_SSL_create(i32* %0, i32 %1) {
%3 = tail call i32* @SSL_new(i32* %0)
%4 = tail call i32 @SSL_set_fd(i32* %3, i32 %1)
ret i32* %3
}
void not_zero() {}


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

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

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

LLVM IR (-O2):
define void @not_zero() {
ret void
}
/* Type definitions */
struct in6_addr {
  int /*<<< orphan*/ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, unsigned char *, int);
unsigned char *deserialize_ip_address(struct in6_addr *ip_address,
                                      unsigned char *data) {
  memcpy(ip_address->s6_addr, data, sizeof(struct in6_addr));
  return data + sizeof(struct in6_addr);
}


x86 assembly (clang, -O0):
<deserialize_ip_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserialize_ip_address>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i8* @deserialize_ip_address(%struct.in6_addr* %0, i8* %1) {
%3 = alloca %struct.in6_addr*
%4 = alloca i8*
store %struct.in6_addr* %0, %struct.in6_addr** %3
store i8* %1, i8** %4
%5 = load %struct.in6_addr*, %struct.in6_addr** %3
%6 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = call i32 @memcpy(i32 %7, i8* %8, i32 4)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 4
ret i8* %11
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i8* @deserialize_ip_address(%struct.in6_addr* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @memcpy(i32 %4, i8* %1, i32 4)
%6 = getelementptr inbounds i8, i8* %1, i64 4
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ SET_b_r(int /*<<< orphan*/, int /*<<< orphan*/ const);
int /*<<< orphan*/ get_mem(int /*<<< orphan*/ const);
int /*<<< orphan*/ set_mem(int /*<<< orphan*/ const, int /*<<< orphan*/);
int /*<<< orphan*/ update_all_cycles(int);
void SET_b_mem(uint16_t const addr, uint8_t const bit) {
  update_all_cycles(4);
  uint8_t result = SET_b_r(get_mem(addr), bit);
  update_all_cycles(4);
  set_mem(addr, result);
}


x86 assembly (clang, -O0):
<SET_b_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x4,%edi
call   1050 <update_all_cycles@plt>
mov    -0x4(%rbp),%edi
call   1030 <get_mem@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1060 <SET_b_r@plt>
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
call   1050 <update_all_cycles@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <set_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SET_b_mem>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x4,%edi
call   1050 <update_all_cycles@plt>
mov    %ebp,%edi
call   1030 <get_mem@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1060 <SET_b_r@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1050 <update_all_cycles@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <set_mem@plt>

LLVM IR (-O0):
define void @SET_b_mem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @update_all_cycles(i32 4)
%7 = load i32, i32* %3
%8 = call i32 @get_mem(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @SET_b_r(i32 %8, i32 %9)
store i32 %10, i32* %5
%11 = call i32 @update_all_cycles(i32 4)
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i32 @set_mem(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @SET_b_mem(i32 %0, i32 %1) {
%3 = tail call i32 @update_all_cycles(i32 4)
%4 = tail call i32 @get_mem(i32 %0)
%5 = tail call i32 @SET_b_r(i32 %4, i32 %1)
%6 = tail call i32 @update_all_cycles(i32 4)
%7 = tail call i32 @set_mem(i32 %0, i32 %5)
ret void
}
__attribute__((weak)) void TC0_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<TC0_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TC0_IrqHandler+0x9>
jmp    1109 <TC0_IrqHandler+0x9>

x86 assembly (clang, -O2):
<TC0_IrqHandler>:
jmp    1100 <TC0_IrqHandler>

LLVM IR (-O0):
define weak void @TC0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @TC0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int close(int);
int gpio_delete_pin(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<gpio_delete_pin>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @gpio_delete_pin(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printHelp() {
  const char message[] =
      "Program: Prevod casovych udaju\n"
      "Autor: Frantisek Kolacek (xkolac12@stud.fit.vutbr.cz)\n\n"
      "Pouziti: proj1 [moznosti]\n"
      " -t      - nejvyssi zobrazena jednotka bude tyden (standartne)\n"
      " -d      - nejvyssi zobrazena jednotka bude den\n"
      " -h      - nejvyssi zobrazena jednotka bude hodina\n"
      " -m      - nejvyssi zobrazena jednotka bude minuta\n"
      " -s      - nejvyssi zobrazena jednotka bude sekunda\n"
      " --extra - neomezene dlouhy vstup\n"
      " --help  - vypise napovedu\n";
  printf("%s\n", message);
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
lea    -0x1c0(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1b7,%edx
call   1040 <memcpy@plt>
lea    -0x1c0(%rbp),%rsi
lea    0x1066(%rip),%rdi
call   1030 <printf@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
push   %rbx
sub    $0x1c0,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x1b7,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
lea    0x1071(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1c0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.printHelp.message = [439 x i8] c"Program: Prevod casovych udaju\0AAutor: Frantisek Kolacek (xkolac12@stud.fit.vutbr.cz)\0A\0APouziti: proj1 [moznosti]\0A -t - nejvyssi zobrazena jednotka bude tyden (standartne)\0A -d - nejvyssi zobrazena jednotka bude den\0A -h - nejvyssi zobrazena jednotka bude hodina\0A -m - nejvyssi zobrazena jednotka bude minuta\0A -s - nejvyssi zobrazena jednotka bude sekunda\0A --extra - neomezene dlouhy vstup\0A --help - vypise napovedu\0A\00"
@.str = [4 x i8] c"%s\0A\00"
define void @printHelp() {
%1 = alloca [439 x i8]
%2 = bitcast [439 x i8]* %1 to i8*
%3 = getelementptr inbounds [439 x i8], [439 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@__const.printHelp.message = [439 x i8] c"Program: Prevod casovych udaju\0AAutor: Frantisek Kolacek (xkolac12@stud.fit.vutbr.cz)\0A\0APouziti: proj1 [moznosti]\0A -t - nejvyssi zobrazena jednotka bude tyden (standartne)\0A -d - nejvyssi zobrazena jednotka bude den\0A -h - nejvyssi zobrazena jednotka bude hodina\0A -m - nejvyssi zobrazena jednotka bude minuta\0A -s - nejvyssi zobrazena jednotka bude sekunda\0A --extra - neomezene dlouhy vstup\0A --help - vypise napovedu\0A\00"
@.str = [4 x i8] c"%s\0A\00"
define void @printHelp() {
%1 = alloca [439 x i8]
%2 = getelementptr inbounds [439 x i8], [439 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int __attribute__((always_)) f1(int x) {
  int blarg = 0;
  for (int i = 0; i < x; ++i)
    blarg = blarg + x * i;
  return blarg;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113e <f1+0x3e>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <f1+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
test   %edi,%edi
jle    111b <f1+0x1b>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
imul   %edi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
%13 = mul i32 %12, %0
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
int test_imm_32int16_reg(short val) {
  return ((val) & (0x32 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_32int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 50
%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_32int16_reg(i16 signext %0) {
%2 = and i16 %0, 50
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int isalnum(int);
int isalnumde(int c) { return (c > 127) ? -1 : isalnum(c); }


x86 assembly (clang, -O0):
<isalnumde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
jle    1132 <isalnumde+0x22>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <isalnumde+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnumde>:
cmp    $0x7f,%edi
jle    111b <isalnumde+0xb>
mov    $0xffffffff,%eax
ret
jmp    1030 <isalnum@plt>

LLVM IR (-O0):
define i32 @isalnumde(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 127
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalnum(i32 %7)
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ -1, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @isalnumde(i32 %0) {
%2 = icmp sgt i32 %0, 127
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isalnum(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}