xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
scalar_t__ mpi_mpz_millerrabin(int /*<<< orphan*/, int);
bool isPrime(mpz_t n) { return (mpi_mpz_millerrabin(n, 1) != 0); }


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <mpi_mpz_millerrabin@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rax
mov    $0x1,%esi
call   1030 <mpi_mpz_millerrabin@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @mpi_mpz_millerrabin(i32 %3, i32 1)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i64 @mpi_mpz_millerrabin(i32 %0, i32 1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ emit1(struct jit_state *, int);
void emit_modrm(struct jit_state *state, int mod, int r, int m) {
  assert(!(mod & ~0xc0));
  emit1(state, (mod & 0xc0) | ((r & 7) << 3) | (m & 7));
}


x86 assembly (clang, -O0):
<emit_modrm>:
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    -0xc(%rbp),%eax
and    $0xffffff3f,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xc0,%esi
mov    -0x10(%rbp),%eax
and    $0x7,%eax
shl    $0x3,%eax
or     %eax,%esi
mov    -0x14(%rbp),%eax
and    $0x7,%eax
or     %eax,%esi
call   1030 <emit1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_modrm>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r12
xor    %edi,%edi
test   $0xffffff3f,%esi
sete   %dil
call   1040 <assert@plt>
and    $0xc0,%r15d
and    $0x7,%r14d
lea    (%r15,%r14,8),%eax
and    $0x7,%ebx
or     %eax,%ebx
mov    %r12,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <emit1@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_modrm(%struct.jit_state* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.jit_state*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = and i32 %9, -193
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load %struct.jit_state*, %struct.jit_state** %5
%16 = load i32, i32* %6
%17 = and i32 %16, 192
%18 = load i32, i32* %7
%19 = and i32 %18, 7
%20 = shl i32 %19, 3
%21 = or i32 %17, %20
%22 = load i32, i32* %8
%23 = and i32 %22, 7
%24 = or i32 %21, %23
%25 = call i32 @emit1(%struct.jit_state* %15, i32 %24)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_modrm(%struct.jit_state* %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, -193
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = and i32 %1, 192
%10 = shl i32 %2, 3
%11 = and i32 %10, 56
%12 = or i32 %11, %9
%13 = and i32 %3, 7
%14 = or i32 %12, %13
%15 = tail call i32 @emit1(%struct.jit_state* %0, i32 %14)
ret void
}
int strcmp(const char *cs, const char *ct) {
  register signed char __res;
  while (1) {
    if ((__res = *cs - *ct++) != 0 || !*cs++) {
      break;
    }
  }
  return __res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jne    114e <strcmp+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1153 <strcmp+0x53>
jmp    1158 <strcmp+0x58>
jmp    110c <strcmp+0xc>
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%edx
mov    %edx,%ecx
sub    (%rsi,%rax,1),%cl
test   %dl,%dl
je     1125 <strcmp+0x25>
add    $0x1,%rax
test   %cl,%cl
je     1110 <strcmp+0x10>
movsbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %10, %3 ]
%5 = phi i8* [ %0, %2 ], [ %11, %3 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = sub i8 %6, %7
%9 = icmp ne i8 %8, 0
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %6, 0
%13 = or i1 %12, %9
br i1 %13, label %14, label %3
14: ; preds = %3
%15 = sext i8 %8 to i32
ret i32 %15
}
/* Variables and functions */
long LONG_MIN;
long strtol(char const *, char **, int);
long int stoie(const char *s, int *err) {
  char *endptr;
  long int i = strtol(s, &endptr, 10);
  if (endptr == s) {
    *err = 1;
    return LONG_MIN;
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<stoie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1161 <stoie+0x51>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <stoie+0x59>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoie>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    %rbx,(%rsp)
jne    113e <stoie+0x2e>
movl   $0x1,(%r14)
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@LONG_MIN = global i64 0
define i64 @stoie(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %8, label %10
8: ; preds = %2
store i32 1, i32* %1
%9 = load i64, i64* @LONG_MIN
br label %10
10: ; preds = %2, %8
%11 = phi i64 [ %9, %8 ], [ %5, %2 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ dpop();
void primitive_drop_impl(void) { dpop(); }


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

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

LLVM IR (-O0):
define void @primitive_drop_impl() {
%1 = call i32 (...) @dpop()
ret void
}

LLVM IR (-O2):
define void @primitive_drop_impl() {
%1 = tail call i32 (...) @dpop()
ret void
}
long power(long base, long exponent) {
  long sum = 1;
  int i = 1;
  while (i <= exponent) {
    sum = sum * base;
    i++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1144 <power+0x44>
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <power+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %rsi,%rsi
jle    111b <power+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <power+0x21>
mov    $0x1,%eax
jmp    1156 <power+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <power+0x30>
test   %rcx,%rcx
je     116a <power+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <power+0x60>
ret

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

LLVM IR (-O2):
define i64 @power(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, 1
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i64 %11, %0
%14 = mul nsw i64 %13, %0
%15 = mul nsw i64 %14, %0
%16 = mul nsw i64 %15, %0
%17 = mul nsw i64 %16, %0
%18 = mul nsw i64 %17, %0
%19 = mul nsw i64 %18, %0
%20 = mul nsw i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
int scan(unsigned long long flags) {
  if (!flags) {
    return -1;
  }
  int index = 0;
  unsigned long long p = 1;
  while (1) {
    if (flags & p) {
      return index;
    }
    p <<= 1;
    ++index;
  }
}


x86 assembly (clang, -O0):
<scan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <scan+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <scan+0x65>
movl   $0x0,-0x14(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    -0x20(%rbp),%rax
cmp    $0x0,%rax
je     114b <scan+0x4b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <scan+0x65>
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <scan+0x2e>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan>:
test   %rdi,%rdi
je     112c <scan+0x2c>
xor    %eax,%eax
test   $0x1,%dil
jne    112b <scan+0x2b>
xor    %eax,%eax
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %rcx,%rcx
add    $0x1,%eax
test   %rdi,%rcx
je     1120 <scan+0x20>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @scan(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 1, %3 ]
%8 = phi i32 [ %10, %6 ], [ 0, %3 ]
%9 = shl i64 %7, 1
%10 = add nuw nsw i32 %8, 1
%11 = and i64 %9, %0
%12 = icmp eq i64 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
void vector_swap(int *a, int *b) {
  int t;
  t = *a;
  *a = *b;
  *b = t;
}


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

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

LLVM IR (-O0):
define void @vector_swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @vector_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *localtime_r(const time_t *timep, struct tm *result) {
  return gmtime_r(timep, result);
}


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

x86 assembly (clang, -O2):
<localtime_r>:
jmp    1030 <gmtime_r@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* %1) {
%3 = tail call %struct.tm* @gmtime_r(i32* %0, %struct.tm* %1)
ret %struct.tm* %3
}
double area(double x1, double y1, double x2, double y2, double x3, double y3) {
  const double acx = x1 - x3;
  const double bcx = x2 - x3;
  const double acy = y1 - y3;
  const double bcy = y2 - y3;
  return (double)(acx * bcy - acy * bcx);
}


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
subsd  %xmm4,%xmm0
subsd  %xmm4,%xmm2
subsd  %xmm5,%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm5,%xmm3
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @area(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%17 = load double, double* %7
%18 = load double, double* %11
%19 = fsub double %17, %18
store double %19, double* %13
%20 = load double, double* %9
%21 = load double, double* %11
%22 = fsub double %20, %21
store double %22, double* %14
%23 = load double, double* %8
%24 = load double, double* %12
%25 = fsub double %23, %24
store double %25, double* %15
%26 = load double, double* %10
%27 = load double, double* %12
%28 = fsub double %26, %27
store double %28, double* %16
%29 = load double, double* %13
%30 = load double, double* %16
%31 = load double, double* %15
%32 = load double, double* %14
%33 = fmul double %31, %32
%34 = fneg double %33
%35 = call double @llvm.fmuladd.f64(double %29, double %30, double %34)
ret double %35
}

LLVM IR (-O2):
define double @area(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %4
%8 = fsub double %2, %4
%9 = fsub double %1, %5
%10 = fsub double %3, %5
%11 = fneg double %9
%12 = fmul double %8, %11
%13 = tail call double @llvm.fmuladd.f64(double %7, double %10, double %12)
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void func8() { print("timer to turn on\n security automaticly\n 0=off"); }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"timer to turn on\0A security automaticly\0A 0=off\00"
define void @func8() {
%1 = call i32 @print(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"timer to turn on\0A security automaticly\0A 0=off\00"
define void @func8() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
char check_optional(char *tocheck, int which) {
  if (tocheck[0] == '-') {
    fprintf(stderr,
            "If you want to give the -%c flag a parameter starting"
            " with a - don't put a space. Ignoring it.\n",
            which);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_optional>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1150 <check_optional+0x40>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
movb   $0x0,-0x1(%rbp)
jmp    1154 <check_optional+0x44>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_optional>:
push   %rax
mov    $0x1,%al
cmpb   $0x2d,(%rdi)
jne    1131 <check_optional+0x21>
mov    %esi,%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [96 x i8] c"If you want to give the -%c flag a parameter starting with a - don't put a space. Ignoring it.\0A\00"
define signext i8 @check_optional(i8* %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %5
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i32 %13)
store i8 0, i8* %3
br label %16
15: ; preds = %2
store i8 1, i8* %3
br label %16
16: ; preds = %15, %11
%17 = load i8, i8* %3
ret i8 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [96 x i8] c"If you want to give the -%c flag a parameter starting with a - don't put a space. Ignoring it.\0A\00"
define signext i8 @check_optional(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ 0, %5 ], [ 1, %2 ]
ret i8 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void volatile_store_u32(volatile uint32_t *dest, uint32_t val) { *dest = val; }


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

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

LLVM IR (-O0):
define void @volatile_store_u32(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
%6 = load i32*, i32** %3
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @volatile_store_u32(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void msg_setdst(char *msg, int n) {
  char nn[16];
  sprintf(nn, "%02d", n);
  msg[0] = nn[0];
  msg[1] = nn[1];
}


x86 assembly (clang, -O0):
<msg_setdst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x20(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1f(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_setdst>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
mov    %rsp,%rdi
call   1030 <sprintf@plt>
mov    (%rsp),%al
mov    %al,(%rbx)
mov    0x1(%rsp),%al
mov    %al,0x1(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02d\00"
define void @msg_setdst(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [16 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02d\00"
define void @msg_setdst(i8* nocapture writeonly %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = load i8, i8* %4
store i8 %6, i8* %0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 1
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %8, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _print_list(int **, int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *list = malloc(4 * sizeof(int));
  list[0] = 0;
  list[1] = 8;
  list[2] = 5;
  list[3] = 3;
  printf("list size: %d\n", 4);
  _print_list(&list, 4);
  free(list);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x8,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0xc(%rax)
lea    0xe78(%rip),%rdi
mov    $0x4,%esi
call   1050 <printf@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <_print_list@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
call   1060 <malloc@plt>
mov    %rax,(%rsp)
movaps 0xeaa(%rip),%xmm0
movups %xmm0,(%rax)
lea    0xeb0(%rip),%rdi
mov    $0x4,%esi
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <_print_list@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"list size: %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 16)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 0, i32* %4
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 8, i32* %6
%7 = load i32*, i32** %1
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 5, i32* %8
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 3, i32* %10
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%12 = call i32 @_print_list(i32** %1, i32 4)
%13 = load i32*, i32** %1
%14 = call i32 @free(i32* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"list size: %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = tail call i32* @malloc(i32 16)
store i32* %3, i32** %1
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 8, i32 5, i32 3>, <4 x i32>* %4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = call i32 @_print_list(i32** %1, i32 4)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret i32 0
}
/* Variables and functions */
double vec4d_norm(double const *);
int /*<<< orphan*/ vec4d_scalarDiv_new(double *, double const *, double);
void vec4d_normalize_new(double dest[4], const double src[4]) {
  double len = vec4d_norm(src);
  vec4d_scalarDiv_new(dest, src, len);
}


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

x86 assembly (clang, -O2):
<vec4d_normalize_new>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <vec4d_norm@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vec4d_scalarDiv_new@plt>

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

LLVM IR (-O2):
define void @vec4d_normalize_new(double* %0, double* %1) {
%3 = tail call double @vec4d_norm(double* %1)
%4 = tail call i32 @vec4d_scalarDiv_new(double* %0, double* %1, double %3)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ sd_solve(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  sd_solve(stdin);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <sd_solve@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <sd_solve@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @sd_solve(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@stdin = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @sd_solve(i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void XkbSetMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbSetMap() {
ret void
}
int ptstash(adr, val)
int *adr;
int val;
{
  register int *a;
  if ((0 <= (*(a = adr))))
    return 1;
  *a = val;
  return (0);
}


x86 assembly (clang, -O0):
<ptstash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
cmp    (%rcx),%eax
jg     1129 <ptstash+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1139 <ptstash+0x39>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptstash>:
mov    $0x1,%eax
cmpl   $0x0,(%rdi)
js     110b <ptstash+0xb>
ret
mov    %esi,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ptstash(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
%7 = load i32*, i32** %4
store i32* %7, i32** %6
%8 = load i32, i32* %7
%9 = icmp sle i32 0, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32*, i32** %6
store i32 %12, i32* %13
store i32 0, i32* %3
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ptstash(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %6, label %5
5: ; preds = %2
store i32 %1, i32* %0
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sleep(int s) { printf("I am not sleeping!\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am not sleeping!\0A\00"
define void @sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"I am not sleeping!\00"
define void @sleep(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool _pcouner_is_on(void) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @_pcouner_is_on() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printHelloWorld() { printf("%s\n", "Hello World"); }


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

x86 assembly (clang, -O2):
<printHelloWorld>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Hello World\00"
define void @printHelloWorld() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Hello World\00"
define void @printHelloWorld() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int func14() {
#pragma critTer : 54 :../../ test / resources / functionNumber.c:
  return 0;
#pragma critTer : 55 :../../ test / resources / functionNumber.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func14() {
ret i32 0
}
/* Variables and functions */
int Sys_GetLastNetError();
char const *strerror(int);
const char *Sys_GetLastNetErrorString(void) {
  int last_error = Sys_GetLastNetError();
  return strerror(last_error);
}


x86 assembly (clang, -O0):
<Sys_GetLastNetErrorString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Sys_GetLastNetError@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_GetLastNetErrorString>:
push   %rax
xor    %eax,%eax
call   1030 <Sys_GetLastNetError@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <strerror@plt>

LLVM IR (-O0):
define i8* @Sys_GetLastNetErrorString() {
%1 = alloca i32
%2 = call i32 (...) @Sys_GetLastNetError()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @strerror(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Sys_GetLastNetErrorString() {
%1 = tail call i32 (...) @Sys_GetLastNetError()
%2 = tail call i8* @strerror(i32 %1)
ret i8* %2
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c;
  c = (getchar() != EOF);
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *sbrk(size_t);
void *nonfree_malloc(size_t size) {
  void *p = sbrk(0);
  void *request = sbrk(size);
  if (request == (void *)-1) {
    return NULL;
  } else {
    assert(p == request);
    return p;
  }
}


x86 assembly (clang, -O0):
<nonfree_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <sbrk@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sbrk@plt>
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x20(%rbp)
jne    1164 <nonfree_malloc+0x44>
movq   $0x0,-0x8(%rbp)
jmp    1181 <nonfree_malloc+0x61>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonfree_malloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <sbrk@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <sbrk@plt>
cmp    $0xffffffffffffffff,%rax
je     1153 <nonfree_malloc+0x33>
xor    %edi,%edi
cmp    %rax,%r14
sete   %dil
call   1040 <assert@plt>
mov    %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @nonfree_malloc(i64 %0) {
%2 = tail call i8* @sbrk(i64 0)
%3 = tail call i8* @sbrk(i64 %0)
%4 = icmp eq i8* %3, inttoptr (i64 -1 to i8*)
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = icmp eq i8* %2, %3
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %2, %5 ], [ null, %1 ]
ret i8* %10
}
/* Type definitions */
typedef scalar_t__ *__m128d;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_add_sd(__m128d a, __m128d b) {
  a[0] += b[0];
  return a;
}


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

x86 assembly (clang, -O2):
<_mm_add_sd>:
mov    %rdi,%rax
mov    (%rsi),%rcx
add    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i64* @_mm_add_sd(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = add nsw i64 %10, %7
store i64 %11, i64* %9
%12 = load i64*, i64** %3
ret i64* %12
}

LLVM IR (-O2):
define i64* @_mm_add_sd(i64* returned %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = load i64, i64* %0
%5 = add nsw i64 %4, %3
store i64 %5, i64* %0
ret i64* %0
}
/* Variables and functions */
int /*<<< orphan*/ getppid();
int /*<<< orphan*/ prctl(int, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int ptracepreload_init(void) {
  prctl(0x59616d61, getppid(), 0, 0, 0);
  puts("eeks\n");
  return 0;
}


x86 assembly (clang, -O0):
<ptracepreload_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
mov    $0x59616d61,%edi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <prctl@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptracepreload_init>:
push   %rax
xor    %eax,%eax
call   1050 <getppid@plt>
mov    $0x59616d61,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <prctl@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"eeks\0A\00"
define i32 @ptracepreload_init() {
%1 = call i32 (...) @getppid()
%2 = call i32 @prctl(i32 1499557217, i32 %1, i32 0, i32 0, i32 0)
%3 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"eeks\0A\00"
define i32 @ptracepreload_init() {
%1 = tail call i32 (...) @getppid()
%2 = tail call i32 @prctl(i32 1499557217, i32 %1, i32 0, i32 0, i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ USB_DIS_ISR_Disable();
void USB_DIS_ISR_Stop(void) { USB_DIS_ISR_Disable(); }


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

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

LLVM IR (-O0):
define void @USB_DIS_ISR_Stop() {
%1 = call i32 (...) @USB_DIS_ISR_Disable()
ret void
}

LLVM IR (-O2):
define void @USB_DIS_ISR_Stop() {
%1 = tail call i32 (...) @USB_DIS_ISR_Disable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void show_help(const char *app) {
  fprintf(stderr, "usage: %s [options]\n", app);
  fprintf(stderr, "       -h         this text\n"
                  "       -i sensor  sensor identifier\n"
                  "       -d device  serial device\n"
                  "       -b rate    device baudrate (default = 115200)\n"
                  "       -t timeout wanted timeout in ms (default = 100ms)\n"
                  "       -s value   write value to sensor\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee1(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s [options]\0A\00"
@.str.1 = [247 x i8] c" -h this text\0A -i sensor sensor identifier\0A -d device serial device\0A -b rate device baudrate (default = 115200)\0A -t timeout wanted timeout in ms (default = 100ms)\0A -s value write value to sensor\0A\00"
define void @show_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s [options]\0A\00"
@.str.1 = [247 x i8] c" -h this text\0A -i sensor sensor identifier\0A -d device serial device\0A -b rate device baudrate (default = 115200)\0A -t timeout wanted timeout in ms (default = 100ms)\0A -s value write value to sensor\0A\00"
define void @show_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double floating_point_bit_fields_message1_signal1_encode(double value) {
  return (double)(value);
}


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

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

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

LLVM IR (-O2):
define double @floating_point_bit_fields_message1_signal1_encode(double returned %0) {
ret double %0
}
/* Variables and functions */
char *strnsave(char const *, int /*<<< orphan*/);
char *strsave(const char *s) { return strnsave(s, 0); }


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

x86 assembly (clang, -O2):
<strsave>:
xor    %esi,%esi
jmp    1030 <strnsave@plt>

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

LLVM IR (-O2):
define i8* @strsave(i8* %0) {
%2 = tail call i8* @strnsave(i8* %0, i32 0)
ret i8* %2
}