xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float raio, area, raio2;
  printf("Digite o valor do raio do circulo!\n");
  scanf("%f", &raio);
  raio2 = raio * raio;
  area = 3, 141592 * raio2;
  printf("%f\n", raio2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe9c(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Digite o valor do raio do circulo!\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float %7, %8
store float %9, float* %4
store float 3.000000e+00, float* %3
%10 = load float, float* %4
%11 = fmul float 1.415920e+05, %10
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@str = [35 x i8] c"Digite o valor do raio do circulo!\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, %5
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
int isPrime(long long n) {
  long long i = 0;
  if (n <= 1)
    return 0;
  else
    for (i = 2; i * i <= n; i++) {
      if (n % i == 0)
        return 0;
    }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jg     1127 <isPrime+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1184 <isPrime+0x84>
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1178 <isPrime+0x78>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    1162 <isPrime+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1184 <isPrime+0x84>
jmp    1167 <isPrime+0x67>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <isPrime+0x2f>
jmp    117d <isPrime+0x7d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %ecx,%ecx
cmp    $0x2,%rdi
jl     115b <isPrime+0x5b>
mov    $0x1,%ecx
cmp    $0x4,%rdi
jb     115b <isPrime+0x5b>
mov    $0x2,%esi
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1140 <isPrime+0x40>
mov    %rdi,%rax
cqto
idiv   %rsi
test   %rdx,%rdx
jne    114b <isPrime+0x4b>
jmp    115e <isPrime+0x5e>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
je     115e <isPrime+0x5e>
add    $0x1,%rsi
mov    %rsi,%rax
imul   %rsi,%rax
cmp    %rdi,%rax
jle    1120 <isPrime+0x20>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = mul nsw i64 %12, %12
%7 = icmp sgt i64 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %3, %5
%9 = phi i64 [ %12, %5 ], [ 2, %3 ]
%10 = srem i64 %0, %9
%11 = icmp eq i64 %10, 0
%12 = add nuw nsw i64 %9, 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %8 ], [ 1, %5 ]
ret i32 %14
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u64;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ fill_word(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ load_word(struct __sk_buff *, int);
int /*<<< orphan*/ update_hash_word(int /*<<< orphan*/ *, int /*<<< orphan*/);
void fill_ipv4(struct __sk_buff *skb, int offset, __u8 *dst, __u64 *hash) {
  __u32 w = load_word(skb, offset);
  fill_word(w, dst, 12);
  update_hash_word(hash, w);
}


x86 assembly (clang, -O0):
<fill_ipv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <load_word@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0xc,%edx
call   1030 <fill_word@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <update_hash_word@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_ipv4>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
call   1040 <load_word@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1030 <fill_word@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <update_hash_word@plt>

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
define void @fill_ipv4(%struct.__sk_buff* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca %struct.__sk_buff*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load %struct.__sk_buff*, %struct.__sk_buff** %5
%11 = load i32, i32* %6
%12 = call i32 @load_word(%struct.__sk_buff* %10, i32 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = load i32*, i32** %7
%15 = call i32 @fill_word(i32 %13, i32* %14, i32 12)
%16 = load i32*, i32** %8
%17 = load i32, i32* %9
%18 = call i32 @update_hash_word(i32* %16, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
define void @fill_ipv4(%struct.__sk_buff* %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @load_word(%struct.__sk_buff* %0, i32 %1)
%6 = tail call i32 @fill_word(i32 %5, i32* %2, i32 12)
%7 = tail call i32 @update_hash_word(i32* %3, i32 %5)
ret void
}
void fa154(void) {
a:
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    p02C:
      goto p02C;
      goto a;
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


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

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

LLVM IR (-O0):
define void @fa154() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %0
br label %8
8: ; preds = %8, %7
br label %8
9: ; No predecessors!
br label %10
10: ; preds = %10, %9
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
br label %13
13: ; preds = %13, %12
br label %13
14: ; preds = %14
br label %14
15: ; preds = %15
br label %15
16: ; No predecessors!
br label %17
17: ; preds = %17, %16
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; preds = %20
br label %20
21: ; No predecessors!
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %23
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa154() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ U_swap4(char *, int);
void U_WMRCORE_SIZE16_swap(char *record, int torev) {
  (void)(torev);
  U_swap4(record, 1);
}


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

x86 assembly (clang, -O2):
<U_WMRCORE_SIZE16_swap>:
mov    $0x1,%esi
jmp    1030 <U_swap4@plt>

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

LLVM IR (-O2):
define void @U_WMRCORE_SIZE16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_swap4(i8* %0, i32 1)
ret void
}
int endian_islittle(void) {
  short word = 0x4321;
  if ((*(char *)&word) != 0x21)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<endian_islittle>:
push   %rbp
mov    %rsp,%rbp
movw   $0x4321,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x21,%eax
je     1123 <endian_islittle+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112a <endian_islittle+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @endian_islittle() {
%1 = alloca i32
%2 = alloca i16
store i16 17185, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 33
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @endian_islittle() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fz_trace_end_mask(void *user) { printf("</mask>\n"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"</mask>\0A\00"
define void @fz_trace_end_mask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"</mask>\00"
define void @fz_trace_end_mask(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_set_thread(int cmd, int tid) { return (make_return_packet(0)); }


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

x86 assembly (clang, -O2):
<gdb_set_thread>:
xor    %edi,%edi
jmp    1030 <make_return_packet@plt>

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

LLVM IR (-O2):
define i8* @gdb_set_thread(i32 %0, i32 %1) {
%3 = tail call i8* @make_return_packet(i32 0)
ret i8* %3
}
/* Variables and functions */
int five();
int four();
int one();
int three();
int two();
plus() { return (one() + two() + three() + four() + five()); }


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <one@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <two@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1070 <three@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <four@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <five@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <one@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <two@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1070 <three@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1050 <four@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <five@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @plus() {
%1 = call i32 (...) @one()
%2 = call i32 (...) @two()
%3 = add nsw i32 %1, %2
%4 = call i32 (...) @three()
%5 = add nsw i32 %3, %4
%6 = call i32 (...) @four()
%7 = add nsw i32 %5, %6
%8 = call i32 (...) @five()
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @plus() {
%1 = tail call i32 (...) @one()
%2 = tail call i32 (...) @two()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @three()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @four()
%7 = add nsw i32 %5, %6
%8 = tail call i32 (...) @five()
%9 = add nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ outtext(char *, int, int /*<<< orphan*/, int);
void cleartopline(void) {
  outtext("                          ", 0, 0, 3);
  outtext(" ", 308, 0, 3);
}


x86 assembly (clang, -O0):
<cleartopline>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %edx,%edx
mov    $0x3,%ecx
mov    %edx,%esi
call   1030 <outtext@plt>
lea    0xee9(%rip),%rdi
mov    $0x134,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1030 <outtext@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleartopline>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1030 <outtext@plt>
lea    0xeec(%rip),%rdi
mov    $0x134,%esi
xor    %edx,%edx
mov    $0x3,%ecx
pop    %rax
jmp    1030 <outtext@plt>

LLVM IR (-O0):
@.str = [27 x i8] c" \00"
@.str.1 = [2 x i8] c" \00"
define void @cleartopline() {
%1 = call i32 @outtext(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 3)
%2 = call i32 @outtext(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 308, i32 0, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c" \00"
@.str.1 = [2 x i8] c" \00"
define void @cleartopline() {
%1 = tail call i32 @outtext(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 3)
%2 = tail call i32 @outtext(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 308, i32 0, i32 3)
ret void
}
struct __pthread *__pthread_self() {
  struct __pthread *self;
  __asm__("mov %%fs:0,%0" : "=r"(self));
  return self;
}


x86 assembly (clang, -O0):
<__pthread_self>:
push   %rbp
mov    %rsp,%rbp
mov    %fs:0x0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_self>:
mov    %fs:0x0,%rax
ret

LLVM IR (-O0):
%struct.__pthread = type opaque
define %struct.__pthread* @__pthread_self() {
%1 = alloca %struct.__pthread*
%2 = call %struct.__pthread* asm "mov %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store %struct.__pthread* %2, %struct.__pthread** %1
%3 = load %struct.__pthread*, %struct.__pthread** %1
ret %struct.__pthread* %3
}

LLVM IR (-O2):
%struct.__pthread = type opaque
define %struct.__pthread* @__pthread_self() {
%1 = tail call %struct.__pthread* asm "mov %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret %struct.__pthread* %1
}
/* Variables and functions */
int new_process_group();
int new_process_session(void) { return new_process_group(); }


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

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

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

LLVM IR (-O2):
define i32 @new_process_session() {
%1 = tail call i32 (...) @new_process_group()
ret i32 %1
}
const char *fpp_config_get_default_plugin_descr(void) {
  return "libpdf.so renderer backend";
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"libpdf.so renderer backend\00"
define i8* @fpp_config_get_default_plugin_descr() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"libpdf.so renderer backend\00"
define i8* @fpp_config_get_default_plugin_descr() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
int MSB(long word) {
  long dummy, dummy2;
  asm("          bsrq    %1, %0     "
      "\n\t"
      "          jnz     1f         "
      "\n\t"
      "          movq    $64, %0    "
      "\n\t"
      "1:                           "
      "\n\t"
      : "=&r"(dummy), "=&r"(dummy2)
      : "1"((long)(word))
      : "cc");
  return (dummy);
}


x86 assembly (clang, -O0):
<MSB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rcx
jne    111d <MSB+0x1d>
mov    $0x40,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MSB>:
bsr    %rdi,%rax
jne    110d <MSB+0xd>
mov    $0x40,%rax
ret

LLVM IR (-O0):
define i32 @MSB(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call { i64, i64 } asm " bsrq $1, $0 \0A\09 jnz 1f \0A\09 movq $$64, $0 \0A\091: \0A\09", "=&r,=&r,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %5)
%7 = extractvalue { i64, i64 } %6, 0
%8 = extractvalue { i64, i64 } %6, 1
store i64 %7, i64* %3
store i64 %8, i64* %4
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @MSB(i64 %0) {
%2 = tail call { i64, i64 } asm " bsrq $1, $0 \0A\09 jnz 1f \0A\09 movq $$64, $0 \0A\091: \0A\09", "=&r,=&r,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %0)
%3 = extractvalue { i64, i64 } %2, 0
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
int HasDotSuffix(char *string) { return string[strlen(string) - 2] == '.'; }


x86 assembly (clang, -O0):
<HasDotSuffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HasDotSuffix>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x2e,-0x2(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HasDotSuffix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 46
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @HasDotSuffix(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 46
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
float log(int /*<<< orphan*/);
int /*<<< orphan*/ tan(double);
float isometric_latitude0(float phi) {
  return log(tan((3.14159265358979323846 / 4) + phi / 2.0));
}


x86 assembly (clang, -O0):
<isometric_latitude0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <tan@plt>
mov    %eax,%edi
call   1040 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isometric_latitude0>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xed3(%rip),%xmm0
addsd  0xed3(%rip),%xmm0
call   1030 <tan@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <log@plt>

LLVM IR (-O0):
define float @isometric_latitude0(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 2.000000e+00
%6 = fadd double 0x3FE921FB54442D18, %5
%7 = call i32 @tan(double %6)
%8 = call float @log(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @isometric_latitude0(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 5.000000e-01
%4 = fadd double %3, 0x3FE921FB54442D18
%5 = tail call i32 @tan(double %4)
%6 = tail call float @log(i32 %5)
ret float %6
}
int sb_has_quota_limits_enabled(struct super_block *sb, int type) { return 0; }


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define i32 @sb_has_quota_limits_enabled(%struct.super_block* %0, i32 %1) {
%3 = alloca %struct.super_block*
%4 = alloca i32
store %struct.super_block* %0, %struct.super_block** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @sb_has_quota_limits_enabled(%struct.super_block* nocapture readnone %0, i32 %1) {
ret i32 0
}
void DrawLine(unsigned char x1, unsigned char y1, unsigned char x2,
              unsigned char y2) {}


x86 assembly (clang, -O0):
<DrawLine>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @DrawLine(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
ret void
}

LLVM IR (-O2):
define void @DrawLine(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ffgsdt(int *, int *, int *, int *);
extern void ftgsdt_(int *A1, int *A2, int *A3, int *A4) {
  ;
  ffgsdt(A1, A2, A3, A4);
  return;
}


x86 assembly (clang, -O0):
<ftgsdt_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ffgsdt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftgsdt_>:
jmp    1030 <ffgsdt@plt>

LLVM IR (-O0):
define void @ftgsdt_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 @ffgsdt(i32* %9, i32* %10, i32* %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @ftgsdt_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @ffgsdt(i32* %0, i32* %1, i32* %2, i32* %3)
ret void
}
int dosys(comstring, nohalt)
register char *comstring;
int nohalt;
{
  register int status;
  if (metas(comstring))
    status = doshell(comstring, nohalt);
  else
    status = doexec(comstring);
  return (status);
}


x86 assembly (clang, -O0):
<dosys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <metas@plt>
cmp    $0x0,%eax
je     1169 <dosys+0x39>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <doshell@plt>
mov    %eax,-0x10(%rbp)
jmp    1177 <dosys+0x47>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <doexec@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dosys>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <metas@plt>
mov    %rbx,%rdi
test   %eax,%eax
je     1155 <dosys+0x25>
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <doshell@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <doexec@plt>

LLVM IR (-O0):
define i32 @dosys(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @metas to i32 (i8*, ...)*)(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @doshell to i32 (i8*, i32, ...)*)(i8* %10, i32 %11)
store i32 %12, i32* %5
br label %16
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @doexec to i32 (i8*, ...)*)(i8* %14)
store i32 %15, i32* %5
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @dosys(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @metas to i32 (i8*, ...)*)(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @doshell to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @doexec to i32 (i8*, ...)*)(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("starting master"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"starting master\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"starting master\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void releaseAccBuf(int **p, int len) {
  int i;
  for (i = 0; i < len; i++)
    free(p[i]);
  free(p);
}


x86 assembly (clang, -O0):
<releaseAccBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <releaseAccBuf+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <releaseAccBuf+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<releaseAccBuf>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <releaseAccBuf+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <releaseAccBuf+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @releaseAccBuf(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int inet_pton(int, char const *, void *);
int finslib_inet_pton(int af, const char *src, void *dst) {
  return inet_pton(af, src, dst);
}


x86 assembly (clang, -O0):
<finslib_inet_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finslib_inet_pton>:
jmp    1030 <inet_pton@plt>

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

LLVM IR (-O2):
define i32 @finslib_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_pton(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
void leds_ON_all(void) {
  ((*(volatile unsigned long *)0x7F008808) &= ~(1 << 4));
  ((*(volatile unsigned long *)0x7F008808) &= ~(1 << 5));
  ((*(volatile unsigned long *)0x7F008808) &= ~(1 << 6));
  ((*(volatile unsigned long *)0x7F008808) &= ~(1 << 7));
}


x86 assembly (clang, -O0):
<leds_ON_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008808,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    $0x7f008808,%eax
mov    %rcx,(%rax)
mov    $0x7f008808,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffdf,%rcx
mov    $0x7f008808,%eax
mov    %rcx,(%rax)
mov    $0x7f008808,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffbf,%rcx
mov    $0x7f008808,%eax
mov    %rcx,(%rax)
mov    $0x7f008808,%eax
mov    (%rax),%rcx
and    $0xffffffffffffff7f,%rcx
mov    $0x7f008808,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<leds_ON_all>:
andq   $0xffffffffffffffef,0x7f008808
7f ef
andq   $0xffffffffffffffdf,0x7f008808
7f df
andq   $0xffffffffffffffbf,0x7f008808
7f bf
andq   $0xffffffffffffff7f,0x7f008808
7f 7f ff ff ff
ret

LLVM IR (-O0):
define void @leds_ON_all() {
%1 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%2 = and i64 %1, -17
store volatile i64 %2, i64* inttoptr (i64 2130741256 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%4 = and i64 %3, -33
store volatile i64 %4, i64* inttoptr (i64 2130741256 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%6 = and i64 %5, -65
store volatile i64 %6, i64* inttoptr (i64 2130741256 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%8 = and i64 %7, -129
store volatile i64 %8, i64* inttoptr (i64 2130741256 to i64*)
ret void
}

LLVM IR (-O2):
define void @leds_ON_all() {
%1 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%2 = and i64 %1, -17
store volatile i64 %2, i64* inttoptr (i64 2130741256 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%4 = and i64 %3, -33
store volatile i64 %4, i64* inttoptr (i64 2130741256 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%6 = and i64 %5, -65
store volatile i64 %6, i64* inttoptr (i64 2130741256 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 2130741256 to i64*)
%8 = and i64 %7, -129
store volatile i64 %8, i64* inttoptr (i64 2130741256 to i64*)
ret void
}
int main() {
  int x;
  int y;
  x = 3;
  y = ++x;
  return y;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
void x5(void) {}


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

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

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

LLVM IR (-O2):
define void @x5() {
ret void
}
/* Variables and functions */
double double_input();
int /*<<< orphan*/ printf(char *);
double purchases_input(void) {
  double purchases = 0.0;
  printf("Total Purchase Price? ");
  purchases = double_input();
  return purchases;
}


x86 assembly (clang, -O0):
<purchases_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <double_input@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<purchases_input>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <double_input@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Total Purchase Price? \00"
define double @purchases_input() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call double (...) @double_input()
store double %3, double* %1
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@.str = [23 x i8] c"Total Purchase Price? \00"
define double @purchases_input() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call double (...) @double_input()
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int sql_exec_cb(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/,
                int /*<<< orphan*/);
int sql_exec(sqlite3 *db, const char *sql) {
  return sql_exec_cb(db, sql, 0, 0);
}


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

x86 assembly (clang, -O2):
<sql_exec>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <sql_exec_cb@plt>

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

LLVM IR (-O2):
define i32 @sql_exec(i32* %0, i8* %1) {
%3 = tail call i32 @sql_exec_cb(i32* %0, i8* %1, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? (c + 32) : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
void invalid_list() { error(2, 0, "invalid byte or field list"); }


x86 assembly (clang, -O0):
<invalid_list>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %esi,%esi
lea    0xede(%rip),%rdx
call   1030 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_list>:
lea    0xee9(%rip),%rdx
mov    $0x2,%edi
xor    %esi,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"invalid byte or field list\00"
define void @invalid_list() {
%1 = call i32 @error(i32 2, i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"invalid byte or field list\00"
define void @invalid_list() {
%1 = tail call i32 @error(i32 2, i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
char *strdup(s) const char *s;
{
  char *dup;
  dup = (char *)malloc(strlen(s) + 1);
  if (dup)
    strcpy(dup, s);
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *repeatChr(int, char);
main() { printf(">%s<\n", repeatChr(5, '*')); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x2a,%esi
call   1030 <repeatChr@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x2a,%esi
call   1030 <repeatChr@plt>
lea    0xec9(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c">%s<\0A\00"
define i32 @main() {
%1 = call i8* @repeatChr(i32 5, i8 signext 42)
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c">%s<\0A\00"
define i32 @main() {
%1 = tail call i8* @repeatChr(i32 5, i8 signext 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int signed_high_prod(unsigned int, unsigned int);
unsigned unsigned_high_prod(unsigned x, unsigned y) {
  int sig_x = x >> 31;
  int sig_y = y >> 31;
  int signed_prod = signed_high_prod(x, y);
  return signed_prod + x * sig_y + y * sig_x;
}


x86 assembly (clang, -O0):
<unsigned_high_prod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <signed_high_prod@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_high_prod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <signed_high_prod@plt>
mov    %ebx,%ecx
sar    $0x1f,%ecx
and    %ebp,%ecx
sar    $0x1f,%ebp
and    %ebx,%ebp
add    %ecx,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unsigned_high_prod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = lshr i32 %8, 31
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = lshr i32 %10, 31
store i32 %11, i32* %6
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @signed_high_prod(i32 %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* %3
%17 = load i32, i32* %6
%18 = mul i32 %16, %17
%19 = add i32 %15, %18
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = mul i32 %20, %21
%23 = add i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @unsigned_high_prod(i32 %0, i32 %1) {
%3 = tail call i32 @signed_high_prod(i32 %0, i32 %1)
%4 = icmp slt i32 %1, 0
%5 = select i1 %4, i32 %0, i32 0
%6 = icmp slt i32 %0, 0
%7 = select i1 %6, i32 %1, i32 0
%8 = add i32 %5, %7
%9 = add i32 %8, %3
ret i32 %9
}
int my_atoi(char *s) {
  int res;
  res = 0;
  while (*s) {
    if (*s < '0' || '9' < *s)
      return 0;
    res = res * 10 + (*s - '0');
    ++s;
  }
  return res;
}


x86 assembly (clang, -O0):
<my_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1170 <my_atoi+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1140 <my_atoi+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x39,%eax
cmp    %ecx,%eax
jge    114c <my_atoi+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1176 <my_atoi+0x76>
imul   $0xa,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <my_atoi+0xf>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1130 <my_atoi+0x30>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    -0x3a(%rcx),%edx
cmp    $0xf6,%dl
jb     1130 <my_atoi+0x30>
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %16, %10 ], [ %2, %1 ]
%6 = phi i32 [ %14, %10 ], [ 0, %1 ]
%7 = phi i8* [ %15, %10 ], [ %0, %1 ]
%8 = add i8 %5, -58
%9 = icmp ult i8 %8, -10
br i1 %9, label %18, label %10
10: ; preds = %4
%11 = zext i8 %5 to i32
%12 = mul nsw i32 %6, 10
%13 = add i32 %12, -48
%14 = add i32 %13, %11
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %4, %10, %1
%19 = phi i32 [ 0, %1 ], [ %14, %10 ], [ 0, %4 ]
ret i32 %19
}
int last_dma_chan(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @last_dma_chan() {
ret i32 3
}

LLVM IR (-O2):
define i32 @last_dma_chan() {
ret i32 3
}
int mul(int lhs, int rhs) { return lhs * rhs; }


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

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

LLVM IR (-O0):
define i32 @mul(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
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}