xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert_context_process();
int nondet_int();
int get_user(int size, void *ptr) {
  int tmp;
  {
    assert_context_process();
    tmp = nondet_int();
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<get_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <assert_context_process@plt>
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user>:
push   %rax
xor    %eax,%eax
call   1040 <assert_context_process@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nondet_int@plt>

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

LLVM IR (-O2):
define i32 @get_user(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @assert_context_process()
%4 = tail call i32 (...) @nondet_int()
ret i32 %4
}
unsigned int rotr1(unsigned int a) {
  unsigned int b;
  if ((a & 0x01) == 0x01) {
    b = (a >> 1) | 0x8000;
  } else {
    b = (a >> 1) & 0x7fff;
  }
  b = b % 65536;
  return b;
}


x86 assembly (clang, -O0):
<rotr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1129 <rotr1+0x29>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     $0x8000,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <rotr1+0x37>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    $0x7fff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr1>:
mov    %edi,%eax
shr    %eax
mov    %eax,%ecx
or     $0x8000,%ecx
and    $0x7fff,%eax
test   $0x1,%dil
cmovne %ecx,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @rotr1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = lshr i32 %8, 1
%10 = or i32 %9, 32768
store i32 %10, i32* %3
br label %15
11: ; preds = %1
%12 = load i32, i32* %2
%13 = lshr i32 %12, 1
%14 = and i32 %13, 32767
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %7
%16 = load i32, i32* %3
%17 = urem i32 %16, 65536
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @rotr1(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = lshr i32 %0, 1
%5 = or i32 %4, 32768
%6 = and i32 %4, 32767
%7 = select i1 %3, i32 %6, i32 %5
%8 = and i32 %7, 65535
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int const);
char *alfabeto_rand(char (*randomcharfunction)(void)) {
  const int tamano = 1000000;
  int k;
  char *result = (char *)malloc((tamano + 1) * sizeof(char));
  for (k = 0; k < tamano; k++)
    result[k] = randomcharfunction();
  result[k] = 0;
  return result;
}


x86 assembly (clang, -O0):
<alfabeto_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xf4240,-0xc(%rbp)
mov    $0xf4241,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xf4240,-0x10(%rbp)
jge    1163 <alfabeto_rand+0x53>
call   *-0x8(%rbp)
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <alfabeto_rand+0x28>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alfabeto_rand>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xf4241,%edi
call   1030 <malloc@plt>
mov    %rax,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
call   *%r14
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    $0xf4240,%rbx
jne    1130 <alfabeto_rand+0x20>
movb   $0x0,0xf4240(%r15)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @alfabeto_rand(i8 ()* nocapture %0) {
%2 = tail call i64 @malloc(i32 1000001)
%3 = inttoptr i64 %2 to i8*
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %8, %4 ]
%6 = tail call signext i8 %0()
%7 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 %6, i8* %7
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, 1000000
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %3, i64 1000000
store i8 0, i8* %11
ret i8* %3
}
/* Variables and functions */
int ENXIO;
int pm8921_batt_temperature(void) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_batt_temperature>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_batt_temperature>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_batt_temperature() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_batt_temperature() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}
int myStrcmp(char *s, char *t) {
  for (; *s == *t; s++, t++)
    if (*s == '\0')
      return 0;
  return *s - *t;
}


x86 assembly (clang, -O0):
<myStrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <myStrcmp+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <myStrcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <myStrcmp+0x73>
jmp    1143 <myStrcmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <myStrcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myStrcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <myStrcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <myStrcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <myStrcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @myStrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
float copysignf(int, float);
float coshf(float);
scalar_t__ isinf(float);
float sinhf(float);
float tanhf(float x) {
  if (isinf(x)) {
    return copysignf(1, x);
  }
  return sinhf(x) / coshf(x);
}


x86 assembly (clang, -O0):
<tanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1060 <isinf@plt>
cmp    $0x0,%rax
je     117a <tanhf+0x3a>
movss  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1040 <copysignf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    11a4 <tanhf+0x64>
movss  -0x8(%rbp),%xmm0
call   1050 <sinhf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <coshf@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanhf>:
push   %rax
movss  %xmm0,(%rsp)
call   1060 <isinf@plt>
test   %rax,%rax
je     1160 <tanhf+0x20>
mov    $0x1,%edi
movss  (%rsp),%xmm0
pop    %rax
jmp    1040 <copysignf@plt>
movss  (%rsp),%xmm0
call   1050 <sinhf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <coshf@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tanhf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call i64 @isinf(float %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = call float @copysignf(i32 1, float %8)
store float %9, float* %2
br label %16
10: ; preds = %1
%11 = load float, float* %3
%12 = call float @sinhf(float %11)
%13 = load float, float* %3
%14 = call float @coshf(float %13)
%15 = fdiv float %12, %14
store float %15, float* %2
br label %16
16: ; preds = %10, %7
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @tanhf(float %0) {
%2 = tail call i64 @isinf(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call float @copysignf(i32 1, float %0)
br label %10
6: ; preds = %1
%7 = tail call float @sinhf(float %0)
%8 = tail call float @coshf(float %0)
%9 = fdiv float %7, %8
br label %10
10: ; preds = %6, %4
%11 = phi float [ %5, %4 ], [ %9, %6 ]
ret float %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int rand();
int time(int /*<<< orphan*/ *);
uint16_t int_random(uint16_t n) {
  uint16_t t = time(NULL);
  return ((rand() >> 4) ^ t) % n;
}


x86 assembly (clang, -O0):
<int_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
sar    $0x4,%eax
xor    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_random>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <rand@plt>
sar    $0x4,%eax
xor    %ebp,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @int_random(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = call i32 (...) @rand()
%6 = ashr i32 %5, 4
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %2
%10 = srem i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_random(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 (...) @rand()
%4 = ashr i32 %3, 4
%5 = xor i32 %4, %2
%6 = srem i32 %5, %0
ret i32 %6
}
unsigned long long toBinaryFunc(int inputNum) {
  unsigned long long result = 0;
  int i = 1;
  while (inputNum != 0) {
    int remainder = inputNum % 2;
    inputNum /= 2;
    result += i * remainder;
    i *= 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<toBinaryFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1159 <toBinaryFunc+0x59>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <toBinaryFunc+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toBinaryFunc>:
test   %edi,%edi
je     113e <toBinaryFunc+0x3e>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
shr    $0x1f,%edx
add    %edi,%edx
mov    %edx,%r8d
sar    %r8d
and    $0xfffffffe,%edx
mov    %edi,%esi
sub    %edx,%esi
imul   %ecx,%esi
movslq %esi,%rdx
add    %rdx,%rax
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0x1,%edi
cmp    $0x2,%edi
mov    %r8d,%edi
ja     1110 <toBinaryFunc+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @toBinaryFunc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %12, %3 ], [ 1, %1 ]
%6 = phi i64 [ %11, %3 ], [ 0, %1 ]
%7 = srem i32 %4, 2
%8 = sdiv i32 %4, 2
%9 = mul nsw i32 %7, %5
%10 = sext i32 %9 to i64
%11 = add i64 %6, %10
%12 = mul nsw i32 %5, 10
%13 = add i32 %4, 1
%14 = icmp ult i32 %13, 3
br i1 %14, label %15, label %3
15: ; preds = %3, %1
%16 = phi i64 [ 0, %1 ], [ %11, %3 ]
ret i64 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigfillset(int /*<<< orphan*/ *);
void test(void) {
  sigset_t signal_set;
  int result;
  result = sigfillset(&signal_set);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <sigfillset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @sigfillset(i32* %1)
store i32 %3, i32* %2
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
ret void
}
/* Variables and functions */
double comb(int, int);
double two_black(int w, int b, int r) {
  return comb(b, 2) * comb(w + r, 1) / comb(w + b + r, 3);
}


x86 assembly (clang, -O0):
<two_black>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <comb@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
add    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <comb@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
mov    $0x3,%esi
call   1030 <comb@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_black>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %esi,%edi
mov    $0x2,%esi
call   1030 <comb@plt>
movsd  %xmm0,0x8(%rsp)
add    %r14d,%ebx
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <comb@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
add    %ebp,%ebx
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <comb@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @two_black(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = call double @comb(i32 %7, i32 2)
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = call double @comb(i32 %11, i32 1)
%13 = fmul double %8, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
%19 = call double @comb(i32 %18, i32 3)
%20 = fdiv double %13, %19
ret double %20
}

LLVM IR (-O2):
define double @two_black(i32 %0, i32 %1, i32 %2) {
%4 = tail call double @comb(i32 %1, i32 2)
%5 = add i32 %2, %0
%6 = tail call double @comb(i32 %5, i32 1)
%7 = fmul double %4, %6
%8 = add i32 %5, %1
%9 = tail call double @comb(i32 %8, i32 3)
%10 = fdiv double %7, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ findMaxArea(int *, int);
int main() {
  int histogram[5] = {2, 1, 2, 3, 1};
  findMaxArea(histogram, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <findMaxArea@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <findMaxArea@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.histogram = [5 x i32] [i32 2, i32 1, i32 2, i32 3, i32 1]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @findMaxArea(i32* %3, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.histogram = [5 x i32] [i32 2, i32 1, i32 2, i32 3, i32 1]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @findMaxArea(i32* %3, i32 5)
ret i32 0
}
void nop() { int k = 0; }


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

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

/* Variables and functions */
uint16_t eeprom_read_word(const void *ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @eeprom_read_word(i8* nocapture readnone %0) {
ret i32 0
}
void i2d_PUBKEY_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PUBKEY_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long atoll(char *);
int /*<<< orphan*/ memset(char *, char, int);
void test1(char *array) {
  memset(array, '1', 10);
  array[9] = 'a';
  long long r = atoll(array);
  assert(r == 111111111);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x31,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x61,0x9(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x69f6bc7,-0x10(%rbp)
06
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    %rdi,%rbx
mov    $0x31,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
movb   $0x61,0x9(%rbx)
mov    %rbx,%rdi
call   1040 <atoll@plt>
xor    %edi,%edi
cmp    $0x69f6bc7,%rax
sete   %dil
pop    %rbx
jmp    1050 <assert@plt>

LLVM IR (-O0):
define void @test1(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i8 signext 49, i32 10)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 9
store i8 97, i8* %7
%8 = load i8*, i8** %2
%9 = call i64 @atoll(i8* %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = icmp eq i64 %10, 111111111
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}

LLVM IR (-O2):
define void @test1(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i8 signext 49, i32 10)
%3 = getelementptr inbounds i8, i8* %0, i64 9
store i8 97, i8* %3
%4 = tail call i64 @atoll(i8* %0)
%5 = icmp eq i64 %4, 111111111
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0;
  assert(i != 0);
  printf("ok\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
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    %edi,%edi
call   1040 <assert@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"ok\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int ps_test_close(int fd) {
  int rv;
  rv = close(fd);
  if (rv != 0)
    perror("Klaida iskvietus close() funkcija");
  else if (0 == 0)
    puts("closed");
  return rv;
}


x86 assembly (clang, -O0):
<ps_test_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1161 <ps_test_close+0x31>
lea    0xea9(%rip),%rdi
call   1050 <perror@plt>
jmp    116d <ps_test_close+0x3d>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_test_close>:
push   %rbx
call   1040 <close@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    114c <ps_test_close+0x1c>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xead(%rip),%rdi
call   1050 <perror@plt>
jmp    1148 <ps_test_close+0x18>

LLVM IR (-O0):
@.str = [34 x i8] c"Klaida iskvietus close() funkcija\00"
@.str.1 = [7 x i8] c"closed\00"
define i32 @ps_test_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [34 x i8] c"Klaida iskvietus close() funkcija\00"
@.str.1 = [7 x i8] c"closed\00"
define i32 @ps_test_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_or_si256(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm256_slli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm256_srli_epi32(int /*<<< orphan*/, int);
__attribute__((always_)) __m256i rot7(__m256i x) {
  return _mm256_or_si256(_mm256_srli_epi32(x, 7), _mm256_slli_epi32(x, 32 - 7));
}


x86 assembly (clang, -O0):
<rot7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x7,%esi
call   1050 <_mm256_srli_epi32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x19,%esi
call   1030 <_mm256_slli_epi32@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm256_or_si256@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot7>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x7,%esi
call   1050 <_mm256_srli_epi32@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x19,%esi
call   1030 <_mm256_slli_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_mm256_or_si256@plt>

LLVM IR (-O0):
define i32 @rot7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm256_srli_epi32(i32 %3, i32 7)
%5 = load i32, i32* %2
%6 = call i32 @_mm256_slli_epi32(i32 %5, i32 25)
%7 = call i32 @_mm256_or_si256(i32 %4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot7(i32 %0) {
%2 = tail call i32 @_mm256_srli_epi32(i32 %0, i32 7)
%3 = tail call i32 @_mm256_slli_epi32(i32 %0, i32 25)
%4 = tail call i32 @_mm256_or_si256(i32 %2, i32 %3)
ret i32 %4
}
int sub(int x, int y) {
  int z;
  z = x - y;
  return z;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int setCursorAtFileStart(FILE *pfFilePointer) {
  return fseek(pfFilePointer, 0L, SEEK_SET);
}


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

x86 assembly (clang, -O2):
<setCursorAtFileStart>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @setCursorAtFileStart(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i64 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @setCursorAtFileStart(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
ret i32 %3
}
unsigned long gcd(unsigned long a, unsigned long b) {
  unsigned long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <gcd+0x3c>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = urem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
int modulo(int n, int modulus) {
  int rem = n % modulus;
  return (rem >= 0) ? rem : rem + modulus;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1129 <modulo+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <modulo+0x32>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("any(\"hello fool2fish!\", \"f2f\") -> %d\n",
         any("hello fool2fish", "f2f"));
  printf("any(\"hello fool2fish!\", \"yzx\") -> %d\n",
         any("hello fool2fish", "yzx"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xefb(%rip),%rdi
lea    0xf04(%rip),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0xf0d(%rip),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xefe(%rip),%rbx
lea    0xf07(%rip),%rsi
mov    %rbx,%rdi
call   1040 <any@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xf14(%rip),%rsi
mov    %rbx,%rdi
call   1040 <any@plt>
lea    0xedf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"any(\22hello fool2fish!\22, \22f2f\22) -> %d\0A\00"
@.str.1 = [16 x i8] c"hello fool2fish\00"
@.str.2 = [4 x i8] c"f2f\00"
@.str.3 = [38 x i8] c"any(\22hello fool2fish!\22, \22yzx\22) -> %d\0A\00"
@.str.4 = [4 x i8] c"yzx\00"
define i32 @main() {
%1 = call i32 @any(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @any(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"any(\22hello fool2fish!\22, \22f2f\22) -> %d\0A\00"
@.str.1 = [16 x i8] c"hello fool2fish\00"
@.str.2 = [4 x i8] c"f2f\00"
@.str.3 = [38 x i8] c"any(\22hello fool2fish!\22, \22yzx\22) -> %d\0A\00"
@.str.4 = [4 x i8] c"yzx\00"
define i32 @main() {
%1 = tail call i32 @any(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @any(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret i32 0
}
void shmem_init(struct consumer_workspace *ws) {}


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

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

LLVM IR (-O0):
%struct.consumer_workspace = type opaque
define void @shmem_init(%struct.consumer_workspace* %0) {
%2 = alloca %struct.consumer_workspace*
store %struct.consumer_workspace* %0, %struct.consumer_workspace** %2
ret void
}

LLVM IR (-O2):
%struct.consumer_workspace = type opaque
define void @shmem_init(%struct.consumer_workspace* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
void U_WMRSETBKCOLOR_swap(char *record, int torev) {
  U_WMRCORE_SIZE16_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSETBKCOLOR_swap>:
jmp    1030 <U_WMRCORE_SIZE16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRSETBKCOLOR_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_SIZE16_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int M_PI;
int atan(double);
double vec_arg(double x, double y) {
  double arg = atan(y / x) * 180 / M_PI;
  if (x < 0)
    return 180 + arg;
  return arg;
}


x86 assembly (clang, -O0):
<vec_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <atan@plt>
imul   $0xb4,%eax,%eax
mov    0x2eaa(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116f <vec_arg+0x5f>
movsd  0xea0(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1179 <vec_arg+0x69>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_arg>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <atan@plt>
imul   $0xb4,%eax,%eax
mov    0x2eb5(%rip),%rcx
cltd
idivl  (%rcx)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xebb(%rip),%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd (%rsp),%xmm3
cmpltsd %xmm2,%xmm3
movapd %xmm3,%xmm2
andnpd %xmm0,%xmm2
andpd  %xmm1,%xmm3
orpd   %xmm2,%xmm3
movapd %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @vec_arg(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call i32 @atan(double %9)
%11 = mul nsw i32 %10, 180
%12 = load i32, i32* @M_PI
%13 = sdiv i32 %11, %12
%14 = sitofp i32 %13 to double
store double %14, double* %6
%15 = load double, double* %4
%16 = fcmp olt double %15, 0.000000e+00
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load double, double* %6
%19 = fadd double 1.800000e+02, %18
store double %19, double* %3
br label %22
20: ; preds = %2
%21 = load double, double* %6
store double %21, double* %3
br label %22
22: ; preds = %20, %17
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @vec_arg(double %0, double %1) {
%3 = fdiv double %1, %0
%4 = tail call i32 @atan(double %3)
%5 = mul nsw i32 %4, 180
%6 = load i32, i32* @M_PI
%7 = sdiv i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fcmp olt double %0, 0.000000e+00
%10 = fadd double %8, 1.800000e+02
%11 = select i1 %9, double %10, double %8
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ fatorial(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int nth;
  scanf("%d", &nth);
  printf("%lu\n", fatorial(nth));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fatorial@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fatorial@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @fatorial(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fatorial(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int g(int v) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 0
}
int internal_function() { return 42; }


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

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

LLVM IR (-O0):
define i32 @internal_function() {
ret i32 42
}

LLVM IR (-O2):
define i32 @internal_function() {
ret i32 42
}
/* Variables and functions */
int CRYPTO_secure_malloc_init(size_t size, int minsize) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_secure_malloc_init(i64 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int, char *);
char *strerror(int);
int check_fd(int fd, int nfds) {
  if (fd < 0) {
    printf("Error: %d (%s)\n", errno, strerror(errno));
  }
  return ((fd + 1) < nfds) ? nfds : (fd + 1);
}


x86 assembly (clang, -O0):
<check_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1164 <check_fd+0x44>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    117e <check_fd+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1187 <check_fd+0x67>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_fd>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
test   %edi,%edi
jns    1150 <check_fd+0x30>
mov    0x2ead(%rip),%rax
mov    (%rax),%r14d
mov    %r14d,%edi
call   1040 <strerror@plt>
lea    0xebb(%rip),%rdi
mov    %r14d,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebx,%ebp
cmovl  %ebx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Error: %d (%s)\0A\00"
@errno = global i32 0
define i32 @check_fd(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @errno
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %10)
br label %12
12: ; preds = %7, %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i32, i32* %4
br label %22
19: ; preds = %12
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
br label %22
22: ; preds = %19, %17
%23 = phi i32 [ %18, %17 ], [ %21, %19 ]
ret i32 %23
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error: %d (%s)\0A\00"
@errno = global i32 0
define i32 @check_fd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
br label %8
8: ; preds = %4, %2
%9 = add nsw i32 %0, 1
%10 = icmp slt i32 %9, %1
%11 = select i1 %10, i32 %1, i32 %9
ret i32 %11
}
/* Variables and functions */
int tcpSetBlock(char *, int, int /*<<< orphan*/);
int tcpBlock(char *err, int fd) { return tcpSetBlock(err, fd, 0); }


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

x86 assembly (clang, -O2):
<tcpBlock>:
xor    %edx,%edx
jmp    1030 <tcpSetBlock@plt>

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

LLVM IR (-O2):
define i32 @tcpBlock(i8* %0, i32 %1) {
%3 = tail call i32 @tcpSetBlock(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swab_32(uint32_t v) {
  return (v >> 24) | ((v & 0x00ff0000) >> 8) | ((v & 0x0000ff00) << 8) |
         ((v & 0xff) << 24);
}


x86 assembly (clang, -O0):
<swab_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swab_32>:
mov    %edi,%eax
sar    $0x18,%eax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
mov    %edi,%edx
shl    $0x8,%edx
and    $0xff0000,%edx
shl    $0x18,%edi
or     %edi,%eax
or     %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @swab_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = load i32, i32* %2
%6 = and i32 %5, 16711680
%7 = ashr i32 %6, 8
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = and i32 %13, 255
%15 = shl i32 %14, 24
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @swab_32(i32 %0) {
%2 = ashr i32 %0, 24
%3 = lshr i32 %0, 8
%4 = and i32 %3, 65280
%5 = shl i32 %0, 8
%6 = and i32 %5, 16711680
%7 = shl i32 %0, 24
%8 = or i32 %7, %2
%9 = or i32 %8, %4
%10 = or i32 %9, %6
ret i32 %10
}