xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
scalar_t__ rewind_tape(int);
int disk_is_tape(const char *device) {
  int fd, rc = 0;
  fd = open(device, O_RDWR);
  if (fd == -1)
    return 0;
  if (rewind_tape(fd) == 0)
    rc = 1;
  close(fd);
  return rc;
}


x86 assembly (clang, -O0):
<disk_is_tape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    116e <disk_is_tape+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1195 <disk_is_tape+0x65>
mov    -0x14(%rbp),%edi
call   1040 <rewind_tape@plt>
cmp    $0x0,%rax
jne    1187 <disk_is_tape+0x57>
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disk_is_tape>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     1161 <disk_is_tape+0x31>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <rewind_tape@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebx,%edi
call   1030 <close@plt>
jmp    1163 <disk_is_tape+0x33>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @disk_is_tape(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = tail call i64 @rewind_tape(i32 %3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @close(i32 %3)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %11
}
void delay() {
  int i;
  for (i = 0; i < 4; i++)
    asm volatile("nop");
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1124 <delay+0x24>
nop
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 4
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sayHelloTo(char who[]) { printf("Hello, %s!\n", who); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello, %s!\0A\00"
define void @sayHelloTo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello, %s!\0A\00"
define void @sayHelloTo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ unknown(int);
void unknown_is_functional_ok() {
  int *p = NULL;
  if (unknown(10) != unknown(10)) {
    *p = 42;
  }
}


x86 assembly (clang, -O0):
<unknown_is_functional_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <unknown@plt>
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
call   1030 <unknown@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1152 <unknown_is_functional_ok+0x42>
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_is_functional_ok>:
push   %rax
mov    $0xa,%edi
call   1030 <unknown@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <unknown@plt>

LLVM IR (-O0):
define void @unknown_is_functional_ok() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i64 @unknown(i32 10)
%3 = call i64 @unknown(i32 10)
%4 = icmp ne i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32*, i32** %1
store i32 42, i32* %6
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @unknown_is_functional_ok() {
%1 = tail call i64 @unknown(i32 10)
%2 = tail call i64 @unknown(i32 10)
%3 = icmp eq i64 %1, %2
tail call void @llvm.assume(i1 %3)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int cmpint64(const void *a, const void *b) {
  int64_t *aa = (int64_t *)a;
  int64_t *bb = (int64_t *)b;
  return *aa - *bb;
}


x86 assembly (clang, -O0):
<cmpint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmpint64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpint64(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char *strerror(int /*<<< orphan*/);
char *fild_LastError(void) { return strerror(errno); }


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

x86 assembly (clang, -O2):
<fild_LastError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define i8* @fild_LastError() {
%1 = load i32, i32* @errno
%2 = tail call i8* @strerror(i32 %1)
ret i8* %2
}
/* Type definitions */
struct timespec {
  unsigned long long tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void timespec_chk_overflow(struct timespec *ts) {
  while (ts->tv_nsec >= 1000000000ULL) {
    ts->tv_nsec -= 1000000000ULL;
    ts->tv_sec++;
  }
}


x86 assembly (clang, -O0):
<timespec_chk_overflow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x3b9aca00,(%rax)
jb     113c <timespec_chk_overflow+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
sub    $0x3b9aca00,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x8(%rax)
jmp    1108 <timespec_chk_overflow+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_chk_overflow>:
mov    (%rdi),%rcx
cmp    $0x3b9aca00,%rcx
jb     1147 <timespec_chk_overflow+0x47>
mov    0x8(%rdi),%esi
lea    -0x3b9aca00(%rcx),%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rdx
mul    %rdx
shr    $0xb,%rdx
imul   $0xffffffffc4653600,%rdx,%rax
add    %rcx,%rax
add    $0xffffffffc4653600,%rax
lea    (%rsi,%rdx,1),%ecx
add    $0x1,%ecx
mov    %rax,(%rdi)
mov    %ecx,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define void @timespec_chk_overflow(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = icmp uge i64 %6, 1000000000
br i1 %7, label %8, label %17
8: ; preds = %3
%9 = load %struct.timespec*, %struct.timespec** %2
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sub i64 %11, 1000000000
store i64 %12, i64* %10
%13 = load %struct.timespec*, %struct.timespec** %2
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
define void @timespec_chk_overflow(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 999999999
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = add i64 %3, -1000000000
%9 = udiv i64 %8, 1000000000
%10 = mul i64 %9, -1000000000
%11 = trunc i64 %9 to i32
%12 = add i32 %7, %11
%13 = add i64 %10, %8
%14 = add i32 %12, 1
store i64 %13, i64* %2
store i32 %14, i32* %6
br label %15
15: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unimplemented();
void swi(void) { unimplemented(); }


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

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

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

LLVM IR (-O2):
define void @swi() {
%1 = tail call i32 (...) @unimplemented()
ret void
}
/* Variables and functions */
int binary_search_int(int *, int, int /*<<< orphan*/, unsigned int);
int binary_search(int haystack[], int needle, unsigned int n_haystack) {
  return binary_search_int(haystack, needle, 0, n_haystack - 1);
}


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

x86 assembly (clang, -O2):
<binary_search>:
lea    -0x1(%rdx),%ecx
xor    %edx,%edx
jmp    1030 <binary_search_int@plt>

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

LLVM IR (-O2):
define i32 @binary_search(i32* %0, i32 %1, i32 %2) {
%4 = add i32 %2, -1
%5 = tail call i32 @binary_search_int(i32* %0, i32 %1, i32 0, i32 %4)
ret i32 %5
}
/* Variables and functions */
float clamp(scalar_t__, double, double);
scalar_t__ pow(float, double);
float getFalloff(float distance, float lightFalloff) {
  float result = clamp(1.0 - pow(distance / lightFalloff, 4.0), 0.0, 1.0);
  return result * result / (distance * distance + 1.0);
}


x86 assembly (clang, -O0):
<getFalloff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
call   1040 <pow@plt>
cvtsi2sd %rax,%xmm1
movsd  0xeaa(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
xorps  %xmm0,%xmm0
movsd  0xe96(%rip),%xmm1
call   1030 <clamp@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe68(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFalloff>:
push   %rax
movss  %xmm0,0x4(%rsp)
divss  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xec0(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
cvttsd2si %xmm2,%rdi
xorpd  %xmm0,%xmm0
call   1030 <clamp@plt>
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xe8c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @getFalloff(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fdiv float %6, %7
%9 = call i64 @pow(float %8, double 4.000000e+00)
%10 = sitofp i64 %9 to double
%11 = fsub double 1.000000e+00, %10
%12 = fptosi double %11 to i64
%13 = call float @clamp(i64 %12, double 0.000000e+00, double 1.000000e+00)
store float %13, float* %5
%14 = load float, float* %5
%15 = load float, float* %5
%16 = fmul float %14, %15
%17 = fpext float %16 to double
%18 = load float, float* %3
%19 = load float, float* %3
%20 = fmul float %18, %19
%21 = fpext float %20 to double
%22 = fadd double %21, 1.000000e+00
%23 = fdiv double %17, %22
%24 = fptrunc double %23 to float
ret float %24
}

LLVM IR (-O2):
define float @getFalloff(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call i64 @pow(float %3, double 4.000000e+00)
%5 = sitofp i64 %4 to double
%6 = fsub double 1.000000e+00, %5
%7 = fptosi double %6 to i64
%8 = tail call float @clamp(i64 %7, double 0.000000e+00, double 1.000000e+00)
%9 = fmul float %8, %8
%10 = fpext float %9 to double
%11 = fmul float %0, %0
%12 = fpext float %11 to double
%13 = fadd double %12, 1.000000e+00
%14 = fdiv double %10, %13
%15 = fptrunc double %14 to float
ret float %15
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *path) {
  if (path != NULL) {
    char *pos = strrchr(path, '\\');
    if (pos != NULL) {
      if (pos + 1 != NULL)
        return pos + 1;
      else
        return pos;
    } else {
      return path;
    }
  } else {
    return ".";
  }
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1181 <basename+0x71>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <basename+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
cmp    $0x0,%rax
je     1167 <basename+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    118c <basename+0x7c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118c <basename+0x7c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118c <basename+0x7c>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
test   %rdi,%rdi
je     1133 <basename+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %23
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strrchr(i8* %8, i8 signext 92)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %21
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8* %18, i8** %2
br label %24
19: ; preds = %12
%20 = load i8*, i8** %4
store i8* %20, i8** %2
br label %24
21: ; preds = %7
%22 = load i8*, i8** %3
store i8* %22, i8** %2
br label %24
23: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %24
24: ; preds = %23, %21, %19, %16
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @basename(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 92)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}
unsigned short seqno_plus(unsigned short s, int plus) {
  return ((s + plus) & 0xFFFF);
}


x86 assembly (clang, -O0):
<seqno_plus>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
add    -0x8(%rbp),%eax
and    $0xffff,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqno_plus>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @seqno_plus(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = and i32 %8, 65535
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @seqno_plus(i16 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = add i16 %3, %0
ret i16 %4
}
unsigned int test_05(unsigned int a) { return a >= 255 ? 255 : a; }


x86 assembly (clang, -O0):
<test_05>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jb     1121 <test_05+0x21>
mov    $0xff,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <test_05+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_05>:
cmp    $0xff,%edi
mov    $0xff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @test_05(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 255
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 255, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_05(i32 %0) {
%2 = icmp ult i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
ret i32 %3
}
unsigned char _is_separator_char(char c) {
  return (c == ',') || (c == ';') || (c == ':');
}


x86 assembly (clang, -O0):
<_is_separator_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     113b <_is_separator_char+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3b,%ecx
mov    %al,-0x2(%rbp)
je     113b <_is_separator_char+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x3a,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_separator_char>:
mov    $0x1,%al
cmp    $0x2c,%dil
je     110e <_is_separator_char+0xe>
cmp    $0x3b,%dil
jne    110f <_is_separator_char+0xf>
ret
cmp    $0x3a,%dil
sete   %al
ret

LLVM IR (-O0):
define zeroext i8 @_is_separator_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 44
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 59
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 58
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @_is_separator_char(i8 signext %0) {
switch i8 %0, label %2 [
i8 59, label %5
i8 44, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 58
%4 = zext i1 %3 to i8
br label %5
5: ; preds = %1, %1, %2
%6 = phi i8 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i8 %6
}
long double __attribute__((no)) fcmovnu(long flags) {
  long double out;
  asm("\n"
      "	push	%1"
      "\n"
      "	popf"
      "\n"
      "	fldpi"
      "\n"
      "	fld1"
      "\n"
      "	"
      "fcmovnu"
      " %%st(1), %%st"
      "\n"
      "	ffree	%%st(1)"
      "\n"
      : "=t"(out)
      : "r"(flags));
  return out;
}


x86 assembly (clang, -O0):
<fcmovnu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
push   %rax
popf
fldpi
fld1
fcmovnu %st(1),%st
ffree  %st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmovnu>:
push   %rdi
popf
fldpi
fld1
fcmovnu %st(1),%st
ffree  %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fcmovnu(i64 %0) {
%2 = alloca i64
%3 = alloca x86_fp80
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovnu %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @fcmovnu(i64 %0) {
%2 = tail call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovnu %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret x86_fp80 %2
}
void uprobe_simulate_nop(struct uprobe_probept *p, struct pt_regs *regs) {}


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

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

LLVM IR (-O0):
%struct.uprobe_probept = type opaque
%struct.pt_regs = type opaque
define void @uprobe_simulate_nop(%struct.uprobe_probept* %0, %struct.pt_regs* %1) {
%3 = alloca %struct.uprobe_probept*
%4 = alloca %struct.pt_regs*
store %struct.uprobe_probept* %0, %struct.uprobe_probept** %3
store %struct.pt_regs* %1, %struct.pt_regs** %4
ret void
}

LLVM IR (-O2):
%struct.uprobe_probept = type opaque
%struct.pt_regs = type opaque
define void @uprobe_simulate_nop(%struct.uprobe_probept* nocapture %0, %struct.pt_regs* nocapture %1) {
ret void
}
/* Variables and functions */
char lowercase(int);
bool is_binsym(int c) {
  if (lowercase(c) == 'b') {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_binsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <lowercase@plt>
movsbl %al,%eax
cmp    $0x62,%eax
jne    113b <is_binsym+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <is_binsym+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_binsym>:
push   %rax
call   1030 <lowercase@plt>
xor    %ecx,%ecx
cmp    $0x62,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_binsym(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call signext i8 @lowercase(i32 %4)
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 98
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_binsym(i32 %0) {
%2 = tail call signext i8 @lowercase(i32 %0)
%3 = icmp eq i8 %2, 98
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RAND_pseudo_bytes(void *, unsigned int);
void arc4rand(void *ptr, unsigned int len, int reseed) {
  (void)reseed;
  RAND_pseudo_bytes(ptr, len);
}


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

x86 assembly (clang, -O2):
<arc4rand>:
jmp    1030 <RAND_pseudo_bytes@plt>

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

LLVM IR (-O2):
define void @arc4rand(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @RAND_pseudo_bytes(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ae(int);
int /*<<< orphan*/ s(int, int);
void N(int j, int e) {
  ae(j + 131);
  s((e > -512 && e < 512) << 7 | 5, e);
}


x86 assembly (clang, -O0):
<N>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x83,%edi
call   1030 <ae@plt>
xor    %eax,%eax
cmpl   $0xfffffe00,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    115b <N+0x3b>
cmpl   $0x200,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
shl    $0x7,%edi
or     $0x5,%edi
mov    -0x8(%rbp),%esi
call   1040 <s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<N>:
push   %rbx
mov    %esi,%ebx
add    $0x83,%edi
call   1030 <ae@plt>
lea    0x1ff(%rbx),%eax
xor    %edi,%edi
cmp    $0x3ff,%eax
setb   %dil
shl    $0x7,%edi
or     $0x5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <s@plt>

LLVM IR (-O0):
define void @N(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 = add nsw i32 %5, 131
%7 = call i32 @ae(i32 %6)
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, -512
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 512
br label %13
13: ; preds = %10, %2
%14 = phi i1 [ false, %2 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = shl i32 %15, 7
%17 = or i32 %16, 5
%18 = load i32, i32* %4
%19 = call i32 @s(i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @N(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 131
%4 = tail call i32 @ae(i32 %3)
%5 = add i32 %1, 511
%6 = icmp ult i32 %5, 1023
%7 = select i1 %6, i32 133, i32 5
%8 = tail call i32 @s(i32 %7, i32 %1)
ret void
}
unsigned long div_round_up(unsigned long x, unsigned long y) {
  if (x % y == 0)
    return x / y;
  else
    return x / y + 1;
}


x86 assembly (clang, -O0):
<div_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    1137 <div_round_up+0x37>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    114b <div_round_up+0x4b>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_round_up>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <div_round_up+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <div_round_up+0x1a>
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
sbb    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @div_round_up(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp ne i64 %3, 0
%5 = udiv i64 %0, %1
%6 = zext i1 %4 to i64
%7 = add i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x5c() {
  Assert_real((isprint(92)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              465, ("isprint should be 1 for 0x5c"));
}


x86 assembly (clang, -O0):
<t_isprint_0x5c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5c,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1d1,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x5c>:
push   %rax
mov    $0x5c,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1d1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 1 for 0x5c\00"
define void @t_isprint_0x5c() {
%1 = call i32 @isprint(i32 92)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 1 for 0x5c\00"
define void @t_isprint_0x5c() {
%1 = tail call i32 @isprint(i32 92)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
struct s38 {
  char a[3];
  short b;
} f38(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f38>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <f38+0x4>

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

LLVM IR (-O0):
define i48 @f38() {
%1 = alloca i48
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i48 @f38() {
br label %1
1: ; preds = %0, %1
br label %1
}
double circumference(double r) { return 2.0 * 3.141592654 * r; }


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

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

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

LLVM IR (-O2):
define double @circumference(double %0) {
%2 = fmul double %0, 0x401921FB54524550
ret double %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int mostrarText(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int j;
  printf("\nLa longitud de la cadena es %d \n", mostrarText("Hola mon!!"));
  return (EXIT_SUCCESS);
}


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)
lea    0xee5(%rip),%rdi
call   1040 <mostrarText@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefa(%rip),%rdi
call   1040 <mostrarText@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"\0ALa longitud de la cadena es %d \0A\00"
@.str.1 = [11 x i8] c"Hola mon!!\00"
@EXIT_SUCCESS = global i32 0
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
%7 = call i32 @mostrarText(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0ALa longitud de la cadena es %d \0A\00"
@.str.1 = [11 x i8] c"Hola mon!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mostrarText(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int cmp2(unsigned long long x, int y) {
  return x == ((unsigned long long)y << 3);
}


x86 assembly (clang, -O0):
<cmp2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp2>:
movslq %esi,%rcx
shl    $0x3,%rcx
xor    %eax,%eax
cmp    %rdi,%rcx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @cmp2(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = shl nsw i64 %3, 3
%5 = icmp eq i64 %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct zero_ring_buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ zero_ring_buffer_used(struct zero_ring_buffer *);
bool zero_ring_buffer_empty(struct zero_ring_buffer *ring_buffer) {
  return zero_ring_buffer_used(ring_buffer) == 0;
}


x86 assembly (clang, -O0):
<zero_ring_buffer_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <zero_ring_buffer_used@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_ring_buffer_empty>:
push   %rax
call   1030 <zero_ring_buffer_used@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.zero_ring_buffer = type { i32 }
define i32 @zero_ring_buffer_empty(%struct.zero_ring_buffer* %0) {
%2 = alloca %struct.zero_ring_buffer*
store %struct.zero_ring_buffer* %0, %struct.zero_ring_buffer** %2
%3 = load %struct.zero_ring_buffer*, %struct.zero_ring_buffer** %2
%4 = call i64 @zero_ring_buffer_used(%struct.zero_ring_buffer* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.zero_ring_buffer = type { i32 }
define i32 @zero_ring_buffer_empty(%struct.zero_ring_buffer* %0) {
%2 = tail call i64 @zero_ring_buffer_used(%struct.zero_ring_buffer* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned log2p1(unsigned n) {
  unsigned x, l;
  for (l = 0, x = 1; x && x < n; l++)
    x <<= 1;
  return l;
}


x86 assembly (clang, -O0):
<log2p1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1130 <log2p1+0x30>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setb   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <log2p1+0x40>
jmp    1157 <log2p1+0x57>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <log2p1+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2p1>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111d <log2p1+0x1d>
mov    $0x1,%ecx
xor    %eax,%eax
xchg   %ax,%ax
add    %ecx,%ecx
add    $0x1,%eax
test   %ecx,%ecx
je     111d <log2p1+0x1d>
cmp    %edi,%ecx
jb     1110 <log2p1+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2p1(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = shl i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ne i32 %6, 0
%9 = icmp ult i32 %6, %0
%10 = and i1 %8, %9
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA1_Update(int /*<<< orphan*/ *, char const *, size_t);
int /*<<< orphan*/ hashlength(int /*<<< orphan*/ *, size_t);
size_t strlen(char const *);
void hashstring(SHA_CTX *sha, const char *string) {
  size_t l = strlen(string);
  hashlength(sha, l);
  SHA1_Update(sha, string, l);
}


x86 assembly (clang, -O0):
<hashstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <hashlength@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <SHA1_Update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashstring>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1050 <hashlength@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <SHA1_Update@plt>

LLVM IR (-O0):
define void @hashstring(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i64
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i32*, i32** %3
%9 = load i64, i64* %5
%10 = call i32 @hashlength(i32* %8, i64 %9)
%11 = load i32*, i32** %3
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i32 @SHA1_Update(i32* %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @hashstring(i32* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @hashlength(i32* %0, i64 %3)
%5 = tail call i32 @SHA1_Update(i32* %0, i8* %1, i64 %3)
ret void
}
int pRec2(int argc) { return (argc == 2); }


x86 assembly (clang, -O0):
<pRec2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pRec2>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @pRec2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @pRec2(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
void foo(int *a, char *b, char *c) { __builtin_memmove(c, b, a[b[0]]); }


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

x86 assembly (clang, -O2):
<foo>:
mov    %rdx,%rax
movsbq (%rsi),%rcx
movslq (%rdi,%rcx,4),%rdx
mov    %rax,%rdi
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = load i8, i8* %1
%5 = sext i8 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 %1, i64 %8, i1 false)
ret void
}
int do_422() { return 422; }


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

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

LLVM IR (-O0):
define i32 @do_422() {
ret i32 422
}

LLVM IR (-O2):
define i32 @do_422() {
ret i32 422
}
/* Type definitions */
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_family;
};

/* Variables and functions */
int /*<<< orphan*/ PF_INET6;
main() {
  struct sockaddr_in6 sa;
  sa.sin6_family = PF_INET6;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
@PF_INET6 = global i32 0
define i32 @main() {
%1 = alloca %struct.sockaddr_in6
%2 = load i32, i32* @PF_INET6
%3 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %1, i32 0, i32 0
store i32 %2, i32* %3
ret i32 0
}

LLVM IR (-O2):
@PF_INET6 = global i32 0
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
__attribute__((const)) uint16_t av_clip_uint16(int a) {
  if (a & (~65535))
    return (-a) >> 31;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clip_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
cmp    $0x0,%eax
je     1128 <av_clip_uint16+0x28>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <av_clip_uint16+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clip_uint16>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
neg    %eax
cmp    $0x10000,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @av_clip_uint16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -65536
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 0, %8
%10 = ashr i32 %9, 31
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @av_clip_uint16(i32 %0) {
%2 = icmp ult i32 %0, 65536
%3 = icmp sgt i32 %0, 0
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 %0, i32 %4
ret i32 %5
}
void wpalTraceDisplay(void) {}


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

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

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

LLVM IR (-O2):
define void @wpalTraceDisplay() {
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_embedded_null() {
  if (strcasecmp("ab\0zz", "ab\0yy") != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcasecmp_embedded_null>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1131 <strcasecmp_embedded_null+0x21>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ab\00zz\00"
@.str.1 = [6 x i8] c"ab\00yy\00"
define void @strcasecmp_embedded_null() {
%1 = call i64 @strcasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = load i8, i8* null
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @strcasecmp_embedded_null() {
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFCHR;
int S_IFMT;
scalar_t__ stat(char *, struct stat *);
int checkstdin(void) {
  struct stat sb;
  if (stat("/dev/stdin", &sb) < 0)
    return -1;
  if ((sb.st_mode & S_IFMT) == S_IFCHR)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<checkstdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113e <checkstdin+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <checkstdin+0x5c>
mov    -0x8(%rbp),%eax
mov    0x2e98(%rip),%rcx
and    (%rcx),%eax
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%eax
jne    1165 <checkstdin+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <checkstdin+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkstdin>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1143 <checkstdin+0x33>
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
and    (%rsp),%ecx
mov    0x2ea0(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
sete   %al
neg    %eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [11 x i8] c"/dev/stdin\00"
@S_IFMT = global i32 0
@S_IFCHR = global i32 0
define i32 @checkstdin() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = call i64 @stat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %15
6: ; preds = %0
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFMT
%10 = and i32 %8, %9
%11 = load i32, i32* @S_IFCHR
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %6
store i32 -1, i32* %1
br label %15
14: ; preds = %6
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13, %5
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [11 x i8] c"/dev/stdin\00"
@S_IFMT = global i32 0
@S_IFCHR = global i32 0
define i32 @checkstdin() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @stat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IFMT
%9 = and i32 %8, %7
%10 = load i32, i32* @S_IFCHR
%11 = icmp eq i32 %9, %10
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %5, %0
%14 = phi i32 [ -1, %0 ], [ %12, %5 ]
ret i32 %14
}