xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(const char *str, int ch) {
  while (*str && *str != ch) {
    str++;
  }
  return (*str == ch) ? (char *)str : NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1130 <strchr+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <strchr+0x40>
jmp    1151 <strchr+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    116e <strchr+0x6e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1179 <strchr+0x79>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1179 <strchr+0x79>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %ecx,%ecx
je     1120 <strchr+0x20>
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = select i1 %8, i8* %4, i8* null
ret i8* %12
}
/* Variables and functions */
float fabs(float);
bool compare_f(float a, float b, float eps) { return fabs(a - b) < eps; }


x86 assembly (clang, -O0):
<compare_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_f>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @compare_f(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = call float @fabs(float %9)
%11 = load float, float* %6
%12 = fcmp olt float %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @compare_f(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fcmp olt float %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
int uwsgi_socket_passcred(int fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @uwsgi_socket_passcred(i32 %0) {
ret i32 -1
}
/* Variables and functions */
double sqrt(double);
double przeciwprost(double a, double b) {
  double wynik;
  wynik = sqrt(a * a + b * b);
  return wynik;
}


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

x86 assembly (clang, -O2):
<przeciwprost>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <przeciwprost+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @przeciwprost(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = call double @llvm.fmuladd.f64(double %6, double %7, double %10)
%12 = call double @sqrt(double %11)
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @przeciwprost(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Variables and functions */
scalar_t__ shifta(unsigned int, int);
scalar_t__ shiftb(int, unsigned int);
int main(int argc, char **argv) {
  unsigned x = -2;
  return (shifta(x, 3) == shiftb(3, x));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfffffffe,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x3,%esi
call   1030 <shifta@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x3,%edi
call   1040 <shiftb@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xfffffffe,%edi
mov    $0x3,%esi
call   1030 <shifta@plt>
mov    %rax,%rbx
mov    $0x3,%edi
mov    $0xfffffffe,%esi
call   1040 <shiftb@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -2, i32* %6
%7 = load i32, i32* %6
%8 = call i64 @shifta(i32 %7, i32 3)
%9 = load i32, i32* %6
%10 = call i64 @shiftb(i32 3, i32 %9)
%11 = icmp eq i64 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @shifta(i32 -2, i32 3)
%4 = tail call i64 @shiftb(i32 3, i32 -2)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct group {
  int gr_gid;
};
typedef int gid_t;

/* Variables and functions */
struct group *getgrnam(char const *);
gid_t groupIdFromName(const char *name) {
  struct group *g;
  if ((g = getgrnam(name)) == NULL) {
    return -1;
  }
  return g->gr_gid;
}


x86 assembly (clang, -O0):
<groupIdFromName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    113f <groupIdFromName+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <groupIdFromName+0x38>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<groupIdFromName>:
push   %rax
call   1030 <getgrnam@plt>
test   %rax,%rax
je     111f <groupIdFromName+0xf>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type { i32 }
define i32 @groupIdFromName(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.group*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.group* @getgrnam(i8* %5)
store %struct.group* %6, %struct.group** %4
%7 = icmp eq %struct.group* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = load %struct.group*, %struct.group** %4
%11 = getelementptr inbounds %struct.group, %struct.group* %10, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.group = type { i32 }
define i32 @groupIdFromName(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
regx0adrreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
ja     113f <regx0adrreg1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <regx0adrreg1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrreg1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @regx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %5, i64 277777
%11 = load i32, i32* %10
%12 = icmp ule i32 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl64(uint64_t a, uint64_t n) { return ((a << n) | (a >> (64 - n))); }


x86 assembly (clang, -O0):
<rotl64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl64(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int spawnvpe(int, char const *, char const **, char const **);
int execlpe(const char *path, const char *argv0, ...) {
  char const **ptr;
  for (ptr = &argv0; *ptr; ptr++)
    ;
  ptr = (char const **)(*++ptr);
  ;
  return spawnvpe(3, path, &argv0, ptr);
}


x86 assembly (clang, -O0):
<execlpe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <execlpe+0x3c>
jmp    113b <execlpe+0x2b>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <execlpe+0x18>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x3,%edi
lea    -0x10(%rbp),%rdx
call   1030 <spawnvpe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execlpe>:
push   %rax
mov    %rdi,%rax
mov    %rsi,(%rsp)
test   %rsi,%rsi
je     1130 <execlpe+0x20>
mov    %rsp,%rdx
lea    0x8(%rdx),%rcx
cmpq   $0x0,0x8(%rdx)
mov    %rcx,%rdx
jne    1120 <execlpe+0x10>
jmp    1133 <execlpe+0x23>
mov    %rsp,%rcx
mov    0x8(%rcx),%rcx
mov    %rsp,%rdx
mov    $0x3,%edi
mov    %rax,%rsi
call   1030 <spawnvpe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execlpe(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8** %4, i8*** %5
br label %6
6: ; preds = %11, %2
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %6
br label %11
11: ; preds = %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
br label %6
14: ; preds = %6
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %5
%17 = load i8*, i8** %16
%18 = bitcast i8* %17 to i8**
store i8** %18, i8*** %5
%19 = load i8*, i8** %3
%20 = load i8**, i8*** %5
%21 = call i32 @spawnvpe(i32 3, i8* %19, i8** %4, i8** %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @execlpe(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = icmp eq i8* %1, null
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8** [ %7, %5 ], [ %3, %2 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i8** [ %3, %2 ], [ %7, %5 ]
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = bitcast i8** %12 to i8***
%14 = load i8**, i8*** %13
%15 = call i32 @spawnvpe(i32 3, i8* %0, i8** %3, i8** %14)
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ err_quit(char *);
scalar_t__ listen(int, int);
void Listen(int sockfd, int backlog) {
  if (listen(sockfd, backlog) < 0)
    err_quit("listen failed\n");
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <listen@plt>
cmp    $0x0,%rax
jge    114f <Listen+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1040 <listen@plt>
test   %rax,%rax
js     112d <Listen+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_quit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"listen failed\0A\00"
define void @Listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_quit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
void gtk_container_get_focus_vadjustment() {}


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

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

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

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

/* Variables and functions */
uint16_t _crc_ccitt_update(uint16_t crc, uint8_t data) {
  data ^= crc & 0xFF;
  data ^= data << 4;
  return ((((uint16_t)data << 8) | (crc >> 8)) ^ (uint8_t)(data >> 4) ^
          ((uint16_t)data << 3));
}


x86 assembly (clang, -O0):
<_crc_ccitt_update>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_crc_ccitt_update>:
movzbl %dil,%ecx
xor    %esi,%ecx
mov    %ecx,%eax
shl    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shl    $0x8,%ecx
sar    $0x8,%edi
or     %edi,%ecx
mov    %eax,%edx
sar    $0x4,%edx
shl    $0x3,%eax
xor    %edx,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_crc_ccitt_update(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 = and i32 %5, 255
%7 = load i32, i32* %4
%8 = xor i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = shl i32 %9, 4
%11 = load i32, i32* %4
%12 = xor i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = ashr i32 %15, 8
%17 = or i32 %14, %16
%18 = load i32, i32* %4
%19 = ashr i32 %18, 4
%20 = xor i32 %17, %19
%21 = load i32, i32* %4
%22 = shl i32 %21, 3
%23 = xor i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @_crc_ccitt_update(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = xor i32 %3, %1
%5 = shl i32 %4, 4
%6 = xor i32 %5, %4
%7 = shl i32 %6, 8
%8 = ashr i32 %0, 8
%9 = or i32 %7, %8
%10 = ashr i32 %6, 4
%11 = shl i32 %6, 3
%12 = xor i32 %11, %10
%13 = xor i32 %12, %9
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "Usage: tee [-a] file\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: tee [-a] file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: tee [-a] file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ countZeros(long);
scalar_t__ pow(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long n;
  scanf("%ld", &n);
  printf("%ld", (long)pow(2, countZeros(n)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <countZeros@plt>
mov    %eax,%esi
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %rax,%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rdi
call   1040 <countZeros@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1060 <pow@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @countZeros(i64 %4)
%6 = call i64 @pow(i32 2, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i32 0
}
/* Variables and functions */
float fb_FIXSingle(float);
float fb_FRACf(float x) { return x - fb_FIXSingle(x); }


x86 assembly (clang, -O0):
<fb_FRACf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fb_FIXSingle@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_FRACf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <fb_FIXSingle@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fb_FRACf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @fb_FIXSingle(float %4)
%6 = fsub float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @fb_FRACf(float %0) {
%2 = tail call float @fb_FIXSingle(float %0)
%3 = fsub float %0, %2
ret float %3
}
int fun443() { return 443; }


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

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

LLVM IR (-O0):
define i32 @fun443() {
ret i32 443
}

LLVM IR (-O2):
define i32 @fun443() {
ret i32 443
}
int atomic_get(int *x) { return __sync_fetch_and_add(x, 0); }


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

x86 assembly (clang, -O2):
<atomic_get>:
mfence
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @atomic_get(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = atomicrmw add i32* %3, i32 0 seq_cst
ret i32 %4
}

LLVM IR (-O2):
define i32 @atomic_get(i32* nocapture %0) {
%2 = atomicrmw or i32* %0, i32 0 seq_cst
ret i32 %2
}
int test_imm_A7uint8_reg(unsigned char val) {
  return ((val) & (-0xA7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A7uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff59,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A7uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 89
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int fread_8(uint8_t *buf, FILE *fd) {
  return (fread(buf, sizeof(*buf), 1, fd) == 1) ? 0 : -1;
}


x86 assembly (clang, -O0):
<fread_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread_8>:
push   %rax
mov    %rsi,%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fread_8(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @fread(i32* %5, i32 4, i32 1, i32* %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @fread_8(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(i32* %0, i32 4, i32 1, i32* %1)
%4 = icmp ne i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double histogram_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + 1e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<histogram_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<histogram_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @histogram_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @histogram_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void intro(void) {
  printf("\nAcey Duecy\n"
         "----------\n"
         "Acey Ducey is played by having the computer deal out two cards. The\n"
         "player then decides on whether the next card chosen will be between "
         "the\n"
         "first two dealt, Aces high.\n\n"
         "You gain %d points every time you guess correctly and lose %d points "
         "for\n"
         "every incorrect guess.\n\n",
         5, 25);
  srand(time(NULL));
}


x86 assembly (clang, -O0):
<intro>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x5,%esi
mov    $0x19,%edx
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intro>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x5,%esi
mov    $0x19,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
@.str = [290 x i8] c"\0AAcey Duecy\0A----------\0AAcey Ducey is played by having the computer deal out two cards. The\0Aplayer then decides on whether the next card chosen will be between the\0Afirst two dealt, Aces high.\0A\0AYou gain %d points every time you guess correctly and lose %d points for\0Aevery incorrect guess.\0A\0A\00"
define void @intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([290 x i8], [290 x i8]* @.str, i64 0, i64 0), i32 5, i32 25)
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [290 x i8] c"\0AAcey Duecy\0A----------\0AAcey Ducey is played by having the computer deal out two cards. The\0Aplayer then decides on whether the next card chosen will be between the\0Afirst two dealt, Aces high.\0A\0AYou gain %d points every time you guess correctly and lose %d points for\0Aevery incorrect guess.\0A\0A\00"
define void @intro() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([290 x i8], [290 x i8]* @.str, i64 0, i64 0), i32 5, i32 25)
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
ret void
}
char test34(int a, int *b) { return (b[4] & b[0] & a) == a; }


x86 assembly (clang, -O0):
<test34>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
mov    -0x10(%rbp),%rcx
and    (%rcx),%eax
and    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test34>:
mov    0x10(%rsi),%eax
and    %edi,%eax
and    (%rsi),%eax
cmp    %edi,%eax
sete   %al
ret

LLVM IR (-O0):
define signext i8 @test34(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = and i32 %7, %10
%12 = load i32, i32* %3
%13 = and i32 %11, %12
%14 = load i32, i32* %3
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @test34(i32 %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 4
%4 = load i32, i32* %3
%5 = load i32, i32* %1
%6 = and i32 %4, %0
%7 = and i32 %6, %5
%8 = icmp eq i32 %7, %0
%9 = zext i1 %8 to i8
ret i8 %9
}
int main(int argc, char **argv, char **env) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 0
}
int is_upper(char character) {
  int temp_ascii = (int)character;
  if ((temp_ascii >= 65) && (temp_ascii <= 90)) {
    return 6;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41,-0xc(%rbp)
jl     1131 <is_upper+0x31>
cmpl   $0x5a,-0xc(%rbp)
jg     1131 <is_upper+0x31>
movl   $0x6,-0x4(%rbp)
jmp    1138 <is_upper+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_upper>:
add    $0xbf,%dil
xor    %ecx,%ecx
cmp    $0x1a,%dil
mov    $0x6,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_upper(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 6, i32* %2
br label %14
13: ; preds = %9, %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_upper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = select i1 %3, i32 6, i32 0
ret i32 %4
}
float ffabs(float x) { return ((x >= 0) * 2) * x - x; }


x86 assembly (clang, -O0):
<ffabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffabs>:
xorps  %xmm2,%xmm2
cmpless %xmm0,%xmm2
movss  0xef0(%rip),%xmm1
andps  %xmm2,%xmm1
mulss  %xmm0,%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ffabs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = mul nsw i32 %5, 2
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = load float, float* %2
%10 = fneg float %9
%11 = call float @llvm.fmuladd.f32(float %7, float %8, float %10)
ret float %11
}

LLVM IR (-O2):
define float @ffabs(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 2.000000e+00, float 0.000000e+00
%4 = fneg float %0
%5 = tail call float @llvm.fmuladd.f32(float %3, float %0, float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float ar;
  printf("Ar AFA nelkul?\n");
  scanf("%f", &ar);
  float total = ar * 1.27;
  printf("Teljes ar: %f\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%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    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xea0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Ar AFA nelkul?\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [15 x i8] c"Teljes ar: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double %7, 1.270000e+00
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [15 x i8] c"Teljes ar: %f\0A\00"
@str = [15 x i8] c"Ar AFA nelkul?\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 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 = fpext float %5 to double
%7 = fmul double %6, 1.270000e+00
%8 = fptrunc double %7 to float
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ html_header();
int /*<<< orphan*/ status(char *);
int main() {
  status("204 nada");
  html_header();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <status@plt>
mov    $0x0,%al
call   1040 <html_header@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <status@plt>
xor    %eax,%eax
call   1040 <html_header@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"204 nada\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @status(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @html_header()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"204 nada\00"
define i32 @main() {
%1 = tail call i32 @status(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @html_header()
%3 = tail call i32 @exit(i32 0)
unreachable
}
void d_fetchub(const unsigned char **ptr, unsigned char *dest) {
  *dest = *(*ptr)++;
}


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

x86 assembly (clang, -O2):
<d_fetchub>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%al
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @d_fetchub(i8** nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
%5 = load i8, i8* %3
store i8 %5, i8* %1
ret void
}
int test_imm_CBint8_reg(signed char val) {
  return ((val) & (-0xCB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CBint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff35,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CBint8_reg>:
test   $0xffffff35,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CBint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -203
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float sqrtf(float);
float arm_sqrtf(float in) {
  float out;
  out = sqrtf(in);
  return out;
}


x86 assembly (clang, -O0):
<arm_sqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_sqrtf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <arm_sqrtf+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @arm_sqrtf(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
int test_struct_scope_3(struct S4 *s4) {
  struct S4 {
    int y;
  } *s4_2 = 0;
  return 0;
}


x86 assembly (clang, -O0):
<test_struct_scope_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S4 = type { i32 }
define i32 @test_struct_scope_3(%struct.S4* %0) {
%2 = alloca %struct.S4*
%3 = alloca %struct.S4*
store %struct.S4* %0, %struct.S4** %2
store %struct.S4* null, %struct.S4** %3
ret i32 0
}

LLVM IR (-O2):
%struct.S4 = type { i32 }
define i32 @test_struct_scope_3(%struct.S4* nocapture readnone %0) {
ret i32 0
}
void pthread_detach() {}


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

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

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

LLVM IR (-O2):
define void @pthread_detach() {
ret void
}
unsigned long energest_type_time(int type) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @energest_type_time(i32 %0) {
ret i64 0
}
/* Variables and functions */
size_t ZBUFF_recommendedDOutSize(void) { return (128 * 1024); }


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

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

LLVM IR (-O0):
define i64 @ZBUFF_recommendedDOutSize() {
ret i64 131072
}

LLVM IR (-O2):
define i64 @ZBUFF_recommendedDOutSize() {
ret i64 131072
}
unsigned int cgc_strlen(const char *str) {
  unsigned int count = 0;
  while (*str != '\0') {
    count++;
    str++;
  }
  return count;
}


x86 assembly (clang, -O0):
<cgc_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <cgc_strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <cgc_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgc_strlen>:
cmpb   $0x0,(%rdi)
je     111c <cgc_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <cgc_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cgc_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ heapSort(int *, int /*<<< orphan*/, int);
int findKthLargest(int *nums, int size, int k) {
  heapSort(nums, 0, size - 1);
  return nums[size - k];
}


x86 assembly (clang, -O0):
<findKthLargest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <heapSort@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findKthLargest>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%rbp
lea    -0x1(%rbx),%edx
xor    %esi,%esi
call   1030 <heapSort@plt>
sub    %r14d,%ebx
movslq %ebx,%rax
mov    0x0(%rbp,%rax,4),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @findKthLargest(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = call i32 @heapSort(i32* %7, i32 0, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %11, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @findKthLargest(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @heapSort(i32* %0, i32 0, i32 %4)
%6 = sub nsw i32 %1, %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void handle_signal(int sig) {
  fprintf(stdout, "Interrupted.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_signal>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Interrupted.\0A\00"
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Interrupted.\0A\00"
define void @handle_signal(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void error(char *msg) { err(-1, msg); }


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

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <err@plt>

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

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 @err(i32 -1, i8* %0)
ret void
}