xunge/DecIR huggingface dataset:
/* Variables and functions */
int ch();
int chsp(void) {
  int c;
  while (c = ch(), c == ' ')
    ;
  return c;
}


x86 assembly (clang, -O0):
<chsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ch@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jne    1131 <chsp+0x21>
jmp    1118 <chsp+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chsp>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ch@plt>
cmp    $0x20,%eax
je     1120 <chsp+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @chsp() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @ch()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @chsp() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @ch()
%3 = icmp eq i32 %2, 32
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 %2
}
double Km2Rad(const double km) { return km / 6371; }


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

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

LLVM IR (-O0):
define double @Km2Rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 6.371000e+03
ret double %4
}

LLVM IR (-O2):
define double @Km2Rad(double %0) {
%2 = fdiv double %0, 6.371000e+03
ret double %2
}
char *strrchr(const char *s, int c) {
  const char *ptr = s;
  while (*ptr)
    ptr++;
  while (--ptr >= s) {
    if (*ptr == c) {
      return (char *)ptr;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1131 <strrchr+0x31>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strrchr+0x13>
jmp    1136 <strrchr+0x36>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
cmp    -0x10(%rbp),%rax
jb     116e <strrchr+0x6e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1169 <strrchr+0x69>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <strrchr+0x76>
jmp    1136 <strrchr+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
lea    -0x2(%rdi),%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x2(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strrchr+0x10>
xor    %eax,%eax
nopl   0x0(%rax)
cmp    %rdi,%rcx
jb     1137 <strrchr+0x37>
movsbl (%rcx),%edx
add    $0xffffffffffffffff,%rcx
cmp    %esi,%edx
jne    1120 <strrchr+0x20>
add    $0x1,%rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %12
%9 = phi i8* [ %10, %12 ], [ %4, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 -1
%11 = icmp ult i8* %10, %0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i8, i8* %10
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, %1
br i1 %15, label %16, label %8
16: ; preds = %8, %12
%17 = phi i8* [ %10, %12 ], [ null, %8 ]
ret i8* %17
}
main(a) { printf(a = "main(a){printf(a=%c%s%c,34,a,34);}", 34, a, 34); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xed1(%rip),%rax
movslq %eax,%rdi
mov    $0x22,%ecx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rax
movslq %eax,%rdi
mov    $0x22,%esi
mov    %edi,%edx
mov    $0x22,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"main(a){printf(a=%c%s%c,34,a,34);}\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 ptrtoint ([35 x i8]* @.str to i32), i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 sext (i32 ptrtoint ([35 x i8]* @.str to i32) to i64) to i8*), i32 34, i32 %3, i32 34)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"main(a){printf(a=%c%s%c,34,a,34);}\00"
define i32 @main(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 sext (i32 ptrtoint ([35 x i8]* @.str to i32) to i64) to i8*), i32 34, i32 ptrtoint ([35 x i8]* @.str to i32), i32 34)
ret i32 0
}
float min_value(const float value1, const float value2) {
  if (value1 < value2)
    return value1;
  else
    return value2;
}


x86 assembly (clang, -O0):
<min_value>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min_value+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <min_value+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_value>:
minss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @min_value(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void RTDirReadEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDirReadEx() {
ret void
}
int main() {
  int arg = 0xA0000000;
  int out1 = 0;
  int out2 = 0;
  int out3 = 0;
  __asm__("movl %3, %0; movl %3, %1; movl $0xDEADBEEF, %2;"
          : "=m"(out1), "=m"(out2), "=r"(out3)
          : "r"(arg));
  return (arg == out1) && (arg == out2) && (out3 == 0xDEADBEEF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa0000000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    $0xdeadbeef,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x15(%rbp)
jne    1167 <main+0x67>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x15(%rbp)
jne    1167 <main+0x67>
cmpl   $0xdeadbeef,-0x14(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
movl   $0x0,-0x8(%rsp)
mov    $0xa0000000,%ecx
mov    %ecx,-0x4(%rsp)
mov    %ecx,-0x8(%rsp)
mov    $0xdeadbeef,%edx
mov    -0x4(%rsp),%eax
xor    %ecx,%eax
xor    -0x8(%rsp),%ecx
or     %eax,%ecx
xor    $0xdeadbeef,%edx
xor    %eax,%eax
or     %ecx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 -1610612736, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = call i32 asm "movl $3, $0; movl $3, $1; movl $$0xDEADBEEF, $2;", "=*m,=*m,=r,r,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32* elementtype(i32) %4, i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %0
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, -559038737
br label %18
18: ; preds = %15, %11, %0
%19 = phi i1 [ false, %11 ], [ false, %0 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 asm "movl $3, $0; movl $3, $1; movl $$0xDEADBEEF, $2;", "=*m,=*m,=r,r,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %1, i32* elementtype(i32) %2, i32 -1610612736)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, -1610612736
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, -1610612736
%10 = select i1 %7, i1 %9, i1 false
%11 = icmp eq i32 %5, -559038737
%12 = select i1 %10, i1 %11, i1 false
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ sirens();
int /*<<< orphan*/ strsig();
int main(void) {
  strsig();
  sirens();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <strsig@plt>
mov    $0x0,%al
call   1040 <sirens@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @strsig()
%3 = call i32 (...) @sirens()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @strsig()
%2 = tail call i32 (...) @sirens()
ret i32 0
}
void RTSemEventDestroy(void) {}


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

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

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

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

/* Variables and functions */
uint8_t getR1(uint32_t instruction) {
  uint32_t mask = 0x03e00000;
  uint32_t reg = mask & instruction;
  uint8_t r1 = reg >> 21;
  return r1;
}


x86 assembly (clang, -O0):
<getR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3e00000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x15,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getR1>:
mov    %edi,%eax
shr    $0x15,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @getR1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 65011712, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 21
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @getR1(i32 %0) {
%2 = lshr i32 %0, 21
%3 = and i32 %2, 31
ret i32 %3
}
int left_ch(int i, int k) { return (i * k) + 1; }


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

x86 assembly (clang, -O2):
<left_ch>:
imul   %esi,%edi
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @left_ch(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int Arith_div(int, int);
int Arith_ceiling(int x, int y) { return Arith_div(x, y) + (x % y != 0); }


x86 assembly (clang, -O0):
<Arith_ceiling>:
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 <Arith_div@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Arith_ceiling>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <Arith_div@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ebx
cmp    $0x1,%edx
sbb    $0xffffffff,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Arith_ceiling(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 @Arith_div(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @Arith_ceiling(i32 %0, i32 %1) {
%3 = tail call i32 @Arith_div(i32 %0, i32 %1)
%4 = srem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int /*<<< orphan*/ scanf(char *, short *);
int main() {
  short n;
  while (1) {
    scanf("%hd", &n);
    if (n == 42) {
      break;
    }
    printf("%hd\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1040 <scanf@plt>
movswl -0x6(%rbp),%eax
cmp    $0x2a,%eax
jne    1151 <main+0x31>
jmp    1166 <main+0x46>
lea    0xeac(%rip),%rdi
movswl -0x6(%rbp),%esi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1040 <scanf@plt>
movzwl 0xe(%rsp),%eax
cmp    $0x2a,%ax
je     1181 <main+0x61>
lea    0xeb8(%rip),%r14
lea    0xead(%rip),%r15
lea    0xe(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
movswl %ax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movzwl 0xe(%rsp),%eax
cmp    $0x2a,%ax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%hd\00"
@.str.1 = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
br label %3
3: ; preds = %0, %9
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = icmp eq i32 %6, 42
br i1 %7, label %8, label %9
8: ; preds = %3
br label %12
9: ; preds = %3
%10 = load i16, i16* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i16 signext %10)
br label %3
12: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%hd\00"
@.str.1 = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %1)
%4 = load i16, i16* %1
%5 = icmp eq i16 %4, 42
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i16 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i16 signext %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %1)
%10 = load i16, i16* %1
%11 = icmp eq i16 %10, 42
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  scalar_t__ tv_nsec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t timespec_sub_nanosec_int64(struct timespec a, struct timespec b) {
  return 1000000000LL * (a.tv_sec - b.tv_sec) + (a.tv_nsec - b.tv_nsec);
}


x86 assembly (clang, -O0):
<timespec_sub_nanosec_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
imul   $0x3b9aca00,%rax,%rax
mov    -0x8(%rbp),%rcx
sub    -0x18(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_sub_nanosec_int64>:
sub    %rdx,%rdi
imul   $0x3b9aca00,%rdi,%rax
sub    %rcx,%rsi
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_sub_nanosec_int64(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = bitcast %struct.timespec* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timespec* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%16 = load i64, i64* %15
%17 = sub nsw i64 %14, %16
%18 = mul nsw i64 1000000000, %17
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%22 = load i64, i64* %21
%23 = sub nsw i64 %20, %22
%24 = add nsw i64 %18, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @timespec_sub_nanosec_int64(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %0, %2
%6 = mul nsw i64 %5, 1000000000
%7 = sub i64 %1, %3
%8 = add nsw i64 %7, %6
ret i64 %8
}
void test_trailing_slash_is_ok(void) {
  do {
    seatest_assert_true(is_dir("test-data/existing-files/"), __FUNCTION__, 20);
  } while (0);
}


x86 assembly (clang, -O0):
<test_trailing_slash_is_ok>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_trailing_slash_is_ok+0x9>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1040 <is_dir@plt>
mov    %eax,%edi
lea    0xeda(%rip),%rsi
mov    $0x14,%edx
mov    $0x0,%al
call   1030 <seatest_assert_true@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trailing_slash_is_ok>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <is_dir@plt>
lea    0xee4(%rip),%rsi
mov    %eax,%edi
mov    $0x14,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <seatest_assert_true@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"test-data/existing-files/\00"
@__FUNCTION__.test_trailing_slash_is_ok = [26 x i8] c"test_trailing_slash_is_ok\00"
define void @test_trailing_slash_is_ok() {
br label %1
1: ; preds = %0
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @is_dir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__FUNCTION__.test_trailing_slash_is_ok, i64 0, i64 0), i32 20)
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"test-data/existing-files/\00"
@__FUNCTION__.test_trailing_slash_is_ok = [26 x i8] c"test_trailing_slash_is_ok\00"
define void @test_trailing_slash_is_ok() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_dir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__FUNCTION__.test_trailing_slash_is_ok, i64 0, i64 0), i32 20)
ret void
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int countlib(int);
int offset(int, int, int, int);
int autohelperowl_attackpat32(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int A;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(1, -1, move, transformation);
  return countlib(A) > 1;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <countlib@plt>
cmp    $0x1,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat32>:
push   %rax
mov    %esi,%ecx
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1030 <offset@plt>
mov    %eax,%edi
call   1040 <countlib@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat32(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 1, i32 -1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i32 @countlib(i32 %18)
%20 = icmp sgt i32 %19, 1
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat32(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 1, i32 -1, i32 %2, i32 %1)
%7 = tail call i32 @countlib(i32 %6)
%8 = icmp sgt i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
double aberration_correction(double r) { return -20.4898 / (3600.0 * r); }


x86 assembly (clang, -O0):
<aberration_correction>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<aberration_correction>:
mulsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @aberration_correction(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.600000e+03, %3
%5 = fdiv double -2.048980e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @aberration_correction(double %0) {
%2 = fmul double %0, 3.600000e+03
%3 = fdiv double -2.048980e+01, %2
ret double %3
}
int __ltstring(s1, len1, s2, len2)
char *s1;
int len1;
char *s2;
int len2;
{
  int i;
  i = memcmp(s1, s2, ((len1) < (len2) ? (len1) : (len2)));
  if (i)
    return (i < 0);
  return (len1 < len2);
}


x86 assembly (clang, -O0):
<__ltstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    114d <__ltstring+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1153 <__ltstring+0x43>
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdi
mov    -0x3c(%rbp),%eax
movslq %eax,%rdx
call   1030 <memcmp@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1187 <__ltstring+0x77>
cmpl   $0x0,-0x28(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1198 <__ltstring+0x88>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltstring>:
push   %rbx
xor    %ebx,%ebx
cmp    %ecx,%esi
setl   %bl
cmovl  %esi,%ecx
movslq %ecx,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sets   %cl
cmove  %ebx,%ecx
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__ltstring(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load i8*, i8** %6
%12 = load i8*, i8** %8
%13 = load i32, i32* %7
%14 = load i32, i32* %9
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = load i32, i32* %7
br label %20
18: ; preds = %4
%19 = load i32, i32* %9
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
%22 = sext i32 %21 to i64
%23 = call i32 @memcmp(i8* %11, i8* %12, i64 %22)
store i32 %23, i32* %10
%24 = load i32, i32* %10
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %20
%27 = load i32, i32* %10
%28 = icmp slt i32 %27, 0
%29 = zext i1 %28 to i32
store i32 %29, i32* %5
br label %35
30: ; preds = %20
%31 = load i32, i32* %7
%32 = load i32, i32* %9
%33 = icmp slt i32 %31, %32
%34 = zext i1 %33 to i32
store i32 %34, i32* %5
br label %35
35: ; preds = %30, %26
%36 = load i32, i32* %5
ret i32 %36
}

LLVM IR (-O2):
define i32 @__ltstring(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = icmp slt i32 %1, %3
%6 = select i1 %5, i32 %1, i32 %3
%7 = sext i32 %6 to i64
%8 = tail call i32 @memcmp(i8* %0, i8* %2, i64 %7)
%9 = icmp eq i32 %8, 0
%10 = icmp slt i32 %8, 0
%11 = select i1 %9, i1 %5, i1 %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef union quat {
  int dummy;
} quat;

/* Variables and functions */
float quat_len(union quat const *);
int /*<<< orphan*/ quat_scale(union quat *, union quat const *, float);
void quat_normalize(union quat *o, const union quat *q) {
  quat_scale(o, q, 1.0f / quat_len(q));
}


x86 assembly (clang, -O0):
<quat_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <quat_len@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movaps %xmm0,%xmm1
movss  0xea4(%rip),%xmm0
divss  %xmm1,%xmm0
call   1040 <quat_scale@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_normalize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <quat_len@plt>
movss  0xec6(%rip),%xmm1
divss  %xmm0,%xmm1
mov    %r14,%rdi
mov    %rbx,%rsi
movaps %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <quat_scale@plt>

LLVM IR (-O0):
%union.quat = type { i32 }
define void @quat_normalize(%union.quat* %0, %union.quat* %1) {
%3 = alloca %union.quat*
%4 = alloca %union.quat*
store %union.quat* %0, %union.quat** %3
store %union.quat* %1, %union.quat** %4
%5 = load %union.quat*, %union.quat** %3
%6 = load %union.quat*, %union.quat** %4
%7 = load %union.quat*, %union.quat** %4
%8 = call float @quat_len(%union.quat* %7)
%9 = fdiv float 1.000000e+00, %8
%10 = call i32 @quat_scale(%union.quat* %5, %union.quat* %6, float %9)
ret void
}

LLVM IR (-O2):
%union.quat = type { i32 }
define void @quat_normalize(%union.quat* %0, %union.quat* %1) {
%3 = tail call float @quat_len(%union.quat* %1)
%4 = fdiv float 1.000000e+00, %3
%5 = tail call i32 @quat_scale(%union.quat* %0, %union.quat* %1, float %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char);
char *timlib_escape_character_string(char *, char *);
char *escape_field(char *source_destination) {
  char character_string[16];
  sprintf(character_string, "',$()%c", '%');
  return timlib_escape_character_string(source_destination, character_string);
}


x86 assembly (clang, -O0):
<escape_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x25,%edx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <timlib_escape_character_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape_field>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x25,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <timlib_escape_character_string@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"',$()%c\00"
define i8* @escape_field(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 37)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i8* @timlib_escape_character_string(i8* %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"',$()%c\00"
define i8* @escape_field(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 37)
%5 = call i8* @timlib_escape_character_string(i8* %0, i8* %3)
ret i8* %5
}
int charToInt(char c) { return (c - 48); }


x86 assembly (clang, -O0):
<charToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToInt>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @charToInt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @charToInt(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ QSsort(char *, int /*<<< orphan*/, int);
int strlen(char *);
void ialSort(char *string) {
  int rind = strlen(string) - 1;
  QSsort(string, 0, rind);
}


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

x86 assembly (clang, -O2):
<ialSort>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <QSsort@plt>

LLVM IR (-O0):
define void @ialSort(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = call i32 @QSsort(i8* %7, i32 0, i32 %8)
ret void
}

LLVM IR (-O2):
define void @ialSort(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = tail call i32 @QSsort(i8* %0, i32 0, i32 %3)
ret void
}
char cast_int_char_fast(int x) { return (char)x; }


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

x86 assembly (clang, -O2):
<cast_int_char_fast>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @cast_int_char_fast(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
void subc_inst(struct state *context, struct debug_state *dbg_context,
               struct instruction *inst) {}


x86 assembly (clang, -O0):
<subc_inst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.state = type opaque
%struct.debug_state = type opaque
%struct.instruction = type opaque
define void @subc_inst(%struct.state* %0, %struct.debug_state* %1, %struct.instruction* %2) {
%4 = alloca %struct.state*
%5 = alloca %struct.debug_state*
%6 = alloca %struct.instruction*
store %struct.state* %0, %struct.state** %4
store %struct.debug_state* %1, %struct.debug_state** %5
store %struct.instruction* %2, %struct.instruction** %6
ret void
}

LLVM IR (-O2):
%struct.state = type opaque
%struct.debug_state = type opaque
%struct.instruction = type opaque
define void @subc_inst(%struct.state* nocapture %0, %struct.debug_state* nocapture %1, %struct.instruction* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int fseeko(FILE *file, off_t offset, int origin) {
  return fseek(file, offset, origin);
}


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

x86 assembly (clang, -O2):
<fseeko>:
jmp    1030 <fseek@plt>

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

LLVM IR (-O2):
define i32 @fseeko(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fseek(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
int main(void) {
  1.0 || 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
mov    %al,-0x5(%rbp)
jne    1122 <main+0x22>
xor    %eax,%eax
mov    %al,-0x5(%rbp)
jmp    1122 <main+0x22>
mov    -0x5(%rbp),%al
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br i1 true, label %3, label %2
2: ; preds = %0
br label %3
3: ; preds = %2, %0
%4 = phi i1 [ true, %0 ], [ false, %2 ]
%5 = zext i1 %4 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double tan(double x) {
  const double a0 = 1.02552185054002842e-153;
  const double a1 = 9.08426171426218458e-1;
  const double a2 = -6.11583939958416952e-153;
  const double a3 = 6.28822891947394513e-1;
  const double a4 = 4.32583762409611991e-153;
  return a0 + x * (a1 + x * (a2 + x * (a3 + x * a4)));
}


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  0xeb2(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xeae(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe8e(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe76(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5e(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
store double 0x202B800000000000, double* %3
store double 0x3FED11D3C3236528, double* %4
store double 0xA054800000000000, double* %5
store double 0x3FE41F512F7C7C87, double* %6
store double 0x204D000000000000, double* %7
%8 = load double, double* %2
%9 = load double, double* %2
%10 = load double, double* %2
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double %11, double 0x204D000000000000, double 0x3FE41F512F7C7C87)
%13 = call double @llvm.fmuladd.f64(double %10, double %12, double 0xA054800000000000)
%14 = call double @llvm.fmuladd.f64(double %9, double %13, double 0x3FED11D3C3236528)
%15 = call double @llvm.fmuladd.f64(double %8, double %14, double 0x202B800000000000)
ret double %15
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x204D000000000000, double 0x3FE41F512F7C7C87)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0xA054800000000000)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 0x3FED11D3C3236528)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 0x202B800000000000)
ret double %5
}
/* Variables and functions */
scalar_t__ malloc(long);
double **crea_espacio(long n) {
  long i;
  double **m;
  m = (double **)malloc(n * sizeof(double *));
  for (i = 0; i < n; i++)
    m[i] = (double *)malloc(n * sizeof(double));
  return m;
}


x86 assembly (clang, -O0):
<crea_espacio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1170 <crea_espacio+0x60>
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1135 <crea_espacio+0x25>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crea_espacio>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0x0(,%rdi,8),%r14
mov    %r14,%rdi
call   1030 <malloc@plt>
mov    %rax,%r12
test   %r15,%r15
jle    1155 <crea_espacio+0x45>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <malloc@plt>
mov    %rax,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <crea_espacio+0x30>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define double** @crea_espacio(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to double**
%5 = icmp sgt i64 %0, 0
br i1 %5, label %6, label %13
6: ; preds = %1, %6
%7 = phi i64 [ %11, %6 ], [ 0, %1 ]
%8 = tail call i64 @malloc(i64 %2)
%9 = inttoptr i64 %8 to double*
%10 = getelementptr inbounds double*, double** %4, i64 %7
store double* %9, double** %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret double** %4
}
int fqcmp(const void *p1, const void *p2) {
  double f1 = *((float *)p1);
  double f2 = *((float *)p2);
  return f1 > f2 ? 1 : (f1 < f2 ? -1 : 0);
}


x86 assembly (clang, -O0):
<fqcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    114b <fqcmp+0x4b>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1166 <fqcmp+0x66>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fqcmp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fqcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
%10 = fpext float %9 to double
store double %10, double* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to float*
%13 = load float, float* %12
%14 = fpext float %13 to double
store double %14, double* %6
%15 = load double, double* %5
%16 = load double, double* %6
%17 = fcmp ogt double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %2
br label %25
19: ; preds = %2
%20 = load double, double* %5
%21 = load double, double* %6
%22 = fcmp olt double %20, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 -1, i32 0
br label %25
25: ; preds = %19, %18
%26 = phi i32 [ 1, %18 ], [ %24, %19 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @fqcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t u64_max(uint64_t x, uint64_t y) { return x > y ? x : y; }


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

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

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

LLVM IR (-O2):
define i64 @u64_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int devcoredump_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @devcoredump_init() {
ret i32 0
}
/* Type definitions */
typedef unsigned long u_int16_t;

/* Variables and functions */
void set_bit_u16(int nr, u_int16_t *addr) {
  addr[nr >> 4] |= (1UL << (nr & 15));
}


x86 assembly (clang, -O0):
<set_bit_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_u16>:
mov    %edi,%ecx
and    $0xf,%cl
mov    $0x1,%eax
shl    %cl,%rax
sar    $0x4,%edi
movslq %edi,%rcx
or     %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @set_bit_u16(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 15
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = or i64 %14, %8
store i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @set_bit_u16(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 15
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = ashr i32 %0, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %5
store i64 %10, i64* %8
ret void
}
int fun504() { return 504; }


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

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

LLVM IR (-O0):
define i32 @fun504() {
ret i32 504
}

LLVM IR (-O2):
define i32 @fun504() {
ret i32 504
}
void ex2(int *x) {}


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

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

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

LLVM IR (-O2):
define void @ex2(i32* nocapture %0) {
ret void
}
int foo(int x, int y) { return y; }


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

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ABMON_5;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abmon_5() { return nl_langinfo(ABMON_5); }


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

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

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

LLVM IR (-O2):
@ABMON_5 = global i32 0
define i8* @langinfo_abmon_5() {
%1 = load i32, i32* @ABMON_5
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}